opt:优化混料组盘入库带任务执行逻辑
This commit is contained in:
@@ -365,7 +365,7 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
.eq("lock_type",IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
.eq("sect_code", param.getSect_code())
|
||||
;
|
||||
if(!param.getStoragevehicle_code().startsWith("VTP")){//虚拟托盘不验证空位
|
||||
if(!StrUtil.isEmptyIfStr(param.getStoragevehicle_code())&&!param.getStoragevehicle_code().startsWith("VTP")){//虚拟托盘不验证空位
|
||||
query.isNull("storagevehicle_code");
|
||||
}
|
||||
List<Structattr> list = this.list(query);
|
||||
|
||||
@@ -329,9 +329,9 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
||||
jsonMst.put("biz_date", DateUtil.now());
|
||||
// 组织明细数据
|
||||
ArrayList<HashMap> tableData = new ArrayList<>();
|
||||
HashMap<String, Object> dtl = new HashMap<>();
|
||||
// GroupPlate plateDao = plateDaoList.get(0);
|
||||
for (GroupPlate plateDao : plateDaoList) {
|
||||
HashMap<String, Object> dtl = new HashMap<>();
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(plateDao.getMaterial_code());
|
||||
dtl.put("storagevehicle_code", plateDao.getStoragevehicle_code());
|
||||
dtl.put("material_id", materDao.getMaterial_id());
|
||||
@@ -362,10 +362,11 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
||||
jsonMst1.put("stor_code", storeDao.getStor_code());
|
||||
jsonMst1.put("storagevehicle_code", groupPlateInboundDto.getVehicle_code());
|
||||
// 组织明细数据
|
||||
IOStorInvDtl dtlDao = ioStorInvDtlMapper.selectOne(
|
||||
List<IOStorInvDtl> ioStorInvDtls = ioStorInvDtlMapper.selectList(
|
||||
new QueryWrapper<IOStorInvDtl>().lambda()
|
||||
.eq(IOStorInvDtl::getIostorinv_id, iostorinv_id)
|
||||
);
|
||||
IOStorInvDtl dtlDao = ioStorInvDtls.get(0);
|
||||
// 查找分配明细
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("iostorinvdtl_id", dtlDao.getIostorinvdtl_id());
|
||||
@@ -377,7 +378,7 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
||||
// 调用分配,默认自动分配库位
|
||||
iRawAssistIStorService.divStruct(new JSONObject(jsonMst1));
|
||||
// 下发任务
|
||||
if (subTask){
|
||||
if (subTask) {
|
||||
JSONObject whereJsonTask = new JSONObject();
|
||||
whereJsonTask.put("iostorinv_id",iostorinv_id);
|
||||
whereJsonTask.put("point_code", groupPlateInboundDto.getPoint_code());
|
||||
@@ -540,10 +541,11 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
||||
Map<String, Object> jsonMst = new HashMap<>();
|
||||
jsonMst.put("point_code", whereJson.getString("point_code"));
|
||||
// 组织明细数据
|
||||
IOStorInvDtl dtlDao = ioStorInvDtlMapper.selectOne(
|
||||
List<IOStorInvDtl> ioStorInvDtls = ioStorInvDtlMapper.selectList(
|
||||
new QueryWrapper<IOStorInvDtl>().lambda()
|
||||
.eq(IOStorInvDtl::getIostorinv_id, whereJson.getString("iostorinv_id"))
|
||||
);
|
||||
IOStorInvDtl dtlDao = ioStorInvDtls.get(0);
|
||||
// 查找分配明细
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("iostorinvdtl_id",dtlDao.getIostorinvdtl_id());
|
||||
|
||||
@@ -44,8 +44,6 @@ import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvMapper;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dto.IOStorInvDisDto;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dto.IOStorInvDtlDto;
|
||||
import org.nl.wms.warehouse_manage.inventory.IStInventoryService;
|
||||
import org.nl.wms.warehouse_manage.inventory.core.enums.InventoryChangeType;
|
||||
import org.nl.wms.warehouse_manage.inventory.core.param.impl.AddInvParam;
|
||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_manage.service.dto.GroupPlateDto;
|
||||
@@ -703,28 +701,30 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
||||
.eq(IOStorInvDis::getIostorinvdtl_id,disList.get(0).getIostorinvdtl_id())
|
||||
.ne(IOStorInvDis::getWork_status,IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||
);
|
||||
final List<AddInvParam> addInvParams = new ArrayList<>();
|
||||
for (IOStorInvDis invDis : disList) {
|
||||
AddInvParam addParam = new AddInvParam();
|
||||
addParam.setPcsn(invDis.getPcsn());
|
||||
addParam.setMaterialCode(invDis.getMaterial_code());
|
||||
addParam.setStoragevehicleCode(invDis.getStoragevehicle_code());
|
||||
addParam.setUnitName(invDis.getQty_unit_name());
|
||||
addParam.setUnitId(invDis.getQty_unit_id());
|
||||
addParam.setQty(invDis.getPlan_qty());
|
||||
addInvParams.add(addParam);
|
||||
}
|
||||
iStInventoryService.changeInventory(InventoryChangeType.ADD_INV, addInvParams);
|
||||
// final List<AddInvParam> addInvParams = new ArrayList<>();
|
||||
// for (IOStorInvDis invDis : disList) {
|
||||
// AddInvParam addParam = new AddInvParam();
|
||||
// addParam.setPcsn(invDis.getPcsn());
|
||||
// addParam.setMaterialCode(invDis.getMaterial_code());
|
||||
// addParam.setStoragevehicleCode(invDis.getStoragevehicle_code());
|
||||
// addParam.setUnitName(invDis.getQty_unit_name());
|
||||
// addParam.setUnitId(invDis.getQty_unit_id());
|
||||
// addParam.setQty(invDis.getPlan_qty());
|
||||
// addInvParams.add(addParam);
|
||||
// }
|
||||
// iStInventoryService.changeInventory(InventoryChangeType.ADD_INV, addInvParams);
|
||||
// 如果分配明细全部完成则更新明细表状态
|
||||
if (countDis == 0){
|
||||
// 更新明细表状态
|
||||
final IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(disList.get(0).getIostorinvdtl_id());
|
||||
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||
ioStorInvDtlMapper.updateById(ioStorInvDtl);
|
||||
callbackStrategyPublish.callbackStrategy(ioStorInvDtl.getCallback_strategy(),ioStorInvDtl);
|
||||
for (IOStorInvDis ioStorInvDis : disList) {
|
||||
final IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(ioStorInvDis.getIostorinvdtl_id());
|
||||
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||
ioStorInvDtlMapper.updateById(ioStorInvDtl);
|
||||
callbackStrategyPublish.callbackStrategy(ioStorInvDtl.getCallback_strategy(),ioStorInvDtl);
|
||||
}
|
||||
// 查看明细是否全部完成
|
||||
int countDtl = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
|
||||
.eq(IOStorInvDtl::getIostorinv_id,ioStorInvDtl.getIostorinv_id())
|
||||
.eq(IOStorInvDtl::getIostorinv_id,disList.get(0).getIostorinv_id())
|
||||
.ne(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code("完成"))
|
||||
);
|
||||
// 如果明细全部完成则更新主表状态
|
||||
@@ -735,7 +735,7 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
||||
.set(IOStorInv::getConfirm_optid, SecurityUtils.getCurrentUserId())
|
||||
.set(IOStorInv::getConfirm_optname, SecurityUtils.getCurrentNickName())
|
||||
.set(IOStorInv::getConfirm_time, DateUtil.now())
|
||||
.eq(IOStorInv::getIostorinv_id,ioStorInvDtl.getIostorinv_id())
|
||||
.eq(IOStorInv::getIostorinv_id,disList.get(0).getIostorinv_id())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,23 +47,19 @@ public class DealPurchaseRecBillCallback implements CallbackStrategy {
|
||||
final String orderCode = param.getSource_bill_code();
|
||||
Purchasemst purchasemst = purchaseService.getOne(new LambdaQueryWrapper<Purchasemst>()
|
||||
.eq(Purchasemst::getBill_id, orderCode));
|
||||
List<IOStorInvDtl> ioStorInvDtls = ioStorInvDtlMapper.selectList(new LambdaQueryWrapper<IOStorInvDtl>()
|
||||
.eq(IOStorInvDtl::getIostorinv_id, param.getIostorinv_id()));
|
||||
List<EasAuditRequestDto.EasAuditEntryDto> entryList = new ArrayList<>();
|
||||
for (IOStorInvDtl item : ioStorInvDtls) {
|
||||
Purchasedtl purchasedtl = purchasedtlService.getOne(new LambdaQueryWrapper<Purchasedtl>()
|
||||
.eq(Purchasedtl::getBill_id, orderCode)
|
||||
.eq(Purchasedtl::getSku_code, item.getMaterial_code()));
|
||||
Purchasedtl purchasedtl = purchasedtlService.getOne(new LambdaQueryWrapper<Purchasedtl>()
|
||||
.eq(Purchasedtl::getBill_id, orderCode)
|
||||
.eq(Purchasedtl::getSku_code, param.getMaterial_code()));
|
||||
|
||||
purchasedtl.setInstock_qty(item.getPlan_qty().add(purchasedtl.getInstock_qty()));
|
||||
purchasedtlService.updateById(purchasedtl);
|
||||
purchasedtl.setInstock_qty(param.getPlan_qty().add(purchasedtl.getInstock_qty()));
|
||||
purchasedtlService.updateById(purchasedtl);
|
||||
|
||||
EasAuditRequestDto.EasAuditEntryDto easAuditEntryDto = new EasAuditRequestDto.EasAuditEntryDto();
|
||||
easAuditEntryDto.setSeq(Integer.parseInt(purchasedtl.getItem_no()));
|
||||
easAuditEntryDto.setQty(item.getPlan_qty());
|
||||
easAuditEntryDto.setEntryId(purchasedtl.getEntry_id());
|
||||
entryList.add(easAuditEntryDto);
|
||||
}
|
||||
EasAuditRequestDto.EasAuditEntryDto easAuditEntryDto = new EasAuditRequestDto.EasAuditEntryDto();
|
||||
easAuditEntryDto.setSeq(Integer.parseInt(purchasedtl.getItem_no()));
|
||||
easAuditEntryDto.setQty(param.getPlan_qty());
|
||||
easAuditEntryDto.setEntryId(purchasedtl.getEntry_id());
|
||||
entryList.add(easAuditEntryDto);
|
||||
List<Purchasedtl> list = purchasedtlService.list(new LambdaQueryWrapper<Purchasedtl>()
|
||||
.eq(Purchasedtl::getBill_id, orderCode));
|
||||
boolean flag = list.stream().anyMatch(i -> i.getQty().compareTo(i.getInstock_qty()) != 0);
|
||||
|
||||
@@ -54,6 +54,7 @@ spring:
|
||||
url: jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:wms_standardv2}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:5XXX/3GEgdUnRZd4cbVnDL6BA6P9YToc}
|
||||
# password: ${DB_PWD:123456}
|
||||
druid:
|
||||
# 基础连接池配置
|
||||
initial-size: 15
|
||||
@@ -61,14 +62,14 @@ spring:
|
||||
max-active: 40
|
||||
max-wait: 9000
|
||||
# 连接回收配置
|
||||
remove-abandoned: false # ⚠️ 生产环境建议改为 false,你之前的日志也警告了
|
||||
remove-abandoned: false # ⚠️ 生产环境建议改为 false
|
||||
remove-abandoned-timeout-millis: 180000
|
||||
# 连接检测配置
|
||||
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-borrow: true
|
||||
test-on-return: false
|
||||
validation-query: SELECT 1 # MySQL 用 SELECT 1,Oracle 才用 select 1 from dual
|
||||
|
||||
@@ -77,19 +78,19 @@ spring:
|
||||
DruidFilter,stat # 修正:stat是监控统计,wall是SQL防火墙
|
||||
log-abandoned: false
|
||||
eas:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:wms_standardv2}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${EAS_DB_USER:root}
|
||||
password: ${DB_PWD:5XXX/3GEgdUnRZd4cbVnDL6BA6P9YToc}
|
||||
driver-class-name: oracle.jdbc.OracleDriver
|
||||
url: jdbc:oracle:thin:@//192.168.100.96:1521/orcl
|
||||
username: ${EAS_DB_USER:EAS_NOBLE}
|
||||
password: ${DB_PWD:abc123}
|
||||
druid:
|
||||
initial-size: 5
|
||||
min-idle: 5
|
||||
max-active: 20
|
||||
test-while-idle: true
|
||||
validation-query: SELECT 1 # 修正:MySQL 用 SELECT 1
|
||||
validation-query: SELECT 1 FROM DUAL
|
||||
# 如果 eas 也需要监控,添加下面两行(可选)
|
||||
filters:
|
||||
DruidFilter,stat
|
||||
stat,wall
|
||||
log-abandoned: false
|
||||
redis:
|
||||
#数据库索引
|
||||
@@ -175,17 +176,19 @@ sa-token:
|
||||
lucene:
|
||||
index:
|
||||
path: D:\lucene\index
|
||||
eas:
|
||||
webservice:
|
||||
wsdl: http://192.168.100.100:8080/ormrpc/services/WSNLWQFacade?wsdl
|
||||
namespace: http://ws.eas.kingdee.com/
|
||||
inbound:
|
||||
liku-codes: LK01
|
||||
erp:
|
||||
loginUrl: http://192.168.100.100:8080/ormrpc/services/EASLogin?wsdl
|
||||
busUrl: http://192.168.100.100:8080/ormrpc/services/WSNLMESFacade?wsdl
|
||||
username: user
|
||||
password: Noble123!9
|
||||
password: test
|
||||
slnName: eas
|
||||
dcName: test
|
||||
dcName: testNL_YK
|
||||
dbType: 1
|
||||
#erp: # 正式
|
||||
# loginUrl: http://192.168.100.9:6896/ormrpc/services/EASLogin?wsdl
|
||||
# busUrl: http://192.168.100.9:6896/ormrpc/services/WSNLMESFacade?wsdl
|
||||
# username: mes_eas2
|
||||
# password: eas@123456
|
||||
# slnName: eas
|
||||
# dcName: orcl
|
||||
# dbType: 1
|
||||
|
||||
Reference in New Issue
Block a user