diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/controller/BoardController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/controller/BoardController.java new file mode 100644 index 0000000..db781e2 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/controller/BoardController.java @@ -0,0 +1,98 @@ +package org.nl.wms.board.controller; + +import cn.dev33.satoken.annotation.SaIgnore; +import com.alibaba.fastjson.JSONObject; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.nl.common.logging.annotation.Log; +import org.nl.wms.board.service.BoardService; +import org.nl.wms.pda.service.PdaService; +import org.nl.wms.sch.point.service.ISchBasePointService; +import org.nl.wms.sch.point.service.dao.SchBasePoint; +import org.nl.wms.sch.region.service.ISchBaseRegionService; +import org.nl.wms.sch.region.service.dao.SchBaseRegion; +import org.springframework.context.annotation.Lazy; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.Map; + + +@Slf4j +@RestController +@Api(tags = "看板接口") +@RequestMapping("/api/board" + + "") +@SaIgnore +@Lazy +public class BoardController { + + @Resource + private BoardService boardService; + + + @PostMapping("/cz") + @Log("称重看板") + @ApiOperation("称重看板") + @SaIgnore + public ResponseEntity cz(@RequestBody JSONObject param){ + return new ResponseEntity<>(boardService.cz(param), HttpStatus.OK); + } + + @PostMapping("/rk/kc") + @Log("入库看板库存") + @ApiOperation("入库看板库存") + @SaIgnore + public ResponseEntity kc(@RequestBody JSONObject param){ + return new ResponseEntity<>(boardService.kc(), HttpStatus.OK); + } + + @PostMapping("/rk/hw") + @Log("入库看板货位占用") + @ApiOperation("入库看板货位占用") + @SaIgnore + public ResponseEntity hw(@RequestBody JSONObject param){ + return new ResponseEntity<>(boardService.hw(), HttpStatus.OK); + } + + @PostMapping("/rk/kn") + @Log("入库看板库内物料") + @ApiOperation("入库看板库内物料") + @SaIgnore + public ResponseEntity kn(@RequestBody JSONObject param){ + return new ResponseEntity<>(boardService.kn(), HttpStatus.OK); + } + + @PostMapping("/rk/wrk") + @Log("入库看板未入库物料") + @ApiOperation("入库看板未入库物料") + @SaIgnore + public ResponseEntity wrk(@RequestBody JSONObject param){ + return new ResponseEntity<>(boardService.wrk(), HttpStatus.OK); + } + + + @PostMapping("/sc/pt") + @Log("生产看板普通回温") + @ApiOperation("生产看板普通回温") + @SaIgnore + public ResponseEntity pt(){ + return new ResponseEntity<>(boardService.sc("HW"), HttpStatus.OK); + } + + + @PostMapping("/sc/ks") + @Log("生产看板快速回温") + @ApiOperation("生产看板快速回温") + @SaIgnore + public ResponseEntity ks(){ + return new ResponseEntity<>(boardService.sc("HWK"), HttpStatus.OK); + } + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/BoardService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/BoardService.java new file mode 100644 index 0000000..41882af --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/BoardService.java @@ -0,0 +1,23 @@ +package org.nl.wms.board.service; + +import com.alibaba.fastjson.JSONObject; +import org.nl.wms.board.service.dao.dto.HwDto; +import org.nl.wms.board.service.dao.dto.ScDto; +import org.nl.wms.board.service.dao.dto.WlDto; +import org.nl.wms.pda.service.dao.vo.PdaResponseVo; + +import java.util.List; + +public interface BoardService { + PdaResponseVo cz(JSONObject param); + + PdaResponseVo kc(); + + HwDto hw(); + + List kn(); + + List wrk(); + + List sc(String region_code); +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/dto/HwDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/dto/HwDto.java new file mode 100644 index 0000000..d559d59 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/dto/HwDto.java @@ -0,0 +1,14 @@ +package org.nl.wms.board.service.dao.dto; + +import lombok.Data; + +@Data +public class HwDto { + private int pointNumber; + private int pointUsed; + private int pointRemain; + private int emptyNumber; + private int emptyUsed; + private int emptyRemain; + private int emptyQty; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/dto/ScDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/dto/ScDto.java new file mode 100644 index 0000000..ced0d6c --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/dto/ScDto.java @@ -0,0 +1,15 @@ +package org.nl.wms.board.service.dao.dto; + +import lombok.Data; + +@Data +public class ScDto { + private String productName; + private String supplierName; + private String productDescription; + private String batch; + private String number; + private String standingTime; + private String usedTime; + private int state; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/dto/WlDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/dto/WlDto.java new file mode 100644 index 0000000..6c9eede --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/dto/WlDto.java @@ -0,0 +1,13 @@ +package org.nl.wms.board.service.dao.dto; + +import lombok.Data; + +@Data +public class WlDto { + private String palletSN; + private String productName; + private String productDescription; + private String qty; + private String incomingWeight; + private String supplierName; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/mapper/BoardMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/mapper/BoardMapper.java new file mode 100644 index 0000000..ff977d1 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/mapper/BoardMapper.java @@ -0,0 +1,20 @@ +package org.nl.wms.board.service.dao.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.nl.wms.board.service.dao.dto.HwDto; +import org.nl.wms.board.service.dao.dto.ScDto; +import org.nl.wms.board.service.dao.dto.WlDto; +import org.nl.wms.pdm.service.dao.PointDetail; + +import java.util.List; +import java.util.logging.Handler; + +public interface BoardMapper { + List sc(String region_code); + + List kn(); + + List wrk(); + + HwDto hw(); +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/mapper/BoardMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/mapper/BoardMapper.xml new file mode 100644 index 0000000..f72afcd --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/mapper/BoardMapper.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/impl/BoardServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/impl/BoardServiceImpl.java new file mode 100644 index 0000000..fd2fec2 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/impl/BoardServiceImpl.java @@ -0,0 +1,49 @@ +package org.nl.wms.board.service.impl; + +import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; +import org.nl.wms.board.service.BoardService; +import org.nl.wms.board.service.dao.dto.HwDto; +import org.nl.wms.board.service.dao.dto.ScDto; +import org.nl.wms.board.service.dao.dto.WlDto; +import org.nl.wms.board.service.dao.mapper.BoardMapper; +import org.nl.wms.pda.service.dao.vo.PdaResponseVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Slf4j +@Service +public class BoardServiceImpl implements BoardService { + @Autowired + private BoardMapper boardMapper; + public PdaResponseVo cz(JSONObject param){ + return PdaResponseVo.pdaResultOk("回温状态查询成功"); + } + + public PdaResponseVo rk(JSONObject param){ + return PdaResponseVo.pdaResultOk("回温状态查询成功"); + } + + public PdaResponseVo kc(){ + return PdaResponseVo.pdaResultOk("回温状态查询成功"); + } + + public HwDto hw(){ + return boardMapper.hw(); + } + + + public List kn(){ + return boardMapper.kn(); + } + + public List wrk(){ + return boardMapper.wrk(); + } + + public List sc(String region_code){ + return boardMapper.sc(region_code); + } +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java index 073b926..fadd292 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java @@ -56,7 +56,7 @@ public class PdaServiceImpl implements PdaService { @Override public PdaResponseVo dwzt(JSONObject param) { - acsToWmsService.notify(param); +// acsToWmsService.notify(param); return PdaResponseVo.pdaResultOk("回温状态查询成功"); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/controller/PointDetailController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/controller/PointDetailController.java index 2f1e966..a49d528 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/controller/PointDetailController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/controller/PointDetailController.java @@ -1,5 +1,6 @@ package org.nl.wms.pdm.controller; +import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSONObject; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -48,6 +49,7 @@ public class PointDetailController { param.put("time",pointDetailAdd.getTime()); param.put("mode",pointDetailAdd.getMode()); param.put("workorder_code",pointDetailAdd.getWorkorder_code()); + param.put("batch", DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss")); pdaService.yclck(param); } return new ResponseEntity<>(HttpStatus.OK); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java index 266935d..eccd683 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java @@ -165,46 +165,9 @@ public class KJRKTask extends AbstractTask { endPointObj.setVehicle_code(ObjectUtil.isEmpty(endPointObj.getVehicle_code()) ? vehicle_code + "," : endPointObj.getVehicle_code() + vehicle_code + ","); endPointObj.setVehicle_qty(1); pointService.update(endPointObj); - // 要把数据存到组盘表 -> 改造公共方法,返回id - //todo 组盘表需要关联外部mes晶棒数据,一对多 - SchBaseVehiclematerialgroup groupEntity = new SchBaseVehiclematerialgroup(); - groupEntity.setGroup_id(IdUtil.getSnowflake(1, 1).nextIdStr()); - groupEntity.setCreate_id("2"); - groupEntity.setCreate_name("ACS"); - groupEntity.setCreate_time(DateUtil.now()); - groupEntity.setMaterial_id(ObjectUtil.isNotEmpty(workorderCode) - ? workorderCode.getMaterial_id() - : ""); - groupEntity.setStanding_time(ObjectUtil.isNotEmpty(workorderCode) - ? workorderCode.getStanding_time() - : 0); - groupEntity.setMaterial_weight(ObjectUtil.isNotEmpty(extGroupData) - ? extGroupData.getBigDecimal("material_qty") - : BigDecimal.valueOf(0)); - groupEntity.setWorkorder_code(ObjectUtil.isNotEmpty(workorderCode) - ? workorderCode.getWorkorder_code() - : ""); - groupEntity.setVehicle_code(vehicle_code); - groupEntity.setVehicle_type(taskObj.getVehicle_type()); - groupEntity.setPoint_code(startPoint); - groupEntity.setPoint_name(startPointObj.getPoint_name()); - groupEntity.setPcsn(DateUtil.format(DateUtil.date(), "yyyyMMdd")); -// groupEntity.setInstorage_time(DateUtil.now()); - groupEntity.setTask_code(taskObj.getTask_code()); - groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 绑定 - groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。 - groupEntity.setIs_delete(false); - groupEntity.setMove_way(startPoint); - vehiclematerialgroupService.save(groupEntity); // 任务完成 taskObj.setTask_status(TaskStatus.FINISHED.getCode()); - taskObj.setGroup_id(ObjectUtil.isNotEmpty(groupEntity)?groupEntity.getGroup_id():null); taskObj.setRemark("任务完成"); - try { - //todo 入库成功后上报mes - }catch (Exception e){ - log.error("原材料入库上报MES失败{}",e.getMessage(),e); - } } if (status.equals(TaskStatus.CANCELED)) { // 取消 // 终点解锁 diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java index c8761ce..9f5b1e7 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java @@ -164,46 +164,9 @@ public class SSXBKJTask extends AbstractTask { endPointObj.setVehicle_code(ObjectUtil.isEmpty(endPointObj.getVehicle_code()) ? vehicle_code + "," : endPointObj.getVehicle_code() + vehicle_code + ","); endPointObj.setVehicle_qty(1); pointService.update(endPointObj); - // 要把数据存到组盘表 -> 改造公共方法,返回id - //todo 组盘表需要关联外部mes晶棒数据,一对多 - SchBaseVehiclematerialgroup groupEntity = new SchBaseVehiclematerialgroup(); - groupEntity.setGroup_id(IdUtil.getSnowflake(1, 1).nextIdStr()); - groupEntity.setCreate_id("2"); - groupEntity.setCreate_name("ACS"); - groupEntity.setCreate_time(DateUtil.now()); - groupEntity.setMaterial_id(ObjectUtil.isNotEmpty(workorderCode) - ? workorderCode.getMaterial_id() - : ""); - groupEntity.setStanding_time(ObjectUtil.isNotEmpty(workorderCode) - ? workorderCode.getStanding_time() - : 0); - groupEntity.setMaterial_weight(ObjectUtil.isNotEmpty(extGroupData) - ? extGroupData.getBigDecimal("material_qty") - : BigDecimal.valueOf(0)); - groupEntity.setWorkorder_code(ObjectUtil.isNotEmpty(workorderCode) - ? workorderCode.getWorkorder_code() - : ""); - groupEntity.setVehicle_code(vehicle_code); - groupEntity.setVehicle_type(taskObj.getVehicle_type()); - groupEntity.setPoint_code(startPoint); - groupEntity.setPoint_name(startPointObj.getPoint_name()); - groupEntity.setPcsn(DateUtil.format(DateUtil.date(), "yyyyMMdd")); -// groupEntity.setInstorage_time(DateUtil.now()); - groupEntity.setTask_code(taskObj.getTask_code()); - groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 绑定 - groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。 - groupEntity.setIs_delete(false); - groupEntity.setMove_way(startPoint); - vehiclematerialgroupService.save(groupEntity); // 任务完成 taskObj.setTask_status(TaskStatus.FINISHED.getCode()); - taskObj.setGroup_id(ObjectUtil.isNotEmpty(groupEntity)?groupEntity.getGroup_id():null); taskObj.setRemark("任务完成"); - try { - //todo 入库成功后上报mes - }catch (Exception e){ - log.error("原材料入库上报MES失败{}",e.getMessage(),e); - } } if (status.equals(TaskStatus.CANCELED)) { // 取消 // 终点解锁 diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java index f4ee963..9218f99 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java @@ -204,9 +204,11 @@ public class YCLCKTask extends AbstractTask { one.setMove_way(one.getMove_way() == null ? "" : (one.getMove_way() + " -> ") + endPointObj.getPoint_code()); one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); one.setInstorage_time(DateUtil.now()); + one.setStanding_time(Integer.valueOf(extGroupData.getString("time"))); one.setUpdate_id(GeneralDefinition.ACS_ID); one.setUpdate_name(GeneralDefinition.ACS_NAME); one.setUpdate_time(DateUtil.now()); + one.setPcsn(extGroupData.getString("batch")); vehiclematerialgroupService.updateById(one); } // 终点解锁 @@ -232,7 +234,7 @@ public class YCLCKTask extends AbstractTask { .eq(Material::getPalletSN, taskObj.getVehicle_code2()) .eq(Material::getGroup_bind_material_status, GroupBindMaterialStatusEnum.BOUND.getValue())); if (ObjectUtil.isNotEmpty(materialList)) { - String url = "http://192.168.9.5/sitAppWebApi/PDSToWMS/Api/QPMES065"; + String url = "http://192.168.9.124/sitAppWebApi/PDSToWMS/Api/QPMES065"; QPMES065Request qpmes065Request = new QPMES065Request(); List qpmes065RequestBodyList=new ArrayList<>(); Head head=new Head(); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java index 2dd590c..5955475 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java @@ -206,7 +206,7 @@ public class YCLRKTask extends AbstractTask { try { //todo 待确认具体传值 if(ObjectUtil.isNotEmpty(materialList)) { - String url = "http://192.168.9.5/sitAppWebApi/PDSToWMS/Api/QPMES062 "; + String url = "http://192.168.9.124/sitAppWebApi/PDSToWMS/Api/QPMES062"; QPMES062Request qpmes062Request = new QPMES062Request(); Head head=new Head(); head.setDEST_SYSTEM("WMS"); @@ -274,7 +274,7 @@ public class YCLRKTask extends AbstractTask { : ""); groupEntity.setPoint_code(startPoint); groupEntity.setPoint_name(startPointObj.getPoint_name()); - groupEntity.setPcsn(DateUtil.format(DateUtil.date(), "yyyyMMdd")); +// groupEntity.setPcsn(DateUtil.format(DateUtil.date(), "yyyyMMdd")); // groupEntity.setInstorage_time(DateUtil.now()); groupEntity.setTask_code(taskObj.getTask_code()); groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 绑定