add:CTU出入库功能;

This commit is contained in:
2025-10-16 16:55:56 +08:00
parent f7512364cd
commit 3d038430f3
24 changed files with 632 additions and 83 deletions

View File

@@ -53,7 +53,13 @@
<artifactId>jna</artifactId> <artifactId>jna</artifactId>
<version>5.6.0</version> <version>5.6.0</version>
</dependency> </dependency>
<dependency>
<groupId>org.nl</groupId>
<artifactId>nl-verify-check-sdk</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/nl-verify-check-sdk-1.0-SNAPSHOT.jar</systemPath>
</dependency>
<dependency> <dependency>
<groupId>net.java.dev.jna</groupId> <groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId> <artifactId>jna-platform</artifactId>

View File

@@ -13,6 +13,7 @@ public class StructattrChangeDto {
String inv; String inv;
String structCode; String structCode;
String storagevehicleCode; String storagevehicleCode;
//默认faletrue则是如果出库是手持库出确认则不在这边变动组盘信息
Boolean inBound; Boolean inBound;
String taskType; String taskType;
} }

View File

@@ -172,7 +172,6 @@ public class BsrealStorattrServiceImpl extends ServiceImpl<BsrealStorattrMapper,
.eq(BsrealStorattr::getIs_delete, BaseDataEnum.IS_YES_NOT.code("")) .eq(BsrealStorattr::getIs_delete, BaseDataEnum.IS_YES_NOT.code(""))
.eq(BsrealStorattr::getIs_used, BaseDataEnum.IS_YES_NOT.code("") .eq(BsrealStorattr::getIs_used, BaseDataEnum.IS_YES_NOT.code("")
); );
return bsrealStorattrMapper.selectList(queryWrapper); return bsrealStorattrMapper.selectList(queryWrapper);
} }

View File

@@ -410,25 +410,27 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
wrapper.set("storagevehicle_code", null); wrapper.set("storagevehicle_code", null);
} }
this.update(wrapper); this.update(wrapper);
//更新冻结数量
Structattr structattr = this.getByCode(changeDto.getStructCode());
List<StIvtStructivtflow> records = new ArrayList<>();
List<GroupPlate> groupPlates = iMdPbGroupplateService.list(new QueryWrapper<GroupPlate>() List<GroupPlate> groupPlates = iMdPbGroupplateService.list(new QueryWrapper<GroupPlate>()
.eq("storagevehicle_code", changeDto.getStoragevehicleCode()) .eq("storagevehicle_code", changeDto.getStoragevehicleCode())
.eq("status", IOSEnum.GROUP_PLATE_STATUS.code("入库"))); .eq("status", IOSEnum.GROUP_PLATE_STATUS.code("入库")));
List<StIvtStructivtflow> records = new ArrayList<>();
//更新冻结数量
Structattr structattr = this.getByCode(changeDto.getStructCode());
for (GroupPlate vehicleMater : groupPlates) { for (GroupPlate vehicleMater : groupPlates) {
String vehicleCode = vehicleMater.getStoragevehicle_code(); String vehicleCode = vehicleMater.getStoragevehicle_code();
BigDecimal subtract = vehicleMater.getQty().subtract(vehicleMater.getFrozen_qty()); BigDecimal subtract = vehicleMater.getQty().subtract(vehicleMater.getFrozen_qty());
//100-出50 = 50 //100-出50 = 50
//如果出库是手持库出确认则不在这边变动组盘信息 //如果出库是手持库出确认则不在这边变动组盘信息
if (!changeDto.getInBound()){ if (!changeDto.getInBound()){
String status = subtract.compareTo(BigDecimal.ZERO) > 0 ? IOSEnum.GROUP_PLATE_STATUS.code("组盘"):IOSEnum.GROUP_PLATE_STATUS.code("出库");
UpdateWrapper<GroupPlate> update = new UpdateWrapper<GroupPlate>() UpdateWrapper<GroupPlate> update = new UpdateWrapper<GroupPlate>()
.set("frozen_qty", 0) .set("frozen_qty", 0)
.set("qty", subtract) .set("qty", subtract)
.set("update_time", now) .set("update_time", now)
.set("status", IOSEnum.GROUP_PLATE_STATUS.code("组盘")) .set("status",status)
.eq("group_id", vehicleMater.getGroup_id()); .eq("group_id", vehicleMater.getGroup_id());
iMdPbGroupplateService.update(update); iMdPbGroupplateService.update(update);
iMdPbGroupplateService.update(update);
} }
StIvtStructivtflow record = new StIvtStructivtflow(); StIvtStructivtflow record = new StIvtStructivtflow();
record.setId(IdUtil.getStringId()); record.setId(IdUtil.getStringId());

View File

@@ -51,21 +51,20 @@ public class SameBlockNumRuleHandler extends Decisioner<Structattr, JSONObject>
.thenComparing(Structattr::getLayer_num)) .thenComparing(Structattr::getLayer_num))
.collect(Collectors.toList()); .collect(Collectors.toList());
List<Structattr> result = new ArrayList<>(); List<Structattr> result = new ArrayList<>();
// 3. 找出所有层号(去重 + 升序) // 3. 找出所有层号
Set<Integer> allLayers = blockList.stream() Set<Integer> allLayers = blockList.stream()
.map(Structattr::getLayer_num) .map(Structattr::getLayer_num)
.collect(Collectors.toCollection(TreeSet::new)); // 自动排序 .collect(Collectors.toCollection(TreeSet::new)); // 自动排序
// 4. 从小层号开始,尝试找同一列的货位 // 4. 从小层号开始,找同一列的货位
for (Integer layer : allLayers) { for (Integer layer : allLayers) {
List<Structattr> currentLayer = blockList.stream() List<Structattr> currentLayer = blockList.stream()
.filter(item -> item.getLayer_num().compareTo(layer) == 0) .filter(item -> item.getLayer_num().compareTo(layer) == 0)
.collect(Collectors.toList()); .collect(Collectors.toList());
if (!currentLayer.isEmpty()) { if (!currentLayer.isEmpty()) {
result.addAll(currentLayer); result.addAll(currentLayer);
break; // 找到一层就跳出 break;
} }
} }
// 5. 如果没找到符合的,就用全部 blockList
if (result.isEmpty()) { if (result.isEmpty()) {
result.addAll(blockList); result.addAll(blockList);
} }

View File

