Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
be2e5f3198
|
|
@ -12,7 +12,7 @@ public enum BackTaskStatusEnum {
|
||||||
|
|
||||||
BACK_TASK_NO_FINISHED(0, "退料未完成"),
|
BACK_TASK_NO_FINISHED(0, "退料未完成"),
|
||||||
BACK_TASK_TO_REJECT(1, "维修驳回"),
|
BACK_TASK_TO_REJECT(1, "维修驳回"),
|
||||||
BACK_TASK_IN_FINISHED(3, "退料已完成");
|
BACK_TASK_IN_FINISHED(2, "退料已完成");
|
||||||
|
|
||||||
private final Integer status;
|
private final Integer status;
|
||||||
private final String statusName;
|
private final String statusName;
|
||||||
|
|
|
||||||
|
|
@ -174,4 +174,16 @@ public class BackApplyInfoController extends BaseController {
|
||||||
public AjaxResult remove(@PathVariable Long id) {
|
public AjaxResult remove(@PathVariable Long id) {
|
||||||
return backApplyInfoService.deleteBackApplyInfoById(id);
|
return backApplyInfoService.deleteBackApplyInfoById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app内层删除退料任务
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "app内层删除退料任务")
|
||||||
|
@PreventRepeatSubmit
|
||||||
|
@RequiresPermissions("back:info:remove")
|
||||||
|
@SysLog(title = "退料任务", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除退料任务")
|
||||||
|
@PostMapping("/delete")
|
||||||
|
public AjaxResult delete(@RequestBody BackApplyInfo backApplyInfo) {
|
||||||
|
return backApplyInfoService.delete(backApplyInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,11 @@ public class BackApplyInfo {
|
||||||
@ApiModelProperty(value = "类型id")
|
@ApiModelProperty(value = "类型id")
|
||||||
private String typeId;
|
private String typeId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "物资类型")
|
||||||
|
private String materialType;
|
||||||
|
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "类型名称")
|
@ApiModelProperty(value = "类型名称")
|
||||||
@Excel(name = "物资类型")
|
@Excel(name = "物资类型")
|
||||||
private String typeName;
|
private String typeName;
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,6 @@ import java.util.List;
|
||||||
@Data
|
@Data
|
||||||
public class BackApplyRequestVo {
|
public class BackApplyRequestVo {
|
||||||
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退料申请信息
|
* 退料申请信息
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -211,4 +211,18 @@ public interface BackApplyInfoMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int updateBackApplyDetails(BackApplyDetails applyDetail);
|
int updateBackApplyDetails(BackApplyDetails applyDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除详情
|
||||||
|
* @param backApplyInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deleteApplyDetails(BackApplyInfo backApplyInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除详情
|
||||||
|
* @param backApplyInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deleteDetails(BackApplyInfo backApplyInfo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,4 +80,11 @@ public interface IBackApplyInfoService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult insertApp(BackApplyRequestVo dto);
|
AjaxResult insertApp(BackApplyRequestVo dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app内层删除退料任务
|
||||||
|
* @param backApplyInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult delete(BackApplyInfo backApplyInfo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -246,7 +246,6 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
tmTask.setCreateTime(DateUtils.getNowDate());
|
tmTask.setCreateTime(DateUtils.getNowDate());
|
||||||
tmTask.setCreateBy(SecurityUtils.getUsername());
|
tmTask.setCreateBy(SecurityUtils.getUsername());
|
||||||
BackApplyInfo backApplyInfo = dto.getBackApplyInfo();
|
BackApplyInfo backApplyInfo = dto.getBackApplyInfo();
|
||||||
backApplyInfo.setTaskId(tmTask.getTaskId());
|
|
||||||
backApplyInfo.setCode(code);
|
backApplyInfo.setCode(code);
|
||||||
backApplyInfo.setCreateBy(SecurityUtils.getUsername());
|
backApplyInfo.setCreateBy(SecurityUtils.getUsername());
|
||||||
backApplyInfo.setCreateTime(DateUtils.getNowDate());
|
backApplyInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
|
|
@ -257,6 +256,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
|
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
|
||||||
tmTaskAgreement.setCreateBy(SecurityUtils.getUsername());
|
tmTaskAgreement.setCreateBy(SecurityUtils.getUsername());
|
||||||
taskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
|
taskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
|
||||||
|
backApplyInfo.setTaskId(tmTask.getTaskId());
|
||||||
result += backApplyInfoMapper.insertBackApplyInfo(backApplyInfo);
|
result += backApplyInfoMapper.insertBackApplyInfo(backApplyInfo);
|
||||||
}
|
}
|
||||||
// 保存退料详情
|
// 保存退料详情
|
||||||
|
|
@ -328,6 +328,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
// 设置每个 MaCodeDto 的独立属性
|
// 设置每个 MaCodeDto 的独立属性
|
||||||
details.setMaId(maCodeDto.getMaId());
|
details.setMaId(maCodeDto.getMaId());
|
||||||
details.setPreNum(1);
|
details.setPreNum(1);
|
||||||
|
details.setApDetection(maCodeDto.getApDetection());
|
||||||
// 插入 CheckDetails
|
// 插入 CheckDetails
|
||||||
result += backApplyInfoMapper.insertCheckDetails(details);
|
result += backApplyInfoMapper.insertCheckDetails(details);
|
||||||
if (CollectionUtils.isNotEmpty(maCodeDto.getBmFileInfos())) {
|
if (CollectionUtils.isNotEmpty(maCodeDto.getBmFileInfos())) {
|
||||||
|
|
@ -395,7 +396,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult updateBackApplyInfo(BackApplyRequestVo dto) {
|
public AjaxResult updateBackApplyInfo(BackApplyRequestVo dto) {
|
||||||
if (dto == null || dto.getBackApplyInfo() == null || CollectionUtils.isEmpty(dto.getBackApplyDetailsList())) {
|
if (dto == null || dto.getBackApplyInfo() == null || dto.getBackApplyInfo().getId() == null || CollectionUtils.isEmpty(dto.getBackApplyDetailsList())) {
|
||||||
return AjaxResult.error("参数为空,请重新选择后上传!");
|
return AjaxResult.error("参数为空,请重新选择后上传!");
|
||||||
}
|
}
|
||||||
//对提交的退料详情树木进行校验
|
//对提交的退料详情树木进行校验
|
||||||
|
|
@ -413,48 +414,26 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
return AjaxResult.error("手机号格式不正确,请重新填写!");
|
return AjaxResult.error("手机号格式不正确,请重新填写!");
|
||||||
}
|
}
|
||||||
// 查询信息
|
// 查询信息
|
||||||
Long id = dto.getId();
|
Long id = dto.getBackApplyInfo().getId();
|
||||||
BackApplyInfo backApplyInfo = backApplyInfoMapper.selectBackApplyInfoById(id);
|
|
||||||
List<BackApplyDetails> backApplyDetailsList = backApplyInfoMapper.selectBackApplyDetailsListByTaskId(id);
|
List<BackApplyDetails> backApplyDetailsList = backApplyInfoMapper.selectBackApplyDetailsListByTaskId(id);
|
||||||
List<MaCodeVo> maCodeList = backApplyInfoMapper.selectByCode(id);
|
List<MaCodeVo> maCodeList = backApplyInfoMapper.selectByCode(id);
|
||||||
// 删除相关任务信息
|
// 删除相关任务信息
|
||||||
int result = 0;
|
int result = 0;
|
||||||
result += taskMapper.deleteTmTaskByTaskId(backApplyInfo.getTaskId());
|
result += backApplyInfoMapper.deleteBackApplyDetails(id);
|
||||||
result += taskAgreementMapper.deleteTmTaskAgreementByTaskId(backApplyInfo.getTaskId());
|
result += backApplyInfoMapper.deleteCheckDetails(id);
|
||||||
result += backApplyInfoMapper.deleteBackApplyDetails(backApplyInfo.getId());
|
|
||||||
result += backApplyInfoMapper.deleteCheckDetails(backApplyInfo.getId());
|
|
||||||
// 删除退料详情附件
|
// 删除退料详情附件
|
||||||
result += deleteFileInfoForDetails(backApplyDetailsList, id);
|
result += deleteFileInfoForDetails(backApplyDetailsList, id);
|
||||||
// 删除编码设备附件
|
// 删除编码设备附件
|
||||||
result += deleteFileInfoForMaCodes(maCodeList, id);
|
result += deleteFileInfoForMaCodes(maCodeList, id);
|
||||||
|
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
//执行新增操作
|
//执行新增操作
|
||||||
backApplyInfo.setTaskType(TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId());
|
BackApplyInfo info = dto.getBackApplyInfo();
|
||||||
backApplyInfo.setTaskStatus(BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus());
|
info.setId(id);
|
||||||
backApplyInfo.setId(id);
|
info.setUpdateTime(DateUtils.getNowDate());
|
||||||
backApplyInfo.setUpdateTime(DateUtils.getNowDate());
|
info.setUpdateBy(SecurityUtils.getUsername());
|
||||||
backApplyInfo.setUpdateBy(SecurityUtils.getUsername());
|
result += backApplyInfoMapper.updateBackApplyInfo(info);
|
||||||
backApplyInfo.setBackPerson(dto.getBackApplyInfo().getBackPerson());
|
|
||||||
backApplyInfo.setPhone(dto.getBackApplyInfo().getPhone());
|
|
||||||
backApplyInfo.setRemark(dto.getBackApplyInfo().getRemark() == null ? backApplyInfo.getRemark() : dto.getBackApplyInfo().getRemark());
|
|
||||||
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId());
|
|
||||||
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId(), BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus(),
|
|
||||||
null,thisMonthMaxOrder + 1, backApplyInfo.getCode());
|
|
||||||
tmTask.setCreateTime(DateUtils.getNowDate());
|
|
||||||
tmTask.setCreateBy(SecurityUtils.getUsername());
|
|
||||||
// 保存退料信息到 tm_task 表中
|
|
||||||
result += taskMapper.insertTmTask(tmTask);
|
|
||||||
backApplyInfo.setTaskId(tmTask.getTaskId());
|
|
||||||
if (result > 0) {
|
|
||||||
TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(tmTask.getTaskId(), dto.getBackApplyInfo().getAgreementId());
|
|
||||||
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
|
|
||||||
tmTaskAgreement.setCreateBy(SecurityUtils.getUsername());
|
|
||||||
taskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
|
|
||||||
result += backApplyInfoMapper.updateBackApplyInfo(backApplyInfo);
|
|
||||||
}
|
|
||||||
// 保存退料详情
|
// 保存退料详情
|
||||||
result = saveBackApplyDetails(dto, backApplyInfo, result);
|
result = saveBackApplyDetails(dto, info, result);
|
||||||
return AjaxResult.success(result);
|
return AjaxResult.success(result);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -587,7 +566,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
// 设置更新信息
|
// 设置更新信息
|
||||||
backApplyInfo.setUpdateBy(SecurityUtils.getUsername());
|
backApplyInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||||
backApplyInfo.setUpdateTime(DateUtils.getNowDate());
|
backApplyInfo.setUpdateTime(DateUtils.getNowDate());
|
||||||
backApplyInfo.setTaskStatus(2);
|
backApplyInfo.setTaskStatus(BackTaskStatusEnum.BACK_TASK_IN_FINISHED.getStatus());
|
||||||
// 更新任务表及退料申请表状态
|
// 更新任务表及退料申请表状态
|
||||||
result += updateTaskAndBackInfo(backApplyInfo);
|
result += updateTaskAndBackInfo(backApplyInfo);
|
||||||
if (result > 0 && CollectionUtils.isNotEmpty(applyInfoList)) {
|
if (result > 0 && CollectionUtils.isNotEmpty(applyInfoList)) {
|
||||||
|
|
@ -646,7 +625,85 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult insertApp(BackApplyRequestVo dto) {
|
public AjaxResult insertApp(BackApplyRequestVo dto) {
|
||||||
return null;
|
int result = 0;
|
||||||
|
if (dto != null && dto.getBackApplyInfo() != null && CollectionUtils.isEmpty(dto.getBackApplyDetailsList())) {
|
||||||
|
//只新增主任务单
|
||||||
|
//对传入的手机号进行校验
|
||||||
|
if (StringUtils.isNotBlank(dto.getBackApplyInfo().getPhone()) && !PhoneUtil.isMobile(dto.getBackApplyInfo().getPhone())) {
|
||||||
|
return AjaxResult.error("手机号格式不正确,请重新填写!");
|
||||||
|
}
|
||||||
|
//生成退料单号
|
||||||
|
String code = getString();
|
||||||
|
if (StringUtils.isBlank(code)) {
|
||||||
|
return AjaxResult.error("后台退料编号生成异常,请重试!");
|
||||||
|
}
|
||||||
|
|
||||||
|
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId());
|
||||||
|
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId(),
|
||||||
|
BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus(),
|
||||||
|
null,thisMonthMaxOrder + 1, code);
|
||||||
|
tmTask.setCreateTime(DateUtils.getNowDate());
|
||||||
|
tmTask.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
BackApplyInfo backApplyInfo = dto.getBackApplyInfo();
|
||||||
|
backApplyInfo.setCode(code);
|
||||||
|
backApplyInfo.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
backApplyInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
|
// 保存退料信息到 tm_task 表中
|
||||||
|
result += taskMapper.insertTmTask(tmTask);
|
||||||
|
if (result > 0) {
|
||||||
|
TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(tmTask.getTaskId(), dto.getBackApplyInfo().getAgreementId());
|
||||||
|
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
|
||||||
|
tmTaskAgreement.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
taskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
|
||||||
|
backApplyInfo.setTaskId(tmTask.getTaskId());
|
||||||
|
result += backApplyInfoMapper.insertBackApplyInfo(backApplyInfo);
|
||||||
|
}
|
||||||
|
if (result > 0) {
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
} else if (dto != null && dto.getBackApplyInfo() != null && dto.getBackApplyInfo().getId() != null) {
|
||||||
|
// 保存退料详情
|
||||||
|
result = saveBackApplyDetails(dto, dto.getBackApplyInfo(), result);
|
||||||
|
if (result > 0) {
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return insertBackApplyInfo(dto);
|
||||||
|
}
|
||||||
|
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app内层删除退料任务
|
||||||
|
* @param backApplyInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult delete(BackApplyInfo backApplyInfo) {
|
||||||
|
//先查询相关编码信息
|
||||||
|
List<MaCodeVo> maCodeVoList = backApplyInfoMapper.selectByCode(backApplyInfo.getParentId());
|
||||||
|
//需要清除明细表以及可能存储的文件信息
|
||||||
|
//清除back_apply_details表信息
|
||||||
|
int result = backApplyInfoMapper.deleteApplyDetails(backApplyInfo);
|
||||||
|
//删除back_check_details表信息
|
||||||
|
result += backApplyInfoMapper.deleteDetails(backApplyInfo);
|
||||||
|
//清除file文件表信息
|
||||||
|
BmFileInfo fileInfo = new BmFileInfo();
|
||||||
|
fileInfo.setTaskId(backApplyInfo.getParentId());
|
||||||
|
fileInfo.setModelId(backApplyInfo.getId());
|
||||||
|
result += bmFileInfoMapper.deleteBmFileInfoByBizInfo(fileInfo);
|
||||||
|
if (CollectionUtils.isNotEmpty(maCodeVoList)) {
|
||||||
|
for (MaCodeVo maCodeVo : maCodeVoList) {
|
||||||
|
BmFileInfo bmFileInfo = new BmFileInfo();
|
||||||
|
bmFileInfo.setTaskId(backApplyInfo.getId());
|
||||||
|
bmFileInfo.setModelId(maCodeVo.getMaId());
|
||||||
|
result += bmFileInfoMapper.deleteBmFileInfoByBizInfo(bmFileInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (result > 0) {
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
@ -91,6 +92,15 @@ public class RepairController extends BaseController {
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询维修单
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取维修单详情")
|
||||||
|
@GetMapping("/getRepairTicketInfo")
|
||||||
|
public AjaxResult getRepairTicketInfo(@NotBlank(message = "TaskId参数不能为空") String taskId) {
|
||||||
|
return service.getRepairTicketInfo(taskId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增维修记录
|
* 新增维修记录
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -97,4 +97,12 @@ public class RepairTaskDetails extends BaseEntity {
|
||||||
|
|
||||||
@ApiModelProperty(value = "关键字")
|
@ApiModelProperty(value = "关键字")
|
||||||
private String keyword;
|
private String keyword;
|
||||||
|
|
||||||
|
public RepairTaskDetails(String taskId) {
|
||||||
|
this.taskId = taskId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RepairTaskDetails() {
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.bonus.material.repair.domain.vo;
|
||||||
|
|
||||||
|
import com.bonus.material.repair.domain.RepairTask;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author : 阮世耀
|
||||||
|
* @version : 1.0
|
||||||
|
* @PackagePath: com.bonus.material.repair.domain.vo
|
||||||
|
* @CreateTime: 2024-11-20 09:43
|
||||||
|
* @Description: 维修任务单VO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Api(value = "维修任务单")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class RepairTicketVo {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "维修任务信息")
|
||||||
|
private RepairTask repairTaskInfo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "维修物资列表")
|
||||||
|
private List<RepairDeviceListVo> repairDeviceArray;
|
||||||
|
|
||||||
|
// 覆盖默认get方法,防止空指针异常
|
||||||
|
public List<RepairDeviceListVo> getRepairDeviceList() {
|
||||||
|
if (this.repairDeviceArray == null) {return new ArrayList<>();}
|
||||||
|
return this.repairDeviceArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -24,6 +24,12 @@ public interface RepairMapper {
|
||||||
*/
|
*/
|
||||||
List<RepairTask> getRepairTaskList(RepairTask bean);
|
List<RepairTask> getRepairTaskList(RepairTask bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取维修任务列表
|
||||||
|
* @param taskId 任务id
|
||||||
|
*/
|
||||||
|
RepairTask getRepairTaskInfoByTaskId(Long taskId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取维修详细列表
|
* 获取维修详细列表
|
||||||
* @param bean 维修任务详情--查询条件
|
* @param bean 维修任务详情--查询条件
|
||||||
|
|
@ -49,7 +55,7 @@ public interface RepairMapper {
|
||||||
* @param repairer 维修人员
|
* @param repairer 维修人员
|
||||||
* @param userId 用户id
|
* @param userId 用户id
|
||||||
*/
|
*/
|
||||||
int updateRepairedNum(@Param("id") Long id, @Param("repairNum")int repairNum,@Param("repairer") Long repairer,@Param("userId") Long userId);
|
int updateRepairedNum(@Param("id") Long id, @Param("repairNum") int repairNum, @Param("repairer") Long repairer, @Param("userId") Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改报废数量
|
* 修改报废数量
|
||||||
|
|
@ -57,7 +63,7 @@ public interface RepairMapper {
|
||||||
* @param scrapNum 报废数量
|
* @param scrapNum 报废数量
|
||||||
* @param userId 用户id
|
* @param userId 用户id
|
||||||
*/
|
*/
|
||||||
int updateScrapNum(@Param("id")Long id, @Param("scrapNum")int scrapNum,@Param("userId")Long userId);
|
int updateScrapNum(@Param("id") Long id, @Param("scrapNum") int scrapNum, @Param("userId") Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增配件维修记录
|
* 新增配件维修记录
|
||||||
|
|
@ -70,7 +76,7 @@ public interface RepairMapper {
|
||||||
* @param ids 主键集合
|
* @param ids 主键集合
|
||||||
* @param userId 用户id
|
* @param userId 用户id
|
||||||
*/
|
*/
|
||||||
int completeRepair(@Param("ids") ArrayList<Long> ids, @Param("userId")Long userId);
|
int completeRepair(@Param("ids") ArrayList<Long> ids, @Param("userId") Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询维修人员列表
|
* 查询维修人员列表
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,11 @@ public interface RepairService {
|
||||||
*/
|
*/
|
||||||
List<RepairDeviceListVo> getRepairMaTypeList(RepairTaskDetails bean);
|
List<RepairDeviceListVo> getRepairMaTypeList(RepairTaskDetails bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询维修单
|
||||||
|
*/
|
||||||
|
AjaxResult getRepairTicketInfo(String taskId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交维修记录
|
* 提交维修记录
|
||||||
*/
|
*/
|
||||||
|
|
@ -36,8 +41,6 @@ public interface RepairService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 快捷维修记录
|
* 快捷维修记录
|
||||||
* @param list
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
AjaxResult fastRepairApply(List<RepairTaskDetails> list);
|
AjaxResult fastRepairApply(List<RepairTaskDetails> list);
|
||||||
|
|
||||||
|
|
@ -50,7 +53,6 @@ public interface RepairService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询维修人员列表
|
* 查询维修人员列表
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
List<SysUser> selectUserList();
|
List<SysUser> selectUserList();
|
||||||
|
|
||||||
|
|
@ -65,8 +67,6 @@ public interface RepairService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出维修列表
|
* 导出维修列表
|
||||||
* @param bean
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
List<RepairTask> exportRepairTaskList(RepairTask bean);
|
List<RepairTask> exportRepairTaskList(RepairTask bean);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.repair.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
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;
|
||||||
|
|
@ -12,6 +13,7 @@ import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||||
import com.bonus.material.repair.domain.*;
|
import com.bonus.material.repair.domain.*;
|
||||||
import com.bonus.material.repair.domain.vo.RepairDeviceListVo;
|
import com.bonus.material.repair.domain.vo.RepairDeviceListVo;
|
||||||
import com.bonus.material.repair.domain.vo.RepairDeviceVO;
|
import com.bonus.material.repair.domain.vo.RepairDeviceVO;
|
||||||
|
import com.bonus.material.repair.domain.vo.RepairTicketVo;
|
||||||
import com.bonus.material.repair.mapper.RepairMapper;
|
import com.bonus.material.repair.mapper.RepairMapper;
|
||||||
import com.bonus.material.repair.service.RepairService;
|
import com.bonus.material.repair.service.RepairService;
|
||||||
import com.bonus.material.task.mapper.TmTaskMapper;
|
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||||
|
|
@ -22,6 +24,7 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
@ -94,6 +97,42 @@ public class RepairServiceImpl implements RepairService {
|
||||||
return new ArrayList<>(resultMap.values());
|
return new ArrayList<>(resultMap.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询维修单
|
||||||
|
* @param taskId 任务id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult getRepairTicketInfo(@NotBlank(message = "TaskId参数不能为空") String taskId) {
|
||||||
|
if (!NumberUtil.isNumber(taskId)) {
|
||||||
|
return AjaxResult.error("TaskId参数非数字类型,参数类型错误");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
long thisTaskId = Long.parseLong(taskId);
|
||||||
|
// 查询维修任务信息
|
||||||
|
RepairTask repairTaskInfo = repairMapper.getRepairTaskInfoByTaskId(thisTaskId);
|
||||||
|
// 查询维修任务详情
|
||||||
|
List<RepairDeviceListVo> repairMaTypeList = getRepairMaTypeList(new RepairTaskDetails(taskId));
|
||||||
|
// TODO: 待完善--查询维修配件信息
|
||||||
|
List<RepairPartDetails> partList = new ArrayList<>();
|
||||||
|
if (Objects.isNull(repairTaskInfo)) {
|
||||||
|
return AjaxResult.error("未查询到维修任务信息");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 组装result返回对象
|
||||||
|
RepairTicketVo result = new RepairTicketVo()
|
||||||
|
.setRepairTaskInfo(repairTaskInfo)
|
||||||
|
.setRepairDeviceArray(repairMaTypeList);
|
||||||
|
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return AjaxResult.error("TaskId转换类型时发生错误:" + e.getMessage());
|
||||||
|
} catch (DataAccessException e) {
|
||||||
|
return AjaxResult.error("数据库查询操作失败:" + e.getMessage());
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("代码处理异常:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交维修记录
|
* 提交维修记录
|
||||||
* @param bean repairApplyRecord
|
* @param bean repairApplyRecord
|
||||||
|
|
|
||||||
|
|
@ -100,9 +100,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
mm.ma_id AS maId,
|
mm.ma_id AS maId,
|
||||||
mm.ma_code AS maCode,
|
mm.ma_code AS maCode,
|
||||||
mm.ma_status AS maStatus,
|
mm.ma_status AS maStatus,
|
||||||
mt1.type_name AS materialName,
|
mt1.type_name AS typeName,
|
||||||
mm.type_id AS typeId,
|
mm.type_id AS typeId,
|
||||||
mt.type_name AS typeName
|
mt.type_name AS materialName,
|
||||||
|
mt2.type_name AS materialType
|
||||||
FROM
|
FROM
|
||||||
lease_out_details lod
|
lease_out_details lod
|
||||||
LEFT JOIN ma_machine mm ON lod.ma_id = mm.ma_id
|
LEFT JOIN ma_machine mm ON lod.ma_id = mm.ma_id
|
||||||
|
|
@ -110,6 +111,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
AND mt.del_flag = '0'
|
AND mt.del_flag = '0'
|
||||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||||
AND mt1.del_flag = '0'
|
AND mt1.del_flag = '0'
|
||||||
|
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
|
||||||
|
AND mt2.del_flag = '0'
|
||||||
LEFT JOIN lease_apply_info lai ON lod.parent_id = lai.id
|
LEFT JOIN lease_apply_info lai ON lod.parent_id = lai.id
|
||||||
LEFT JOIN tm_task_agreement tta ON lai.task_id = tta.task_id
|
LEFT JOIN tm_task_agreement tta ON lai.task_id = tta.task_id
|
||||||
LEFT JOIN bm_agreement_info ba ON tta.agreement_id = ba.agreement_id
|
LEFT JOIN bm_agreement_info ba ON tta.agreement_id = ba.agreement_id
|
||||||
|
|
@ -508,10 +511,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
values (#{info.agreementId},#{info.typeId},#{info.maId},#{many},#{info.startTime},#{info.status},#{info.leaseId},#{info.leasePrice},#{info.buyPrice},'0',#{info.companyId},#{info.leaseType},now());
|
values (#{info.agreementId},#{info.typeId},#{info.maId},#{many},#{info.startTime},#{info.status},#{info.leaseId},#{info.leasePrice},#{info.buyPrice},'0',#{info.companyId},#{info.leaseType},now());
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<delete id="deleteBackApplyInfoById" parameterType="Long">
|
|
||||||
delete from back_apply_info where id = #{id}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<delete id="deleteBackApply">
|
<delete id="deleteBackApply">
|
||||||
delete from back_apply_info where id = #{id}
|
delete from back_apply_info where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
@ -523,4 +522,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<delete id="deleteCheckDetails">
|
<delete id="deleteCheckDetails">
|
||||||
delete from back_check_details where parent_id = #{id}
|
delete from back_check_details where parent_id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteApplyDetails">
|
||||||
|
delete from back_apply_details where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteDetails">
|
||||||
|
delete from back_apply_details where parent_id = #{parentId} and type_id = #{typeId}
|
||||||
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -80,6 +80,35 @@
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="getRepairTaskInfoByTaskId" resultType="com.bonus.material.repair.domain.RepairTask">
|
||||||
|
SELECT
|
||||||
|
rd.task_id as taskId,
|
||||||
|
rd.repairer,
|
||||||
|
tt.CODE AS repairCode,
|
||||||
|
tt.create_time AS createTime,
|
||||||
|
tt.task_status AS repairStatusCode,
|
||||||
|
tt.company_id AS companyId,
|
||||||
|
tt.remark,
|
||||||
|
bui.unit_name AS backUnit,
|
||||||
|
bpi.pro_name AS backPro,
|
||||||
|
su.nick_name AS createName,
|
||||||
|
bai.CODE AS backCode,
|
||||||
|
GROUP_CONCAT(DISTINCT mt2.type_name) as type
|
||||||
|
FROM
|
||||||
|
repair_apply_details rd
|
||||||
|
LEFT JOIN ma_type mt on rd.type_id = mt.type_id
|
||||||
|
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
|
||||||
|
LEFT JOIN tm_task tt on rd.task_id = tt.task_id
|
||||||
|
LEFT JOIN back_apply_info bai ON rd.back_id = bai.id
|
||||||
|
LEFT JOIN tm_task_agreement tta ON rd.task_id = tta.task_id
|
||||||
|
LEFT JOIN bm_agreement_info bai2 ON tta.agreement_id = bai2.agreement_id
|
||||||
|
LEFT JOIN bm_unit bui ON bai2.unit_id = bui.unit_id
|
||||||
|
LEFT JOIN bm_project bpi ON bai2.project_id = bpi.pro_id and bpi.del_flag = '0'
|
||||||
|
left join sys_user su on rd.create_by = su.user_id
|
||||||
|
where rd.task_id = #{taskId}
|
||||||
|
GROUP BY rd.task_id
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getRepairTaskList" resultType="com.bonus.material.repair.domain.RepairTask">
|
<select id="getRepairTaskList" resultType="com.bonus.material.repair.domain.RepairTask">
|
||||||
SELECT
|
SELECT
|
||||||
rd.task_id as taskId,
|
rd.task_id as taskId,
|
||||||
|
|
@ -289,4 +318,5 @@
|
||||||
select ifnull(buy_price,0) from ma_part_type where pa_id = #{partId}
|
select ifnull(buy_price,0) from ma_part_type where pa_id = #{partId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue