From f3b92944ae39916bbf4fa170989a91e58bacca6a Mon Sep 17 00:00:00 2001 From: anthonywj Date: Mon, 15 May 2023 16:28:55 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase/PurOrderController.java | 99 ++++++++++--------- .../api/req/purchase/PurOrderRequest.java | 1 + .../mybatis/mapper/purchase/PurOrderDao.xml | 8 +- 3 files changed, 58 insertions(+), 50 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/purchase/PurOrderController.java b/src/main/java/com/glxp/api/controller/purchase/PurOrderController.java index b602414e..efbee6f7 100644 --- a/src/main/java/com/glxp/api/controller/purchase/PurOrderController.java +++ b/src/main/java/com/glxp/api/controller/purchase/PurOrderController.java @@ -116,7 +116,10 @@ public class PurOrderController { if (purOrderRequest.getStatus() == null) { purOrderRequest.setStatus(11); //查询未审核和草稿状态 } - + String customerId = customerService.getCustomerId(); + if (!customerId.equals("110")) { + purOrderRequest.setSupId(customerId); + } List purApplyEntities = purOrderService.queryPageList(purOrderRequest); PageInfo pageInfo; pageInfo = new PageInfo<>(purApplyEntities); @@ -156,7 +159,7 @@ public class PurOrderController { purOrderEntity.setUpdateTime(new Date()); purOrderService.update(purOrderEntity); - if(postPurOrderRequest.isAutoPurchase() && StrUtil.isNotEmpty(postPurOrderRequest.getTargetBillAction())){ + if (postPurOrderRequest.isAutoPurchase() && StrUtil.isNotEmpty(postPurOrderRequest.getTargetBillAction())) { String billNo = ""; List purOrderDetailEntities = purOrderDetailService.findByOrderId(purOrderEntity.getId() + ""); @@ -164,61 +167,59 @@ public class PurOrderController { Map> map = purOrderDetailEntities.stream().collect(Collectors.groupingBy(PurOrderDetailEntity::getSupId)); + if (CollUtil.isNotEmpty(purOrderDetailEntities) && postPurOrderRequest.isAutoPurchase() == true + && StrUtil.isNotEmpty(postPurOrderRequest.getTargetBillAction())) { - if (CollUtil.isNotEmpty(purOrderDetailEntities) && postPurOrderRequest.isAutoPurchase() == true - && StrUtil.isNotEmpty(postPurOrderRequest.getTargetBillAction())) { - - 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(postPurOrderRequest.getTargetBillAction()); - ioOrderEntity.setFromCorp(m.getKey()); - ioOrderEntity.setFromType(ConstantStatus.FROM_Order); - ioOrderEntity.setStatus(1); - ioOrderEntity.setDealStatus(1); - ioOrderEntity.setOrderType(1); - ioOrderEntity.setCreateTime(new Date()); - ioOrderEntity.setCreateUser(postPurOrderRequest.getPurOrderEntity().getAuditUser()); - ioOrderEntity.setUpdateTime(new Date()); - ioOrderEntity.setUpdateUser(postPurOrderRequest.getPurOrderEntity().getAuditUser()); - ioOrderEntity.setCustomerId("110"); - ioOrderEntity.setDeptCode(purOrderEntity.getDeptCode()); - ioOrderEntity.setInvCode(purOrderEntity.getInvCode()); - ioOrderService.insertOrder(ioOrderEntity); - billNo += ioOrderEntity.getBillNo() + ","; - //插入业务单表 - for (PurOrderDetailEntity obj : m.getValue()) { - BasicProductsEntity basicProductsEntity = purOrderDetailService.selectIoOrderDetailBiz(obj.getId()); - IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity(); - ioOrderDetailBizEntity.setOrderIdFk(ioOrderEntity.getBillNo()); - ioOrderDetailBizEntity.setBindRlFk(Long.valueOf(obj.getProductId())); - ioOrderDetailBizEntity.setCount(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()); - if (basicProductsEntity.getPrice() != null) { - ioOrderDetailBizEntity.setPrice(BigDecimal.valueOf(basicProductsEntity.getPrice())); - } - ioOrderDetailBizEntity.setSupId(obj.getSupId()); - ioOrderDetailBizService.insert(ioOrderDetailBizEntity); + 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(postPurOrderRequest.getTargetBillAction()); + ioOrderEntity.setFromCorp(m.getKey()); + ioOrderEntity.setFromType(ConstantStatus.FROM_Order); + ioOrderEntity.setStatus(1); + ioOrderEntity.setDealStatus(1); + ioOrderEntity.setOrderType(1); + ioOrderEntity.setCreateTime(new Date()); + ioOrderEntity.setCreateUser(postPurOrderRequest.getPurOrderEntity().getAuditUser()); + ioOrderEntity.setUpdateTime(new Date()); + ioOrderEntity.setUpdateUser(postPurOrderRequest.getPurOrderEntity().getAuditUser()); + ioOrderEntity.setCustomerId("110"); + ioOrderEntity.setDeptCode(purOrderEntity.getDeptCode()); + ioOrderEntity.setInvCode(purOrderEntity.getInvCode()); + ioOrderService.insertOrder(ioOrderEntity); + billNo += ioOrderEntity.getBillNo() + ","; + //插入业务单表 + for (PurOrderDetailEntity obj : m.getValue()) { + BasicProductsEntity basicProductsEntity = purOrderDetailService.selectIoOrderDetailBiz(obj.getId()); + IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity(); + ioOrderDetailBizEntity.setOrderIdFk(ioOrderEntity.getBillNo()); + ioOrderDetailBizEntity.setBindRlFk(Long.valueOf(obj.getProductId())); + ioOrderDetailBizEntity.setCount(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()); + if (basicProductsEntity.getPrice() != null) { + ioOrderDetailBizEntity.setPrice(BigDecimal.valueOf(basicProductsEntity.getPrice())); } + ioOrderDetailBizEntity.setSupId(obj.getSupId()); + ioOrderDetailBizService.insert(ioOrderDetailBizEntity); } - purOrderEntity.setStockOrderNo(billNo.substring(0, billNo.length() - 1)); - purOrderService.update(purOrderEntity); } + purOrderEntity.setStockOrderNo(billNo.substring(0, billNo.length() - 1)); + purOrderService.update(purOrderEntity); + } } - return ResultVOUtils.success("更新成功!"); } diff --git a/src/main/java/com/glxp/api/req/purchase/PurOrderRequest.java b/src/main/java/com/glxp/api/req/purchase/PurOrderRequest.java index f74661d5..845c4dc8 100644 --- a/src/main/java/com/glxp/api/req/purchase/PurOrderRequest.java +++ b/src/main/java/com/glxp/api/req/purchase/PurOrderRequest.java @@ -81,6 +81,7 @@ public class PurOrderRequest extends ListPageRequest { private Date auditTime; private String createUser; + private String supId; /** * 创建时间 diff --git a/src/main/resources/mybatis/mapper/purchase/PurOrderDao.xml b/src/main/resources/mybatis/mapper/purchase/PurOrderDao.xml index 8fcc3dd7..acf4c3d0 100644 --- a/src/main/resources/mybatis/mapper/purchase/PurOrderDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/PurOrderDao.xml @@ -40,12 +40,15 @@ cb.employeeName createUserName, ab.employeeName auditUserName, auth_warehouse.NAME invName, - auth_dept.`name` deptName + auth_dept.`name` deptName, + basic_corp.name supName FROM pur_order LEFT JOIN auth_user cb ON pur_order.createUser = cb.id LEFT JOIN auth_user ab ON pur_order.auditUser = ab.id LEFT JOIN auth_warehouse ON pur_order.invCode = auth_warehouse.`code` LEFT JOIN auth_dept ON auth_dept.CODE = pur_order.deptCode + left join basic_corp on pur_order.supId = basic_corp.erpId + AND billNo = #{billNo} @@ -92,6 +95,9 @@ AND auditUser = #{auditUser} + + AND pur_order.supId = #{supId} + AND createUser = #{createUser} From aa8fee64d12678407c2b4ab5e359fd2b7614aa1b Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Mon, 15 May 2023 17:56:20 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=86=B7=E9=93=BE=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/inout/IoOrderDetailBizController.java | 1 + .../glxp/api/entity/inout/IoOrderDetailBizEntity.java | 11 +++++++++++ .../glxp/api/res/inout/IoOrderDetailBizResponse.java | 4 ++++ src/main/resources/schemas/schema_v2.1.sql | 5 +++++ 4 files changed, 21 insertions(+) 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 521aa2db..f88106b6 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -615,6 +615,7 @@ public class IoOrderDetailBizController extends BaseController { orderService.update(orderEntity); } ioOrderDetailBizEntity.setCheckFileName(ioOrderDetailBizEntity.getFilePath()); + ioOrderDetailBizEntity.setCheckColdFileName(ioOrderDetailBizEntity.getColdFilePath()); boolean b = orderDetailBizService.updateOrderDetailBiz(ioOrderDetailBizEntity); return ResultVOUtils.success("修改成功!"); } diff --git a/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java b/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java index f2bb0ca6..2a542be5 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoOrderDetailBizEntity.java @@ -180,12 +180,23 @@ public class IoOrderDetailBizEntity { @TableField(value = "filePath") private String filePath; + @TableField(value = "coldFilePath") + private String coldFilePath; + /** * 检验报告名称 */ @TableField(value = "checkFileName") private String checkFileName; + /** + * 冷链报告名称 + */ + @TableField(value = "checkColdFileName") + private String checkColdFileName; + + + @TableField(exist = false) private boolean checkSuccess; diff --git a/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java b/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java index 2d908e88..d4a9fc4f 100644 --- a/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java +++ b/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java @@ -169,6 +169,10 @@ public class IoOrderDetailBizResponse { private String invoiceCode; + private String coldFilePath; + + private String checkColdFileName; + } diff --git a/src/main/resources/schemas/schema_v2.1.sql b/src/main/resources/schemas/schema_v2.1.sql index 05273196..3b6f34c7 100644 --- a/src/main/resources/schemas/schema_v2.1.sql +++ b/src/main/resources/schemas/schema_v2.1.sql @@ -184,6 +184,11 @@ CALL Pro_Temp_ColumnWork('sys_pdf_template', 'bussinessStatus', 'varchar(255)', CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'filePath', 'varchar(255)', 1); +CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'coldFilePath', 'varchar(255)', 1); + +CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'checkColdFileName', 'varchar(255)', 1); + + CALL Pro_Temp_ColumnWork('io_order', 'checkStatus', 'tinyint', 1); INSERT ignore INTO `sys_scheduled`(`id`, `cronName`, `cron`, `customerId`, `remark`) From 974e26a3e9c764ccd013b7a1555e8543cc9c0ad4 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Mon, 15 May 2023 20:40:41 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=B9=81=E5=BF=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inout/IoOrderInvoiceController.java | 3 +-- .../mybatis/mapper/inout/IoOrderInvoiceMapper.xml | 15 +++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java index bffa41e7..18b9ef0d 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderInvoiceController.java @@ -25,7 +25,6 @@ import java.util.List; public class IoOrderInvoiceController { @Resource IoOrderInvoiceService ioOrderInvoiceService; - RefreshInoiceRequest refreshInoiceRequest; @Resource IoOrderDetailCodeService orderDetailCodeService; @@ -37,7 +36,7 @@ public class IoOrderInvoiceController { IoOrderInvoiceRequest orderInvoiceRequest = new IoOrderInvoiceRequest(); BeanUtils.copyProperties(refreshInoiceRequest, orderInvoiceRequest); - List orderInvoiceEntities = ioOrderInvoiceService.selectOrderInvoice(orderInvoiceRequest); + List orderInvoiceEntities = ioOrderInvoiceService.findByBillNo(orderInvoiceRequest.getOrderIdFk()); List orderDetailCodeEntities = orderDetailCodeService.findByOrderId(orderInvoiceRequest.getOrderIdFk()); RefreshInoiceResponse response = new RefreshInoiceResponse(); diff --git a/src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml b/src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml index 2421b41c..f60f7cf2 100644 --- a/src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml +++ b/src/main/resources/mybatis/mapper/inout/IoOrderInvoiceMapper.xml @@ -13,18 +13,18 @@ From 0ee194313d1378a799a15470df3412631bdeced8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Mon, 15 May 2023 17:33:46 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=86=85=E9=83=A8=E7=A0=81=E5=92=8C?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E6=89=93=E5=8D=B0=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 (cherry picked from commit b493e80846e5a832f264574721c395057a5d1abd) --- .../inout/IoOrderDetailResultController.java | 116 ++++++++++++++++++ .../inv/InvInnerOrderPrintController.java | 94 +++++++++++++- .../inout/FilterOrderDetailResultRequest.java | 3 + .../inout/IoOrderDetailResultResponse.java | 2 + 4 files changed, 213 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java index 04f9a76f..653ebcab 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java @@ -2,6 +2,7 @@ package com.glxp.api.controller.inout; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.common.enums.ResultEnum; @@ -13,19 +14,36 @@ import com.glxp.api.entity.basic.BasicBussinessTypeEntity; import com.glxp.api.entity.inout.IoOrderDetailBizEntity; import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; import com.glxp.api.entity.inout.IoOrderEntity; +import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; +import com.glxp.api.entity.system.SystemPDFTemplateEntity; import com.glxp.api.req.inout.FilterCodeRequest; import com.glxp.api.req.inout.FilterOrderDetailResultRequest; import com.glxp.api.req.inout.FilterOrderRequest; +import com.glxp.api.req.inout.InspectionPDFTemplateRequest; import com.glxp.api.res.inout.IoCodeResponse; import com.glxp.api.res.inout.IoOrderDetailResultResponse; import com.glxp.api.service.basic.IBasicBussinessTypeService; import com.glxp.api.service.inout.*; +import com.glxp.api.service.system.SystemPDFModuleService; +import com.glxp.api.service.system.SystemPDFTemplateService; +import com.glxp.api.util.JasperUtils; +import net.sf.jasperreports.engine.JRException; +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; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 单据扫码明细查询接口 @@ -40,6 +58,12 @@ public class IoOrderDetailResultController extends BaseController { IBasicBussinessTypeService basicBussinessTypeService; @Resource IoCodeService codeService; + @Resource + private SystemPDFTemplateService systemPDFTemplateService; + @Resource + private SystemPDFModuleService systemPDFModuleService; + @Value("${file_path}") + private String filePath; /** * 查询单据扫码明细列表 @@ -140,4 +164,96 @@ public class IoOrderDetailResultController extends BaseController { return ResultVOUtils.success(orderDetailBizEntities); } + + //校验模板是否正确 + @AuthRuleAnnotation("") + @PostMapping("/udiwms/pdf/template/order/result/file") + public BaseResponse inspectionStockOrderPDFFromTemplateFile(@RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) { + + //查询模板文件是否存在 + SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(inspectionPDFTemplateRequest.getId()); + if (null == sysPdfTemplateRelevanceStatemenEntity) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误"); + } + + SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceStatemenEntity.getTemplateId())); + if (null == systemPDFTemplateEntity) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误"); + } + return ResultVOUtils.success(sysPdfTemplateRelevanceStatemenEntity.getTemplateId()); + } + + + /** + * 出入库明细打印 + * + * @param filterOrderDetailResultRequest + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/udiwms/inout/resultDetail/filterOrderPrint") + public BaseResponse filterOrderPrint(@RequestBody FilterOrderDetailResultRequest filterOrderDetailResultRequest, HttpServletRequest request, HttpServletResponse response) throws JRException, IOException { + List ioOrderDetailResultResponseList=new ArrayList<>(); + SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(filterOrderDetailResultRequest.getTemplateId()); + //打印单号标签 + Map data = new HashMap<>(1); + List list = new ArrayList<>(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式 + + //按选入打印 + if(filterOrderDetailResultRequest.getList() != null && filterOrderDetailResultRequest.getList().size()>0){ + ioOrderDetailResultResponseList =filterOrderDetailResultRequest.getList(); + }else{ + //按查询打印 + FilterOrderRequest filterOrderRequest = new FilterOrderRequest(); + filterOrderRequest.setVueType(filterOrderDetailResultRequest.getActionType()); + List actions = orderService.setActions(filterOrderRequest); + if (CollUtil.isEmpty(actions)) { + return ResultVOUtils.success(""); + } + filterOrderDetailResultRequest.setActions(actions); + ioOrderDetailResultResponseList = orderDetailResultService.filterOrderList(filterOrderDetailResultRequest); + for (IoOrderDetailResultResponse orderDetailResultResponse : ioOrderDetailResultResponseList) { + if (orderDetailResultResponse.getMainAction().equals(ConstantType.TYPE_OUT)) { + orderDetailResultResponse.setOutCount(orderDetailResultResponse.getReCount()); + orderDetailResultResponse.setInCount(0); + } else { + orderDetailResultResponse.setOutCount(0); + orderDetailResultResponse.setInCount(orderDetailResultResponse.getReCount()); + } + } + } + int i=1; + for (IoOrderDetailResultResponse ioOrderDetailResultResponse : ioOrderDetailResultResponseList) { + //组装数据 + Map ioOrderDetailResultData = new HashMap<>(); + ioOrderDetailResultData.put("index", String.valueOf(i)); + ioOrderDetailResultData.put("nameCode", ioOrderDetailResultResponse.getNameCode() == null ? ' ' : ioOrderDetailResultResponse.getNameCode()); + ioOrderDetailResultData.put("batchNo", ioOrderDetailResultResponse.getBatchNo() == null ? ' ' : ioOrderDetailResultResponse.getBatchNo()); + ioOrderDetailResultData.put("productDate", ioOrderDetailResultResponse.getProductDate() == null ? ' ' : ioOrderDetailResultResponse.getProductDate()); + ioOrderDetailResultData.put("expireDate", ioOrderDetailResultResponse.getExpireDate() == null ? ' ' : ioOrderDetailResultResponse.getExpireDate()); + ioOrderDetailResultData.put("coName", ioOrderDetailResultResponse.getCoName() == null ? ' ' : ioOrderDetailResultResponse.getCoName()); + ioOrderDetailResultData.put("certCode", ioOrderDetailResultResponse.getCertCode() == null ? ' ' : ioOrderDetailResultResponse.getCertCode()); + ioOrderDetailResultData.put("ylqxzcrbarmc", ioOrderDetailResultResponse.getYlqxzcrbarmc() == null ? ' ' : ioOrderDetailResultResponse.getYlqxzcrbarmc()); + ioOrderDetailResultData.put("manufacturer", ioOrderDetailResultResponse.getManufacturer() == null ? ' ' : ioOrderDetailResultResponse.getManufacturer()); + ioOrderDetailResultData.put("measname", ioOrderDetailResultResponse.getMeasname() == null ? ' ' : ioOrderDetailResultResponse.getMeasname()); + ioOrderDetailResultData.put("spec", ioOrderDetailResultResponse.getSpec() == null ? ' ' : ioOrderDetailResultResponse.getSpec()); + ioOrderDetailResultData.put("price", ioOrderDetailResultResponse.getPrice() == null ? ' ' : ioOrderDetailResultResponse.getPrice()); + ioOrderDetailResultData.put("count", ioOrderDetailResultResponse.getCount()); + ioOrderDetailResultData.put("reCount",ioOrderDetailResultResponse.getReCount()); + ioOrderDetailResultData.put("inCount", ioOrderDetailResultResponse.getInCount()); + ioOrderDetailResultData.put("acceptCount", ioOrderDetailResultResponse.getAcceptCount()); + ioOrderDetailResultData.put("fromCorpName", ioOrderDetailResultResponse.getFromCorpName() == null ? ' ' : ioOrderDetailResultResponse.getFromCorpName()); + ioOrderDetailResultData.put("billTypeName", ioOrderDetailResultResponse.getBillTypeName() == null ? ' ' : ioOrderDetailResultResponse.getBillTypeName()); + ioOrderDetailResultData.put("mainAction", ioOrderDetailResultResponse.getMainAction() == null ? ' ' : ioOrderDetailResultResponse.getMainAction()); + ioOrderDetailResultData.put("auditTime", ioOrderDetailResultResponse.getAuditTime() == null ? ' ' : formatter.format(ioOrderDetailResultResponse.getAuditTime())); + list.add(ioOrderDetailResultData); + i++; + } + + String param = JSON.toJSONString(list); + JasperUtils.jasperReport(request, response, param, filePath+"pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf"); + return ResultVOUtils.success(); + } + } diff --git a/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java b/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java index c7e8e823..b64f4696 100644 --- a/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java +++ b/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java @@ -1,5 +1,6 @@ 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.annotation.Log; @@ -12,6 +13,7 @@ import com.glxp.api.entity.inv.InnerOrderEntity; import com.glxp.api.entity.inv.InvInnerOrderPrintEntity; import com.glxp.api.entity.inv.InvInnerOrderPdfTempEntity; import com.glxp.api.entity.system.SysPdfTemplateRelevanceLabelEntity; +import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; import com.glxp.api.entity.system.SystemPDFModuleEntity; import com.glxp.api.entity.system.SystemPDFTemplateEntity; import com.glxp.api.req.inout.InspectionPDFTemplateRequest; @@ -173,7 +175,7 @@ public class InvInnerOrderPrintController { innerOrderPdfTempService.insertStockPrintTempEntity(stockPrintTempEntity); stockPrintTempEntities.add(stockPrintTempEntity); } - jaspaperService.printPdfLocal(splits, stockPrintTempEntities, systemPDFTemplateEntity.getPath()); + jaspaperService.printPdfLocal(splits, stockPrintTempEntities, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath()); PageInfo pageInfo; pageInfo = new PageInfo<>(stockPrintTempEntities); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); @@ -184,7 +186,7 @@ public class InvInnerOrderPrintController { } else { Map data = new HashMap(); data.put("data", printEntities); - JasperUtils.jasperReport(request, response, data, filePath + "/pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf"); + JasperUtils.jasperReport(request, response, data, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); } @@ -219,6 +221,94 @@ public class InvInnerOrderPrintController { } + + //-----------打印码 + @AuthRuleAnnotation("") + @PostMapping("/udiwms/pdf/template/inspection/stock/qrcode/text/statement/file") + public BaseResponse inspectionStockQRCodeTextPDFFromTemplateStatementFile( + @RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) throws Exception { + + //查询模板文件是否存在 + SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(inspectionPDFTemplateRequest.getLabelId()+""); + if (null == sysPdfTemplateRelevanceStatemenEntity) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误"); + } + + SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceStatemenEntity.getTemplateId())); + if (null == systemPDFTemplateEntity) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误"); + } + return ResultVOUtils.success(sysPdfTemplateRelevanceStatemenEntity.getTemplateId()); + } + + @AuthRuleAnnotation("") + @PostMapping("/udiwms/pdf/template/stock/qrcode/text/statement/file") + public BaseResponse stockQRCodeTextPDFFromTemplateStatementFile( + @RequestBody InnerOrderQRCodeTextPDFTemplateRequest stockQRCodeTextPDFTemplateRequest, + HttpServletRequest request, HttpServletResponse response) throws Exception { + + SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(stockQRCodeTextPDFTemplateRequest.getLabelId()+""); + if (sysPdfTemplateRelevanceStatemenEntity == null) return ResultVOUtils.error(500, "未找到单据模板模块设置,请检查"); + + SystemPDFTemplateEntity systemPDFTemplateEntity = + systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceStatemenEntity.getTemplateId())); + if (systemPDFTemplateEntity == null) return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误"); + + List printEntities = new ArrayList<>(); + List mStockPrintEntities = new ArrayList<>(); + FilterinnerOrderprintRequest filterinnerOrderprintRequest = new FilterinnerOrderprintRequest(); + if (stockQRCodeTextPDFTemplateRequest.getOrderId() != null) { + filterinnerOrderprintRequest.setSOrderId(stockQRCodeTextPDFTemplateRequest.getOrderId()); + } else { + filterinnerOrderprintRequest.setId(stockQRCodeTextPDFTemplateRequest.getQueryId()); + } + List stockPrintEntities = invInnerOrderPrintService.filterJoinInnerPrint(filterinnerOrderprintRequest); + if (stockPrintEntities != null && stockPrintEntities.size() > 0) { + mStockPrintEntities.addAll(stockPrintEntities); + } + for (InnerOrderPrintResponse InnerOrderPrintResponse : mStockPrintEntities) { + PdfPrintCountEntity pdfPrintCount = getCount(stockQRCodeTextPDFTemplateRequest.getCountList(), InnerOrderPrintResponse); + if (pdfPrintCount != null && pdfPrintCount.getRowCount() > 0) { + for (int i = 0; i < pdfPrintCount.getRowCount(); i++) { + InnerOrderPrintResponse clone = new InnerOrderPrintResponse(); + BeanUtils.copyProperties(InnerOrderPrintResponse, clone); + printEntities.add(clone); + } + } else { + printEntities.add(InnerOrderPrintResponse); + } + } + + + String param = JSON.toJSONString(printEntities); + JasperUtils.jasperReport(request, response, param, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); + + String orderId = ""; + for (InnerOrderPrintResponse InnerOrderPrintResponse : mStockPrintEntities) { + InvInnerOrderPrintEntity innerOrderPrintEntity = new InvInnerOrderPrintEntity(); + innerOrderPrintEntity.setStatus(1); + innerOrderPrintEntity.setId(InnerOrderPrintResponse.getId()); + invInnerOrderPrintService.updateOrder(innerOrderPrintEntity); + orderId = InnerOrderPrintResponse.getId() + ""; + } + + //查询订单id + InvInnerOrderPrintEntity innerOrderPrintEntity = invInnerOrderPrintService.selectById(orderId); + //更新内部码状态 + InnerOrderEntity innerOrderEntity = innerOrderService.findByRecordKey(innerOrderPrintEntity.getOrderIdFk()); + if (innerOrderEntity != null) { + innerOrderEntity.setGenStatus(2); + innerOrderEntity.setId(innerOrderEntity.getId()); + innerOrderService.update(innerOrderEntity); + } + IoOrderEntity ioOrderEntity = new IoOrderEntity(); + ioOrderEntity.setInCodeStatus(1); + ioOrderEntity.setBillNo(innerOrderPrintEntity.getOrderIdFk()); + ioOrderService.updateByBillNo(ioOrderEntity); + return null; + + } + public PdfPrintCountEntity getCount(List countList, InnerOrderPrintResponse InnerOrderPrintResponse) { for (PdfPrintCountEntity pdfPrintCount : countList) { if (pdfPrintCount.getQueryId().equals(InnerOrderPrintResponse.getId() + "")) { diff --git a/src/main/java/com/glxp/api/req/inout/FilterOrderDetailResultRequest.java b/src/main/java/com/glxp/api/req/inout/FilterOrderDetailResultRequest.java index 700c315c..f27320f3 100644 --- a/src/main/java/com/glxp/api/req/inout/FilterOrderDetailResultRequest.java +++ b/src/main/java/com/glxp/api/req/inout/FilterOrderDetailResultRequest.java @@ -1,5 +1,6 @@ package com.glxp.api.req.inout; +import com.glxp.api.res.inout.IoOrderDetailResultResponse; import com.glxp.api.util.page.ListPageRequest; import lombok.Data; @@ -43,7 +44,9 @@ public class FilterOrderDetailResultRequest extends ListPageRequest { private String endAduditTime; //结束日期 private String fromCorp; private String actionType; + private String templateId; private String manufacturer; private String zczbhhzbapzbh; private List actions; + private List list; } diff --git a/src/main/java/com/glxp/api/res/inout/IoOrderDetailResultResponse.java b/src/main/java/com/glxp/api/res/inout/IoOrderDetailResultResponse.java index 2c079da3..56e2da9f 100644 --- a/src/main/java/com/glxp/api/res/inout/IoOrderDetailResultResponse.java +++ b/src/main/java/com/glxp/api/res/inout/IoOrderDetailResultResponse.java @@ -3,6 +3,7 @@ package com.glxp.api.res.inout; import lombok.Data; import java.math.BigDecimal; +import java.util.Date; /** * 单据扫码明细VO @@ -159,6 +160,7 @@ public class IoOrderDetailResultResponse { private String fromCorpName; private String billTypeName; private String mainAction; + private Date auditTime; } From 43571f316c12ab94861918d41deee9e23bd8393c Mon Sep 17 00:00:00 2001 From: schry <2433098676@qq.com> Date: Tue, 16 May 2023 18:01:33 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=B5=84=E8=B4=A8=E8=AF=81=E4=B9=A6=E6=8F=90=E7=A4=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/controller/purchase/SupCertController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java index 73115e77..6aa9670d 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java @@ -305,7 +305,7 @@ public class SupCertController { if (postSupCertRequest.getVailDate() != null && postSupCertRequest.getExpireDate() != null) { if (postSupCertRequest.getVailDate().getTime() > postSupCertRequest.getExpireDate().getTime()) { - return ResultVOUtils.error(999, "生效期不能小于失效期!"); + return ResultVOUtils.error(999, "失效期不能小于生效期!"); } } From cfc32f6bdc7ce0da75df7b1378ff2c78c1017e89 Mon Sep 17 00:00:00 2001 From: schry <2433098676@qq.com> Date: Wed, 17 May 2023 11:58:09 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=9C=AC=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E8=B5=84=E8=B4=A8=E8=AF=81=E4=B9=A6=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/controller/purchase/SupCertController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java index 6aa9670d..1de6dcae 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java @@ -241,6 +241,11 @@ public class SupCertController { supCertEntity.setUpdateTime(new Date()); supCertEntity.setStatus(0); supCertEntity.setId(IdUtil.getSnowflakeNextId()); + if (supCertEntity.getVailDate() != null && supCertEntity.getExpireDate() != null) { + if (supCertEntity.getVailDate().getTime() > supCertEntity.getExpireDate().getTime()) { + return ResultVOUtils.error(999, "失效期不能小于生效期!"); + } + } boolean b = supCertService.insertCompanyCert(supCertEntity); return ResultVOUtils.success("成功"); } From 36602ee0e63057001b04e53f121b2e274dc79f1e Mon Sep 17 00:00:00 2001 From: schry <2433098676@qq.com> Date: Wed, 17 May 2023 14:24:22 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=85=A5=E9=99=A2=E7=89=A9=E8=B5=84?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E6=A8=A1=E5=9D=97=E9=80=89=E5=85=A5=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=AD=97=E6=AE=B5=E5=90=8D=E7=A7=B0=E4=B8=8D=E4=B8=80?= =?UTF-8?q?=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/glxp/api/util/SupplementVailUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/util/SupplementVailUtil.java b/src/main/java/com/glxp/api/util/SupplementVailUtil.java index 17912680..7ac1aea6 100644 --- a/src/main/java/com/glxp/api/util/SupplementVailUtil.java +++ b/src/main/java/com/glxp/api/util/SupplementVailUtil.java @@ -54,7 +54,7 @@ public class SupplementVailUtil { basicProductSetEntity = basicProductSetEntityMap.get("manufactory"); if (isMustFill(type, basicProductSetEntity)) { if (StrUtil.isEmptyIfStr(supplementRequest.getManufactory())) { - return "生产厂家不能为空"; + return "生产企业不能为空"; } }