@@ -4,9 +4,11 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.RedissonUtils; import org.nl.common.utils.RedissonUtils;
@@ -18,6 +20,7 @@ import org.nl.wms.gateway.dto.FeedBackTaskDto;
import org.nl.wms.gateway.dto.InteracteDto; import org.nl.wms.gateway.dto.InteracteDto;
import org.nl.wms.gateway.dto.RcsResponse; import org.nl.wms.gateway.dto.RcsResponse;
import org.nl.wms.gateway.service.IGateWayService; import org.nl.wms.gateway.service.IGateWayService;
import org.nl.wms.pda.ios_manage.service.impl.PdaIosInServiceImpl;
import org.nl.wms.sch_manage.enums.TaskStatus; import org.nl.wms.sch_manage.enums.TaskStatus;
import org.nl.wms.sch_manage.service.ISchBasePointService; import org.nl.wms.sch_manage.service.ISchBasePointService;
import org.nl.wms.sch_manage.service.ISchBaseTaskService; import org.nl.wms.sch_manage.service.ISchBaseTaskService;
@@ -25,6 +28,9 @@ import org.nl.wms.sch_manage.service.dao.SchBasePoint;
import org.nl.wms.sch_manage.service.dao.SchBaseTask; import org.nl.wms.sch_manage.service.dao.SchBaseTask;
import org.nl.wms.sch_manage.service.util.AbstractTask; import org.nl.wms.sch_manage.service.util.AbstractTask;
import org.nl.wms.sch_manage.service.util.TaskFactory; import org.nl.wms.sch_manage.service.util.TaskFactory;
import org.nl.wms.warehouse_management.enums.IOSEnum;
import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
import org.redisson.api.RLock; import org.redisson.api.RLock;
import org.redisson.api.RedissonClient; import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -46,7 +52,11 @@ import java.util.concurrent.atomic.AtomicReference;
@Slf4j @Slf4j
@Service @Service
public class GateWayServiceImpl implements IGateWayService { public class GateWayServiceImpl implements IGateWayService {
/**
* 组盘记录服务
*/
@Autowired
private IMdPbGroupplateService iMdPbGroupplateService;
@Autowired @Autowired
private TaskFactory taskFactory; private TaskFactory taskFactory;
@@ -61,6 +71,11 @@ public class GateWayServiceImpl implements IGateWayService {
@Autowired @Autowired
private ISchBaseTaskService iSchBaseTaskService; private ISchBaseTaskService iSchBaseTaskService;
@Autowired
private PdaIosInServiceImpl pdaIosInServiceImpl;
public String applyTask(String service, String type, JSONObject data, InteracteDto<Map> param) { public String applyTask(String service, String type, JSONObject data, InteracteDto<Map> param) {
if ("InStorage".equals(service)) { if ("InStorage".equals(service)) {
try { try {
@@ -96,6 +111,30 @@ public class GateWayServiceImpl implements IGateWayService {
result.put("taskCode", taskCode); result.put("taskCode", taskCode);
}, param.getService() + param.getType(), null); }, param.getService() + param.getType(), null);
} }
if ("CtuInStorage".equals(service)) {
RedissonUtils.lock(() -> {
//tofix
String vehicleCode = jsonObject.keySet().iterator().next();
String siteCode = jsonObject.getString(vehicleCode);
Assert.noNullElements(new Object[]{vehicleCode, siteCode}, "站点编号与料箱号不能为空");
List<GroupPlate> groupPlateList = iMdPbGroupplateService.list(
new LambdaQueryWrapper<GroupPlate>()
.eq(GroupPlate::getStoragevehicle_code,vehicleCode)
.lt(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))
);
JSONObject jsonData = new JSONObject();
jsonData.put("vehicle_code", vehicleCode);
jsonData.put("site_code", siteCode);
jsonData.put("sect_id", "1940612379800899585");
jsonData.put("stor_code", "CTU");
if(ObjectUtils.isEmpty(groupPlateList)) {
jsonData.put("is_empty_vehicle","1");
}
pdaIosInServiceImpl.confirmIn(jsonData);
// String taskCode = gateWayServiceImpl.applyTask(param.getService(), type, jsonObject, param);
// result.put("taskCode", taskCode);
}, param.getService() + param.getType(), null);
}
if ("Task".equals(service)) { if ("Task".equals(service)) {
iSchBaseTaskService.operation(jsonObject); iSchBaseTaskService.operation(jsonObject);
} }

View File

@@ -12,6 +12,7 @@ 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.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -65,6 +66,7 @@ import static org.nl.wms.warehouse_management.enums.IOSEnum.GROUP_PLATE_STATUS;
* @since 2025-06-05 * @since 2025-06-05
*/ */
@Service @Service
@Slf4j
public class PdaIosInServiceImpl implements PdaIosInService { public class PdaIosInServiceImpl implements PdaIosInService {
@Autowired @Autowired
@@ -566,7 +568,8 @@ public class PdaIosInServiceImpl implements PdaIosInService {
//库存校验 //库存校验
Structattr structattr = iStructattrService.getOne(new LambdaUpdateWrapper<Structattr>().eq(Structattr::getStoragevehicle_code, whereJson.getString("vehicle_code"))); Structattr structattr = iStructattrService.getOne(new LambdaUpdateWrapper<Structattr>().eq(Structattr::getStoragevehicle_code, whereJson.getString("vehicle_code")));
if (structattr != null) { if (structattr != null) {
throw new BadRequestException("此载具已在库内" + structattr.getStruct_code() + " 中,请检查!"); log.error("此载具:"+whereJson.getString("vehicle_code")+"已存在" + structattr.getStruct_code() + " 中,请检查!");
throw new BadRequestException("此载具:"+whereJson.getString("vehicle_code")+"已存在:" + structattr.getStruct_code() + " 中,请检查!");
} }
Sectattr sectDao = updateIvtUtils.checkVehicleType(whereJson.getString("sect_id"), whereJson.getString("vehicle_code")); Sectattr sectDao = updateIvtUtils.checkVehicleType(whereJson.getString("sect_id"), whereJson.getString("vehicle_code"));
whereJson.put("stor_code", sectDao.getStor_code()); whereJson.put("stor_code", sectDao.getStor_code());
@@ -609,11 +612,13 @@ public class PdaIosInServiceImpl implements PdaIosInService {
}); });
taskJson.put("tableMater", tableMater); taskJson.put("tableMater", tableMater);
iRawAssistIStorService.divPoint(taskJson); iRawAssistIStorService.divPoint(taskJson);
//更新组盘表状态 if (!"CTU".equals(whereJson.getString("stor_code"))) {
mdPbGroupplateMapper.update(new GroupPlate(), new LambdaUpdateWrapper<GroupPlate>() //更新组盘表状态
.set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘")) mdPbGroupplateMapper.update(new GroupPlate(), new LambdaUpdateWrapper<GroupPlate>()
.eq(GroupPlate::getStoragevehicle_code, whereJson.getString("storagevehicle_code")) .set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"))
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))); .eq(GroupPlate::getStoragevehicle_code, whereJson.getString("storagevehicle_code"))
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库")));
}
} else { } else {
//空载具入库 //空载具入库
whereJson.put("qty", 1); whereJson.put("qty", 1);

View File

@@ -78,6 +78,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
*/ */
@Autowired @Autowired
private MdPbGroupplateMapper mdPbGroupplateMapper; private MdPbGroupplateMapper mdPbGroupplateMapper;
/** /**
* 库区服务 * 库区服务
*/ */
@@ -647,6 +648,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public PdaResponse outStorageConfirm(JSONObject whereJson) { public PdaResponse outStorageConfirm(JSONObject whereJson) {
String now = DateUtil.now();
//任务校验 //任务校验
SchBaseTask task = iSchBaseTaskService.getOne(new LambdaQueryWrapper<SchBaseTask>().eq(SchBaseTask::getVehicle_code, whereJson.getString("storagevehicle_code")).lt(SchBaseTask::getTask_status, TaskStatus.FINISHED.getCode())); SchBaseTask task = iSchBaseTaskService.getOne(new LambdaQueryWrapper<SchBaseTask>().eq(SchBaseTask::getVehicle_code, whereJson.getString("storagevehicle_code")).lt(SchBaseTask::getTask_status, TaskStatus.FINISHED.getCode()));
if (ObjectUtil.isNotEmpty(task)) { if (ObjectUtil.isNotEmpty(task)) {
@@ -666,13 +668,28 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
//自动送回空载具 //自动送回空载具
autoReturnEmptyVehicle(whereJson, pointDao); autoReturnEmptyVehicle(whereJson, pointDao);
} else { } else {
List<GroupPlate> groupPlateList = iMdPbGroupplateService.list( // List<GroupPlate> groupPlateList = iMdPbGroupplateService.list(
new LambdaQueryWrapper<GroupPlate>() // new LambdaQueryWrapper<GroupPlate>()
.eq(GroupPlate::getStoragevehicle_code, whereJson.getString("storagevehicle_code")) // .eq(GroupPlate::getStoragevehicle_code, whereJson.getString("storagevehicle_code"))
.lt(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库")) // .lt(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))
); // );
if (groupPlateList.stream().anyMatch(r -> r.getQty().compareTo(BigDecimal.ZERO) > 0)) { // if (groupPlateList.stream().anyMatch(r -> r.getQty().compareTo(BigDecimal.ZERO) > 0)) {
throw new BadRequestException("该载具:" + whereJson.getString("storagevehicle_code") + "存在拣选余料或混托物料,不能直接出库确认,请选择拣选余料回库。"); // throw new BadRequestException("该载具:" + whereJson.getString("storagevehicle_code") + "存在拣选余料或混托物料,不能直接出库确认,请选择拣选余料回库。");
// }
List<GroupPlate> groupPlates = iMdPbGroupplateService.list(new QueryWrapper<GroupPlate>()
.eq("storagevehicle_code", whereJson.getString("storagevehicle_code"))
.eq("status", IOSEnum.GROUP_PLATE_STATUS.code("入库")));
for (GroupPlate vehicleMater : groupPlates) {
BigDecimal subtract = vehicleMater.getQty().subtract(vehicleMater.getFrozen_qty());
//100-出50 = 50
String status = subtract.compareTo(BigDecimal.ZERO) > 0 ? IOSEnum.GROUP_PLATE_STATUS.code("组盘"):IOSEnum.GROUP_PLATE_STATUS.code("出库");
UpdateWrapper<GroupPlate> update = new UpdateWrapper<GroupPlate>()
.set("frozen_qty", 0)
.set("qty", subtract)
.set("update_time", now)
.set("status",status)
.eq("group_id", vehicleMater.getGroup_id());
iMdPbGroupplateService.update(update);
} }
//载具解绑 //载具解绑
iSchBasePointService.update(new SchBasePoint(), new LambdaUpdateWrapper<>(SchBasePoint.class) iSchBasePointService.update(new SchBasePoint(), new LambdaUpdateWrapper<>(SchBasePoint.class)
@@ -680,18 +697,29 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
.set(SchBasePoint::getIos_id, BaseDataEnum.IS_YES_NOT.code("")) .set(SchBasePoint::getIos_id, BaseDataEnum.IS_YES_NOT.code(""))
.eq(SchBasePoint::getPoint_code, pointDao.getPoint_code()) .eq(SchBasePoint::getPoint_code, pointDao.getPoint_code())
); );
//仓位解绑
UpdateWrapper<Structattr> wrapper = new UpdateWrapper<Structattr>()
.set("update_time", now)
.set("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"))
.set("storagevehicle_code", null)
.eq("storagevehicle_code", whereJson.getString("storagevehicle_code"));
iStructattrService.update(wrapper);
// StructattrChangeDto changeDto = StructattrChangeDto.builder()
// .storagevehicleCode(whereJson.getString("storagevehicle_code"))
// .structCode(task.getPoint_code1()).taskType(task.getConfig_code()).inBound(false).build();
// iStructattrService.changeStruct(changeDto);
//物料全部出库 //物料全部出库
if (CollectionUtils.isNotEmpty(groupPlateList)) { // if (CollectionUtils.isNotEmpty(groupPlateList)) {
LambdaUpdateWrapper<GroupPlate> update = new LambdaUpdateWrapper<>(); // LambdaUpdateWrapper<GroupPlate> update = new LambdaUpdateWrapper<>();
Set<String> plateCodes = groupPlateList.stream().map(GroupPlate::getGroup_id).collect(Collectors.toSet()); // Set<String> plateCodes = groupPlateList.stream().map(GroupPlate::getGroup_id).collect(Collectors.toSet());
update.set(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("出库")) // update.set(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("出库"))
.set(GroupPlate::getUpdate_time, DateUtil.now()) // .set(GroupPlate::getUpdate_time, DateUtil.now())
.set(GroupPlate::getCreate_time, DateUtil.now()) // .set(GroupPlate::getCreate_time, DateUtil.now())
.set(GroupPlate::getRemark, SecurityUtils.getCurrentNickName() + "" + DateUtil.now() + "使用手持扫码确认出库。") // .set(GroupPlate::getRemark, SecurityUtils.getCurrentNickName() + "于" + DateUtil.now() + "使用手持扫码确认出库。")
.set(GroupPlate::getUpdate_optname, SecurityUtils.getCurrentNickName()) // .set(GroupPlate::getUpdate_optname, SecurityUtils.getCurrentNickName())
.in(GroupPlate::getGroup_id, plateCodes); // .in(GroupPlate::getGroup_id, plateCodes);
mdPbGroupplateMapper.update(null, update); // mdPbGroupplateMapper.update(null, update);
} // }
} }
return PdaResponse.requestOk(); return PdaResponse.requestOk();
} }

View File

@@ -16,6 +16,7 @@ import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.nl.common.domain.query.PageQuery; import org.nl.common.domain.query.PageQuery;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.CodeUtil;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import org.nl.wms.basedata_manage.enums.BaseDataEnum; import org.nl.wms.basedata_manage.enums.BaseDataEnum;
import org.nl.wms.sch_manage.enums.StatusEnum; import org.nl.wms.sch_manage.enums.StatusEnum;
@@ -102,7 +103,7 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
String now = DateUtil.now(); String now = DateUtil.now();
Assert.notNull(entity.getTask_status(), "任务状态不能为空!"); Assert.notNull(entity.getTask_status(), "任务状态不能为空!");
entity.setTask_id(IdUtil.getSnowflake(1, 1).nextIdStr()); entity.setTask_id(IdUtil.getSnowflake(1, 1).nextIdStr());
entity.setTask_code(IdUtil.getSnowflake(1, 1).nextIdStr()); entity.setTask_code(CodeUtil.getNewCode("TASK_CODE"));
entity.setCreate_id(currentUserId); entity.setCreate_id(currentUserId);
entity.setCreate_name(nickName); entity.setCreate_name(nickName);
entity.setCreate_time(now); entity.setCreate_time(now);

View File

@@ -93,11 +93,11 @@ public class BackInTask extends AbstractTask {
task.setPoint_code2(json.getString("point_code2")); task.setPoint_code2(json.getString("point_code2"));
task.setVehicle_code(json.getString("vehicle_code")); task.setVehicle_code(json.getString("vehicle_code"));
task.setVehicle_type(json.getString("vehicle_type")); task.setVehicle_type(json.getString("vehicle_type"));
task.setRequest_param(json.toString());
task.setAcs_trace_id(json.getString("acs_task_type")); task.setAcs_trace_id(json.getString("acs_task_type"));
task.setCreate_id(SecurityUtils.getCurrentUserId()); task.setCreate_id(SecurityUtils.getCurrentUserId());
task.setCreate_name(SecurityUtils.getCurrentNickName()); task.setCreate_name(SecurityUtils.getCurrentNickName());
task.setCreate_time(DateUtil.now()); task.setCreate_time(DateUtil.now());
task.setRequest_param(json.toString());
taskService.save(task); taskService.save(task);
return task.getTask_id(); return task.getTask_id();
} }

