diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java index ee1ecf96..caa97528 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java @@ -35,7 +35,7 @@ public class AccLogPluginInitializer extends PluginBaseEntity { Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private INingboBankPluginService ningboBankPluginService; - @Value("${OA.data_source_code}") + @Value("${OA.data_source_code:}") private String oa_data_source_code; @Autowired private IPayBillPluginInitializerDao payBillDao; diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayResultPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayResultPluginInitializer.java index 7b366558..493df2dd 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayResultPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayResultPluginInitializer.java @@ -27,7 +27,7 @@ import java.util.Map; **/ public class NingboBankPayResultPluginInitializer extends PluginBaseEntity { Logger logger = LoggerFactory.getLogger(getClass()); - @Value("${OA.data_source_code}") + @Value("${OA.data_source_code:}") private String oa_data_source_code; @Autowired private IPayBillPluginInitializerDao payBillDao; diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankTTPayPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankTTPayPluginInitializer.java index 5303546e..10ebc8a0 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankTTPayPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankTTPayPluginInitializer.java @@ -34,7 +34,7 @@ public class NingboBankTTPayPluginInitializer extends PluginBaseEntity { private IIntegrationTaskLivingDetailsService taskLivingDetailsService; @Autowired private IPayBillPluginInitializerDao payBillDao; - @Value("${OA.data_source_code}") + @Value("${OA.data_source_code:}") private String oa_data_source_code; diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankTTPayResultPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankTTPayResultPluginInitializer.java index f5ed1791..995ff4f9 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankTTPayResultPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankTTPayResultPluginInitializer.java @@ -30,7 +30,7 @@ public class NingboBankTTPayResultPluginInitializer extends PluginBaseEntity { private IIntegrationTaskLivingDetailsService taskLivingDetailsService; @Autowired private IPayBillPluginInitializerDao payBillDao; - @Value("${OA.data_source_code}") + @Value("${OA.data_source_code:}") private String oa_data_source_code; diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayReqSyncU8CPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayReqSyncU8CPluginInitializer.java index 74297311..11b2098f 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayReqSyncU8CPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayReqSyncU8CPluginInitializer.java @@ -34,7 +34,7 @@ public class PayReqSyncU8CPluginInitializer extends PluginBaseEntity { private IIntegrationTaskLivingDetailsService taskLivingDetailsService; @Autowired private IPayBillPluginInitializerDao payBillDao; - @Value("${OA.data_source_code}") + @Value("${OA.data_source_code:}") private String oa_data_source_code; /*** diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java index 889ba344..91a94b1f 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java @@ -55,7 +55,7 @@ private IFormmain0044Service formmain0044Service; private RestUtil restUtil; @Autowired private INingboBankTreasuryService ningboBankTreasuryService; - @Value("${OA.data_source_code}") + @Value("${OA.data_source_code:}") private String oa_data_source_code; diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/plugin/OtherReceiptPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/plugin/OtherReceiptPluginInitializer.java new file mode 100644 index 00000000..148340b0 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/kjs/plugin/OtherReceiptPluginInitializer.java @@ -0,0 +1,106 @@ +package com.hzya.frame.plugin.kjs.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.u8.otherreceipt.service.IOtherReceiptService; +import com.hzya.frame.u8.receipt.service.IReceiptService; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * + * @content 其他应收单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 8:46 + * + */ + +public class OtherReceiptPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private IOtherReceiptService otherReceiptService; + /*** + * 插件初始化方法 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 10:48 + * @Param [] + * @return void + **/ + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + /**** + * 插件销毁方法 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + /**** + * 插件的ID + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginId() { + return "OtherReceiptPluginInitializer"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "其他应收单同步CRM插件"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "其他应收单同步CRM插件"; + } + + /*** + * 插件类型 1、场景插件 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 14:01 + * @Param [] + * @return java.lang.String + **/ + @Override + public String getPluginType() { + return "1"; + } + + /*** + * 执行业务代码 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-07 11:20 + * @param requestJson 执行业务代码的参数 + * @return void + **/ + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + otherReceiptService.getU8otherReceiptToCrm(requestJson); + return BaseResult.getSuccessMessageEntity("操作成功"); + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java index 4b943082..a3f0373f 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java @@ -23,7 +23,7 @@ public class SalesBillingServiceImpl implements ISalesBillingService { Logger logger = LoggerFactory.getLogger(SalesBillingServiceImpl.class); - @Value("${OA.data_source_code}") + @Value("${OA.data_source_code:}") private String oa_data_source_code; @Autowired private IU8cSalesBillingService iu8cSalesBillingService; diff --git a/buildpackage/src/main/resources/cfgHome/plugin/kjs/spring/spring-buildpackage-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/kjs/spring/spring-buildpackage-plugin.xml index 45198dec..d2f4372d 100644 --- a/buildpackage/src/main/resources/cfgHome/plugin/kjs/spring/spring-buildpackage-plugin.xml +++ b/buildpackage/src/main/resources/cfgHome/plugin/kjs/spring/spring-buildpackage-plugin.xml @@ -9,4 +9,6 @@ <bean name="ReceiptPluginInitializer" class="com.hzya.frame.plugin.kjs.plugin.ReceiptPluginInitializer" /> <bean name="SaleInvPluginInitializer" class="com.hzya.frame.plugin.kjs.plugin.SaleInvPluginInitializer" /> <bean name="OtherInPluginInitializer" class="com.hzya.frame.plugin.kjs.plugin.OtherInPluginInitializer" /> +<bean name="OtherReceiptPluginInitializer" class="com.hzya.frame.plugin.kjs.plugin.OtherReceiptPluginInitializer" /> +<bean name="OtherOutPluginInitializer" class="com.hzya.frame.plugin.kjs.plugin.OtherOutPluginInitializer" /> </beans> diff --git a/service/src/main/java/com/hzya/frame/crm/util/CrmUtil.java b/service/src/main/java/com/hzya/frame/crm/util/CrmUtil.java index f4b8a81d..c8deaff0 100644 --- a/service/src/main/java/com/hzya/frame/crm/util/CrmUtil.java +++ b/service/src/main/java/com/hzya/frame/crm/util/CrmUtil.java @@ -27,13 +27,13 @@ public class CrmUtil { public static String sendU8TOCrmEsb(String parm, String apiCode){ - String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"; + String baseUrl = "http://127.0.0.1:9991/kangarooDataCenterV3/entranceController/externalCallInterface"; System.out.println("推送参数"+parm); String result = HttpRequest.post(baseUrl) - .header("appId", "800023")//头信息,多个头信息多次调用此方法即可 + .header("appId", "800007")//头信息,多个头信息多次调用此方法即可 .header("apiCode", apiCode)//头信息,多个头信息多次调用此方法即可 - .header("publicKey", "ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可 - .header("secretKey", "7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可 + .header("publicKey", "ZJYA+1JrrKQGBuWV9n1uUejlZnxUAH0fPDywF/1U0SD3BZ1Ce7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可 + .header("secretKey", "u2T1Dt5DtiXJcXZx4Y9ARQifbnEbNGorDvUGoDbV9jWsBl8lZT2+mcoQE4q097JQj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可 .body(parm)//表单内容 .timeout(20000)//超时,毫秒 .execute().body(); diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java index 29afd8c9..032b7599 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java @@ -670,9 +670,9 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String> } //递归删除树结构 1.树 2.列表 - if(map.get("viewName").equals("1")){ - return recursiveDeleteComparison(comparisonEntitiePages,comparisonEntity); - } +// if(map.get("viewName").equals("1")){ +// return recursiveDeleteComparison(comparisonEntitiePages,comparisonEntity); +// } String id = String.valueOf(comparisonEntitiePages.get(0).get("id")); diff --git a/service/src/main/java/com/hzya/frame/u8/delivery/dao/IDeliveryOrderDao.java b/service/src/main/java/com/hzya/frame/u8/delivery/dao/IDeliveryOrderDao.java index f63b6c22..24a12085 100644 --- a/service/src/main/java/com/hzya/frame/u8/delivery/dao/IDeliveryOrderDao.java +++ b/service/src/main/java/com/hzya/frame/u8/delivery/dao/IDeliveryOrderDao.java @@ -9,4 +9,14 @@ import com.hzya.frame.u8.delivery.entity.DeliveryOrderEntity; * @Date 2024/8/22 15:07 **/ public interface IDeliveryOrderDao extends IBaseDao<DeliveryOrderEntity,String> { + /** + * + * @content 修改发货单状态 + * @className: Administrator + * @author laborer + * @date 2024-11-18 19:48 + * + */ + + int updateDeliveryState( DeliveryOrderEntity entity); } diff --git a/service/src/main/java/com/hzya/frame/u8/delivery/dao/impl/DeliveryOrderDaoImpl.java b/service/src/main/java/com/hzya/frame/u8/delivery/dao/impl/DeliveryOrderDaoImpl.java index 1bf6508c..a5ec36ac 100644 --- a/service/src/main/java/com/hzya/frame/u8/delivery/dao/impl/DeliveryOrderDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/u8/delivery/dao/impl/DeliveryOrderDaoImpl.java @@ -1,5 +1,6 @@ package com.hzya.frame.u8.delivery.dao.impl; +import com.baomidou.dynamic.datasource.annotation.DS; import com.hzya.frame.basedao.dao.MybatisGenericDao; import com.hzya.frame.u8.delivery.dao.IDeliveryOrderDao; import com.hzya.frame.u8.delivery.entity.DeliveryOrderEntity; @@ -12,4 +13,9 @@ import org.springframework.stereotype.Repository; **/ @Repository public class DeliveryOrderDaoImpl extends MybatisGenericDao<DeliveryOrderEntity,String> implements IDeliveryOrderDao { + @Override + @DS("#entity.dataSourceCode") + public int updateDeliveryState( DeliveryOrderEntity entity) { + return super.update("com.hzya.frame.u8.delivery.dao.impl.DeliveryOrderDaoImpl.entity_update",entity); + } } diff --git a/service/src/main/java/com/hzya/frame/u8/delivery/entity/DeliveryOrderEntity.xml b/service/src/main/java/com/hzya/frame/u8/delivery/entity/DeliveryOrderEntity.xml index b1e316a4..d6f782be 100644 --- a/service/src/main/java/com/hzya/frame/u8/delivery/entity/DeliveryOrderEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8/delivery/entity/DeliveryOrderEntity.xml @@ -71,12 +71,10 @@ <!--通过主键修改方法--> <update id="entity_update" parameterType="com.hzya.frame.u8.delivery.entity.DeliveryOrderEntity"> --- update ${AccCode}.dbo.DispatchList_extradefine set chdefine19 = #{frozen} - - UPDATE ${AccCode}.dbo.DispatchList_extradefine - set chdefine14 = #{frozen} - FROM DispatchList_extradefine - JOIN ${AccCode}.dbo.DispatchList c ON DispatchList.id = DispatchList_extradefine.id + UPDATE ${AccId}.dbo.DispatchList_extradefine + set chdefine19 = #{frozen} + FROM ${AccId}.dbo.DispatchList_extradefine + JOIN ${AccId}.dbo.DispatchList ON DispatchList.dlid = DispatchList_extradefine.dlid where cdlcode = #{cdlcode} diff --git a/service/src/main/java/com/hzya/frame/u8/delivery/service/IDeliveryOrderService.java b/service/src/main/java/com/hzya/frame/u8/delivery/service/IDeliveryOrderService.java index 534774f2..172194ed 100644 --- a/service/src/main/java/com/hzya/frame/u8/delivery/service/IDeliveryOrderService.java +++ b/service/src/main/java/com/hzya/frame/u8/delivery/service/IDeliveryOrderService.java @@ -1,5 +1,6 @@ package com.hzya.frame.u8.delivery.service; +import com.alibaba.fastjson.JSONObject; import com.hzya.frame.basedao.service.IBaseService; import com.hzya.frame.u8.delivery.entity.DeliveryOrderEntity; import com.hzya.frame.web.entity.JsonResultEntity; @@ -24,5 +25,5 @@ public interface IDeliveryOrderService extends IBaseService<DeliveryOrderEntity, * */ - JsonResultEntity editDelivery(String parm); + JsonResultEntity editDelivery(JSONObject parm); } diff --git a/service/src/main/java/com/hzya/frame/u8/delivery/service/impl/DeliveryOrderServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/delivery/service/impl/DeliveryOrderServiceImpl.java index bda58f4e..2064f0bd 100644 --- a/service/src/main/java/com/hzya/frame/u8/delivery/service/impl/DeliveryOrderServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/u8/delivery/service/impl/DeliveryOrderServiceImpl.java @@ -42,11 +42,16 @@ public class DeliveryOrderServiceImpl extends BaseService<DeliveryOrderEntity,St } @Override - public JsonResultEntity editDelivery(String parm) { - JSONObject jsonObject = JSONObject.parseObject(parm); + public JsonResultEntity editDelivery(JSONObject parm) { + JSONObject jsonObject = parm.getJSONObject("jsonStr"); + logger.info("接收到的参数"+jsonObject.toString()); +// JSONObject jsonObject = JSONObject.parseObject(json); String cdlcode = jsonObject.getString("cdlCode"); + logger.info("发货单号"+cdlcode); String AccId = jsonObject.getString("AccId"); + logger.info("账套号"+AccId); String frozen = jsonObject.getString("frozen"); + logger.info("状态"+frozen); switch (AccId){ case "001": AccId = "UFDATA_001_2023"; @@ -60,28 +65,27 @@ public class DeliveryOrderServiceImpl extends BaseService<DeliveryOrderEntity,St case "005": AccId = "UFDATA_005_2023"; break; - case "021": + case "201": AccId = "UFDATA_201_2023"; break; default: return BaseResult.getFailureMessageEntity("清传入正确的账套号"); } - if("frozen".equals("Y")||"frozen".equals("N")){ - if(StrUtil.isEmpty(cdlcode)){ - return BaseResult.getFailureMessageEntity("发货单号不能为空"); - } - if(StrUtil.isEmpty(AccId)){ - return BaseResult.getFailureMessageEntity("账套号不能为空"); - } - DeliveryOrderEntity entity = new DeliveryOrderEntity(); - entity.setAccId(AccId); - entity.setCdlcode(cdlcode); - entity.setFrozen(frozen); - deliveryOrderDao.update("com.hzya.frame.u8.delivery.dao.impl.DeliveryOrderDaoImpl.entity_update",entity); - return BaseResult.getSuccessMessageEntity("更新成功"); - }else{ - return BaseResult.getFailureMessageEntity("清传入正确的状态Y=冻结 N=解冻"); + + + if(StrUtil.isEmpty(cdlcode)){ + return BaseResult.getFailureMessageEntity("发货单号不能为空"); } + if(StrUtil.isEmpty(AccId)){ + return BaseResult.getFailureMessageEntity("账套号不能为空"); + } + DeliveryOrderEntity entity = new DeliveryOrderEntity(); + entity.setAccId(AccId); + entity.setCdlcode(cdlcode); + entity.setFrozen(frozen); + entity.setDataSourceCode("YONYOUU8"); + deliveryOrderDao.updateDeliveryState(entity); + return BaseResult.getSuccessMessageEntity("更新成功"); } } diff --git a/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.java b/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.java index 8f79a027..5c157668 100644 --- a/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.java +++ b/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.java @@ -25,6 +25,15 @@ private String id;// private String state;// private String AccCode;// private String ids;// + private String syncFlag;//标识 + + public String getSyncFlag() { + return syncFlag; + } + + public void setSyncFlag(String syncFlag) { + this.syncFlag = syncFlag; + } public String getIds() { return ids; diff --git a/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.xml b/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.xml index 836b6b40..80bf940b 100644 --- a/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.xml @@ -11,6 +11,7 @@ <result property="AccCode" column="AccCode" /> <result property="id" column="id" /> <result property="ids" column="ids" /> + <result property="syncFlag" column="sync_flag" /> </resultMap> <sql id="OtherInEntity_Base_Column_List"> @@ -30,7 +31,8 @@ cwhcode, cmaker, ccuscode, - cHandler + cHandler, + sync_flag from UFDATA_001_2023.dbo.RdRecord08 union all @@ -46,7 +48,8 @@ cwhcode, cmaker, ccuscode, - cHandler + cHandler, + sync_flag from UFDATA_002_2024.dbo.RdRecord08 union all @@ -61,7 +64,8 @@ cwhcode, cmaker, ccuscode, - cHandler + cHandler, + sync_flag from UFDATA_004_2024.dbo.RdRecord08 union all @@ -76,7 +80,8 @@ cwhcode, cmaker, ccuscode, - cHandler + cHandler, + sync_flag from UFDATA_005_2024.dbo.RdRecord08 union all @@ -91,16 +96,17 @@ cwhcode, cmaker, ccuscode, - cHandler + cHandler, + sync_flag from UFDATA_201_2023.dbo.RdRecord08 - )m1 where cHandler is not null + )m1 where cHandler is not null and sync_flag is null and AccId = '201' <if test="ids != null and ids != ''">and ids = #{ids} </if> </select> <!--通过主键修改方法--> <update id="entity_update" parameterType="com.hzya.frame.u8.otherin.entity.OtherInEntity"> - update #{AccCode}.dbo.RdRecord08 set sync_flag = #{state} + update ${AccCode}.dbo.RdRecord08 set sync_flag = #{state} where id = #{id} </update> </mapper> diff --git a/service/src/main/java/com/hzya/frame/u8/otherin/service/impl/OtherInServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/otherin/service/impl/OtherInServiceImpl.java index 14baac05..98f29241 100644 --- a/service/src/main/java/com/hzya/frame/u8/otherin/service/impl/OtherInServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/u8/otherin/service/impl/OtherInServiceImpl.java @@ -102,10 +102,10 @@ public class OtherInServiceImpl extends BaseService<OtherInEntity,String> implem logDetails.setNewTransmitInfo(result); logDetails.setNewPushDate(new Date()); logDetails.setRootAppNewData(JSON.toJSONString(sale)); - logDetails.setPluginId("SaleConPlugin"); + logDetails.setPluginId("OtherInPluginInitializer"); JSONObject resultObj = JSON.parseObject(result); - boolean flag = resultObj.getString("code").equals("0"); + boolean flag = resultObj.getString("code").equals("200"); if(flag){ // 推送成功,更新状态 sale.setState("Y"); diff --git a/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutDetailEntity.xml b/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutDetailEntity.xml index d63d9416..765eeaec 100644 --- a/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutDetailEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutDetailEntity.xml @@ -12,51 +12,7 @@ </sql> <select id="entity_list_base" resultMap="get-entity-result" parameterType="com.hzya.frame.u8.otherout.entity.OtherOutDetailEntity"> - select * from ( - - select - '201' as AccId, - 'UFDATA_201_2023' as AccCode, - body.cinvcode, - body.iquantity - from UFDATA_201_2023.dbo.RdRecords09 body - left join UFDATA_201_2023.dbo.TransVouchs on body.iTrIds = TransVouchs.autoID - - UNION ALL - select - '002' as AccId, - 'UFDATA_002_2024' as AccCode, - body.cinvcode, - body.iquantity - from UFDATA_002_2024.dbo.RdRecords09 body - left join UFDATA_002_2024.dbo.TransVouchs on body.iTrIds = TransVouchs.autoID - - UNION ALL - select - '004' as AccId, - 'UFDATA_004_2024' as AccCode, - body.cinvcode, - body.iquantity - from UFDATA_004_2024.dbo.RdRecords09 body - left join UFDATA_004_2024.dbo.TransVouchs on body.iTrIds = TransVouchs.autoID - - UNION ALL - select - '005' as AccId, - 'UFDATA_005_2024' as AccCode, - body.cinvcode, - body.iquantity - from UFDATA_005_2024.dbo.RdRecords09 body - left join UFDATA_005_2024.dbo.TransVouchs on body.iTrIds = TransVouchs.autoID - - UNION ALL - select - '201' as AccId, - 'UFDATA_201_2023' as AccCode, - body.cinvcode, - body.iquantity - from UFDATA_201_2023.dbo.RdRecords09 body - left join UFDATA_201_2023.dbo.TransVouchs on body.iTrIds = TransVouchs.autoID - )m1 +select * from kjs_external.dbo.v_hzya_otherout_details where id = #{id} and AccId = #{AccId} + </select> </mapper> diff --git a/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutEntity.java b/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutEntity.java index ffb372f8..a856829e 100644 --- a/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutEntity.java +++ b/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutEntity.java @@ -25,7 +25,15 @@ public class OtherOutEntity extends BaseEntity { private List<OtherOutDetailEntity>otherOutDetailEntityList; private String AccCode;//账套编码 private String ids;// + private String syncFlag;//标识 + public String getSyncFlag() { + return syncFlag; + } + + public void setSyncFlag(String syncFlag) { + this.syncFlag = syncFlag; + } public String getIds() { return ids; } diff --git a/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutEntity.xml b/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutEntity.xml index 85c9f908..fee18f39 100644 --- a/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutEntity.xml @@ -11,92 +11,19 @@ <result property="AccCode" column="AccCode" /> <result property="id" column="id" /> <result property="ids" column="ids" /> + <result property="syncFlag" column="sync_flag" /> </resultMap> <sql id="OtherOutEntity_Base_Column_List"> </sql> <select id="entity_list_base" resultMap="get-entity-result" parameterType="com.hzya.frame.u8.otherout.entity.OtherOutEntity"> - select * from ( - select - '001' as AccId, - 'UFDATA_001_2023' as AccCode, - id, - '1001'+CAST( id AS VARCHAR(100)) as ids, - ccode, - cbuscode, - crdcode, - cwhcode, - cmaker, - cCusCode, - cHandler - from UFDATA_001_2023.dbo.RdRecord09 - - union all - select - '002' as AccId, - 'UFDATA_002_2024' as AccCode, - id, - '1002'+CAST( id AS VARCHAR(100)) as ids, - ccode, - cbuscode, - crdcode, - cwhcode, - cmaker, - cCusCode, - cHandler - from UFDATA_002_2024.dbo.RdRecord09 - - union all - select - '004' as AccId, - 'UFDATA_004_2024' as AccCode, - id, - '1004'+CAST( id AS VARCHAR(100)) as ids, - ccode, - cbuscode, - crdcode, - cwhcode, - cmaker, - cCusCode, - cHandler - from UFDATA_004_2024.dbo.RdRecord09 - - union all - select - '005' as AccId, - 'UFDATA_005_2024' as AccCode, - id, - '1005'+CAST( id AS VARCHAR(100)) as ids, - ccode, - cbuscode, - crdcode, - cwhcode, - cmaker, - cCusCode, - cHandler - from UFDATA_005_2024.dbo.RdRecord09 - - union all - select - '201' as AccId, - 'UFDATA_201_2023' as AccCode, - id, - '1201'+CAST( id AS VARCHAR(100)) as ids, - ccode, - cbuscode, - crdcode, - cwhcode, - cmaker, - cCusCode, - cHandler - from UFDATA_201_2023.dbo.RdRecord09 - )m1 where cHandler is not null + select * from kjs_external.dbo.v_hzya_otherout <if test="ids != null and ids != ''">and ids = #{ids} </if> </select> <!--通过主键修改方法--> <update id="entity_update" parameterType="com.hzya.frame.u8.otherout.entity.OtherOutEntity"> - update RdRecord09 set sync_flag = #{state} + update ${AccCode}.dbo.RdRecord09 set sync_flag = #{state} where id = #{id} </update> </mapper> diff --git a/service/src/main/java/com/hzya/frame/u8/otherout/service/impl/OtherOutServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/otherout/service/impl/OtherOutServiceImpl.java index 52ed5576..e530f011 100644 --- a/service/src/main/java/com/hzya/frame/u8/otherout/service/impl/OtherOutServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/u8/otherout/service/impl/OtherOutServiceImpl.java @@ -48,8 +48,8 @@ public class OtherOutServiceImpl extends BaseService<OtherOutEntity,String> impl //获取重推信息id,并记录日志 JSONObject requestJsonObj = JSON.parseObject(requestJson.toString(),JSONObject.class); String interId = requestJsonObj.getString("integration_task_living_details_id"); - logger.info("U8销售出库单重推解析后:"+requestJsonObj.toString()); - logger.info("U8销售出库单推送CRM重新执行的任务主键:"+interId); + logger.info("U8其他出库单重推解析后:"+requestJsonObj.toString()); + logger.info("U8其他出库单推送CRM重新执行的任务主键:"+interId); //更换数据源 JsonResultEntity resultEntity = new JsonResultEntity(); @@ -67,7 +67,7 @@ public class OtherOutServiceImpl extends BaseService<OtherOutEntity,String> impl StrUtil.isEmpty(rootAppPk); //如果是重推,是否通过entity传入的id,只能查到一条数据。 List<OtherOutEntity> soleList = otherOutDao.getU8SaleOut(entity); - logger.info("销售出库查询数据{}",JSONObject.toJSONString(soleList)); + logger.info("其他出库查询数据{}",JSONObject.toJSONString(soleList)); if(CollectionUtils.isNotEmpty(soleList)){ soleList.forEach(sale -> { try{ @@ -76,26 +76,26 @@ public class OtherOutServiceImpl extends BaseService<OtherOutEntity,String> impl if(!StrUtil.isEmpty(id)){ OtherOutDetailEntity line = new OtherOutDetailEntity(); line.setId(id); - line.setAccId(id); + line.setAccId(sale.getAccId()); line.setDataSourceCode(requestJson.getString("db_code")); List<OtherOutDetailEntity> lineList = otherOutDetailDao.getU8otherOutLine(line); - logger.info("销售出库单明细查询数据{}",JSONObject.toJSONString(lineList)); + logger.info("其他出库单明细查询数据{}",JSONObject.toJSONString(lineList)); sale.setOtherOutDetailEntityList(lineList); logger.info("组装数据"); JSONObject main = bindingAdd(sale); - logger.info("销售出库推送数据:"+main.toString()); - String result = CrmUtil.sendU8TOCrmEsb(main.toString(), "8000340003"); - logger.info("销售出库推送结果:"+result); + logger.info("其他出库推送数据:"+main.toString()); + String result = CrmUtil.sendU8TOCrmEsb(main.toString(), "8000070011"); + logger.info("其他出库推送结果:"+result); IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); logDetails.setRootAppPk(sale.getIds()); logDetails.setRootAppBill(sale.getCcode()); logDetails.setNewTransmitInfo(result); logDetails.setNewPushDate(new Date()); logDetails.setRootAppNewData(JSON.toJSONString(sale)); - logDetails.setPluginId("SaleConPlugin"); + logDetails.setPluginId("OtherOutPluginInitializer"); JSONObject resultObj = JSON.parseObject(result); - boolean flag = resultObj.getString("code").equals("0"); + boolean flag = resultObj.getString("code").equals("200"); if(flag){ logDetails.setNewTransmitInfo("推送成功"); // 推送成功,更新状态 @@ -115,7 +115,7 @@ public class OtherOutServiceImpl extends BaseService<OtherOutEntity,String> impl otherOutDao.updateState(sale); } } catch (Exception e) { - logger.error("销售出库执行失败"+e.getMessage()); + logger.error("其他出库执行失败"+e.getMessage()); e.printStackTrace(); } }); diff --git a/service/src/main/java/com/hzya/frame/u8/otherreceipt/dao/IOtherReceiptDao.java b/service/src/main/java/com/hzya/frame/u8/otherreceipt/dao/IOtherReceiptDao.java new file mode 100644 index 00000000..1533acbf --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherreceipt/dao/IOtherReceiptDao.java @@ -0,0 +1,37 @@ +package com.hzya.frame.u8.otherreceipt.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.u8.otherreceipt.entity.OtherReceiptEntity; + +import java.util.List; + +/** + * + * @content 其他应收单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface IOtherReceiptDao extends IBaseDao<OtherReceiptEntity,String> { + /** + * + * @content 获取U8销售发票信息 + * @className: Administrator + * @author laborer + * @date 2024-10-18 14:22 + * + */ + + List<OtherReceiptEntity> getU8OtherReceipt(OtherReceiptEntity entity); +/** + * + * @content 修改推送状态 + * @className: Administrator + * @author laborer + * @date 2024-10-18 14:43 + * + */ + + int updateState(OtherReceiptEntity entity); +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherreceipt/dao/IOtherReceiptDetailDao.java b/service/src/main/java/com/hzya/frame/u8/otherreceipt/dao/IOtherReceiptDetailDao.java new file mode 100644 index 00000000..caaa861c --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherreceipt/dao/IOtherReceiptDetailDao.java @@ -0,0 +1,27 @@ +package com.hzya.frame.u8.otherreceipt.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.u8.otherreceipt.entity.OtherReceiptDetailEntity; + +import java.util.List; + +/** + * + * @content 其他应收单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface IOtherReceiptDetailDao extends IBaseDao<OtherReceiptDetailEntity,String> { + /** + * + * @content 获取U8销售发票明细数据 + * @className: Administrator + * @author laborer + * @date 2024-10-18 14:37 + * + */ + + List<OtherReceiptDetailEntity> getU8OtherReceipt(OtherReceiptDetailEntity line); +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherreceipt/dao/impl/OtherReceiptDaoImpl.java b/service/src/main/java/com/hzya/frame/u8/otherreceipt/dao/impl/OtherReceiptDaoImpl.java new file mode 100644 index 00000000..4377849f --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherreceipt/dao/impl/OtherReceiptDaoImpl.java @@ -0,0 +1,32 @@ +package com.hzya.frame.u8.otherreceipt.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.u8.otherreceipt.dao.IOtherReceiptDao; +import com.hzya.frame.u8.otherreceipt.entity.OtherReceiptEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * + * @content 其他应收单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Repository(value = "OtherReceiptDaoImpl") +public class OtherReceiptDaoImpl extends MybatisGenericDao<OtherReceiptEntity,String> implements IOtherReceiptDao { + @DS("#entity.dataSourceCode") + + @Override + public List<OtherReceiptEntity> getU8OtherReceipt(OtherReceiptEntity entity) { + return (List<OtherReceiptEntity>) super.selectList("com.hzya.frame.u8.otherreceipt.dao.impl.OtherReceiptDaoImpl.entity_list_base",entity); + } + @DS("#entity.dataSourceCode") + @Override + public int updateState(OtherReceiptEntity entity) { + return super.update("com.hzya.frame.u8.otherreceipt.dao.impl.OtherReceiptDaoImpl.entity_update", entity); + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherreceipt/dao/impl/OtherReceiptDetailDaoImpl.java b/service/src/main/java/com/hzya/frame/u8/otherreceipt/dao/impl/OtherReceiptDetailDaoImpl.java new file mode 100644 index 00000000..6e38fed4 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherreceipt/dao/impl/OtherReceiptDetailDaoImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.u8.otherreceipt.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.u8.otherreceipt.dao.IOtherReceiptDetailDao; +import com.hzya.frame.u8.otherreceipt.entity.OtherReceiptDetailEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * + * @content 其他应收单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Repository(value = "OtherReceiptDetailDaoImpl") +public class OtherReceiptDetailDaoImpl extends MybatisGenericDao<OtherReceiptDetailEntity,String> implements IOtherReceiptDetailDao { + @DS("#entity.dataSourceCode") + @Override + public List<OtherReceiptDetailEntity> getU8OtherReceipt(OtherReceiptDetailEntity entity) { + return (List<OtherReceiptDetailEntity>) super.selectList("com.hzya.frame.u8.otherreceipt.dao.impl.OtherReceiptDetailDaoImpl.entity_list_base",entity); + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherreceipt/entity/OtherReceiptDetailEntity.java b/service/src/main/java/com/hzya/frame/u8/otherreceipt/entity/OtherReceiptDetailEntity.java new file mode 100644 index 00000000..8d0caca5 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherreceipt/entity/OtherReceiptDetailEntity.java @@ -0,0 +1,95 @@ +package com.hzya.frame.u8.otherreceipt.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * + * @content 其他应收单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public class OtherReceiptDetailEntity extends BaseEntity { + private String AccId;// + private String AccCode;// + private String cinvcode;// + private String cinvname;// + private String iquantity;// + private String cdlcode;// + private String inum;// + private String iAmount_f;// + private String cLink;// + + public String getAccId() { + return AccId; + } + + public void setAccId(String accId) { + AccId = accId; + } + + public String getAccCode() { + return AccCode; + } + + public void setAccCode(String accCode) { + AccCode = accCode; + } + + public String getCinvcode() { + return cinvcode; + } + + public void setCinvcode(String cinvcode) { + this.cinvcode = cinvcode; + } + + public String getCinvname() { + return cinvname; + } + + public void setCinvname(String cinvname) { + this.cinvname = cinvname; + } + + public String getIquantity() { + return iquantity; + } + + public void setIquantity(String iquantity) { + this.iquantity = iquantity; + } + + public String getCdlcode() { + return cdlcode; + } + + public void setCdlcode(String cdlcode) { + this.cdlcode = cdlcode; + } + + public String getInum() { + return inum; + } + + public void setInum(String inum) { + this.inum = inum; + } + + public String getiAmount_f() { + return iAmount_f; + } + + public void setiAmount_f(String iAmount_f) { + this.iAmount_f = iAmount_f; + } + + public String getcLink() { + return cLink; + } + + public void setcLink(String cLink) { + this.cLink = cLink; + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherreceipt/entity/OtherReceiptDetailEntity.xml b/service/src/main/java/com/hzya/frame/u8/otherreceipt/entity/OtherReceiptDetailEntity.xml new file mode 100644 index 00000000..07a3581e --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherreceipt/entity/OtherReceiptDetailEntity.xml @@ -0,0 +1,115 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.hzya.frame.u8.otherreceipt.dao.impl.OtherReceiptDetailDaoImpl"> + <resultMap id="get-entity-result" type="com.hzya.frame.u8.otherreceipt.entity.OtherReceiptDetailEntity"> + <result property="AccId" column="AccId" /> + <result property="AccCode" column="AccCode" /> + <result property="cinvcode" column="cinvcode" /> + <result property="cinvname" column="cinvname" /> + <result property="iquantity" column="iquantity" /> + <result property="cdlcode" column="cdlcode" /> + <result property="inum" column="inum" /> + <result property="iAmount_f" column="iAmount_f" /> + <result property="cLink" column="cLink" /> + + + </resultMap> + <sql id="OtherReceiptDetailEntity_Base_Column_List"> + + </sql> + + <select id="entity_list_base" resultMap="get-entity-result" parameterType="com.hzya.frame.u8.otherreceipt.entity.OtherReceiptDetailEntity"> + select *from ( + + + + select + '001' as AccId, + 'UFDATA_001_2023' as AccCode, + d.cInvCode as cinvcode, + d.cInvName as cinvname, + c.iquantity as iquantity, + e.cDLCode as cdlcode, + c.iNum as inum, + a.iAmount_f as iAmount_f, + a.cLink + from UFDATA_001_2023.dbo.Ap_Vouchs a + LEFT JOIN UFDATA_001_2023.dbo.Ap_Vouch b on a.cLink = b.cLink + LEFT JOIN UFDATA_001_2023.dbo.DispatchLists c on a.cDefine25 = c.iDLsID + left join UFDATA_001_2023.dbo.DispatchList e on c.DLID = e.DLID + LEFT JOIN UFDATA_001_2023.dbo.inventory d on c.cInvCode = d.cInvCode + where b.cVouchType = 'R0' and b.cDigest = '押金单' and a.cDefine25 is not null + union all + select + '002' as AccId, + 'UFDATA_002_2024' as AccCode, + d.cInvCode as cinvcode, + d.cInvName as cinvname, + c.iquantity as iquantity, + e.cDLCode as cdlcode, + c.iNum as inum, + a.iAmount_f as iAmount_f, + a.cLink + from UFDATA_002_2024.dbo.Ap_Vouchs a + LEFT JOIN UFDATA_002_2024.dbo.Ap_Vouch b on a.cLink = b.cLink + LEFT JOIN UFDATA_002_2024.dbo.DispatchLists c on a.cDefine25 = c.iDLsID + left join UFDATA_002_2024.dbo.DispatchList e on c.DLID = e.DLID + LEFT JOIN UFDATA_002_2024.dbo.inventory d on c.cInvCode = d.cInvCode + where b.cVouchType = 'R0' and b.cDigest = '押金单' and a.cDefine25 is not null + union all + select + '004' as AccId, + 'UFDATA_004_2024' as AccCode, + d.cInvCode as cinvcode, + d.cInvName as cinvname, + c.iquantity as iquantity, + e.cDLCode as cdlcode, + c.iNum as inum, + a.iAmount_f as iAmount_f, + a.cLink + from UFDATA_004_2024.dbo.Ap_Vouchs a + LEFT JOIN UFDATA_004_2024.dbo.Ap_Vouch b on a.cLink = b.cLink + LEFT JOIN UFDATA_004_2024.dbo.DispatchLists c on a.cDefine25 = c.iDLsID + left join UFDATA_004_2024.dbo.DispatchList e on c.DLID = e.DLID + LEFT JOIN UFDATA_004_2024.dbo.inventory d on c.cInvCode = d.cInvCode + where b.cVouchType = 'R0' and b.cDigest = '押金单' and a.cDefine25 is not null + union all + select + '005' as AccId, + 'UFDATA_005_2024' as AccCode, + d.cInvCode as cinvcode, + d.cInvName as cinvname, + c.iquantity as iquantity, + e.cDLCode as cdlcode, + c.iNum as inum, + a.iAmount_f as iAmount_f, + a.cLink + from UFDATA_005_2024.dbo.Ap_Vouchs a + LEFT JOIN UFDATA_005_2024.dbo.Ap_Vouch b on a.cLink = b.cLink + LEFT JOIN UFDATA_005_2024.dbo.DispatchLists c on a.cDefine25 = c.iDLsID + left join UFDATA_005_2024.dbo.DispatchList e on c.DLID = e.DLID + LEFT JOIN UFDATA_005_2024.dbo.inventory d on c.cInvCode = d.cInvCode + where b.cVouchType = 'R0' and b.cDigest = '押金单' and a.cDefine25 is not null + union all + select + '201' as AccId, + 'UFDATA_201_2023' as AccCode, + d.cInvCode as cinvcode, + d.cInvName as cinvname, + c.iquantity as iquantity, + e.cDLCode as cdlcode, + c.iNum as inum, + a.iAmount_f as iAmount_f, + a.cLink + from UFDATA_201_2023.dbo.Ap_Vouchs a + LEFT JOIN UFDATA_201_2023.dbo.Ap_Vouch b on a.cLink = b.cLink + LEFT JOIN UFDATA_201_2023.dbo.DispatchLists c on a.cDefine25 = c.iDLsID + left join UFDATA_201_2023.dbo.DispatchList e on c.DLID = e.DLID + LEFT JOIN UFDATA_201_2023.dbo.inventory d on c.cInvCode = d.cInvCode + where b.cVouchType = 'R0' and b.cDigest = '押金单' and a.cDefine25 is not null + )m1 + + + where cLink = #{cLink} and AccId = #{AccId} + </select> +</mapper> diff --git a/service/src/main/java/com/hzya/frame/u8/otherreceipt/entity/OtherReceiptEntity.java b/service/src/main/java/com/hzya/frame/u8/otherreceipt/entity/OtherReceiptEntity.java new file mode 100644 index 00000000..9de0f378 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherreceipt/entity/OtherReceiptEntity.java @@ -0,0 +1,99 @@ +package com.hzya.frame.u8.otherreceipt.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +import java.util.List; + +/** + * + * @content 其他应收单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ + +public class OtherReceiptEntity extends BaseEntity { + private String AccId; + private String AccCode; + private String cvouchid; + private String cCusCode; + private String ids; + private String syncFlag; + private String cLink; + private String state; + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getcLink() { + return cLink; + } + + public void setcLink(String cLink) { + this.cLink = cLink; + } + + public String getAccId() { + return AccId; + } + + public void setAccId(String accId) { + AccId = accId; + } + + public String getAccCode() { + return AccCode; + } + + public void setAccCode(String accCode) { + AccCode = accCode; + } + + public String getCvouchid() { + return cvouchid; + } + + public void setCvouchid(String cvouchid) { + this.cvouchid = cvouchid; + } + + public String getcCusCode() { + return cCusCode; + } + + public void setcCusCode(String cCusCode) { + this.cCusCode = cCusCode; + } + + public String getIds() { + return ids; + } + + public void setIds(String ids) { + this.ids = ids; + } + + public String getSyncFlag() { + return syncFlag; + } + + public void setSyncFlag(String syncFlag) { + this.syncFlag = syncFlag; + } + + private List<OtherReceiptDetailEntity>OtherReceiptDetailEntity; + + public List<com.hzya.frame.u8.otherreceipt.entity.OtherReceiptDetailEntity> getOtherReceiptDetailEntity() { + return OtherReceiptDetailEntity; + } + + public void setOtherReceiptDetailEntity(List<com.hzya.frame.u8.otherreceipt.entity.OtherReceiptDetailEntity> otherReceiptDetailEntity) { + OtherReceiptDetailEntity = otherReceiptDetailEntity; + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherreceipt/entity/OtherReceiptEntity.xml b/service/src/main/java/com/hzya/frame/u8/otherreceipt/entity/OtherReceiptEntity.xml new file mode 100644 index 00000000..5f7f272c --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherreceipt/entity/OtherReceiptEntity.xml @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.hzya.frame.u8.otherreceipt.dao.impl.OtherReceiptDaoImpl"> + <resultMap id="get-entity-result" type="com.hzya.frame.u8.otherreceipt.entity.OtherReceiptEntity"> + <result property="AccId" column="AccId" /> + <result property="AccCode" column="AccCode" /> + <result property="cvouchid" column="cvouchid" /> + <result property="cCusCode" column="cCusCode" /> + <result property="ids" column="ids" /> + <result property="syncFlag" column="sync_flag" /> + <result property="cLink" column="cLink" /> + </resultMap> + <sql id="OtherReceiptEntity_Base_Column_List"> + + </sql> + + <select id="entity_list_base" resultMap="get-entity-result" parameterType="com.hzya.frame.u8.otherreceipt.entity.OtherReceiptEntity"> + select * from ( + select + '001' as AccId, + 'UFDATA_001_2023' as AccCode, + '1001'+CAST( cLink AS VARCHAR(100)) as ids, + cLink, + cVouchID as cvouchid, + cDwCode as cCusCode, + sync_flag, + cCheckMan + + from UFDATA_001_2023.dbo.Ap_Vouch + where cVouchType = 'R0' and cDigest = '押金单' + + UNION ALL + + select + '002' as AccId, + 'UFDATA_002_2024' as AccCode, + '1002'+CAST( cLink AS VARCHAR(100)) as ids, + cLink, + cVouchID as cvouchid, + cDwCode as cCusCode, + sync_flag, + cCheckMan + + from UFDATA_002_2024.dbo.Ap_Vouch + where cVouchType = 'R0' and cDigest = '押金单' + + + UNION ALL + + select + '004' as AccId, + 'UFDATA_004_2024' as AccCode, + '1004'+CAST( cLink AS VARCHAR(100)) as ids, + cLink, + cVouchID as cvouchid, + cDwCode as cCusCode, + sync_flag, + cCheckMan + + from UFDATA_004_2024.dbo.Ap_Vouch + where cVouchType = 'R0' and cDigest = '押金单' + + UNION ALL + + select + '005' as AccId, + 'UFDATA_005_2024' as AccCode, + '1005'+CAST( cLink AS VARCHAR(100)) as ids, + cLink, + cVouchID as cvouchid, + cDwCode as cCusCode, + sync_flag, + cCheckMan + + from UFDATA_005_2024.dbo.Ap_Vouch + where cVouchType = 'R0' and cDigest = '押金单' + + UNION ALL + + select + '201' as AccId, + 'UFDATA_201_2023' as AccCode, + '1201'+CAST( cLink AS VARCHAR(100)) as ids, + cLink, + cVouchID as cvouchid, + cDwCode as cCusCode, + sync_flag, + cCheckMan + from UFDATA_201_2023.dbo.Ap_Vouch + where cVouchType = 'R0' and cDigest = '押金单' + + )m1 where cCusCode not in ('001','002','004','005') and cCheckMan is not null and AccId = '201' and sync_flag is null + <if test="ids != null and ids != ''">and ids = #{ids} </if> + + </select> + + <!--通过主键修改方法--> + <update id="entity_update" parameterType="com.hzya.frame.u8.otherreceipt.entity.OtherReceiptEntity"> + update ${AccCode}.dbo.Ap_Vouch set sync_flag = #{state} + where cLink = #{cLink} + </update> + +</mapper> diff --git a/service/src/main/java/com/hzya/frame/u8/otherreceipt/service/IOtherReceiptDetaiService.java b/service/src/main/java/com/hzya/frame/u8/otherreceipt/service/IOtherReceiptDetaiService.java new file mode 100644 index 00000000..3abb6934 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherreceipt/service/IOtherReceiptDetaiService.java @@ -0,0 +1,15 @@ +package com.hzya.frame.u8.otherreceipt.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.u8.otherreceipt.entity.OtherReceiptDetailEntity; + +/** + * + * @content 其他应收单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface IOtherReceiptDetaiService extends IBaseService<OtherReceiptDetailEntity,String> { +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherreceipt/service/IOtherReceiptService.java b/service/src/main/java/com/hzya/frame/u8/otherreceipt/service/IOtherReceiptService.java new file mode 100644 index 00000000..212ac169 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherreceipt/service/IOtherReceiptService.java @@ -0,0 +1,27 @@ +package com.hzya.frame.u8.otherreceipt.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.u8.otherreceipt.entity.OtherReceiptEntity; + +/** + * + * @content 其他应收单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface IOtherReceiptService extends IBaseService<OtherReceiptEntity,String> { +/** + * + * @content 获取其他应收单数据,并推送到CRM + * @param requestJson + * @className: Administrator + * @author laborer + * @date 2024-10-18 13:48 + * + */ + + void getU8otherReceiptToCrm(JSONObject requestJson); +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherreceipt/service/impl/OtherReceiptDetaiServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/otherreceipt/service/impl/OtherReceiptDetaiServiceImpl.java new file mode 100644 index 00000000..15890863 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherreceipt/service/impl/OtherReceiptDetaiServiceImpl.java @@ -0,0 +1,23 @@ +package com.hzya.frame.u8.otherreceipt.service.impl; + +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.u8.otherreceipt.entity.OtherReceiptDetailEntity; +import com.hzya.frame.u8.otherreceipt.service.IOtherReceiptDetaiService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.stereotype.Service; + +/** + * + * @content 销售发票 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Service(value = "OtherReceiptDetaiServiceImpl") +public class OtherReceiptDetaiServiceImpl extends BaseService<OtherReceiptDetailEntity,String> implements IOtherReceiptDetaiService { + Logger logger = LogManager.getLogger(getClass()); + + +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherreceipt/service/impl/OtherReceiptServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/otherreceipt/service/impl/OtherReceiptServiceImpl.java new file mode 100644 index 00000000..95eb0269 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherreceipt/service/impl/OtherReceiptServiceImpl.java @@ -0,0 +1,194 @@ +package com.hzya.frame.u8.otherreceipt.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.crm.util.CrmUtil; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.u8.otherreceipt.dao.IOtherReceiptDao; +import com.hzya.frame.u8.otherreceipt.dao.IOtherReceiptDetailDao; +import com.hzya.frame.u8.otherreceipt.entity.OtherReceiptDetailEntity; +import com.hzya.frame.u8.otherreceipt.entity.OtherReceiptEntity; +import com.hzya.frame.u8.otherreceipt.service.IOtherReceiptService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * + * @content 其他应收单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Service(value = "OtherReceiptServiceImpl") +public class OtherReceiptServiceImpl extends BaseService<OtherReceiptEntity,String> implements IOtherReceiptService { + Logger logger = LogManager.getLogger(getClass()); + @Autowired + private IOtherReceiptDao otherReceiptDao; + @Autowired + private IOtherReceiptDetailDao otherReceiptDetailDao; + @Resource + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + @Override + public void getU8otherReceiptToCrm(JSONObject requestJson) { + //获取重推信息id,并记录日志 + JSONObject requestJsonObj = JSON.parseObject(requestJson.toString(),JSONObject.class); + String interId = requestJsonObj.getString("integration_task_living_details_id"); + logger.info("U8其他应收单重推解析后:"+requestJsonObj.toString()); + logger.info("U8其他应收单推送CRM重新执行的任务主键:"+interId); + + //更换数据源 + JsonResultEntity resultEntity = new JsonResultEntity(); + OtherReceiptEntity entity = new OtherReceiptEntity(); + requestJson.put("db_code","YONYOUU8"); + entity.setDataSourceCode(requestJson.getString("db_code")); + + //根据重推信息id,查询该条重推记录信息 + IntegrationTaskLivingDetailsEntity oldMsg = new IntegrationTaskLivingDetailsEntity(); + if(StrUtil.isNotEmpty(interId)){ + oldMsg = taskLivingDetailsService.get(interId); + } + String rootAppPk = oldMsg.getRootAppPk(); + entity.setIds(rootAppPk); + StrUtil.isEmpty(rootAppPk);//entity.setQueryState("查询"); + //如果是重推,是否通过entity传入的id,只能查到一条数据。 + //entity.setId("-8845102890648320822"); + List<OtherReceiptEntity> soleList = otherReceiptDao.getU8OtherReceipt(entity); + logger.info("其他应收单查询数据{}",JSONObject.toJSONString(soleList)); + if(CollectionUtils.isNotEmpty(soleList)){ + soleList.forEach(sale -> { + try{ + //获取明细数据进行拼接 + String id = sale.getcLink(); + if(!StrUtil.isEmpty(id)){ + OtherReceiptDetailEntity line = new OtherReceiptDetailEntity(); + logger.info("其他应收单对象{}",JSONObject.toJSONString(sale)); + line.setcLink(id); + line.setAccId(sale.getAccId()); + line.setDataSourceCode(requestJson.getString("db_code")); + logger.info("其他应收单明细查询{}",JSONObject.toJSONString(line)); + List<OtherReceiptDetailEntity> lineList = otherReceiptDetailDao.getU8OtherReceipt(line); + logger.info("其他应收单明细查询数据{}",JSONObject.toJSONString(lineList)); + sale.setOtherReceiptDetailEntity(lineList); + logger.info("组装数据"); + JSONObject main = bindingAdd(sale); + logger.info("其他应收单推送数据:"+main.toString()); + String result = CrmUtil.sendU8TOCrmEsb(main.toString(), "8000070013"); + logger.info("其他应收单推送结果:"+result); + IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); + logDetails.setRootAppPk(sale.getIds()); + logDetails.setRootAppBill(sale.getCvouchid()); + logDetails.setNewTransmitInfo(result); + logDetails.setNewPushDate(new Date()); + logDetails.setRootAppNewData(JSON.toJSONString(sale)); + logDetails.setPluginId("OtherReceiptPluginInitializer"); + + JSONObject resultObj = JSON.parseObject(result); + boolean flag = resultObj.getString("code").equals("200"); + if(flag){ + logDetails.setNewTransmitInfo("推送成功"); + // 推送成功,更新状态 + sale.setState("Y"); + }else{ + // 推送失败 + sale.setState("N"); + } + sale.setDataSourceCode(requestJson.getString("db_code")); + try{ + saveLog(interId, logDetails, flag); + }catch (Exception e){ + logger.error("保存日志失败"+e.getMessage()); + otherReceiptDao.updateState(sale); + e.printStackTrace(); + } + otherReceiptDao.updateState(sale); + } + } catch (Exception e) { + logger.error("其他应收单执行失败"+e.getMessage()); + e.printStackTrace(); + } + }); + + } + } + /** + * + * @content 保存日志信息 + * @className: Administrator + * @author laborer + * @date 2024-10-18 11:27 + * + */ + + private void saveLog(String interId, IntegrationTaskLivingDetailsEntity logDetails, boolean flag) throws Exception { + if(StrUtil.isEmpty(interId)){ + if(flag){ + //首推成功 + taskLivingDetailsService.saveLogToSuccess(logDetails); + }else{ + //首推失败 + taskLivingDetailsService.saveLogToFail(logDetails); + } + }else{ + logDetails.setId(interId); + if(flag){ + //重推成功 + taskLivingDetailsService.saveLogFailToSuccess(logDetails); + }else{ + //重推失败,把失败信息,更新到重推表中 + taskLivingDetailsService.updateLogFailToSuccess(logDetails); + } + } + } + + /** + * + * @content 组装推送参数 + * @className: Administrator + * @author laborer + * @date 2024-10-18 11:13 + * + */ + + private JSONObject bindingAdd(OtherReceiptEntity sale) { + JSONObject main = new JSONObject(); + main.put("AccId",sale.getAccId()); + main.put("billid",sale.getId()); + main.put("LoginDate", DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); + JSONObject head = new JSONObject(); + head.put("cvouchid",sale.getCvouchid()); + head.put("syncFlag",""); + JSONArray body = new JSONArray(); + main.put("head",head); + List<OtherReceiptDetailEntity> lineList = sale.getOtherReceiptDetailEntity(); + if(CollectionUtils.isNotEmpty(lineList)){ + lineList.forEach(line -> { + JSONObject lineObj = new JSONObject(); + lineObj.put("cinvcode",line.getCinvcode()); + lineObj.put("cinvname",line.getCinvname()); + lineObj.put("iquantity",line.getIquantity()); + lineObj.put("inum",line.getInum()); + lineObj.put("iamount_f",line.getiAmount_f()); + lineObj.put("cdlcode",line.getCdlcode()); + + + body.add(lineObj); + }); + } + main.put("body",body); + return main; + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptDetailEntity.xml b/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptDetailEntity.xml index a63ae040..44417089 100644 --- a/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptDetailEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptDetailEntity.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -<mapper namespace="com.hzya.frame.u8.receipt.dao.impl.receiptDetailDaoImpl"> +<mapper namespace="com.hzya.frame.u8.receipt.dao.impl.ReceiptDetailDaoImpl"> <resultMap id="get-entity-result" type="com.hzya.frame.u8.receipt.entity.ReceiptDetailEntity"> <result property="dlid" column="dlid" /> </resultMap> diff --git a/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptEntity.xml b/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptEntity.xml index 2fa5e46c..2314e1e7 100644 --- a/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptEntity.xml @@ -10,7 +10,7 @@ <result property="ccusname" column="ccusname" /> <result property="iamount_f" column="iamount_f" /> <result property="csscode" column="csscode" /> - <result property="syncFlag" column="syncFlag" /> + <result property="syncFlag" column="sync_flag" /> <result property="AccId" column="AccId" /> <result property="AccCode" column="AccCode" /> <result property="ids" column="ids" /> @@ -22,7 +22,7 @@ <select id="entity_list_base" resultMap="get-entity-result" parameterType="com.hzya.frame.u8.receipt.entity.ReceiptEntity"> select * from ( - select + select '001' as AccId, 'UFDATA_001_2023' as AccCode, head.iID, @@ -31,12 +31,16 @@ head.dvouchdate, customer.ccuscode, customer.ccusname, - head.iamount_f, - head.csscode, - 'Y' as syncFlag, + case + when cVouchType ='49' then '-'+CAST(iamount_f AS VARCHAR(20)) + when cVouchType ='48' then iamount_f + end as iamount_f, + SettleStyle.cSSName as csscode, + sync_flag, cCheckMan from UFDATA_001_2023.dbo.Ap_CloseBill head left join UFDATA_001_2023.dbo.customer customer on cDwCode = customer.ccuscode + left join UFDATA_001_2023.dbo.SettleStyle SettleStyle on head.csscode = SettleStyle.csscode UNION ALL @@ -49,12 +53,16 @@ head.dvouchdate, customer.ccuscode, customer.ccusname, - head.iamount_f, - head.csscode, - 'Y' as syncFlag, + case + when cVouchType ='49' then '-'+CAST(iamount_f AS VARCHAR(20)) + when cVouchType ='48' then iamount_f + end as iamount_f, + SettleStyle.cSSName as csscode, + sync_flag, cCheckMan from UFDATA_002_2024.dbo.Ap_CloseBill head - left join UFDATA_002_2024.dbo.customer customer on cDwCode = customer.ccuscode + left join UFDATA_002_2024.dbo.customer customer on cDwCode = customer.ccuscode + left join UFDATA_002_2024.dbo.SettleStyle SettleStyle on head.csscode = SettleStyle.csscode UNION ALL @@ -67,13 +75,16 @@ head.dvouchdate, customer.ccuscode, customer.ccusname, - head.iamount_f, - head.csscode, - 'Y' as syncFlag, + case + when cVouchType ='49' then '-'+CAST(iamount_f AS VARCHAR(20)) + when cVouchType ='48' then iamount_f + end as iamount_f, + SettleStyle.cSSName as csscode, + sync_flag, cCheckMan from UFDATA_004_2024.dbo.Ap_CloseBill head - left join UFDATA_004_2024.dbo.customer customer on cDwCode = customer.ccuscode - + left join UFDATA_004_2024.dbo.customer customer on cDwCode = customer.ccuscode + left join UFDATA_004_2024.dbo.SettleStyle SettleStyle on head.csscode = SettleStyle.csscode UNION ALL select @@ -85,13 +96,16 @@ head.dvouchdate, customer.ccuscode, customer.ccusname, - head.iamount_f, - head.csscode, - 'Y' as syncFlag, + case + when cVouchType ='49' then '-'+CAST(iamount_f AS VARCHAR(20)) + when cVouchType ='48' then iamount_f + end as iamount_f, + SettleStyle.cSSName as csscode, + sync_flag, cCheckMan from UFDATA_005_2024.dbo.Ap_CloseBill head - left join UFDATA_005_2024.dbo.customer customer on cDwCode = customer.ccuscode - + left join UFDATA_005_2024.dbo.customer customer on cDwCode = customer.ccuscode + left join UFDATA_005_2024.dbo.SettleStyle SettleStyle on head.csscode = SettleStyle.csscode UNION ALL select @@ -103,19 +117,23 @@ head.dvouchdate, customer.ccuscode, customer.ccusname, - head.iamount_f, - head.csscode, - 'Y' as syncFlag, + case + when cVouchType ='49' then '-'+CAST(iamount_f AS VARCHAR(20)) + when cVouchType ='48' then iamount_f + end as iamount_f, + SettleStyle.cSSName as csscode, + sync_flag, cCheckMan from UFDATA_201_2023.dbo.Ap_CloseBill head - left join UFDATA_201_2023.dbo.customer customer on cDwCode = customer.ccuscode - )m1 where cCusCode not in ('001','002','004','005') and cCheckMan is not null + left join UFDATA_201_2023.dbo.customer customer on cDwCode = customer.ccuscode + left join UFDATA_201_2023.dbo.SettleStyle SettleStyle on head.csscode = SettleStyle.csscode + )m1 where cCusCode not in ('001','002','004','005') and cCheckMan is not null and sync_flag is null and AccId = '201' <if test="ids != null and ids != ''">and ids = #{ids} </if> </select> <!--通过主键修改方法--> <update id="entity_update" parameterType="com.hzya.frame.u8.receipt.entity.ReceiptEntity"> - update #{AccCode}.dbo.Ap_CloseBill set sync_flag = #{state} + update ${AccCode}.dbo.Ap_CloseBill set sync_flag = #{state} where iID = #{iID} </update> </mapper> diff --git a/service/src/main/java/com/hzya/frame/u8/receipt/service/impl/ReceiptServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/receipt/service/impl/ReceiptServiceImpl.java index b36f983e..12e88e3d 100644 --- a/service/src/main/java/com/hzya/frame/u8/receipt/service/impl/ReceiptServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/u8/receipt/service/impl/ReceiptServiceImpl.java @@ -62,8 +62,15 @@ public class ReceiptServiceImpl extends BaseService<ReceiptEntity,String> implem StrUtil.isEmpty(rootAppPk);//entity.setQueryState("查询"); //如果是重推,是否通过entity传入的id,只能查到一条数据。 //entity.setId("-8845102890648320822"); - List<ReceiptEntity> soleList = saleOutDao.getU8Receipt(entity); - logger.info("销售出库查询数据{}",JSONObject.toJSONString(soleList)); + List<ReceiptEntity> soleList = null; + try { + soleList = saleOutDao.getU8Receipt(entity); + } catch (Exception e) { + logger.info("销售收款单查询失败"+e); + logger.info("销售收款单查询失败1"+e.getMessage()); + throw new RuntimeException(e); + } + logger.info("销售收款单查询数据{}",JSONObject.toJSONString(soleList)); if(CollectionUtils.isNotEmpty(soleList)){ soleList.forEach(sale -> { try{ @@ -72,19 +79,19 @@ public class ReceiptServiceImpl extends BaseService<ReceiptEntity,String> implem if(!StrUtil.isEmpty(id)){ logger.info("组装数据"); JSONObject main = bindingAdd(sale); - logger.info("销售出库推送数据:"+main.toString()); - String result = CrmUtil.sendU8TOCrmEsb(main.toString(), "8000340003"); - logger.info("销售出库推送结果:"+result); + logger.info("销售收款单推送数据:"+main.toString()); + String result = CrmUtil.sendU8TOCrmEsb(main.toString(), "8000070010"); + logger.info("销售收款单推送结果:"+result); IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); logDetails.setRootAppPk(sale.getIds()); logDetails.setRootAppBill(sale.getCvouchid()); logDetails.setNewTransmitInfo(result); logDetails.setNewPushDate(new Date()); logDetails.setRootAppNewData(JSON.toJSONString(sale)); - logDetails.setPluginId("SaleConPlugin"); + logDetails.setPluginId("ReceiptPluginInitializer"); JSONObject resultObj = JSON.parseObject(result); - boolean flag = resultObj.getString("code").equals("0"); + boolean flag = resultObj.getString("code").equals("200"); if(flag){ logDetails.setNewTransmitInfo("推送成功"); // 推送成功,更新状态 @@ -104,7 +111,7 @@ public class ReceiptServiceImpl extends BaseService<ReceiptEntity,String> implem saleOutDao.updateState(sale); } } catch (Exception e) { - logger.error("销售出库执行失败"+e.getMessage()); + logger.error("销售收款单执行失败"+e.getMessage()); e.printStackTrace(); } }); @@ -159,7 +166,7 @@ public class ReceiptServiceImpl extends BaseService<ReceiptEntity,String> implem head.put("cvouchid",sale.getCvouchid()); head.put("dvouchdate",sale.getDvouchdate()); head.put("ccuscode",sale.getCcuscode()); - head.put("iamount",sale.getCcusname()); + head.put("iamount_f",sale.getIamount_f()); head.put("csscode",sale.getCsscode()); head.put("syncFlag",sale.getSyncFlag()); main.put("head",head); diff --git a/service/src/main/java/com/hzya/frame/u8/saleinv/dao/impl/SaleInvDaoImpl.java b/service/src/main/java/com/hzya/frame/u8/saleinv/dao/impl/SaleInvDaoImpl.java index df12cd47..436b8d72 100644 --- a/service/src/main/java/com/hzya/frame/u8/saleinv/dao/impl/SaleInvDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/u8/saleinv/dao/impl/SaleInvDaoImpl.java @@ -24,7 +24,7 @@ public class SaleInvDaoImpl extends MybatisGenericDao<SaleInvEntity,String> impl public List<SaleInvEntity> getU8SaleInv(SaleInvEntity entity) { return (List<SaleInvEntity>) super.selectList("com.hzya.frame.u8.saleinv.dao.impl.SaleInvDaoImpl.entity_list_base",entity); } - + @DS("#entity.dataSourceCode") @Override public int updateState(SaleInvEntity entity) { return super.update("com.hzya.frame.u8.saleinv.dao.impl.SaleInvDaoImpl.entity_update", entity); diff --git a/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvDetailEntity.java b/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvDetailEntity.java index 9f4925de..de6091af 100644 --- a/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvDetailEntity.java +++ b/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvDetailEntity.java @@ -17,6 +17,24 @@ public class SaleInvDetailEntity extends BaseEntity { private String SBVID;//主表主键 private String AccCode;//账套编码 private String AccId;//账套号 + private String cbdlcode;// + private String iexchsum;// + + public String getIexchsum() { + return iexchsum; + } + + public void setIexchsum(String iexchsum) { + this.iexchsum = iexchsum; + } + + public String getCbdlcode() { + return cbdlcode; + } + + public void setCbdlcode(String cbdlcode) { + this.cbdlcode = cbdlcode; + } public String getAccCode() { return AccCode; diff --git a/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvDetailEntity.xml b/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvDetailEntity.xml index 81564d34..eef99345 100644 --- a/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvDetailEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvDetailEntity.xml @@ -16,56 +16,8 @@ <select id="entity_list_base" resultMap="get-entity-result" parameterType="com.hzya.frame.u8.saleinv.entity.SaleInvDetailEntity"> -- 销售发票子表 - select * from ( - select - '001' as AccId, - 'UFDATA_001_2023' as AccCode, - cbdlcode , - DispatchLists.iexchsum, - DispatchLists.irowno as idlrowno - from UFDATA_001_2023.dbo.SaleBillVouchs Vouchs - left join UFDATA_001_2023.dbo.DispatchLists on Vouchs.iDLsID = DispatchLists.AutoID - - union all - select - '002' as AccId, - 'UFDATA_002_2024' as AccCode, - cbdlcode , - DispatchLists.iexchsum, - DispatchLists.irowno as idlrowno - from UFDATA_002_2024.dbo.SaleBillVouchs Vouchs - left join UFDATA_002_2024.dbo.DispatchLists on Vouchs.iDLsID = DispatchLists.AutoID - union all - select - '004' as AccId, - 'UFDATA_004_2024' as AccCode, - cbdlcode , - DispatchLists.iexchsum, - DispatchLists.irowno as idlrowno - from UFDATA_004_2024.dbo.SaleBillVouchs Vouchs - left join UFDATA_004_2024.dbo.DispatchLists on Vouchs.iDLsID = DispatchLists.AutoID - - union all - select - '005' as AccId, - 'UFDATA_005_2024' as AccCode, - cbdlcode , - DispatchLists.iexchsum, - DispatchLists.irowno as idlrowno - from UFDATA_005_2024.dbo.SaleBillVouchs Vouchs - left join UFDATA_005_2024.dbo.DispatchLists on Vouchs.iDLsID = DispatchLists.AutoID - - union all - select - '201' as AccId, - 'UFDATA_201_2023' as AccCode, - cbdlcode , - DispatchLists.iexchsum, - DispatchLists.irowno as idlrowno - from UFDATA_201_2023.dbo.SaleBillVouchs Vouchs - left join UFDATA_201_2023.dbo.DispatchLists on Vouchs.iDLsID = DispatchLists.AutoID - )m1 +select * from kjs_external.dbo.v_hzya_saleinv_details where SBVID = #{SBVID} and AccId = #{AccId} </select> diff --git a/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvEntity.xml b/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvEntity.xml index 887ad0da..44122ca5 100644 --- a/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvEntity.xml @@ -9,100 +9,21 @@ <result property="AccId" column="AccId" /> <result property="AccCode" column="AccCode" /> <result property="ids" column="ids" /> - +<result property="syncFlag" column="sync_flag" /> </resultMap> <sql id="SaleInvEntity_Base_Column_List"> </sql> <select id="entity_list_base" resultMap="get-entity-result" parameterType="com.hzya.frame.u8.saleinv.entity.SaleInvEntity"> - select * from ( - select - '001' as AccId, - 'UFDATA_001_2023' as AccCode, - main.SBVID, - '1001'+CAST(main.SBVID AS VARCHAR(100)) as ids, - main.csbvcode, - main.ddate, - sum(line.isum) as isum, - cCusCode, - cVerifier - from UFDATA_001_2023.dbo.SaleBillVouch main - left join UFDATA_001_2023.dbo.SaleBillVouchs line on main.SBVID = line.SBVID - GROUP BY main.csbvcode,main.ddate,main.SBVID,cCusCode, - cVerifier - - union all - select - '002' as AccId, - 'UFDATA_002_2024' as AccCode, - main.SBVID, - '1002'+CAST(main.SBVID AS VARCHAR(100)) as ids, - main.csbvcode, - main.ddate, - sum(line.isum) as isum, - cCusCode, - cVerifier - from UFDATA_002_2024.dbo.SaleBillVouch main - left join UFDATA_002_2024.dbo.SaleBillVouchs line on main.SBVID = line.SBVID - GROUP BY main.csbvcode,main.ddate,main.SBVID,cCusCode, - cVerifier - - union all - select - '004' as AccId, - 'UFDATA_004_2024' as AccCode, - main.SBVID, - '1004'+CAST(main.SBVID AS VARCHAR(100)) as ids, - main.csbvcode, - main.ddate, - sum(line.isum) as isum, - cCusCode, - cVerifier - from UFDATA_004_2024.dbo.SaleBillVouch main - left join UFDATA_004_2024.dbo.SaleBillVouchs line on main.SBVID = line.SBVID - GROUP BY main.csbvcode,main.ddate,main.SBVID,cCusCode, - cVerifier - - union all - select - '005' as AccId, - 'UFDATA_005_2024' as AccCode, - main.SBVID, - '1005'+CAST(main.SBVID AS VARCHAR(100)) as ids, - main.csbvcode, - main.ddate, - sum(line.isum) as isum, - cCusCode, - cVerifier - from UFDATA_005_2024.dbo.SaleBillVouch main - left join UFDATA_005_2024.dbo.SaleBillVouchs line on main.SBVID = line.SBVID - GROUP BY main.csbvcode,main.ddate,main.SBVID,cCusCode, - cVerifier - - union all - select - '201' as AccId, - 'UFDATA_201_2023' as AccCode, - main.SBVID, - '1201'+CAST(main.SBVID AS VARCHAR(100)) as ids, - main.csbvcode, - main.ddate, - sum(line.isum) as isum, - cCusCode, - cVerifier - from UFDATA_201_2023.dbo.SaleBillVouch main - left join UFDATA_201_2023.dbo.SaleBillVouchs line on main.SBVID = line.SBVID - GROUP BY main.csbvcode,main.ddate,main.SBVID,cCusCode, - cVerifier - )m1 where cCusCode not in ('001','002','004','005') and cVerifier is not null + select * from kjs_external.dbo.v_hzya_saleinv <if test="ids != null and ids != ''">and ids = #{ids} </if> </select> <!--通过主键修改方法--> <update id="entity_update" parameterType="com.hzya.frame.u8.saleinv.entity.SaleInvEntity"> - update #{AccCode}.dbo.SaleBillVouch set sync_flag = #{state} + update ${AccCode}.dbo.SaleBillVouch set sync_flag = #{state} where SBVID = #{SBVID} </update> diff --git a/service/src/main/java/com/hzya/frame/u8/saleinv/service/impl/SaleInvServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/saleinv/service/impl/SaleInvServiceImpl.java index 76cffc9a..b25a47ad 100644 --- a/service/src/main/java/com/hzya/frame/u8/saleinv/service/impl/SaleInvServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/u8/saleinv/service/impl/SaleInvServiceImpl.java @@ -78,7 +78,7 @@ public class SaleInvServiceImpl extends BaseService<SaleInvEntity,String> implem if(!StrUtil.isEmpty(id)){ SaleInvDetailEntity line = new SaleInvDetailEntity(); line.setSBVID(id); - line.setAccId(id); + line.setAccId(sale.getAccId()); line.setDataSourceCode(requestJson.getString("db_code")); List<SaleInvDetailEntity> lineList = saleInvDetailDao.getU8InvDetail(line); logger.info("销售发票单明细查询数据{}",JSONObject.toJSONString(lineList)); @@ -86,7 +86,7 @@ public class SaleInvServiceImpl extends BaseService<SaleInvEntity,String> implem logger.info("组装数据"); JSONObject main = bindingAdd(sale); logger.info("销售发票推送数据:"+main.toString()); - String result = CrmUtil.sendU8TOCrmEsb(main.toString(), "8000340003"); + String result = CrmUtil.sendU8TOCrmEsb(main.toString(), "8000070014"); logger.info("销售发票推送结果:"+result); IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); logDetails.setRootAppPk(sale.getIds()); @@ -94,10 +94,10 @@ public class SaleInvServiceImpl extends BaseService<SaleInvEntity,String> implem logDetails.setNewTransmitInfo(result); logDetails.setNewPushDate(new Date()); logDetails.setRootAppNewData(JSON.toJSONString(sale)); - logDetails.setPluginId("SaleConPlugin"); + logDetails.setPluginId("SaleInvPluginInitializer"); JSONObject resultObj = JSON.parseObject(result); - boolean flag = resultObj.getString("code").equals("0"); + boolean flag = resultObj.getString("code").equals("200"); if(flag){ logDetails.setNewTransmitInfo("推送成功"); // 推送成功,更新状态 diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/dao/impl/SaleOutDaoImpl.java b/service/src/main/java/com/hzya/frame/u8/saleout/dao/impl/SaleOutDaoImpl.java index cac9899e..a188e924 100644 --- a/service/src/main/java/com/hzya/frame/u8/saleout/dao/impl/SaleOutDaoImpl.java +++ b/service/src/main/java/com/hzya/frame/u8/saleout/dao/impl/SaleOutDaoImpl.java @@ -23,6 +23,6 @@ public class SaleOutDaoImpl extends MybatisGenericDao<SaleOutEntity,String> impl @DS("#entity.dataSourceCode") @Override public int updateState(SaleOutEntity entity) { - return super.update("com.hzya.frame.u8.saleout.dao.impl.SaleOutDaoImpl.entity_list_base",entity); + return super.update("com.hzya.frame.u8.saleout.dao.impl.SaleOutDaoImpl.entity_update",entity); } } diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutDetailEntity.xml b/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutDetailEntity.xml index 7ec7acfb..c87430da 100644 --- a/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutDetailEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutDetailEntity.xml @@ -14,65 +14,70 @@ -- 销售出库单子表 select * from ( select + id, '001' as AccId, 'UFDATA_001_2023' as AccCode, inv.cinvcode, inv.cinvname, iquantity, inum, - irowno as idlrowno + cbdlcode as idlrowno from UFDATA_001_2023.dbo.rdrecords32 main left join UFDATA_001_2023.dbo.inventory inv on main.cinvcode = inv.cinvcode union all select + id, '002' as AccId, 'UFDATA_002_2024' as AccCode, inv.cinvcode, inv.cinvname, iquantity, inum, - irowno as idlrowno + cbdlcode as idlrowno from UFDATA_002_2024.dbo.rdrecords32 main left join UFDATA_002_2024.dbo.inventory inv on main.cinvcode = inv.cinvcode union all select + id, '004' as AccId, 'UFDATA_004_2024' as AccCode, inv.cinvcode, inv.cinvname, iquantity, inum, - irowno as idlrowno + cbdlcode as idlrowno from UFDATA_004_2024.dbo.rdrecords32 main left join UFDATA_004_2024.dbo.inventory inv on main.cinvcode = inv.cinvcode union all select + id, '005' as AccId, 'UFDATA_005_2024' as AccCode, inv.cinvcode, inv.cinvname, iquantity, inum, - irowno as idlrowno + cbdlcode as idlrowno from UFDATA_005_2024.dbo.rdrecords32 main left join UFDATA_005_2024.dbo.inventory inv on main.cinvcode = inv.cinvcode union all select + id, '201' as AccId, 'UFDATA_201_2023' as AccCode, inv.cinvcode, inv.cinvname, iquantity, inum, - irowno as idlrowno + cbdlcode as idlrowno from UFDATA_201_2023.dbo.rdrecords32 main left join UFDATA_201_2023.dbo.inventory inv on main.cinvcode = inv.cinvcode )m1 diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutEntity.java b/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutEntity.java index ace3d86d..ed99586c 100644 --- a/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutEntity.java +++ b/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutEntity.java @@ -24,7 +24,24 @@ public class SaleOutEntity extends BaseEntity { private String state;//状态 private String AccCode;//账套编码 private String ids;// + private String syncFlag;//标识 + private String couttype;//标识 + public String getCouttype() { + return couttype; + } + + public void setCouttype(String couttype) { + this.couttype = couttype; + } + + public String getSyncFlag() { + return syncFlag; + } + + public void setSyncFlag(String syncFlag) { + this.syncFlag = syncFlag; + } public String getIds() { return ids; } diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutEntity.xml b/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutEntity.xml index 6c7e4035..99b903a2 100644 --- a/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutEntity.xml @@ -10,6 +10,7 @@ <result property="AccId" column="AccId" /> <result property="AccCode" column="AccCode" /> <result property="ids" column="ids" /> + <result property="syncFlag" column="sync_flag" /> </resultMap> <sql id="SaleOutEntity_Base_Column_List"> @@ -28,7 +29,7 @@ ccode, ddate, cCusCode, - cHandler + cHandler,sync_flag from UFDATA_001_2023.dbo.rdrecord32 union all @@ -42,7 +43,7 @@ ccode, ddate, cCusCode, - cHandler + cHandler,sync_flag from UFDATA_002_2024.dbo.rdrecord32 @@ -57,7 +58,7 @@ ccode, ddate, cCusCode, - cHandler + cHandler,sync_flag from UFDATA_004_2024.dbo.rdrecord32 @@ -72,14 +73,14 @@ ccode, ddate, cCusCode, - cHandler + cHandler,sync_flag from UFDATA_005_2024.dbo.rdrecord32 union all select - '1201' as AccId, - '1UFDATA_201_2023' as AccCode, + '201' as AccId, + 'UFDATA_201_2023' as AccCode, '201'+CAST(id AS VARCHAR(100)) as ids, id, cdlcode, @@ -87,15 +88,15 @@ ccode, ddate, cCusCode, - cHandler + cHandler,sync_flag from UFDATA_201_2023.dbo.rdrecord32 - )m1 where cCusCode not in ('001','002','004','005') and cHandler is not null + )m1 where cCusCode not in ('001','002','004','005') and cHandler is not null and sync_flag is null and AccId = '201' <if test="ids != null and ids != ''">and ids = #{ids} </if> </select> <!--通过主键修改方法--> <update id="entity_update" parameterType="com.hzya.frame.u8.saleout.entity.SaleOutEntity"> - update #{AccCode}.dbo.rdrecords32 set sync_flag = #{state} + update ${AccCode}.dbo.rdrecord32 set sync_flag = #{state} where id = #{id} </update> </mapper> diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/service/impl/SaleOutServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/saleout/service/impl/SaleOutServiceImpl.java index c60a6654..a6923b3a 100644 --- a/service/src/main/java/com/hzya/frame/u8/saleout/service/impl/SaleOutServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/u8/saleout/service/impl/SaleOutServiceImpl.java @@ -79,7 +79,14 @@ public class SaleOutServiceImpl extends BaseService<SaleOutEntity,String> implem StrUtil.isEmpty(rootAppPk);//entity.setQueryState("查询"); //如果是重推,是否通过entity传入的id,只能查到一条数据。 //entity.setId("-8845102890648320822"); - List<SaleOutEntity> soleList = saleOutDao.getU8SaleOut(entity); + List<SaleOutEntity> soleList = null; + try { + soleList = saleOutDao.getU8SaleOut(entity); + } catch (Exception e) { + logger.info("销售出库单查询失败"+e); + logger.info("销售出库单查询失败1"+e.getMessage()); + throw new RuntimeException(e); + } logger.info("销售出库查询数据{}",JSONObject.toJSONString(soleList)); if(CollectionUtils.isNotEmpty(soleList)){ soleList.forEach(sale -> { @@ -89,7 +96,7 @@ public class SaleOutServiceImpl extends BaseService<SaleOutEntity,String> implem if(!StrUtil.isEmpty(id)){ SaleOutDetailEntity line = new SaleOutDetailEntity(); line.setId(id); - line.setAccId(id); + line.setAccId(sale.getAccId()); line.setDataSourceCode(requestJson.getString("db_code")); List<SaleOutDetailEntity> lineList = saleOutDetailDao.getU8SaleOutLine(line); logger.info("销售出库单明细查询数据{}",JSONObject.toJSONString(lineList)); @@ -97,7 +104,7 @@ public class SaleOutServiceImpl extends BaseService<SaleOutEntity,String> implem logger.info("组装数据"); JSONObject main = bindingAdd(sale); logger.info("销售出库推送数据:"+main.toString()); - String result = CrmUtil.sendU8TOCrmEsb(main.toString(), "8000340003"); + String result = CrmUtil.sendU8TOCrmEsb(main.toString(), "8000070012"); logger.info("销售出库推送结果:"+result); IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); logDetails.setRootAppPk(sale.getIds()); @@ -105,10 +112,11 @@ public class SaleOutServiceImpl extends BaseService<SaleOutEntity,String> implem logDetails.setNewTransmitInfo(result); logDetails.setNewPushDate(new Date()); logDetails.setRootAppNewData(JSON.toJSONString(sale)); - logDetails.setPluginId("SaleConPlugin"); + logDetails.setPluginId("SaleOutPluginInitializer"); + logger.info("111111111111111111111111"); JSONObject resultObj = JSON.parseObject(result); - boolean flag = resultObj.getString("code").equals("0"); + boolean flag = resultObj.getString("code").equals("200"); if(flag){ logDetails.setNewTransmitInfo("推送成功"); // 推送成功,更新状态 @@ -117,6 +125,7 @@ public class SaleOutServiceImpl extends BaseService<SaleOutEntity,String> implem // 推送失败 sale.setState("N"); } + logger.info("222222222222222222"); sale.setDataSourceCode(requestJson.getString("db_code")); try{ saveLog(interId, logDetails, flag); @@ -125,6 +134,7 @@ public class SaleOutServiceImpl extends BaseService<SaleOutEntity,String> implem saleOutDao.updateState(sale); e.printStackTrace(); } + logger.info("3333333333333333333333"); saleOutDao.updateState(sale); } } catch (Exception e) {