From 6ee242d2a6a24633b87e686e0dbf6f9ce2abfc7a Mon Sep 17 00:00:00 2001 From: sx <@sx.com> Date: Fri, 16 Aug 2024 10:26:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=A2=E5=95=86=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustdocAutoAllotPluginInitializer.java | 2 +- .../base/CustmandocPluginInitializer.java | 257 ------------------ .../plugin/base/ShopPluginInitializer.java | 6 +- .../lets/queryvo/CustmandocRequestVo.java | 24 -- .../lets/u8cdto/CustmandocEntityDto.java | 199 -------------- 5 files changed, 2 insertions(+), 486 deletions(-) delete mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/CustmandocPluginInitializer.java delete mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/CustmandocRequestVo.java delete mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/CustmandocEntityDto.java diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/CustdocAutoAllotPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/CustdocAutoAllotPluginInitializer.java index 44d1d008..c989a214 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/CustdocAutoAllotPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/CustdocAutoAllotPluginInitializer.java @@ -145,7 +145,7 @@ public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity { boolean isExis = true; IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); integrationTaskLivingDetailsEntity.setRootAppPk(requestVo.getParentvo().getCustcode()); - integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y_H); + integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y); integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); List integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity); if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) { diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/CustmandocPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/CustmandocPluginInitializer.java deleted file mode 100644 index f2bd6ccd..00000000 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/CustmandocPluginInitializer.java +++ /dev/null @@ -1,257 +0,0 @@ -package com.hzya.frame.plugin.lets.plugin.base; - -import cn.hutool.core.lang.Assert; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.hzya.frame.base.PluginBaseEntity; -import com.hzya.frame.plugin.lets.constant.OverallConstant; -import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant; - -import com.hzya.frame.plugin.lets.queryvo.CustdocRequestVo; - -import com.hzya.frame.plugin.lets.queryvo.CustmandocRequestVo; -import com.hzya.frame.plugin.lets.resultvo.CbdocResultVo; -import com.hzya.frame.plugin.lets.u8cdto.CustdocEntityDto; -import com.hzya.frame.plugin.lets.u8cdto.CustmandocEntityDto; -import com.hzya.frame.plugin.lets.u8cdto.ReusltStrDto; -import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil; -import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil; -import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao; -import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; -import com.hzya.frame.web.entity.JsonResultEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; - -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.concurrent.locks.ReentrantLock; - -/** - * @Author - * @Date 2024/8/12 15:25 - * @PackageName:com.hzya.frame.plugin.lets.plugin.base - * @ClassName: CustmandocPluginInitializer - * @Description: 客商管理档案 - */ -public class CustmandocPluginInitializer extends PluginBaseEntity { - - Logger logger = LoggerFactory.getLogger(CustmandocPluginInitializer.class); - - private static final ReentrantLock LOCK = new ReentrantLock(true); - - @Override - public void initialize() { - logger.info(getPluginLabel() + "執行初始化方法initialize()"); - } - - @Override - public void destroy() { - logger.info(getPluginLabel() + "執行銷毀方法destroy()"); - } - - @Override - public String getPluginId() { - return "com.hzya.frame.plugin.lets.plugin.base.CustmandocPluginInitializer"; - } - - @Override - public String getPluginName() { - return "丽知:OFS客商档案--->U8C客商管理档案"; - } - - @Override - public String getPluginLabel() { - return "丽知:U8C客商基本档案--->U8C客商管理档案"; - } - - @Override - public String getPluginType() { - return "1"; - } - - @Autowired - private PushDataByU8cUtil pushDataByU8cUtil; - @Autowired - private IIntegrationTaskLivingDetailsDao iIntegrationTaskLivingDetailsDao; - @Autowired - private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil; - - @Override - public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { - return null; - } - - - /** - * 默认推送 - */ - public void start() { - try { - //获取符合条件客商基本档案 - List custdocRequestVos = queryCustDoc(); - implement(custdocRequestVos); - } catch (Exception e) { - logger.error("丽知:U8C客商基本档案 --->U8C客商管理档案 ,start()方法报错:", e); - } - } - - /** - * 查询客商基本档案 - * @return - */ - private List queryCustDoc() { - List custdocRequestVos=null; - try { - String data = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custdocQuery"), "{}"); - CbdocResultVo cbdocResultVo = JSONObject.parseObject(data, CbdocResultVo.class); - String datastring = cbdocResultVo.getData(); - Map map = JSONObject.parseObject(datastring, Map.class); - Object o = map.get("datas"); - List list = JSONObject.parseArray(JSON.toJSONString(o), CustdocRequestVo.class); - custdocRequestVos = filterData(list); - - } catch (Exception e) { - logger.error("丽知:查询客商基本档案失败", e); - } - return custdocRequestVos; - } - - private List filterData(List list) { - List filterlist = new ArrayList<>(); - for (CustdocRequestVo requestVo : list) { - if("N".equals(requestVo.getParentvo().getDef11())){ - filterlist.add(requestVo); - } - } - return filterlist; - } - - public void implement(List list) { - for (CustdocRequestVo vo : list) { - String mandocjsonString = ""; - //生成业务日期 - - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 定义日期格式 - Date date = new Date(System.currentTimeMillis()); // 创建Date对象 - String businessFormat = sdf.format(date); // 将Date对象格式化为字符串 - - CustdocEntityDto parentvo = vo.getParentvo(); - try { - - parentvo.setPk_areacl("F"); - CustmandocRequestVo custmandocRequestVo = new CustmandocRequestVo(); - custmandocRequestVo.setParentvo(parentvo); - custmandocRequestVo.setAddrs(vo.getAddrs()); -// custmandocRequestVo.setBanks(vo.getBanks()); - - CustmandocEntityDto custmandocEntityDto = new CustmandocEntityDto(); - custmandocEntityDto.setCustflag("0"); - CustmandocEntityDto custmandocEntityDto1 = new CustmandocEntityDto(); - custmandocEntityDto1.setCustflag("4"); - List custmandocEntities = new ArrayList<>(); - custmandocEntities.add(custmandocEntityDto); - custmandocEntities.add(custmandocEntityDto1); - custmandocRequestVo.setChildrenvo(custmandocEntities); - HashMap mandocparam = new HashMap<>(); - mandocparam.put("billvo", custmandocRequestVo); - mandocjsonString = JSONObject.toJSONString(mandocparam); - String response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custmandocSave"), mandocjsonString); - System.out.println(response); - boolean isSuccess = false; - if (response != null && !"".equals(response)) { - ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class); - if ("success".equals(reusltStrDto.getStatus())) { - isSuccess = true; - updateDoc(vo); - } - } - if (!isSuccess) { - Assert.state(false, "推送U8C-->丽知:U8C客商基本档案 --->U8C客商管理档案 失败 接口返回结果:{} 接口入参:{}", response, mandocjsonString); - } - //成功 - IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); - integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y); - integrationTaskLivingDetailsEntity.setRootAppNewData(mandocjsonString); - integrationTaskLivingDetailsEntity.setNewTransmitInfo(response); - integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); - integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat); - integrationTaskLivingDetailsEntity.setRootAppPk(parentvo.getPk_cubasdoc()); - integrationTaskLivingDetailsEntity.setRootAppBill(parentvo.getCustcode()); - integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); - saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); - - - } catch (Exception e) { - e.printStackTrace(); - logger.error("丽知:U8C客商基本档案 --->U8C客商管理档案 ,implement()方法报错", e); - //失败 - String ErrMessage = e.getMessage(); - IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); - integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N); - integrationTaskLivingDetailsEntity.setRootAppNewData(mandocjsonString); - integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage); - integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); - integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat); - integrationTaskLivingDetailsEntity.setRootAppPk(parentvo.getPk_cubasdoc()); - integrationTaskLivingDetailsEntity.setRootAppBill(parentvo.getCustcode()); - integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); - saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); - } - } - } - - private void updateDoc(CustdocRequestVo custdocRequestVo) { - //已分配 - String pkCubasdoc = custdocRequestVo.getParentvo().getPk_cubasdoc(); - String createtime = custdocRequestVo.getParentvo().getCreatetime(); - - custdocRequestVo.getParentvo().setDef11("Y"); - ArrayList requestVos = new ArrayList<>(); - requestVos.add(custdocRequestVo); - HashMap map = new HashMap<>(); - map.put("custbasvo", requestVos); - String data = JSONObject.toJSONString(map); - try { - String response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custdocUpdate"), data); - - boolean isSuccess = false; - if (response != null && !"".equals(response)) { - ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class); - if ("success".equals(reusltStrDto.getStatus())) { - isSuccess = true; - } - } - if (!isSuccess) { - Assert.state(false, "更新客商基本档案失败 接口返回结果:{} 接口入参:{}", response, data); - } - //成功 - IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); - integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y); - integrationTaskLivingDetailsEntity.setRootAppNewData(data); - integrationTaskLivingDetailsEntity.setNewTransmitInfo(response); - integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); - integrationTaskLivingDetailsEntity.setBusinessDate(createtime); - integrationTaskLivingDetailsEntity.setRootAppPk(pkCubasdoc); - integrationTaskLivingDetailsEntity.setRootAppBill(pkCubasdoc); - integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); - saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); - - } catch (Exception e) { - //失败 - logger.error("U8C->客商基本档案更新updateDoc(CustdocRequestVo custdocRequestVo)方法失败"); - String ErrMessage = e.getMessage(); - IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); - integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N); - integrationTaskLivingDetailsEntity.setRootAppNewData(data); - integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage); - integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); - integrationTaskLivingDetailsEntity.setBusinessDate(createtime); - integrationTaskLivingDetailsEntity.setRootAppPk(pkCubasdoc); - integrationTaskLivingDetailsEntity.setRootAppBill(pkCubasdoc); - integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); - saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); - } - - } -} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/ShopPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/ShopPluginInitializer.java index b9ff19f0..80bc2a39 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/ShopPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/ShopPluginInitializer.java @@ -210,10 +210,6 @@ public class ShopPluginInitializer extends PluginBaseEntity { // parentvo.setCustcode(shopEntity.getCustomerCode()); // parentvo.setCustcode(shopEntity.getBizCode()); // parentvo.setPk_areacl("F"); - //设置还未分配公司 -// parentvo.setDef10("N"); -// //设置还未同步到管理档案 -// parentvo.setDef11("N"); // parentvo.setCustprop("2"); custdocRequestVo.setParentvo(parentvo); @@ -284,7 +280,7 @@ public class ShopPluginInitializer extends PluginBaseEntity { boolean isExis = true; IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); integrationTaskLivingDetailsEntity.setRootAppPk(ofsShopDto.getBizCode()); - integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y_H); + integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y); integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); List integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity); if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) { diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/CustmandocRequestVo.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/CustmandocRequestVo.java deleted file mode 100644 index 38836018..00000000 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/CustmandocRequestVo.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.hzya.frame.plugin.lets.queryvo; - -import com.hzya.frame.plugin.lets.entity.BdCumandocEntity; -import com.hzya.frame.plugin.lets.u8cdto.CustdocEntityDto; -import com.hzya.frame.plugin.lets.u8cdto.CustmandocEntityDto; -import lombok.Data; - -import java.util.List; - -/** - * @Author - * @Date 2024/8/8 15:17 - * @PackageName:com.hzya.frame.plugin.lets.plugin.base.vo - * @ClassName: CustmandocRequestVo - * @Description: TODO - */ -@Data -public class CustmandocRequestVo { - private List addrs; - private List custBanks; - - private List childrenvo; - private CustdocEntityDto parentvo; -} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/CustmandocEntityDto.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/CustmandocEntityDto.java deleted file mode 100644 index 72922e2b..00000000 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/CustmandocEntityDto.java +++ /dev/null @@ -1,199 +0,0 @@ -package com.hzya.frame.plugin.lets.u8cdto; - - -import lombok.Data; - -import java.util.List; - -/** - * @Author - * @Date 2024/8/8 15:15 - * @PackageName:com.hzya.frame.plugin.lets.plugin.base.vo - * @ClassName: BdCumandocEntity - * @Description: 客商管理档案 - */ -@Data -public class CustmandocEntityDto { - // 于客商总公司账期控制 - private boolean acclimitcontrol; - // 呼机 - private String bp; - // 助记码 - private String cmnecode; - // 是否收付协同 - private boolean cooperateflag; - // 合作期限从 - private String cooperatingdayfrom; - // 合作期限到 - private String cooperatingdayto; - // 创建时间 - private String createtime; - // 创建人 - - private String creator; - // 基于客商总公司信用控制 - private boolean creditcontrol; - // 信用等级(填写编码) - private String creditlevel; - // 信用期限 - private int creditlimitnum; - // 信用额度 - private double creditmny; - // 信用保证金 - private double creditmoney; - // 是否信用管制 - private String credlimitflag; - // 客商编码 - private String custcode; - //由于客商管理档案在数据库表中存的两条,所以childrenvo如果传的话需要传两条,这两条数据的客商属性字段必须是这些组合(客户0和4,供应商1和空格,客商2和3),不传childrenvo默认是客户0和4 - private String custflag; - // 客商名称 - private String custname; - // 客商状态 - private String custstate; - - private String def1; - - private String def10; - - private String def11; - - private String def12; - - private String def13; - - private String def14; - private String def15; - - private String def16; - - private String def17; - - private String def18; - - private String def19; - - private String def2; - - private String def20; - - private String def21; - - private String def22; - - private String def23; - - private String def24; - - private String def25; - private String def26; - - private String def27; - - private String def28; - - private String def29; - - private String def3; - - private String def30; - - private String def4; - - private String def5; - - private String def6; - - private String def7; - - private String def8; - - private String def9; - // 发展日期 - private String developdate; - //是否允许异币种核算 - private String diffcurrflag; - // 扣率 - private String discountrate; - // 删除标志 - private int dr; - // 免于帐期检查 - private boolean freeofacclmtcheck; - // 免于信用额度检查 - private boolean freeofcremnycheck; - // 冻结时间 - private String frozendate; - // 是否冻结 - private boolean frozenflag; - - // 等级 - private int grade; - // 内控帐期天数 - private String innerctldays; - // 筹投资单位 - private boolean iounit; - // 是否零售加盟店 - private boolean isagent; - // 是否催款 - private boolean ispromtesettlement; - // 联系人 - private String linkman; - // 备注 - private String memo; - // 手机 - private String mobilephone; - // 修改人 - private String modifier; - // 修改时间 - private String modifytime; - // 地区分类 - private String pk_areacl; - // 库存组织(填写编码) - private String pk_calbody; - // 公司(填写编码) - private String pk_corp; - // 默认交易币种(填写编码) - private String pk_currtype1; - // 开票客商(填写编码) - private String pk_cusmandoc2; - // 发货客商(填写编码) - private String pk_cusmandoc3; - // 默认业务类型(填写编码) - private String pk_defbusitype; - // 默认收付款协议(填写编码) - private String pk_payterm; - // 公司价格分组(填写编码) - private String pk_pricegroupcorp; - // 专管部门(填写编码) - private String pk_respdept1; - // 专管业务员(填写编码) - private String pk_resppsn1; - // 销售组织(填写编码) - private String pk_salestru; - // 发运方式(填写编码) - private String pk_sendtype; - // 结算单位主键(已废弃) - private String pk_settleunit; - // 仓库档案(填写编码) - private String pk_stordoc2; - // 预收款比例 - private int prepaidratio; - // 批准日期 - private String ratifydate; - // 封存标志 - private String sealflag; - // 存货最低售价比例 - private int stockpriceratio; - // 新产品试销保证金 - private double testsalemoney; -} - - - - - - - - - -