rev:半成品仓储

This commit is contained in:
2023-06-26 16:00:03 +08:00
parent 50bd42e7d1
commit a3ee247657
21 changed files with 104 additions and 51 deletions

View File

@@ -28,6 +28,7 @@ public class MdPbStoragevehicleext implements Serializable {
/**
* 载具编码
*/
@TableId
private String storagevehicle_id;
/**
* 载具编码

View File

@@ -39,6 +39,7 @@ public class StructattrController {
@ApiOperation("查询仓位")
//@PreAuthorize("@el.check('structattr:list')")
public ResponseEntity<Object> queryAll(StructarrQuery query, PageQuery page) {
page.setSort("struct_code ASC");
Page<StIvtStructattr> list = ivtStructattrService.page(page.build(StIvtStructattr.class), query.build());
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
}

View File

@@ -107,7 +107,7 @@ public class StIvtCheckdtlCp implements Serializable {
/**
* 是否已下发
*/
private String is_down;
private Boolean is_down;
/**
* 盘点数量

View File

@@ -82,14 +82,7 @@ public class StIvtCheckdtlCpServiceImpl extends ServiceImpl<StIvtCheckdtlCpMappe
if (ObjectUtil.isEmpty(structDao)) throw new BadRequestException("仓位不存在或未启用!");
row.setStruct_name(structDao.getStruct_name());
// 获取载具信息
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getOne(
new QueryWrapper<MdPbStoragevehicleinfo>().lambda()
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, row.getStoragevehicle_code())
);
row.setStoragevehicle_id(vehicleDao.getStoragevehicle_id());
row.setStoragevehicle_code(vehicleDao.getStoragevehicle_code());
row.setStoragevehicle_id(IdUtil.getStringId()); // 随机生成
row.setStatus(CHECKEnum.DTL_STATUS.code("生成"));
this.save(row);

View File

@@ -544,7 +544,7 @@ public class StIvtCheckmstCpServiceImpl extends ServiceImpl<StIvtCheckmstCpMappe
.build();
BussEventMulticaster.Publish(event);
dtlDao.setIs_down("1");
dtlDao.setIs_down(true);
iStIvtCheckdtlCpService.updateById(dtlDao);
}

View File

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.nl.common.utils.IdUtil;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleinfoService;
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleinfo;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtSectattrService;
@@ -89,17 +90,12 @@ public class StIvtMoreorlessdtlCpServiceImpl extends ServiceImpl<StIvtMoreorless
row.setStruct_name(structDao.getStruct_name());
// 获取载具信息
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getOne(
new QueryWrapper<MdPbStoragevehicleinfo>().lambda()
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, row.getStoragevehicle_code())
.eq(MdPbStoragevehicleinfo::getIs_used, true)
);
String storagevehicle_code = row.getStoragevehicle_code();
if (ObjectUtil.isEmpty(storagevehicle_code)) {
storagevehicle_code = CodeUtil.getNewCode("VEHICCLE_CODE_CDMTP");
}
if (ObjectUtil.isEmpty(vehicleDao)) throw new BadRequestException("载具不存在!");
row.setStoragevehicle_id(vehicleDao.getStoragevehicle_id());
row.setStoragevehicle_code(vehicleDao.getStoragevehicle_code());
row.setStoragevehicle_type(vehicleDao.getStoragevehicle_type());
row.setStoragevehicle_code(storagevehicle_code);
row.setStatus(MLEnum.DTL_STATUS.code("生成"));
this.save(row);

View File

@@ -181,7 +181,7 @@ public class StIvtMoreorlessmstCpServiceImpl extends ServiceImpl<StIvtMoreorless
ivt.setCanuse_qty(NumberUtil.sub(canuse_qty, mol_qty));
ivt.setIvt_qty(NumberUtil.sub(ivt_qty, mol_qty));
// 更新载具扩展属性重量
/* // 更新载具扩展属性重量
MdPbStoragevehicleext vehicleDao = iMdPbStoragevehicleextService.getOne(
new QueryWrapper<MdPbStoragevehicleext>().lambda()
.eq(MdPbStoragevehicleext::getStoragevehicle_code, dtl.getStoragevehicle_code())
@@ -189,7 +189,7 @@ public class StIvtMoreorlessmstCpServiceImpl extends ServiceImpl<StIvtMoreorless
if (ObjectUtil.isNotEmpty(vehicleDao)) {
vehicleDao.setStorage_qty(NumberUtil.sub(vehicleDao.getStorage_qty(),mol_qty));
iMdPbStoragevehicleextService.updateById(vehicleDao);
}
}*/
// 判断是否有箱
MdPbBucketrecord buckDao = iMdPbBucketrecordService.getOne(
@@ -218,14 +218,14 @@ public class StIvtMoreorlessmstCpServiceImpl extends ServiceImpl<StIvtMoreorless
.eq(MdPbBucketrecord::getMaterial_id, dtl.getMaterial_id())
);
// 更新载具扩展属性 - 释放载具对应物料关系 清空数量
/* // 更新载具扩展属性 - 释放载具对应物料关系 清空数量
iMdPbStoragevehicleextService.update(
new MdPbStoragevehicleext()
.setMaterial_id("")
.setStorage_qty(BigDecimal.valueOf(0)),
new QueryWrapper<MdPbStoragevehicleext>().lambda()
.eq(MdPbStoragevehicleext::getStoragevehicle_code,dtl.getStoragevehicle_code())
);
);*/
// 更新货位 -- 清除载具号
structattrService.update(
@@ -271,7 +271,7 @@ public class StIvtMoreorlessmstCpServiceImpl extends ServiceImpl<StIvtMoreorless
struct_jo.setStoragevehicle_code(dtl.getStoragevehicle_code());
structattrService.updateById(struct_jo);
// 更新载具对应物料关系、数量
/* // 更新载具对应物料关系、数量
MdPbStoragevehicleext vehicleDao = iMdPbStoragevehicleextService.getOne(
new QueryWrapper<MdPbStoragevehicleext>().lambda()
.eq(MdPbStoragevehicleext::getStoragevehicle_code, dtl.getStoragevehicle_code())
@@ -280,7 +280,7 @@ public class StIvtMoreorlessmstCpServiceImpl extends ServiceImpl<StIvtMoreorless
vehicleDao.setStorage_qty(mol_qty);
vehicleDao.setMaterial_id(dtl.getMaterial_id());
iMdPbStoragevehicleextService.updateById(vehicleDao);
}
}*/
// 判断是否有箱
if (ObjectUtil.isNotEmpty(dtl.getBucketunique())) {
@@ -350,7 +350,7 @@ public class StIvtMoreorlessmstCpServiceImpl extends ServiceImpl<StIvtMoreorless
}
}
// 更新载具扩展属性 - 数量
/* // 更新载具扩展属性 - 数量
MdPbStoragevehicleext vehicleDao = iMdPbStoragevehicleextService.getOne(
new QueryWrapper<MdPbStoragevehicleext>().lambda()
.eq(MdPbStoragevehicleext::getStoragevehicle_code, dtl.getStoragevehicle_code())
@@ -358,7 +358,7 @@ public class StIvtMoreorlessmstCpServiceImpl extends ServiceImpl<StIvtMoreorless
if (ObjectUtil.isNotEmpty(vehicleDao)) {
vehicleDao.setStorage_qty(NumberUtil.add(vehicleDao.getStorage_qty(), dtl.getMol_qty()));
iMdPbStoragevehicleextService.updateById(vehicleDao);
}
}*/
}
//更新明细状态

