|
|
@ -6,16 +6,10 @@ import com.op.common.core.context.SecurityContextHolder;
|
|
|
|
import com.op.common.core.utils.DateUtils;
|
|
|
|
import com.op.common.core.utils.DateUtils;
|
|
|
|
import com.op.common.core.utils.uuid.IdUtils;
|
|
|
|
import com.op.common.core.utils.uuid.IdUtils;
|
|
|
|
import com.op.common.core.web.domain.AjaxResult;
|
|
|
|
import com.op.common.core.web.domain.AjaxResult;
|
|
|
|
import com.op.plan.domain.ProOrder;
|
|
|
|
import com.op.plan.domain.*;
|
|
|
|
import com.op.plan.domain.ProOrderWorkorder;
|
|
|
|
|
|
|
|
import com.op.plan.domain.ProRoute;
|
|
|
|
|
|
|
|
import com.op.plan.domain.ProShift;
|
|
|
|
|
|
|
|
import com.op.plan.domain.vo.CascaderDTO;
|
|
|
|
import com.op.plan.domain.vo.CascaderDTO;
|
|
|
|
import com.op.plan.domain.vo.SplitProWhiteOrderVo;
|
|
|
|
import com.op.plan.domain.vo.SplitProWhiteOrderVo;
|
|
|
|
import com.op.plan.mapper.ProOrderMapper;
|
|
|
|
import com.op.plan.mapper.*;
|
|
|
|
import com.op.plan.mapper.ProOrderWorkorderMapper;
|
|
|
|
|
|
|
|
import com.op.plan.mapper.ProRouteMapper;
|
|
|
|
|
|
|
|
import com.op.plan.mapper.ProWhiteOrderMapper;
|
|
|
|
|
|
|
|
import com.op.plan.service.IProWhiteOrderService;
|
|
|
|
import com.op.plan.service.IProWhiteOrderService;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@ -27,6 +21,9 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static com.op.common.core.web.domain.AjaxResult.error;
|
|
|
|
|
|
|
|
import static com.op.common.core.web.domain.AjaxResult.success;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 白坯订单管理Service业务层处理
|
|
|
|
* 白坯订单管理Service业务层处理
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -44,6 +41,12 @@ public class ProWhiteOrderServiceImpl implements IProWhiteOrderService {
|
|
|
|
private ProOrderWorkorderMapper proOrderWorkorderMapper;
|
|
|
|
private ProOrderWorkorderMapper proOrderWorkorderMapper;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private ProOrderMapper proOrderMapper;
|
|
|
|
private ProOrderMapper proOrderMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private ProWetMaterialPlanMapper proWetMaterialPlanMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private ProOrderWorkorderBatchMapper proOrderWorkorderBatchMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private ProWetMaterialPlanDetailMapper proWetMaterialPlanDetailMapper;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询白坯订单管理
|
|
|
|
* 查询白坯订单管理
|
|
|
@ -184,8 +187,44 @@ public class ProWhiteOrderServiceImpl implements IProWhiteOrderService {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@DS("#header.poolName")
|
|
|
|
@DS("#header.poolName")
|
|
|
|
public int deleteProOrderByIds(String[] ids) {
|
|
|
|
public AjaxResult deleteProOrderByIds(String[] ids) {
|
|
|
|
return proWhiteOrderMapper.deleteProOrderByIds(ids);
|
|
|
|
for (String id : ids) {
|
|
|
|
|
|
|
|
// 通过母订单查询自定单list
|
|
|
|
|
|
|
|
String[] orderIds = proOrderMapper.selectOrderIdByParentOrder(id);
|
|
|
|
|
|
|
|
// 通过子订单id列表查询
|
|
|
|
|
|
|
|
for (String orderId : orderIds) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ProOrderWorkorder> proOrderWorkorderList = proOrderWorkorderMapper.selectProOrderWorkorderByOrderId(orderId);
|
|
|
|
|
|
|
|
if (proOrderWorkorderList.size() > 0) {
|
|
|
|
|
|
|
|
for (ProOrderWorkorder workOrder : proOrderWorkorderList) {
|
|
|
|
|
|
|
|
// 订单下存在已下发工单
|
|
|
|
|
|
|
|
if (!(workOrder.getStatus().equals("w0") || workOrder.getStatus().equals("w1"))) {
|
|
|
|
|
|
|
|
return error("订单下存在已生产工单,不可删除!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 订单下存在下发湿料计划
|
|
|
|
|
|
|
|
ProWetMaterialPlan plan = proWetMaterialPlanMapper.selectProWetMaterialPlanByWorkId(workOrder.getWorkorderId());
|
|
|
|
|
|
|
|
if (plan != null) {
|
|
|
|
|
|
|
|
return error("订单下存在已下发湿料计划工单,不可删除!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (ProOrderWorkorder workorder : proOrderWorkorderList) {
|
|
|
|
|
|
|
|
// 删除批次信息
|
|
|
|
|
|
|
|
proOrderWorkorderBatchMapper.deleteProOrderWorkorderBatchByWorkorderId(workorder.getWorkorderId());
|
|
|
|
|
|
|
|
// 删除湿料详情
|
|
|
|
|
|
|
|
proWetMaterialPlanDetailMapper.deleteProWetMaterialPlanDetailByWorkId(workorder.getWorkorderId());
|
|
|
|
|
|
|
|
// 删除工单
|
|
|
|
|
|
|
|
proOrderWorkorderMapper.deleteProOrderWorkorderByWorkorderId(workorder.getWorkorderId());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 删除子订单
|
|
|
|
|
|
|
|
proWhiteOrderMapper.deleteProOrderByIds(orderIds);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 删除母订单
|
|
|
|
|
|
|
|
proWhiteOrderMapper.deleteProOrderByIds(ids);
|
|
|
|
|
|
|
|
return success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -246,7 +285,7 @@ public class ProWhiteOrderServiceImpl implements IProWhiteOrderService {
|
|
|
|
// 将工艺信息list放入返回实体
|
|
|
|
// 将工艺信息list放入返回实体
|
|
|
|
splitProWhiteOrderVo.setRouteList(routeList);
|
|
|
|
splitProWhiteOrderVo.setRouteList(routeList);
|
|
|
|
|
|
|
|
|
|
|
|
return AjaxResult.success(splitProWhiteOrderVo);
|
|
|
|
return success(splitProWhiteOrderVo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|