diff --git a/WebContent/WEB-INF/etc/jbo/jbo_lease.xml b/WebContent/WEB-INF/etc/jbo/jbo_lease.xml index 017a9d945..0a6ed964a 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_lease.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_lease.xml @@ -4168,7 +4168,7 @@ - + @@ -4177,6 +4177,7 @@ + diff --git a/src_core/com/tenwa/voucher/serviceImp/CustomerServiceImpl.java b/src_core/com/tenwa/voucher/serviceImp/CustomerServiceImpl.java index 770498c8b..217f278c0 100644 --- a/src_core/com/tenwa/voucher/serviceImp/CustomerServiceImpl.java +++ b/src_core/com/tenwa/voucher/serviceImp/CustomerServiceImpl.java @@ -2,21 +2,16 @@ package com.tenwa.voucher.serviceImp; import java.util.List; import java.util.Map; -import com.amarsoft.are.jbo.BizObject; -import com.amarsoft.are.jbo.BizObjectManager; -import com.amarsoft.are.jbo.JBOException; + +import org.junit.Test; + import com.amarsoft.are.jbo.JBOFactory; import com.amarsoft.are.jbo.JBOTransaction; -import com.amarsoft.awe.Configure; -import com.amarsoft.awe.util.ASResultSet; -import com.amarsoft.awe.util.SqlObject; -import com.amarsoft.awe.util.Transaction; import com.amarsoft.are.util.StringFunction; import com.amarsoft.awe.util.Transaction; import com.amarsoft.dict.als.cache.CacheLoaderFactory; import com.tenwa.comm.util.jboutil.DataOperatorUtil; import com.tenwa.voucher.service.CustomerService; -import com.tenwa.voucher.service.ReturnMessage; /** * ڲͬӿ @@ -24,7 +19,7 @@ import com.tenwa.voucher.service.ReturnMessage; */ public class CustomerServiceImpl implements CustomerService{ - public String Customer_syn(String CUST_ID,String CUST_NAME, String CUST_NO,String CUST_TYPE){ + public String Customer_syn(String CUST_ID,String CUST_NAME, String CUST_NO,String CUST_STATUS){ // ȡǰϵͳʱ String startime = StringFunction.getTodayNow(); // @@ -33,41 +28,38 @@ public class CustomerServiceImpl implements CustomerService{ String sql1=""; String insertSql1=""; String insertSql2=""; - Transaction Sqlca =null; JBOTransaction tx = null; + Transaction Sqlca =null; try { - tx =JBOFactory.createJBOTransaction(); -// Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());JBOFactory.createJBOTransaction() - Sqlca = Transaction.createTransaction(tx); + //tx =JBOFactory.createJBOTransaction(); + Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource()); + //Sqlca = Transaction.createTransaction(tx); // жϲǷΪ, ΪϢ if(CUST_ID==null || CUST_ID=="" || CUST_ID.length()<=0){ return "ʧܣ̱벻Ϊ !"; }else if (CUST_NAME==null || CUST_NAME=="" || CUST_NAME.length()<=0){ return "ʧܣƲΪ !"; - }else if(CUST_NO==null || CUST_NO=="" || CUST_NO.length()<=0){ - return "ʧܣ˰ʶŲΪ !"; - }else if(CUST_TYPE==null || CUST_TYPE=="" || CUST_TYPE.length()<=0){ - return "ʧܣּʶΪ !"; + //}else if(CUST_NO==null || CUST_NO=="" || CUST_NO.length()<=0){ + // return "ʧܣ˰ʶŲΪ !"; + }else if(CUST_STATUS==null || CUST_STATUS=="" || CUST_STATUS.length()<=0){ + return "ʧܣʶΪ !"; } - System.out.println(1111111); + // ִsql, ڻȡݼж or ޸IJ - sql1="SELECT cust_id,cust_name FROM CUSTOMER_LIST CL WHERE (CUST_ID ='111' OR CUST_NAME ='1111') "; - System.out.println(1112222); + sql1="SELECT cust_id,cust_name FROM CUSTOMER_LIST CL WHERE (CUST_ID ='"+CUST_ID+"' OR CUST_NAME ='"+CUST_NAME+"') "; List> list = DataOperatorUtil.getDataBySql(Sqlca, sql1, null); - System.out.println(22222); - // Ϊ ˵ǰϵͳƥ, Ҫ - if(list.size()==0 || list == null) { - insertSql1="INSERT INTO CUSTOMER_LIST(cust_id,cust_name,cust_no,cust_type,inputuserid,inputorgid,inputtime,updateuserid,updateorgid,updatetime) VALUES('"+CUST_ID+"','"+CUST_NAME+"','"+CUST_NO+"','"+CUST_TYPE+"','administrator','8009001','"+startime+"','administrator','8009001','"+startime+"')"; + + // ״̬ΪдI, Ҳѯlistûв鵽, һϢ + if("I".equals(CUST_STATUS) && (list.size()==0 || list == null)) { + insertSql1="INSERT INTO CUSTOMER_LIST(cust_id,cust_name,cust_no,cust_type,inputuserid,inputorgid,inputtime,updateuserid,updateorgid,updatetime) VALUES('"+CUST_ID+"','"+CUST_NAME+"','"+CUST_NO+"',NULL,'administrator','8009001','"+startime+"','administrator','8009001','"+startime+"')"; Sqlca.executeSQL(insertSql1); - System.out.println(3333333); - // , ˵Ҫ, Ҫµݲ־, - }else if(list != null || list.size() >0) { + // ״̬ΪдU, Ҳѯ, һҪݵ¼ + }else if("U".equals(CUST_STATUS) && (list != null || list.size() >0)) { String OLD_CUST_ID = list.get(0).get("cust_id"); String OLD_CUST_NAME = list.get(0).get("cust_name"); - insertSql2="INSERT INTO customer_log(ID,CUST_NO,CUST_TYPE,OLD_CUST_ID,OLD_CUST_NAME,NEW_CUST_ID,NEW_CUST_NAME,RECORD_DATE) VALUES(REPLACE(UUID(), '-', ''),'"+CUST_NO+"','"+CUST_TYPE+"','"+OLD_CUST_ID+"','"+OLD_CUST_NAME+"','"+CUST_ID+"','"+CUST_NAME+"','"+startime+"')"; + insertSql2="INSERT INTO customer_log(ID,CUST_NO,CUST_TYPE,OLD_CUST_ID,OLD_CUST_NAME,NEW_CUST_ID,NEW_CUST_NAME,RECORD_DATE) VALUES(REPLACE(UUID(), '-', ''),'"+CUST_NO+"',NULL,'"+OLD_CUST_ID+"','"+OLD_CUST_NAME+"','"+CUST_ID+"','"+CUST_NAME+"','"+startime+"')"; Sqlca.executeSQL(insertSql2); - System.out.println(4444444); } Sqlca.commit(); } catch (Exception e) {