View File

@@ -3,6 +3,7 @@ package org.nl.wms.storage_manage.semimanage.controller.iostorInv;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -10,6 +11,8 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.common.anno.Log;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleextService;
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleext;
import org.nl.wms.storage_manage.semimanage.service.iostorInv.IStIvtIostorinvBcpService;
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvBcp;
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dto.BcpIostorInvQuery;
@@ -18,6 +21,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Map;
@@ -39,6 +43,9 @@ public class StIvtIostorinvBcpController {
@Autowired
private IStIvtIostorinvBcpService stIvtIostorinvBcpService;
@Autowired
private IMdPbStoragevehicleextService iMdPbStoragevehicleextService; // 载具扩展属性信息表服务
@GetMapping
@Log("查询入库单据")
@ApiOperation("查询入库单据")
@@ -62,6 +69,17 @@ public class StIvtIostorinvBcpController {
stIvtIostorinvBcpService.update(new UpdateWrapper<StIvtIostorinvBcp>()
.set("is_delete","1")
.in("iostorinv_id",ids));
StIvtIostorinvBcp mst = stIvtIostorinvBcpService.getById(ids);
// 更新载具扩展属性 - 释放载具对应物料关系 清空数量
iMdPbStoragevehicleextService.update(
new MdPbStoragevehicleext()
.setMaterial_id("")
.setStorage_qty(BigDecimal.valueOf(0)),
new QueryWrapper<MdPbStoragevehicleext>().lambda()
.eq(MdPbStoragevehicleext::getStoragevehicle_code,mst.getStoragevehicle_code())
);
}
return new ResponseEntity<>(HttpStatus.OK);
}

