维修报废功能修改
This commit is contained in:
parent
8109f4b9d2
commit
c4461f3b91
|
|
@ -61,6 +61,9 @@ public class MaterialConstants {
|
||||||
/** 维修单号的开头字母 */
|
/** 维修单号的开头字母 */
|
||||||
public static final String REPAIR_TASK_TYPE_LABEL = "WX";
|
public static final String REPAIR_TASK_TYPE_LABEL = "WX";
|
||||||
|
|
||||||
|
/** 维修审核单号的开头字母 */
|
||||||
|
public static final String REPAIR_AUDIT_TYPE_LABEL = "WS";
|
||||||
|
|
||||||
/** 报废单号的开头字母 */
|
/** 报废单号的开头字母 */
|
||||||
public static final String SCRAP_TASK_TYPE_LABEL = "BF";
|
public static final String SCRAP_TASK_TYPE_LABEL = "BF";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ public enum RepairTaskStatusEnum {
|
||||||
TASK_STATUS_COMPLETE(1, "维修管理--已完成"),
|
TASK_STATUS_COMPLETE(1, "维修管理--已完成"),
|
||||||
TASK_STATUS_REJECT(2, "维修管理--驳回退料"),
|
TASK_STATUS_REJECT(2, "维修管理--驳回退料"),
|
||||||
TASK_STATUS_TO_EXAM(10, "修饰审核--待审核"),
|
TASK_STATUS_TO_EXAM(10, "修饰审核--待审核"),
|
||||||
TASK_STATUS_REVIEW(11, "修饰审核--审核通过"),
|
TASK_STATUS_REVIEW(11, "修饰审核--审核完成"),
|
||||||
TASK_STATUS_NO_REVIEW(12, "修饰审核--审核不通过"),
|
TASK_STATUS_NO_REVIEW(12, "修饰审核--审核不通过"),
|
||||||
SCRAP_UNDER_REVIEW(6, "报废审核--待审核");
|
SCRAP_UNDER_REVIEW(6, "报废审核--待审核");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import lombok.Getter;
|
||||||
public enum ScrapTaskStatusEnum {
|
public enum ScrapTaskStatusEnum {
|
||||||
|
|
||||||
SCRAP_TASK_NO_FINISHED(0, "报废审核进行中"),
|
SCRAP_TASK_NO_FINISHED(0, "报废审核进行中"),
|
||||||
SCRAP_TASK_IN_FINISHED(1, "报废审核通过"),
|
SCRAP_TASK_IN_FINISHED(1, "报废审核完成"),
|
||||||
SCRAP_TASK_TO_REJECT(2, "报废审核驳回");
|
SCRAP_TASK_TO_REJECT(2, "报废审核驳回");
|
||||||
|
|
||||||
private final Integer status;
|
private final Integer status;
|
||||||
|
|
|
||||||
|
|
@ -49,10 +49,6 @@ public class ArchivesServiceImpl implements ArchivesService {
|
||||||
@Resource
|
@Resource
|
||||||
private ArchivesMapper archivesMapper;
|
private ArchivesMapper archivesMapper;
|
||||||
|
|
||||||
private static final String DOMAIN = "http://127.0.0.1:9300";
|
|
||||||
private static final String PATH = "/usr/local/bonus/uploadPath";
|
|
||||||
private static final String PREFIX = "/statics";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取电子档案分类树
|
* 获取电子档案分类树
|
||||||
* @param archiveInfo
|
* @param archiveInfo
|
||||||
|
|
@ -272,111 +268,6 @@ public class ArchivesServiceImpl implements ArchivesService {
|
||||||
return AjaxResult.error(HttpCodeEnum.TO_PARAM_NULL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg());
|
return AjaxResult.error(HttpCodeEnum.TO_PARAM_NULL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
|
||||||
public void download(ArchivesVo archivesVo, HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
List<Long> idList = new ArrayList<>();
|
|
||||||
String[] arr = archivesVo.getIds().split(",");
|
|
||||||
Integer size = arr.length;
|
|
||||||
for (int i = 0; i < size; i++) {
|
|
||||||
idList.add(Long.valueOf(arr[i]));
|
|
||||||
}
|
|
||||||
archivesVo.setDetailsIdList(idList);
|
|
||||||
// 根据id查询详情
|
|
||||||
List<ArchivesDetails> list = archivesMapper.selectDetails(archivesVo.getDetailsIdList());
|
|
||||||
// 提取文件信息
|
|
||||||
List<FileInfo> fileInfos = extractFileInfos(list);
|
|
||||||
//如果有附件 进行zip处理
|
|
||||||
String zipFileName = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) + ".zip";
|
|
||||||
// 设置响应头
|
|
||||||
response.setContentType("application/zip");
|
|
||||||
response.setHeader("Content-Disposition", "attachment; filename=" + zipFileName);
|
|
||||||
if (fileInfos != null && fileInfos.size() > 0) {
|
|
||||||
*//*try {
|
|
||||||
//被压缩文件流集合
|
|
||||||
InputStream[] srcFiles = new InputStream[fileInfos.size()];
|
|
||||||
//被压缩文件名称
|
|
||||||
String[] srcFileNames = new String[fileInfos.size()];
|
|
||||||
for (FileInfo entity : fileInfos) {
|
|
||||||
//以下代码为获取图片inputStream
|
|
||||||
InputStream ins = ossService.getObject(OssConfiguration.bucket, entity.getObjectKey());
|
|
||||||
if (ins == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//塞入流数组中
|
|
||||||
srcFiles[i] = ins;
|
|
||||||
srcFileNames[i] = entity.getFileName();
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
response.setCharacterEncoding("UTF-8");
|
|
||||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("下载.zip", "UTF-8"));
|
|
||||||
//多个文件压缩成压缩包返回
|
|
||||||
ZipUtil.zip(response.getOutputStream(), srcFileNames, srcFiles);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}*//*
|
|
||||||
// 创建 MinIO 客户端
|
|
||||||
String bucketName = "bonus";
|
|
||||||
String endpoint = "http://192.168.0.14:9090";
|
|
||||||
String accessKey = "QAxpqXEVc9VEQQ4H3sOn";
|
|
||||||
String secretKey = "3oTv7oAN9G7zhUoMW1ii3fv4pdkl8PcmJuxU50O6";
|
|
||||||
|
|
||||||
// 检查存储桶是否存在,如果不存在则创建
|
|
||||||
try {
|
|
||||||
// 创建 MinIO 客户端
|
|
||||||
MinioClient minioClient = MinioClient.builder()
|
|
||||||
.endpoint(endpoint)
|
|
||||||
.credentials(accessKey, secretKey)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
// 检查存储桶是否存在,如果不存在则创建
|
|
||||||
boolean found = minioClient.bucketExists(BucketExistsArgs.builder().bucket(bucketName).build());
|
|
||||||
if (!found) {
|
|
||||||
minioClient.makeBucket(MakeBucketArgs.builder().bucket(bucketName).build());
|
|
||||||
}
|
|
||||||
|
|
||||||
// 创建 ZipOutputStream 用于生成压缩包
|
|
||||||
try (ZipOutputStream zipOut = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFileName)))) {
|
|
||||||
// 假设你有一个文件列表,这里可以从 MinIO 中获取文件列表,例如列出存储桶中的所有文件
|
|
||||||
// 以下是一个示例,列出存储桶中的所有对象
|
|
||||||
// List<io.minio.Result<io.minio.messages.Item>> objects = minioClient.listObjects(ListObjectsArgs.builder().bucket(bucketName).build());
|
|
||||||
// 为了简化,假设我们已经有一个文件列表,存储在一个字符串数组中
|
|
||||||
String[] objectKeys = {"file1.txt", "file2.txt", "file3.txt"};
|
|
||||||
for (String objectKey : objectKeys) {
|
|
||||||
// 获取文件的输入流
|
|
||||||
try (InputStream inputStream = minioClient.getObject(GetObjectArgs.builder().bucket(bucketName).object(objectKey).build());
|
|
||||||
BufferedInputStream bis = new BufferedInputStream(inputStream)) {
|
|
||||||
// 创建一个 ZipEntry 并将其添加到 ZipOutputStream 中
|
|
||||||
ZipEntry zipEntry = new ZipEntry(objectKey);
|
|
||||||
zipOut.putNextEntry(zipEntry);
|
|
||||||
|
|
||||||
byte[] buffer = new byte[1024];
|
|
||||||
int bytesRead;
|
|
||||||
while ((bytesRead = bis.read(buffer)) != -1) {
|
|
||||||
zipOut.write(buffer, 0, bytesRead);
|
|
||||||
}
|
|
||||||
// 关闭当前的 ZipEntry
|
|
||||||
zipOut.closeEntry();
|
|
||||||
} catch (IOException e) {
|
|
||||||
System.err.println("Error reading file from MinIO: " + objectKey);
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
System.err.println("Error creating zip file: " + zipFileName);
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
} catch (MinioException e) {
|
|
||||||
System.err.println("Error with MinIO client: " + e.getMessage());
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (NoSuchAlgorithmException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (InvalidKeyException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下载电子档案右侧详情
|
* 下载电子档案右侧详情
|
||||||
|
|
@ -425,7 +316,7 @@ public class ArchivesServiceImpl implements ArchivesService {
|
||||||
String suffix = fileName.substring(dotIndex);
|
String suffix = fileName.substring(dotIndex);
|
||||||
// 拼接最终的文件名
|
// 拼接最终的文件名
|
||||||
String extractedFileName = namePart + suffix;
|
String extractedFileName = namePart + suffix;
|
||||||
String savePath = "D:/" + extractedFileName;
|
String savePath = System.getProperty("user.home") + File.separator + extractedFileName;
|
||||||
// 检查文件保存路径是否可写
|
// 检查文件保存路径是否可写
|
||||||
Path path = Paths.get(savePath);
|
Path path = Paths.get(savePath);
|
||||||
if (Files.isWritable(path.getParent())) {
|
if (Files.isWritable(path.getParent())) {
|
||||||
|
|
@ -505,6 +396,9 @@ public class ArchivesServiceImpl implements ArchivesService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(System.getProperty("user.home") + File.separator + "test.txt");
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 将文件添加到压缩包
|
* 将文件添加到压缩包
|
||||||
* @param filePath
|
* @param filePath
|
||||||
|
|
@ -524,7 +418,6 @@ public class ArchivesServiceImpl implements ArchivesService {
|
||||||
// 将当前文件作为一个zip实体写入压缩流,fileName代表压缩文件中的文件名称
|
// 将当前文件作为一个zip实体写入压缩流,fileName代表压缩文件中的文件名称
|
||||||
zipOut.putNextEntry(new ZipEntry(fileName));
|
zipOut.putNextEntry(new ZipEntry(fileName));
|
||||||
int length = 0;
|
int length = 0;
|
||||||
// 最常规IO操作,不必紧张
|
|
||||||
while ((length = bufferStream.read(bufferArea, 0, 1024 * 10)) != -1) {
|
while ((length = bufferStream.read(bufferArea, 0, 1024 * 10)) != -1) {
|
||||||
zipOut.write(bufferArea, 0, length);
|
zipOut.write(bufferArea, 0, length);
|
||||||
}
|
}
|
||||||
|
|
@ -532,7 +425,6 @@ public class ArchivesServiceImpl implements ArchivesService {
|
||||||
fileInput.close();
|
fileInput.close();
|
||||||
// 需要注意的是缓冲流必须要关闭流,否则输出无效
|
// 需要注意的是缓冲流必须要关闭流,否则输出无效
|
||||||
bufferStream.close();
|
bufferStream.close();
|
||||||
// 压缩流不必关闭,使用完后再关
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -483,6 +483,15 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
result += deleteFileInfoForDetails(backApplyDetailsList, id);
|
result += deleteFileInfoForDetails(backApplyDetailsList, id);
|
||||||
// 删除编码设备附件
|
// 删除编码设备附件
|
||||||
result += deleteFileInfoForMaCodes(maCodeList, id);
|
result += deleteFileInfoForMaCodes(maCodeList, id);
|
||||||
|
// 查询编码是否存在,恢复为在用
|
||||||
|
List<MaCodeVo> list = backApplyInfoMapper.selectByCode(id);
|
||||||
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
for (MaCodeVo maCodeVo : list) {
|
||||||
|
if (maCodeVo.getMaId() != null) {
|
||||||
|
machineMapper.updateStatus(maCodeVo.getMaId(), MaMachineStatusEnum.IN_USE.getStatus());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
return AjaxResult.success(result);
|
return AjaxResult.success(result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -100,10 +100,9 @@ public class RepairAuditDetailsController extends BaseController {
|
||||||
@ApiOperation("查看修饰审核任务详细列表")
|
@ApiOperation("查看修饰审核任务详细列表")
|
||||||
@GetMapping("/getRepairAuditList")
|
@GetMapping("/getRepairAuditList")
|
||||||
@RequiresPermissions("service:auditing:list")
|
@RequiresPermissions("service:auditing:list")
|
||||||
public TableDataInfo getRepairAuditList(RepairAuditDetails repairAuditDetails) {
|
public AjaxResult getRepairAuditList(RepairAuditDetails repairAuditDetails) {
|
||||||
startPage();
|
|
||||||
List<RepairAuditDetails> list = repairAuditDetailsService.getRepairAuditList(repairAuditDetails);
|
List<RepairAuditDetails> list = repairAuditDetailsService.getRepairAuditList(repairAuditDetails);
|
||||||
return getDataTable(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,9 @@ public class RepairTask {
|
||||||
@ApiModelProperty(value = "任务类型")
|
@ApiModelProperty(value = "任务类型")
|
||||||
private Integer taskType;
|
private Integer taskType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "任务当月序号 例如:1 插入及查询时请携带任务类型")
|
||||||
|
private Integer monthOrder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维修单号
|
* 维修单号
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -69,4 +69,13 @@ public interface RepairApplyDetailsMapper {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteRepairApplyDetailsByIds(Long[] ids);
|
public int deleteRepairApplyDetailsByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据维修ID查询维修任务单号
|
||||||
|
* @param repairId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String selectById(Long repairId);
|
||||||
|
|
||||||
|
int updateStatus(@Param("repairId") Long repairId, @Param("status") Integer status);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -212,4 +212,11 @@ public interface RepairMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<RepairPartDetails> getDetailsList(RepairPartDetails bean);
|
List<RepairPartDetails> getDetailsList(RepairPartDetails bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询维修审核明细
|
||||||
|
* @param details
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<RepairTaskDetails> getAuditDetailsById(RepairTaskDetails details);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.bonus.common.biz.constant.MaterialConstants;
|
import com.bonus.common.biz.constant.MaterialConstants;
|
||||||
import com.bonus.common.biz.domain.repair.RepairInputDetails;
|
import com.bonus.common.biz.domain.repair.RepairInputDetails;
|
||||||
import com.bonus.common.biz.domain.vo.KeyValueVO;
|
import com.bonus.common.biz.domain.vo.KeyValueVO;
|
||||||
import com.bonus.common.biz.enums.RepairInputStatusEnum;
|
import com.bonus.common.biz.enums.*;
|
||||||
import com.bonus.common.biz.enums.RepairTaskStatusEnum;
|
|
||||||
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
import com.bonus.common.core.utils.StringUtils;
|
import com.bonus.common.core.utils.StringUtils;
|
||||||
|
|
@ -499,17 +497,26 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
}
|
}
|
||||||
} else if ("2".equals(status)) {
|
} else if ("2".equals(status)) {
|
||||||
for (RepairAuditDetails auditDetails : repairAuditDetails) {
|
for (RepairAuditDetails auditDetails : repairAuditDetails) {
|
||||||
// 处理维修详情的数量
|
|
||||||
repairApplyDetailsMapper.updateRepairApplyDetailsAfterReject(
|
|
||||||
ObjectUtils.defaultIfNull(auditDetails.getRepairedNum(),0).longValue(),
|
|
||||||
ObjectUtils.defaultIfNull(auditDetails.getScrapNum(),0).longValue(), auditDetails.getRepairId());
|
|
||||||
|
|
||||||
// 处理 -- 修饰审核任务状态
|
// 处理 -- 修饰审核任务状态
|
||||||
taskMapper.updateTaskStatus(String.valueOf(auditDetails.getTaskId()), RepairTaskStatusEnum.TASK_STATUS_NO_REVIEW.getStatus());
|
taskMapper.updateTaskStatus(String.valueOf(auditDetails.getTaskId()), RepairTaskStatusEnum.TASK_STATUS_NO_REVIEW.getStatus());
|
||||||
// 处理 -- 原维修任务单的状态(提交修饰审核前拆分的任务)
|
// 处理 -- 原维修任务单的状态(提交修饰审核前拆分的任务)
|
||||||
TmTask preTmTaskInfo = taskMapper.selectTmTaskByTaskId(auditDetails.getTaskId());
|
TmTask preTmTaskInfo = taskMapper.selectTmTaskByTaskId(auditDetails.getTaskId());
|
||||||
if (Objects.nonNull(preTmTaskInfo) && Objects.nonNull(preTmTaskInfo.getPreTaskId())) {
|
if (Objects.nonNull(preTmTaskInfo) && Objects.nonNull(preTmTaskInfo.getPreTaskId())) {
|
||||||
taskMapper.updateTaskStatus(String.valueOf(preTmTaskInfo.getTaskId()), RepairTaskStatusEnum.TASK_STATUS_NO_REVIEW.getStatus());
|
taskMapper.updateTaskStatus(String.valueOf(preTmTaskInfo.getPreTaskId()), RepairTaskStatusEnum.TASK_STATUS_PROCESSING.getStatus());
|
||||||
|
}
|
||||||
|
// 根据taskId查询维修审核明细
|
||||||
|
final List<RepairAuditDetails> repairAuditDetailsByTaskId = repairAuditDetailsMapper.selectRepairAuditDetailsByTaskId(auditDetails.getTaskId());
|
||||||
|
if (!CollectionUtils.isEmpty(repairAuditDetailsByTaskId)) {
|
||||||
|
for (RepairAuditDetails repairAuditDetail : repairAuditDetailsByTaskId) {
|
||||||
|
if ("1".equals(repairAuditDetail.getStatus()) || "2".equals(repairAuditDetail.getStatus())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// 根据查询详情获取的维修ID,更新scrap_apply_details维修数量
|
||||||
|
repairApplyDetailsMapper.updateRepairApplyDetailsAfterReject(
|
||||||
|
ObjectUtils.defaultIfNull(repairAuditDetail.getRepairedNum(),0).longValue(),
|
||||||
|
ObjectUtils.defaultIfNull(repairAuditDetail.getScrapNum(),0).longValue(), repairAuditDetail.getRepairId());
|
||||||
|
repairApplyDetailsMapper.updateStatus(repairAuditDetail.getRepairId(), RepairTaskStatusEnum.TASK_STATUS_PROCESSING.getStatus());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -545,6 +552,8 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
}
|
}
|
||||||
final RepairAuditDetails auditDetails1 = repairAuditDetails.get(0);
|
final RepairAuditDetails auditDetails1 = repairAuditDetails.get(0);
|
||||||
final String status = auditDetails1.getStatus(); // 1通过 2驳回
|
final String status = auditDetails1.getStatus(); // 1通过 2驳回
|
||||||
|
// 根据repairId查询前任务id
|
||||||
|
String preTaskId = repairApplyDetailsMapper.selectById(auditDetails1.getRepairId());
|
||||||
if ("1".equals(status)) {
|
if ("1".equals(status)) {
|
||||||
//根据任务id查询协议id
|
//根据任务id查询协议id
|
||||||
final Long agreementId = taskAgreementMapper.selectAgreementIdByTaskId(auditDetails1.getTaskId());
|
final Long agreementId = taskAgreementMapper.selectAgreementIdByTaskId(auditDetails1.getTaskId());
|
||||||
|
|
@ -554,12 +563,28 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
repairApplyDetailsMapper.updateRepairApplyDetailsAfterReject(
|
repairApplyDetailsMapper.updateRepairApplyDetailsAfterReject(
|
||||||
ObjectUtils.defaultIfNull(auditDetails.getRepairedNum(),0).longValue(),
|
ObjectUtils.defaultIfNull(auditDetails.getRepairedNum(),0).longValue(),
|
||||||
ObjectUtils.defaultIfNull(auditDetails.getScrapNum(),0).longValue(), auditDetails.getRepairId());
|
ObjectUtils.defaultIfNull(auditDetails.getScrapNum(),0).longValue(), auditDetails.getRepairId());
|
||||||
|
repairApplyDetailsMapper.updateStatus(auditDetails.getRepairId(), RepairTaskStatusEnum.TASK_STATUS_PROCESSING.getStatus());
|
||||||
}
|
}
|
||||||
|
taskMapper.updateTaskStatus(preTaskId, RepairTaskStatusEnum.TASK_STATUS_PROCESSING.getStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
return repairAuditDetailsMapper.updateRepairAuditDetailsBatch(ids, status, userId);
|
int result = repairAuditDetailsMapper.updateRepairAuditDetailsBatch(ids, status, userId);
|
||||||
|
// 根据任务id查询内层详情任务状态,更新外层任务状态
|
||||||
|
List<RepairAuditDetails> repairAuditDetailsByTaskId = repairAuditDetailsMapper.selectRepairAuditDetailsByTaskId(auditDetails1.getTaskId());
|
||||||
|
if (!CollectionUtils.isEmpty(repairAuditDetailsByTaskId)) {
|
||||||
|
// 获取集合中的全部status集合
|
||||||
|
List<Integer> statusList = repairAuditDetailsByTaskId.stream()
|
||||||
|
.map(scrapApplyDetail -> Integer.parseInt(scrapApplyDetail.getStatus()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (!statusList.contains(RepairTaskStatusEnum.TASK_STATUS_PROCESSING.getStatus())) {
|
||||||
|
result += taskMapper.updateTaskStatus(auditDetails1.getTaskId().toString(), RepairTaskStatusEnum.TASK_STATUS_REVIEW.getStatus());
|
||||||
|
} else if (statusList.stream().allMatch(newStatus -> newStatus.equals(RepairTaskStatusEnum.TASK_STATUS_NO_REVIEW.getStatus()))){
|
||||||
|
result += taskMapper.updateTaskStatus(auditDetails1.getTaskId().toString(), RepairTaskStatusEnum.TASK_STATUS_NO_REVIEW.getStatus());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
throw new ServiceException("错误信息描述");
|
throw new ServiceException("错误信息描述");
|
||||||
}
|
}
|
||||||
|
|
@ -572,9 +597,12 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
// }
|
// }
|
||||||
|
|
||||||
private void batchInsertRepairInputDetails(List<RepairAuditDetails> repairAuditDetailsByQuery, Long agreementId) {
|
private void batchInsertRepairInputDetails(List<RepairAuditDetails> repairAuditDetailsByQuery, Long agreementId) {
|
||||||
//插入任务表
|
//插入修饰审核入库任务表
|
||||||
final Long newTaskId = insertTt();
|
final Long newTaskId = insertTt();
|
||||||
|
//插入报废任务表
|
||||||
|
Long newScrapTaskId = insertScrapTt();
|
||||||
insertTta(newTaskId, agreementId);
|
insertTta(newTaskId, agreementId);
|
||||||
|
insertScrapTta(newScrapTaskId, agreementId);
|
||||||
final List<RepairInputDetails> inputList = new ArrayList<>();
|
final List<RepairInputDetails> inputList = new ArrayList<>();
|
||||||
for (final RepairAuditDetails details : repairAuditDetailsByQuery) {
|
for (final RepairAuditDetails details : repairAuditDetailsByQuery) {
|
||||||
//修改机具状态
|
//修改机具状态
|
||||||
|
|
@ -589,11 +617,71 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
inputVo.setTaskId(newTaskId);
|
inputVo.setTaskId(newTaskId);
|
||||||
inputVo.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
|
inputVo.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
|
||||||
inputList.add(inputVo);
|
inputList.add(inputVo);
|
||||||
|
if (details.getScrapNum().compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
ScrapApplyDetails scrapApplyDetails = new ScrapApplyDetails();
|
||||||
|
scrapApplyDetails.setTaskId(newScrapTaskId);
|
||||||
|
scrapApplyDetails.setTypeId(details.getTypeId());
|
||||||
|
scrapApplyDetails.setMaId(details.getMaId());
|
||||||
|
scrapApplyDetails.setScrapNum(details.getScrapNum());
|
||||||
|
scrapApplyDetails.setScrapSource("2");
|
||||||
|
scrapApplyDetails.setStatus("0");
|
||||||
|
scrapApplyDetails.setParentId(details.getId());
|
||||||
|
scrapApplyDetails.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
scrapApplyDetails.setCreateTime(new Date());
|
||||||
|
scrapApplyDetailsMapper.insertScrapApplyDetails(scrapApplyDetails);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 插入维修入库明细
|
// 插入维修入库明细
|
||||||
repairInputDetailsMapper.batchInsertRepairInputDetails(inputList);
|
repairInputDetailsMapper.batchInsertRepairInputDetails(inputList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入报废任务表
|
||||||
|
* @param newScrapTaskId
|
||||||
|
* @param agreementId
|
||||||
|
*/
|
||||||
|
private void insertScrapTta(Long newScrapTaskId, Long agreementId) {
|
||||||
|
final TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(newScrapTaskId, agreementId);
|
||||||
|
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
|
||||||
|
tmTaskAgreement.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
taskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入报废任务表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private Long insertScrapTt() {
|
||||||
|
Long newTask = null;
|
||||||
|
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_SCRAP.getTaskTypeId());
|
||||||
|
// 生成修饰入库单号
|
||||||
|
String code = genderBfTaskCode(thisMonthMaxOrder);
|
||||||
|
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_SCRAP.getTaskTypeId(), ScrapTaskStatusEnum.SCRAP_TASK_NO_FINISHED.getStatus(),
|
||||||
|
null,thisMonthMaxOrder + 1, code);
|
||||||
|
tmTask.setCreateTime(DateUtils.getNowDate());
|
||||||
|
tmTask.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
// 插入任务
|
||||||
|
int taskId = taskMapper.insertTmTask(tmTask);
|
||||||
|
// 如果插入成功且返回的 taskId 大于 0
|
||||||
|
if (taskId > 0 && tmTask.getTaskId() > 0) {
|
||||||
|
newTask = tmTask.getTaskId();
|
||||||
|
}
|
||||||
|
return newTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成报废单号
|
||||||
|
* @param thisMonthMaxOrder
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String genderBfTaskCode(int thisMonthMaxOrder) {
|
||||||
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Date nowDate = DateUtils.getNowDate();
|
||||||
|
String format = dateFormat.format(nowDate);
|
||||||
|
String result = format.replace("-", "");
|
||||||
|
return MaterialConstants.SCRAP_TASK_TYPE_LABEL + result + String.format("-%03d", thisMonthMaxOrder + 1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 插入任务关联表
|
* 插入任务关联表
|
||||||
* @param newTaskId
|
* @param newTaskId
|
||||||
|
|
|
||||||
|
|
@ -859,10 +859,11 @@ public class RepairServiceImpl implements RepairService {
|
||||||
// 新增tm_task表数据、修饰审核任务、状态是待审核
|
// 新增tm_task表数据、修饰审核任务、状态是待审核
|
||||||
task.setTaskType(TmTaskTypeEnum.TM_TASK_REPAIR_AUDIT.getTaskTypeId());
|
task.setTaskType(TmTaskTypeEnum.TM_TASK_REPAIR_AUDIT.getTaskTypeId());
|
||||||
task.setTaskStatus(RepairTaskStatusEnum.TASK_STATUS_TO_EXAM.getStatus());
|
task.setTaskStatus(RepairTaskStatusEnum.TASK_STATUS_TO_EXAM.getStatus());
|
||||||
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_REPAIR.getTaskTypeId());
|
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_REPAIR_AUDIT.getTaskTypeId());
|
||||||
// 生成维修单号
|
// 生成维修单号
|
||||||
String code = genderWxTaskCode(thisMonthMaxOrder);
|
String code = genderWxTaskCode(thisMonthMaxOrder);
|
||||||
task.setRepairCode(code);
|
task.setRepairCode(code);
|
||||||
|
task.setMonthOrder(thisMonthMaxOrder + 1);
|
||||||
// 插入之前的维修任务id标记前置任务
|
// 插入之前的维修任务id标记前置任务
|
||||||
task.setPreTaskId(task.getTaskId());
|
task.setPreTaskId(task.getTaskId());
|
||||||
// 注意:此处将会生成新的 taskId (审核入库用的)
|
// 注意:此处将会生成新的 taskId (审核入库用的)
|
||||||
|
|
@ -880,7 +881,10 @@ public class RepairServiceImpl implements RepairService {
|
||||||
details.setRepairNum(details.getRepairNum());
|
details.setRepairNum(details.getRepairNum());
|
||||||
details.setRepairedNum(details.getRepairedNum());
|
details.setRepairedNum(details.getRepairedNum());
|
||||||
details.setScrapNum(details.getScrapNum());
|
details.setScrapNum(details.getScrapNum());
|
||||||
repairMapper.addAuditDetails(details);
|
// 先根据id查询审核表中是否存在数据,存在则不用重复插入
|
||||||
|
if (CollectionUtils.isEmpty(repairMapper.getAuditDetailsById(details))) {
|
||||||
|
repairMapper.addAuditDetails(details);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -906,7 +910,7 @@ public class RepairServiceImpl implements RepairService {
|
||||||
Date nowDate = DateUtils.getNowDate();
|
Date nowDate = DateUtils.getNowDate();
|
||||||
String format = dateFormat.format(nowDate);
|
String format = dateFormat.format(nowDate);
|
||||||
String result = format.replace("-", "");
|
String result = format.replace("-", "");
|
||||||
return MaterialConstants.REPAIR_TASK_TYPE_LABEL + result + String.format("-%03d", thisMonthMaxOrder + 1);
|
return MaterialConstants.REPAIR_AUDIT_TYPE_LABEL + result + String.format("-%03d", thisMonthMaxOrder + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ public class ScrapApplyDetailsController extends BaseController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "报废审核通过")
|
@ApiOperation(value = "报废审核通过")
|
||||||
@GetMapping("/approve")
|
@PostMapping("/approve")
|
||||||
public AjaxResult approve(@RequestBody ScrapApplyDetails scrapApplyDetails) {
|
public AjaxResult approve(@RequestBody ScrapApplyDetails scrapApplyDetails) {
|
||||||
return scrapApplyDetailsService.approve(scrapApplyDetails);
|
return scrapApplyDetailsService.approve(scrapApplyDetails);
|
||||||
}
|
}
|
||||||
|
|
@ -92,7 +92,7 @@ public class ScrapApplyDetailsController extends BaseController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "报废审核驳回")
|
@ApiOperation(value = "报废审核驳回")
|
||||||
@GetMapping("/reject")
|
@PostMapping("/reject")
|
||||||
public AjaxResult reject(@RequestBody ScrapApplyDetails scrapApplyDetails) {
|
public AjaxResult reject(@RequestBody ScrapApplyDetails scrapApplyDetails) {
|
||||||
return scrapApplyDetailsService.reject(scrapApplyDetails);
|
return scrapApplyDetailsService.reject(scrapApplyDetails);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,9 @@ public class ScrapApplyDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "已修数量")
|
@ApiModelProperty(value = "已修数量")
|
||||||
private BigDecimal repairNum;
|
private BigDecimal repairNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "已修数量")
|
||||||
|
private BigDecimal repairedNum;
|
||||||
|
|
||||||
@ApiModelProperty(value = "费用合计")
|
@ApiModelProperty(value = "费用合计")
|
||||||
private BigDecimal totalCost;
|
private BigDecimal totalCost;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,7 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
||||||
// TODO: 报废审核二级页面通过
|
// TODO: 报废审核二级页面通过
|
||||||
int result = 0;
|
int result = 0;
|
||||||
if (scrapApplyDetails != null) {
|
if (scrapApplyDetails != null) {
|
||||||
if (scrapApplyDetails.getId() != null) {
|
/*if (scrapApplyDetails.getId() != null) {
|
||||||
scrapApplyDetails.setStatus("1");
|
scrapApplyDetails.setStatus("1");
|
||||||
scrapApplyDetails.setAuditBy(SecurityUtils.getUserId());
|
scrapApplyDetails.setAuditBy(SecurityUtils.getUserId());
|
||||||
scrapApplyDetails.setAuditTime(DateUtils.getNowDate());
|
scrapApplyDetails.setAuditTime(DateUtils.getNowDate());
|
||||||
|
|
@ -167,7 +167,7 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
updateTaskStatus(scrapApplyDetails);
|
updateTaskStatus(scrapApplyDetails);
|
||||||
}
|
}
|
||||||
} else if (CollectionUtils.isNotEmpty(scrapApplyDetails.getScrapApplyDetailsList())) {
|
} else */if (CollectionUtils.isNotEmpty(scrapApplyDetails.getScrapApplyDetailsList())) {
|
||||||
for (ScrapApplyDetails applyDetails : scrapApplyDetails.getScrapApplyDetailsList()) {
|
for (ScrapApplyDetails applyDetails : scrapApplyDetails.getScrapApplyDetailsList()) {
|
||||||
applyDetails.setStatus("1");
|
applyDetails.setStatus("1");
|
||||||
applyDetails.setAuditBy(SecurityUtils.getUserId());
|
applyDetails.setAuditBy(SecurityUtils.getUserId());
|
||||||
|
|
@ -216,13 +216,18 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
||||||
.map(scrapApplyDetail -> Integer.parseInt(scrapApplyDetail.getStatus()))
|
.map(scrapApplyDetail -> Integer.parseInt(scrapApplyDetail.getStatus()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(statusList)) {
|
if (CollectionUtils.isNotEmpty(statusList)) {
|
||||||
if (!statusList.contains(ScrapTaskStatusEnum.SCRAP_TASK_NO_FINISHED.getStatus()) &&
|
boolean notContainsNoFinished =!statusList.contains(ScrapTaskStatusEnum.SCRAP_TASK_NO_FINISHED.getStatus());
|
||||||
statusList.contains(ScrapTaskStatusEnum.SCRAP_TASK_TO_REJECT.getStatus())) {
|
boolean allReject = true;
|
||||||
taskMapper.updateTaskStatus(scrapApplyDetails.getTaskId().toString(), ScrapTaskStatusEnum.SCRAP_TASK_TO_REJECT.getStatus());
|
for (Integer status : statusList) {
|
||||||
} else if (!statusList.contains(ScrapTaskStatusEnum.SCRAP_TASK_NO_FINISHED.getStatus()) &&
|
if (!status.equals(ScrapTaskStatusEnum.SCRAP_TASK_TO_REJECT.getStatus())) {
|
||||||
!statusList.contains(ScrapTaskStatusEnum.SCRAP_TASK_TO_REJECT.getStatus()) &&
|
allReject = false;
|
||||||
statusList.stream().allMatch(status -> status.equals(ScrapTaskStatusEnum.SCRAP_TASK_IN_FINISHED.getStatus()))) {
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (notContainsNoFinished && !allReject) {
|
||||||
taskMapper.updateTaskStatus(scrapApplyDetails.getTaskId().toString(), ScrapTaskStatusEnum.SCRAP_TASK_IN_FINISHED.getStatus());
|
taskMapper.updateTaskStatus(scrapApplyDetails.getTaskId().toString(), ScrapTaskStatusEnum.SCRAP_TASK_IN_FINISHED.getStatus());
|
||||||
|
} else if (notContainsNoFinished && allReject) {
|
||||||
|
taskMapper.updateTaskStatus(scrapApplyDetails.getTaskId().toString(), ScrapTaskStatusEnum.SCRAP_TASK_TO_REJECT.getStatus());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -274,7 +279,8 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
||||||
List<ScrapApplyDetails> scrapApplyDetailsList = scrapApplyDetailsMapper.selectRepairQuestListByTaskId(applyDetails);
|
List<ScrapApplyDetails> scrapApplyDetailsList = scrapApplyDetailsMapper.selectRepairQuestListByTaskId(applyDetails);
|
||||||
// 将集合中status为0的筛选出来
|
// 将集合中status为0的筛选出来
|
||||||
if (CollectionUtils.isNotEmpty(scrapApplyDetailsList)) {
|
if (CollectionUtils.isNotEmpty(scrapApplyDetailsList)) {
|
||||||
for (ScrapApplyDetails applyDetails1 : scrapApplyDetailsList) {
|
List<ScrapApplyDetails> applyDetailsList = scrapApplyDetailsList.stream().filter(applyDetails1 -> "0".equals(applyDetails1.getStatus())).collect(Collectors.toList());
|
||||||
|
for (ScrapApplyDetails applyDetails1 : applyDetailsList) {
|
||||||
applyDetails1.setStatus("2");
|
applyDetails1.setStatus("2");
|
||||||
applyDetails1.setAuditBy(SecurityUtils.getUserId());
|
applyDetails1.setAuditBy(SecurityUtils.getUserId());
|
||||||
applyDetails1.setAuditTime(DateUtils.getNowDate());
|
applyDetails1.setAuditTime(DateUtils.getNowDate());
|
||||||
|
|
@ -287,6 +293,7 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
||||||
applyDetails1.setCreateBy(SecurityUtils.getUsername());
|
applyDetails1.setCreateBy(SecurityUtils.getUsername());
|
||||||
applyDetails1.setCreateTime(DateUtils.getNowDate());
|
applyDetails1.setCreateTime(DateUtils.getNowDate());
|
||||||
applyDetails1.setBackId(backId);
|
applyDetails1.setBackId(backId);
|
||||||
|
applyDetails1.setNewTaskId(newTaskId);
|
||||||
result += insertWxTask(applyDetails1);
|
result += insertWxTask(applyDetails1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -320,7 +327,7 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
||||||
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_REPAIR.getTaskTypeId());
|
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_REPAIR.getTaskTypeId());
|
||||||
// 生成维修单号
|
// 生成维修单号
|
||||||
String code = genderWxTaskCode(thisMonthMaxOrder);
|
String code = genderWxTaskCode(thisMonthMaxOrder);
|
||||||
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_REPAIR.getTaskTypeId(), BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus(),
|
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_REPAIR.getTaskTypeId(), RepairTaskStatusEnum.TASK_STATUS_PROCESSING.getStatus(),
|
||||||
null,thisMonthMaxOrder + 1, code);
|
null,thisMonthMaxOrder + 1, code);
|
||||||
tmTask.setCreateTime(DateUtils.getNowDate());
|
tmTask.setCreateTime(DateUtils.getNowDate());
|
||||||
tmTask.setCreateBy(SecurityUtils.getUsername());
|
tmTask.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
|
@ -355,8 +362,13 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
||||||
*/
|
*/
|
||||||
private int insertTta(Long newTaskId, ScrapApplyDetails scrapApplyDetails) {
|
private int insertTta(Long newTaskId, ScrapApplyDetails scrapApplyDetails) {
|
||||||
int res;
|
int res;
|
||||||
String agreementId = String.valueOf(scrapApplyDetails.getAgreementId());
|
Long agreementId = null;
|
||||||
TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(newTaskId, Long.parseLong(agreementId));
|
if (CollectionUtils.isNotEmpty(scrapApplyDetails.getScrapApplyDetailsList())) {
|
||||||
|
agreementId = scrapApplyDetails.getScrapApplyDetailsList().get(0).getAgreementId();
|
||||||
|
} else {
|
||||||
|
agreementId = scrapApplyDetails.getAgreementId();
|
||||||
|
}
|
||||||
|
TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(newTaskId, agreementId);
|
||||||
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
|
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
|
||||||
tmTaskAgreement.setCreateBy(SecurityUtils.getUsername());
|
tmTaskAgreement.setCreateBy(SecurityUtils.getUsername());
|
||||||
res = taskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
|
res = taskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updateStatus">
|
||||||
|
update repair_apply_details
|
||||||
|
set status = #{status},
|
||||||
|
update_time = NOW()
|
||||||
|
where id = #{repairId}
|
||||||
|
</update>
|
||||||
|
|
||||||
<select id="getRepairDetailsWhichNotSent" resultType="com.bonus.material.repair.domain.RepairTaskDetails">
|
<select id="getRepairDetailsWhichNotSent" resultType="com.bonus.material.repair.domain.RepairTaskDetails">
|
||||||
select rad.id,
|
select rad.id,
|
||||||
rad.ma_id as maId,
|
rad.ma_id as maId,
|
||||||
|
|
@ -138,6 +145,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<!-- and rad.status = '0'-->
|
<!-- and rad.status = '0'-->
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectById" resultType="java.lang.String">
|
||||||
|
select task_id from repair_apply_details where id = #{repairId}
|
||||||
|
</select>
|
||||||
|
|
||||||
<delete id="deleteRepairApplyDetailsById" parameterType="Long">
|
<delete id="deleteRepairApplyDetailsById" parameterType="Long">
|
||||||
delete from repair_apply_details where id = #{id}
|
delete from repair_apply_details where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="selectRepairAuditDetailsList" parameterType="com.bonus.material.repair.domain.RepairAuditDetails" resultMap="RepairAuditDetailsResult">
|
<select id="selectRepairAuditDetailsList" parameterType="com.bonus.material.repair.domain.RepairAuditDetails" resultMap="RepairAuditDetailsResult">
|
||||||
select
|
select
|
||||||
rad.* ,mt.type_name as specification_type, mt1.type_name as machine_type_name, mma.ma_code as ma_id
|
rad.* ,mt.type_name as specification_type, mt1.type_name as machine_type_name, mma.ma_code as maCode,
|
||||||
|
rad.ma_id as maId
|
||||||
,mt.manage_type as manageType
|
,mt.manage_type as manageType
|
||||||
from
|
from
|
||||||
repair_audit_details rad
|
repair_audit_details rad
|
||||||
|
|
@ -66,7 +67,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
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 ma_machine mma on rad.ma_id= mma.ma_id
|
left join ma_machine mma on rad.ma_id= mma.ma_id
|
||||||
where
|
where
|
||||||
rad.task_id in
|
rad.status = '0'
|
||||||
|
and rad.task_id in
|
||||||
<foreach item="taskId" collection="taskIds" open="(" separator="," close=")">
|
<foreach item="taskId" collection="taskIds" open="(" separator="," close=")">
|
||||||
#{taskId}
|
#{taskId}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
|
||||||
|
|
@ -547,6 +547,22 @@
|
||||||
rar.task_id = #{taskId} and rar.type_id = #{typeId}
|
rar.task_id = #{taskId} and rar.type_id = #{typeId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getAuditDetailsById" resultType="com.bonus.material.repair.domain.RepairTaskDetails">
|
||||||
|
SELECT
|
||||||
|
rad.id,
|
||||||
|
rad.ma_id AS maId,
|
||||||
|
rad.type_id AS typeId,
|
||||||
|
rad.repair_num AS repairNum,
|
||||||
|
rad.repaired_num AS repairedNum,
|
||||||
|
rad.scrap_num AS scrapNum,
|
||||||
|
rad.company_id AS companyId
|
||||||
|
FROM
|
||||||
|
repair_audit_details rad
|
||||||
|
WHERE
|
||||||
|
rad.repair_id = #{id}
|
||||||
|
AND rad.`status` != '2'
|
||||||
|
</select>
|
||||||
|
|
||||||
<update id="updateRepairedAndScrapNum">
|
<update id="updateRepairedAndScrapNum">
|
||||||
update
|
update
|
||||||
repair_apply_details
|
repair_apply_details
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
when 1 then '报废审核通过'
|
when 1 then '报废审核通过'
|
||||||
when 2 then '报废审核驳回'
|
when 2 then '报废审核驳回'
|
||||||
else '未知'
|
else '未知'
|
||||||
END as taskStatusName
|
END as taskStatusName,
|
||||||
|
su1.nick_name as auditByName,
|
||||||
|
sad.audit_time as auditTime
|
||||||
FROM
|
FROM
|
||||||
scrap_apply_details sad
|
scrap_apply_details sad
|
||||||
LEFT JOIN ma_type mt on sad.type_id = mt.type_id
|
LEFT JOIN ma_type mt on sad.type_id = mt.type_id
|
||||||
|
|
@ -269,7 +271,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<update id="updateMaStatus">
|
<update id="updateMaStatus">
|
||||||
update ma_machine
|
update ma_machine
|
||||||
set status = #{status}
|
set ma_status = #{status}
|
||||||
where ma_id = #{maId}
|
where ma_id = #{maId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue