From d867cc27dfb6da46fc5cb0990b8873eedabec924 Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Wed, 12 Nov 2025 12:23:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BB=B4=E4=BF=AE=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E3=80=81=E7=BB=B4=E4=BF=AE=E5=AE=A1=E6=A0=B8=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repair/controller/RepairController.java | 61 +++++ .../domain/RepairAuditDetailsExport.java | 234 +++++++++++++++++ .../repair/domain/RepairDetailsExport.java | 239 ++++++++++++++++++ .../service/impl/RepairServiceImpl.java | 14 + .../mapper/material/repair/RepairMapper.xml | 24 ++ 5 files changed, 572 insertions(+) create mode 100644 bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/RepairAuditDetailsExport.java create mode 100644 bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/RepairDetailsExport.java 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 06051dc7..863c70b6 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 @@ -5,6 +5,7 @@ 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.bean.BeanUtils; import com.bonus.common.core.utils.poi.ExcelUtil; import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.domain.AjaxResult; @@ -14,10 +15,13 @@ import com.bonus.common.log.enums.OperaType; import com.bonus.common.security.annotation.RequiresPermissions; import com.bonus.material.back.domain.BackApplyInfo; import com.bonus.material.back.domain.vo.BackApplyVo; +import com.bonus.material.basic.domain.ProjUsingRecord; +import com.bonus.material.basic.domain.ProjUsingRecordExport; import com.bonus.material.common.annotation.PreventRepeatSubmit; import com.bonus.material.ma.domain.LabelBind; import com.bonus.material.repair.domain.*; import com.bonus.material.repair.domain.vo.*; +import com.bonus.material.repair.service.IRepairAuditDetailsService; import com.bonus.material.repair.service.RepairService; import com.bonus.system.api.domain.SysUser; import com.fasterxml.jackson.core.JsonProcessingException; @@ -35,6 +39,8 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.constraints.NotNull; import java.util.*; +import static com.bonus.common.biz.enums.TmTaskTypeEnum.TM_TASK_REPAIR_AUDIT; + /** * @author syruan */ @@ -46,6 +52,9 @@ public class RepairController extends BaseController { @Resource private RepairService service; + @Resource + private IRepairAuditDetailsService repairAuditDetailsService; + /** * Jackson -- 避免反序列化漏洞 */ @@ -483,6 +492,26 @@ public class RepairController extends BaseController { return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); } + @PostMapping("/exportDetails") + @ApiOperation(value = "导出维修任务列表") + public void exportDetails(HttpServletResponse response, RepairTask bean) { + List list = new ArrayList<>(); + List listExport = new ArrayList<>(); + try { + list = service.getRepairQueryList(bean); + //将list复制到exportList + for (RepairTask repairTask : list) { + RepairDetailsExport repairDetailsExport = new RepairDetailsExport(); + BeanUtils.copyProperties(repairTask, repairDetailsExport); + listExport.add(repairDetailsExport); + } + } catch (Exception e) { + list = new ArrayList<>(); + } + ExcelUtil util = new ExcelUtil<>(RepairDetailsExport.class); + util.exportExcel(response, listExport, "机具维修报表", "机具维修报表"); + } + /** * -----------维修审核查询页面接口---------- */ @@ -498,4 +527,36 @@ public class RepairController extends BaseController { List list = service.getRepairAuditQueryList(bean); return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); } + + /** + * 导出修试审核任务详情列表 + */ + @PostMapping("/exportAuditDetails") + @SysLog(title = "导出修试审核任务详情列表", businessType = OperaType.EXPORT, module = "机具系统->导出修试审核任务详情列表") + public void exportAuditDetails(HttpServletResponse response, RepairAuditDetails bean) { + if (Objects.isNull(bean)) { + bean = new RepairAuditDetails(); + } + if (Objects.isNull(bean.getTaskType())) { + bean.setTaskType(TM_TASK_REPAIR_AUDIT.getTaskTypeId()); + } + List listExport = new ArrayList<>(); + repairAuditDetailsService.queryTimeCope(bean); + RepairTask repairTask = new RepairTask(); + repairTask.setTaskType(bean.getTaskType()); + repairTask.setTaskStatus(Integer.valueOf(bean.getTaskStatus())); + repairTask.setStartTime(bean.getStartTime()); + repairTask.setEndTime(bean.getEndTime()); + repairTask.setKeyWord(bean.getKeyWord()); + List list = service.getRepairAuditQueryList(repairTask); + for (RepairTask repairTask1 : list){ + RepairAuditDetailsExport repairAuditDetailsExport = new RepairAuditDetailsExport(); + BeanUtils.copyProperties(repairTask1, repairAuditDetailsExport); + listExport.add(repairAuditDetailsExport); + } + + + ExcelUtil util = new ExcelUtil<>(RepairAuditDetailsExport.class); + util.exportExcel(response, listExport, "入库单", "入库单"); + } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/RepairAuditDetailsExport.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/RepairAuditDetailsExport.java new file mode 100644 index 00000000..6eae56d2 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/RepairAuditDetailsExport.java @@ -0,0 +1,234 @@ +package com.bonus.material.repair.domain; + +import com.bonus.common.core.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @author syruan + */ +@Data +@ApiModel(value="维修任务") +public class RepairAuditDetailsExport { + + private Long id; + /** + * 任务id + */ + @ApiModelProperty(value = "任务id") + private Long taskId; + + @ApiModelProperty(value = "前置任务id") + private Long preTaskId; + + @ApiModelProperty(value = "任务状态") + private Integer taskStatus; + + @ApiModelProperty(value = "任务类型") + private Integer taskType; + + @ApiModelProperty(value = "任务当月序号 例如:1 插入及查询时请携带任务类型") + private Integer monthOrder; + + @ApiModelProperty(value = "维修拆分层级") + private String level; + + @ApiModelProperty(value = "维修拆分父级id") + private Long parentId; + + @ApiModelProperty(value = "序号") + @Excel(name = "序号", isSequence = true, sort = 0) + private String serialNumber; + + /** + * 退料单位名称 + */ + @ApiModelProperty(value = "退料单位名称") + private String backUnit; + /** + * 退料工程名称 + */ + @ApiModelProperty(value = "退料工程名称") + private String backPro; + /** + * 退料单号 + */ + @ApiModelProperty(value = "退料单号") + private String backCode; + /** + * 维修单号 + */ + @ApiModelProperty(value = "维修单号") + @Excel(name = "维修单号",sort = 2) + private String repairCode; + /** + * 维修机具类型 + */ + @ApiModelProperty(value = "维修机具类型") + @Excel(name = "机具名称",sort = 3) + private String type; + /** + * 规格型号 + */ + @ApiModelProperty(value = "规格型号") + @Excel(name = "规格型号",sort = 4) + private String typeName; + @ApiModelProperty(value = "退料数量") + private BigDecimal returnNum; + /** + * 维修总量 + */ + @ApiModelProperty(value = "维修总量") + @Excel(name = "退料数量",sort = 5) + private BigDecimal repairNum; + /** + * 维修报废数量 + */ + @ApiModelProperty(value = "报废数量") + @Excel(name = "报废数量",sort = 7) + private BigDecimal scrapNum; + @ApiModelProperty(value = "待维修数量") + private BigDecimal beRepairedNum; + /** + * 任务创建人 + */ + @ApiModelProperty(value = "任务创建人") + private String createName; + /** + * 任务创建时间 + */ + @ApiModelProperty(value = "任务创建时间") + @Excel(name = "审核提交时间", sort = 1) + private String createTime; + /** + * 任务创建人 + */ + @ApiModelProperty(value = "任务创建人") + private Long createBy; + /** + * 维修状态 + */ + @ApiModelProperty(value = "维修状态") + private String repairStatus; + /** + * 关键字 + */ + private String keyWord; + /** + * 开始时间 + */ + private String startTime; + /** + * 结束时间 + */ + private String endTime; + + @ApiModelProperty(value = "组织id") + private Long companyId; + + @ApiModelProperty(value = "协议id") + private Long agreementId; + + @ApiModelProperty(value = "维修状态编码CODE") + private String repairStatusCode; + + + /** + * 编码 + */ + @ApiModelProperty(value = "编码") + private String code; + + /** + * 维修合格数量 + */ + @ApiModelProperty(value = "维修合格数量") + @Excel(name = "合格数量",sort = 6) + private BigDecimal repairedNum; + + /** + * 待修状态 + */ + @ApiModelProperty(value = "待修状态") + private String status; + /** + * 维修人员 + */ + @ApiModelProperty(value = "维修人员") + private String repairer; + /** + * 维修时间 + */ + @ApiModelProperty(value = "维修时间") + private String updateTime; + + /** 导出选中列表 */ + @ApiModelProperty(value = "导出选中列表") + private List dataCondition; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "app维修任务状态,0 进行中 1已审核(包含通过和驳回)") + private Integer appTaskStatus; + + /** + * 退料人 + */ + private String backPerson; + + private List ids; + + private List taskIds; + + @ApiModelProperty(value = "登录用户id") + private Long userId; + + @ApiModelProperty(value = "一级类型id") + private String firstId; + + /** + * 数据状态 0-未定损,1-已定损 3-修饰后入库驳回 + */ + private String dataStatus; + + private Integer num; + + @ApiModelProperty(value = "退料ID") + private Long backId; + + /** + * 签名地址 + */ + @ApiModelProperty(value = "签名地址") + private String signUrl; + + @ApiModelProperty(value = "签名类型 手写0 和 图片上传1") + private int signType; + + /** + * 维修完成时间 + */ + private String repairTime; + + /** + * 单位 + */ + private String unit; + + @ApiModelProperty(value = "单位id") + private Long unitId; + + @ApiModelProperty(value="工程id") + private Long proId; + + @ApiModelProperty(value = "类型id") + private String typeId; + + @ApiModelProperty(value = "规格id") + private String typeModelId; +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/RepairDetailsExport.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/RepairDetailsExport.java new file mode 100644 index 00000000..05c0e030 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/RepairDetailsExport.java @@ -0,0 +1,239 @@ +package com.bonus.material.repair.domain; + +import com.bonus.common.core.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @author syruan + */ +@Data +@ApiModel(value="维修任务") +public class RepairDetailsExport { + + private Long id; + /** + * 任务id + */ + @ApiModelProperty(value = "任务id") + private Long taskId; + + @ApiModelProperty(value = "前置任务id") + private Long preTaskId; + + @ApiModelProperty(value = "任务状态") + private Integer taskStatus; + + @ApiModelProperty(value = "任务类型") + private Integer taskType; + + @ApiModelProperty(value = "任务当月序号 例如:1 插入及查询时请携带任务类型") + private Integer monthOrder; + + @ApiModelProperty(value = "维修拆分层级") + private String level; + + @ApiModelProperty(value = "维修拆分父级id") + private Long parentId; + + @ApiModelProperty(value = "序号") + @Excel(name = "序号", isSequence = true, sort = 0) + private String serialNumber; + + /** + * 退料单位名称 + */ + @ApiModelProperty(value = "退料单位名称") + @Excel(name = "退料单位名称",sort = 4) + private String backUnit; + /** + * 退料工程名称 + */ + @ApiModelProperty(value = "退料工程名称") + @Excel(name = "退料工程名称",sort = 5) + private String backPro; + /** + * 退料单号 + */ + @ApiModelProperty(value = "退料单号") + @Excel(name = "退料单号",sort = 3) + private String backCode; + /** + * 维修单号 + */ + @ApiModelProperty(value = "维修单号") + @Excel(name = "维修单号",sort = 2) + private String repairCode; + /** + * 维修机具类型 + */ + @ApiModelProperty(value = "维修机具类型") + @Excel(name = "机具名称",sort = 6) + private String type; + /** + * 规格型号 + */ + @ApiModelProperty(value = "规格型号") + @Excel(name = "规格型号",sort = 7) + private String typeName; + @ApiModelProperty(value = "退料数量") + private BigDecimal returnNum; + /** + * 维修总量 + */ + @ApiModelProperty(value = "维修总量") + @Excel(name = "维修数量",sort = 10) + private BigDecimal repairNum; + /** + * 维修报废数量 + */ + @ApiModelProperty(value = "报废数量") + @Excel(name = "报废数量",sort = 12) + private BigDecimal scrapNum; + @ApiModelProperty(value = "待维修数量") + private BigDecimal beRepairedNum; + /** + * 任务创建人 + */ + @ApiModelProperty(value = "任务创建人") + private String createName; + /** + * 任务创建时间 + */ + @ApiModelProperty(value = "任务创建时间") + private String createTime; + /** + * 任务创建人 + */ + @ApiModelProperty(value = "任务创建人") + private Long createBy; + /** + * 维修状态 + */ + @ApiModelProperty(value = "维修状态") + @Excel(name = "维修状态",sort = 9) + private String repairStatus; + /** + * 关键字 + */ + private String keyWord; + /** + * 开始时间 + */ + private String startTime; + /** + * 结束时间 + */ + private String endTime; + + @ApiModelProperty(value = "组织id") + private Long companyId; + + @ApiModelProperty(value = "协议id") + private Long agreementId; + + @ApiModelProperty(value = "维修状态编码CODE") + private String repairStatusCode; + + + /** + * 编码 + */ + @ApiModelProperty(value = "编码") + private String code; + + /** + * 维修合格数量 + */ + @ApiModelProperty(value = "维修合格数量") + @Excel(name = "维修合格数量",sort = 11) + private BigDecimal repairedNum; + + /** + * 待修状态 + */ + @ApiModelProperty(value = "待修状态") + private String status; + /** + * 维修人员 + */ + @ApiModelProperty(value = "维修人员") + private String repairer; + /** + * 维修时间 + */ + @ApiModelProperty(value = "维修时间") + private String updateTime; + + /** 导出选中列表 */ + @ApiModelProperty(value = "导出选中列表") + private List dataCondition; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "app维修任务状态,0 进行中 1已审核(包含通过和驳回)") + private Integer appTaskStatus; + + /** + * 退料人 + */ + private String backPerson; + + private List ids; + + private List taskIds; + + @ApiModelProperty(value = "登录用户id") + private Long userId; + + @ApiModelProperty(value = "一级类型id") + private String firstId; + + /** + * 数据状态 0-未定损,1-已定损 3-修饰后入库驳回 + */ + private String dataStatus; + + private Integer num; + + @ApiModelProperty(value = "退料ID") + private Long backId; + + /** + * 签名地址 + */ + @ApiModelProperty(value = "签名地址") + private String signUrl; + + @ApiModelProperty(value = "签名类型 手写0 和 图片上传1") + private int signType; + + /** + * 维修完成时间 + */ + @Excel(name = "维修时间",sort = 1) + private String repairTime; + + /** + * 单位 + */ + @Excel(name = "单位",sort = 8) + private String unit; + + @ApiModelProperty(value = "单位id") + private Long unitId; + + @ApiModelProperty(value="工程id") + private Long proId; + + @ApiModelProperty(value = "类型id") + private String typeId; + + @ApiModelProperty(value = "规格id") + private String typeModelId; +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairServiceImpl.java index aff744df..8c7c287d 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairServiceImpl.java @@ -1973,6 +1973,13 @@ public class RepairServiceImpl implements RepairService { @Override public List getRepairQueryList(RepairTask bean) { try { + Long userId = SecurityUtils.getLoginUser().getUserid(); + Set userRoles = SecurityUtils.getLoginUser().getRoles(); + // 检查用户是否具有特殊角色 + boolean hasSpecialRole = hasSpecialRole(userRoles); + if (!hasSpecialRole) { + bean.setUserId(userId == 0 ? null : userId); + } return repairMapper.getRepairQueryList(bean); } catch (Exception e) { log.error("查询修试查询列表", e.getMessage()); @@ -1983,6 +1990,13 @@ public class RepairServiceImpl implements RepairService { @Override public List getRepairAuditQueryList(RepairTask bean) { try { + Long userId = SecurityUtils.getLoginUser().getUserid(); + Set userRoles = SecurityUtils.getLoginUser().getRoles(); + // 检查用户是否具有特殊角色 + boolean hasSpecialRole = hasSpecialRole(userRoles); + if (!hasSpecialRole) { + bean.setUserId(userId == 0 ? null : userId); + } return repairMapper.getRepairAuditQueryList(bean); } catch (Exception e) { log.error("查询修试查询列表", e.getMessage()); 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 ad6bcd10..d6d9ebb0 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 @@ -1687,6 +1687,9 @@ LEFT JOIN back_apply_info bai ON rad.back_id = bai.id LEFT JOIN ma_type mt on mt.type_id=rad.type_id LEFT JOIN ma_type mt2 on mt2.type_id=mt.parent_id + + JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId} + WHERE rad.is_ds = 0 @@ -1714,6 +1717,15 @@ and mt.type_id = #{typeModelId} + + AND tt.task_status = #{repairStatus} + + + and (tt.task_status = 3 or tt.task_status = 4) + + + and (tt.task_status = 1 or tt.task_status = 2) + GROUP BY rad.task_id,rad.type_id ORDER BY tt.create_time desc @@ -1731,6 +1743,9 @@ LEFT JOIN tm_task tt2 ON tt2.task_id = rad.repair_id LEFT JOIN ma_type mt ON rad.type_id = mt.type_id LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id + + JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId} + WHERE tt.create_time < '2025-08-20 00:00:00' AND tt.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') @@ -1748,6 +1763,9 @@ and mt.type_id = #{typeModelId} + + AND tt.task_status = #{taskStatus} + GROUP BY rad.task_id, rad.type_id UNION @@ -1764,6 +1782,9 @@ LEFT JOIN tm_task tt2 ON tt2.task_id = tt.pre_task_id LEFT JOIN ma_type mt ON rad.type_id = mt.type_id LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id + + JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId} + WHERE tt.create_time >= '2025-08-20 00:00:00' AND tt.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') @@ -1781,6 +1802,9 @@ and mt.type_id = #{typeModelId} + + AND tt.task_status = #{taskStatus} + GROUP BY rad.task_id, rad.type_id) a order by createTime desc From 2851805852709d379ec339fe7f7f3069ca4650ea Mon Sep 17 00:00:00 2001 From: mashuai Date: Wed, 12 Nov 2025 17:33:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ma/service/impl/MachineServiceImpl.java | 22 +++--- .../controller/IwsCostPushController.java | 12 +-- .../material/push/domain/IwsCostPushBean.java | 2 +- .../service/impl/IwsCostPushServiceImpl.java | 24 +++--- .../lease/LeaseApplyDetailsMapper.xml | 3 + .../mapper/material/ma/MachineMapper.xml | 75 ++++++++++--------- .../settlement/SltAgreementInfoMapper.xml | 4 +- 7 files changed, 79 insertions(+), 63 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java index 006f4b42..89e9e37d 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java @@ -224,21 +224,19 @@ public class MachineServiceImpl implements IMachineService //查询ma_machine表,安全工器具 list = machineMapper.getElectronicLabel(machine); } - for (Machine dto : list){ - Date nextCheckTime = dto.getNextCheckTime(); - Date todayStart = new Date(); // 获取当前时间 - // 将 todayStart 设置为当天的开始时间(00:00:00) - todayStart = Date.from(todayStart.toInstant().atZone(ZoneId.systemDefault()) - .withHour(0).withMinute(0).withSecond(0).withNano(0) - .toInstant()); - if (nextCheckTime != null && nextCheckTime.before(todayStart)) { - type=1; - throw new RuntimeException("该工器具已临近下次检验时间,请及时退还至机具(物流)分公司!"); - } - } if (CollectionUtils.isNotEmpty(list)) { for (Machine dto : list) { + Date nextCheckTime = dto.getNextCheckTime(); + Date todayStart = new Date(); // 获取当前时间 + // 将 todayStart 设置为当天的开始时间(00:00:00) + todayStart = Date.from(todayStart.toInstant().atZone(ZoneId.systemDefault()) + .withHour(0).withMinute(0).withSecond(0).withNano(0) + .toInstant()); + if (nextCheckTime != null && nextCheckTime.before(todayStart)) { + type=1; + throw new RuntimeException("该工器具已临近下次检验时间,请及时退还至机具(物流)分公司!"); + } // 根据typeId查询信息 Machine info = machineMapper.selectHouse(dto); if (info != null) { diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/IwsCostPushController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/IwsCostPushController.java index 494413b7..df50d329 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/IwsCostPushController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/IwsCostPushController.java @@ -1,18 +1,20 @@ package com.bonus.material.push.controller; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.convert.Convert; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.bonus.common.biz.config.ListPagingUtil; import com.bonus.common.biz.utils.AesEncryptUtils; import com.bonus.common.biz.utils.HttpHelper; import com.bonus.common.biz.utils.StringHelper; import com.bonus.common.core.exception.ServiceException; +import com.bonus.common.core.utils.ServletUtils; import com.bonus.common.core.utils.poi.ExcelUtil; import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.core.web.page.TableDataInfo; import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo; -import com.bonus.material.clz.domain.vo.lease.LeaseTotalInfo; import com.bonus.material.push.domain.IwsCostPushBean; import com.bonus.material.push.domain.vo.IwsCostPushExportVo; import com.bonus.material.push.service.IwsCostPushService; @@ -25,7 +27,6 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; import java.math.BigDecimal; import java.util.*; import java.util.stream.Collectors; @@ -55,10 +56,11 @@ public class IwsCostPushController extends BaseController { */ @ApiOperation("查询协议推送匹配列表--分页") @GetMapping("/findAgreementPushMatchList") - public TableDataInfo findAgreementPushMatchList(IwsCostPushBean obj) { - startPage(); + public AjaxResult findAgreementPushMatchList(IwsCostPushBean obj) { + Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); + Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); List list = iwsCostPushService.findAgreement(obj); - return getDataTable(list); + return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); } /** diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/IwsCostPushBean.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/IwsCostPushBean.java index c7b24d5e..925dca4f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/IwsCostPushBean.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/IwsCostPushBean.java @@ -144,7 +144,7 @@ public class IwsCostPushBean implements Serializable { // 是否匹配 @Excel(name = "是否匹配", readConverterExp = "0=未匹配,1=已匹配", sort = 5) - private Byte isMatch = 0; + private Byte isMatch; private String userName; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/IwsCostPushServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/IwsCostPushServiceImpl.java index bd6cd5e9..3822a8da 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/IwsCostPushServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/IwsCostPushServiceImpl.java @@ -68,15 +68,21 @@ public class IwsCostPushServiceImpl implements IwsCostPushService { public List findAgreement(IwsCostPushBean o) { List pushBeanList = iwsCostPushMapper.findAgreement(o); - // 使用流式操作过滤掉null值,并设置isMatch属性 - return pushBeanList.stream() - .filter(Objects::nonNull) - .peek(bean -> { - if (StringUtils.isNotBlank(bean.getProjectId()) && StringUtils.isNotBlank(bean.getProjectCode())) { - bean.setIsMatch((byte) 1); - } - }) - .collect(Collectors.toList()); + pushBeanList.forEach(bean -> { + if (bean != null) { + if (StringUtils.isNotBlank(bean.getProjectId()) && StringUtils.isNotBlank(bean.getProjectCode())) { + bean.setIsMatch((byte) 1); + } else { + bean.setIsMatch((byte) 0); + } + } + }); + + if (o.getIsMatch() != null) { + pushBeanList = pushBeanList.stream().filter(bean -> bean.getIsMatch().equals(o.getIsMatch())).collect(Collectors.toList()); + } + + return pushBeanList; } /** diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml index a113f346..a7fe7268 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml @@ -432,6 +432,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" JOIN ma_type_keeper mtk ON mtk.type_id = lod.type_id AND mtk.user_id = #{userId} WHERE lod.parent_id = #{id} + + AND lod.publish_task = #{publishTask} + and mt4.type_id in diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml index 5cda7c47..60c28eed 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml @@ -518,40 +518,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml index b4913d8a..ba226fb3 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml @@ -329,8 +329,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sai.lease_price as leasePrice, sai.num as num, DATE(sai.start_time) as startTime, - DATE(sai.end_time) as endTime, - DATEDIFF(IF(sai.end_time is null,CURDATE(),sai.end_time), sai.start_time) + 1 as leaseDays + IF(sai.end_time is null, if(sai.is_slt = 1, sai.slt_time, CURDATE()) ,sai.end_time) as endTime, + DATEDIFF(IF(sai.end_time is null, if(sai.is_slt = 1, sai.slt_time, CURDATE()) ,sai.end_time), sai.start_time) + 1 as leaseDays from slt_agreement_info sai LEFT JOIN bm_agreement_info bai on sai.agreement_id = bai.agreement_id LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id