feature:时空和用友回推调整

zkh
路明慧 11 months ago
parent 89912dcb91
commit 744f3afccd
  1. 1
      order-management-order/src/main/java/com/dxhy/order/consumer/config/rabbitmq/InvoiceFptsHandler.java
  2. 12
      order-management-order/src/main/java/com/dxhy/order/consumer/dao/TInvoiceInvmapMapper.java
  3. 5
      order-management-order/src/main/java/com/dxhy/order/consumer/dao/YyOrderMapper.java
  4. 20
      order-management-order/src/main/java/com/dxhy/order/consumer/modules/bespoke/service/impl/SkOrderServiceImpl.java
  5. 16
      order-management-order/src/main/java/com/dxhy/order/consumer/modules/bespoke/service/impl/YyOrderServiceImpl.java
  6. 96
      order-management-order/src/main/resources/mybatis/mapper/TInvoiceInvmapMapper.xml
  7. 89
      order-management-order/src/main/resources/mybatis/mapper/YyOrderMapper.xml

@ -72,6 +72,7 @@ public class InvoiceFptsHandler implements BaseListener {
*/
public void reverse(String message) {
message = JsonUtils.getInstance().parseObject(message, String.class);
orderHandleService.backMsg(message);
// message = JsonUtils.getInstance().parseObject(message, String.class);

@ -0,0 +1,12 @@
package com.dxhy.order.consumer.dao;
import com.dxhy.order.consumer.modules.bespoke.model.yy.NewTable;
public interface TInvoiceInvmapMapper {
//插入回写信息
int insertBackMsg(NewTable newTable);
//删除原信息
int deleteBackMsg(String cdlCode);
}

@ -17,13 +17,8 @@ public interface YyOrderMapper {
//订单明细读取
List<YyOrderItemInfo> findOrderDetailList(String sbvid);
//插入回写信息
int insertBackMsg(NewTable newTable);
//根据订单编号查询订单信息
List<InvoiceBpmmap> getDdbh(String cdlCode);
int updateBackMsg(@Param("fild") String reBackFild, @Param("ddh") String originDdh, @Param("fph") String sdfphm);
int deleteBackMsg(String cdlCode);
}

@ -22,12 +22,14 @@ import com.dxhy.order.baseservice.model.OrderOriginExtendInfo;
import com.dxhy.order.consumer.dao.SkOrderInfoMapper;
import com.dxhy.order.consumer.dao.SkOrderItemInfoMapper;
import com.dxhy.order.consumer.dao.SkOrderMapper;
import com.dxhy.order.consumer.dao.TInvoiceInvmapMapper;
import com.dxhy.order.consumer.modules.bespoke.config.datasource.config.DynamicContextHolder;
import com.dxhy.order.consumer.modules.bespoke.model.req.FileModel;
import com.dxhy.order.consumer.modules.bespoke.model.req.ReqParam;
import com.dxhy.order.consumer.modules.bespoke.model.sk.BackProduct;
import com.dxhy.order.consumer.modules.bespoke.model.sk.SkOrderInfo;
import com.dxhy.order.consumer.modules.bespoke.model.sk.SkOrderItemInfo;
import com.dxhy.order.consumer.modules.bespoke.model.yy.NewTable;
import com.dxhy.order.consumer.modules.bespoke.service.OrderService;
import com.dxhy.order.consumer.openapi.protocol.v4.order.*;
import com.dxhy.order.consumer.openapi.protocol.v6.order.QdTxxBO;
@ -75,6 +77,9 @@ public class SkOrderServiceImpl implements OrderService {
@Resource
private OrderItemInfoMapper orderItemInfoMapper;
@Resource
private TInvoiceInvmapMapper tInvoiceInvmapMapper;
// 订单读入
@Override
public R orderRead(ReqParam reqParam) {
@ -197,7 +202,22 @@ public class SkOrderServiceImpl implements OrderService {
backProduct.setDjbh(ddh);
backProduct.setMark(ConfigureConstant.CH);
}
DynamicContextHolder.push(orderInvoiceInfo.getXhfNsrsbh());
skOrderMapper.callProcedure(backProduct);
//回写创建表
DynamicContextHolder.push(ConfigureConstant.MAIN);
NewTable newTable = new NewTable();
newTable.setCDLCode(orderOriginExtendInfo.getOriginDdh());
newTable.setInvoiceCode(orderInvoiceInfo.getSdfphm());
newTable.setInvoiceTime(orderInvoiceInfo.getKprq());
newTable.setInvoiceAmount(orderInvoiceInfo.getKphjje());
newTable.setInvoicePhoto(fileModel.getFilePath());
newTable.setInvoiceFilename(fileModel.getFileName());
newTable.setOperater(orderInvoiceInfo.getKpr());
newTable.setOperateDate(orderInvoiceInfo.getKprq());
tInvoiceInvmapMapper.deleteBackMsg(newTable.getCDLCode());
tInvoiceInvmapMapper.insertBackMsg(newTable);
}
}

@ -18,6 +18,7 @@ import com.dxhy.order.baseservice.constant.ConfigurerInfo;
import com.dxhy.order.baseservice.constant.OrderValidateEnum;
import com.dxhy.order.baseservice.model.OrderInvoiceInfo;
import com.dxhy.order.baseservice.model.OrderOriginExtendInfo;
import com.dxhy.order.consumer.dao.TInvoiceInvmapMapper;
import com.dxhy.order.consumer.dao.YyOrderInfoMapper;
import com.dxhy.order.consumer.dao.YyOrderItemInfoMapper;
import com.dxhy.order.consumer.dao.YyOrderMapper;
@ -78,6 +79,9 @@ public class YyOrderServiceImpl implements OrderService {
@Resource
private FildConfig fildConfig;
@Resource
private TInvoiceInvmapMapper tInvoiceInvmapMapper;
//订单读入
@Override
public R orderRead(ReqParam reqParam) {
@ -207,8 +211,7 @@ public class YyOrderServiceImpl implements OrderService {
}
log.debug("待回传数据:{}", JSON.toJSONString(newTableList));
DynamicContextHolder.push(orderInvoiceInfo.getXhfNsrsbh());
int count = accressReback(newTableList);
int count = accressReback(newTableList,orderInvoiceInfo.getXhfNsrsbh());
if (count >=newTableList.size()){
return R.ok("成功回传" + count + "条数据");
@ -217,21 +220,22 @@ public class YyOrderServiceImpl implements OrderService {
return R.error("回传失败");
}
@Transactional
public int accressReback(List<NewTable> newTableList) {
public int accressReback(List<NewTable> newTableList,String nsrsbh) {
int count = ConfigureConstant.INT_0;
for (NewTable newTable : newTableList) {
DynamicContextHolder.push(nsrsbh);
List<InvoiceBpmmap> ddbhList = yyOrderMapper.getDdbh(newTable.getCDLCode());
log.debug("查询到中间表信息:{}", JSON.toJSONString(ddbhList));
if (CollectionUtils.isNotEmpty(ddbhList)){
yyOrderMapper.deleteBackMsg(newTable.getCDLCode());
DynamicContextHolder.push(ConfigureConstant.MAIN);
tInvoiceInvmapMapper.deleteBackMsg(newTable.getCDLCode());
for (InvoiceBpmmap invoiceBpmmap : ddbhList) {
NewTable newTableFull = new NewTable();
BeanUtil.copyProperties(newTable, newTableFull);
newTableFull.setBpmNo(invoiceBpmmap.getBpmno());
newTableFull.setBpmlsNo(invoiceBpmmap.getBpmlsno());
count+= yyOrderMapper.insertBackMsg(newTableFull);
count+= tInvoiceInvmapMapper.insertBackMsg(newTableFull);
}
}

@ -0,0 +1,96 @@
<?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.dxhy.order.consumer.dao.TInvoiceInvmapMapper">
<insert id="insertBackMsg" parameterType="com.dxhy.order.consumer.modules.bespoke.model.yy.NewTable">
insert into T_INVOICE_INVMAP
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="cDLCode != null">
cDLCode,
</if>
<if test="invoiceNo != null">
invoiceNo,
</if>
<if test="invoiceCode != null">
invoiceCode,
</if>
<if test="invoiceTime != null">
invoiceTime,
</if>
<if test="invoiceAmount != null">
invoiceAmount,
</if>
<if test="invoicePhoto != null">
invoicePhoto,
</if>
<if test="invoiceFilename != null">
invoiceFilename,
</if>
<if test="bpmlsNo != null">
bpmlsNo,
</if>
<if test="bpmNo != null">
bpmNo,
</if>
<if test="operater != null">
operater,
</if>
<if test="operateDate != null">
operateDate,
</if>
<if test="shipper != null">
shipper,
</if>
<if test="status != null">
status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cDLCode != null">
#{cDLCode},
</if>
<if test="invoiceNo != null">
#{invoiceNo},
</if>
<if test="invoiceCode != null">
#{invoiceCode},
</if>
<if test="invoiceTime != null">
#{invoiceTime},
</if>
<if test="invoiceAmount != null">
#{invoiceAmount},
</if>
<if test="invoicePhoto != null">
#{invoicePhoto},
</if>
<if test="invoiceFilename != null">
#{invoiceFilename},
</if>
<if test="bpmlsNo != null">
#{bpmlsNo},
</if>
<if test="bpmNo != null">
#{bpmNo},
</if>
<if test="operater != null">
#{operater},
</if>
<if test="operateDate != null">
#{operateDate},
</if>
<if test="shipper != null">
#{shipper},
</if>
<if test="status != null">
#{status},
</if>
</trim>
</insert>
<delete id="deleteBackMsg">
delete from T_INVOICE_INVMAP where cdlcode = #{cdlCode}
</delete>
</mapper>

@ -44,91 +44,6 @@
where sbvid = #{sbvid}
</select>
<insert id="insertBackMsg" parameterType="com.dxhy.order.consumer.modules.bespoke.model.yy.NewTable">
insert into NewTable
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="cDLCode != null">
cDLCode,
</if>
<if test="invoiceNo != null">
invoiceNo,
</if>
<if test="invoiceCode != null">
invoiceCode,
</if>
<if test="invoiceTime != null">
invoiceTime,
</if>
<if test="invoiceAmount != null">
invoiceAmount,
</if>
<if test="invoicePhoto != null">
invoicePhoto,
</if>
<if test="invoiceFilename != null">
invoiceFilename,
</if>
<if test="bpmlsNo != null">
bpmlsNo,
</if>
<if test="bpmNo != null">
bpmNo,
</if>
<if test="operater != null">
operater,
</if>
<if test="operateDate != null">
operateDate,
</if>
<if test="shipper != null">
shipper,
</if>
<if test="status != null">
status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cDLCode != null">
#{cDLCode},
</if>
<if test="invoiceNo != null">
#{invoiceNo},
</if>
<if test="invoiceCode != null">
#{invoiceCode},
</if>
<if test="invoiceTime != null">
#{invoiceTime},
</if>
<if test="invoiceAmount != null">
#{invoiceAmount},
</if>
<if test="invoicePhoto != null">
#{invoicePhoto},
</if>
<if test="invoiceFilename != null">
#{invoiceFilename},
</if>
<if test="bpmlsNo != null">
#{bpmlsNo},
</if>
<if test="bpmNo != null">
#{bpmNo},
</if>
<if test="operater != null">
#{operater},
</if>
<if test="operateDate != null">
#{operateDate},
</if>
<if test="shipper != null">
#{shipper},
</if>
<if test="status != null">
#{status},
</if>
</trim>
</insert>
<select id="getDdbh" resultType="com.dxhy.order.consumer.modules.bespoke.model.yy.InvoiceBpmmap">
select cdlcode, bpmno,bpmlsno
@ -139,8 +54,4 @@
<update id="updateBackMsg">
update salebillvouch set ${fild} = #{fph} where cdlcode = #{ddh}
</update>
<delete id="deleteBackMsg">
delete from NewTable where cdlcode = #{cdlCode}
</delete>
</mapper>

Loading…
Cancel
Save