Merge remote-tracking branch 'origin/branch_syruan'
This commit is contained in:
commit
1704d1f761
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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