|
|
@@ -163,6 +163,13 @@ public class RMScontroller extends BaseRESTfulController {
|
|
|
return rmsFeign.getMaterialTypeById(id);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "物资树形结构", notes = "")
|
|
|
+ @ApiImplicitParam(name = "rmsMaterialType", value = "rmsMaterialType", required = true, dataType = "rmsMaterialType")
|
|
|
+ @PostMapping(value = "/getMaterialTree")
|
|
|
+ public Map<String, Object> getMaterialTree(@RequestBody(required = false) Map<String, Object> map) {
|
|
|
+ return rmsFeign.getMaterialTree(map);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//====================物资
|
|
|
@ApiOperation(value = "获取物资列表")
|
|
|
@@ -221,6 +228,41 @@ public class RMScontroller extends BaseRESTfulController {
|
|
|
return rmsFeign.syncMaterial(map);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("导入物资")
|
|
|
+ @PostMapping("/importMaterial")
|
|
|
+ public RESTfulResult importMaterial(@RequestBody MultipartFile file,
|
|
|
+ String remark,
|
|
|
+ String userId,
|
|
|
+ String userName) throws Exception {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ //获取Excel中包含的对象数组
|
|
|
+ List<Map<String, Object>> list = ExcelToolUtils.getExcelList(file, 0);
|
|
|
+ map.put("list", list);
|
|
|
+ Set<String> set = new HashSet<>();
|
|
|
+ for (Map<String, Object> item : list) {
|
|
|
+ //校验行
|
|
|
+ if(
|
|
|
+ item.get("名称")==null || item.get("名称").equals("")
|
|
|
+ || item.get("编码")==null || item.get("编码").equals("")
|
|
|
+ || item.get("类型")==null || item.get("类型").equals("")
|
|
|
+ || item.get("NC主键")==null || item.get("NC主键").equals("")
|
|
|
+ ){
|
|
|
+ throw new Exception("单元格数据异常,请检查模板或数据是否正确!");
|
|
|
+ }
|
|
|
+ set.add(item.get("NC主键").toString());
|
|
|
+ map.put(item.get("NC主键").toString(),item);
|
|
|
+ }
|
|
|
+ //去重
|
|
|
+ String[] setList = set.toArray(new String[0]);
|
|
|
+ if (setList.length != list.size()) {
|
|
|
+ throw new Exception("NC主键不允许重复!");
|
|
|
+ }
|
|
|
+ map.put("setList",setList);
|
|
|
+ map.put("userId",userId);
|
|
|
+ map.put("userName",userName);
|
|
|
+ return rmsFeign.importMaterial(map);
|
|
|
+ }
|
|
|
+
|
|
|
//====================作业点
|
|
|
@ApiOperation(value = "获取作业点列表")
|
|
|
@ApiImplicitParams({
|