|
|
@ -79,7 +79,7 @@ public class BPSLTask extends AbstractTask { |
|
|
|
String extGroupData = task.getExt_group_data(); |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(extGroupData); |
|
|
|
String materialType = jsonObject.getString("material_type"); |
|
|
|
SchBasePoint point = findNextPoint(jsonObject); |
|
|
|
SchBasePoint point = findNextPoint(jsonObject,task); |
|
|
|
if (ObjectUtil.isEmpty(point)) { |
|
|
|
task.setRemark("未找到所需点位!"); |
|
|
|
taskService.update(task); |
|
|
@ -112,7 +112,7 @@ public class BPSLTask extends AbstractTask { |
|
|
|
* @param extGroupData |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private SchBasePoint findNextPoint(JSONObject extGroupData) { |
|
|
|
private SchBasePoint findNextPoint(JSONObject extGroupData,SchBaseTask task) { |
|
|
|
String regionCode = ""; |
|
|
|
String materialType = extGroupData.getString("material_type"); |
|
|
|
if("1".equals(materialType)){ |
|
|
@ -125,6 +125,10 @@ public class BPSLTask extends AbstractTask { |
|
|
|
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode,"1"); |
|
|
|
for(int i=schBasePointList.size()-1;i>=0;i--){ |
|
|
|
SchBasePoint schBasePoint=schBasePointList.get(i); |
|
|
|
//已锁定直接返回
|
|
|
|
if(task.getTask_code().equals(schBasePoint.getIng_task_code())){ |
|
|
|
return schBasePoint; |
|
|
|
} |
|
|
|
if (!"2".equals(schBasePoint.getPoint_type())&&schBasePoint.getVehicle_qty()!=0 |
|
|
|
&&ObjectUtil.isEmpty(schBasePoint.getIng_task_code()) |
|
|
|
&&(ObjectUtil.isEmpty(schBasePoint.getVehicle_type())||materialType.equals(schBasePoint.getVehicle_type()))){ |
|
|
@ -231,8 +235,12 @@ public class BPSLTask extends AbstractTask { |
|
|
|
protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) { |
|
|
|
//todo 重算最优点
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(schBaseTask.getExt_group_data()); |
|
|
|
SchBasePoint point = this.findNextPoint(jsonObject); |
|
|
|
schBaseTask.setPoint_code1(point.getPoint_code()); |
|
|
|
SchBasePoint point = this.findNextPoint(jsonObject,schBaseTask); |
|
|
|
if( "1".equals(jsonObject.getString("material_type"))) { |
|
|
|
schBaseTask.setPoint_code1(point.getPoint_code()+"0"+point.getVehicle_qty()); |
|
|
|
}else{ |
|
|
|
schBaseTask.setPoint_code1(point.getPoint_code()); |
|
|
|
} |
|
|
|
//重算点位时把点位占用
|
|
|
|
point.setIng_task_code(schBaseTask.getTask_code()); |
|
|
|
// point.setVehicle_qty(point.getVehicle_qty() - 1);
|
|
|
|