|
|
@ -29,10 +29,13 @@ import org.nl.wms.sch.task.service.ISchBaseTaskService; |
|
|
|
import org.nl.wms.sch.task_manage.GeneralDefinition; |
|
|
|
import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; |
|
|
|
import org.nl.wms.sch.task_manage.enums.GroupStatusEnum; |
|
|
|
import org.nl.wms.sch.task_manage.enums.PointStatusEnum; |
|
|
|
import org.nl.wms.sch.task_manage.enums.WorkOrderStatusEnum; |
|
|
|
import org.nl.wms.util.PointUtils; |
|
|
|
import org.nl.wms.util.TaskUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
@ -64,7 +67,7 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
@Override |
|
|
|
public List<DropdownListVo> getDeviceInfo() { |
|
|
|
// 暂定压机区域
|
|
|
|
return pdaMapper.getDeviceInfo(); |
|
|
|
return pdaMapper.getAllPoint(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -225,6 +228,7 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
SchBasePoint rgcdw01 = pointService.getById("RGCDW01"); |
|
|
|
param.put("vehicle_code", rgcdw01.getVehicle_code()); |
|
|
|
param.put("vehicle_type", GeneralDefinition.STEEL_TRAY); |
|
|
|
param.put("user_id", "1"); |
|
|
|
taskService.apply(param); |
|
|
|
return PdaResponseVo.pdaResultOk("空盘入库请求成功"); |
|
|
|
} |
|
|
@ -241,6 +245,7 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
JSONObject param = new JSONObject(); |
|
|
|
param.put("device_code", "RGMDW01"); |
|
|
|
param.put("config_code", "FJQKTask"); |
|
|
|
param.put("user_id", "1"); |
|
|
|
taskService.apply(param); |
|
|
|
return PdaResponseVo.pdaResultOk("呼叫木托盘请求成功"); |
|
|
|
} |
|
|
@ -257,6 +262,7 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
JSONObject param = new JSONObject(); |
|
|
|
param.put("device_code", "RGCDW01"); |
|
|
|
param.put("config_code", "FJQLTask"); |
|
|
|
param.put("user_id", "1"); |
|
|
|
taskService.apply(param); |
|
|
|
return PdaResponseVo.pdaResultOk("呼叫物料请求成功"); |
|
|
|
} |
|
|
@ -276,6 +282,7 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
param.put("qty", manualResidueInDto.getQty()); |
|
|
|
param.put("vehicle_code", manualResidueInDto.getVehicle_code()); |
|
|
|
param.put("vehicle_qty", "1"); |
|
|
|
param.put("user_id", "1"); |
|
|
|
taskService.apply(param); |
|
|
|
return PdaResponseVo.pdaResultOk("剩料入库请求成功"); |
|
|
|
} |
|
|
@ -295,6 +302,7 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
param.put("qty", manualResidueInDto.getQty()); |
|
|
|
param.put("vehicle_code", manualResidueInDto.getVehicle_code()); |
|
|
|
param.put("vehicle_qty", "1"); |
|
|
|
param.put("user_id", "1"); |
|
|
|
taskService.apply(param); |
|
|
|
return PdaResponseVo.pdaResultOk("包装入库请求成功"); |
|
|
|
} |
|
|
@ -325,4 +333,79 @@ public class PdaServiceImpl implements PdaService { |
|
|
|
vehicleBindingService.save(vehicleBinding); |
|
|
|
return PdaResponseVo.pdaResultOk("载具绑定成功!"); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public PdaResponseVo pressTask(PressMoveDto pressMoveDto) { |
|
|
|
JSONObject param = (JSONObject) JSONObject.toJSON(pressMoveDto); |
|
|
|
param.put("user_id", "1"); |
|
|
|
param.put("config_code", "YZMLTask"); |
|
|
|
taskService.apply(param); |
|
|
|
return PdaResponseVo.pdaResultOk("压机入库请求成功"); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<MaterialInfoVo> materialQuery(CommonQueryDto commonQueryDto) { |
|
|
|
return pdaMapper.materialQuery(commonQueryDto); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public PdaResponseVo updateData(ShelfSaveDto shelfSaveDto) { |
|
|
|
// 货位号填充HCHJ+***
|
|
|
|
String pointCode = "HCHJ" + String.format("%03d", Integer.parseInt(shelfSaveDto.getPoint_code())); |
|
|
|
// 获取点位
|
|
|
|
shelfSaveDto.setPoint_code(pointCode); |
|
|
|
SchBasePoint basePoint = pointService.getById(shelfSaveDto.getPoint_code()); |
|
|
|
basePoint.setPoint_status(shelfSaveDto.getPoint_status()); |
|
|
|
PointUtils.setUpdateByPC(basePoint); |
|
|
|
if (shelfSaveDto.getPoint_status().equals(PointStatusEnum.EMPTY_POINT.getCode())) { |
|
|
|
// 空位
|
|
|
|
PointUtils.clearPoint(basePoint); |
|
|
|
return PdaResponseVo.pdaResultOk("货位情况成功"); |
|
|
|
} else if (shelfSaveDto.getPoint_status().equals(PointStatusEnum.FULL_POINT.getCode())){ |
|
|
|
// 设置物料
|
|
|
|
toSaveGroupMaterial(shelfSaveDto);// 保存组盘
|
|
|
|
basePoint.setVehicle_code(shelfSaveDto.getVehicle_code()); |
|
|
|
basePoint.setVehicle_type(GeneralDefinition.STEEL_TRAY); |
|
|
|
basePoint.setVehicle_qty(1); |
|
|
|
} |
|
|
|
pointService.updateById(basePoint); |
|
|
|
return PdaResponseVo.pdaResultOk("组盘成功"); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<DropdownListVo> pressPointList() { |
|
|
|
return pdaMapper.getAllPressPoint(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 保存组盘信息 |
|
|
|
* @param shelfSaveDto |
|
|
|
*/ |
|
|
|
private void toSaveGroupMaterial(ShelfSaveDto shelfSaveDto) { |
|
|
|
MdBaseMaterial material = materialService.getById(shelfSaveDto.getMaterial_id()); |
|
|
|
SchBasePoint basePoint = pointService.getById(shelfSaveDto.getPoint_code()); |
|
|
|
if (ObjectUtil.isEmpty(material)) { |
|
|
|
throw new BadRequestException("物料信息不存在"); |
|
|
|
} |
|
|
|
SchBaseVehiclematerialgroup group = new SchBaseVehiclematerialgroup(); |
|
|
|
group.setGroup_id(IdUtil.getSnowflake(1,1).nextIdStr()); |
|
|
|
group.setMaterial_qty(Integer.valueOf(shelfSaveDto.getMaterial_qty())); |
|
|
|
group.setMaterial_id(shelfSaveDto.getMaterial_id()); |
|
|
|
group.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); |
|
|
|
group.setVehicle_code(shelfSaveDto.getVehicle_code()); |
|
|
|
group.setVehicle_type(GeneralDefinition.STEEL_TRAY); |
|
|
|
group.setPoint_code(basePoint.getPoint_code()); // 对接位
|
|
|
|
group.setPoint_name(basePoint.getPoint_name()); |
|
|
|
group.setSource_vehicle_code(basePoint.getPoint_code()); |
|
|
|
group.setMove_way(basePoint.getPoint_code()); |
|
|
|
group.setPcsn(DateUtil.format(DateUtil.date(), "yyyyMMdd")); |
|
|
|
group.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。
|
|
|
|
group.setIs_delete(false); |
|
|
|
group.setIs_full(true); |
|
|
|
group.setCreate_id(SecurityUtils.getCurrentUserId()); |
|
|
|
group.setCreate_name(SecurityUtils.getCurrentNickName()); |
|
|
|
group.setCreate_time(DateUtil.now()); |
|
|
|
vehiclematerialgroupService.save(group); |
|
|
|
} |
|
|
|
} |
|
|
|