Merge branch 'master' of http://121.40.234.130:8899/root/wuHanXinRui
This commit is contained in:
@@ -33,7 +33,9 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -383,6 +385,17 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
|||||||
mst_jo.put("syscompanyid", deptId + "");
|
mst_jo.put("syscompanyid", deptId + "");
|
||||||
io_mst.insert(mst_jo);
|
io_mst.insert(mst_jo);
|
||||||
|
|
||||||
|
//批量查询桶:
|
||||||
|
List<String> bucketuniqueCollenct = new ArrayList<>();
|
||||||
|
for (HashMap row : rows) {
|
||||||
|
bucketuniqueCollenct.add(String.valueOf(row.get("bucketunique")));
|
||||||
|
}
|
||||||
|
Map<String, JSONObject> buckqMap = bucket_wql.query("bucketunique in ('" + bucketuniqueCollenct.stream().collect(Collectors.joining("','")) + "')")
|
||||||
|
.getResultJSONArray(0).stream().collect(HashMap::new, (map, buckq) -> {
|
||||||
|
JSONObject jo = (JSONObject) buckq;
|
||||||
|
map.put("key_"+jo.getString("bucketunique")+jo.getString("material_id") + jo.getString("pcsn"), jo);
|
||||||
|
}, HashMap::putAll);
|
||||||
|
|
||||||
for (int i = 0; i < rows.size(); i++) {
|
for (int i = 0; i < rows.size(); i++) {
|
||||||
String iostorinvdtl_id = "";
|
String iostorinvdtl_id = "";
|
||||||
String iostorinvdis_id = "";
|
String iostorinvdis_id = "";
|
||||||
@@ -391,47 +404,45 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
|||||||
if (flag.equals("5") && row.containsKey("is_new") && row.get("is_new").equals("0")) {
|
if (flag.equals("5") && row.containsKey("is_new") && row.get("is_new").equals("0")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
JSONObject bucket_jo = buckqMap.get("key_" + row.get("bucketunique") + row.get("material_id") + row.get("pcsn"));
|
||||||
|
|
||||||
//校验桶状态
|
check:{ //校验桶状态
|
||||||
JSONObject bucket_jo = bucket_wql.query("bucketunique = '" + row.get("bucketunique") + "' AND material_id = '" + row.get("material_id") + "' AND pcsn = '" + row.get("pcsn") + "'").uniqueResult(0);
|
if (ObjectUtil.isEmpty(bucket_jo)) {
|
||||||
|
throw new PdaRequestException("桶号:" + row.get("bucketunique") + "查不到对应物料批次记录!");
|
||||||
if (ObjectUtil.isEmpty(bucket_jo)) {
|
|
||||||
throw new PdaRequestException("桶号:"+row.get("bucketunique")+"查不到对应物料批次记录!");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ObjectUtil.isEmpty(bucket_jo) && !bucket_jo.getString("status").equals("01")) {
|
|
||||||
//如果为软废采购入库,判断是否为新加,不是新加的不需要判断是否组盘
|
|
||||||
if (!flag.equals("5") && row.containsKey("is_new") && row.get("is_new").equals("0")) {
|
|
||||||
throw new PdaRequestException("桶" + bucket_jo.getString("bucketunique") + "已经组盘!");
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (flag.equals("1")) {
|
if (!ObjectUtil.isEmpty(bucket_jo) && !bucket_jo.getString("status").equals("01")) {
|
||||||
if (StrUtil.isNotEmpty(material_id) && StrUtil.isNotEmpty(pcsn)) {
|
//如果为软废采购入库,判断是否为新加,不是新加的不需要判断是否组盘
|
||||||
if (!row.get("material_id").equals(material_id) || !pcsn.equals(row.get("pcsn"))) {
|
if (!flag.equals("5") && row.containsKey("is_new") && row.get("is_new").equals("0")) {
|
||||||
throw new PdaRequestException("存在不同物料、批次的明细!");
|
throw new PdaRequestException("桶" + bucket_jo.getString("bucketunique") + "已经组盘!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag.equals("1")) {
|
||||||
|
if (StrUtil.isNotEmpty(material_id) && StrUtil.isNotEmpty(pcsn)) {
|
||||||
|
if (!row.get("material_id").equals(material_id) || !pcsn.equals(row.get("pcsn"))) {
|
||||||
|
throw new PdaRequestException("存在不同物料、批次的明细!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//工序返工入库校验、零头粉入库
|
||||||
|
if (flag.equals("3") || flag.equals("6")) {
|
||||||
|
//物料为PG粉
|
||||||
|
boolean is_pgf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.PGF.getCode(), bucket_jo.getString("material_id"), null);
|
||||||
|
//桶内物料必须为PG粉;
|
||||||
|
if (!is_pgf) {
|
||||||
|
throw new PdaRequestException("桶内物料不为PG粉!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (flag.equals("5") || flag.equals("7")) {
|
||||||
|
//物料为软废
|
||||||
|
boolean is_rf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.RF.getCode(), bucket_jo.getString("material_id"), null);
|
||||||
|
//桶内物料必须为软废;
|
||||||
|
if (!is_rf) {
|
||||||
|
throw new PdaRequestException("桶内物料不为软废!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//工序返工入库校验、零头粉入库
|
|
||||||
if (flag.equals("3") || flag.equals("6")) {
|
|
||||||
//物料为PG粉
|
|
||||||
boolean is_pgf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.PGF.getCode(), bucket_jo.getString("material_id"), null);
|
|
||||||
//桶内物料必须为PG粉;
|
|
||||||
if (!is_pgf) {
|
|
||||||
throw new PdaRequestException("桶内物料不为PG粉!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flag.equals("5") || flag.equals("7")) {
|
|
||||||
//物料为软废
|
|
||||||
boolean is_rf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.RF.getCode(), bucket_jo.getString("material_id"), null);
|
|
||||||
//桶内物料必须为软废;
|
|
||||||
if (!is_rf) {
|
|
||||||
throw new PdaRequestException("桶内物料不为软废!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//查询该桶记录是否存在
|
//查询该桶记录是否存在
|
||||||
if (ObjectUtil.isEmpty(bucket_jo) || !"01,02,03".contains(bucket_jo.getString("status"))) {
|
if (ObjectUtil.isEmpty(bucket_jo) || !"01,02,03".contains(bucket_jo.getString("status"))) {
|
||||||
//插入一条桶记录
|
//插入一条桶记录
|
||||||
@@ -442,10 +453,8 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
|||||||
row.put("flag", flag);
|
row.put("flag", flag);
|
||||||
this.insertBucket(row);
|
this.insertBucket(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
//立库返工入库校验
|
//立库返工入库校验
|
||||||
if (flag.equals("4")) {
|
if (flag.equals("4")) {
|
||||||
bucket_jo = bucket_wql.query("bucketunique = '" + row.get("bucketunique") + "' AND material_id = '" + row.get("material_id") + "' AND pcsn = '" + row.get("pcsn") + "'").uniqueResult(0);
|
|
||||||
//物料为PG粉
|
//物料为PG粉
|
||||||
boolean is_pgf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.PGF.getCode(), bucket_jo.getString("material_id"), null);
|
boolean is_pgf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.PGF.getCode(), bucket_jo.getString("material_id"), null);
|
||||||
//桶内物料必须为PG粉;
|
//桶内物料必须为PG粉;
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
IF 输入.flag = "11"
|
IF 输入.flag = "11"
|
||||||
QUERY
|
QUERY
|
||||||
SELECT
|
SELECT
|
||||||
IOStorInvDisDtl.*
|
IOStorInvDisDtl.storagevehicle_code
|
||||||
FROM
|
FROM
|
||||||
ST_IVT_IOStorInvDisDtl IOStorInvDisDtl
|
ST_IVT_IOStorInvDisDtl IOStorInvDisDtl
|
||||||
LEFT JOIN st_ivt_iostorinvdtl iostorinvdtl ON iostorinvdtl.iostorinvdtl_id = IOStorInvDisDtl.iostorinvdtl_id
|
LEFT JOIN st_ivt_iostorinvdtl iostorinvdtl ON iostorinvdtl.iostorinvdtl_id = IOStorInvDisDtl.iostorinvdtl_id
|
||||||
|
|||||||
@@ -38,8 +38,12 @@ public class RedissonUtils {
|
|||||||
throw new BadRequestException("当前业务正在执行:"+key+",稍后再试");
|
throw new BadRequestException("当前业务正在执行:"+key+",稍后再试");
|
||||||
}
|
}
|
||||||
}finally {
|
}finally {
|
||||||
if (isLock){
|
if (isLock && lock.isHeldByCurrentThread()){
|
||||||
lock.unlock();
|
try {
|
||||||
|
lock.unlock();
|
||||||
|
}catch (Exception ex){
|
||||||
|
System.out.println("redisson锁释放失败"+ex.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,6 +130,8 @@ https://juejin.cn/post/6844903775631572999
|
|||||||
<logger name="org.springframework" level="ERROR" additivity="false">
|
<logger name="org.springframework" level="ERROR" additivity="false">
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
</logger>
|
</logger>
|
||||||
|
<logger name="org.nl.wql.core.engine.object.WP" level="off">
|
||||||
|
</logger>
|
||||||
<logger name="org.hibernate" level="ERROR" additivity="false">
|
<logger name="org.hibernate" level="ERROR" additivity="false">
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
</logger>
|
</logger>
|
||||||
|
|||||||
Reference in New Issue
Block a user