Browse Source

看板fix

master
psh 7 months ago
parent
commit
4d237db025
  1. 98
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/controller/BoardController.java
  2. 23
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/BoardService.java
  3. 14
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/dto/HwDto.java
  4. 15
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/dto/ScDto.java
  5. 13
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/dto/WlDto.java
  6. 20
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/mapper/BoardMapper.java
  7. 108
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/mapper/BoardMapper.xml
  8. 49
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/impl/BoardServiceImpl.java
  9. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java
  10. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/controller/PointDetailController.java
  11. 37
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java
  12. 37
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java
  13. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java
  14. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java

98
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<Object> cz(@RequestBody JSONObject param){
return new ResponseEntity<>(boardService.cz(param), HttpStatus.OK);
}
@PostMapping("/rk/kc")
@Log("入库看板库存")
@ApiOperation("入库看板库存")
@SaIgnore
public ResponseEntity<Object> kc(@RequestBody JSONObject param){
return new ResponseEntity<>(boardService.kc(), HttpStatus.OK);
}
@PostMapping("/rk/hw")
@Log("入库看板货位占用")
@ApiOperation("入库看板货位占用")
@SaIgnore
public ResponseEntity<Object> hw(@RequestBody JSONObject param){
return new ResponseEntity<>(boardService.hw(), HttpStatus.OK);
}
@PostMapping("/rk/kn")
@Log("入库看板库内物料")
@ApiOperation("入库看板库内物料")
@SaIgnore
public ResponseEntity<Object> kn(@RequestBody JSONObject param){
return new ResponseEntity<>(boardService.kn(), HttpStatus.OK);
}
@PostMapping("/rk/wrk")
@Log("入库看板未入库物料")
@ApiOperation("入库看板未入库物料")
@SaIgnore
public ResponseEntity<Object> wrk(@RequestBody JSONObject param){
return new ResponseEntity<>(boardService.wrk(), HttpStatus.OK);
}
@PostMapping("/sc/pt")
@Log("生产看板普通回温")
@ApiOperation("生产看板普通回温")
@SaIgnore
public ResponseEntity<Object> pt(){
return new ResponseEntity<>(boardService.sc("HW"), HttpStatus.OK);
}
@PostMapping("/sc/ks")
@Log("生产看板快速回温")
@ApiOperation("生产看板快速回温")
@SaIgnore
public ResponseEntity<Object> ks(){
return new ResponseEntity<>(boardService.sc("HWK"), HttpStatus.OK);
}
}

23
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<WlDto> kn();
List<WlDto> wrk();
List<ScDto> sc(String region_code);
}

14
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;
}

15
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;
}

13
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;
}

20
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<ScDto> sc(String region_code);
List<WlDto> kn();
List<WlDto> wrk();
HwDto hw();
}

108
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/board/service/dao/mapper/BoardMapper.xml

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.nl.wms.board.service.dao.mapper.BoardMapper">
<select id="sc" resultType="org.nl.wms.board.service.dao.dto.ScDto">
SELECT
*,
CASE
WHEN b.standing_time > b.usedTime THEN
0 ELSE 1
END AS state
FROM
(
SELECT
productName,
supplierName,
productDescription,
pcsn AS batch,
standing_time,
TIMESTAMPDIFF(
HOUR,
instorage_time,
curtime()) AS usedTime
FROM
(
SELECT
*
FROM
sch_base_vehiclematerialgroup
WHERE
vehicle_code IN ( SELECT vehicle_code2 FROM sch_base_point WHERE region_code = #{region_code} AND vehicle_code IS NOT NULL )) a
LEFT JOIN sch_base_material m ON a.vehicle_code = m.PalletSN
AND m.group_bind_material_status = 2
) b
</select>
<select id="kn" resultType="org.nl.wms.board.service.dao.dto.WlDto">
SELECT
a.palletSN,
any_value ( a.productName ),
any_value ( a.productDescription ),
sum( a.qty ),
sum( a.incomingWeight ),
any_value ( a.supplierName )
FROM
(
SELECT
m.*
FROM
sch_base_material m,
sch_base_point p
WHERE
m.PalletSN = p.vehicle_code2
AND p.region_code = 'YL'
) a
GROUP BY
PalletSN;
</select>
<select id="wrk" resultType="org.nl.wms.board.service.dao.dto.WlDto">
SELECT
a.palletSN,
any_value ( a.productName ),
any_value ( a.productDescription ),
sum( a.qty ),
sum( a.incomingWeight ),
any_value ( a.supplierName )
FROM
(
SELECT
m.*
FROM
sch_base_material m
WHERE
m.PalletSN NOT IN ( SELECT vehicle_code2 FROM sch_base_point where vehicle_code2 is not null )) a
GROUP BY
PalletSN;
</select>
<select id="hw" resultType="org.nl.wms.board.service.dao.dto.HwDto">
SELECT
a.*,
b.*,
emptyRemain * 10 AS emptyQty
FROM
(
SELECT
COUNT(*) AS pointNumber,
SUM( CASE WHEN vehicle_code2 = '' OR vehicle_code2 IS NULL THEN 1 ELSE 0 END ) AS pointUsed,
SUM( CASE WHEN vehicle_code2 != '' AND vehicle_code2 IS NOT NULL THEN 1 ELSE 0 END ) AS pointRemain
FROM
sch_base_point
WHERE
region_code IN ( 'YL', 'HW', 'HWK' )
) a,
(
SELECT
COUNT(*) AS emptyNumber,
SUM( CASE WHEN vehicle_qty = 0 THEN 1 ELSE 0 END ) AS emptyUsed,
SUM( CASE WHEN vehicle_qty = 1 THEN 1 ELSE 0 END ) AS emptyRemain
FROM
sch_base_point
WHERE
region_code IN ( 'KJHC' )
)b
</select>
</mapper>

49
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<WlDto> kn(){
return boardMapper.kn();
}
public List<WlDto> wrk(){
return boardMapper.wrk();
}
public List<ScDto> sc(String region_code){
return boardMapper.sc(region_code);
}
}

2
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("回温状态查询成功");
}

2
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);

37
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)) { // 取消
// 终点解锁

37
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)) { // 取消
// 终点解锁

4
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<QPMES065RequestBody> qpmes065RequestBodyList=new ArrayList<>();
Head head=new Head();

4
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()); // 绑定

Loading…
Cancel
Save