设备点检和保养计划添加设备信息时的验证问题修复
This commit is contained in:
parent
6a5196d039
commit
a15d8bdecf
@ -130,10 +130,13 @@ public class DvCheckPlanController extends BaseController
|
||||
for (Long planId:planIds
|
||||
) {
|
||||
DvCheckPlan plan = dvCheckPlanService.selectDvCheckPlanByPlanId(planId);
|
||||
if(UserConstants.ORDER_STATUS_PREPARE.equals(plan.getStatus())){
|
||||
if(!UserConstants.ORDER_STATUS_PREPARE.equals(plan.getStatus())){
|
||||
return AjaxResult.error("只能删除草稿状态单据!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return toAjax(dvCheckPlanService.deleteDvCheckPlanByPlanIds(planIds));
|
||||
}
|
||||
}
|
||||
|
@ -60,4 +60,11 @@ public interface DvCheckMachineryMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckMachineryByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 根据计划头ID删除对应的设备列表
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
public int deleteByPlanId(Long planId);
|
||||
}
|
||||
|
@ -60,4 +60,11 @@ public interface IDvCheckMachineryService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckMachineryByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 根据计划头ID删除对应的设备列表
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
public int deleteByPlanId(Long planId);
|
||||
}
|
||||
|
@ -106,4 +106,9 @@ public class DvCheckMachineryServiceImpl implements IDvCheckMachineryService
|
||||
{
|
||||
return dvCheckMachineryMapper.deleteDvCheckMachineryByRecordId(recordId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByPlanId(Long planId) {
|
||||
return dvCheckMachineryMapper.deleteByPlanId(planId);
|
||||
}
|
||||
}
|
||||
|
@ -45,8 +45,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="checkMachineryUnique" parameterType="DvCheckMachinery" resultMap="DvCheckMachineryResult">
|
||||
<include refid="selectDvCheckMachineryVo"/>
|
||||
where machinery_id = #{machineryId} and plan_type = #{planType} limit 1
|
||||
select record_id, cm.plan_id, machinery_id, machinery_code, machinery_name, machinery_brand, machinery_spec, cm.remark, cm.attr1, cm.attr2, cm.attr3, cm.attr4, cm.create_by, cm.create_time, cm.update_by, cm.update_time
|
||||
from dv_check_machinery cm
|
||||
left join dv_check_plan cp
|
||||
on cm.plan_id = cp.plan_id
|
||||
where cm.machinery_id = #{machineryId} and cp.plan_type = (
|
||||
select plan_type
|
||||
from dv_check_plan
|
||||
where plan_id = #{planId}
|
||||
) limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertDvCheckMachinery" parameterType="DvCheckMachinery" useGeneratedKeys="true" keyProperty="recordId">
|
||||
@ -119,4 +126,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByPlanId" parameterType="Long">
|
||||
delete from dv_check_machinery where plan_id = #{planId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user