diff --git a/src/main/java/com/glxp/api/controller/inv/InvProductController.java b/src/main/java/com/glxp/api/controller/inv/InvProductController.java index a1852a61..500f4d80 100644 --- a/src/main/java/com/glxp/api/controller/inv/InvProductController.java +++ b/src/main/java/com/glxp/api/controller/inv/InvProductController.java @@ -272,7 +272,7 @@ public class InvProductController extends BaseController { */ @GetMapping("/spms/inv/product/getInvMAProducts") public BaseResponse getInvMAProducts(FilterInvProductRequest filterInvProductRequest) { - if (null == filterInvProductRequest || StrUtil.isBlank(filterInvProductRequest.getInvCode())) { + if (null == filterInvProductRequest) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); } List list = invProductService.getInvMAProducts(filterInvProductRequest); diff --git a/src/main/java/com/glxp/api/entity/inv/DeviceReceiveOrderEntity.java b/src/main/java/com/glxp/api/entity/inv/DeviceReceiveOrderEntity.java index 68e402ee..e210121a 100644 --- a/src/main/java/com/glxp/api/entity/inv/DeviceReceiveOrderEntity.java +++ b/src/main/java/com/glxp/api/entity/inv/DeviceReceiveOrderEntity.java @@ -108,4 +108,7 @@ public class DeviceReceiveOrderEntity { @TableField(value = "remark") private String remark; + @TableField(value = "type") + private String type; + } diff --git a/src/main/java/com/glxp/api/req/inv/AddDeviceReceiveOrderDetailRequest.java b/src/main/java/com/glxp/api/req/inv/AddDeviceReceiveOrderDetailRequest.java index 9ce96601..f6f816f6 100644 --- a/src/main/java/com/glxp/api/req/inv/AddDeviceReceiveOrderDetailRequest.java +++ b/src/main/java/com/glxp/api/req/inv/AddDeviceReceiveOrderDetailRequest.java @@ -45,4 +45,6 @@ public class AddDeviceReceiveOrderDetailRequest { */ private String supId; + private Integer type; + } diff --git a/src/main/java/com/glxp/api/service/inv/impl/DeptDeviceDetailServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/DeptDeviceDetailServiceImpl.java index f249373c..4544f8c3 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/DeptDeviceDetailServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/DeptDeviceDetailServiceImpl.java @@ -88,6 +88,11 @@ public class DeptDeviceDetailServiceImpl implements DeptDeviceDetailService { // deviceDetail.setCreateTime(date); // deviceDetail.setUpdateTime(date); deptDeviceDetailDao.insert(deviceDetail); + }else{ + DeptDeviceDetailEntity deptDeviceDetailEntity = deptDeviceDetailDao.selectOne(new QueryWrapper().eq("deptCode", receiveOrderEntity.getFromDeptCode())); + deptDeviceDetailEntity.setDeptCode(receiveOrderEntity.getFromDeptCode()); + deptDeviceDetailEntity.setCreateUser(receiveOrderEntity.getAuditUser()); + deptDeviceDetailDao.updateById(deptDeviceDetailEntity); } } return ResultVOUtils.success("添加成功"); 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 32606882..288de482 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 @@ -7,11 +7,13 @@ 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.ConstantType; +import com.glxp.api.dao.inv.DeptDeviceDetailDao; 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.DeptDeviceDetailEntity; import com.glxp.api.entity.inv.DeviceReceiveOrderDetailEntity; import com.glxp.api.entity.inv.InvProductDetailEntity; import com.glxp.api.entity.inv.InvProductEntity; @@ -22,6 +24,7 @@ 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.DeptDeviceDetailService; import com.glxp.api.service.inv.DeviceReceiveOrderDetailService; import com.glxp.api.service.system.SystemParamConfigService; import com.glxp.api.util.udi.FilterUdiUtils; @@ -48,6 +51,8 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe private SystemParamConfigService systemParamConfigService; @Resource private UdiProductService udiProductService; + @Resource + private DeptDeviceDetailDao deptDeviceDetailDao; @Override public List filterList(FilterDeviceReceiveOrderDetailRequest detailRequest) { @@ -106,7 +111,7 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe deviceReceiveOrderDetailDao.insert(orderDetail); } else { SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("device_product"); - if(systemParamConfigEntity.getParamValue().equals("0")){ + if(systemParamConfigEntity.getParamValue().equals("0") || addDetailRequest.getType() == 1){ //通过选库存添加 //查询选中的库存信息 for (String invProductId : addDetailRequest.getInvProductIds()) { @@ -116,7 +121,7 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe //插入设备领用记录详情 deviceReceiveOrderDetailDao.insert(orderDetail); } - }else{ + }else if(systemParamConfigEntity.getParamValue().equals("1") || addDetailRequest.getType() == 3 ){ for (String invProductId : addDetailRequest.getInvProductIds()) { DeviceReceiveOrderDetailEntity deviceReceiveOrderDetailEntity = new DeviceReceiveOrderDetailEntity(); @@ -131,6 +136,27 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe deviceReceiveOrderDetailDao.insert(deviceReceiveOrderDetailEntity); } + }else if(addDetailRequest.getType() == 2){ + for (String invProductId : addDetailRequest.getInvProductIds()) { + DeviceReceiveOrderDetailEntity deviceReceiveOrderDetailEntity = new DeviceReceiveOrderDetailEntity(); + + DeptDeviceDetailEntity deptDeviceDetailEntity= deptDeviceDetailDao.selectById(invProductId); + //查询库存详情 + deviceReceiveOrderDetailEntity.setNameCode(deptDeviceDetailEntity.getNameCode()); + deviceReceiveOrderDetailEntity.setRelId(Long.valueOf(deptDeviceDetailEntity.getRelId())); + deviceReceiveOrderDetailEntity.setOriginCode(deptDeviceDetailEntity.getOriginCode()); + deviceReceiveOrderDetailEntity.setCode(deptDeviceDetailEntity.getCode()); + deviceReceiveOrderDetailEntity.setOrderIdFk(addDetailRequest.getOrderIdFk()); + deviceReceiveOrderDetailEntity.setSupId(deptDeviceDetailEntity.getSupId()); + deviceReceiveOrderDetailEntity.setBatchNo(deptDeviceDetailEntity.getBatchNo()); + deviceReceiveOrderDetailEntity.setProductionDate(deptDeviceDetailEntity.getProductionDate()); + deviceReceiveOrderDetailEntity.setExpireDate(deptDeviceDetailEntity.getExpireDate()); + deviceReceiveOrderDetailEntity.setSerialNo(deptDeviceDetailEntity.getSerialNo()); + deviceReceiveOrderDetailEntity.setCreateTime(new Date()); + deviceReceiveOrderDetailEntity.setUpdateTime(new Date()); + deviceReceiveOrderDetailDao.insert(deviceReceiveOrderDetailEntity); + } + } } return ResultVOUtils.success("添加成功!"); diff --git a/src/main/java/com/glxp/api/util/test.java b/src/main/java/com/glxp/api/util/test.java new file mode 100644 index 00000000..7612a633 --- /dev/null +++ b/src/main/java/com/glxp/api/util/test.java @@ -0,0 +1,22 @@ +package com.glxp.api.util; + +import java.util.ArrayList; +import java.util.List; + +public class test { + public static void main(String[] args) { + List list = new ArrayList<>(); + list.add("1"); + list.add("2"); + list.add("3"); + list.add("4"); + list.add("5"); + list.add("6"); + list.add("7"); + + for (int i =0; i<20;i++){ + String ys =list.get(i%7); + System.out.println(ys); + } + } +} diff --git a/src/main/resources/schemas/schema_v2.2.sql b/src/main/resources/schemas/schema_v2.2.sql index 717ffe2c..53acfac4 100644 --- a/src/main/resources/schemas/schema_v2.2.sql +++ b/src/main/resources/schemas/schema_v2.2.sql @@ -265,3 +265,4 @@ CALL Pro_Temp_ColumnWork('dept_device_detail', 'nameCode', 'varchar(255)', 1); CALL Pro_Temp_ColumnWork('device_inspect_plan', 'executeCount', 'int', 1); CALL Pro_Temp_ColumnWork('device_inspect_plan', 'useFrequency', 'int', 1); +CALL Pro_Temp_ColumnWork('device_receive_order', 'type', 'int', 1);