销售合同新增
This commit is contained in:
parent
a6a85ecca4
commit
9f86196f06
|
@ -743,7 +743,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
map1.put("tableName",mainDb);
|
||||
//map1.put("dataStatus", "F");
|
||||
map1.put("updateStatus", "0");
|
||||
map1.put("size", 50);
|
||||
//map1.put("size", 50);
|
||||
objects = mdmModuleDao.queryMdmSTs(map1);
|
||||
objects = toLowerCaseKeys(objects);
|
||||
|
||||
|
@ -937,7 +937,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
map1.put("tableName",mainDb);
|
||||
//map1.put("dataStatus", "Y");
|
||||
map1.put("addStatus", "0");
|
||||
map1.put("size", 50);
|
||||
//map1.put("size", 50);
|
||||
objects = mdmModuleDao.queryMdmSTs(map1);
|
||||
objects = toLowerCaseKeys(objects);
|
||||
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
WHERE 1=1
|
||||
and CTP_AFFAIR.node_policy = '审计完成' AND CTP_AFFAIR.complete_time is not null
|
||||
and CTP_AFFAIR.state = '4' and CTP_AFFAIR.sub_state = '0' and field0427 is null
|
||||
and rownum < 100 and field0274 in ('浙S-QZWLJS2402YXZ001-05','浙S-QZWLJS2402YXZ001-04','浙D-NB2412TH15001')
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
</trim>
|
||||
|
@ -82,7 +83,8 @@
|
|||
LEFT JOIN org_member m4 ON m4.id=field0081
|
||||
WHERE 1=1
|
||||
and CTP_AFFAIR.node_policy = '归档' AND CTP_AFFAIR.complete_time is not null
|
||||
and CTP_AFFAIR.state = '4' and CTP_AFFAIR.sub_state = '0' and field0425 is null and formmain_0219.id='4000079310249084585'
|
||||
and CTP_AFFAIR.state = '4' and CTP_AFFAIR.sub_state = '0' and field0425 is null
|
||||
and rownum < 100 and field0274 in ('浙S-QZWLJS2402YXZ001-05','浙S-QZWLJS2402YXZ001-04','浙D-NB2412TH15001')
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
</trim>
|
||||
|
|
|
@ -110,7 +110,7 @@ public class ProjectMainFlowArchivistPluginInitializer extends PluginBaseEntity
|
|||
//发送数据
|
||||
String result = HttpRequest.post(url).
|
||||
header("appId", "800050").
|
||||
header("apiCode", "8000500016").
|
||||
header("apiCode", "8000500011").
|
||||
header("access_token", tokenBody).
|
||||
header("publicKey", "ZJYAQ/VtQ66PqKXlV0EowrrlKkhBHYgS/Zk39Q5ezIQne51Ce7eDIk+3zDUT+v578prj").
|
||||
header("secretKey", "iLLk424Bmzknbu+ROeJoiVDMYY5EFXtbZY/aU13HmVYIiQrIw9c0Ag4ipxbfpUqqj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=").
|
||||
|
|
|
@ -111,7 +111,7 @@ public class ProjectMainFlowAuditPluginInitializer extends PluginBaseEntity {
|
|||
//发送数据
|
||||
String result = HttpRequest.post(url).
|
||||
header("appId", "800050").
|
||||
header("apiCode", "8000500016").
|
||||
header("apiCode", "8000500011").
|
||||
header("access_token", tokenBody).
|
||||
header("publicKey", "ZJYAQ/VtQ66PqKXlV0EowrrlKkhBHYgS/Zk39Q5ezIQne51Ce7eDIk+3zDUT+v578prj").
|
||||
header("secretKey", "iLLk424Bmzknbu+ROeJoiVDMYY5EFXtbZY/aU13HmVYIiQrIw9c0Ag4ipxbfpUqqj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=").
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
package com.hzya.frame.plugin.salesContract.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.plugin.salesContract.entity.SalesContractEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ISalesContractDao extends IBaseDao<SalesContractEntity,String> {
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 查询未推送的销售合同
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2025-04-03 11:07
|
||||
* **/
|
||||
List<SalesContractEntity> querySalesContract(SalesContractEntity salesContractEntity);
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 更新销售合同的推送标识
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2025-04-03 11:09
|
||||
* **/
|
||||
Integer updateSalesContract(SalesContractEntity entity);
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.hzya.frame.plugin.salesContract.dao.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.plugin.salesContract.dao.ISalesContractDao;
|
||||
import com.hzya.frame.plugin.salesContract.entity.SalesContractEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SalesContractDaoImpl extends MybatisGenericDao<SalesContractEntity,String> implements ISalesContractDao {
|
||||
@DS("#entity.dataSourceCode")
|
||||
@Override
|
||||
public List<SalesContractEntity> querySalesContract(SalesContractEntity entity) {
|
||||
return (List<SalesContractEntity>) super.selectList("querySalesContract",entity);
|
||||
}
|
||||
|
||||
@DS("#entity.dataSourceCode")
|
||||
@Override
|
||||
public Integer updateSalesContract(SalesContractEntity entity) {
|
||||
return super.update("updateSalesContract",entity);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,249 @@
|
|||
package com.hzya.frame.plugin.salesContract.entity;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
public class SalesContractEntity extends BaseEntity {
|
||||
private String pk_group;//集团编码
|
||||
private String pk_org;//公司编码
|
||||
private String contractno;//合同号
|
||||
private String contractName;//合同名称
|
||||
private String creator;//创建人用户
|
||||
private String creationtime;//创建时间
|
||||
private String contractor;//订单负责人名称
|
||||
private String cdeptid;//事业部
|
||||
private String approvestatus;//审批状态默认-1
|
||||
private String belongtodeptid;//单据归属部门
|
||||
private String dpk_custclass;//合同对应客户大类
|
||||
private String dcustomerid;//合同对应客户大类
|
||||
private String zcustomerid;//
|
||||
private String cinvoicecustid;//开票客户名称
|
||||
private String cemployeeid;//业务人员
|
||||
private String ccurrencyid;//币种
|
||||
private String totalamount;//原币总金额
|
||||
private String rmbtotalamount;//人民币总金额
|
||||
private String presentrate;//汇率 CPO汇率
|
||||
private String def13;//IPO合同号
|
||||
private String def16;//IPO汇率
|
||||
private String def8;//贸易方式
|
||||
private String def27;//IPO币种
|
||||
private String def17;//收款账期
|
||||
private String def18;//账簿本币金额
|
||||
private String def26;//当前账簿兑人民币汇率
|
||||
private String pushStatus;//推送标识
|
||||
|
||||
public String getPushStatus() {
|
||||
return pushStatus;
|
||||
}
|
||||
|
||||
public void setPushStatus(String pushStatus) {
|
||||
this.pushStatus = pushStatus;
|
||||
}
|
||||
|
||||
public String getPk_group() {
|
||||
return pk_group;
|
||||
}
|
||||
|
||||
public void setPk_group(String pk_group) {
|
||||
this.pk_group = pk_group;
|
||||
}
|
||||
|
||||
public String getPk_org() {
|
||||
return pk_org;
|
||||
}
|
||||
|
||||
public void setPk_org(String pk_org) {
|
||||
this.pk_org = pk_org;
|
||||
}
|
||||
|
||||
public String getContractno() {
|
||||
return contractno;
|
||||
}
|
||||
|
||||
public void setContractno(String contractno) {
|
||||
this.contractno = contractno;
|
||||
}
|
||||
|
||||
public String getContractName() {
|
||||
return contractName;
|
||||
}
|
||||
|
||||
public void setContractName(String contractName) {
|
||||
this.contractName = contractName;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator;
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getCreationtime() {
|
||||
return creationtime;
|
||||
}
|
||||
|
||||
public void setCreationtime(String creationtime) {
|
||||
this.creationtime = creationtime;
|
||||
}
|
||||
|
||||
public String getContractor() {
|
||||
return contractor;
|
||||
}
|
||||
|
||||
public void setContractor(String contractor) {
|
||||
this.contractor = contractor;
|
||||
}
|
||||
|
||||
public String getCdeptid() {
|
||||
return cdeptid;
|
||||
}
|
||||
|
||||
public void setCdeptid(String cdeptid) {
|
||||
this.cdeptid = cdeptid;
|
||||
}
|
||||
|
||||
public String getApprovestatus() {
|
||||
return approvestatus;
|
||||
}
|
||||
|
||||
public void setApprovestatus(String approvestatus) {
|
||||
this.approvestatus = approvestatus;
|
||||
}
|
||||
|
||||
public String getBelongtodeptid() {
|
||||
return belongtodeptid;
|
||||
}
|
||||
|
||||
public void setBelongtodeptid(String belongtodeptid) {
|
||||
this.belongtodeptid = belongtodeptid;
|
||||
}
|
||||
|
||||
public String getDpk_custclass() {
|
||||
return dpk_custclass;
|
||||
}
|
||||
|
||||
public void setDpk_custclass(String dpk_custclass) {
|
||||
this.dpk_custclass = dpk_custclass;
|
||||
}
|
||||
|
||||
public String getDcustomerid() {
|
||||
return dcustomerid;
|
||||
}
|
||||
|
||||
public void setDcustomerid(String dcustomerid) {
|
||||
this.dcustomerid = dcustomerid;
|
||||
}
|
||||
|
||||
public String getZcustomerid() {
|
||||
return zcustomerid;
|
||||
}
|
||||
|
||||
public void setZcustomerid(String zcustomerid) {
|
||||
this.zcustomerid = zcustomerid;
|
||||
}
|
||||
|
||||
public String getCinvoicecustid() {
|
||||
return cinvoicecustid;
|
||||
}
|
||||
|
||||
public void setCinvoicecustid(String cinvoicecustid) {
|
||||
this.cinvoicecustid = cinvoicecustid;
|
||||
}
|
||||
|
||||
public String getCemployeeid() {
|
||||
return cemployeeid;
|
||||
}
|
||||
|
||||
public void setCemployeeid(String cemployeeid) {
|
||||
this.cemployeeid = cemployeeid;
|
||||
}
|
||||
|
||||
public String getCcurrencyid() {
|
||||
return ccurrencyid;
|
||||
}
|
||||
|
||||
public void setCcurrencyid(String ccurrencyid) {
|
||||
this.ccurrencyid = ccurrencyid;
|
||||
}
|
||||
|
||||
public String getTotalamount() {
|
||||
return totalamount;
|
||||
}
|
||||
|
||||
public void setTotalamount(String totalamount) {
|
||||
this.totalamount = totalamount;
|
||||
}
|
||||
|
||||
public String getRmbtotalamount() {
|
||||
return rmbtotalamount;
|
||||
}
|
||||
|
||||
public void setRmbtotalamount(String rmbtotalamount) {
|
||||
this.rmbtotalamount = rmbtotalamount;
|
||||
}
|
||||
|
||||
public String getPresentrate() {
|
||||
return presentrate;
|
||||
}
|
||||
|
||||
public void setPresentrate(String presentrate) {
|
||||
this.presentrate = presentrate;
|
||||
}
|
||||
|
||||
public String getDef13() {
|
||||
return def13;
|
||||
}
|
||||
|
||||
public void setDef13(String def13) {
|
||||
this.def13 = def13;
|
||||
}
|
||||
|
||||
public String getDef16() {
|
||||
return def16;
|
||||
}
|
||||
|
||||
public void setDef16(String def16) {
|
||||
this.def16 = def16;
|
||||
}
|
||||
|
||||
public String getDef8() {
|
||||
return def8;
|
||||
}
|
||||
|
||||
public void setDef8(String def8) {
|
||||
this.def8 = def8;
|
||||
}
|
||||
|
||||
public String getDef27() {
|
||||
return def27;
|
||||
}
|
||||
|
||||
public void setDef27(String def27) {
|
||||
this.def27 = def27;
|
||||
}
|
||||
|
||||
public String getDef17() {
|
||||
return def17;
|
||||
}
|
||||
|
||||
public void setDef17(String def17) {
|
||||
this.def17 = def17;
|
||||
}
|
||||
|
||||
public String getDef18() {
|
||||
return def18;
|
||||
}
|
||||
|
||||
public void setDef18(String def18) {
|
||||
this.def18 = def18;
|
||||
}
|
||||
|
||||
public String getDef26() {
|
||||
return def26;
|
||||
}
|
||||
|
||||
public void setDef26(String def26) {
|
||||
this.def26 = def26;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hzya.frame.plugin.salesContract.dao.impl.SalesContractDaoImpl">
|
||||
<resultMap id="get-SalesContractEntity-result" type="com.hzya.frame.plugin.salesContract.entity.SalesContractEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id = "SalesContractEntity_Base_Column_List">
|
||||
formmain_8694.id as id,
|
||||
'SW01' as pk_group, -- 集团编码
|
||||
field0132 as pk_org, -- 公司编码
|
||||
field0009 as contractno, -- 合同号
|
||||
field0010 as contractName, -- 合同名称
|
||||
'field0146' as pushStatusFiald, -- 推送标识字段
|
||||
field0146 as pushStatus, -- 推送标识
|
||||
'OA' as creator, -- 创建人用户
|
||||
to_char(field0007,'yyyy-MM-dd HH24:mi:ss') as creationtime, -- 创建时间
|
||||
'' as contractor, -- 订单负责人名称
|
||||
'' as cdeptid, -- 事业部
|
||||
'-1' as approvestatus, -- 审批状态默认
|
||||
'' as belongtodeptid, -- 单据归属部门
|
||||
'' as dpk_custclass, -- 合同对应客户大类
|
||||
'' as dcustomerid, -- 合同对应客户大类
|
||||
'' as zcustomerid,
|
||||
'' as cinvoicecustid, -- 开票客户名称
|
||||
field0145 as cemployeeid, -- 业务人员
|
||||
field0143 as ccurrencyid, -- 币种
|
||||
field0012 as totalamount, -- 原币总金额
|
||||
'' as rmbtotalamount, -- 人民币总金额
|
||||
'' as presentrate, -- 汇率
|
||||
'' as def13, -- IPO合同号
|
||||
'' as def16, -- IPO汇率
|
||||
myfs.SORTNUMBER as def8, -- 贸易方式
|
||||
'' as def27, -- IPO币种
|
||||
skzq.SORTNUMBER as def17, -- 收款账期
|
||||
'' as def18, -- 账簿本币金额
|
||||
'' as def26 -- 当前账簿兑人民币汇率
|
||||
</sql>
|
||||
|
||||
<!--查询审计完成的数据,推送BIP新增-->
|
||||
<select id="querySalesContract" resultMap="get-SalesContractEntity-result" parameterType = "com.hzya.frame.plugin.salesContract.entity.SalesContractEntity">
|
||||
select
|
||||
<include refid="SalesContractEntity_Base_Column_List" />
|
||||
from
|
||||
formmain_8694
|
||||
LEFT JOIN COL_SUMMARY summary ON summary.FORM_RECORDID = formmain_8694.id
|
||||
left join CTP_ENUM_ITEM myfs on myfs.id=field0141
|
||||
left join CTP_ENUM_ITEM skzq on skzq.id=field0138
|
||||
where field0146 is null and to_char(field0007,'yyyy-MM-dd HH24:mi:ss')>'2025-01-01'
|
||||
and summary.state in ('1','3')
|
||||
and field0132 is not null and field0009='4501889245'
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateSalesContract" parameterType="com.hzya.frame.plugin.salesContract.entity.SalesContractEntity">
|
||||
update formmain_8694 set field0146 = #{pushStatus} where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,213 @@
|
|||
package com.hzya.frame.plugin.salesContract.plugin;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.plugin.projectMainFlow.entity.ProjectMainFlowEntity;
|
||||
import com.hzya.frame.plugin.salesContract.dao.ISalesContractDao;
|
||||
import com.hzya.frame.plugin.salesContract.entity.SalesContractEntity;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
|
||||
import com.hzya.frame.uuid.UUIDUtils;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class SalesContractPluginInitializer extends PluginBaseEntity {
|
||||
Logger logger = LoggerFactory.getLogger(SalesContractPluginInitializer.class);
|
||||
|
||||
@Autowired
|
||||
private ISalesContractDao salesContractDao;
|
||||
|
||||
@Autowired
|
||||
private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
|
||||
|
||||
@Value("${zt.url}")
|
||||
private String url;
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "SalesContractPluginInitializer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "销售合同新增";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginLabel() {
|
||||
return "SalesContractPluginInitializer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginType() {
|
||||
return "1";
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
||||
try {
|
||||
logger.info("======开始执行销售合同推送BIP========");
|
||||
//重试方法
|
||||
if (null != requestJson) {
|
||||
//如果这个id不为空,说明是重试的
|
||||
String id = requestJson.getString("integration_task_living_details_id");
|
||||
//执行重新发送
|
||||
SalesContractEntity salesContractEntity = new SalesContractEntity();
|
||||
salesContractEntity.setDataSourceCode("SW-OA");
|
||||
if (StrUtil.isNotEmpty(id)) {
|
||||
salesContractEntity.setId(id);
|
||||
}
|
||||
//查询未推送的数据
|
||||
List<SalesContractEntity> salesContractEntities = salesContractDao.querySalesContract(salesContractEntity);
|
||||
if(salesContractEntities == null || salesContractEntities.size() == 0){
|
||||
logger.info("=====没有需要推送BIP的销售合同==========");
|
||||
return BaseResult.getSuccessMessageEntity("查询成功");
|
||||
}
|
||||
for (SalesContractEntity contractEntity : salesContractEntities) {
|
||||
//组装数据
|
||||
JSONObject sendData = getSendData(contractEntity);
|
||||
JSONObject tokenData = getBipTokenData();
|
||||
contractEntity.setDataSourceCode("SW-OA");
|
||||
//获取TOKEN
|
||||
String tokenResult = HttpRequest.post(url).
|
||||
header("appId", "800050").
|
||||
header("apiCode", "8000500003").
|
||||
header("publicKey", "ZJYAQ/VtQ66PqKXlV0EowrrlKkhBHYgS/Zk39Q5ezIQne51Ce7eDIk+3zDUT+v578prj").
|
||||
header("secretKey", "iLLk424Bmzknbu+ROeJoiVDMYY5EFXtbZY/aU13HmVYIiQrIw9c0Ag4ipxbfpUqqj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=").
|
||||
body(tokenData.toString()).
|
||||
execute().
|
||||
body();
|
||||
logger.error("销售合同推送BIPtoken返回结果:"+tokenResult);
|
||||
JSONObject tokenResultJson = JSONObject.parseObject(tokenResult);
|
||||
if(!tokenResultJson.getBoolean("flag")){
|
||||
logger.info("=========销售合同获取biptoken错误,开始修改销售合同推送标识为失败==========");
|
||||
contractEntity.setPushStatus("0");
|
||||
salesContractDao.updateSalesContract(contractEntity);
|
||||
logger.info("=========销售合同获取biptoken错误,修改销售合同推送标识完毕==========");
|
||||
continue;
|
||||
}
|
||||
String tokenBody = tokenResultJson.getJSONObject("attribute").getJSONObject("data").getString("access_token");
|
||||
//发送数据
|
||||
String result = HttpRequest.post(url).
|
||||
header("appId", "800050").
|
||||
header("apiCode", "8000500012").
|
||||
header("access_token", tokenBody).
|
||||
header("publicKey", "ZJYAQ/VtQ66PqKXlV0EowrrlKkhBHYgS/Zk39Q5ezIQne51Ce7eDIk+3zDUT+v578prj").
|
||||
header("secretKey", "iLLk424Bmzknbu+ROeJoiVDMYY5EFXtbZY/aU13HmVYIiQrIw9c0Ag4ipxbfpUqqj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=").
|
||||
body(sendData.toString()).
|
||||
execute().
|
||||
body();
|
||||
logger.error("销售合同推送BIP返回结果:"+result);
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
if(!resultJson.getBoolean("flag")){
|
||||
logger.info("=========销售合同获取bip返回结果错误,开始修改销售合同推送标识为失败==========");
|
||||
contractEntity.setPushStatus("0");
|
||||
salesContractDao.updateSalesContract(contractEntity);
|
||||
logger.info("=========销售合同获取bip返回结果错误,修改销售合同推送标识为失败完毕==========");
|
||||
saveTaskLivingDetails(contractEntity.getId(),contractEntity.getContractno(),sendData.toString(),resultJson.toJSONString(),false);
|
||||
}else {
|
||||
logger.info("=========销售合同获取bip返回结果成功,开始修改销售合同推送标识为成功==========");
|
||||
contractEntity.setPushStatus("1");
|
||||
salesContractDao.updateSalesContract(contractEntity);
|
||||
logger.info("=========销售合同获取bip返回结果成功,修改销售合同推送标识为成功完毕==========");
|
||||
saveTaskLivingDetails(contractEntity.getId(),contractEntity.getContractno(),sendData.toString(),resultJson.toJSONString(),true);
|
||||
}
|
||||
}
|
||||
}
|
||||
logger.info("=======销售合同推送BIP执行成功=======");
|
||||
return BaseResult.getSuccessMessageEntity("销售合同执行成功");
|
||||
}catch (Exception e){
|
||||
logger.info("======执行销售合同推送BIP失败:{}========", e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
return BaseResult.getFailureMessageEntity("销售合同执行失败");
|
||||
}
|
||||
|
||||
private JSONObject getSendData(SalesContractEntity contractEntity) {
|
||||
JSONObject bill = new JSONObject();
|
||||
bill.put("pk_group",contractEntity.getPk_group());//集团编码
|
||||
bill.put("pk_org",contractEntity.getPk_org());//公司编码
|
||||
bill.put("contractno",contractEntity.getContractno());//合同号
|
||||
bill.put("name",contractEntity.getContractName());//合同名称
|
||||
bill.put("creator",contractEntity.getCreator());//创建人用户
|
||||
bill.put("creationtime",contractEntity.getCreationtime());//创建时间
|
||||
bill.put("contractor",contractEntity.getContractor());//订单负责人名称
|
||||
bill.put("cdeptid",contractEntity.getCdeptid());//事业部
|
||||
bill.put("approvestatus",contractEntity.getApprovestatus());//审批状态默认
|
||||
bill.put("belongtodeptid",contractEntity.getBelongtodeptid());//单据归属部门
|
||||
bill.put("dpk_custclass",contractEntity.getDpk_custclass());//合同对应客户大类
|
||||
bill.put("dcustomerid",contractEntity.getDcustomerid());//合同对应客户大类
|
||||
bill.put("zcustomerid",contractEntity.getZcustomerid());
|
||||
bill.put("cinvoicecustid",contractEntity.getCinvoicecustid());//开票客户名称
|
||||
bill.put("cemployeeid",contractEntity.getCemployeeid());//业务人员
|
||||
bill.put("ccurrencyid",contractEntity.getCcurrencyid());//币种
|
||||
bill.put("totalamount",contractEntity.getTotalamount());//原币总金额
|
||||
bill.put("rmbtotalamount",contractEntity.getRmbtotalamount());//人民币总金额
|
||||
bill.put("presentrate",contractEntity.getPresentrate());//汇率
|
||||
bill.put("def13",contractEntity.getDef13());//IPO合同号
|
||||
bill.put("def16",contractEntity.getDef16());//IPO汇率
|
||||
bill.put("def8",contractEntity.getDef8());//贸易方式
|
||||
bill.put("def27",contractEntity.getDef27());//IPO币种
|
||||
bill.put("def17",contractEntity.getDef17());//收款账期
|
||||
bill.put("def18",contractEntity.getDef18());//账簿本币金额
|
||||
bill.put("def26",contractEntity.getDef26());//当前账簿兑人民币汇率
|
||||
JSONObject htdd01Master=new JSONObject();
|
||||
htdd01Master.put("htdd01Master",bill);
|
||||
return htdd01Master;
|
||||
}
|
||||
|
||||
private JSONObject getBipTokenData() {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
||||
|
||||
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
|
||||
private void saveTaskLivingDetails(String rootAppPk,String rootAppBill,String rootAppNewData,String newTransmitInfo,boolean flag) {
|
||||
try {
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setId(UUIDUtils.getUUID());
|
||||
integrationTaskLivingDetailsEntity.setSts("Y");
|
||||
integrationTaskLivingDetailsEntity.setCreate_user_id("1");
|
||||
integrationTaskLivingDetailsEntity.setModify_user_id("1");
|
||||
integrationTaskLivingDetailsEntity.setCreate_time(new Date());
|
||||
integrationTaskLivingDetailsEntity.setModify_time(new Date());
|
||||
integrationTaskLivingDetailsEntity.setOrg_id("0");
|
||||
integrationTaskLivingDetailsEntity.setCompanyId("0");
|
||||
integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk);
|
||||
integrationTaskLivingDetailsEntity.setRootAppBill(rootAppBill);
|
||||
integrationTaskLivingDetailsEntity.setPluginId("SalesContractPluginInitializer");
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData(rootAppNewData);
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(newTransmitInfo);
|
||||
if (flag) {
|
||||
taskLivingDetailsService.saveLogToSuccess(integrationTaskLivingDetailsEntity);
|
||||
} else {
|
||||
taskLivingDetailsService.saveLogToFail(integrationTaskLivingDetailsEntity);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.info("保存日志到集成任务日志明细中失败:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.hzya.frame.plugin.salesContract.service;
|
||||
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.plugin.salesContract.entity.SalesContractEntity;
|
||||
|
||||
public interface ISalesContractService extends IBaseService<SalesContractEntity,String> {
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.plugin.salesContract.service.impl;
|
||||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.plugin.salesContract.dao.ISalesContractDao;
|
||||
import com.hzya.frame.plugin.salesContract.entity.SalesContractEntity;
|
||||
import com.hzya.frame.plugin.salesContract.service.ISalesContractService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
public class SalesContractServiceImpl extends BaseService<SalesContractEntity,String> implements ISalesContractService {
|
||||
|
||||
private ISalesContractDao salesContractDao;
|
||||
|
||||
@Autowired
|
||||
public void setSalesContractDao(ISalesContractDao dao) {
|
||||
this.salesContractDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -612,7 +612,7 @@ public class ServiceDataDistributePluginInitializer extends PluginBaseEntity{
|
|||
map1.put("tableName",mainDb);
|
||||
map1.put("dataStatus", "N");
|
||||
map1.put("deleteStatus", "0");
|
||||
map1.put("size", 50);
|
||||
//map1.put("size", 50);
|
||||
objects = mdmModuleDao.queryMdmSTs(map1);
|
||||
objects = toLowerCaseKeys(objects);
|
||||
|
||||
|
@ -807,7 +807,7 @@ public class ServiceDataDistributePluginInitializer extends PluginBaseEntity{
|
|||
map1.put("tableName",mainDb);
|
||||
//map1.put("dataStatus", "F");
|
||||
map1.put("updateStatus", "0");
|
||||
map1.put("size", 50);
|
||||
//map1.put("size", 50);
|
||||
objects = mdmModuleDao.queryMdmSTs(map1);
|
||||
objects = toLowerCaseKeys(objects);
|
||||
|
||||
|
@ -995,7 +995,7 @@ public class ServiceDataDistributePluginInitializer extends PluginBaseEntity{
|
|||
map1.put("tableName",mainDb);
|
||||
//map1.put("dataStatus", "Y");
|
||||
map1.put("addStatus", "0");
|
||||
map1.put("size", 50);
|
||||
//map1.put("size", 50);
|
||||
objects = mdmModuleDao.queryMdmSTs(map1);
|
||||
objects = toLowerCaseKeys(objects);
|
||||
|
||||
|
|
Loading…
Reference in New Issue