diff --git a/src/main/java/com/glxp/udi/admin/controller/inout/OrderController.java b/src/main/java/com/glxp/udi/admin/controller/inout/OrderController.java index f7d2510..635766f 100644 --- a/src/main/java/com/glxp/udi/admin/controller/inout/OrderController.java +++ b/src/main/java/com/glxp/udi/admin/controller/inout/OrderController.java @@ -417,7 +417,7 @@ public class OrderController { /** * 补单 * - * @param billNo 单据号 + * @param orderId 单据号 * @return */ @AuthRuleAnnotation("") diff --git a/src/main/java/com/glxp/udi/admin/controller/inout/WareHouseController.java b/src/main/java/com/glxp/udi/admin/controller/inout/WareHouseController.java index 9267e03..44cc435 100644 --- a/src/main/java/com/glxp/udi/admin/controller/inout/WareHouseController.java +++ b/src/main/java/com/glxp/udi/admin/controller/inout/WareHouseController.java @@ -27,10 +27,7 @@ import com.glxp.udi.admin.util.FilterUdiUtils; import com.glxp.udi.common.enums.ResultEnum; import com.glxp.udi.common.util.ResultVOUtils; import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; @@ -263,6 +260,8 @@ public class WareHouseController { } /** + * 删除码 + * * @param deleteCodeRequest * @param bindingResult * @return @@ -282,4 +281,20 @@ public class WareHouseController { return ResultVOUtils.success("删除成功"); } + /** + * 更新码详情创建时间 + * + * @param codeEditRequest + * @param bindingResult + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/warehouse/inout/code/updateCodesTime") + public BaseResponse updateCodesTime(@RequestBody CodeEditRequest codeEditRequest, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); + } + warehouseService.updateCodesTime(codeEditRequest); + return ResultVOUtils.success("更新成功"); + } } diff --git a/src/main/java/com/glxp/udi/admin/dao/inout/CodesDao.java b/src/main/java/com/glxp/udi/admin/dao/inout/CodesDao.java index 8f4895d..af579e7 100644 --- a/src/main/java/com/glxp/udi/admin/dao/inout/CodesDao.java +++ b/src/main/java/com/glxp/udi/admin/dao/inout/CodesDao.java @@ -52,4 +52,11 @@ public interface CodesDao extends BaseMapper { * @param orderId */ void deleteByOrderId(@Param("orderId") String orderId); + + /** + * 根据单号,更新创建时间 + * + * @param orderId + */ + void updateActDateByOrderId(@Param("actDate") String actDate, @Param("orderId") String orderId); } diff --git a/src/main/java/com/glxp/udi/admin/dao/inout/CodesTempDao.java b/src/main/java/com/glxp/udi/admin/dao/inout/CodesTempDao.java index 3e2a9b7..8f72507 100644 --- a/src/main/java/com/glxp/udi/admin/dao/inout/CodesTempDao.java +++ b/src/main/java/com/glxp/udi/admin/dao/inout/CodesTempDao.java @@ -44,4 +44,11 @@ public interface CodesTempDao extends BaseMapper { */ void deleteByOrderId(@Param("orderId") String orderId); + /** + * 根据单据号,更新创建时间 + * + * @param actDate + * @param orderId + */ + void updateActDateByOrderId(@Param("actDate") String actDate, @Param("orderId") String orderId); } diff --git a/src/main/java/com/glxp/udi/admin/dao/inout/OrderDao.java b/src/main/java/com/glxp/udi/admin/dao/inout/OrderDao.java index 9e0e9be..6040a40 100644 --- a/src/main/java/com/glxp/udi/admin/dao/inout/OrderDao.java +++ b/src/main/java/com/glxp/udi/admin/dao/inout/OrderDao.java @@ -37,4 +37,12 @@ public interface OrderDao extends BaseMapper { * @param orderId */ void updateReplicateNo(@Param("replicateNo") String replicateNo, @Param("orderId") String orderId); + + /** + * 根据单据号,查询单据状态值 + * + * @param orderId + * @return + */ + int selectStatusByOrderId(@Param("orderId") String orderId); } diff --git a/src/main/java/com/glxp/udi/admin/req/inout/CodeEditRequest.java b/src/main/java/com/glxp/udi/admin/req/inout/CodeEditRequest.java new file mode 100644 index 0000000..8a322ae --- /dev/null +++ b/src/main/java/com/glxp/udi/admin/req/inout/CodeEditRequest.java @@ -0,0 +1,23 @@ +package com.glxp.udi.admin.req.inout; + +import lombok.Data; + +import java.util.List; + +/** + * 码更新参数对象 + */ +@Data +public class CodeEditRequest { + + /** + * 创建时间 + */ + private String actDate; + + /** + * 扫码单据号 + */ + private List orderIds; + +} diff --git a/src/main/java/com/glxp/udi/admin/service/inout/WarehouseService.java b/src/main/java/com/glxp/udi/admin/service/inout/WarehouseService.java index 4002ffb..d7f1986 100644 --- a/src/main/java/com/glxp/udi/admin/service/inout/WarehouseService.java +++ b/src/main/java/com/glxp/udi/admin/service/inout/WarehouseService.java @@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.glxp.udi.admin.constant.ConstantStatus; import com.glxp.udi.admin.constant.ConstantType; import com.glxp.udi.admin.dao.inout.CodesDao; +import com.glxp.udi.admin.dao.inout.CodesTempDao; +import com.glxp.udi.admin.dao.inout.OrderDao; import com.glxp.udi.admin.entity.inout.*; import com.glxp.udi.admin.req.inout.*; import com.glxp.udi.admin.req.inventory.FilterInvProductRequest; @@ -35,6 +37,10 @@ public class WarehouseService { private OrderDetailService orderDetailService; @Resource private CodesDao codesDao; + @Resource + private CodesTempDao codesTempDao; + @Resource + private OrderDao orderDao; public IPage filterWarehouseByPage(WarehouseQueryRequest warehouseQueryRequest) { @@ -87,7 +93,7 @@ public class WarehouseService { if (StrUtil.isNotBlank(orderId)) { return Collections.emptyList(); } - return codesDao.selectByOrderId(orderId); + return codesDao.selectByOrderId(orderId); } public void replaceCodes(CodesReplaceRequest codesReplaceRequest) { @@ -196,6 +202,11 @@ public class WarehouseService { } } + /** + * 更新码数量 + * + * @param warehouseEntity + */ public void updateCode(WarehouseEntity warehouseEntity) { codesDao.updateCount(warehouseEntity.getCount(), warehouseEntity.getId()); } @@ -204,4 +215,20 @@ public class WarehouseService { codesDao.deleteById(id); } + /** + * 根据单据号,更新码创建时间 + * + * @param codeEditRequest + */ + public void updateCodesTime(CodeEditRequest codeEditRequest) { + for (String orderId : codeEditRequest.getOrderIds()) { + //根据单据状态,判断是更新码表还是临时码表 + int status = orderDao.selectStatusByOrderId(orderId); + if (ConstantStatus.ORDER_STATUS_SUCCESS == status) { + codesDao.updateActDateByOrderId(codeEditRequest.getActDate(), orderId); + } else { + codesTempDao.updateActDateByOrderId(codeEditRequest.getActDate(), orderId); + } + } + } } diff --git a/src/main/resources/mybatis/mapper/inout/CodesDao.xml b/src/main/resources/mybatis/mapper/inout/CodesDao.xml index 715e896..3e348e6 100644 --- a/src/main/resources/mybatis/mapper/inout/CodesDao.xml +++ b/src/main/resources/mybatis/mapper/inout/CodesDao.xml @@ -31,4 +31,10 @@ from io_codes where orderId = #{orderId} + + + update io_codes + set actDate = #{actDate} + where orderId = #{orderId} + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml b/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml index 1f09e1b..48e6a91 100644 --- a/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml +++ b/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml @@ -27,4 +27,7 @@ where orderId = #{orderId} + + update io_codes_temp set actDate = #{actDate} where orderId = #{orderId} + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/inout/OrderDao.xml b/src/main/resources/mybatis/mapper/inout/OrderDao.xml index a4448eb..8d97424 100644 --- a/src/main/resources/mybatis/mapper/inout/OrderDao.xml +++ b/src/main/resources/mybatis/mapper/inout/OrderDao.xml @@ -23,4 +23,8 @@ set replicateNo = #{replicateNo} where orderId = #{orderId} + + \ No newline at end of file