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 e3182f22..68e402ee 100644 --- a/src/main/java/com/glxp/api/entity/inv/DeviceReceiveOrderEntity.java +++ b/src/main/java/com/glxp/api/entity/inv/DeviceReceiveOrderEntity.java @@ -15,7 +15,7 @@ public class DeviceReceiveOrderEntity { /** * id */ - @TableId(value = "id", type = IdType.INPUT) + @TableId(value = "id", type = IdType.AUTO) 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 faddd29f..908da82a 100644 --- a/src/main/java/com/glxp/api/req/inv/FilterDeviceReceiveOrderRequest.java +++ b/src/main/java/com/glxp/api/req/inv/FilterDeviceReceiveOrderRequest.java @@ -42,4 +42,17 @@ public class FilterDeviceReceiveOrderRequest extends ListPageRequest { private String templateId; + /** + * 开始时间 + */ + private String startTime; + + /** + * 结束时间 + */ + private String endTime; + + private String receiveUserName; + + } diff --git a/src/main/java/com/glxp/api/req/inv/FilterInvProductDetailRequest.java b/src/main/java/com/glxp/api/req/inv/FilterInvProductDetailRequest.java index c9cda9af..92ae8c4e 100644 --- a/src/main/java/com/glxp/api/req/inv/FilterInvProductDetailRequest.java +++ b/src/main/java/com/glxp/api/req/inv/FilterInvProductDetailRequest.java @@ -11,6 +11,8 @@ import java.util.List; @Data public class FilterInvProductDetailRequest extends ListPageRequest { + private int id; + /** * UDI码 */ diff --git a/src/main/java/com/glxp/api/req/inv/FilterInvProductRequest.java b/src/main/java/com/glxp/api/req/inv/FilterInvProductRequest.java index d6c682df..84625811 100644 --- a/src/main/java/com/glxp/api/req/inv/FilterInvProductRequest.java +++ b/src/main/java/com/glxp/api/req/inv/FilterInvProductRequest.java @@ -108,4 +108,10 @@ public class FilterInvProductRequest extends ListPageRequest { */ private Integer filterCount; + private String code; + + private String serialNo; + + private String manufactory; + } diff --git a/src/main/java/com/glxp/api/res/basic/UdiRelevanceResponse.java b/src/main/java/com/glxp/api/res/basic/UdiRelevanceResponse.java index b430c4e9..c8072e51 100644 --- a/src/main/java/com/glxp/api/res/basic/UdiRelevanceResponse.java +++ b/src/main/java/com/glxp/api/res/basic/UdiRelevanceResponse.java @@ -106,6 +106,7 @@ public class UdiRelevanceResponse { private String unitFk; //供应商ID private String companyName; //供应商名称 + //手持终端下载需要主键 private Long relId; private boolean dispatch; //是否可配送 diff --git a/src/main/java/com/glxp/api/res/inv/InvProductResponse.java b/src/main/java/com/glxp/api/res/inv/InvProductResponse.java index 96e18072..ac9dee93 100644 --- a/src/main/java/com/glxp/api/res/inv/InvProductResponse.java +++ b/src/main/java/com/glxp/api/res/inv/InvProductResponse.java @@ -38,7 +38,7 @@ public class InvProductResponse { /** * 生产日期 */ - private String productionDate; + private String produceDate; /** * 过期时间 @@ -113,6 +113,12 @@ public class InvProductResponse { private String code; + private String serialNo; + + private String manufactoryl; + + + /* * 计量单位 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 bbaecd0e..61de8143 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 @@ -110,61 +110,11 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe //通过选库存添加 //查询选中的库存信息 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); - } - - //根据计算得出的,所有存在于库存中的码明细,生成设备领用记录详情 - 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++) { - DeviceReceiveOrderDetailEntity orderDetail = getDeviceReceiveOrderDetailEntity(addDetailRequest.getOrderIdFk(), code, invProductDetailEntity); - //插入设备领用记录详情 - deviceReceiveOrderDetailDao.insert(orderDetail); - } - } else { - DeviceReceiveOrderDetailEntity orderDetail = getDeviceReceiveOrderDetailEntity(addDetailRequest.getOrderIdFk(), code, invProductDetailEntity); - deviceReceiveOrderDetailDao.insert(orderDetail); - } - } - } + InvProductDetailEntity invProductDetailEntities = invProductDetailDao.selectById(Integer.valueOf(invProductId)); + DeviceReceiveOrderDetailEntity orderDetail = getDeviceReceiveOrderDetailEntity(addDetailRequest.getOrderIdFk(), invProductDetailEntities.getCode(), invProductDetailEntities); + //插入设备领用记录详情 + deviceReceiveOrderDetailDao.insert(orderDetail); } }else{ for (String invProductId : addDetailRequest.getInvProductIds()) { diff --git a/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml b/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml index bae8b373..8b468f76 100644 --- a/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml +++ b/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml @@ -57,16 +57,21 @@ basic_products.basicPrductRemak5, basic_products.basicPrductRemak6, basic_products.basicPrductRemak7, - basic_products.basicPrductRemak8 + basic_products.basicPrductRemak8, + basic_corp.name as companyName FROM basic_udirel - inner JOIN basic_products - ON basic_products.uuid = basic_udirel.uuid + inner JOIN basic_products ON basic_products.uuid = basic_udirel.uuid + left join company_product_relevance on basic_udirel.id = company_product_relevance.udiRlIdFk + left JOIN basic_corp on basic_corp.erpId = company_product_relevance.customerId AND ylqxzcrbarmc LIKE concat('%', #{ylqxzcrbarmc}, '%') - - AND supName LIKE concat('%', #{supName}, '%') + + AND basic_products.manufactory LIKE concat('%', #{manufactory}, '%') + + + AND basic_corp.name LIKE concat('%', #{companyName}, '%') AND cpmctymc LIKE concat('%', #{cpmctymc}, '%') diff --git a/src/main/resources/mybatis/mapper/inv/DeviceReceiveOrderDao.xml b/src/main/resources/mybatis/mapper/inv/DeviceReceiveOrderDao.xml index 5bdc1811..7c0c0ac6 100644 --- a/src/main/resources/mybatis/mapper/inv/DeviceReceiveOrderDao.xml +++ b/src/main/resources/mybatis/mapper/inv/DeviceReceiveOrderDao.xml @@ -13,15 +13,15 @@ dro.STATUS, dro.fromInvSpaceCode, dro.receiveUser, - ( SELECT employeeName FROM auth_user WHERE id = dro.receiveUser ) receiveUserName, + au.employeeName as receiveUserName, ( SELECT `name` FROM auth_dept WHERE CODE = dro.fromDeptCode ) fromDeptName, ( SELECT `code` FROM auth_dept WHERE CODE = dro.fromDeptCode ) fromDeptCode, ( SELECT `name` FROM auth_warehouse WHERE CODE = dro.fromInvCode ) fromInvName, ( SELECT `code` FROM auth_warehouse WHERE CODE = dro.fromInvCode ) fromInvCode, - ( SELECT `name` FROM auth_space WHERE CODE = dro.fromInvSpaceCode ) fromInvSpaceName, - ( SELECT employeeName FROM auth_user WHERE userName = dro.createUser ) createUserName + ( SELECT `name` FROM auth_space WHERE CODE = dro.fromInvSpaceCode ) fromInvSpaceName FROM device_receive_order dro + left join auth_user au on au.id = dro.receiveUser AND status = #{status} @@ -38,6 +38,12 @@ AND fromInvSpaceCode = #{fromInvSpaceCode} + + AND au.employeeName like concat('%', #{receiveUserName}, '%') + + + AND date_format(dro.createTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') + order by updateTime desc diff --git a/src/main/resources/mybatis/mapper/inv/DeviceReceiveOrderDetailDao.xml b/src/main/resources/mybatis/mapper/inv/DeviceReceiveOrderDetailDao.xml index 7f83cad2..9ffbdb1d 100644 --- a/src/main/resources/mybatis/mapper/inv/DeviceReceiveOrderDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/DeviceReceiveOrderDetailDao.xml @@ -74,6 +74,7 @@ AND drod.originCode = #{code} + group by bu.uuid