单据相关bug修改,单据撤回,单据编辑

master
anthonywj 2 years ago
parent 25b27d1c6f
commit a380f67945

@ -58,6 +58,10 @@ public class IoOrderController extends BaseController {
IoOrderDetailBizService orderDetailBizService;
@Resource
IoOrderDetailCodeService orderDetailCodeService;
@Resource
IoAddInoutService ioAddInoutService;
@Resource
IoCheckInoutService ioCheckInoutService;
/**
*
@ -75,54 +79,8 @@ public class IoOrderController extends BaseController {
return ResultVOUtils.page(pageInfo);
}
@AuthRuleAnnotation("")
@GetMapping("udiwms/inout/order/draft")
public BaseResponse getDrafts() {
List<IoOrderEntity> orderEntityList = orderService.selectAll();
PageSimpleResponse<IoOrderEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(Long.valueOf(orderEntityList.size()));
pageSimpleResponse.setList(orderEntityList);
return ResultVOUtils.success(pageSimpleResponse);
}
//处理单据提交,草稿保存
@AuthRuleAnnotation("")
@PostMapping("warehouse/inout/saveOrderWeb")
public BaseResponse saveOrderWeb(@RequestBody AddOrderRequest addOrderRequest) {
IoOrderEntity orderEntity = new IoOrderEntity();
if (StrUtil.isEmpty(addOrderRequest.getAction()))
return ResultVOUtils.error(500, "单据类型不能为空");
orderEntity.setAction(addOrderRequest.getAction());
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(addOrderRequest.getAction());
orderEntity.setMainAction(bussinessTypeEntity.getMainAction());
orderEntity.setFromCorp(addOrderRequest.getFromCorp());
orderEntity.setRemark(addOrderRequest.getRemark());
orderEntity.setFromInvCode(addOrderRequest.getFromInvCode());
orderEntity.setDeptCode(addOrderRequest.getDeptCode());
orderEntity.setBillNo(addOrderRequest.getBillNo());
orderEntity.setInvCode(addOrderRequest.getInvCode());
orderService.updateByBillNo(orderEntity);
IoCodeTempEntity warehouseEntity = new IoCodeTempEntity();
warehouseEntity.setOrderId(orderEntity.getBillNo());
warehouseEntity.setAction(orderEntity.getAction());
warehouseEntity.setMainAction(orderEntity.getMainAction());
warehouseEntity.setDeptCode(orderEntity.getDeptCode());
warehouseEntity.setInvCode(orderEntity.getInvCode());
codeTempService.updateByOrderId(warehouseEntity);
return ResultVOUtils.success("保存成功!");
}
@Resource
IoAddInoutService ioAddInoutService;
@Resource
IoCheckInoutService ioCheckInoutService;
//新增业务单据提交
//新增业务-立即提交
@AuthRuleAnnotation("")
@PostMapping("warehouse/inout/submitBiz")
public BaseResponse submitBiz(@RequestBody AddOrderRequest addOrderRequest) {
@ -149,7 +107,7 @@ public class IoOrderController extends BaseController {
return ResultVOUtils.success("提交成功!");
}
//新增扫码单据提交
//新增扫码单据-立即提交
@AuthRuleAnnotation("")
@PostMapping("warehouse/inout/submitCodes")
public BaseResponse submitCodes(@RequestBody AddOrderRequest addOrderRequest) {
@ -171,13 +129,41 @@ public class IoOrderController extends BaseController {
}
//处理后单据提交
//新增业务单据,新增扫码单据,等待校验-草稿保存
@AuthRuleAnnotation("")
@PostMapping("warehouse/inout/saveOrderWeb")
public BaseResponse saveOrderWeb(@RequestBody AddOrderRequest addOrderRequest) {
IoOrderEntity orderEntity = new IoOrderEntity();
if (StrUtil.isEmpty(addOrderRequest.getAction()))
return ResultVOUtils.error(500, "单据类型不能为空");
orderEntity.setAction(addOrderRequest.getAction());
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(addOrderRequest.getAction());
orderEntity.setMainAction(bussinessTypeEntity.getMainAction());
orderEntity.setFromCorp(addOrderRequest.getFromCorp());
orderEntity.setRemark(addOrderRequest.getRemark());
orderEntity.setFromInvCode(addOrderRequest.getFromInvCode());
orderEntity.setDeptCode(addOrderRequest.getDeptCode());
orderEntity.setBillNo(addOrderRequest.getBillNo());
orderEntity.setInvCode(addOrderRequest.getInvCode());
orderService.updateByBillNo(orderEntity);
IoCodeTempEntity warehouseEntity = new IoCodeTempEntity();
warehouseEntity.setOrderId(orderEntity.getBillNo());
warehouseEntity.setAction(orderEntity.getAction());
warehouseEntity.setMainAction(orderEntity.getMainAction());
warehouseEntity.setDeptCode(orderEntity.getDeptCode());
warehouseEntity.setInvCode(orderEntity.getInvCode());
codeTempService.updateByOrderId(warehouseEntity);
return ResultVOUtils.success("保存成功!");
}
//等待校验-立即提交
@AuthRuleAnnotation("")
@PostMapping("warehouse/inout/submitOrderWeb")
public BaseResponse submitOrderWeb(@RequestBody AddOrderRequest addOrderRequest) {
//校验单据是否已完成
List<IoOrderDetailBizEntity> orderDetailBizEntities = orderDetailBizService.findByOrderId(addOrderRequest.getBillNo());
List<IoOrderDetailCodeEntity> orderDetailCodeEntities = orderDetailCodeService.findByOrderId(addOrderRequest.getBillNo());
@ -216,6 +202,7 @@ public class IoOrderController extends BaseController {
return ResultVOUtils.success("提交成功!");
}
@Resource
IoCodeService codeService;
@ -264,8 +251,8 @@ public class IoOrderController extends BaseController {
//已验收单据撤回
@AuthRuleAnnotation("")
@GetMapping("/udiwms/stock/order/received/rollback")
public BaseResponse rollbackOrder(String billNo, Integer contrastStatus) {
@GetMapping("/udiwms/inout/order/received/rollback")
public BaseResponse rollbackOrder(String billNo) {
if (StrUtil.isBlank(billNo)) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
@ -273,6 +260,10 @@ public class IoOrderController extends BaseController {
if (StrUtil.isNotEmpty(orderEntity.getSupplementNo()) || StrUtil.isNotEmpty(orderEntity.getUllageSupNo())) {
return ResultVOUtils.error(500, "单据已补单,无法撤回!");
}
if (orderEntity.getSyncStatus() != null && orderEntity.getSyncStatus() == 1) {
return ResultVOUtils.error(500, "单据已同步,无法撤回!");
}
boolean result = orderService.rollbackOrder(billNo);
if (result) {
return ResultVOUtils.success();
@ -284,7 +275,7 @@ public class IoOrderController extends BaseController {
//已校验单据撤回到等待处理
@AuthRuleAnnotation("")
@GetMapping("/udiwms/inout/order/unReceive/rollback")
public BaseResponse rollUnReceivebackOrder(String billNo, Integer contrastStatus) {
public BaseResponse rollUnReceivebackOrder(String billNo) {
if (StrUtil.isBlank(billNo)) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}

@ -195,6 +195,11 @@ public class IoOrderEntity {
@TableField(value = "orderType")
private Integer orderType;
//单据同步状态
@TableField(value = "syncStatus")
private Integer syncStatus;
@TableField(value = "fromReceiveBillNo")
private String fromReceiveBillNo;

@ -31,5 +31,6 @@ public class FilterOrderDetailResultRequest extends ListPageRequest {
private int showType;
private String productName;
private String coName;
}

@ -204,6 +204,7 @@ public class IoOrderResponse {
* 1.2:,3. 稿
*/
private Integer orderType;
private Integer syncStatus;
private String fromReceiveBillNo;
private String fromThrBillNo;
//是否可以补单

@ -70,7 +70,7 @@ public class IoAddInoutService {
//新增扫码单据处理
public void dealProcess(IoOrderEntity orderEntity) {
orderEntity.setRemark("正在处理!");
orderEntity.setErrMsg("正在处理!");
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESSING);
orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST);
orderEntity.setUpdateTime(new Date());
@ -79,7 +79,7 @@ public class IoAddInoutService {
List<IoOrderEntity> orderEntities = orderService.isExitRepeat(orderEntity.getCorpOrderId(), orderEntity.getBillNo());
if (CollUtil.isNotEmpty(orderEntities)) {
orderEntity.setRemark("单据重复上传");
orderEntity.setErrMsg("单据重复上传");
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);
@ -88,14 +88,14 @@ public class IoAddInoutService {
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
if (bussinessTypeEntity == null) {
orderEntity.setRemark("单据类型不存在");
orderEntity.setErrMsg("单据类型不存在");
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);
return;
}
if (StrUtil.isEmpty(orderEntity.getFromCorp()) && StrUtil.isEmpty(orderEntity.getFromInvCode())) {
orderEntity.setRemark("未选择往来单位");
orderEntity.setErrMsg("未选择往来单位");
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);
@ -121,7 +121,7 @@ public class IoAddInoutService {
if (StrUtil.isEmpty(orderEntity.getInvCode())) {
orderEntity.setRemark("未选择当前仓库信息");
orderEntity.setErrMsg("未选择当前仓库信息");
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);
@ -147,7 +147,7 @@ public class IoAddInoutService {
//三期校验
String checkOriginMsg = checkOriginCode(warehouseEntity);
if (StrUtil.isNotEmpty(checkOriginMsg)) {
orderEntity.setRemark("checkOriginMsg");
orderEntity.setErrMsg("checkOriginMsg");
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);
@ -159,7 +159,7 @@ public class IoAddInoutService {
if ((warehouseEntity.getRelId() == null)) {
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderEntity.setRemark("udi码" + warehouseEntity.getCode() + "上传时对照数据丢失,请选择对!");
orderEntity.setErrMsg("udi码" + warehouseEntity.getCode() + "上传时对照数据丢失,请选择对!");
orderService.update(orderEntity);
return;
}
@ -168,7 +168,7 @@ public class IoAddInoutService {
if (StrUtil.isEmpty(warehouseEntity.getSupId())) {
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderEntity.setRemark("udi码" + warehouseEntity.getCode() + "未指定供应商!");
orderEntity.setErrMsg("udi码" + warehouseEntity.getCode() + "未指定供应商!");
orderService.update(orderEntity);
return;
}
@ -179,7 +179,7 @@ public class IoAddInoutService {
if (udiRlSupEntity == null) {
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderEntity.setRemark("udi码" + warehouseEntity.getCode() + "当前供应商不存在此配送产品");
orderEntity.setErrMsg("udi码" + warehouseEntity.getCode() + "当前供应商不存在此配送产品");
orderService.update(orderEntity);
return;
}
@ -190,14 +190,14 @@ public class IoAddInoutService {
if (udiRelevanceResponse == null) {
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderEntity.setRemark("udi码" + warehouseEntity.getCode() + "该产品信息未维护");
orderEntity.setErrMsg("udi码" + warehouseEntity.getCode() + "该产品信息未维护");
orderService.update(orderEntity);
return;
} else if (!udiRelevanceResponse.getUseDy() && udiRelevanceResponse.getDiType() == ConstantStatus.DITYPE_SYDY) {
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderEntity.setRemark("udi码" + warehouseEntity.getCode() + "该产品不允许以使用单元入库");
orderEntity.setErrMsg("udi码" + warehouseEntity.getCode() + "该产品不允许以使用单元入库");
orderService.update(orderEntity);
return;
}
@ -213,12 +213,12 @@ public class IoAddInoutService {
}
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK);
orderEntity.setUpdateTime(new Date());
orderEntity.setRemark("");
orderEntity.setErrMsg("");
orderService.update(orderEntity);
} else {
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderEntity.setRemark("未添加UDI码");
orderEntity.setErrMsg("未添加UDI码");
orderService.update(orderEntity);
}
@ -227,7 +227,7 @@ public class IoAddInoutService {
//新增业务单据处理
public void dealBusProcess(IoOrderEntity orderEntity) {
orderEntity.setRemark("正在处理!");
orderEntity.setErrMsg("正在处理!");
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESSING);
orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST);
orderEntity.setUpdateTime(new Date());
@ -236,7 +236,7 @@ public class IoAddInoutService {
List<IoOrderEntity> orderEntities = orderService.isExitRepeat(orderEntity.getCorpOrderId(), orderEntity.getBillNo());
if (CollUtil.isNotEmpty(orderEntities)) {
orderEntity.setRemark("单据重复上传");
orderEntity.setErrMsg("单据重复上传");
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);
@ -245,7 +245,7 @@ public class IoAddInoutService {
if (StrUtil.isEmpty(orderEntity.getFromCorp()) && StrUtil.isEmpty(orderEntity.getFromInvCode())) {
orderEntity.setRemark("未选择往来单位");
orderEntity.setErrMsg("未选择往来单位");
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);
@ -253,7 +253,7 @@ public class IoAddInoutService {
}
if (StrUtil.isEmpty(orderEntity.getInvCode())) {
orderEntity.setRemark("未选择当前仓库信息");
orderEntity.setErrMsg("未选择当前仓库信息");
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);
@ -276,7 +276,7 @@ public class IoAddInoutService {
}
if (StrUtil.isNotEmpty(errMsg)) {
orderEntity.setRemark(errMsg);
orderEntity.setErrMsg(errMsg);
orderEntity.setStatus(ConstantStatus.ORDER_STATS_ERROR);
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);

@ -373,7 +373,7 @@ public class IoOrderServiceImpl implements IoOrderService {
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK_SUCCESS);
orderEntity.setUpdateTime(new Date());
update(orderEntity);
return false;
return true;
}
@Override
@ -432,13 +432,20 @@ public class IoOrderServiceImpl implements IoOrderService {
}
List<IoOrderResponse> result = new ArrayList<>();
orderEntities.forEach(orderEntity -> {
IoOrderResponse response = new IoOrderResponse();
BeanUtil.copyProperties(orderEntity, response);
if (orderEntity.getStatus().equals(ConstantStatus.ORDER_STATUS_AUDITED) && checkBusTypeSupplementOrder(orderEntity)
&& StrUtil.isEmpty(orderEntity.getSupplementNo())) {
response.setEnableSupplementOrder(true);
try {
IoOrderResponse response = new IoOrderResponse();
BeanUtil.copyProperties(orderEntity, response);
if (orderEntity.getStatus().equals(ConstantStatus.ORDER_STATUS_AUDITED) && checkBusTypeSupplementOrder(orderEntity)
&& StrUtil.isEmpty(orderEntity.getSupplementNo())) {
response.setEnableSupplementOrder(true);
}
result.add(response);
} catch (Exception e) {
e.printStackTrace();
log.error(orderEntity.getBillNo() + "平衡补单出错\n" + e.getCause().toString());
}
result.add(response);
});
return result;
}

@ -4,7 +4,7 @@ server:
spring:
datasource:
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
jdbc-url: jdbc:p6spy:mysql://192.168.0.66:3364/udi_wms_wmd?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
jdbc-url: jdbc:p6spy:mysql://192.168.0.66:3364/udi_wms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: Glxp@6066
hikari:

@ -1,6 +1,6 @@
spring:
profiles:
active: pro
active: dev
jmx:
enabled: true

@ -109,6 +109,9 @@
<if test="deptCode != null and deptCode != ''">
AND deptCode = #{deptCode}
</if>
<if test="syncStatus != null">
AND syncStatus = #{syncStatus}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND date_format(createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d')
</if>

@ -1,6 +1,8 @@
-- 字段新增 表名字段名字段类型修改方式1新增2修改3删除
CALL Pro_Temp_ColumnWork('io_order', 'fromReceiveBillNo', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'fromThrBillNo', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'syncStatus', 'tinyint ', 1);
CALL Pro_Temp_ColumnWork('thr_bustype_origin', 'thirdSysName', 'varchar(255) ', 3);
CALL Pro_Temp_ColumnWork('thr_system_bus_api', 'thirdBuyName', 'varchar(255) ', 3);

Loading…
Cancel
Save