湿料计划(删除湿料计划)

highway
wws 1 year ago
parent 3c0983043b
commit d7610f0b31

@ -181,7 +181,7 @@ public class ProWetMaterialPlanController extends BaseController {
@Log(title = "湿料计划管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) {
return toAjax(proWetMaterialPlanService.deleteProWetMaterialPlanByIds(ids));
return proWetMaterialPlanService.deleteProWetMaterialPlanByIds(ids);
}
// /**
// * 提交湿料计划同步WCS

@ -116,4 +116,10 @@ public interface ProWetMaterialPlanDetailMapper {
* @return
*/
ProWetMaterialPlanDetail selectProWetMaterialPlanDetailByOrderCode(String orderCode);
/**
* 湿id湿
* @param id
*/
void deleteProWetMaterialPlanDetailByPlanId(String id);
}

@ -54,7 +54,7 @@ public interface IProWetMaterialPlanService {
* @param ids 湿
* @return
*/
public int deleteProWetMaterialPlanByIds(String[] ids);
public AjaxResult deleteProWetMaterialPlanByIds(String[] ids);
/**
* 湿

@ -1,5 +1,6 @@
package com.op.plan.service.impl;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@ -112,8 +113,22 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService
*/
@Override
@DS("#header.poolName")
public int deleteProWetMaterialPlanByIds(String[] ids) {
return proWetMaterialPlanMapper.deleteProWetMaterialPlanByIds(ids);
public AjaxResult deleteProWetMaterialPlanByIds(String[] ids) {
// 已下发计划不允许删除
for (String id : ids) {
ProWetMaterialPlan plan = proWetMaterialPlanMapper.selectProWetMaterialPlanById(id);
if (plan.getSyncFlag().equals("Y")){
SimpleDateFormat formatDate = new SimpleDateFormat("yyyy-MM-dd");
return error("日期为"+formatDate.format(plan.getPlanTime())+"的计划已下发,不允许删除!");
}
}
for (String id : ids) {
// 删除主计划
proWetMaterialPlanMapper.deleteProWetMaterialPlanById(id);
// 删除计划详情
proWetMaterialPlanDetailMapper.deleteProWetMaterialPlanDetailByPlanId(id);
}
return success();
}
/**

@ -234,4 +234,10 @@
set del_flag = '1'
where workorder_id = #{workorderId}
</delete>
<delete id="deleteProWetMaterialPlanDetailByPlanId">
update pro_wet_material_plan_detail
set del_flag = '1'
where wet_material_plan_id = #{id}
</delete>
</mapper>

Loading…
Cancel
Save