From b75ab6577807c48a0fe25bcb3e9c801f5a41999e Mon Sep 17 00:00:00 2001 From: liux <963924687@qq.com> Date: Fri, 10 Oct 2025 20:56:27 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9D=90=E6=96=99=E7=AB=99=E7=82=B9?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=8F=8A=E6=9F=A5=E8=AF=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../clz/domain/back/MaterialBackExportVO.java | 83 +++++ .../service/MaterialBackApplyInfoService.java | 3 + .../service/impl/ClzDirectServiceImpl.java | 1 - .../MaterialBackApplyInfoServiceImpl.java | 44 ++- .../resources/bootstrap-sgzb_bns_local.yml | 4 + .../material/clz/MaterialBackInfoMapper.xml | 314 +++++++++--------- .../mapper/material/common/SelectMapper.xml | 28 +- 7 files changed, 311 insertions(+), 166 deletions(-) create mode 100644 bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/domain/back/MaterialBackExportVO.java diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/domain/back/MaterialBackExportVO.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/domain/back/MaterialBackExportVO.java new file mode 100644 index 00000000..5cefbe0b --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/domain/back/MaterialBackExportVO.java @@ -0,0 +1,83 @@ +package com.bonus.material.clz.domain.back; + +import com.bonus.common.core.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.apache.poi.ss.usermodel.HorizontalAlignment; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author xliu + * @date 2025/10/10 15:41 + */ +@Data +public class MaterialBackExportVO { + + @ApiModelProperty(value = "序号") + @Excel(name = "序号", isSequence = true, sort = 0) + private String serialNumber; + + @Excel(name = "分公司") + @ApiModelProperty(value = "分公司") + private String impUnitName; + + @Excel(name = "退料工程") + @ApiModelProperty(value = "退料工程") + private String proName; + + + @Excel(name = "单位名称") + @ApiModelProperty(value = "单位名称") + private String unitName; + + @Excel(name = "退料人") + @ApiModelProperty(value = "退料人") + private String backPerson; + + @ApiModelProperty(value = "物资类型") + private String materialType; + + + @Excel(name = "退料单号") + @ApiModelProperty(value = "退料单号") + private String code; + + @ApiModelProperty(value = "工器具名称") + @Excel(name = "工器具名称") + private String materialName; + + @Excel(name = "规格型号") + @ApiModelProperty(value = "规格型号") + private String typeModelName; + + + @ApiModelProperty(value = "类型名称") + @Excel(name = "类型名称") + private String typeCode; + + /** 退料数量 */ + @ApiModelProperty(value = "预退数量") + @Excel(name = "预退数量", cellType = Excel.ColumnType.NUMERIC) + private BigDecimal backNum; + + @Excel(name = "退料数量",cellType = Excel.ColumnType.NUMERIC) + @ApiModelProperty(value = "退料数量") + private BigDecimal outNum; + + @ApiModelProperty(value = "计量单位") + @Excel(name = "计量单位") + private String unit; + + @Excel(name = "退料时间",dateFormat = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "退料时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date backTime; + + + + + +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/MaterialBackApplyInfoService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/MaterialBackApplyInfoService.java index 4e88c080..1c877a4c 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/MaterialBackApplyInfoService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/MaterialBackApplyInfoService.java @@ -4,6 +4,7 @@ import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.material.clz.domain.back.MaterialBackApplyDetails; import com.bonus.material.clz.domain.back.MaterialBackApplyInfo; import com.bonus.material.clz.domain.back.MaterialBackApplyTotalInfo; +import com.bonus.material.clz.domain.back.MaterialBackExportVO; import com.bonus.material.clz.domain.vo.back.MaterialBackApplyRequestVo; import com.bonus.material.clz.domain.vo.back.MaterialBackMaCodeVo; @@ -120,4 +121,6 @@ public interface MaterialBackApplyInfoService { * @return */ AjaxResult getMachine(MaterialBackApplyInfo dto); + + List exportBackInfoExcl(MaterialBackApplyInfo bean); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/ClzDirectServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/ClzDirectServiceImpl.java index 49181ebf..b2e8062c 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/ClzDirectServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/ClzDirectServiceImpl.java @@ -50,7 +50,6 @@ import com.bonus.material.work.domain.SysWorkflowRecordHistory; import com.bonus.material.work.domain.SysWorkflowType; import com.bonus.material.work.mapper.*; import com.bonus.system.api.domain.SysUser; -import com.sun.org.apache.bcel.internal.generic.NEW; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.web.util.UriComponentsBuilder; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialBackApplyInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialBackApplyInfoServiceImpl.java index 8b059650..881440e5 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialBackApplyInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialBackApplyInfoServiceImpl.java @@ -13,6 +13,7 @@ import com.bonus.common.biz.enums.TmTaskTypeEnum; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; import com.bonus.common.core.utils.StringUtils; +import com.bonus.common.core.utils.bean.BeanUtils; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.security.utils.SecurityUtils; import com.bonus.material.back.domain.BackApplyInfo; @@ -20,6 +21,7 @@ import com.bonus.material.back.domain.MaCodeDto; import com.bonus.material.back.domain.vo.MaCodeVo; import com.bonus.material.basic.mapper.BmFileInfoMapper; import com.bonus.material.clz.domain.BmTeam; +import com.bonus.material.clz.domain.back.MaterialBackExportVO; import com.bonus.material.clz.domain.lease.MaterialLeaseApplyInfo; import com.bonus.material.clz.mapper.IwsTeamUserMapper; import com.bonus.material.clz.mapper.MaterialMachineMapper; @@ -92,7 +94,7 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe boolean hasSpecialRole = hasSpecialRole(userRoles); if (!hasSpecialRole) { // 根据用户名判断用户是否为班组长 - teamData = materialMachineMapper.getTeamData(username); + teamData = materialMachineMapper.getTeamData(username); if (teamData == null) { // 根据用户名查询项目部信息 List departId = mapper.getDepartId(username); @@ -226,6 +228,7 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe */ @Override public List getTotalList(MaterialBackApplyInfo backApplyInfo) { + long time1 = System.currentTimeMillis(); Set userRoles = SecurityUtils.getLoginUser().getRoles(); String username = SecurityUtils.getLoginUser().getUsername(); // 检查用户是否具有特殊角色 @@ -234,16 +237,23 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe if (!hasSpecialRole) { // 根据用户名判断用户是否为班组长 teamData = materialMachineMapper.getTeamData(username); + long time2 = System.currentTimeMillis(); + System.err.println("查询用户信息耗时time2 - time1:" + (time2 - time1)); if (teamData == null) { // 根据用户名查询项目部信息 List departId = mapper.getDepartId(username); + long time3 = System.currentTimeMillis(); + System.err.println("查询用户所属项目部信息耗时time3 - time2:" + (time3 - time2)); // 根据项目部id查询工程信息 List projectIdList = mapper.getProjectId(departId); if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) { backApplyInfo.setProjectIdList(projectIdList); } + long time4 = System.currentTimeMillis(); + System.err.println("查询用户所属项目部工程信息耗时time4 - time3:" + (time4 - time3)); } } + long time5 = System.currentTimeMillis(); List list = materialBackInfoMapper.getTotalList(backApplyInfo); if (!hasSpecialRole) { Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); @@ -252,6 +262,8 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe list.removeIf(info -> !deptId.toString().equals(info.getImpUnit())); } } + long time6 = System.currentTimeMillis(); + System.err.println("查询总站点退料记录数据耗时time6 - time5:" + (time6 - time5)); if (!org.springframework.util.CollectionUtils.isEmpty(list)) { // 班组长权限 if (teamData != null) { @@ -264,6 +276,8 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe list = filterList(list, username); }*/ } + long time7 = System.currentTimeMillis(); + System.err.println("过滤数据耗时time7 - time6:" + (time7 - time6)); // 新增typeName过滤条件 if (!org.springframework.util.CollectionUtils.isEmpty(list) && !StringUtils.isBlank(backApplyInfo.getTypeName())) { list = list.stream() @@ -281,6 +295,8 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe // 查询所有未结算的工程 List projectIdList = mapper.getUnsettledProId(); + long time8 = System.currentTimeMillis(); + System.err.println("查询所有未结算的工程耗时time8 - time7:" + (time8 - time7)); // 使用 HashSet 来加速查找过程 Set unsettledProjectIds = new HashSet<>(projectIdList); // 过滤掉不在未结算工程集合内的设备 @@ -294,6 +310,8 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe iterator.remove(); } } + long time9 = System.currentTimeMillis(); + System.err.println("过滤未结算工程耗时time9 - time8:" + (time9 - time8)); } return list; } @@ -640,7 +658,7 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe boolean hasSpecialRole = hasSpecialRole(userRoles); if (!hasSpecialRole) { // 根据用户名判断用户是否为班组长 - teamData = materialMachineMapper.getTeamData(username); + teamData = materialMachineMapper.getTeamData(username); if (teamData == null) { // 根据用户名查询项目部信息 List departId = mapper.getDepartId(username); @@ -1303,4 +1321,26 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe (item.getBackPerson() != null && item.getBackPerson().contains(keyWord)) || (item.getCode() != null && item.getCode().contains(keyWord)); } + + @Override + public List exportBackInfoExcl(MaterialBackApplyInfo backApplyInfo) { + List list = this.getTotalList(backApplyInfo); + List result = new ArrayList<>(); + for (MaterialBackApplyInfo bean: list) { + bean.setParentId(bean.getId()); + List details = this.getDetailsList(bean); + for (MaterialBackApplyInfo detail: details){ + MaterialBackExportVO vo = new MaterialBackExportVO(); + BeanUtils.copyProperties(bean, vo); + vo.setUnit(detail.getUnitNames()); + vo.setOutNum(detail.getBackNum()); + vo.setBackNum(detail.getBackNum()); + vo.setTypeModelName(detail.getModelCode()); + vo.setMaterialName(detail.getTypeName()); + vo.setTypeCode(detail.getTypeCode()); + result.add( vo); + } + } + return result; + } } diff --git a/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_local.yml b/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_local.yml index be72758f..da05b0e6 100644 --- a/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_local.yml +++ b/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_local.yml @@ -10,10 +10,14 @@ spring: # 服务注册地址 server-addr: 127.0.0.1:8848 namespace: sgzb_bns + username: nacos + password: nacos config: # 配置中心地址 server-addr: 127.0.0.1:8848 namespace: sgzb_bns + username: nacos + password: nacos # 配置文件格式 file-extension: yml # 共享配置 diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialBackInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialBackInfoMapper.xml index 1c9c5b37..621ceffb 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialBackInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialBackInfoMapper.xml @@ -1,7 +1,7 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> insert into clz_back_apply_info @@ -128,19 +128,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update clz_slt_agreement_info set end_time = now(), - update_time = now(), - back_id = #{record.id}, - status = '1' + update_time = now(), + back_id = #{record.id}, + status = '1' where id = #{info.id} update clz_slt_agreement_info set num = #{backNum}, - end_time = now(), - update_time = now(), - back_id = #{record.id}, - status = '1' + end_time = now(), + update_time = now(), + back_id = #{record.id}, + status = '1' where id = #{info.id} @@ -343,7 +343,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" END isZz, bu.bzz_idcard AS idCard FROM - back_apply_info bai + (select * from back_apply_info + + + and create_time between concat(#{startTime},' 00:00:00') and concat(#{endTime},' 23:59:59') + + + ) bai LEFT JOIN back_check_details bad on bad.parent_id = bai.id LEFT JOIN tm_task tt on tt.task_id = bai.task_id LEFT JOIN tm_task_agreement tta on tta.task_id = tt.task_id @@ -379,9 +385,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and bp.pro_id = #{proId} - - - + + + and tt.task_status = #{appTaskStatus} @@ -403,59 +409,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT - bcd.ma_id AS maId, - mm.ma_code as maCode, - bcd.type_id AS typeId, - mt2.type_name AS materialType, - mt.type_name AS typeName, - mt1.type_name AS materialName, - bcd.ap_detection AS apDetection, - sd.dict_label AS maStatusName, - bcd.bad_num AS badNum, - bcd.good_num AS goodNum, - mm.ma_status AS maStatus + bcd.ma_id AS maId, + mm.ma_code as maCode, + bcd.type_id AS typeId, + mt2.type_name AS materialType, + mt.type_name AS typeName, + mt1.type_name AS materialName, + bcd.ap_detection AS apDetection, + sd.dict_label AS maStatusName, + bcd.bad_num AS badNum, + bcd.good_num AS goodNum, + mm.ma_status AS maStatus FROM - clz_back_check_details bcd - left join ma_machine mm on bcd.ma_id = mm.ma_id - left join ma_type mt ON mt.type_id = mm.type_id and mt.del_flag = 0 - left join ma_type mt1 ON mt.parent_id = mt1.type_id and mt1.del_flag = 0 - left join ma_type mt2 ON mt1.parent_id = mt2.type_id and mt2.del_flag = 0 - LEFT JOIN sys_dict_data sd ON mm.ma_status = sd.dict_value - and sd.dict_type = 'ma_machine_status' + clz_back_check_details bcd + left join ma_machine mm on bcd.ma_id = mm.ma_id + left join ma_type mt ON mt.type_id = mm.type_id and mt.del_flag = 0 + left join ma_type mt1 ON mt.parent_id = mt1.type_id and mt1.del_flag = 0 + left join ma_type mt2 ON mt1.parent_id = mt2.type_id and mt2.del_flag = 0 + LEFT JOIN sys_dict_data sd ON mm.ma_status = sd.dict_value + and sd.dict_type = 'ma_machine_status' where bcd.parent_id = #{id} @@ -547,27 +553,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT - mt.type_id as typeId, - mt1.type_name as materialName, - mt.type_name as typeName, - mt.parent_id as parentId, - mt.unit_name as unitName, - mt.unit_value as unitValue, - mt.manage_type as manageType, - SUM(sai.num) AS num, - mt.LEVEL as level, - clai.lease_style as leaseStyle + mt.type_id as typeId, + mt1.type_name as materialName, + mt.type_name as typeName, + mt.parent_id as parentId, + mt.unit_name as unitName, + mt.unit_value as unitValue, + mt.manage_type as manageType, + SUM(sai.num) AS num, + mt.LEVEL as level, + clai.lease_style as leaseStyle FROM - ma_type mt - LEFT JOIN clz_slt_agreement_info sai ON mt.type_id = sai.type_id - LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id and mt1.del_flag = '0' - LEFT JOIN clz_lease_apply_info clai ON sai.lease_id = clai.id + ma_type mt + LEFT JOIN clz_slt_agreement_info sai ON mt.type_id = sai.type_id + LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id and mt1.del_flag = '0' + LEFT JOIN clz_lease_apply_info clai ON sai.lease_id = clai.id WHERE - sai.STATUS = '0' + sai.STATUS = '0' and sai.agreement_id in @@ -767,35 +773,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" GROUP BY - mt.type_id + mt.type_id SELECT - tt.agreement_id AS agreementId + tt.agreement_id AS agreementId FROM - clz_back_apply_info ba - LEFT JOIN tm_task_agreement tt ON ba.task_id = tt.task_id + clz_back_apply_info ba + LEFT JOIN tm_task_agreement tt ON ba.task_id = tt.task_id WHERE - ba.id = #{id} + ba.id = #{id} From 9efa25e31a00ee812eb4cecccfb07d3b106fd7f5 Mon Sep 17 00:00:00 2001 From: liux <963924687@qq.com> Date: Fri, 10 Oct 2025 20:57:44 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9D=90=E6=96=99=E7=AB=99=E7=82=B9?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=8F=8A=E6=9F=A5=E8=AF=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap-sgzb_bns_local.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_local.yml b/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_local.yml index da05b0e6..be72758f 100644 --- a/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_local.yml +++ b/bonus-modules/bonus-material/src/main/resources/bootstrap-sgzb_bns_local.yml @@ -10,14 +10,10 @@ spring: # 服务注册地址 server-addr: 127.0.0.1:8848 namespace: sgzb_bns - username: nacos - password: nacos config: # 配置中心地址 server-addr: 127.0.0.1:8848 namespace: sgzb_bns - username: nacos - password: nacos # 配置文件格式 file-extension: yml # 共享配置 From 1f8e477105e942800150d1cda8c679d7f6aebe88 Mon Sep 17 00:00:00 2001 From: jjLv <1981429112@qq.com> Date: Fri, 10 Oct 2025 20:58:21 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=88=E5=8F=91=E6=96=99=E8=AE=B0=E5=BD=95=E6=B1=87=E6=80=BB?= =?UTF-8?q?=E3=80=81=E7=BB=B4=E4=BF=AE=E4=BB=BB=E5=8A=A1=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E3=80=81=E7=BB=B4=E4=BF=AE=E5=AE=A1=E6=A0=B8=E7=AE=A1=E7=90=86?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MaterialLeaseInfoController.java | 2 +- .../clz/domain/vo/lease/LeaseTotalInfo.java | 46 ++++--- .../RepairAuditDetailsController.java | 3 +- .../repair/controller/RepairController.java | 3 +- .../material/repair/domain/RepairTask.java | 124 ++++++++++-------- .../repair/domain/vo/ScrapApplyDetailsVO.java | 42 ++++-- .../repair/RepairAuditDetailsMapper.xml | 90 ++++++++----- .../mapper/material/repair/RepairMapper.xml | 54 ++++---- 8 files changed, 214 insertions(+), 150 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/controller/MaterialLeaseInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/controller/MaterialLeaseInfoController.java index 51fbcd5b..9ee305ec 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/controller/MaterialLeaseInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/controller/MaterialLeaseInfoController.java @@ -364,7 +364,7 @@ public class MaterialLeaseInfoController extends BaseController { bean.setIsExport(0); List list = materialLeaseInfoService.getLeaseInfoDetails(bean); ExcelUtil util = new ExcelUtil<>(LeaseTotalInfo.class); - util.exportExcel(response, list, "综合查询--工器具领料记录查询", "工器具领料记录查询"); + util.exportExcel(response, list, "综合查询--项目部材料站出库一览表", "项目部材料站出库一览表 (导出时间:" + DateUtils.getTime() + ")" ); } /** diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/domain/vo/lease/LeaseTotalInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/domain/vo/lease/LeaseTotalInfo.java index 262ba1b6..375bf782 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/domain/vo/lease/LeaseTotalInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/domain/vo/lease/LeaseTotalInfo.java @@ -25,6 +25,18 @@ public class LeaseTotalInfo { private Long parentId; + @ApiModelProperty(value = "序号") + @Excel(name = "序号", isSequence = true, sort = 0) + private String serialNumber; + + @ApiModelProperty(value = "分公司") + @Excel(name = "分公司") + private String impUnitName; + + @ApiModelProperty(value = "领料工程") + @Excel(name = "领料工程") + private String projectName; + @ApiModelProperty(value = "工器具名称") @Excel(name = "工器具名称") private String maTypeName; @@ -41,30 +53,25 @@ public class LeaseTotalInfo { private BigDecimal preNum; @ApiModelProperty(value = "出库数量") - @Excel(name = "出库数量") + @Excel(name = "出库数量", cellType = Excel.ColumnType.NUMERIC) private BigDecimal outNum; + @ApiModelProperty(value = "分包单位") + @Excel(name = "分包单位") + private String subUnitName; + @ApiModelProperty(value = "待出库数量") private BigDecimal pendingNum; @ApiModelProperty(value = "领料日期") @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "领料日期", dateFormat = "yyyy-MM-dd", width = 30) +// @Excel(name = "领料日期", dateFormat = "yyyy-MM-dd", width = 30) private String leaseDate; - @ApiModelProperty(value = "出库日期") - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "出库日期", dateFormat = "yyyy-MM-dd", width = 30) - private String outDate; - @ApiModelProperty(value = "领料班组") @Excel(name = "领料班组") private String teamName; - @ApiModelProperty(value = "领料工程") - @Excel(name = "领料工程") - private String projectName; - @ApiModelProperty(value = "领料人") @Excel(name = "班组长") private String leasePerson; @@ -76,7 +83,10 @@ public class LeaseTotalInfo { @ApiModelProperty(value = "领料单号") @Excel(name = "领料单号") private String code; - + @ApiModelProperty(value = "出库日期") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "出库日期", dateFormat = "yyyy-MM-dd", width = 30) + private String outDate; @ApiModelProperty(value = "开始时间") private String startTime; @@ -103,22 +113,16 @@ public class LeaseTotalInfo { */ private List projectIdList; - @ApiModelProperty(value = "分公司") - @Excel(name = "分公司") - private String impUnitName; + @ApiModelProperty(value = "项目部") - @Excel(name = "项目部") +// @Excel(name = "项目部") private String departName; @ApiModelProperty(value = "工程名称") - @Excel(name = "工程名称") +// @Excel(name = "工程名称") private String proName; - @ApiModelProperty(value = "分包单位") - @Excel(name = "分包单位") - private String subUnitName; - @ApiModelProperty(value = "工程id") private String proId; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/controller/RepairAuditDetailsController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/controller/RepairAuditDetailsController.java index 3eda65b2..7677b56b 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/controller/RepairAuditDetailsController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/controller/RepairAuditDetailsController.java @@ -9,6 +9,7 @@ import javax.validation.constraints.NotNull; import cn.hutool.core.convert.Convert; import com.bonus.common.biz.annotation.StoreLog; import com.bonus.common.biz.config.ListPagingUtil; +import com.bonus.common.core.utils.DateUtils; import com.bonus.common.core.utils.ServletUtils; import com.bonus.common.log.enums.OperaType; import com.bonus.material.basic.domain.report.LeaseOutInfo; @@ -95,7 +96,7 @@ public class RepairAuditDetailsController extends BaseController { repairAuditDetailsService.queryTimeCope(bean); List list = repairAuditDetailsService.selectRepairQuestList(bean); ExcelUtil util = new ExcelUtil<>(ScrapApplyDetailsVO.class); - util.exportExcel(response, list, "修试审核任务列表"); + util.exportExcel(response, list, "修试审核任务列表", "修试审核数据一览表(导出时间:" + DateUtils.getTime() + ")"); } /** diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/controller/RepairController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/controller/RepairController.java index 7ca0011b..1c34a66d 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/controller/RepairController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/controller/RepairController.java @@ -3,6 +3,7 @@ package com.bonus.material.repair.controller; import cn.hutool.core.convert.Convert; import com.bonus.common.biz.config.ListPagingUtil; import com.bonus.common.core.exception.ServiceException; +import com.bonus.common.core.utils.DateUtils; import com.bonus.common.core.utils.ServletUtils; import com.bonus.common.core.utils.poi.ExcelUtil; import com.bonus.common.core.web.controller.BaseController; @@ -255,7 +256,7 @@ public class RepairController extends BaseController { list = new ArrayList<>(); } ExcelUtil util = new ExcelUtil<>(RepairTask.class); - util.exportExcel(response, list, "维修任务列表"); + util.exportExcel(response, list, "维修任务列表", "维修任务一览表 (导出时间:" + DateUtils.getTime() + ")"); } @ApiOperation(value = "获取修试后入库列表") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/RepairTask.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/RepairTask.java index 875e41c3..d078e5bb 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/RepairTask.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/RepairTask.java @@ -40,53 +40,86 @@ public class RepairTask { @ApiModelProperty(value = "维修拆分父级id") private Long parentId; - /** - * 维修单号 - */ - @ApiModelProperty(value = "维修单号") - @Excel(name = "维修单号",sort = 1) - private String repairCode; + @ApiModelProperty(value = "序号") + @Excel(name = "序号", isSequence = true, sort = 0) + private String serialNumber; + /** * 退料单位名称 */ @ApiModelProperty(value = "退料单位名称") - @Excel(name = "退料单位名称",sort = 2) + @Excel(name = "退料单位名称",sort = 1) private String backUnit; /** * 退料工程名称 */ @ApiModelProperty(value = "退料工程名称") - @Excel(name = "退料工程名称",sort = 3) + @Excel(name = "退料工程名称",sort = 2) private String backPro; + /** + * 退料单号 + */ + @ApiModelProperty(value = "退料单号") + @Excel(name = "退料单号",sort = 3) + private String backCode; + /** + * 维修单号 + */ + @ApiModelProperty(value = "维修单号") + @Excel(name = "维修单号",sort = 4) + private String repairCode; + /** + * 维修机具类型 + */ + @ApiModelProperty(value = "维修机具类型") + @Excel(name = "物资名称",sort = 5) + private String type; + /** + * 规格型号 + */ + @ApiModelProperty(value = "规格型号") + @Excel(name = "规格型号",sort = 6) + private String typeName; + @ApiModelProperty(value = "退料数量") + @Excel(name = "退料数量",sort = 7) + private BigDecimal returnNum; + /** + * 维修总量 + */ + @ApiModelProperty(value = "维修总量") + @Excel(name = "维修数量",sort = 8) + private BigDecimal repairNum; + /** + * 维修报废数量 + */ + @ApiModelProperty(value = "报废数量") + @Excel(name = "报废数量",sort = 9) + private BigDecimal scrapNum; + @ApiModelProperty(value = "待维修数量") + @Excel(name = "待维修数量",sort = 10) + private BigDecimal beRepairedNum; + /** + * 任务创建人 + */ + @ApiModelProperty(value = "任务创建人") + @Excel(name = "任务创建人",sort = 11) + private String createName; + /** + * 任务创建时间 + */ + @ApiModelProperty(value = "任务创建时间") + @Excel(name = "任务创建时间",sort = 12) + private String createTime; /** * 任务创建人 */ @ApiModelProperty(value = "任务创建人") private Long createBy; - /** - * 任务创建人 - */ - @ApiModelProperty(value = "任务创建人") - @Excel(name = "任务创建人",sort = 4) - private String createName; - - /** - * 任务创建时间 - */ - @ApiModelProperty(value = "任务创建时间") - @Excel(name = "任务创建时间",sort = 5) - private String createTime; - /** - * 退料单号 - */ - @ApiModelProperty(value = "退料单号") - @Excel(name = "退料单号",sort = 6) - private String backCode; /** * 维修状态 */ @ApiModelProperty(value = "维修状态") - @Excel(name = "维修状态",sort = 7) +// @Excel(name = "维修状态",sort = 7) private String repairStatus; /** * 关键字 @@ -110,47 +143,26 @@ public class RepairTask { @ApiModelProperty(value = "维修状态编码CODE") private String repairStatusCode; - /** - * 维修机具类型 - */ - @ApiModelProperty(value = "维修机具类型") - @Excel(name = "维修机具类型",sort = 8) - private String type; - /** - * 规格型号 - */ - @ApiModelProperty(value = "规格型号") - @Excel(name = "规格型号",sort = 9) - private String typeName; + /** * 编码 */ @ApiModelProperty(value = "编码") - @Excel(name = "编码",sort = 10) +// @Excel(name = "编码",sort = 10) private String code; - /** - * 维修总量 - */ - @ApiModelProperty(value = "维修总量") - @Excel(name = "维修总量",sort = 11) - private BigDecimal repairNum; + /** * 维修合格数量 */ @ApiModelProperty(value = "维修合格数量") - @Excel(name = "维修合格数量",sort = 12) +// @Excel(name = "维修合格数量",sort = 12) private BigDecimal repairedNum; - /** - * 维修报废数量 - */ - @ApiModelProperty(value = "报废数量") - @Excel(name = "维修报废数量",sort = 13) - private BigDecimal scrapNum; + /** * 待修状态 */ @ApiModelProperty(value = "待修状态") - @Excel(name = "待修状态",sort = 14) +// @Excel(name = "待修状态",sort = 14) private String status; /** * 维修人员 @@ -162,7 +174,7 @@ public class RepairTask { * 维修时间 */ @ApiModelProperty(value = "维修时间") - @Excel(name = "维修时间",sort = 16) +// @Excel(name = "维修时间",sort = 16) private String updateTime; /** 导出选中列表 */ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/vo/ScrapApplyDetailsVO.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/vo/ScrapApplyDetailsVO.java index 849f1ebd..9ea7cdf5 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/vo/ScrapApplyDetailsVO.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/vo/ScrapApplyDetailsVO.java @@ -5,6 +5,7 @@ import com.bonus.material.scrap.domain.ScrapAuditorSet; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.math.BigDecimal; import java.util.List; /** @@ -21,11 +22,16 @@ public class ScrapApplyDetailsVO { /** * 报废审核单号 */ - @Excel(name = "任务单号",sort = 4) +// @Excel(name = "任务单号",sort = 4) private String scrapNum; + @ApiModelProperty(value = "维修任务单号") private String repairTaskCode; + @ApiModelProperty(value = "序号") + @Excel(name = "序号", isSequence = true, sort = 0) + private String serialNumber; + /** * 单位名称 */ @@ -35,44 +41,64 @@ public class ScrapApplyDetailsVO { /** * 工程名称 */ - @Excel(name = "工程名称",sort = 2) + @Excel(name = "退料工程",sort = 2) private String projectName; + @Excel(name = "退料单号",sort = 3) + private String backCode; + + @Excel(name = "维修审核单号",sort = 4) + private String auditCode; + + @Excel(name = "物资类型",sort = 5) + private String typeName2; + + @Excel(name = "退料数量",sort = 6, cellType = Excel.ColumnType.NUMERIC) + private BigDecimal repairNum2; + @Excel(name = "合格数量",sort = 7, cellType = Excel.ColumnType.NUMERIC) + private BigDecimal repairedNum; + @Excel(name = "报废数量",sort = 8, cellType = Excel.ColumnType.NUMERIC) + private BigDecimal scrapNum3; + @Excel(name = "维修人",sort = 9) + private String createBy2; + @Excel(name = "审核时间", dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 10) + private String auditTime; + /** * 维修班组名称 */ - @Excel(name = "维修班组",sort = 6) +// @Excel(name = "维修班组",sort = 6) //@ApiModelProperty(value = "维修班组") private String teamName; /** * 任务创建人 */ - @Excel(name = "提交人",sort = 7) +// @Excel(name = "提交人",sort = 7) private String createBy; /** * 机具类型 */ - @Excel(name = "物资类型",sort = 5) +// @Excel(name = "物资类型",sort = 5) private String itemType; /** * 创建时间 */ - @Excel(name = "提交时间",sort = 8) +// @Excel(name = "提交时间",sort = 8) private String createTime; /** * 维修单号 */ - @Excel(name = "维修审核单号",sort = 3) +// @Excel(name = "维修审核单号",sort = 3) private String repairNum; /** * 审核状态 */ - @Excel(name = "状态",sort = 9,readConverterExp = "10=维修审核进行中,11=维修审核完成,12=维修审核被驳回") +// @Excel(name = "状态",sort = 9,readConverterExp = "10=维修审核进行中,11=维修审核完成,12=维修审核被驳回") private Integer taskStatus; /** diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairAuditDetailsMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairAuditDetailsMapper.xml index f2efa20d..88af071e 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairAuditDetailsMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairAuditDetailsMapper.xml @@ -331,21 +331,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -- 第一个查询(时间条件:小于 2025-08-20) SELECT DISTINCT tk.task_id AS taskId, - tk.CODE AS scrapNum, - tt2.CODE AS repairTaskCode, - tk.task_status AS taskStatus, bui.unit_name AS unitName, bpl.pro_name AS projectName, - su.nick_name AS createBy, - tk.create_time AS createTime, - tk.remark, - tk.CODE AS repairNum, - rad.audit_time as auditTime, - GROUP_CONCAT(DISTINCT mt4.type_id) AS firstId + tk.CODE as auditCode, + tt3.`code` as backCode, + GROUP_CONCAT(DISTINCT mt1.type_name) AS typeName2, + rn.scrapNum AS scrapNum3, + rn.repairNum as repairNum2, + rn.repairedNum as repairedNum, + tk.task_status AS taskStatus, + rad.create_by AS createBy2, + rad.create_time AS auditTime FROM tm_task tk - LEFT JOIN tm_task tt ON tk.pre_task_id = tt.task_id LEFT JOIN repair_audit_details rad ON tk.task_id = rad.task_id + LEFT JOIN ( + SELECT + rad.task_id, + SUM(rad.scrap_num) AS scrapNum, + SUM(rad.repair_num) as repairNum, + SUM(rad.repaired_num) as repairedNum + from repair_audit_details rad + + JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId} + + GROUP BY rad.task_id + ) rn on rn.task_id = tk.task_id + LEFT JOIN repair_apply_details raad on raad.task_id = rad.repair_id + LEFT JOIN tm_task tt3 on tt3.task_id = raad.back_id LEFT JOIN tm_task tt2 ON tt2.task_id = rad.repair_id LEFT JOIN tm_task_agreement tta ON rad.repair_id = tta.task_id LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id @@ -354,10 +367,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN ma_type mt ON rad.type_id = mt.type_id LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id LEFT JOIN sys_user su ON su.user_id = tk.create_by - LEFT JOIN ma_type mt3 ON mt1.parent_id = mt3.type_id AND mt3.del_flag = '0' - LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id AND mt4.del_flag = '0' + LEFT JOIN ma_type mt3 ON mt1.parent_id = mt3.type_id + AND mt3.del_flag = '0' + LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id + AND mt4.del_flag = '0' - JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId} + JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId} WHERE tk.task_type = #{taskType} and tt2.CODE is not null @@ -388,41 +403,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" GROUP BY tk.CODE - UNION - -- 第二个查询(时间条件:>= 2025-08-20) SELECT DISTINCT tk.task_id AS taskId, - tk.CODE AS scrapNum, - tt.CODE AS repairTaskCode, - tk.task_status AS taskStatus, bui.unit_name AS unitName, bpl.pro_name AS projectName, - su.nick_name AS createBy, - tk.create_time AS createTime, - tk.remark, - tk.CODE AS repairNum, - rad.audit_time as auditTime, - GROUP_CONCAT(DISTINCT mt4.type_id) AS firstId + tk.CODE as auditCode, + baii.`code` as backCode, + GROUP_CONCAT(DISTINCT mt1.type_name) AS typeName2, + rn.scrapNum AS scrapNum3, + rn.repairNum as repairNum2, + rn.repairedNum as repairedNum, + tk.task_status AS taskStatus, + su.nick_name AS createBy2, + rad.audit_time AS auditTime FROM tm_task tk - LEFT JOIN tm_task tt ON tk.pre_task_id = tt.task_id + LEFT JOIN ( + SELECT + rad.task_id, + SUM(rad.scrap_num) AS scrapNum, + SUM(rad.repair_num) as repairNum, + SUM(rad.repaired_num) as repairedNum, + rad.audit_time + from repair_audit_details rad + + JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId} + + GROUP BY rad.task_id + ) rn on rn.task_id = tk.task_id + LEFT JOIN repair_audit_details rad ON tk.task_id = rad.task_id + LEFT JOIN back_apply_info baii on baii.id = rad.back_id LEFT JOIN tm_task_agreement tta ON tk.task_id = tta.task_id LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id LEFT JOIN bm_project bpl ON bai.project_id = bpl.pro_id LEFT JOIN bm_unit bui ON bai.unit_id = bui.unit_id - LEFT JOIN repair_audit_details rad ON tk.task_id = rad.task_id LEFT JOIN ma_type mt ON rad.type_id = mt.type_id LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id LEFT JOIN sys_user su ON su.user_id = tk.create_by - LEFT JOIN ma_type mt3 ON mt1.parent_id = mt3.type_id AND mt3.del_flag = '0' - LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id AND mt4.del_flag = '0' + LEFT JOIN ma_type mt3 ON mt1.parent_id = mt3.type_id + AND mt3.del_flag = '0' + LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id + AND mt4.del_flag = '0' - JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId} + JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId} WHERE - tk.task_type = #{taskType} and tt.CODE is not null + tk.task_type = #{taskType} AND tk.create_time >= '2025-08-20 00:00:00' AND bui.unit_id = #{backUnit} @@ -458,7 +486,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ORDER BY taskStatus, - createTime DESC + auditTime DESC diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairMapper.xml index 069cd61f..262a9453 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairMapper.xml @@ -336,40 +336,32 @@