View File

@@ -0,0 +1,302 @@
package org.nl.wms.sch_manage.service.util.tasks;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleinfoService;
import org.nl.wms.basedata_manage.service.IStructattrService;
import org.nl.wms.basedata_manage.service.dao.Structattr;
import org.nl.wms.decision_manage.service.strategyConfig.decisioner.impl.diy.SameBlockNumRuleHandler;
import org.nl.wms.sch_manage.enums.StatusEnum;
import org.nl.wms.sch_manage.enums.TaskStatus;
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
import org.nl.wms.sch_manage.service.util.AbstractTask;
import org.nl.wms.sch_manage.service.util.AcsTaskDto;
import org.nl.wms.sch_manage.service.util.TaskType;
import org.nl.wms.warehouse_management.enums.IOSConstant;
import org.nl.wms.warehouse_management.enums.IOSEnum;
import org.nl.wms.warehouse_management.service.IMdPbGroupplateService;
import org.nl.wms.warehouse_management.service.IOutBillService;
import org.nl.wms.warehouse_management.service.IRawAssistIStorService;
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
import org.nl.wms.warehouse_management.service.dao.IOStorInvDis;
import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvDisMapper;
import org.nl.wms.warehouse_management.service.dao.mapper.MdPbGroupplateMapper;
import org.nl.wms.warehouse_management.service.util.UpdateIvtUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import static org.nl.wms.warehouse_management.enums.IOSEnum.GROUP_PLATE_STATUS;
/**
* @Author: Liuxy
* @Description: CTU入库任务类
* @Date: 2025/5/25
*/
@Slf4j
@Component(value = "CtuInTask")
@TaskType("CtuInTask")
public class CtuInTask extends AbstractTask {
@Autowired
private ISchBaseTaskService taskService;
/**
* 组盘记录mapper
*/
@Autowired
private MdPbGroupplateMapper mdPbGroupplateMapper;
@Resource
private IStructattrService iStructattrService;
@Autowired
private SameBlockNumRuleHandler sameBlockNumRuleHandler;
@Resource
private IRawAssistIStorService rawAssistIStorService;
/**
* 组盘记录服务
*/
@Autowired
private IMdPbGroupplateService iMdPbGroupplateService;
@Resource
private IOStorInvDisMapper ioStorInvDisMapper;
/**
* 载具服务
*/
@Autowired
private IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService;
/**
* 校验工具类
*/
@Autowired
private UpdateIvtUtils updateIvtUtils;
@Resource
private IOutBillService outBillService;
@Override
public String create(JSONObject json) {
if (ObjectUtils.isEmpty(json)) {
log.error("创建任务失败:方法请求参数不能为空");
throw new BadRequestException("创建任务失败:方法请求参数不能为空");
}
String vehicleCode = json.keySet().iterator().next();
String startPoint = json.getString(vehicleCode);
//校验载具
// MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getByCode(vehicleCode);
// if (ObjectUtil.isEmpty(vehicleDao)) {
// throw new BadRequestException("不存在该载具号信息,请检查");
// }
// //库存校验
// Structattr structattr = iStructattrService.getOne(new LambdaUpdateWrapper<Structattr>().eq(Structattr::getStoragevehicle_code, vehicleCode));
// if (structattr != null) {
// throw new BadRequestException("此载具已在库内:" + structattr.getStruct_code() + " 中,请检查!");
// }
// List<GroupPlate> groupPlateList = iMdPbGroupplateService.list(
// new LambdaQueryWrapper<GroupPlate>()
// .eq(GroupPlate::getStoragevehicle_code, vehicleDao.getStoragevehicle_code())
// .lt(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))
// );
// if (ObjectUtils.isEmpty(groupPlateList)) {
// throw new BadRequestException("该载具号未组盘,请检查");
// }
json.put("vehicle_code", vehicleCode);
json.put("point_code1", startPoint);
String endPoint = getEndPoint(vehicleCode);
json.put("point_code2", endPoint);
updateIvtUtils.checkTask(json);
try {
UpdateWrapper<Structattr> updateWrapper = new UpdateWrapper<Structattr>()
.set("storagevehicle_code", vehicleCode)
.set("lock_type", IOSEnum.LOCK_TYPE.code("入库锁"))
.set("update_time", DateUtil.now())
.set("update_optname", SecurityUtils.getCurrentNickName())
.eq("struct_code", endPoint);
iStructattrService.update(updateWrapper);
} catch (Exception e) {
throw new BadRequestException("当前载具:" + vehicleCode + "已绑定仓位CTU申请任务失败请检查仓位信息" + e.getMessage());
}
SchBaseTask task = new SchBaseTask();
task.setTask_status(TaskStatus.CREATE.getCode());
task.setAcs_trace_id(json.getString("acs_task_type"));
task.setVehicle_code(vehicleCode);
task.setPoint_code1(startPoint);
task.setPoint_code2(endPoint);
task.setRequest_param(json.toString());
task.setVehicle_type(json.getString("vehicle_type"));
task.setConfig_code(IOSConstant.CTU_IN_TASK);
taskService.create(task);
return task.getTask_code();
}
public String getEndPoint(String vehicleCode) {
QueryWrapper<Structattr> query = new QueryWrapper<Structattr>()
.eq("is_used", true)
.eq("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"))
.eq("stor_code", StatusEnum.STOCK_INFO.code("二楼ctu缓存库"));
query.isNull("storagevehicle_code");
List<Structattr> list = iStructattrService.list(query);
List<Structattr> structList = sameBlockNumRuleHandler.handler(list, null);
if (CollectionUtils.isEmpty(structList)) {
//iSchBasePointService.sendErrorMsg("1", null, "当前载具:" + vehicleCode + "CTU申请任务失败没有可用仓位");
throw new BadRequestException("当前载具:" + vehicleCode + "CTU申请任务失败没有可用仓位");
}
// Map map = SpringContextHolder.getBean(DecisionHandler.class)
// .dispenseTransa(ListOf.of("limitStorage","depthPriority","nearby"), new JSONObject(MapOf.of("stor_code", stIvtStructattr.getStor_code()
// ,"vehicleCode",task.getVehicle_code(),
// "startPoint",task.getPoint_code1())));
// String new_struct_code = ((Map<String, String>) map.get("form_data")).get("end_struct_code");
log.info("货位绑定成功" + structList.get(0).getStruct_code() + "_" + vehicleCode);
return structList.get(0).getStruct_code();
}
@Override
public AcsTaskDto sendAcsParam(String taskId) {
SchBaseTask taskDao = taskService.getById(taskId);
// 组织下发给acs的数据
AcsTaskDto acsTaskDto = new AcsTaskDto();
acsTaskDto.setExt_task_uuid(taskDao.getTask_id());
acsTaskDto.setTask_code(taskDao.getTask_code());
acsTaskDto.setStart_device_code(taskDao.getPoint_code1());
acsTaskDto.setNext_device_code(taskDao.getPoint_code2());
if (taskDao.getPoint_code2().contains("-")) {
acsTaskDto.setNext_device_code(taskDao.getPoint_code2().replace('-', '_'));
}
acsTaskDto.setPriority(taskDao.getPriority());
acsTaskDto.setTask_type("1");
return acsTaskDto;
}
@Override
protected void updateStatus(String task_code, TaskStatus status) {
// 校验任务
SchBaseTask taskObj = taskService.getByCode(task_code);
if (taskObj.getTask_status().equals(TaskStatus.FINISHED.getCode())) {
throw new BadRequestException("该任务已完成!");
}
if (taskObj.getTask_status().equals(TaskStatus.CANCELED.getCode())) {
throw new BadRequestException("该任务已取消!");
}
// 根据传来的类型去对任务进行操作
if (status.equals(TaskStatus.EXECUTING)) {
taskObj.setTask_status(TaskStatus.EXECUTING.getCode());
taskObj.setRemark("执行中");
taskService.updateById(taskObj);
}
if (status.equals(TaskStatus.FINISHED)) {
this.finishTask(taskObj);
}
if (status.equals(TaskStatus.CANCELED)) {
this.cancelTask(taskObj);
}
}
@Override
public void forceFinish(String task_code) {
SchBaseTask taskObj = taskService.getByCode(task_code);
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
taskObj.setRemark("已完成");
taskService.updateById(taskObj);
// 更新终点
iStructattrService.update(
new UpdateWrapper<Structattr>().lambda()
.eq(Structattr::getStruct_code, taskObj.getPoint_code2())
.set(Structattr::getStoragevehicle_code, taskObj.getVehicle_code())
.set(Structattr::getTaskdtl_id, null)
.set(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
);
List<GroupPlate> plates = mdPbGroupplateMapper.selectList(
new LambdaQueryWrapper<GroupPlate>()
.eq(GroupPlate::getStoragevehicle_code, taskObj.getVehicle_code())
.lt(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("出库"))
);
//更新组盘信息
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(plates)) {
LambdaUpdateWrapper<GroupPlate> update = new LambdaUpdateWrapper<>();
Set<String> plateCodes = plates.stream().map(GroupPlate::getGroup_id).collect(Collectors.toSet());
update.set(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("入库"))
.set(GroupPlate::getUpdate_time, DateUtil.now())
.set(GroupPlate::getCreate_time, DateUtil.now())
.in(GroupPlate::getGroup_id, plateCodes);
mdPbGroupplateMapper.update(null, update);
}
}
@Override
public void cancel(String task_code) {
SchBaseTask taskObj = taskService.getByCode(task_code);
if (ObjectUtil.isEmpty(taskObj)) {
throw new BadRequestException("该任务不存在");
}
if (!TaskStatus.CREATE.getCode().equals(taskObj.getTask_status())) {
throw new BadRequestException("任务状态必须为生成才能取消任务");
}
this.cancelTask(taskObj);
}
@Override
public void backMes(String task_code) {
}
@Transactional(rollbackFor = Exception.class)
public void finishTask(SchBaseTask taskObj) {
// 任务完成
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
taskObj.setRemark("已完成");
taskService.updateById(taskObj);
// 更新终点
iStructattrService.update(
new UpdateWrapper<Structattr>().lambda()
.eq(Structattr::getStruct_code, taskObj.getPoint_code2())
.set(Structattr::getStoragevehicle_code, taskObj.getVehicle_code())
.set(Structattr::getTaskdtl_id, null)
.set(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
);
List<GroupPlate> plates = mdPbGroupplateMapper.selectList(
new LambdaQueryWrapper<GroupPlate>()
.eq(GroupPlate::getStoragevehicle_code, taskObj.getVehicle_code())
.lt(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("出库"))
);
//更新组盘信息
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(plates)) {
LambdaUpdateWrapper<GroupPlate> update = new LambdaUpdateWrapper<>();
Set<String> plateCodes = plates.stream().map(GroupPlate::getGroup_id).collect(Collectors.toSet());
update.set(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("入库"))
.set(GroupPlate::getUpdate_time, DateUtil.now())
.set(GroupPlate::getCreate_time, DateUtil.now())
.in(GroupPlate::getGroup_id, plateCodes);
mdPbGroupplateMapper.update(null, update);
}
}
@Transactional(rollbackFor = Exception.class)
public void cancelTask(SchBaseTask taskObj) {
//分配表清除任务
ioStorInvDisMapper.update(new IOStorInvDis(), new LambdaUpdateWrapper<>(IOStorInvDis.class)
.set(IOStorInvDis::getTask_id, null)
.set(IOStorInvDis::getPoint_code, null)
.set(IOStorInvDis::getIs_issued, 0)
.set(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("未生成"))
.eq(IOStorInvDis::getTask_id, taskObj.getTask_id())
);
// 更新任务状态
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark("已取消");
taskService.updateById(taskObj);
}
}

