add 新增
This commit is contained in:
@@ -18,7 +18,7 @@ import java.util.Map;
|
|||||||
@Getter
|
@Getter
|
||||||
public enum BoxStackEnum {
|
public enum BoxStackEnum {
|
||||||
// 木箱任务类型
|
// 木箱任务类型
|
||||||
TASK_TYPE(MapOf.of("木箱入库", "010702", "木箱出库", "010704", "木箱移库", "010705","木箱缓存区到对接位", "010706","木箱行架", "010706","木箱对接位到缓存区", "010707")),
|
TASK_TYPE(MapOf.of("木箱入库", "010702", "木箱出库", "010705", "木箱移库", "010706","木箱缓存区到对接位", "010704","木箱行架", "010701","木箱对接位到缓存区", "010703")),
|
||||||
// 木箱出入库任务二次分配类型
|
// 木箱出入库任务二次分配类型
|
||||||
AGV_ACTION_TYPE(MapOf.of("普通任务", "1", "取货二次分配", "2", "放货二次分配", "3", "取放货二次分配", "4")),
|
AGV_ACTION_TYPE(MapOf.of("普通任务", "1", "取货二次分配", "2", "放货二次分配", "3", "取放货二次分配", "4")),
|
||||||
//AGV取放货完成
|
//AGV取放货完成
|
||||||
|
|||||||
@@ -178,27 +178,27 @@ public class InBoxTrussTask extends AbstractAcsTask {
|
|||||||
BstIvtBoxstack bstIvtBoxstack = new BstIvtBoxstack();
|
BstIvtBoxstack bstIvtBoxstack = new BstIvtBoxstack();
|
||||||
bstIvtBoxstack.setCurrent_layer_count(bstIvtBoxstackUpdate.getCurrent_layer_count() - 1);
|
bstIvtBoxstack.setCurrent_layer_count(bstIvtBoxstackUpdate.getCurrent_layer_count() - 1);
|
||||||
boxstackMapper.updateById(bstIvtBoxstack);
|
boxstackMapper.updateById(bstIvtBoxstack);
|
||||||
JSONObject json = new JSONObject();
|
SchBaseTask schBaseTask = new SchBaseTask();
|
||||||
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
schBaseTask.setTask_id(String.valueOf(IdUtil.getSnowflake(1, 1).nextId()));
|
||||||
json.put("task_code", IdUtil.getSnowflake(1, 1).nextId());
|
schBaseTask.setTask_code(String.valueOf(IdUtil.getSnowflake(1, 1).nextId()));
|
||||||
json.put("task_type", form.getString("task_type"));
|
schBaseTask.setTask_type(form.getString("task_type"));
|
||||||
json.put("vehicle_code", form.getString("vehicle_code"));
|
schBaseTask.setVehicle_code(form.getString("vehicle_code"));
|
||||||
json.put("vehicle_code2", form.getString("vehicle_code2"));
|
schBaseTask.setVehicle_code2(form.getString("vehicle_code2"));
|
||||||
json.put("vehicle_type", form.getString("vehicle_type"));
|
schBaseTask.setVehicle_type(form.getString("vehicle_type"));
|
||||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
schBaseTask.setTask_status(TaskStatusEnum.START_AND_POINT.getCode());
|
||||||
json.put("task_group_id", form.getLongValue("task_group_id"));
|
schBaseTask.setTask_group_id(String.valueOf(form.getLongValue("task_group_id")));
|
||||||
json.put("point_code1", form.getString("start_device_code"));
|
schBaseTask.setPoint_code1(form.getString("start_device_code"));
|
||||||
json.put("point_code2", form.getString("next_device_code"));
|
schBaseTask.setPoint_code2(form.getString("next_device_code"));
|
||||||
json.put("product_area", "BLK");
|
schBaseTask.setProduct_area("BLK");
|
||||||
json.put("handle_class", this.getClass().getName());
|
schBaseTask.setHandle_class(this.getClass().getName());
|
||||||
json.put("create_id", SecurityUtils.getCurrentUserId());
|
schBaseTask.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||||
json.put("create_name", SecurityUtils.getCurrentUsername());
|
schBaseTask.setCreate_name(SecurityUtils.getCurrentUsername());
|
||||||
json.put("create_time", DateUtil.now());
|
schBaseTask.setCreate_time(DateUtil.now());
|
||||||
json.put("priority", "1");
|
schBaseTask.setPriority("1");
|
||||||
json.put("acs_task_type", "6");
|
schBaseTask.setAcs_task_type("6");
|
||||||
json.put("request_param", form.getString("request_param"));
|
schBaseTask.setRequest_param(form.getString("request_param"));
|
||||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(json);
|
taskService.save(schBaseTask);
|
||||||
return json.getString("task_id");
|
return schBaseTask.getTask_id();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv.impl;
|
package org.nl.b_lms.storage_manage.ios.service.iostorInv.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
@@ -9,6 +10,7 @@ import com.alibaba.fastjson.JSONArray;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
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.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@@ -21,9 +23,13 @@ import org.nl.b_lms.pdm.storagevehicleext.dao.MdPbStoragevehicleext;
|
|||||||
import org.nl.b_lms.pdm.storagevehicleext.dao.mapper.MdPbStoragevehicleextMapper;
|
import org.nl.b_lms.pdm.storagevehicleext.dao.mapper.MdPbStoragevehicleextMapper;
|
||||||
import org.nl.b_lms.pdm.storagevehicleext.service.IMdPbStoragevehicleextService;
|
import org.nl.b_lms.pdm.storagevehicleext.service.IMdPbStoragevehicleextService;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||||
|
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelationrecord;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper;
|
import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper;
|
||||||
|
import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationrecordMapper;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||||
import org.nl.b_lms.pdm_manage.enums.SUBEnum;
|
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.TwoInTask;
|
import org.nl.b_lms.sch.tasks.TwoInTask;
|
||||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
||||||
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
|
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
|
||||||
@@ -58,6 +64,7 @@ import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
|
|||||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||||
import org.nl.wms.sch.service.PointService;
|
import org.nl.wms.sch.service.PointService;
|
||||||
|
import org.nl.wms.sch.service.TaskService;
|
||||||
import org.nl.wms.sch.service.dto.PointDto;
|
import org.nl.wms.sch.service.dto.PointDto;
|
||||||
import org.nl.wms.st.inbill.service.StorPublicService;
|
import org.nl.wms.st.inbill.service.StorPublicService;
|
||||||
import org.nl.wms.st.inbill.service.dto.ChargePageParam;
|
import org.nl.wms.st.inbill.service.dto.ChargePageParam;
|
||||||
@@ -164,6 +171,14 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
|
|||||||
@Autowired
|
@Autowired
|
||||||
private MdPbStoragevehicleextMapper mdPbStoragevehicleextMapper;
|
private MdPbStoragevehicleextMapper mdPbStoragevehicleextMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IschBaseTaskService taskService;
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PdmBiSubpackagerelationrecordMapper pdmBiSubpackagerelationrecordMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object pageQuery(Map query, Pageable pageQuery) {
|
public Object pageQuery(Map query, Pageable pageQuery) {
|
||||||
Page<Object> page = PageHelper.startPage(pageQuery.getPageNumber() + 1, pageQuery.getPageSize());
|
Page<Object> page = PageHelper.startPage(pageQuery.getPageNumber() + 1, pageQuery.getPageSize());
|
||||||
@@ -917,7 +932,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
|
|||||||
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr");
|
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr");
|
||||||
|
|
||||||
// 仓位表
|
// 仓位表
|
||||||
WQLObject taskService = WQLObject.getWQLObject("sch_base_task");
|
// WQLObject taskService = WQLObject.getWQLObject("sch_base_task");
|
||||||
|
|
||||||
// 子卷包装关系表
|
// 子卷包装关系表
|
||||||
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation");
|
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation");
|
||||||
@@ -993,63 +1008,111 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
|
|||||||
mstDao.setConfirm_time(DateUtil.now());
|
mstDao.setConfirm_time(DateUtil.now());
|
||||||
|
|
||||||
// 更新任务为完成
|
// 更新任务为完成
|
||||||
JSONObject jsonTaskParam = new JSONObject();
|
// JSONObject jsonTaskParam = new JSONObject();
|
||||||
jsonTaskParam.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
// jsonTaskParam.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||||
jsonTaskParam.put("update_optid", SecurityUtils.getCurrentUserId());
|
// jsonTaskParam.put("update_optid", SecurityUtils.getCurrentUserId());
|
||||||
jsonTaskParam.put("update_optname", SecurityUtils.getCurrentNickName());
|
// jsonTaskParam.put("update_optname", SecurityUtils.getCurrentNickName());
|
||||||
jsonTaskParam.put("update_time", DateUtil.now());
|
// jsonTaskParam.put("update_time", DateUtil.now());
|
||||||
|
//
|
||||||
|
// List<String> needUpdateTaskList = new ArrayList<>();
|
||||||
|
//
|
||||||
|
// for (int i = 0; i < disDaoList.size(); i++) {
|
||||||
|
// StIvtIostorinvdis disDao = disDaoList.get(i);
|
||||||
|
// if (disDao.getTask_id() != null) {
|
||||||
|
//
|
||||||
|
// needUpdateTaskList.add(disDao.getTask_id().toString());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// taskService.update(jsonTaskParam, "task_id IN ('" + String.join("','", needUpdateTaskList) + "') AND task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'");
|
||||||
|
|
||||||
|
|
||||||
List<String> needUpdateTaskList = new ArrayList<>();
|
List<String> needUpdateTaskList = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 0; i < disDaoList.size(); i++) {
|
for (int i = 0; i < disDaoList.size(); i++) {
|
||||||
StIvtIostorinvdis disDao = disDaoList.get(i);
|
StIvtIostorinvdis disDao = disDaoList.get(i);
|
||||||
if (disDao.getTask_id() != null) {
|
if (disDao.getTask_id() != null) {
|
||||||
|
needUpdateTaskList.add(disDao.getTask_id());
|
||||||
needUpdateTaskList.add(disDao.getTask_id().toString());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
taskService.update(jsonTaskParam, "task_id IN ('" + String.join("','", needUpdateTaskList) + "') AND task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'");
|
if (!needUpdateTaskList.isEmpty()) {
|
||||||
|
LambdaUpdateWrapper<SchBaseTask> updateWrapper = new LambdaUpdateWrapper<SchBaseTask>()
|
||||||
|
.in(SchBaseTask::getTask_id, needUpdateTaskList)
|
||||||
|
.ne(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
|
||||||
|
.set(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
|
||||||
|
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId())
|
||||||
|
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentNickName())
|
||||||
|
.set(SchBaseTask::getUpdate_time, DateUtil.now());
|
||||||
|
|
||||||
|
taskService.update(updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 更新子卷包装关系
|
// 更新子卷包装关系
|
||||||
String pcsn_in = disDaoList.stream()
|
// String pcsn_in = disDaoList.stream()
|
||||||
|
// .map(StIvtIostorinvdis::getPcsn)
|
||||||
|
// .collect(Collectors.joining("','"));
|
||||||
|
//
|
||||||
|
// JSONObject jsonSubParam = new JSONObject();
|
||||||
|
// jsonSubParam.put("status", SUBEnum.STATUS.code("入库"));
|
||||||
|
//
|
||||||
|
// subTab.update(jsonSubParam, "container_name IN ('" + pcsn_in + "')");
|
||||||
|
|
||||||
|
List<String> pcsnList = disDaoList.stream()
|
||||||
.map(StIvtIostorinvdis::getPcsn)
|
.map(StIvtIostorinvdis::getPcsn)
|
||||||
.collect(Collectors.joining("','"));
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
JSONObject jsonSubParam = new JSONObject();
|
if (!pcsnList.isEmpty()) {
|
||||||
jsonSubParam.put("status", SUBEnum.STATUS.code("入库"));
|
LambdaUpdateWrapper<PdmBiSubpackagerelation> updateWrapper = new LambdaUpdateWrapper<PdmBiSubpackagerelation>()
|
||||||
|
.in(PdmBiSubpackagerelation::getContainer_name, pcsnList)
|
||||||
|
.set(PdmBiSubpackagerelation::getStatus, SUBEnum.STATUS.code("入库"));
|
||||||
|
|
||||||
subTab.update(jsonSubParam, "container_name IN ('" + pcsn_in + "')");
|
// 使用正确的update方法
|
||||||
|
pdmBiSubpackagerelationMapper.update(null, updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 插入子卷包装关系出入记录
|
* 插入子卷包装关系出入记录
|
||||||
*/
|
*/
|
||||||
// 子卷包装集合
|
// 子卷包装集合
|
||||||
List<JSONObject> subList = subTab.query("container_name IN ('" + pcsn_in + "')")
|
// List<JSONObject> subList = subTab.query("container_name IN ('" + pcsn_in + "')")
|
||||||
.getResultJSONArray(0).toJavaList(JSONObject.class);
|
// .getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||||
|
|
||||||
|
List<PdmBiSubpackagerelation> subList = pdmBiSubpackagerelationMapper.selectList(new QueryWrapper<PdmBiSubpackagerelation>().in("container_name", pcsnList));
|
||||||
|
|
||||||
for (int i = 0; i < disDaoList.size(); i++) {
|
for (int i = 0; i < disDaoList.size(); i++) {
|
||||||
StIvtIostorinvdis disDao = disDaoList.get(i);
|
StIvtIostorinvdis disDao = disDaoList.get(i);
|
||||||
|
|
||||||
List<JSONObject> subJoList = subList.stream()
|
List<PdmBiSubpackagerelation> subJoList = subList.stream()
|
||||||
.filter(row -> row.getString("container_name").equals(disDao.getPcsn()))
|
.filter(row -> row.getContainer_name().equals(disDao.getPcsn()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
JSONObject jsonSub;
|
PdmBiSubpackagerelation pdmBiSubpackagerelation = new PdmBiSubpackagerelation();
|
||||||
if (ObjectUtil.isNotEmpty(subJoList)) {
|
if (ObjectUtil.isNotEmpty(subJoList)) {
|
||||||
jsonSub = subJoList.get(0);
|
pdmBiSubpackagerelation = subJoList.get(0);
|
||||||
} else {
|
} else {
|
||||||
throw new BadRequestException("未查询到子卷号为:" + disDao.getPcsn() + "对应的包装关系!");
|
throw new BadRequestException("未查询到子卷号为:" + disDao.getPcsn() + "对应的包装关系!");
|
||||||
}
|
}
|
||||||
|
PdmBiSubpackagerelationrecord pdmBiSubpackagerelationrecord = new PdmBiSubpackagerelationrecord();
|
||||||
|
|
||||||
|
BeanUtil.copyProperties(pdmBiSubpackagerelation, pdmBiSubpackagerelationrecord);
|
||||||
//插入包装关系出入库记录表
|
//插入包装关系出入库记录表
|
||||||
jsonSub.put("bill_code", mstDao.getBill_code());
|
pdmBiSubpackagerelationrecord.setBill_code(mstDao.getBill_code());
|
||||||
jsonSub.put("bill_id", mstDao.getIostorinv_id());
|
pdmBiSubpackagerelationrecord.setBill_id(mstDao.getIostorinv_id());
|
||||||
jsonSub.put("bill_type", mstDao.getBill_type());
|
pdmBiSubpackagerelationrecord.setBill_type(mstDao.getBill_type());
|
||||||
jsonSub.put("io_type", IOSEnum.IO_TYPE.code("入库"));
|
pdmBiSubpackagerelationrecord.setIo_type(IOSEnum.IO_TYPE.code("入库"));
|
||||||
jsonSub.put("insert_time", DateUtil.now());
|
pdmBiSubpackagerelationrecord.setInsert_time(DateUtil.now());
|
||||||
jsonSub.put("record_id", cn.hutool.core.util.IdUtil.getSnowflake(1, 1).nextId());
|
pdmBiSubpackagerelationrecord.setRecord_id(String.valueOf(cn.hutool.core.util.IdUtil.getSnowflake(1, 1).nextId()));
|
||||||
subRecordTab.insert(jsonSub);
|
|
||||||
|
// 使用Mapper插入数据
|
||||||
|
pdmBiSubpackagerelationrecordMapper.insert(pdmBiSubpackagerelationrecord);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//返检入库,将回传字段改为1
|
//返检入库,将回传字段改为1
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class StIvtSectattrServiceImpl extends ServiceImpl<StIvtSectattrMapper, S
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<StIvtSectattr> lam = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<StIvtSectattr> lam = new LambdaQueryWrapper<>();
|
||||||
lam.eq(StIvtSectattr::getSect_id, ids);
|
lam.in(StIvtSectattr::getSect_id, ids);
|
||||||
return list(lam);
|
return list(lam);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,7 +32,8 @@ public class StIvtSectattrServiceImpl extends ServiceImpl<StIvtSectattrMapper, S
|
|||||||
if (ids.size() == 0) {
|
if (ids.size() == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return CollectionUtils.mapList(ids, sect -> (JSONObject) JSON.toJSON(sect));
|
List<StIvtSectattr> sectList = getByIds(ids);
|
||||||
|
return CollectionUtils.mapList(sectList, sect -> (JSONObject) JSON.toJSON(sect));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,19 +1,39 @@
|
|||||||
package org.nl.modules.system.util;
|
package org.nl.modules.system.util;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
|
import lombok.SneakyThrows;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.system.service.GenCodeService;
|
import org.nl.modules.system.service.GenCodeService;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
|
import org.redisson.api.RLock;
|
||||||
|
import org.redisson.api.RedissonClient;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
public class CodeUtil {
|
public class CodeUtil {
|
||||||
|
|
||||||
|
@SneakyThrows
|
||||||
public static String getNewCode(String ruleCode) {
|
public static String getNewCode(String ruleCode) {
|
||||||
GenCodeService bean = SpringContextHolder.getBean(GenCodeService.class);
|
RedissonClient redissonClient = SpringContextHolder.getBean(RedissonClient.class);
|
||||||
String flag = "1";
|
RLock lock = redissonClient.getLock(ruleCode);
|
||||||
HashMap<String, String> map = new HashMap<>();
|
boolean tryLock = lock.tryLock(5, TimeUnit.SECONDS);
|
||||||
map.put("flag", flag);
|
try {
|
||||||
map.put("code", ruleCode);
|
if (tryLock) {
|
||||||
return bean.codeDemo(map);
|
String flag = "1";
|
||||||
|
String code = HttpUtil.get("http://127.0.0.1:8013/api/codeDetail/getNewCode?code=" + ruleCode + "&flag=" + flag);
|
||||||
|
if (code.contains("status")){
|
||||||
|
throw new BadRequestException(code);
|
||||||
|
}
|
||||||
|
return code;
|
||||||
|
} else {
|
||||||
|
throw new BadRequestException("系统繁忙,稍后在试!");
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
if (lock.isLocked() && lock.isHeldByCurrentThread()) {
|
||||||
|
lock.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ public class MesToLmsController {
|
|||||||
return new ResponseEntity<>(mesToLmsService.inventoryTransferInfoSync(jo), HttpStatus.OK);
|
return new ResponseEntity<>(mesToLmsService.inventoryTransferInfoSync(jo), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/childRollInfoUpdate")
|
@PostMapping("/childRollInfoUpdate")
|
||||||
@Log("子卷信息更新:计划外需求有可能入库完成后,ERP才回传计划外需求SalesOrder")
|
@Log("子卷信息更新:计划外需求有可能入库完成后,ERP才回传计划外需求SalesOrder")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
|
|||||||
@@ -1099,7 +1099,6 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
result = JSONObject.parseObject(resultMsg);
|
result = JSONObject.parseObject(resultMsg);
|
||||||
IpdmBiSubpackagerelationService subpackagerelationService = SpringContextHolder.getBean(IpdmBiSubpackagerelationService.class);
|
IpdmBiSubpackagerelationService subpackagerelationService = SpringContextHolder.getBean(IpdmBiSubpackagerelationService.class);
|
||||||
JSONObject container_info = result.getJSONObject("RTDAT");
|
JSONObject container_info = result.getJSONObject("RTDAT");
|
||||||
System.out.println(container_info.toString());
|
|
||||||
if (ObjectUtil.isNotEmpty(container_info)) {
|
if (ObjectUtil.isNotEmpty(container_info)) {
|
||||||
//子卷号
|
//子卷号
|
||||||
String ContainerName = container_info.getString("ContainerName");
|
String ContainerName = container_info.getString("ContainerName");
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import org.nl.b_lms.pdm.info.dao.PdmBiOrderbominfo;
|
|||||||
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinfoService;
|
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinfoService;
|
||||||
import org.nl.b_lms.pdm.info.service.IPdmBiOrderbominfoService;
|
import org.nl.b_lms.pdm.info.service.IPdmBiOrderbominfoService;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||||
|
import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
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.BstIvtPackageinfoivt;
|
||||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||||
@@ -36,6 +37,14 @@ import org.nl.b_lms.sch.tasks.first_floor_area.DjqTask;
|
|||||||
import org.nl.b_lms.sch.tasks.first_floor_area.GzqTask;
|
import org.nl.b_lms.sch.tasks.first_floor_area.GzqTask;
|
||||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||||
import org.nl.b_lms.sch.tasks.slitter.service.SlitterService;
|
import org.nl.b_lms.sch.tasks.slitter.service.SlitterService;
|
||||||
|
import org.nl.b_lms.storage_manage.md.dao.MdMeMaterialBase;
|
||||||
|
import org.nl.b_lms.storage_manage.md.dao.MdPbMeasureunit;
|
||||||
|
import org.nl.b_lms.storage_manage.md.dao.mapper.MdMeMaterialBaseMapper;
|
||||||
|
import org.nl.b_lms.storage_manage.md.dao.mapper.MdPbMeasureunitMapper;
|
||||||
|
import org.nl.b_lms.storage_manage.st.dao.StIvtBsrealstorattr;
|
||||||
|
import org.nl.b_lms.storage_manage.st.dao.StIvtStructattr;
|
||||||
|
import org.nl.b_lms.storage_manage.st.dao.mapper.StIvtStructattrMapper;
|
||||||
|
import org.nl.b_lms.storage_manage.st.service.StIvtBsrealstorattrService;
|
||||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.common.utils.TaskUtils;
|
import org.nl.common.utils.TaskUtils;
|
||||||
@@ -45,6 +54,7 @@ import org.nl.modules.wql.WQL;
|
|||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||||
|
import org.nl.wms.basedata.master.service.CustomerbaseService;
|
||||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||||
import org.nl.wms.ext.mes.service.MesToLmsService;
|
import org.nl.wms.ext.mes.service.MesToLmsService;
|
||||||
import org.nl.wms.pda.mps.service.InService;
|
import org.nl.wms.pda.mps.service.InService;
|
||||||
@@ -59,6 +69,8 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -76,9 +88,19 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IPdmBiSlittingproductionplanService slittingproductionplanService;
|
private IPdmBiSlittingproductionplanService slittingproductionplanService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PdmBiSubpackagerelationMapper pdmBiSubpackagerelationMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StIvtBsrealstorattrService bsrealstorattrService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private WmsToAcsService wmsToAcsService;
|
private WmsToAcsService wmsToAcsService;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MdPbMeasureunitMapper mdPbMeasureunitMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private DjqTask djqTask;
|
private DjqTask djqTask;
|
||||||
@Resource
|
@Resource
|
||||||
@@ -95,11 +117,21 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IpdmBiSubpackagerelationService subpackagerelationService;
|
private IpdmBiSubpackagerelationService subpackagerelationService;
|
||||||
|
@Autowired
|
||||||
|
private CustomerbaseService customerbaseService;
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SlitterService slitterService;
|
private SlitterService slitterService;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StIvtStructattrMapper stIvtStructattrMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MdMeMaterialBaseMapper mdMeMaterialBaseMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生箔烘箱:
|
* 生箔烘箱:
|
||||||
* 母卷批次创建信息发送智能物流(MES生箔工序Move In)
|
* 母卷批次创建信息发送智能物流(MES生箔工序Move In)
|
||||||
@@ -416,7 +448,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
} else {
|
} else {
|
||||||
if (containerName.startsWith("B1") || containerName.startsWith("B3")) {
|
if (containerName.startsWith("B1") || containerName.startsWith("B3")) {
|
||||||
point_code = jsonCoolIvt.getString("point_code");
|
point_code = jsonCoolIvt.getString("point_code");
|
||||||
}else {
|
} else {
|
||||||
point_code = jsonCoolIvt.getString("full_point_code");
|
point_code = jsonCoolIvt.getString("full_point_code");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -453,7 +485,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
JSONObject jsonPoint = pointTab.query("material_code = '" + containerName + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
|
JSONObject jsonPoint = pointTab.query("material_code = '" + containerName + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
|
||||||
JSONObject cool_jo = new JSONObject();
|
JSONObject cool_jo = new JSONObject();
|
||||||
if (ObjectUtil.isEmpty(jsonPoint)) {
|
if (ObjectUtil.isEmpty(jsonPoint)) {
|
||||||
cool_jo = coolIvtTab.query("container_name = '"+containerName+"'").uniqueResult(0);
|
cool_jo = coolIvtTab.query("container_name = '" + containerName + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(cool_jo)) {
|
if (ObjectUtil.isEmpty(cool_jo)) {
|
||||||
throw new BadRequestException("当前AGV已启用,且母卷不存在烘箱对接位上!");
|
throw new BadRequestException("当前AGV已启用,且母卷不存在烘箱对接位上!");
|
||||||
}
|
}
|
||||||
@@ -462,7 +494,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
// 调用接口输入参数
|
// 调用接口输入参数
|
||||||
if (ObjectUtil.isEmpty(jsonPoint)) {
|
if (ObjectUtil.isEmpty(jsonPoint)) {
|
||||||
jsonParam.put("point_code", cool_jo.getString("point_code"));
|
jsonParam.put("point_code", cool_jo.getString("point_code"));
|
||||||
}else {
|
} else {
|
||||||
jsonParam.put("point_code", jsonPoint.getString("point_code"));
|
jsonParam.put("point_code", jsonPoint.getString("point_code"));
|
||||||
}
|
}
|
||||||
jsonParam.put("container_name", containerName);
|
jsonParam.put("container_name", containerName);
|
||||||
@@ -1245,13 +1277,19 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//查询库内是否存在相同的子卷号
|
//查询库内是否存在相同的子卷号
|
||||||
JSONObject container_jo = WQLObject.getWQLObject("PDM_BI_SubPackageRelation").query("container_name = '" + ContainerName + "'").uniqueResult(0);
|
// JSONObject container_jo = WQLObject.getWQLObject("PDM_BI_SubPackageRelation").query("container_name = '" + ContainerName + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(container_jo)) {
|
PdmBiSubpackagerelation pdmBiSubpackagerelation = pdmBiSubpackagerelationMapper.selectOne(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getContainer_name, ContainerName));
|
||||||
if (StrUtil.isNotEmpty(container_jo.getString("need_delete")) && container_jo.getString("need_delete").equals("99")) {
|
|
||||||
WQLObject tab = WQLObject.getWQLObject("PDM_BI_SubPackageRelation");
|
if (ObjectUtil.isNotEmpty(pdmBiSubpackagerelation)) {
|
||||||
HashMap<String, String> map = new HashMap<>();
|
if (StrUtil.isNotEmpty(pdmBiSubpackagerelation.getNeed_delete()) && pdmBiSubpackagerelation.getNeed_delete().equals("99")) {
|
||||||
map.put("need_delete", "");
|
// WQLObject tab = WQLObject.getWQLObject("PDM_BI_SubPackageRelation");
|
||||||
tab.update(map, "package_box_sn = '" + PackageBoxSN + "'");
|
// HashMap<String, String> map = new HashMap<>();
|
||||||
|
// map.put("need_delete", "");
|
||||||
|
// tab.update(map, "package_box_sn = '" + PackageBoxSN + "'");
|
||||||
|
|
||||||
|
pdmBiSubpackagerelationMapper.update(null, new LambdaUpdateWrapper<PdmBiSubpackagerelation>()
|
||||||
|
.set(PdmBiSubpackagerelation::getNeed_delete, "")
|
||||||
|
.eq(PdmBiSubpackagerelation::getPackage_box_sn, PackageBoxSN));
|
||||||
result.put("RTYPE", "S");
|
result.put("RTYPE", "S");
|
||||||
result.put("RTMSG", "操作成功!");
|
result.put("RTMSG", "操作成功!");
|
||||||
result.put("RTOAL", 1);
|
result.put("RTOAL", 1);
|
||||||
@@ -1262,68 +1300,136 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject jo = new JSONObject();
|
// JSONObject jo = new JSONObject();
|
||||||
jo.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId());
|
// jo.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
jo.put("package_box_sn", PackageBoxSN);
|
// jo.put("package_box_sn", PackageBoxSN);
|
||||||
jo.put("sap_pcsn", sap_pcsn);
|
// jo.put("sap_pcsn", sap_pcsn);
|
||||||
jo.put("sub_type", sub_type);
|
// jo.put("sub_type", sub_type);
|
||||||
jo.put("box_type", box_type);
|
// jo.put("box_type", box_type);
|
||||||
jo.put("box_length", box_length);
|
// jo.put("box_length", box_length);
|
||||||
jo.put("box_width", box_width);
|
// jo.put("box_width", box_width);
|
||||||
jo.put("box_high", box_high);
|
// jo.put("box_high", box_high);
|
||||||
jo.put("demand_limit", demand_limit);
|
// jo.put("demand_limit", demand_limit);
|
||||||
jo.put("standard_limit", standard_limit);
|
// jo.put("standard_limit", standard_limit);
|
||||||
jo.put("actual_value", actual_value);
|
// jo.put("actual_value", actual_value);
|
||||||
jo.put("quanlity_in_box", QuanlityInBox);
|
// jo.put("quanlity_in_box", QuanlityInBox);
|
||||||
jo.put("ext_code", ext_code);
|
// jo.put("ext_code", ext_code);
|
||||||
if (StrUtil.equals(BoxWeight, "0")) {
|
// if (StrUtil.equals(BoxWeight, "0")) {
|
||||||
BoxWeight2 = NumberUtil.add(BoxWeight2, NetWeight).toString();
|
// BoxWeight2 = NumberUtil.add(BoxWeight2, NetWeight).toString();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// jo.put("box_weight", BoxWeight);
|
||||||
|
// if ("0天".equals(QualityGuaranPeriod)) {
|
||||||
|
// jo.put("quality_guaran_period", "90天");
|
||||||
|
// } else {
|
||||||
|
// jo.put("quality_guaran_period", QualityGuaranPeriod);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// jo.put("sale_order_name", SaleOrderName);
|
||||||
|
// jo.put("customer_name", CustomerName);
|
||||||
|
// jo.put("customer_description", CustomerDescription);
|
||||||
|
// jo.put("product_name", ProductName);
|
||||||
|
// jo.put("product_description", Description);
|
||||||
|
// jo.put("date_of_FG_inbound", DateOfFGInbound);
|
||||||
|
// jo.put("container_name", ContainerName);
|
||||||
|
// jo.put("width", Width);
|
||||||
|
// jo.put("thickness", Thickness);
|
||||||
|
// jo.put("mass_per_unit_area", MassPerUnitArea);
|
||||||
|
// jo.put("net_weight", NetWeight);
|
||||||
|
// jo.put("length", Length);
|
||||||
|
// jo.put("date_of_production", DateOfProduction);
|
||||||
|
// jo.put("is_un_plan_production", isUnPlanProduction);
|
||||||
|
// jo.put("un_plan_product_property1", UnPlanProductProperty1);
|
||||||
|
// jo.put("un_plan_product_property2", UnPlanProductProperty2);
|
||||||
|
// jo.put("un_plan_product_property3", UnPlanProductProperty3);
|
||||||
|
// jo.put("width_standard", width_standard);
|
||||||
|
// jo.put("thickness_request", thickness_request);
|
||||||
|
// jo.put("material_type", Attribute8);
|
||||||
|
// jo.put("joint_type", Attribute9);
|
||||||
|
// jo.put("thickness_request", thickness_request);
|
||||||
|
// jo.put("status", "0");
|
||||||
|
// jo.put("create_id", "1");
|
||||||
|
// jo.put("create_name", "管理员");
|
||||||
|
// jo.put("create_time", DateUtil.now());
|
||||||
|
// WQLObject tab = WQLObject.getWQLObject("PDM_BI_SubPackageRelation");
|
||||||
|
// tab.insert(jo);
|
||||||
|
//
|
||||||
|
// HashMap<String, String> map = new HashMap<>();
|
||||||
|
// if (StrUtil.equals(BoxWeight, "0")) {
|
||||||
|
// map.put("box_weight", String.valueOf(BoxWeight2));
|
||||||
|
// } else {
|
||||||
|
// map.put("box_weight", String.valueOf(BoxWeight));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// tab.update(map, "package_box_sn = '" + PackageBoxSN + "'");
|
||||||
|
|
||||||
|
|
||||||
|
// ========== 1. 构造实体类,替换原JSONObject赋值 ==========
|
||||||
|
PdmBiSubpackagerelation entity = new PdmBiSubpackagerelation();
|
||||||
|
entity.setWorkorder_id(String.valueOf(IdUtil.getSnowflake(1, 1).nextId()));
|
||||||
|
entity.setPackage_box_sn(PackageBoxSN);
|
||||||
|
entity.setSap_pcsn(sap_pcsn); // 下划线命名的setter
|
||||||
|
entity.setSub_type(sub_type);
|
||||||
|
entity.setBox_type(box_type);
|
||||||
|
entity.setBox_length(box_length);
|
||||||
|
entity.setBox_width(box_width);
|
||||||
|
entity.setBox_high(box_high);
|
||||||
|
entity.setDemand_limit(demand_limit);
|
||||||
|
entity.setStandard_limit(standard_limit);
|
||||||
|
entity.setActual_value(actual_value);
|
||||||
|
entity.setQuanlity_in_box(NumberUtil.toBigDecimal(QuanlityInBox).setScale(2, RoundingMode.DOWN));
|
||||||
|
entity.setExt_code(ext_code);
|
||||||
|
|
||||||
|
BigDecimal boxWeightBigDecimal = new BigDecimal(BoxWeight).setScale(2, RoundingMode.DOWN);
|
||||||
|
entity.setBox_weight(boxWeightBigDecimal);
|
||||||
|
if (BigDecimal.ZERO.compareTo(boxWeightBigDecimal) == 0) {
|
||||||
|
BoxWeight2 = String.valueOf(NumberUtil.add(BoxWeight2, NetWeight));
|
||||||
}
|
}
|
||||||
|
|
||||||
jo.put("box_weight", BoxWeight);
|
|
||||||
if ("0天".equals(QualityGuaranPeriod)) {
|
if ("0天".equals(QualityGuaranPeriod)) {
|
||||||
jo.put("quality_guaran_period", "90天");
|
entity.setQuality_guaran_period("90天");
|
||||||
} else {
|
} else {
|
||||||
jo.put("quality_guaran_period", QualityGuaranPeriod);
|
entity.setQuality_guaran_period(QualityGuaranPeriod);
|
||||||
}
|
}
|
||||||
|
|
||||||
jo.put("sale_order_name", SaleOrderName);
|
entity.setSale_order_name(SaleOrderName);
|
||||||
jo.put("customer_name", CustomerName);
|
entity.setCustomer_name(CustomerName);
|
||||||
jo.put("customer_description", CustomerDescription);
|
entity.setCustomer_description(CustomerDescription);
|
||||||
jo.put("product_name", ProductName);
|
entity.setProduct_name(ProductName);
|
||||||
jo.put("product_description", Description);
|
entity.setProduct_description(Description);
|
||||||
jo.put("date_of_FG_inbound", DateOfFGInbound);
|
entity.setDate_of_FG_inbound(DateOfFGInbound);
|
||||||
jo.put("container_name", ContainerName);
|
entity.setContainer_name(ContainerName);
|
||||||
jo.put("width", Width);
|
entity.setWidth(Width);
|
||||||
jo.put("thickness", Thickness);
|
entity.setThickness(Thickness);
|
||||||
jo.put("mass_per_unit_area", MassPerUnitArea);
|
entity.setMass_per_unit_area(MassPerUnitArea);
|
||||||
jo.put("net_weight", NetWeight);
|
entity.setNet_weight(NetWeight);
|
||||||
jo.put("length", Length);
|
entity.setLength(Length);
|
||||||
jo.put("date_of_production", DateOfProduction);
|
entity.setDate_of_production(DateOfProduction);
|
||||||
jo.put("is_un_plan_production", isUnPlanProduction);
|
entity.setIs_un_plan_production(isUnPlanProduction);
|
||||||
jo.put("un_plan_product_property1", UnPlanProductProperty1);
|
entity.setUn_plan_product_property1(UnPlanProductProperty1);
|
||||||
jo.put("un_plan_product_property2", UnPlanProductProperty2);
|
entity.setUn_plan_product_property2(UnPlanProductProperty2);
|
||||||
jo.put("un_plan_product_property3", UnPlanProductProperty3);
|
entity.setUn_plan_product_property3(UnPlanProductProperty3);
|
||||||
jo.put("width_standard", width_standard);
|
entity.setWidth_standard(width_standard);
|
||||||
jo.put("thickness_request", thickness_request);
|
entity.setThickness_request(thickness_request);
|
||||||
jo.put("material_type", Attribute8);
|
entity.setMaterial_type(Attribute8);
|
||||||
jo.put("joint_type", Attribute9);
|
entity.setJoint_type(String.valueOf(Attribute9));
|
||||||
jo.put("thickness_request", thickness_request);
|
entity.setStatus("0");
|
||||||
jo.put("status", "0");
|
entity.setCreate_id(1L);
|
||||||
jo.put("create_id", "1");
|
entity.setCreate_name("管理员");
|
||||||
jo.put("create_name", "管理员");
|
entity.setCreate_time(DateUtil.now());
|
||||||
jo.put("create_time", DateUtil.now());
|
|
||||||
WQLObject tab = WQLObject.getWQLObject("PDM_BI_SubPackageRelation");
|
|
||||||
tab.insert(jo);
|
|
||||||
|
|
||||||
HashMap<String, String> map = new HashMap<>();
|
// ========== 2. 插入数据(替换原tab.insert(jo)) ==========
|
||||||
|
pdmBiSubpackagerelationMapper.insert(entity);
|
||||||
|
|
||||||
|
PdmBiSubpackagerelation pdmBiSubpackagerelationUpdate = new PdmBiSubpackagerelation();
|
||||||
if (StrUtil.equals(BoxWeight, "0")) {
|
if (StrUtil.equals(BoxWeight, "0")) {
|
||||||
map.put("box_weight", String.valueOf(BoxWeight2));
|
pdmBiSubpackagerelationUpdate.setBox_weight(NumberUtil.toBigDecimal(BoxWeight2).setScale(2, RoundingMode.DOWN));
|
||||||
} else {
|
} else {
|
||||||
map.put("box_weight", String.valueOf(BoxWeight));
|
pdmBiSubpackagerelationUpdate.setBox_weight(NumberUtil.toBigDecimal(BoxWeight).setScale(2, RoundingMode.DOWN));
|
||||||
}
|
}
|
||||||
|
pdmBiSubpackagerelationMapper.update(pdmBiSubpackagerelationUpdate, new LambdaUpdateWrapper<PdmBiSubpackagerelation>()
|
||||||
|
.eq(PdmBiSubpackagerelation::getPackage_box_sn, PackageBoxSN));
|
||||||
|
|
||||||
tab.update(map, "package_box_sn = '" + PackageBoxSN + "'");
|
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
result.put("RTYPE", "S");
|
result.put("RTYPE", "S");
|
||||||
@@ -1370,13 +1476,20 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
String PackageBoxSN = json.getString("PackageBoxSN");
|
String PackageBoxSN = json.getString("PackageBoxSN");
|
||||||
|
|
||||||
// 查询此木箱在哪个仓库
|
// 查询此木箱在哪个仓库
|
||||||
JSONObject jsonBox = WQLObject.getWQLObject("st_ivt_structattr")
|
// JSONObject jsonBox = WQLObject.getWQLObject("st_ivt_structattr")
|
||||||
.query("storagevehicle_code = '" + PackageBoxSN + "' and is_delete = '0' and is_used = '1' and lock_type = '1'").uniqueResult(0);
|
// .query("storagevehicle_code = '" + PackageBoxSN + "' and is_delete = '0' and is_used = '1' and lock_type = '1'").uniqueResult(0);
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<StIvtStructattr> structQueryWrapper = new QueryWrapper<>();
|
||||||
|
structQueryWrapper.eq("storagevehicle_code", PackageBoxSN)
|
||||||
|
.eq("is_delete", "0").eq("is_used", "1").eq("lock_type", "1");
|
||||||
|
StIvtStructattr jsonBox = stIvtStructattrMapper.selectOne(structQueryWrapper);
|
||||||
|
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(jsonBox)) {
|
if (ObjectUtil.isEmpty(jsonBox)) {
|
||||||
throw new BadRequestException("此木箱不在库内:" + PackageBoxSN);
|
throw new BadRequestException("此木箱不在库内:" + PackageBoxSN);
|
||||||
}
|
}
|
||||||
storSet.add(jsonBox.getString("stor_code"));
|
storSet.add(jsonBox.getStor_code());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据仓库生成多个库存变更单据
|
// 根据仓库生成多个库存变更单据
|
||||||
@@ -1385,8 +1498,10 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
double detail_count = 0;
|
double detail_count = 0;
|
||||||
String changeinv_id = IdUtil.getSnowflake(1, 1).nextId() + "";
|
String changeinv_id = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||||
|
|
||||||
JSONObject jsonStor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("stor_code = '" + stor_code + "'").uniqueResult(0);
|
// JSONObject jsonStor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("stor_code = '" + stor_code + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(jsonStor)) {
|
|
||||||
|
StIvtBsrealstorattr stIvtBsrealstorattr = bsrealstorattrService.getOne(new LambdaQueryWrapper<StIvtBsrealstorattr>().eq(StIvtBsrealstorattr::getStor_code, stor_code));
|
||||||
|
if (ObjectUtil.isEmpty(stIvtBsrealstorattr)) {
|
||||||
throw new BadRequestException("仓库不存在:" + stor_code);
|
throw new BadRequestException("仓库不存在:" + stor_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1396,10 +1511,14 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
JSONObject row = rows.getJSONObject(i);
|
JSONObject row = rows.getJSONObject(i);
|
||||||
String PackageBoxSN = row.getString("PackageBoxSN");
|
String PackageBoxSN = row.getString("PackageBoxSN");
|
||||||
|
|
||||||
JSONObject jsonBox = WQLObject.getWQLObject("st_ivt_structattr")
|
// JSONObject jsonBox = WQLObject.getWQLObject("st_ivt_structattr")
|
||||||
.query("storagevehicle_code = '" + PackageBoxSN + "' and is_delete = '0' and is_used = '1' and lock_type = '1'").uniqueResult(0);
|
// .query("storagevehicle_code = '" + PackageBoxSN + "' and is_delete = '0' and is_used = '1' and lock_type = '1'").uniqueResult(0);
|
||||||
|
|
||||||
if (StrUtil.equals(jsonBox.getString("stor_code"), stor_code)) {
|
QueryWrapper<StIvtStructattr> structQueryWrapper = new QueryWrapper<>();
|
||||||
|
structQueryWrapper.eq("storagevehicle_code", PackageBoxSN)
|
||||||
|
.eq("is_delete", "0").eq("is_used", "1").eq("lock_type", "1");
|
||||||
|
StIvtStructattr jsonBox = stIvtStructattrMapper.selectOne(structQueryWrapper);
|
||||||
|
if (StrUtil.equals(jsonBox.getStor_code(), stor_code)) {
|
||||||
rowsDtl.add(row);
|
rowsDtl.add(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1412,20 +1531,26 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
String isUnPackBox = row.getString("isUnPackBox");
|
String isUnPackBox = row.getString("isUnPackBox");
|
||||||
String UpdatedDateOfProduction = row.getString("UpdatedDateOfProduction");
|
String UpdatedDateOfProduction = row.getString("UpdatedDateOfProduction");
|
||||||
//查询该木箱内子卷数量
|
//查询该木箱内子卷数量
|
||||||
JSONArray container_rows = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + PackageBoxSN + "'").getResultJSONArray(0);
|
// JSONArray container_rows = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + PackageBoxSN + "'").getResultJSONArray(0);
|
||||||
|
|
||||||
|
List<PdmBiSubpackagerelation> container_rows = pdmBiSubpackagerelationMapper.selectList(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getPackage_box_sn, PackageBoxSN));
|
||||||
for (int j = 0; j < container_rows.size(); j++) {
|
for (int j = 0; j < container_rows.size(); j++) {
|
||||||
JSONObject container_row = container_rows.getJSONObject(j);
|
PdmBiSubpackagerelation pdmBiSubpackagerelation = container_rows.get(j);
|
||||||
JSONObject change_jo = new JSONObject();
|
JSONObject change_jo = new JSONObject();
|
||||||
change_jo.put("changeinvdtl_id", IdUtil.getSnowflake(1, 1).nextId() + "");
|
change_jo.put("changeinvdtl_id", IdUtil.getSnowflake(1, 1).nextId() + "");
|
||||||
change_jo.put("changeinv_id", changeinv_id);
|
change_jo.put("changeinv_id", changeinv_id);
|
||||||
change_jo.put("seq_no", detail_count + 1);
|
change_jo.put("seq_no", detail_count + 1);
|
||||||
JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + container_row.getString("product_name") + "'").uniqueResult(0);
|
// JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + container_row.getString("product_name") + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(mater_jo)) {
|
// if (ObjectUtil.isEmpty(mater_jo)) {
|
||||||
throw new BadRequestException("物料不存在:" + container_row.getString("product_name"));
|
// throw new BadRequestException("物料不存在:" + container_row.getString("product_name"));
|
||||||
|
// }
|
||||||
|
MdMeMaterialBase mdMeMaterialBase = mdMeMaterialBaseMapper.selectOne(new LambdaQueryWrapper<MdMeMaterialBase>().eq(MdMeMaterialBase::getMaterial_code, pdmBiSubpackagerelation.getProduct_name()));
|
||||||
|
if (ObjectUtil.isEmpty(mdMeMaterialBase)) {
|
||||||
|
throw new BadRequestException("物料不存在:" + pdmBiSubpackagerelation.getProduct_name());
|
||||||
}
|
}
|
||||||
change_jo.put("material_id", mater_jo.getString("material_id"));
|
change_jo.put("material_id", mdMeMaterialBase.getMaterial_id());
|
||||||
change_jo.put("pcsn", container_row.getString("container_name"));
|
change_jo.put("pcsn", pdmBiSubpackagerelation.getContainer_name());
|
||||||
change_jo.put("package_box_sn", container_row.getString("package_box_sn"));
|
change_jo.put("package_box_sn", pdmBiSubpackagerelation.getPackage_box_sn());
|
||||||
change_jo.put("mfg_order_name", SaleOrderItem);
|
change_jo.put("mfg_order_name", SaleOrderItem);
|
||||||
change_jo.put("demand_date", DemandDate);
|
change_jo.put("demand_date", DemandDate);
|
||||||
change_jo.put("customer_name", CustomerName);
|
change_jo.put("customer_name", CustomerName);
|
||||||
@@ -1438,15 +1563,22 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
change_jo.put("isRePrintPackageBoxLabel", isRePrintPackageBoxLabel);
|
change_jo.put("isRePrintPackageBoxLabel", isRePrintPackageBoxLabel);
|
||||||
change_jo.put("isUnPackBox", isUnPackBox);
|
change_jo.put("isUnPackBox", isUnPackBox);
|
||||||
change_jo.put("UpdatedDateOfProduction", UpdatedDateOfProduction);
|
change_jo.put("UpdatedDateOfProduction", UpdatedDateOfProduction);
|
||||||
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + mater_jo.getString("base_unit_id") + "'").uniqueResult(0);
|
// JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + mater_jo.getString("base_unit_id") + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(unit)) {
|
// if (ObjectUtil.isEmpty(unit)) {
|
||||||
throw new BadRequestException("计量单位不存在:" + mater_jo.getString("base_unit_id"));
|
// throw new BadRequestException("计量单位不存在:" + mater_jo.getString("base_unit_id"));
|
||||||
|
// }
|
||||||
|
MdPbMeasureunit unit = mdPbMeasureunitMapper.selectOne(new LambdaQueryWrapper<MdPbMeasureunit>().eq(MdPbMeasureunit::getMeasure_unit_id, mdMeMaterialBase.getBase_unit_id()));
|
||||||
|
if (unit == null) {
|
||||||
|
throw new BadRequestException("找不到对应的计量单位:" + mdMeMaterialBase.getBase_unit_id());
|
||||||
}
|
}
|
||||||
change_jo.put("qty_unit_id", mater_jo.getString("base_unit_id"));
|
|
||||||
change_jo.put("qty_unit_name", unit.getString("unit_name"));
|
change_jo.put("qty_unit_id", mdMeMaterialBase.getBase_unit_id());
|
||||||
change_jo.put("qty", container_row.getString("net_weight"));
|
change_jo.put("qty_unit_name", unit.getUnit_name());
|
||||||
|
change_jo.put("qty", pdmBiSubpackagerelation.getNet_weight());
|
||||||
WQLObject.getWQLObject("ST_IVT_StructIvtChangeDtl").insert(change_jo);
|
WQLObject.getWQLObject("ST_IVT_StructIvtChangeDtl").insert(change_jo);
|
||||||
total_qty += container_row.getDoubleValue("net_weight");
|
if (StrUtil.isNotEmpty(pdmBiSubpackagerelation.getNet_weight())) {
|
||||||
|
total_qty += Double.valueOf(pdmBiSubpackagerelation.getNet_weight());
|
||||||
|
}
|
||||||
detail_count += 1;
|
detail_count += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1460,9 +1592,9 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
mst_jo.put("buss_type", "2001");
|
mst_jo.put("buss_type", "2001");
|
||||||
mst_jo.put("bill_type", "2001");
|
mst_jo.put("bill_type", "2001");
|
||||||
mst_jo.put("biz_date", DateUtil.today());
|
mst_jo.put("biz_date", DateUtil.today());
|
||||||
mst_jo.put("stor_id", jsonStor.getString("stor_id"));
|
mst_jo.put("stor_id", stIvtBsrealstorattr.getStor_id());
|
||||||
mst_jo.put("stor_code", jsonStor.getString("stor_code"));
|
mst_jo.put("stor_code", stIvtBsrealstorattr.getStor_code());
|
||||||
mst_jo.put("stor_name", jsonStor.getString("stor_name"));
|
mst_jo.put("stor_name", stIvtBsrealstorattr.getStor_name());
|
||||||
mst_jo.put("total_qty", total_qty);
|
mst_jo.put("total_qty", total_qty);
|
||||||
mst_jo.put("detail_count", detail_count);
|
mst_jo.put("detail_count", detail_count);
|
||||||
mst_jo.put("bill_status", "10");
|
mst_jo.put("bill_status", "10");
|
||||||
|
|||||||
@@ -45,7 +45,5 @@ public class AppUpdateController {
|
|||||||
obj.put("versionName", app_version);
|
obj.put("versionName", app_version);
|
||||||
return new ResponseEntity<>(obj, HttpStatus.OK);
|
return new ResponseEntity<>(obj, HttpStatus.OK);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,17 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||||
|
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.mapper.StIvtIostorinvMapper;
|
||||||
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper.StIvtIostorinvdisMapper;
|
||||||
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper.StIvtIostorinvdtlMapper;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
@@ -25,6 +32,7 @@ import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
|
|||||||
import org.nl.wms.ext.mes.service.LmsToMesService;
|
import org.nl.wms.ext.mes.service.LmsToMesService;
|
||||||
import org.nl.wms.pda.st.service.ProductInstorService;
|
import org.nl.wms.pda.st.service.ProductInstorService;
|
||||||
import org.nl.wms.sch.tasks.CutConveyorTask;
|
import org.nl.wms.sch.tasks.CutConveyorTask;
|
||||||
|
import org.nl.wms.st.inbill.service.RawAssistIStorService;
|
||||||
import org.nl.wms.st.inbill.service.StorPublicService;
|
import org.nl.wms.st.inbill.service.StorPublicService;
|
||||||
import org.nl.wms.st.inbill.service.impl.InbillServiceImpl;
|
import org.nl.wms.st.inbill.service.impl.InbillServiceImpl;
|
||||||
import org.redisson.api.RLock;
|
import org.redisson.api.RLock;
|
||||||
@@ -60,6 +68,11 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
|||||||
|
|
||||||
private final LmsToMesService lmsToMesService;
|
private final LmsToMesService lmsToMesService;
|
||||||
|
|
||||||
|
private final RawAssistIStorService rawAssistIStorService;
|
||||||
|
private final StIvtIostorinvMapper stIvtIostorinvMapper;
|
||||||
|
private final StIvtIostorinvdisMapper stIvtIostorinvdisMapper;
|
||||||
|
private final StIvtIostorinvdtlMapper stIvtIostorinvdtlMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject boxQuery(JSONObject whereJson) {
|
public JSONObject boxQuery(JSONObject whereJson) {
|
||||||
String box_no = whereJson.getString("box_no");
|
String box_no = whereJson.getString("box_no");
|
||||||
@@ -176,8 +189,10 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
|||||||
JSONObject stor = new JSONObject();
|
JSONObject stor = new JSONObject();
|
||||||
if ("BC01".equals(sub_jo.getString("ext_code"))) {
|
if ("BC01".equals(sub_jo.getString("ext_code"))) {
|
||||||
stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("is_delete = '0' AND is_used = '1' AND is_productstore = '0' AND stor_code = 'BC01'").uniqueResult(0);
|
stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("is_delete = '0' AND is_used = '1' AND is_productstore = '0' AND stor_code = 'BC01'").uniqueResult(0);
|
||||||
} else {
|
} else if ("NC01".equals(sub_jo.getString("ext_code"))){
|
||||||
stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("is_delete = '0' AND is_used = '1' AND is_productstore = '1'").uniqueResult(0);
|
stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("is_delete = '0' AND is_used = '1' AND is_productstore = '1' AND stor_code = 'NC01'").uniqueResult(0);
|
||||||
|
}else {
|
||||||
|
stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("is_delete = '0' AND is_used = '1' AND is_productstore = '1' ").uniqueResult(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
mst_jo.put("stor_id", stor.getString("stor_id"));
|
mst_jo.put("stor_id", stor.getString("stor_id"));
|
||||||
@@ -193,8 +208,8 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
|||||||
if (ObjectUtil.isNotEmpty(box_mst_jo)) {
|
if (ObjectUtil.isNotEmpty(box_mst_jo)) {
|
||||||
iostorinv_id = box_mst_jo.getString("iostorinv_id");
|
iostorinv_id = box_mst_jo.getString("iostorinv_id");
|
||||||
} else {
|
} else {
|
||||||
|
iostorinv_id = rawAssistIStorService.insertDtl(mst_jo);
|
||||||
}
|
}
|
||||||
|
|
||||||
//判断是否虚拟
|
//判断是否虚拟
|
||||||
if (!"1".equals(is_virtual)) {
|
if (!"1".equals(is_virtual)) {
|
||||||
if ("BC01".equals(sub_jo.getString("ext_code"))) {
|
if ("BC01".equals(sub_jo.getString("ext_code"))) {
|
||||||
@@ -386,6 +401,16 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
|||||||
whereJson.put("sect_id","1760183817781514240");
|
whereJson.put("sect_id","1760183817781514240");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//直接分配虚拟区货位,并确认
|
||||||
|
if ("NC01".equals(sub_jo.getString("ext_code"))) {
|
||||||
|
JSONObject jsonObject = WQLObject.getWQLObject("st_ivt_sectattr").query("sect_id = '" + whereJson.getString("sect_id") + "'")
|
||||||
|
.uniqueResult(0);
|
||||||
|
|
||||||
|
if ("XN01".equals(jsonObject.getString("sect_code"))) {
|
||||||
|
whereJson.put("sect_id","2005475495155732480");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject struct = WQL.getWO("PDA_ST_01")
|
JSONObject struct = WQL.getWO("PDA_ST_01")
|
||||||
@@ -397,49 +422,73 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
|||||||
if (ObjectUtil.isEmpty(struct)) {
|
if (ObjectUtil.isEmpty(struct)) {
|
||||||
throw new BadRequestException("当前没有可用的空仓位进行入库!");
|
throw new BadRequestException("当前没有可用的空仓位进行入库!");
|
||||||
}
|
}
|
||||||
HashMap<String, String> dis_map = new HashMap();
|
// HashMap<String, String> dis_map = new HashMap();
|
||||||
dis_map.put("sect_id", struct.getString("sect_id"));
|
// dis_map.put("sect_id", struct.getString("sect_id"));
|
||||||
dis_map.put("sect_code", struct.getString("sect_code"));
|
// dis_map.put("sect_code", struct.getString("sect_code"));
|
||||||
dis_map.put("sect_name", struct.getString("sect_name"));
|
// dis_map.put("sect_name", struct.getString("sect_name"));
|
||||||
dis_map.put("struct_id", struct.getString("struct_id"));
|
// dis_map.put("struct_id", struct.getString("struct_id"));
|
||||||
dis_map.put("struct_code", struct.getString("struct_code"));
|
// dis_map.put("struct_code", struct.getString("struct_code"));
|
||||||
dis_map.put("struct_name", struct.getString("struct_name"));
|
// dis_map.put("struct_name", struct.getString("struct_name"));
|
||||||
dis_map.put("work_status", "01");
|
// dis_map.put("work_status", "01");
|
||||||
dis_map.put("task_id", task_id);
|
// dis_map.put("task_id", task_id);
|
||||||
|
|
||||||
|
|
||||||
|
StIvtIostorinvdis stIvtIostorinvdis = new StIvtIostorinvdis();
|
||||||
|
stIvtIostorinvdis.setSect_id(struct.getString("sect_id"));
|
||||||
|
stIvtIostorinvdis.setSect_code(struct.getString("sect_code"));
|
||||||
|
stIvtIostorinvdis.setSect_name(struct.getString("sect_name"));
|
||||||
|
stIvtIostorinvdis.setStruct_id(struct.getString("struct_id"));
|
||||||
|
stIvtIostorinvdis.setStruct_code(struct.getString("struct_code"));
|
||||||
|
stIvtIostorinvdis.setStruct_name(struct.getString("struct_name"));
|
||||||
|
stIvtIostorinvdis.setWork_status("01");
|
||||||
|
stIvtIostorinvdis.setTask_id(task_id);
|
||||||
|
|
||||||
|
|
||||||
//更新该木箱明细对应的分配
|
//更新该木箱明细对应的分配
|
||||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(dis_map, "iostorinv_id = '" + iostorinv_id + "' AND box_no = '" + box_no + "'");
|
// WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(dis_map, "iostorinv_id = '" + iostorinv_id + "' AND box_no = '" + box_no + "'");
|
||||||
|
|
||||||
|
stIvtIostorinvdisMapper.update(stIvtIostorinvdis,new LambdaQueryWrapper<StIvtIostorinvdis>().eq(StIvtIostorinvdis::getIostorinv_id, iostorinv_id).eq(StIvtIostorinvdis::getBox_no, box_no));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//修改库存
|
//修改库存
|
||||||
//直接取出入库分配表的库存
|
//直接取出入库分配表的库存
|
||||||
mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
|
// mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
|
||||||
JSONArray dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "' AND box_no = '" + map.get("box_no") + "'").getResultJSONArray(0);
|
// JSONArray dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "' AND box_no = '" + map.get("box_no") + "'").getResultJSONArray(0);
|
||||||
|
|
||||||
|
StIvtIostorinv stIvtIostorinv = stIvtIostorinvMapper.selectById(iostorinv_id);
|
||||||
|
|
||||||
|
|
||||||
|
List<StIvtIostorinvdis> dis_rows = stIvtIostorinvdisMapper.selectList(new QueryWrapper<StIvtIostorinvdis>()
|
||||||
|
.eq("iostorinv_id", iostorinv_id)
|
||||||
|
.eq("box_no", map.get("box_no")));
|
||||||
|
|
||||||
for (int i = 0; i < dis_rows.size(); i++) {
|
for (int i = 0; i < dis_rows.size(); i++) {
|
||||||
JSONObject dis_jo = dis_rows.getJSONObject(i);
|
StIvtIostorinvdis dis_jo = dis_rows.get(i);
|
||||||
JSONObject i_form = new JSONObject();
|
JSONObject i_form = new JSONObject();
|
||||||
i_form.put("struct_id", dis_jo.getString("struct_id"));
|
i_form.put("struct_id", dis_jo.getStruct_id());
|
||||||
i_form.put("material_id", dis_jo.getString("material_id"));
|
i_form.put("material_id", dis_jo.getMaterial_id());
|
||||||
i_form.put("pcsn", dis_jo.getString("pcsn"));
|
i_form.put("pcsn", dis_jo.getPcsn());
|
||||||
i_form.put("change_qty", dis_jo.getString("plan_qty"));
|
i_form.put("change_qty", dis_jo.getPlan_qty());
|
||||||
i_form.put("bill_type_scode", mst_jo.getString("bill_type"));
|
i_form.put("bill_type_scode", stIvtIostorinv.getBill_type());
|
||||||
i_form.put("quality_scode", "01");
|
i_form.put("quality_scode", "01");
|
||||||
i_form.put("inv_id", mst_jo.getString("iostorinv_id"));
|
i_form.put("inv_id", stIvtIostorinv.getIostorinv_id());
|
||||||
i_form.put("bill_code", mst_jo.getString("bill_code"));
|
i_form.put("bill_code", stIvtIostorinv.getBill_code());
|
||||||
i_form.put("bill_table", "ST_IVT_IOStorInv");
|
i_form.put("bill_table", "ST_IVT_IOStorInv");
|
||||||
i_form.put("qty_unit_id", dis_jo.getString("qty_unit_id"));
|
i_form.put("qty_unit_id", dis_jo.getQty_unit_id());
|
||||||
i_form.put("qty_unit_name", dis_jo.getString("qty_unit_name"));
|
i_form.put("qty_unit_name", dis_jo.getQty_unit_name());
|
||||||
storPublicService.IOStor(i_form, "31");
|
storPublicService.IOStor(i_form, "31");
|
||||||
|
|
||||||
//更新明细表状态
|
//更新明细表状态
|
||||||
JSONObject dtl_jo = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinvdtl_id = '" + dis_jo.getString("iostorinvdtl_id") + "'").uniqueResult(0);
|
JSONObject dtl_jo = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinvdtl_id = '" + dis_jo.getIostorinvdtl_id() + "'").uniqueResult(0);
|
||||||
if (dtl_jo.getDoubleValue("unassign_qty") == 0) {
|
if (dtl_jo.getDoubleValue("unassign_qty") == 0) {
|
||||||
//判断该明细下是否还存在未分配货位的分配明细
|
//判断该明细下是否还存在未分配货位的分配明细
|
||||||
JSONArray disdiv_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinvdtl_id = '" + dis_jo.getString("iostorinvdtl_id") + "' AND (struct_id = '' OR struct_id is null) AND (point_id = '' OR point_id is null)").getResultJSONArray(0);
|
JSONArray disdiv_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinvdtl_id = '" + dis_jo.getIostorinvdtl_id() + "' AND (struct_id = '' OR struct_id is null) AND (point_id = '' OR point_id is null)").getResultJSONArray(0);
|
||||||
if (disdiv_rows.size() == 0) {
|
if (disdiv_rows.size() == 0) {
|
||||||
dtl_jo.put("bill_status", "40");
|
dtl_jo.put("bill_status", "40");
|
||||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").update(dtl_jo);
|
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").update(dtl_jo);
|
||||||
//判断主表下的明细是否都为40
|
//判断主表下的明细是否都为40
|
||||||
JSONArray dtl_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinv_id = '" + dis_jo.getString("iostorinv_id") + "' AND bill_status < '40'").getResultJSONArray(0);
|
JSONArray dtl_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinv_id = '" + dis_jo.getIostorinv_id() + "' AND bill_status < '40'").getResultJSONArray(0);
|
||||||
if (dtl_rows.size() == 0) {
|
if (dtl_rows.size() == 0) {
|
||||||
mst_jo.put("bill_status", "40");
|
mst_jo.put("bill_status", "40");
|
||||||
mst_jo.put("dis_optid", currentUserId);
|
mst_jo.put("dis_optid", currentUserId);
|
||||||
@@ -451,6 +500,9 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//调用入库分配确认方法
|
//调用入库分配确认方法
|
||||||
InbillServiceImpl inbillService = SpringContextHolder.getBean(InbillServiceImpl.class);
|
InbillServiceImpl inbillService = SpringContextHolder.getBean(InbillServiceImpl.class);
|
||||||
JSONObject dis_form = new JSONObject();
|
JSONObject dis_form = new JSONObject();
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
|||||||
throw new BadRequestException("木箱:" + boxNo + "已存在库内,请对数据进行核实!");
|
throw new BadRequestException("木箱:" + boxNo + "已存在库内,请对数据进行核实!");
|
||||||
}
|
}
|
||||||
|
|
||||||
String planQtyStr = row.get("plan_qty");
|
String planQtyStr = row.get("net_weight");
|
||||||
BigDecimal planQty = planQtyStr == null || planQtyStr.trim().isEmpty()
|
BigDecimal planQty = planQtyStr == null || planQtyStr.trim().isEmpty()
|
||||||
? BigDecimal.ZERO
|
? BigDecimal.ZERO
|
||||||
: new BigDecimal(planQtyStr);
|
: new BigDecimal(planQtyStr);
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
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;
|
||||||
|
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.mapper.StIvtIostorinvMapper;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.common.utils.FileUtil;
|
import org.nl.modules.common.utils.FileUtil;
|
||||||
@@ -30,6 +33,7 @@ import org.nl.wms.ext.sap.service.impl.LmsToSapServiceImpl;
|
|||||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||||
import org.nl.wms.sch.service.TaskService;
|
import org.nl.wms.sch.service.TaskService;
|
||||||
import org.nl.wms.st.returns.service.InAndOutReturnService;
|
import org.nl.wms.st.returns.service.InAndOutReturnService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -51,6 +55,9 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
@Resource
|
@Resource
|
||||||
private IschBaseTaskService schBaseTaskService;
|
private IschBaseTaskService schBaseTaskService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StIvtIostorinvMapper stIvtIostorinvMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> pageQuery(Map whereJson, Pageable page) {
|
public Map<String, Object> pageQuery(Map whereJson, Pageable page) {
|
||||||
HashMap map = new HashMap<>(whereJson);
|
HashMap map = new HashMap<>(whereJson);
|
||||||
@@ -208,11 +215,18 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
LmsToMesService lmsToMesService = SpringContextHolder.getBean(LmsToMesService.class);
|
LmsToMesService lmsToMesService = SpringContextHolder.getBean(LmsToMesService.class);
|
||||||
lmsToMesService.childRollFGInboundComplete(paramMesMst);
|
lmsToMesService.childRollFGInboundComplete(paramMesMst);
|
||||||
|
|
||||||
jo_mst.put("is_upload", "1");
|
// jo_mst.put("is_upload", "1");
|
||||||
jo_mst.put("upload_mes", "1");
|
// jo_mst.put("upload_mes", "1");
|
||||||
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
// jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
||||||
jo_mst.put("upload_time", DateUtil.now());
|
// jo_mst.put("upload_time", DateUtil.now());
|
||||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
// WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
||||||
|
StIvtIostorinv stIvtIostorinvdis = new StIvtIostorinv();
|
||||||
|
stIvtIostorinvdis.setIs_upload("1");
|
||||||
|
stIvtIostorinvdis.setUpload_mes("1");
|
||||||
|
stIvtIostorinvdis.setUpload_optid(SecurityUtils.getCurrentUserId());
|
||||||
|
stIvtIostorinvdis.setUpload_time(DateUtil.now());
|
||||||
|
stIvtIostorinvdis.setIostorinv_id(jo_mst.getString("iostorinv_id"));
|
||||||
|
stIvtIostorinvMapper.updateById(stIvtIostorinvdis);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,11 +249,13 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
param.put("Details", details);
|
param.put("Details", details);
|
||||||
SpringContextHolder.getBean(LmsToMesServiceImpl.class).lmsPackage(param);
|
SpringContextHolder.getBean(LmsToMesServiceImpl.class).lmsPackage(param);
|
||||||
}
|
}
|
||||||
jo_mst.put("upload_mes", "1");
|
StIvtIostorinv stIvtIostorinvdis = new StIvtIostorinv();
|
||||||
jo_mst.put("is_upload", "1");
|
stIvtIostorinvdis.setIs_upload("1");
|
||||||
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
stIvtIostorinvdis.setUpload_mes("1");
|
||||||
jo_mst.put("upload_time", DateUtil.now());
|
stIvtIostorinvdis.setUpload_optid(SecurityUtils.getCurrentUserId());
|
||||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
stIvtIostorinvdis.setUpload_time(DateUtil.now());
|
||||||
|
stIvtIostorinvdis.setIostorinv_id(jo_mst.getString("iostorinv_id"));
|
||||||
|
stIvtIostorinvMapper.updateById(stIvtIostorinvdis);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 拆分出库:回传mes
|
// 拆分出库:回传mes
|
||||||
@@ -261,11 +277,13 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
param.put("Details", details);
|
param.put("Details", details);
|
||||||
SpringContextHolder.getBean(LmsToMesServiceImpl.class).lmsUnPackage(param);
|
SpringContextHolder.getBean(LmsToMesServiceImpl.class).lmsUnPackage(param);
|
||||||
}
|
}
|
||||||
jo_mst.put("upload_mes", "1");
|
StIvtIostorinv stIvtIostorinvdis = new StIvtIostorinv();
|
||||||
jo_mst.put("is_upload", "1");
|
stIvtIostorinvdis.setIs_upload("1");
|
||||||
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
stIvtIostorinvdis.setUpload_mes("1");
|
||||||
jo_mst.put("upload_time", DateUtil.now());
|
stIvtIostorinvdis.setUpload_optid(SecurityUtils.getCurrentUserId());
|
||||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
stIvtIostorinvdis.setUpload_time(DateUtil.now());
|
||||||
|
stIvtIostorinvdis.setIostorinv_id(jo_mst.getString("iostorinv_id"));
|
||||||
|
stIvtIostorinvMapper.updateById(stIvtIostorinvdis);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 返检出库:回传mes
|
// 返检出库:回传mes
|
||||||
@@ -298,11 +316,13 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
param.put("Details", details);
|
param.put("Details", details);
|
||||||
SpringContextHolder.getBean(LmsToMesServiceImpl.class).lmsUnPackage(param);
|
SpringContextHolder.getBean(LmsToMesServiceImpl.class).lmsUnPackage(param);
|
||||||
}
|
}
|
||||||
jo_mst.put("upload_mes", "1");
|
StIvtIostorinv stIvtIostorinvdis = new StIvtIostorinv();
|
||||||
jo_mst.put("is_upload", "1");
|
stIvtIostorinvdis.setIs_upload("1");
|
||||||
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
stIvtIostorinvdis.setUpload_mes("1");
|
||||||
jo_mst.put("upload_time", DateUtil.now());
|
stIvtIostorinvdis.setUpload_optid(SecurityUtils.getCurrentUserId());
|
||||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
stIvtIostorinvdis.setUpload_time(DateUtil.now());
|
||||||
|
stIvtIostorinvdis.setIostorinv_id(jo_mst.getString("iostorinv_id"));
|
||||||
|
stIvtIostorinvMapper.updateById(stIvtIostorinvdis);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 销售出库
|
// 销售出库
|
||||||
@@ -334,13 +354,19 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
// 调用接口回传
|
// 调用接口回传
|
||||||
SpringContextHolder.getBean(LmsToMesServiceImpl.class).childRollFGOutboundComplete(paramMesMst);
|
SpringContextHolder.getBean(LmsToMesServiceImpl.class).childRollFGOutboundComplete(paramMesMst);
|
||||||
|
|
||||||
jo_mst.put("upload_mes", "1");
|
StIvtIostorinv stIvtIostorinvdis = new StIvtIostorinv();
|
||||||
|
stIvtIostorinvdis.setUpload_mes("1");
|
||||||
if ("1".equals(jo_mst.getString("upload_sap"))) {
|
if ("1".equals(jo_mst.getString("upload_sap"))) {
|
||||||
jo_mst.put("is_upload", "1");
|
stIvtIostorinvdis.setIs_upload("1");
|
||||||
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
stIvtIostorinvdis.setUpload_optid(SecurityUtils.getCurrentUserId());
|
||||||
jo_mst.put("upload_time", DateUtil.now());
|
stIvtIostorinvdis.setUpload_time(DateUtil.now());
|
||||||
|
stIvtIostorinvdis.setIostorinv_id(jo_mst.getString("iostorinv_id"));
|
||||||
}
|
}
|
||||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
|
||||||
|
stIvtIostorinvMapper.updateById(stIvtIostorinvdis);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 调拨出库
|
// 调拨出库
|
||||||
@@ -372,11 +398,13 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
// 调用接口回传
|
// 调用接口回传
|
||||||
SpringContextHolder.getBean(LmsToMesServiceImpl.class).childRollFGOutboundComplete(paramMesMst);
|
SpringContextHolder.getBean(LmsToMesServiceImpl.class).childRollFGOutboundComplete(paramMesMst);
|
||||||
|
|
||||||
jo_mst.put("upload_mes", "1");
|
StIvtIostorinv stIvtIostorinvdis = new StIvtIostorinv();
|
||||||
jo_mst.put("is_upload", "1");
|
stIvtIostorinvdis.setIs_upload("1");
|
||||||
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
stIvtIostorinvdis.setUpload_mes("1");
|
||||||
jo_mst.put("upload_time", DateUtil.now());
|
stIvtIostorinvdis.setUpload_optid(SecurityUtils.getCurrentUserId());
|
||||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
stIvtIostorinvdis.setUpload_time(DateUtil.now());
|
||||||
|
stIvtIostorinvdis.setIostorinv_id(jo_mst.getString("iostorinv_id"));
|
||||||
|
stIvtIostorinvMapper.updateById(stIvtIostorinvdis);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 改切出库:回传mes
|
// 改切出库:回传mes
|
||||||
@@ -413,11 +441,13 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
param.put("Details", details);
|
param.put("Details", details);
|
||||||
SpringContextHolder.getBean(LmsToMesServiceImpl.class).lmsUnPackage(param);
|
SpringContextHolder.getBean(LmsToMesServiceImpl.class).lmsUnPackage(param);
|
||||||
}
|
}
|
||||||
jo_mst.put("upload_mes", "1");
|
StIvtIostorinv stIvtIostorinvdis = new StIvtIostorinv();
|
||||||
jo_mst.put("is_upload", "1");
|
stIvtIostorinvdis.setIs_upload("1");
|
||||||
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
stIvtIostorinvdis.setUpload_mes("1");
|
||||||
jo_mst.put("upload_time", DateUtil.now());
|
stIvtIostorinvdis.setUpload_optid(SecurityUtils.getCurrentUserId());
|
||||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
stIvtIostorinvdis.setUpload_time(DateUtil.now());
|
||||||
|
stIvtIostorinvdis.setIostorinv_id(jo_mst.getString("iostorinv_id"));
|
||||||
|
stIvtIostorinvMapper.updateById(stIvtIostorinvdis);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 报废出库:回传mes
|
// 报废出库:回传mes
|
||||||
@@ -477,11 +507,13 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
.update(jsonUpdate,"iostorinv_id = '"+jo_mst.getString("iostorinv_id")+"' and box_no = '"+json.getString("box_no")+"'");
|
.update(jsonUpdate,"iostorinv_id = '"+jo_mst.getString("iostorinv_id")+"' and box_no = '"+json.getString("box_no")+"'");
|
||||||
}
|
}
|
||||||
|
|
||||||
jo_mst.put("upload_mes", "1");
|
StIvtIostorinv stIvtIostorinvdis = new StIvtIostorinv();
|
||||||
jo_mst.put("is_upload", "1");
|
stIvtIostorinvdis.setIs_upload("1");
|
||||||
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
stIvtIostorinvdis.setUpload_mes("1");
|
||||||
jo_mst.put("upload_time", DateUtil.now());
|
stIvtIostorinvdis.setUpload_optid(SecurityUtils.getCurrentUserId());
|
||||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
stIvtIostorinvdis.setUpload_time(DateUtil.now());
|
||||||
|
stIvtIostorinvdis.setIostorinv_id(jo_mst.getString("iostorinv_id"));
|
||||||
|
stIvtIostorinvMapper.updateById(stIvtIostorinvdis);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*// 改切出库
|
/*// 改切出库
|
||||||
@@ -597,11 +629,13 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
// 调用接口回传
|
// 调用接口回传
|
||||||
SpringContextHolder.getBean(LmsToSapServiceImpl.class).returnDelivery(param);
|
SpringContextHolder.getBean(LmsToSapServiceImpl.class).returnDelivery(param);
|
||||||
|
|
||||||
jo_mst.put("upload_sap", "1");
|
StIvtIostorinv stIvtIostorinvdis = new StIvtIostorinv();
|
||||||
jo_mst.put("is_upload", "1");
|
stIvtIostorinvdis.setIs_upload("1");
|
||||||
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
stIvtIostorinvdis.setUpload_mes("1");
|
||||||
jo_mst.put("upload_time", DateUtil.now());
|
stIvtIostorinvdis.setUpload_optid(SecurityUtils.getCurrentUserId());
|
||||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
stIvtIostorinvdis.setUpload_time(DateUtil.now());
|
||||||
|
stIvtIostorinvdis.setIostorinv_id(jo_mst.getString("iostorinv_id"));
|
||||||
|
stIvtIostorinvMapper.updateById(stIvtIostorinvdis);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -802,11 +836,13 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|||||||
// 调用接口回传
|
// 调用接口回传
|
||||||
SpringContextHolder.getBean(LmsToSapServiceImpl.class).returnOutDtl(param);
|
SpringContextHolder.getBean(LmsToSapServiceImpl.class).returnOutDtl(param);
|
||||||
|
|
||||||
jo_mst.put("upload_sap", "1");
|
StIvtIostorinv stIvtIostorinvdis = new StIvtIostorinv();
|
||||||
jo_mst.put("is_upload", "1");
|
stIvtIostorinvdis.setIs_upload("1");
|
||||||
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
stIvtIostorinvdis.setUpload_mes("1");
|
||||||
jo_mst.put("upload_time", DateUtil.now());
|
stIvtIostorinvdis.setUpload_optid(SecurityUtils.getCurrentUserId());
|
||||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
stIvtIostorinvdis.setUpload_time(DateUtil.now());
|
||||||
|
stIvtIostorinvdis.setIostorinv_id(jo_mst.getString("iostorinv_id"));
|
||||||
|
stIvtIostorinvMapper.updateById(stIvtIostorinvdis);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*// 改切出库
|
/*// 改切出库
|
||||||
|
|||||||
@@ -43,9 +43,9 @@ spring:
|
|||||||
reset-enable: false
|
reset-enable: false
|
||||||
filters:
|
filters:
|
||||||
DruidFilter,stat
|
DruidFilter,stat
|
||||||
url: jdbc:mysql://10.1.3.87:3306/lms?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
url: jdbc:mysql://10.100.9.6:2306/ynhl_lms?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
|
||||||
username: root
|
username: root
|
||||||
password: NLABC&hl123
|
password: P@ssw0rd
|
||||||
slave:
|
slave:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
@@ -84,9 +84,9 @@ spring:
|
|||||||
reset-enable: false
|
reset-enable: false
|
||||||
filters:
|
filters:
|
||||||
DruidFilter,stat
|
DruidFilter,stat
|
||||||
url: jdbc:mysql://10.1.3.89:3306/lms?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
url: jdbc:mysql://10.100.9.7:2306/ynhl_lms?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
|
||||||
username: root
|
username: root
|
||||||
password: NLABC&hl123
|
password: P@ssw0rd
|
||||||
rules:
|
rules:
|
||||||
readwrite-splitting:
|
readwrite-splitting:
|
||||||
data-sources:
|
data-sources:
|
||||||
@@ -101,7 +101,7 @@ spring:
|
|||||||
redis:
|
redis:
|
||||||
#数据库索引
|
#数据库索引
|
||||||
database: ${REDIS_DB:11}
|
database: ${REDIS_DB:11}
|
||||||
host: ${REDIS_HOST:10.1.3.91}
|
host: ${REDIS_HOST:10.100.9.5}
|
||||||
port: ${REDIS_PORT:6379}
|
port: ${REDIS_PORT:6379}
|
||||||
password: ${REDIS_PWD:}
|
password: ${REDIS_PWD:}
|
||||||
redisson:
|
redisson:
|
||||||
@@ -112,7 +112,7 @@ spring:
|
|||||||
connectionMinimumIdleSize: 8
|
connectionMinimumIdleSize: 8
|
||||||
connectionPoolSize: 8
|
connectionPoolSize: 8
|
||||||
database: 11
|
database: 11
|
||||||
address: redis://10.1.3.91:6379
|
address: redis://10.100.9.5:6379
|
||||||
idleConnectionTimeout: 10000
|
idleConnectionTimeout: 10000
|
||||||
timeout: 3000
|
timeout: 3000
|
||||||
# 登录相关配置
|
# 登录相关配置
|
||||||
@@ -179,7 +179,7 @@ file:
|
|||||||
avatarMaxSize: 5
|
avatarMaxSize: 5
|
||||||
logging:
|
logging:
|
||||||
file:
|
file:
|
||||||
path: d:\log\wms
|
path: e:\log\wms
|
||||||
config: classpath:logback-spring.xml
|
config: classpath:logback-spring.xml
|
||||||
|
|
||||||
# Sa-Token配置
|
# Sa-Token配置
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ ENV = 'production'
|
|||||||
|
|
||||||
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
||||||
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
||||||
VUE_APP_BASE_API = 'http://60.165.35.2:8011/'
|
VUE_APP_BASE_API = 'http://10.100.9.3:8013/'
|
||||||
# 如果接口是 http 形式, wss 需要改为 ws
|
# 如果接口是 http 形式, wss 需要改为 ws
|
||||||
VUE_APP_WS_API = 'ws://60.165.35.2:8011/'
|
VUE_APP_WS_API = 'ws://10.100.9.3:8013/'
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
window.g = {
|
window.g = {
|
||||||
dev: {
|
dev: {
|
||||||
VUE_APP_BASE_API: 'http://localhost:8081'
|
VUE_APP_BASE_API: 'http://127.0.0.1:8013'
|
||||||
},
|
},
|
||||||
prod: {
|
prod: {
|
||||||
VUE_APP_BASE_API: 'http://localhost:8081'
|
VUE_APP_BASE_API: 'http://10.100.9.3:8013'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -317,9 +317,13 @@ function CRUD(options) {
|
|||||||
* 提交新增/编辑
|
* 提交新增/编辑
|
||||||
*/
|
*/
|
||||||
submitCU(formName) {
|
submitCU(formName) {
|
||||||
|
debugger
|
||||||
if (formName instanceof PointerEvent) {
|
if (formName instanceof PointerEvent) {
|
||||||
formName = 'form'
|
formName = 'form'
|
||||||
}
|
}
|
||||||
|
if (typeof formName !== 'string') {
|
||||||
|
formName = 'form'
|
||||||
|
}
|
||||||
if (!callVmHook(crud, CRUD.HOOK.beforeValidateCU)) {
|
if (!callVmHook(crud, CRUD.HOOK.beforeValidateCU)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -289,19 +289,61 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 提交
|
* 提交
|
||||||
*/
|
*/
|
||||||
submitMethod() {
|
// 表单提交核心逻辑(带完整异常日志)
|
||||||
if (!this.beforeSubmitMethod()) {
|
submitForm() {
|
||||||
return
|
try {
|
||||||
}
|
// 1. 先判断表单实例是否存在,打印基础日志
|
||||||
if (this.$refs['form']) {
|
if (this.$refs['form']) {
|
||||||
this.$refs['form'].validate((valid) => {
|
console.log('表单实例存在,开始执行校验', {
|
||||||
if (valid) {
|
formRef: this.$refs['form'], // 打印表单实例详情
|
||||||
this.loading = true
|
isAdd: this.isAdd, // 打印当前是新增/编辑状态
|
||||||
if (this.isAdd) {
|
formData: this.form // 打印表单数据(排查数据异常)
|
||||||
this.addMethod()
|
})
|
||||||
} else this.editMethod()
|
// 2. 检查validate方法是否存在(核心异常点)
|
||||||
|
if (typeof this.$refs['form'].validate !== 'function') {
|
||||||
|
throw new Error('表单实例存在,但validate方法未找到')
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
// 3. 执行表单校验
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
console.log('表单校验通过,开始执行提交逻辑')
|
||||||
|
this.loading = true
|
||||||
|
try {
|
||||||
|
// 4. 执行新增/编辑方法,捕获接口调用异常
|
||||||
|
if (this.isAdd) {
|
||||||
|
this.addMethod().catch(err => {
|
||||||
|
throw new Error(`新增接口调用失败:${err.message}`)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.editMethod().catch(err => {
|
||||||
|
throw new Error(`编辑接口调用失败:${err.message}`)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} catch (submitErr) {
|
||||||
|
// 5. 捕获新增/编辑方法的异常
|
||||||
|
console.error('表单提交逻辑执行失败:', submitErr)
|
||||||
|
this.$message.error(submitErr.message || '操作失败,请重试')
|
||||||
|
this.loading = false // 重置loading状态
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.warn('表单校验未通过:用户输入不符合规则')
|
||||||
|
this.$message.warning('请检查表单填写内容是否符合要求')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 6. 表单实例不存在的异常日志
|
||||||
|
console.error('表单校验失败:表单实例未找到', {
|
||||||
|
refs: this.$refs, // 打印所有refs,排查命名错误
|
||||||
|
component: this.$options.name // 打印当前组件名,定位报错组件
|
||||||
|
})
|
||||||
|
this.$message.error('表单初始化失败,请刷新页面重试')
|
||||||
|
}
|
||||||
|
} catch (mainErr) {
|
||||||
|
// 7. 捕获整个流程的未预期异常
|
||||||
|
console.error('表单提交全流程异常:', mainErr)
|
||||||
|
this.$message.error('系统异常,请联系管理员')
|
||||||
|
this.loading = false // 兜底重置loading
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user