工单管理(删除逻辑变更-湿料计划)、湿料计划管理(新增逻辑变更-白坯)

highway
wws 1 year ago
parent f72eaf604a
commit ca123c873b

@ -7,6 +7,8 @@ import javax.servlet.http.HttpServletResponse;
import com.op.common.core.exception.ServiceException;
import com.op.plan.domain.ProOrder;
import com.op.plan.domain.dto.SplitOrderDTO;
import com.op.plan.service.IProWetMaterialPlanDetailService;
import com.op.plan.service.IProWetMaterialPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
@ -38,6 +40,8 @@ import com.op.common.core.web.page.TableDataInfo;
public class ProOrderWorkorderController extends BaseController {
@Autowired
private IProOrderWorkorderService proOrderWorkorderService;
@Autowired
private IProWetMaterialPlanDetailService proWetMaterialPlanDetailService;
/**
*
@ -154,6 +158,10 @@ public class ProOrderWorkorderController extends BaseController {
for (ProOrderWorkorder proOrderWorkorder : proOrderWorkorders) {
String status = proOrderWorkorder.getStatus();
strings.add(status);
// 判断是否含有湿料计划 boolean值存在为true不存在为false
if (proWetMaterialPlanDetailService.selectProWetMaterialPlanDetailByWorkId(proOrderWorkorder.getWorkorderId())) {
throw new ServiceException("工单已创建湿料计划,不能删除!");
}
}
String[] orderWorkerIds= strings.toArray(new String[0]);
for (String orderWorkerId : orderWorkerIds) {

@ -13,4 +13,11 @@ public interface IProWetMaterialPlanDetailService {
* @return
*/
List<ProWetMaterialPlanDetail> selectProWetMaterialPlanDetailList(ProWetMaterialPlan proWetMaterialPlan);
/**
* id湿
* @param workorderId
* @return
*/
boolean selectProWetMaterialPlanDetailByWorkId(String workorderId);
}

@ -25,4 +25,19 @@ public class ProWetMaterialPlanDetailServiceImpl implements IProWetMaterialPlanD
public List<ProWetMaterialPlanDetail> selectProWetMaterialPlanDetailList(ProWetMaterialPlan proWetMaterialPlan) {
return proWetMaterialPlanDetailMapper.selectWetPlanList(proWetMaterialPlan);
}
/**
* id湿
* @param workorderId
* @return
*/
@Override
@DS("#header.poolName")
public boolean selectProWetMaterialPlanDetailByWorkId(String workorderId) {
ProWetMaterialPlanDetail detail = proWetMaterialPlanDetailMapper.selectProWetMaterialPlanDetailByWorkId(workorderId);
if (detail != null){
return true;
}
return false;
}
}

@ -110,7 +110,7 @@
<include refid="selectProOrderWorkorderVo"/>
where workorder_id not in (
select workorder_id
from pro_wet_material_plan_detail) and CONVERT(date, product_date) = #{productDate}
from pro_wet_material_plan_detail) and CONVERT(date, product_date) = #{productDate} and prod_type = 'white'
</select>
<select id="getWorkOrderByIds" resultMap="ProOrderWorkorderResult">
<include refid="selectProOrderWorkorderVo"/>

Loading…
Cancel
Save