|
|
@ -2,13 +2,11 @@ package com.logpm.factory.oupai.receiver; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.logpm.factory.oupai.entity.OpOrderStatusLogEntity; |
|
|
|
import com.logpm.factory.oupai.entity.*; |
|
|
|
import com.logpm.factory.oupai.entity.OpOutGoingOrderEntity; |
|
|
|
|
|
|
|
import com.logpm.factory.oupai.entity.OpSignBillEntity; |
|
|
|
|
|
|
|
import com.logpm.factory.oupai.entity.OpSignPackageEntity; |
|
|
|
|
|
|
|
import com.logpm.factory.oupai.service.IOpOutGoingOrderService; |
|
|
|
import com.logpm.factory.oupai.service.IOpOutGoingOrderService; |
|
|
|
import com.logpm.factory.oupai.service.IOpSignBillService; |
|
|
|
import com.logpm.factory.oupai.service.IOpSignBillService; |
|
|
|
import com.logpm.factory.oupai.service.IOpSignPackageService; |
|
|
|
import com.logpm.factory.oupai.service.IOpSignPackageService; |
|
|
|
|
|
|
|
import com.logpm.factory.oupai.service.IOpSignPictureService; |
|
|
|
import com.rabbitmq.client.Channel; |
|
|
|
import com.rabbitmq.client.Channel; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springblade.common.constant.RabbitConstant; |
|
|
|
import org.springblade.common.constant.RabbitConstant; |
|
|
@ -41,6 +39,8 @@ public class OpSignDataHandler { |
|
|
|
private IOpSignBillService opSignBillService; |
|
|
|
private IOpSignBillService opSignBillService; |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private IOpSignPackageService opSignPackageService; |
|
|
|
private IOpSignPackageService opSignPackageService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private IOpSignPictureService opSignPictureService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RabbitHandler |
|
|
|
@RabbitHandler |
|
|
@ -66,6 +66,7 @@ public class OpSignDataHandler { |
|
|
|
String outGoingOrderCode = outGoingOrder.getString("Code"); |
|
|
|
String outGoingOrderCode = outGoingOrder.getString("Code"); |
|
|
|
JSONObject store = valueObject.getJSONObject("Store"); |
|
|
|
JSONObject store = valueObject.getJSONObject("Store"); |
|
|
|
JSONArray packages = valueObject.getJSONArray("Packages"); |
|
|
|
JSONArray packages = valueObject.getJSONArray("Packages"); |
|
|
|
|
|
|
|
JSONArray signPictures = valueObject.getJSONArray("SignPictures"); |
|
|
|
String status = outGoingOrder.getString("Status"); |
|
|
|
String status = outGoingOrder.getString("Status"); |
|
|
|
//先查询是否已经有数据存在系统中
|
|
|
|
//先查询是否已经有数据存在系统中
|
|
|
|
OpOutGoingOrderEntity opOutGoingOrderEntity = opOutGoingOrderService.getEntityByCode(outGoingOrderCode); |
|
|
|
OpOutGoingOrderEntity opOutGoingOrderEntity = opOutGoingOrderService.getEntityByCode(outGoingOrderCode); |
|
|
@ -195,9 +196,24 @@ public class OpSignDataHandler { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 保存签收图片
|
|
|
|
// 保存签收图片
|
|
|
|
|
|
|
|
for (int t = 0; t < signPictures.size(); t++) { |
|
|
|
|
|
|
|
JSONObject signPicturesJSONObject = signPictures.getJSONObject(t); |
|
|
|
|
|
|
|
String oid = signPicturesJSONObject.getString("Oid"); |
|
|
|
|
|
|
|
//先判断库中是否已经存在
|
|
|
|
|
|
|
|
OpSignPictureEntity signPictureEntity = opSignPictureService.findEntityByOid(oid); |
|
|
|
|
|
|
|
if(Objects.isNull(signPictureEntity)){ |
|
|
|
|
|
|
|
JSONObject data = signPicturesJSONObject.getJSONObject("Data"); |
|
|
|
|
|
|
|
signPictureEntity = new OpSignPictureEntity(); |
|
|
|
|
|
|
|
signPictureEntity.setSignBillId(signBillId); |
|
|
|
|
|
|
|
signPictureEntity.setSignBillCode(signBillEntity.getCode()); |
|
|
|
|
|
|
|
signPictureEntity.setOid(oid); |
|
|
|
|
|
|
|
if(!Objects.isNull(data)){ |
|
|
|
|
|
|
|
signPictureEntity.setFileUrl(data.getString("FileUrl")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
opSignPictureService.save(signPictureEntity); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//存入包件数据
|
|
|
|
//存入包件数据
|
|
|
|
for (int j = 0; j < packages.size(); j++) { |
|
|
|
for (int j = 0; j < packages.size(); j++) { |
|
|
|