导出预报废审核列表
This commit is contained in:
parent
54c2460965
commit
d92af0df79
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.bonus.sgzb.common.core.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 报废来源
|
||||||
|
*/
|
||||||
|
public enum ScrapSourceEnum {
|
||||||
|
|
||||||
|
MATERIAL_RETURN(1, "退料"),
|
||||||
|
MAINTENANCE_COST(2, "维修"),
|
||||||
|
MAKE_AN_INVENTORY(3, "盘点"),
|
||||||
|
;
|
||||||
|
|
||||||
|
private final Integer code;
|
||||||
|
private final String info;
|
||||||
|
|
||||||
|
ScrapSourceEnum(Integer code, String info) {
|
||||||
|
this.code = code;
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInfo() {
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer getCodeByInfo(String info) {
|
||||||
|
for (ScrapSourceEnum value : ScrapSourceEnum.values()) {
|
||||||
|
if (value.getInfo().equals(info)) {
|
||||||
|
return value.getCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getInfoByCode(Integer code) {
|
||||||
|
for (ScrapSourceEnum value : ScrapSourceEnum.values()) {
|
||||||
|
if (value.getCode().equals(code)) {
|
||||||
|
return value.getInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -56,12 +56,12 @@ public enum TaskStatusEnum {
|
||||||
/**
|
/**
|
||||||
* 报废任务--报废审核通过
|
* 报废任务--报废审核通过
|
||||||
*/
|
*/
|
||||||
SCRAP_PASSED("59", "报废审核通过"),
|
SCRAP_PASSED("59", "审核通过"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报废任务--报废审核驳回
|
* 报废任务--报废审核驳回
|
||||||
*/
|
*/
|
||||||
SCRAP_REJECTED("61", "报废审核驳回"),
|
SCRAP_REJECTED("61", "审核驳回"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处置情况--宁夏处置管理 0 未处置
|
* 处置情况--宁夏处置管理 0 未处置
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,21 @@
|
||||||
package com.bonus.sgzb.material.controller;
|
package com.bonus.sgzb.material.controller;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.common.core.enums.ScrapSourceEnum;
|
||||||
import com.bonus.sgzb.material.domain.*;
|
import com.bonus.sgzb.material.domain.*;
|
||||||
import com.bonus.sgzb.material.service.IScrapApplyDetailsService;
|
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.ScrapApplyDetailsVO;
|
||||||
import com.bonus.sgzb.material.vo.ScrapAudit;
|
import com.bonus.sgzb.material.vo.ScrapAudit;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|
@ -233,9 +238,9 @@ public class ScrapApplyDetailsController extends BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出预报废任务列表
|
* 导出预报废审核列表
|
||||||
*/
|
*/
|
||||||
@Log(title = "导出预报废任务列表", businessType = BusinessType.EXPORT)
|
@Log(title = "导出预报废审核列表", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/exportForecastWaste")
|
@PostMapping("/exportForecastWaste")
|
||||||
public void exportForecastWaste(HttpServletResponse response, ScrapApplyDetails scrapApplyDetails)
|
public void exportForecastWaste(HttpServletResponse response, ScrapApplyDetails scrapApplyDetails)
|
||||||
{
|
{
|
||||||
|
|
@ -247,9 +252,10 @@ public class ScrapApplyDetailsController extends BaseController
|
||||||
params.put("endTime", endTime+" 23:59:59");
|
params.put("endTime", endTime+" 23:59:59");
|
||||||
scrapApplyDetails.setParams(params);
|
scrapApplyDetails.setParams(params);
|
||||||
}
|
}
|
||||||
List<ScrapApplyDetailsVO> list = scrapApplyDetailsService.getScrapApplyList(scrapApplyDetails);
|
//获取预报废列表
|
||||||
ExcelUtil<ScrapApplyDetailsVO> util = new ExcelUtil<ScrapApplyDetailsVO>(ScrapApplyDetailsVO.class);
|
List<ForecastWasteExcel> ForecastWasteExcelList = scrapApplyDetailsService.exportForecastWaste(scrapApplyDetails);
|
||||||
util.exportExcel(response, list, "预报废任务列表");
|
ExcelUtil<ForecastWasteExcel> util = new ExcelUtil<>(ForecastWasteExcel.class);
|
||||||
|
util.exportExcel(response, ForecastWasteExcelList, "预报废审核列表");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.sgzb.material.domain;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
@ -111,6 +112,10 @@ public class ScrapApplyDetails extends BaseEntity
|
||||||
private String keyword;
|
private String keyword;
|
||||||
private String typeName;
|
private String typeName;
|
||||||
|
|
||||||
|
/** 任务ID集合 --导出时可以选择导出*/
|
||||||
|
@ApiModelProperty(value = "任务ID集合")
|
||||||
|
private String taskIdList;
|
||||||
|
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.bonus.sgzb.material.service;
|
package com.bonus.sgzb.material.service;
|
||||||
|
|
||||||
import com.bonus.sgzb.material.domain.*;
|
import com.bonus.sgzb.material.domain.*;
|
||||||
|
import com.bonus.sgzb.material.vo.ForecastWasteExcel;
|
||||||
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
|
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
|
||||||
import com.bonus.sgzb.material.vo.ScrapAudit;
|
import com.bonus.sgzb.material.vo.ScrapAudit;
|
||||||
|
|
||||||
|
|
@ -139,4 +140,11 @@ public interface IScrapApplyDetailsService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int obtainDisposal(List<TmTask> tmTaskList);
|
int obtainDisposal(List<TmTask> tmTaskList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出预报废审核列表
|
||||||
|
* @param scrapApplyDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ForecastWasteExcel> exportForecastWaste(ScrapApplyDetails scrapApplyDetails);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import java.util.stream.Collectors;
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.bonus.sgzb.common.core.constant.TaskTypeConstants;
|
import com.bonus.sgzb.common.core.constant.TaskTypeConstants;
|
||||||
import com.bonus.sgzb.common.core.enums.ReviewStatusEnum;
|
import com.bonus.sgzb.common.core.enums.ReviewStatusEnum;
|
||||||
|
import com.bonus.sgzb.common.core.enums.ScrapSourceEnum;
|
||||||
import com.bonus.sgzb.common.core.enums.TaskStatusEnum;
|
import com.bonus.sgzb.common.core.enums.TaskStatusEnum;
|
||||||
import com.bonus.sgzb.common.core.enums.TaskTypeEnum;
|
import com.bonus.sgzb.common.core.enums.TaskTypeEnum;
|
||||||
import com.bonus.sgzb.common.core.exception.ServiceException;
|
import com.bonus.sgzb.common.core.exception.ServiceException;
|
||||||
|
|
@ -20,6 +21,7 @@ import com.bonus.sgzb.material.domain.*;
|
||||||
import com.bonus.sgzb.material.exception.ExceptionDict;
|
import com.bonus.sgzb.material.exception.ExceptionDict;
|
||||||
import com.bonus.sgzb.material.mapper.*;
|
import com.bonus.sgzb.material.mapper.*;
|
||||||
import com.bonus.sgzb.material.service.IScrapApplyDetailsService;
|
import com.bonus.sgzb.material.service.IScrapApplyDetailsService;
|
||||||
|
import com.bonus.sgzb.material.vo.ForecastWasteExcel;
|
||||||
import com.bonus.sgzb.material.vo.GlobalContants;
|
import com.bonus.sgzb.material.vo.GlobalContants;
|
||||||
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
|
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
|
||||||
import com.bonus.sgzb.material.vo.ScrapAudit;
|
import com.bonus.sgzb.material.vo.ScrapAudit;
|
||||||
|
|
@ -288,6 +290,28 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
||||||
return BigDecimal.ROUND_DOWN;
|
return BigDecimal.ROUND_DOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出预报废
|
||||||
|
* @param scrapApplyDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ForecastWasteExcel> exportForecastWaste(ScrapApplyDetails scrapApplyDetails) {
|
||||||
|
List<ScrapApplyDetailsVO> scrapApplyDetailsList = this.getScrapApplyList(scrapApplyDetails);
|
||||||
|
List<ForecastWasteExcel> ForecastWasteExcelList = new ArrayList<>();
|
||||||
|
ForecastWasteExcel forecastWasteExcel = new ForecastWasteExcel();
|
||||||
|
//对预报废来源进行处理
|
||||||
|
for (ScrapApplyDetailsVO scrapApplyDetailsVO: scrapApplyDetailsList) {
|
||||||
|
BeanUtils.copyProperties(scrapApplyDetailsVO,forecastWasteExcel);
|
||||||
|
//获取来源单号
|
||||||
|
forecastWasteExcel.setRepairNum(scrapApplyDetailsVO.getRepairNum()!=null?scrapApplyDetailsVO.getRepairNum(): scrapApplyDetailsVO.getRepairCode());
|
||||||
|
//获取来源名称
|
||||||
|
forecastWasteExcel.setScrapSourceName(ScrapSourceEnum.getInfoByCode(scrapApplyDetailsVO.getScrapSource()));
|
||||||
|
ForecastWasteExcelList.add(forecastWasteExcel);
|
||||||
|
}
|
||||||
|
return ForecastWasteExcelList;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成报废任务
|
* 生成报废任务
|
||||||
* @param taskId
|
* @param taskId
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
package com.bonus.sgzb.material.vo;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ForecastWasteExcel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预报废单号
|
||||||
|
*/
|
||||||
|
@Excel(name = "预报废单号",sort = 1)
|
||||||
|
private String scrapNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报废来源
|
||||||
|
*/
|
||||||
|
@Excel(name = "报废来源",sort = 2)
|
||||||
|
private String scrapSourceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单号
|
||||||
|
*/
|
||||||
|
@Excel(name = "单号",sort = 3)
|
||||||
|
private String repairNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "单位名称",sort = 4)
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "工程名称",sort = 5)
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机具类型
|
||||||
|
*/
|
||||||
|
@Excel(name = "机具类型",sort = 6)
|
||||||
|
private String itemType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务创建人
|
||||||
|
*/
|
||||||
|
@Excel(name = "任务创建人",sort = 7)
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Excel(name = "任务创建时间",sort = 8)
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态
|
||||||
|
*/
|
||||||
|
@Excel(name = "审核状态",sort = 9)
|
||||||
|
private String taskStatusName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 不通过原因
|
||||||
|
*/
|
||||||
|
@Excel(name = "不通过原因",sort = 10)
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
|
|
@ -471,6 +471,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="repairStatus != null and repairStatus != ''">
|
<if test="repairStatus != null and repairStatus != ''">
|
||||||
and tk.task_status = #{repairStatus}
|
and tk.task_status = #{repairStatus}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="taskIdList != null and taskIdList != ''">
|
||||||
|
and tk.task_id in #{taskIdList}
|
||||||
|
</if>
|
||||||
<if test="backPro != null and backPro != ''">
|
<if test="backPro != null and backPro != ''">
|
||||||
and bpl.lot_id = #{backPro}
|
and bpl.lot_id = #{backPro}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -50,25 +50,25 @@ import java.util.stream.Collectors;
|
||||||
@RequestMapping("/user")
|
@RequestMapping("/user")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class SysUserController extends BaseController {
|
public class SysUserController extends BaseController {
|
||||||
@Autowired
|
@Resource
|
||||||
private ISysUserService userService;
|
private ISysUserService userService;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private ISysRoleService roleService;
|
private ISysRoleService roleService;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private ISysDeptService deptService;
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private ISysPostService postService;
|
private ISysPostService postService;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private ISysSmsService smsService;
|
private ISysSmsService smsService;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private ISysPermissionService permissionService;
|
private ISysPermissionService permissionService;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private ISysConfigService configService;
|
private ISysConfigService configService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue