diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/info/SystemPDFTemplateController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/info/SystemPDFTemplateController.java index 4fd4e5d9..e10d7005 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/info/SystemPDFTemplateController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/info/SystemPDFTemplateController.java @@ -69,10 +69,13 @@ public class SystemPDFTemplateController { String data = ""; if (systemPDFTemplateEntity.getModule() == 2) { data = - "{\"data\":[{\"batchNo\":\"2020\",\"billNo\":\"2022040811589\",\"billType\":\"ST39730635520\",\"billdate\":\"2022-04-08\",\"corpId\":\"39864007581\",\"corpName\":\"漳州**有限公司\",\"count\":\"4\",\"customerId\":\"39864007581\",\"expireDate\":\"251020\",\"id\":\"10\",\"index\":\"1\",\"locInv\":\"总库\",\"orderIdFk\":\"SM412208685600\",\"printStatus\":\"102\",\"productDate\":\"201020\",\"productId\":\"169\",\"productName\":\"一次性使用开环式微创肛肠吻合器\",\"sourceType\":\"1\",\"spec\":\"TST33-T80——2993规格\",\"status\":\"5\",\"sweepCount\":\"0\",\"title\":\"漳州**医院\",\"type\":\"2\",\"unitIdFk\":\"39864007581\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"苏械注准2022000000\",\"price\":\"10.00\",\"maintenanceStatus\":\"已养护\",\"code\":\"0106972825505180112101241725012421x003\",\"orderId\":\"DMA202212300022\",\"createTime\":\"2022-12-30 11:06:43\",\"createUser\":\"超级用户\",\"remark\":\"备注\",\"productName\":\"裂解仪\",\"deviceStatus\":\"正常\",\"auditUser\":\"超级用户\"},{\"batchNo\":\"2023\",\"billNo\":\"2022040811589\",\"billType\":\"ST39730635520\",\"billdate\":\"2022-04-08\",\"corpId\":\"39864007581\",\"corpName\":\"漳州**有限公司\",\"count\":\"4\",\"customerId\":\"39864007581\",\"expireDate\":\"251020\",\"id\":\"10\",\"index\":\"2\",\"locInv\":\"总库\",\"orderIdFk\":\"SM412208685600\",\"printStatus\":\"102\",\"productDate\":\"201020\",\"productId\":\"169\",\"productName\":\"一次性使用开环式微创肛肠吻合器\",\"sourceType\":\"1\",\"spec\":\"TST33-T80——2993规格\",\"status\":\"5\",\"sweepCount\":\"0\",\"title\":\"漳州**医院\",\"type\":\"2\",\"unitIdFk\":\"39864007581\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"苏械注准2022000000\",\"price\":\"10.00\",\"maintenanceStatus\":\"已养护\",\"code\":\"0106972825505180112101241725012421x003\",\"orderId\":\"DMA202212300022\",\"createTime\":\"2022-12-30 11:06:43\",\"createUser\":\"超级用户\",\"remark\":\"备注\",\"productName\":\"裂解仪\",\"deviceStatus\":\"正常\",\"auditUser\":\"超级用户\"},{\"batchNo\":\"2021\",\"billNo\":\"2022040811589\",\"billType\":\"ST39730635520\",\"billdate\":\"2022-04-08\",\"corpId\":\"39864007581\",\"corpName\":\"漳州**有限公司\",\"count\":\"4\",\"customerId\":\"39864007581\",\"expireDate\":\"251020\",\"id\":\"10\",\"index\":\"3\",\"locInv\":\"总库\",\"orderIdFk\":\"SM412208685600\",\"printStatus\":\"102\",\"productDate\":\"201020\",\"productId\":\"169\",\"productName\":\"一次性使用开环式微创肛肠吻合器\",\"sourceType\":\"1\",\"spec\":\"TST33-T80——2993规格\",\"status\":\"5\",\"sweepCount\":\"0\",\"title\":\"漳州**医院\",\"type\":\"2\",\"unitIdFk\":\"39864007581\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"苏械注准2022000000\",\"price\":\"10.00\",\"maintenanceStatus\":\"已养护\",\"code\":\"0106972825505180112101241725012421x003\",\"orderId\":\"DMA202212300022\",\"createTime\":\"2022-12-30 11:06:43\",\"createUser\":\"超级用户\",\"remark\":\"备注\",\"productName\":\"裂解仪\",\"deviceStatus\":\"正常\",\"auditUser\":\"超级用户\"}]}"; + "{\"data\":[{\"batchNo\":\"2020\",\"billNo\":\"2022040811589\",\"billType\":\"ST39730635520\",\"billdate\":\"2022-04-08\",\"corpId\":\"39864007581\",\"corpName\":\"漳州**有限公司\",\"count\":\"4\",\"customerId\":\"39864007581\",\"expireDate\":\"251020\",\"id\":\"10\",\"index\":\"1\",\"locInv\":\"总库\",\"orderIdFk\":\"SM412208685600\",\"printStatus\":\"102\",\"productDate\":\"201020\",\"productId\":\"169\",\"productName\":\"一次性使用开环式微创肛肠吻合器\",\"sourceType\":\"1\",\"spec\":\"TST33-T80——2993规格\",\"status\":\"5\",\"sweepCount\":\"0\",\"title\":\"漳州**医院\",\"type\":\"2\",\"unitIdFk\":\"39864007581\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"苏械注准2022000000\",\"price\":\"10.00\"},{\"batchNo\":\"2023\",\"billNo\":\"2022040811589\",\"billType\":\"ST39730635520\",\"billdate\":\"2022-04-08\",\"corpId\":\"39864007581\",\"corpName\":\"漳州**有限公司\",\"count\":\"4\",\"customerId\":\"39864007581\",\"expireDate\":\"251020\",\"id\":\"10\",\"index\":\"2\",\"locInv\":\"总库\",\"orderIdFk\":\"SM412208685600\",\"printStatus\":\"102\",\"productDate\":\"201020\",\"productId\":\"169\",\"productName\":\"一次性使用开环式微创肛肠吻合器\",\"sourceType\":\"1\",\"spec\":\"TST33-T80——2993规格\",\"status\":\"5\",\"sweepCount\":\"0\",\"title\":\"漳州**医院\",\"type\":\"2\",\"unitIdFk\":\"39864007581\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"苏械注准2022000000\",\"price\":\"10.00\"},{\"batchNo\":\"2021\",\"billNo\":\"2022040811589\",\"billType\":\"ST39730635520\",\"billdate\":\"2022-04-08\",\"corpId\":\"39864007581\",\"corpName\":\"漳州**有限公司\",\"count\":\"4\",\"customerId\":\"39864007581\",\"expireDate\":\"251020\",\"id\":\"10\",\"index\":\"3\",\"locInv\":\"总库\",\"orderIdFk\":\"SM412208685600\",\"printStatus\":\"102\",\"productDate\":\"201020\",\"productId\":\"169\",\"productName\":\"一次性使用开环式微创肛肠吻合器\",\"sourceType\":\"1\",\"spec\":\"TST33-T80——2993规格\",\"status\":\"5\",\"sweepCount\":\"0\",\"title\":\"漳州**医院\",\"type\":\"2\",\"unitIdFk\":\"39864007581\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"苏械注准2022000000\",\"price\":\"10.00\",\"maintenanceStatus\":\"已养护\",\"code\":\"0106972825505180112101241725012421x003\",\"orderId\":\"DMA202212300022\",\"createTime\":\"2022/12/30 11:06:43\",\"createUser\":\"超级用户\",\"remark\":\"备注\",\"productName\":\"裂解仪\",\"deviceStatus\":\"正常\"}]}"; } else if (systemPDFTemplateEntity.getModule() == 0) { data = - "{\"data\":[{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\",\"orderId\":\"MP202212200001\"},{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\",\"orderId\":\"MP202212200001\"},{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\",\"orderId\":\"MP202212200001\"},{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\",\"orderId\":\"MP202212200001\"},{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\",\"orderId\":\"MP202212200001\"},{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\",\"orderId\":\"MP202212200001\"}]}"; + "{\"data\":[{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\"},{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\"},{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\"},{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\"},{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\"},{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\",\"orderId\":\"MP202212200001\"}]}"; + } else if (systemPDFTemplateEntity.getModule() == 1) { + data = + "[{\"area\":\"北京市市辖区东城区\",\"vaiDate\":\"2023-01-20\",\"code\":\"2222\",\"companyName\":\"小郑哈哈\",\"classes\":\"2\",\"filePath\":\"https://img.tt98.com/d/file/tt98/20200409112430681/a722ac1a6e.jpg\",\"mobile\":\"444\",\"index\":\"1\",\"remark\":\" \",\"detailAddr\":\"333\",\"name\":\"111\",\"creditNum\":\"2222\",\"auditStatus\":\"1\",\"expireDate\":\"2023-01-18\",\"contacts\":\"333\",\"email\":\"455\",\"status\":\"0\"},{\"area\":\"北京市市辖区东城区\",\"vaiDate\":\"2022-11-10\",\"code\":\"534535\",\"companyName\":\"小郑哈哈\",\"classes\":\"2\",\"filePath\":\"https://img0.baidu.com/it/u=2039887338,4134952980&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=705\",\"mobile\":\"444\",\"index\":\"2\",\"remark\":\"5435353\",\"detailAddr\":\"333\",\"name\":\"海关检测报告\",\"creditNum\":\"2222\",\"auditStatus\":\"1\",\"expireDate\":\"2022-11-25\",\"contacts\":\"333\",\"email\":\"455\",\"status\":\"0\"}]"; } JasperUtils.jasperReport(request, response, data, systemPDFTemplateEntity.getPath(), "pdf"); diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/purchase/SupCertController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/purchase/SupCertController.java index abb2316e..1b41dba1 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/purchase/SupCertController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/purchase/SupCertController.java @@ -2,24 +2,35 @@ package com.glxp.api.admin.controller.purchase; 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.admin.annotation.AuthRuleAnnotation; import com.glxp.api.admin.constant.ConstantStatus; import com.glxp.api.admin.entity.auth.AuthAdmin; +import com.glxp.api.admin.entity.info.SystemPDFModuleEntity; +import com.glxp.api.admin.entity.info.SystemPDFTemplateEntity; +import com.glxp.api.admin.entity.inout.WarehouseUserEntity; import com.glxp.api.admin.entity.purchase.*; import com.glxp.api.admin.exception.JsonException; import com.glxp.api.admin.req.info.CompanyRequest; import com.glxp.api.admin.req.info.DeleteCompanyFileRequest; +import com.glxp.api.admin.req.info.SystemPDFModuleRequest; +import com.glxp.api.admin.req.inventory.InvCountOrderPrintRequest; +import com.glxp.api.admin.req.itextpdf.InspectionPDFTemplateRequest; import com.glxp.api.admin.req.purchase.FilterSupCertRequest; import com.glxp.api.admin.req.purchase.PostSelCertRequest; import com.glxp.api.admin.req.purchase.PostSupCertRequest; +import com.glxp.api.admin.req.purchase.purPlanPrintRequest; import com.glxp.api.admin.res.PageSimpleResponse; import com.glxp.api.admin.res.purchase.SupProductResponse; import com.glxp.api.admin.service.auth.AuthAdminService; +import com.glxp.api.admin.service.info.SystemPDFModuleService; +import com.glxp.api.admin.service.info.SystemPDFTemplateService; import com.glxp.api.admin.service.purchase.SupCertService; import com.glxp.api.admin.service.purchase.SupCompanyService; import com.glxp.api.admin.service.purchase.SupManufacturerService; import com.glxp.api.admin.service.purchase.SupProductService; +import com.glxp.api.admin.util.JasperUtils; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; @@ -35,9 +46,11 @@ import org.springframework.web.context.request.ServletRequestAttributes; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.io.File; -import java.util.Date; -import java.util.List; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; @RestController public class SupCertController { @@ -49,6 +62,12 @@ public class SupCertController { @Value("${file_path}") private String filePath; + @Resource + private SystemPDFTemplateService systemPDFTemplateService; + @Resource + private SystemPDFModuleService systemPDFModuleService; + + @AuthRuleAnnotation("") @GetMapping("/sup/company/cert/filter") public BaseResponse filterCompanyCert(FilterSupCertRequest filterSupCertRequest, @@ -190,4 +209,123 @@ public class SupCertController { AuthAdmin authAdmin = authAdminService.findById(Long.parseLong(userId)); return authAdmin.getCustomerId() + ""; } + + /** + * 校验模板文件 + * + * @param inspectionPDFTemplateRequest + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/sup/info/verifyTemplateFile") + public BaseResponse verifyTemplateFile(@RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) { + if (null == inspectionPDFTemplateRequest) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!"); + } + //查询模板文件是否存在 + SystemPDFModuleRequest systemPDFModuleRequest = new SystemPDFModuleRequest(); + systemPDFModuleRequest.setId(inspectionPDFTemplateRequest.getModuleId()); + SystemPDFModuleEntity systemPDFModule = systemPDFModuleService.findSystemPDFModule(systemPDFModuleRequest); + if (null == systemPDFModule) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误"); + } + + SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(systemPDFModule.getTemplateId())); + if (null == systemPDFTemplateEntity) { + return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误"); + } + return ResultVOUtils.success(systemPDFModule.getTemplateId()); + } + + /** + * 打印模板单号标签 + * + * @param purPlanPrintRequest + * @param request + * @param response + * @throws Exception + */ + @AuthRuleAnnotation("") + @PostMapping("/sup/info/printOrder") + public void printOrder(@RequestBody purPlanPrintRequest purPlanPrintRequest, HttpServletRequest request, HttpServletResponse response) throws Exception { + SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(purPlanPrintRequest.getTemplateId()); + //打印单号标签 + Map data = new HashMap<>(1); + List list=new ArrayList<>(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式 + + + //查询配送企业信息 + SupCompanyEntity supCompanyEntity=supCompanyService.findCompany(purPlanPrintRequest.getCustomerId()); + //查询详情 + List selectSupCertList=supCertService.selectSupCertList(purPlanPrintRequest); + int i=1; + if(selectSupCertList!=null && selectSupCertList.size()>0){ + for(SupCertEntity obj:selectSupCertList){ + //组装数据 + Map supData=new HashMap<>(); + supData.put("companyName",supCompanyEntity.getCompanyName()==null ? ' ' :supCompanyEntity.getCompanyName()); + supData.put("creditNum",supCompanyEntity.getCreditNum()==null ? ' ' :supCompanyEntity.getCreditNum()); + supData.put("classes",supCompanyEntity.getClasses()==null ? ' ' :supCompanyEntity.getClasses()); + supData.put("area",supCompanyEntity.getArea()==null ? ' ' :supCompanyEntity.getArea()); + supData.put("contacts",supCompanyEntity.getContacts()==null ? ' ' :supCompanyEntity.getContacts()); + supData.put("detailAddr",supCompanyEntity.getDetailAddr()==null ? ' ' :supCompanyEntity.getDetailAddr()); + supData.put("mobile",supCompanyEntity.getMobile()==null ? ' ' :supCompanyEntity.getMobile()); + supData.put("email",supCompanyEntity.getEmail()==null ? ' ' :supCompanyEntity.getEmail()); + supData.put("index",String.valueOf(i)); + supData.put("name",obj.getName()==null ? ' ' :obj.getName()); + supData.put("code",obj.getCode()==null ? ' ' :obj.getCode()); + supData.put("vaiDate",formatter.format(obj.getVailDate())); + supData.put("expireDate",formatter.format(obj.getExpireDate())); + supData.put("status",obj.getStatus()==0 ? "启用" : "禁用"); + supData.put("auditStatus",getAuditStatus(obj.getAuditStatus())); + supData.put("remark",obj.getRemark()==null ? ' ' :obj.getRemark()); + supData.put("filePath","d:/1s/udiwms/register/file/image2/" + obj.getFilePath()); + list.add(supData); + i++; + } + } + + String param= JSON.toJSONString(list); + JasperUtils.jasperReport(request, response, param, systemPDFTemplateEntity.getPath(), "pdf"); + } + + /** + * 获取详情ids + * + * @param filterSupCertRequest + * @return + */ + @AuthRuleAnnotation("") + @PostMapping("/sup/info/filterCompanyCertIdList") + public BaseResponse filterCompanyCertIdList(@RequestBody FilterSupCertRequest filterSupCertRequest) { + + if(StrUtil.isNotEmpty(filterSupCertRequest.getCustomerId()) && filterSupCertRequest.getType()!=null){ + List supCertEntityList=supCertService.filterCompanyCert(filterSupCertRequest); + List idsList=supCertEntityList .stream().map(SupCertEntity::getId).distinct().collect(Collectors.toList()); + return ResultVOUtils.success(idsList); + } + return ResultVOUtils.error(999,"参数错误"); + } + + + public String getAuditStatus(int type){ + + if(type==0){ + return "草稿"; + }else if(type==1){ + return "审核通过"; + }else if(type==2){ + return "审核不通过"; + }else if(type==3){ + return "申请变更"; + }else if(type==4){ + return "申请变更通过"; + }else if(type==5){ + return "申请变更不通过"; + }else if(type==6){ + return "已提交未审核"; + } + return ""; + } } diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/purchase/SupCompanyController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/purchase/SupCompanyController.java index 6fc4a0ef..8ec8f2a7 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/purchase/SupCompanyController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/purchase/SupCompanyController.java @@ -8,24 +8,29 @@ import com.glxp.api.admin.annotation.AuthRuleAnnotation; import com.glxp.api.admin.constant.ConstantStatus; import com.glxp.api.admin.entity.auth.AuthAdmin; import com.glxp.api.admin.entity.basic.BasicUnitMaintainEntity; +import com.glxp.api.admin.entity.info.SystemPDFModuleEntity; +import com.glxp.api.admin.entity.info.SystemPDFTemplateEntity; import com.glxp.api.admin.entity.purchase.CustomerContactEntity; import com.glxp.api.admin.entity.purchase.SupCertEntity; import com.glxp.api.admin.entity.purchase.SupCertSetEntity; import com.glxp.api.admin.entity.purchase.SupCompanyEntity; import com.glxp.api.admin.exception.JsonException; +import com.glxp.api.admin.req.info.SystemPDFModuleRequest; import com.glxp.api.admin.req.inout.DeleteRequest; -import com.glxp.api.admin.req.purchase.FilterCertSetsRequest; -import com.glxp.api.admin.req.purchase.FilterSupCertRequest; -import com.glxp.api.admin.req.purchase.FilterSupCompanyRequest; -import com.glxp.api.admin.req.purchase.SelectCorpBindRequest; +import com.glxp.api.admin.req.inventory.InvCountOrderPrintRequest; +import com.glxp.api.admin.req.itextpdf.InspectionPDFTemplateRequest; +import com.glxp.api.admin.req.purchase.*; import com.glxp.api.admin.res.PageSimpleResponse; import com.glxp.api.admin.service.auth.AuthAdminService; import com.glxp.api.admin.service.basic.BasicUnitMaintainService; +import com.glxp.api.admin.service.info.SystemPDFModuleService; +import com.glxp.api.admin.service.info.SystemPDFTemplateService; import com.glxp.api.admin.service.purchase.SupCertService; import com.glxp.api.admin.service.purchase.CustomerContactService; import com.glxp.api.admin.service.purchase.SupCertSetService; import com.glxp.api.admin.service.purchase.SupCompanyService; import com.glxp.api.admin.util.CustomUtil; +import com.glxp.api.admin.util.JasperUtils; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; @@ -39,9 +44,10 @@ import org.springframework.web.context.request.ServletRequestAttributes; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.List; -import java.util.ListIterator; +import javax.servlet.http.HttpServletResponse; +import java.text.SimpleDateFormat; +import java.util.*; +import com.alibaba.fastjson.JSON; @RestController public class SupCompanyController { @@ -64,6 +70,7 @@ public class SupCompanyController { @Resource SupCompanyService supCompanyService; + @AuthRuleAnnotation("") @GetMapping("/api/pur/getSupComapnys") public BaseResponse getSupComapnys(FilterSupCompanyRequest companyRequest) { diff --git a/api-admin/src/main/java/com/glxp/api/admin/dao/purchase/SupCertDao.java b/api-admin/src/main/java/com/glxp/api/admin/dao/purchase/SupCertDao.java index 50a59fa1..8cb204f3 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/dao/purchase/SupCertDao.java +++ b/api-admin/src/main/java/com/glxp/api/admin/dao/purchase/SupCertDao.java @@ -1,7 +1,9 @@ package com.glxp.api.admin.dao.purchase; import com.glxp.api.admin.entity.purchase.SupCertEntity; +import com.glxp.api.admin.entity.purchase.SupCertSetEntity; import com.glxp.api.admin.req.purchase.FilterSupCertRequest; +import com.glxp.api.admin.req.purchase.purPlanPrintRequest; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -35,4 +37,6 @@ public interface SupCertDao { boolean deleteCert(FilterSupCertRequest filterSupCertRequest); + List selectSupCertList(purPlanPrintRequest purPlanPrintRequest); + } diff --git a/api-admin/src/main/java/com/glxp/api/admin/dao/purchase/SupCertSetDao.java b/api-admin/src/main/java/com/glxp/api/admin/dao/purchase/SupCertSetDao.java index c6091ea3..54717359 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/dao/purchase/SupCertSetDao.java +++ b/api-admin/src/main/java/com/glxp/api/admin/dao/purchase/SupCertSetDao.java @@ -1,7 +1,9 @@ package com.glxp.api.admin.dao.purchase; +import com.glxp.api.admin.entity.purchase.SupCertEntity; import com.glxp.api.admin.entity.purchase.SupCertSetEntity; import com.glxp.api.admin.req.purchase.FilterCertSetsRequest; +import com.glxp.api.admin.req.purchase.purPlanPrintRequest; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -18,4 +20,6 @@ public interface SupCertSetDao { boolean deleteById(String id); boolean deleteAll(); + + } diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/purchase/purPlanPrintRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/purchase/purPlanPrintRequest.java new file mode 100644 index 00000000..3599d8d3 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/req/purchase/purPlanPrintRequest.java @@ -0,0 +1,28 @@ +package com.glxp.api.admin.req.purchase; + +import lombok.Data; + +import java.util.List; + +/** + * 盘点单据打印参数 + */ +@Data +public class purPlanPrintRequest { + + /** + * 打印id + */ + private List ids; + + /** + * 模板ID + */ + private String templateId; + + /** + * 用户id + */ + private String customerId; + +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/purchase/SupCertService.java b/api-admin/src/main/java/com/glxp/api/admin/service/purchase/SupCertService.java index 4d1fa69c..3aa1b4c9 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/purchase/SupCertService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/purchase/SupCertService.java @@ -2,7 +2,9 @@ package com.glxp.api.admin.service.purchase; import com.glxp.api.admin.entity.purchase.SupCertEntity; +import com.glxp.api.admin.entity.purchase.SupCertSetEntity; import com.glxp.api.admin.req.purchase.FilterSupCertRequest; +import com.glxp.api.admin.req.purchase.purPlanPrintRequest; import java.util.List; @@ -38,4 +40,8 @@ public interface SupCertService { boolean delManufacturerId(String customerId, String manufacturerId); boolean delProductId(String customerId, String manufacturerId, String productId); + + List selectSupCertList(purPlanPrintRequest purPlanPrintRequest); + + } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/purchase/SupCertSetService.java b/api-admin/src/main/java/com/glxp/api/admin/service/purchase/SupCertSetService.java index 6356dbcf..1f284794 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/purchase/SupCertSetService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/purchase/SupCertSetService.java @@ -3,6 +3,7 @@ package com.glxp.api.admin.service.purchase; import com.glxp.api.admin.entity.purchase.SupCertSetEntity; import com.glxp.api.admin.req.purchase.FilterCertSetsRequest; +import com.glxp.api.admin.req.purchase.purPlanPrintRequest; import java.util.List; @@ -19,4 +20,5 @@ public interface SupCertSetService { boolean deleteAll(); + } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/purchase/impl/SupCertServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/purchase/impl/SupCertServiceImpl.java index a592e0b7..f6c218c5 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/purchase/impl/SupCertServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/purchase/impl/SupCertServiceImpl.java @@ -6,6 +6,7 @@ import com.glxp.api.admin.constant.ConstantStatus; import com.glxp.api.admin.dao.purchase.SupCertDao; import com.glxp.api.admin.entity.purchase.SupCertEntity; import com.glxp.api.admin.req.purchase.FilterSupCertRequest; +import com.glxp.api.admin.req.purchase.purPlanPrintRequest; import com.glxp.api.admin.service.purchase.SupCertService; import org.springframework.stereotype.Service; @@ -151,4 +152,9 @@ public class SupCertServiceImpl implements SupCertService { } return false; } + + @Override + public List selectSupCertList(purPlanPrintRequest purPlanPrintRequest) { + return supCertDao.selectSupCertList(purPlanPrintRequest); + } } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/purchase/impl/SupCertSetServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/purchase/impl/SupCertSetServiceImpl.java index c5c03487..b6ce138b 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/purchase/impl/SupCertSetServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/purchase/impl/SupCertSetServiceImpl.java @@ -4,6 +4,7 @@ import com.github.pagehelper.PageHelper; import com.glxp.api.admin.dao.purchase.SupCertSetDao; import com.glxp.api.admin.entity.purchase.SupCertSetEntity; import com.glxp.api.admin.req.purchase.FilterCertSetsRequest; +import com.glxp.api.admin.req.purchase.purPlanPrintRequest; import com.glxp.api.admin.service.purchase.SupCertSetService; import org.springframework.stereotype.Service; @@ -50,4 +51,5 @@ public class SupCertSetServiceImpl implements SupCertSetService { public boolean deleteAll() { return supCertSetDao.deleteAll(); } + } diff --git a/api-admin/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml b/api-admin/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml index 6b8253c7..4e8d7689 100644 --- a/api-admin/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml @@ -155,4 +155,19 @@ + + + \ No newline at end of file diff --git a/api-admin/src/main/resources/mybatis/mapper/purchase/SupCertSetDao.xml b/api-admin/src/main/resources/mybatis/mapper/purchase/SupCertSetDao.xml index 2a6c88c9..07334922 100644 --- a/api-admin/src/main/resources/mybatis/mapper/purchase/SupCertSetDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/purchase/SupCertSetDao.xml @@ -66,4 +66,6 @@ DELETE FROM sup_cert_set + + \ No newline at end of file