|
|
|
@ -8,8 +8,9 @@ import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
import com.glxp.api.dao.inout.*;
|
|
|
|
|
import com.glxp.api.entity.inout.*;
|
|
|
|
|
import com.glxp.api.service.inout.IoAddInoutService;
|
|
|
|
|
import com.glxp.api.service.inout.IoCheckInoutService;
|
|
|
|
|
import com.glxp.api.res.sync.SpsSyncBusResponse;
|
|
|
|
|
import com.glxp.api.res.sync.SpsSyncDataResponse;
|
|
|
|
|
import com.glxp.api.service.inout.*;
|
|
|
|
|
import org.apache.ibatis.session.ExecutorType;
|
|
|
|
|
import org.apache.ibatis.session.SqlSession;
|
|
|
|
|
import org.apache.ibatis.session.SqlSessionFactory;
|
|
|
|
@ -30,7 +31,6 @@ import com.glxp.api.http.sync.SpGetHttpClient;
|
|
|
|
|
import com.glxp.api.req.sync.SpsSyncDataRequest;
|
|
|
|
|
import com.glxp.api.res.sync.SpsSyncBusOrderResponse;
|
|
|
|
|
import com.glxp.api.res.sync.SpsSyncOrderResponse;
|
|
|
|
|
import com.glxp.api.service.inout.IoOrderService;
|
|
|
|
|
import com.glxp.api.util.CustomUtil;
|
|
|
|
|
import com.glxp.api.util.DateUtil;
|
|
|
|
|
|
|
|
|
@ -52,7 +52,12 @@ public class HeartService {
|
|
|
|
|
SqlSessionFactory sqlSessionFactory;
|
|
|
|
|
@Resource
|
|
|
|
|
IoOrderService orderService;
|
|
|
|
|
@Resource
|
|
|
|
|
IoAddInoutService addInoutService;
|
|
|
|
|
@Resource
|
|
|
|
|
IoCheckInoutService ioCheckInoutService;
|
|
|
|
|
|
|
|
|
|
//上传最近更新扫码单据
|
|
|
|
|
public BaseResponse uploadAllOrder(String syncTime) {
|
|
|
|
|
SpsSyncDataRequest spsSyncDataRequest = new SpsSyncDataRequest();
|
|
|
|
|
if (syncTime == null) {
|
|
|
|
@ -112,7 +117,7 @@ public class HeartService {
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//上传最近更新业务单据
|
|
|
|
|
public BaseResponse uploadAllBusOrder(String syncTime) {
|
|
|
|
|
SpsSyncDataRequest spsSyncDataRequest = new SpsSyncDataRequest();
|
|
|
|
|
if (syncTime == null) {
|
|
|
|
@ -170,6 +175,168 @@ public class HeartService {
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//上传最近更新单据类型
|
|
|
|
|
public BaseResponse uploadAllBus(String syncTime) {
|
|
|
|
|
SpsSyncDataRequest spsSyncDataRequest = new SpsSyncDataRequest();
|
|
|
|
|
if (syncTime == null) {
|
|
|
|
|
BasicExportStatusTimeEntity basicExportStatusTimeEntity = basicExportTimeService.findByKey(ConstantStatus.SYNC_BUS_TYPE);
|
|
|
|
|
if (basicExportStatusTimeEntity == null) {
|
|
|
|
|
basicExportStatusTimeEntity = new BasicExportStatusTimeEntity();
|
|
|
|
|
basicExportStatusTimeEntity.setLastUpdateTime("1949-10-01 09:00:00");
|
|
|
|
|
}
|
|
|
|
|
spsSyncDataRequest.setLastUpdateTime(basicExportStatusTimeEntity.getLastUpdateTime());
|
|
|
|
|
} else {
|
|
|
|
|
spsSyncDataRequest.setLastUpdateTime(syncTime);
|
|
|
|
|
}
|
|
|
|
|
SpsSyncBusResponse spsSyncBusResponse = upBasicService.upAllBus(spsSyncDataRequest);
|
|
|
|
|
if (CollUtil.isEmpty(spsSyncBusResponse.getBussinessTypeEntities())
|
|
|
|
|
&& CollUtil.isEmpty(spsSyncBusResponse.getBusTypeChangeEntities())
|
|
|
|
|
&& CollUtil.isEmpty(spsSyncBusResponse.getThrBusTypeOriginEntities())
|
|
|
|
|
) {
|
|
|
|
|
return ResultVOUtils.success("无数据");
|
|
|
|
|
}
|
|
|
|
|
BasicExportStatusEntity basicExportStatusEntity2 = basicExportService.findByData(ConstantStatus.SYNC_BUS_TYPE, 0);
|
|
|
|
|
if (basicExportStatusEntity2 == null) {
|
|
|
|
|
BasicExportStatusEntity busTypetatusEntity = new BasicExportStatusEntity();
|
|
|
|
|
busTypetatusEntity.setId(CustomUtil.getId());
|
|
|
|
|
busTypetatusEntity.setIdDatas(ConstantStatus.SYNC_BUS_TYPE);
|
|
|
|
|
busTypetatusEntity.setType(BasicProcessStatus.NEW_ALL_BUS);
|
|
|
|
|
busTypetatusEntity.setUpdateTime(new Date());
|
|
|
|
|
busTypetatusEntity.setStartTime(new Date());
|
|
|
|
|
busTypetatusEntity.setStatus(0);
|
|
|
|
|
busTypetatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
|
|
|
|
|
basicExportService.insertExportStatus(busTypetatusEntity);
|
|
|
|
|
basicExportStatusEntity2 = busTypetatusEntity;
|
|
|
|
|
}
|
|
|
|
|
BasicExportStatusTimeEntity basicExportStatusTimeEntity = new BasicExportStatusTimeEntity();
|
|
|
|
|
basicExportStatusTimeEntity.setLastUpdateTime(DateUtil.formatDate(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
basicExportStatusTimeEntity.setKey(ConstantStatus.SYNC_BUS_TYPE);
|
|
|
|
|
spsSyncBusResponse.setTaskId(basicExportStatusEntity2.getId());
|
|
|
|
|
BaseResponse<String> baseResponse2 = spGetHttp.postAllBusType(spsSyncBusResponse);
|
|
|
|
|
if (baseResponse2.getCode() == 20000) {
|
|
|
|
|
basicExportStatusEntity2.setStatus(1);
|
|
|
|
|
} else {
|
|
|
|
|
basicExportStatusEntity2.setStatus(ConstantStatus.SYNC_STATUS_FAIL);
|
|
|
|
|
}
|
|
|
|
|
basicExportStatusEntity2.setEndTime(new Date());
|
|
|
|
|
basicExportTimeService.insertExportStatus(basicExportStatusTimeEntity);
|
|
|
|
|
//拼接日志
|
|
|
|
|
String logs = "";
|
|
|
|
|
if (CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessTypeEntities()))
|
|
|
|
|
logs = logs + "扫码单据类型:" + spsSyncBusResponse.getBussinessTypeEntities().size() + "条\n";
|
|
|
|
|
if (CollUtil.isNotEmpty(spsSyncBusResponse.getBusTypeChangeEntities()))
|
|
|
|
|
logs = logs + "业务单据类型:" + spsSyncBusResponse.getBusTypeChangeEntities().size() + "条\n";
|
|
|
|
|
if (CollUtil.isNotEmpty(spsSyncBusResponse.getThrBusTypeOriginEntities()))
|
|
|
|
|
logs = logs + "第三方单据类型:" + spsSyncBusResponse.getThrBusTypeOriginEntities().size() + "条\n";
|
|
|
|
|
basicExportStatusEntity2.setRemark(logs);
|
|
|
|
|
basicExportStatusEntity2.setUpdateTime(new Date());
|
|
|
|
|
basicExportService.updateExportStatus(basicExportStatusEntity2);
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//上传用户信息
|
|
|
|
|
public BaseResponse uploadAllUserData(String syncTime) {
|
|
|
|
|
SpsSyncDataRequest spsSyncDataRequest = new SpsSyncDataRequest();
|
|
|
|
|
if (syncTime == null) {
|
|
|
|
|
BasicExportStatusTimeEntity basicExportStatusTimeEntity = basicExportTimeService.findByKey(ConstantStatus.SYNC_BASIC_DATA);
|
|
|
|
|
if (basicExportStatusTimeEntity == null) {
|
|
|
|
|
basicExportStatusTimeEntity = new BasicExportStatusTimeEntity();
|
|
|
|
|
basicExportStatusTimeEntity.setLastUpdateTime("1949-10-01 09:00:00");
|
|
|
|
|
}
|
|
|
|
|
spsSyncDataRequest.setLastUpdateTime(basicExportStatusTimeEntity.getLastUpdateTime());
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
spsSyncDataRequest.setLastUpdateTime(syncTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SpsSyncDataResponse syncDataResponse = upBasicService.uploadAllUserData(spsSyncDataRequest);
|
|
|
|
|
if (CollUtil.isEmpty(syncDataResponse.getInvWarehouseEntities())
|
|
|
|
|
&& CollUtil.isEmpty(syncDataResponse.getAuthAdminList())
|
|
|
|
|
&& CollUtil.isEmpty(syncDataResponse.getDeptEntityList())
|
|
|
|
|
&& CollUtil.isEmpty(syncDataResponse.getWarehouseBussinessTypeEntities())
|
|
|
|
|
&& CollUtil.isEmpty(syncDataResponse.getWarehouseUserEntities())
|
|
|
|
|
) {
|
|
|
|
|
//数据不记录日志
|
|
|
|
|
return ResultVOUtils.success("无数据");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BasicExportStatusEntity basicExportStatusEntity3 = basicExportService.findByData(ConstantStatus.SYNC_BASIC_DATA, 0);
|
|
|
|
|
if (basicExportStatusEntity3 == null) {
|
|
|
|
|
BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity();
|
|
|
|
|
basicExportStatusEntity.setId(CustomUtil.getId());
|
|
|
|
|
basicExportStatusEntity.setIdDatas(ConstantStatus.SYNC_BASIC_DATA);
|
|
|
|
|
basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_DATA);
|
|
|
|
|
basicExportStatusEntity.setUpdateTime(new Date());
|
|
|
|
|
basicExportStatusEntity.setStartTime(new Date());
|
|
|
|
|
basicExportStatusEntity.setStatus(0);
|
|
|
|
|
basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
|
|
|
|
|
basicExportService.insertExportStatus(basicExportStatusEntity);
|
|
|
|
|
basicExportStatusEntity3 = basicExportStatusEntity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BasicExportStatusTimeEntity basicExportStatusTimeEntity = new BasicExportStatusTimeEntity();
|
|
|
|
|
basicExportStatusTimeEntity.setLastUpdateTime(DateUtil.formatDate(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
basicExportStatusTimeEntity.setKey(ConstantStatus.SYNC_BASIC_DATA);
|
|
|
|
|
syncDataResponse.setTaskId(basicExportStatusEntity3.getId());
|
|
|
|
|
BaseResponse<String> baseResponse = spGetHttp.postAllUser(syncDataResponse);
|
|
|
|
|
if (baseResponse.getCode() == 20000) {
|
|
|
|
|
basicExportStatusEntity3.setStatus(1);
|
|
|
|
|
} else {
|
|
|
|
|
basicExportStatusEntity3.setStatus(ConstantStatus.SYNC_STATUS_FAIL);
|
|
|
|
|
}
|
|
|
|
|
basicExportStatusEntity3.setEndTime(new Date());
|
|
|
|
|
basicExportTimeService.insertExportStatus(basicExportStatusTimeEntity);
|
|
|
|
|
String logs = "";
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getInvWarehouseEntities()))
|
|
|
|
|
logs = logs + "仓库字典:" + syncDataResponse.getInvWarehouseEntities().size() + "条\n";
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getWarehouseUserEntities())) {
|
|
|
|
|
logs = logs + "仓库用户信息:" + syncDataResponse.getWarehouseUserEntities().size() + "条\n";
|
|
|
|
|
}
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getWarehouseBussinessTypeEntities())) {
|
|
|
|
|
logs = logs + "仓库单据类型:" + syncDataResponse.getWarehouseBussinessTypeEntities().size() + "条\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getAuthAdminList()))
|
|
|
|
|
logs = logs + "系统用户信息:" + syncDataResponse.getAuthAdminList().size() + "条\n";
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getInvBusUserEntities()))
|
|
|
|
|
logs = logs + "用户关联单据类型信息:" + syncDataResponse.getInvBusUserEntities().size() + "条\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getDeptEntityList()))
|
|
|
|
|
logs = logs + "部门信息:" + syncDataResponse.getDeptEntityList().size() + "条\n";
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getDeptUserEntities()))
|
|
|
|
|
logs = logs + "部门用户信息:" + syncDataResponse.getDeptUserEntities().size() + "条\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getInvSpaces()))
|
|
|
|
|
logs = logs + "货位信息:" + syncDataResponse.getInvSpaces().size() + "条\n";
|
|
|
|
|
|
|
|
|
|
basicExportStatusEntity3.setRemark(logs);
|
|
|
|
|
basicExportStatusEntity3.setUpdateTime(new Date());
|
|
|
|
|
basicExportService.updateExportStatus(basicExportStatusEntity3);
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
// //上传最近更新第三方基础数据
|
|
|
|
|
// public BaseResponse uploadThirdData(String syncTime) {
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
IoCodeTempService codeTempService;
|
|
|
|
|
@Resource
|
|
|
|
|
IoOrderDetailBizService orderDetailBizService;
|
|
|
|
|
@Resource
|
|
|
|
|
IoOrderDetailCodeService orderDetailCodeService;
|
|
|
|
|
@Resource
|
|
|
|
|
IoOrderDetailResultService orderDetailResultService;
|
|
|
|
|
@Resource
|
|
|
|
|
IoOrderInvoiceService orderInvoiceService;
|
|
|
|
|
|
|
|
|
|
//下载最近更新扫码单据
|
|
|
|
|
public void dlAllOrder() {
|
|
|
|
|
BaseResponse<List<BasicExportStatusEntity>> baseResponse = spGetHttp.getBasicStatus(BasicProcessStatus.NEW_ALL_ORDER + "");
|
|
|
|
|
List<BasicExportStatusEntity> pageSimpleResponse = baseResponse != null ? baseResponse.getData() : new ArrayList<>();
|
|
|
|
@ -195,11 +362,9 @@ public class HeartService {
|
|
|
|
|
basicDownloadService.insertDownloadStatus(basicDownloadStatusEntity);
|
|
|
|
|
StringBuffer remark = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
SqlSession batchSession = sqlSessionFactory.openSession(ExecutorType.BATCH, TransactionIsolationLevel.READ_COMMITTED);
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getOrderEntities())) {
|
|
|
|
|
try {
|
|
|
|
|
List<IoOrderEntity> orderEntities = syncDataResponse.getOrderEntities();
|
|
|
|
|
IoOrderDao mapper = batchSession.getMapper(IoOrderDao.class);
|
|
|
|
|
for (IoOrderEntity orderEntity : orderEntities) {
|
|
|
|
|
orderEntity.setUpdateTime(null);
|
|
|
|
|
orderEntity.setFromType(ConstantStatus.FROM_UDISP);
|
|
|
|
@ -207,70 +372,8 @@ public class HeartService {
|
|
|
|
|
IoOrderEntity temp = orderService.findByBillNo(orderEntity.getBillNo());
|
|
|
|
|
if (temp == null) {
|
|
|
|
|
orderEntity.setId(null);
|
|
|
|
|
mapper.insert(orderEntity);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//更新码详情
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailCodeEntities())) {
|
|
|
|
|
IoCodeTempDao codeMappert = batchSession.getMapper(IoCodeTempDao.class);
|
|
|
|
|
List<IoCodeEntity> warehouseEntityList = syncDataResponse.getCodeEntities();
|
|
|
|
|
for (IoCodeEntity warehouseEntity : warehouseEntityList) {
|
|
|
|
|
if (warehouseEntity.getOrderId().equals(orderEntity.getBillNo())) {
|
|
|
|
|
IoCodeTempEntity codeTempEntity = new IoCodeTempEntity();
|
|
|
|
|
BeanUtils.copyProperties(warehouseEntity, codeTempEntity);
|
|
|
|
|
codeTempEntity.setId(null);
|
|
|
|
|
codeMappert.insert(codeTempEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//更新业务详情
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailBizEntities())) {
|
|
|
|
|
IoOrderDetailBizDao orderDetailBizDao = batchSession.getMapper(IoOrderDetailBizDao.class);
|
|
|
|
|
List<IoOrderDetailBizEntity> orderDetailBizEntities = syncDataResponse.getOrderDetailBizEntities();
|
|
|
|
|
for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) {
|
|
|
|
|
if (bizEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
|
|
|
|
|
orderDetailBizDao.insert(bizEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//更新码详情
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailCodeEntities())) {
|
|
|
|
|
IoOrderDetailCodeDao orderDetailCodeDao = batchSession.getMapper(IoOrderDetailCodeDao.class);
|
|
|
|
|
List<IoOrderDetailCodeEntity> orderDetailCodeEntities = syncDataResponse.getOrderDetailCodeEntities();
|
|
|
|
|
for (IoOrderDetailCodeEntity codeEntity : orderDetailCodeEntities) {
|
|
|
|
|
if (codeEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
|
|
|
|
|
orderDetailCodeDao.insert(codeEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//更新结果详情
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailResultEntities())) {
|
|
|
|
|
IoOrderDetailResultDao orderDetailResultDao = batchSession.getMapper(IoOrderDetailResultDao.class);
|
|
|
|
|
List<IoOrderDetailResultEntity> orderDetailResultEntities = syncDataResponse.getOrderDetailResultEntities();
|
|
|
|
|
for (IoOrderDetailResultEntity detailResultEntity : orderDetailResultEntities) {
|
|
|
|
|
if (detailResultEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
|
|
|
|
|
orderDetailResultDao.insert(detailResultEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//更新发票信息
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getOrderInvoiceEntities())) {
|
|
|
|
|
IoOrderInvoiceMapper orderInvoiceMapper = batchSession.getMapper(IoOrderInvoiceMapper.class);
|
|
|
|
|
List<IoOrderInvoiceEntity> orderInvoiceEntities = syncDataResponse.getOrderInvoiceEntities();
|
|
|
|
|
for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) {
|
|
|
|
|
if (orderInvoiceEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
|
|
|
|
|
orderInvoiceMapper.insert(orderInvoiceEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
batchSession.commit();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
orderService.insertOrder(orderEntity);
|
|
|
|
|
insetOrderDb(syncDataResponse, orderEntity);
|
|
|
|
|
orderEntity = orderService.findByBillNo(orderEntity.getBillNo());
|
|
|
|
|
addInoutService.dealProcess(orderEntity);
|
|
|
|
|
orderEntity = orderService.findByBillNo(orderEntity.getBillNo());
|
|
|
|
@ -279,7 +382,6 @@ public class HeartService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
batchSession.commit();
|
|
|
|
|
|
|
|
|
|
String logs = "";
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getOrderEntities()))
|
|
|
|
@ -299,7 +401,6 @@ public class HeartService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
batchSession.close();
|
|
|
|
|
spGetHttp.postBasicStatus(basicExportStatusEntity.getId());
|
|
|
|
|
|
|
|
|
|
basicDownloadStatusEntity.setUpdateTime(new Date());
|
|
|
|
@ -315,9 +416,64 @@ public class HeartService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void insetOrderDb(SpsSyncOrderResponse syncDataResponse, IoOrderEntity orderEntity) {
|
|
|
|
|
//更新码详情
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailCodeEntities())) {
|
|
|
|
|
List<IoCodeEntity> warehouseEntityList = syncDataResponse.getCodeEntities();
|
|
|
|
|
for (IoCodeEntity warehouseEntity : warehouseEntityList) {
|
|
|
|
|
if (warehouseEntity.getOrderId().equals(orderEntity.getBillNo())) {
|
|
|
|
|
IoCodeTempEntity codeTempEntity = new IoCodeTempEntity();
|
|
|
|
|
BeanUtils.copyProperties(warehouseEntity, codeTempEntity);
|
|
|
|
|
codeTempEntity.setId(null);
|
|
|
|
|
codeTempService.insert(codeTempEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//更新业务详情
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailBizEntities())) {
|
|
|
|
|
List<IoOrderDetailBizEntity> orderDetailBizEntities = syncDataResponse.getOrderDetailBizEntities();
|
|
|
|
|
for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) {
|
|
|
|
|
if (bizEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
|
|
|
|
|
bizEntity.setId(null);
|
|
|
|
|
orderDetailBizService.insert(bizEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//更新码详情
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailCodeEntities())) {
|
|
|
|
|
List<IoOrderDetailCodeEntity> orderDetailCodeEntities = syncDataResponse.getOrderDetailCodeEntities();
|
|
|
|
|
for (IoOrderDetailCodeEntity codeEntity : orderDetailCodeEntities) {
|
|
|
|
|
if (codeEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
|
|
|
|
|
codeEntity.setId(null);
|
|
|
|
|
orderDetailCodeService.insert(codeEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//更新结果详情
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailResultEntities())) {
|
|
|
|
|
List<IoOrderDetailResultEntity> orderDetailResultEntities = syncDataResponse.getOrderDetailResultEntities();
|
|
|
|
|
for (IoOrderDetailResultEntity detailResultEntity : orderDetailResultEntities) {
|
|
|
|
|
if (detailResultEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
|
|
|
|
|
detailResultEntity.setId(null);
|
|
|
|
|
orderDetailResultService.insert(detailResultEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//更新发票信息
|
|
|
|
|
if (CollUtil.isNotEmpty(syncDataResponse.getOrderInvoiceEntities())) {
|
|
|
|
|
List<IoOrderInvoiceEntity> orderInvoiceEntities = syncDataResponse.getOrderInvoiceEntities();
|
|
|
|
|
for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) {
|
|
|
|
|
if (orderInvoiceEntity.getOrderIdFk().equals(orderEntity.getBillNo())) {
|
|
|
|
|
orderInvoiceService.insertInvoice(orderInvoiceEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
IoAddInoutService addInoutService;
|
|
|
|
|
@Resource
|
|
|
|
|
IoCheckInoutService ioCheckInoutService;
|
|
|
|
|
}
|
|
|
|
|