skyouc
15 小时以前 11662208c26eb3d837d4c2d1e7cbbeae5d5c9943
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();
    }
}