fix:设备台账TAB栏中的“点检”“保养”“维修”相关接口开发。
This commit is contained in:
parent
cb3f288512
commit
fdb428a022
@ -7,6 +7,7 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.mes.dv.domain.DvCheckMachinery;
|
||||
import com.ktg.mes.dv.domain.DvCheckSubject;
|
||||
import com.ktg.mes.dv.domain.dto.DvCheckPlanDTO;
|
||||
import com.ktg.mes.dv.service.IDvCheckMachineryService;
|
||||
import com.ktg.mes.dv.service.IDvCheckSubjectService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -150,4 +151,14 @@ public class DvCheckPlanController extends BaseController
|
||||
|
||||
return toAjax(dvCheckPlanService.deleteDvCheckPlanByPlanIds(planIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备编码和计划类型查询设备点检计划头列表
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:list')")
|
||||
@GetMapping("/getCheckPlan")
|
||||
public AjaxResult getCheckPlan(DvCheckPlanDTO checkPlanDTO) {
|
||||
return dvCheckPlanService.getCheckPlan(checkPlanDTO);
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.mes.dv.domain.dto.DvRepairDTO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -109,4 +110,13 @@ public class DvRepairController extends BaseController
|
||||
{
|
||||
return toAjax(dvRepairService.deleteDvRepairByRepairIds(repairIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备编码查询设备维修单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:repair:list')")
|
||||
@GetMapping("/getRepairList")
|
||||
public AjaxResult getRepairList(DvRepairDTO repairDTO) {
|
||||
return dvRepairService.getRepairList(repairDTO);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
package com.ktg.mes.dv.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DvCheckPlanDTO {
|
||||
|
||||
private String planType;
|
||||
|
||||
private String machineryCode;
|
||||
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.ktg.mes.dv.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DvRepairDTO {
|
||||
|
||||
private String machineryCode;
|
||||
|
||||
}
|
@ -2,6 +2,7 @@ package com.ktg.mes.dv.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.dv.domain.DvCheckMachinery;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 点检设备Mapper接口
|
||||
@ -67,4 +68,11 @@ public interface DvCheckMachineryMapper
|
||||
* @return
|
||||
*/
|
||||
public int deleteByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 根据设备编码获取相关计划id
|
||||
* @param machineryCode
|
||||
* @return
|
||||
*/
|
||||
List<Long> getPlanId(@Param("machineryCode") String machineryCode);
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package com.ktg.mes.dv.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.dv.domain.DvCheckPlan;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
|
||||
/**
|
||||
* 设备点检计划头Mapper接口
|
||||
@ -60,4 +62,6 @@ public interface DvCheckPlanMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckPlanByPlanIds(Long[] planIds);
|
||||
|
||||
List<DvCheckPlan> getByIds(@Param("planIds") List<Long> planIds,@Param("planType") String planType);
|
||||
}
|
||||
|
@ -1,7 +1,9 @@
|
||||
package com.ktg.mes.dv.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.mes.dv.domain.DvRepair;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 设备维修单Mapper接口
|
||||
@ -61,4 +63,12 @@ public interface DvRepairMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairByRepairIds(Long[] repairIds);
|
||||
|
||||
/**
|
||||
* 根据设备编码查询设备维修单列表
|
||||
*
|
||||
* @param machineryCode
|
||||
* @return
|
||||
*/
|
||||
List<DvRepair> getRepairList(@Param("machineryCode") String machineryCode);
|
||||
}
|
||||
|
@ -67,4 +67,11 @@ public interface IDvCheckMachineryService
|
||||
* @return
|
||||
*/
|
||||
public int deleteByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 根据设备编码获取相关计划id
|
||||
* @param machineryCode
|
||||
* @return
|
||||
*/
|
||||
List<Long> getPlanId(String machineryCode);
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
package com.ktg.mes.dv.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.mes.dv.domain.DvCheckPlan;
|
||||
import com.ktg.mes.dv.domain.dto.DvCheckPlanDTO;
|
||||
|
||||
/**
|
||||
* 设备点检计划头Service接口
|
||||
@ -65,4 +68,11 @@ public interface IDvCheckPlanService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckPlanByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 根据设备编码和计划类型查询设备点检计划头列表
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getCheckPlan(DvCheckPlanDTO checkPlanDTO);
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
package com.ktg.mes.dv.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.mes.dv.domain.DvRepair;
|
||||
import com.ktg.mes.dv.domain.dto.DvRepairDTO;
|
||||
|
||||
/**
|
||||
* 设备维修单Service接口
|
||||
@ -65,4 +68,11 @@ public interface IDvRepairService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairByRepairId(Long repairId);
|
||||
|
||||
/**
|
||||
* 根据设备编码查询设备维修单列表
|
||||
* @param repairDTO
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getRepairList(DvRepairDTO repairDTO);
|
||||
}
|
||||
|
@ -111,4 +111,9 @@ public class DvCheckMachineryServiceImpl implements IDvCheckMachineryService
|
||||
public int deleteByPlanId(Long planId) {
|
||||
return dvCheckMachineryMapper.deleteByPlanId(planId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getPlanId(String machineryCode) {
|
||||
return dvCheckMachineryMapper.getPlanId(machineryCode);
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,12 @@ package com.ktg.mes.dv.service.impl;
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.mes.dv.domain.dto.DvCheckPlanDTO;
|
||||
import com.ktg.mes.dv.service.IDvCheckMachineryService;
|
||||
import org.aspectj.weaver.loadtime.Aj;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.dv.mapper.DvCheckPlanMapper;
|
||||
@ -23,6 +27,9 @@ public class DvCheckPlanServiceImpl implements IDvCheckPlanService
|
||||
@Autowired
|
||||
private DvCheckPlanMapper dvCheckPlanMapper;
|
||||
|
||||
@Autowired
|
||||
private IDvCheckMachineryService dvCheckMachineryService;
|
||||
|
||||
/**
|
||||
* 查询设备点检计划头
|
||||
*
|
||||
@ -106,4 +113,20 @@ public class DvCheckPlanServiceImpl implements IDvCheckPlanService
|
||||
{
|
||||
return dvCheckPlanMapper.deleteDvCheckPlanByPlanId(planId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备编码和计划类型查询设备点检计划头列表
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getCheckPlan(DvCheckPlanDTO checkPlanDTO) {
|
||||
// 根据设备编码获取相关计划id
|
||||
List<Long> planIds = dvCheckMachineryService.getPlanId(checkPlanDTO.getMachineryCode());
|
||||
if (planIds != null && planIds.size() > 0) {
|
||||
// 根据设备编码和计划类型获取相关设备点检计划头列表
|
||||
List<DvCheckPlan> list = dvCheckPlanMapper.getByIds(planIds, checkPlanDTO.getPlanType());
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,10 @@ package com.ktg.mes.dv.service.impl;
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.mes.dv.domain.dto.DvRepairDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.dv.mapper.DvRepairMapper;
|
||||
@ -106,4 +108,15 @@ public class DvRepairServiceImpl implements IDvRepairService
|
||||
{
|
||||
return dvRepairMapper.deleteDvRepairByRepairId(repairId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备编码查询设备维修单列表
|
||||
* @param repairDTO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getRepairList(DvRepairDTO repairDTO) {
|
||||
List<DvRepair> list = dvRepairMapper.getRepairList(repairDTO.getMachineryCode());
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where plan_id = #{planId}
|
||||
) limit 1
|
||||
</select>
|
||||
|
||||
<select id="getPlanId" resultType="java.lang.Long">
|
||||
select plan_id from dv_check_machinery
|
||||
where machinery_code = #{machineryCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertDvCheckMachinery" parameterType="DvCheckMachinery" useGeneratedKeys="true" keyProperty="recordId">
|
||||
insert into dv_check_machinery
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
@ -52,7 +52,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="selectDvCheckPlanVo"/>
|
||||
where plan_code = #{planCode}
|
||||
</select>
|
||||
|
||||
<select id="getByIds" resultType="com.ktg.mes.dv.domain.DvCheckPlan" resultMap="DvCheckPlanResult">
|
||||
<include refid="selectDvCheckPlanVo"/>
|
||||
where plan_type = #{planType}
|
||||
and plan_id in
|
||||
<foreach collection="planIds" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<insert id="insertDvCheckPlan" parameterType="DvCheckPlan" useGeneratedKeys="true" keyProperty="planId">
|
||||
insert into dv_check_plan
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
@ -66,6 +66,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="selectDvRepairVo"/>
|
||||
where repair_code = #{repairCode} limit 1
|
||||
</select>
|
||||
<select id="getRepairList" resultType="com.ktg.mes.dv.domain.DvRepair" resultMap="DvRepairResult">
|
||||
<include refid="selectDvRepairVo"/>
|
||||
where machinery_code = #{machineryCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertDvRepair" parameterType="DvRepair" useGeneratedKeys="true" keyProperty="repairId">
|
||||
insert into dv_repair
|
||||
|
Loading…
Reference in New Issue
Block a user