From 11662208c26eb3d837d4c2d1e7cbbeae5d5c9943 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期一, 18 八月 2025 13:59:13 +0800 Subject: [PATCH] 库存调整功能优化 --- rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/ReceiveMsgServiceImpl.java | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 53 insertions(+), 6 deletions(-) diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/ReceiveMsgServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/ReceiveMsgServiceImpl.java index 61376e7..303f02b 100644 --- a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/ReceiveMsgServiceImpl.java +++ b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/ReceiveMsgServiceImpl.java @@ -7,9 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.vincent.rsf.framework.common.R; import com.vincent.rsf.framework.exception.CoolException; -import com.vincent.rsf.server.api.controller.params.BaseMatParms; -import com.vincent.rsf.server.api.controller.params.QueryOrderParam; -import com.vincent.rsf.server.api.controller.params.WkOrderDto; +import com.vincent.rsf.server.api.controller.erp.params.*; import com.vincent.rsf.server.common.domain.BaseParam; import com.vincent.rsf.server.common.domain.PageParam; import com.vincent.rsf.server.manager.controller.dto.LocStockDto; @@ -18,7 +16,6 @@ import com.vincent.rsf.server.manager.service.*; import com.vincent.rsf.server.manager.service.impl.MatnrServiceImpl; import com.vincent.rsf.server.system.constant.SerialRuleCode; -import com.vincent.rsf.server.api.controller.params.OrderParams; import com.vincent.rsf.server.system.entity.Fields; import com.vincent.rsf.server.system.service.FieldsItemService; import com.vincent.rsf.server.system.service.FieldsService; @@ -207,7 +204,7 @@ /** * @author Ryan * @date 2025/8/15 - * @description: 鍚屾搴撲綅淇℃伅 + * @description: 鏌ヨ搴撲綅淇℃伅 * @version 1.0 */ @Override @@ -215,8 +212,58 @@ Page<Object> page = new Page<>(); page.setCurrent(pageParam.getCurrent()).setSize(pageParam.getSize()); IPage<LocStockDto> locStocks = locService.getLocDetls(page); - return null; + return R.ok().add(locStocks); } + /** + * @author Ryan + * @date 2025/8/18 + * @description: 搴撲綅鍚屾 + * @version 1.0 + */ + @Override + @Transactional(timeout = 30, rollbackFor = Exception.class) + public R syncLocs(List<SyncLocsParams> locs) { + List<Loc> syncLocs = new ArrayList<>(); + locs.forEach(loc -> { + Loc loc1 = new Loc(); + BeanUtils.copyProperties(loc, loc1); + loc1.setCode(loc.getLocCode()).setId(null); + syncLocs.add(loc1); + }); + if (!locService.saveBatch(syncLocs)) { + throw new CoolException("搴撲綅鍚屾澶辫触锛侊紒"); + } + return R.ok(); + } + /** + * @author Ryan + * @date 2025/8/18 + * @description: 鐗╂枡淇℃伅鍚屾 + * @version 1.0 + */ + @Override + @Transactional(timeout = 30, rollbackFor = Exception.class) + public R syncMatGroups(List<SyncMatGroupsParams> matGroupsParams) { + List<MatnrGroup> syncMatGroups = new ArrayList<>(); + matGroupsParams.forEach(matGroupsParam -> { + MatnrGroup matnrGroup = new MatnrGroup(); + BeanUtils.copyProperties(matGroupsParam, matnrGroup); + if (Objects.isNull(matGroupsParam.getCode())) { + throw new CoolException("鐗╂枡鍒嗙粍缂栫爜涓嶈兘涓虹┖锛侊紒"); + } + if (Objects.isNull(matGroupsParam.getName())) { + throw new CoolException("鍒嗙粍鍚嶇О涓嶈兘涓虹┖锛侊紒"); + } + if (Objects.isNull(matGroupsParam.getParCode())) { + throw new CoolException("涓婄骇鐗╂枡鍒嗙粍缂栫爜涓嶈兘涓虹┖锛侊紒"); + } + syncMatGroups.add(matnrGroup); + }); + if (!matnrGroupService.saveBatch(syncMatGroups)) { + throw new CoolException("鐗╂枡鍒嗙粍淇濆瓨澶辫触锛侊紒"); + } + return R.ok(); + } } -- Gitblit v1.9.1