会稽山对接CRM代码
This commit is contained in:
parent
b7916bbfb4
commit
4836f217a2
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
/***
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
||||
|
|
|
@ -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("操作成功");
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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"));
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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}
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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,13 +65,14 @@ 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("发货单号不能为空");
|
||||
}
|
||||
|
@ -77,11 +83,9 @@ public class DeliveryOrderServiceImpl extends BaseService<DeliveryOrderEntity,St
|
|||
entity.setAccId(AccId);
|
||||
entity.setCdlcode(cdlcode);
|
||||
entity.setFrozen(frozen);
|
||||
deliveryOrderDao.update("com.hzya.frame.u8.delivery.dao.impl.DeliveryOrderDaoImpl.entity_update",entity);
|
||||
entity.setDataSourceCode("YONYOUU8");
|
||||
deliveryOrderDao.updateDeliveryState(entity);
|
||||
return BaseResult.getSuccessMessageEntity("更新成功");
|
||||
}else{
|
||||
return BaseResult.getFailureMessageEntity("清传入正确的状态Y=冻结 N=解冻");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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>
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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>
|
|
@ -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> {
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -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());
|
||||
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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>
|
||||
|
|
|
@ -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" />
|
||||
|
@ -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.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.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.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.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>
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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("推送成功");
|
||||
// 推送成功,更新状态
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue