skyouc
2025-03-26 34150a16ef56b933c59838da129d5b35b9dc09d8
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/MatnrServiceImpl.java
@@ -4,6 +4,7 @@
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.vincent.rsf.framework.common.R;
@@ -87,7 +88,11 @@
                String uuid = CommonUtil.randomUUID16();
                matnr.setFieldsIndex(uuid);
                //保存物料扩展属性值
                FieldsUtils.saveFields(template, uuid);
                try {
                    FieldsUtils.saveFields(template, uuid);
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
            matnrs.add(matnr);
        });
@@ -100,6 +105,7 @@
    @Override
    public PageParam<Matnr, BaseParam> getMatnrPage(PageParam<Matnr, BaseParam> pageParam) {
        QueryWrapper<Matnr> queryWrapper = pageParam.buildWrapper(true);
        IPage<Map<String, Object>> reulst = this.baseMapper.selectMatnrs(pageParam, pageParam.buildWrapper(true));
        /**获取物料分页信息 */
        List<Map<String, Object>> mapList = reulst.getRecords();
@@ -212,8 +218,14 @@
         */
        String uuid16 = CommonUtil.randomUUID16();
        if (!FieldsUtils.getFieldsSta().isEmpty()) {
            FieldsUtils.saveFields(matnr, uuid16);
            matnr1.setFieldsIndex(uuid16);
            Map<String, ?> extendFields = (Map<String, ?>) matnr.get("extendFields");
            try {
                FieldsUtils.saveFields(extendFields, uuid16);
                matnr1.setFieldsIndex(uuid16);
            } catch (Exception ex) {
                log.error(ex.toString());
                throw new CoolException("动态字段保存失败");
            }
        }
        if (!this.saveOrUpdate(matnr1)) {
            return R.error("Save Fail");