View File

@@ -69,7 +69,7 @@ public class StOutTask extends AbstractTask {
task.setVehicle_type(json.getString("vehicle_type")); task.setVehicle_type(json.getString("vehicle_type"));
task.setGroup_id(json.getString("group_id")); task.setGroup_id(json.getString("group_id"));
task.setRequest_param(json.toString()); task.setRequest_param(json.toString());
task.setHandle_status(json.getString("vehicle_type")); task.setHandle_status(json.getString("handle_status"));
task.setIs_auto_confirm(StringUtils.isNotBlank(json.getString("is_auto_confirm"))?json.getInteger("is_auto_confirm"):0); task.setIs_auto_confirm(StringUtils.isNotBlank(json.getString("is_auto_confirm"))?json.getInteger("is_auto_confirm"):0);
task.setAcs_trace_id(json.getString("acs_task_type")); task.setAcs_trace_id(json.getString("acs_task_type"));
task.setCreate_id(SecurityUtils.getCurrentUserId()); task.setCreate_id(SecurityUtils.getCurrentUserId());

View File

@@ -105,4 +105,16 @@ public class IOSConstant {
*/ */
public final static String XB_OUT_TASK = "XbOutTask"; public final static String XB_OUT_TASK = "XbOutTask";
/**
* CTU入库
*/
public final static String CTU_IN_TASK = "CtuInTask";
/**
* CTU出库
*/
public final static String CTU_OUT_TASK = "CtuOutTask";
} }

