|
|
|
@ -334,7 +334,7 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
|
|
|
|
|
}
|
|
|
|
|
//构造单据数据
|
|
|
|
|
IoOrderEntity orderEntity = new IoOrderEntity();
|
|
|
|
|
bussinessTypeEntity = bussinessTypeService.findByAction(sysWorkplaceDocumentEntity.getDocumentTypeCode());
|
|
|
|
|
bussinessTypeEntity = bussinessTypeService.findByAction(sysWorkplaceDocumentEntity.getUploadDocumentTypeCode());
|
|
|
|
|
orderEntity.setMainAction(bussinessTypeEntity.getMainAction());
|
|
|
|
|
orderEntity.setAction(bussinessTypeEntity.getAction());
|
|
|
|
|
orderEntity.setPreInBillNo(collectOrder.getPreInBillNo());
|
|
|
|
@ -342,11 +342,12 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
|
|
|
|
|
if (IntUtil.value(sysWorkplaceDocumentEntity.getCorpType()) == 2) {
|
|
|
|
|
orderEntity.setInvCode(invWarehouseEntity.getCode());
|
|
|
|
|
orderEntity.setFromCorp(collectOrder.getFromCorp());
|
|
|
|
|
if (invWarehouseEntity != null) orderEntity.setDeptCode(invWarehouseEntity.getParentId());
|
|
|
|
|
} else {
|
|
|
|
|
orderEntity.setInvCode(invWarehouseEntity.getCode());
|
|
|
|
|
orderEntity.setFromCorp(collectOrder.getShipper());
|
|
|
|
|
if (invWarehouseEntity != null) orderEntity.setDeptCode(invWarehouseEntity.getParentId());
|
|
|
|
|
orderEntity.setFromCorp(addInoutService.updateCorp(bussinessTypeEntity, collectOrder.getFromCorp(), collectOrder.getFromCorp()));
|
|
|
|
|
}
|
|
|
|
|
if (invWarehouseEntity != null) {
|
|
|
|
|
orderEntity.setDeptCode(invWarehouseEntity.getParentId());
|
|
|
|
|
}
|
|
|
|
|
orderEntity.setCorpOrderId(CustomUtil.getId() + "x");
|
|
|
|
|
orderEntity.setExportStatus(0);
|
|
|
|
@ -366,6 +367,11 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
|
|
|
|
|
for (IoCollectOrderCodeMan collectOrderCodeMan : collectOrderCodes) {
|
|
|
|
|
lossCodesList.add(buildCodeEntity(collectOrderCodeMan, orderEntity));
|
|
|
|
|
}
|
|
|
|
|
List<IoCollectOrderCodeAuto> collectOrderCodeAutos = collectOrderCodeAutoService.listByBillNo(collectOrder.getBillNo(), null);
|
|
|
|
|
|
|
|
|
|
for (IoCollectOrderCodeAuto collectOrderCodeAuto : collectOrderCodeAutos) {
|
|
|
|
|
lossCodesList.add(buildAutoCodeEntity(collectOrderCodeAuto, orderEntity));
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 如果单据类型为供应商的话,则进行供应商产品绑定
|
|
|
|
|
*/
|
|
|
|
@ -389,19 +395,16 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void updateSpmsOrder(String billNo, AuthAdmin authAdmin) {
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
IoOrderEntity orderEntity = orderService.findByBillNo(billNo);
|
|
|
|
|
if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_REW) {
|
|
|
|
|
if (orderEntity.getFromType() == ConstantStatus.FROM_UDISP) {
|
|
|
|
|
ReviewFinishRequest reviewFinishRequest = new ReviewFinishRequest();
|
|
|
|
|
reviewFinishRequest.setOrderId(billNo);
|
|
|
|
|
ThreadUtil.execAsync(() -> {
|
|
|
|
|
BaseResponse<String> stringBaseResponse = spGetHttp.reviewOrder(reviewFinishRequest, authAdmin.getId() + "");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
updateReview(authAdmin, orderEntity);
|
|
|
|
|
IoOrderEntity orderEntity = orderService.findByBillNo(billNo);
|
|
|
|
|
if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_REW) {
|
|
|
|
|
if (orderEntity.getFromType() == ConstantStatus.FROM_UDISP) {
|
|
|
|
|
ReviewFinishRequest reviewFinishRequest = new ReviewFinishRequest();
|
|
|
|
|
reviewFinishRequest.setOrderId(billNo);
|
|
|
|
|
ThreadUtil.execAsync(() -> {
|
|
|
|
|
BaseResponse<String> stringBaseResponse = spGetHttp.reviewOrder(reviewFinishRequest, authAdmin.getId() + "");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
updateReview(authAdmin, orderEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -498,6 +501,29 @@ public class IoCollectOrderBackupService extends ServiceImpl<IoCollectOrderBacku
|
|
|
|
|
return tempEntity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//todo 这个有问题,自动赋码还有数据没补齐
|
|
|
|
|
private IoCodeTempEntity buildAutoCodeEntity(IoCollectOrderCodeAuto collectOrderCodeMan, IoOrderEntity orderEntity) {
|
|
|
|
|
IoCodeTempEntity tempEntity = new IoCodeTempEntity();
|
|
|
|
|
tempEntity.setOrderId(orderEntity.getBillNo());
|
|
|
|
|
tempEntity.setCode(collectOrderCodeMan.getUdiCode());
|
|
|
|
|
tempEntity.setRelId(collectOrderCodeMan.getRelId());
|
|
|
|
|
tempEntity.setMainAction(orderEntity.getMainAction());
|
|
|
|
|
tempEntity.setInvCode(orderEntity.getInvCode());
|
|
|
|
|
tempEntity.setBatchNo(collectOrderCodeMan.getBatchNo());
|
|
|
|
|
tempEntity.setProduceDate(collectOrderCodeMan.getProductDate());
|
|
|
|
|
tempEntity.setExpireDate(collectOrderCodeMan.getExpireDate());
|
|
|
|
|
tempEntity.setSerialNo(collectOrderCodeMan.getSerialNo());
|
|
|
|
|
tempEntity.setNameCode(collectOrderCodeMan.getUdiCode());
|
|
|
|
|
tempEntity.setCount(1);
|
|
|
|
|
tempEntity.setReCount(1);
|
|
|
|
|
tempEntity.setCreateTime(new Date());
|
|
|
|
|
tempEntity.setUpdateTime(new Date());
|
|
|
|
|
CompanyProductRelevanceEntity udiRlSupEntity = udiRlSupService.selOneByRlId(tempEntity.getRelId());
|
|
|
|
|
if (udiRlSupEntity != null) tempEntity.setSupId(udiRlSupEntity.getCustomerId());
|
|
|
|
|
tempEntity.setDeptCode(orderEntity.getDeptCode());
|
|
|
|
|
return tempEntity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
|
|
|
public Boolean orderUpload(String billNo, AuthAdmin authAdmin) {
|
|
|
|
|