催办,退料报废,维修报废,预报废审核,报废审核
This commit is contained in:
parent
382a4fb6a1
commit
40736e1c85
|
|
@ -0,0 +1,21 @@
|
|||
package com.bonus.sgzb.common.core.constant;
|
||||
|
||||
public class TaskTypeConstants {
|
||||
|
||||
/**
|
||||
* 预报废任务
|
||||
*/
|
||||
public static final String YBF = "YBF";
|
||||
|
||||
/**
|
||||
* 报废任务
|
||||
*/
|
||||
public static final String BF = "BF";
|
||||
|
||||
/**
|
||||
* 维修任务
|
||||
*/
|
||||
public static final String WX = "WX";
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.bonus.sgzb.common.core.enums;
|
||||
|
||||
public enum CostTypeEnum {
|
||||
|
||||
|
||||
LEASE_COST("1", "租赁"),
|
||||
LOSE_COST("2", "丢失"),
|
||||
MAINTENANCE_COST("3", "维修"),
|
||||
SCRAP_COST("4", "报废");
|
||||
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
CostTypeEnum(String code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.bonus.sgzb.common.core.enums;
|
||||
|
||||
public enum PartTypeEnum {
|
||||
|
||||
|
||||
NOT_CHARGE("0", "不收费"),
|
||||
CHARGE("1", "收费");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
PartTypeEnum(String code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
public static String getCodeByInfo(String info){
|
||||
for (PartTypeEnum type : PartTypeEnum.values()) {
|
||||
if (type.info.equals(info)) {
|
||||
return type.code;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getInfoByCode(String code){
|
||||
for (PartTypeEnum type : PartTypeEnum.values()) {
|
||||
if (type.code.equals(code)) {
|
||||
return type.info;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.bonus.sgzb.common.core.enums;
|
||||
|
||||
public enum ReviewStatusEnum {
|
||||
|
||||
|
||||
/**
|
||||
* 进行中/待审核
|
||||
*/
|
||||
IN_PROGRESS("0", "进行中"),
|
||||
/**
|
||||
* 已审核/通过
|
||||
*/
|
||||
PASSED("1", "已审核"),
|
||||
|
||||
/**
|
||||
*驳回
|
||||
*/
|
||||
REJECTED("2", "驳回");
|
||||
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
ReviewStatusEnum(String code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.bonus.sgzb.common.core.enums;
|
||||
|
||||
public enum RoleEnum {
|
||||
|
||||
/**
|
||||
* 一级审核员
|
||||
*/
|
||||
BRANCH_OFFICES(105L, "分公司"),
|
||||
/**
|
||||
* 二级审核员
|
||||
*/
|
||||
CONSTRUCTION_MANAGEMENT_DEPARTMENT(111L, "施管部"),
|
||||
SAFETY_SUPERVISION_DEPARTMENT(112L, "安监部"),
|
||||
/**
|
||||
* 三级审核员
|
||||
*/
|
||||
MACHINERY_BRANCH(108L, "机具分公司"),
|
||||
DEBUGGING_BRANCH(109L, "调试分公司");
|
||||
|
||||
private final Long code;
|
||||
private final String info;
|
||||
|
||||
RoleEnum(Long code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public Long getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.bonus.sgzb.common.core.enums;
|
||||
|
||||
public enum ScrapTypeEnum {
|
||||
|
||||
NATURAL("0", "自然"),
|
||||
ARTIFICIAL("1", "人为");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
ScrapTypeEnum(String code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
public static String getCodeByInfo(String info){
|
||||
for (ScrapTypeEnum type : ScrapTypeEnum.values()) {
|
||||
type.getInfo();
|
||||
type.getCode();
|
||||
if (type.getInfo().equals(info)) {
|
||||
return type.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getInfoByCode(String code){
|
||||
for (ScrapTypeEnum type : ScrapTypeEnum.values()) {
|
||||
if (type.getCode().equals(code)) {
|
||||
return type.getInfo();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
package com.bonus.sgzb.common.core.enums;
|
||||
|
||||
public enum TaskStatusEnum {
|
||||
|
||||
/**
|
||||
* 待分公司审核
|
||||
*/
|
||||
STAY_BRANCH_AUDIT("30", "待分公司审核"),
|
||||
/**
|
||||
*待分管部门审核
|
||||
*/
|
||||
STAY_RESPONSIBLE_DEPARTMENT_AUDIT("31", "待分管部门审核"),
|
||||
/**
|
||||
* 待内部审核
|
||||
*/
|
||||
STAY_INTERNAL_AUDIT("32", "待内部审核"),
|
||||
/**
|
||||
*待出库
|
||||
*/
|
||||
STAY_OUTBOUND("33", "待出库"),
|
||||
/**
|
||||
* 出库进行中
|
||||
*/
|
||||
OUTBOUND_IN_PROGRESS("34", "出库进行中"),
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
COMPLETE("35", "完成"),
|
||||
/**
|
||||
* 待报废任务--待审核
|
||||
*/
|
||||
PENDING_REVIEW("120", "待审核"),
|
||||
/**
|
||||
* 待报废任务--审核中
|
||||
*/
|
||||
UNDER_REVIEW("121", "审核中"),
|
||||
/**
|
||||
* 待报废任务--已通过
|
||||
*/
|
||||
PASSED("122", "已通过"),
|
||||
/**
|
||||
* 待报废任务--已驳回
|
||||
*/
|
||||
REJECTED("123", "已驳回"),
|
||||
|
||||
/**
|
||||
* 报废任务--未提交
|
||||
*/
|
||||
SCRAP_UNSUBMITTED("124", "未提交"),
|
||||
|
||||
/**
|
||||
* 报废任务--审核中
|
||||
*/
|
||||
SCRAP_UNDER_REVIEW("58", "审核中"),
|
||||
|
||||
/**
|
||||
* 报废任务--报废审核通过
|
||||
*/
|
||||
SCRAP_PASSED("59", "报废审核通过"),
|
||||
|
||||
/**
|
||||
* 报废任务--报废审核驳回
|
||||
*/
|
||||
SCRAP_REJECTED("61", "报废审核驳回"),
|
||||
|
||||
/**
|
||||
* 处置情况--宁夏处置管理 0 未处置
|
||||
*/
|
||||
NOT_DISPOSED("0", "未处置"),
|
||||
|
||||
/**
|
||||
* 处置情况--宁夏处置管理 1 已处置
|
||||
*/
|
||||
DISPOSED("1", "已处置");
|
||||
|
||||
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
|
||||
TaskStatusEnum(String code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
public static String getCodeByInfo(String info){
|
||||
for (TaskStatusEnum type : TaskStatusEnum.values()) {
|
||||
type.getInfo();
|
||||
type.getCode();
|
||||
if (type.getInfo().equals(info)) {
|
||||
return type.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getInfoByCode(String code){
|
||||
for (TaskStatusEnum type : TaskStatusEnum.values()) {
|
||||
if (type.getCode().equals(code)) {
|
||||
return type.getInfo();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.bonus.sgzb.common.core.enums;
|
||||
|
||||
/**
|
||||
* 任务类型枚举类
|
||||
*/
|
||||
public enum TaskTypeEnum {
|
||||
|
||||
/**
|
||||
* 退料待报废
|
||||
*/
|
||||
RETURNED_MATERIALS_TO_BE_SCRAPPED(20, "退料待报废"),
|
||||
/**
|
||||
* 退料待报废
|
||||
*/
|
||||
REPAIR_TO_BE_SCRAPPED(21, "维修待报废"),
|
||||
/**
|
||||
*维修任务
|
||||
*/
|
||||
MAINTENANCE_TASK(41, "维修任务"),
|
||||
/**
|
||||
* 报废任务
|
||||
*/
|
||||
SCRAP_TASK(57, "报废任务");
|
||||
|
||||
|
||||
|
||||
private final Integer code;
|
||||
private final String info;
|
||||
|
||||
TaskTypeEnum(Integer code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
public Integer getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -7,6 +7,9 @@ import com.bonus.sgzb.app.mapper.BackReceiveMapper;
|
|||
import com.bonus.sgzb.app.mapper.TmTaskMapper;
|
||||
import com.bonus.sgzb.app.service.BackReceiveService;
|
||||
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
|
||||
import com.bonus.sgzb.common.core.constant.TaskTypeConstants;
|
||||
import com.bonus.sgzb.common.core.enums.TaskStatusEnum;
|
||||
import com.bonus.sgzb.common.core.enums.TaskTypeEnum;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.GlobalConstants;
|
||||
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||
|
|
@ -187,7 +190,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
List<BackApplyInfo> wxList = backReceiveMapper.getWxList(record);
|
||||
if (wxList != null && wxList.size() > 0) {
|
||||
//插入任务表tm_task
|
||||
int newTaskId = insertTt(wxList, 41, record.getCreateBy());
|
||||
int newTaskId = insertTt(wxList, TaskTypeEnum.MAINTENANCE_TASK.getCode(), record.getCreateBy());
|
||||
//插入协议任务表tm_task_agreement
|
||||
res = insertTta(newTaskId, wxList);
|
||||
//插入维修记录表repair_apply_details
|
||||
|
|
@ -198,7 +201,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
List<BackApplyInfo> bfList = backReceiveMapper.getBfList(record);
|
||||
if (bfList != null && bfList.size() > 0) {
|
||||
//插入任务表tm_task
|
||||
int newTaskId = insertTt(bfList, 57, record.getCreateBy());
|
||||
int newTaskId = insertTt(bfList, TaskTypeEnum.RETURNED_MATERIALS_TO_BE_SCRAPPED.getCode(), record.getCreateBy());
|
||||
//插入协议任务表tm_task_agreement
|
||||
res = insertTta(newTaskId, bfList);
|
||||
//插入维修记录表scrap_apply_details
|
||||
|
|
@ -376,18 +379,20 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
return res;
|
||||
}
|
||||
|
||||
private int insertTt(List<BackApplyInfo> hgList, int taskType, String createBy) {
|
||||
private int insertTt(List<BackApplyInfo> hgList, Integer taskType, String createBy) {
|
||||
int newTask;
|
||||
//生成单号
|
||||
String code = genCodeRule(taskType);
|
||||
BackApplyInfo applyInfo = new BackApplyInfo();
|
||||
applyInfo.setTaskType(taskType);
|
||||
applyInfo.setTaskType(Integer.valueOf(taskType));
|
||||
String taskStatus = "";
|
||||
if (GlobalConstants.INT_41 == taskType) {
|
||||
taskStatus = "43";
|
||||
if (TaskTypeEnum.MAINTENANCE_TASK.getCode().equals(taskType)) {
|
||||
//taskStatus = "43";
|
||||
taskStatus = TaskStatusEnum.PENDING_REVIEW.getCode();
|
||||
}
|
||||
if (GlobalConstants.INT_57 == taskType) {
|
||||
taskStatus = "58";
|
||||
if (TaskTypeEnum.RETURNED_MATERIALS_TO_BE_SCRAPPED.getCode().equals(taskType)) {
|
||||
//taskStatus = "58";
|
||||
taskStatus = TaskStatusEnum.PENDING_REVIEW.getCode();
|
||||
}
|
||||
applyInfo.setTaskStatus(taskStatus);
|
||||
applyInfo.setCode(code);
|
||||
|
|
@ -457,6 +462,8 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
if ("3".equals(backStatus)) {
|
||||
//退料待报废状态变为退料待报废20
|
||||
backReceiveMapper.updateMaStatus(maId, "20");
|
||||
//在任务表中创建一个报废任务
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -494,30 +501,32 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
/**
|
||||
* 编号生成规则
|
||||
*/
|
||||
private String genCodeRule(int taskType) {
|
||||
private String genCodeRule(Integer taskType) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
Integer taskNum = backReceiveMapper.selectTaskNumByMonthWx(nowDate, taskType);
|
||||
String taskNumStr = "";
|
||||
if (taskNum != null) {
|
||||
// 将字符串转换为整数
|
||||
|
||||
String taskNumStr = "";
|
||||
if (taskNum != null) {
|
||||
// 将字符串转换为整数
|
||||
// int num = Integer.parseInt(taskNum);
|
||||
// 执行加一操作
|
||||
taskNum++;
|
||||
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||
taskNumStr = String.format("%04d", taskNum);
|
||||
} else {
|
||||
taskNumStr = "0001";
|
||||
// 执行加一操作
|
||||
taskNum++;
|
||||
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||
taskNumStr = String.format("%04d", taskNum);
|
||||
} else {
|
||||
taskNumStr = "0001";
|
||||
}
|
||||
String code = "";
|
||||
if (TaskTypeEnum.MAINTENANCE_TASK.getCode().equals(taskType)) {
|
||||
code = TaskTypeConstants.WX;
|
||||
}
|
||||
|
||||
if (TaskTypeEnum.RETURNED_MATERIALS_TO_BE_SCRAPPED.getCode().equals(taskType)) {
|
||||
code = TaskTypeConstants.YBF;
|
||||
}
|
||||
code = code + format + "-" + taskNumStr;
|
||||
return code;
|
||||
}
|
||||
String code = "";
|
||||
if (GlobalConstants.INT_41 == taskType) {
|
||||
code = "WX";
|
||||
}
|
||||
if (GlobalConstants.INT_57 == taskType) {
|
||||
code = "BF";
|
||||
}
|
||||
code = code + format + "-" + taskNumStr;
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -660,6 +660,11 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
}
|
||||
}
|
||||
}
|
||||
// 存入领料任务实体集合
|
||||
tmTask.setLeaseApplyInfoList(collect);
|
||||
if(collect.size()>0){
|
||||
tmTask.setRemark(collect.get(0).getRemark());
|
||||
}
|
||||
}
|
||||
//施管部只能看到机具分公司(101)的数据
|
||||
if ((roles.contains("jjfgs") || roles.contains("sgb")) && companyId != null) {
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@ package com.bonus.sgzb.material.controller;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.sgzb.material.domain.RepairAuditDetails;
|
||||
import com.bonus.sgzb.material.domain.RepairRecord;
|
||||
import com.bonus.sgzb.material.domain.ScrapApplyDetails;
|
||||
import com.bonus.sgzb.material.domain.*;
|
||||
import com.bonus.sgzb.material.service.IScrapApplyDetailsService;
|
||||
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
|
||||
import com.bonus.sgzb.material.vo.ScrapAudit;
|
||||
|
|
@ -40,7 +39,7 @@ import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
|||
@RequestMapping("/scrap")
|
||||
public class ScrapApplyDetailsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
@Resource
|
||||
private IScrapApplyDetailsService scrapApplyDetailsService;
|
||||
|
||||
/**
|
||||
|
|
@ -128,4 +127,129 @@ public class ScrapApplyDetailsController extends BaseController
|
|||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询预报废任务列表
|
||||
*/
|
||||
@ApiOperation("查询预报废任务列表")
|
||||
@PostMapping("/getScrapApplyList")
|
||||
public TableDataInfo getScrapApplyList(ScrapApplyDetails scrapApplyDetails)
|
||||
{
|
||||
startPage();
|
||||
Map<String, Object> 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<ScrapApplyDetailsVO> list = scrapApplyDetailsService.getScrapApplyList(scrapApplyDetails);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 预报废任务审核
|
||||
*/
|
||||
@ApiOperation("预报废任务审核")
|
||||
@Log(title = "预报废任务审核", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/forecastWasteAudit")
|
||||
public AjaxResult forecastWasteAudit(@RequestBody ScrapAudit scrapAudit) throws Exception {
|
||||
return toAjax(scrapApplyDetailsService.forecastWasteAudit(scrapAudit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 报废任务提交审计信息
|
||||
*/
|
||||
@ApiOperation("报废任务提交审计信息")
|
||||
@Log(title = "报废任务提交审计信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/submitScrapTask")
|
||||
public AjaxResult submitScrapTask(@RequestBody ScrapAudit scrapAudit){
|
||||
return toAjax(scrapApplyDetailsService.submitScrapTask(scrapAudit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询报废审核任务列表
|
||||
*/
|
||||
@ApiOperation("查询报废审核任务列表")
|
||||
@PostMapping("/scrapTaskReviewList")
|
||||
public TableDataInfo scrapTaskReviewList(ScrapApplyDetails scrapApplyDetails)
|
||||
{
|
||||
startPage();
|
||||
Map<String, Object> 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<ScrapApplyDetailsVO> list = scrapApplyDetailsService.scrapTaskReviewList(scrapApplyDetails);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 报废任务审核----宁夏
|
||||
*/
|
||||
@ApiOperation("报废任务审核----宁夏")
|
||||
@Log(title = "报废任务审核----宁夏", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/scrapTaskReview")
|
||||
public AjaxResult scrapTaskReview(@RequestBody ScrapAuditorSet scrapAuditorSet) {
|
||||
return toAjax(scrapApplyDetailsService.scrapTaskReview(scrapAuditorSet));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取处置列表----宁夏
|
||||
*/
|
||||
@ApiOperation("获取处置列表----宁夏")
|
||||
@Log(title = "获取处置列表----宁夏", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/obtainDisposalList")
|
||||
public TableDataInfo obtainDisposalList(@RequestBody ScrapApplyDetails scrapApplyDetails) {
|
||||
startPage();
|
||||
Map<String, Object> 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<ScrapApplyDetailsVO> list = scrapApplyDetailsService.obtainDisposalList(scrapApplyDetails);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处置----宁夏
|
||||
*/
|
||||
@ApiOperation("处置----宁夏")
|
||||
@Log(title = "处置----宁夏", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/obtainDisposal")
|
||||
public AjaxResult obtainDisposal(@RequestBody List<TmTask> tmTaskList) {
|
||||
|
||||
return toAjax(scrapApplyDetailsService.obtainDisposal(tmTaskList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出预报废任务列表
|
||||
*/
|
||||
@Log(title = "导出预报废任务列表", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportForecastWaste")
|
||||
public void exportForecastWaste(HttpServletResponse response, ScrapApplyDetails scrapApplyDetails)
|
||||
{
|
||||
Map<String, Object> params = scrapApplyDetails.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");
|
||||
scrapApplyDetails.setParams(params);
|
||||
}
|
||||
List<ScrapApplyDetailsVO> list = scrapApplyDetailsService.getScrapApplyList(scrapApplyDetails);
|
||||
ExcelUtil<ScrapApplyDetailsVO> util = new ExcelUtil<ScrapApplyDetailsVO>(ScrapApplyDetailsVO.class);
|
||||
util.exportExcel(response, list, "预报废任务列表");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.bonus.sgzb.material.domain.AgreementInfo;
|
|||
import com.bonus.sgzb.material.domain.ToDoBean;
|
||||
import com.bonus.sgzb.material.service.AgreementInfoService;
|
||||
import com.bonus.sgzb.material.service.ToDoService;
|
||||
import com.bonus.sgzb.material.vo.NoticeInfoVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -49,4 +50,17 @@ public class ToDoController extends BaseController {
|
|||
return toDoService.getTaskType(bean);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发送催办短信
|
||||
* @param noticeInfoVO
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "催办")
|
||||
@PostMapping("/urgentProcessing")
|
||||
public AjaxResult urgentProcessing(@RequestBody NoticeInfoVO noticeInfoVO){
|
||||
return toAjax(toDoService.urgentProcessing(noticeInfoVO));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,64 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel(description="报废审核人员配置")
|
||||
@Data
|
||||
public class ScrapAuditorSet {
|
||||
|
||||
|
||||
/**
|
||||
* 报废审核人员配置ID
|
||||
*/
|
||||
@ApiModelProperty(value = "报废审核人员配置ID")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 报废任务id
|
||||
*/
|
||||
@ApiModelProperty(value = "报废任务id")
|
||||
private Integer taskId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@ApiModelProperty(value = "部门id")
|
||||
private Integer deptId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 审核人id
|
||||
*/
|
||||
@ApiModelProperty(value = "审核人id")
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 0未审核1审核通过,2驳回
|
||||
*/
|
||||
@ApiModelProperty(value = "0未审核1审核通过,2驳回")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 组织Id
|
||||
*/
|
||||
@ApiModelProperty(value = "组织Id")
|
||||
private Integer companyId;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
@ApiModelProperty(value = "审核时间")
|
||||
private String auditTime;
|
||||
|
||||
/**
|
||||
*驳回原因
|
||||
*/
|
||||
private String reasonRejection;
|
||||
}
|
||||
|
|
@ -231,4 +231,22 @@ public class TmTask implements Serializable {
|
|||
private String partNum;
|
||||
private String typeId;
|
||||
|
||||
/**
|
||||
* 处置情况 --宁夏
|
||||
*/
|
||||
@ApiModelProperty(value = "处置情况")
|
||||
private Integer disposition;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
@ApiModelProperty(value = "文件地址")
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
@ApiModelProperty(value = "文件名称")
|
||||
private String fileName;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.bonus.sgzb.material.domain.vo;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 预报废导出实体类
|
||||
*/
|
||||
@Data
|
||||
public class ForecastWasteVo {
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 预报废审核单号
|
||||
*/
|
||||
@Excel(name = "报废审核单号",sort = 1)
|
||||
private String scrapNum;
|
||||
|
||||
|
||||
/**
|
||||
* 报废来源
|
||||
*/
|
||||
@Excel(name = "单位名称",sort = 2)
|
||||
private String scrap_source;
|
||||
|
||||
public String getScrap_source() {
|
||||
return scrap_source;
|
||||
}
|
||||
|
||||
public void setScrap_source(String scrap_source) {
|
||||
this.scrap_source = scrap_source;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.bonus.sgzb.material.exception;
|
||||
|
||||
public class ExceptionDict {
|
||||
|
||||
// 参数不合法
|
||||
public static final Integer PARAM_VALUE_IS_ERROR = 50000;
|
||||
public static final String PARAM_VALUE_IS_ERROR_MSG = "参数不合法";
|
||||
|
||||
// 参数为空异常提示code,msg
|
||||
public static final Integer PARAM_IS_NULL_ERROR = 50001;
|
||||
public static final String PARAM_IS_NULL_ERROR_MSG = "参数%s不能为空";
|
||||
|
||||
// 参数为空异常提示code,msg
|
||||
public static final Integer NEW_AGREEMENT_SETTLEMENT_ERROR = 50002;
|
||||
public static final String NEW_AGREEMENT_SETTLEMENT_ERROR_MSG = "新增协议结算记录失败";
|
||||
|
||||
public static final Integer SETTLEMENT_REVIEW_ERROR = 50003;
|
||||
public static final String SETTLEMENT_REVIEW_ERROR_MSG = "结算审核失败";
|
||||
|
||||
public static final Integer NEW_SETTLEMENT_NUMBER_ERROR = 50004;
|
||||
public static final String NEW_SETTLEMENT_NUMBER_ERROR_MSG = "新增结算单号失败";
|
||||
|
||||
public static final Integer TASK_ID_IS_EMPTY = 50005;
|
||||
public static final String TASK_ID_IS_EMPTY_MSG = "任务taskId为空!!";
|
||||
|
||||
public static final Integer BINDING_USER_IS_EMPTY = 50006;
|
||||
public static final String BINDING_USER_IS_EMPTY_MSG = "绑定用户为空!!";
|
||||
|
||||
public static final Integer TASK_IS_EMPTY = 50007;
|
||||
public static final String TASK_IS_EMPTY_MSG = "获取预报废任务为空";
|
||||
|
||||
public static final Integer TASK_DETAILS_IS_EMPTY = 50008;
|
||||
public static final String TASK_DETAILS_IS_EMPTY_MSG = "获取报废任务详细为空";
|
||||
|
||||
public static final Integer ERROR_OCCURRED_DURING_SCRAP_TASK_REVIEW = 50009;
|
||||
public static final String ERROR_OCCURRED_DURING_SCRAP_TASK_REVIEW_MSG = "报废任务审核失败!";
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
System.out.println(String.format(ExceptionDict.PARAM_IS_NULL_ERROR_MSG,"name"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -159,4 +159,13 @@ public interface ScrapApplyDetailsMapper
|
|||
String getFileUrl(String s);
|
||||
|
||||
List<RepairRecord> getGyoupRepairRecord(RepairAuditDetails byRepairId);
|
||||
|
||||
/**
|
||||
* 查询预报废申请列表
|
||||
* @param scrapApplyDetails 包含预报废申请详情的实体对象,用于筛选申请列表的条件。
|
||||
* @return
|
||||
*/
|
||||
List<ScrapApplyDetailsVO> getScrapApplyList(ScrapApplyDetails scrapApplyDetails);
|
||||
|
||||
List<ScrapApplyDetailsVO> scrapTaskReviewList(ScrapApplyDetails scrapApplyDetails);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
import com.bonus.sgzb.material.domain.ScrapAuditorSet;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ScrapAuditorSetMapper接口定义
|
||||
* 该接口用于定义与“ScrapAuditorSet”相关的数据库操作方法。
|
||||
*/
|
||||
public interface ScrapAuditorSetMapper {
|
||||
void insertScrapAuditorSet(ScrapAuditorSet scrapAuditorSet);
|
||||
|
||||
void updateStatus(ScrapAuditorSet scrapAuditorSet);
|
||||
|
||||
List<ScrapAuditorSet> selectScrapAuditListByTaskId(Long taskId);
|
||||
}
|
||||
|
|
@ -2,8 +2,10 @@ package com.bonus.sgzb.material.mapper;
|
|||
|
||||
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.ScrapApplyDetails;
|
||||
import com.bonus.sgzb.material.domain.MachinePart;
|
||||
import com.bonus.sgzb.material.domain.TmTask;
|
||||
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
@ -94,4 +96,6 @@ public interface TaskMapper {
|
|||
* @return
|
||||
*/
|
||||
String selectTaskNumByMonths(@Param("date") Date nowDate, @Param("taskType") Integer taskType);
|
||||
|
||||
List<ScrapApplyDetailsVO> selectTmTaskListByDisposition(ScrapApplyDetails scrapApplyDetails);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
package com.bonus.sgzb.material.service;
|
||||
|
||||
import com.bonus.sgzb.material.domain.RepairAuditDetails;
|
||||
import com.bonus.sgzb.material.domain.RepairRecord;
|
||||
import com.bonus.sgzb.material.domain.ScrapApplyDetails;
|
||||
import com.bonus.sgzb.material.domain.*;
|
||||
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
|
||||
import com.bonus.sgzb.material.vo.ScrapAudit;
|
||||
|
||||
|
|
@ -89,4 +87,56 @@ public interface IScrapApplyDetailsService
|
|||
List<RepairRecord> getScrapRecord(ScrapApplyDetails scrapApplyDetails);
|
||||
|
||||
List<String> getFileUrl(String fileIds);
|
||||
|
||||
/**
|
||||
* 获取预报废申请列表。
|
||||
*
|
||||
* @param scrapApplyDetails 包含预报废申请详情的实体对象,用于筛选申请列表的条件。
|
||||
* @return 返回一个预报废申请详情的VO(值对象)列表,这些对象代表了满足条件的预报废申请的详细信息。
|
||||
*/
|
||||
List<ScrapApplyDetailsVO> getScrapApplyList(ScrapApplyDetails scrapApplyDetails);
|
||||
|
||||
/**
|
||||
* 预报废申请审核
|
||||
* @param scrapAudit
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
int forecastWasteAudit(ScrapAudit scrapAudit);
|
||||
|
||||
/**
|
||||
* 提交废弃任务审计信息。
|
||||
*
|
||||
* @param scrapAudit 包含废弃任务审计信息的对象。
|
||||
* @return 返回任务提交的结果,通常为任务的ID或状态码。
|
||||
*/
|
||||
int submitScrapTask(ScrapAudit scrapAudit);
|
||||
|
||||
/**
|
||||
* 废弃任务审核----宁夏
|
||||
* @param scrapAuditorSet
|
||||
* @return
|
||||
*/
|
||||
int scrapTaskReview(ScrapAuditorSet scrapAuditorSet);
|
||||
|
||||
/**
|
||||
* 报废任务审核列表
|
||||
* @param scrapApplyDetails
|
||||
* @return
|
||||
*/
|
||||
List<ScrapApplyDetailsVO> scrapTaskReviewList(ScrapApplyDetails scrapApplyDetails);
|
||||
|
||||
/**
|
||||
* 获取处置列表----宁夏
|
||||
* @param scrapApplyDetails
|
||||
* @return
|
||||
*/
|
||||
List<ScrapApplyDetailsVO> obtainDisposalList(ScrapApplyDetails scrapApplyDetails);
|
||||
|
||||
/**
|
||||
* 处置----宁夏
|
||||
* @param tmTaskList
|
||||
* @return
|
||||
*/
|
||||
int obtainDisposal(List<TmTask> tmTaskList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.sgzb.material.service;
|
|||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.material.domain.AgreementInfo;
|
||||
import com.bonus.sgzb.material.domain.ToDoBean;
|
||||
import com.bonus.sgzb.material.vo.NoticeInfoVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -25,4 +26,11 @@ public interface ToDoService {
|
|||
* @return
|
||||
*/
|
||||
AjaxResult getTaskType(ToDoBean bean);
|
||||
|
||||
/**
|
||||
* 发送催办短信
|
||||
* @param noticeInfoVO
|
||||
* @return
|
||||
*/
|
||||
Boolean urgentProcessing(NoticeInfoVO noticeInfoVO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@ import java.util.ArrayList;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.sgzb.common.core.constant.TaskTypeConstants;
|
||||
import com.bonus.sgzb.common.core.enums.TaskStatusEnum;
|
||||
import com.bonus.sgzb.common.core.enums.TaskTypeEnum;
|
||||
import com.bonus.sgzb.common.core.exception.ServiceException;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||
|
|
@ -204,6 +207,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
}
|
||||
} else {
|
||||
repairInputList = repairAuditDetailsMapper.selectRepairInputByTaskId(taskId);
|
||||
//获取维修报废列表
|
||||
scrapNumList = repairAuditDetailsMapper.selectScrapNumByTaskId(taskId);
|
||||
}
|
||||
|
||||
|
|
@ -243,10 +247,11 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
if (scrapNumList.get(0).getCompanyId() != null) {
|
||||
companyId = scrapNumList.get(0).getCompanyId();
|
||||
}
|
||||
taskCode = purchaseCodeRule("BF", 57);
|
||||
taskStatus = 58;
|
||||
taskType = 57;
|
||||
long scrapTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, companyId);
|
||||
taskCode = purchaseCodeRule(TaskTypeConstants.YBF, TaskTypeEnum.REPAIR_TO_BE_SCRAPPED.getCode());
|
||||
/*taskStatus = 58;
|
||||
taskType = 57;*/
|
||||
//创建报废任务
|
||||
long scrapTaskId = genTask(taskCode, TaskTypeEnum.REPAIR_TO_BE_SCRAPPED.getCode(), Integer.parseInt(TaskStatusEnum.PENDING_REVIEW.getCode()), tmTaskAgreement, companyId);
|
||||
for (RepairAuditDetails scrapDetails : scrapNumList) {
|
||||
RepairAuditDetails byRepairId = scrapApplyDetailsMapper.getByRepairId(String.valueOf(scrapDetails.getRepairId()));
|
||||
List<RepairRecord> repairRecord = scrapApplyDetailsMapper.getGyoupRepairRecord(byRepairId);
|
||||
|
|
|
|||
|
|
@ -5,21 +5,27 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.bonus.sgzb.common.core.constant.TaskTypeConstants;
|
||||
import com.bonus.sgzb.common.core.enums.ReviewStatusEnum;
|
||||
import com.bonus.sgzb.common.core.enums.TaskStatusEnum;
|
||||
import com.bonus.sgzb.common.core.enums.TaskTypeEnum;
|
||||
import com.bonus.sgzb.common.core.exception.ServiceException;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.domain.*;
|
||||
import com.bonus.sgzb.material.mapper.PurchaseCheckInfoMapper;
|
||||
import com.bonus.sgzb.material.mapper.ScrapApplyDetailsMapper;
|
||||
import com.bonus.sgzb.material.mapper.TaskMapper;
|
||||
import com.bonus.sgzb.material.mapper.TmTaskAgreementMapper;
|
||||
import com.bonus.sgzb.material.exception.ExceptionDict;
|
||||
import com.bonus.sgzb.material.mapper.*;
|
||||
import com.bonus.sgzb.material.service.IScrapApplyDetailsService;
|
||||
import com.bonus.sgzb.material.vo.GlobalContants;
|
||||
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
|
||||
import com.bonus.sgzb.material.vo.ScrapAudit;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.catalina.security.SecurityUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -33,8 +39,9 @@ import javax.annotation.Resource;
|
|||
* @date 2023-12-15
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
||||
@Autowired
|
||||
@Resource
|
||||
private ScrapApplyDetailsMapper scrapApplyDetailsMapper;
|
||||
|
||||
@Resource
|
||||
|
|
@ -46,6 +53,9 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
|||
@Resource
|
||||
private TmTaskAgreementMapper agreementMapper;
|
||||
|
||||
@Resource
|
||||
private ScrapAuditorSetMapper scrapAuditorSetMapper;
|
||||
|
||||
/**
|
||||
* 查询报废任务详细scrap_apply_details
|
||||
*
|
||||
|
|
@ -82,6 +92,254 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
|||
return fileUrlList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询预报废申请列表
|
||||
* @param scrapApplyDetails 包含预报废申请详情的实体对象,用于筛选申请列表的条件。
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ScrapApplyDetailsVO> getScrapApplyList(ScrapApplyDetails scrapApplyDetails) {
|
||||
List<ScrapApplyDetailsVO> scrapApplyDetailsList = scrapApplyDetailsMapper.getScrapApplyList(scrapApplyDetails);
|
||||
for (ScrapApplyDetailsVO applyDetails : scrapApplyDetailsList) {
|
||||
Long taskId = applyDetails.getTaskId();
|
||||
String typeName = scrapApplyDetailsMapper.selectTypeNameByTaskId(taskId);
|
||||
applyDetails.setItemType(typeName);
|
||||
}
|
||||
return scrapApplyDetailsList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 预报废任务审核
|
||||
* @param scrapAudit
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int forecastWasteAudit(ScrapAudit scrapAudit) {
|
||||
log.info("ScrapApplyDetailsServiceImpl forecastWasteAudit begin: {}", scrapAudit);
|
||||
//获取任务id
|
||||
Long taskId = scrapAudit.getTaskId();
|
||||
if (taskId == null) {
|
||||
throw new ServiceException(ExceptionDict.TASK_ID_IS_EMPTY_MSG, ExceptionDict.TASK_ID_IS_EMPTY);
|
||||
}
|
||||
//获取审核列表
|
||||
List<ScrapApplyDetails> scrapApplyDetailList = scrapAudit.getScrapDetailList();
|
||||
if (scrapApplyDetailList == null || scrapApplyDetailList.size() == 0) {
|
||||
throw new ServiceException(String.format(ExceptionDict.PARAM_IS_NULL_ERROR_MSG,"scrapDetailList"), ExceptionDict.PARAM_IS_NULL_ERROR);
|
||||
}
|
||||
//修改装备状态
|
||||
for (ScrapApplyDetails scrapApplyDetails: scrapApplyDetailList){
|
||||
scrapApplyDetails.setAuditTime(new Date());
|
||||
scrapApplyDetailsMapper.updateScrapApplyDetails(scrapApplyDetails);
|
||||
}
|
||||
//根据任务id查看是否还有未审核的设备
|
||||
List<ScrapApplyDetails> getScrapApplyDetailList = scrapApplyDetailsMapper.selectScrapDetailsByTaskId(taskId);
|
||||
if (scrapApplyDetailList.size()==0){
|
||||
return BigDecimal.ROUND_UP;
|
||||
}
|
||||
//获取所有装备的状态
|
||||
List<String> statusList = getScrapApplyDetailList.stream().map(ScrapApplyDetails::getStatus).collect(Collectors.toList());
|
||||
TmTask task = new TmTask();
|
||||
task.setTaskId(taskId);
|
||||
//判断是否还有装备没有进行审核
|
||||
if (statusList.contains(ReviewStatusEnum.IN_PROGRESS.getCode())){
|
||||
task.setTaskStatus(Integer.valueOf(TaskStatusEnum.UNDER_REVIEW.getCode()));
|
||||
//当全部审核以后判断是否有被驳回的装备
|
||||
} else if (!statusList.contains(ReviewStatusEnum.IN_PROGRESS.getCode()) &&statusList.contains(ReviewStatusEnum.REJECTED.getCode())) {
|
||||
task.setTaskStatus(Integer.valueOf(TaskStatusEnum.REJECTED.getCode()));
|
||||
//TODO 对审核驳回的单子进行处理的业务待确认
|
||||
}else {
|
||||
task.setTaskStatus(Integer.valueOf(TaskStatusEnum.PASSED.getCode()));
|
||||
//生成报废的单子
|
||||
createScrapTask(taskId);
|
||||
}
|
||||
//修改任务状态
|
||||
taskMapper.updateTmTask(task);
|
||||
log.info("ScrapApplyDetailsServiceImpl forecastWasteAudit end: {}", scrapAudit);
|
||||
return BigDecimal.ROUND_DOWN;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交报废任务
|
||||
* @param scrapAudit 包含废弃任务审计信息的对象。
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int submitScrapTask(ScrapAudit scrapAudit) {
|
||||
log.info("ScrapApplyDetailsServiceImpl submitScrapTask begin: {}", scrapAudit);
|
||||
//参数校验 后期可以考虑写一个校验的工具类
|
||||
List<Integer> deptIds = scrapAudit.getDeptIds();
|
||||
if (deptIds == null || deptIds.size() == 0) {
|
||||
throw new ServiceException(String.format(ExceptionDict.PARAM_IS_NULL_ERROR_MSG,"deptIds"), ExceptionDict.PARAM_IS_NULL_ERROR);
|
||||
}
|
||||
List<Long> taskIdList =scrapAudit.getTaskIdList();
|
||||
if (taskIdList == null || taskIdList.size() == 0) {
|
||||
throw new ServiceException(ExceptionDict.TASK_ID_IS_EMPTY_MSG, ExceptionDict.TASK_ID_IS_EMPTY);
|
||||
}
|
||||
for (Long taskId : taskIdList) {
|
||||
//修任务状态
|
||||
TmTask task = new TmTask();
|
||||
task.setTaskId(taskId);
|
||||
task.setTaskStatus(Integer.valueOf(TaskStatusEnum.SCRAP_UNDER_REVIEW.getCode()));
|
||||
taskMapper.updateTmTask(task);
|
||||
//创建审核详情
|
||||
ScrapAuditorSet scrapAuditorSet = new ScrapAuditorSet();
|
||||
scrapAuditorSet.setTaskId(taskId.intValue());
|
||||
for (Integer deptId : deptIds) {
|
||||
scrapAuditorSet.setDeptId(deptId);
|
||||
scrapAuditorSet.setTaskId(taskId.intValue());
|
||||
scrapAuditorSetMapper.insertScrapAuditorSet(scrapAuditorSet);
|
||||
}
|
||||
}
|
||||
log.info("ScrapApplyDetailsServiceImpl submitScrapTask end" );
|
||||
return BigDecimal.ROUND_DOWN;
|
||||
}
|
||||
|
||||
/**
|
||||
* 报废任务审核--宁夏
|
||||
* @param scrapAuditorSet
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int scrapTaskReview(ScrapAuditorSet scrapAuditorSet) {
|
||||
log.info("ScrapApplyDetailsServiceImpl scrapTaskReview begin: {}", scrapAuditorSet);
|
||||
try {
|
||||
scrapAuditorSet.setAuditTime(DateUtils.dateTimeNow());
|
||||
//修改审核状态
|
||||
scrapAuditorSetMapper.updateStatus(scrapAuditorSet);
|
||||
//获取报废任务所有审核人员的审核详情
|
||||
List<ScrapAuditorSet> scrapAuditorSetList = scrapAuditorSetMapper.selectScrapAuditListByTaskId(Long.valueOf(scrapAuditorSet.getTaskId()));
|
||||
//获取所有的审核状态
|
||||
List<String> statusList = scrapAuditorSetList.stream().map(ScrapAuditorSet::getStatus).collect(Collectors.toList());
|
||||
TmTask task = new TmTask();
|
||||
task.setTaskId(Long.valueOf(scrapAuditorSet.getTaskId()));
|
||||
//判断是否还有部门没有进行审核
|
||||
if (statusList.contains(ReviewStatusEnum.IN_PROGRESS.getCode())){
|
||||
task.setTaskStatus(Integer.valueOf(TaskStatusEnum.SCRAP_UNDER_REVIEW.getCode()));
|
||||
//当全部审核以后判断是否有驳回的
|
||||
} else if (!statusList.contains(ReviewStatusEnum.IN_PROGRESS.getCode()) &&statusList.contains(ReviewStatusEnum.REJECTED.getCode())) {
|
||||
task.setTaskStatus(Integer.valueOf(TaskStatusEnum.SCRAP_REJECTED.getCode()));
|
||||
}else {
|
||||
task.setTaskStatus(Integer.valueOf(TaskStatusEnum.SCRAP_PASSED.getCode()));
|
||||
task.setDisposition(Integer.valueOf(TaskStatusEnum.NOT_DISPOSED.getCode()));
|
||||
}
|
||||
//修改任务状态
|
||||
taskMapper.updateTmTask(task);
|
||||
log.info("ScrapApplyDetailsServiceImpl scrapTaskReview end");
|
||||
} catch (Exception e) {
|
||||
log.error("Error occurred during scrap task review: {}", e.getMessage());
|
||||
throw new ServiceException(ExceptionDict.ERROR_OCCURRED_DURING_SCRAP_TASK_REVIEW_MSG, ExceptionDict.ERROR_OCCURRED_DURING_SCRAP_TASK_REVIEW);
|
||||
}
|
||||
return BigDecimal.ROUND_DOWN;
|
||||
}
|
||||
|
||||
/**
|
||||
* 报废任务审核列表
|
||||
* @param scrapApplyDetails
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ScrapApplyDetailsVO> scrapTaskReviewList(ScrapApplyDetails scrapApplyDetails) {
|
||||
log.info("ScrapApplyDetailsServiceImpl scrapTaskReviewList begin:{}",scrapApplyDetails);
|
||||
List<ScrapApplyDetailsVO> scrapApplyDetailsList = scrapApplyDetailsMapper.scrapTaskReviewList(scrapApplyDetails);
|
||||
for (ScrapApplyDetailsVO applyDetails : scrapApplyDetailsList) {
|
||||
Long taskId = applyDetails.getTaskId();
|
||||
String typeName = scrapApplyDetailsMapper.selectTypeNameByTaskId(taskId);
|
||||
applyDetails.setItemType(typeName);
|
||||
List<ScrapAuditorSet> scrapAuditorSetList = scrapAuditorSetMapper.selectScrapAuditListByTaskId(taskId);
|
||||
applyDetails.setScrapAuditorSetList(scrapAuditorSetList);
|
||||
}
|
||||
log.info("ScrapApplyDetailsServiceImpl scrapTaskReviewList end:{}",scrapApplyDetails);
|
||||
return scrapApplyDetailsList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取处置列表----宁夏
|
||||
* @param scrapApplyDetails
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ScrapApplyDetailsVO> obtainDisposalList(ScrapApplyDetails scrapApplyDetails) {
|
||||
List<ScrapApplyDetailsVO> tmTaskList = taskMapper.selectTmTaskListByDisposition(scrapApplyDetails);
|
||||
for (ScrapApplyDetailsVO applyDetails : tmTaskList) {
|
||||
Long taskId = applyDetails.getTaskId();
|
||||
String typeName = scrapApplyDetailsMapper.selectTypeNameByTaskId(taskId);
|
||||
applyDetails.setItemType(typeName);
|
||||
List<ScrapAuditorSet> scrapAuditorSetList = scrapAuditorSetMapper.selectScrapAuditListByTaskId(taskId);
|
||||
applyDetails.setScrapAuditorSetList(scrapAuditorSetList);
|
||||
}
|
||||
return tmTaskList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处置
|
||||
* @param tmTaskList
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int obtainDisposal(List<TmTask> tmTaskList) {
|
||||
log.info("ScrapApplyDetailsServiceImpl scrapTaskReviewList begin:{}",tmTaskList);
|
||||
tmTaskList.forEach(tmTask -> {
|
||||
taskMapper.updateTmTask(tmTask);
|
||||
});
|
||||
log.info("ScrapApplyDetailsServiceImpl scrapTaskReviewList end:{}",tmTaskList);
|
||||
return BigDecimal.ROUND_DOWN;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成报废任务
|
||||
* @param taskId
|
||||
*/
|
||||
private void createScrapTask(Long taskId) {
|
||||
TmTask task = taskMapper.selectTmTaskByTaskId(taskId);
|
||||
if (task == null) {
|
||||
throw new ServiceException(ExceptionDict.TASK_IS_EMPTY_MSG, ExceptionDict.TASK_IS_EMPTY);
|
||||
}
|
||||
// 查询协议表
|
||||
TmTaskAgreement tmTaskAgreement = agreementMapper.selectTmTaskAgreementByTaskId(taskId);
|
||||
//生成编号
|
||||
String taskCode = purchaseCodeRule(TaskTypeConstants.BF, Integer.valueOf(TaskTypeEnum.SCRAP_TASK.getCode()));
|
||||
Integer taskStatus = Integer.valueOf(TaskStatusEnum.SCRAP_UNSUBMITTED.getCode());
|
||||
Integer taskType = Integer.valueOf(TaskTypeEnum.SCRAP_TASK.getCode());
|
||||
//获取该任务下通过预报废审核的装备信息
|
||||
ScrapApplyDetails scrapApplyDetails = new ScrapApplyDetails();
|
||||
scrapApplyDetails.setTaskId(taskId);
|
||||
scrapApplyDetails.setStatus(ReviewStatusEnum.PASSED.getCode());
|
||||
List<ScrapApplyDetails> scrapApplyDetailsList = scrapApplyDetailsMapper.selectScrapAuditList(scrapApplyDetails);
|
||||
if (scrapApplyDetailsList.size() == 0){
|
||||
throw new ServiceException(ExceptionDict.TASK_DETAILS_IS_EMPTY_MSG, ExceptionDict.TASK_DETAILS_IS_EMPTY);
|
||||
}
|
||||
//获取生成的任务id
|
||||
int companyId = task.getCompanyId() == null ? 0 : task.getCompanyId();
|
||||
long backTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, companyId);
|
||||
//保存装备详情
|
||||
processScrapApplyDetails( scrapApplyDetailsList, backTaskId);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存报废任务详细scrap_apply_details
|
||||
*
|
||||
* @param scrapApplyDetailsList 报废任务详细scrap_apply_details
|
||||
* @param backTaskId 报废任务id
|
||||
*/
|
||||
public void processScrapApplyDetails(List<ScrapApplyDetails> scrapApplyDetailsList, Long backTaskId) {
|
||||
ScrapApplyDetails scrapApplyDetails = new ScrapApplyDetails();
|
||||
for (ScrapApplyDetails scrapApplyDetail:scrapApplyDetailsList) {
|
||||
BeanUtil.copyProperties(scrapApplyDetail, scrapApplyDetails);
|
||||
scrapApplyDetails.setStatus(ReviewStatusEnum.IN_PROGRESS.getCode());
|
||||
scrapApplyDetails.setId(null);
|
||||
scrapApplyDetails.setAuditBy(null);
|
||||
scrapApplyDetails.setAuditTime(null);
|
||||
scrapApplyDetails.setAuditRemark(null);
|
||||
scrapApplyDetails.setTaskId(backTaskId);
|
||||
scrapApplyDetails.setParentId(scrapApplyDetail.getId());
|
||||
scrapApplyDetailsMapper.insertScrapApplyDetails(scrapApplyDetails);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询报废任务详细scrap_apply_details列表
|
||||
*
|
||||
|
|
@ -95,6 +353,8 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
|||
Long taskId = applyDetails.getTaskId();
|
||||
String typeName = scrapApplyDetailsMapper.selectTypeNameByTaskId(taskId);
|
||||
applyDetails.setItemType(typeName);
|
||||
List<ScrapAuditorSet> scrapAuditorSetList = scrapAuditorSetMapper.selectScrapAuditListByTaskId(taskId);
|
||||
applyDetails.setScrapAuditorSetList(scrapAuditorSetList);
|
||||
}
|
||||
return scrapApplyDetailsList;
|
||||
}
|
||||
|
|
@ -166,6 +426,7 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public int auditScrap(ScrapAudit scrapAudit) throws Exception {
|
||||
String checkResult = scrapAudit.getCheckResult();
|
||||
//获取报废来源数据
|
||||
List<ScrapApplyDetails> scrapDetailList = scrapAudit.getScrapDetailList();
|
||||
List<Long> taskIdList = scrapAudit.getTaskIdList();
|
||||
for (Long taskId : taskIdList) {
|
||||
|
|
@ -173,8 +434,11 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
|||
TmTask task1 = taskMapper.selectTmTaskByTaskId(taskId);
|
||||
// 查询协议表
|
||||
TmTaskAgreement tmTaskAgreement = agreementMapper.selectTmTaskAgreementByTaskId(taskId);
|
||||
//获取未审核的数据
|
||||
List<ScrapApplyDetails> notScrapList = scrapApplyDetailsMapper.selectnotScrapByTaskId(taskId);
|
||||
//获取全部数据
|
||||
List<ScrapApplyDetails> scrapAllApplyDetails = scrapApplyDetailsMapper.selectScrapDetailsByTaskId(taskId);
|
||||
|
||||
if (task1.getTaskStatus() == 47) {
|
||||
throw new Exception("报废审核已通过");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,28 @@
|
|||
package com.bonus.sgzb.material.service.impl;
|
||||
|
||||
import com.bonus.sgzb.common.core.enums.TaskStatusEnum;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.material.domain.AgreementInfo;
|
||||
import com.bonus.sgzb.material.domain.BmNoticeInfo;
|
||||
import com.bonus.sgzb.material.domain.TmTask;
|
||||
import com.bonus.sgzb.material.domain.ToDoBean;
|
||||
import com.bonus.sgzb.material.exception.ExceptionDict;
|
||||
import com.bonus.sgzb.material.mapper.AgreementInfoMapper;
|
||||
import com.bonus.sgzb.material.mapper.PurchaseCheckDetailsMapper;
|
||||
import com.bonus.sgzb.material.mapper.PurchaseCheckInfoMapper;
|
||||
import com.bonus.sgzb.material.mapper.ToDoMapper;
|
||||
import com.bonus.sgzb.material.service.AgreementInfoService;
|
||||
import com.bonus.sgzb.material.service.ToDoService;
|
||||
import com.bonus.sgzb.material.vo.GlobalContants;
|
||||
import com.bonus.sgzb.material.vo.NoticeInfoVO;
|
||||
import com.bonus.sgzb.system.api.RemoteUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import com.bonus.sgzb.common.core.exception.ServiceException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
|
@ -26,9 +37,15 @@ import java.util.List;
|
|||
@Slf4j
|
||||
public class ToDoServiceImpl implements ToDoService {
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private ToDoMapper toDoMapper;
|
||||
|
||||
@Resource
|
||||
private PurchaseCheckInfoMapper purchaseCheckInfoMapper;
|
||||
|
||||
@Resource
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
@Override
|
||||
public List<ToDoBean> getToDoList(ToDoBean bean) {
|
||||
return toDoMapper.getToDoList(bean);
|
||||
|
|
@ -44,4 +61,44 @@ public class ToDoServiceImpl implements ToDoService {
|
|||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送催办短信
|
||||
* @param noticeInfoVO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean urgentProcessing(NoticeInfoVO noticeInfoVO){
|
||||
log.info("ToDoServiceImpl urgentProcessing begin {} ",noticeInfoVO.getTaskId());
|
||||
Long taskId = noticeInfoVO.getTaskId();
|
||||
//判断任务是否为空
|
||||
if (taskId == null) {
|
||||
throw new ServiceException(ExceptionDict.TASK_ID_IS_EMPTY_MSG,ExceptionDict.TASK_ID_IS_EMPTY);
|
||||
}
|
||||
String message = noticeInfoVO.getMessage();
|
||||
List<BmNoticeInfo> bmNoticeInfoList = noticeInfoVO.getBmNoticeInfoList();
|
||||
//判断短信通知为是否为空
|
||||
if (bmNoticeInfoList.size() <= 0) {
|
||||
throw new ServiceException(ExceptionDict.BINDING_USER_IS_EMPTY_MSG,ExceptionDict.BINDING_USER_IS_EMPTY);
|
||||
}
|
||||
Boolean send = true;
|
||||
for (BmNoticeInfo bmNoticeInfo : bmNoticeInfoList) {
|
||||
bmNoticeInfo.setContent(message);
|
||||
bmNoticeInfo.setTaskId(taskId);
|
||||
bmNoticeInfo.setModelName(bmNoticeInfo.getModelName());
|
||||
bmNoticeInfo.setCreateTime(new Date());
|
||||
String phone = bmNoticeInfo.getPhone();
|
||||
try {
|
||||
// 短信通知
|
||||
send = remoteUserService.send(phone, message);
|
||||
purchaseCheckInfoMapper.insertBmNoticeInfo(bmNoticeInfo);
|
||||
}catch (Exception e){
|
||||
log.error("发送手机号:{} 失败!",phone);
|
||||
}
|
||||
}
|
||||
log.info("ToDoServiceImpl urgentProcessing end {} ",noticeInfoVO.getTaskId());
|
||||
return send;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,10 +38,10 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
@Resource
|
||||
private TaskService tmTaskService;
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private BackApplyService backApplyService;
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private BackRecordMapper backRecordMapper;
|
||||
|
||||
@Resource
|
||||
|
|
@ -49,7 +49,6 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
@Resource
|
||||
private LeaseRecordMapper leaseRecordMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<SltAgreementInfo> getUseringData(SltAgreementInfo sltAgreementInfo) {
|
||||
return workSiteDirectManageMapper.getUseringData(sltAgreementInfo);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
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.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author 阮世耀
|
||||
|
|
@ -95,4 +97,35 @@ public class ScrapApplyDetailsVO {
|
|||
/** 报废数量 */
|
||||
@Excel(name = "报废数量")
|
||||
private BigDecimal scrapNum2;
|
||||
|
||||
|
||||
/**
|
||||
* 报废来源
|
||||
*/
|
||||
private Integer scrapSource;
|
||||
|
||||
/**
|
||||
*退料单号
|
||||
*/
|
||||
private String repairCode;
|
||||
|
||||
/**
|
||||
* 审核部门列表
|
||||
*/
|
||||
private List<ScrapAuditorSet> scrapAuditorSetList;
|
||||
|
||||
/**
|
||||
* 处置
|
||||
*/
|
||||
private Integer disposition;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
private String dispositionFileUrl;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String dispositionFileName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,4 +30,16 @@ public class ScrapAudit {
|
|||
@ApiModelProperty(value = "报废任务明细")
|
||||
private List<ScrapApplyDetails> scrapDetailList;
|
||||
|
||||
@ApiModelProperty(value = "任务id")
|
||||
private Long taskId;
|
||||
|
||||
@ApiModelProperty(value = "审核部门列表id")
|
||||
private List<Integer> deptIds;
|
||||
|
||||
@ApiModelProperty(value = "组织id")
|
||||
private Integer companyId;
|
||||
|
||||
@ApiModelProperty(value = "处置情况")
|
||||
private Integer disposition;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
tk.remark,
|
||||
tk1.CODE repairNum,
|
||||
sad.scrap_num as scrapNum2,
|
||||
sad.scrap_source as scrapSource,
|
||||
sad.file_url as fileUrl,
|
||||
tk.task_id taskId
|
||||
FROM
|
||||
tm_task tk
|
||||
|
|
@ -51,9 +53,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN bm_project_lot bpl ON bai.project_id = bpl.lot_id
|
||||
LEFT JOIN bm_unit_info bui ON bai.unit_id = bui.unit_id
|
||||
LEFT JOIN scrap_apply_details sad ON tk.task_id = sad.task_id
|
||||
LEFT JOIN repair_audit_details rad ON sad.parent_id = rad.id
|
||||
LEFT JOIN repair_apply_details rad2 ON rad.repair_id = rad2.id
|
||||
LEFT JOIN tm_task tk1 ON rad2.task_id = tk1.task_id
|
||||
/* LEFT JOIN repair_audit_details rad ON sad.parent_id = rad.id
|
||||
LEFT JOIN repair_apply_details rad2 ON rad.repair_id = rad2.id*/
|
||||
LEFT JOIN scrap_apply_details sad1 ON sad.parent_id = sad1.id
|
||||
LEFT JOIN tm_task tk1 ON sad1.task_id = tk1.task_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
id,
|
||||
|
|
@ -287,6 +290,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="typeName != null and typeName != ''">
|
||||
AND mt1.type_id = #{typeName}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND sad.status = #{status}
|
||||
</if>
|
||||
order by sad.create_time desc
|
||||
</select>
|
||||
|
||||
|
|
@ -410,5 +416,145 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
group by scrap_type
|
||||
</select>
|
||||
<select id="getScrapApplyList" resultType="com.bonus.sgzb.material.vo.ScrapApplyDetailsVO">
|
||||
|
||||
SELECT
|
||||
tk.CODE scrapNum,
|
||||
tk.task_status taskStatus,
|
||||
dic.NAME taskStatusName,
|
||||
bui.unit_name unitName,
|
||||
bpl.lot_name projectName,
|
||||
su.nick_name createBy,
|
||||
tk.create_time createTime,
|
||||
tk.remark,
|
||||
tk1.CODE repairNum,
|
||||
sad.scrap_num as scrapNum2,
|
||||
sad.scrap_source as scrapSource,
|
||||
rad3.CODE repairCode,
|
||||
tk.task_id taskId
|
||||
FROM
|
||||
tm_task tk
|
||||
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_lot bpl ON bai.project_id = bpl.lot_id
|
||||
LEFT JOIN bm_unit_info bui ON bai.unit_id = bui.unit_id
|
||||
LEFT JOIN scrap_apply_details sad ON tk.task_id = sad.task_id
|
||||
LEFT JOIN repair_audit_details rad ON sad.parent_id = rad.id
|
||||
LEFT JOIN back_apply_info rad3 ON sad.parent_id = rad3.id
|
||||
LEFT JOIN repair_apply_details rad2 ON rad.repair_id = rad2.id
|
||||
LEFT JOIN tm_task tk1 ON rad2.task_id = tk1.task_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
id,
|
||||
p_id,
|
||||
NAME
|
||||
FROM
|
||||
sys_dic
|
||||
WHERE
|
||||
p_id = '20') dic ON tk.task_status = dic.id
|
||||
LEFT JOIN ma_type mt ON sad.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
|
||||
WHERE
|
||||
sad.scrap_source IN ( '1', '2' )
|
||||
AND tk.task_type IN ('20' , '21')
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (locate(#{keyword}, tk.create_by) > 0
|
||||
or locate(#{keyword}, tk.CODE) > 0
|
||||
or locate(#{keyword}, bui.unit_name) > 0
|
||||
or locate(#{keyword}, bpl.lot_name) > 0
|
||||
or locate(#{keyword}, tk1.CODE) > 0)
|
||||
</if>
|
||||
<if test="backUnit != null and backUnit != ''">
|
||||
and bui.unit_id = #{backUnit}
|
||||
</if>
|
||||
<if test="repairStatus != null and repairStatus != ''">
|
||||
and tk.task_status = #{repairStatus}
|
||||
</if>
|
||||
<if test="backPro != null and backPro != ''">
|
||||
and bpl.lot_id = #{backPro}
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
and mt1.type_id = #{type}
|
||||
</if>
|
||||
<if test="backCode != null and backCode != ''">
|
||||
and locate(#{backCode}, tk.code) > 0
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
|
||||
and tk.create_time between #{params.beginTime} and #{params.endTime}
|
||||
</if>
|
||||
GROUP BY tk.CODE
|
||||
order by tk.create_time desc
|
||||
|
||||
</select>
|
||||
<select id="scrapTaskReviewList" resultType="com.bonus.sgzb.material.vo.ScrapApplyDetailsVO">
|
||||
SELECT
|
||||
tk.CODE scrapNum,
|
||||
tk.task_status taskStatus,
|
||||
dic.NAME taskStatusName,
|
||||
bui.unit_name unitName,
|
||||
bpl.lot_name projectName,
|
||||
su.nick_name createBy,
|
||||
tk.create_time createTime,
|
||||
tk.remark,
|
||||
tk1.CODE repairNum,
|
||||
sad.scrap_num as scrapNum2,
|
||||
sad.scrap_source as scrapSource,
|
||||
sad.file_url as fileUrl,
|
||||
tk.task_id taskId
|
||||
FROM
|
||||
tm_task tk
|
||||
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_lot bpl ON bai.project_id = bpl.lot_id
|
||||
LEFT JOIN bm_unit_info bui ON bai.unit_id = bui.unit_id
|
||||
LEFT JOIN scrap_apply_details sad ON tk.task_id = sad.task_id
|
||||
/* LEFT JOIN repair_audit_details rad ON sad.parent_id = rad.id
|
||||
LEFT JOIN repair_apply_details rad2 ON rad.repair_id = rad2.id*/
|
||||
LEFT JOIN scrap_apply_details sad1 ON sad.parent_id = sad1.id
|
||||
LEFT JOIN tm_task tk1 ON sad1.task_id = tk1.task_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
id,
|
||||
p_id,
|
||||
NAME
|
||||
FROM
|
||||
sys_dic
|
||||
WHERE
|
||||
p_id IN ( SELECT id FROM sys_dic WHERE VALUE = 'bf_task' )) dic ON tk.task_status = dic.id
|
||||
LEFT JOIN ma_type mt ON sad.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
|
||||
WHERE
|
||||
sad.scrap_source IN ( '1', '2' )
|
||||
AND tk.task_type = 57 AND tk.task_status in ('58','59','61')
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (locate(#{keyword}, tk.create_by) > 0
|
||||
or locate(#{keyword}, tk.CODE) > 0
|
||||
or locate(#{keyword}, bui.unit_name) > 0
|
||||
or locate(#{keyword}, bpl.lot_name) > 0
|
||||
or locate(#{keyword}, tk1.CODE) > 0)
|
||||
</if>
|
||||
<if test="backUnit != null and backUnit != ''">
|
||||
and bui.unit_id = #{backUnit}
|
||||
</if>
|
||||
<if test="repairStatus != null and repairStatus != ''">
|
||||
and tk.task_status = #{repairStatus}
|
||||
</if>
|
||||
<if test="backPro != null and backPro != ''">
|
||||
and bpl.lot_id = #{backPro}
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
and mt1.type_id = #{type}
|
||||
</if>
|
||||
<if test="backCode != null and backCode != ''">
|
||||
and locate(#{backCode}, tk.code) > 0
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
|
||||
and tk.create_time between #{params.beginTime} and #{params.endTime}
|
||||
</if>
|
||||
GROUP BY tk.CODE
|
||||
order by tk.create_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.bonus.sgzb.material.mapper.ScrapAuditorSetMapper">
|
||||
<insert id="insertScrapAuditorSet" parameterType="com.bonus.sgzb.material.domain.ScrapAuditorSet">
|
||||
insert into scrap_auditor_set(task_id,dept_id,user_id,company_id,audit_time)
|
||||
values(#{taskId},#{deptId},#{userId},#{companyId},#{auditTime})
|
||||
</insert>
|
||||
<update id="updateStatus" parameterType="com.bonus.sgzb.material.domain.ScrapAuditorSet">
|
||||
update scrap_auditor_set
|
||||
<set>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="auditTime != null">audit_time = #{auditTime},</if>
|
||||
<if test="reasonRejection != null">reason_rejection = #{reasonRejection},</if>
|
||||
</set>
|
||||
where task_id = #{taskId} and dept_id = #{deptId}
|
||||
</update>
|
||||
<select id="selectScrapAuditListByTaskId" resultType="com.bonus.sgzb.material.domain.ScrapAuditorSet">
|
||||
select sas.*, d.dept_name as deptName from scrap_auditor_set sas
|
||||
left join sys_dept d on d.dept_id = sas.dept_id
|
||||
where task_id = #{taskId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -205,6 +205,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="companyId != null">company_id = #{companyId},</if>
|
||||
<if test="disposition != null">disposition = #{disposition},</if>
|
||||
<if test="fileUrl != null">file_url = #{fileUrl},</if>
|
||||
<if test="fileName != null">file_name = #{fileName},</if>
|
||||
</trim>
|
||||
where task_id = #{taskId}
|
||||
</update>
|
||||
|
|
@ -251,4 +254,74 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND task_type = #{taskType}
|
||||
ORDER BY create_time DESC LIMIT 1
|
||||
</select>
|
||||
<select id="selectTmTaskListByDisposition" resultType="com.bonus.sgzb.material.vo.ScrapApplyDetailsVO">
|
||||
|
||||
SELECT
|
||||
tk.CODE scrapNum,
|
||||
tk.task_status taskStatus,
|
||||
dic.NAME taskStatusName,
|
||||
bui.unit_name unitName,
|
||||
bpl.lot_name projectName,
|
||||
su.nick_name createBy,
|
||||
tk.create_time createTime,
|
||||
tk.remark,
|
||||
tk1.CODE repairNum,
|
||||
sad.scrap_num as scrapNum2,
|
||||
sad.scrap_source as scrapSource,
|
||||
sad.file_url as fileUrl,
|
||||
tk.task_id taskId,
|
||||
tk.disposition disposition,
|
||||
tk.file_url dispositionFileUrl,
|
||||
tk.file_name dispositionFileName
|
||||
FROM
|
||||
tm_task tk
|
||||
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_lot bpl ON bai.project_id = bpl.lot_id
|
||||
LEFT JOIN bm_unit_info bui ON bai.unit_id = bui.unit_id
|
||||
LEFT JOIN scrap_apply_details sad ON tk.task_id = sad.task_id
|
||||
LEFT JOIN scrap_apply_details sad1 ON sad.parent_id = sad1.id
|
||||
LEFT JOIN tm_task tk1 ON sad1.task_id = tk1.task_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
id,
|
||||
p_id,
|
||||
NAME
|
||||
FROM
|
||||
sys_dic
|
||||
WHERE
|
||||
p_id IN ( SELECT id FROM sys_dic WHERE VALUE = 'bf_task' )) dic ON tk.task_status = dic.id
|
||||
LEFT JOIN ma_type mt ON sad.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
|
||||
WHERE
|
||||
tk.task_type = '57' and tk.task_status = '59'
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (locate(#{keyword}, tk.create_by) > 0
|
||||
or locate(#{keyword}, tk.CODE) > 0
|
||||
or locate(#{keyword}, bui.unit_name) > 0
|
||||
or locate(#{keyword}, bpl.lot_name) > 0
|
||||
or locate(#{keyword}, tk1.CODE) > 0)
|
||||
</if>
|
||||
<if test="backUnit != null and backUnit != ''">
|
||||
and bui.unit_id = #{backUnit}
|
||||
</if>
|
||||
<if test="repairStatus != null and repairStatus != ''">
|
||||
and tk.task_status = #{repairStatus}
|
||||
</if>
|
||||
<if test="backPro != null and backPro != ''">
|
||||
and bpl.lot_id = #{backPro}
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
and mt1.type_id = #{type}
|
||||
</if>
|
||||
<if test="backCode != null and backCode != ''">
|
||||
and locate(#{backCode}, tk.code) > 0
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
|
||||
and tk.create_time between #{params.beginTime} and #{params.endTime}
|
||||
</if>
|
||||
GROUP BY tk.CODE
|
||||
order by tk.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT
|
||||
tt.task_id as taskId,
|
||||
tt.`code` as taskCode,
|
||||
tt.task_type as taskTypeId,
|
||||
sd2.`name` as taskType,
|
||||
sd.`name` as taskEvent,
|
||||
us.user_name as createName,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ import com.bonus.sgzb.system.api.domain.SysDept;
|
|||
import com.bonus.sgzb.system.api.domain.SysRole;
|
||||
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||
import com.bonus.sgzb.system.api.model.LoginUser;
|
||||
import com.bonus.sgzb.system.domain.po.UrgentProcessingUser;
|
||||
import com.bonus.sgzb.system.service.*;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
|
@ -371,4 +373,15 @@ public class SysUserController extends BaseController {
|
|||
return success(userService.getUserByRoleList(sysUser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过任务状态获取下一级审批人的信息
|
||||
* @param urgentProcessingUser
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取催办用户信息")
|
||||
@PostMapping("/urgentProcessingUser")
|
||||
public AjaxResult urgentProcessingUser(@RequestBody UrgentProcessingUser urgentProcessingUser){
|
||||
return userService.urgentProcessingUser(urgentProcessingUser);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
package com.bonus.sgzb.system.domain.po;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UrgentProcessingUser {
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
*/
|
||||
private String taskStatus;
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.bonus.sgzb.system.exception;
|
||||
|
||||
public class SystemException {
|
||||
|
||||
|
||||
public static final Integer TASK_ID_IS_EMPTY = 50005;
|
||||
public static final String TASK_ID_IS_EMPTY_MSG = "任务taskId为空!!";
|
||||
}
|
||||
|
|
@ -1,7 +1,10 @@
|
|||
package com.bonus.sgzb.system.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||
import com.bonus.sgzb.system.domain.po.UrgentProcessingUser;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
|
@ -213,4 +216,12 @@ public interface ISysUserService
|
|||
* @return List<SysUser>
|
||||
*/
|
||||
List<SysUser> getUserByRoleList(SysUser sysUser);
|
||||
|
||||
|
||||
/**
|
||||
* 通过任务状态获取下一级审批人的信息
|
||||
* @param urgentProcessingUser
|
||||
* @return
|
||||
*/
|
||||
AjaxResult urgentProcessingUser(UrgentProcessingUser urgentProcessingUser);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
package com.bonus.sgzb.system.service.impl;
|
||||
|
||||
import com.bonus.sgzb.common.core.constant.UserConstants;
|
||||
import com.bonus.sgzb.common.core.enums.RoleEnum;
|
||||
import com.bonus.sgzb.common.core.enums.TaskStatusEnum;
|
||||
import com.bonus.sgzb.common.core.exception.ServiceException;
|
||||
import com.bonus.sgzb.common.core.utils.SpringUtils;
|
||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||
import com.bonus.sgzb.common.core.utils.bean.BeanValidators;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.datascope.annotation.DataScope;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.system.api.domain.SysDept;
|
||||
|
|
@ -13,6 +16,8 @@ import com.bonus.sgzb.system.api.domain.SysUser;
|
|||
import com.bonus.sgzb.system.domain.SysPost;
|
||||
import com.bonus.sgzb.system.domain.SysUserPost;
|
||||
import com.bonus.sgzb.system.domain.SysUserRole;
|
||||
import com.bonus.sgzb.system.domain.po.UrgentProcessingUser;
|
||||
import com.bonus.sgzb.system.exception.SystemException;
|
||||
import com.bonus.sgzb.system.mapper.*;
|
||||
import com.bonus.sgzb.system.service.ISysConfigService;
|
||||
import com.bonus.sgzb.system.service.ISysUserService;
|
||||
|
|
@ -30,6 +35,8 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.bonus.sgzb.common.core.web.domain.AjaxResult.success;
|
||||
|
||||
/**
|
||||
* 用户 业务层处理
|
||||
*
|
||||
|
|
@ -39,28 +46,28 @@ import java.util.stream.Collectors;
|
|||
public class SysUserServiceImpl implements ISysUserService {
|
||||
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private SysUserMapper userMapper;
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private SysRoleMapper roleMapper;
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private SysPostMapper postMapper;
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private SysUserRoleMapper userRoleMapper;
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private SysUserPostMapper userPostMapper;
|
||||
|
||||
@Resource
|
||||
private ISysConfigService configService;
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
protected Validator validator;
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private SysDeptMapper deptMapper;
|
||||
|
||||
/**
|
||||
|
|
@ -526,4 +533,32 @@ public class SysUserServiceImpl implements ISysUserService {
|
|||
return userMapper.selectUserByRole(sysUser);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过任务状态获取下一级审批人的信息
|
||||
* @param urgentProcessingUser
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult urgentProcessingUser(UrgentProcessingUser urgentProcessingUser) {
|
||||
log.info("ToDoServiceImpl urgentProcessingUser {} begin" ,urgentProcessingUser);
|
||||
List<SysUser> userList = new ArrayList<>();
|
||||
SysUser sysUser = new SysUser();
|
||||
// 验证是否为空
|
||||
if (urgentProcessingUser == null || urgentProcessingUser.getTaskStatus() == null) {
|
||||
throw new ServiceException(SystemException.TASK_ID_IS_EMPTY_MSG,SystemException.TASK_ID_IS_EMPTY);
|
||||
}
|
||||
//判断当前催办任务的状态,获取需要催办人的信息
|
||||
if(TaskStatusEnum.STAY_BRANCH_AUDIT.getInfo().equals(urgentProcessingUser.getTaskStatus())){//待分公司审核
|
||||
sysUser.setRoleId(RoleEnum.BRANCH_OFFICES.getCode());
|
||||
//TODO 后期逻辑需要待确认
|
||||
}else if (TaskStatusEnum.STAY_RESPONSIBLE_DEPARTMENT_AUDIT.getInfo().equals(urgentProcessingUser.getTaskStatus())) {//待分管部门审核
|
||||
sysUser.setRoleId(RoleEnum.CONSTRUCTION_MANAGEMENT_DEPARTMENT.getCode());
|
||||
}else if (TaskStatusEnum.STAY_INTERNAL_AUDIT.getInfo().equals(urgentProcessingUser.getTaskStatus())) {//待内部审核
|
||||
sysUser.setRoleId(RoleEnum.MACHINERY_BRANCH.getCode());
|
||||
}
|
||||
userList = userMapper.selectUserByRole(sysUser);
|
||||
log.info("ToDoServiceImpl urgentProcessingUser {} end" ,urgentProcessingUser);
|
||||
return success(userList);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue