| | |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.controller.params.BatchUpdateParam; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrder; |
| | | import com.vincent.rsf.server.common.utils.FieldsUtils; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrderItem; |
| | | import com.vincent.rsf.server.manager.entity.Companys; |
| | | import com.vincent.rsf.server.manager.entity.Matnr; |
| | | import com.vincent.rsf.server.manager.entity.excel.AsnOrderTemplate; |
| | | import com.vincent.rsf.server.manager.enums.CompanysType; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderItemService; |
| | |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<AsnOrderItem, BaseParam> pageParam = new PageParam<>(baseParam, AsnOrderItem.class); |
| | | return R.ok().add(asnOrderItemService.listByAsnId(pageParam, pageParam.buildWrapper(true))); |
| | | /**拼接扩展字段*/ |
| | | PageParam<AsnOrderItem, BaseParam> page = asnOrderItemService.page(pageParam, pageParam.buildWrapper(true)); |
| | | List<AsnOrderItem> records = page.getRecords(); |
| | | for (AsnOrderItem record : records) { |
| | | if (!Objects.isNull(record.getFieldsIndex())) { |
| | | Map<String, String> fields = FieldsUtils.getFields(record.getFieldsIndex()); |
| | | record.setExtendFields(fields); |
| | | } |
| | | } |
| | | page.setRecords(records); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:asnOrderItem:list')") |
| | |
| | | params.put("createBy", getLoginUserId()); |
| | | params.put("updateBy", getLoginUserId()); |
| | | |
| | | if (!asnOrderItemService.fieldsSave(params)) { |
| | | if (!asnOrderItemService.fieldsSave(params, getLoginUserId())) { |
| | | return R.error("Save Fail"); |
| | | } |
| | | return R.ok("Save Success"); |
| | |
| | | @PostMapping("/asnOrderItem/import") |
| | | @ApiOperation("ASN导入接口") |
| | | @PreAuthorize("hasAuthority('manager:asnOrderItem:update')") |
| | | public R importExcel(@RequestParam(value = "file") MultipartFile file, @RequestParam String asnId) throws Exception { |
| | | public R importExcel(@RequestParam(value = "file") MultipartFile file) throws Exception { |
| | | if (Objects.isNull(file)) { |
| | | R.error("文件不能为空!!"); |
| | | return R.error("文件不能为空!!"); |
| | | } |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | return asnOrderItemService.excelImport(file, hashMap, getLoginUserId()); |