View File

@@ -177,8 +177,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
} }
List<String> billTypeCollect = ObjectUtil.isNotEmpty(bill_type) List<String> billTypeCollect = ObjectUtil.isNotEmpty(bill_type)
? Arrays.stream(bill_type).collect(Collectors.toList()) : null; ? Arrays.stream(bill_type).collect(Collectors.toList()) : null;
IPage<IOStorInv> SS= ioStorInvMapper.queryOutBillPage(new Page<>(page.getPage()+1,page.getSize()),map,billTypeCollect); IPage<IOStorInv> result= ioStorInvMapper.queryOutBillPage(new Page<>(page.getPage()+1,page.getSize()),map,billTypeCollect);
return SS; return result;
} }
@Override @Override
@@ -1015,6 +1015,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
task_form.put("point_code1", ioStorInvDis.getStruct_code()); task_form.put("point_code1", ioStorInvDis.getStruct_code());
task_form.put("point_code2", pointCode); task_form.put("point_code2", pointCode);
task_form.put("vehicle_code", ioStorInvDis.getStoragevehicle_code()); task_form.put("vehicle_code", ioStorInvDis.getStoragevehicle_code());
task_form.put("handle_status",BaseDataEnum.IS_YES_NOT.code(""));
StOutTask stOutTask = SpringContextHolder.getBean("STOutTask"); StOutTask stOutTask = SpringContextHolder.getBean("STOutTask");
String task_id = stOutTask.create(task_form); String task_id = stOutTask.create(task_form);
//更新点位 //更新点位
@@ -1234,7 +1235,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
StructattrChangeDto changeDto = StructattrChangeDto.builder() StructattrChangeDto changeDto = StructattrChangeDto.builder()
.inv(ioStorInvDis.getIostorinv_id()) .inv(ioStorInvDis.getIostorinv_id())
.storagevehicleCode(ioStorInvDis.getStoragevehicle_code()) .storagevehicleCode(ioStorInvDis.getStoragevehicle_code())
.structCode(ioStorInvDis.getStruct_code()).taskType(task.getConfig_code()).inBound(false).build(); .structCode(ioStorInvDis.getStruct_code()).taskType(task.getConfig_code()).inBound(true).build();
iStructattrService.changeStruct(changeDto); iStructattrService.changeStruct(changeDto);
int countDis = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class) int countDis = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
.eq(IOStorInvDis::getIostorinvdtl_id, ioStorInvDis.getIostorinvdtl_id()) .eq(IOStorInvDis::getIostorinvdtl_id, ioStorInvDis.getIostorinvdtl_id())

