diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java index 0920d166..99161ff9 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -446,6 +446,7 @@ public class IoOrderDetailBizController extends BaseController { ioOrderDetailBizEntity.setExpireDate(purReceiveDetailEntity.getExpireDate()); ioOrderDetailBizEntity.setBatchNo(purReceiveDetailEntity.getBatchNo()); ioOrderDetailBizEntity.setSupId(purReceiveDetailEntity.getSupId()); + ioOrderDetailBizEntity.setPrice(purReceiveDetailEntity.getPrice()); ioOrderDetailBizEntity.setCount(IntUtil.value(purReceiveDetailEntity.getCount())); orderDetailBizService.insert(ioOrderDetailBizEntity); } diff --git a/src/main/java/com/glxp/api/controller/purchase/IoPurChangeService.java b/src/main/java/com/glxp/api/controller/purchase/IoPurChangeService.java index f3e211c6..a1fb8b69 100644 --- a/src/main/java/com/glxp/api/controller/purchase/IoPurChangeService.java +++ b/src/main/java/com/glxp/api/controller/purchase/IoPurChangeService.java @@ -256,53 +256,57 @@ public class IoPurChangeService { BasicBusTypeChangeEntity basicBusTypeChangeEntity = basicBusTypeChangeService.selectByOriginAction(ConstantStatus.BUS_ORDER_HCLY); purReceiveEntity = receiveService.selectById(purReceiveEntity.getId()); List purReceiveDetailEntityList = receivedetailService.selectByOrderId(purReceiveEntity.getBillNo()); - Map> map = purReceiveDetailEntityList.stream().collect(Collectors.groupingBy(PurReceiveDetailEntity::getSupId)); +// Map> map = purReceiveDetailEntityList.stream().collect(Collectors.groupingBy(PurReceiveDetailEntity::getSupId)); String billNo = ""; if (basicBusTypeChangeEntity != null && StrUtil.isNotEmpty(basicBusTypeChangeEntity.getTargetAction()) && basicBusTypeChangeEntity.isEnable() == true) { - for (Map.Entry> m : map.entrySet()) { - //生产单据表信息 - IoOrderEntity ioOrderEntity = new IoOrderEntity(); - ioOrderEntity.setBillNo(gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER, "yyyyMMdd"))); - ioOrderEntity.setCorpOrderId(CustomUtil.getDate()); - ioOrderEntity.setMainAction(ConstantType.TYPE_PUT); - ioOrderEntity.setAction(basicBusTypeChangeEntity.getTargetAction()); - ioOrderEntity.setFromCorp(m.getKey()); - ioOrderEntity.setFromType(ConstantStatus.FROM_PLAN); - if (basicBusTypeChangeEntity.getAuditStatus() == 1) { - ioOrderEntity.setStatus(ConstantStatus.ORDER_STATUS_TEMP_SAVE); - ioOrderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_DRAFT); - } else { - ioOrderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK); - ioOrderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST); - } - ioOrderEntity.setOrderType(1); - ioOrderEntity.setCreateTime(new Date()); - ioOrderEntity.setCreateUser(purReceiveEntity.getCreateUser()); - ioOrderEntity.setUpdateTime(new Date()); - ioOrderEntity.setUpdateUser(purReceiveEntity.getCreateUser()); - ioOrderEntity.setCustomerId("110"); - ioOrderEntity.setDeptCode(purReceiveEntity.getInvCode()); - ioOrderEntity.setInvCode(purReceiveEntity.getDeptCode()); - ioOrderService.insertOrder(ioOrderEntity); - billNo += ioOrderEntity.getBillNo() + ","; - //插入业务单表 - for (PurReceiveDetailEntity obj : m.getValue()) { - BasicProductsEntity basicProductsEntity = receivedetailService.selectIoOrderDetailBiz(obj.getId()); - IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity(); - ioOrderDetailBizEntity.setOrderIdFk(ioOrderEntity.getBillNo()); - ioOrderDetailBizEntity.setBindRlFk(obj.getRelIdFk()); - ioOrderDetailBizEntity.setCount(IntUtil.value(obj.getCount())); - ioOrderDetailBizEntity.setUuidFk(basicProductsEntity.getUuid()); - ioOrderDetailBizEntity.setNameCode(basicProductsEntity.getNameCode()); - ioOrderDetailBizEntity.setCoName(basicProductsEntity.getCpmctymc()); - ioOrderDetailBizEntity.setCertCode(basicProductsEntity.getZczbhhzbapzbh()); - ioOrderDetailBizEntity.setYlqxzcrbarmc(basicProductsEntity.getYlqxzcrbarmc()); - ioOrderDetailBizEntity.setManufacturer(basicProductsEntity.getManufactory()); ioOrderDetailBizEntity.setMeasname(basicProductsEntity.getMeasname()); - ioOrderDetailBizEntity.setSpec(basicProductsEntity.getGgxh()); - ioOrderDetailBizEntity.setPrice(obj.getPrice()); - ioOrderDetailBizEntity.setSupId(obj.getSupId()); - ioOrderDetailBizService.insert(ioOrderDetailBizEntity); - } + //生产单据表信息 + IoOrderEntity ioOrderEntity = new IoOrderEntity(); + ioOrderEntity.setBillNo(gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER, "yyyyMMdd"))); + ioOrderEntity.setCorpOrderId(purReceiveEntity.getBillNo()); + ioOrderEntity.setFromReceiveBillNo(purReceiveEntity.getBillNo()); + ioOrderEntity.setMainAction(ConstantType.TYPE_PUT); + ioOrderEntity.setAction(basicBusTypeChangeEntity.getTargetAction()); + ioOrderEntity.setFromDeptCode(purReceiveEntity.getTargetDeptCode()); + ioOrderEntity.setFromInvCode(purReceiveEntity.getTargetInvCode()); + ioOrderEntity.setFromType(ConstantStatus.FROM_RECEIVE); + if (basicBusTypeChangeEntity.getAuditStatus() == 1) { + ioOrderEntity.setStatus(ConstantStatus.ORDER_STATUS_TEMP_SAVE); + ioOrderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_DRAFT); + } else { + ioOrderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK); + ioOrderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_POST); + } + ioOrderEntity.setOrderType(1); + ioOrderEntity.setCreateTime(new Date()); + ioOrderEntity.setCreateUser(purReceiveEntity.getCreateUser()); + ioOrderEntity.setUpdateTime(new Date()); + ioOrderEntity.setUpdateUser(purReceiveEntity.getCreateUser()); + ioOrderEntity.setCustomerId("110"); + ioOrderEntity.setDeptCode(purReceiveEntity.getDeptCode()); + ioOrderEntity.setInvCode(purReceiveEntity.getInvCode()); + ioOrderService.insertOrder(ioOrderEntity); + billNo += ioOrderEntity.getBillNo() + ","; + //插入业务单表 + for (PurReceiveDetailEntity obj : purReceiveDetailEntityList) { + BasicProductsEntity basicProductsEntity = receivedetailService.selectIoOrderDetailBiz(obj.getId()); + IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity(); + ioOrderDetailBizEntity.setOrderIdFk(ioOrderEntity.getBillNo()); + ioOrderDetailBizEntity.setBindRlFk(obj.getRelIdFk()); + ioOrderDetailBizEntity.setCount(IntUtil.value(obj.getCount())); + ioOrderDetailBizEntity.setUuidFk(basicProductsEntity.getUuid()); + ioOrderDetailBizEntity.setNameCode(basicProductsEntity.getNameCode()); + ioOrderDetailBizEntity.setCoName(basicProductsEntity.getCpmctymc()); + ioOrderDetailBizEntity.setCertCode(basicProductsEntity.getZczbhhzbapzbh()); + ioOrderDetailBizEntity.setYlqxzcrbarmc(basicProductsEntity.getYlqxzcrbarmc()); + ioOrderDetailBizEntity.setManufacturer(basicProductsEntity.getManufactory()); + ioOrderDetailBizEntity.setProductDate(obj.getProductDate()); + ioOrderDetailBizEntity.setExpireDate(obj.getExpireDate()); + ioOrderDetailBizEntity.setBatchNo(obj.getBatchNo()); + ioOrderDetailBizEntity.setMeasname(basicProductsEntity.getMeasname()); + ioOrderDetailBizEntity.setSpec(basicProductsEntity.getGgxh()); + ioOrderDetailBizEntity.setPrice(obj.getPrice()); + ioOrderDetailBizEntity.setSupId(obj.getSupId()); + ioOrderDetailBizService.insert(ioOrderDetailBizEntity); } } } diff --git a/src/main/java/com/glxp/api/req/inv/FilterInvPreProductDetailRequest.java b/src/main/java/com/glxp/api/req/inv/FilterInvPreProductDetailRequest.java index 75a1f8b7..215f9ed4 100644 --- a/src/main/java/com/glxp/api/req/inv/FilterInvPreProductDetailRequest.java +++ b/src/main/java/com/glxp/api/req/inv/FilterInvPreProductDetailRequest.java @@ -77,6 +77,7 @@ public class FilterInvPreProductDetailRequest extends ListPageRequest { */ private String updateTime; private BigDecimal price; - + private String startTime; + private String endTime; } diff --git a/src/main/java/com/glxp/api/req/inv/FilterInvPreinProductRequest.java b/src/main/java/com/glxp/api/req/inv/FilterInvPreinProductRequest.java index 75dda00d..e40b4a36 100644 --- a/src/main/java/com/glxp/api/req/inv/FilterInvPreinProductRequest.java +++ b/src/main/java/com/glxp/api/req/inv/FilterInvPreinProductRequest.java @@ -111,4 +111,7 @@ public class FilterInvPreinProductRequest extends ListPageRequest { private Integer filterCount; private String diCode; + + private String startTime; + private String endTime; } 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 3e876600..453ba399 100644 --- a/src/main/java/com/glxp/api/req/inv/FilterInvProductDetailRequest.java +++ b/src/main/java/com/glxp/api/req/inv/FilterInvProductDetailRequest.java @@ -91,4 +91,7 @@ public class FilterInvProductDetailRequest extends ListPageRequest { private String expireDate; private BigDecimal price; + + private String startTime; + private String endTime; } diff --git a/src/main/java/com/glxp/api/util/RsaUtils.java b/src/main/java/com/glxp/api/util/RsaUtils.java index 46b9e455..5224994d 100644 --- a/src/main/java/com/glxp/api/util/RsaUtils.java +++ b/src/main/java/com/glxp/api/util/RsaUtils.java @@ -58,7 +58,7 @@ public class RsaUtils { } public static String readFileContent(String fileName) { - ClassPathResource resource = new ClassPathResource("config.txt"); + ClassPathResource resource = new ClassPathResource("/config.txt"); File file = new File(resource.getAbsolutePath()); BufferedReader reader = null; diff --git a/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml b/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml index 09c3cb88..f92a0fb9 100644 --- a/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/InvPreInProductDetailDao.xml @@ -6,7 +6,7 @@ from inv_prein_product_detail - AND code = #{code} + AND code like concat('%', #{code}, '%') AND mainAction = #{mainAction} @@ -53,6 +53,10 @@ AND updateTime #{updateTime} + + AND date_format(updateTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and + date_format(#{endTime}, '%Y-%m-%d') + diff --git a/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml b/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml index 00c0cd09..74957989 100644 --- a/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/InvPreProductDetailDao.xml @@ -86,7 +86,7 @@ from inv_pre_product_detail - AND code = #{code} + AND code like concat('%', #{code}, '%') AND price = #{price} @@ -133,6 +133,10 @@ AND updateTime #{updateTime} + + AND date_format(updateTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and + date_format(#{endTime}, '%Y-%m-%d') + diff --git a/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml b/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml index 64efea8d..75a63c68 100644 --- a/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/invProductDetailDao.xml @@ -92,7 +92,7 @@ from inv_product_detail - AND code = #{code} + AND code like concat('%', #{code}, '%') AND mainAction = #{mainAction} @@ -150,6 +150,11 @@ AND updateTime #{updateTime} + + + AND date_format(updateTime, '%Y-%m-%d') between date_format(#{startTime}, '%Y-%m-%d') and + date_format(#{endTime}, '%Y-%m-%d') + diff --git a/src/main/resources/schemas/schema_v2.1.sql b/src/main/resources/schemas/schema_v2.1.sql index 3d2e3575..3865c657 100644 --- a/src/main/resources/schemas/schema_v2.1.sql +++ b/src/main/resources/schemas/schema_v2.1.sql @@ -523,7 +523,7 @@ INSERT ignore INTO `sys_param_config`(id, `parentId`, `paramName`, `paramKey`, ` `paramExplain`, `updateTime`) VALUES (20059, 0, '是否允许编辑第三方产品信息', 'enable_edit_third', '1', 0, 0, '0:否;1:是', NULL); -CREATE TABLE if not exists `basic_destiny_rel` +CREATE TABLE if not exists `basic_sk_project_detail` ( `id` bigint(0) NOT NULL, `relId` bigint(0) NULL DEFAULT NULL COMMENT '耗材产品id', diff --git a/src/main/resources/schemas/schema_v2.3.sql b/src/main/resources/schemas/schema_v2.3.sql index 4ede9288..0e8b3daf 100644 --- a/src/main/resources/schemas/schema_v2.3.sql +++ b/src/main/resources/schemas/schema_v2.3.sql @@ -811,7 +811,7 @@ INSERT ignore INTO `sys_param_config`(id, `parentId`, `paramName`, `paramKey`, ` `paramExplain`, `updateTime`) VALUES (20059, 0, '是否允许编辑第三方产品信息', 'enable_edit_third', '1', 0, 0, '0:否;1:是', NULL); -CREATE TABLE if not exists `basic_destiny_rel` +CREATE TABLE if not exists `basic_sk_project_detail` ( `id` bigint(0) NOT NULL, `relId` bigint(0) NULL DEFAULT NULL COMMENT '耗材产品id',