rev: 手持功能接口、看板接口
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package org.nl;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
|
||||
import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
|
||||
import com.alicp.jetcache.anno.config.EnableMethodCache;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -9,7 +8,6 @@ import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
|
||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
|
||||
@@ -40,7 +38,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
public class AppRun {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
SpringApplication.run(AppRun.class, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +165,6 @@ public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice
|
||||
List<SysNotice> sysNotices = sysNoticeMapper.selectList(new LambdaQueryWrapper<SysNotice>()
|
||||
.eq(SysNotice::getNotice_title, title)
|
||||
.eq(SysNotice::getHave_read, NoticeEnum.HAVE_READ_OFF.getValue()));
|
||||
if (ObjectUtil.isNotEmpty(sysNotices)) return;
|
||||
SysNotice noticeDto = SysNotice.builder()
|
||||
.notice_id(IdUtil.getSnowflake(1, 1).nextIdStr())
|
||||
.notice_type(type)
|
||||
@@ -175,8 +174,11 @@ public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice
|
||||
.have_read(NoticeEnum.HAVE_READ_OFF.getValue())
|
||||
.create_time(DateUtil.now())
|
||||
.build();
|
||||
// 插入
|
||||
sysNoticeMapper.insert(noticeDto);
|
||||
if (ObjectUtil.isNotEmpty(sysNotices)) {
|
||||
noticeDto.setNotice_id(sysNotices.get(0).getNotice_id());
|
||||
}
|
||||
// 插入/修改
|
||||
this.saveOrUpdate(noticeDto);
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("data", "notice_message_update");
|
||||
SocketMsg messageInfo = new SocketMsg(res, MsgType.INFO);
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
w.plan_qty,
|
||||
w.real_qty,
|
||||
w.unqualified_qty,
|
||||
((w.qualified_qty / w.plan_qty) * 100) AS qualified_rate,
|
||||
FORMAT((w.qualified_qty / w.plan_qty) * 100, 1) AS qualified_rate,
|
||||
CASE w.workorder_status
|
||||
WHEN '1' THEN '未生产'
|
||||
WHEN '2' THEN '已下发'
|
||||
@@ -60,6 +60,7 @@
|
||||
FROM
|
||||
`pdm_bd_workorder` w
|
||||
LEFT JOIN md_base_material m ON m.material_id = w.material_id
|
||||
WHERE w.region_code = 'YZ'
|
||||
ORDER BY w.team DESC, w.workorder_status
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -85,16 +85,22 @@ public class MdBaseMaterial implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "外部时间")
|
||||
private String ext_time;
|
||||
|
||||
@ApiModelProperty(value = "物料型号")
|
||||
private String material_model;
|
||||
|
||||
@ApiModelProperty(value = "物料单重")
|
||||
private String single_weight;
|
||||
|
||||
@ApiModelProperty(value = "A")
|
||||
private String a_long_side;
|
||||
|
||||
@ApiModelProperty(value = "B")
|
||||
private String b_short_side;
|
||||
|
||||
@ApiModelProperty(value = "H")
|
||||
private String h_height;
|
||||
|
||||
@ApiModelProperty(value = "W")
|
||||
private String w_thickness;
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ import org.nl.wms.ext.mes.service.dto.MesMudConsumptionDto;
|
||||
import org.nl.wms.ext.mms.service.WmsToMmsService;
|
||||
import org.nl.wms.ext.record.service.ISysInteractRecordService;
|
||||
import org.nl.wms.pdm.consumption.service.IPdmBdMudConsumptionService;
|
||||
import org.nl.wms.pdm.consumption.service.dao.PdmBdMudConsumption;
|
||||
import org.nl.wms.pdm.record.service.IPdmBdRequestMaterialRecordService;
|
||||
import org.nl.wms.pdm.record.service.dao.PdmBdRequestMaterialRecord;
|
||||
import org.nl.wms.pdm.residue.service.IPdmBdMaterialResidueService;
|
||||
@@ -595,7 +594,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
mesMudConsumptionDto.setPWORKSCHE_ID(productionTask.getWorkorder_code());
|
||||
mesMudConsumptionDto.setOUT_FINNUM(one.getMaterial_weight());
|
||||
mesMudConsumptionDto.setPRESSUNIT(devicePoint.getExt_point_code());
|
||||
mesMudConsumptionDto.setFBAGCODE("吨袋号未设置");
|
||||
mesMudConsumptionDto.setFBAGCODE(one.getExt_data());
|
||||
mesMudConsumptionDto.setLOGT("仓库未知");
|
||||
mesMudConsumptionDto.setSENDTIM(DateUtil.now());
|
||||
mesMudConsumptionDto.setCREATE_TM(DateUtil.now());
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -53,12 +54,19 @@ public class WmsToMesServiceImpl implements WmsToMesService {
|
||||
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService;
|
||||
@Autowired
|
||||
private ISysNoticeService noticeService;
|
||||
|
||||
@Override
|
||||
public void reportMudConsumption(MesMudConsumptionDto mudObject) {
|
||||
log.info("上报mes消耗泥料记录的信息: {}", mudObject);
|
||||
// 请求mes插入mes数据库
|
||||
// todo: 注意防止重复上报
|
||||
mesRequestMapper.insertMudConsumptionInfo(mudObject);
|
||||
try {
|
||||
mesRequestMapper.insertMudConsumptionInfo(mudObject);
|
||||
} catch (Exception e) {
|
||||
log.error("上报mes消耗泥料记录失败:{}", e.getMessage());
|
||||
// todo:发送通知
|
||||
noticeService.createNotice("上报mes消耗泥料数据失败", "消耗泥料数据" + mudObject.getPWORKSCHE_ID(),
|
||||
NoticeTypeEnum.EXCEPTION.getCode());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -105,6 +113,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
|
||||
}
|
||||
|
||||
@Override
|
||||
// @DSTransactional
|
||||
public void reportProductData(String groupId) {
|
||||
log.info("压机产出数据记录");
|
||||
// 获取组盘信息
|
||||
@@ -117,7 +126,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
|
||||
log.info("获取MES给的工单数据:{}", mesWorkOrderDto);
|
||||
SchBasePoint basePoint = pointService.getById(workorder.getPoint_code());
|
||||
MesProductDataDto mesProductDataDto = new MesProductDataDto();
|
||||
mesProductDataDto.setMSGID(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
mesProductDataDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
mesProductDataDto.setFORDER_NO(mesWorkOrderDto.getFORDER_NO());
|
||||
mesProductDataDto.setPWORKSCHE_ID(mesWorkOrderDto.getPWORKSCHE_ID());
|
||||
mesProductDataDto.setFPRODUCT_MATERIAL_ID(mesWorkOrderDto.getFPRODUCT_MATERIAL_ID());
|
||||
@@ -131,7 +140,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
|
||||
mesProductDataDto.setPRO_SUBNUM(BigDecimal.valueOf(vehiclematerialgroup.getMaterial_qty()));// 数量
|
||||
mesProductDataDto.setPRO_SUBUNIT("块");
|
||||
mesProductDataDto.setCHECKERIN_TIM(DateUtil.now());
|
||||
mesProductDataDto.setPRODATE(ObjectUtil.isNotEmpty(workorder.getProduce_date())?workorder.getProduce_date():DateUtil.now());
|
||||
mesProductDataDto.setPRODATE(ObjectUtil.isNotEmpty(workorder.getProduce_date()) ? workorder.getProduce_date() : DateUtil.now());
|
||||
mesProductDataDto.setCREATE_TM(DateUtil.now());
|
||||
mesProductDataDto.setOP_FLAG(GeneralDefinition.NO);
|
||||
log.info("压机产出返给MES的数据:{}", mesProductDataDto);
|
||||
@@ -140,8 +149,8 @@ public class WmsToMesServiceImpl implements WmsToMesService {
|
||||
mesRequestMapper.insertProductData(mesProductDataDto);
|
||||
} catch (Exception e) {
|
||||
log.error("反馈压机产出插入mes数据库失败:{}", e.getMessage());
|
||||
// todo:发送通知
|
||||
noticeService.createNotice("反馈压机产出插入mes数据库失败", "压机产出"+mesProductDataDto.getMSGID(),
|
||||
// 发送通知
|
||||
noticeService.createNotice("反馈压机产出插入mes数据库失败", "压机产出" + mesProductDataDto.getPRESSUNIT(),
|
||||
NoticeTypeEnum.EXCEPTION.getCode());
|
||||
}
|
||||
}
|
||||
@@ -158,7 +167,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
|
||||
MesWorkOrderDto mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class);
|
||||
log.info("获取MES给的工单数据:{}", mesWorkOrderDto);
|
||||
MesSemiProductionInfoInDto semiProductionInfoInDto = new MesSemiProductionInfoInDto();
|
||||
semiProductionInfoInDto.setMSGID(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
semiProductionInfoInDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
semiProductionInfoInDto.setFORDER_NO(mesWorkOrderDto.getFORDER_NO());
|
||||
semiProductionInfoInDto.setPRESSUNIT(mesWorkOrderDto.getPRESSUNIT());
|
||||
semiProductionInfoInDto.setFSCHEDULE_ID(mesWorkOrderDto.getFSCHEDULE_ID());
|
||||
@@ -200,7 +209,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
|
||||
MesWorkOrderDto mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class);
|
||||
log.info("获取MES给的工单数据:{}", mesWorkOrderDto);
|
||||
MesSemiProductionInfoOutDto semiProductionInfoOutDto = new MesSemiProductionInfoOutDto();
|
||||
semiProductionInfoOutDto.setMSGID(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
semiProductionInfoOutDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
semiProductionInfoOutDto.setSEMIPRODUCT_BATCHNO(workorder.getBatch_no());
|
||||
semiProductionInfoOutDto.setPRODUCT_BATCHNO(workorder.getBatch_no());
|
||||
semiProductionInfoOutDto.setFPRODUCT_MATERIAL_ID(mesWorkOrderDto.getFPRODUCT_MATERIAL_ID());
|
||||
@@ -239,7 +248,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
|
||||
MesWorkOrderDto mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class);
|
||||
log.info("获取MES给的工单数据:{}", mesWorkOrderDto);
|
||||
MesGdyMaterialInDto gdyMaterialInDto = new MesGdyMaterialInDto();
|
||||
gdyMaterialInDto.setMSGID(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
gdyMaterialInDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
gdyMaterialInDto.setTRAY_NO(vehiclematerialgroup.getVehicle_code());
|
||||
gdyMaterialInDto.setFPRODUCT_MATERIAL_ID(mesWorkOrderDto.getFPRODUCT_MATERIAL_ID());
|
||||
gdyMaterialInDto.setFPRODUCT_MATERIAL_NAME(mesWorkOrderDto.getFPRODUCT_MATERIAL_NAME());
|
||||
@@ -279,7 +288,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
|
||||
MesWorkOrderDto mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class);
|
||||
log.info("获取MES给的工单数据:{}", mesWorkOrderDto);
|
||||
MesGdyMaterialOutDto gdyMaterialOutDto = new MesGdyMaterialOutDto();
|
||||
gdyMaterialOutDto.setMSGID(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
gdyMaterialOutDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
gdyMaterialOutDto.setTRAY_NO(vehiclematerialgroup.getVehicle_code());
|
||||
gdyMaterialOutDto.setFPRODUCT_MATERIAL_ID(mesWorkOrderDto.getFPRODUCT_MATERIAL_ID());
|
||||
gdyMaterialOutDto.setFPRODUCT_MATERIAL_NAME(mesWorkOrderDto.getFPRODUCT_MATERIAL_NAME());
|
||||
@@ -331,7 +340,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
|
||||
log.info("统计到设备:{} 不合格砖数:{}", orderObj.getPoint_name(), number);
|
||||
// 设置字段值
|
||||
MesUnusedDto mesUnusedDto = new MesUnusedDto();
|
||||
mesUnusedDto.setMSGID(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
mesUnusedDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
mesUnusedDto.setFORDER_NO(orderObj.getProduction_order());
|
||||
mesUnusedDto.setPWORKSCHE_ID(orderObj.getWorkshop_code());
|
||||
mesUnusedDto.setFPRODUCT_MATERIAL_ID(orderObj.getMaterial_code());
|
||||
@@ -372,7 +381,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
|
||||
SchBasePoint pointDto = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getExt_point_code, mesWorkOrderDto.getPRESSUNIT()));
|
||||
PdmBdWorkorder pdmBdWorkorder = new PdmBdWorkorder();
|
||||
pdmBdWorkorder.setWorkorder_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
pdmBdWorkorder.setWorkorder_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
pdmBdWorkorder.setWorkorder_code(mesWorkOrderDto.getPWORKSCHE_ID());
|
||||
pdmBdWorkorder.setPlan_qty(mesWorkOrderDto.getFPRODUCT_SUBNUM());
|
||||
pdmBdWorkorder.setMaterial_id(materialDto.getMaterial_id());
|
||||
|
||||
@@ -11,9 +11,7 @@ import org.nl.wms.das.device.check.service.dao.DasDeviceCheckRecord;
|
||||
import org.nl.wms.das.device.operation.service.IDasDeviceOperationRecordService;
|
||||
import org.nl.wms.das.device.operation.service.dao.DasDeviceOperationRecord;
|
||||
import org.nl.wms.pda.service.PdaService;
|
||||
import org.nl.wms.pda.service.dao.dto.BlendingMoveDto;
|
||||
import org.nl.wms.pda.service.dao.dto.ForcedRestingDto;
|
||||
import org.nl.wms.pda.service.dao.dto.ManualGroupDto;
|
||||
import org.nl.wms.pda.service.dao.dto.*;
|
||||
import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
|
||||
import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService;
|
||||
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
|
||||
@@ -44,8 +42,6 @@ public class PdaController {
|
||||
@Autowired
|
||||
private PdaService pdaService;
|
||||
@Autowired
|
||||
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService;
|
||||
@Autowired
|
||||
private IPdmBdWorkorderService workorderService;
|
||||
@PostMapping("/deviceCheck/verify")
|
||||
@Log("设备点检")
|
||||
@@ -139,4 +135,101 @@ public class PdaController {
|
||||
return new ResponseEntity<>(pdaService.forcedResting(forcedRestingDto), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/manualSorting/orders")
|
||||
@Log("人工分拣-显示工单")
|
||||
@ApiOperation("人工分拣-显示工单")
|
||||
public ResponseEntity<Object> manualOrders(){
|
||||
return new ResponseEntity<>(pdaService.manualOrders(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/manualSorting/productionScheduling")
|
||||
@Log("人工分拣-开工")
|
||||
@ApiOperation("人工分拣-开工")
|
||||
public ResponseEntity<PdaResponseVo> productionScheduling(@Validated @RequestBody ManualSortingDto manualSortingDto){
|
||||
return new ResponseEntity<>(pdaService.productionScheduling(manualSortingDto), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/manualSorting/productionComplete")
|
||||
@Log("人工分拣-完工")
|
||||
@ApiOperation("人工分拣-完工")
|
||||
public ResponseEntity<PdaResponseVo> productionComplete(@Validated @RequestBody ManualSortingDto manualSortingDto){
|
||||
return new ResponseEntity<>(pdaService.productionComplete(manualSortingDto), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/manualSorting/emptyDiskIntoStorageTask")
|
||||
@Log("人工分拣-空盘入库-动作")
|
||||
@ApiOperation("人工分拣-空盘入库-动作")
|
||||
public ResponseEntity<PdaResponseVo> emptyDiskIntoStorageTask(){
|
||||
return new ResponseEntity<>(pdaService.emptyDiskIntoStorageTask(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/manualSorting/emptyDiskIntoStorageShow")
|
||||
@Log("人工分拣-空盘入库-显示任务信息")
|
||||
@ApiOperation("人工分拣-空盘入库-显示任务信息")
|
||||
public ResponseEntity<Object> emptyDiskIntoStorageShow(){
|
||||
return new ResponseEntity<>(pdaService.emptyDiskIntoStorageShow(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/manualSorting/callingWoodenPalletTask")
|
||||
@Log("人工分拣-呼叫木托盘-动作")
|
||||
@ApiOperation("人工分拣-呼叫木托盘-动作")
|
||||
public ResponseEntity<PdaResponseVo> callingWoodenPalletTask(){
|
||||
return new ResponseEntity<>(pdaService.callingWoodenPalletTask(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/manualSorting/callingWoodenPalletTaskShow")
|
||||
@Log("人工分拣-呼叫木托盘-显示任务信息")
|
||||
@ApiOperation("人工分拣-呼叫木托盘-显示任务信息")
|
||||
public ResponseEntity<Object> callingWoodenPalletTaskShow(){
|
||||
return new ResponseEntity<>(pdaService.callingWoodenPalletTaskShow(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/manualSorting/callingMaterialTask")
|
||||
@Log("人工分拣-呼叫物料-动作")
|
||||
@ApiOperation("人工分拣-呼叫物料-动作")
|
||||
public ResponseEntity<PdaResponseVo> callingMaterialTask(){
|
||||
return new ResponseEntity<>(pdaService.callingMaterialTask(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/manualSorting/callingMaterialTaskShow")
|
||||
@Log("人工分拣-呼叫物料-显示任务信息")
|
||||
@ApiOperation("人工分拣-呼叫物料-显示任务信息")
|
||||
public ResponseEntity<Object> callingMaterialTaskShow(){
|
||||
return new ResponseEntity<>(pdaService.callingMaterialTaskShow(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/manualSorting/callingResidueMaterialTask")
|
||||
@Log("人工分拣-剩料入库-动作")
|
||||
@ApiOperation("人工分拣-剩料入库-动作")
|
||||
public ResponseEntity<PdaResponseVo> callingResidueMaterialTask(@Validated @RequestBody ManualResidueInDto manualResidueInDto){
|
||||
return new ResponseEntity<>(pdaService.callingResidueMaterialTask(manualResidueInDto), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/manualSorting/callingResidueMaterialTaskShow")
|
||||
@Log("人工分拣-剩料入库-显示任务信息")
|
||||
@ApiOperation("人工分拣-剩料入库-显示任务信息")
|
||||
public ResponseEntity<Object> callingResidueMaterialTaskShow(){
|
||||
return new ResponseEntity<>(pdaService.callingResidueMaterialTaskShow(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/manualSorting/packingTask")
|
||||
@Log("人工分拣-包装入库-动作")
|
||||
@ApiOperation("人工分拣-包装入库-动作")
|
||||
public ResponseEntity<PdaResponseVo> packingTask(@Validated @RequestBody ManualResidueInDto manualResidueInDto){
|
||||
return new ResponseEntity<>(pdaService.packingTask(manualResidueInDto), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/manualSorting/packingTaskShow")
|
||||
@Log("人工分拣-包装入库-显示任务信息")
|
||||
@ApiOperation("人工分拣-包装入库-显示任务信息")
|
||||
public ResponseEntity<Object> packingTaskShow(){
|
||||
return new ResponseEntity<>(pdaService.packingTaskShow(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/manualSorting/bindingVehicle")
|
||||
@Log("人工分拣-载具绑定")
|
||||
@ApiOperation("人工分拣-载具绑定")
|
||||
public ResponseEntity<PdaResponseVo> bindingVehicle(@Validated @RequestBody VehicleBindingDto vehicleBindingDto){
|
||||
return new ResponseEntity<>(pdaService.bindingVehicle(vehicleBindingDto), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
package org.nl.wms.pda.service;
|
||||
|
||||
import org.nl.wms.pda.service.dao.dto.BlendingMoveDto;
|
||||
import org.nl.wms.pda.service.dao.dto.ForcedRestingDto;
|
||||
import org.nl.wms.pda.service.dao.dto.ManualGroupDto;
|
||||
import org.nl.wms.pda.service.dao.vo.DropdownListVo;
|
||||
import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
|
||||
import org.nl.wms.pda.service.dao.vo.StandTimeShowVo;
|
||||
import org.nl.wms.pda.service.dao.dto.*;
|
||||
import org.nl.wms.pda.service.dao.vo.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -33,4 +29,32 @@ public interface PdaService {
|
||||
List<StandTimeShowVo> forcedRestingShow();
|
||||
|
||||
List<DropdownListVo> getVehicleType();
|
||||
|
||||
List<ManualWorkOrderVo> manualOrders();
|
||||
|
||||
PdaResponseVo productionScheduling(ManualSortingDto manualSortingDto);
|
||||
|
||||
PdaResponseVo productionComplete(ManualSortingDto manualSortingDto);
|
||||
|
||||
PdaResponseVo emptyDiskIntoStorageTask();
|
||||
|
||||
List<TaskShowVo> emptyDiskIntoStorageShow();
|
||||
|
||||
PdaResponseVo callingWoodenPalletTask();
|
||||
|
||||
List<TaskShowVo> callingWoodenPalletTaskShow();
|
||||
|
||||
PdaResponseVo callingMaterialTask();
|
||||
|
||||
List<TaskShowVo> callingMaterialTaskShow();
|
||||
|
||||
PdaResponseVo callingResidueMaterialTask(ManualResidueInDto manualResidueInDto);
|
||||
|
||||
List<TaskShowVo> callingResidueMaterialTaskShow();
|
||||
|
||||
PdaResponseVo packingTask(ManualResidueInDto manualResidueInDto);
|
||||
|
||||
List<TaskShowVo> packingTaskShow();
|
||||
|
||||
PdaResponseVo bindingVehicle(VehicleBindingDto vehicleBindingDto);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,12 @@ import java.math.BigDecimal;
|
||||
@Data
|
||||
public class BlendingMoveDto {
|
||||
private String vehicle_code;
|
||||
/**
|
||||
* 混碾对接位
|
||||
*/
|
||||
private String start_point_code;
|
||||
private String end_point_code;
|
||||
private BigDecimal material_weight;
|
||||
/**
|
||||
* 压机号,需要自行寻找点位
|
||||
*/
|
||||
// private String end_point_code;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.nl.wms.pda.service.dao.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 剩料回库参数
|
||||
* @Date: 2023/9/28
|
||||
*/
|
||||
@Data
|
||||
public class ManualResidueInDto {
|
||||
private String vehicle_code;
|
||||
private String qty;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.nl.wms.pda.service.dao.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 人工排产Dto
|
||||
* @Date: 2023/9/28
|
||||
*/
|
||||
@Data
|
||||
public class ManualSortingDto {
|
||||
private String workorder_code;
|
||||
private String username; // 用户
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.nl.wms.pda.service.dao.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 载具绑定
|
||||
* @Date: 2023/10/7
|
||||
*/
|
||||
@Data
|
||||
public class VehicleBindingDto {
|
||||
private String origin_vehicle_code;
|
||||
private String target_vehicle_code;
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package org.nl.wms.pda.service.dao.mapper;
|
||||
|
||||
import org.nl.wms.pda.service.dao.vo.DropdownListVo;
|
||||
import org.nl.wms.pda.service.dao.vo.ManualWorkOrderVo;
|
||||
import org.nl.wms.pda.service.dao.vo.StandTimeShowVo;
|
||||
import org.nl.wms.pda.service.dao.vo.TaskShowVo;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
|
||||
import java.util.List;
|
||||
@@ -32,4 +34,24 @@ public interface PdaMapper {
|
||||
SchBasePoint findKLXPoint(String endPointCode);
|
||||
|
||||
List<StandTimeShowVo> forcedRestingShow();
|
||||
|
||||
/**
|
||||
* 获取人工分拣的工单
|
||||
* @return
|
||||
*/
|
||||
List<ManualWorkOrderVo> getManualOrders();
|
||||
|
||||
/**
|
||||
* 根据起点获取任务
|
||||
* @param point_code
|
||||
* @return
|
||||
*/
|
||||
List<TaskShowVo> getRunningTaskByStart(String point_code, String task_config);
|
||||
|
||||
/**
|
||||
* 根据终点获取任务
|
||||
* @param point_code
|
||||
* @return
|
||||
*/
|
||||
List<TaskShowVo> getRunningTaskByEnd(String point_code, String task_config);
|
||||
}
|
||||
|
||||
@@ -52,4 +52,70 @@
|
||||
)
|
||||
AND vg.group_bind_material_status = '2'
|
||||
</select>
|
||||
<select id="getManualOrders" resultType="org.nl.wms.pda.service.dao.vo.ManualWorkOrderVo">
|
||||
SELECT
|
||||
pw.workorder_code,
|
||||
mm.material_code,
|
||||
mm.material_name,
|
||||
CASE pw.workorder_status
|
||||
WHEN '1' THEN '未生产'
|
||||
WHEN '3' THEN '生产中'
|
||||
WHEN '4' THEN '暂停'
|
||||
ELSE ''
|
||||
END AS workorder_status,
|
||||
pw.operator,
|
||||
pw.create_name,
|
||||
pw.plan_qty,
|
||||
pw.real_qty
|
||||
FROM
|
||||
`pdm_bd_workorder` pw
|
||||
LEFT JOIN md_base_material mm ON mm.material_id = pw.material_id
|
||||
WHERE pw.region_code = 'FJ' AND pw.point_code LIKE 'RG%' AND pw.workorder_status IN ('1','3','4')
|
||||
</select>
|
||||
<select id="getRunningTaskByStart" resultType="org.nl.wms.pda.service.dao.vo.TaskShowVo">
|
||||
SELECT
|
||||
t.task_code,
|
||||
p1.point_name AS point_name1,
|
||||
p2.point_name AS point_name2,
|
||||
p3.point_name AS point_name3,
|
||||
p4.point_name AS point_name4,
|
||||
CASE t.task_status
|
||||
WHEN '1' THEN '创建'
|
||||
WHEN '2' THEN '创建完成'
|
||||
WHEN '3' THEN '下发'
|
||||
WHEN '4' THEN '执行中'
|
||||
ELSE '-'
|
||||
END AS task_status,
|
||||
t.remark
|
||||
FROM
|
||||
`sch_base_task` t
|
||||
LEFT JOIN sch_base_point p1 ON p1.point_code = t.point_code1
|
||||
LEFT JOIN sch_base_point p2 ON p2.point_code = t.point_code2
|
||||
LEFT JOIN sch_base_point p3 ON p3.point_code = t.point_code3
|
||||
LEFT JOIN sch_base_point p4 ON p4.point_code = t.point_code4
|
||||
WHERE task_status IN ('1','2','3','4') AND t.point_code1 = #{point_code} AND t.config_code = #{task_config}
|
||||
</select>
|
||||
<select id="getRunningTaskByEnd" resultType="org.nl.wms.pda.service.dao.vo.TaskShowVo">
|
||||
SELECT
|
||||
t.task_code,
|
||||
p1.point_name AS point_name1,
|
||||
p2.point_name AS point_name2,
|
||||
p3.point_name AS point_name3,
|
||||
p4.point_name AS point_name4,
|
||||
CASE t.task_status
|
||||
WHEN '1' THEN '创建'
|
||||
WHEN '2' THEN '创建完成'
|
||||
WHEN '3' THEN '下发'
|
||||
WHEN '4' THEN '执行中'
|
||||
ELSE '-'
|
||||
END AS task_status,
|
||||
t.remark
|
||||
FROM
|
||||
`sch_base_task` t
|
||||
LEFT JOIN sch_base_point p1 ON p1.point_code = t.point_code1
|
||||
LEFT JOIN sch_base_point p2 ON p2.point_code = t.point_code2
|
||||
LEFT JOIN sch_base_point p3 ON p3.point_code = t.point_code3
|
||||
LEFT JOIN sch_base_point p4 ON p4.point_code = t.point_code4
|
||||
WHERE task_status IN ('1','2','3','4') AND t.point_code2 = #{point_code} AND t.config_code = #{task_config}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.nl.wms.pda.service.dao.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 人工排产 - 工单显示
|
||||
* @Date: 2023/9/28
|
||||
*/
|
||||
@Data
|
||||
public class ManualWorkOrderVo {
|
||||
private String workorder_code;
|
||||
private String material_code;
|
||||
private String material_name;
|
||||
private String workorder_status;
|
||||
private String operator;
|
||||
private String create_name;
|
||||
private String plan_qty;
|
||||
private String real_qty;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.nl.wms.pda.service.dao.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 输出前端的任务显示
|
||||
* @Date: 2023/9/28
|
||||
*/
|
||||
@Data
|
||||
public class TaskShowVo {
|
||||
private String point_name1;
|
||||
private String point_name2;
|
||||
private String point_name3;
|
||||
private String point_name4;
|
||||
private String task_status;
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -3,29 +3,30 @@ package org.nl.wms.pda.service.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.database.material.service.IMdBaseMaterialService;
|
||||
import org.nl.wms.database.material.service.dao.MdBaseMaterial;
|
||||
import org.nl.wms.pda.service.PdaService;
|
||||
import org.nl.wms.pda.service.dao.dto.BlendingMoveDto;
|
||||
import org.nl.wms.pda.service.dao.dto.ForcedRestingDto;
|
||||
import org.nl.wms.pda.service.dao.dto.ManualGroupDto;
|
||||
import org.nl.wms.pda.service.dao.dto.*;
|
||||
import org.nl.wms.pda.service.dao.mapper.PdaMapper;
|
||||
import org.nl.wms.pda.service.dao.vo.DropdownListVo;
|
||||
import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
|
||||
import org.nl.wms.pda.service.dao.vo.StandTimeShowVo;
|
||||
import org.nl.wms.pda.service.dao.vo.*;
|
||||
import org.nl.wms.pdm.vehiclebiding.service.IPdmBdVehicleBindingService;
|
||||
import org.nl.wms.pdm.vehiclebiding.service.dao.PdmBdVehicleBinding;
|
||||
import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService;
|
||||
import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder;
|
||||
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
|
||||
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
|
||||
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
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.WorkOrderStatusEnum;
|
||||
import org.nl.wms.util.TaskUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -49,6 +50,10 @@ public class PdaServiceImpl implements PdaService {
|
||||
private IMdBaseMaterialService materialService;
|
||||
@Autowired
|
||||
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService;
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
@Autowired
|
||||
private IPdmBdVehicleBindingService vehicleBindingService;
|
||||
@Override
|
||||
public List<DropdownListVo> getDeviceInfo() {
|
||||
// 暂定压机区域
|
||||
@@ -111,27 +116,31 @@ public class PdaServiceImpl implements PdaService {
|
||||
}
|
||||
|
||||
@Override
|
||||
// todo
|
||||
public PdaResponseVo sendTask(BlendingMoveDto blendingMoveDto) {
|
||||
if (ObjectUtil.isEmpty(blendingMoveDto.getStart_point_code())) {
|
||||
throw new BadRequestException("混碾位不能为空");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(blendingMoveDto.getEnd_point_code())) {
|
||||
throw new BadRequestException("目标压机位不能为空");
|
||||
}
|
||||
// if (ObjectUtil.isEmpty(blendingMoveDto.getEnd_point_code())) {
|
||||
// throw new BadRequestException("目标压机位不能为空");
|
||||
// }
|
||||
// 获取压机对应的困料线、空位、无任务
|
||||
SchBasePoint point = pdaMapper.findKLXPoint(blendingMoveDto.getEnd_point_code());
|
||||
if (ObjectUtil.isEmpty(point)) {
|
||||
throw new BadRequestException("创建失败,已有搬运到【" + blendingMoveDto.getEnd_point_code() + "】的任务, 请稍后在试!");
|
||||
}
|
||||
// 获取压机当前工单
|
||||
PdmBdWorkorder workorder = workorderService.getDeviceProductionTask(blendingMoveDto.getEnd_point_code());
|
||||
// 组盘
|
||||
|
||||
// 创建任务
|
||||
SchBaseTask task = new SchBaseTask(); // 任务实体
|
||||
|
||||
return null;
|
||||
// SchBasePoint point = pdaMapper.findKLXPoint(blendingMoveDto.getEnd_point_code());
|
||||
// if (ObjectUtil.isEmpty(point)) {
|
||||
// throw new BadRequestException("创建失败,已有搬运到【" + blendingMoveDto.getEnd_point_code() + "】的任务, 请稍后在试!");
|
||||
// }
|
||||
// todo: 1、向acs获取吨袋号、重量
|
||||
// 准备参数:设备编码、载具号、载具类型、重量、吨袋号(material_code)
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("device_code", blendingMoveDto.getStart_point_code());
|
||||
param.put("material_code", "吨袋号");
|
||||
param.put("weight", "0");
|
||||
param.put("vehicle_code", blendingMoveDto.getVehicle_code());
|
||||
param.put("vehicle_type", GeneralDefinition.MATERIAL_CUP);
|
||||
param.put("requestNo", IdUtil.simpleUUID());
|
||||
param.put("config_code", "HLMLTask");
|
||||
param.put("vehicle_qty", "1");
|
||||
taskService.apply(param);
|
||||
return PdaResponseVo.pdaResultOk("任务创建成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -154,4 +163,157 @@ public class PdaServiceImpl implements PdaService {
|
||||
public List<DropdownListVo> getVehicleType() {
|
||||
return pdaMapper.getDictByCode("vehicle_type");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ManualWorkOrderVo> manualOrders() {
|
||||
return pdaMapper.getManualOrders();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponseVo productionScheduling(ManualSortingDto manualSortingDto) {
|
||||
// 查询工单
|
||||
PdmBdWorkorder bdWorkorder = workorderService.getByCode(manualSortingDto.getWorkorder_code());
|
||||
if (ObjectUtil.isEmpty(bdWorkorder)) {
|
||||
throw new BadRequestException("工单:[" + bdWorkorder.getWorkorder_code() + "]不存在");
|
||||
}
|
||||
switch (bdWorkorder.getWorkorder_status()) {
|
||||
case "3":
|
||||
throw new BadRequestException("工单:[" + bdWorkorder.getWorkorder_code() + "]已开工");
|
||||
case "5":
|
||||
throw new BadRequestException("工单:[" + bdWorkorder.getWorkorder_code() + "]已完工");
|
||||
}
|
||||
// 开工
|
||||
bdWorkorder.setOperator(manualSortingDto.getUsername());
|
||||
bdWorkorder.setWorkorder_status(WorkOrderStatusEnum.PRODUCING.getCode());
|
||||
TaskUtils.setWorkOrderUpdateByPC(bdWorkorder);
|
||||
workorderService.updateById(bdWorkorder);
|
||||
return PdaResponseVo.pdaResultOk("工单:[" + bdWorkorder.getWorkorder_code() + "]开工成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponseVo productionComplete(ManualSortingDto manualSortingDto) {
|
||||
// 查询工单
|
||||
PdmBdWorkorder bdWorkorder = workorderService.getByCode(manualSortingDto.getWorkorder_code());
|
||||
if (ObjectUtil.isEmpty(bdWorkorder)) {
|
||||
throw new BadRequestException("工单:[" + bdWorkorder.getWorkorder_code() + "]不存在");
|
||||
}
|
||||
switch (bdWorkorder.getWorkorder_status()) {
|
||||
case "1":
|
||||
throw new BadRequestException("工单:[" + bdWorkorder.getWorkorder_code() + "]未开工");
|
||||
case "5":
|
||||
throw new BadRequestException("工单:[" + bdWorkorder.getWorkorder_code() + "]已完工");
|
||||
}
|
||||
TaskUtils.setWorkOrderUpdateByPC(bdWorkorder);
|
||||
bdWorkorder.setWorkorder_status(WorkOrderStatusEnum.COMPLETE.getCode());
|
||||
workorderService.updateById(bdWorkorder);
|
||||
return PdaResponseVo.pdaResultOk("工单:[" + bdWorkorder.getWorkorder_code() + "]完工成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponseVo emptyDiskIntoStorageTask() {
|
||||
// 只有一个人工位置,因此在这固定
|
||||
// 准备参数:设备编码
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("device_code", "RGCDW01");
|
||||
param.put("config_code", "FJSKTask");
|
||||
taskService.apply(param);
|
||||
return PdaResponseVo.pdaResultOk("空盘入库请求成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskShowVo> emptyDiskIntoStorageShow() {
|
||||
return pdaMapper.getRunningTaskByStart("RGCDW01", "FJSKTask");
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponseVo callingWoodenPalletTask() {
|
||||
// 只有一个人工位置,因此在这固定
|
||||
// 准备参数:设备编码
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("device_code", "RGMDW01");
|
||||
param.put("config_code", "FJQKTask");
|
||||
taskService.apply(param);
|
||||
return PdaResponseVo.pdaResultOk("呼叫木托盘请求成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskShowVo> callingWoodenPalletTaskShow() {
|
||||
return pdaMapper.getRunningTaskByEnd("RGMDW01", "FJQKTask");
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponseVo callingMaterialTask() {
|
||||
// 只有一个人工位置,因此在这固定
|
||||
// 准备参数:设备编码
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("device_code", "RGCDW01");
|
||||
param.put("config_code", "FJQLTask");
|
||||
taskService.apply(param);
|
||||
return PdaResponseVo.pdaResultOk("呼叫物料请求成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskShowVo> callingMaterialTaskShow() {
|
||||
return pdaMapper.getRunningTaskByEnd("RGCDW01", "FJQLTask");
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponseVo callingResidueMaterialTask(ManualResidueInDto manualResidueInDto) {
|
||||
// 只有一个人工位置,因此在这固定
|
||||
// 准备参数:设备编码
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("device_code", "RGCDW01");
|
||||
param.put("config_code", "FJSLHSTask");
|
||||
param.put("qty", manualResidueInDto.getQty());
|
||||
param.put("vehicle_code", manualResidueInDto.getVehicle_code());
|
||||
param.put("vehicle_qty", "1");
|
||||
taskService.apply(param);
|
||||
return PdaResponseVo.pdaResultOk("剩料入库请求成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskShowVo> callingResidueMaterialTaskShow() {
|
||||
return pdaMapper.getRunningTaskByStart("RGCDW01", "FJSLHSTask");
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponseVo packingTask(ManualResidueInDto manualResidueInDto) {
|
||||
// 只有一个人工位置,因此在这固定
|
||||
// 准备参数:设备编码
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("device_code", "RGMDW01");
|
||||
param.put("config_code", "FJMLTask");
|
||||
param.put("qty", manualResidueInDto.getQty());
|
||||
param.put("vehicle_code", manualResidueInDto.getVehicle_code());
|
||||
param.put("vehicle_qty", "1");
|
||||
taskService.apply(param);
|
||||
return PdaResponseVo.pdaResultOk("包装入库请求成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskShowVo> packingTaskShow() {
|
||||
return pdaMapper.getRunningTaskByStart("RGMDW01", "FJMLTask");
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponseVo bindingVehicle(VehicleBindingDto vehicleBindingDto) {
|
||||
PdmBdWorkorder workOrder = workorderService.getDeviceProductionTask("RGFJ01");
|
||||
if (ObjectUtil.isEmpty(workOrder)) {
|
||||
throw new BadRequestException("人工分拣未开工");
|
||||
}
|
||||
PdmBdVehicleBinding vehicleBinding = new PdmBdVehicleBinding();
|
||||
vehicleBinding.setAssociate_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
vehicleBinding.setOrigin_vehicle_code(vehicleBindingDto.getTarget_vehicle_code());
|
||||
vehicleBinding.setOrigin_vehicle_type(GeneralDefinition.STEEL_TRAY);
|
||||
vehicleBinding.setTarget_vehicle_code(vehicleBindingDto.getTarget_vehicle_code());
|
||||
vehicleBinding.setTarget_vehicle_type(workOrder.getVehicle_type());
|
||||
vehicleBinding.setGet_station("RGCDW01");
|
||||
vehicleBinding.setPut_station("RGMDW01");
|
||||
vehicleBinding.setOrigin_qty("0");
|
||||
vehicleBinding.setTarget_qty("0");
|
||||
vehicleBinding.setOrder_code(workOrder.getWorkorder_code());
|
||||
vehicleBinding.setRecord_time(DateUtil.now());
|
||||
vehicleBindingService.save(vehicleBinding);
|
||||
return PdaResponseVo.pdaResultOk("载具绑定成功!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
if (ObjectUtil.isEmpty(blendingMoveDto.getEnd_point_code())) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("device_code", blendingMoveDto.getStart_point_code());
|
||||
param.put("material_code", "吨袋号");
|
||||
param.put("weight", "0");
|
||||
param.put("vehicle_code", blendingMoveDto.getVehicle_code());
|
||||
param.put("vehicle_type", GeneralDefinition.MATERIAL_CUP);
|
||||
param.put("requestNo", IdUtil.simpleUUID());
|
||||
param.put("config_code", "HLMLTask");
|
||||
param.put("vehicle_qty", "1");
|
||||
taskService.apply(param);
|
||||
return PdaResponseVo.pdaResultOk("任务创建成功");
|
||||
}
|
||||
// 2、组盘
|
||||
// 找到相同组盘信息就直接返回id,避免任务取消组盘信息还存在,重复插入
|
||||
// 找到不直接返回,用那条数据进行修改
|
||||
SchBaseVehiclematerialgroup groupEntity = vehiclematerialgroupService.getGroupInfo(blendingMoveDto.getVehicle_code(),
|
||||
GeneralDefinition.MATERIAL_CUP, GroupBindMaterialStatusEnum.BOUND.getValue());
|
||||
if (groupEntity == null) {
|
||||
groupEntity = new SchBaseVehiclematerialgroup();
|
||||
groupEntity.setGroup_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
}
|
||||
// 要把数据存到组盘表
|
||||
groupEntity.setMaterial_id(GeneralDefinition.UNKNOWN); // 物料标识等任务完成后赋值
|
||||
groupEntity.setRedundance_material_code(workorder.getRaw_material_code());
|
||||
groupEntity.setCreate_id(GeneralDefinition.ACS_ID);
|
||||
groupEntity.setCreate_name(GeneralDefinition.ACS_NAME);
|
||||
groupEntity.setCreate_time(DateUtil.now());
|
||||
groupEntity.setVehicle_code(blendingMoveDto.getVehicle_code());
|
||||
groupEntity.setVehicle_type(GeneralDefinition.MATERIAL_CUP);
|
||||
groupEntity.setSource_vehicle_code(startPoint.getPoint_code());
|
||||
groupEntity.setPoint_code(startPoint.getPoint_code()); // 当前位置
|
||||
groupEntity.setPoint_name(startPoint.getPoint_name());
|
||||
groupEntity.setMove_way(startPoint.getPoint_code()); // 头次
|
||||
// groupEntity.setMix_times(mixTimes); // 碾次
|
||||
groupEntity.setInstorage_time(DateUtil.now());
|
||||
// groupEntity.setMaterial_weight(blendingMoveDto.getMaterial_weight());
|
||||
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 绑定
|
||||
groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。
|
||||
groupEntity.setIs_delete(false);
|
||||
// groupEntity.setExt_data(packNo);// todo: 对于混碾的组盘 暂时存吨袋号
|
||||
vehiclematerialgroupService.saveOrUpdate(groupEntity);
|
||||
// 3、查找压机对应的位置,并且设置左边还是右边
|
||||
|
||||
// 4、创建任务
|
||||
SchBaseTask task = new SchBaseTask(); // 任务实体
|
||||
task.setTask_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
task.setTask_code(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
task.setConfig_code("HLMLTask");
|
||||
task.setCreate_mode(GeneralDefinition.ACS_CREATION);
|
||||
task.setVehicle_code(blendingMoveDto.getVehicle_code());
|
||||
task.setVehicle_qty(1);
|
||||
task.setVehicle_type(GeneralDefinition.MATERIAL_CUP);
|
||||
task.setTask_status(TaskStatus.APPLY.getCode());
|
||||
task.setWorkshop_code("A1"); // 车间编码
|
||||
// 设置起/终点
|
||||
task.setPoint_code1(blendingMoveDto.getStart_point_code());
|
||||
// task.setPoint_code2(blendingMoveDto.getEnd_point_code());
|
||||
task.setGroup_id(groupEntity.getGroup_id());
|
||||
task.setRequest_param(JSONObject.toJSONString(blendingMoveDto));
|
||||
task.setCreate_id(SecurityUtils.getCurrentUserId());// 设置创建人信息
|
||||
task.setCreate_name(SecurityUtils.getCurrentNickName());// 设置创建人信息
|
||||
task.setCreate_time(DateUtil.now());// 设置创建人信息
|
||||
taskService.save(task);
|
||||
return PdaResponseVo.pdaResultOk("任务创建成功");
|
||||
@@ -14,7 +14,7 @@ public class AcsWorkOrderVo {
|
||||
private String material_code; // 半成品物料编码 - 工单物料编码
|
||||
private String product_code; // 产品代号 - 规格
|
||||
private String formula; // 配方 - 型号
|
||||
private String brick_code; // 砖型编码
|
||||
private String brick_code; // 砖型编码 - 自己维护
|
||||
private String plan_qty; // 计划数量
|
||||
private String a; // a边
|
||||
private String b; // b边
|
||||
@@ -28,5 +28,5 @@ public class AcsWorkOrderVo {
|
||||
private String standard_size_height3; // 标准尺寸3
|
||||
private String standard_size_height4; // 标准尺寸4
|
||||
private String standard_weight; // 标准重量
|
||||
private String detection_error; // 检测误差值
|
||||
private String detection_error; // 检测误差值 - 不用传
|
||||
}
|
||||
|
||||
@@ -103,6 +103,7 @@ public class FJMKTask extends AbstractTask {
|
||||
for (ApplyDeviceDto applyDeviceDto : list) {
|
||||
sum += Integer.parseInt(applyDeviceDto.getQty());
|
||||
}
|
||||
// todo: 需要提供两个托盘上的数量
|
||||
// 2.1 获取库存剩余数量 + 2.2 获取在搬运任务 - 组盘绑定状态是带绑定状态、任务类型是创建完成、下发、执行中
|
||||
int surplusNumber = fjMapper.getInventoryQuantity();
|
||||
int total = sum + surplusNumber; // 现有总数
|
||||
@@ -113,15 +114,9 @@ public class FJMKTask extends AbstractTask {
|
||||
if (ObjectUtil.isNotEmpty(responseParam)) {
|
||||
response = JSON.parseObject(responseParam);
|
||||
}
|
||||
// 大于两托正常,大于1托给个1,小于1托给2
|
||||
// 大于两托正常,大于1托给1,小于1托给2
|
||||
// 4 校验是否够码满一托/两托
|
||||
if ((total % needFullNumber) == 0) {
|
||||
// 不可以叫空木托盘
|
||||
// response.put("")
|
||||
} else if ((total % needFullNumber) < 2) {
|
||||
// 不可以叫空木托盘
|
||||
}
|
||||
// 大于2就可以码
|
||||
// 大于等于2就可以码
|
||||
/** 覆膜机木托盘位 */
|
||||
SchBasePoint LaminatePoint = findStartPoint(startRegionStr, jsonObject);
|
||||
if (ObjectUtil.isEmpty(LaminatePoint)) {
|
||||
|
||||
@@ -34,13 +34,13 @@ import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: rgv - 分拣强制入库任务 - 2点
|
||||
* @Description: rgv - 分拣强制入库任务 - 2点 改:不需要强制入库,改为人工分拣入库的方法
|
||||
* @Date: 2023/6/21
|
||||
*/
|
||||
@Component
|
||||
@TaskType("FJQZRKTask")
|
||||
@TaskType("RGFJRKTask")
|
||||
public class FJRKTask extends AbstractTask {
|
||||
private static String TASK_CONFIG_CODE = "FJQZRKTask";
|
||||
private static String TASK_CONFIG_CODE = "RGFJRKTask";
|
||||
@Autowired
|
||||
private ISchBasePointService pointService;
|
||||
@Autowired
|
||||
@@ -49,7 +49,6 @@ public class FJRKTask extends AbstractTask {
|
||||
private ISchBaseTaskconfigService taskConfigService;
|
||||
@Autowired
|
||||
private ISysNoticeService noticeService;
|
||||
|
||||
@Autowired
|
||||
private IPdmBdWorkorderService workorderService;
|
||||
@Autowired
|
||||
@@ -111,7 +110,7 @@ public class FJRKTask extends AbstractTask {
|
||||
task.setTask_status(TaskStatus.CREATED.getCode());
|
||||
task.setRemark("");
|
||||
taskService.save(task);
|
||||
|
||||
// todo 判断是否够码满一垛,够就叫空盘,否则就是两点任务
|
||||
point.setIng_task_code(task.getTask_code());
|
||||
PointUtils.setUpdateByAcs(point);
|
||||
pointService.updateById(point);
|
||||
@@ -125,6 +124,7 @@ public class FJRKTask extends AbstractTask {
|
||||
private SchBasePoint findNextPoint(List<String> nextRegionStr) {
|
||||
LambdaQueryWrapper<SchBasePoint> lam = new LambdaQueryWrapper<>();
|
||||
lam.in(SchBasePoint::getRegion_code, nextRegionStr)
|
||||
.eq(SchBasePoint::getPoint_status, PointStatusEnum.EMPTY_POINT.getCode())
|
||||
.and(la -> la.isNull(SchBasePoint::getIng_task_code) // 当前执行的任务为空或者NULL,有数据表示锁住
|
||||
.or()
|
||||
.eq(SchBasePoint::getIng_task_code, ""))
|
||||
|
||||
@@ -159,6 +159,7 @@ public class FJSLTask extends AbstractTask {
|
||||
throw new BadRequestException("找不到组盘信息");
|
||||
}
|
||||
groupObject.setIs_full(false);
|
||||
groupObject.setMaterial_qty(param.getInteger(param.getString("qty")));
|
||||
groupObject.setExt_data(JSONObject.toJSONString(stackParameters));
|
||||
TaskUtils.setGroupUpdateByAcs(groupObject);
|
||||
vehiclematerialgroupService.updateById(groupObject);
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.nl.wms.util;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2023/9/27
|
||||
*/
|
||||
@Configuration
|
||||
@ComponentScan(basePackages = "org.nl.wms.util")
|
||||
public class MainConfig {
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
package org.nl.wms.util;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
@@ -10,11 +8,15 @@ import org.springframework.stereotype.Component;
|
||||
* @Description: 监听事件,用来debug查看bean工厂等信息
|
||||
* @Date: 2023/5/23
|
||||
*/
|
||||
@Component
|
||||
public class MyEventListener {
|
||||
public class MyEventListener extends ApplicationEvent {
|
||||
|
||||
@EventListener
|
||||
public void handleContextRefresh(ContextRefreshedEvent event) {
|
||||
ApplicationContext applicationContext = event.getApplicationContext();
|
||||
public MyEventListener(Object source) {
|
||||
super(source);
|
||||
}
|
||||
|
||||
// @EventListener
|
||||
// public void handleContextRefresh(ContextRefreshedEvent event) {
|
||||
// ApplicationContext applicationContext = event.getApplicationContext();
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.nl.wms.util;
|
||||
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2023/9/27
|
||||
*/
|
||||
@Component
|
||||
public class MyListener implements ApplicationListener<MyEventListener> {
|
||||
@Override
|
||||
public void onApplicationEvent(MyEventListener myEventListener) {
|
||||
System.out.println("事件:"+myEventListener.toString());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.nl.wms.util;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2023/10/8
|
||||
*/
|
||||
public class TreePrinter {
|
||||
public static void main(String[] args) {
|
||||
// 指定文件夹的路径
|
||||
String folderPath = "D:\\Code\\Work\\rl_mg\\lms\\nladmin-system\\nlsso-server\\src\\main\\java\\org\\nl\\wms";
|
||||
|
||||
// 调用递归方法获取文件树并打印
|
||||
File folder = new File(folderPath);
|
||||
if (folder.exists() && folder.isDirectory()) {
|
||||
System.out.println(folder.getAbsolutePath());
|
||||
printFileTree(folder, "", true);
|
||||
} else {
|
||||
System.out.println("指定路径不是一个有效的文件夹。");
|
||||
}
|
||||
}
|
||||
|
||||
public static void printFileTree(File folder, String prefix, boolean isLast) {
|
||||
File[] files = folder.listFiles();
|
||||
if (files != null) {
|
||||
int count = 0;
|
||||
for (File file : files) {
|
||||
count++;
|
||||
boolean isSubfolder = file.isDirectory();
|
||||
boolean isLastItem = count == files.length;
|
||||
|
||||
System.out.print(prefix);
|
||||
System.out.print(isLastItem ? "└── " : "├── ");
|
||||
System.out.println(file.getName());
|
||||
|
||||
if (isSubfolder) {
|
||||
String newPrefix = prefix + (isLastItem ? " " : "│ ");
|
||||
printFileTree(file, newPrefix, isLastItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,9 +113,11 @@ public class test {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String f = "14070300003423092216085408190002";
|
||||
System.out.println(f.substring(0, 12));
|
||||
System.out.println(f.substring(18, f.length()));
|
||||
// String f = "14070300003423092216085408190002";
|
||||
// System.out.println(f.substring(0, 12));
|
||||
// System.out.println(f.substring(18, f.length()));
|
||||
|
||||
System.out.println(5%3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user