View File

@@ -548,9 +548,7 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
task_form.put("point_code2", ioStorInvDis.get(0).getStruct_code()); task_form.put("point_code2", ioStorInvDis.get(0).getStruct_code());
task_form.put("vehicle_code", map.get("storagevehicle_code")); task_form.put("vehicle_code", map.get("storagevehicle_code"));
StInTask stInTask = SpringContextHolder.getBean("STInTask"); StInTask stInTask = SpringContextHolder.getBean("STInTask");
String task_id = stInTask.create(task_form); String task_id = stInTask.create(task_form);
//分配明细表更新任务相关数据 //分配明细表更新任务相关数据
IOStorInvDis dis = new IOStorInvDis(); IOStorInvDis dis = new IOStorInvDis();
dis.setIostorinvdis_id(map.get("iostorinvdis_id")); dis.setIostorinvdis_id(map.get("iostorinvdis_id"));

View File

@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSON;
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 lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
@@ -41,6 +42,7 @@ import java.util.stream.Collectors;
* @desc 更新库存工具类 * @desc 更新库存工具类
*/ */
@Component @Component
@Slf4j
public class UpdateIvtUtils { public class UpdateIvtUtils {
/** /**
@@ -146,6 +148,7 @@ public class UpdateIvtUtils {
if (mdPbStoragevehicleinfo == null) { if (mdPbStoragevehicleinfo == null) {
throw new BadRequestException("该载具不存在,请检查。"); throw new BadRequestException("该载具不存在,请检查。");
} }
//根据载具类型判断RCS任务类型
String acsTaskType = StatusEnum.ACS_TASK_TYPE.getR(mdPbStoragevehicleinfo.getStoragevehicle_type()); String acsTaskType = StatusEnum.ACS_TASK_TYPE.getR(mdPbStoragevehicleinfo.getStoragevehicle_type());
where.put("acs_task_type", acsTaskType); where.put("acs_task_type", acsTaskType);
where.put("vehicle_type", mdPbStoragevehicleinfo.getStoragevehicle_type()); where.put("vehicle_type", mdPbStoragevehicleinfo.getStoragevehicle_type());
@@ -212,7 +215,6 @@ public class UpdateIvtUtils {
*/ */
private void updateAddFrozenIvt(JSONObject where) { private void updateAddFrozenIvt(JSONObject where) {
// 找当前托盘物料库存 // 找当前托盘物料库存
LambdaQueryWrapper<GroupPlate> query = new QueryWrapper<GroupPlate>().lambda() LambdaQueryWrapper<GroupPlate> query = new QueryWrapper<GroupPlate>().lambda()
.eq(GroupPlate::getStoragevehicle_code, where.getString("storagevehicle_code")) .eq(GroupPlate::getStoragevehicle_code, where.getString("storagevehicle_code"))
.eq(GroupPlate::getMaterial_id, where.getString("material_id")) .eq(GroupPlate::getMaterial_id, where.getString("material_id"))
@@ -395,10 +397,12 @@ public class UpdateIvtUtils {
Sectattr sectDao = iSectattrService.getById(sectId); Sectattr sectDao = iSectattrService.getById(sectId);
String vehicleTypeList = sectDao.getExt_id(); String vehicleTypeList = sectDao.getExt_id();
if (StringUtils.isBlank(vehicleTypeList)) { if (StringUtils.isBlank(vehicleTypeList)) {
log.error("库区:【" + sectDao.getSect_code() + "】未配置允许的载具类型!");
throw new BadRequestException("库区:【" + sectDao.getSect_code() + "】未配置允许的载具类型!"); throw new BadRequestException("库区:【" + sectDao.getSect_code() + "】未配置允许的载具类型!");
} }
List<String> allowedVehicleTypes = Arrays.asList(vehicleTypeList.split(",")); List<String> allowedVehicleTypes = Arrays.asList(vehicleTypeList.split(","));
if (!allowedVehicleTypes.contains(vehicleType)) { if (!allowedVehicleTypes.contains(vehicleType)) {
log.error("该载具类型【" + mdPbStoragevehicleinfo.getStoragevehicle_name() + "】不在仓库【"+sectDao.getSect_name()+"】的出入库范围内!");
throw new BadRequestException("该载具类型【" + mdPbStoragevehicleinfo.getStoragevehicle_name() + "】不在仓库【"+sectDao.getSect_name()+"】的出入库范围内!"); throw new BadRequestException("该载具类型【" + mdPbStoragevehicleinfo.getStoragevehicle_name() + "】不在仓库【"+sectDao.getSect_name()+"】的出入库范围内!");
} }
return sectDao; return sectDao;

View File

@@ -0,0 +1 @@
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCBbWQ38mZdmOX379myX/NFn/qFIeP3kbogDiWlGtc1JNt6eDSsOEShUNj3o8Jo5Qaepyo6j4stP4WpmCAUFsdyOodzU0R60P7gFOR1OIdKyyQ2OS9J1MdNXRRuksfD1WVG+azoB+huQo2D52bcXSjnu1UDRDrXN3XXZgh1L2V/aDg+Gi9QAIsMDHtN62zKsHs4tlClHt0KORSdAxN9RjPzUFNYXfxW3dNTM9zfltoM2bgeUfG61F5EMipkAEVjDb4+Pu2BsNUamjy85eKDWA8NxDU6uuDkxLNiLx5KipLxOR+EM4/cOqRwHdEj8matpGlqBSOfOxXd6Sh5XmVStBjtAgMBAAECggEAQCbcme6IVrRGqJI2MXfluQkGv56AxGFzBBh/CEs5iJnwP8/9K6/oNJ1CLdz5q8x5b4IkKEqmDZOCyQEiRVLVIQVpxfvr4YReEOvKIWAXjzcJh+boTYwuDWapjfUrFyJaxMdUsN3ak2xhgJPeJDP45oOwK6JSGALhYhas8oi/olptl3leZs/5Z3h9UE69u80XRdhjtGyfS3AOOtT6dVcfKw6H8tmoKmx43ZfPvoV+a7hcwHO587mI1epAhYGOn81e5QoNBegiCEv9KutuZtauJuGHKcsvNh/FK8QujRJ1TFxOsMtxsJWZfxQxUuvJ0PulCpGpmkuHFNGDmV3ukJO1AQKBgQC8eiTaWgq8eCrIOi5fYtXQUmzv2e5BOhMrRyUWoB30N7GmKcdNGT5HJVXztidcBj53cNd8T6t5yTwYFrdZ5Lll7ItPAub25CSnGQU2nmceHK+46PNlQfLZRrlyeUuGYJTHVZanV+6Pneqn+6XifTa969HzpejpiJuG8iYVmcztfQKBgQCvy5ha6tBS+sIrjXL8/lrxXMDm4xT3CnCLmBqInppLwfFOgcQFzYWL6SQSJ7k3uC+xFT++VgsRLz/pQrVLsQzkY6mUF8sI7F0kevy/jAFzl9cgFn9BXu1ATyWloQIAX/UdSbzSWxIH3BW3BNOWZ0x91HUqBDAFzyLBkIns8LZ0MQKBgQCyg9oN+kS69/JFjV3IuLsdQkSt9LNGknP/hLYrNOLKIkofwOhlLOigyEsdt0SWU8+sn3Np6afXhPNnOXTWLt4vHJlh77TE2ZehsQAQGH5Athj1waZvHMSgaO1S8HHJSAcCuh0kSRPKcV8FVkNrPv+vaQGFjXoKX3o3mXja8r53nQKBgQCElQVj1GKnoo1csYJ+wgqurCikObFvG8WD0oR4cz2lUzD956qCQd2thnj45FKxbk0xvffkQhp4rG0ELJZ07qPtgCi+Ey/CnBknUUZb5GiX2HWbsrvo/oHqlYasIwFSbQx9OUaaU6sGmHscHBzD+0ZaRCjVNnFNgEoTOEJ9m5HPkQKBgQC0Kd29rQMIm5wXhIyW+bVdwmEyB/Xuq6Ch7lVVfZ6WMSoDbQZdYH3Mxw+yzjYpcS8jf/7x7mYH9Z0ggXwX7CAcRqhpjtKU800KzwQ2Cnd7Jmgq56Mn/e70J4btH73EZB6sm7vmhIuBZZlvc3oYGeJN/t/9vLwomFqrlXVw318J2A==

View File

@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"><title>欧伦可视化看板</title><link href=./static/css/app.abeef858ab8a563eff57723a1e4a5ba3.css rel=stylesheet></head><body class=clearfix><div id=app></div><script type=text/javascript src=./static/js/manifest.86a69f9de70f23f4e3b6.js></script><script type=text/javascript src=./static/js/app.1d4bffb7467a90103946.js></script></body></html> <!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"><title>欧伦可视化看板</title><link href=./static/css/app.5870e33b125883ff4a2fac9a4c13b0cf.css rel=stylesheet></head><body class=clearfix><div id=app></div><script type=text/javascript src=./static/js/manifest.1de6f50891544c3b119a.js></script><script type=text/javascript src=./static/js/app.1d4bffb7467a90103946.js></script></body></html>

View File

@@ -60,6 +60,12 @@ export const constantRouterMap = [
meta: { title: i18n.t('common.Personal_center') } meta: { title: i18n.t('common.Personal_center') }
} }
] ]
},
{
path: '/999',
meta: { title: '无授权码', noCache: true },
component: (resolve) => require(['@/views/features/licenseTip'], resolve),
hidden: true
} }
] ]

