Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -3,6 +3,7 @@ package org.nl.b_lms.bst.ivt.cutpointivt.service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dto.BstIvtCutpointivtQuery;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dto.CutpointAirShhaftDto;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.SlitterPlanDistinctDto;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@@ -65,13 +66,12 @@ public interface IBstIvtCutpointivtService extends IService<BstIvtCutpointivt> {
|
||||
List<BstIvtCutpointivt> getAreaNotTaskPointByStatusNotCheckPickUpCompleted(String type, String pointStatus, String area, String sort);
|
||||
|
||||
/**
|
||||
* 获取同尺寸的气涨轴
|
||||
* @param type 点位类型:1套轴对接位,2分切缓存位,3分切对接位,4套轴异常位
|
||||
* @param size 气涨轴尺寸
|
||||
* @param generation 代数(4:小,5:大)
|
||||
* 获取空的子卷下线满轴位点
|
||||
* @param point_status 点位类型:1套轴对接位,2分切缓存位,3分切对接位,4套轴异常位
|
||||
* @param ivt_status 气涨轴尺寸
|
||||
* @return /
|
||||
*/
|
||||
List<BstIvtCutpointivt> getPointByTypeAndShaftSize(String type, String size, String generation);
|
||||
List<BstIvtPackageinfoivt> getPointByStatus(String point_status, String ivt_status);
|
||||
|
||||
/**
|
||||
* 根据桁架对应的点位编码获取点位实体
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.b_lms.bst.ivt.cutpointivt.service.dao.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dto.CutpointAirShhaftDto;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.SlitterPlanDistinctDto;
|
||||
|
||||
import java.util.List;
|
||||
@@ -15,7 +16,7 @@ public interface BstIvtCutpointivtMapper extends BaseMapper<BstIvtCutpointivt> {
|
||||
|
||||
List<BstIvtCutpointivt> getAreaNotTaskPointByStatus(String type, String pointStatus, String area, String sort);
|
||||
|
||||
List<BstIvtCutpointivt> getPointByTypeAndShaftSize(String type, String size, String generation);
|
||||
List<BstIvtPackageinfoivt> getPointByStatus(String point_status, String ivt_status);
|
||||
|
||||
List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location);
|
||||
|
||||
|
||||
@@ -26,26 +26,19 @@
|
||||
</if>
|
||||
|
||||
</select>
|
||||
<select id="getPointByTypeAndShaftSize"
|
||||
resultType="org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt">
|
||||
<select id="getPointByStatus"
|
||||
resultType="org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt">
|
||||
SELECT bc.*
|
||||
FROM `bst_ivt_cutpointivt` bc
|
||||
LEFT JOIN pdm_bi_slittingproductionplan pp ON pp.qzzno = bc.qzz_no1
|
||||
OR pp.qzzno = bc.qzz_no2
|
||||
WHERE bc.point_type = #{type}
|
||||
AND IFNULL(pp.qzzno,'') <![CDATA[ <> ]]> ''
|
||||
AND pp.qzz_size = #{size}
|
||||
<if test="size == '3'">
|
||||
AND pp.qzz_generation = #{generation}
|
||||
</if>
|
||||
FROM `bst_ivt_packageinfoivt` bc
|
||||
WHERE bc.point_status = #{point_status}
|
||||
AND bc.ivt_status = #{ivt_status}
|
||||
AND bc.is_used = '1'
|
||||
AND bc.point_status = '3'
|
||||
AND IFNULL(pp.workorder_id,'') <![CDATA[ <> ]]> ''
|
||||
AND 0 = (SELECT COUNT(*)
|
||||
FROM sch_base_task t
|
||||
WHERE t.task_status <![CDATA[ < ]]> '07'
|
||||
AND t.is_delete = '0'
|
||||
AND (t.point_code1 = bc.truss_point_code1 OR t.point_code1 = bc.truss_point_code2))
|
||||
AND (t.point_code1 = bc.point_code OR t.point_code2 = bc.point_code OR t.point_code3 = bc.point_code OR t.point_code4 = bc.point_code))
|
||||
order by bc.sort_seq
|
||||
</select>
|
||||
<select id="getAreaNotTaskPointByLocationAreaAndStatus"
|
||||
resultType="org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt">
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.mapper.BstIvtCutpointivtMapper;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dto.BstIvtCutpointivtQuery;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dto.CutpointAirShhaftDto;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.SlitterPlanDistinctDto;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
@@ -102,8 +103,8 @@ public class BstIvtCutpointivtServiceImpl extends ServiceImpl<BstIvtCutpointivtM
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BstIvtCutpointivt> getPointByTypeAndShaftSize(String type, String size, String generation) {
|
||||
return bstIvtCutpointivtMapper.getPointByTypeAndShaftSize(type, size, generation);
|
||||
public List<BstIvtPackageinfoivt> getPointByStatus(String point_status, String ivt_status) {
|
||||
return bstIvtCutpointivtMapper.getPointByStatus(point_status, ivt_status);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -56,12 +56,6 @@ public class BstIvtStockingivtController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("操作管芯托盘库存")
|
||||
@PostMapping("operateIvt")
|
||||
public ResponseEntity<Object> operateIvt(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(bstIvtStockingivtService.operateIvt(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("查询管芯托盘库存明细")
|
||||
@PostMapping("/showDetail")
|
||||
public ResponseEntity<Object> showDetail(@RequestBody JSONObject param) {
|
||||
|
||||
@@ -81,8 +81,6 @@ public interface IBstIvtStockingivtService extends IService<BstIvtStockingivt> {
|
||||
*/
|
||||
BstIvtStockingivt getCanMovePointOne(String location, String pointType);
|
||||
|
||||
JSONObject operateIvt(JSONObject jsonObject) ;
|
||||
|
||||
/**
|
||||
* 分组聚合获取需要管芯的托盘位置
|
||||
* @param pointType
|
||||
|
||||
@@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.bst.ivt.paper.service.dao.MdPbPaper;
|
||||
import org.nl.b_lms.bst.ivt.paper.service.dao.mapper.MdPbPaperMapper;
|
||||
import org.nl.b_lms.bst.ivt.papervehicle.service.IMdPbPapervehicleService;
|
||||
import org.nl.b_lms.bst.ivt.papervehicle.service.dao.MdPbPapervehicle;
|
||||
import org.nl.b_lms.bst.ivt.stockingivt.service.IBstIvtStockingivtService;
|
||||
@@ -32,6 +34,7 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -133,178 +136,6 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
||||
return bstIvtStockingivtMapper.getCanMovePointOne(location, pointType);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// List<String> lines = new ArrayList<>();
|
||||
// lines.add("纸制简管|纸管|6英寸|1300");
|
||||
// lines.add("纸制简管|纸管|3英寸|12|650");
|
||||
// lines.add("玻璃纤维及其制品|FRP管|6英寸|15-20|1700|阶梯");
|
||||
// lines.add("玻璃纤维及其制品|FRP管|6英寸|15|1700|高强");
|
||||
// // 定义正则表达式,去除最后的中文部分
|
||||
// String regex = "\\|[\\u4e00-\\u9fa5]+$";
|
||||
//
|
||||
// // 处理每一行数据
|
||||
// List<String> cleanedLines = new ArrayList<>();
|
||||
// for (String line : lines) {
|
||||
// cleanedLines.add(line.replaceAll(regex, ""));
|
||||
// }
|
||||
//
|
||||
// // 打印结果
|
||||
// for (String cleanedLine : cleanedLines) {
|
||||
// System.out.println(cleanedLine);
|
||||
// }
|
||||
String material_name = "玻璃纤维及其制品|FRP管|6英寸|15-20|1100|阶梯";
|
||||
String[] tubeArray = material_name.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
System.out.println(tubeArray);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject operateIvt(JSONObject jsonObject) {
|
||||
log.info("手持操作管芯托盘 - {}", jsonObject);
|
||||
//载具托盘号
|
||||
String vehicle_code = jsonObject.getString("vehicle_code");
|
||||
//排
|
||||
String row_num = jsonObject.getString("row_num");
|
||||
//列
|
||||
String col_num = jsonObject.getString("col_num");
|
||||
//物料
|
||||
String material_code = jsonObject.getString("material_code");
|
||||
//管芯/纸管编码
|
||||
String paper_code = jsonObject.getString("paper_code");
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
if (ObjectUtil.isEmpty(row_num)) {
|
||||
throw new BadRequestException("排数不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(col_num)) {
|
||||
throw new BadRequestException("列数不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("托盘信息不能为空!");
|
||||
}
|
||||
if(!vehicle_code.contains("GX")){
|
||||
throw new BadRequestException("请扫描或输入正确的托盘码!");
|
||||
}
|
||||
//1-绑定;2-清除
|
||||
String type = jsonObject.getString("type");
|
||||
if (type.equals("1")) {
|
||||
if (ObjectUtil.isEmpty(material_code)) {
|
||||
throw new BadRequestException("物料编码不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(paper_code)) {
|
||||
throw new BadRequestException("管芯/纸管编码不能为空!");
|
||||
}
|
||||
MaterialbaseDto mater = materialbaseService.findByCode(material_code);
|
||||
String material_name = mater.getMaterial_name();
|
||||
//查询当前载具和排列是否存在库存
|
||||
MdPbPapervehicle papervehicle = papervehicleService.getOne(new LambdaQueryWrapper<MdPbPapervehicle>()
|
||||
.eq(MdPbPapervehicle::getVehicle_code, vehicle_code)
|
||||
.eq(MdPbPapervehicle::getRow_num, row_num)
|
||||
.eq(MdPbPapervehicle::getCol_num, col_num));
|
||||
if (ObjectUtil.isNotEmpty(papervehicle) && !papervehicle.getMaterial_code().equals(material_code)) {
|
||||
throw new BadRequestException("当前排-列已有物料为【" + papervehicle.getMaterial_code() + "】,如需要修改请先清除库存,再进行绑定!");
|
||||
}
|
||||
//查询当前管芯编码是否在托盘中
|
||||
MdPbPapervehicle papervehicle_flag = papervehicleService.getOne(new LambdaQueryWrapper<MdPbPapervehicle>()
|
||||
.eq(MdPbPapervehicle::getPaper_code, paper_code));
|
||||
if (ObjectUtil.isNotEmpty(papervehicle_flag)) {
|
||||
throw new BadRequestException("当前管芯编码已存在托盘上:" + papervehicle_flag.getVehicle_code() + "所在位置排列:"+papervehicle_flag.getRow_num()+"-"+papervehicle_flag.getCol_num());
|
||||
}
|
||||
//获取当前纸管的高度
|
||||
// 解析描述数组
|
||||
String[] tubeArray = material_name.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
|
||||
int currLength = Integer.parseInt(tubeArray[tubeArray.length - 1]);
|
||||
|
||||
//校验高度差要大于50MM,否则不允许进行绑定
|
||||
int num = Integer.parseInt(row_num);
|
||||
if (num == 1) {
|
||||
//只判断第二排的纸管长度
|
||||
int nextNum = num + 1;
|
||||
MdPbPapervehicle nextPaper = papervehicleService.getOne(new LambdaQueryWrapper<MdPbPapervehicle>().eq(MdPbPapervehicle::getVehicle_code, vehicle_code)
|
||||
.eq(MdPbPapervehicle::getRow_num, nextNum));
|
||||
if (ObjectUtil.isNotEmpty(nextPaper)) {
|
||||
//获取第二排的纸管高度和纸管类型
|
||||
String nextMaterialName = nextPaper.getMaterial_name();
|
||||
String[] nextArray = nextMaterialName.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
int nextLength = Integer.parseInt(nextArray[nextArray.length - 1]);
|
||||
if (Math.abs(nextLength - currLength) <= 50 && !material_code.equals(nextPaper.getMaterial_code())) {
|
||||
throw new BadRequestException("相邻排的纸管高度差要大于等于50MM!");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//判断后一排的纸管高度
|
||||
int nextNum = num + 1;
|
||||
MdPbPapervehicle nextPaper = papervehicleService.getOne(new LambdaQueryWrapper<MdPbPapervehicle>().eq(MdPbPapervehicle::getVehicle_code, vehicle_code)
|
||||
.eq(MdPbPapervehicle::getRow_num, nextNum));
|
||||
if (ObjectUtil.isNotEmpty(nextPaper)) {
|
||||
//获取后一排的纸管高度和纸管类型
|
||||
String nextMaterialName = nextPaper.getMaterial_name();
|
||||
String[] nextArray = nextMaterialName.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
int nextLength = Integer.parseInt(nextArray[nextArray.length - 1]);
|
||||
if (Math.abs(nextLength - currLength) <= 50 && !material_code.equals(nextPaper.getMaterial_code())) {
|
||||
throw new BadRequestException("相邻排的纸管高度差要大于等于50MM!");
|
||||
}
|
||||
}
|
||||
//判断前一排的纸管高度
|
||||
int preNum = num - 1;
|
||||
MdPbPapervehicle prePaper = papervehicleService.getOne(new LambdaQueryWrapper<MdPbPapervehicle>().eq(MdPbPapervehicle::getVehicle_code, vehicle_code)
|
||||
.eq(MdPbPapervehicle::getRow_num, preNum));
|
||||
if (ObjectUtil.isNotEmpty(prePaper)) {
|
||||
//获取后一排的纸管高度和纸管类型
|
||||
String preMaterialName = prePaper.getMaterial_name();
|
||||
String[] preArray = preMaterialName.replaceAll("\\|[\\u4e00-\\u9fa5]+$", "").split("\\|");
|
||||
int preLength = Integer.parseInt(preArray[preArray.length - 1]);
|
||||
if (Math.abs(preLength - currLength) <= 50 && !material_code.equals(prePaper.getMaterial_code())) {
|
||||
throw new BadRequestException("相邻排的纸管高度差要大于等于50MM!");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(papervehicle)) {
|
||||
papervehicle.setQty(1);
|
||||
papervehicle.setUpdate_optid(currentUserId);
|
||||
papervehicle.setUpdate_optname(nickName);
|
||||
papervehicle.setUpdate_time(now);
|
||||
papervehicleService.updateById(papervehicle);
|
||||
} else {
|
||||
papervehicle = new MdPbPapervehicle();
|
||||
papervehicle.setIvt_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
papervehicle.setVehicle_code(vehicle_code);
|
||||
papervehicle.setRow_num(row_num);
|
||||
papervehicle.setMaterial_code(material_code);
|
||||
papervehicle.setMaterial_name(material_name);
|
||||
papervehicle.setQty(1);
|
||||
papervehicle.setUpdate_optid(currentUserId);
|
||||
papervehicle.setUpdate_optname(nickName);
|
||||
papervehicle.setUpdate_time(now);
|
||||
papervehicleService.save(papervehicle);
|
||||
}
|
||||
}else if (type.equals("2")) {
|
||||
//清除管芯托盘库存
|
||||
papervehicleService.remove(new LambdaQueryWrapper<MdPbPapervehicle>().eq(MdPbPapervehicle::getVehicle_code, vehicle_code)
|
||||
.eq(MdPbPapervehicle::getRow_num, row_num)
|
||||
.eq(MdPbPapervehicle::getCol_num, col_num));
|
||||
}
|
||||
|
||||
//判断绑定的纸管是否在机械手范围内,如果存在的话把最新库存推送给电气
|
||||
BstIvtStockingivt bstIvtStockingivt = bstIvtStockingivtMapper.selectOne(new LambdaQueryWrapper<BstIvtStockingivt>().eq(BstIvtStockingivt::getVehicle_code, vehicle_code));
|
||||
if (bstIvtStockingivt != null && bstIvtStockingivt.getPoint_type().equals("1")) {
|
||||
List<MdPbPapervehicle> list = papervehicleService.list(new LambdaQueryWrapper<MdPbPapervehicle>().eq(MdPbPapervehicle::getVehicle_code, vehicle_code));
|
||||
JSONObject jo = new JSONObject();
|
||||
SlitterTaskUtil.doSavePaperInfos(list, jo);
|
||||
jo.put("product_area", bstIvtStockingivt.getProduct_area());
|
||||
jo.put("device_code", bstIvtStockingivt.getPoint_code());
|
||||
wmsToAcsService.getTubeMsg(jo);
|
||||
}
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "操作成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BhTubePointDto> getNeedPaperTubePoint(String pointType, String tube, String location) {
|
||||
return bstIvtStockingivtMapper.getNeedPaperTubePoint(pointType, tube, location);
|
||||
|
||||
@@ -43,6 +43,12 @@ public class SlitterPdaController {
|
||||
public ResponseEntity<Object> downRolls2(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(slitterService.downRolls2(param), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/downShafts")
|
||||
@Log("下轴")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> downShafts(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(slitterService.downShafts(param), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/downRollsCheck")
|
||||
@Log("下卷2提示确认")
|
||||
@SaIgnore
|
||||
|
||||
@@ -71,10 +71,10 @@ public class StockingIvtController {
|
||||
}
|
||||
|
||||
@Log("操作管芯托盘库存")
|
||||
@PostMapping("operateIvt")
|
||||
@PostMapping("/operateIvt")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> operateIvt(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(bstIvtStockingivtService.operateIvt(param), HttpStatus.OK);
|
||||
return new ResponseEntity<>(stockingIvtService.operateIvt(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.bst.ivt.paper.service.dao.MdPbPaper;
|
||||
import org.nl.b_lms.bst.ivt.paper.service.dao.mapper.MdPbPaperMapper;
|
||||
import org.nl.b_lms.bst.ivt.papervehicle.service.IMdPbPapervehicleService;
|
||||
import org.nl.b_lms.bst.ivt.papervehicle.service.dao.MdPbPapervehicle;
|
||||
import org.nl.b_lms.bst.ivt.stockingivt.service.IBstIvtStockingivtService;
|
||||
@@ -19,7 +21,6 @@ import org.nl.b_lms.sch.tasks.slitter.InstorStockAgvTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterEnum;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil;
|
||||
import org.nl.b_lms.storage_manage.md.service.MaterialbaseService;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.common.utils.TaskUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
@@ -32,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -42,20 +44,20 @@ import java.util.List;
|
||||
@Slf4j
|
||||
@Service
|
||||
public class StockingIvtServiceImpl implements StockingIvtService {
|
||||
@Autowired
|
||||
@Resource
|
||||
private BstIvtStockingivtMapper bstIvtStockingivtMapper;
|
||||
@Autowired
|
||||
private IBstIvtStockingivtService stockingivtService;
|
||||
@Autowired
|
||||
private InstorStockAgvTask instorStockAgvTask;
|
||||
@Autowired
|
||||
@Resource
|
||||
private SysDictMapper sysDictMapper;
|
||||
@Autowired
|
||||
private WmsToAcsService wmsToAcsService;
|
||||
@Autowired
|
||||
private IMdPbPapervehicleService papervehicleService;
|
||||
@Autowired
|
||||
private MaterialbaseService materialbaseService;
|
||||
@Resource
|
||||
private MdPbPaperMapper mdPbPaperMapper;
|
||||
|
||||
@Override
|
||||
public JSONObject doStockAreaBinding(JSONObject param) {
|
||||
@@ -264,35 +266,45 @@ public class StockingIvtServiceImpl implements StockingIvtService {
|
||||
String row_num = jsonObject.getString("row_num");
|
||||
//列
|
||||
String col_num = jsonObject.getString("col_num");
|
||||
//物料
|
||||
String material_code = jsonObject.getString("material_code");
|
||||
//管芯/纸管编码
|
||||
String paper_code = jsonObject.getString("paper_code");
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
if (ObjectUtil.isEmpty(row_num)) {
|
||||
throw new BadRequestException("排数不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(col_num)) {
|
||||
throw new BadRequestException("列数不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("托盘信息不能为空!");
|
||||
}
|
||||
if(!vehicle_code.contains("GX")){
|
||||
throw new BadRequestException("请扫描或输入正确的托盘码!");
|
||||
}
|
||||
//1-绑定;2-清除
|
||||
String type = jsonObject.getString("type");
|
||||
if (type.equals("1")) {
|
||||
if (ObjectUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("托盘信息不能为空!");
|
||||
}
|
||||
if(!vehicle_code.contains("GX")){
|
||||
throw new BadRequestException("请扫描或输入正确的托盘码!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(material_code)) {
|
||||
throw new BadRequestException("物料不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(paper_code)) {
|
||||
throw new BadRequestException("管芯/纸管编码不能为空!");
|
||||
}
|
||||
MaterialbaseDto mater = materialbaseService.findByCode(material_code);
|
||||
String material_name = mater.getMaterial_name();
|
||||
//查询当前载具和排是否存在库存
|
||||
MdPbPapervehicle papervehicle = papervehicleService.getOne(new LambdaQueryWrapper<MdPbPapervehicle>().eq(MdPbPapervehicle::getVehicle_code, vehicle_code)
|
||||
.eq(MdPbPapervehicle::getRow_num, row_num).eq(MdPbPapervehicle::getCol_num, col_num));
|
||||
//查询管芯记录
|
||||
LambdaQueryWrapper<MdPbPaper> lam = new LambdaQueryWrapper<>();
|
||||
lam.eq( ObjectUtil.isNotEmpty(paper_code),MdPbPaper::getPaper_code,paper_code);
|
||||
MdPbPaper paper = mdPbPaperMapper.selectOne(lam);
|
||||
if(ObjectUtil.isEmpty(paper)){
|
||||
throw new BadRequestException("管芯/纸管记录不存在!");
|
||||
}
|
||||
//物料
|
||||
String material_code = paper.getMaterial_code();
|
||||
String material_name = paper.getMaterial_name();
|
||||
//查询当前载具和排列是否存在库存
|
||||
MdPbPapervehicle papervehicle = papervehicleService.getOne(new LambdaQueryWrapper<MdPbPapervehicle>()
|
||||
.eq(MdPbPapervehicle::getVehicle_code, vehicle_code)
|
||||
.eq(MdPbPapervehicle::getRow_num, row_num)
|
||||
.eq(MdPbPapervehicle::getCol_num, col_num));
|
||||
if (ObjectUtil.isNotEmpty(papervehicle) && !papervehicle.getMaterial_code().equals(material_code)) {
|
||||
throw new BadRequestException("当前排-列已有物料为【" + papervehicle.getMaterial_code() + "】,如需要修改请先清除库存,再进行绑定!");
|
||||
}
|
||||
@@ -352,17 +364,13 @@ public class StockingIvtServiceImpl implements StockingIvtService {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(papervehicle)) {
|
||||
papervehicle.setQty(1);
|
||||
papervehicle.setUpdate_optid(currentUserId);
|
||||
papervehicle.setUpdate_optname(nickName);
|
||||
papervehicle.setUpdate_time(now);
|
||||
papervehicleService.updateById(papervehicle);
|
||||
} else {
|
||||
if (ObjectUtil.isEmpty(papervehicle)) {
|
||||
papervehicle = new MdPbPapervehicle();
|
||||
papervehicle.setIvt_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
papervehicle.setVehicle_code(vehicle_code);
|
||||
papervehicle.setRow_num(row_num);
|
||||
papervehicle.setCol_num(col_num);
|
||||
papervehicle.setPaper_code(paper_code);
|
||||
papervehicle.setMaterial_code(material_code);
|
||||
papervehicle.setMaterial_name(material_name);
|
||||
papervehicle.setQty(1);
|
||||
|
||||
@@ -142,6 +142,12 @@ public interface IpdmBiSubpackagerelationService extends IService<PdmBiSubpackag
|
||||
void downloadData(Integer day, HttpServletResponse response);
|
||||
|
||||
|
||||
/**
|
||||
* 根据子卷号获取子卷包装关系数据
|
||||
* @param pcsns 子卷号数组
|
||||
* @return
|
||||
*/
|
||||
List<JSONObject> getSubPackageInfoBySubRolls(List<String> pcsns);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.db.PageResult;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -874,5 +875,16 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
strings[5] = "呼叫时间";
|
||||
new FileUtil().downloadExcelIO(ioData,strings,response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getSubPackageInfoBySubRolls(List<String> pcsns) {
|
||||
if (pcsns.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
LambdaQueryWrapper<PdmBiSubpackagerelation> lam = new LambdaQueryWrapper<>();
|
||||
lam.in(PdmBiSubpackagerelation::getContainer_name, pcsns);
|
||||
return org.nl.common.utils.CollectionUtils.mapList(pdmBiSubpackagerelationMapper.selectList(lam),
|
||||
pdmBiSubpackagerelation -> (JSONObject) JSON.toJSON(pdmBiSubpackagerelation));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
package org.nl.b_lms.sch.tasks.slitter;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.IBstIvtCutpointivtService;
|
||||
import org.nl.b_lms.bst.ivt.cutpointivt.service.dao.BstIvtCutpointivt;
|
||||
import org.nl.b_lms.sch.point.dao.StIvtCutpointivt;
|
||||
import org.nl.b_lms.sch.point.service.IstIvtCutpointivtService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.common.utils.TaskUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.sch.AcsTaskDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 分切下气胀轴桁架任务(2/4点任务)
|
||||
* @Date: 2024/2/1
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class DownShaftTrussTask extends AbstractAcsTask {
|
||||
private final String THIS_CLASS = DownShaftTrussTask.class.getName();
|
||||
@Autowired
|
||||
private IschBaseTaskService taskService;
|
||||
@Autowired
|
||||
private IBstIvtCutpointivtService bcutpointivtService;
|
||||
@Autowired
|
||||
private IstIvtCutpointivtService cutpointivtService;
|
||||
|
||||
@Override
|
||||
public List<AcsTaskDto> addTask() {
|
||||
/*
|
||||
* 下发给ACS时需要特殊处理
|
||||
*/
|
||||
List<SchBaseTask> taskList = taskService.getIssueTasks(THIS_CLASS);
|
||||
|
||||
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
|
||||
String agv_system_type = "2";
|
||||
for (SchBaseTask task : taskList) {
|
||||
String requestParam = task.getRequest_param();
|
||||
JSONObject requestParamObj = JSONObject.parseObject(requestParam);
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(task.getTask_id())
|
||||
.task_code(task.getTask_code())
|
||||
.task_type(task.getAcs_task_type())
|
||||
.start_device_code(task.getPoint_code1())
|
||||
.next_device_code(task.getPoint_code2())
|
||||
.start_device_code2(task.getPoint_code3())
|
||||
.next_device_code2(task.getPoint_code4())
|
||||
.vehicle_code(task.getVehicle_code())
|
||||
.truss_type(requestParamObj.getString("truss_type"))
|
||||
.empty_site(requestParamObj.getString("empty_site"))
|
||||
.agv_system_type(agv_system_type)
|
||||
.priority(task.getPriority())
|
||||
.remark(task.getRemark())
|
||||
.product_area(task.getProduct_area())
|
||||
.build();
|
||||
resultList.add(dto);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
SchBaseTask task = taskService.getById(taskObj.getString("task_id"));
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
// 更新任务状态为执行中
|
||||
task.setTask_status(TaskStatusEnum.EXECUTING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
||||
task.setTask_status(TaskStatusEnum.FINISHED.getCode());
|
||||
//起点
|
||||
String pointCode1 = task.getPoint_code1();
|
||||
//终点
|
||||
String pointCode2 = task.getPoint_code2();
|
||||
StIvtCutpointivt point1 = cutpointivtService.getPintByUpOrDownCode(pointCode1, false);
|
||||
BstIvtCutpointivt point2 = bcutpointivtService.getPintByTrussCode(pointCode2, false);
|
||||
// 点位数据更新
|
||||
|
||||
point2.setQzz_no1(point1.getUp_qzzno());
|
||||
point1.setUp_qzzno("");
|
||||
//下双
|
||||
if(ObjectUtil.isNotEmpty(task.getPoint_code3())){
|
||||
|
||||
point2.setQzz_no2(point1.getDown_qzzno());
|
||||
point1.setDown_qzzno("");
|
||||
}
|
||||
//更新分切机点位
|
||||
point1.setRemark("");
|
||||
point1.setUpdate_optid(3L);
|
||||
point1.setUpdate_optname("ACS");
|
||||
point1.setUpdate_time(DateUtil.now());
|
||||
cutpointivtService.updateById(point1);
|
||||
|
||||
//更新分切暂存点
|
||||
point2.setPoint_status("3");
|
||||
TaskUtils.updateOptMessageByBCutPoint(point2);
|
||||
bcutpointivtService.updateById(point2);
|
||||
}
|
||||
// 取消
|
||||
if (status.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||
task.setTask_status(TaskStatusEnum.FINISHED.getCode());
|
||||
}
|
||||
task.setUpdate_time(DateUtil.now());
|
||||
taskService.updateById(task);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createTask(JSONObject form) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
task.setTask_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
task.setTask_code(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
task.setTask_status(TaskStatusEnum.START_AND_POINT.getCode());
|
||||
task.setPoint_code1(form.getString("point_code1"));
|
||||
task.setPoint_code2(form.getString("point_code2"));
|
||||
task.setPoint_code3(form.getString("point_code3"));
|
||||
task.setPoint_code4(form.getString("point_code4"));
|
||||
task.setVehicle_code(form.getString("vehicle_code1"));
|
||||
task.setVehicle_code2(form.getString("vehicle_code2"));
|
||||
task.setAcs_task_type("6");
|
||||
task.setIs_delete("0");
|
||||
task.setRequest_param(form.toJSONString());
|
||||
task.setTask_type(form.getString("task_type"));
|
||||
task.setProduct_area(form.getString("product_area"));
|
||||
task.setCreate_id(currentUserId);
|
||||
task.setCreate_name(currentUsername);
|
||||
task.setCreate_time(DateUtil.now());
|
||||
task.setHandle_class(THIS_CLASS);
|
||||
//根据类型获取对应的任务优先级
|
||||
JSONObject priority_jo = WQL.getWO("PDA_COOLIN").addParam("flag", "3").addParam("task_type", task.getTask_type()).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(priority_jo)) {
|
||||
task.setPriority("1");
|
||||
} else {
|
||||
task.setPriority(priority_jo.getString("value"));
|
||||
}
|
||||
taskService.save(task);
|
||||
this.immediateNotifyAcs(null);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceFinish(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void cancel(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, "0");
|
||||
}
|
||||
}
|
||||
@@ -159,15 +159,13 @@ public class AutoCallAirShaftTask extends Prun {
|
||||
List<BstIvtShafttubeivt> emptyPoints = bstIvtShafttubeivtService.getAllShaftPointsByConditions("2",
|
||||
cutpointivt.getProduct_area(), "0");
|
||||
if(emptyPoints.size() == 0){
|
||||
if(emptyPoints.size() == 0){
|
||||
log.warn("气涨轴[{}]排队中,暂时无空闲拔轴机构!", qzzNo);
|
||||
bcutpointivtService.update(new UpdateWrapper<BstIvtCutpointivt>()
|
||||
.eq("ivt_id",cutpointivt.getIvt_id())
|
||||
.set("remark","排队中,暂时无空闲拔轴机构!")
|
||||
.set("update_time",DateUtil.now()));
|
||||
//跳过当前子卷任务
|
||||
continue;
|
||||
}
|
||||
log.warn("气涨轴[{}]排队中,暂时无空闲拔轴机构!", qzzNo);
|
||||
bcutpointivtService.update(new UpdateWrapper<BstIvtCutpointivt>()
|
||||
.eq("ivt_id",cutpointivt.getIvt_id())
|
||||
.set("remark","排队中,暂时无空闲拔轴机构!")
|
||||
.set("update_time",DateUtil.now()));
|
||||
//跳过当前子卷任务
|
||||
continue;
|
||||
}
|
||||
List<String> collect = list.stream().map(PdmBiSlittingproductionplan::getContainer_name).collect(Collectors.toList());
|
||||
JSONObject param = new JSONObject();
|
||||
@@ -217,7 +215,7 @@ public class AutoCallAirShaftTask extends Prun {
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
//没有可以接续的套轴计划,直接下发拔轴任务即可
|
||||
if (planDto == null) {
|
||||
if (ObjectUtil.isEmpty(planDto)) {
|
||||
log.warn("当前拔轴任务无可接续的套轴计划:{}", cutpointivt);
|
||||
if(!this.havaEmptyShaft(emptyPoints.get(0),plan,max_qzz_num)) {
|
||||
log.warn("气涨轴[{}]排队中,暂时无空闲气胀轴空位放空轴!", qzzNo);
|
||||
@@ -316,24 +314,22 @@ public class AutoCallAirShaftTask extends Prun {
|
||||
String qzz_generation = planDto.getQzz_generation();
|
||||
String product_area = "";
|
||||
if (StrUtil.equals(qzz_generation, "4")){
|
||||
product_area = "A";
|
||||
product_area = "A1";
|
||||
}else if (StrUtil.equals(qzz_generation, "5")){
|
||||
product_area = "B";
|
||||
product_area = "B1";
|
||||
}
|
||||
|
||||
//再次查询空的拔轴机构点位,优先查同区的拔轴设备
|
||||
List<BstIvtShafttubeivt> emptyPoints = bstIvtShafttubeivtService.getAllShaftPointsByConditions("2",
|
||||
product_area, "0");
|
||||
if(emptyPoints.size() == 0){
|
||||
if(emptyPoints.size() == 0){
|
||||
log.warn("分切计划{}排队中,暂时无空闲拔轴机构!", planDto.getWorkorder_id());
|
||||
slittingproductionplanService.update(new UpdateWrapper<PdmBiSlittingproductionplan>()
|
||||
.eq("workorder_id",planDto.getWorkorder_id())
|
||||
.set("remark","排队中,暂时无空闲拔轴机构!")
|
||||
.set("update_time",DateUtil.now()));
|
||||
//跳过当前计划
|
||||
continue;
|
||||
}
|
||||
log.warn("分切计划{}排队中,暂时无空闲拔轴机构!", planDto.getWorkorder_id());
|
||||
slittingproductionplanService.update(new UpdateWrapper<PdmBiSlittingproductionplan>()
|
||||
.eq("workorder_id",planDto.getWorkorder_id())
|
||||
.set("remark","排队中,暂时无空闲拔轴机构!")
|
||||
.set("update_time",DateUtil.now()));
|
||||
//跳过当前计划
|
||||
continue;
|
||||
}
|
||||
//判断是否有对应尺寸的气胀轴,无跳过
|
||||
if(!this.havaEnoughShaft(planDto, emptyPoints.get(0))){
|
||||
@@ -474,56 +470,43 @@ public class AutoCallAirShaftTask extends Prun {
|
||||
String product_area = empty.getProduct_area();
|
||||
//获取气胀轴缓存架最大缓存数量
|
||||
Integer max_num = Integer.valueOf(max_qzz_num.getValue());
|
||||
|
||||
// 查询拔轴设备旁边缓存架点位是否存在
|
||||
List<BstIvtShafttubeivt> shafttubeivts = bstIvtShafttubeivtService.getByQzzSize(qzzSize ,empty.getPoint_code(), product_area);
|
||||
if (shafttubeivts.size() == 0) {
|
||||
log.error("气胀轴库找不到[" + qzzSize + "]规格的气涨轴缓存位");
|
||||
return false;
|
||||
}
|
||||
// 对应尺寸的气涨轴库
|
||||
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
|
||||
//判断是否存在残留的脏数据
|
||||
String planStr = shafttubeivt.getPlan();
|
||||
if(ObjectUtil.isNotEmpty(planStr) && StrUtil.equals(planStr, "1")){
|
||||
log.error("气胀轴库" + shafttubeivt.getPoint_code() + "预分配字段plan异常,需要确认并初始化!");
|
||||
return false;
|
||||
}
|
||||
// 判断气胀轴是否有轴
|
||||
JSONArray device_rows = new JSONArray();
|
||||
JSONObject device_obj = new JSONObject();
|
||||
device_rows.add(device_obj);
|
||||
device_obj.put("device_code", shafttubeivt.getPoint_code());
|
||||
device_obj.put("product_area", product_area);
|
||||
JSONObject pointStatus = wmsToAcsService.getPointStatus(device_rows);
|
||||
if (ObjectUtil.isEmpty(pointStatus) || ObjectUtil.isEmpty(pointStatus.getJSONArray("data"))) {
|
||||
log.error("获取气胀轴库信息失败");
|
||||
return false;
|
||||
}
|
||||
JSONObject data2 = pointStatus.getJSONArray("data").getJSONObject(0);
|
||||
//若缓存架数量已经满了
|
||||
if (data2.getInteger("qty") >= max_num) {
|
||||
log.warn("气胀轴库【" + shafttubeivt.getPoint_code() + "】没有气胀轴空位。");
|
||||
// 根据尺寸和代数和车间区域,查询气涨轴暂存架是否有空位
|
||||
List<BstIvtShafttubeivt> qzzCache = bstIvtShafttubeivtService.getNotTaskShaftCacheEmpty2(qzzSize,qzzGeneration,product_area);
|
||||
if (qzzCache.size() <= 0) {
|
||||
log.warn("气胀轴暂存架没空位,无法分配拔轴任务");
|
||||
// 根据尺寸和代数和车间区域,查询气涨轴暂存架是否有空位
|
||||
List<BstIvtShafttubeivt> qzzCache = bstIvtShafttubeivtService.getNotTaskShaftCacheEmpty2(qzzSize,qzzGeneration,product_area);
|
||||
if (qzzCache.size() > 0) {
|
||||
return true;
|
||||
}else{
|
||||
// 查询拔轴设备旁边缓存架点位是否存在
|
||||
List<BstIvtShafttubeivt> shafttubeivts = bstIvtShafttubeivtService.getByQzzSize(qzzSize ,empty.getPoint_code(), product_area);
|
||||
if (shafttubeivts.size() == 0) {
|
||||
log.error("气胀轴库找不到[" + qzzSize + "]规格的气涨轴缓存位");
|
||||
return false;
|
||||
}
|
||||
// 对应尺寸的气涨轴库
|
||||
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
|
||||
//判断是否存在残留的脏数据
|
||||
String planStr = shafttubeivt.getPlan();
|
||||
if(ObjectUtil.isNotEmpty(planStr) && StrUtil.equals(planStr, "1")){
|
||||
log.error("气胀轴库" + shafttubeivt.getPoint_code() + "预分配字段plan异常,需要确认并初始化!");
|
||||
return false;
|
||||
}
|
||||
// 判断气胀轴是否有轴
|
||||
JSONArray device_rows = new JSONArray();
|
||||
JSONObject device_obj = new JSONObject();
|
||||
device_rows.add(device_obj);
|
||||
device_obj.put("device_code", shafttubeivt.getPoint_code());
|
||||
device_obj.put("product_area", product_area);
|
||||
JSONObject pointStatus = wmsToAcsService.getPointStatus(device_rows);
|
||||
if (ObjectUtil.isEmpty(pointStatus) || ObjectUtil.isEmpty(pointStatus.getJSONArray("data"))) {
|
||||
log.error("获取气胀轴库信息失败");
|
||||
return false;
|
||||
}
|
||||
JSONObject data2 = pointStatus.getJSONArray("data").getJSONObject(0);
|
||||
//若缓存架数量已经满了
|
||||
if (data2.getInteger("qty") >= max_num) {
|
||||
log.warn("气胀轴库【" + shafttubeivt.getPoint_code() + "】没有气胀轴空位。");
|
||||
return false;
|
||||
}
|
||||
// 预扣除暂存架库存
|
||||
BstIvtShafttubeivt waitUsedPoint = qzzCache.get(0);
|
||||
waitUsedPoint.setPlan("1");
|
||||
waitUsedPoint.setUpdate_time(DateUtil.now());
|
||||
bstIvtShafttubeivtService.updateById(waitUsedPoint);
|
||||
log.info("暂存架空位被预分配 - {}", waitUsedPoint);
|
||||
}else{
|
||||
// 预扣除缓存架库存
|
||||
shafttubeivt.setPlan("1");
|
||||
shafttubeivt.setUpdate_time(DateUtil.now());
|
||||
bstIvtShafttubeivtService.updateById(shafttubeivt);
|
||||
log.info("缓存架空位被预分配 - {}", shafttubeivt);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -794,35 +777,13 @@ public class AutoCallAirShaftTask extends Prun {
|
||||
if (cuts.size() > 0) {
|
||||
return true;
|
||||
}
|
||||
// 判断穿拔轴机是否存在正在套轴的,存在也不继续。
|
||||
List<BstIvtShafttubeivt> shafts = bstIvtShafttubeivtService.getOtherCBJData(empty.getPoint_code(), empty.getPoint_location());
|
||||
if (shafts.size() > 0) {
|
||||
BstIvtShafttubeivt shafttubeivt = shafts.get(0);
|
||||
String containerCode = ObjectUtil.isNotEmpty(shafttubeivt.getContainer_name1())
|
||||
? shafttubeivt.getContainer_name1() : shafttubeivt.getContainer_name2();
|
||||
// 获取这个子卷号的分切计划
|
||||
PdmBiSlittingproductionplan byContainerName = slittingproductionplanService.getByContainerName(containerCode);
|
||||
if (ObjectUtil.isNotEmpty(byContainerName)) {
|
||||
String parent = "1".equals(byContainerName.getOrder_type())
|
||||
? byContainerName.getParent_container_name()
|
||||
: byContainerName.getRestruct_container_name();
|
||||
if (byContainerName.getResource_name().equals(dto.getResource_name())) {
|
||||
// 如果是同设备同母卷、同组,证明是一根轴上的,故允许套轴
|
||||
if (parent.equals(dto.getParent_container_name())
|
||||
&& byContainerName.getSplit_group().equals(dto.getSplit_group())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 校验是否在拔轴暂存位、分切对接位有相同设备的分切计划信息。
|
||||
// 有就返回false, 没有就返回true
|
||||
List<BstIvtCutpointivt> cuts2 = bcutpointivtService.getReallyQzzSameDevice(dto.getResource_name());
|
||||
if (cuts2.size() == 0) {
|
||||
return true;
|
||||
}
|
||||
List<String> stringList = cuts2.stream().map(BstIvtCutpointivt::getPoint_code).collect(Collectors.toList());
|
||||
//List<String> stringList = cuts2.stream().map(BstIvtCutpointivt::getPoint_code).collect(Collectors.toList());
|
||||
}
|
||||
log.info("检查有同母卷不允许套轴:{}", dto);
|
||||
// 有就返回true
|
||||
|
||||
@@ -328,6 +328,13 @@ public interface SlitterService {
|
||||
*/
|
||||
JSONObject downRolls2(JSONObject param);
|
||||
|
||||
/**
|
||||
* 子卷下料2
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
JSONObject downShafts(JSONObject param);
|
||||
|
||||
/**
|
||||
* 母卷暂存架管理
|
||||
* @param param
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproducti
|
||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.point.dao.StIvtCutpointivt;
|
||||
import org.nl.b_lms.sch.point.service.IstIvtCutpointivtService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
@@ -42,6 +43,7 @@ import org.nl.b_lms.sch.tasks.slitter.mapper.dto.CallPlanViewVO;
|
||||
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.GxQtyDto;
|
||||
import org.nl.b_lms.sch.tasks.slitter.service.SlitterService;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil;
|
||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.common.utils.TaskUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
@@ -124,6 +126,9 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
private UpShaftTrussTask upShaftTrussTask;
|
||||
@Autowired
|
||||
private ReturnShaftAgvTask returnShaftAgvTask;
|
||||
@Autowired
|
||||
private DownShaftTrussTask downShaftTrussTask;
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
@@ -781,15 +786,26 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
log.info("分切计划数据:{}", plan);
|
||||
String point_type = "5".equals(plan.getLevel()) ? "5" : "4";
|
||||
// todo 如果是成品称重,需要Lms分配一个空位point_code2
|
||||
// 查找终点 确认是废箔还是成品: 根据分切计划的子卷等级来区分,5为报废
|
||||
BstIvtShafttubeivt one = shafttubeivtService.getOne(new LambdaQueryWrapper<BstIvtShafttubeivt>()
|
||||
.eq(BstIvtShafttubeivt::getPoint_type, point_type)
|
||||
.eq(BstIvtShafttubeivt::getPoint_location, device.getPoint_location())
|
||||
.eq(BstIvtShafttubeivt::getIs_used, SlitterConstant.SLITTER_YES));
|
||||
JSONObject taskParam = new JSONObject();
|
||||
//
|
||||
taskParam.put("point_code2", one.getPoint_code());
|
||||
// 查找终点 确认是废箔还是成品: 根据分切计划的子卷等级来区分,5为报废
|
||||
//成品
|
||||
if(point_type.equals("4")){
|
||||
//设置目的点为有架子的点
|
||||
List<BstIvtPackageinfoivt> mzPointList = bcutpointivtService.getPointByStatus(PackageInfoIvtEnum.POINT_STATUS.code("满轴缓存位"),PackageInfoIvtEnum.IVT_STATUS.code("空"));
|
||||
if(mzPointList.size() == 0){
|
||||
throw new BadRequestException("内包间无空闲满轴缓存位!");
|
||||
}
|
||||
//设置目的点为满轴位
|
||||
taskParam.put("point_code2", mzPointList.get(0).getPoint_code());
|
||||
}else{//废箔
|
||||
BstIvtShafttubeivt one = shafttubeivtService.getOne(new LambdaQueryWrapper<BstIvtShafttubeivt>()
|
||||
.eq(BstIvtShafttubeivt::getPoint_type, point_type)
|
||||
.eq(BstIvtShafttubeivt::getPoint_location, device.getPoint_location())
|
||||
.eq(BstIvtShafttubeivt::getIs_used, SlitterConstant.SLITTER_YES));
|
||||
//设置目的点为废箔称重
|
||||
taskParam.put("point_code2", one.getPoint_code());
|
||||
}
|
||||
|
||||
taskParam.put("material_code", plan.getContainer_name());
|
||||
//是否打印标签
|
||||
taskParam.put("to_is_labeling", "0");
|
||||
@@ -2323,6 +2339,91 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject downShafts(JSONObject param) {
|
||||
log.info("下轴的输入参数为:{}", param);
|
||||
// param: device_code, container: [{"site":"上下轴(1/2)"}]
|
||||
String device_code = param.getString("device_code");
|
||||
JSONArray conArray = param.getJSONArray("container");
|
||||
if (conArray.size() == 0) {
|
||||
log.error("下空轴参数不能为空!");
|
||||
throw new BadRequestException("下空轴参数不能为空!");
|
||||
}
|
||||
// 获得设备
|
||||
StIvtCutpointivt device = cutpointivtService.getOne(new LambdaQueryWrapper<StIvtCutpointivt>()
|
||||
.eq(StIvtCutpointivt::getExt_code, device_code));
|
||||
|
||||
List<SchBaseTask> tasks = taskService.checkHaveTrussTask(Arrays.asList(device.getUp_point_code(), device.getDown_point_code()));
|
||||
if (tasks.size() > 0) {
|
||||
throw new BadRequestException("分切机" + device_code + " 已经有存在的任务");
|
||||
}
|
||||
|
||||
List<String> containerList = new ArrayList<>();
|
||||
for (int i = 0; i < conArray.size(); i++) {
|
||||
JSONObject container = conArray.getJSONObject(i);
|
||||
containerList.add(container.getString("site"));
|
||||
//上轴要下,且气胀轴字段为空
|
||||
if(StrUtil.equals(container.getString("site"),"1") && ObjectUtil.isEmpty(device.getUp_point_code())){
|
||||
throw new BadRequestException("分切机上轴无气胀轴信息,无法生成下空轴任务!");
|
||||
}
|
||||
//下轴要下,且气胀轴字段为空
|
||||
if(StrUtil.equals(container.getString("site"),"2") && ObjectUtil.isEmpty(device.getDown_point_code())){
|
||||
throw new BadRequestException("分切机下轴无气胀轴信息,无法生成下空轴任务!");
|
||||
}
|
||||
//下轴要单下,上轴检测有货
|
||||
if(StrUtil.equals(container.getString("site"),"2") && ObjectUtil.isNotEmpty(device.getUp_point_code()) && (conArray.size() == 1)){
|
||||
throw new BadRequestException("分切机上轴有货,无法生成单下空轴任务!");
|
||||
}
|
||||
}
|
||||
|
||||
StIvtCutpointivt actualDevice = device;
|
||||
String area = device.getProduct_area();
|
||||
// 获取当前分切机的下一组分切计划(最多四条分切计划)
|
||||
// 任务参数
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("containers", containerList);
|
||||
// 如果没有下一组的分切计划,就只做下卷任务(判断下单/下双)
|
||||
// 获取分切对接位没任务的空位置
|
||||
List<BstIvtCutpointivt> emptyPoints = slitterMapper.getEmptyCutPointNotTask(area,
|
||||
device.getSort_seq(),
|
||||
getPointLocationInCutDevice(getNumberByResourceCode(device_code), area));
|
||||
//必须两个位置都为空
|
||||
if (emptyPoints.size() == 0 ) {
|
||||
log.error("分切机【" + device.getExt_code() + "】对接位不全为空位, 或已存在任务!");
|
||||
throw new BadRequestException("分切机【" + device.getExt_code() + "】对接位不全为空位,或已存在任务!");
|
||||
}
|
||||
// 枷锁
|
||||
BstIvtCutpointivt emptyPoint = emptyPoints.get(0);
|
||||
// 创建任务
|
||||
if (containerList.size() == 2) {
|
||||
// 双轴任务 下双
|
||||
taskParam.put("point_code1", actualDevice.getUp_point_code());
|
||||
taskParam.put("point_code2", emptyPoint.getTruss_point_code1());
|
||||
taskParam.put("point_code3", actualDevice.getDown_point_code());
|
||||
taskParam.put("point_code4", emptyPoint.getTruss_point_code2());
|
||||
taskParam.put("truss_type", "1");
|
||||
taskParam.put("empty_site", "0");
|
||||
} else if (containerList.size() == 1) {
|
||||
// 单轴任务 下单
|
||||
taskParam.put("point_code1", containerList.get(0) == "2"
|
||||
? actualDevice.getDown_point_code() : actualDevice.getUp_point_code());
|
||||
taskParam.put("point_code2", containerList.get(0) == "2"
|
||||
? emptyPoint.getTruss_point_code2() : emptyPoint.getTruss_point_code1());
|
||||
taskParam.put("truss_type", "1");
|
||||
taskParam.put("empty_site", "0");
|
||||
}
|
||||
taskParam.put("task_type", SlitterEnum.TASK_TYPE.code("分切机下气胀轴"));
|
||||
taskParam.put("product_area", device.getProduct_area());
|
||||
// 创建任务
|
||||
downShaftTrussTask.createTask(taskParam);
|
||||
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", HttpStatus.HTTP_OK);
|
||||
res.put("message", "下轴任务生成成功!");
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject rollCacheManage(JSONObject param) {
|
||||
// param: point_code、flag(1:清除,2:有空轴)
|
||||
|
||||
@@ -28,8 +28,8 @@ public class SlitterTaskUtil {
|
||||
|
||||
/** B1区域 */
|
||||
public final static String B1_AREA_CODE = "B1";
|
||||
/** B2区域 */
|
||||
public final static String B2_AREA_CODE = "B2";
|
||||
/** A1区域 */
|
||||
public final static String A1_AREA_CODE = "A1";
|
||||
/**
|
||||
* 组成纸管信息
|
||||
* @param plan 对应的分切计划数组
|
||||
@@ -226,8 +226,8 @@ public class SlitterTaskUtil {
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
if (area.equals(B2_AREA_CODE)) {
|
||||
if (num >= 1 && num <= 5) {
|
||||
if (area.equals(A1_AREA_CODE)) {
|
||||
if (num >= 1 && num <= 6) {
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv;
|
||||
@@ -81,7 +82,6 @@ public interface IStIvtIostorinvOutService extends IService<StIvtIostorinv> {
|
||||
*/
|
||||
void allDiv(JSONObject whereJson);
|
||||
|
||||
|
||||
/**
|
||||
* 手工分配
|
||||
* @param whereJson:{
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.nl.b_lms.storage_manage.st.service.StIvtStructivtService;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @see StIvtStructivtService#getAllInventorys(InventoryQueryParam)
|
||||
* @Author: lyd
|
||||
* @Date: 2025/6/20
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class InventoryQueryParam implements Serializable {
|
||||
private String sect_id;
|
||||
|
||||
private String stor_id;
|
||||
|
||||
private List<String> box_in;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@@ -8,10 +9,13 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.SneakyThrows;
|
||||
import org.nl.b_lms.pdm_manage.enums.SUBEnum;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.TwoExcepionalMoveTask;
|
||||
import org.nl.b_lms.sch.tasks.TwoOutExceptionalTask;
|
||||
import org.nl.b_lms.sch.tasks.TwoOutTask;
|
||||
@@ -29,9 +33,11 @@ import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdis;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdtl;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper.StIvtIostorinvOutMapper;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper.StIvtIostorinvdisMapper;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.InventoryQueryParam;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InBussManageService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.OutBussManageService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.TwoInBussManageService;
|
||||
import org.nl.b_lms.storage_manage.st.service.StIvtStructivtService;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
@@ -137,6 +143,10 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
|
||||
|
||||
@Autowired
|
||||
private RedissonClient redissonClient;
|
||||
@Autowired
|
||||
private StIvtStructivtService structivtService;
|
||||
@Autowired
|
||||
private IschBaseTaskService ischBaseTaskService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -268,10 +278,10 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
|
||||
}
|
||||
|
||||
// 查找此仓库/库区的所有库存 (库区:前端没有选择库区就默认仓库)
|
||||
List<JSONObject> ivtList = WQL.getWO("BST_OUTDIV").addParam("flag", "1").addParam("stor_id", mstDao.getStor_id().toString())
|
||||
.addParam("sect_id", whereJson.getString("sect_id"))
|
||||
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
List<JSONObject> ivtList = structivtService.getAllInventorys(InventoryQueryParam.builder()
|
||||
.stor_id(mstDao.getStor_id())
|
||||
.sect_id(whereJson.getString("sect_id"))
|
||||
.build());
|
||||
if (ObjectUtil.isEmpty(ivtList)) {
|
||||
throw new BadRequestException("库存不足!");
|
||||
}
|
||||
@@ -424,9 +434,6 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@SneakyThrows
|
||||
public void cancelDiv(JSONObject whereJson) {
|
||||
// 任务表
|
||||
WQLObject taskService = WQLObject.getWQLObject("sch_base_task");
|
||||
|
||||
StIvtIostorinv mstDao = this.getById(whereJson.getLongValue("iostorinv_id"));
|
||||
|
||||
/*
|
||||
@@ -554,21 +561,17 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
|
||||
this.updateMstStatus(mstDao.getIostorinv_id());
|
||||
|
||||
/*删除出库任务*/
|
||||
String task_id_in = disList.stream()
|
||||
List<String> taskIds = disList.stream()
|
||||
.map(row -> row.getString("task_id"))
|
||||
.distinct()
|
||||
.collect(Collectors.joining("','"));
|
||||
|
||||
|
||||
if (task_id_in.equals("null")) {
|
||||
task_id_in = "";
|
||||
.collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(taskIds)) {
|
||||
LambdaUpdateWrapper<SchBaseTask> lam = new LambdaUpdateWrapper<>();
|
||||
lam.set(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("是"))
|
||||
.in(SchBaseTask::getTask_id, taskIds);
|
||||
ischBaseTaskService.update(lam);
|
||||
}
|
||||
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("is_delete", IOSEnum.IS_NOTANDYES.code("是"));
|
||||
|
||||
taskService.update(taskParam,"task_id IN ('"+task_id_in+"')");
|
||||
|
||||
/*
|
||||
* 删除移库单、移库任务
|
||||
*/
|
||||
|
||||
@@ -15,6 +15,8 @@ import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdis;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdtl;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper.StIvtIostorinvdtlMapper;
|
||||
import org.nl.b_lms.storage_manage.md.service.MaterialbaseService;
|
||||
import org.nl.b_lms.storage_manage.md.service.MdPbMeasureunitService;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
@@ -53,6 +55,12 @@ public class StIvtIostorinvdtlServiceImpl extends ServiceImpl<StIvtIostorinvdtlM
|
||||
private IStIvtIostorinvService iStIvtIostorinvService;
|
||||
@Autowired
|
||||
private StIvtIostorinvdtlMapper stIvtIostorinvdtlMapper;
|
||||
/** 物料表服务 */
|
||||
@Autowired
|
||||
private MaterialbaseService materialbaseService;
|
||||
/** 单位服务 */
|
||||
@Autowired
|
||||
private MdPbMeasureunitService measureunitService;
|
||||
|
||||
@Override
|
||||
public HashMap<String, ArrayList<JSONObject>>insertDtl(List<JSONObject> rows, String iostorinv_id) {
|
||||
@@ -62,25 +70,19 @@ public class StIvtIostorinvdtlServiceImpl extends ServiceImpl<StIvtIostorinvdtlM
|
||||
updateSub(iostorinv_id);
|
||||
|
||||
// 查询所有对应物料集合
|
||||
String materialCodeIn = rows.stream()
|
||||
List<String> materialCodes = rows.stream()
|
||||
.map(row -> JSONObject.parseObject(JSON.toJSONString(row)).getString("product_name"))
|
||||
.distinct()
|
||||
.collect(Collectors.joining("','"));
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<JSONObject> materList = WQLObject.getWQLObject("md_me_materialbase")
|
||||
.query("material_code in ('" + materialCodeIn + "')")
|
||||
.getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
List<JSONObject> materList = materialbaseService.getMaterialAllByCodes(materialCodes);
|
||||
|
||||
// 查询所有物料对应的计量单位
|
||||
String unitIdIn = materList.stream()
|
||||
List<String> unitIds = materList.stream()
|
||||
.map(row -> row.getString("base_unit_id"))
|
||||
.distinct()
|
||||
.collect(Collectors.joining("','"));
|
||||
|
||||
List<JSONObject> unitList = WQLObject.getWQLObject("md_pb_measureunit")
|
||||
.query("measure_unit_id in ('" + unitIdIn + "')")
|
||||
.getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
.collect(Collectors.toList());
|
||||
List<JSONObject> unitList = measureunitService.getUnitAllByIds(unitIds);
|
||||
// 明细批量插入集合
|
||||
ArrayList<StIvtIostorinvdtl> dtlDaoList = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -5,7 +5,10 @@ import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
||||
@@ -19,6 +22,12 @@ import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdtl;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InBussManageService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.OutBussManageService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.TwoInBussManageService;
|
||||
import org.nl.b_lms.storage_manage.md.service.MdPbMeasureunitService;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtSectattr;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtStructattr;
|
||||
import org.nl.b_lms.storage_manage.st.service.StIvtSectattrService;
|
||||
import org.nl.b_lms.storage_manage.st.service.StIvtStructattrService;
|
||||
import org.nl.b_lms.storage_manage.st.service.StIvtStructivtService;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
@@ -38,6 +47,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -97,6 +107,17 @@ public class OutBussManageServiceImpl implements OutBussManageService {
|
||||
*/
|
||||
@Autowired
|
||||
private TwoInBussManageService twoInBussManageService;
|
||||
@Autowired
|
||||
private StIvtStructivtService structivtService;
|
||||
@Autowired
|
||||
private MdPbMeasureunitService measureunitService;
|
||||
/** 子卷包装关系 */
|
||||
@Autowired
|
||||
private IpdmBiSubpackagerelationService subpackagerelationService;
|
||||
@Autowired
|
||||
private StIvtSectattrService sectattrService;
|
||||
@Autowired
|
||||
private StIvtStructattrService structattrService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -106,13 +127,15 @@ public class OutBussManageServiceImpl implements OutBussManageService {
|
||||
throw new BadRequestException("锁定或解锁仓位不能为空!");
|
||||
}
|
||||
|
||||
// 仓位表
|
||||
WQLObject attrTab = WQLObject.getWQLObject("ST_IVT_StructAttr");
|
||||
|
||||
String operate = json.getString("operate");
|
||||
if (operate.equals(IOSEnum.IO_TYPE.code("出库"))) {
|
||||
|
||||
attrTab.update(json, "struct_code IN ('" + String.join("','", param) + "')");
|
||||
LambdaUpdateWrapper<StIvtStructattr> lam = new LambdaUpdateWrapper<>();
|
||||
lam.in(StIvtStructattr::getStruct_code, param)
|
||||
.set(StIvtStructattr::getInv_id, json.getString("inv_id"))
|
||||
.set(StIvtStructattr::getInv_type, json.getString("inv_type"))
|
||||
.set(StIvtStructattr::getInv_code, json.getString("inv_code"))
|
||||
.set(StIvtStructattr::getLock_type, json.getString("lock_type"));
|
||||
structattrService.update(lam);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,29 +287,25 @@ public class OutBussManageServiceImpl implements OutBussManageService {
|
||||
List<StIvtIostorinvdis> resultDisList = new ArrayList<>();
|
||||
|
||||
// 查询计量单位
|
||||
JSONObject jsonUnit = WQLObject.getWQLObject("md_pb_measureunit")
|
||||
.query("measure_unit_id = '" + likeBoxList.get(0).getString("qty_unit_id") + "'")
|
||||
.uniqueResult(0);
|
||||
|
||||
List<JSONObject> units = measureunitService.getUnitAllByIds(Stream.of(likeBoxList.get(0).getString("qty_unit_id"))
|
||||
.collect(Collectors.toList()));
|
||||
if (ObjectUtil.isEmpty(units)) {
|
||||
throw new BadRequestException("找不到单位【" + likeBoxList.get(0).getString("qty_unit_id") + "】");
|
||||
}
|
||||
JSONObject jsonUnit = units.get(0);
|
||||
// 查询子卷包装关系
|
||||
String pcsn_in = likeBoxList.stream()
|
||||
List<String> pcsns = likeBoxList.stream()
|
||||
.map(row -> row.getString("pcsn"))
|
||||
.collect(Collectors.joining("','"));
|
||||
|
||||
List<JSONObject> subList = WQLObject.getWQLObject("pdm_bi_subpackagerelation")
|
||||
.query("container_name in ('" + pcsn_in + "')")
|
||||
.getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
.collect(Collectors.toList());
|
||||
List<JSONObject> subList = subpackagerelationService.getSubPackageInfoBySubRolls(pcsns);
|
||||
for (int i = 0; i < likeBoxList.size(); i++) {
|
||||
JSONObject jsonIvt = likeBoxList.get(i);
|
||||
|
||||
// 查询库区
|
||||
JSONObject jsonSect = WQLObject.getWQLObject("st_ivt_sectattr")
|
||||
.query("sect_id = '" + jsonIvt.getString("sect_id") + "'")
|
||||
.uniqueResult(0);
|
||||
StIvtSectattr sectAttribute = sectattrService.getById(jsonIvt.getString("sect_id"));
|
||||
|
||||
String work_status;
|
||||
if (jsonSect.getString("sect_type_attr").equals(IOSEnum.SECT_TYPE.code("虚拟区"))) {
|
||||
if (sectAttribute.getSect_type_attr().equals(IOSEnum.SECT_TYPE.code("虚拟区"))) {
|
||||
work_status = IOSEnum.WORK_STATUS.code("生成");
|
||||
} else {
|
||||
work_status = IOSEnum.WORK_STATUS.code("未生成");
|
||||
|
||||
@@ -15,7 +15,4 @@ import org.nl.b_lms.storage_manage.md.dao.MdMeMaterialBase;
|
||||
public interface MdMeMaterialBaseMapper extends BaseMapper<MdMeMaterialBase> {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -91,4 +91,11 @@ public interface MaterialbaseService {
|
||||
JSONArray getProductSeries(String parent_class_id);
|
||||
|
||||
|
||||
/**
|
||||
* 通过物料编码获取物料列表JSONObject
|
||||
* <p>使用mybatis-plus</p>
|
||||
* @param materialCodes
|
||||
* @return
|
||||
*/
|
||||
List<JSONObject> getMaterialAllByCodes(List<String> materialCodes);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,19 @@
|
||||
package org.nl.b_lms.storage_manage.md.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.storage_manage.md.dao.MdPbMeasureunit;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtBsrealstorattr;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MdPbMeasureunitService extends IService<MdPbMeasureunit> {
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有单位数据通过单位id
|
||||
* @param unitIds
|
||||
* @return
|
||||
*/
|
||||
List<JSONObject> getUnitAllByIds(List<String> unitIds);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.b_lms.storage_manage.md.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
@@ -9,9 +10,13 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.storage_manage.md.dao.MdMeMaterialBase;
|
||||
import org.nl.b_lms.storage_manage.md.dao.mapper.MdMeMaterialBaseMapper;
|
||||
import org.nl.b_lms.storage_manage.md.service.MaterialbaseService;
|
||||
import org.nl.common.utils.CollectionUtils;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
@@ -28,6 +33,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhouz
|
||||
@@ -39,6 +45,7 @@ import java.util.Set;
|
||||
@Slf4j
|
||||
public class MaterialbaseServiceImpl implements MaterialbaseService {
|
||||
private final ClassstandardService classstandardService;
|
||||
private final MdMeMaterialBaseMapper mdMeMaterialBaseMapper;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
@@ -227,4 +234,15 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
|
||||
return newParentArray;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getMaterialAllByCodes(List<String> materialCodes) {
|
||||
LambdaQueryWrapper<MdMeMaterialBase> lam = new LambdaQueryWrapper<>();
|
||||
lam.in(MdMeMaterialBase::getMaterial_code, materialCodes);
|
||||
List<MdMeMaterialBase> materialBases = mdMeMaterialBaseMapper.selectList(lam);
|
||||
if (CollectionUtil.isEmpty(materialBases)) {
|
||||
return null;
|
||||
}
|
||||
return CollectionUtils.mapList(materialBases, material -> (JSONObject) JSON.toJSON(material));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,33 @@
|
||||
package org.nl.b_lms.storage_manage.md.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.storage_manage.md.dao.MdPbMeasureunit;
|
||||
import org.nl.b_lms.storage_manage.md.dao.mapper.MdPbMeasureunitMapper;
|
||||
import org.nl.b_lms.storage_manage.md.service.MdPbMeasureunitService;
|
||||
import org.nl.common.utils.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class MdPbMeasureunitServiceImpl extends ServiceImpl<MdPbMeasureunitMapper, MdPbMeasureunit> implements IService<MdPbMeasureunit> {
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MdPbMeasureunitServiceImpl extends ServiceImpl<MdPbMeasureunitMapper, MdPbMeasureunit> implements MdPbMeasureunitService {
|
||||
@Autowired
|
||||
private MdPbMeasureunitMapper mdPbMeasureunitMapper;
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getUnitAllByIds(List<String> unitIds) {
|
||||
LambdaQueryWrapper<MdPbMeasureunit> lam = new LambdaQueryWrapper<>();
|
||||
lam.in(MdPbMeasureunit::getMeasure_unit_id, unitIds);
|
||||
List<MdPbMeasureunit> mdPbMeasureunits = mdPbMeasureunitMapper.selectList(lam);
|
||||
return CollectionUtils.mapList(mdPbMeasureunits, mdPbMeasureunit -> (JSONObject) JSON.toJSON(mdPbMeasureunit));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package org.nl.b_lms.storage_manage.st.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.InventoryQueryParam;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtStructivt;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.basedata.st.service.dto.ProductStoreDownDto;
|
||||
@@ -38,4 +40,6 @@ public interface StIvtStructivtMapper extends BaseMapper<StIvtStructivt> {
|
||||
IPage<StockMaterialVo> queryAddDtl(StockMaterialQueryParam paramMap, IPage<StockMaterialVo> pages);
|
||||
|
||||
JSONArray getBoxAllMaterial(String boxNo);
|
||||
|
||||
List<JSONObject> getAllInventorys(@Param("param") InventoryQueryParam param);
|
||||
}
|
||||
|
||||
@@ -787,4 +787,44 @@
|
||||
AND attr.is_used = '1'
|
||||
AND attr.storagevehicle_code = #{boxNo}
|
||||
</select>
|
||||
<select id="getAllInventorys" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
ivt.*,
|
||||
attr.row_num,
|
||||
attr.block_num,
|
||||
attr.storagevehicle_code,
|
||||
attr.storagevehicle_id,
|
||||
attr.sect_id,
|
||||
attr.sect_code,
|
||||
attr.sect_name,
|
||||
sub.sale_order_name,
|
||||
CASE
|
||||
WHEN SUBSTRING(sub.container_name,1,2) = 'BB' AND DATEDIFF( NOW(), sub.date_of_production ) > '180'
|
||||
THEN '1'
|
||||
WHEN SUBSTRING(sub.container_name,1,2) != 'BB' AND DATEDIFF( NOW(), sub.date_of_production ) > '90'
|
||||
THEN '1'
|
||||
ELSE '0'
|
||||
END AS is_overdue
|
||||
FROM
|
||||
ST_IVT_StructIvt ivt
|
||||
LEFT JOIN ST_IVT_StructAttr attr ON attr.struct_id = ivt.struct_id
|
||||
LEFT JOIN PDM_BI_SubPackageRelation sub ON attr.storagevehicle_code = sub.package_box_SN AND sub.container_name
|
||||
= ivt.pcsn
|
||||
WHERE
|
||||
attr.lock_type = '1'
|
||||
AND ivt.canuse_qty <![CDATA[ <> ]]> '0'
|
||||
<if test="param.sect_id != null and param.sect_id != ''">
|
||||
AND attr.sect_id = #{param.sect_id}
|
||||
</if>
|
||||
<if test="param.stor_id != null and param.stor_id != ''">
|
||||
AND attr.stor_id = #{param.stor_id}
|
||||
</if>
|
||||
<if test="param.box_in != null and !param.box_in.isEmpty()">
|
||||
AND attr.storagevehicle_code IN
|
||||
<foreach collection="param.box_in" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
order by ivt.instorage_time ASC
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package org.nl.b_lms.storage_manage.st.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.InventoryQueryParam;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtStructivt;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.basedata.st.service.dto.ProductStoreDownDto;
|
||||
@@ -63,4 +65,11 @@ public interface StIvtStructivtService extends IService<StIvtStructivt> {
|
||||
* @return
|
||||
*/
|
||||
StIvtStructivt getOneByPcsn(String pcsn, boolean throwEx);
|
||||
|
||||
/**
|
||||
* 获取所有库存信息
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<JSONObject> getAllInventorys(InventoryQueryParam param);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package org.nl.b_lms.storage_manage.st.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.InventoryQueryParam;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtStructivt;
|
||||
import org.nl.b_lms.storage_manage.st.dao.mapper.StIvtStructivtMapper;
|
||||
import org.nl.b_lms.storage_manage.st.service.StIvtBsrealstorattrService;
|
||||
@@ -71,4 +73,9 @@ public class StIvtStructivtServiceImpl extends ServiceImpl<StIvtStructivtMapper,
|
||||
lam.eq(StIvtStructivt::getPcsn, pcsn);
|
||||
return getOne(lam, throwEx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getAllInventorys(InventoryQueryParam param) {
|
||||
return stIvtStructivtMapper.getAllInventorys(param);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.nl.common.utils;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/6/20
|
||||
*/
|
||||
public class CollectionUtils {
|
||||
public static <T, U> List<U> mapList(Collection<T> from, Function<T, U> func) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return from.stream().map(func).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@@ -155,7 +155,7 @@ public class AcsToWmsController {
|
||||
}
|
||||
|
||||
@PostMapping("/sendSubVolumeApply")
|
||||
@Log(value = "二期内包间送子卷请求", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||
@Log(value = "二期套管工位请求判断去成品还是废箔", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> sendSubVolumeApply(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(acsToWmsService.sendSubVolumeApply(param), HttpStatus.OK);
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.st.outbill.rest;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtIostorinvOutService;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
@@ -17,6 +18,7 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 出库单管理
|
||||
@@ -72,4 +74,33 @@ public class CheckOutBillController {
|
||||
public ResponseEntity<Object> getInvTypes() {
|
||||
return new ResponseEntity<>(dictService.getInvTypes(), HttpStatus.OK);
|
||||
}
|
||||
@GetMapping("/getOutBillDis2")
|
||||
@Log("查询未出库单分配")
|
||||
public ResponseEntity<Object> getOutBillDis2(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(checkOutBillService.getOutBillDis2(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/allDiv")
|
||||
@Log("出库单全部分配")
|
||||
public ResponseEntity<Object> allDiv(@RequestBody JSONObject whereJson) {
|
||||
iStIvtIostorinvOutService.allDiv(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
@GetMapping("/getOutBillTask")
|
||||
@Log("查询出库单分配任务")
|
||||
public ResponseEntity<Object> getOutBillTask(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(checkOutBillService.getOutBillTask(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/allDivOne")
|
||||
@Log("出库单自动分配")
|
||||
public ResponseEntity<Object> allDivOne(@RequestBody JSONObject whereJson) {
|
||||
iStIvtIostorinvOutService.allDiv(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
@PostMapping("/allCancel")
|
||||
@Log("出库单全部取消")
|
||||
public ResponseEntity<Object> allCancel(@RequestBody JSONObject whereJson) {
|
||||
iStIvtIostorinvOutService.cancelDiv(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.nl.wms.st.outbill.service.vo.OutBillTaskVo;
|
||||
import org.nl.wms.st.outbill.service.vo.StockMaterialVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
@@ -50,4 +51,14 @@ public interface CheckOutBillService {
|
||||
* @return
|
||||
*/
|
||||
JSONArray queryBox(JSONObject whereJson);
|
||||
|
||||
JSONArray getOutBillDis2(Map whereJson);
|
||||
|
||||
/**
|
||||
* 查询出库单分配任务
|
||||
*
|
||||
* @param whereJson /
|
||||
* @return
|
||||
*/
|
||||
JSONArray getOutBillTask(Map whereJson);
|
||||
}
|
||||
|
||||
@@ -29,8 +29,10 @@ import org.nl.wms.stat.service.vo.PastStructPageVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
@@ -125,4 +127,30 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getOutBillDis2(Map whereJson) {
|
||||
whereJson.put("flag", "52");
|
||||
JSONArray jo = WQL.getWO("QST_IVT_CHECKOUTBILL")
|
||||
.addParamMap((HashMap) whereJson)
|
||||
.process()
|
||||
.getResultJSONArray(0);
|
||||
return jo;
|
||||
}
|
||||
@Override
|
||||
public JSONArray getOutBillTask(Map whereJson) {
|
||||
HashMap<String, String> map = new HashMap<>(whereJson);
|
||||
map.put("flag", "10");
|
||||
if ("true".equals(map.get("checked"))) {
|
||||
map.put("task_status", "99");
|
||||
}
|
||||
JSONArray jo = new JSONArray();
|
||||
if (map.containsKey("iostorinvdtl_id")) {
|
||||
jo = WQL.getWO("QST_IVT_CHECKOUTBILL")
|
||||
.addParamMap(map)
|
||||
.process()
|
||||
.getResultJSONArray(0);
|
||||
}
|
||||
return jo;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user