|
|
|
@ -5,14 +5,12 @@ import java.util.*;
|
|
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
|
|
import com.op.common.core.utils.DateUtils;
|
|
|
|
|
import com.op.common.core.web.domain.AjaxResult;
|
|
|
|
|
import com.op.mes.domain.BMS;
|
|
|
|
|
import com.op.mes.domain.ProOrderWorkorder;
|
|
|
|
|
import com.op.mes.domain.Product;
|
|
|
|
|
import com.op.mes.domain.*;
|
|
|
|
|
import com.op.mes.mapper.ProOrderMapper;
|
|
|
|
|
import com.op.mes.mapper.ProOrderWorkorderMapper;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import com.op.mes.mapper.ProWetMaterialPlanMapper;
|
|
|
|
|
import com.op.mes.domain.ProWetMaterialPlan;
|
|
|
|
|
import com.op.mes.service.IProWetMaterialPlanService;
|
|
|
|
|
|
|
|
|
|
import static com.op.common.core.web.domain.AjaxResult.error;
|
|
|
|
@ -30,6 +28,8 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService
|
|
|
|
|
private ProWetMaterialPlanMapper proWetMaterialPlanMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ProOrderWorkorderMapper proOrderWorkorderMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ProOrderMapper proOrderMapper;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询湿料计划管理
|
|
|
|
@ -41,7 +41,7 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public ProWetMaterialPlan selectProWetMaterialPlanById(String id) {
|
|
|
|
|
// 参数判空
|
|
|
|
|
if (id == null || id.equals("")){
|
|
|
|
|
if (id == null || id.equals("")) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
return proWetMaterialPlanMapper.selectProWetMaterialPlanById(id);
|
|
|
|
@ -122,7 +122,7 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public AjaxResult getWorkOrderByTime(Date productDate) {
|
|
|
|
|
// 参数判空
|
|
|
|
|
if (productDate == null){
|
|
|
|
|
if (productDate == null) {
|
|
|
|
|
return error("参数为空!");
|
|
|
|
|
}
|
|
|
|
|
List<ProOrderWorkorder> workorderList = proOrderWorkorderMapper.selectWorkOrderByTime(productDate);
|
|
|
|
@ -166,9 +166,58 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public AjaxResult getBMSList(Date planTime) {
|
|
|
|
|
// 参数判空
|
|
|
|
|
if (planTime == null){
|
|
|
|
|
if (planTime == null) {
|
|
|
|
|
return error("参数为空!");
|
|
|
|
|
}
|
|
|
|
|
return success(proWetMaterialPlanMapper.selectBMSList(planTime));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 提交湿料计划接口
|
|
|
|
|
*
|
|
|
|
|
* @param proOrderWorkorderList
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public AjaxResult addWetPlan(List<ProOrderWorkorder> proOrderWorkorderList) {
|
|
|
|
|
// 获取料罐信息list
|
|
|
|
|
List<Bucket> bucketList = proWetMaterialPlanMapper.selectBucketList();
|
|
|
|
|
// 获取班次信息list
|
|
|
|
|
List<ProShift> shiftList = proOrderMapper.selectProShift();
|
|
|
|
|
|
|
|
|
|
// 湿料计划分类
|
|
|
|
|
for (int shift = 0; shift < shiftList.size(); shift++){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Map<String, Map<String, List<String>>> classifyWorkOrders(List<String> shifts, List<String> tanks, List<String> workOrders) {
|
|
|
|
|
Map<String, Map<String, List<String>>> classifiedWorkOrders = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < shifts.size(); i++) {
|
|
|
|
|
String shift = shifts.get(i);
|
|
|
|
|
String tank = tanks.get(i);
|
|
|
|
|
String workOrder = workOrders.get(i);
|
|
|
|
|
|
|
|
|
|
// 获取当前班次的工单分类
|
|
|
|
|
Map<String, List<String>> shiftMap = classifiedWorkOrders.getOrDefault(shift, new HashMap<>());
|
|
|
|
|
|
|
|
|
|
// 获取当前料罐的工单列表
|
|
|
|
|
List<String> tankOrders = shiftMap.getOrDefault(tank, new ArrayList<>());
|
|
|
|
|
|
|
|
|
|
// 添加工单到料罐列表
|
|
|
|
|
tankOrders.add(workOrder);
|
|
|
|
|
|
|
|
|
|
// 更新料罐的工单列表
|
|
|
|
|
shiftMap.put(tank, tankOrders);
|
|
|
|
|
|
|
|
|
|
// 更新班次的工单分类
|
|
|
|
|
classifiedWorkOrders.put(shift, shiftMap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return classifiedWorkOrders;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|