opt:优化前端界面及后端功能;
This commit is contained in:
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
@@ -26,9 +27,11 @@ import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdMeMaterialbaseMapper;
|
||||
import org.nl.wms.ext.service.WmsToErpService;
|
||||
import org.nl.wms.pda.ios_manage.service.PdaIosInService;
|
||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
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.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -55,7 +58,11 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class MdMeMaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialbaseMapper, MdMeMaterialbase> implements IMdMeMaterialbaseService {
|
||||
|
||||
|
||||
/**
|
||||
* 组盘记录服务
|
||||
*/
|
||||
@Autowired
|
||||
private IMdPbGroupplateService iMdPbGroupplateService;
|
||||
/**
|
||||
* 手持服务
|
||||
*/
|
||||
@@ -239,13 +246,23 @@ public class MdMeMaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialbaseMap
|
||||
if (ObjectUtil.isEmpty(mdPbStoragevehicleinfo)) {
|
||||
throw new BadRequestException("第" + i + "行,托盘编号不存在【" + m3 + "】,请检查。");
|
||||
}
|
||||
List<GroupPlate> groupPlateList = iMdPbGroupplateService.list(
|
||||
new LambdaQueryWrapper<GroupPlate>()
|
||||
.eq(GroupPlate::getStoragevehicle_code, mdPbStoragevehicleinfo.getStoragevehicle_code())
|
||||
.eq(GroupPlate::getMaterial_id, mdMeMaterialbase.getMaterial_id())
|
||||
.lt(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))
|
||||
);
|
||||
if (ObjectUtils.isNotEmpty(groupPlateList)) {
|
||||
continue;
|
||||
}
|
||||
//物料数量
|
||||
Integer m4 = Integer.parseInt(String.valueOf(list.get(6)).trim());
|
||||
JSONObject whereJson = new JSONObject();
|
||||
JSONArray dataArray = new JSONArray();
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("material_id",mdMeMaterialbase.getMaterial_id());
|
||||
item.put("material_id", mdMeMaterialbase.getMaterial_id());
|
||||
item.put("qty", m4);
|
||||
item.put("status", m4);
|
||||
dataArray.add(item);
|
||||
whereJson.put("data", dataArray);
|
||||
whereJson.put("store_id", structattr.getStor_id());
|
||||
@@ -253,25 +270,25 @@ public class MdMeMaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialbaseMap
|
||||
whereJson.put("material_code", mdMeMaterialbase.getMaterial_code());
|
||||
whereJson.put("pcsn", "");
|
||||
whereJson.put("qty", m4);
|
||||
whereJson.put("nonClear", "1");
|
||||
whereJson.put("vehicle_code", mdPbStoragevehicleinfo.getStoragevehicle_code());
|
||||
whereJson.put("groupStatus", "02");
|
||||
whereJson.put("groupStatus", IOSEnum.GROUP_PLATE_STATUS.code("入库"));
|
||||
whereJson.put("remark", "该库存通过仓库数据初始化进行仓库盘点,手动导入库存。");
|
||||
pdaIosInService.groupPlate(whereJson);
|
||||
//判断该载具编号是否已经存在库内
|
||||
Structattr struct = iStructattrService.getOne(
|
||||
new LambdaQueryWrapper<Structattr>()
|
||||
.eq(Structattr::getStoragevehicle_code,m3)
|
||||
.eq(Structattr::getStoragevehicle_code, m3)
|
||||
);
|
||||
if (struct!=null) {
|
||||
continue;
|
||||
if (struct == null) {
|
||||
iStructattrService.update(new LambdaUpdateWrapper<>(Structattr.class)
|
||||
.set(Structattr::getStoragevehicle_code, mdPbStoragevehicleinfo.getStoragevehicle_code())
|
||||
.set(Structattr::getUpdate_optid, currentUserId)
|
||||
.set(Structattr::getUpdate_optname, nickName)
|
||||
.set(Structattr::getUpdate_time, now)
|
||||
.eq(Structattr::getStruct_id, structattr.getStruct_id())
|
||||
);
|
||||
}
|
||||
iStructattrService.update(new LambdaUpdateWrapper<>(Structattr.class)
|
||||
.set(Structattr::getStoragevehicle_code, mdPbStoragevehicleinfo.getStoragevehicle_code())
|
||||
.set(Structattr::getUpdate_optid, currentUserId)
|
||||
.set(Structattr::getUpdate_optname, nickName)
|
||||
.set(Structattr::getUpdate_time, now)
|
||||
.eq(Structattr::getStruct_id, structattr.getStruct_id())
|
||||
);
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.BsrealStorattrMapper;
|
||||
import org.nl.wms.bigscreen_manage.service.BigScreenService;
|
||||
import org.nl.wms.bigscreen_manage.service.dto.IvtAnalyse;
|
||||
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;
|
||||
@@ -58,7 +59,6 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getData(List<String> stors) {
|
||||
// String storCode = "GW";
|
||||
List result = new ArrayList<>();
|
||||
if (CollectionUtils.isEmpty(stors)){
|
||||
return result;
|
||||
@@ -118,7 +118,10 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
// 空余货位
|
||||
result.put("emp_qty", emp_qty);
|
||||
// 使用货位百分比
|
||||
double use_percentage = NumberUtil.mul(NumberUtil.div(use_qty, total_qty), 100);
|
||||
double use_percentage = 0;
|
||||
if (total_qty != 0) {
|
||||
use_percentage = NumberUtil.mul(NumberUtil.div(use_qty, total_qty), 100);
|
||||
}
|
||||
result.put("use_percentage", NumberUtil.round(use_percentage, 2));
|
||||
return result;
|
||||
}
|
||||
@@ -348,7 +351,7 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
if (item.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完"))) {
|
||||
item.setBill_status("分配完");
|
||||
}
|
||||
item.setBill_type("dict.getLabel()");
|
||||
item.setBill_type("入库".equals(item.getIo_type())?StatusEnum.IOBILL_TYPE_IN.getM(item.getBill_type()):StatusEnum.IOBILL_TYPE_OUT.getM(item.getBill_type()));
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -98,15 +98,9 @@ public class GateWayServiceImpl implements IGateWayService {
|
||||
}
|
||||
if ("Task".equals(service)) {
|
||||
iSchBaseTaskService.operation(jsonObject);
|
||||
}
|
||||
if ("DeviceInfo".equals(service)) {
|
||||
|
||||
}
|
||||
if ("Device".equals(service)) {
|
||||
Assert.noNullElements(new Object[]{jsonObject.getString("devicePoint"), jsonObject.getString("status")}, "请求参数不能为空");
|
||||
if (!"1207".equals(jsonObject.getString("devicePoint")) && !"1210".equals(jsonObject.getString("devicePoint"))) {
|
||||
throw new BadRequestException("您输入的拣选位不存在,请输入1207或1210拣选位!");
|
||||
}
|
||||
RedissonUtils.lock(() -> {
|
||||
LambdaUpdateWrapper<SchBasePoint> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.set(SchBasePoint::getIs_used, "0".equals(jsonObject.getString("status")) ? 0 : 1);
|
||||
|
||||
@@ -73,10 +73,10 @@ public class PdaIosOutController {
|
||||
|
||||
|
||||
/**
|
||||
* 线边库仓物料点确认出库
|
||||
* 线边库仓物料点取货确认
|
||||
*/
|
||||
@PostMapping("/materialConfirm")
|
||||
@Log("线边库仓物料点确认出库")
|
||||
@Log("线边库仓物料点取货确认")
|
||||
public ResponseEntity<Object> materialConfirm(@RequestBody JSONObject whereJson) {
|
||||
assertNotBlankJson(whereJson, "请求参数不能为空", "sect_id", "siteCode");
|
||||
RedissonUtils.lock(() -> {
|
||||
@@ -165,6 +165,7 @@ public class PdaIosOutController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -261,10 +262,10 @@ public class PdaIosOutController {
|
||||
|
||||
|
||||
/**
|
||||
* 空载具出库确认
|
||||
* 空载具出库点确认
|
||||
*/
|
||||
@PostMapping("vehicleOutConfirm")
|
||||
@Log("空载具出库确认")
|
||||
@Log("空载具出库点确认")
|
||||
public ResponseEntity<Object> vehicleOutConfirm(@RequestBody JSONObject whereJson) {
|
||||
assertNotBlankJson(whereJson, "请求参数不能为空", "sect_id", "siteCode");
|
||||
RedissonUtils.lock(() -> {
|
||||
|
||||
@@ -72,7 +72,7 @@ public interface PdaIosOutService {
|
||||
|
||||
|
||||
/**
|
||||
* 载具出库确认
|
||||
* 线边库仓物料点取货确认
|
||||
*
|
||||
* @param whereJson {
|
||||
* storagevehicle_code: 载具码
|
||||
|
||||
@@ -101,6 +101,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
@Autowired
|
||||
private IMdPbMeasureunitService iMdPbMeasureunitService;
|
||||
|
||||
|
||||
/**
|
||||
* 载具服务
|
||||
*/
|
||||
@@ -174,7 +175,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
whereJson.put("material_code", materDao.getMaterial_code());
|
||||
//批次
|
||||
String pcsn = StringUtils.isBlank(whereJson.getString("pcsn")) ? org.nl.common.utils.DateUtil.getDateTimeFormatyMd() : whereJson.getString("pcsn");
|
||||
//判断该载具是否存在组盘信息
|
||||
//查询组盘信息,判断该载具是否存在组盘信息
|
||||
List<GroupPlate> groupPlateList = iMdPbGroupplateService.list(
|
||||
new LambdaQueryWrapper<GroupPlate>()
|
||||
.eq(GroupPlate::getStoragevehicle_code, vehicleDao.getStoragevehicle_code())
|
||||
@@ -218,11 +219,20 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
if (StringUtils.isNotBlank(whereJson.getString("siteCode"))) {
|
||||
whereJson.put("mode", IOSEnum.BIND_OR_UNBIND.code("绑定"));
|
||||
//确定点位则绑定
|
||||
pdaIosOutService.bindOrUnbind(whereJson.getString("siteCode"), whereJson.getString("vehicle_code"), whereJson.getString("mode"),false);
|
||||
pdaIosOutService.bindOrUnbind(whereJson.getString("siteCode"), whereJson.getString("vehicle_code"), whereJson.getString("mode"), false);
|
||||
}
|
||||
return whereJson;
|
||||
}
|
||||
|
||||
/**
|
||||
* whereJson:
|
||||
* data:多行明细:qty明细数量,pcsn批次,remark备注
|
||||
* vehicle_code:载具号
|
||||
* ext_code:订单号
|
||||
* groupStatus:组盘状态,非必传
|
||||
* siteCode:起点,非必传,用于触发立刻生成任务
|
||||
* nonClear:是否清空组盘,非必传,默认为true
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public JSONObject groupPlate(JSONObject whereJson) {
|
||||
@@ -249,23 +259,25 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
if (qtyIsEmpty) {
|
||||
throw new BadRequestException("物料数量不能为空");
|
||||
}
|
||||
// 判断该载具是否存在组盘信息(出库前清理)
|
||||
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.isNotEmpty(groupPlateList)) {
|
||||
mdPbGroupplateMapper.update(null, new LambdaUpdateWrapper<GroupPlate>()
|
||||
.set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))
|
||||
.set(GroupPlate::getQty, BigDecimal.ZERO)
|
||||
.set(GroupPlate::getFrozen_qty, BigDecimal.ZERO)
|
||||
.set(GroupPlate::getUpdate_time, DateUtil.now())
|
||||
.set(GroupPlate::getUpdate_optid, SecurityUtils.getCurrentUserId())
|
||||
.set(GroupPlate::getUpdate_optname, SecurityUtils.getCurrentNickName())
|
||||
.set(GroupPlate::getRemark, "载具:" + vehicleDao.getStoragevehicle_code() + "存在物料,于" + DateUtil.now() + "重新组盘,该物料强制清空出库。")
|
||||
.in(GroupPlate::getGroup_id, groupPlateList.stream().map(GroupPlate::getGroup_id).collect(Collectors.toSet()))
|
||||
if (StringUtils.isBlank(whereJson.getString("nonClear"))) {
|
||||
// 判断该载具是否存在组盘信息(出库前清理)
|
||||
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.isNotEmpty(groupPlateList)) {
|
||||
mdPbGroupplateMapper.update(null, new LambdaUpdateWrapper<GroupPlate>()
|
||||
.set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))
|
||||
.set(GroupPlate::getQty, BigDecimal.ZERO)
|
||||
.set(GroupPlate::getFrozen_qty, BigDecimal.ZERO)
|
||||
.set(GroupPlate::getUpdate_time, DateUtil.now())
|
||||
.set(GroupPlate::getUpdate_optid, SecurityUtils.getCurrentUserId())
|
||||
.set(GroupPlate::getUpdate_optname, SecurityUtils.getCurrentNickName())
|
||||
.set(GroupPlate::getRemark, "载具:" + vehicleDao.getStoragevehicle_code() + "存在物料,于" + DateUtil.now() + "重新组盘,该物料强制清空出库。")
|
||||
.in(GroupPlate::getGroup_id, groupPlateList.stream().map(GroupPlate::getGroup_id).collect(Collectors.toSet()))
|
||||
);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < dataArray.size(); i++) {
|
||||
JSONObject item = dataArray.getJSONObject(i);
|
||||
@@ -291,7 +303,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
.qty_unit_id(unitDao.getMeasure_unit_id())
|
||||
.qty_unit_name(unitDao.getUnit_name())
|
||||
.qty(new BigDecimal(qty))
|
||||
.status(StringUtils.defaultIfBlank(item.getString("groupStatus"),
|
||||
.status(StringUtils.defaultIfBlank(whereJson.getString("groupStatus"),
|
||||
IOSEnum.GROUP_PLATE_STATUS.code("组盘")))
|
||||
.ext_code(extCode)
|
||||
.create_id(SecurityUtils.getCurrentUserId())
|
||||
@@ -323,7 +335,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
if (StringUtils.isNotBlank(whereJson.getString("siteCode"))) {
|
||||
whereJson.put("mode", IOSEnum.BIND_OR_UNBIND.code("绑定"));
|
||||
//确定点位则绑定
|
||||
pdaIosOutService.bindOrUnbind(whereJson.getString("siteCode"), whereJson.getString("vehicle_code"), whereJson.getString("mode"),false);
|
||||
pdaIosOutService.bindOrUnbind(whereJson.getString("siteCode"), whereJson.getString("vehicle_code"), whereJson.getString("mode"),true);
|
||||
}
|
||||
return whereJson;
|
||||
}
|
||||
@@ -347,7 +359,11 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
.eq(BsrealStorattr::getIs_delete, IOSConstant.IS_DELETE_NO)
|
||||
.eq(BsrealStorattr::getIs_used, IOSConstant.IS_DELETE_YES).select(BsrealStorattr::getStor_name, BsrealStorattr::getStor_code, BsrealStorattr::getStor_id)
|
||||
);
|
||||
return PdaResponse.requestParamOk(storageList);
|
||||
List<SelectItemVo> selectList = new ArrayList<>();
|
||||
storageList.forEach(r ->
|
||||
selectList.add(SelectItemVo.builder().text(r.getStor_name()).value(r.getStor_code()).build())
|
||||
);
|
||||
return PdaResponse.requestParamOk(selectList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -416,6 +432,11 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
*/
|
||||
@Override
|
||||
public PdaResponse getReturnMaterial(JSONObject whereJson) {
|
||||
//库存校验
|
||||
Structattr structattr = iStructattrService.getOne(new LambdaUpdateWrapper<Structattr>().eq(Structattr::getStoragevehicle_code, whereJson.getString("search")));
|
||||
if (structattr != null) {
|
||||
throw new BadRequestException("此载具已在库内:" + structattr.getStruct_code() + "中,请检查!");
|
||||
}
|
||||
whereJson.put("status", IOSEnum.GROUP_PLATE_STATUS.code("组盘"));
|
||||
whereJson.put("vehicleCode", whereJson.getString("search"));
|
||||
whereJson.put("qty", 0);
|
||||
@@ -441,14 +462,29 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
@Transactional
|
||||
public PdaResponse confirmReturnMaterial(JSONObject whereJson) {
|
||||
//校验仓库
|
||||
Sectattr sectDao = updateIvtUtils.checkVehicleType(whereJson.getString("sect_id"),whereJson.getString("storagevehicle_code"));
|
||||
Sectattr sectDao = updateIvtUtils.checkVehicleType(whereJson.getString("sect_id"), whereJson.getString("storagevehicle_code"));
|
||||
//校验回库起点
|
||||
SchBasePoint schBasePoint = iSchBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getVehicle_code, whereJson.getString("storagevehicle_code")));
|
||||
SchBasePoint schBasePoint = iSchBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, whereJson.getString("site_code")));
|
||||
if (ObjectUtil.isEmpty(schBasePoint)) {
|
||||
throw new BadRequestException("未找到载具所在的点位信息,请检查");
|
||||
}
|
||||
List<GroupPlate> groupPlateList = iMdPbGroupplateService.list(
|
||||
new LambdaQueryWrapper<GroupPlate>()
|
||||
.eq(GroupPlate::getStoragevehicle_code, whereJson.getString("storagevehicle_code"))
|
||||
.lt(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库")).eq(GroupPlate::getQty, 0)
|
||||
);
|
||||
//处理组盘信息
|
||||
if (CollectionUtils.isNotEmpty(groupPlateList)) {
|
||||
LambdaUpdateWrapper<GroupPlate> update = new LambdaUpdateWrapper<>();
|
||||
Set<String> plateCodes = groupPlateList.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);
|
||||
}
|
||||
// 生成回库任务
|
||||
whereJson.put("site_code",schBasePoint.getPoint_code());
|
||||
whereJson.put("site_code", schBasePoint.getPoint_code());
|
||||
whereJson.put("config_code", IOSConstant.BACK_IN_TASK);
|
||||
whereJson.put("vehicle_code", whereJson.getString("storagevehicle_code"));
|
||||
whereJson.put("stor_code", sectDao.getStor_code());
|
||||
@@ -527,7 +563,12 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
@Override
|
||||
@Transactional
|
||||
public PdaResponse confirmIn(JSONObject whereJson) {
|
||||
Sectattr sectDao = updateIvtUtils.checkVehicleType(whereJson.getString("sect_id"),whereJson.getString("vehicle_code"));
|
||||
//库存校验
|
||||
Structattr structattr = iStructattrService.getOne(new LambdaUpdateWrapper<Structattr>().eq(Structattr::getStoragevehicle_code, whereJson.getString("vehicle_code")));
|
||||
if (structattr != null) {
|
||||
throw new BadRequestException("此载具已在库内:" + structattr.getStruct_code() + " 中,请检查!");
|
||||
}
|
||||
Sectattr sectDao = updateIvtUtils.checkVehicleType(whereJson.getString("sect_id"), whereJson.getString("vehicle_code"));
|
||||
whereJson.put("stor_code", sectDao.getStor_code());
|
||||
whereJson.put("sect_code", sectDao.getSect_code());
|
||||
//物料组盘入库
|
||||
@@ -537,7 +578,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, whereJson.getString("site_code")));
|
||||
if (ObjectUtil.isEmpty(schBasePoint)) {
|
||||
//自动绑定
|
||||
pdaIosOutService.bindOrUnbind(whereJson.getString("site_code"), whereJson.getString("vehicle_code"),IOSEnum.BIND_OR_UNBIND.code("绑定"),false);
|
||||
pdaIosOutService.bindOrUnbind(whereJson.getString("site_code"), whereJson.getString("vehicle_code"), IOSEnum.BIND_OR_UNBIND.code("绑定"), false);
|
||||
}
|
||||
whereJson.put("point_code", whereJson.getString("site_code"));
|
||||
// 预组织出入库单据实体
|
||||
|
||||
@@ -41,6 +41,7 @@ import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.AbstractTask;
|
||||
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.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInv;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInvDis;
|
||||
@@ -82,6 +83,9 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
*/
|
||||
@Autowired
|
||||
private ISectattrService iSectattrService;
|
||||
@Resource
|
||||
private IMdPbGroupplateService iMdPbGroupplateService;
|
||||
|
||||
/**
|
||||
* 基础物料服务
|
||||
*/
|
||||
@@ -197,12 +201,11 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
@Override
|
||||
public PdaResponse getVehicleMaterial(JSONObject whereJson) {
|
||||
List<JSONObject> list = new ArrayList<>();
|
||||
whereJson.put("status", GROUP_PLATE_STATUS.code("入库"));
|
||||
whereJson.put("status", GROUP_PLATE_STATUS.code("组盘"));
|
||||
whereJson.put("vehicleCode", whereJson.getString("search"));
|
||||
whereJson.put("qty", 0);
|
||||
whereJson.put("frozen_qty", 0);
|
||||
List<JSONObject> result = mdPbGroupplateMapper.getVehicleMaterial(whereJson);
|
||||
if (CollectionUtils.isEmpty(result)) {
|
||||
List<JSONObject> jsonObjectList = result.stream().filter(r -> r.getBigDecimal("qty").compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(jsonObjectList)) {
|
||||
throw new BadRequestException("此载具无出库确认的任务!");
|
||||
}
|
||||
list.add(result.get(0));
|
||||
@@ -321,7 +324,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 空载具出库
|
||||
* 空载具出库点确认
|
||||
* 1:托盘2料箱
|
||||
*/
|
||||
|
||||
@@ -568,7 +571,10 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
LambdaUpdateWrapper<SchBasePoint> wrapper1 = new LambdaUpdateWrapper<>();
|
||||
wrapper1.eq(SchBasePoint::getPoint_code, boundPoint.getPoint_code())
|
||||
.set(SchBasePoint::getVehicle_code, null)
|
||||
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("无货"));
|
||||
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("无货"))
|
||||
.set(SchBasePoint::getUpdate_time, DateUtil.now())
|
||||
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName());
|
||||
;
|
||||
iSchBasePointService.update(wrapper1);
|
||||
//throw new BadRequestException("当前货架:" + shelfCode + "已绑定在站点:" + boundPoint.getPoint_code() + ",请扫描站点:" + boundPoint.getPoint_code() + "进行解绑,再绑定。");
|
||||
}
|
||||
@@ -576,8 +582,6 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
.set(SchBasePoint::getVehicle_code, shelfCode)
|
||||
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("有货"))
|
||||
.set(SchBasePoint::getUpdate_time, DateUtil.now())
|
||||
.set(SchBasePoint::getIs_has_workder, BaseDataEnum.IS_YES_NOT.code("否"))
|
||||
.set(SchBasePoint::getIng_task_code, null)
|
||||
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName());
|
||||
iSchBasePointService.update(wrapper);
|
||||
}
|
||||
@@ -637,9 +641,8 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
|
||||
|
||||
/**
|
||||
* 1.库存载具绑定到出库点位
|
||||
* 2.更新组盘记录为出库
|
||||
* 3.type="1",出库确认;type="2",强制确认。
|
||||
* 1.出库点位解绑载具号
|
||||
* 2.type="1",出库确认;type="2",强制确认。
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -654,23 +657,41 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
if (ObjectUtil.isEmpty(pointDao)) {
|
||||
throw new BadRequestException("未找到载具所在的点位信息,请检查");
|
||||
}
|
||||
//预装区与商用5号线点位需自动回空
|
||||
if (pointDao.getRegion_code().equals(StatusEnum.REGION_INFO.code("商用线5号线"))) {
|
||||
//默认整出,强制确认
|
||||
whereJson.put("type", "2");
|
||||
}
|
||||
//处理组盘信息
|
||||
handleGroupPlate(whereJson);
|
||||
//预装区与商用5号线点位需自动回空
|
||||
if (pointDao.getRegion_code().equals(StatusEnum.REGION_INFO.code("商用线5号线"))) {
|
||||
//处理组盘信息
|
||||
handleGroupPlate(whereJson);
|
||||
//自动送回空载具
|
||||
autoReturnEmptyVehicle(whereJson, pointDao);
|
||||
} else {
|
||||
//载具绑定到出库点
|
||||
List<GroupPlate> groupPlateList = iMdPbGroupplateService.list(
|
||||
new LambdaQueryWrapper<GroupPlate>()
|
||||
.eq(GroupPlate::getStoragevehicle_code, whereJson.getString("storagevehicle_code"))
|
||||
.lt(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))
|
||||
);
|
||||
if (groupPlateList.stream().anyMatch(r -> r.getQty().compareTo(BigDecimal.ZERO) > 0)) {
|
||||
throw new BadRequestException("该载具:" + whereJson.getString("storagevehicle_code") + "存在拣选余料或混托物料,不能直接出库确认,请选择拣选余料回库。");
|
||||
}
|
||||
//载具解绑
|
||||
iSchBasePointService.update(new SchBasePoint(), new LambdaUpdateWrapper<>(SchBasePoint.class)
|
||||
.set(SchBasePoint::getVehicle_code, whereJson.getString("storagevehicle_code"))
|
||||
.set(SchBasePoint::getIos_id, BaseDataEnum.IS_YES_NOT.code("是"))
|
||||
.set(SchBasePoint::getVehicle_code, null)
|
||||
.set(SchBasePoint::getIos_id, BaseDataEnum.IS_YES_NOT.code("否"))
|
||||
.eq(SchBasePoint::getPoint_code, pointDao.getPoint_code())
|
||||
);
|
||||
//物料全部出库
|
||||
if (CollectionUtils.isNotEmpty(groupPlateList)) {
|
||||
LambdaUpdateWrapper<GroupPlate> update = new LambdaUpdateWrapper<>();
|
||||
Set<String> plateCodes = groupPlateList.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())
|
||||
.set(GroupPlate::getRemark, SecurityUtils.getCurrentNickName() + "于" + DateUtil.now() + "使用手持扫码确认出库。")
|
||||
.set(GroupPlate::getUpdate_optname, SecurityUtils.getCurrentNickName())
|
||||
.in(GroupPlate::getGroup_id, plateCodes);
|
||||
mdPbGroupplateMapper.update(null, update);
|
||||
}
|
||||
}
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
@@ -797,7 +818,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
throw new BadRequestException("目标站点或区域请二选一!");
|
||||
}
|
||||
//库存校验
|
||||
if (whereJson.getString("isCheckIvt").equals(BaseDataEnum.IS_YES_NOT.code("是"))) {
|
||||
if (whereJson.getString("isCheckIvt").equals(BaseDataEnum.IS_YES_NOT.code("是")) & !startPointCode.contains("A")) {
|
||||
SchBasePoint vehiclePoint = iSchBasePointService.getOne(
|
||||
new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getVehicle_code, vehicleCode)
|
||||
@@ -830,9 +851,10 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
}
|
||||
endPointCode = pointCode2;
|
||||
} else {
|
||||
List<SchBasePoint> endPointList = getRegionPoint(regionCode);
|
||||
if (CollectionUtils.isEmpty(endPointList)) {
|
||||
//入线边仓
|
||||
//获取终点
|
||||
endPointCode = iSchBasePointService.getPointCode(regionCode);
|
||||
if (StringUtils.isBlank(endPointCode)) {
|
||||
//入线边仓分配库位
|
||||
if (regionCode.equals(StatusEnum.REGION_INFO.code("预装线货架区"))) {
|
||||
JSONArray dataArray = new JSONArray();
|
||||
JSONObject item = new JSONObject();
|
||||
@@ -854,11 +876,10 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
//入库分配
|
||||
SpringContextHolder.getBean(PdaIosInServiceImpl.class).divStructNoBills(whereJson);
|
||||
return PdaResponse.requestOk();
|
||||
} else {
|
||||
throw new BadRequestException("暂无可用空位,请稍后再试。");
|
||||
}else{
|
||||
throw new BadRequestException("该区域暂无空闲货位,请及时取走该区域的物料!");
|
||||
}
|
||||
}
|
||||
endPointCode = endPointList.get(0).getPoint_code();
|
||||
}
|
||||
//生成转运任务
|
||||
JSONObject task = new JSONObject();
|
||||
@@ -879,29 +900,5 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
/**
|
||||
* regionCode 区域编号
|
||||
*/
|
||||
private List<SchBasePoint> getRegionPoint(String regionCode) {
|
||||
//终点为区域
|
||||
List<SchBasePoint> pointList;
|
||||
//特殊分配规则
|
||||
if (regionCode.equals(StatusEnum.REGION_INFO.code("预装线货架区"))) {
|
||||
pointList = iSchBasePointService.checkEndPointTask(
|
||||
StatusEnum.REGION_INFO.code("预装线货架区"),
|
||||
IOSEnum.LOCK_TYPE.code("未锁定"),
|
||||
StatusEnum.SORT_TYPE.code("升序"), null, null, "true", false);
|
||||
//可放空料架位置
|
||||
pointList = pointList.stream().filter(r -> (StatusEnum.VEHICLE_TYPE.code("空载具").equals(r.getCan_vehicle_type()))).collect(Collectors.toList());
|
||||
} else {
|
||||
pointList = iSchBasePointService.checkEndPointTask(
|
||||
regionCode,
|
||||
IOSEnum.LOCK_TYPE.code("未锁定"),
|
||||
StatusEnum.SORT_TYPE.code("降序"),
|
||||
null, null, "true", false
|
||||
);
|
||||
}
|
||||
return pointList;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,12 +27,30 @@ public enum StatusEnum {
|
||||
/**
|
||||
* 出入库单据类型退货出库
|
||||
*/
|
||||
IOBILL_TYPE_IN(ForkMap.of("生产入库", "0001", "inStorageTask", "调拨入库", "0004", "inStorageTask", "退货入库", "0002", "inStorageTask", "拣选回库",
|
||||
"13", "inStorageTask", "盘点入库", "14", "inStorageTask", "托盘入库", "30", "inStorageTask", "返检入库", "0005", "inStorageTask", "报废入库", "0003", "inStorageTask", "inStorageTask", "手工入库", "0009", "inStorageTask")),
|
||||
IOBILL_TYPE_OUT(ForkMap.of("销售出库", "20", "outStorageTask","发货出库", "1001", "outStorageTask", "生产出库", "1003", "outStorageTask", "手工出库", "1009", "outStorageTask", "领料出库", "23", "outStorageTask", "调拨出库", "1004", "outStorageTask",
|
||||
"拣选出库", "23", "conveyorOutStorageTask", "盘点出库", "24", "outStorageTask", "出库拣选", "25", "toPickPlatformTask",
|
||||
"退货出库", "26", "outStorageTask", "托盘出库", "40", "outStorageTask", "二楼CTU出库", "81", "outStorageTask", "返检出库",
|
||||
"1006", "outStorageTask", "报废出库", "1002", "outStorageTask")),
|
||||
IOBILL_TYPE_IN(ForkMap.of("生产入库", "0001", "inStorageTask",
|
||||
"调拨入库", "0004", "inStorageTask",
|
||||
"退货入库", "0002", "inStorageTask",
|
||||
"拣选回库", "13", "inStorageTask",
|
||||
"盘点入库", "14", "inStorageTask",
|
||||
"托盘入库", "30", "inStorageTask",
|
||||
"返检入库", "0005", "inStorageTask",
|
||||
"报废入库", "0003", "inStorageTask",
|
||||
"手工入库", "0009", "inStorageTask")),
|
||||
|
||||
IOBILL_TYPE_OUT(ForkMap.of("销售出库", "20", "outStorageTask",
|
||||
"发货出库", "1001", "outStorageTask",
|
||||
"生产出库", "1003", "outStorageTask",
|
||||
"手工出库", "1009", "outStorageTask",
|
||||
"领料出库", "23", "outStorageTask",
|
||||
"调拨出库", "1004", "outStorageTask",
|
||||
"拣选出库", "23", "conveyorOutStorageTask",
|
||||
"盘点出库", "24", "outStorageTask",
|
||||
"出库拣选", "25", "toPickPlatformTask",
|
||||
"退货出库", "26", "outStorageTask",
|
||||
"托盘出库", "40", "outStorageTask",
|
||||
"二楼CTU出库", "81", "outStorageTask",
|
||||
"返检出库", "1006", "outStorageTask",
|
||||
"报废出库", "1002", "outStorageTask")),
|
||||
|
||||
|
||||
IOBILL_TYPE_MOVE(ForkMap.of("移库", "50", "moveStorageTask", "异常位移库", "51", "moveStorageTask")),
|
||||
@@ -78,7 +96,7 @@ public enum StatusEnum {
|
||||
|
||||
|
||||
REGION_INFO(ForkMap.of("商用线5号线", "SYCX01", null, "预装暂存区", "YZZC01", null, "预装线货架区", "YZHJ01", null, "铜管仓", "TGCK01", null,
|
||||
"烧焊车间", "SHCJ01", null, "来料检验区", "LLJY01", null)),
|
||||
"烧焊车间", "SHCJ01", null, "来料检验区", "LLJY01", null, "空托存放区", "KTCF01", null, "两器货架区", "LQHJ01", null, "满托存放区", "MTCF01", null, "焊接货架区", "LQSH01", null, "原料入库区", "RKQ01", null)),
|
||||
|
||||
|
||||
STOCK_INFO(ForkMap.of("托盘库", "FStockPallet", null, "料箱库", "FStockId", null, "虚拟库", "FicStockId", null, "二楼ctu缓存库", "CStockId", null,
|
||||
@@ -129,6 +147,18 @@ public enum StatusEnum {
|
||||
throw new BadRequestException(this.name() + "对应编码" + code + "未定义x的数据");
|
||||
}
|
||||
|
||||
public String getM(String code) {
|
||||
for (String key : this.getCode().getKeySet()) {
|
||||
if (key.equals(code)) {
|
||||
String r = this.getCode().getM(key);
|
||||
if (StringUtils.isEmpty(r)) {
|
||||
throw new BadRequestException(this.name() + "对应编码" + code + "未定义R的数据");
|
||||
}
|
||||
return r;
|
||||
}
|
||||
}
|
||||
throw new BadRequestException(this.name() + "对应编码" + code + "未定义x的数据");
|
||||
}
|
||||
public Boolean check(String code) {
|
||||
ForkMap<String, String, String> map = this.getCode();
|
||||
return map.getKeySet().contains(code);
|
||||
|
||||
@@ -62,6 +62,13 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
|
||||
*/
|
||||
List<SchBasePoint> getPointList(SchBasePoint region);
|
||||
|
||||
|
||||
/**
|
||||
* 获取区域可用入库点位
|
||||
*/
|
||||
String getPointCode(String regionCode);
|
||||
|
||||
|
||||
/**
|
||||
* 解锁/上锁
|
||||
*
|
||||
|
||||
@@ -32,10 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -206,6 +203,70 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取区域可用入库点位
|
||||
*/
|
||||
@Override
|
||||
public String getPointCode(String regionCode) {
|
||||
String pointCode = "";
|
||||
List<SchBasePoint> pointList = checkEndPointTask(
|
||||
regionCode,
|
||||
IOSEnum.LOCK_TYPE.code("未锁定"),
|
||||
StatusEnum.SORT_TYPE.code("升序"), null, null, "true", false);
|
||||
if (regionCode.equals(StatusEnum.REGION_INFO.code("预装线货架区"))) {
|
||||
//可放空料架位置
|
||||
pointCode = pointList.stream()
|
||||
.filter(r -> StatusEnum.VEHICLE_TYPE.code("空载具").equals(r.getCan_vehicle_type()))
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new BadRequestException("该区域暂无空闲货位,请及时取走该区域的物料!"))
|
||||
.getPoint_code();
|
||||
} else if ((regionCode.equals(StatusEnum.REGION_INFO.code("预装暂存区")))) {
|
||||
Map<String, List<SchBasePoint>> pointMap = pointList.stream().collect(Collectors.groupingBy(SchBasePoint::getParent_point_code));
|
||||
if (ObjectUtils.isEmpty(pointMap)) {
|
||||
throw new RuntimeException("该暂存区已分配或放满了,请及时取走暂存区的物料!");
|
||||
}
|
||||
for (Map.Entry<String, List<SchBasePoint>> entry : pointMap.entrySet()) {
|
||||
List<SchBasePoint> filteredSortedList = entry.getValue();
|
||||
filteredSortedList.sort(Comparator.comparingInt(SchBasePoint::getCol_num).reversed());
|
||||
boolean hasEmptyVehicle = true;
|
||||
Optional<SchBasePoint> emptyList = filteredSortedList.stream()
|
||||
.filter(n -> n.getPoint_status().equals(IOSEnum.POINT_STATUS.code("无货")))
|
||||
.findFirst();
|
||||
//判断点位外层是否有空载具
|
||||
if (emptyList.isPresent()) {
|
||||
Integer sortSeq = emptyList.get().getCol_num();
|
||||
//外层存在有货的阻挡,那么这一列都不能用了
|
||||
hasEmptyVehicle = filteredSortedList.stream()
|
||||
.anyMatch(r -> r.getCol_num() < sortSeq &&
|
||||
r.getPoint_status().equals(IOSEnum.POINT_STATUS.code("有货")));
|
||||
}
|
||||
if (!hasEmptyVehicle) {
|
||||
pointCode = emptyList.get().getPoint_code();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (StringUtils.isBlank(pointCode)) {
|
||||
throw new BadRequestException("该暂存区暂无空闲货位,请检查暂存区是否存在同一列有物料阻挡未取走!");
|
||||
}
|
||||
} else {
|
||||
//默认升序
|
||||
pointCode = pointList.stream()
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new BadRequestException("该区域暂无空闲货位,请及时取走该区域的物料!"))
|
||||
.getPoint_code();
|
||||
}
|
||||
return pointCode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询没有搬运任务的空的目标点位
|
||||
*
|
||||
|
||||
@@ -144,6 +144,8 @@ public interface IOutBillService extends IService<IOStorInv> {
|
||||
*/
|
||||
void allSetPoint(JSONObject whereJson);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 出库单强制确认(更新仓位以及库存信息)
|
||||
*
|
||||
|
||||
@@ -43,6 +43,10 @@
|
||||
AND
|
||||
ios.input_time <= #{params.end_time}
|
||||
</if>
|
||||
<if test="params.source_bill_code != null">
|
||||
AND
|
||||
dtl.source_bill_code LIKE #{params.source_bill_code}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ios.iostorinv_id Desc
|
||||
</select>
|
||||
@@ -170,6 +174,10 @@
|
||||
AND
|
||||
ios.input_time <= #{params.end_time}
|
||||
</if>
|
||||
<if test="params.source_bill_code != null">
|
||||
AND
|
||||
dtl.source_bill_code LIKE #{params.source_bill_code}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ios.iostorinv_id Desc
|
||||
</select>
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
</if>
|
||||
<if test="params.status != null and params.status != ''">
|
||||
AND
|
||||
gro.status = #{params.status}
|
||||
gro.status <3
|
||||
</if>
|
||||
<if test="params.frozen_qty == 0">
|
||||
AND
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.nl.wms.basedata_manage.service.dto.StrategyStructMaterialVO;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
||||
import org.nl.wms.basedata_manage.service.dto.StructattrChangeDto;
|
||||
import org.nl.wms.pda.ios_manage.service.PdaIosOutService;
|
||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
@@ -109,8 +110,9 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
private IOStorInvDtlMapper ioStorInvDtlMapper;
|
||||
|
||||
|
||||
@Resource
|
||||
private SchBasePointMapper schBasePointMapper;
|
||||
|
||||
|
||||
|
||||
|
||||
@Resource
|
||||
private IMdPbGroupplateService iMdPbGroupPlateService;
|
||||
@@ -123,6 +125,11 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
if (StrUtil.isNotEmpty(map.get("bill_code"))) {
|
||||
map.put("bill_code", "%" + map.get("bill_code") + "%");
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(map.get("source_bill_code"))) {
|
||||
map.put("source_bill_code", "%" + map.get("source_bill_code") + "%");
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(map.get("is_upload"))) {
|
||||
map.put("is_upload", map.get("is_upload"));
|
||||
}
|
||||
@@ -170,7 +177,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
}
|
||||
List<String> billTypeCollect = ObjectUtil.isNotEmpty(bill_type)
|
||||
? Arrays.stream(bill_type).collect(Collectors.toList()) : null;
|
||||
return ioStorInvMapper.queryOutBillPage(new Page<>(page.getPage()+1,page.getSize()),map,billTypeCollect);
|
||||
IPage<IOStorInv> SS= ioStorInvMapper.queryOutBillPage(new Page<>(page.getPage()+1,page.getSize()),map,billTypeCollect);
|
||||
return SS;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -999,7 +1007,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
}
|
||||
for (IOStorInvDis ioStorInvDis : ioStorInvDisList) {
|
||||
//获取终点
|
||||
String pointCode = getPointCode(regionCode);
|
||||
String pointCode = iSchBasePointService.getPointCode(regionCode);
|
||||
//创建任务
|
||||
JSONObject task_form = new JSONObject();
|
||||
task_form.put("task_type", "STOutTask");
|
||||
@@ -1015,7 +1023,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
.set(SchBasePoint::getVehicle_code, ioStorInvDis.getStoragevehicle_code())
|
||||
.set(SchBasePoint::getIs_has_workder, BaseDataEnum.IS_YES_NOT.code("是"))
|
||||
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("有货"));
|
||||
schBasePointMapper.update(new SchBasePoint(), wrapper);
|
||||
iSchBasePointService.update(new SchBasePoint(), wrapper);
|
||||
//分配明细表更新任务相关数据
|
||||
IOStorInvDis dis = new IOStorInvDis();
|
||||
dis.setIostorinvdis_id(ioStorInvDis.getIostorinvdis_id());
|
||||
@@ -1027,50 +1035,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
}
|
||||
}
|
||||
|
||||
private String getPointCode(String regionCode) {
|
||||
String pointCode = "";
|
||||
List<SchBasePoint> pointList = schBasePointMapper.selectList(new LambdaQueryWrapper<>(SchBasePoint.class)
|
||||
.eq(SchBasePoint::getRegion_code, regionCode)
|
||||
.eq(SchBasePoint::getIs_used, BaseDataEnum.IS_YES_NOT.code("是")));
|
||||
if (regionCode.contains("YZZC01")) {
|
||||
Map<String, List<SchBasePoint>> pointMap = pointList.stream().collect(Collectors.groupingBy(SchBasePoint::getParent_point_code));
|
||||
if (ObjectUtils.isEmpty(pointMap)) {
|
||||
throw new RuntimeException("该暂存区已分配或放满了,请及时取走暂存区的物料!");
|
||||
}
|
||||
|
||||
for (Map.Entry<String, List<SchBasePoint>> entry : pointMap.entrySet()) {
|
||||
List<SchBasePoint> filteredSortedList = entry.getValue();
|
||||
filteredSortedList.sort(Comparator.comparingInt(SchBasePoint::getCol_num).reversed());
|
||||
boolean hasEmptyVehicle = true;
|
||||
Optional<SchBasePoint> emptyList = filteredSortedList.stream()
|
||||
.filter(n -> n.getPoint_status().equals(IOSEnum.POINT_STATUS.code("无货")))
|
||||
.findFirst();
|
||||
//判断点位外层是否有空载具
|
||||
if (emptyList.isPresent()) {
|
||||
Integer sortSeq = emptyList.get().getCol_num();
|
||||
//外层存在有货的阻挡,那么这一列都不能用了
|
||||
hasEmptyVehicle = filteredSortedList.stream()
|
||||
.anyMatch(r -> r.getCol_num() < sortSeq &&
|
||||
r.getPoint_status().equals(IOSEnum.POINT_STATUS.code("有货")));
|
||||
}
|
||||
if (!hasEmptyVehicle) {
|
||||
pointCode = emptyList.get().getPoint_code();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (StringUtils.isBlank(pointCode)) {
|
||||
throw new BadRequestException("该暂存区暂无空闲货位,请检查暂存区是否存在同一列有物料阻挡未取走!");
|
||||
}
|
||||
} else {
|
||||
pointCode = pointList.stream()
|
||||
.filter(r -> IOSEnum.POINT_STATUS.code("无货").equals(r.getPoint_status()))
|
||||
.sorted(Comparator.comparing(SchBasePoint::getRow_num))
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new BadRequestException("该暂存区暂无空闲货位,请及时取走暂存区的物料!"))
|
||||
.getPoint_code();
|
||||
}
|
||||
return pointCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void confirm(JSONObject whereJson) {
|
||||
@@ -1124,7 +1089,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
iStructattrService.updateStatusByCode("1",finish_map);
|
||||
|
||||
//库存绑定到出库点。
|
||||
schBasePointMapper.update(new SchBasePoint(),new LambdaUpdateWrapper<>(SchBasePoint.class)
|
||||
iSchBasePointService.update(new SchBasePoint(),new LambdaUpdateWrapper<>(SchBasePoint.class)
|
||||
.set(SchBasePoint::getVehicle_code,ioStorInvDis.getStoragevehicle_code())
|
||||
.set(SchBasePoint::getIos_id,ioStorInvDis.getIostorinvdis_id())
|
||||
.eq(SchBasePoint::getPoint_code,ioStorInvDis.getPoint_code())
|
||||
@@ -1241,6 +1206,12 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv>
|
||||
} else {
|
||||
wrapper.set(SchBasePoint::getIs_has_workder, BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
}
|
||||
wrapper.eq(SchBasePoint::getPoint_code, task.getPoint_code2())
|
||||
.set(SchBasePoint::getIos_id, null)
|
||||
.set(SchBasePoint::getUpdate_time, DateUtil.now())
|
||||
.set(SchBasePoint::getUpdate_id, SecurityUtils.getCurrentUserId())
|
||||
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName());
|
||||
iSchBasePointService.update(wrapper);
|
||||
//绑定载具
|
||||
pdaIosOutService.bindOrUnbind(task.getPoint_code2(), task.getVehicle_code(), IOSEnum.BIND_OR_UNBIND.code("绑定"),false);
|
||||
//是否处理单据及分配信息
|
||||
|
||||
@@ -102,6 +102,9 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
if (!ObjectUtil.isEmpty(bill_code)) {
|
||||
map.put("bill_code", "%" + bill_code + "%");
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(MapUtil.getStr(whereJson, "source_bill_code"))) {
|
||||
map.put("source_bill_code", "%" + MapUtil.getStr(whereJson, "source_bill_code") + "%");
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(pcsn)) {
|
||||
@@ -194,7 +197,7 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
//判断该载具编号是否已经存在库内
|
||||
Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<>(Structattr.class).eq(Structattr::getStoragevehicle_code,row.get("storagevehicle_code")));
|
||||
if (ObjectUtil.isNotEmpty(structattr)) {
|
||||
throw new BadRequestException("载具编码:" + row.get("storagevehicle_code") + "已存在库内,请对数据进行核实!");
|
||||
throw new BadRequestException("载具编码:" + row.get("storagevehicle_code") + ",已存在库内,请对数据进行核实!");
|
||||
}
|
||||
ioStorInvDtlMapper.insert(ioStorInvDtl.toJavaObject(IOStorInvDtl.class));
|
||||
JSONObject dis = new JSONObject();
|
||||
@@ -293,7 +296,7 @@ public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOSt
|
||||
//判断该载具编号是否已经存在库内
|
||||
Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<>(Structattr.class).eq(Structattr::getStoragevehicle_code,row.get("storagevehicle_code")));
|
||||
if (ObjectUtil.isNotEmpty(structattr)) {
|
||||
throw new BadRequestException("载具编码:" + row.get("storagevehicle_code") + "已存在库内,请对数据进行核实!");
|
||||
throw new BadRequestException("载具编码:" + row.get("storagevehicle_code") + ",已存在库内,请对数据进行核实!");
|
||||
}
|
||||
|
||||
ioStorInvDtlMapper.insert(ioStorInvDtl.toJavaObject(IOStorInvDtl.class));
|
||||
|
||||
@@ -9,10 +9,11 @@ spring:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${DB_HOST:192.168.81.251}:${DB_PORT:3306}/${DB_NAME:wms_oulun}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:wms_oulun}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
#url: jdbc:mysql://${DB_HOST:192.168.81.251}:${DB_PORT:3306}/${DB_NAME:wms_oulun}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:wms_oulun_test}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:P@ssw0rd.}
|
||||
#password: ${DB_PWD:P@ssw0rd.}
|
||||
password: ${DB_PWD:123456}
|
||||
# 初始连接数
|
||||
initial-size: 15
|
||||
# 最小连接数
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
server:
|
||||
port: 8018
|
||||
#配置数据源
|
||||
spring:
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
allow-circular-references: true
|
||||
datasource:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3302}/${DB_NAME:wms_test}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:wms_oulun}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:Noble123456.}
|
||||
# 初始连接数
|
||||
initial-size: 15
|
||||
# 最小连接数
|
||||
min-idle: 25
|
||||
# 最大连接数
|
||||
max-active: 40
|
||||
# 是否自动回收超时连接
|
||||
remove-abandoned: true
|
||||
# 超时时间(以秒数为单位)
|
||||
remove-abandoned-timeout: 180
|
||||
# 获取连接超时时间
|
||||
max-wait: 9000
|
||||
# 连接有效性检测时间
|
||||
time-between-eviction-runs-millis: 20000
|
||||
# 连接在池中最小生存的时间
|
||||
min-evictable-idle-time-millis: 300000
|
||||
# 连接在池中最大生存的时间
|
||||
max-evictable-idle-time-millis: 900000
|
||||
# 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
|
||||
test-while-idle: true
|
||||
# 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
|
||||
test-on-borrow: false
|
||||
# 是否在归还到池中前进行检验
|
||||
test-on-return: false
|
||||
# 检测连接是否有效
|
||||
validation-query: select 1 from dual
|
||||
# 配置监控统计
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
reset-enable: false
|
||||
allow: 127.0.0.1
|
||||
filters:
|
||||
DruidFilter,stat
|
||||
log-abandoned: false
|
||||
keep-alive: true
|
||||
keep-alive-between-time-millis: 20000
|
||||
|
||||
redis:
|
||||
#数据库索引
|
||||
database: ${REDIS_DB:1}
|
||||
#host: ${REDIS_HOST:127.0.0.1}
|
||||
host: ${REDIS_HOST:localhost}
|
||||
port: ${REDIS_PORT:6379}
|
||||
password: ${REDIS_PWD:}
|
||||
#连接超时时间
|
||||
timeout: 5000
|
||||
redisson:
|
||||
config: |
|
||||
threads: 4
|
||||
nettyThreads: 4
|
||||
singleServerConfig:
|
||||
connectionMinimumIdleSize: 8
|
||||
connectionPoolSize: 8
|
||||
address: redis://127.0.0.1:6379
|
||||
idleConnectionTimeout: 10000
|
||||
timeout: 3000
|
||||
|
||||
# 登录相关配置
|
||||
login:
|
||||
# 登录缓存
|
||||
cache-enable: true
|
||||
# 是否限制单用户登录
|
||||
single-login: false
|
||||
# 验证码
|
||||
login-code:
|
||||
# 验证码类型配置 查看 LoginProperties 类
|
||||
code-type: arithmetic
|
||||
# 登录图形验证码有效时间/分钟
|
||||
expiration: 2
|
||||
# 验证码高度
|
||||
width: 111
|
||||
# 验证码宽度
|
||||
heigth: 36
|
||||
# 内容长度
|
||||
length: 2
|
||||
# 字体名称,为空则使用默认字体
|
||||
font-name:
|
||||
# 字体大小
|
||||
font-size: 25
|
||||
|
||||
#jwt
|
||||
jwt:
|
||||
header: Authorization
|
||||
# 令牌前缀
|
||||
token-start-with: Bearer
|
||||
# 必须使用最少88位的Base64对该令牌进行编码
|
||||
base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI=
|
||||
# 令牌过期时间 此处单位/毫秒 ,默认4小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
|
||||
token-validity-in-seconds: 14400000
|
||||
# 在线用户key
|
||||
online-key: online-token-
|
||||
# 验证码
|
||||
code-key: code-key-
|
||||
# token 续期检查时间范围(默认30分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
|
||||
detect: 1800000
|
||||
# 续期时间范围,默认1小时,单位毫秒
|
||||
renew: 3600000
|
||||
|
||||
sa-token:
|
||||
# token 名称 (同时也是cookie名称)
|
||||
token-name: Authorization
|
||||
# token 有效期,单位s 默认30天, -1代表永不过期
|
||||
timeout: 2592000
|
||||
# token 临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
||||
activity-timeout: -1
|
||||
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
|
||||
is-concurrent: true
|
||||
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
|
||||
is-share: false
|
||||
# token风格
|
||||
token-style: random-128
|
||||
# 是否输出操作日志
|
||||
is-log: false
|
||||
jwt-secret-key: opsjajisdnnca0sdkksdfaaasdfwwq
|
||||
# token 前缀
|
||||
token-prefix:
|
||||
is-read-cookie: false
|
||||
is-print: false
|
||||
lucene:
|
||||
index:
|
||||
path: D:\lms\lucene1\index
|
||||
@@ -109,4 +109,4 @@ mybatis-plus:
|
||||
|
||||
lucene:
|
||||
index:
|
||||
path: D:\lucene\index
|
||||
path: D:\lucene1\index
|
||||
|
||||
Reference in New Issue
Block a user