设备点检保养删除时同时删除行信息

This commit is contained in:
JinLu.Yin 2022-09-01 23:03:47 +08:00
parent a15d8bdecf
commit ec0b393b9b
5 changed files with 29 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import com.ktg.mes.dv.service.IDvCheckMachineryService;
import com.ktg.mes.dv.service.IDvCheckSubjectService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
@ -124,6 +125,7 @@ public class DvCheckPlanController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:remove')")
@Log(title = "设备点检计划头", businessType = BusinessType.DELETE)
@Transactional
@DeleteMapping("/{planIds}")
public AjaxResult remove(@PathVariable Long[] planIds)
{
@ -133,6 +135,9 @@ public class DvCheckPlanController extends BaseController
if(!UserConstants.ORDER_STATUS_PREPARE.equals(plan.getStatus())){
return AjaxResult.error("只能删除草稿状态单据!");
}
dvCheckMachineryService.deleteByPlanId(planId);
dvCheckSubjectService.deleteByPlanId(planId);
}

View File

@ -61,4 +61,11 @@ public interface DvCheckSubjectMapper
* @return 结果
*/
public int deleteDvCheckSubjectByRecordIds(Long[] recordIds);
/**
* 根据计划ID删除对应的计划项目
* @param planId
* @return
*/
public int deleteByPlanId(Long planId);
}

View File

@ -66,4 +66,11 @@ public interface IDvCheckSubjectService
* @return 结果
*/
public int deleteDvCheckSubjectByRecordId(Long recordId);
/**
* 根据计划ID删除对应的计划项目
* @param planId
* @return
*/
public int deleteByPlanId(Long planId);
}

View File

@ -108,4 +108,9 @@ public class DvCheckSubjectServiceImpl implements IDvCheckSubjectService
{
return dvCheckSubjectMapper.deleteDvCheckSubjectByRecordId(recordId);
}
@Override
public int deleteByPlanId(Long planId) {
return dvCheckSubjectMapper.deleteByPlanId(planId);
}
}

View File

@ -124,4 +124,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{recordId}
</foreach>
</delete>
<delete id="deleteByPlanId" parameterType="Long">
delete from dv_check_subject where plan_id = #{planId}
</delete>
</mapper>