opt:越南富佳优化

This commit is contained in:
2025-10-27 15:16:57 +08:00
parent 7fa6959b48
commit 4a56288de9
10 changed files with 60 additions and 35 deletions

View File

@@ -28,7 +28,7 @@ public interface WmsToErpService {
JSONObject instorinfoToErp(JSONObject whereJson);
/**
* 物料同步
* 出库单据回传
* @param whereJson {
*
* "order_code": "3000000056",

View File

@@ -344,6 +344,7 @@ public class ErpToWmsServiceImpl implements ErpToWmsService {
jsonDtl.setCreate_time(DateUtil.now());
jsonDtl.setFloor_code(json.getString("floor_code"));
jsonDtl.setOut_code(json.getString("hoist_code"));
jsonDtl.setIs_merge("0");
dtlArr.add(jsonDtl);
}
//保存单据表

View File

@@ -28,7 +28,7 @@ public enum StatusEnum {
/**
* 出入库单据类型退货出库
*/
IOBILL_TYPE_IN(ForkMap.of("生产入库", "0001", "StInTask", "手工入库", "0009", "StInTask")),
IOBILL_TYPE_IN(ForkMap.of("生产入库", "0001", "StInTask", "手工入库", "0009", "StInTask", "剩料回库", "0010", "StInTask")),
IOBILL_TYPE_OUT(ForkMap.of("用料出库", "1001", "StOutTask", "手工出库", "1009", "StOutTask")),

View File

@@ -3,7 +3,9 @@ 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.update.LambdaUpdateWrapper;
import org.apache.commons.collections4.CollectionUtils;
import org.nl.common.exception.BadRequestException;
import org.nl.config.language.LangProcess;
import org.nl.common.utils.SecurityUtils;
@@ -12,6 +14,7 @@ import org.nl.language.LangBehavior;
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
import org.nl.wms.sch_manage.enums.TaskStatus;
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
import org.nl.wms.sch_manage.service.dao.SchBaseRegion;
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;
@@ -25,6 +28,7 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author: Liuxy
@@ -152,6 +156,10 @@ public class StOutTask extends AbstractTask {
.eq(SchBaseTask::getTask_id,taskObj.getTask_id())
);
List<IOStorInvDis> ioStorInvDisList = ioStorInvDisMapper.selectList(new LambdaQueryWrapper<IOStorInvDis>()
.eq(IOStorInvDis::getTask_id, taskObj.getTask_id()));
//分配表清除任务
ioStorInvDisMapper.update(new IOStorInvDis(),new LambdaUpdateWrapper<>(IOStorInvDis.class)
.set(IOStorInvDis::getTask_id,null)
@@ -161,6 +169,12 @@ public class StOutTask extends AbstractTask {
.eq(IOStorInvDis::getTask_id,taskObj.getTask_id())
);
if (CollectionUtils.isNotEmpty(ioStorInvDisList)) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("iostorinv_id", ioStorInvDisList.get(0).getIostorinv_id());
outBillService.allCancel(jsonObject);
}
// 更新任务状态
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark("已取消");

View File

@@ -199,7 +199,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
@Override
public List<Map> dynamicTableEnum(String table, String label, String value) {
if (StringUtils.isEmpty(table)||StringUtils.isEmpty(label)||StringUtils.isEmpty(value)){
throw new BadRequestException(LangBehavior.language("system_manage","param_empty"));
throw new BadRequestException(LangBehavior.language("system_manage.param_empty"));
}
return this.sysDictMapper.dynamicTableEnum(table,label,value);
}

View File

@@ -29,7 +29,7 @@ public enum IOSEnum {
BILL_STATUS(MapOf.of("生成","10", "分配中", "20", "分配完", "30", "完成", "99")),
// 入库业务类型
BILL_TYPE(MapOf.of("生产入库","0001", "手工入库", "0009")),
BILL_TYPE(MapOf.of("生产入库","0001", "手工入库", "0009", "剩料回库", "0010")),
//入库分配明细状态
INBILL_DIS_STATUS(MapOf.of("未生成", "00", "生成", "01", "执行中", "02", "完成", "99")),

View File

@@ -318,7 +318,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
// 校验计划数量不能为零
double plan_qty = row.getDoubleValue("qty");
if (Double.compare(plan_qty, 0.0) == 0) {
throw new BadRequestException(LangBehavior.language("warehouse_manage", "outbill_qty_zero"));
throw new BadRequestException(LangBehavior.language("warehouse_manage.outbill_qty_zero"));
}
JSONObject ioStorInvDtl = new JSONObject();
@@ -372,12 +372,12 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
String iostorinv_id = whereJson.getString("iostorinv_id");
Sectattr sect = iSectattrService.findById(whereJson.getString("sect_code"));
if (ObjectUtil.isEmpty(sect)) {
throw new BadRequestException(LangBehavior.language("warehouse_manage", "outbill_sect_empty"));
throw new BadRequestException(LangBehavior.language("warehouse_manage.outbill_sect_empty"));
}
//查询主表信息
IOStorInv ioStorInv = ioStorInvMapper.selectById(iostorinv_id);
if (ObjectUtil.isEmpty(ioStorInv)) {
throw new BadRequestException(LangBehavior.language("warehouse_manage", "outbill_not_found"));
throw new BadRequestException(LangBehavior.language("warehouse_manage.outbill_not_found"));
}
//查询生成和未分配完的明细
@@ -387,7 +387,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
queryDtl.put("iostorinv_id", iostorinv_id);
List<IOStorInvDtlDto> dtls = ioStorInvMapper.getIODtl(queryDtl);
if (ObjectUtil.isEmpty(dtls)) {
throw new BadRequestException(LangBehavior.language("warehouse_manage", "outbill_no_details"));
throw new BadRequestException(LangBehavior.language("warehouse_manage.outbill_no_details"));
}
for (int i = 0; i < dtls.size(); i++) {
@@ -482,8 +482,17 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
@Transactional(rollbackFor = Exception.class)
public void allCancel(JSONObject whereJson) {
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String currentUserId = "";
String nickName = "";
try {
currentUserId = SecurityUtils.getCurrentUserId();
nickName = SecurityUtils.getCurrentNickName();
}
catch (Exception e){
currentUserId = "OtherSys";
nickName= "OtherSys";
}
String now = DateUtil.now();
String iostorinv_id = whereJson.getString("iostorinv_id");
@@ -559,13 +568,13 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
String now = DateUtil.now();
Sectattr sect = iSectattrService.findById(whereJson.getString("sect_code"));
if (ObjectUtil.isEmpty(sect)) {
throw new BadRequestException(LangBehavior.language("warehouse_manage", "outbill_sect_empty"));
throw new BadRequestException(LangBehavior.language("warehouse_manage.outbill_sect_empty"));
}
String iostorinv_id = whereJson.getString("iostorinv_id");
//查询主表信息
IOStorInv ioStorInv = ioStorInvMapper.selectById(iostorinv_id);
if (ObjectUtil.isEmpty(ioStorInv)) {
throw new BadRequestException(LangBehavior.language("warehouse_manage", "outbill_not_found"));
throw new BadRequestException(LangBehavior.language("warehouse_manage.outbill_not_found"));
}
//查询生成和未分配完的明细
@@ -576,7 +585,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
queryDtl.put("iostorinvdtl_id", whereJson.getString("iostorinvdtl_id"));
List<IOStorInvDtlDto> dtls = ioStorInvMapper.getIODtl(queryDtl);
if (ObjectUtil.isEmpty(dtls)) {
throw new BadRequestException(LangBehavior.language("warehouse_manage", "outbill_no_details"));
throw new BadRequestException(LangBehavior.language("warehouse_manage.outbill_no_details"));
}
for (int i = 0; i < dtls.size(); i++) {
IOStorInvDtlDto dtl = dtls.get(i);
@@ -679,7 +688,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
.eq(IOStorInvDis::getIostorinvdtl_id,whereJson.getString("iostorinvdtl_id"))
);
if (ObjectUtil.isEmpty(ioStorInvDisList)){
throw new BadRequestException(LangBehavior.language("warehouse_manage", "outbill_no_cancelable_details"));
throw new BadRequestException(LangBehavior.language("warehouse_manage.outbill_no_cancelable_details"));
}
//需要更新的出入库单明细
Set<String> dtlSet = new HashSet<>();
@@ -764,7 +773,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
//查询主表信息
IOStorInv ioStorInv = ioStorInvMapper.selectById(iostorinv_id);
if (ObjectUtil.isEmpty(ioStorInv)) {
throw new BadRequestException(LangBehavior.language("warehouse_manage", "outbill_no_details"));
throw new BadRequestException(LangBehavior.language("warehouse_manage.outbill_no_details"));
}
//查询生成和未分配完的明细
@@ -775,13 +784,13 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
queryDtl.put("iostorinvdtl_id", row.getString("iostorinvdtl_id"));
List<IOStorInvDtlDto> dtls = ioStorInvMapper.getIODtl(queryDtl);
if (ObjectUtil.isEmpty(dtls)) {
throw new BadRequestException(LangBehavior.language("warehouse_manage", "outbill_no_details"));
throw new BadRequestException(LangBehavior.language("warehouse_manage.outbill_no_details"));
}
for (IOStorInvDtlDto dtl:dtls){
BigDecimal unassign_qty = dtl.getUnassign_qty();
if (unassign_qty.equals(BigDecimal.ZERO)){
throw new BadRequestException(LangBehavior.language("warehouse_manage", "outbill_allocated"));
throw new BadRequestException(LangBehavior.language("warehouse_manage.outbill_allocated"));
}
//分配数量
BigDecimal allocation_canuse_qty = BigDecimal.ZERO;

View File

@@ -20,6 +20,7 @@ import org.nl.wms.basedata_manage.service.dao.MdPbMeasureunit;
import org.nl.wms.ext_manage.service.WmsToErpService;
import org.nl.wms.pm_manage.service.dao.PmFormData;
import org.nl.wms.pm_manage.service.dao.mapper.PmFormDataMapper;
import org.nl.wms.sch_manage.enums.StatusEnum;
import org.nl.wms.warehouse_manage.enums.IOSConstant;
import org.nl.wms.warehouse_manage.enums.IOSEnum;
import org.nl.wms.warehouse_manage.service.ReturnService;
@@ -127,7 +128,7 @@ public class RetrunServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
JSONObject row = rows.get(i);
IOStorInv mst = ioStorInvMapper.selectById(row.getString("iostorinv_id"));
//入库
if ("0".equals(mst.getIo_type())) {
if ("0".equals(mst.getIo_type()) && !StatusEnum.IOBILL_TYPE_IN.code("剩料回库").equals(mst.getBill_type())) {
// 根据主表id查询所有分配明细
List<IOStorInvDis> iosDisList = ioStorInvDisMapper.selectList(
new QueryWrapper<IOStorInvDis>().lambda()
@@ -139,7 +140,7 @@ public class RetrunServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
param.put("instor_time", mst.getConfirm_time());
wmsToErpService.instorinfoToErp(param);
}
}else{
} else {
//按明细回传
List<IOStorInvDtl> dtls = ioStorInvDtlMapper.selectList(
new QueryWrapper<IOStorInvDtl>().lambda()

View File

@@ -13,7 +13,7 @@ var config = {
"dataFormat": "Dữ liệu bất thường, dữ liệu không chính xác",
"activatArg": "%s chưa được kích hoạt trong hệ thống",
"operation": "Thao tác thất bại",
"error_param_undefined": "Loại 【%s】 tương ứng 【%d】 chưa được định nghĩa",
"error_param_undefined": "Loại 【%s】 tương ứng 【%s】 chưa được định nghĩa",
"per_auth": "Quyền đã được phân phối, không thể xóa",
"error_isNull": "Dữ liệu không tồn tại: %s",
"dept_has": "Bộ phận đã liên kết người dùng, không thể xóa",
@@ -392,7 +392,7 @@ var config = {
"sect_code_already_exists": "Tồn tại mã khu vực kho giống nhau trong cùng kho",
"struct_code_not_exist": "Mã cấu trúc 【%s】 không tồn tại",
"sect_no_io_rule": "Khu vực 【%s】 không có cấu hình chiến lược xuất/nhập kho",
"strategy_no_available_struct": "Chiến lược 【%s】 không có vị trí kho khả dụng, đã truy vấn tổng cộng %d vị trí kho",
"strategy_no_available_struct": "Chiến lược 【%s】 không có vị trí kho khả dụng, đã truy vấn tổng cộng %s vị trí kho",
"sect_no_in_rule": "Khu vực 【%s】 không có cấu hình chiến lược nhập kho"
},
"sch_manage": {
@@ -495,7 +495,7 @@ var config = {
"outbill_no_cancelable_details": "Không tồn tại chi tiết phân bổ xuất kho có thể hủy",
"outbill_allocated": "Đã phân bổ xong, số lượng chưa phân bổ là 0",
"storagevehicle_no_inventory": "Thiết bị vận chuyển hiện tại 【%s】 không tồn tại tồn kho vật liệu lô liên quan, vui lòng kiểm tra dữ liệu!",
"frozen_quantity_cannot_be_negative": "Số lượng đóng băng không thể âm, vui lòng kiểm tra số lượng thay đổi! Số lượng đóng băng hiện tại là 【%s】 Số lượng thay đổi hiện tại là 【%d】"
"frozen_quantity_cannot_be_negative": "Số lượng đóng băng không thể âm, vui lòng kiểm tra số lượng thay đổi! Số lượng đóng băng hiện tại là 【%s】 Số lượng thay đổi hiện tại là 【%s】"
},
"pda_manage": {
"change_type_cannot_be_empty": "Loại thay đổi không thể để trống!",
@@ -508,7 +508,7 @@ var config = {
"material_info_cannot_be_empty": "Thông tin vật liệu không thể để trống!",
"vehicle_info_cannot_be_empty": "Thông tin thiết bị vận chuyển không thể để trống!",
"vehicle_already_has_group_plate_info": "Mã thiết bị vận chuyển【%s】 đã tồn tại thông tin nhóm pallet, vui lòng kiểm tra dữ liệu",
"vehicle_already_in_storage": "Mã thiết bị vận chuyển【%s】 đã tồn tại trong kho:【%d】, vui lòng kiểm tra dữ liệu",
"vehicle_already_in_storage": "Mã thiết bị vận chuyển【%s】 đã tồn tại trong kho:【%s】, vui lòng kiểm tra dữ liệu",
"dtllist_cannot_be_empty": "dtlList không thể để trống",
"vehicle_not_group_plated": "Thiết bị vận chuyển này chưa được nhóm pallet, vui lòng kiểm tra!",
"vehicle_not_in_group_plate_status": "Thiết bị vận chuyển này không ở trạng thái nhóm pallet, vui lòng kiểm tra!",
@@ -522,9 +522,9 @@ var config = {
"vehicle_code_empty": "Mã thiết bị vận chuyển không thể để trống",
"point_code_empty": "Mã điểm không thể để trống",
"point_not_found": "Điểm 【%s】 không tồn tại",
"point_already_binded": "Điểm 【%s】 đã liên kết thiết bị vận chuyển 【%d】",
"vehicle_already_binded": "Thiết bị vận chuyển 【%s】 đã liên kết điểm 【%d】",
"point_no_vehicle_need_unbind": "Điểm 【%s】 không liên kết thiết bị vận chuyển 【%d】, không cần hủy liên kết",
"point_already_binded": "Điểm 【%s】 đã liên kết thiết bị vận chuyển 【%s】",
"vehicle_already_binded": "Thiết bị vận chuyển 【%s】 đã liên kết điểm 【%s】",
"point_no_vehicle_need_unbind": "Điểm 【%s】 không liên kết thiết bị vận chuyển 【%s】, không cần hủy liên kết",
"start_point_not_exist": "Điểm bắt đầu không tồn tại",
"end_point_not_exist": "Điểm kết thúc không tồn tại",
"site_code_empty": "Mã điểm không thể để trống",
@@ -644,4 +644,4 @@ var config = {
"login": {
"childError": "Menu nút con không thể đặt thành thư mục"
}
}
}

View File

@@ -13,7 +13,7 @@ var config = {
"dataFormat": "数据异常,数据不正确",
"activatArg": "%s尚未在系统中激活",
"operation": "操作失败",
"error_param_undefined": "【%s】对应类型【%d】未定义",
"error_param_undefined": "【%s】对应类型【%s】未定义",
"per_auth": "权限已分配,无法删除",
"error_isNull": "数据不存在: %s",
"dept_has": "部门已关联用户,无法删除",
@@ -392,7 +392,7 @@ var config = {
"sect_code_already_exists": "存在相同仓库的库区编号",
"struct_code_not_exist": "结构编码【%s】不存在",
"sect_no_io_rule": "区域【%s】没有配置出入库策略",
"strategy_no_available_struct": "策略【%s】没有可用的货位共查询到%d个货位",
"strategy_no_available_struct": "策略【%s】没有可用的货位共查询到%s个货位",
"sect_no_in_rule": "区域【%s】没有配置入库策略",
},
"sch_manage": {
@@ -496,7 +496,7 @@ var config = {
"outbill_no_cancelable_details": "不存在可取消的出库分配明细",
"outbill_allocated": "已全部分配完未分配数量为0",
"storagevehicle_no_inventory": "当前载具【%s】不存在相关物料批次库存请检查数据!",
"frozen_quantity_cannot_be_negative": "冻结数不能为负数,请检查变动数量!当前冻结为【%s】当前变动数为【%d】",
"frozen_quantity_cannot_be_negative": "冻结数不能为负数,请检查变动数量!当前冻结为【%s】当前变动数为【%s】",
},
"pda_manage": {
"change_type_cannot_be_empty": "变动类型不能为空!",
@@ -509,7 +509,7 @@ var config = {
"material_info_cannot_be_empty": "物料信息不能为空!",
"vehicle_info_cannot_be_empty": "载具信息不能为空!",
"vehicle_already_has_group_plate_info": "载具编码:【%s】已存在组盘信息请对数据进行核实",
"vehicle_already_in_storage": "载具编码:【%s】已存在库内:【%d】,请对数据进行核实!",
"vehicle_already_in_storage": "载具编码:【%s】已存在库内:【%s】,请对数据进行核实!",
"dtllist_cannot_be_empty": "dtlList不可为空",
"vehicle_not_group_plated": "此载具未组盘,请检查!",
"vehicle_not_in_group_plate_status": "此载具非组盘状态,请检查!",
@@ -523,9 +523,9 @@ var config = {
"vehicle_code_empty": "载具编码不能为空",
"point_code_empty": "点位编码不能为空",
"point_not_found": "点位【%s】不存在",
"point_already_binded": "点位【%s】已绑定载具【%d】",
"vehicle_already_binded": "载具【%s】已绑定点位【%d】",
"point_no_vehicle_need_unbind": "点位【%s】没有绑定载具【%d】,无需解绑",
"point_already_binded": "点位【%s】已绑定载具【%s】",
"vehicle_already_binded": "载具【%s】已绑定点位【%s】",
"point_no_vehicle_need_unbind": "点位【%s】没有绑定载具【%s】,无需解绑",
"start_point_not_exist": "起点不存在",
"end_point_not_exist": "终点不存在",
"site_code_empty": "点位编码不能为空",
@@ -645,4 +645,4 @@ var config = {
"login": {
"childError": "子节点菜单不能设置为目录"
}
}
}