View File

@@ -385,6 +385,7 @@ public class StIvtCheckmstBcpServiceImpl extends ServiceImpl<StIvtCheckmstBcpMap
dtl_jo.put("source_bill_type", jo_mst.getCheck_type());
dtl_jo.put("source_bill_code", jo_mst.getCheck_code());
dtl_jo.put("source_bill_table", "ST_IVT_CheckMst_YL");
dtl_jo.put("storagevehicle_code", dtl.getStoragevehicle_code());
JSONArray mol_rows = new JSONArray();
mol_rows.add(dtl_jo);
mol_jo.put("tableData", mol_rows);

View File

@@ -27,6 +27,8 @@ import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.masterdata_manage.service.material.IMdMeMaterialbaseService;
import org.nl.wms.masterdata_manage.service.material.dao.MdMeMaterialbase;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleextService;
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleext;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtSectattrService;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
@@ -53,6 +55,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
@@ -86,7 +89,8 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
private IMdMeMaterialbaseService materialbaseService;
@Autowired
private IStIvtStructivtflowService iStIvtStructivtflowService; // 库存变动服务
@Autowired
protected IMdPbStoragevehicleextService iMdPbStoragevehicleextService; // 载具扩展属性信息表服务
@Override
public Object queryDtl(BcpIostorInvQuery query, PageQuery pageQuery) {
@@ -222,6 +226,15 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
.eq(SchBaseTask::getTask_id, mst.getTask_id())
);
// 更新载具扩展属性 - 释放载具对应物料关系 清空数量
iMdPbStoragevehicleextService.update(
new MdPbStoragevehicleext()
.setMaterial_id("")
.setStorage_qty(BigDecimal.valueOf(0)),
new QueryWrapper<MdPbStoragevehicleext>().lambda()
.eq(MdPbStoragevehicleext::getStoragevehicle_code,mst.getStoragevehicle_code())
);
return null;
}

View File

@@ -25,6 +25,10 @@ import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleextService;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleinfoService;
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleext;
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleinfo;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtSectattrService;
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtSectattr;
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
@@ -86,7 +90,10 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
private ISchBaseTaskService iSchBaseTaskService; // 任务表服务
@Autowired
private IStIvtStructivtflowService iStIvtStructivtflowService; // 库存变动服务
@Autowired
protected IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService; // 载具信息
@Autowired
protected IMdPbStoragevehicleextService iMdPbStoragevehicleextService; // 载具扩展属性信息表服务
@Override
public Object queryDtl(BcpIostorInvQuery query, PageQuery pageQuery) {
@@ -140,8 +147,29 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
mst.setBase_bill_code(row.getString("base_bill_code"));
mst.setQty_unit_name(row.getString("base_unit_name"));
mst.setUnit_weight(row.getBigDecimal("unit_weight"));
mst.setStoragevehicle_code(row.getString("storagevehicle_code"));
mst.setStoragevehicle_id(row.getString("storagevehicle_id"));
// 载具信息
{
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getOne(
new QueryWrapper<MdPbStoragevehicleinfo>().lambda()
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, row.getString("storagevehicle_code"))
);
if (ObjectUtil.isEmpty(vehicleDao)) throw new BadRequestException("载具不存在!");
mst.setStoragevehicle_code(vehicleDao.getStoragevehicle_code());
mst.setStoragevehicle_id(vehicleDao.getStoragevehicle_id());
// 更新载具对应物料关系、数量
MdPbStoragevehicleext vehicleExtDao = iMdPbStoragevehicleextService.getOne(
new QueryWrapper<MdPbStoragevehicleext>().lambda()
.eq(MdPbStoragevehicleext::getStoragevehicle_code, row.getString("storagevehicle_code"))
);
if (ObjectUtil.isNotEmpty(vehicleDao)) {
vehicleExtDao.setStorage_qty(mst.getPlan_qty());
vehicleExtDao.setMaterial_id(mst.getMaterial_id());
iMdPbStoragevehicleextService.updateById(vehicleExtDao);
}
}
}
@Override

View File

@@ -122,6 +122,7 @@
attr.struct_name,
attr.sect_code,
attr.sect_name,
attr.stor_name,
attr.storagevehicle_code
FROM
st_ivt_structivt_bcp ivt