From 2b3021f13786a35cc175e79094ff4341bb5652e4 Mon Sep 17 00:00:00 2001 From: x_z Date: Mon, 26 Sep 2022 17:59:07 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4=E7=A0=81?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=202.=E4=BF=AE=E5=A4=8D=E4=B8=80=E7=BA=A7?= =?UTF-8?q?=E5=8C=85=E8=A3=85=E4=B8=94=E6=9C=80=E5=B0=8F=E9=94=80=E5=94=AE?= =?UTF-8?q?=E5=8C=85=E8=A3=85=E6=95=B0=E9=87=8F=E4=B8=BA0=E6=97=B6?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E6=95=B0=E9=87=8F=E9=94=99=E8=AF=AF=E9=97=AE?= =?UTF-8?q?=E9=A2=98=203.=E6=89=93=E5=8D=B0=E6=A8=A1=E6=9D=BF=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8D=95=E6=8D=AE=E7=B1=BB=E5=9E=8B=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=EF=BC=8C=E7=BB=91=E5=AE=9A=E5=8D=95=E6=8D=AE=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/inout/WareHouseController.java | 23 ++++++++++++++++++- .../param/SystemPDFTemplateController.java | 7 ++++++ .../admin/entity/info/DeviceKeyEntity.java | 3 +++ .../udi/admin/entity/inout/UdiInfoEntity.java | 7 ++++++ .../entity/param/SystemPDFTemplateEntity.java | 5 ++++ .../admin/req/inout/DeleteCodeRequest.java | 11 +++++++++ .../inventory/FilterInvLinkDataRequest.java | 3 --- .../param/SystemPDFTemplateSaveRequest.java | 5 ++++ .../res/param/SystemPDFTemplateResponse.java | 5 ++++ .../service/basic/BussinessTypeService.java | 13 +++++++++++ .../service/inout/WarehouseTempService.java | 13 ++++++++++- .../glxp/udi/admin/util/inout/InoutUtils.java | 11 ++++++++- .../mybatis/mapper/inout/CodesTempDao.xml | 1 + .../mapper/param/SystemPDFTemplateDao.xml | 5 +++- 14 files changed, 105 insertions(+), 7 deletions(-) create mode 100644 src/main/java/com/glxp/udi/admin/req/inout/DeleteCodeRequest.java 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 5e6611a..9267e03 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 @@ -1,5 +1,6 @@ package com.glxp.udi.admin.controller.inout; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -117,7 +118,7 @@ public class WareHouseController { */ @AuthRuleAnnotation("") @GetMapping("/warehouse/inout/warehouseUserList") - public BaseResponse getWarehouseUserList(@Valid FilterInvLinkDataRequest filterInvLinkDataRequest) { + public BaseResponse getWarehouseUserList(FilterInvLinkDataRequest filterInvLinkDataRequest) { Page page = warehouseUserService.filterUserList(filterInvLinkDataRequest); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); pageSimpleResponse.setTotal(page.getTotal()); @@ -261,4 +262,24 @@ public class WareHouseController { return ResultVOUtils.success(); } + /** + * @param deleteCodeRequest + * @param bindingResult + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/warehouse/inout/code/deleteCodes") + public BaseResponse deleteCodes(@RequestBody DeleteCodeRequest deleteCodeRequest, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + List ids = deleteCodeRequest.getCodes(); + if (CollUtil.isNotEmpty(ids)) { + warehouseTempService.deleteCodes(ids); + } else { + return ResultVOUtils.error(ResultEnum.DATA_ERROR); + } + return ResultVOUtils.success("删除成功"); + } + } diff --git a/src/main/java/com/glxp/udi/admin/controller/param/SystemPDFTemplateController.java b/src/main/java/com/glxp/udi/admin/controller/param/SystemPDFTemplateController.java index ce77f6d..4b528ec 100644 --- a/src/main/java/com/glxp/udi/admin/controller/param/SystemPDFTemplateController.java +++ b/src/main/java/com/glxp/udi/admin/controller/param/SystemPDFTemplateController.java @@ -1,6 +1,7 @@ package com.glxp.udi.admin.controller.param; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.glxp.udi.admin.annotation.AuthRuleAnnotation; @@ -10,6 +11,7 @@ import com.glxp.udi.admin.req.param.SystemPDFTemplateRequest; import com.glxp.udi.admin.req.param.SystemPDFTemplateSaveRequest; import com.glxp.udi.admin.res.PageSimpleResponse; import com.glxp.udi.admin.res.param.SystemPDFTemplateResponse; +import com.glxp.udi.admin.service.basic.BussinessTypeService; import com.glxp.udi.admin.service.param.SystemPDFTemplateService; import com.glxp.udi.admin.util.JasperUtils; import com.glxp.udi.admin.util.PageUtil; @@ -37,6 +39,8 @@ public class SystemPDFTemplateController { @Resource private SystemPDFTemplateService systemPDFTemplateService; + @Resource + private BussinessTypeService bussinessTypeService; @AuthRuleAnnotation("system/pdf/template/list") @GetMapping("/system/pdf/template/list") @@ -49,6 +53,9 @@ public class SystemPDFTemplateController { List systemPDFTemplateResponseList = page.getRecords().stream().map(item -> { SystemPDFTemplateResponse systemPDFTemplateResponse = new SystemPDFTemplateResponse(); BeanUtils.copyProperties(item, systemPDFTemplateResponse); + if (StrUtil.isNotBlank(item.getAction())) { + systemPDFTemplateResponse.setBussinessTypeName(bussinessTypeService.findNameByAction(item.getAction())); + } return systemPDFTemplateResponse; }).collect(Collectors.toList()); diff --git a/src/main/java/com/glxp/udi/admin/entity/info/DeviceKeyEntity.java b/src/main/java/com/glxp/udi/admin/entity/info/DeviceKeyEntity.java index a10a1c9..0557e60 100644 --- a/src/main/java/com/glxp/udi/admin/entity/info/DeviceKeyEntity.java +++ b/src/main/java/com/glxp/udi/admin/entity/info/DeviceKeyEntity.java @@ -1,5 +1,7 @@ package com.glxp.udi.admin.entity.info; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -7,6 +9,7 @@ import lombok.Data; @TableName("device_check") public class DeviceKeyEntity { + @TableId(type = IdType.AUTO) private String id; private String imei; diff --git a/src/main/java/com/glxp/udi/admin/entity/inout/UdiInfoEntity.java b/src/main/java/com/glxp/udi/admin/entity/inout/UdiInfoEntity.java index fa1b46d..ab6a8c2 100644 --- a/src/main/java/com/glxp/udi/admin/entity/inout/UdiInfoEntity.java +++ b/src/main/java/com/glxp/udi/admin/entity/inout/UdiInfoEntity.java @@ -114,4 +114,11 @@ public class UdiInfoEntity { @TableField(exist = false) private Boolean isCheck; + public int getBhzxxsbzsl() { + if (bhzxxsbzsl == null || bhzxxsbzsl == 0) { + return 1; + } else + return bhzxxsbzsl; + } + } diff --git a/src/main/java/com/glxp/udi/admin/entity/param/SystemPDFTemplateEntity.java b/src/main/java/com/glxp/udi/admin/entity/param/SystemPDFTemplateEntity.java index 804fb1b..86531f3 100644 --- a/src/main/java/com/glxp/udi/admin/entity/param/SystemPDFTemplateEntity.java +++ b/src/main/java/com/glxp/udi/admin/entity/param/SystemPDFTemplateEntity.java @@ -41,4 +41,9 @@ public class SystemPDFTemplateEntity { */ private String customerId; + /** + * 单据类型代码 + */ + private String action; + } diff --git a/src/main/java/com/glxp/udi/admin/req/inout/DeleteCodeRequest.java b/src/main/java/com/glxp/udi/admin/req/inout/DeleteCodeRequest.java new file mode 100644 index 0000000..56973a9 --- /dev/null +++ b/src/main/java/com/glxp/udi/admin/req/inout/DeleteCodeRequest.java @@ -0,0 +1,11 @@ +package com.glxp.udi.admin.req.inout; + +import lombok.Data; + +import java.util.List; + +@Data +public class DeleteCodeRequest { + List codes; + +} diff --git a/src/main/java/com/glxp/udi/admin/req/inventory/FilterInvLinkDataRequest.java b/src/main/java/com/glxp/udi/admin/req/inventory/FilterInvLinkDataRequest.java index 7732e42..715c51a 100644 --- a/src/main/java/com/glxp/udi/admin/req/inventory/FilterInvLinkDataRequest.java +++ b/src/main/java/com/glxp/udi/admin/req/inventory/FilterInvLinkDataRequest.java @@ -3,8 +3,6 @@ package com.glxp.udi.admin.req.inventory; import com.glxp.udi.admin.req.ListPageRequest; import lombok.Data; -import javax.validation.constraints.NotBlank; - /** * 查询仓库关联的数据请求参数 */ @@ -12,7 +10,6 @@ import javax.validation.constraints.NotBlank; public class FilterInvLinkDataRequest extends ListPageRequest { //分仓码 - @NotBlank(message = "仓库码不能为空") private String code; } diff --git a/src/main/java/com/glxp/udi/admin/req/param/SystemPDFTemplateSaveRequest.java b/src/main/java/com/glxp/udi/admin/req/param/SystemPDFTemplateSaveRequest.java index 5842505..b710f73 100644 --- a/src/main/java/com/glxp/udi/admin/req/param/SystemPDFTemplateSaveRequest.java +++ b/src/main/java/com/glxp/udi/admin/req/param/SystemPDFTemplateSaveRequest.java @@ -24,4 +24,9 @@ public class SystemPDFTemplateSaveRequest { * 客户ID */ private String customerId; + + /** + * 单据类型代码 + */ + private String action; } \ No newline at end of file diff --git a/src/main/java/com/glxp/udi/admin/res/param/SystemPDFTemplateResponse.java b/src/main/java/com/glxp/udi/admin/res/param/SystemPDFTemplateResponse.java index 031e7ce..cd43e9f 100644 --- a/src/main/java/com/glxp/udi/admin/res/param/SystemPDFTemplateResponse.java +++ b/src/main/java/com/glxp/udi/admin/res/param/SystemPDFTemplateResponse.java @@ -26,4 +26,9 @@ public class SystemPDFTemplateResponse { * 客户ID */ private String customerId; + + /** + * 单据类型名称 + */ + private String bussinessTypeName; } \ No newline at end of file diff --git a/src/main/java/com/glxp/udi/admin/service/basic/BussinessTypeService.java b/src/main/java/com/glxp/udi/admin/service/basic/BussinessTypeService.java index f805e58..3cfcfa8 100644 --- a/src/main/java/com/glxp/udi/admin/service/basic/BussinessTypeService.java +++ b/src/main/java/com/glxp/udi/admin/service/basic/BussinessTypeService.java @@ -220,4 +220,17 @@ public class BussinessTypeService { } return unitType; } + + /** + * 查询单据类型名称 + * + * @param action + * @return + */ + public String findNameByAction(String action) { + if (StrUtil.isBlank(action)) { + return null; + } + return bussinessTypeDao.selectNameByAction(action); + } } diff --git a/src/main/java/com/glxp/udi/admin/service/inout/WarehouseTempService.java b/src/main/java/com/glxp/udi/admin/service/inout/WarehouseTempService.java index c775964..c569214 100644 --- a/src/main/java/com/glxp/udi/admin/service/inout/WarehouseTempService.java +++ b/src/main/java/com/glxp/udi/admin/service/inout/WarehouseTempService.java @@ -10,11 +10,13 @@ import com.glxp.udi.admin.entity.inout.WarehousetempEntity; import com.glxp.udi.admin.req.inout.DeleteRequest; import com.glxp.udi.admin.req.inout.WarehouseQueryRequest; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.List; @Service +@Transactional public class WarehouseTempService { @Resource @@ -29,13 +31,14 @@ public class WarehouseTempService { /** * 构造查询条件 + * * @param warehouseQueryRequest * @return */ private QueryWrapper buildCodesTempQueryWrapper(WarehouseQueryRequest warehouseQueryRequest) { QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StrUtil.isNotBlank(warehouseQueryRequest.getCode()), "code", warehouseQueryRequest.getCode()) - .eq(StrUtil.isNotBlank(warehouseQueryRequest.getOrderId()),"orderId",warehouseQueryRequest.getOrderId()) + .eq(StrUtil.isNotBlank(warehouseQueryRequest.getOrderId()), "orderId", warehouseQueryRequest.getOrderId()) .eq(StrUtil.isNotBlank(warehouseQueryRequest.getCorpOrderId()), "corpOrderId", warehouseQueryRequest.getCorpOrderId()) .eq(null != warehouseQueryRequest.getCustomerId(), "customerId", warehouseQueryRequest.getCustomerId()); return wrapper; @@ -71,4 +74,12 @@ public class WarehouseTempService { codesTempDao.updateCount(warehousetemp.getId(), warehousetemp.getCount()); } + /** + * 批量删除临时码表的码 + * + * @param ids + */ + public void deleteCodes(List ids) { + codesTempDao.deleteBatchIds(ids); + } } diff --git a/src/main/java/com/glxp/udi/admin/util/inout/InoutUtils.java b/src/main/java/com/glxp/udi/admin/util/inout/InoutUtils.java index 3ddb270..22c1036 100644 --- a/src/main/java/com/glxp/udi/admin/util/inout/InoutUtils.java +++ b/src/main/java/com/glxp/udi/admin/util/inout/InoutUtils.java @@ -2,6 +2,7 @@ package com.glxp.udi.admin.util.inout; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; import com.glxp.udi.admin.constant.Constant; import com.glxp.udi.admin.constant.TypeConstant; import com.glxp.udi.admin.entity.info.SetupEntity; @@ -208,6 +209,14 @@ public class InoutUtils { return null; } + /** + * 生成单据详情 + * + * @param udiInfoService + * @param udiRelevanceService + * @param orderDetailService + * @param warehouseEntityList + */ public void generateConstrastDetail(UdiInfoService udiInfoService, UdiRelevanceService udiRelevanceService, OrderDetailService orderDetailService, List warehouseEntityList) { @@ -254,7 +263,7 @@ public class InoutUtils { orderDetailEntity.setGgxh(erpDetailCodeEntity.getGgxh()); erpOrderEntities.add(orderDetailEntity); } - if (!erpOrderEntities.isEmpty()) { + if (CollUtil.isNotEmpty(erpOrderEntities)) { orderDetailService.insertOrderDetail(erpOrderEntities); } } diff --git a/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml b/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml index 4f5aa1a..1f09e1b 100644 --- a/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml +++ b/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml @@ -26,4 +26,5 @@ from io_codes_temp where orderId = #{orderId} + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/param/SystemPDFTemplateDao.xml b/src/main/resources/mybatis/mapper/param/SystemPDFTemplateDao.xml index 8848354..a6dc6e7 100644 --- a/src/main/resources/mybatis/mapper/param/SystemPDFTemplateDao.xml +++ b/src/main/resources/mybatis/mapper/param/SystemPDFTemplateDao.xml @@ -39,7 +39,10 @@ jrxmlPath=#{jrxmlPath}, - customerId = #{customerId} + customerId = #{customerId}, + + + action = #{action} WHERE id = #{id}