同步生成收款单接口

This commit is contained in:
username 2024-07-31 15:27:38 +08:00
parent 29a0b03f14
commit 0495fda264
4 changed files with 302 additions and 36 deletions

View File

@ -58,7 +58,7 @@ public class BipUtil {
}
return null;
}
public static String sendOaToDj(String parm, String apiCode){
public static String sendOaToU8c(String parm, String apiCode){
String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface";
System.out.println("推送参数"+parm);
String result = HttpRequest.post(baseUrl)

View File

@ -3,15 +3,168 @@ package com.hzya.frame.seeyon.receiptFor.entity;
import com.hzya.frame.web.entity.BaseEntity;
public class ReceiptForEntity extends BaseEntity {
private String dfybje;
private String djrq;
private String djrq;//field0003单据日期合同申请日期
private String dwbm;
private String hbbm;
private String hbbm;//field0090客商客商编码客商档案
private String lrr;
private String shr;
private String shrq;
private String state;
private String djbh;//field0001单据号
private Long wldx;//field0004往来对象
private String deptid;//field0091部门部门档案部门编码
private String ywybm;//field0092业务员人员档案业务员编码
private String bfyhzh;//field0060收款银行账号客户方账号
private String skyhmc;//field0062收款银行名称客户方开户行
private String dfyhzh;//field0014付款银行账号我方账号
private String fkyhmc;//field0051付款银行名称我方开户行
private String bzbm;//field0072币种默认CNY币种编码
private String dfbbje;
private String dfybje;
private String ddh;
private String bbhl;
private String contractno;
public String getDfbbje() {
return dfbbje;
}
public void setDfbbje(String dfbbje) {
this.dfbbje = dfbbje;
}
public String getDdh() {
return ddh;
}
public void setDdh(String ddh) {
this.ddh = ddh;
}
public String getBbhl() {
return bbhl;
}
public void setBbhl(String bbhl) {
this.bbhl = bbhl;
}
public String getContractno() {
return contractno;
}
public void setContractno(String contractno) {
this.contractno = contractno;
}
private String fph;//field0019发票号
private String zy;//field0059摘要
private String bzbm_code;//field0073币种编码
public String getFph() {
return fph;
}
public void setFph(String fph) {
this.fph = fph;
}
public String getZy() {
return zy;
}
public void setZy(String zy) {
this.zy = zy;
}
public String getBzbm_code() {
return bzbm_code;
}
public void setBzbm_code(String bzbm_code) {
this.bzbm_code = bzbm_code;
}
public String getDjbh() {
return djbh;
}
public void setDjbh(String djbh) {
this.djbh = djbh;
}
public Long getWldx() {
return wldx;
}
public void setWldx(Long wldx) {
this.wldx = wldx;
}
public String getDeptid() {
return deptid;
}
public void setDeptid(String deptid) {
this.deptid = deptid;
}
public String getYwybm() {
return ywybm;
}
public void setYwybm(String ywybm) {
this.ywybm = ywybm;
}
public String getBfyhzh() {
return bfyhzh;
}
public void setBfyhzh(String bfyhzh) {
this.bfyhzh = bfyhzh;
}
public String getSkyhmc() {
return skyhmc;
}
public void setSkyhmc(String skyhmc) {
this.skyhmc = skyhmc;
}
public String getDfyhzh() {
return dfyhzh;
}
public void setDfyhzh(String dfyhzh) {
this.dfyhzh = dfyhzh;
}
public String getFkyhmc() {
return fkyhmc;
}
public void setFkyhmc(String fkyhmc) {
this.fkyhmc = fkyhmc;
}
public String getBzbm() {
return bzbm;
}
public void setBzbm(String bzbm) {
this.bzbm = bzbm;
}
public String getState() {
return state;

View File

@ -13,6 +13,20 @@
<result property="shr" column="r_shr" jdbcType="VARCHAR"/>
<result property="shrq" column="r_shrq" jdbcType="VARCHAR"/>
<result property="djbh" column="r_djbh" jdbcType="VARCHAR"/>
<result property="wldx" column="r_wldx" jdbcType="INTEGER"/>
<result property="deptid" column="r_deptid" jdbcType="VARCHAR"/>
<result property="ywybm" column="r_ywybm" jdbcType="VARCHAR"/>
<result property="bfyhzh" column="r_bfyhzh" jdbcType="VARCHAR"/>
<result property="skyhmc" column="r_skyhmc" jdbcType="VARCHAR"/>
<result property="dfyhzh" column="r_dfyhzh" jdbcType="VARCHAR"/>
<result property="fkyhmc" column="r_fkyhmc" jdbcType="VARCHAR"/>
<result property="bzbm" column="r_bzbm" jdbcType="VARCHAR"/>
<result property="fph" column="r_fph" jdbcType="VARCHAR"/>
<result property="zy" column="r_zy" jdbcType="VARCHAR"/>
<result property="bzbm_code" column="r_bzbm_code" jdbcType="VARCHAR"/>
<result property="dfbbje" column="r_dfbbje" jdbcType="VARCHAR"/>
</resultMap>
<!-- <select id="ReceiptForEntity_list_base" resultMap="get-ReceiptForEntity-result" parameterType="com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity">-->
@ -25,30 +39,61 @@
<!-- '17633965916' as r_shr,-->
<!-- '2024-07-23' as r_shrq-->
<!-- from formmain_0045-->
<!-- </select>-->
<!-- <select id="ReceiptForEntity_list_base" resultMap="get-ReceiptForEntity-result" parameterType="com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity">-->
<!-- select-->
<!-- id,-->
<!-- '1' as r_dfybje,-->
<!-- '2024-07-23' as r_djrq,-->
<!-- '001' as r_dwbm,-->
<!-- field0090 as r_hbbm,-->
<!-- field0092 as r_lrr,-->
<!-- field0094 as r_shr,-->
<!-- '2024-07-23' as r_shrq-->
<!-- from formmain_0045-->
<!-- where field0089 = 'N'-->
<!-- <trim>-->
<!-- <if test="id !=null and id!=''">and id like concat('%',#{id},'%')</if>-->
<!-- </trim>-->
<!-- </select>-->
<select id="ReceiptForEntity_list_base" resultMap="get-ReceiptForEntity-result" parameterType="com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity">
select
id,
'1' as r_dfybje,
'2024-07-23' as r_djrq,
'001' as r_dwbm,
'C000001' as r_hbbm,
'17633965916' as r_lrr,
'17633965916' as r_shr,
'2024-07-23' as r_shrq
field0003 as r_djrq,
field0003 as r_shrq,
field0047 as r_dwbm,
field0090 as r_hbbm,
field0092 as r_lrr,
field0092 as r_shr,
field0013 as r_dfbbje,
field0011 as r_dfybje,
field0019 as r_fph,
field0059 as r_zy,
field0073 as r_bzbm_code,
field0001 as r_djbh,
field0004 as r_wldx,
field0091 as r_deptid,
field0060 as r_bfyhzh,
field0062 as r_skyhmc,
field0014 as r_dfyhzh,
field0051 as r_fkyhmc,
field0073 as r_bzbm,
field0092 as r_ywybm
from formmain_0045
where sts = 'N'
<trim>
<if test="id !=null and id!=''">and id like concat('%',#{id},'%')</if>
</trim>
where field0089 = 'N'
<trim>
<if test="id !=null and id!=''">and id like concat('%',#{id},'%')</if>
</trim>
</select>
<!-- ReceiptForEntity_update_state-->
<!--通过主键修改方法-->
<update id="ReceiptForEntity_update_state" parameterType = "com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity" >
update formmain_0045 set state = #{state} where id = #{id}
update formmain_0045 set field0089 = #{state} where id = #{id}
</update>

View File

@ -66,12 +66,11 @@ public class ReceiptForServiceImpl extends BaseService<ReceiptForEntity,String>
JSONObject main = bindingAdd(rec);
logger.info("收款认领单推送数据:"+main.toString());
String result = BipUtil.sendOaToDj(main.toString(),"8000350034");
String result = BipUtil.sendOaToU8c(main.toString(),"8000350034");
logger.info("收款认领单推送结果:"+result);
IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity();
logDetails.setRootAppPk(rec.getId());
//logDetails.setRootAppBill();
//不知道源系统单据是什么所以先注释掉了
logDetails.setRootAppBill(rec.getDjbh());
logDetails.setNewTransmitInfo(result);
logDetails.setNewPushDate(new Date());
logDetails.setRootAppNewData(JSON.toJSONString(rec));
@ -81,17 +80,16 @@ public class ReceiptForServiceImpl extends BaseService<ReceiptForEntity,String>
boolean flag = resultObj.get("status").equals("success");
if(flag){
// 推送成功更新状态
rec.setState("1");
rec.setState("Y");
}else{
// 推送失败
rec.setState("0");
rec.setState("N");
}
rec.setDataSourceCode(requestJson.getString("db_code"));
try{
if(StrUtil.isEmpty(interId)){
if(flag){
//首推成功
//由于字段匹配问题logDetails中没设置单据号因此会保存失败
taskLivingDetailsService.saveLogToSuccess(logDetails);
}else{
//首推失败
@ -124,29 +122,99 @@ public class ReceiptForServiceImpl extends BaseService<ReceiptForEntity,String>
return new JsonResultEntity("成功",true,resultEntity);
}
// @NotNull
// private JSONObject bindingAdd(ReceiptForEntity rec) {
// String djrq = rec.getDjrq().substring(0,10);
// if(djrq.length()>10){
// djrq = rec.getDjrq().substring(0,10);
// }
// String shrq = rec.getShrq().substring(0,10);
// if(shrq.length()>10){
// shrq = rec.getShrq().substring(0,10);
// }
//
// JSONObject childrenJson = new JSONObject();
// childrenJson.put("dfybje",rec.getDfybje());
//
// childrenJson.put("dfbbje","24");
// childrenJson.put("dfybje","12");
// childrenJson.put("ddh","1231231");
// childrenJson.put("fph","fph12312");
// childrenJson.put("zy","zy");
// childrenJson.put("bzbm_code","CNY");
// childrenJson.put("bbhl","2");
// childrenJson.put("contractno","hth123123");
//
//
// JSONArray childrenArray = new JSONArray();
// childrenArray.add(childrenJson);
//
// JSONObject parentvo = new JSONObject();
// parentvo.put("djrq",djrq);
// parentvo.put("dwbm",rec.getDwbm());
// parentvo.put("hbbm",rec.getHbbm());
// parentvo.put("lrr",rec.getLrr());
// parentvo.put("shr",rec.getShr());
// parentvo.put("shrq",shrq);
//
// JSONObject billvoJson = new JSONObject();
// billvoJson.put("children",childrenArray);
// billvoJson.put("parentvo",parentvo);
//
// JSONArray billvoArray = new JSONArray();
// billvoArray.add(billvoJson);
// JSONObject main = new JSONObject();
// main.put("billvo",billvoArray);
// return main;
// }
@NotNull
private JSONObject bindingAdd(ReceiptForEntity rec) {
String djrq = rec.getDjrq().substring(0,10);
if(djrq.length()>19){
djrq = rec.getDjrq().substring(0,10);
}
String shrq = rec.getShrq().substring(0,10);
if(shrq.length()>19){
shrq = rec.getShrq().substring(0,10);
}
// if(rec.getDjrq()!=null){
// String djrq = rec.getDjrq().substring(0,10);
// if(djrq.length()>10){
// djrq = rec.getDjrq().substring(0,10);
// }
// }
// if(rec.getShrq()!=null){
// String shrq = rec.getShrq().substring(0,10);
// if(shrq.length()>10){
// shrq = rec.getShrq().substring(0,10);
// }
// }
JSONObject childrenJson = new JSONObject();
childrenJson.put("dfybje",rec.getDfybje());
//childrenJson.put("dfbbje",rec.getDfbbje());
childrenJson.put("ddh",rec.getDdh());
childrenJson.put("fph",rec.getFph());
childrenJson.put("zy",rec.getZy());
childrenJson.put("bzbm_code",rec.getBzbm_code());
childrenJson.put("bbhl",rec.getBbhl());
childrenJson.put("contractno",rec.getContractno());
JSONObject dfybjeJson = new JSONObject();
dfybjeJson.put("dfybje",rec.getDfybje());
JSONArray childrenArray = new JSONArray();
childrenArray.add(dfybjeJson);
childrenArray.add(childrenJson);
JSONObject parentvo = new JSONObject();
parentvo.put("djrq",djrq);
parentvo.put("djrq",rec.getDjrq().substring(0,10));
parentvo.put("dwbm",rec.getDwbm());
parentvo.put("hbbm",rec.getHbbm());
parentvo.put("lrr",rec.getLrr());
parentvo.put("shr",rec.getShr());
parentvo.put("shrq",shrq);
parentvo.put("shrq",rec.getShrq().substring(0,10));
parentvo.put("djbh",rec.getDjbh());
//parentvo.put("wldx",rec.getWldx());
parentvo.put("deptid",rec.getDeptid());
//parentvo.put("ywybm",rec.getYwybm());
//parentvo.put("bfyhzh",rec.getBfyhzh());
parentvo.put("skyhmc",rec.getSkyhmc());
//parentvo.put("dfyhzh",rec.getDfyhzh());
parentvo.put("fkyhmc",rec.getFkyhmc());
parentvo.put("bzbm",rec.getBzbm());
JSONObject billvoJson = new JSONObject();
billvoJson.put("children",childrenArray);