| | |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelImportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.common.SpringUtils; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | |
| | | import com.vincent.rsf.server.manager.service.MatnrService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.entity.Fields; |
| | | import com.vincent.rsf.server.system.service.FieldsService; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public PageParam<Matnr, BaseParam> getMatnrPage(PageParam<Matnr, BaseParam> pageParam) { |
| | | PageParam<Matnr, BaseParam> page = this.page(pageParam, pageParam.buildWrapper(true)); |
| | | List<Matnr> records = page.getRecords(); |
| | | for (Matnr record : records) { |
| | | if (!Objects.isNull(record.getFieldsIndex())) { |
| | | Map<String, String> fields = FieldsUtils.getFields(record.getFieldsIndex()); |
| | | record.setExtendFields(fields); |
| | | public IPage<Map<String, Object>> getMatnrPage(PageParam<Matnr, BaseParam> pageParam) { |
| | | IPage<Map<String, Object>> reulst = this.baseMapper.selectMatnrs(pageParam, pageParam.buildWrapper(true)); |
| | | /**获取物料分页信息 */ |
| | | List<Map<String, Object>> mapList = reulst.getRecords(); |
| | | if (!mapList.isEmpty()) { |
| | | mapList.forEach(map -> { |
| | | if (!Objects.isNull(map.get("fieldsIndex"))) { |
| | | FieldsUtils.mergeFields(map, map.get("fieldsIndex").toString()); |
| | | } |
| | | }); |
| | | } |
| | | page.setRecords(records); |
| | | return page; |
| | | List<Matnr> matnrs = JSONArray.parseArray(JSON.toJSONString(mapList), Matnr.class); |
| | | // PageParam<Matnr, BaseParam> page = this.page(pageParam, pageParam.buildWrapper(true)); |
| | | // List<Matnr> records = page.getRecords(); |
| | | // for (Matnr record : records) { |
| | | // if (!Objects.isNull(record.getFieldsIndex())) { |
| | | // Map<String, String> fields = FieldsUtils.getFields(record.getFieldsIndex()); |
| | | // record.setExtendFields(fields); |
| | | // } |
| | | // } |
| | | // page.setRecords(records); |
| | | return reulst; |
| | | } |
| | | |
| | | /** |