|
|
|
@ -14,9 +14,7 @@ import com.glxp.api.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
|
import com.glxp.api.constant.*;
|
|
|
|
|
import com.glxp.api.dao.basic.*;
|
|
|
|
|
import com.glxp.api.dao.inout.IoCodeLostMapper;
|
|
|
|
|
import com.glxp.api.dao.inout.IoCodeRelMapper;
|
|
|
|
|
import com.glxp.api.dao.inout.IoOrderInvoiceMapper;
|
|
|
|
|
import com.glxp.api.dao.inout.*;
|
|
|
|
|
import com.glxp.api.dao.purchase.*;
|
|
|
|
|
import com.glxp.api.dao.thrsys.ThrBusTypeOriginDao;
|
|
|
|
|
import com.glxp.api.dto.RelaySyncDto;
|
|
|
|
@ -55,6 +53,7 @@ import org.apache.ibatis.session.TransactionIsolationLevel;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
@ -273,7 +272,7 @@ public class HeartService {
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case IO_ORDER:
|
|
|
|
|
if(needExec())
|
|
|
|
|
if (needExec())
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1328,13 +1327,14 @@ public class HeartService {
|
|
|
|
|
if (response.getCode() == 20000 && response.getData() != null) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONArray fileJson = JSONUtil.parseObj(response.getData()).getJSONArray("files");
|
|
|
|
|
JSONArray fileJson = JSONUtil.parseObj(response.getData()).getJSONArray("syncFiles");
|
|
|
|
|
SpsSyncOrderResponse syncDataResponse = JSONObject.parseObject(response.getData(), new TypeReference<SpsSyncOrderResponse>() {
|
|
|
|
|
});
|
|
|
|
|
BasicDownloadStatusEntity basicDownloadStatusEntity = new BasicDownloadStatusEntity();
|
|
|
|
|
basicDownloadStatusEntity.setId(CustomUtil.getId());
|
|
|
|
|
basicDownloadStatusEntity.setTaskId(syncDataResponse.getTaskId());
|
|
|
|
|
basicDownloadStatusEntity.setStartTime(startTime);
|
|
|
|
|
basicDownloadStatusEntity.setUpdateTime(startTime);
|
|
|
|
|
basicDownloadStatusEntity.setIdDatas(ConstantStatus.SYNC_DOWNLOAD_SCAN_ORDER);
|
|
|
|
|
basicDownloadStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_WAIT); //下载中
|
|
|
|
|
basicDownloadStatusEntity.setType(NEW_ALL_ORDER);
|
|
|
|
@ -1346,14 +1346,13 @@ public class HeartService {
|
|
|
|
|
try {
|
|
|
|
|
List<IoOrderEntity> orderEntities = syncDataResponse.getOrderEntities();
|
|
|
|
|
for (IoOrderEntity orderEntity : orderEntities) {
|
|
|
|
|
|
|
|
|
|
SyncDataBustypeEntity syncDataBustypeEntity = syncDataBustypeService.findByAction(orderEntity.getAction(), 2);
|
|
|
|
|
orderEntity.setUpdateTime(null);
|
|
|
|
|
orderEntity.setFromType(ConstantStatus.FROM_UDISP);
|
|
|
|
|
orderEntity.setProcessStatus(ConstantStatus.ORDER_DEAL_POST);
|
|
|
|
|
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
|
|
|
|
|
if (syncDataBustypeEntity != null) {
|
|
|
|
|
if (syncDataBustypeEntity.getSyncStatus() == 1) {
|
|
|
|
|
if (syncDataBustypeEntity.getSyncStatus() != null && syncDataBustypeEntity.getSyncStatus().compareTo(1) == 0) {
|
|
|
|
|
orderEntity.setProcessStatus(ConstantStatus.ORDER_DEAL_DRAFT);
|
|
|
|
|
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_TEMP_SAVE);
|
|
|
|
|
}
|
|
|
|
@ -1374,7 +1373,8 @@ public class HeartService {
|
|
|
|
|
ioCheckInoutService.check(orderEntity.getBillNo());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
updateOrderDb(syncDataResponse, orderEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (fileJson != null && fileJson.size() > 0) {
|
|
|
|
@ -1829,7 +1829,6 @@ public class HeartService {
|
|
|
|
|
List<IoOrderDetailBizEntity> orderDetailBizEntities = syncDataResponse.getOrderDetailBizEntities();
|
|
|
|
|
for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) {
|
|
|
|
|
if (bizEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
|
|
|
|
|
bizEntity.setId(null);
|
|
|
|
|
orderDetailBizService.insert(bizEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1840,7 +1839,6 @@ public class HeartService {
|
|
|
|
|
List<IoOrderDetailCodeEntity> orderDetailCodeEntities = syncDataResponse.getOrderDetailCodeEntities();
|
|
|
|
|
for (IoOrderDetailCodeEntity codeEntity : orderDetailCodeEntities) {
|
|
|
|
|
if (codeEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
|
|
|
|
|
codeEntity.setId(null);
|
|
|
|
|
orderDetailCodeService.insert(codeEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1863,7 +1861,49 @@ public class HeartService {
|
|
|
|
|
List<IoOrderInvoiceEntity> orderInvoiceEntities = syncDataResponse.getOrderInvoiceEntities();
|
|
|
|
|
for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) {
|
|
|
|
|
if (orderInvoiceEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
|
|
|
|
|
orderInvoiceEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
orderInvoiceService.insertInvoice(orderInvoiceEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
IoOrderDetailBizDao ioOrderDetailBizDao;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
IoOrderDetailCodeDao ioOrderDetailCodeDao;
|
|
|
|
|
@Resource
|
|
|
|
|
IoOrderDao orderDao;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
public void updateOrderDb(SpsSyncOrderResponse syncDataResponse, IoOrderEntity orderEntity) {
|
|
|
|
|
orderDao.updateOrder(orderEntity);
|
|
|
|
|
//更新业务详情
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailBizEntities())) {
|
|
|
|
|
List<IoOrderDetailBizEntity> orderDetailBizEntities = syncDataResponse.getOrderDetailBizEntities();
|
|
|
|
|
for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) {
|
|
|
|
|
if (bizEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
|
|
|
|
|
ioOrderDetailBizDao.insertOrUpdate(bizEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//更新码详情
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailCodeEntities())) {
|
|
|
|
|
List<IoOrderDetailCodeEntity> orderDetailCodeEntities = syncDataResponse.getOrderDetailCodeEntities();
|
|
|
|
|
for (IoOrderDetailCodeEntity codeEntity : orderDetailCodeEntities) {
|
|
|
|
|
if (codeEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
|
|
|
|
|
ioOrderDetailCodeDao.insertOrUpdate(codeEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//更新发票信息
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getOrderInvoiceEntities())) {
|
|
|
|
|
List<IoOrderInvoiceEntity> orderInvoiceEntities = syncDataResponse.getOrderInvoiceEntities();
|
|
|
|
|
for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) {
|
|
|
|
|
if (orderInvoiceEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
|
|
|
|
|
orderInvoiceService.insertInvoice(orderInvoiceEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|