大屏更新

This commit is contained in:
ludj
2022-11-22 14:27:21 +08:00
parent 6b6558e498
commit dabd61fda0
13 changed files with 132 additions and 150 deletions

View File

@@ -1,7 +1,6 @@
package org.nl.wms.ext.dp.service.imp;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -13,8 +12,6 @@ import org.nl.modules.system.service.dto.UserDto;
import org.nl.utils.RsaUtils;
import org.nl.wms.ext.dp.service.BigScreenService;
import org.nl.wql.WQL;
import org.nl.wql.core.bean.WQLObject;
import org.nl.wql.core.engine.object.WO;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
@@ -172,24 +169,6 @@ public class BigScreenServiceImpl implements BigScreenService {
//查询熟化仓位信息
JSONArray allrows = WQL.getWO("QST_BIG_SCREEN").addParam("flag", "5").process()
.getResultJSONArray(0);
//物料标签明细表【md_base_materialLabelDtl】
WQLObject materialLabelDtlTab = WQLObject.getWQLObject("md_base_materialLabelDtl");
//拼接库存信息
for (int i = 0; i < allrows.size(); i++) {
JSONObject json = allrows.getJSONObject(i);
String labeldtl_uuid = json.getString("labeldtl_uuid");
if (StrUtil.isNotEmpty(labeldtl_uuid)) {
JSONObject jsonObject1 = materialLabelDtlTab.query("labeldtl_uuid = '" + labeldtl_uuid + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonObject1)) {
JSONObject labelObj = WQL.getWO("QST_BIG_SCREEN").addParam("flag", "12").addParam("labeldtl_uuid", labeldtl_uuid).process().uniqueResult(0);
//配方-批次-重量(YC-B8-1000)
String material_ivt_info = labelObj.getString("formula") + "-" + labelObj.getString("pcsn") + "-" + labelObj.getString("weight");
json.put("material_ivt_info", material_ivt_info);
json.put("color", labelObj.getString("color"));
}
}
}
return allrows;
}
@@ -306,24 +285,6 @@ public class BigScreenServiceImpl implements BigScreenService {
//查询恒温区信息
JSONArray allrows = WQL.getWO("QST_BIG_SCREEN").addParam("flag", "10").process()
.getResultJSONArray(0);
//物料标签明细表【md_base_materialLabelDtl】
WQLObject materialLabelDtlTab = WQLObject.getWQLObject("md_base_materialLabelDtl");
//拼接库存信息
for (int i = 0; i < allrows.size(); i++) {
JSONObject json = allrows.getJSONObject(i);
String labeldtl_uuid = json.getString("labeldtl_uuid");
if (StrUtil.isNotEmpty(labeldtl_uuid)) {
JSONObject jsonObject1 = materialLabelDtlTab.query("labeldtl_uuid = '" + labeldtl_uuid + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonObject1)) {
JSONObject labelObj = WQL.getWO("QST_BIG_SCREEN").addParam("flag", "12").addParam("labeldtl_uuid", labeldtl_uuid).process().uniqueResult(0);
//配方-批次-重量(YC-B8-1000)
String material_ivt_info = labelObj.getString("formula") + "-" + labelObj.getString("pcsn") + "-" + labelObj.getString("weight");
json.put("material_ivt_info", material_ivt_info);
json.put("color", labelObj.getString("color"));
}
}
}
return allrows;
}
}

View File

