|
|
@@ -1818,4 +1818,59 @@ public class RMScontroller extends BaseRESTfulController {
|
|
|
public Map<String, Object> cancelRelevance(@RequestBody HashMap<String,Object> map){
|
|
|
return rmsFeign.cancelRelevance(map);
|
|
|
}
|
|
|
+
|
|
|
+ //================客户-到站
|
|
|
+ @PostMapping("/getCompanyArrivalList")
|
|
|
+ public Map<String, Object> getCompanyArrivalList(@RequestBody(required = false) Map<String, Object> mapValue,
|
|
|
+ Integer apiId,
|
|
|
+ Integer pageNum,
|
|
|
+ Integer pageSize
|
|
|
+ ) {
|
|
|
+ return rmsFeign.getCompanyArrivalList(mapValue == null ? new HashMap<>() : mapValue, apiId, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping(value = "/insertCompanyArrival")
|
|
|
+ @LogAround(foreignKeys = {"companyId"}, foreignKeyTypes = "公司", description = "新增公司单位")
|
|
|
+ public Map<String, Object> insertCompanyArrival(@RequestBody(required = false) Map<String, Object> map) {
|
|
|
+ return rmsFeign.insertCompanyArrival(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping(value = "/deleteCompanyArrival")
|
|
|
+ @LogAround(foreignKeys = {"companyId"}, foreignKeyTypes = "公司", description = "删除公司单位")
|
|
|
+ public Map<String, Object> deleteCompanyArrival(@RequestBody Map<String, Object> map) {
|
|
|
+ return rmsFeign.deleteCompanyArrival(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/importCompanyArrival")
|
|
|
+ public RESTfulResult importCompanyArrival(@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("")
|
|
|
+ ){
|
|
|
+ throw new Exception("单元格数据异常,请检查模板或数据是否正确!");
|
|
|
+ }
|
|
|
+ set.add(item.get("客户").toString()+"-"+item.get("到站").toString());
|
|
|
+ map.put(item.get("客户").toString()+"-"+item.get("到站").toString(),item);
|
|
|
+ }
|
|
|
+ //去重
|
|
|
+ String[] setList = set.toArray(new String[0]);
|
|
|
+ if (setList.length != list.size()) {
|
|
|
+ throw new Exception("客户-到站不允许重复!");
|
|
|
+ }
|
|
|
+ map.put("setList",setList);
|
|
|
+ map.put("userId",userId);
|
|
|
+ map.put("userName",userName);
|
|
|
+ map.put("remark",remark);
|
|
|
+ return rmsFeign.importCompanyArrival(map);
|
|
|
+ }
|
|
|
}
|