Merge remote-tracking branch 'origin/master_merge' into master_merge
This commit is contained in:
@@ -179,7 +179,10 @@ public class VehicleTwoServiceImpl implements VehicleTwoService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public JSONObject reback(JSONObject whereJson) {
|
public JSONObject reback(JSONObject whereJson) {
|
||||||
|
WQLObject extTab = WQLObject.getWQLObject("md_pb_storagevehicleext");
|
||||||
|
|
||||||
String bill_type = whereJson.getString("bill_type");
|
String bill_type = whereJson.getString("bill_type");
|
||||||
whereJson.put("material_barcode", whereJson.getString("box_no"));
|
whereJson.put("material_barcode", whereJson.getString("box_no"));
|
||||||
whereJson.put("device_code", whereJson.getString("point_code"));
|
whereJson.put("device_code", whereJson.getString("point_code"));
|
||||||
@@ -217,6 +220,8 @@ public class VehicleTwoServiceImpl implements VehicleTwoService {
|
|||||||
);
|
);
|
||||||
if (boxDao != null) {
|
if (boxDao != null) {
|
||||||
whereJson.put("vehicleType", boxDao.getVehicle_type());
|
whereJson.put("vehicleType", boxDao.getVehicle_type());
|
||||||
|
boxDao.setIs_packing("1");
|
||||||
|
iBstIvtBoxinfoService.updateById(boxDao);
|
||||||
} else {
|
} else {
|
||||||
//查询mes木箱信息,插入木箱信息表
|
//查询mes木箱信息,插入木箱信息表
|
||||||
try {
|
try {
|
||||||
@@ -230,8 +235,18 @@ public class VehicleTwoServiceImpl implements VehicleTwoService {
|
|||||||
new QueryWrapper<BstIvtBoxinfo>().lambda()
|
new QueryWrapper<BstIvtBoxinfo>().lambda()
|
||||||
.eq(BstIvtBoxinfo::getBox_no, boxNo)
|
.eq(BstIvtBoxinfo::getBox_no, boxNo)
|
||||||
);
|
);
|
||||||
|
boxDao1.setIs_packing("1");
|
||||||
|
iBstIvtBoxinfoService.updateById(boxDao1);
|
||||||
whereJson.put("vehicleType", boxDao1.getVehicle_type());
|
whereJson.put("vehicleType", boxDao1.getVehicle_type());
|
||||||
}
|
}
|
||||||
|
// 更新载具对应木箱信息
|
||||||
|
JSONObject jsonExt = extTab.query("storagevehicle_code = '" + whereJson.getString("vehicle_code") + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(jsonExt)) {
|
||||||
|
throw new BadRequestException("载具不存在!"+whereJson.getString("vehicle_code"));
|
||||||
|
}
|
||||||
|
jsonExt.put("pcsn", whereJson.getString("box_no"));
|
||||||
|
extTab.update(jsonExt);
|
||||||
|
|
||||||
inBussManageService.inTask(whereJson);
|
inBussManageService.inTask(whereJson);
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
result.put("message", "入库成功!");
|
result.put("message", "入库成功!");
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ import java.util.Map;
|
|||||||
public enum SUBEnum {
|
public enum SUBEnum {
|
||||||
// 子卷包装状态
|
// 子卷包装状态
|
||||||
STATUS(MapOf.of("生成", "0", "包装", "1", "入库", "2", "出库", "3")),
|
STATUS(MapOf.of("生成", "0", "包装", "1", "入库", "2", "出库", "3")),
|
||||||
|
|
||||||
|
// 子卷包装类型
|
||||||
|
SUB_TYPE(MapOf.of("返检入库", "1", "改切入库", "2")),
|
||||||
;
|
;
|
||||||
|
|
||||||
private Map<String, String> code;
|
private Map<String, String> code;
|
||||||
|
|||||||
@@ -524,7 +524,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
|
|||||||
StIvtIostorinv mstDao = this.getById(jsonDis.getString("iostorinv_id"));
|
StIvtIostorinv mstDao = this.getById(jsonDis.getString("iostorinv_id"));
|
||||||
|
|
||||||
// 查询木箱对应的绑定关系
|
// 查询木箱对应的绑定关系
|
||||||
JSONObject jsonVeExt = veExtTab.query("pcsn = '" + whereJson.get("vehicle_code") + "'")
|
JSONObject jsonVeExt = veExtTab.query("pcsn = '" + jsonDis.get("storagevehicle_code") + "'")
|
||||||
.uniqueResult(0);
|
.uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(jsonVeExt)) {
|
if (ObjectUtil.isEmpty(jsonVeExt)) {
|
||||||
throw new BadRequestException("此木箱没有绑定托盘号!"+whereJson.get("vehicle_code"));
|
throw new BadRequestException("此木箱没有绑定托盘号!"+whereJson.get("vehicle_code"));
|
||||||
@@ -535,7 +535,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
|
|||||||
jsonTaskParam.put("task_type", "010703");
|
jsonTaskParam.put("task_type", "010703");
|
||||||
jsonTaskParam.put("start_device_code", pointDto.getPoint_code());
|
jsonTaskParam.put("start_device_code", pointDto.getPoint_code());
|
||||||
jsonTaskParam.put("next_device_code", jsonDis.getString("struct_code"));
|
jsonTaskParam.put("next_device_code", jsonDis.getString("struct_code"));
|
||||||
jsonTaskParam.put("vehicle_code", whereJson.get("vehicle_code"));
|
jsonTaskParam.put("vehicle_code", jsonDis.get("storagevehicle_code"));
|
||||||
jsonTaskParam.put("vehicle_code2", jsonVeExt.getString("storagevehicle_code"));
|
jsonTaskParam.put("vehicle_code2", jsonVeExt.getString("storagevehicle_code"));
|
||||||
jsonTaskParam.put("inv_type", mstDao.getBill_type());
|
jsonTaskParam.put("inv_type", mstDao.getBill_type());
|
||||||
jsonTaskParam.put("inv_id", mstDao.getIostorinv_id());
|
jsonTaskParam.put("inv_id", mstDao.getIostorinv_id());
|
||||||
|
|||||||
@@ -301,6 +301,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void returnIn(JSONObject whereJson) {
|
public void returnIn(JSONObject whereJson) {
|
||||||
// 载具表
|
// 载具表
|
||||||
//api/twoPda/vehicle/returnIn
|
//api/twoPda/vehicle/returnIn
|
||||||
@@ -329,11 +330,12 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
new QueryWrapper<BstIvtBoxinfo>().lambda()
|
new QueryWrapper<BstIvtBoxinfo>().lambda()
|
||||||
.eq(BstIvtBoxinfo::getBox_no, whereJson.getString("box_no"))
|
.eq(BstIvtBoxinfo::getBox_no, whereJson.getString("box_no"))
|
||||||
);
|
);
|
||||||
boxDao.setIs_packing("1");
|
|
||||||
iBstIvtBoxinfoService.updateById(boxDao);
|
|
||||||
if (boxDao == null) {
|
if (boxDao == null) {
|
||||||
throw new BadRequestException("木箱不存在!");
|
throw new BadRequestException("木箱不存在!");
|
||||||
}
|
}
|
||||||
|
boxDao.setIs_packing("1");
|
||||||
|
iBstIvtBoxinfoService.updateById(boxDao);
|
||||||
|
|
||||||
// 下发桁架任务
|
// 下发桁架任务
|
||||||
JSONObject taskParam = new JSONObject();
|
JSONObject taskParam = new JSONObject();
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import lombok.extern.log4j.Log4j;
|
import lombok.extern.log4j.Log4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
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.dao.SchBaseTask;
|
||||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||||
@@ -245,7 +246,18 @@ public class InBussManageServiceImpl implements InBussManageService {
|
|||||||
mst.put("bill_status", IOSEnum.BILL_STATUS.code("生成"));
|
mst.put("bill_status", IOSEnum.BILL_STATUS.code("生成"));
|
||||||
mst.put("total_qty", subList.stream().map(row -> row.getDoubleValue("net_weight")).reduce(Double::sum).orElse(0.00));
|
mst.put("total_qty", subList.stream().map(row -> row.getDoubleValue("net_weight")).reduce(Double::sum).orElse(0.00));
|
||||||
mst.put("detail_count", subList.size());
|
mst.put("detail_count", subList.size());
|
||||||
|
// 根据子卷类型判断是返检入库还是反切入库
|
||||||
|
if (ObjectUtil.isEmpty(subList.get(0).getString("sub_type"))) {
|
||||||
mst.put("bill_type", jsonObject.getString("bill_type"));
|
mst.put("bill_type", jsonObject.getString("bill_type"));
|
||||||
|
} else {
|
||||||
|
if (subList.get(0).getString("sub_type").equals(SUBEnum.SUB_TYPE.code("返检入库"))) {
|
||||||
|
mst.put("bill_type", IOSEnum.IN_TYPE.code("返检入库"));
|
||||||
|
} else if (subList.get(0).getString("sub_type").equals(SUBEnum.SUB_TYPE.code("改切入库"))) {
|
||||||
|
mst.put("bill_type", IOSEnum.IN_TYPE.code("改切入库"));
|
||||||
|
} else {
|
||||||
|
mst.put("bill_type", jsonObject.getString("bill_type"));
|
||||||
|
}
|
||||||
|
}
|
||||||
mst.put("biz_date", DateUtil.today());
|
mst.put("biz_date", DateUtil.today());
|
||||||
mst.put("remark", "");
|
mst.put("remark", "");
|
||||||
// 明细
|
// 明细
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
|
|||||||
jsonParam.put("stor_id", IOSEnum.STOR_ID.code("二期"));
|
jsonParam.put("stor_id", IOSEnum.STOR_ID.code("二期"));
|
||||||
jsonParam.put("sect_id", RegionTypeEnum.TWO_BZC01.getId());
|
jsonParam.put("sect_id", RegionTypeEnum.TWO_BZC01.getId());
|
||||||
jsonParam.put("material_code", boxDao.getMaterial_code());
|
jsonParam.put("material_code", boxDao.getMaterial_code());
|
||||||
|
jsonParam.put("move_block_num", jsonAttr.getString("block_num"));
|
||||||
jsonParam.put("num", boxDao.getNum());
|
jsonParam.put("num", boxDao.getNum());
|
||||||
|
|
||||||
// 调用找货位方法
|
// 调用找货位方法
|
||||||
@@ -235,17 +236,31 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
|
|||||||
* 判断是否有相同规格的木箱
|
* 判断是否有相同规格的木箱
|
||||||
* 判断条件:库区、仓库、是否启用、是否删除、未锁定、有载具、相同规格的木箱
|
* 判断条件:库区、仓库、是否启用、是否删除、未锁定、有载具、相同规格的木箱
|
||||||
*/
|
*/
|
||||||
|
String block_num = whereJson.getString("move_block_num");
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(block_num)) {
|
||||||
whereJson.put("flag", "6");
|
whereJson.put("flag", "6");
|
||||||
|
} else {
|
||||||
|
whereJson.put("flag", "7");
|
||||||
|
}
|
||||||
|
|
||||||
JSONArray structArray = WQL.getWO("BST_OUTBOX").addParamMap(whereJson).process().getResultJSONArray(0);
|
JSONArray structArray = WQL.getWO("BST_OUTBOX").addParamMap(whereJson).process().getResultJSONArray(0);
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(structArray)) {
|
if (ObjectUtil.isEmpty(structArray)) {
|
||||||
notOutRowList.clear();
|
notOutRowList.clear();
|
||||||
notOutBlockList.clear();
|
notOutBlockList.clear();
|
||||||
|
if (ObjectUtil.isNotEmpty(block_num)) {
|
||||||
|
throw new BadRequestException(block_num+"号巷道没有相同规格的木箱!木箱料号:"+whereJson.getString("material_code"));
|
||||||
|
} else {
|
||||||
throw new BadRequestException("没有相同规格的木箱!");
|
throw new BadRequestException("没有相同规格的木箱!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// 确定巷道:找相同规格木箱的最多的巷道
|
// 确定巷道:找相同规格木箱的最多的巷道
|
||||||
String block_num = getMaxBlock(whereJson);
|
if (ObjectUtil.isEmpty(block_num)) {
|
||||||
|
block_num = getMaxBlock(whereJson);
|
||||||
|
}
|
||||||
|
|
||||||
// 确定排:找某一巷道规格木箱的最多排
|
// 确定排:找某一巷道规格木箱的最多排
|
||||||
whereJson.put("block_num", block_num);
|
whereJson.put("block_num", block_num);
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ public class OutVehicleManageServiceImpl implements OutVehicleManageService {
|
|||||||
jsonTaskParam.put("next_device_code", whereJson.getString("device_code"));
|
jsonTaskParam.put("next_device_code", whereJson.getString("device_code"));
|
||||||
jsonTaskParam.put("vehicle_code", jsonAttr.getString("storagevehicle_code"));
|
jsonTaskParam.put("vehicle_code", jsonAttr.getString("storagevehicle_code"));
|
||||||
jsonTaskParam.put("containerType", whereJson.getString("vehicle_type"));
|
jsonTaskParam.put("containerType", whereJson.getString("vehicle_type"));
|
||||||
|
jsonTaskParam.put("vehicle_type", whereJson.getString("vehicle_type"));
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("containerType", whereJson.getString("vehicle_type"));
|
param.put("containerType", whereJson.getString("vehicle_type"));
|
||||||
jsonTaskParam.put("request_param", param.toString());
|
jsonTaskParam.put("request_param", param.toString());
|
||||||
@@ -139,6 +140,7 @@ public class OutVehicleManageServiceImpl implements OutVehicleManageService {
|
|||||||
JSONObject jsonParam = new JSONObject();
|
JSONObject jsonParam = new JSONObject();
|
||||||
jsonParam.put("stor_id", IOSEnum.STOR_ID.code("二期"));
|
jsonParam.put("stor_id", IOSEnum.STOR_ID.code("二期"));
|
||||||
jsonParam.put("sect_id", RegionTypeEnum.TWO_BZC01.getId());
|
jsonParam.put("sect_id", RegionTypeEnum.TWO_BZC01.getId());
|
||||||
|
jsonParam.put("move_block_num", jsonAttr.getString("block_num"));
|
||||||
jsonParam.put("storagevehicle_type", taskDao.getVehicle_type());
|
jsonParam.put("storagevehicle_type", taskDao.getVehicle_type());
|
||||||
|
|
||||||
// 调用找货位方法
|
// 调用找货位方法
|
||||||
@@ -214,19 +216,35 @@ public class OutVehicleManageServiceImpl implements OutVehicleManageService {
|
|||||||
* 判断是否有相同类型的托盘
|
* 判断是否有相同类型的托盘
|
||||||
* 判断条件:库区、仓库、是否启用、是否删除、未锁定、有载具、相同载具类型
|
* 判断条件:库区、仓库、是否启用、是否删除、未锁定、有载具、相同载具类型
|
||||||
*/
|
*/
|
||||||
JSONArray structArray = attrTab.query("IFNULL(storagevehicle_code,'') <> '' " +
|
String block_num = whereJson.getString("move_block_num");
|
||||||
|
|
||||||
|
JSONArray structArray = new JSONArray();
|
||||||
|
if (ObjectUtil.isEmpty(block_num)) {
|
||||||
|
structArray = attrTab.query("IFNULL(storagevehicle_code,'') <> '' " +
|
||||||
"AND is_used = '" + IOSEnum.IS_NOTANDYES.code("是") + "' AND is_delete = '" + IOSEnum.IS_NOTANDYES.code("否") + "' " +
|
"AND is_used = '" + IOSEnum.IS_NOTANDYES.code("是") + "' AND is_delete = '" + IOSEnum.IS_NOTANDYES.code("否") + "' " +
|
||||||
"AND lock_type = '" + IOSEnum.LOCK_TYPE.code("未锁定") + "' AND stor_id = '"+whereJson.getString("stor_id")+"' " +
|
"AND lock_type = '" + IOSEnum.LOCK_TYPE.code("未锁定") + "' AND stor_id = '"+whereJson.getString("stor_id")+"' " +
|
||||||
"AND sect_id = '"+whereJson.getString("sect_id")+"' AND storagevehicle_type = '"+whereJson.getString("storagevehicle_type")+"'").getResultJSONArray(0);
|
"AND sect_id = '"+whereJson.getString("sect_id")+"' AND storagevehicle_type = '"+whereJson.getString("storagevehicle_type")+"' AND is_emptyvehicle = '1'").getResultJSONArray(0);
|
||||||
|
} else {
|
||||||
|
structArray = attrTab.query("IFNULL(storagevehicle_code,'') <> '' " +
|
||||||
|
"AND is_used = '" + IOSEnum.IS_NOTANDYES.code("是") + "' AND is_delete = '" + IOSEnum.IS_NOTANDYES.code("否") + "' " +
|
||||||
|
"AND lock_type = '" + IOSEnum.LOCK_TYPE.code("未锁定") + "' AND stor_id = '"+whereJson.getString("stor_id")+"' " +
|
||||||
|
"AND sect_id = '"+whereJson.getString("sect_id")+"' AND storagevehicle_type = '"+whereJson.getString("storagevehicle_type")+"' AND block_num = '"+block_num+"' AND is_emptyvehicle = '1'").getResultJSONArray(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(structArray)) {
|
if (ObjectUtil.isEmpty(structArray)) {
|
||||||
notOutRowList.clear();
|
notOutRowList.clear();
|
||||||
notOutBlockList.clear();
|
notOutBlockList.clear();
|
||||||
|
if (ObjectUtil.isNotEmpty(block_num)) {
|
||||||
|
throw new BadRequestException(block_num+"号巷道没有相同托盘类型的库存!托盘类型:"+whereJson.getString("storagevehicle_type"));
|
||||||
|
} else {
|
||||||
throw new BadRequestException("没有相同托盘类型的库存!");
|
throw new BadRequestException("没有相同托盘类型的库存!");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 确定巷道:找相同托盘类型的最多的巷道
|
// 确定巷道:找相同托盘类型的最多的巷道
|
||||||
String block_num = getMaxBlock(whereJson);
|
if (ObjectUtil.isEmpty(block_num)) {
|
||||||
|
block_num = getMaxBlock(whereJson);
|
||||||
|
}
|
||||||
|
|
||||||
// 确定排:找某一巷道相同托盘类型的最多排
|
// 确定排:找某一巷道相同托盘类型的最多排
|
||||||
whereJson.put("block_num", block_num);
|
whereJson.put("block_num", block_num);
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
输入.box_high TYPEAS s_string
|
输入.box_high TYPEAS s_string
|
||||||
输入.num TYPEAS s_string
|
输入.num TYPEAS s_string
|
||||||
输入.material_code TYPEAS s_string
|
输入.material_code TYPEAS s_string
|
||||||
|
输入.move_block_num TYPEAS s_string
|
||||||
|
|
||||||
[临时表]
|
[临时表]
|
||||||
--这边列出来的临时表就会在运行期动态创建
|
--这边列出来的临时表就会在运行期动态创建
|
||||||
@@ -325,3 +326,47 @@
|
|||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
|
IF 输入.flag = "7"
|
||||||
|
QUERY
|
||||||
|
SELECT
|
||||||
|
attr.*
|
||||||
|
FROM
|
||||||
|
st_ivt_structattr attr
|
||||||
|
INNER JOIN bst_ivt_boxinfo box ON attr.storagevehicle_code = box.box_no
|
||||||
|
WHERE
|
||||||
|
attr.is_used = '1'
|
||||||
|
AND attr.is_delete = '0'
|
||||||
|
AND attr.lock_type = '1'
|
||||||
|
AND IFNULL(storagevehicle_code,'') <> ''
|
||||||
|
AND attr.stor_id = 输入.stor_id
|
||||||
|
AND attr.sect_id = 输入.sect_id
|
||||||
|
AND box.is_packing = '0'
|
||||||
|
|
||||||
|
OPTION 输入.box_length <> ""
|
||||||
|
box.box_length = 输入.box_length
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.box_width <> ""
|
||||||
|
box.box_width = 输入.box_width
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.box_high <> ""
|
||||||
|
box.box_high = 输入.box_high
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.material_code <> ""
|
||||||
|
box.material_code = 输入.material_code
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.move_block_num <> ""
|
||||||
|
attr.block_num = 输入.move_block_num
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.num <> ""
|
||||||
|
box.num = 输入.num
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
ENDSELECT
|
||||||
|
ENDQUERY
|
||||||
|
ENDIF
|
||||||
|
|||||||
Reference in New Issue
Block a user