From 834ab523b32b9b2e1158c13224f9e4035e9f9545 Mon Sep 17 00:00:00 2001 From: sx <@sx.com> Date: Tue, 13 Aug 2024 09:38:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=97=E9=93=BA=EF=BC=8C=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E5=90=8C=E6=AD=A5=E5=88=B0u8c=E5=AE=A2=E5=95=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/lets/constant/OverallConstant.java | 12 +- .../lets/dao/impl/BdCubasdocDaoImpl.java | 2 +- .../plugin/lets/entity/BdCubasdocEntity.java | 103 ++-- .../plugin/lets/entity/BdCubasdocEntity.xml | 274 ++++----- .../plugin/lets/entity/BdCumandocEntity.java | 3 + .../plugin/lets/entity/BdJobbasfilEntity.xml | 86 +-- .../plugin/lets/ofs/entity/ShopEntity.java | 46 ++ .../plugin/lets/ofs/entity/ShopEntity.xml | 85 +++ .../lets/ofs/entity/SupplierEntity.java | 38 ++ .../CustdocAutoAllotPluginInitializer.java | 288 ++++++++++ .../base/CustmandocPluginInitializer.java | 255 +++++++++ .../base/GoodsAutoAllotPluginInitializer.java | 1 + .../base/GoodsClassPluginInitializer.java | 1 - .../plugin/base/ShopPluginInitializer.java | 354 ++++++++++++ .../base/SupplierPluginInitializer.java | 322 +++++++++++ .../sales/SoSaleOutPluginInitializerToC.java | 4 +- .../SoSaleReturnPluginInitializerToC.java | 4 +- .../frame/plugin/lets/queryvo/AddrVo.java | 32 ++ .../frame/plugin/lets/queryvo/BankVo.java | 50 ++ .../plugin/lets/queryvo/CustDocAssginVo.java | 18 + .../plugin/lets/queryvo/CustdocRequestVo.java | 22 + .../lets/queryvo/CustmandocRequestVo.java | 23 + .../plugin/lets/resultvo/CbdocResultVo.java | 21 + .../lets/resultvo/ShopReturnMessageDto.java | 26 + .../plugin/lets/util/PushDataByU8cUtil.java | 2 +- .../util/SaveOrUpdateBusinessLogUtil.java | 52 +- .../main/resources/application-hclocal.yml | 2 +- .../src/main/resources/application-local.yml | 6 +- .../src/main/resources/application-yuqh.yml | 2 +- .../src/main/resources/application.yml | 2 +- .../lets/spring/spring-sowow-plugin.xml | 7 +- .../plugin/lets/plugin/base/ShopTest.java | 99 ++++ .../controller/BusinessFileController.java | 1 + .../IntegrationTaskLivingDetailsEntity.java | 6 +- .../IntegrationTaskLivingDetailsEntity.xml | 534 +++++++++--------- 35 files changed, 2227 insertions(+), 556 deletions(-) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/ShopEntity.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/ShopEntity.xml create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/SupplierEntity.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/CustdocAutoAllotPluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/CustmandocPluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/ShopPluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SupplierPluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/AddrVo.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/BankVo.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/CustDocAssginVo.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/CustdocRequestVo.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/CustmandocRequestVo.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/resultvo/CbdocResultVo.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/resultvo/ShopReturnMessageDto.java create mode 100644 buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/base/ShopTest.java diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/constant/OverallConstant.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/constant/OverallConstant.java index cea1f3c9..5227e992 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/constant/OverallConstant.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/constant/OverallConstant.java @@ -5,7 +5,6 @@ import java.util.Map; /** * lets全局静态参数配置 - * */ public class OverallConstant { @@ -43,6 +42,13 @@ public class OverallConstant { + prodOverPublic.put("custdocSave", "/u8cloud/api/uapbd/custdoc/insert");//客商档案新增 + prodOverPublic.put("custdocQuery", "/u8cloud/api/uapbd/custdoc/query");//客商档案查询 + prodOverPublic.put("custdocUpdate", "/u8cloud/api/uapbd/custdoc/update");//客商档案修改 + prodOverPublic.put("custdocAssign", "/u8cloud/api/uapbd/custdoc/assign");//客商档案分配 + prodOverPublic.put("custmandocSave", "/u8cloud/api/uapbd/custmandoc/insert");//客商档案新增 + prodOverPublic.put("bdcorpQuery", "/u8cloud/api/uapbd/bdcorp/query");//公司档案查询 + } @@ -64,6 +70,8 @@ public class OverallConstant { devOverAll.put("u8cApiNeedStackTraceCode", "Y"); devOverAll.put("u8cApiZdrCode", "15932295350");//单据制单人---测试环境:郑一凡 + + } private static void loadProd() { @@ -91,4 +99,4 @@ public class OverallConstant { } return value; } -} \ No newline at end of file +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/BdCubasdocDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/BdCubasdocDaoImpl.java index 14af6bb5..14aca308 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/BdCubasdocDaoImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/BdCubasdocDaoImpl.java @@ -20,7 +20,7 @@ public class BdCubasdocDaoImpl extends MybatisGenericDao - - - - - - + + + + + + @@ -78,83 +78,83 @@ accdefault - ,billtemplet - ,bp1 - ,bp2 - ,bp3 - ,conaddr - ,correspondunit - ,createtime - ,creator - ,creditmny - ,custcode - ,custname - ,custprop - ,custshortname - ,def1 - ,def10 - ,def11 - ,def12 - ,def13 - ,def14 - ,def15 - ,def16 - ,def17 - ,def18 - ,def19 - ,def2 - ,def20 - ,def3 - ,def4 - ,def5 - ,def6 - ,def7 - ,def8 - ,def9 - ,dr - ,drpnodeflag - ,ecotypesincevfive - ,email - ,engname - ,fax1 - ,fax2 - ,freecustflag - ,isconnflag - ,legalbody - ,linkman1 - ,linkman2 - ,linkman3 - ,memo - ,mnecode - ,mobilephone1 - ,mobilephone2 - ,mobilephone3 - ,modifier - ,modifytime - ,phone1 - ,phone2 - ,phone3 - ,pk_areacl - ,pk_corp - ,pk_corp1 - ,pk_cubasdoc - ,pk_cubasdoc1 - ,pk_pricegroup - ,registerfund - ,saleaddr - ,sealflag - ,taxpayerid - ,trade - ,ts - ,url - ,zipcode + ,billtemplet + ,bp1 + ,bp2 + ,bp3 + ,conaddr + ,correspondunit + ,createtime + ,creator + ,creditmny + ,custcode + ,custname + ,custprop + ,custshortname + ,def1 + ,def10 + ,def11 + ,def12 + ,def13 + ,def14 + ,def15 + ,def16 + ,def17 + ,def18 + ,def19 + ,def2 + ,def20 + ,def3 + ,def4 + ,def5 + ,def6 + ,def7 + ,def8 + ,def9 + ,dr + ,drpnodeflag + ,ecotypesincevfive + ,email + ,engname + ,fax1 + ,fax2 + ,freecustflag + ,isconnflag + ,legalbody + ,linkman1 + ,linkman2 + ,linkman3 + ,memo + ,mnecode + ,mobilephone1 + ,mobilephone2 + ,mobilephone3 + ,modifier + ,modifytime + ,phone1 + ,phone2 + ,phone3 + ,pk_areacl + ,pk_corp + ,pk_corp1 + ,pk_cubasdoc + ,pk_cubasdoc1 + ,pk_pricegroup + ,registerfund + ,saleaddr + ,sealflag + ,taxpayerid + ,trade + ,ts + ,url + ,zipcode - + - + @@ -539,12 +539,12 @@ - - - - - - + + + + + + @@ -615,12 +615,12 @@ - - - - - - + + + + + + @@ -635,19 +635,19 @@ - + - + - + - + @@ -781,11 +781,11 @@ - - - - - + + + + + @@ -795,12 +795,12 @@ - + - + @@ -863,12 +863,12 @@ - - - - - - + + + + + + @@ -883,7 +883,7 @@ - + @@ -895,7 +895,7 @@ bca.dr = 0 and bc.dr = 0 and bca.pk_cumandoc = #{pk_cumandoc} - and bca.pk_corp = #{pkCorp} + and bca.pk_corp = #{pkcorp} - + + select + + from shop + where biz_code = #{bizCode,jdbcType=VARCHAR} + + + + + + + + + + + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/SupplierEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/SupplierEntity.java new file mode 100644 index 00000000..e8b46279 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/SupplierEntity.java @@ -0,0 +1,38 @@ +package com.hzya.frame.plugin.lets.ofs.entity; + +import lombok.Data; + +/** + * @Author + * @Date 2024/8/7 10:23 + * @PackageName:com.hzya.frame.plugin.lets.ofs.entity + * @ClassName: SupplierEntity + * @Description: TODO + */ +@Data +public class SupplierEntity { + //业务编码 + private String bizCode; + //供应商名称 + private String name; + //组织 + private String clientCode; + //货主编码 + private String companyCode; + //地址 + private String address; + //国家 + private String country; + //省 + private String state; + //市 + private String city; + //区 + private String district; + //联系人 + private String attentionTo; + //手机号 + private String mobile; + //状态 + private String status; +} 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 new file mode 100644 index 00000000..07f18582 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/CustdocAutoAllotPluginInitializer.java @@ -0,0 +1,288 @@ +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.entity.BdInvbasdocEntity; +import com.hzya.frame.plugin.lets.queryvo.CustDocAssginVo; +import com.hzya.frame.plugin.lets.queryvo.CustdocRequestVo; +import com.hzya.frame.plugin.lets.resultvo.CbdocResultVo; +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.util.*; +import java.util.concurrent.locks.ReentrantLock; + +/** + * @Author + * @Date 2024/8/12 13:57 + * @PackageName:com.hzya.frame.plugin.lets.plugin.base + * @ClassName: CustdocAutoAllotPluginInitializer + * @Description: 客商档案自动分配 + */ +public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity { + + Logger logger = LoggerFactory.getLogger(GoodsAutoAllotPluginInitializer.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.GoodsAutoAllotPluginInitializer"; + } + + @Override + public String getPluginName() { + return "丽知:U8C->客商基本档案自动分配全公司"; + } + + @Override + public String getPluginLabel() { + return "丽知:U8C->客商基本档案自动分配全公司"; + } + + @Override + public String getPluginType() { + return "1"; + } + + @Autowired + private IIntegrationTaskLivingDetailsDao iIntegrationTaskLivingDetailsDao; + @Autowired + private PushDataByU8cUtil pushDataByU8cUtil; + @Autowired + private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil; + + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + return null; + } + + + /** + * 默认推送 + */ + public void start() { + try { + //查询要分配的客商 + List list = queryCustDoc(); + //推送:自动分配 + implement(list); + + } catch (Exception e) { + logger.error("丽知:U8C->客商基本档案自动分配全公司,start()方法报错:", e); + } + } + + + + /** + * 过滤成功日志 + * + * @return + */ + public List filter(List bdInvbasdocEntityList) { + List filterInvbasdocList = new ArrayList<>(); + for (BdInvbasdocEntity bdInvbasdocEntity : bdInvbasdocEntityList) { + String rootAppPk = bdInvbasdocEntity.getPkInvbasdoc(); + boolean isExis = true; + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk); + integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y); + integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); + List integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity); + if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) { + isExis = false; + } + if (!isExis) { + filterInvbasdocList.add(bdInvbasdocEntity); + } + + } + return filterInvbasdocList; + } + + /** + * 查询客商基本档案 + * @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(); + List list = JSONObject.parseObject(datastring, List.class); + custdocRequestVos = filterData(list); + } catch (Exception e) { + logger.error("丽知:U8C->客商基本档案自动分配全公司,查询客商基本档案失败", e); + } + return custdocRequestVos; + } + + private List filterData(List list) { + List filterlist = new ArrayList<>(); + for (Object o : list) { + //o转为 + CustdocRequestVo requestVo = JSONObject.parseObject(JSONObject.toJSONString(o), CustdocRequestVo.class); + + + if("N".equals(requestVo.getParentvo().getDef10())){ + filterlist.add(requestVo); + } + } + return filterlist; + } + + /** + * U8C->客商基本档案自动分配全公司 + */ + public void implement(List list) { + + //查询公司档案 + try { + String corpresponse = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("bdcorpQuery"), "{}"); + CbdocResultVo cbdocResultVo = JSONObject.parseObject(corpresponse, CbdocResultVo.class); + if(cbdocResultVo.getStatus()!="success"){ + Assert.state(false, "查询公司档案失败"); + } + + } catch (Exception e) { + throw new RuntimeException(e); + } + + for (CustdocRequestVo custdocRequestVo : list) { + String assginjsonString = ""; + String pkCubasdoc = custdocRequestVo.getParentvo().getPk_cubasdoc(); + String createtime = custdocRequestVo.getParentvo().getCreatetime(); + try { + ArrayList assginvolist = new ArrayList<>(); + CustDocAssginVo custDocAssginVo = new CustDocAssginVo(); + custDocAssginVo.setPk_cubasdoc(pkCubasdoc); + custDocAssginVo.setAssignallcorps("Y"); + custDocAssginVo.setCustprop("2"); + assginvolist.add(custDocAssginVo); + + HashMap map = new HashMap<>(); + map.put("custbasvo", list); + assginjsonString = JSONObject.toJSONString(map); + String response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custdocAssign"), assginjsonString); + + 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(custdocRequestVo); + } + } + if (!isSuccess) { + Assert.state(false, "推送U8C--> U8C->客商基本档案自动分配全公司 失败 接口返回结果:{} 接口入参:{}", response, assginjsonString); + } + //成功 + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y); + integrationTaskLivingDetailsEntity.setRootAppNewData(assginjsonString); + 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) { + e.printStackTrace(); + logger.error("U8C->客商基本档案自动分配全公司implement(List filterInvbasdocList)方法失败"); + //失败 + String ErrMessage = e.getMessage(); + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N); + integrationTaskLivingDetailsEntity.setRootAppNewData(assginjsonString); + integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage); + integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); + integrationTaskLivingDetailsEntity.setBusinessDate(createtime); + integrationTaskLivingDetailsEntity.setRootAppPk(pkCubasdoc); + integrationTaskLivingDetailsEntity.setRootAppBill(pkCubasdoc); + integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); + saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); + } + } + } + + private void updateDoc(CustdocRequestVo custdocRequestVo) { + //已分配 + String pkCubasdoc = custdocRequestVo.getParentvo().getPk_cubasdoc(); + String createtime = custdocRequestVo.getParentvo().getCreatetime(); + + custdocRequestVo.getParentvo().setDef10("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, "推送U8C--> U8C->客商基本档案自动分配全公司 失败 接口返回结果:{} 接口入参:{}", 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/CustmandocPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/CustmandocPluginInitializer.java new file mode 100644 index 00000000..6d491491 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/CustmandocPluginInitializer.java @@ -0,0 +1,255 @@ +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.entity.BdCubasdocEntity; + +import com.hzya.frame.plugin.lets.entity.BdCumandocEntity; +import com.hzya.frame.plugin.lets.queryvo.CustdocRequestVo; + +import com.hzya.frame.plugin.lets.queryvo.CustmandocRequestVo; +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(GoodsClassPluginInitializer.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.GoodsClassPluginInitializer"; + } + + @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"), "{}"); + + List list = JSONObject.parseObject(data, List.class); + custdocRequestVos = filterData(list); + + } catch (Exception e) { + logger.error("丽知:查询客商基本档案失败", e); + } + return custdocRequestVos; + } + + private List filterData(List list) { + List filterlist = new ArrayList<>(); + for (Object o : list) { + //o转为 + CustdocRequestVo BdCubasdocEntity = JSONObject.parseObject(JSONObject.toJSONString(o), CustdocRequestVo.class); + if("N".equals(BdCubasdocEntity.getParentvo().getDef11())){ + filterlist.add(BdCubasdocEntity); + } + } + 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对象格式化为字符串 + + BdCubasdocEntity parentvo = vo.getParentvo(); + try { + + parentvo.setPk_areacl("F"); + CustmandocRequestVo custmandocRequestVo = new CustmandocRequestVo(); + custmandocRequestVo.setParentvo(parentvo); + custmandocRequestVo.setAddrs(vo.getAddrs()); +// custmandocRequestVo.setBanks(vo.getBanks()); + + BdCumandocEntity BdCumandocEntity = new BdCumandocEntity(); + BdCumandocEntity.setCustflag("0"); + BdCumandocEntity BdCumandocEntity1 = new BdCumandocEntity(); + BdCumandocEntity1.setCustflag("4"); + List custmandocEntities = new ArrayList<>(); + custmandocEntities.add(BdCumandocEntity); + custmandocEntities.add(BdCumandocEntity1); + 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_areacl()); + 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/GoodsAutoAllotPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/GoodsAutoAllotPluginInitializer.java index ed266462..32783c70 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/GoodsAutoAllotPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/GoodsAutoAllotPluginInitializer.java @@ -100,6 +100,7 @@ public class GoodsAutoAllotPluginInitializer extends PluginBaseEntity { bdInvbasdocEntity.setCreatetime_start_time(startTimeStr); bdInvbasdocEntity.setCreatetime_end_time(endTimeStr); bdInvbasdocEntity.setDataSourceCode(ProfilesActiveConstant.LETS_DATE_SOURCE); + List bdInvbasdocEntityList = bdInvbasdocDao.query(bdInvbasdocEntity); if (bdInvbasdocEntityList.size() == 0) { return; diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/GoodsClassPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/GoodsClassPluginInitializer.java index c9476da2..180253a8 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/GoodsClassPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/GoodsClassPluginInitializer.java @@ -115,7 +115,6 @@ public class GoodsClassPluginInitializer extends PluginBaseEntity { } catch (Exception e) { logger.error("丽知:OFS货品档案分类--->U8C货品档案分类,start(String className)方法报错:", e); } - } /** 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 new file mode 100644 index 00000000..f55f5b56 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/ShopPluginInitializer.java @@ -0,0 +1,354 @@ +package com.hzya.frame.plugin.lets.plugin.base; + +import cn.hutool.core.date.DateField; +import cn.hutool.core.date.DateUtil; +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.entity.BdCubasdocEntity; +import com.hzya.frame.plugin.lets.ofs.entity.ShopEntity; + +import com.hzya.frame.plugin.lets.queryvo.CustdocRequestVo; +import com.hzya.frame.plugin.lets.resultvo.CbdocResultVo; +import com.hzya.frame.plugin.lets.resultvo.ShopReturnMessageDto; +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.ttxofs.dto.InterfaceParamDto; +import com.hzya.frame.ttxofs.service.OfsUnifiedService; +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.transaction.annotation.Transactional; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.locks.ReentrantLock; + +/** + * @Author + * @Date 2024/8/6 14:36 + * @PackageName:com.hzya.frame.plugin.lets.plugin.base + * @ClassName: ShopPluginInitializer + * @Description: 店铺->U8C客商档案 + */ + +public class ShopPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(GoodsClassPluginInitializer.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 "ShopPluginInitializer"; + } + + @Override + public String getPluginName() { + return "丽知:OFS店铺档案--->U8C客商档案"; + } + + @Override + public String getPluginLabel() { + return "丽知:OFS店铺档案--->U8C客商档案"; + } + + @Override + public String getPluginType() { + return "1"; + } + + +// @Autowired +// private IShopDao shopDao; + + @Autowired + private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil; + @Autowired + private IIntegrationTaskLivingDetailsDao iIntegrationTaskLivingDetailsDao; + + @Autowired + private PushDataByU8cUtil pushDataByU8cUtil; + + @Autowired + private OfsUnifiedService ofsUnifiedService; + + + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + String param = String.valueOf(requestJson.get("param")); + if (requestJson != null && ProfilesActiveConstant.TYPE_DATE.equals(requestJson.get("type"))) { + if (param != null && !"".equals(param)) { + String[] split = param.split("/"); + startImplement(split[0], split[1]); + } + } else if (requestJson != null && ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) { + if (param != null && !"".equals(param)) { + startImplement(param); + } + } else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) { + String integration_task_living_details_id = (String) requestJson.get("integration_task_living_details_id"); + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id); + startImplement(integrationTaskLivingDetailsEntity.getRootAppPk()); + } else { + startImplement(); + } + return null; + } + + + public void startImplement(String startDate, String endDate) { + try { + ShopEntity shopEntity = new ShopEntity(); + shopEntity.setCreated_start(startDate); + shopEntity.setCreated_end(endDate); + + InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); + interfaceParamDto.setApi("ofs.store.search"); + interfaceParamDto.setData(JSON.toJSONString(shopEntity)); + ShopReturnMessageDto unified = (ShopReturnMessageDto) ofsUnifiedService.unified(interfaceParamDto); + List data = unified.getData(); + + + List shopEntities = filterShopEntity(data); + implement(shopEntities); + + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 默认推送 + */ + public void startImplement() { + try { + //获取当前时间 + Date currentDate = new Date(); + Date startTime = DateUtil.offset(currentDate, DateField.MINUTE, -10); + Date endTime = DateUtil.offset(currentDate, DateField.MINUTE, -2); + String startTimeStr = DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss"); + String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss"); + + + ShopEntity shopEntity = new ShopEntity(); + //TODO ofs查询店铺信息 + shopEntity.setCreated_start(startTimeStr); + shopEntity.setCreated_end(endTimeStr); + +// List query = shopDao.query(shopEntity); + List query = new ArrayList<>(); + query.add(shopEntity); + //过滤数据 +// List shopEntities = filterShopEntity(query); + //同步u8c + implement(query); + + } catch (Exception e) { + logger.error("丽知:OFS货品档案分类--->U8C货品档案分类,startImplement()方法报错:", e); + } + } + + + /** + * 按编码名称 + */ + public void startImplement(String code) { + Assert.notNull(code, "code不能为空"); + try { + ShopEntity shopEntity = new ShopEntity(); + shopEntity.setBizCode(code); + //TODO ofs查询店铺信息 +// List query = shopDao.query(shopEntity); + List query = null; + + //过滤数据 + List shopEntities = filterShopEntity(query); + //执行 + implement(shopEntities); + + } catch (Exception e) { + logger.error("丽知:OFS店铺档案--->U8C客商档案,startImplement(String code)方法报错:", e); + } + } + + @Transactional + public void implement(List shopEntityList) { + Assert.notNull(shopEntityList, "shopEntityList不能为空"); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date date = new Date(System.currentTimeMillis()); + String businessFormat = sdf.format(date); + for (ShopEntity shopEntity : shopEntityList) { + + try { + + BdCubasdocEntity parentvo = new BdCubasdocEntity(); + CustdocRequestVo BdCubasdocEntity = new CustdocRequestVo(); + //TODO 设置parentvo + parentvo.setCustname(shopEntity.getName()); + parentvo.setCustshortname(shopEntity.getName()); + parentvo.setCustcode(shopEntity.getCustomerCode()); + //设置还未分配公司 + parentvo.setDef10("N"); + //设置还同步到管理档案 + parentvo.setDef11("N"); +// parentvo.setCustprop("0"); + BdCubasdocEntity.setParentvo(parentvo); + + //TODO 同步u8c + HashMap param = new HashMap<>(); + param.put("cbdocvo", BdCubasdocEntity); + String jsonString = JSONObject.toJSONString(param); + String response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custdocSave"), jsonString); + System.out.println(response); + if (response != null) { + CbdocResultVo cbdocResultVo = JSONObject.parseObject(response, CbdocResultVo.class); + String taskNumber = null; + boolean isSuccess = false; + if ("success".equals(cbdocResultVo.getStatus())) { + isSuccess = true; + taskNumber = cbdocResultVo.getTaskNumber(); + String data = cbdocResultVo.getData(); +// CustdocRequestVo BdCubasdocEntity1 = JSONObject.parseObject(data, CustdocRequestVo.class); +// List list = JSONObject.parseObject(data, List.class); +// Object o = list.get(0); +// CustdocRequestVo BdCubasdocEntity1 = JSONObject.parseObject(JSONObject.toJSONString(o), CustdocRequestVo.class); +// +// //分配给所有公司 +// CustDocAssginVo custDocAssginVo = new CustDocAssginVo(); +// custDocAssginVo.setAssignallcorps("Y"); +// //分配给所有的公司 +//// custDocAssginVo.setCustprop("0"); +// //客户基本档案主键 +// custDocAssginVo.setPk_cubasdoc(BdCubasdocEntity1.getParentvo().getPk_cubasdoc()); +// //公司主键 +//// custDocAssginVo.setPk_corp(BdCubasdocEntity1.getParentvo().getPk_corp()); +// custDocAssginVo.setCustprop("2"); +// HashMap assginHashMap = new HashMap<>(); +// assginHashMap.put("custbasvo", custDocAssginVo); +// String assginjsonString = JSONObject.toJSONString(assginHashMap); +// String assignresponse = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custdocAssign"), assginjsonString); +// CbdocResultVo cbdocResultVo1 = JSONObject.parseObject(assignresponse, CbdocResultVo.class); +// if (!"success".equals(cbdocResultVo1.getStatus())) { +// isSuccess = false; +// } + + //生成客商管理档案 + //TODO 设置属性 + + //地区名称:丽知商城客商? +// parentvo.setPk_areacl("F"); +// +// parentvo.setCustprop(BdCubasdocEntity1.getParentvo().getCustprop()); +// CustmandocRequestVo custmandocRequestVo = new CustmandocRequestVo(); +// custmandocRequestVo.setParentvo(parentvo); +// BdCumandocEntity BdCumandocEntity = new BdCumandocEntity(); +// BdCumandocEntity.setCustflag("0"); +// BdCumandocEntity BdCumandocEntity1 = new BdCumandocEntity(); +// BdCumandocEntity1.setCustflag("4"); +// List custmandocEntities = new ArrayList<>(); +// custmandocEntities.add(BdCumandocEntity); +// custmandocEntities.add(BdCumandocEntity1); +// custmandocRequestVo.setChildrenvo(custmandocEntities); +// HashMap mandocparam = new HashMap<>(); +// mandocparam.put("billvo", custmandocRequestVo); +// String mandocjsonString = JSONObject.toJSONString(mandocparam); +// String mandocresponse = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custmandocSave"), mandocjsonString); +// CbdocResultVo mandoccbdocResultVo = JSONObject.parseObject(mandocresponse, CbdocResultVo.class); +// if (!"success".equals(mandoccbdocResultVo.getStatus())) { +// isSuccess = false; +// } + } + + + if (!isSuccess) { + Assert.state(false, "同步到U8C失败,原因:{} 接口入参:{} {}", JSON.toJSONString(cbdocResultVo), JSON.toJSONString(OverallConstant.getOverAllValue("custdocSave")), JSON.toJSONString(BdCubasdocEntity)); + } + //TODO 根据返回结果记录日志 + //成功 + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y); + integrationTaskLivingDetailsEntity.setRootAppNewData(jsonString); + integrationTaskLivingDetailsEntity.setNewTransmitInfo(JSON.toJSONString(cbdocResultVo)); + integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); + integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat); + integrationTaskLivingDetailsEntity.setRootAppPk(shopEntity.getBizCode()); + integrationTaskLivingDetailsEntity.setRootAppBill(shopEntity.getName()); + integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); + saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); + //TODO 更新店铺状态 +// CbdocResultVo cbdocResultVo1 = JSONObject.parseObject(response, CbdocResultVo.class); +// String errormsg = cbdocResultVo1.getErrormsg(); + + + } + + } catch (Exception e) { + e.printStackTrace(); + String ErrMessage = e.getMessage(); + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N); + integrationTaskLivingDetailsEntity.setRootAppNewData(JSONObject.toJSONString(shopEntity)); + integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage); + integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); + integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat); + integrationTaskLivingDetailsEntity.setRootAppPk(shopEntity.getBizCode()); + integrationTaskLivingDetailsEntity.setRootAppBill(shopEntity.getName()); + integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); + saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); + logger.error("丽知:OFS店铺档案--->U8C客商档案,implement()方法报错:", e); + } + } + + + } + + public List filterShopEntity(List list) { + Assert.notNull(list, "不能为空!"); + + List shopEntityList = new ArrayList<>(); + if (list != null && list.size() > 0) { + for (int i = 0; i < list.size(); i++) { + ShopEntity shopEntity = list.get(i); + + if (shopEntity.getBizCode() != null && !"".equals(shopEntity.getBizCode().trim())) { + boolean isExis = true; + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setRootAppPk(shopEntity.getBizCode()); + integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y_H); + integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); + List integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity); + if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) { + isExis = false; + } + if (!isExis) { + shopEntityList.add(shopEntity); + } + } + } + } + return shopEntityList; + + } + + +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SupplierPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SupplierPluginInitializer.java new file mode 100644 index 00000000..df0583b3 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SupplierPluginInitializer.java @@ -0,0 +1,322 @@ +package com.hzya.frame.plugin.lets.plugin.base; + +import cn.hutool.core.date.DateField; +import cn.hutool.core.date.DateUtil; +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.entity.BdCubasdocEntity; +import com.hzya.frame.plugin.lets.ofs.entity.ShopEntity; +import com.hzya.frame.plugin.lets.ofs.entity.SupplierEntity; + +import com.hzya.frame.plugin.lets.queryvo.CustDocAssginVo; +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.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.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.locks.ReentrantLock; + +/** + * @Author + * @Date 2024/8/6 14:36 + * @PackageName:com.hzya.frame.plugin.lets.plugin.base + * @ClassName: ShopPluginInitializer + * @Description: 供应商档案->客商档案 + */ +public class SupplierPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(GoodsClassPluginInitializer.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 "ShopPluginInitializer"; + } + + @Override + public String getPluginName() { + return "丽知:OFS供应商档案--->U8C客商档案"; + } + + @Override + public String getPluginLabel() { + return "丽知:OFS供应商档案--->U8C客商档案"; + } + + @Override + public String getPluginType() { + return "1"; + } + + + @Autowired + private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil; + + @Autowired + private IIntegrationTaskLivingDetailsDao iIntegrationTaskLivingDetailsDao; + + + @Autowired + private PushDataByU8cUtil pushDataByU8cUtil; + + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + String param = String.valueOf(requestJson.get("param")); + if (requestJson != null && ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) { + if (param != null && !"".equals(param)) { + startImplement(param); + } + } else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) { + String integration_task_living_details_id = (String) requestJson.get("integration_task_living_details_id"); + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id); + startImplement(integrationTaskLivingDetailsEntity.getRootAppPk()); + } else { + startImplement(); + } + return null; + } + + + /** + * 默认推送 + */ + public void startImplement() { + try { + //获取当前时间 + //获取当前时间 + Date currentDate = new Date(); + Date startTime = DateUtil.offset(currentDate, DateField.MINUTE, -10); + Date endTime = DateUtil.offset(currentDate, DateField.MINUTE, -2); + String startTimeStr = DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss"); + String endTimeStr = DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss"); + + SupplierEntity supplierEntity = new SupplierEntity(); + + //TODO ofs查询店铺信息 +// List query = shopDao.query(shopEntity); + List query = null; + //过滤数据 + List supplierEntities = filterSupplierEntity(query); + + implement(supplierEntities); + + } catch (Exception e) { + logger.error("丽知:OFS供应商档案--->U8C客商档案,startImplement()方法报错:", e); + } + } + + + /** + * 按编码名称 + */ + public void startImplement(String code) { + Assert.notNull(code, "code不能为空"); + try { + ShopEntity shopEntity = new ShopEntity(); + shopEntity.setBizCode(code); + //TODO ofs查询供应商信息 + + List query = null; + //过滤数据 + List supplierEntities = filterSupplierEntity(query); + //执行 + implement(supplierEntities); + + } catch (Exception e) { + logger.error("丽知:OFS供应商档案--->U8C客商档案,startImplement(String code)方法报错:", e); + } + } + + /** + * 按时间区间 + */ + public void startImplement(String startTime, String endTime) { + try { + Date business_start = DateUtil.parse(startTime); + Date business_end = DateUtil.parse(endTime); + String start = DateUtil.format(business_start, "yyyy-MM-dd") + " 00:00:00"; + String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59"; + + ShopEntity shopEntity = new ShopEntity(); + shopEntity.setCreated_start(start); + shopEntity.setCreated_end(end); + //TODO ofs查询供应商信息 + } catch (Exception e) { + logger.error("丽知:OFS供应商档案--->U8C客商档案,startImplement(String startTime, String endTime)方法报错:", e); + } + } + + public void implement(List shopEntityList) { + + Assert.notNull(shopEntityList, "shopEntityList不能为空"); + //业务时间 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date date = new Date(System.currentTimeMillis()); + String businessFormat = sdf.format(date); + for (SupplierEntity supplierEntity : shopEntityList) { + BdCubasdocEntity parentvo = new BdCubasdocEntity(); + CustdocRequestVo BdCubasdocEntity = new CustdocRequestVo(); + try { + //TODO 设置parentvo +// parentvo.setPk_areacl(""); + parentvo.setCustname(supplierEntity.getName()); + parentvo.setCustshortname(supplierEntity.getName()); + parentvo.setCustcode(supplierEntity.getCompanyCode()); + + BdCubasdocEntity.setParentvo(parentvo); + //TODO 同步u8c + HashMap param = new HashMap<>(); + param.put("cbdocvo", BdCubasdocEntity); + + String jsonString = JSONObject.toJSONString(param); + String response = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custdocSave"), jsonString); + if (response != null) { + CbdocResultVo cbdocResultVo = JSONObject.parseObject(response, CbdocResultVo.class); + String taskNumber = null; + boolean isSuccess = false; + if ("success".equals(cbdocResultVo.getStatus())) { + isSuccess = true; + taskNumber = cbdocResultVo.getTaskNumber(); + String data = cbdocResultVo.getData(); + +// CustdocRequestVo BdCubasdocEntity1 = JSONObject.parseObject(data, CustdocRequestVo.class); + List datalist = JSONObject.parseObject(data, List.class); + Object o = datalist.get(0); + CustdocRequestVo BdCubasdocEntity1 = JSONObject.parseObject(JSONObject.toJSONString(o), CustdocRequestVo.class); + + + CustDocAssginVo custDocAssginVo = new CustDocAssginVo(); + custDocAssginVo.setAssignallcorps("Y"); + //分配给所有公司 + custDocAssginVo.setCustprop("2"); + custDocAssginVo.setPk_cubasdoc(BdCubasdocEntity1.getParentvo().getPk_cubasdoc()); + HashMap assginHashMap = new HashMap<>(); + assginHashMap.put("custbasvo", custDocAssginVo); + String assginjsonString = JSONObject.toJSONString(assginHashMap); + String assignresponse = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custdocAssgin"), assginjsonString); + CbdocResultVo assginCbdocResultVo = JSONObject.parseObject(assignresponse, CbdocResultVo.class); + if (!"success".equals(assginCbdocResultVo.getStatus())) { + isSuccess = false; + } + + //生成客商管理档案 + + //地区名称:丽知商城客商? + parentvo.setPk_areacl("F"); + parentvo.setCustprop(BdCubasdocEntity1.getParentvo().getCustprop()); + CustmandocRequestVo custmandocRequestVo = new CustmandocRequestVo(); + custmandocRequestVo.setParentvo(parentvo); +// BdCumandocEntity BdCumandocEntity = new BdCumandocEntity(); +// BdCumandocEntity.setCustflag("1"); +// +// BdCumandocEntity BdCumandocEntity1 = new BdCumandocEntity(); +// BdCumandocEntity.setCustflag(" "); +// ArrayList list = new ArrayList<>(); +// list.add(BdCumandocEntity); +// list.add(BdCumandocEntity1); +// custmandocRequestVo.setChildrenvo(list); + + //TODO 设置属性 + HashMap mandocparam = new HashMap<>(); + mandocparam.put("billvo", custmandocRequestVo); + String mandocjsonString = JSONObject.toJSONString(mandocparam); + String mandocresponse = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custmandocSave"), mandocjsonString); + CbdocResultVo mandoccbdocResultVo = JSONObject.parseObject(mandocresponse, CbdocResultVo.class); + if (!"success".equals(mandoccbdocResultVo.getStatus())) { + isSuccess = false; + } + } + if (!isSuccess) { + Assert.state(false, "推送U8C,原因:{} 接口入参:{} {}", JSON.toJSONString(cbdocResultVo), JSON.toJSONString(OverallConstant.getOverAllValue("custdocSave")), JSON.toJSONString(BdCubasdocEntity)); + } + //TODO 根据返回结果记录日志 + //成功 + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y); + integrationTaskLivingDetailsEntity.setRootAppNewData(jsonString); + integrationTaskLivingDetailsEntity.setNewTransmitInfo(JSON.toJSONString(cbdocResultVo)); + integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); + integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat); + integrationTaskLivingDetailsEntity.setRootAppPk(supplierEntity.getBizCode()); + integrationTaskLivingDetailsEntity.setRootAppBill(supplierEntity.getName()); + integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); + saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); + //TODO 更新供应商状态 + } + + + } catch (Exception e) { + e.printStackTrace(); + String ErrMessage = e.getMessage(); + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N); + integrationTaskLivingDetailsEntity.setRootAppNewData(JSONObject.toJSONString(BdCubasdocEntity)); + integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage); + integrationTaskLivingDetailsEntity.setNewPushDate(new Date()); + integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat); + integrationTaskLivingDetailsEntity.setRootAppPk(supplierEntity.getBizCode()); + integrationTaskLivingDetailsEntity.setRootAppBill(supplierEntity.getName()); + integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); + saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); + logger.error("丽知:OFS供应商档案--->U8C客商档案,implement()方法报错:", e); + } + } + } + + //过滤数据 + public List filterSupplierEntity(List list) { + + Assert.notNull(list, "不能为空!"); + + List supplierEntityList = new ArrayList<>(); + if (list != null && list.size() > 0) { + for (int i = 0; i < list.size(); i++) { + SupplierEntity supplierEntity = list.get(i); + + if (supplierEntity.getBizCode() != null && !"".equals(supplierEntity.getBizCode().trim())) { + boolean isExis = true; + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setRootAppPk(supplierEntity.getBizCode()); + integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y_H); + integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); + List integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity); + if (integrationTaskLivingDetailsEntities == null || integrationTaskLivingDetailsEntities.size() == 0) { + isExis = false; + } + if (!isExis) { + supplierEntityList.add(supplierEntity); + } + } + } + } + return supplierEntityList; + } + + +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java index 062fd300..ed486007 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java @@ -523,7 +523,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //客商管理档案:2024年8月5日 15:41:54 TOC店铺名称查询U8C客商档案,已经和妮姐确认 //2024年8月5日 15:49:49 先根据O店铺编码,得到店铺档案信息,取到名称,通过U8C接口查询出来 //目前O店铺信息查询接口还没有,等待开发,所以我这里先写所一个名字 - BdCumandocEntity bdCumandocEntity = TocOrderBasicArchivesCacheUtil.stringBdCumandocEntityMap.get(bdCubasdocEntity.getPkCubasdoc() + bdCorpEntity.getPkCorp()); + BdCumandocEntity bdCumandocEntity = TocOrderBasicArchivesCacheUtil.stringBdCumandocEntityMap.get(bdCubasdocEntity.getPk_cubasdoc() + bdCorpEntity.getPkCorp()); Assert.notNull(bdCumandocEntity, "无法匹配到客商档案 店铺名称:{}", "天猫intoyou旗舰店-自营"); //查找平台 @@ -839,4 +839,4 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { } -} \ No newline at end of file +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java index 32b4376b..8ca6f626 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java @@ -513,7 +513,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { //客商管理档案:2024年8月5日 15:41:54 TOC店铺名称查询U8C客商档案,已经和妮姐确认 //2024年8月5日 15:49:49 先根据O店铺编码,得到店铺档案信息,取到名称,通过U8C接口查询出来 //目前O店铺信息查询接口还没有,等待开发,所以我这里先写所一个名字 - BdCumandocEntity bdCumandocEntity = TocReturnBasicArchivesCacheUtil.stringBdCumandocEntityMap.get(bdCubasdocEntity.getPkCubasdoc() + bdCorpEntity.getPkCorp()); + BdCumandocEntity bdCumandocEntity = TocReturnBasicArchivesCacheUtil.stringBdCumandocEntityMap.get(bdCubasdocEntity.getPk_cubasdoc() + bdCorpEntity.getPkCorp()); Assert.notNull(bdCumandocEntity, "无法匹配到客商档案 店铺名称:{}", "天猫intoyou旗舰店-自营"); //查找平台 @@ -833,4 +833,4 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { return null; } -} \ No newline at end of file +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/AddrVo.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/AddrVo.java new file mode 100644 index 00000000..b8db32a9 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/AddrVo.java @@ -0,0 +1,32 @@ +package com.hzya.frame.plugin.lets.queryvo; + +import lombok.Data; + +/** + * @Author + * @Date 2024/8/6 16:14 + * @PackageName:com.hzya.frame.plugin.lets.plugin.base.vo + * @ClassName: addrs + * @Description: TODO + */ +@Data +public class AddrVo { + private String addrname; + ; + private boolean defaddrflag; + ; + private String linkman; + ; + private String phone; + ; + private String pk_address; + ; + private String pk_areacl; + ; + private String pk_cubasdoc; + ; + private String pk_custaddr; + ; + private String status; + +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/BankVo.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/BankVo.java new file mode 100644 index 00000000..4ec6d64f --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/BankVo.java @@ -0,0 +1,50 @@ +package com.hzya.frame.plugin.lets.queryvo; + +import lombok.Data; + +/** + * @Author + * @Date 2024/8/6 16:14 + * @PackageName:com.hzya.frame.plugin.lets.plugin.base.vo + * @ClassName: banks + * @Description: TODO + */ +@Data +public class BankVo { + private String accname; + + private String accopendate; + + private String account; + + private String accountname; + + private String accountproperty; + + private String bankarea; + + private String banktypename; + + private String defflag; + + private String memo; + + private String pk_accbank; + + private String pk_bankdoc; + + + private String pk_corp; + + private String pk_cubasdoc; + + private String pk_currtype; + + private String pk_custbank; + + private String status; + + private String ts; + + private String unitname; +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/CustDocAssginVo.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/CustDocAssginVo.java new file mode 100644 index 00000000..53cac6ad --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/CustDocAssginVo.java @@ -0,0 +1,18 @@ +package com.hzya.frame.plugin.lets.queryvo; + +import lombok.Data; + +/** + * @Author + * @Date 2024/8/8 14:53 + * @PackageName:com.hzya.frame.plugin.lets.plugin.base.vo + * @ClassName: CustDocAssginVo + * @Description: TODO + */ +@Data +public class CustDocAssginVo { + private String assignallcorps; + private String custprop; + private String pk_corp; + private String pk_cubasdoc; +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/CustdocRequestVo.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/CustdocRequestVo.java new file mode 100644 index 00000000..fb3b3048 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/CustdocRequestVo.java @@ -0,0 +1,22 @@ +package com.hzya.frame.plugin.lets.queryvo; + +import com.hzya.frame.plugin.lets.entity.BdCubasdocEntity; +import lombok.Data; + +import java.util.List; + +/** + * @Author + * @Date 2024/8/6 16:13 + * @PackageName:com.hzya.frame.plugin.lets.ofsvo + * @ClassName: cbdocvo + * @Description: + */ +@Data +public class CustdocRequestVo { + private List addrs; + private List banks; +// private BdCubasdocEntity parentvo; + private BdCubasdocEntity parentvo; + +} 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 new file mode 100644 index 00000000..319ce577 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/queryvo/CustmandocRequestVo.java @@ -0,0 +1,23 @@ +package com.hzya.frame.plugin.lets.queryvo; + +import com.hzya.frame.plugin.lets.entity.BdCubasdocEntity; +import com.hzya.frame.plugin.lets.entity.BdCumandocEntity; +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 BdCubasdocEntity parentvo; +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/resultvo/CbdocResultVo.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/resultvo/CbdocResultVo.java new file mode 100644 index 00000000..8dd427ad --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/resultvo/CbdocResultVo.java @@ -0,0 +1,21 @@ +package com.hzya.frame.plugin.lets.resultvo; + +import lombok.Data; + +/** + * @Author + * @Date 2024/8/6 17:55 + * @PackageName:com.hzya.frame.plugin.lets.plugin.base.vo + * @ClassName: ShopResultVo + * @Description: 客商档案返回结果 + */ +@Data +public class CbdocResultVo { + + private String status; + private String data; + private String taskNumber; + + private String errormsg; + +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/resultvo/ShopReturnMessageDto.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/resultvo/ShopReturnMessageDto.java new file mode 100644 index 00000000..d40f0efc --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/resultvo/ShopReturnMessageDto.java @@ -0,0 +1,26 @@ +package com.hzya.frame.plugin.lets.resultvo; + +import com.hzya.frame.plugin.lets.ofs.entity.ShopEntity; +import com.hzya.frame.ttxofs.basics.ReturnMessageBasics; +import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto; + +import java.util.List; + +/** + * @Author + * @Date 2024/8/8 17:42 + * @PackageName:com.hzya.frame.plugin.lets.plugin.base.vo + * @ClassName: ShopReturnMessageDto + * @Description: TODO + */ +public class ShopReturnMessageDto extends ReturnMessageBasics { + private List data; + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/PushDataByU8cUtil.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/PushDataByU8cUtil.java index b5488581..588cb604 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/PushDataByU8cUtil.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/PushDataByU8cUtil.java @@ -24,7 +24,7 @@ public class PushDataByU8cUtil { * @param data 请求参数 * @return 返回消息 */ - public String pushU8CByPK(String url, String data) throws Exception { + public String pushU8CByPK(String url, String data) throws Exception { Assert.notNull(url, "请求地址不能为空"); Assert.notNull(data, "请求参数不能为空(需要JSON格式)"); diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/SaveOrUpdateBusinessLogUtil.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/SaveOrUpdateBusinessLogUtil.java index 2afb5f00..3f300269 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/SaveOrUpdateBusinessLogUtil.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/SaveOrUpdateBusinessLogUtil.java @@ -1,6 +1,5 @@ package com.hzya.frame.plugin.lets.util; - import cn.hutool.core.lang.Assert; import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao; @@ -11,17 +10,13 @@ import org.springframework.stereotype.Component; import java.util.List; -/** - * 保存或者更新业务日志 - * - * @author liuyang - */ +//保存或者更新业务日志 + @Component public class SaveOrUpdateBusinessLogUtil { @Autowired private IIntegrationTaskLivingDetailsDao iIntegrationTaskLivingDetailsDao; - private static final Object insertOrUpdateLock = new Object(); /** @@ -34,41 +29,6 @@ public class SaveOrUpdateBusinessLogUtil { Assert.notNull(integrationTaskLivingDetailsEntity.getRootAppPk(), "源系统单号不能为空"); Assert.notNull(integrationTaskLivingDetailsEntity.getPluginId(), "场景id不能为空"); -// Thread thread = new Thread(new Runnable() { -// @Override -// public void run() { -// synchronized (insertOrUpdateLock) { -// IntegrationTaskLivingDetailsEntity integrationTaskLivingDetails = null; -// IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity1 = new IntegrationTaskLivingDetailsEntity(); -// integrationTaskLivingDetailsEntity1.setRoot_app_pk(integrationTaskLivingDetailsEntity.getRoot_app_pk()); -// integrationTaskLivingDetailsEntity1.setPlugin_id(integrationTaskLivingDetailsEntity.getPlugin_id()); -// List integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity1); -// if (integrationTaskLivingDetailsEntities != null && integrationTaskLivingDetailsEntities.size() > 0) { -// integrationTaskLivingDetails = integrationTaskLivingDetailsEntities.get(0); -// } -// -// if (integrationTaskLivingDetails != null) { -// //存在 -// integrationTaskLivingDetailsEntity.setId(integrationTaskLivingDetails.getId()); -// updateSuccessMessage(integrationTaskLivingDetailsEntity); -// iIntegrationTaskLivingDetailsDao.update("com.hzya.frame.sys.integrationtask.living.dao.impl.IntegrationTaskLivingDetailsDaoImpl.entity_updatebyid", integrationTaskLivingDetailsEntity); -// } else { -// //不存在 -// Long uuid = UUIDLong.longUUID(); -// integrationTaskLivingDetailsEntity.setId(String.valueOf(uuid)); -// updateSuccessMessage(integrationTaskLivingDetailsEntity); -// iIntegrationTaskLivingDetailsDao.save(integrationTaskLivingDetailsEntity); -// } -// } -// } -// }); -// thread.start(); -// try { -// thread.join(); -// } catch (Exception e) { -// e.printStackTrace(); -// } - IntegrationTaskLivingDetailsEntity integrationTaskLivingDetails = null; IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity1 = new IntegrationTaskLivingDetailsEntity(); integrationTaskLivingDetailsEntity1.setRootAppPk(integrationTaskLivingDetailsEntity.getRootAppPk()); @@ -82,14 +42,16 @@ public class SaveOrUpdateBusinessLogUtil { synchronized (insertOrUpdateLock) { integrationTaskLivingDetailsEntity.setId(integrationTaskLivingDetails.getId()); updateSuccessMessage(integrationTaskLivingDetailsEntity); - iIntegrationTaskLivingDetailsDao.update("com.hzya.frame.sys.integrationtask.living.dao.impl.IntegrationTaskLivingDetailsDaoImpl.entity_updatebyid", integrationTaskLivingDetailsEntity); +// iIntegrationTaskLivingDetailsDao.update("com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.impl.IntegrationTaskLivingDetailsDaoImpl.entity_updatebyid", integrationTaskLivingDetailsEntity); + iIntegrationTaskLivingDetailsDao.update(integrationTaskLivingDetailsEntity); } } else { //不存在 Long uuid = UUIDLong.longUUID(); integrationTaskLivingDetailsEntity.setId(String.valueOf(uuid)); updateSuccessMessage(integrationTaskLivingDetailsEntity); - iIntegrationTaskLivingDetailsDao.save(integrationTaskLivingDetailsEntity); + IntegrationTaskLivingDetailsEntity save = iIntegrationTaskLivingDetailsDao.save(integrationTaskLivingDetailsEntity); + System.out.println("save = " + save); } } @@ -123,4 +85,4 @@ public class SaveOrUpdateBusinessLogUtil { Assert.notNull(integrationTaskLivingDetailsEntity, "根据主键id没有查询到明细信息"); return integrationTaskLivingDetailsEntity; } -} \ No newline at end of file +} diff --git a/buildpackage/src/main/resources/application-hclocal.yml b/buildpackage/src/main/resources/application-hclocal.yml index 3e44c377..801f02a8 100644 --- a/buildpackage/src/main/resources/application-hclocal.yml +++ b/buildpackage/src/main/resources/application-hclocal.yml @@ -24,4 +24,4 @@ savefile: # 文件保存路径 path: D:\yongansystem\kangarooDataCenter\v3\logs zt: - url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file + url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface diff --git a/buildpackage/src/main/resources/application-local.yml b/buildpackage/src/main/resources/application-local.yml index 4fc3208a..6c031d2c 100644 --- a/buildpackage/src/main/resources/application-local.yml +++ b/buildpackage/src/main/resources/application-local.yml @@ -12,12 +12,14 @@ spring: dynamic: datasource: master: - url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true + url: jdbc:mysql://192.168.14.252:3306/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true username: root password: 62e4295b615a30dbf3b8ee96f41c820b driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 savefile: # 文件保存路径 path: /Users/apple/Desktop/log/local + + zt: - url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file + url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface diff --git a/buildpackage/src/main/resources/application-yuqh.yml b/buildpackage/src/main/resources/application-yuqh.yml index b5209253..d46f5b16 100644 --- a/buildpackage/src/main/resources/application-yuqh.yml +++ b/buildpackage/src/main/resources/application-yuqh.yml @@ -20,4 +20,4 @@ savefile: # 文件保存路径 path: E:\yongansystem\log zt: - url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file + url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface diff --git a/buildpackage/src/main/resources/application.yml b/buildpackage/src/main/resources/application.yml index 8450d6bd..8d096174 100644 --- a/buildpackage/src/main/resources/application.yml +++ b/buildpackage/src/main/resources/application.yml @@ -124,4 +124,4 @@ jeecg : minio_pass: ?? bucketName: ?? data: - use: true \ No newline at end of file + use: true diff --git a/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-sowow-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-sowow-plugin.xml index ef61b0f6..a6ba466c 100644 --- a/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-sowow-plugin.xml +++ b/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-sowow-plugin.xml @@ -9,9 +9,14 @@ + + + + + - \ No newline at end of file + diff --git a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/base/ShopTest.java b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/base/ShopTest.java new file mode 100644 index 00000000..92e56eca --- /dev/null +++ b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/base/ShopTest.java @@ -0,0 +1,99 @@ +package com.hzya.frame.plugin.lets.plugin.base; + +import com.hzya.frame.WebappApplication; +import com.hzya.frame.plugin.lets.entity.BdCubasdocEntity; +import com.hzya.frame.plugin.lets.queryvo.CustdocRequestVo; +import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil; +import com.hzya.frame.ttxofs.service.OfsUnifiedService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.ArrayList; + +/** + * @Author + * @Date 2024/8/8 9:09 + * @PackageName:com.hzya.frame.plugin.lets.plugin.base + * @ClassName: ShopTest + * @Description: TODO + */ + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = WebappApplication.class) +public class ShopTest { + + @Autowired + private ShopPluginInitializer shopPluginInitializer; + @Autowired + private OfsUnifiedService ofsUnifiedService; + @Autowired + private PushDataByU8cUtil pushDataByU8cUtil; + @Autowired + private CustmandocPluginInitializer custmandocPluginInitializer; + + @Test + public void t00() { +// shopPluginInitializer.startImplement(); +// ShopEntity shopEntity = new ShopEntity(); +// shopEntity.setStatus(1); +// shopEntity.setClientCode("LETS"); +// InterfaceParamDto interfaceParamDto = new InterfaceParamDto(); +// interfaceParamDto.setApi("ofs.store.search"); +// interfaceParamDto.setData(JSON.toJSONString(shopEntity)); +// try { +// ShopReturnMessageDto unified = (ShopReturnMessageDto) ofsUnifiedService.unified(interfaceParamDto); +// System.out.println(unified); +// } catch (Exception e) { +// throw new RuntimeException(e); +// } + +// ArrayList shopEntities = new ArrayList<>(); +// ShopEntity shopEntity = new ShopEntity(); +// shopEntity.setBizCode("intoyou-xhs"); +// shopEntity.setName("小红书INTO YOU心慕与你旗舰店-自营1test1a1231"); +// shopEntity.setCustomerCode("testcode11232411"); +// shopEntities.add(shopEntity); +// shopPluginInitializer.implement(shopEntities); +// System.out.println("shopEntities = " + shopEntities); + + +// try { +// System.out.println("开始推送"); +// //分配给所有公司 +// CustDocAssginVo custDocAssginVo = new CustDocAssginVo(); +// custDocAssginVo.setAssignallcorps("Y"); +// //客户基本档案主键 +// custDocAssginVo.setPk_cubasdoc("0001A210000000000PNV"); +// //公司主键 +// custDocAssginVo.setCustprop("2"); +// HashMap assginHashMap = new HashMap<>(); +// assginHashMap.put("custbasvo", custDocAssginVo); +// String assginjsonString = JSONObject.toJSONString(assginHashMap); +// String assignresponse = null; +// assignresponse = pushDataByU8cUtil.pushU8CByCode(OverallConstant.getOverAllValue("custdocAssign"), assginjsonString); +// CbdocResultVo cbdocResultVo1 = JSONObject.parseObject(assignresponse, CbdocResultVo.class); +// System.out.println("cbdocResultVo1 = " + cbdocResultVo1); +// //{"custbasvo":[{"custprop":"2","pk_cubasdoc":"CU785@@@000001","assignallcorps":"Y"}]} +// } catch (Exception e) { +// throw new RuntimeException(e); +// } + + + //生成客商管理档案 + BdCubasdocEntity parentvo = new BdCubasdocEntity(); + parentvo.setCustname("测试客商管理档11223案"); + parentvo.setCustshortname("测试客商管理档13121案"); + parentvo.setCustcode("test34121a"); + //地区名称:丽知商城客商? + parentvo.setPk_areacl("F"); + parentvo.setPk_corp("0001"); + CustdocRequestVo custdocRequestVo = new CustdocRequestVo(); + custdocRequestVo.setParentvo(parentvo); + ArrayList list = new ArrayList<>(); + list.add(custdocRequestVo); + custmandocPluginInitializer.implement(list); + } +} diff --git a/service/src/main/java/com/hzya/frame/sys/businessFile/controller/BusinessFileController.java b/service/src/main/java/com/hzya/frame/sys/businessFile/controller/BusinessFileController.java index e94949b8..8cd86bb3 100644 --- a/service/src/main/java/com/hzya/frame/sys/businessFile/controller/BusinessFileController.java +++ b/service/src/main/java/com/hzya/frame/sys/businessFile/controller/BusinessFileController.java @@ -19,6 +19,7 @@ import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; import java.util.List; import java.util.zip.ZipOutputStream; diff --git a/service/src/main/java/com/hzya/frame/sysnew/integtationTaskLivingDetails/entity/IntegrationTaskLivingDetailsEntity.java b/service/src/main/java/com/hzya/frame/sysnew/integtationTaskLivingDetails/entity/IntegrationTaskLivingDetailsEntity.java index c85adbd5..02bd393e 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/integtationTaskLivingDetails/entity/IntegrationTaskLivingDetailsEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/integtationTaskLivingDetails/entity/IntegrationTaskLivingDetailsEntity.java @@ -2,14 +2,17 @@ package com.hzya.frame.sysnew.integtationTaskLivingDetails.entity; import java.util.Date; import com.hzya.frame.web.entity.BaseEntity; +import lombok.Data; + /** * 集成任务-实例详情(IntegrationTaskLivingDetails)实体类 * * @author makejava * @since 2024-05-15 14:06:41 */ +@Data public class IntegrationTaskLivingDetailsEntity extends BaseEntity { - + /** 集成任务-实例_id */ private String taskLinvingId; /** 返回结果 */ @@ -85,7 +88,6 @@ public class IntegrationTaskLivingDetailsEntity extends BaseEntity { public void setQueryCondition(String queryCondition) { this.queryCondition = queryCondition; } - public String getRootAppPk() { return rootAppPk; } diff --git a/service/src/main/java/com/hzya/frame/sysnew/integtationTaskLivingDetails/entity/IntegrationTaskLivingDetailsEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/integtationTaskLivingDetails/entity/IntegrationTaskLivingDetailsEntity.xml index fb8310d6..ffd6e895 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/integtationTaskLivingDetails/entity/IntegrationTaskLivingDetailsEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/integtationTaskLivingDetails/entity/IntegrationTaskLivingDetailsEntity.xml @@ -3,74 +3,74 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id - ,task_linving_id - ,result - ,query_condition - ,root_app_pk - ,root_app_bill - ,root_app_new_data - ,new_transmit_info - ,new_push_date - ,repair_pust - ,create_time - ,create_user_id - ,modify_time - ,modify_user_id - ,sts - ,sorts - ,sence_id - ,new_state - ,business_date - ,plugin_id - ,processing_time - ,processing_remarks - ,processor_name - ,processor - ,new_system_number - ,new_system_primary - ,remark - ,def1 - ,def2 - ,def3 - ,def4 - ,def5 - + ,task_linving_id + ,result + ,query_condition + ,root_app_pk + ,root_app_bill + ,root_app_new_data + ,new_transmit_info + ,new_push_date + ,repair_pust + ,create_time + ,create_user_id + ,modify_time + ,modify_user_id + ,sts + ,sorts + ,sence_id + ,new_state + ,business_date + ,plugin_id + ,processing_time + ,processing_remarks + ,processor_name + ,processor + ,new_system_number + ,new_system_primary + ,remark + ,def1 + ,def2 + ,def3 + ,def4 + ,def5 + - - + select + + from integration_task_living_details + + and id = #{id} and task_linving_id = #{taskLinvingId} and result = #{result} and query_condition = #{queryCondition} @@ -118,16 +118,16 @@ and def4 = #{def4} and def5 = #{def5} and sts='Y' - - order by sorts asc - order by ${sort} ${order} - - - - + + + - + select + + from integration_task_living_details + + and id like concat('%',#{id},'%') and task_linving_id like concat('%',#{taskLinvingId},'%') and result like concat('%',#{result},'%') and query_condition like concat('%',#{queryCondition},'%') @@ -204,60 +204,60 @@ and def4 like concat('%',#{def4},'%') and def5 like concat('%',#{def5},'%') and sts='Y' - - order by sorts asc - order by ${sort} ${order} - + + order by sorts asc + order by ${sort} ${order} + - - + select + + from integration_task_living_details + + or id = #{id} + or task_linving_id = #{taskLinvingId} + or result = #{result} + or query_condition = #{queryCondition} + or root_app_pk = #{rootAppPk} + or root_app_bill = #{rootAppBill} + or root_app_new_data = #{rootAppNewData} + or new_transmit_info = #{newTransmitInfo} + or new_push_date = #{newPushDate} + or repair_pust = #{repairPust} + or create_time = #{create_time} + or create_user_id = #{create_user_id} + or modify_time = #{modify_time} + or modify_user_id = #{modify_user_id} + or sts = #{sts} + or sorts = #{sorts} + or sence_id = #{senceId} + or new_state = #{newState} + or business_date = #{businessDate} + or plugin_id = #{pluginId} + or processing_time = #{processingTime} + or processing_remarks = #{processingRemarks} + or processor_name = #{processorName} + or processor = #{processor} + or new_system_number = #{newSystemNumber} + or new_system_primary = #{newSystemPrimary} + or remark = #{remark} + or def1 = #{def1} + or def2 = #{def2} + or def3 = #{def3} + or def4 = #{def4} + or def5 = #{def5} and sts='Y' - - order by sorts asc - order by ${sort} ${order} - + + order by sorts asc + order by ${sort} ${order} + - - - insert into integration_task_living_details( - - id , + + + insert into integration_task_living_details( + + id , task_linving_id , result , query_condition , @@ -289,11 +289,11 @@ def3 , def4 , def5 , - sts, - - )values( - - #{id} , + sts, + + )values( + + #{id} , #{taskLinvingId} , #{result} , #{queryCondition} , @@ -325,10 +325,10 @@ #{def3} , #{def4} , #{def5} , - 'Y', - - ) - + 'Y', + + ) + @@ -406,105 +406,105 @@ ) - - - insert into integration_task_living_details(task_linving_id, result, query_condition, root_app_pk, root_app_bill, root_app_new_data, new_transmit_info, new_push_date, repair_pust, create_time, create_user_id, modify_time, modify_user_id, sts, sence_id, new_state, business_date, plugin_id, processing_time, processing_remarks, processor_name, processor, new_system_number, new_system_primary, remark, def1, def2, def3, def4, def5, sts) - values - - (#{entity.taskLinvingId},#{entity.result},#{entity.queryCondition},#{entity.rootAppPk},#{entity.rootAppBill},#{entity.rootAppNewData},#{entity.newTransmitInfo},#{entity.newPushDate},#{entity.repairPust},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id},#{entity.sts},#{entity.senceId},#{entity.newState},#{entity.businessDate},#{entity.pluginId},#{entity.processingTime},#{entity.processingRemarks},#{entity.processorName},#{entity.processor},#{entity.newSystemNumber},#{entity.newSystemPrimary},#{entity.remark},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5}, 'Y') - - - - - insert into integration_task_living_details(task_linving_id, result, query_condition, root_app_pk, root_app_bill, root_app_new_data, new_transmit_info, new_push_date, repair_pust, create_time, create_user_id, modify_time, modify_user_id, sts, sence_id, new_state, business_date, plugin_id, processing_time, processing_remarks, processor_name, processor, new_system_number, new_system_primary, remark, def1, def2, def3, def4, def5) - values - - (#{entity.taskLinvingId},#{entity.result},#{entity.queryCondition},#{entity.rootAppPk},#{entity.rootAppBill},#{entity.rootAppNewData},#{entity.newTransmitInfo},#{entity.newPushDate},#{entity.repairPust},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id},#{entity.sts},#{entity.senceId},#{entity.newState},#{entity.businessDate},#{entity.pluginId},#{entity.processingTime},#{entity.processingRemarks},#{entity.processorName},#{entity.processor},#{entity.newSystemNumber},#{entity.newSystemPrimary},#{entity.remark},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5}) - - on duplicate key update - task_linving_id = values(task_linving_id), - result = values(result), - query_condition = values(query_condition), - root_app_pk = values(root_app_pk), - root_app_bill = values(root_app_bill), - root_app_new_data = values(root_app_new_data), - new_transmit_info = values(new_transmit_info), - new_push_date = values(new_push_date), - repair_pust = values(repair_pust), - create_time = values(create_time), - create_user_id = values(create_user_id), - modify_time = values(modify_time), - modify_user_id = values(modify_user_id), - sts = values(sts), - sence_id = values(sence_id), - new_state = values(new_state), - business_date = values(business_date), - plugin_id = values(plugin_id), - processing_time = values(processing_time), - processing_remarks = values(processing_remarks), - processor_name = values(processor_name), - processor = values(processor), - new_system_number = values(new_system_number), - new_system_primary = values(new_system_primary), - remark = values(remark), - def1 = values(def1), - def2 = values(def2), - def3 = values(def3), - def4 = values(def4), - def5 = values(def5) - - -update integration_task_living_details set - - task_linving_id = #{taskLinvingId}, - result = #{result}, - query_condition = #{queryCondition}, - root_app_pk = #{rootAppPk}, - root_app_bill = #{rootAppBill}, - root_app_new_data = #{rootAppNewData}, - new_transmit_info = #{newTransmitInfo}, - new_push_date = #{newPushDate}, - repair_pust = #{repairPust}, - create_time = #{create_time}, - create_user_id = #{create_user_id}, - modify_time = #{modify_time}, - modify_user_id = #{modify_user_id}, - sts = #{sts}, - sence_id = #{senceId}, - new_state = #{newState}, - business_date = #{businessDate}, - plugin_id = #{pluginId}, - processing_time = #{processingTime}, - processing_remarks = #{processingRemarks}, - processor_name = #{processorName}, - processor = #{processor}, - new_system_number = #{newSystemNumber}, - new_system_primary = #{newSystemPrimary}, - remark = #{remark}, - def1 = #{def1}, - def2 = #{def2}, - def3 = #{def3}, - def4 = #{def4}, - def5 = #{def5}, - -where id = #{id} - - - -update integration_task_living_details set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} -where id = #{id} - + + + insert into integration_task_living_details(task_linving_id, result, query_condition, root_app_pk, root_app_bill, root_app_new_data, new_transmit_info, new_push_date, repair_pust, create_time, create_user_id, modify_time, modify_user_id, sts, sence_id, new_state, business_date, plugin_id, processing_time, processing_remarks, processor_name, processor, new_system_number, new_system_primary, remark, def1, def2, def3, def4, def5, sts) + values + + (#{entity.taskLinvingId},#{entity.result},#{entity.queryCondition},#{entity.rootAppPk},#{entity.rootAppBill},#{entity.rootAppNewData},#{entity.newTransmitInfo},#{entity.newPushDate},#{entity.repairPust},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id},#{entity.sts},#{entity.senceId},#{entity.newState},#{entity.businessDate},#{entity.pluginId},#{entity.processingTime},#{entity.processingRemarks},#{entity.processorName},#{entity.processor},#{entity.newSystemNumber},#{entity.newSystemPrimary},#{entity.remark},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5}, 'Y') + + + + + insert into integration_task_living_details(task_linving_id, result, query_condition, root_app_pk, root_app_bill, root_app_new_data, new_transmit_info, new_push_date, repair_pust, create_time, create_user_id, modify_time, modify_user_id, sts, sence_id, new_state, business_date, plugin_id, processing_time, processing_remarks, processor_name, processor, new_system_number, new_system_primary, remark, def1, def2, def3, def4, def5) + values + + (#{entity.taskLinvingId},#{entity.result},#{entity.queryCondition},#{entity.rootAppPk},#{entity.rootAppBill},#{entity.rootAppNewData},#{entity.newTransmitInfo},#{entity.newPushDate},#{entity.repairPust},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id},#{entity.sts},#{entity.senceId},#{entity.newState},#{entity.businessDate},#{entity.pluginId},#{entity.processingTime},#{entity.processingRemarks},#{entity.processorName},#{entity.processor},#{entity.newSystemNumber},#{entity.newSystemPrimary},#{entity.remark},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5}) + + on duplicate key update + task_linving_id = values(task_linving_id), + result = values(result), + query_condition = values(query_condition), + root_app_pk = values(root_app_pk), + root_app_bill = values(root_app_bill), + root_app_new_data = values(root_app_new_data), + new_transmit_info = values(new_transmit_info), + new_push_date = values(new_push_date), + repair_pust = values(repair_pust), + create_time = values(create_time), + create_user_id = values(create_user_id), + modify_time = values(modify_time), + modify_user_id = values(modify_user_id), + sts = values(sts), + sence_id = values(sence_id), + new_state = values(new_state), + business_date = values(business_date), + plugin_id = values(plugin_id), + processing_time = values(processing_time), + processing_remarks = values(processing_remarks), + processor_name = values(processor_name), + processor = values(processor), + new_system_number = values(new_system_number), + new_system_primary = values(new_system_primary), + remark = values(remark), + def1 = values(def1), + def2 = values(def2), + def3 = values(def3), + def4 = values(def4), + def5 = values(def5) + + + update integration_task_living_details set + + task_linving_id = #{taskLinvingId}, + result = #{result}, + query_condition = #{queryCondition}, + root_app_pk = #{rootAppPk}, + root_app_bill = #{rootAppBill}, + root_app_new_data = #{rootAppNewData}, + new_transmit_info = #{newTransmitInfo}, + new_push_date = #{newPushDate}, + repair_pust = #{repairPust}, + create_time = #{create_time}, + create_user_id = #{create_user_id}, + modify_time = #{modify_time}, + modify_user_id = #{modify_user_id}, + sts = #{sts}, + sence_id = #{senceId}, + new_state = #{newState}, + business_date = #{businessDate}, + plugin_id = #{pluginId}, + processing_time = #{processingTime}, + processing_remarks = #{processingRemarks}, + processor_name = #{processorName}, + processor = #{processor}, + new_system_number = #{newSystemNumber}, + new_system_primary = #{newSystemPrimary}, + remark = #{remark}, + def1 = #{def1}, + def2 = #{def2}, + def3 = #{def3}, + def4 = #{def4}, + def5 = #{def5}, + + where id = #{id} + + + + update integration_task_living_details set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + where id = #{id} + - - -update integration_task_living_details set sts= 'N' -where id = #{id} - - - -update integration_task_living_details set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} - - and id = #{id} + + + update integration_task_living_details set sts= 'N' + where id = #{id} + + + + update integration_task_living_details set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} and task_linving_id = #{taskLinvingId} and result = #{result} and query_condition = #{queryCondition} @@ -514,7 +514,7 @@ update integration_task_living_details set sts= 'N' ,modify_time = #{modify_tim and new_transmit_info = #{newTransmitInfo} and new_push_date = #{newPushDate} and repair_pust = #{repairPust} - and sts = #{sts} + and sts = #{sts} and sorts = #{sorts} and sence_id = #{senceId} and new_state = #{newState} @@ -533,12 +533,12 @@ update integration_task_living_details set sts= 'N' ,modify_time = #{modify_tim and def4 = #{def4} and def5 = #{def5} and sts='Y' - - - - - delete from integration_task_living_details where id = #{id} - + + + + + delete from integration_task_living_details where id = #{id} + - id, + id, task_linving_id, result, query_condition, @@ -593,7 +593,7 @@ update integration_task_living_details set sts= 'N' ,modify_time = #{modify_tim processor_name, processing_remarks, processing_time - + @@ -721,7 +721,7 @@ update integration_task_living_details set sts= 'N' ,modify_time = #{modify_tim where id = #{id} -update + update integration_task_living_details @@ -729,7 +729,7 @@ update integration_task_living_details_success set sts= 'N' -where id = #{id} - + where id = #{id} +