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