From 876e346a7e7177fe98206cc979503b07748442f0 Mon Sep 17 00:00:00 2001 From: "liang.chao" Date: Thu, 16 May 2024 17:59:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=BA=9F=E5=AF=BC=E5=87=BA=E5=92=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2bug=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ScrapApplyDetailsController.java | 110 ++++++------- .../material/domain/ScrapApplyDetails.java | 1 + .../material/vo/ScrapApplyDetailsBFCZ.java | 140 +++++++++++++++++ .../material/vo/ScrapApplyDetailsBFLB.java | 145 ++++++++++++++++++ .../material/vo/ScrapApplyDetailsBFSH.java | 140 +++++++++++++++++ .../material/ScrapApplyDetailsMapper.xml | 10 +- .../resources/mapper/material/TaskMapper.xml | 8 +- 7 files changed, 495 insertions(+), 59 deletions(-) create mode 100644 sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/ScrapApplyDetailsBFCZ.java create mode 100644 sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/ScrapApplyDetailsBFLB.java create mode 100644 sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/ScrapApplyDetailsBFSH.java diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/ScrapApplyDetailsController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/ScrapApplyDetailsController.java index 6e4edd4d..f7001083 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/ScrapApplyDetailsController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/ScrapApplyDetailsController.java @@ -1,39 +1,34 @@ package com.bonus.sgzb.material.controller; -import java.util.ArrayList; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; -import com.bonus.sgzb.common.core.enums.ScrapSourceEnum; +import cn.hutool.core.convert.Convert; +import com.bonus.sgzb.common.core.utils.ListPagingUtil; +import com.bonus.sgzb.common.core.utils.ServletUtils; import com.bonus.sgzb.material.domain.*; import com.bonus.sgzb.material.service.IScrapApplyDetailsService; -import com.bonus.sgzb.material.vo.ForecastWasteExcel; -import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO; -import com.bonus.sgzb.material.vo.ScrapAudit; +import com.bonus.sgzb.material.vo.*; import com.github.pagehelper.PageHelper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.bonus.sgzb.common.log.annotation.Log; import com.bonus.sgzb.common.log.enums.BusinessType; -import com.bonus.sgzb.common.security.annotation.RequiresPermissions; import com.bonus.sgzb.common.core.web.controller.BaseController; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.core.utils.poi.ExcelUtil; import com.bonus.sgzb.common.core.web.page.TableDataInfo; +import static com.bonus.sgzb.common.core.constant.Constants.PAGE_NUM; +import static com.bonus.sgzb.common.core.constant.Constants.PAGE_SIZE; + /** * 报废任务详细 * @@ -66,24 +61,7 @@ public class ScrapApplyDetailsController extends BaseController { return getDataTable(list); } - /** - * 导出报废任务列表 - */ - @Log(title = "导出报废任务列表", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, ScrapApplyDetails bean) { - Map params = bean.getParams(); - if (params != null && !params.isEmpty()) { - String beginTime = (String) params.get("beginTime"); - String endTime = (String) params.get("endTime"); - params.put("beginTime", beginTime + " 00:00:00"); - params.put("endTime", endTime + " 23:59:59"); - bean.setParams(params); - } - List list = scrapApplyDetailsService.exportScrapApplyDetailsList(bean); - ExcelUtil util = new ExcelUtil(ScrapApplyDetailsVO.class); - util.exportExcel(response, list, "报废任务列表"); - } + /** * 查看报废任务详细列表 @@ -172,22 +150,17 @@ public class ScrapApplyDetailsController extends BaseController { * 查询报废审核任务列表 */ @ApiOperation("查询报废审核任务列表") - @PostMapping("/scrapTaskReviewList") - public TableDataInfo scrapTaskReviewList(ScrapApplyDetails scrapApplyDetails) { - startPage(); - Map params = scrapApplyDetails.getParams(); - if (!params.isEmpty()) { - String beginTime = (String) params.get("beginTime"); - String endTime = (String) params.get("endTime"); - params.put("beginTime", beginTime + " 00:00:00"); - params.put("endTime", endTime + " 23:59:59"); - scrapApplyDetails.setParams(params); - } + @GetMapping("/scrapTaskReviewList") + public AjaxResult scrapTaskReviewList(ScrapApplyDetails scrapApplyDetails) { List list = scrapApplyDetailsService.scrapTaskReviewList(scrapApplyDetails); - return getDataTable(list); + Integer pageIndex = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); + Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); + return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); } + + /** * 报废任务审核----宁夏 */ @@ -204,18 +177,13 @@ public class ScrapApplyDetailsController extends BaseController { */ @ApiOperation("获取处置列表----宁夏") @Log(title = "获取处置列表----宁夏", businessType = BusinessType.UPDATE) - @PostMapping("/obtainDisposalList") - public TableDataInfo obtainDisposalList(@RequestBody ScrapApplyDetails scrapApplyDetails) { + @GetMapping("/obtainDisposalList") + public TableDataInfo obtainDisposalList(ScrapApplyDetails scrapApplyDetails) { startPage(); - Map params = scrapApplyDetails.getParams(); - if (!params.isEmpty()) { - String beginTime = (String) params.get("beginTime"); - String endTime = (String) params.get("endTime"); - params.put("beginTime", beginTime + " 00:00:00"); - params.put("endTime", endTime + " 23:59:59"); - scrapApplyDetails.setParams(params); - } List list = scrapApplyDetailsService.obtainDisposalList(scrapApplyDetails); +// Integer pageIndex = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); +// Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); +// return AjaxResult.success(ListPagingUtil.paging(pageIndex,pageSize, list)); return getDataTable(list); } @@ -227,14 +195,48 @@ public class ScrapApplyDetailsController extends BaseController { @Log(title = "处置----宁夏", businessType = BusinessType.UPDATE) @PostMapping("/obtainDisposal") public AjaxResult obtainDisposal(@RequestBody List tmTaskList) { - return toAjax(scrapApplyDetailsService.obtainDisposal(tmTaskList)); } + /** + * 导出报废任务列表 + */ + @Log(title = "导出预报废管理-报废列表", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ScrapApplyDetails bean) { + List list = scrapApplyDetailsService.selectScrapApplyDetailsList(bean); + List tmTaskDtos = Convert.toList(ScrapApplyDetailsBFLB.class, list); + ExcelUtil util = new ExcelUtil(ScrapApplyDetailsBFLB.class); + util.exportExcel(response, tmTaskDtos, "报废列表"); + } + + /** + * 导出报废审核任务列表 + */ + @ApiOperation("导出报废管理-报废审核列表") + @PostMapping("/exportScrapTaskReviewList") + public void exportScrapTaskReviewList(HttpServletResponse response, ScrapApplyDetails scrapApplyDetails) { + List list = scrapApplyDetailsService.scrapTaskReviewList(scrapApplyDetails); + List tmTaskDtos = Convert.toList(ScrapApplyDetailsBFSH.class, list); + ExcelUtil util = new ExcelUtil(ScrapApplyDetailsBFSH.class); + util.exportExcel(response, tmTaskDtos, "报废审核列表"); + } + + /** + * 导出报废处置任务列表 + */ + @ApiOperation("导出报废管理-报废处置列表") + @PostMapping("/exportObtainDisposalList") + public void exportObtainDisposalList(HttpServletResponse response, ScrapApplyDetails scrapApplyDetails) { + List list = scrapApplyDetailsService.obtainDisposalList(scrapApplyDetails); + List tmTaskDtos = Convert.toList(ScrapApplyDetailsBFCZ.class, list); + ExcelUtil util = new ExcelUtil(ScrapApplyDetailsBFCZ.class); + util.exportExcel(response, tmTaskDtos, "报废处置列表"); + } /** * 导出预报废审核列表 */ - @Log(title = "导出预报废审核列表", businessType = BusinessType.EXPORT) + @Log(title = "导出预报废管理-预报废审核列表", businessType = BusinessType.EXPORT) @PostMapping("/exportForecastWaste") public void exportForecastWaste(HttpServletResponse response, ScrapApplyDetails scrapApplyDetails) { Map params = scrapApplyDetails.getParams(); diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ScrapApplyDetails.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ScrapApplyDetails.java index 638559bc..a0216ad8 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ScrapApplyDetails.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ScrapApplyDetails.java @@ -35,6 +35,7 @@ public class ScrapApplyDetails extends BaseEntity * 审核状态 */ private Integer taskStatus; + private Integer disposition; /** 上级ID */ @ApiModelProperty(value = "上级ID") diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/ScrapApplyDetailsBFCZ.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/ScrapApplyDetailsBFCZ.java new file mode 100644 index 00000000..e015e780 --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/ScrapApplyDetailsBFCZ.java @@ -0,0 +1,140 @@ +package com.bonus.sgzb.material.vo; + +import com.bonus.sgzb.common.core.annotation.Excel; +import com.bonus.sgzb.material.domain.ScrapAuditorSet; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/**报废列表导出dto + * @Author 阮世耀 + * @Create 2023/12/13 15:45 + * @Version 1.0 + */ +@Data +public class ScrapApplyDetailsBFCZ implements Serializable { + + private static final long serialVersionUID = -4135112109792782142L; + /** + * 任务id + */ + private Long taskId; + + /** + * 报废审核单号 + */ + @Excel(name = "报废单号",sort = 1) + private String scrapNum; + + /** + * 单位名称 + */ + @Excel(name = "退料单位名称",sort = 4) + private String unitName; + + /** + * 工程名称 + */ + @Excel(name = "退料工程名称",sort = 5) + private String projectName; + + /** + * 任务创建人 + */ + @Excel(name = "任务创建人",sort = 7) + private String createBy; + + /** + * 机具类型 + */ + @Excel(name = "机具类型",sort = 6) + private String itemType; + /** + * 创建时间 + */ + @Excel(name = "任务创建时间",sort = 8) + private String createTime; + + /** + * 维修单号 + */ + @Excel(name = "预报废单号",sort = 3) + private String repairNum; + /** + * 单位id + */ + private String unitId; + /** + * 工程id + */ + private String projectId; + + /** + * 审核状态 + */ + private Integer taskStatus; + + /** + * 审核状态 + */ + private String taskStatusName; + + /** + * 不通过原因 + */ + private String remark; + + /** + * 机具类型 + */ + private String type; + + /** + * 规格型号 + */ + private String typeName; + + @ApiModelProperty(value = "机具编号") + private String maCode; + + + /** 报废数量 */ + private BigDecimal scrapNum2; + + + /** + * 报废来源 + */ + @Excel(name = "报废来源",sort = 2,readConverterExp = "1=退料,2=维修") + private Integer scrapSource; + + /** + *退料单号 + */ + private String repairCode; + + /** + * 审核部门列表 + */ + private List scrapAuditorSetList; + + /** + * 处置 + */ + @Excel(name = "处置状态",sort = 9,readConverterExp = "0=未处置,1=已处置") + private Integer disposition; + + /** + * 文件地址 + */ + private String dispositionFileUrl; + + /** + * 文件名称 + */ + private String dispositionFileName; + private String companyId; +} diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/ScrapApplyDetailsBFLB.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/ScrapApplyDetailsBFLB.java new file mode 100644 index 00000000..9abaa729 --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/ScrapApplyDetailsBFLB.java @@ -0,0 +1,145 @@ +package com.bonus.sgzb.material.vo; + +import com.bonus.sgzb.common.core.annotation.Excel; +import com.bonus.sgzb.material.domain.ScrapAuditorSet; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 报废列表导出dto + * + * @Author 阮世耀 + * @Create 2023/12/13 15:45 + * @Version 1.0 + */ +@Data +public class ScrapApplyDetailsBFLB implements Serializable { + + private static final long serialVersionUID = -4135112109792782142L; + /** + * 任务id + */ + private Long taskId; + + /** + * 报废审核单号 + */ + @Excel(name = "报废单号", sort = 1) + private String scrapNum; + + /** + * 单位名称 + */ + @Excel(name = "退料单位名称", sort = 4) + private String unitName; + + /** + * 工程名称 + */ + @Excel(name = "退料工程名称", sort = 5) + private String projectName; + + /** + * 任务创建人 + */ + @Excel(name = "任务创建人", sort = 7) + private String createBy; + + /** + * 机具类型 + */ + @Excel(name = "机具类型", sort = 6) + private String itemType; + /** + * 创建时间 + */ + @Excel(name = "任务创建时间", sort = 8) + private String createTime; + + /** + * 维修单号 + */ + @Excel(name = "预报废单号", sort = 3) + private String repairNum; + /** + * 单位id + */ + private String unitId; + /** + * 工程id + */ + private String projectId; + + /** + * 审核状态 + */ + @Excel(name = "审核状态", sort = 9, readConverterExp = "58=审核中,59=已通过,61=已驳回,124=待提交") + private Integer taskStatus; + + /** + * 审核状态 + */ + + private String taskStatusName; + + /** + * 不通过原因 + */ + private String remark; + + /** + * 机具类型 + */ + private String type; + + /** + * 规格型号 + */ + private String typeName; + + @ApiModelProperty(value = "机具编号") + private String maCode; + + + /** + * 报废数量 + */ + private BigDecimal scrapNum2; + + + /** + * 报废来源 + */ + @Excel(name = "报废来源", sort = 2, readConverterExp = "1=退料,2=维修") + private Integer scrapSource; + + /** + * 退料单号 + */ + private String repairCode; + + /** + * 审核部门列表 + */ + private List scrapAuditorSetList; + + /** + * 处置 + */ + private Integer disposition; + + /** + * 文件地址 + */ + private String dispositionFileUrl; + + /** + * 文件名称 + */ + private String dispositionFileName; + private String companyId; +} diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/ScrapApplyDetailsBFSH.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/ScrapApplyDetailsBFSH.java new file mode 100644 index 00000000..5a415ce6 --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/ScrapApplyDetailsBFSH.java @@ -0,0 +1,140 @@ +package com.bonus.sgzb.material.vo; + +import com.bonus.sgzb.common.core.annotation.Excel; +import com.bonus.sgzb.material.domain.ScrapAuditorSet; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/**报废审核导出dto + * @Author 阮世耀 + * @Create 2023/12/13 15:45 + * @Version 1.0 + */ +@Data +public class ScrapApplyDetailsBFSH implements Serializable { + + private static final long serialVersionUID = -4135112109792782142L; + /** + * 任务id + */ + private Long taskId; + + /** + * 报废审核单号 + */ + @Excel(name = "报废单号",sort = 1) + private String scrapNum; + + /** + * 单位名称 + */ + @Excel(name = "退料单位名称",sort = 4) + private String unitName; + + /** + * 工程名称 + */ + @Excel(name = "退料工程名称",sort = 5) + private String projectName; + + /** + * 任务创建人 + */ + @Excel(name = "任务创建人",sort = 7) + private String createBy; + + /** + * 机具类型 + */ + @Excel(name = "机具类型",sort = 6) + private String itemType; + /** + * 创建时间 + */ + @Excel(name = "任务创建时间",sort = 8) + private String createTime; + + /** + * 维修单号 + */ + @Excel(name = "预报废单号",sort = 3) + private String repairNum; + /** + * 单位id + */ + private String unitId; + /** + * 工程id + */ + private String projectId; + + /** + * 审核状态 + */ + private Integer taskStatus; + + /** + * 审核状态 + */ + @Excel(name = "审核状态",sort = 9) + private String taskStatusName; + + /** + * 不通过原因 + */ + private String remark; + + /** + * 机具类型 + */ + private String type; + + /** + * 规格型号 + */ + private String typeName; + + @ApiModelProperty(value = "机具编号") + private String maCode; + + + /** 报废数量 */ + private BigDecimal scrapNum2; + + + /** + * 报废来源 + */ + @Excel(name = "报废来源",sort = 2,readConverterExp = "1=退料,2=维修") + private Integer scrapSource; + + /** + *退料单号 + */ + private String repairCode; + + /** + * 审核部门列表 + */ + private List scrapAuditorSetList; + + /** + * 处置 + */ + private Integer disposition; + + /** + * 文件地址 + */ + private String dispositionFileUrl; + + /** + * 文件名称 + */ + private String dispositionFileName; + private String companyId; +} diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml index a1ab61ba..1476c200 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml @@ -564,11 +564,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and mt1.type_id = #{type} + + and dic.id = #{taskStatus} + + + and sad.scrap_source = #{scrapSource} + and locate(#{backCode}, tk.code) > 0 - - and tk.create_time between #{params.beginTime} and #{params.endTime} + + and tk.create_time between #{beginTime} and #{endTime} GROUP BY tk.CODE order by tk.create_time desc diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/TaskMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/TaskMapper.xml index 438ff712..48ec9600 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/TaskMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/TaskMapper.xml @@ -255,7 +255,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ORDER BY create_time DESC LIMIT 1