凭证接口

This commit is contained in:
xiezhiwen 2018-12-21 18:31:26 +08:00
parent b188b1bc72
commit 1def8d3cb7
2 changed files with 23 additions and 30 deletions

View File

@ -4168,7 +4168,7 @@
</managerProperties>
</manager>
</class>
<class name="LB_DISCOUNT" label="" keyAttributes="ID">
<class name="LB_DISCOUNT" label="贴息导入" keyAttributes="ID">
<attributes>
<attribute name="ID" label="标识" type="STRING" length="64"/>
<attribute name="CONTRACT_NO" label="合同编号" type="STRING" length="64"/>
@ -4177,6 +4177,7 @@
<attribute name="CAR_BRAND" label="品牌" type="STRING" length="64"/>
<attribute name="FRAME_NUMBER" label="车架号" type="STRING" length="64"/>
<attribute name="DISCOUNT_MONEY" label="贴息金额" type="STRING" length="64"/>
<attribute name="RECEIVED_DATE" label="到账日期" type="STRING" length="64"/>
<attribute name="FIELD1" label="FIELD1" type="STRING" length="64"/>
<attribute name="FIELD2" label="FIELD2" type="STRING" length="64"/>
<attribute name="FIELD3" label="FIELD3" type="STRING" length="64"/>

View File

@ -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 修改操作
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<Map<String, String>> 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) {