设备点检保养删除时同时删除行信息
This commit is contained in:
parent
a15d8bdecf
commit
ec0b393b9b
@ -11,6 +11,7 @@ import com.ktg.mes.dv.service.IDvCheckMachineryService;
|
|||||||
import com.ktg.mes.dv.service.IDvCheckSubjectService;
|
import com.ktg.mes.dv.service.IDvCheckSubjectService;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
@ -124,6 +125,7 @@ public class DvCheckPlanController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:remove')")
|
@PreAuthorize("@ss.hasPermi('mes:dv:checkplan:remove')")
|
||||||
@Log(title = "设备点检计划头", businessType = BusinessType.DELETE)
|
@Log(title = "设备点检计划头", businessType = BusinessType.DELETE)
|
||||||
|
@Transactional
|
||||||
@DeleteMapping("/{planIds}")
|
@DeleteMapping("/{planIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] planIds)
|
public AjaxResult remove(@PathVariable Long[] planIds)
|
||||||
{
|
{
|
||||||
@ -133,6 +135,9 @@ public class DvCheckPlanController extends BaseController
|
|||||||
if(!UserConstants.ORDER_STATUS_PREPARE.equals(plan.getStatus())){
|
if(!UserConstants.ORDER_STATUS_PREPARE.equals(plan.getStatus())){
|
||||||
return AjaxResult.error("只能删除草稿状态单据!");
|
return AjaxResult.error("只能删除草稿状态单据!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dvCheckMachineryService.deleteByPlanId(planId);
|
||||||
|
dvCheckSubjectService.deleteByPlanId(planId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,4 +61,11 @@ public interface DvCheckSubjectMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDvCheckSubjectByRecordIds(Long[] recordIds);
|
public int deleteDvCheckSubjectByRecordIds(Long[] recordIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据计划ID删除对应的计划项目
|
||||||
|
* @param planId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int deleteByPlanId(Long planId);
|
||||||
}
|
}
|
||||||
|
@ -66,4 +66,11 @@ public interface IDvCheckSubjectService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDvCheckSubjectByRecordId(Long recordId);
|
public int deleteDvCheckSubjectByRecordId(Long recordId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据计划ID删除对应的计划项目
|
||||||
|
* @param planId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int deleteByPlanId(Long planId);
|
||||||
}
|
}
|
||||||
|
@ -108,4 +108,9 @@ public class DvCheckSubjectServiceImpl implements IDvCheckSubjectService
|
|||||||
{
|
{
|
||||||
return dvCheckSubjectMapper.deleteDvCheckSubjectByRecordId(recordId);
|
return dvCheckSubjectMapper.deleteDvCheckSubjectByRecordId(recordId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteByPlanId(Long planId) {
|
||||||
|
return dvCheckSubjectMapper.deleteByPlanId(planId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,4 +124,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{recordId}
|
#{recordId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteByPlanId" parameterType="Long">
|
||||||
|
delete from dv_check_subject where plan_id = #{planId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue
Block a user