diff --git a/src/main/java/com/glxp/api/constant/Constant.java b/src/main/java/com/glxp/api/constant/Constant.java index 5e03eeed..15820ff1 100644 --- a/src/main/java/com/glxp/api/constant/Constant.java +++ b/src/main/java/com/glxp/api/constant/Constant.java @@ -262,6 +262,7 @@ public class Constant { public static final String ORDER_ACTION_SUP_DELAUDIT = "supDelAudit"; public static final String ORDER_ACTION_SUP_INOUT = "supInout"; public static final String ORDER_ACTION_SUP_PREIN = "preInOrder"; + public static final String ORDER_ACTION_SUP_RETURN = "supReturned"; public static final String SYNC_REMARK = "syncRemark"; diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java index 33c79085..0701e507 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java @@ -15,6 +15,7 @@ import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.*; import com.glxp.api.controller.BaseController; import com.glxp.api.controller.sync.SpsSyncWebSocket; +import com.glxp.api.dao.inout.IoOrderDetailBizDao; import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.auth.InvBusUserEntity; import com.glxp.api.entity.auth.InvWarehouseEntity; @@ -83,7 +84,7 @@ public class IoOrderController extends BaseController { @Resource IoOrderInvoiceService orderInvoiceService; @Resource - private SystemParamConfigService systemParamConfigService; + IoOrderDetailBizDao orderDetailBizDao; /** * 查询单据列表 @@ -873,7 +874,7 @@ public class IoOrderController extends BaseController { return ResultVOUtils.page(pageInfo); } - + @AuthRuleAnnotation("") @GetMapping("/udiwms/inout/order/findByBillNo") public BaseResponse findByBillNo(@RequestParam("billNo") String billNo) { if (StrUtil.isBlank(billNo)) { @@ -883,5 +884,56 @@ public class IoOrderController extends BaseController { return ResultVOUtils.success(orderEntity); } + /** + * 单据再次配货 + * + * @param ioOrderEntity + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udiwms/inout/order/copyOrder") + @Log(title = "单据再次配货", businessType = BusinessType.UPDATE) + public BaseResponse copyOrder(@RequestBody IoOrderEntity ioOrderEntity) { + + IoOrderEntity orderEntity; + IoOrderEntity originOrderEntity = orderService.findByBillNo(ioOrderEntity.getBillNo()); + originOrderEntity.setRepeatSup(true); + orderService.update(originOrderEntity); + + orderEntity = orderService.findByCorpId(ioOrderEntity.getBillNo()); + if (orderEntity != null && orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_TEMP_SAVE) { + return ResultVOUtils.success(orderEntity); + } + orderEntity = new IoOrderEntity(); + BeanUtil.copyProperties(originOrderEntity, orderEntity); + + String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER, "yyyyMMdd")); + orderEntity.setCreateTime(new Date()); + orderEntity.setBillNo(orderNo); + orderEntity.setStatus(ConstantStatus.ORDER_STATUS_TEMP_SAVE); + orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_DRAFT); + orderEntity.setCorpOrderId(orderEntity.getBillNo()); + orderEntity.setFromType(ConstantStatus.FROM_WEBNEW); + orderEntity.setMainAction(ConstantType.TYPE_PUT); + orderEntity.setAction(null); + orderEntity.setUpdateTime(new Date()); + orderEntity.setUpdateUser(null); + orderEntity.setRelKey(null); + orderEntity.setRepeatSup(true); + orderEntity.setOriginUllageSupNo(orderEntity.getBillNo()); + orderService.insertOrder(orderEntity); + + List originDetailBizEntities = orderDetailBizService.findByOrderId(ioOrderEntity.getBillNo()); + List orderDetailBizEntities = BeanUtil.copyToList(originDetailBizEntities, IoOrderDetailBizEntity.class); + orderDetailBizEntities.forEach(item -> + { + item.setId(null); + item.setOrderIdFk(orderNo); + orderDetailBizService.insert(item); + } + ); + return ResultVOUtils.success(orderEntity); + } + } diff --git a/src/main/java/com/glxp/api/entity/inout/IoOrderEntity.java b/src/main/java/com/glxp/api/entity/inout/IoOrderEntity.java index 7faf107f..c97837d5 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoOrderEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoOrderEntity.java @@ -271,4 +271,11 @@ public class IoOrderEntity { private String outSickInfo; + /** + * 是否已重新配货 + */ + @TableField(value = "repeatSup") + private Boolean repeatSup; + + } diff --git a/src/main/java/com/glxp/api/res/inout/IoOrderResponse.java b/src/main/java/com/glxp/api/res/inout/IoOrderResponse.java index 096ebe09..4835050e 100644 --- a/src/main/java/com/glxp/api/res/inout/IoOrderResponse.java +++ b/src/main/java/com/glxp/api/res/inout/IoOrderResponse.java @@ -258,6 +258,9 @@ public class IoOrderResponse { private boolean checkType; + private Boolean repeatSup; + + public String getFromName() { if (StrUtil.isNotEmpty(fromCorpName)) diff --git a/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java index 4315391a..9d78beb3 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java @@ -257,7 +257,11 @@ public class BasicBussinessTypeServiceImpl extends ServiceImpl() .gt("spUse", 0).eq("enable", true).eq("corpType", ConstantStatus.CORP_TYPE_OUT).eq("actionType", 2)); - + break; + case Constant.ORDER_ACTION_SUP_RETURN: + bussinessTypeEntities = basicBussinessTypeDao.selectList(new QueryWrapper() + .gt("spUse", 0).eq("enable", true).eq("corpType", ConstantStatus.CORP_TYPE_OUT).eq("mainAction", ConstantType.TYPE_OUT)); + break; default: break; } diff --git a/src/main/java/com/glxp/api/service/inout/IoOrderService.java b/src/main/java/com/glxp/api/service/inout/IoOrderService.java index 203651bf..c4b42b22 100644 --- a/src/main/java/com/glxp/api/service/inout/IoOrderService.java +++ b/src/main/java/com/glxp/api/service/inout/IoOrderService.java @@ -23,6 +23,9 @@ public interface IoOrderService { IoOrderEntity findByBillNo(String billNO); + IoOrderEntity findByCorpId(String corpOrderId); + + List findByStatus(String action, Integer status, Date lastUpdateTime); int insertOrder(IoOrderEntity orderEntity); @@ -126,5 +129,6 @@ public interface IoOrderService { boolean isExitByAction(String action); + List selectList(Long userId); } diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java index a988b716..b3606eed 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java @@ -144,6 +144,12 @@ public class IoOrderServiceImpl implements IoOrderService { return orderDao.selectOne(new QueryWrapper().eq("billNo", billNO)); } + @Override + public IoOrderEntity findByCorpId(String corpOrderId) { + return orderDao.selectOne(new QueryWrapper().eq("corpOrderId", corpOrderId).last("limit 1")); + + } + @Override public List findByStatus(String action, Integer status, Date lastUpdateTime) { return orderDao.selectList(Wrappers.lambdaQuery(IoOrderEntity.class).eq(IoOrderEntity::getAction, action).eq(IoOrderEntity::getStatus, status) diff --git a/src/main/resources/schemas/schema_v2.3.sql b/src/main/resources/schemas/schema_v2.3.sql index 68b8c452..c23c681f 100644 --- a/src/main/resources/schemas/schema_v2.3.sql +++ b/src/main/resources/schemas/schema_v2.3.sql @@ -695,3 +695,7 @@ CALL Pro_Temp_ColumnWork('io_order_detail_code', 'sterDate', 'varchar(255)', 1); CALL Pro_Temp_ColumnWork('io_order_detail_result', 'sterBatchNo', 'varchar(255)', 1); CALL Pro_Temp_ColumnWork('io_order_detail_result', 'sterDate', 'varchar(255)', 1); +CALL Pro_Temp_ColumnWork('io_order', 'repeatSup', 'tinyint', 1); + + +