From cec467a4be2694d520dbd1bd864c394219f722e0 Mon Sep 17 00:00:00 2001 From: x_z Date: Thu, 15 Sep 2022 23:09:07 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=89=93=E5=8D=B0=E6=A8=A1=E6=9D=BF=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=AE=A2=E6=88=B7ID=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E5=85=B3=E8=81=94=E6=89=80=E5=B1=9E=E5=AE=A2=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/info/CompanyController.java | 14 +++++++++ .../udi/admin/entity/info/CompanyEntity.java | 27 ++++++++++------ .../entity/param/SystemPDFTemplateEntity.java | 8 +++++ .../param/SystemPDFTemplateSaveRequest.java | 5 +++ .../res/param/SystemPDFTemplateResponse.java | 5 +++ .../admin/service/info/CompanyService.java | 14 +++++++++ .../param/SystemPDFTemplateService.java | 19 ++++++------ .../mapper/param/SystemPDFTemplateDao.xml | 31 ++++++++++++------- 8 files changed, 93 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/glxp/udi/admin/controller/info/CompanyController.java b/src/main/java/com/glxp/udi/admin/controller/info/CompanyController.java index fe91a25..d133d80 100644 --- a/src/main/java/com/glxp/udi/admin/controller/info/CompanyController.java +++ b/src/main/java/com/glxp/udi/admin/controller/info/CompanyController.java @@ -32,6 +32,7 @@ import java.io.File; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; import java.util.Date; +import java.util.List; @Slf4j @RestController @@ -205,4 +206,17 @@ public class CompanyController { return ResultVOUtils.success(); } + + /** + * 查询公司列表信息 + * + * @param filterCompanyRequest + * @return + */ + @PostMapping("warehouse/info/getCompanyList") + public BaseResponse getCompanyList(@RequestBody FilterCompanyRequest filterCompanyRequest) { + List companyEntities = companyService.getCompanyList(filterCompanyRequest); + return ResultVOUtils.success(companyEntities); + } + } diff --git a/src/main/java/com/glxp/udi/admin/entity/info/CompanyEntity.java b/src/main/java/com/glxp/udi/admin/entity/info/CompanyEntity.java index 68f2fc7..dadd726 100644 --- a/src/main/java/com/glxp/udi/admin/entity/info/CompanyEntity.java +++ b/src/main/java/com/glxp/udi/admin/entity/info/CompanyEntity.java @@ -1,5 +1,6 @@ package com.glxp.udi.admin.entity.info; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -81,30 +82,38 @@ public class CompanyEntity { private String unitIdFk; + @TableField(exist = false) + private String newAuditStatus; + + @TableField(exist = false) + private String noPassCause; + + @TableField(exist = false) + private String auditor; + + @TableField(exist = false) private String filePath; + @TableField(exist = false) private String newFilePath; + @TableField(exist = false) private String filePath2; + @TableField(exist = false) private String newFilePath2; + @TableField(exist = false) private String filePath3; + @TableField(exist = false) private String newFilePath3; + @TableField(exist = false) private String filePath4; + @TableField(exist = false) private String newFilePath4; - private String updateCause; - - private String newAuditStatus; - - private String noPassCause; - - private String auditor; - - private String auditStatusList; } \ No newline at end of file diff --git a/src/main/java/com/glxp/udi/admin/entity/param/SystemPDFTemplateEntity.java b/src/main/java/com/glxp/udi/admin/entity/param/SystemPDFTemplateEntity.java index 44f30b9..6d54dbf 100644 --- a/src/main/java/com/glxp/udi/admin/entity/param/SystemPDFTemplateEntity.java +++ b/src/main/java/com/glxp/udi/admin/entity/param/SystemPDFTemplateEntity.java @@ -1,5 +1,6 @@ package com.glxp.udi.admin.entity.param; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -11,6 +12,7 @@ public class SystemPDFTemplateEntity { private int id; + @TableField("`name`") private String name; private int type; @@ -19,6 +21,7 @@ public class SystemPDFTemplateEntity { private String param; + @TableField("`path`") private String path; private int rowCount; @@ -33,4 +36,9 @@ public class SystemPDFTemplateEntity { private String jrxmlPath; + /** + * 客户ID + */ + private String customerId; + } diff --git a/src/main/java/com/glxp/udi/admin/req/param/SystemPDFTemplateSaveRequest.java b/src/main/java/com/glxp/udi/admin/req/param/SystemPDFTemplateSaveRequest.java index 6352c04..5842505 100644 --- a/src/main/java/com/glxp/udi/admin/req/param/SystemPDFTemplateSaveRequest.java +++ b/src/main/java/com/glxp/udi/admin/req/param/SystemPDFTemplateSaveRequest.java @@ -19,4 +19,9 @@ public class SystemPDFTemplateSaveRequest { private Date create_time; private Date update_time; private String jrxmlPath; + + /** + * 客户ID + */ + private String customerId; } \ No newline at end of file diff --git a/src/main/java/com/glxp/udi/admin/res/param/SystemPDFTemplateResponse.java b/src/main/java/com/glxp/udi/admin/res/param/SystemPDFTemplateResponse.java index e12bcaa..031e7ce 100644 --- a/src/main/java/com/glxp/udi/admin/res/param/SystemPDFTemplateResponse.java +++ b/src/main/java/com/glxp/udi/admin/res/param/SystemPDFTemplateResponse.java @@ -21,4 +21,9 @@ public class SystemPDFTemplateResponse { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date update_time; private String jrxmlPath; + + /** + * 客户ID + */ + private String customerId; } \ No newline at end of file diff --git a/src/main/java/com/glxp/udi/admin/service/info/CompanyService.java b/src/main/java/com/glxp/udi/admin/service/info/CompanyService.java index 7d96f38..1ba8042 100644 --- a/src/main/java/com/glxp/udi/admin/service/info/CompanyService.java +++ b/src/main/java/com/glxp/udi/admin/service/info/CompanyService.java @@ -1,5 +1,7 @@ package com.glxp.udi.admin.service.info; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.glxp.udi.admin.dao.info.CompanyDao; import com.glxp.udi.admin.entity.info.CompanyEntity; @@ -9,6 +11,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.List; @Slf4j @Service @@ -51,4 +54,15 @@ public class CompanyService { public String findCompanyName(long customerId) { return companyDao.findCompanyName(customerId); } + + /** + * 查询公司列表信息 + * @param filterCompanyRequest + * @return + */ + public List getCompanyList(FilterCompanyRequest filterCompanyRequest) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StrUtil.isNotBlank(filterCompanyRequest.getCompanyName()),"companyName", filterCompanyRequest.getCompanyName()); + return companyDao.selectList(wrapper); + } } diff --git a/src/main/java/com/glxp/udi/admin/service/param/SystemPDFTemplateService.java b/src/main/java/com/glxp/udi/admin/service/param/SystemPDFTemplateService.java index c5d5107..420866c 100644 --- a/src/main/java/com/glxp/udi/admin/service/param/SystemPDFTemplateService.java +++ b/src/main/java/com/glxp/udi/admin/service/param/SystemPDFTemplateService.java @@ -26,15 +26,6 @@ public class SystemPDFTemplateService { return systemPDFTemplateDao.selectPage(page, buildQueryWrapper(systemPDFTemplateRequest)); } - private QueryWrapper buildQueryWrapper(SystemPDFTemplateRequest systemPDFTemplateRequest) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.like(StrUtil.isNotBlank(systemPDFTemplateRequest.getName()), "name", systemPDFTemplateRequest.getName()) - .eq(null != systemPDFTemplateRequest.getModule(), "module", systemPDFTemplateRequest.getModule()) - .eq(null != systemPDFTemplateRequest.getId(), "id", systemPDFTemplateRequest.getId()) - .orderByDesc("update_time"); - return wrapper; - } - public Page listPDFTemplates(Integer page, Integer limit) { Page pageParam = new Page<>(page, limit); if (null == page || null == limit) { @@ -68,4 +59,14 @@ public class SystemPDFTemplateService { public int countByName(String name) { return systemPDFTemplateDao.countByName(name); } + + private QueryWrapper buildQueryWrapper(SystemPDFTemplateRequest systemPDFTemplateRequest) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StrUtil.isNotBlank(systemPDFTemplateRequest.getName()), "name", systemPDFTemplateRequest.getName()) + .eq(null != systemPDFTemplateRequest.getModule(), "module", systemPDFTemplateRequest.getModule()) + .eq(null != systemPDFTemplateRequest.getId(), "id", systemPDFTemplateRequest.getId()) + .orderByDesc("update_time"); + return wrapper; + } + } diff --git a/src/main/resources/mybatis/mapper/param/SystemPDFTemplateDao.xml b/src/main/resources/mybatis/mapper/param/SystemPDFTemplateDao.xml index 82bc559..1f1ffa0 100644 --- a/src/main/resources/mybatis/mapper/param/SystemPDFTemplateDao.xml +++ b/src/main/resources/mybatis/mapper/param/SystemPDFTemplateDao.xml @@ -46,24 +46,29 @@ jrxmlPath=#{jrxmlPath}, + + customerId = #{customerId} + WHERE id=#{id} insert INTO system_pdf_template(name, - type, module, param, path, rowCount, qrcodeCount, remark, create_time, - update_time, jrxmlPath) + type, module, param, path, rowCount, qrcodeCount, remark, create_time, + update_time, jrxmlPath, customerId) values (#{name}, - #{type}, - #{module}, - #{param}, - #{path}, - #{rowCount}, - #{qrcodeCount}, - #{remark}, - #{create_time}, - #{update_time}, #{jrxmlPath}) + #{type}, + #{module}, + #{param}, + #{path}, + #{rowCount}, + #{qrcodeCount}, + #{remark}, + #{create_time}, + #{update_time}, + #{jrxmlPath}, + #{customerId}) - select count(*) from system_pdf_template where name = #{name} + select count(*) + from system_pdf_template + where name = #{name}