@@ -170,9 +170,13 @@ IF 输入.flag = "3"
material.material_code,
material.pcsn,
material.formula,
material.color,
point.point_code AS struct_code,
ivt.label_code,
ivt.labeldtl_uuid,
round( q.quantity, 0 ) AS quantity,
round( ivt.canuse_weight, 0 ) AS weight,
concat(material.formula,'-',material.pcsn,'-',round( ivt.canuse_weight, 0 )) AS material_ivt_info,
CASE
WHEN point.is_active = '0' THEN
@@ -181,7 +185,6 @@ IF 输入.flag = "3"
'3' ELSE '5'
END AS struct_type,
point.vehicle_code AS storagevehicle_code,
round ( ivt.canuse_qty, 0 ) AS quantity,
"" AS pcsn,
'在库' AS STATUS,
ivt.instorage_time,
@@ -198,6 +201,18 @@ IF 输入.flag = "3"
sch_base_point point
LEFT JOIN st_ivt_structivt ivt ON ivt.struct_uuid = point.point_uuid
LEFT JOIN md_base_materialLabelMst material ON material.label_uuid = ivt.label_uuid
LEFT JOIN (
SELECT
i.label_uuid,
count(*) AS quantity
FROM
st_ivt_structivt i
LEFT JOIN sch_base_point p ON i.struct_uuid = p.point_uuid
WHERE
p.area_type IN ( '01', '02' )
GROUP BY
i.label_uuid
) AS q ON ivt.label_uuid = q.label_uuid
WHERE
point.area_type IN ('01','02' )
ENDSELECT
@@ -344,9 +359,14 @@ IF 输入.flag = "8"
material.material_code,
material.pcsn,
material.formula,
material.color,
point.point_code AS struct_code,
point.point_uuid,
ivt.label_code,
ivt.labeldtl_uuid,
round( q.quantity, 0 ) AS quantity,
round( ivt.canuse_weight, 0 ) AS weight,
concat(material.formula,'-', material.pcsn,'-',round( ivt.canuse_weight, 0 )) AS material_ivt_info,
CASE
WHEN point.point_status = '01' THEN
@@ -356,17 +376,27 @@ IF 输入.flag = "8"
WHEN ( point.is_active = '0' ) THEN
'3' ELSE '4'
END AS struct_type,
point.vehicle_code AS storagevehicle_code,
round( ivt.canuse_qty, 0 ) AS quantity,
"" AS pcsn,
ivt.instorage_time,
"" AS status_name
point.vehicle_code AS storagevehicle_code
FROM
sch_base_point point
LEFT JOIN st_ivt_structivt ivt ON ivt.struct_uuid = point.point_uuid
LEFT JOIN md_base_materialLabelMst material ON material.label_uuid = ivt.label_uuid
LEFT JOIN (
SELECT
i.label_uuid,
count(*) AS quantity
FROM
st_ivt_structivt i
LEFT JOIN sch_base_point p ON i.struct_uuid = p.point_uuid
WHERE
p.area_type IN ( '03' )
GROUP BY
i.label_uuid
) AS q ON ivt.label_uuid = q.label_uuid
WHERE
point.area_type IN ('03' )
point.area_type IN (
'03'
)
ENDSELECT
ENDQUERY
ENDIF
@@ -391,25 +421,3 @@ IF 输入.flag = "8"
ENDQUERY
ENDIF
IF 输入.flag = "12"
QUERY
SELECT
mst.material_uuid,
mst.material_code,
mst.material_name,
mst.formula,
mst.pcsn,
mst.color,
dtl.weight
FROM
md_base_materialLabelDtl dtl
LEFT JOIN md_base_materialLabelMst mst ON dtl.label_uuid = mst.label_uuid
where 1=1
OPTION 输入.labeldtl_uuid <> ""
dtl.labeldtl_uuid = 输入.labeldtl_uuid
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -25,10 +25,8 @@ import org.nl.wms.sch.tasks.InEmptyVehicleTask;
import org.nl.wms.sch.tasks.MaterialBackTask;
import org.nl.wms.sch.tasks.TaskTypeEnum;
import org.nl.wms.st.core.IOStoreMst;
import org.nl.wms.st.core.enu.EmptyVehicleBillStatusEnum;
import org.nl.wms.st.core.service.EmptyVehicleService;
import org.nl.wms.st.core.service.IOStoreService;
import org.nl.wms.st.core.service.dto.EmptyVehicleDto;
import org.nl.wms.st.util.StructFindUtil;
import org.nl.wql.WQL;
import org.nl.wql.core.bean.WQLObject;
@@ -386,12 +384,29 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
if (ObjectUtil.isEmpty(map)) {
throw new BadRequestException("没有要完成的任务");
}
String produce_uuid = MapUtil.getStr(map, "produce_uuid");
/* String produce_uuid = MapUtil.getStr(map, "produce_uuid");
//生产任务表【pdm_base_produceTask】
WQLObject produceTaskTab = WQLObject.getWQLObject("pdm_base_produceTask");
JSONObject produceTaskObj = produceTaskTab.query("is_delete='0' and produce_uuid = '" + produce_uuid + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(produceTaskObj)) throw new BadRequestException("生产任务已完成或被删除,操作失败!");
produceTaskObj.put("produce_status", "02");
produceTaskTab.update(produceTaskObj);*/
//生产任务表【pdm_base_produceTask】
String produce_uuid = MapUtil.getStr(map, "produce_uuid");
WQLObject taskTab = WQLObject.getWQLObject("pdm_base_produceTask");
String currentUsername = SecurityUtils.getCurrentUsername();
String now = DateUtil.now();
JSONObject taskObj = taskTab.query("produce_uuid = '" + produce_uuid + "'").uniqueResult(0);
taskObj.put("produce_status", "02");
taskObj.put("remark", "强制结束完成");
taskObj.put("update_by", currentUsername);
taskObj.put("update_time", now);
taskTab.update(taskObj);
/* if (ObjectUtil.isEmpty(produceTaskObj)) throw new BadRequestException("生产任务已完成或被删除,操作失败!");
String produce_status = produceTaskObj.optString("produce_status");
if (StrUtil.equals("00", produce_status)) {
throw new BadRequestException("生产任务未叫料,不能生产完成!");
@@ -442,7 +457,7 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
map.put("produce_status", ProducStatus.FINISHED.getCode());
map.put("end_time", now);
}
WQLObject.getWQLObject("pdm_base_produceTask").update(map);
WQLObject.getWQLObject("pdm_base_produceTask").update(map);*/
}
@Override

