Browse Source

opt: 优化connector小插件的交互

master
yanps 2 months ago
parent
commit
67f5a69dc7
  1. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/connector/service/impl/WmsToConnectorServiceImpl.java
  2. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/controller/FabController.java
  3. 34
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/controller/HandheldController.java
  4. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/HandheldService.java
  5. 10
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/impl/HandheldServiceImpl.java
  6. 42
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/sorting/service/impl/SortingServiceImpl.java
  7. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml
  8. 3
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSMTTask.java
  9. 3
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/connector/service/impl/WmsToConnectorServiceImpl.java

@ -60,7 +60,7 @@ public class WmsToConnectorServiceImpl implements WmsToConnectorService {
materials.forEach(material -> {
String replace = StrUtil.replace(StrUtil.toString(material), "=", ":");
JSONObject jsonObject1 = JSONObject.parseObject(replace);
jsonObject1.put("due_date"," ");
jsonObject1.put("due_date","2000-10-01 00:00:00 ");
jsonObject1.put("next_region_code","");
objects.add(jsonObject1);
});

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/controller/FabController.java

@ -207,11 +207,6 @@ public class FabController {
@Log("工序下料")
@PostMapping("/sendMater")
public ResponseEntity<TableDataInfo> sendMater(@RequestBody SendMaterVo materInfo) {
/*if (StrUtil.isNotEmpty(materInfo.getRegion_code())) {
JSONObject toJSON = (JSONObject) JSON.toJSON(materInfo);
fabService.createAgvTask(toJSON, "smt");
return new ResponseEntity(TableDataInfo.build(), HttpStatus.OK);
} else {*/
JSONObject toJSON = (JSONObject) JSON.toJSON(materInfo);
//TODO:待确定
List<SendVehicleVo> mater = materInfo.getMater();
@ -259,7 +254,6 @@ public class FabController {
fabService.createAgvTask(toJSON, "smt");
return new ResponseEntity(TableDataInfo.build(), HttpStatus.OK);
/* }*/
}
//TODO: 根据物料查主盘信息; 当前工序查所有物料 ->

34
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/controller/HandheldController.java

@ -30,8 +30,6 @@ public class HandheldController {
@PostMapping("/cageFrame")
@Log("外协区空笼框送回")
@ApiOperation("外协区空笼框送回")
@SaIgnore
public ResponseEntity<Object> createEmptyCageStorageTask(@RequestBody JSONObject param) {
handheldService.emptyCageStorageTask(param);
return new ResponseEntity<>(HttpStatus.OK);
@ -40,8 +38,6 @@ public class HandheldController {
@PostMapping("/rack")
@Log("外协区空料架送回")
@ApiOperation("外协区空料架送回")
@SaIgnore
public ResponseEntity<Object> applyRackSendItBask(@RequestBody JSONObject param) {
handheldService.rackSendItBask(param);
return new ResponseEntity<>(HttpStatus.OK);
@ -49,8 +45,6 @@ public class HandheldController {
@PostMapping("/transhipment")
@Log("物料转运")
@ApiOperation("物料转运")
@SaIgnore
public ResponseEntity<Object> applyMaterialTransfer(@RequestBody JSONObject param) {
handheldService.materialTransfer(param);
return new ResponseEntity<>(HttpStatus.OK);
@ -60,8 +54,6 @@ public class HandheldController {
@PostMapping("/callEmptyRack")
@Log("手持呼叫空料笼")
@ApiOperation("手持呼叫空料笼")
@SaIgnore
public ResponseEntity<Object> applyEmptyVehicle(@RequestBody JSONObject param) {
return new ResponseEntity<>(handheldService.applyEmptyVehicle(param), HttpStatus.OK);
}
@ -69,8 +61,6 @@ public class HandheldController {
@PostMapping("/blanking")
@Log("手持工序下料")
@ApiOperation("手持工序下料")
@SaIgnore
public ResponseEntity<Object> createCageBlankingTask(@RequestBody JSONObject param) {
handheldService.cageBlankingTask(param);
return new ResponseEntity<>(HttpStatus.OK);
@ -79,16 +69,12 @@ public class HandheldController {
@PostMapping("/lock")
@Log("点位锁定释放")
@ApiOperation("点位锁定释放")
@SaIgnore
public ResponseEntity<Object> applyPointLock(@RequestBody JSONObject param) {
return new ResponseEntity<>(handheldService.pointLock(param), HttpStatus.OK);
}
@PostMapping("/pointStatus")
@Log("修改点位货物状态")
@ApiOperation("修改点位货物状态")
@SaIgnore
public ResponseEntity<Object> applyPointStatus(@RequestBody JSONObject param) {
return new ResponseEntity<>(handheldService.pointStatus(param), HttpStatus.OK);
}
@ -96,8 +82,6 @@ public class HandheldController {
@PostMapping("/storehouse")
@Log("补空框")
@ApiOperation("补空框")
@SaIgnore
public ResponseEntity<Object> createToStorehouse(@RequestBody JSONObject param) {
handheldService.toStorehouse(param);
return new ResponseEntity<>(HttpStatus.OK);
@ -105,16 +89,12 @@ public class HandheldController {
@PostMapping("/getRegionCode")
@Log("查询工序")
@ApiOperation("查询工序")
@SaIgnore
public ResponseEntity<Object> getRegionCodeByOrderCode(@RequestBody JSONObject orderCode) {
return new ResponseEntity<>(handheldService.regionCodeByOrderCode(orderCode.getString("orderCode")),HttpStatus.OK);
}
@PostMapping("/updateOrder")
@Log("修改订单工序")
@ApiOperation("修改订单工序")
@SaIgnore
public ResponseEntity<Object> updateRegionCodeByOrder(@RequestBody JSONArray json) {
handheldService.updateRegionCodeByOrder(json);
return new ResponseEntity<>(HttpStatus.OK);
@ -122,8 +102,6 @@ public class HandheldController {
@PostMapping("/getUserOrDevice")
@Log("查询用户的关联设备")
@ApiOperation("查询用户的关联设备")
@SaIgnore
public ResponseEntity<Object> selectUserOrDeviceByUserId(@RequestBody JSONObject json) {
List<JSONObject> list = handheldService.selectUserOrDevice(json);
return new ResponseEntity<>(list,HttpStatus.OK);
@ -131,8 +109,6 @@ public class HandheldController {
@PostMapping("/deviceInLogin")
@Log("选择设备之后登录")
@ApiOperation("选择设备之后登录")
@SaIgnore
public ResponseEntity<Object> deviceInLogin(@RequestBody JSONObject json) {
JSONObject list = handheldService.deviceInLogin(json);
return new ResponseEntity<>(list,HttpStatus.OK);
@ -140,8 +116,6 @@ public class HandheldController {
@PostMapping("/getPointVehicle")
@Log("获取点位的载具号")
@ApiOperation("获取点位的载具号")
@SaIgnore
public ResponseEntity<Object> getVehicleByPoint(@RequestBody JSONObject json) {
String vehicleCode = handheldService.selectVehicleByPoint(json);
return new ResponseEntity<>(vehicleCode,HttpStatus.OK);
@ -149,12 +123,16 @@ public class HandheldController {
@PostMapping("/updateRouteStatus")
@Log("修改路线状态")
@SaIgnore
@ApiOperation("修改路线状态")
public ResponseEntity<Object> updateRouteStatus(@RequestBody JSONObject json) {
handheldService.updateRoute(json);
return new ResponseEntity<>(HttpStatus.OK);
}
@GetMapping("/isRouteLock")
@Log("路线是否锁定")
public ResponseEntity<Object> routeIsLock() {
return new ResponseEntity<>(handheldService.isLock(),HttpStatus.OK);
}
}

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/HandheldService.java

@ -101,4 +101,10 @@ public interface HandheldService {
* @param json
*/
void updateRoute(JSONObject json);
/**
* 路线是否锁定
* @return
*/
boolean isLock();
}

10
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/impl/HandheldServiceImpl.java

@ -614,5 +614,15 @@ public class HandheldServiceImpl implements HandheldService {
sysParamService.update(isConnectConnector1);
}
@Override
public boolean isLock() {
SysParamServiceImpl sysParamService = SpringContextHolder.getBean(SysParamServiceImpl.class);
Param isConnectConnector = sysParamService.findByCode(GeneralDefinition.ADD_ROUTE_DOOR);
if (Integer.parseInt(isConnectConnector.getValue()) == 0) {
return false;
}
return true;
}
}

42
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/sorting/service/impl/SortingServiceImpl.java

@ -55,6 +55,7 @@ public class SortingServiceImpl implements SortingService {
@Override
@Transactional(rollbackFor = Exception.class)
public Map createAgvTask(JSONObject jsonObject) {
log.info("sorting下发agv任务:{}", jsonObject);
try {
@ -75,6 +76,7 @@ public class SortingServiceImpl implements SortingService {
String vehicle_type = jsonObject.getString("vehicle_type");
//托盘上的堆垛信息
JSONArray jsonArray = JSONUtil.parseArray(jsonObject.get("pallet_detail"));
JSONArray jsonArray1 = JSONUtil.parseArray(jsonObject.get("pallet_detail2"));
SchBasePoint schBasePoint = iSchBasePointService.selectByPointCode(pointCode);
if (ObjectUtil.isEmpty(schBasePoint)) {
log.info("点位编码不存在:{}", pointCode);
@ -122,6 +124,10 @@ public class SortingServiceImpl implements SortingService {
taskParam.put("config_code", "SortingSMTTask");
connectorTask.apply(taskParam);
}
iSchBasePointService.update(new UpdateWrapper<SchBasePoint>()
.set("is_lock", true)
.set("remark", task_code)
.eq("point_code", pointCode));
} else if ("1".equals(vehicle_type)) {
//TODO:呼叫两个空笼框
if (SortingEnum.TASK_TYPE_ONE.getValue().equals(task_type) && SortingEnum.IS_EMPTY.getValue().equals(is_empty)) {
@ -130,10 +136,18 @@ public class SortingServiceImpl implements SortingService {
taskParam.put("config_code", "SortingTwoCNTTask");
taskParam.put("task_code", task_code + "A");
connectorTask.apply(taskParam);
iSchBasePointService.update(new UpdateWrapper<SchBasePoint>()
.set("is_lock", true)
.set("remark", task_code)
.eq("point_code", pointCode + "_01"));
taskParam.put("device_code", pointCode + "_02");
taskParam.put("task_seq", "2");
taskParam.put("task_code", task_code + "B");
connectorTask.apply(taskParam);
iSchBasePointService.update(new UpdateWrapper<SchBasePoint>()
.set("is_lock", true)
.set("remark", task_code)
.eq("point_code", pointCode + "_02"));
//TODO:将两个笼框放到线边库
} else if (SortingEnum.TASK_TYPE_TWO.getValue().equals(task_type) && SortingEnum.NOT_EMPTY.getValue().equals(is_empty)) {
if (StrUtil.isEmpty(jsonObject.getString("vehicle_code2"))) {
@ -144,23 +158,33 @@ public class SortingServiceImpl implements SortingService {
log.info("物料信息为空!");
return MapOf.of("status", 400, "msg", "物料信息为空!");
}
if (CollUtil.isEmpty(jsonArray1) || jsonArray1.size() < 1) {
log.info("第二个物料信息为空!");
return MapOf.of("status", 400, "msg", "第二个物料信息为空!");
}
taskParam.put("config_code", "SortingSMTTask");
taskParam.put("task_seq", "1");
taskParam.put("vehicle_code", jsonObject.getString("vehicle_code2"));
taskParam.put("device_code", pointCode + "_02");
taskParam.put("task_code", task_code + "B");
connectorTask.apply(taskParam);
taskParam.put("vehicle_code", vehicle_code);
taskParam.put("task_seq", "2");
taskParam.put("device_code", pointCode + "_01");
taskParam.put("task_code", task_code + "A");
connectorTask.apply(taskParam);
iSchBasePointService.update(new UpdateWrapper<SchBasePoint>()
.set("is_lock", true)
.set("remark", task_code)
.eq("point_code", pointCode + "_01"));
taskParam.put("task_seq", "1");
taskParam.put("vehicle_code", jsonObject.getString("vehicle_code2"));
taskParam.put("device_code", pointCode + "_02");
taskParam.put("task_code", task_code + "B");
taskParam.put("ext_data", jsonObject.put("pallet_detail",jsonArray1));
connectorTask.apply(taskParam);
iSchBasePointService.update(new UpdateWrapper<SchBasePoint>()
.set("is_lock", true)
.set("remark", task_code)
.eq("point_code", pointCode + "_02"));
}
}
iSchBasePointService.update(new UpdateWrapper<SchBasePoint>()
.set("is_lock", true)
.set("remark", task_code)
.eq("point_code", pointCode));
return MapOf.of("status", 200, "msg", "sucess");
} catch (Exception ex) {
log.info("sorting下发任务失败:{}", ex.getMessage());

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml

@ -41,7 +41,7 @@
and sch_base_point.can_vehicle_type = #{vehicle_type}
</if>
<if test="due_date != null and due_date != ''">
and sch_base_vehiclematerialgroup.due_date > #{due_date}
and #{due_date} > sch_base_vehiclematerialgroup.due_date
</if>
AND sch_base_vehiclematerialgroup.region_code = #{region_code}

3
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSMTTask.java

@ -93,6 +93,8 @@ public class PcOperationSMTTask extends AbstractTask {
SendMaterVo sendMaterVo1 = new SendMaterVo();
sendMaterVo1.setMaterial_qty(jsonObject.getInteger("material_qty"));
sendMaterVo1.setOrder_code(jsonObject.getString("order_code"));
sendMaterVo1.setDue_date(jsonObject.getString("due_date"));
sendMaterVo1.setRegion_code(jsonObject.getString("region_code"));
sendMaterVos.add(sendMaterVo1);
});
}
@ -110,7 +112,6 @@ public class PcOperationSMTTask extends AbstractTask {
schBaseVehiclematerialgroup.setOrder_code(smv.getOrder_code());
schBaseVehiclematerialgroup.setDue_date(smv.getDue_date());
schBaseVehiclematerialgroup.setHas_work(sendMaterVo.getHas_work());
schBaseVehiclematerialgroup.setCreate_name("Sorting");
schBaseVehiclematerialgroupService.create(schBaseVehiclematerialgroup);
});
}

3
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java

@ -40,6 +40,7 @@ import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.Comparator;
import java.util.List;
/**
@ -72,7 +73,7 @@ public class SortingSMTTask extends AbstractTask {
// 配置信息
SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>()
.eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE));
tasks.stream().sorted((task1, task2) -> Long.compare(getTime(task2.getCreate_time()), getTime(task1.getCreate_time())));
tasks.stream().sorted(Comparator.comparing(SchBaseTask::getAcs_trace_id));
for (SchBaseTask task : tasks) {
TaskUtils.setUpdateByAcs(task);
// 找起点

Loading…
Cancel
Save