View File

@@ -66,6 +66,12 @@ service.interceptors.response.use(
Cookies.set('point', 401) Cookies.set('point', 401)
location.reload() location.reload()
}) })
} else if (code === 402) {
router.push({ path: '/999',
query: {
message: error.response.data.message
}
})
} else if (code === 403) { } else if (code === 403) {
router.push({ path: '/401' }) router.push({ path: '/401' })
} else { } else {

View File

@@ -0,0 +1,131 @@
<template>
<div class="activation-container">
<div class="activation-card">
<h1 class="title">请输入授权码激活</h1>
<p class="description">{{ tip ? tip + ',' : '' }}请输入您的授权码以激活功能</p>
<input
v-model="activationCode"
type="text"
placeholder="请输入授权码"
class="input-field"
>
<button class="activate-button" @click="handleActivate">激活</button>
</div>
</div>
</template>
<script>
import request from '@/utils/request'
export default {
name: 'LicenseTip',
data() {
return {
activationCode: '',
tip: '',
redirect: '/dashboard'
}
},
mounted() {
this.tip = this.$route.query.message
const savedCdk = localStorage.getItem('cdk')
if (savedCdk) {
this.activationCode = savedCdk
}
},
methods: {
handleActivate() {
if (this.activationCode.trim() === '') {
alert('请输入授权码')
return
}
// 暂时不对接API这里模拟激活成功
console.log('授权码:', this.activationCode)
request({
url: 'api/verify/activity',
method: 'post',
data: {
code: this.activationCode.trim()
}
}).then(res => {
console.log('激活成功:', res)
if (res.result) {
localStorage.setItem('cdk', this.activationCode.trim())
window.location.href = this.redirect
this.$message(res.message || '激活成功')
// this.$router.push({ path: '/' })
} else {
this.$message.error(res.message || '激活失败,请检查授权码')
}
}).catch(error => {
console.error('API错误:', error)
})
}
}
}
</script>
<style scoped>
.activation-container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
font-family: 'Arial', sans-serif;
}
.activation-card {
background: white;
padding: 40px;
border-radius: 15px;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
text-align: center;
width: 400px;
max-width: 90%;
}
.title {
font-size: 24px;
margin-bottom: 10px;
color: #333;
}
.description {
font-size: 16px;
margin-bottom: 20px;
color: #666;
}
.input-field {
width: 100%;
padding: 12px;
margin-bottom: 20px;
border: 1px solid #ddd;
border-radius: 8px;
font-size: 16px;
box-sizing: border-box;
transition: border-color 0.3s;
}
.input-field:focus {
border-color: #2575fc;
outline: none;
}
.activate-button {
width: 100%;
padding: 12px;
background: #2575fc;
color: white;
border: none;
border-radius: 8px;
font-size: 16px;
cursor: pointer;
transition: background 0.3s;
}
.activate-button:hover {
background: #1a5bb8;
}
</style>

