Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
9e525fc5e9
|
|
@ -57,6 +57,9 @@ public class MaterialConstants {
|
|||
/** 领料单号的开头字母 */
|
||||
public static final String LEASE_TASK_TYPE_LABEL = "L";
|
||||
|
||||
/** 维修单号的开头字母 */
|
||||
public static final String REPAIR_TASK_TYPE_LABEL = "WX";
|
||||
|
||||
public static final String INNER_PROTOCAL = "1"; //内部单位协议
|
||||
|
||||
public static final String OUTER_PROTOCAL = "2"; //外部单位协议
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
package com.bonus.material.repair.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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;
|
||||
|
|
@ -27,14 +27,14 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
|||
/**
|
||||
* 维修记录Controller
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-10-16
|
||||
* @author syruan
|
||||
*/
|
||||
@Api(tags = "维修记录接口")
|
||||
@RestController
|
||||
@RequestMapping("/repair_apply_record")
|
||||
public class RepairApplyRecordController extends BaseController {
|
||||
@Autowired
|
||||
|
||||
@Resource
|
||||
private IRepairApplyRecordService repairApplyRecordService;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -49,17 +49,11 @@ public class RepairAuditDetailsController extends BaseController {
|
|||
*/
|
||||
@ApiOperation("查询修试审核任务列表")
|
||||
@GetMapping("/questList")
|
||||
@SysLog(title = "查询修试审核任务列表", businessType = OperaType.QUERY, logType = 1,module = "机具系统->查询修试审核任务列表")
|
||||
@RequiresPermissions("service:auditing:list")
|
||||
public TableDataInfo questList(RepairAuditDetails repairAuditDetails) {
|
||||
startPage();
|
||||
Map<String, Object> params = repairAuditDetails.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");
|
||||
repairAuditDetails.setParams(params);
|
||||
}
|
||||
repairAuditDetailsService.queryTimeCope(repairAuditDetails);
|
||||
List<ScrapApplyDetailsVO> list = repairAuditDetailsService.selectRepairQuestList(repairAuditDetails);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
@ -68,15 +62,9 @@ public class RepairAuditDetailsController extends BaseController {
|
|||
* 导出修试审核任务列表
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
@SysLog(title = "导出修试审核任务列表", businessType = OperaType.EXPORT, logType = 1,module = "机具系统->导出修试审核任务列表")
|
||||
public void exportAudit(HttpServletResponse response, RepairAuditDetails bean) {
|
||||
Map<String, Object> params = bean.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");
|
||||
bean.setParams(params);
|
||||
}
|
||||
repairAuditDetailsService.queryTimeCope(bean);
|
||||
List<RepairAuditDetailsVO> list = repairAuditDetailsService.exportRepairQuestList(bean);
|
||||
ExcelUtil<RepairAuditDetailsVO> util = new ExcelUtil<>(RepairAuditDetailsVO.class);
|
||||
util.exportExcel(response, list, "修试审核任务列表");
|
||||
|
|
@ -87,7 +75,7 @@ public class RepairAuditDetailsController extends BaseController {
|
|||
*/
|
||||
@ApiOperation("查看修饰审核任务详细列表")
|
||||
@GetMapping("/getRepairAuditList")
|
||||
@RequiresPermissions("service:auditing")
|
||||
@RequiresPermissions("service:auditing:list")
|
||||
public TableDataInfo getRepairAuditList(RepairAuditDetails repairAuditDetails) {
|
||||
startPage();
|
||||
List<RepairAuditDetails> list = repairAuditDetailsService.getRepairAuditList(repairAuditDetails);
|
||||
|
|
@ -128,7 +116,7 @@ public class RepairAuditDetailsController extends BaseController {
|
|||
|
||||
|
||||
|
||||
//--------------------TOP--COPY--------------------------BUTTON--GENDER---------------
|
||||
//-----------------------------TOP--COPY--BUTTON--GENDER------------------------------
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.material.repair.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -9,6 +11,7 @@ import lombok.EqualsAndHashCode;
|
|||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 修试审核详细对象 repair_audit_details
|
||||
*
|
||||
|
|
@ -29,18 +32,22 @@ public class RepairAuditDetails extends BaseEntity {
|
|||
@ApiModelProperty(value = "任务ID")
|
||||
private Long taskId;
|
||||
|
||||
@ApiModelProperty(value = "任务状态")
|
||||
@Excel(name = "任务状态")
|
||||
private String taskStatus;
|
||||
|
||||
@ApiModelProperty(value = "任务类型编码")
|
||||
private Integer taskTypeCode = TmTaskTypeEnum.TM_TASK_REPAIR.getTaskTypeId();
|
||||
|
||||
/** 维修ID */
|
||||
@Excel(name = "维修ID")
|
||||
@ApiModelProperty(value = "维修ID")
|
||||
private Long repairId;
|
||||
|
||||
/** 机具ID */
|
||||
@Excel(name = "机具ID")
|
||||
@ApiModelProperty(value = "机具ID")
|
||||
private Long maId;
|
||||
|
||||
/** 规格ID */
|
||||
@Excel(name = "规格ID")
|
||||
@ApiModelProperty(value = "规格ID")
|
||||
private Long typeId;
|
||||
|
||||
|
|
@ -67,7 +74,7 @@ public class RepairAuditDetails extends BaseEntity {
|
|||
/** 审核时间 */
|
||||
@ApiModelProperty(value = "审核时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss")
|
||||
private Date auditTime;
|
||||
|
||||
/** 备注备注 */
|
||||
|
|
@ -76,17 +83,14 @@ public class RepairAuditDetails extends BaseEntity {
|
|||
private String auditRemark;
|
||||
|
||||
/** 0未审核1已审核2驳回 */
|
||||
@Excel(name = "0未审核1已审核2驳回")
|
||||
@Excel(name = "状态", readConverterExp = "0=未审核,1=已审核,2=驳回")
|
||||
@ApiModelProperty(value = "0未审核1已审核2驳回")
|
||||
private String status;
|
||||
private char status;
|
||||
|
||||
/** 数据所属组织 */
|
||||
@Excel(name = "数据所属组织")
|
||||
@ApiModelProperty(value = "数据所属组织")
|
||||
private Integer companyId;
|
||||
|
||||
@ApiModelProperty(value = "任务状态")
|
||||
private String taskStatus;
|
||||
|
||||
/**传入参数*/
|
||||
@ApiModelProperty(value = "单位id")
|
||||
|
|
@ -99,6 +103,8 @@ public class RepairAuditDetails extends BaseEntity {
|
|||
private String backCode;
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyword;
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
|
||||
@Excel(name = "设备类型")
|
||||
@ApiModelProperty(value = "设备类型")
|
||||
private String typeName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,4 +72,6 @@ public class RepairTaskDetails extends BaseEntity {
|
|||
|
||||
@ApiModelProperty(value = "组织id")
|
||||
private Long companyId;
|
||||
|
||||
private Long backId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,9 +8,8 @@ import lombok.Data;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author 阮世耀
|
||||
* @Create 2023/12/13 15:45
|
||||
* @Version 1.0
|
||||
* @author : 阮世耀
|
||||
* @version : 2.0
|
||||
*/
|
||||
@Data
|
||||
public class ScrapApplyDetailsVO {
|
||||
|
|
@ -38,9 +37,9 @@ public class ScrapApplyDetailsVO {
|
|||
private String projectName;
|
||||
|
||||
/**
|
||||
* 班组名称
|
||||
* 维修班组名称
|
||||
*/
|
||||
@ApiModelProperty(value = "班组名称")
|
||||
@ApiModelProperty(value = "维修班组名称")
|
||||
private String teamName;
|
||||
|
||||
/**
|
||||
|
|
@ -53,6 +52,7 @@ public class ScrapApplyDetailsVO {
|
|||
* 机具类型
|
||||
*/
|
||||
private String itemType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.material.repair.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.bonus.material.repair.domain.RepairAuditDetails;
|
||||
import com.bonus.material.repair.domain.RepairPart;
|
||||
import com.bonus.material.repair.domain.RepairRecord;
|
||||
|
|
@ -11,8 +13,7 @@ import com.bonus.material.repair.domain.vo.ScrapApplyDetailsVO;
|
|||
/**
|
||||
* 修试审核详细Mapper接口
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-10-16
|
||||
* @author syruan
|
||||
*/
|
||||
public interface RepairAuditDetailsMapper {
|
||||
|
||||
|
|
@ -33,7 +34,7 @@ public interface RepairAuditDetailsMapper {
|
|||
* @param id 修试审核详细主键
|
||||
* @return 修试审核详细
|
||||
*/
|
||||
public RepairAuditDetails selectRepairAuditDetailsById(Long id);
|
||||
RepairAuditDetails selectRepairAuditDetailsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询修试审核详细列表
|
||||
|
|
@ -41,7 +42,7 @@ public interface RepairAuditDetailsMapper {
|
|||
* @param repairAuditDetails 修试审核详细
|
||||
* @return 修试审核详细集合
|
||||
*/
|
||||
public List<RepairAuditDetails> selectRepairAuditDetailsList(RepairAuditDetails repairAuditDetails);
|
||||
List<RepairAuditDetails> selectRepairAuditDetailsList(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
/**
|
||||
* 新增修试审核详细
|
||||
|
|
@ -49,7 +50,7 @@ public interface RepairAuditDetailsMapper {
|
|||
* @param repairAuditDetails 修试审核详细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRepairAuditDetails(RepairAuditDetails repairAuditDetails);
|
||||
int insertRepairAuditDetails(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
/**
|
||||
* 修改修试审核详细
|
||||
|
|
@ -57,7 +58,7 @@ public interface RepairAuditDetailsMapper {
|
|||
* @param repairAuditDetails 修试审核详细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRepairAuditDetails(RepairAuditDetails repairAuditDetails);
|
||||
int updateRepairAuditDetails(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
/**
|
||||
* 删除修试审核详细
|
||||
|
|
@ -65,7 +66,7 @@ public interface RepairAuditDetailsMapper {
|
|||
* @param id 修试审核详细主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRepairAuditDetailsById(Long id);
|
||||
int deleteRepairAuditDetailsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除修试审核详细
|
||||
|
|
@ -73,15 +74,29 @@ public interface RepairAuditDetailsMapper {
|
|||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRepairAuditDetailsByIds(Long[] ids);
|
||||
int deleteRepairAuditDetailsByIds(Long[] ids);
|
||||
|
||||
List<ScrapApplyDetailsVO> selectRepairQuestList(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
/**
|
||||
* 根据taskId查询单个规格名称---单个
|
||||
* @param taskId 任务id
|
||||
*/
|
||||
String selectTypeNameByTaskId(Long taskId);
|
||||
|
||||
/**
|
||||
* 根据taskIds批量查询规格名称---批量
|
||||
* @param taskIds 任务id集合
|
||||
*/
|
||||
Map<Long, String> selectTypeNamesByTaskIds(List<Long> taskIds);
|
||||
|
||||
List<RepairAuditDetails> selectRepairAuditDetailsByTaskId(Long taskId);
|
||||
|
||||
List<RepairAuditDetails> selectnotAuditByTaskId(Long taskId);
|
||||
/**
|
||||
* 根据taskId查询未审核的数据
|
||||
* @param taskId 任务id
|
||||
*/
|
||||
List<RepairAuditDetails> selectNotAuditByTaskId(Long taskId);
|
||||
|
||||
List<RepairAuditDetails> selectRepairInputByTaskId(Long taskId);
|
||||
|
||||
|
|
@ -89,7 +104,7 @@ public interface RepairAuditDetailsMapper {
|
|||
|
||||
void updateStatus(RepairAuditDetails bean);
|
||||
|
||||
void updateRepairCost(RepairAuditDetails inputDetails, String status);
|
||||
void updateRepairCost(RepairAuditDetails inputDetails, char status);
|
||||
|
||||
void insertRepairDetails(RepairTaskDetails repairTaskDetails);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.material.repair.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.bonus.material.repair.domain.RepairAuditDetails;
|
||||
import com.bonus.material.repair.domain.RepairPart;
|
||||
import com.bonus.material.repair.domain.RepairRecord;
|
||||
|
|
@ -11,8 +13,7 @@ import com.bonus.material.repair.domain.vo.ScrapAudit;
|
|||
/**
|
||||
* 修试审核详细Service接口
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-10-16
|
||||
* @author syruan
|
||||
*/
|
||||
public interface IRepairAuditDetailsService {
|
||||
/**
|
||||
|
|
@ -21,8 +22,12 @@ public interface IRepairAuditDetailsService {
|
|||
* @param id 修试审核详细主键
|
||||
* @return 修试审核详细
|
||||
*/
|
||||
public RepairAuditDetails selectRepairAuditDetailsById(Long id);
|
||||
RepairAuditDetails selectRepairAuditDetailsById(Long id);
|
||||
|
||||
/**
|
||||
* 公共方法来处理时间格式化 YYYY-MM-DD 增加 HH:mm:ss
|
||||
*/
|
||||
void formatTimeParam(Map<String, Object> params, String key, String suffix);
|
||||
|
||||
/**
|
||||
* 查询修试审核任务列表
|
||||
|
|
@ -39,6 +44,8 @@ public interface IRepairAuditDetailsService {
|
|||
*/
|
||||
List<RepairAuditDetails> getRepairAuditList(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
void queryTimeCope(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
List<RepairRecord> getRepairRecord(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
List<RepairPart> getPartRecord(RepairAuditDetails repairAuditDetails);
|
||||
|
|
@ -55,7 +62,7 @@ public interface IRepairAuditDetailsService {
|
|||
* @param repairAuditDetails 修试审核详细
|
||||
* @return 修试审核详细集合
|
||||
*/
|
||||
public List<RepairAuditDetails> selectRepairAuditDetailsList(RepairAuditDetails repairAuditDetails);
|
||||
List<RepairAuditDetails> selectRepairAuditDetailsList(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
/**
|
||||
* 新增修试审核详细
|
||||
|
|
@ -63,7 +70,7 @@ public interface IRepairAuditDetailsService {
|
|||
* @param repairAuditDetails 修试审核详细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRepairAuditDetails(RepairAuditDetails repairAuditDetails);
|
||||
int insertRepairAuditDetails(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
/**
|
||||
* 修改修试审核详细
|
||||
|
|
@ -71,7 +78,7 @@ public interface IRepairAuditDetailsService {
|
|||
* @param repairAuditDetails 修试审核详细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRepairAuditDetails(RepairAuditDetails repairAuditDetails);
|
||||
int updateRepairAuditDetails(RepairAuditDetails repairAuditDetails);
|
||||
|
||||
/**
|
||||
* 批量删除修试审核详细
|
||||
|
|
@ -79,7 +86,7 @@ public interface IRepairAuditDetailsService {
|
|||
* @param ids 需要删除的修试审核详细主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRepairAuditDetailsByIds(Long[] ids);
|
||||
int deleteRepairAuditDetailsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除修试审核详细信息
|
||||
|
|
@ -87,5 +94,5 @@ public interface IRepairAuditDetailsService {
|
|||
* @param id 修试审核详细主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRepairAuditDetailsById(Long id);
|
||||
int deleteRepairAuditDetailsById(Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
package com.bonus.material.repair.service.impl;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.bonus.common.biz.constant.MaterialConstants;
|
||||
import com.bonus.common.biz.enums.RepairTaskStatusEnum;
|
||||
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
|
|
@ -22,7 +23,7 @@ import com.bonus.material.task.domain.TmTaskAgreement;
|
|||
import com.bonus.material.task.mapper.TmTaskAgreementMapper;
|
||||
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||
import com.bonus.material.task.domain.TmTask;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.material.repair.mapper.RepairAuditDetailsMapper;
|
||||
import com.bonus.material.repair.service.IRepairAuditDetailsService;
|
||||
|
|
@ -33,7 +34,7 @@ import javax.annotation.Resource;
|
|||
/**
|
||||
* 修试审核详细Service业务层处理
|
||||
*
|
||||
* @author xsheng
|
||||
* @author syruan
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
@Service
|
||||
|
|
@ -51,9 +52,6 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
@Resource
|
||||
private ScrapApplyDetailsMapper scrapApplyDetailsMapper;
|
||||
|
||||
// @Resource
|
||||
// private RepairTestInputMapper repairTestInputMapper;
|
||||
|
||||
@Resource
|
||||
private RepairInputDetailsMapper repairInputDetailsMapper;
|
||||
|
||||
|
|
@ -66,8 +64,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
@Override
|
||||
public List<RepairRecord> getRepairRecord(RepairAuditDetails repairAuditDetails) {
|
||||
RepairAuditDetails bean = repairAuditDetailsMapper.getRepairId(repairAuditDetails);
|
||||
List<RepairRecord> list = repairAuditDetailsMapper.getRepairRecord(bean);
|
||||
return list;
|
||||
return repairAuditDetailsMapper.getRepairRecord(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -76,8 +73,17 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
*/
|
||||
@Override
|
||||
public List<RepairAuditDetails> getRepairAuditList(RepairAuditDetails repairAuditDetails) {
|
||||
List<RepairAuditDetails> repairAuditDetailsList = repairAuditDetailsMapper.selectRepairAuditDetailsList(repairAuditDetails);
|
||||
return repairAuditDetailsList;
|
||||
return repairAuditDetailsMapper.selectRepairAuditDetailsList(repairAuditDetails);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void queryTimeCope(@NotNull RepairAuditDetails repairAuditDetails) {
|
||||
Map<String, Object> params = repairAuditDetails.getParams();
|
||||
if (params != null && !params.isEmpty()) {
|
||||
formatTimeParam(params, "beginTime", " 00:00:00");
|
||||
formatTimeParam(params, "endTime", " 23:59:59");
|
||||
repairAuditDetails.setParams(params);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -88,18 +94,41 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
/**
|
||||
* 查询试验审核列表
|
||||
*
|
||||
* @param repairAuditDetails
|
||||
* @return
|
||||
* @param repairAuditDetails 查询参数
|
||||
*/
|
||||
@Override
|
||||
public List<ScrapApplyDetailsVO> selectRepairQuestList(RepairAuditDetails repairAuditDetails) {
|
||||
List<ScrapApplyDetailsVO> repairQuestList = repairAuditDetailsMapper.selectRepairQuestList(repairAuditDetails);
|
||||
for (ScrapApplyDetailsVO scrapApplyDetailsVO : repairQuestList) {
|
||||
Long taskId = scrapApplyDetailsVO.getTaskId();
|
||||
String typeName = repairAuditDetailsMapper.selectTypeNameByTaskId(taskId);
|
||||
scrapApplyDetailsVO.setItemType(typeName);
|
||||
try {
|
||||
// 获取所有需要查询的 taskId、过滤空的
|
||||
List<ScrapApplyDetailsVO> repairQuestList = repairAuditDetailsMapper.selectRepairQuestList(repairAuditDetails);
|
||||
// 通过流过滤掉空对象 并转换为 List集合
|
||||
List<Long> taskIds = repairQuestList.stream()
|
||||
.filter(Objects::nonNull) // 过滤掉空的 ScrapApplyDetailsVO 对象
|
||||
.map(ScrapApplyDetailsVO::getTaskId)
|
||||
.filter(Objects::nonNull) // 过滤掉空的 taskId
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 批量查询 typeName
|
||||
Map<Long, String> typeNameMap = repairAuditDetailsMapper.selectTypeNamesByTaskIds(taskIds);
|
||||
|
||||
// 设置 itemType
|
||||
for (ScrapApplyDetailsVO scrapApplyDetailsVO : repairQuestList) {
|
||||
Long taskId = scrapApplyDetailsVO.getTaskId();
|
||||
if (taskId != null) {
|
||||
String typeName = typeNameMap.get(taskId);
|
||||
if (typeName != null) {
|
||||
scrapApplyDetailsVO.setItemType(typeName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return repairQuestList;
|
||||
} catch (Exception e) {
|
||||
// 异常处理
|
||||
System.err.println("Error occurred while selecting repair quest list: " + e.getMessage());
|
||||
throw new ServiceException("Failed to get repair quest list" + e.getMessage());
|
||||
}
|
||||
return repairQuestList;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -110,31 +139,31 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int auditRepair(ScrapAudit scrapAudit) throws Exception {
|
||||
public int auditRepair(@NotNull ScrapAudit scrapAudit) throws Exception {
|
||||
String checkResult = scrapAudit.getCheckResult();
|
||||
List<RepairAuditDetails> auditDetailList = scrapAudit.getAuditDetailList();
|
||||
List<Long> taskIdList = scrapAudit.getTaskIdList();
|
||||
Integer b = 0;
|
||||
char status;
|
||||
for (Long taskId : taskIdList) {
|
||||
String status = "0";
|
||||
TmTask task1 = taskMapper.selectTmTaskByTaskId(taskId);
|
||||
if (task1.getTaskStatus() == 47) {
|
||||
TmTask tmTask = taskMapper.selectTmTaskByTaskId(taskId);
|
||||
if (Objects.equals(tmTask.getTaskStatus(), RepairTaskStatusEnum.TASK_STATUS_REVIEW.getStatus())) {
|
||||
throw new Exception("任务已审核已通过");
|
||||
}
|
||||
|
||||
List<RepairAuditDetails> auditAllList = repairAuditDetailsMapper.selectRepairAuditDetailsByTaskId(taskId);
|
||||
List<RepairAuditDetails> notAuditList = repairAuditDetailsMapper.selectnotAuditByTaskId(taskId);
|
||||
List<RepairAuditDetails> notAuditList = repairAuditDetailsMapper.selectNotAuditByTaskId(taskId);
|
||||
// 查询协议表
|
||||
TmTaskAgreement tmTaskAgreement = agreementMapper.selectTmTaskAgreementByTaskId(taskId);
|
||||
String taskCode = "";
|
||||
int taskStatus = 0;
|
||||
int taskType = 0;
|
||||
String taskCode;
|
||||
int taskStatus;
|
||||
int taskType;
|
||||
int companyId = 0;
|
||||
if ("通过".equals(checkResult)) {
|
||||
status = "1";
|
||||
status = 1;
|
||||
List<RepairAuditDetails> repairInputList = new ArrayList<>();
|
||||
List<RepairAuditDetails> scrapNumList = new ArrayList<>();
|
||||
if (auditDetailList != null && auditDetailList.size() > 0) {
|
||||
if (CollectionUtil.isNotEmpty(auditDetailList)) {
|
||||
for (RepairAuditDetails bean : auditDetailList) {
|
||||
if (bean.getRepairedNum().compareTo(b) > 0) {
|
||||
repairInputList.add(bean);
|
||||
|
|
@ -149,7 +178,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
scrapNumList = repairAuditDetailsMapper.selectScrapNumByTaskId(taskId);
|
||||
}
|
||||
|
||||
if (repairInputList != null && repairInputList.size() > 0) {
|
||||
if (CollectionUtil.isNotEmpty(repairInputList)) {
|
||||
if (repairInputList.get(0).getCompanyId() != null) {
|
||||
companyId = repairInputList.get(0).getCompanyId();
|
||||
}
|
||||
|
|
@ -187,13 +216,11 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
}
|
||||
}
|
||||
}
|
||||
if (scrapNumList != null && scrapNumList.size() > 0) {
|
||||
if (CollectionUtil.isNotEmpty(scrapNumList)) {
|
||||
if (scrapNumList.get(0).getCompanyId() != null) {
|
||||
companyId = scrapNumList.get(0).getCompanyId();
|
||||
}
|
||||
taskCode = purchaseCodeRule("BF", TmTaskTypeEnum.TM_TASK_SCRAP.getTaskTypeId());
|
||||
/*taskStatus = 58;
|
||||
taskType = 57;*/
|
||||
//创建报废任务
|
||||
long scrapTaskId = genTask(taskCode, TmTaskTypeEnum.TM_TASK_SCRAP.getTaskTypeId(), RepairTaskStatusEnum.SCRAP_UNDER_REVIEW.getStatus(), tmTaskAgreement, companyId);
|
||||
for (RepairAuditDetails scrapDetails : scrapNumList) {
|
||||
|
|
@ -226,29 +253,29 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
// 修饰审核通过时改修任务为已通过审核
|
||||
if (auditDetailList != null) {
|
||||
if (auditDetailList.size() == notAuditList.size()) {
|
||||
task1.setTaskStatus(47);
|
||||
tmTask.setTaskStatus(47);
|
||||
}
|
||||
} else if (auditAllList != null) {
|
||||
if (auditAllList.size() == notAuditList.size()) {
|
||||
task1.setTaskStatus(47);
|
||||
tmTask.setTaskStatus(47);
|
||||
}
|
||||
}
|
||||
task1.setUpdateTime(new Date());
|
||||
task1.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
taskMapper.updateTmTask(task1);
|
||||
tmTask.setUpdateTime(new Date());
|
||||
tmTask.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
taskMapper.updateTmTask(tmTask);
|
||||
} else {
|
||||
status = "2";
|
||||
status = 2;
|
||||
List<RepairAuditDetails> repairDetailList = new ArrayList<>();
|
||||
if (auditDetailList != null && auditDetailList.size() > 0) {
|
||||
if (CollectionUtil.isNotEmpty(auditDetailList)) {
|
||||
repairDetailList.addAll(auditDetailList);
|
||||
} else {
|
||||
repairDetailList.addAll(auditAllList);
|
||||
}
|
||||
if (repairDetailList.size() > 0) {
|
||||
if (CollectionUtil.isNotEmpty(repairDetailList)) {
|
||||
if (repairDetailList.get(0).getCompanyId() != null) {
|
||||
companyId = repairDetailList.get(0).getCompanyId();
|
||||
}
|
||||
taskCode = purchaseCodeRule("WX", 41);
|
||||
taskCode = purchaseCodeRule(MaterialConstants.REPAIR_TASK_TYPE_LABEL, 41);
|
||||
taskStatus = 43;
|
||||
taskType = 41;
|
||||
long inputTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, companyId);
|
||||
|
|
@ -264,25 +291,24 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
repairTaskDetails.setStatus("0");
|
||||
repairTaskDetails.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
repairTaskDetails.setCompanyId((long) companyId);
|
||||
// repairTaskDetails.setBackId(backId);
|
||||
repairTaskDetails.setBackId(backId);
|
||||
repairAuditDetailsMapper.insertRepairDetails(repairTaskDetails);
|
||||
|
||||
repairAuditDetailsMapper.updateRepairCost(inputDetails,status);
|
||||
}
|
||||
}
|
||||
// 修饰审核任务不通过时
|
||||
TmTask tmTask = new TmTask();
|
||||
tmTask.setTaskId(taskId);
|
||||
tmTask.setRemark(scrapAudit.getRemark());
|
||||
TmTask tmTaskNotExam = new TmTask();
|
||||
tmTaskNotExam.setTaskId(taskId);
|
||||
tmTaskNotExam.setRemark(scrapAudit.getRemark());
|
||||
if (repairDetailList.size() == notAuditList.size()) {
|
||||
tmTask.setTaskStatus(48);
|
||||
tmTaskNotExam.setTaskStatus(RepairTaskStatusEnum.TASK_STATUS_NO_REVIEW.getStatus());
|
||||
}
|
||||
tmTask.setUpdateTime(new Date());
|
||||
tmTask.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
taskMapper.updateTmTask(tmTask);
|
||||
tmTaskNotExam.setUpdateTime(new Date());
|
||||
tmTaskNotExam.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
taskMapper.updateTmTask(tmTaskNotExam);
|
||||
}
|
||||
if (scrapAudit.getAuditDetailList() != null && scrapAudit.getAuditDetailList().size() > 0) {
|
||||
if (auditDetailList != null) {
|
||||
if (CollectionUtil.isNotEmpty(scrapAudit.getAuditDetailList())) {
|
||||
if (CollectionUtil.isNotEmpty(auditDetailList)) {
|
||||
for (RepairAuditDetails bean : auditDetailList) {
|
||||
bean.setAuditBy(SecurityUtils.getLoginUser().getUserid());
|
||||
bean.setStatus(status);
|
||||
|
|
@ -307,16 +333,14 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
}
|
||||
|
||||
/**采购单号编码生成规则*/
|
||||
private String purchaseCodeRule(String code, Integer taskType) {
|
||||
private @NotNull String purchaseCodeRule(String code, Integer taskType) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
String taskNum = taskMapper.selectTaskNumByMonths(nowDate, taskType);
|
||||
if (StringUtils.isNotEmpty(taskNum)){
|
||||
// 将字符串转换为整数
|
||||
int num = Integer.parseInt(taskNum);
|
||||
// 执行加一操作
|
||||
num++;
|
||||
// 将字符串转换为整数并加一
|
||||
int num = Integer.parseInt(taskNum) + 1;
|
||||
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||
taskNum = String.format("%04d", num);
|
||||
}else {
|
||||
|
|
@ -326,7 +350,10 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
return codeNum;
|
||||
}
|
||||
|
||||
private long genTask(String taskCode, int taskType, int taskStatus, TmTaskAgreement tmTaskAgreement, int companyId) {
|
||||
/**
|
||||
* 生成任务并返回任务id
|
||||
*/
|
||||
private long genTask(String taskCode, int taskType, int taskStatus, @NotNull TmTaskAgreement tmTaskAgreement, int companyId) {
|
||||
TmTask task = new TmTask();
|
||||
task.setCode(taskCode);
|
||||
task.setTaskStatus(taskStatus);
|
||||
|
|
@ -361,6 +388,19 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
return repairAuditDetailsMapper.selectRepairAuditDetailsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 公共方法来处理时间格式化
|
||||
*/
|
||||
@Override
|
||||
public void formatTimeParam(@NotNull Map<String, Object> params, String key, String suffix) {
|
||||
String time = (String) params.get(key);
|
||||
if (time != null && !time.isEmpty()) {
|
||||
params.put(key, time.trim() + suffix);
|
||||
} else {
|
||||
params.remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询修试审核详细列表
|
||||
*
|
||||
|
|
@ -379,7 +419,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRepairAuditDetails(RepairAuditDetails repairAuditDetails) {
|
||||
public int insertRepairAuditDetails(@NotNull RepairAuditDetails repairAuditDetails) {
|
||||
repairAuditDetails.setCreateTime(DateUtils.getNowDate());
|
||||
try {
|
||||
return repairAuditDetailsMapper.insertRepairAuditDetails(repairAuditDetails);
|
||||
|
|
@ -395,7 +435,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRepairAuditDetails(RepairAuditDetails repairAuditDetails) {
|
||||
public int updateRepairAuditDetails(@NotNull RepairAuditDetails repairAuditDetails) {
|
||||
repairAuditDetails.setUpdateTime(DateUtils.getNowDate());
|
||||
try {
|
||||
return repairAuditDetailsMapper.updateRepairAuditDetails(repairAuditDetails);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectRepairAuditDetailsVo">
|
||||
select id, task_id, repair_id, ma_id, type_id, repair_num, repaired_num, scrap_num, audit_by, audit_time, audit_remark, status, create_by, create_time, update_by, update_time, remark, company_id from repair_audit_details
|
||||
select id, task_id, repair_id, ma_id, type_id, repair_num, repaired_num, scrap_num, audit_by, audit_time,
|
||||
audit_remark, status, create_by, create_time, update_by, update_time, remark, company_id
|
||||
from repair_audit_details
|
||||
</sql>
|
||||
|
||||
<select id="selectRepairAuditDetailsList" parameterType="com.bonus.material.repair.domain.RepairAuditDetails" resultMap="RepairAuditDetailsResult">
|
||||
|
|
@ -41,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="auditBy != null "> and audit_by = #{auditBy}</if>
|
||||
<if test="auditTime != null "> and audit_time = #{auditTime}</if>
|
||||
<if test="auditRemark != null and auditRemark != ''"> and audit_remark = #{auditRemark}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="status != null and status != ''"> and `status` = #{status}</if>
|
||||
<if test="companyId != null "> and company_id = #{companyId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
|
@ -52,34 +54,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="getRepairId" resultType="com.bonus.material.repair.domain.RepairAuditDetails">
|
||||
select task_id as taskId,
|
||||
ma_id as maId,
|
||||
type_id as typeId
|
||||
from repair_apply_details
|
||||
where id = #{repairId}
|
||||
select
|
||||
task_id as taskId,
|
||||
ma_id as maId,
|
||||
type_id as typeId
|
||||
from
|
||||
repair_apply_details
|
||||
where
|
||||
id = #{repairId}
|
||||
</select>
|
||||
|
||||
<select id="getPartRecord" resultType="com.bonus.material.repair.domain.RepairPart">
|
||||
select concat(mpt2.pa_name,'-',mpt1.pa_name,'-',mpt.pa_name) as partName,
|
||||
rpd.part_num as partNum,
|
||||
rpd.part_cost as partCost,
|
||||
rpd.part_type as partType,
|
||||
rpd.remark as remark,
|
||||
rpd.repair_content as repairContent
|
||||
from repair_part_details rpd
|
||||
select
|
||||
concat(mpt2.pa_name,'-',mpt1.pa_name,'-',mpt.pa_name) as partName,
|
||||
rpd.part_num as partNum,
|
||||
rpd.part_cost as partCost,
|
||||
rpd.part_type as partType,
|
||||
rpd.remark as remark,
|
||||
rpd.repair_content as repairContent
|
||||
from
|
||||
repair_part_details rpd
|
||||
left join ma_part_type mpt on mpt.pa_id = rpd.part_id
|
||||
left join ma_part_type mpt1 on mpt1.pa_id = mpt.parent_id
|
||||
left join ma_part_type mpt2 on mpt2.pa_id = mpt1.parent_id
|
||||
where 1=1
|
||||
<if test="taskId != null and taskId != ''">
|
||||
and rpd.task_id = #{taskId}
|
||||
</if>
|
||||
<if test="maId != null and maId != ''">
|
||||
and rpd.ma_id = #{maId}
|
||||
</if>
|
||||
<if test="typeId != null and typeId != ''">
|
||||
and rpd.type_id = #{typeId}
|
||||
</if>
|
||||
<where>
|
||||
<if test="taskId != null and taskId != ''">
|
||||
and rpd.task_id = #{taskId}
|
||||
</if>
|
||||
<if test="maId != null and maId != ''">
|
||||
and rpd.ma_id = #{maId}
|
||||
</if>
|
||||
<if test="typeId != null and typeId != ''">
|
||||
and rpd.type_id = #{typeId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="exportRepairQuestList" resultType="com.bonus.material.repair.domain.vo.RepairAuditDetailsVO">
|
||||
|
|
@ -111,7 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join ma_machine mma on rad.ma_id= mma.ma_id
|
||||
LEFT JOIN sys_user su ON su.user_id = tk.create_by
|
||||
WHERE
|
||||
tk.task_type = 45
|
||||
tk.task_type = #{taskTypeCode}
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (locate(#{keyword}, su.nick_name) > 0
|
||||
or locate(#{keyword}, tk.CODE) > 0
|
||||
|
|
@ -141,33 +149,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="getRepairRecord" resultType="com.bonus.material.repair.domain.RepairRecord">
|
||||
select repair_num as repairNum,
|
||||
scrap_num as scrapNum,
|
||||
repair_type as repairType,
|
||||
scrap_reason as scrapReason,
|
||||
scrap_type as scrapType,
|
||||
msi.supplier as supplier,
|
||||
part_num as partNum,
|
||||
part_price as partPrice,
|
||||
repair_content as repairContent,
|
||||
part_type as partType,
|
||||
part_name as partName,
|
||||
file_ids as fileIds,
|
||||
su.nick_name as repairer,
|
||||
rar.remark
|
||||
from repair_apply_record rar
|
||||
left join ma_supplier_info msi on msi.supplier_id = rar.supplier_id
|
||||
left join sys_user su on su.user_id = rar.repairer
|
||||
where 1=1
|
||||
<if test="taskId != null and taskId != ''">
|
||||
and rar.task_id = #{taskId}
|
||||
</if>
|
||||
<if test="maId != null and maId != ''">
|
||||
and rar.ma_id = #{maId}
|
||||
</if>
|
||||
<if test="typeId != null and typeId != ''">
|
||||
and rar.type_id = #{typeId}
|
||||
</if>
|
||||
select
|
||||
repair_num as repairNum,
|
||||
scrap_num as scrapNum,
|
||||
repair_type as repairType,
|
||||
scrap_reason as scrapReason,
|
||||
scrap_type as scrapType,
|
||||
msi.supplier as supplier,
|
||||
part_num as partNum,
|
||||
part_price as partPrice,
|
||||
repair_content as repairContent,
|
||||
part_type as partType,
|
||||
part_name as partName,
|
||||
file_ids as fileIds,
|
||||
su.nick_name as repairer,
|
||||
rar.remark
|
||||
from
|
||||
repair_apply_record rar
|
||||
left join
|
||||
ma_supplier_info msi on msi.supplier_id = rar.supplier_id
|
||||
left join
|
||||
sys_user su on su.user_id = rar.repairer
|
||||
<where>
|
||||
<if test="taskId != null and taskId != ''">
|
||||
and rar.task_id = #{taskId}
|
||||
</if>
|
||||
<if test="maId != null and maId != ''">
|
||||
and rar.ma_id = #{maId}
|
||||
</if>
|
||||
<if test="typeId != null and typeId != ''">
|
||||
and rar.type_id = #{typeId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertRepairAuditDetails" parameterType="com.bonus.material.repair.domain.RepairAuditDetails" useGeneratedKeys="true" keyProperty="id">
|
||||
|
|
@ -249,17 +262,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectRepairQuestList" resultType="com.bonus.material.repair.domain.vo.ScrapApplyDetailsVO">
|
||||
SELECT DISTINCT
|
||||
tk.task_id taskId,
|
||||
tk.CODE scrapNum,
|
||||
tk.task_status taskStatus,
|
||||
bui.unit_name unitName,
|
||||
bpl.pro_name projectName,
|
||||
su.nick_name createBy,
|
||||
tk.create_time createTime,
|
||||
tk.remark,
|
||||
tk.CODE repairNum
|
||||
tk.task_id taskId,
|
||||
tk.CODE scrapNum,
|
||||
tk.task_status taskStatus,
|
||||
bui.unit_name unitName,
|
||||
bpl.pro_name projectName,
|
||||
su.nick_name createBy,
|
||||
tk.create_time createTime,
|
||||
tk.remark,
|
||||
tk.CODE repairNum,
|
||||
su1.user_name as teamName
|
||||
FROM
|
||||
tm_task tk
|
||||
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 bpl ON bai.project_id = bpl.pro_id
|
||||
|
|
@ -268,32 +282,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_type mt ON rad.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
LEFT JOIN sys_user su ON su.user_id = tk.create_by
|
||||
LEFT JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id
|
||||
LEFT JOIN sys_user su1 ON su1.user_id = mtr.user_id
|
||||
WHERE
|
||||
tk.task_type = 45
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (locate(#{keyword}, su.nick_name) > 0
|
||||
or locate(#{keyword}, tk.CODE) > 0
|
||||
or locate(#{keyword}, bui.unit_name) > 0
|
||||
or locate(#{keyword}, bpl.pro_name) > 0)
|
||||
</if>
|
||||
<if test="backUnit != null and backUnit != ''">
|
||||
and bui.unit_id = #{backUnit}
|
||||
</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">
|
||||
and tk.task_status = #{taskStatus}
|
||||
</if>
|
||||
<if test="backPro != null and backPro != ''">
|
||||
and bpl.pro_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>
|
||||
tk.task_type = #{taskTypeCode}
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (locate(#{keyword}, su.nick_name) > 0
|
||||
or locate(#{keyword}, tk.CODE) > 0
|
||||
or locate(#{keyword}, bui.unit_name) > 0
|
||||
or locate(#{keyword}, bpl.pro_name) > 0)
|
||||
</if>
|
||||
<if test="backUnit != null and backUnit != ''">
|
||||
and bui.unit_id = #{backUnit}
|
||||
</if>
|
||||
<if test="taskStatus != null and taskStatus != ''">
|
||||
and tk.task_status = #{taskStatus}
|
||||
</if>
|
||||
<if test="backPro != null and backPro != ''">
|
||||
and bpl.pro_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>
|
||||
order by tk.create_time desc
|
||||
</select>
|
||||
|
||||
|
|
@ -313,9 +329,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where task_id = #{taskId}
|
||||
</select>
|
||||
|
||||
<select id="selectnotAuditByTaskId" resultMap="RepairAuditDetailsResult">
|
||||
<select id="selectNotAuditByTaskId" resultMap="RepairAuditDetailsResult">
|
||||
<include refid="selectRepairAuditDetailsVo"/>
|
||||
where task_id = #{taskId} and rd.STATUS = '0'
|
||||
where task_id = #{taskId} and `status` = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectRepairInputByTaskId" resultMap="RepairAuditDetailsResult">
|
||||
|
|
@ -432,4 +448,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<update id="updateRecodeStatus">
|
||||
update repair_apply_record set status = 1,update_time = now() where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectTypeNamesByTaskIds" resultType="java.util.Map">
|
||||
<if test="taskIds != null and taskIds.size() > 0">
|
||||
select
|
||||
task_id, GROUP_CONCAT(type_name) as typeName
|
||||
from
|
||||
(select distinct rad.task_id, mt1.type_name
|
||||
from repair_audit_details rad
|
||||
left join ma_type mt on rad.type_id = mt.type_id
|
||||
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||
where rad.task_id in
|
||||
<foreach item="taskId" index="index" collection="taskIds" open="(" separator="," close=")">
|
||||
#{taskId}
|
||||
</foreach>
|
||||
) t
|
||||
GROUP BY task_id
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue