| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | throw new CoolException("物料分组不能为空!!"); |
| | | } |
| | | |
| | | Matnr matnr1 = JSONObject.parseObject(JSONObject.toJSONString(matnr), Matnr.class); |
| | | |
| | | /** |
| | | * 扩展字段存入库 |
| | | */ |
| | | if (!FieldsUtils.getFieldsSta().isEmpty()) { |
| | | String uuid16 = CommonUtil.randomUUID16(); |
| | | if (!FieldsUtils.getFieldsSta().isEmpty()) { |
| | | FieldsUtils.saveFields(matnr, uuid16); |
| | | matnr1.setFieldsIndex(uuid16); |
| | | } |
| | | |
| | | Matnr matnr1 = JSONObject.parseObject(JSONObject.toJSONString(matnr), Matnr.class); |
| | | matnr1.setCreateBy(getLoginUserId()); |
| | | matnr1.setUpdateBy(getLoginUserId()); |
| | | |
| | |
| | | @PreAuthorize("hasAuthority('manager:matnr:update')") |
| | | @OperationLog("Update 物料信息表") |
| | | @PostMapping("/matnr/update") |
| | | public R update(@RequestBody Matnr matnr) { |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R update(@RequestBody Map<String, Object> params) { |
| | | |
| | | Matnr matnr = JSONObject.parseObject(JSONObject.toJSONString(params), Matnr.class); |
| | | matnr.setUpdateBy(getLoginUserId()); |
| | | matnr.setUpdateTime(new Date()); |
| | | if (!matnrService.updateById(matnr)) { |
| | | return R.error("Update Fail"); |
| | | } |
| | | if (!Objects.isNull(params.get("fieldsIndex"))) { |
| | | FieldsUtils.updateFieldsValue(params); |
| | | } |
| | | return R.ok("Update Success").add(matnr); |
| | | } |
| | | |