View File

@@ -136,7 +136,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-permission="['admin','timing:edit','timing:del']" v-permission="['admin','timing:edit']"
:label="$t('common.Operate')" :label="$t('common.Operate')"
width="170px" width="170px"
align="center" align="center"
@@ -170,25 +170,25 @@
> >
{{ scope.row.is_pause ? $t('Scheduling.table.recover') : $t('Scheduling.table.pause') }} {{ scope.row.is_pause ? $t('Scheduling.table.recover') : $t('Scheduling.table.pause') }}
</el-button> </el-button>
<el-popover <!-- <el-popover-->
:ref="scope.row.job_id" <!-- :ref="scope.row.job_id"-->
v-permission="['admin','timing:del']" <!-- v-permission="['admin','timing:del']"-->
placement="top" <!-- placement="top"-->
width="200" <!-- width="200"-->
> <!-- >-->
<p>{{ $t('Scheduling.msg.tip1') }}</p> <!-- <p>{{ $t('Scheduling.msg.tip1') }}</p>-->
<div style="text-align: right; margin: 0"> <!-- <div style="text-align: right; margin: 0">-->
<el-button size="mini" type="text" @click="$refs[scope.row.job_id].doClose()"> <!-- <el-button size="mini" type="text" @click="$refs[scope.row.job_id].doClose()">-->
{{ $t('common.Cancel') }} <!-- {{ $t('common.Cancel') }}-->
</el-button> <!-- </el-button>-->
<el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row.job_id)"> <!-- <el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row.job_id)">-->
{{ $t('common.Confirm') }} <!-- {{ $t('common.Confirm') }}-->
</el-button> <!-- </el-button>-->
</div> <!-- </div>-->
<el-button slot="reference" type="text" size="mini"> <!-- <el-button slot="reference" type="text" size="mini">-->
{{ $t('common.Delete') }} <!-- {{ $t('common.Delete') }}-->
</el-button> <!-- </el-button>-->
</el-popover> <!-- </el-popover>-->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -236,8 +236,7 @@ export default {
delLoading: false, delLoading: false,
permission: { permission: {
add: ['admin', 'timing:add'], add: ['admin', 'timing:add'],
edit: ['admin', 'timing:edit'], edit: ['admin', 'timing:edit']
del: ['admin', 'timing:del']
}, },
rules: { rules: {
job_name: [ job_name: [
@@ -312,17 +311,17 @@ export default {
console.log(id) console.log(id)
}, },
delMethod(id) { delMethod(id) {
this.delLoading = true // this.delLoading = true
crudJob.del([id]).then(() => { // crudJob.del([id]).then(() => {
this.delLoading = false // this.delLoading = false
this.$refs[id].doClose() // this.$refs[id].doClose()
this.crud.dleChangePage(1) // this.crud.dleChangePage(1)
this.crud.delSuccessNotify() // this.crud.delSuccessNotify()
this.crud.toQuery() // this.crud.toQuery()
}).catch(() => { // }).catch(() => {
this.delLoading = false // this.delLoading = false
this.$refs[id].doClose() // this.$refs[id].doClose()
}) // })
}, },
// 显示日志 // 显示日志
doLog() { doLog() {

View File

@@ -59,17 +59,17 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="归属仓库" prop="stor_id"> <el-form-item label="归属仓库" prop="stor_code">
<el-select <el-select
v-model="form.stor_id" v-model="form.stor_code"
placeholder="" placeholder=""
style="width: 200px" style="width: 200px"
> >
<el-option <el-option
v-for="item in stors" v-for="item in stors"
:key="item.stor_id" :key="item.stor_code"
:label="item.stor_name" :label="item.stor_name"
:value="item.stor_id" :value="item.stor_code"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -270,7 +270,7 @@ export default {
sect_type_attr: [ sect_type_attr: [
{ required: true, message: '库区类型不能为空', trigger: 'blur' } { required: true, message: '库区类型不能为空', trigger: 'blur' }
], ],
stor_id: [ stor_code: [
{ required: true, message: '仓库标识不能为空', trigger: 'blur' } { required: true, message: '仓库标识不能为空', trigger: 'blur' }
], ],
capacity: [ capacity: [

View File

@@ -76,6 +76,15 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="源单编号">
<el-input
v-model="query.source_bill_code"
size="mini"
clearable
placeholder="源单编号"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="批次号"> <el-form-item label="批次号">
<el-input <el-input
v-model="query.pcsn" v-model="query.pcsn"