View File

@@ -97,6 +97,8 @@ public class PointDto implements Serializable {
*/
private String label_uuid;
private String material_uuid;
private String label_code;
private String weight;
}

View File

@@ -115,8 +115,7 @@ public class PointServiceImpl implements PointService {
// 获取数据
String label_uuid = dto.getLabel_uuid();
String point_type1 = dto.getPoint_type1(); // 点位类型
String struct_code = dto.getPoint_code(); // 点位编码就是仓位编码
String point_type1 = dto.getPoint_type1();
String point_status = dto.getPoint_status();
String vehicle_code = dto.getVehicle_code();
String material_uuid = dto.getMaterial_uuid();
@@ -124,59 +123,34 @@ public class PointServiceImpl implements PointService {
WQLObject structIvtTab = WQLObject.getWQLObject("ST_IVT_StructIvt");
WQLObject materialLabelTab = WQLObject.getWQLObject("md_base_materialLabelMst");
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point");
WQLObject structTab = WQLObject.getWQLObject("st_base_struct");
JSONObject structIvtObj = null;
JSONObject structObj = null;
JSONObject materialLabelObj = null;
if (ObjectUtil.isNotEmpty(struct_code)) {
structObj = structTab.query("struct_code = '" + struct_code + "'").uniqueResult(0);
}
// 通过载具号获取仓位库存信息
if (ObjectUtil.isNotEmpty(structObj)) {
structIvtObj = structIvtTab.query("struct_uuid = '" + structObj.getString("struct_uuid") + "'").uniqueResult(0);
}
if (ObjectUtil.isNotEmpty(label_uuid)) {
materialLabelObj = materialLabelTab.query("label_uuid = '" + label_uuid + "'").uniqueResult(0);
}
if (point_type1.equals("01")) { // 仓位的时候需要对仓位库存进行操作
structIvtTab.delete("struct_uuid = '" + dto.getPoint_uuid() + "'");
if (point_status.equals("00")) { // 空位
// 删除仓位库存
if (ObjectUtil.isNotEmpty(structIvtObj)) structIvtTab.delete(structIvtObj);
vehicle_code = null;
} else if (point_status.equals("01")) { // 空载具
if (ObjectUtil.isNotEmpty(structIvtObj)) structIvtTab.delete(structIvtObj);
} else { // 有箱有料
JSONObject materialLabelObj = materialLabelTab.query("label_uuid = '" + label_uuid + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(materialLabelObj)) throw new BadRequestException("物料不能为空");
if (ObjectUtil.isEmpty(vehicle_code)) throw new BadRequestException("载具编码不能为空");
if (ObjectUtil.isEmpty(structIvtObj)) { // 仓位库存为空就插入
JSONObject structIvt = new JSONObject();
structIvt.put("stockrecord_uuid", IdUtil.simpleUUID());
structIvt.put("struct_uuid", structObj.getString("struct_uuid"));
structIvt.put("stand_hour", materialLabelObj.getString("stand_hour"));
structIvt.put("label_uuid", label_uuid);
structIvt.put("canuse_qty", "1");
structIvt.put("ivt_qty", "1");
structIvt.put("ivt_weight", "1");
structIvt.put("qty_unit_uuid", "2FE6EC94FF82441FADD6E78BA833CABC");
structIvt.put("weight_unit_uuid", "9F8D4F6046494CC0AC1EB17B09570A2C");
structIvt.put("material_uuid", material_uuid);
structIvt.put("vehicle_code", vehicle_code);
structIvt.put("instorage_time", DateUtil.now());
structIvtTab.insert(structIvt);
} else { // 修改
structIvtObj.put("struct_uuid", structObj.getString("struct_uuid"));
structIvtObj.put("label_uuid", label_uuid);
structIvtObj.put("stand_hour", materialLabelObj.getString("stand_hour"));
structIvtObj.put("material_uuid", material_uuid);
structIvtObj.put("vehicle_code", vehicle_code);
structIvtObj.put("instorage_time", DateUtil.now());
structIvtTab.update(structIvtObj);
}
if (ObjectUtil.isEmpty(dto.getWeight())) throw new BadRequestException("重量不能为空");
JSONObject structIvt = new JSONObject();
structIvt.put("stockrecord_uuid", IdUtil.simpleUUID());
structIvt.put("struct_uuid", dto.getPoint_uuid());
structIvt.put("stand_hour", materialLabelObj.getString("stand_hour"));
structIvt.put("label_uuid", label_uuid);
structIvt.put("canuse_qty", "1");
structIvt.put("ivt_qty", "1");
structIvt.put("canuse_weight", dto.getWeight());
structIvt.put("ivt_weight", dto.getWeight());
structIvt.put("qty_unit_uuid", "2FE6EC94FF82441FADD6E78BA833CABC");
structIvt.put("weight_unit_uuid", "9F8D4F6046494CC0AC1EB17B09570A2C");
structIvt.put("material_uuid", material_uuid);
structIvt.put("vehicle_code", vehicle_code);
structIvt.put("instorage_time", DateUtil.now());
structIvtTab.insert(structIvt);
}
}
// 点位修改

View File

@@ -70,10 +70,13 @@ public class InEmptyVehicleTask extends AbstractAcsTask {
//解锁下一点位
JSONObject nextPoint = pointTab.query("point_code='" + taskObj.optString("next_point_code") + "'").uniqueResult(0);
nextPoint.put("lock_type", "00");
nextPoint.put("point_status", "01");
nextPoint.put("vehicle_code", taskObj.optString("vehicle_code"));
pointTab.update(nextPoint);
if (ObjectUtil.isNotEmpty(nextPoint)){
nextPoint.put("lock_type", "00");
nextPoint.put("point_status", "01");
nextPoint.put("vehicle_code", taskObj.optString("vehicle_code"));
pointTab.update(nextPoint);
}
}

View File

@@ -164,6 +164,22 @@ public class StoreIvtServiceImpl {
throw new BadRequestException("变动类型不正确!");
}
json.put("vehicle_code", vehicle_code);
//更新标签和重量信息
WQLObject dtlTab = WQLObject.getWQLObject("md_base_materiallabeldtl");
String labeldtl_uuid = json.getString("labeldtl_uuid");
if (ObjectUtil.isNotEmpty(labeldtl_uuid)){
JSONObject labDtl = dtlTab.query("labeldtl_uuid = '" + labeldtl_uuid + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(labDtl)){
json.put("label_code",labDtl.getString("label_code"));
json.put("canuse_weight",labDtl.getString("weight"));
json.put("ivt_weight", labDtl.getString("weight"));
json.put("qty_unit_uuid", "2FE6EC94FF82441FADD6E78BA833CABC");
json.put("weight_unit_uuid", "9F8D4F6046494CC0AC1EB17B09570A2C");
}
}
stackIvtTab.insert(json);
}
// 对应的货位上有物料,需判断数量重量相关字段是否符合实际逻辑,符合时更新相应记录

View File

@@ -63,7 +63,7 @@ https://juejin.cn/post/6844903775631572999
<logger name="springfox.documentation" level="ERROR" additivity="false">
<appender-ref ref="asyncFileAppender"/>
</logger>
<logger name="jdbc.audit" level="ERROR" additivity="false">
<logger name="jdbc" level="ERROR" additivity="false">
<appender-ref ref="asyncFileAppender"/>
</logger>
<logger name="org.hibernate" level="ERROR" additivity="false">