| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | |
| | | import com.vincent.rsf.server.common.utils.CommonUtil; |
| | | import com.vincent.rsf.server.common.utils.ExcelUtil; |
| | | import com.vincent.rsf.server.common.utils.FieldsUtils; |
| | | import com.vincent.rsf.server.manager.controller.params.MatnrToGroupParams; |
| | | import com.vincent.rsf.server.manager.entity.MatnrGroup; |
| | | import com.vincent.rsf.server.manager.entity.excel.MatnrsTemplate; |
| | | import com.vincent.rsf.server.manager.mapper.MatnrMapper; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 物料绑定 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean bindMatnrs(MatnrToGroupParams params) { |
| | | if (Objects.isNull(params) && params.getIds().isEmpty()) { |
| | | throw new CoolException("物料不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getGroupId())) { |
| | | throw new CoolException("分组不能为空!!"); |
| | | } |
| | | MatnrGroup groups = matnrGroupService.getOne(new LambdaQueryWrapper<MatnrGroup>().eq(MatnrGroup::getId, params.getGroupId())); |
| | | if (Objects.isNull(groups)) { |
| | | throw new CoolException("物料分组不存在!!"); |
| | | } |
| | | if (!this.update(new LambdaUpdateWrapper<Matnr>() |
| | | .in(Matnr::getId, params.getIds()) |
| | | .set(Matnr::getGroupId, groups.getId()) |
| | | .set(Matnr::getGroupCode, groups.getCode()))) { |
| | | throw new CoolException("绑定失败!!"); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * @desc 更新扩展物料扩展字段值 |
| | | * @param matnr |
| | | * @return |