modified: 烘烤质检、修改温度/时间
add: 烘烤提示信息
This commit is contained in:
@@ -32,4 +32,14 @@ public class BakingPdaController {
|
|||||||
public ResponseEntity<Object> bakingQuality(@RequestBody JSONObject whereJson) {
|
public ResponseEntity<Object> bakingQuality(@RequestBody JSONObject whereJson) {
|
||||||
return new ResponseEntity<>(bakingPdaService.bakingQuality(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(bakingPdaService.bakingQuality(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@PostMapping("/getHotTempPointInfo")
|
||||||
|
@Log("获取烘箱暂存位信息")
|
||||||
|
public ResponseEntity<Object> getHotTempPointInfo(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(bakingPdaService.getHotTempPointInfo(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
@PostMapping("/doModifyRawInfos")
|
||||||
|
@Log("修改信息")
|
||||||
|
public ResponseEntity<Object> doModifyRawInfos(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(bakingPdaService.doModifyRawInfos(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,4 +14,18 @@ public interface BakingPdaService {
|
|||||||
* @return /
|
* @return /
|
||||||
*/
|
*/
|
||||||
JSONObject bakingQuality(JSONObject param);
|
JSONObject bakingQuality(JSONObject param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取烘箱点位信息
|
||||||
|
* @param param /
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
JSONObject getHotTempPointInfo(JSONObject param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改生箔信息
|
||||||
|
* @param param /
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
JSONObject doModifyRawInfos(JSONObject param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
package org.nl.wms.pda.mps.service.impl;
|
package org.nl.wms.pda.mps.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.wms.pda.mps.service.BakingPdaService;
|
import org.nl.wms.pda.mps.service.BakingPdaService;
|
||||||
import org.nl.wms.pdm.bi.dao.PdmBiRawfoilworkorder;
|
import org.nl.wms.pdm.bi.dao.PdmBiRawfoilworkorder;
|
||||||
import org.nl.wms.pdm.bi.service.IpdmBiRawfoilworkorderService;
|
import org.nl.wms.pdm.bi.service.IpdmBiRawfoilworkorderService;
|
||||||
@@ -14,7 +17,9 @@ import org.nl.wms.util.PointUtils;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: lyd
|
* @Author: lyd
|
||||||
@@ -32,22 +37,17 @@ public class BakingPdaServiceImpl implements BakingPdaService {
|
|||||||
@Override
|
@Override
|
||||||
public JSONObject bakingQuality(JSONObject param) {
|
public JSONObject bakingQuality(JSONObject param) {
|
||||||
log.info("手持操作烘烤质检:{}", param);
|
log.info("手持操作烘烤质检:{}", param);
|
||||||
// param: point_code, vehicle_code,quality(1: 合格,0: 不合格)
|
// param: point_code,quality(1: 合格,0: 不合格)
|
||||||
String quality = param.getString("quality");
|
String quality = param.getString("quality");
|
||||||
String pointCode = param.getString("point_code");
|
String pointCode = param.getString("point_code");
|
||||||
String vehicleCode = param.getString("vehicle_code");
|
|
||||||
Assert.notBlank(pointCode, "点位不能为空!");
|
Assert.notBlank(pointCode, "点位不能为空!");
|
||||||
Assert.notBlank(vehicleCode, "收卷辊不能为空!");
|
|
||||||
SchBasePoint hotZcPoint = pointService.getById(pointCode);
|
SchBasePoint hotZcPoint = pointService.getById(pointCode);
|
||||||
if (ObjectUtil.isEmpty(hotZcPoint)) {
|
if (ObjectUtil.isEmpty(hotZcPoint)) {
|
||||||
throw new BadRequestException("点位 [" + pointCode + "] 不存在!");
|
throw new BadRequestException("点位 [" + pointCode + "] 不存在!");
|
||||||
}
|
}
|
||||||
List<PdmBiRawfoilworkorder> rawOrderList = rawfoilworkorderService.getOrderByVehicleAndStatus(vehicleCode, "04");
|
PdmBiRawfoilworkorder rawOrder = rawfoilworkorderService.getById(hotZcPoint.getSource_id());
|
||||||
if (rawOrderList.size() > 1) {
|
if (ObjectUtil.isEmpty(rawOrder)) {
|
||||||
throw new BadRequestException("收卷辊 [" + vehicleCode + "] 对应的生箔工单存在多条,请将其他多余工单结束!");
|
throw new BadRequestException("点位 [" + pointCode + "] 对应的生箔工单不存在!");
|
||||||
}
|
|
||||||
if (rawOrderList.size() == 0) {
|
|
||||||
throw new BadRequestException("收卷辊 [" + vehicleCode + "] 对应的生箔工单不存在!");
|
|
||||||
}
|
}
|
||||||
if ("0".equals(quality)) {
|
if ("0".equals(quality)) {
|
||||||
// 重复烘烤
|
// 重复烘烤
|
||||||
@@ -62,4 +62,82 @@ public class BakingPdaServiceImpl implements BakingPdaService {
|
|||||||
result.put("message", "操作成功!");
|
result.put("message", "操作成功!");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject getHotTempPointInfo(JSONObject param) {
|
||||||
|
// param: point_code, 可选:order_code
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
String pointCode = param.getString("point_code");
|
||||||
|
String orderCode = param.getString("order_code");
|
||||||
|
SchBasePoint hotPoint = pointService.getById(pointCode);
|
||||||
|
List<String> tip = new ArrayList<>();
|
||||||
|
if (orderCode == null) {
|
||||||
|
if (ObjectUtil.isEmpty(hotPoint.getSource_id())) {
|
||||||
|
result.put("container_name", "该点位不存在母卷信息");
|
||||||
|
result.put("status", "空位");
|
||||||
|
tip.add("点位不存在工单信息");
|
||||||
|
} else {
|
||||||
|
PdmBiRawfoilworkorder rawOrder = rawfoilworkorderService.getById(hotPoint.getSource_id());
|
||||||
|
result.put("container_name", rawOrder.getContainer_name());
|
||||||
|
result.put("status", hotPoint.getPoint_status());
|
||||||
|
doCheckEmptyOrderInfo(tip, rawOrder);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
PdmBiRawfoilworkorder rawOrder = rawfoilworkorderService.getByContainerName(orderCode);
|
||||||
|
if (rawOrder.getWorkorder_id().equals(hotPoint.getSource_id())) {
|
||||||
|
result.put("container_name", rawOrder.getContainer_name());
|
||||||
|
result.put("status", hotPoint.getPoint_status());
|
||||||
|
doCheckEmptyOrderInfo(tip, rawOrder);
|
||||||
|
} else {
|
||||||
|
result.put("container_name", "-");
|
||||||
|
result.put("status", hotPoint.getPoint_status());
|
||||||
|
tip.add("系统信息与扫描的转运卡号信息不一致");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (tip.size() == 0) {
|
||||||
|
tip.add("暂无提示信息!");
|
||||||
|
}
|
||||||
|
String collect = tip.stream().collect(Collectors.joining(" , "));
|
||||||
|
result.put("tip", collect);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject doModifyRawInfos(JSONObject param) {
|
||||||
|
log.info("手持修改温度/时间 - {}", param);
|
||||||
|
// point_code, temperature, time
|
||||||
|
String pointCode = param.getString("point_code");
|
||||||
|
String temperature = param.getString("temperature");
|
||||||
|
String time = param.getString("time");
|
||||||
|
SchBasePoint hotPoint = pointService.getById(pointCode);
|
||||||
|
if (ObjectUtil.isEmpty(hotPoint.getSource_id())) {
|
||||||
|
throw new BadRequestException("点位 [" + pointCode + "] 不存在生箔工单信息!");
|
||||||
|
}
|
||||||
|
PdmBiRawfoilworkorder order = rawfoilworkorderService.getById(hotPoint.getSource_id());
|
||||||
|
if (ObjectUtil.isEmpty(order)) {
|
||||||
|
throw new BadRequestException("生箔工单不存在!");
|
||||||
|
}
|
||||||
|
LambdaUpdateWrapper<PdmBiRawfoilworkorder> lam = new LambdaUpdateWrapper<>();
|
||||||
|
lam.set(PdmBiRawfoilworkorder::getBaking_temperature, temperature)
|
||||||
|
.set(PdmBiRawfoilworkorder::getBaking_time, time)
|
||||||
|
.set(PdmBiRawfoilworkorder::getUpdate_optid, SecurityUtils.getCurrentUserId())
|
||||||
|
.set(PdmBiRawfoilworkorder::getUpdate_optname, SecurityUtils.getCurrentNickName())
|
||||||
|
.set(PdmBiRawfoilworkorder::getUpdate_time, DateUtil.now())
|
||||||
|
.eq(PdmBiRawfoilworkorder::getWorkorder_id, hotPoint.getSource_id());
|
||||||
|
rawfoilworkorderService.update(lam);
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
result.put("message", "操作成功!");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void doCheckEmptyOrderInfo(List<String> tip, PdmBiRawfoilworkorder rawOrder) {
|
||||||
|
if ("1".equals(rawOrder.getIs_baking())) {
|
||||||
|
if (ObjectUtil.isEmpty(rawOrder.getBaking_temperature())) {
|
||||||
|
tip.add("烘烤温度不能为空,请维护");
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(rawOrder.getBaking_time())) {
|
||||||
|
tip.add("烘烤时间不能为空,请维护");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import static org.nl.wms.util.TaskUtils.checkTaskOptionStatus;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: lyd
|
* @Author: lyd
|
||||||
* @Description: 自动创建入烘箱任务
|
* @Description: 自动创建入烘箱任务 todo: 考虑温度与时间没有信息也不入
|
||||||
* <p>通过定时任务 {@link org.nl.wms.quartz.AutoCreateInHotTask} 调用此类</p>
|
* <p>通过定时任务 {@link org.nl.wms.quartz.AutoCreateInHotTask} 调用此类</p>
|
||||||
* @Date: 2024/8/9
|
* @Date: 2024/8/9
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import static org.nl.wms.util.PointUtils.setHxUpdateByType;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: lyd
|
* @Author: lyd
|
||||||
* @Description: 入烘箱的任务类 todo: 需要修改
|
* @Description: 入烘箱的任务类 todo: 需要修改, 考虑温度与时间没有信息也不入
|
||||||
* @Date: 2024/8/8
|
* @Date: 2024/8/8
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|||||||
Reference in New Issue
Block a user