Browse Source

rev:手持

modbus_client
gengby 9 months ago
parent
commit
e1edf3e831
  1. 2
      acs/nladmin-system/src/main/java/org/nl/hand/amb/rest/HFHandController.java
  2. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java
  3. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java
  4. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/PdaService.java
  5. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/BindVehicleDto.java
  6. 9
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.java
  7. 20
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.xml
  8. 61
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java
  9. 11
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java
  10. 3
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java

2
acs/nladmin-system/src/main/java/org/nl/hand/amb/rest/HFHandController.java

@ -27,7 +27,7 @@ import java.util.Map;
@RestController
@RequiredArgsConstructor
@Api(tags = "手持接口")
@RequestMapping("/api/hand")
@RequestMapping("/api/pda")
@Slf4j
public class HFHandController {
private final HFHandService handService;

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

@ -271,7 +271,6 @@ public class WmsToMesServiceImpl implements WmsToMesService {
gdyMaterialInDto.setFCONVERTRATE(mesWorkOrderDto.getFCONVERTRATE());
gdyMaterialInDto.setSTOCK("未知");
gdyMaterialInDto.setDEVICE(GeneralDefinition.YES);
gdyMaterialInDto.setIN_DATE(vehiclematerialgroup.getInto_kiln_time());
gdyMaterialInDto.setCREATE_TM(DateUtil.now());
gdyMaterialInDto.setOP_FLAG(GeneralDefinition.NO);
log.info("入窑数据:{}", gdyMaterialInDto);
@ -314,7 +313,6 @@ public class WmsToMesServiceImpl implements WmsToMesService {
gdyMaterialOutDto.setFCONVERTRATE(mesWorkOrderDto.getFCONVERTRATE());
gdyMaterialOutDto.setSTOCK("未知");
gdyMaterialOutDto.setDEVICE("1");
gdyMaterialOutDto.setOUT_DATE(vehiclematerialgroup.getOut_kiln_time());
gdyMaterialOutDto.setCREATE_TM(DateUtil.now());
gdyMaterialOutDto.setOP_FLAG(GeneralDefinition.NO);

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java

@ -78,6 +78,12 @@ public class PdaController {
return new ResponseEntity<>(pdaService.link(requestParam), HttpStatus.OK);
}
@PostMapping("/queryExistGroup")
@Log("查询已配盘的组盘信息")
public ResponseEntity<Object> queryExistGroup() {
return new ResponseEntity<>(pdaService.queryExistGroup(), HttpStatus.OK);
}
@PostMapping("/fullVehicleIn")
@Log("入库")
public ResponseEntity<PdaResponseVo> fullVehicleIn(@Validated @RequestBody CommonPointQueryDto requestParam) {

7
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/PdaService.java

@ -379,4 +379,11 @@ public interface PdaService {
List<RegionVo> queryDevice();
PdaResponseVo taskConfirm(FullVehicleOutDto requestParam);
/**
* 查询已配盘的组盘信息
*
* @return
*/
List<VehicleLinkVo> queryExistGroup();
}

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/BindVehicleDto.java

@ -10,5 +10,6 @@ import lombok.Data;
@Data
public class BindVehicleDto {
private String point_code;
private String vehicle_type;
private String vehicle_code;
}

9
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.java

@ -22,7 +22,6 @@ public interface PdaMapper {
List<VehicleLinkVo> queryVehicleGroup();
List<DropdownListVo> getDeviceInfo();
/**
@ -97,5 +96,11 @@ public interface PdaMapper {
List<RequestMaterialInfoVo> requestInfo();
/**
* 查询已经配盘的组盘信息
* 可用于入库或打印
*
* @return
*/
List<VehicleLinkVo> queryExistGroup();
}

20
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.xml

@ -191,4 +191,24 @@
WHERE pr.is_delete = false
ORDER BY pr.create_time ASC
</select>
<select id="queryExistGroup" resultType="org.nl.wms.pda.service.dao.vo.VehicleLinkVo">
select g.group_id,
g.material_id,
m.material_code,
m.material_name,
g.point_code,
g.vehicle_code,
d.label as vehicle_type,
g.material_qty,
g.pcsn
from `sch_base_vehiclematerialgroup` g
left join md_base_material m
on g.material_id = m.material_id
left join `sys_dict` d
on d.`value` = g.vehicle_type
where d.`code` = 'vehicle_type'
and link_status = '1'
and group_status = '2'
and group_bind_material_status = '2'
</select>
</mapper>

61
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java

@ -92,13 +92,35 @@ public class PdaServiceImpl implements PdaService {
return pdaMapper.queryVehicleGroup();
}
@Override
public List<VehicleLinkVo> queryExistGroup() {
List<VehicleLinkVo> vehicleLinkVoList = pdaMapper.queryExistGroup();
Iterator<VehicleLinkVo> iterator = vehicleLinkVoList.iterator();
while (iterator.hasNext()) {
VehicleLinkVo vehicleLinkVo = iterator.next();
String point_code = vehicleLinkVo.getPoint_code();
SchBasePoint point = pointService.getById(point_code);
if (ObjectUtil.isEmpty(point) || !point.getRegion_code().equals(RegionEnum.ZP.getRegion_code())) {
iterator.remove();
}
}
return vehicleLinkVoList;
}
@Override
@Transactional(rollbackFor = Exception.class)
public PdaResponseVo manualCreateByPda(ManualGroupDto entity) {
Assert.notNull(entity, "参数不能为空!");
SchBaseVehiclematerialgroup groupInfo = vehiclematerialgroupService.getGroupInfo(entity.getVehicle_code(),
entity.getVehicle_type(), GroupBindMaterialStatusEnum.BOUND.getValue());
Assert.isFalse(ObjectUtil.isNotEmpty(groupInfo), "组盘信息已存在");
Assert.isFalse(ObjectUtil.isNotEmpty(groupInfo), "组盘信息(载具编码)已存在");
LambdaQueryWrapper<SchBaseVehiclematerialgroup> lqw = new LambdaQueryWrapper<>();
lqw.eq(SchBaseVehiclematerialgroup::getPoint_code, entity.getPoint_code())
.eq(SchBaseVehiclematerialgroup::getGroup_bind_material_status, GroupBindMaterialStatusEnum.BOUND.getValue());
SchBaseVehiclematerialgroup one = vehiclematerialgroupService.getOne(lqw);
if (ObjectUtil.isNotEmpty(one)) {
throw new BadRequestException("该点位已存在组盘信息!");
}
// 获取点位
SchBasePoint basePoint = pointService.getById(entity.getPoint_code());
// 获取物料
@ -256,7 +278,7 @@ public class PdaServiceImpl implements PdaService {
.eq(SchBasePoint::getPoint_status, PointStatusEnum.EMPTY_POINT.getCode());
SchBasePoint point = pointService.getOne(lqw);
if (ObjectUtil.isEmpty(point)) {
throw new BadRequestException("点位:" + requestParam.getPoint_code() + "状态不为空位!");
throw new BadRequestException("点位:" + requestParam.getPoint_code() + "不存咋或点位状态不为空位!");
}
if (!RegionEnum.ZP.getRegion_code().equals(point.getRegion_code())) {
throw new BadRequestException("点位:" + requestParam.getPoint_code() + "不属于组盘区域,无法进行空托盘入库!");
@ -276,7 +298,9 @@ public class PdaServiceImpl implements PdaService {
@Override
public List<VehicleLinkVo> queryLinkMaterial(MaterialQueryDto requestParam) {
Assert.notNull(requestParam, "参数不能为空!");
Assert.notBlank(requestParam.getMaterial_id(), "物料ID不能为空!");
if (StrUtil.isEmpty(requestParam.getMaterial_id())) {
return new ArrayList<>();
}
MdBaseMaterial material = materialService.getById(requestParam.getMaterial_id());
Assert.notNull(material, "物料信息有误!未查询出对应的物料信息,物料编码:" + requestParam.getMaterial_code());
LambdaQueryWrapper<SchBaseVehiclematerialgroup> lqw = new LambdaQueryWrapper<>();
@ -315,7 +339,11 @@ public class PdaServiceImpl implements PdaService {
Assert.notBlank(requestParam.getPoint_code1(), "起始点位不能为空!");
Assert.notNull(pointService.getById(requestParam.getPoint_code1()), requestParam.getPoint_code1() + ",对应的点位信息不存在!");
Assert.notBlank(requestParam.getPoint_code2(), "出库点位不能为空!");
Assert.notNull(pointService.getById(requestParam.getPoint_code2()), requestParam.getPoint_code2() + ",对应的点位信息不存在!");
SchBasePoint point2 = pointService.getById(requestParam.getPoint_code2());
Assert.notNull(point2, requestParam.getPoint_code2() + ",对应的点位信息不存在!");
if (!point2.getPoint_status().equals(PointStatusEnum.EMPTY_POINT.getCode())) {
throw new BadRequestException("出库点位不为空位!");
}
JSONObject param = new JSONObject();
param.put("device_code", requestParam.getPoint_code1());
param.put("device_code2", requestParam.getPoint_code2());
@ -339,11 +367,12 @@ public class PdaServiceImpl implements PdaService {
if (ObjectUtil.isEmpty(vehiclematerialgroup)) {
return new VehicleLinkVo();
}
MdBaseMaterial material = materialService.getById(vehiclematerialgroup.getMaterial_id());
VehicleLinkVo vo = new VehicleLinkVo();
vo.setPoint_code(vehiclematerialgroup.getPoint_code());
vo.setMaterial_id(vehiclematerialgroup.getMaterial_id());
vo.setMaterial_code(vehiclematerialgroup.getMaterial_code());
vo.setMaterial_name(vehiclematerialgroup.getMaterial_name());
vo.setMaterial_code(material.getMaterial_code());
vo.setMaterial_name(material.getMaterial_name());
vo.setPcsn(vehiclematerialgroup.getPcsn());
vo.setMaterial_qty(vehiclematerialgroup.getMaterial_qty());
return vo;
@ -446,12 +475,19 @@ public class PdaServiceImpl implements PdaService {
@Override
public List<PointVo> queryEndPointsByStart(FullVehicleOutDto requestParam) {
Assert.notNull(requestParam, "请求参数不能为空!");
Assert.notBlank(requestParam.getPoint_code1(), "当前点位不能为空!");
if (StrUtil.isEmpty(requestParam.getPoint_code1())) {
return new ArrayList<>();
}
//Assert.notBlank(requestParam.getPoint_code1(), "当前点位不能为空!");
SchBasePoint point = pointService.getById(requestParam.getPoint_code1());
Assert.notNull(point, requestParam.getPoint_code1() + "对应的点位信息不存在!");
if (ObjectUtil.isEmpty(point)) {
return new ArrayList<>();
}
// Assert.notNull(point, requestParam.getPoint_code1() + "对应的点位信息不存在!");
List<String> regions = Arrays.asList(RegionEnum.ZP.getRegion_code(), RegionEnum.JLHC.getRegion_code(), RegionEnum.YCL.getRegion_code());
if (regions.contains(point.getRegion_code())) {
throw new BadRequestException("当前点位信息有误,请检查该点位是否为任务流传所属区域!");
return new ArrayList<>();
//throw new BadRequestException("当前点位信息有误,请检查该点位是否为任务流传所属区域!");
}
List<PointVo> list = new ArrayList<>();
if (StrUtil.isEmpty(point.getNext_point_code())) {
@ -494,8 +530,8 @@ public class PdaServiceImpl implements PdaService {
.eq(SchBaseVehiclematerialgroup::getLink_status, LinkStatusEnum.LINK_FINISH.getType());
SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getOne(lqw);
if (ObjectUtil.isNotEmpty(vehiclematerialgroup)) {
vehiclematerialgroup.setPoint_code(null);
vehiclematerialgroup.setPoint_name(null);
vehiclematerialgroup.setPoint_code("");
vehiclematerialgroup.setPoint_name("");
vehiclematerialgroupService.update(vehiclematerialgroup);
}
SchBasePoint point = pointService.getById(requestParam.getPoint_code());
@ -530,6 +566,7 @@ public class PdaServiceImpl implements PdaService {
}
point.setPoint_status(point_status);
point.setVehicle_code(requestParam.getVehicle_code());
point.setVehicle_type(requestParam.getVehicle_type());
point.setVehicle_qty(1);
pointService.update(point);
return PdaResponseVo.pdaResultOk("绑定成功");
@ -589,6 +626,7 @@ public class PdaServiceImpl implements PdaService {
return PdaResponseVo.pdaResultOk("创建定点任务请求成功");
}
@Override
public List<PointVo> copyPointVoList(List<SchBasePoint> list) {
List<PointVo> pointVoList = new ArrayList<>();
@ -696,7 +734,6 @@ public class PdaServiceImpl implements PdaService {
throw new BadRequestException("请选择需要设置静置的料盅!");
}
SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(forcedRestingDto.getGroup_id());
vehiclematerialgroup.setStanding_time(forcedRestingDto.getStand_time());
vehiclematerialgroupService.updateById(vehiclematerialgroup);
return PdaResponseVo.pdaResultOk("设置静置时长完成");
}

11
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java

@ -52,20 +52,13 @@ public class SchBaseVehiclematerialgroup implements Serializable {
private Boolean is_full;
private Boolean is_firing;
private String pcsn;
private String mix_times;
private String instorage_time;
private Integer standing_time;
private String material_qty;
@ -147,10 +140,6 @@ public class SchBaseVehiclematerialgroup implements Serializable {
private String update_time;
private String out_kiln_time;
private String into_kiln_time;
@TableField(exist = false)
private String material_name;

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

@ -67,9 +67,6 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
entity.setUpdate_id(currentUserId);
entity.setUpdate_name(nickName);
entity.setUpdate_time(now);
if (ObjectUtil.isNotEmpty(entity.getOut_kiln_time())) {
entity.setIs_firing(true);
}
vehiclematerialgroupMapper.insert(entity);
}

Loading…
Cancel
Save