From 5c5f667cf5b1ee129df481ed556c4d0b2b9e9fda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Wed, 23 Aug 2023 10:54:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=BB=A3=E7=A0=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/UdiRelevanceController.java | 16 ++ .../inv/DeviceReceiveOrderController.java | 119 ++++++++++++++- .../com/glxp/api/dao/basic/UdiProductDao.java | 2 + .../inv/DeviceReceiveOrderDetailEntity.java | 9 ++ .../api/req/inv/FilterDeptDeviceRequest.java | 2 + .../inv/FilterDeviceReceiveOrderRequest.java | 2 + .../api/res/inv/DeptDeviceDetailResponse.java | 2 + .../api/service/basic/UdiProductService.java | 2 + .../basic/impl/UdiProductServiceImpl.java | 5 + .../inv/DeviceReceiveOrderService.java | 2 + .../DeviceReceiveOrderDetailServiceImpl.java | 143 +++++++++++------- .../impl/DeviceReceiveOrderServiceImpl.java | 27 +++- .../mybatis/mapper/basic/UdiProductDao.xml | 99 +++++++++--- .../mapper/inv/DeptDeviceDetailDao.xml | 3 + 14 files changed, 355 insertions(+), 78 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java b/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java index f76df538..18bdda20 100644 --- a/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java +++ b/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java @@ -245,6 +245,22 @@ public class UdiRelevanceController extends BaseController { } + + @AuthRuleAnnotation("") + @PostMapping("/udiwms/udiinfo/selectProduct") + public BaseResponse selectProduct(@RequestBody FilterUdiRelRequest filterUdiRelRequest) { + List udiRelevanceResponses = null; + udiRelevanceResponses = udiRelevanceService.filterUdiRelevance(filterUdiRelRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(udiRelevanceResponses); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(udiRelevanceResponses); + return ResultVOUtils.success(pageSimpleResponse); + } + + + //多选删除 @AuthRuleAnnotation("") @PostMapping("/udi/udirel/deleteAll") diff --git a/src/main/java/com/glxp/api/controller/inv/DeviceReceiveOrderController.java b/src/main/java/com/glxp/api/controller/inv/DeviceReceiveOrderController.java index 0a20348d..980da387 100644 --- a/src/main/java/com/glxp/api/controller/inv/DeviceReceiveOrderController.java +++ b/src/main/java/com/glxp/api/controller/inv/DeviceReceiveOrderController.java @@ -1,14 +1,35 @@ package com.glxp.api.controller.inv; +import com.alibaba.fastjson.JSON; import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.constant.FileConstant; +import com.glxp.api.dao.schedule.SystemParamConfigDao; +import com.glxp.api.entity.inv.DeviceReceiveOrderDetailEntity; import com.glxp.api.entity.inv.DeviceReceiveOrderEntity; +import com.glxp.api.entity.purchase.SupCertEntity; +import com.glxp.api.entity.system.SysPdfTemplateRelevanceLabelEntity; +import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; +import com.glxp.api.entity.system.SystemPDFTemplateEntity; +import com.glxp.api.req.inout.InspectionPDFTemplateRequest; +import com.glxp.api.req.inv.FilterDeptDeviceRequest; +import com.glxp.api.req.inv.FilterDeviceReceiveOrderDetailRequest; import com.glxp.api.req.inv.FilterDeviceReceiveOrderRequest; +import com.glxp.api.res.inv.DeptDeviceDetailResponse; +import com.glxp.api.res.inv.DeviceReceiveOrderDetailResponse; import com.glxp.api.res.inv.DeviceReceiveOrderResponse; +import com.glxp.api.service.inv.DeptDeviceDetailService; +import com.glxp.api.service.inv.DeviceReceiveOrderDetailService; import com.glxp.api.service.inv.DeviceReceiveOrderService; +import com.glxp.api.service.system.SystemPDFModuleService; +import com.glxp.api.service.system.SystemPDFTemplateService; +import com.glxp.api.service.system.SystemParamConfigService; +import com.glxp.api.util.JasperUtils; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -16,7 +37,10 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; -import java.util.List; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.text.SimpleDateFormat; +import java.util.*; /** * 设备领用记录接口 @@ -28,6 +52,19 @@ public class DeviceReceiveOrderController { @Resource private DeviceReceiveOrderService deviceReceiveOrderService; + @Resource + private SystemParamConfigService systemParamConfigService; + @Resource + private SystemPDFModuleService systemPDFModuleService; + @Resource + private SystemPDFTemplateService systemPDFTemplateService; + @Resource + private DeviceReceiveOrderDetailService deviceReceiveOrderDetailService; + @Resource + private DeptDeviceDetailService deptDeviceDetailService; + @Value("${file_path}") + private String filePath; + /** * 设备领用记录列表查询接口 * @@ -111,6 +148,7 @@ public class DeviceReceiveOrderController { return deviceReceiveOrderService.updateStatus(filterDeviceReceiveOrderRequest.getId(), filterDeviceReceiveOrderRequest.getStatus()); } + /** * 删除设备领用记录 * @@ -130,4 +168,83 @@ public class DeviceReceiveOrderController { } + @GetMapping("/device/receive/order/getConfig") + public BaseResponse getConfig() { + return ResultVOUtils.success(systemParamConfigService.selectByParamKey("device_product")); + } + + /** + * 校验模板文件 + * + * @param inspectionPDFTemplateRequest + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/device/receive/order/verifyTemplateFile") + public BaseResponse verifyTemplateFile(@RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) { + if (null == inspectionPDFTemplateRequest) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!"); + } + //查询模板文件是否存在 + + SysPdfTemplateRelevanceLabelEntity sysPdfTemplateRelevanceLabelEntity = systemPDFModuleService.selectByLabelId(inspectionPDFTemplateRequest.getId()); + if (null == sysPdfTemplateRelevanceLabelEntity) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误"); + } + + SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceLabelEntity.getTemplateId())); + if (null == systemPDFTemplateEntity) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误"); + } + return ResultVOUtils.success(sysPdfTemplateRelevanceLabelEntity.getTemplateId()); + } + + /** + * 打印模板单号标签 + * + * @param + * @param request + * @param response + * @throws Exception + */ + @AuthRuleAnnotation("") + @PostMapping("/device/receive/order/printOrder") + public void printOrder(@RequestBody FilterDeviceReceiveOrderRequest filterDeviceReceiveOrderRequest, HttpServletRequest request, HttpServletResponse response) throws Exception { + SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(filterDeviceReceiveOrderRequest.getTemplateId()); + //打印单号标签 + Map data = new HashMap<>(1); + List list = new ArrayList<>(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式 + FilterDeptDeviceRequest filterDeptDeviceRequest=new FilterDeptDeviceRequest(); + filterDeptDeviceRequest.setId(filterDeviceReceiveOrderRequest.getId()); + List deptDeviceDetailResponseList = deptDeviceDetailService.filterList(filterDeptDeviceRequest); + int i = 1; + if (deptDeviceDetailResponseList != null && deptDeviceDetailResponseList.size() > 0) { + for (DeptDeviceDetailResponse obj : deptDeviceDetailResponseList) { + Map supData = new HashMap<>(); + supData.put("orderIdFk", obj.getOrderIdFk() == null ? ' ' : obj.getOrderIdFk()); + supData.put("batchNo", obj.getBatchNo() == null ? ' ' : obj.getBatchNo()); + supData.put("productionDate", obj.getProductionDate() == null ? ' ' : obj.getProductionDate()); + supData.put("expireDate", obj.getExpireDate() == null ? ' ' : obj.getExpireDate()); + supData.put("serialNo", obj.getSerialNo() == null ? ' ' : obj.getSerialNo()); + supData.put("createTime", obj.getCreateTime() == null ? ' ' : obj.getCreateTime()); + supData.put("invName", obj.getInvName() == null ? ' ' : obj.getInvName()); + supData.put("zczbhhzbapzbh", obj.getZczbhhzbapzbh() == null ? ' ' : obj.getZczbhhzbapzbh()); + supData.put("ggxh", obj.getGgxh() == null ? ' ' : obj.getGgxh()); + supData.put("supName", obj.getSupName() == null ? ' ' : obj.getSupName()); + supData.put("measname", obj.getMeasname() == null ? ' ' : obj.getMeasname()); + supData.put("deviceName", obj.getDeviceName() == null ? ' ' : obj.getDeviceName()); + supData.put("manufactory", obj.getManufactory() == null ? ' ' : obj.getManufactory()); + supData.put("measname", obj.getMeasname() == null ? ' ' : obj.getMeasname()); + supData.put("supName", obj.getSupName() == null ? ' ' : obj.getSupName()); + list.add(supData); + i++; + } + } + + String param = JSON.toJSONString(list); + JasperUtils.jasperReport(request, response, param, filePath + "pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); + } + + } diff --git a/src/main/java/com/glxp/api/dao/basic/UdiProductDao.java b/src/main/java/com/glxp/api/dao/basic/UdiProductDao.java index 08c62e1c..9f0a8ee8 100644 --- a/src/main/java/com/glxp/api/dao/basic/UdiProductDao.java +++ b/src/main/java/com/glxp/api/dao/basic/UdiProductDao.java @@ -53,6 +53,8 @@ public interface UdiProductDao { List filterUdiInfo2(FilterUdiRelRequest filterUdiRelRequest); + UdiRelevanceResponse filterUdiInfoById(String id); + /** * 导入医疗器械信息 diff --git a/src/main/java/com/glxp/api/entity/inv/DeviceReceiveOrderDetailEntity.java b/src/main/java/com/glxp/api/entity/inv/DeviceReceiveOrderDetailEntity.java index 622ce3e7..3ff36052 100644 --- a/src/main/java/com/glxp/api/entity/inv/DeviceReceiveOrderDetailEntity.java +++ b/src/main/java/com/glxp/api/entity/inv/DeviceReceiveOrderDetailEntity.java @@ -93,45 +93,54 @@ public class DeviceReceiveOrderDetailEntity { /** * 产品名称 */ + @TableField(exist = false) private String productName; /** * 仓库名称 */ + @TableField(exist = false) private String invName; /** * 货位名称 */ + @TableField(exist = false) private String invSpaceName; /** * 货位名称 */ + @TableField(exist = false) private String invSpaceCode; /** * 注册/备案凭证号 */ + @TableField(exist = false) private String zczbhhzbapzbh; /** * 生产厂家 */ + @TableField(exist = false) private String ylqxzcrbarmc; /** * 规格型号 */ + @TableField(exist = false) private String ggxh; /** * 是否可以自定义序列号 */ + @TableField(exist = false) private Boolean editSerialNo; /** * 部门名称 */ + @TableField(exist = false) private String deptName; } diff --git a/src/main/java/com/glxp/api/req/inv/FilterDeptDeviceRequest.java b/src/main/java/com/glxp/api/req/inv/FilterDeptDeviceRequest.java index d0d885e2..870e214b 100644 --- a/src/main/java/com/glxp/api/req/inv/FilterDeptDeviceRequest.java +++ b/src/main/java/com/glxp/api/req/inv/FilterDeptDeviceRequest.java @@ -54,4 +54,6 @@ public class FilterDeptDeviceRequest extends ListPageRequest { */ private Integer addType; + private Integer id; + } diff --git a/src/main/java/com/glxp/api/req/inv/FilterDeviceReceiveOrderRequest.java b/src/main/java/com/glxp/api/req/inv/FilterDeviceReceiveOrderRequest.java index f52fcd68..faddd29f 100644 --- a/src/main/java/com/glxp/api/req/inv/FilterDeviceReceiveOrderRequest.java +++ b/src/main/java/com/glxp/api/req/inv/FilterDeviceReceiveOrderRequest.java @@ -40,4 +40,6 @@ public class FilterDeviceReceiveOrderRequest extends ListPageRequest { */ private String fromInvSpaceCode; + private String templateId; + } diff --git a/src/main/java/com/glxp/api/res/inv/DeptDeviceDetailResponse.java b/src/main/java/com/glxp/api/res/inv/DeptDeviceDetailResponse.java index 0bf9c131..f9a1e354 100644 --- a/src/main/java/com/glxp/api/res/inv/DeptDeviceDetailResponse.java +++ b/src/main/java/com/glxp/api/res/inv/DeptDeviceDetailResponse.java @@ -151,4 +151,6 @@ public class DeptDeviceDetailResponse { * 仓库名称 */ private String invName; + + private String orderIdFk; } diff --git a/src/main/java/com/glxp/api/service/basic/UdiProductService.java b/src/main/java/com/glxp/api/service/basic/UdiProductService.java index e3095aa1..ff8844c5 100644 --- a/src/main/java/com/glxp/api/service/basic/UdiProductService.java +++ b/src/main/java/com/glxp/api/service/basic/UdiProductService.java @@ -19,6 +19,8 @@ public interface UdiProductService { List filterUdiInfo2(FilterUdiRelRequest filterUdiRelRequest); + UdiRelevanceResponse filterUdiInfoById(String id); + List filterAllUdiInfo(FilterUdiRelRequest filterUdiRelRequest); UdiProductEntity findByNameCode(String nameCode); diff --git a/src/main/java/com/glxp/api/service/basic/impl/UdiProductServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/UdiProductServiceImpl.java index 9591bb45..fd230fbe 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/UdiProductServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/UdiProductServiceImpl.java @@ -72,6 +72,11 @@ public class UdiProductServiceImpl implements UdiProductService { return data; } + @Override + public UdiRelevanceResponse filterUdiInfoById(String id) { + return udiProductDao.filterUdiInfoById(id); + } + @Override public List filterAllUdiInfo(FilterUdiRelRequest filterUdiRelRequest) { if (filterUdiRelRequest == null) { diff --git a/src/main/java/com/glxp/api/service/inv/DeviceReceiveOrderService.java b/src/main/java/com/glxp/api/service/inv/DeviceReceiveOrderService.java index 650c88db..0ace713b 100644 --- a/src/main/java/com/glxp/api/service/inv/DeviceReceiveOrderService.java +++ b/src/main/java/com/glxp/api/service/inv/DeviceReceiveOrderService.java @@ -18,6 +18,8 @@ public interface DeviceReceiveOrderService { */ List filterList(FilterDeviceReceiveOrderRequest deviceReceiveOrderRequest); + DeviceReceiveOrderEntity selectDeviceOrder(String orderId); + /** * 新增设备领用记录 * diff --git a/src/main/java/com/glxp/api/service/inv/impl/DeviceReceiveOrderDetailServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/DeviceReceiveOrderDetailServiceImpl.java index acc0ef10..bbaecd0e 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/DeviceReceiveOrderDetailServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/DeviceReceiveOrderDetailServiceImpl.java @@ -11,14 +11,19 @@ import com.glxp.api.dao.inv.DeviceReceiveOrderDetailDao; import com.glxp.api.dao.inv.InvProductDao; import com.glxp.api.dao.inv.InvProductDetailDao; import com.glxp.api.entity.basic.UdiEntity; +import com.glxp.api.entity.basic.UdiProductEntity; import com.glxp.api.entity.inv.DeviceReceiveOrderDetailEntity; import com.glxp.api.entity.inv.InvProductDetailEntity; import com.glxp.api.entity.inv.InvProductEntity; +import com.glxp.api.entity.system.SystemParamConfigEntity; import com.glxp.api.req.inv.AddDeviceReceiveOrderDetailRequest; import com.glxp.api.req.inv.FilterDeviceReceiveOrderDetailRequest; import com.glxp.api.req.inv.FilterInvProductDetailRequest; +import com.glxp.api.res.basic.UdiRelevanceResponse; import com.glxp.api.res.inv.DeviceReceiveOrderDetailResponse; +import com.glxp.api.service.basic.UdiProductService; import com.glxp.api.service.inv.DeviceReceiveOrderDetailService; +import com.glxp.api.service.system.SystemParamConfigService; import com.glxp.api.util.udi.FilterUdiUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -39,6 +44,10 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe private InvProductDetailDao invProductDetailDao; @Resource private InvProductDao invProductDao; + @Resource + private SystemParamConfigService systemParamConfigService; + @Resource + private UdiProductService udiProductService; @Override public List filterList(FilterDeviceReceiveOrderDetailRequest detailRequest) { @@ -96,64 +105,81 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe DeviceReceiveOrderDetailEntity orderDetail = getDeviceReceiveOrderDetailEntity(addDetailRequest.getOrderIdFk(), addDetailRequest.getCode(), invProductDetailEntity); deviceReceiveOrderDetailDao.insert(orderDetail); } else { - //通过选库存添加 - //查询选中的库存信息 - for (String invProductId : addDetailRequest.getInvProductIds()) { - InvProductEntity invProductEntity = invProductDao.selectById(invProductId); - //查询库存详情 - FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest(); - filterInvProductDetailRequest.setRelId(String.valueOf(invProductEntity.getRelIdFk())); - filterInvProductDetailRequest.setBatchNo(invProductEntity.getBatchNo()); - filterInvProductDetailRequest.setDeptCode(invProductEntity.getDeptCode()); - filterInvProductDetailRequest.setInvCode(invProductEntity.getInvCode()); - filterInvProductDetailRequest.setInvSpaceCode(addDetailRequest.getInvSpaceCode()); - filterInvProductDetailRequest.setSupId(addDetailRequest.getSupId()); - List invProductDetailEntities = invProductDetailDao.filterInvProductDetailList(filterInvProductDetailRequest); - //计算出在仓库中的设备 - //提取库存详情中不同的码 - List codesList = invProductDetailEntities.stream().map(InvProductDetailEntity::getCode).distinct().collect(Collectors.toList()); - //初始化所有码数量集合 - Map codeMap = new HashMap<>(codesList.size()); - codesList.forEach(code -> codeMap.put(code, 0)); - //计算库存详情中的码明细,得出所有存在于库存中的码 - for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) { - Integer count = codeMap.get(invProductDetailEntity.getCode()); - if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { - //入库,数量 +1 - count = count + 1; - } else { - //出库, 数量 -1 - count = count - 1; + SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("device_product"); + if(systemParamConfigEntity.getParamValue().equals("0")){ + //通过选库存添加 + //查询选中的库存信息 + for (String invProductId : addDetailRequest.getInvProductIds()) { + InvProductEntity invProductEntity = invProductDao.selectById(invProductId); + //查询库存详情 + FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest(); + filterInvProductDetailRequest.setRelId(String.valueOf(invProductEntity.getRelIdFk())); + filterInvProductDetailRequest.setBatchNo(invProductEntity.getBatchNo()); + filterInvProductDetailRequest.setDeptCode(invProductEntity.getDeptCode()); + filterInvProductDetailRequest.setInvCode(invProductEntity.getInvCode()); + filterInvProductDetailRequest.setInvSpaceCode(addDetailRequest.getInvSpaceCode()); + filterInvProductDetailRequest.setSupId(addDetailRequest.getSupId()); + List invProductDetailEntities = invProductDetailDao.filterInvProductDetailList(filterInvProductDetailRequest); + //计算出在仓库中的设备 + //提取库存详情中不同的码 + List codesList = invProductDetailEntities.stream().map(InvProductDetailEntity::getCode).distinct().collect(Collectors.toList()); + //初始化所有码数量集合 + Map codeMap = new HashMap<>(codesList.size()); + codesList.forEach(code -> codeMap.put(code, 0)); + //计算库存详情中的码明细,得出所有存在于库存中的码 + for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) { + Integer count = codeMap.get(invProductDetailEntity.getCode()); + if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { + //入库,数量 +1 + count = count + 1; + } else { + //出库, 数量 -1 + count = count - 1; + } + codeMap.put(invProductDetailEntity.getCode(), count); } - codeMap.put(invProductDetailEntity.getCode(), count); - } - //根据计算得出的,所有存在于库存中的码明细,生成设备领用记录详情 - for (String code : codeMap.keySet()) { - if (codeMap.get(code) > 0) { - //查找此条码对应的库存详情数据,根据此库存详情数据,查找仓库货位等信息 - InvProductDetailEntity invProductDetailEntity = new InvProductDetailEntity(); - for (InvProductDetailEntity detailEntity : invProductDetailEntities) { - if (detailEntity.getCode().equals(code)) { - invProductDetailEntity = detailEntity; - break; + //根据计算得出的,所有存在于库存中的码明细,生成设备领用记录详情 + for (String code : codeMap.keySet()) { + if (codeMap.get(code) > 0) { + //查找此条码对应的库存详情数据,根据此库存详情数据,查找仓库货位等信息 + InvProductDetailEntity invProductDetailEntity = new InvProductDetailEntity(); + for (InvProductDetailEntity detailEntity : invProductDetailEntities) { + if (detailEntity.getCode().equals(code)) { + invProductDetailEntity = detailEntity; + break; + } } - } - //此条码存在于库存中,解析条码生成设备领用记录详情 - Integer count = codeMap.get(code); - if (count > 1) { - for (int i = 0; i < count; i++) { + //此条码存在于库存中,解析条码生成设备领用记录详情 + Integer count = codeMap.get(code); + if (count > 1) { + for (int i = 0; i < count; i++) { + DeviceReceiveOrderDetailEntity orderDetail = getDeviceReceiveOrderDetailEntity(addDetailRequest.getOrderIdFk(), code, invProductDetailEntity); + //插入设备领用记录详情 + deviceReceiveOrderDetailDao.insert(orderDetail); + } + } else { DeviceReceiveOrderDetailEntity orderDetail = getDeviceReceiveOrderDetailEntity(addDetailRequest.getOrderIdFk(), code, invProductDetailEntity); - //插入设备领用记录详情 deviceReceiveOrderDetailDao.insert(orderDetail); } - } else { - DeviceReceiveOrderDetailEntity orderDetail = getDeviceReceiveOrderDetailEntity(addDetailRequest.getOrderIdFk(), code, invProductDetailEntity); - deviceReceiveOrderDetailDao.insert(orderDetail); } } } + }else{ + for (String invProductId : addDetailRequest.getInvProductIds()) { + DeviceReceiveOrderDetailEntity deviceReceiveOrderDetailEntity = new DeviceReceiveOrderDetailEntity(); + + UdiRelevanceResponse udiRelevanceResponse = udiProductService.filterUdiInfoById(invProductId); + //查询库存详情 + deviceReceiveOrderDetailEntity.setRelId(udiRelevanceResponse.getRelId()); + deviceReceiveOrderDetailEntity.setOrderIdFk(addDetailRequest.getOrderIdFk()); + deviceReceiveOrderDetailEntity.setSupId(udiRelevanceResponse.getUnitFk()); + deviceReceiveOrderDetailEntity.setCreateTime(new Date()); + deviceReceiveOrderDetailEntity.setUpdateTime(new Date()); + deviceReceiveOrderDetailDao.insert(deviceReceiveOrderDetailEntity); + } + } } return ResultVOUtils.success("添加成功!"); @@ -192,18 +218,25 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe if (null == detailEntity || null == detailEntity.getId()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); } - //判断新的条码是否重复 - FilterDeviceReceiveOrderDetailRequest detailRequest = new FilterDeviceReceiveOrderDetailRequest(); - detailRequest.setOrderIdFk(detailEntity.getOrderIdFk()); - detailRequest.setCode(detailRequest.getCode()); - List list = deviceReceiveOrderDetailDao.filterList(detailRequest); - if (CollUtil.isNotEmpty(list)) { - return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "条码重复!"); + + SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("device_product"); + if(systemParamConfigEntity.getParamValue().equals("0")){ + //判断新的条码是否重复 + FilterDeviceReceiveOrderDetailRequest detailRequest = new FilterDeviceReceiveOrderDetailRequest(); + detailRequest.setOrderIdFk(detailEntity.getOrderIdFk()); + detailRequest.setCode(detailRequest.getCode()); + List list = deviceReceiveOrderDetailDao.filterList(detailRequest); + if (CollUtil.isNotEmpty(list)) { + return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "条码重复!"); + } + }else{ + } deviceReceiveOrderDetailDao.updateById(detailEntity); return ResultVOUtils.success("更新成功!"); } + @Override public BaseResponse deleteOrderDetail(FilterDeviceReceiveOrderDetailRequest detailRequest) { if (null == detailRequest.getId() && StrUtil.isBlank(detailRequest.getOrderIdFk())) { diff --git a/src/main/java/com/glxp/api/service/inv/impl/DeviceReceiveOrderServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/DeviceReceiveOrderServiceImpl.java index 2e61864e..61c46d6a 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/DeviceReceiveOrderServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/DeviceReceiveOrderServiceImpl.java @@ -3,30 +3,46 @@ package com.glxp.api.service.inv.impl; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.thread.ThreadUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.pagehelper.PageHelper; +import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.Constant; +import com.glxp.api.constant.FileConstant; import com.glxp.api.dao.inv.DeviceReceiveOrderDao; import com.glxp.api.dao.inv.DeviceReceiveOrderDetailDao; import com.glxp.api.entity.inv.DeviceReceiveOrderDetailEntity; import com.glxp.api.entity.inv.DeviceReceiveOrderEntity; +import com.glxp.api.entity.purchase.SupCertEntity; +import com.glxp.api.entity.purchase.SupCompanyEntity; +import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; +import com.glxp.api.entity.system.SystemPDFTemplateEntity; +import com.glxp.api.req.inout.InspectionPDFTemplateRequest; import com.glxp.api.req.inv.FilterDeviceReceiveOrderRequest; +import com.glxp.api.req.purchase.purPlanPrintRequest; import com.glxp.api.res.inv.DeviceReceiveOrderResponse; import com.glxp.api.service.auth.CustomerService; import com.glxp.api.service.inv.DeptDeviceDetailService; import com.glxp.api.service.inv.DeviceReceiveOrderService; +import com.glxp.api.service.system.SystemPDFModuleService; +import com.glxp.api.service.system.SystemPDFTemplateService; import com.glxp.api.util.GennerOrderUtils; +import com.glxp.api.util.JasperUtils; import com.glxp.api.util.OrderNoTypeBean; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import javax.annotation.Resource; -import java.util.Collections; -import java.util.Date; -import java.util.List; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.text.SimpleDateFormat; +import java.util.*; @Slf4j @Service @@ -55,6 +71,11 @@ public class DeviceReceiveOrderServiceImpl implements DeviceReceiveOrderService return deviceReceiveOrderDao.filterList(deviceReceiveOrderRequest); } + @Override + public DeviceReceiveOrderEntity selectDeviceOrder(String orderId) { + return deviceReceiveOrderDao.selectOne(new QueryWrapper().eq("orderId",orderId)); + } + @Override public BaseResponse addDeviceReceiveOrder(DeviceReceiveOrderEntity deviceReceiveOrderEntity) { if (null == deviceReceiveOrderEntity) { diff --git a/src/main/resources/mybatis/mapper/basic/UdiProductDao.xml b/src/main/resources/mybatis/mapper/basic/UdiProductDao.xml index e1ce86b4..73aab972 100644 --- a/src/main/resources/mybatis/mapper/basic/UdiProductDao.xml +++ b/src/main/resources/mybatis/mapper/basic/UdiProductDao.xml @@ -32,21 +32,12 @@ resultType="com.glxp.api.res.basic.UdiRelevanceResponse"> SELECT basic_products.id, basic_udirel.thirdId, - basic_udirel.thirdName, basic_udirel.isUseDy, basic_udirel.thirdId1, basic_udirel.thirdId2, basic_udirel.thirdId3, basic_udirel.thirdId4, - basic_udirel.ybbm, - basic_udirel.sptm, basic_udirel.isDisable, - basic_udirel.thirdName1, - basic_udirel.thirdName2, - basic_udirel.thirdName3, - basic_udirel.thirdName4, - basic_udirel.manufactory, - basic_udirel.measname, basic_udirel.udplatCode, basic_products.nameCode, basic_products.packRatio, @@ -57,7 +48,6 @@ basic_products.zxxsbzbhsydysl, basic_products.bhxjcpbm, basic_products.bzcj, - basic_products.addType, basic_products.deviceRecordKey, basic_products.cpmctymc, basic_products.cplb, @@ -93,7 +83,8 @@ basic_products.mjfs, basic_products.categoryName, basic_products.cplx, - basic_products.hchzsb + basic_products.hchzsb, + company_product_relevance.customerId as unitFk FROM (company_product_relevance inner JOIN basic_udirel ON company_product_relevance.udiRlIdFk = basic_udirel.id) @@ -188,7 +179,7 @@ allowNoBatch, allowNoExpire, allowNoProduct, allowNoSerial, spmc, cplx, hchzsb, cpdls, price, basicPrductRemak1, basicPrductRemak2, basicPrductRemak3, basicPrductRemak4, basicPrductRemak5, basicPrductRemak6, basicPrductRemak7, - basicPrductRemak8,updateTime + basicPrductRemak8, updateTime , sfwblztlcp, cgzmraqxgxx, sfbjwycxsy, zdcfsycs, sfwwjbz, syqsfxyjxmj, mjfs, categoryName, pinyinInitial) values (#{id}, #{uuid}, @@ -922,7 +913,7 @@ @@ -1097,14 +1088,84 @@ + + + diff --git a/src/main/resources/mybatis/mapper/inv/DeptDeviceDetailDao.xml b/src/main/resources/mybatis/mapper/inv/DeptDeviceDetailDao.xml index bee2eef5..12ad5925 100644 --- a/src/main/resources/mybatis/mapper/inv/DeptDeviceDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/DeptDeviceDetailDao.xml @@ -37,6 +37,9 @@ AND t.deptCode = #{deptCode} + + AND t.id = #{id} + AND t.invCode = #{invCode}