Browse Source

fix: 修复与sorting交互问题

master
yanps 2 months ago
parent
commit
d9b995ad94
  1. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  2. 3
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/connector/service/dto/ConnectorDto.java
  3. 9
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/connector/service/impl/ConnectorToWmsServiceImpl.java
  4. 23
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/impl/HandheldServiceImpl.java
  5. 14
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java
  6. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java
  7. 9
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

@ -507,6 +507,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
//TODO:物料不存在
}
SchBaseVehiclematerialgroup schBaseVehiclematerialgroup = new SchBaseVehiclematerialgroup();
schBaseVehiclematerialgroup.setGroup_id(connectorDto.getID());
schBaseVehiclematerialgroup.setVehicle_code(connectorDto.getVehicle_code());
schBaseVehiclematerialgroup.setJob_name(connectorDto.getJobname());
schBaseVehiclematerialgroup.setMaterial_id(connectorDto.getProductID());

3
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/connector/service/dto/ConnectorDto.java

@ -15,7 +15,8 @@ public class ConnectorDto {
/**
* 数据ID
*/
private String id;
@SerializedName("iD")
private String ID;
/**
* 任务号
*/

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

@ -132,15 +132,14 @@ public class ConnectorToWmsServiceImpl implements ConnectorToWmsService {
Assert.noNullElements(jsonArray, "请求参数为空!");
List<ConnectorDto> connectorDtos = BeanUtil.copyToList(jsonArray, ConnectorDto.class);
for (ConnectorDto connectorDto : connectorDtos) {
if(StrUtil.isEmpty(connectorDto.getID())) throw new BadRequestException("物料id为null!");
SchBaseVehiclematerialgroup one = iSchBaseVehiclematerialgroupService.getOne(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class)
.eq(SchBaseVehiclematerialgroup::getJob_name, connectorDto.getJobname())
.eq(SchBaseVehiclematerialgroup::getMaterial_id, connectorDto.getProductID())
.eq(SchBaseVehiclematerialgroup::getOrder_code, connectorDto.getProductionOrder()));
.eq(SchBaseVehiclematerialgroup::getGroup_id, connectorDto.getID()));
if (ObjectUtil.isNotNull(one)) {
throw new BadRequestException("jobName:" + connectorDto.getJobname() + "orderCode:"
+ connectorDto.getProductionOrder() + "ProductID:" + connectorDto.getProductID() + "该物料信息已存在!");
throw new BadRequestException("id:" + connectorDto.getID() + "," + "该物料信息已存在!");
}
SchBaseVehiclematerialgroup schBaseVehiclematerialgroup = new SchBaseVehiclematerialgroup();
schBaseVehiclematerialgroup.setGroup_id(connectorDto.getID());
schBaseVehiclematerialgroup.setVehicle_code(connectorDto.getVehicle_code());
schBaseVehiclematerialgroup.setJob_name(connectorDto.getJobname());
schBaseVehiclematerialgroup.setMaterial_id(connectorDto.getProductID());

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

@ -203,13 +203,13 @@ public class HandheldServiceImpl implements HandheldService {
goShelves(schBasePoint, param, region_code, device_code, vehicle_code, connectorTask);
break;
case "2":
goWxOrNx(param, region_code, device_code, vehicle_code, connectorTask);
goWxOrNx(param, RegionEnum.NBJG.getRegion_code(), device_code, vehicle_code, connectorTask);
break;
case "3":
goWxOrNx(param, region_code, device_code, vehicle_code, connectorTask);
goWxOrNx(param, RegionEnum.WXJG.getRegion_code(), device_code, vehicle_code, connectorTask);
break;
case "4":
connectorBlanking(schBasePoint, param, region_code, device_code, vehicle_code, connectorTask);
connectorBlanking(param, RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), device_code, vehicle_code, connectorTask);
break;
default:
break;
@ -226,8 +226,21 @@ public class HandheldServiceImpl implements HandheldService {
* @param vehicle_code
* @param connectorTask
*/
private void connectorBlanking(SchBasePoint schBasePoint, JSONObject param, String region_code, String device_code, String vehicle_code, AbstractTask connectorTask) {
private void connectorBlanking(JSONObject param, String region_code, String device_code, String vehicle_code, AbstractTask connectorTask) {
JSONObject jo = new JSONObject();
jo.put("device_code", device_code);
jo.put("config_code", "ProcessingSMTTask");
jo.put("create_mode", GeneralDefinition.AUTO_CREATION);
jo.put("vehicle_code", vehicle_code);
jo.put("region_code", region_code);
param.put("target_region_code", region_code);
jo.put("ext_data", param);
connectorTask.apply(jo);
iSchBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, device_code)
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.set(SchBasePoint::getIs_lock, true)
.set(SchBasePoint::getVehicle_code, null));
}
/**

14
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java

@ -36,8 +36,8 @@ import java.util.Map;
import java.util.Set;
/**
* @description 服务实现
* @author lyd
* @description 服务实现
* @date 2023-05-16
**/
@Slf4j
@ -55,6 +55,7 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
@Autowired
private ISchBasePointService pointService;
@Override
public IPage<SchBaseVehiclematerialgroup> queryAll(SchBaseVehiclematerialgroupQuery whereJson, PageQuery page) {
IPage<SchBaseVehiclematerialgroup> pages = new Page<>(page.getPage() + 1, page.getSize());
@ -64,8 +65,7 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
.eq(StrUtil.isNotBlank(whereJson.getGroup_bind_material_status()), SchBaseVehiclematerialgroup::getGroup_bind_material_status, whereJson.getGroup_bind_material_status())
.eq(StrUtil.isNotBlank(whereJson.getRegion_code()), SchBaseVehiclematerialgroup::getRegion_code, whereJson.getRegion_code()));
schBaseVehiclematerialgroupIPage.getRecords().forEach(item -> {
if(StrUtil.isNotBlank(item.getMaterial_id()))
{
if (StrUtil.isNotBlank(item.getMaterial_id())) {
MdBaseMaterial mdBaseMaterial = iMdBaseMaterialService.getOne(Wrappers.lambdaQuery(MdBaseMaterial.class)
.eq(MdBaseMaterial::getMaterial_code, item.getMaterial_id()));
if (ObjectUtil.isNotEmpty(mdBaseMaterial)) {
@ -74,8 +74,7 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
item.setMaterial_code(mdBaseMaterial.getMaterial_code());
}
}
if(StrUtil.isNotBlank(item.getRegion_code()))
{
if (StrUtil.isNotBlank(item.getRegion_code())) {
item.setRegion_name(pointService.list(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getRegion_code, item.getRegion_code())).get(0).getRegion_name());
}
});
@ -88,11 +87,10 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
if(StringUtils.isNotBlank(entity.getPoint_code()))
{
if (StringUtils.isNotBlank(entity.getPoint_code())) {
entity.setRegion_code(pointService.getById(entity.getPoint_code()).getRegion_code());
}
entity.setGroup_id(IdUtil.getSnowflake(1,1).nextIdStr());
entity.setGroup_id(StrUtil.isNotEmpty(entity.getGroup_id()) ? entity.getGroup_id() : IdUtil.getSnowflake(1, 1).nextIdStr());
entity.setCreate_id(currentUserId);
entity.setCreate_name(nickName);
entity.setCreate_time(now);

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java

@ -75,6 +75,8 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
private final Object lock = new Object();
private final Object lock2 = new Object();
@Override
public IPage<SchBasePoint> queryAll(Map whereJson, PageQuery page) {
@ -249,6 +251,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
@Override
@Transactional(rollbackFor = Exception.class)
public SchBasePoint selectByRegionCode(String region_code, String vehicleCode, String piont_type) {
synchronized (lock2) {
//查询载具的类型
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.getById(vehicleCode);
if (ObjectUtil.isEmpty(mdBaseVehicle)) throw new BadRequestException("载具类型不存在!");
@ -286,6 +289,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
}
return null;
}
}
@Override
public SchBasePoint selectByPointCode(String start_device_code) {

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

@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -96,15 +97,19 @@ public class SortingSMTTask extends AbstractTask {
String workorder = jO.getString("ProductionOrder");
String ProductID = jO.getString("ProductID");
Integer qty = jO.getInteger("Currentqty");
String vehicle_code = jO.getString("vehicle_code");
String Jobname = jO.getString("Jobname");
String dueDate = jO.getString("DueDate");
String region_code = jO.getString("NextOperation");
SchBaseVehiclematerialgroup schBaseVehiclematerialgroup = new SchBaseVehiclematerialgroup();
schBaseVehiclematerialgroup.setVehicle_code(vehicle_code);
schBaseVehiclematerialgroup.setVehicle_code(task.getVehicle_code());
schBaseVehiclematerialgroup.setPoint_code(schBasePoint.getPoint_code());
schBaseVehiclematerialgroup.setMaterial_id(ProductID);
schBaseVehiclematerialgroup.setMaterial_qty(qty);
schBaseVehiclematerialgroup.setRegion_code(region_code);
schBaseVehiclematerialgroup.setOrder_code(workorder);
schBaseVehiclematerialgroup.setJob_name(Jobname);
schBaseVehiclematerialgroup.setDue_date(dueDate);
schBaseVehiclematerialgroup.setExtend(JSON.toJSONString(jO));
schBaseVehiclematerialgroupService.create(schBaseVehiclematerialgroup);
}

Loading…
Cancel
Save