Commit fbfe64a5 by jiang'yun

修改问题

parent 0348ae3b
...@@ -187,51 +187,51 @@ public class SjZdbfZsdwwtcjController extends BaseController ...@@ -187,51 +187,51 @@ public class SjZdbfZsdwwtcjController extends BaseController
//日期 //日期
String rq=new DataFormatter().formatCellValue(row.getCell(1)); String rq=new DataFormatter().formatCellValue(row.getCell(1));
if(StringUtils.isEmpty(rq)){ if(StringUtils.isEmpty(rq)){
return AjaxResult.error("导入失败,日期不能为空"); return AjaxResult.error("导入失败,第"+(i+1)+"行日期不能为空");
} }
zsdwwtcj.setRq(rq); zsdwwtcj.setRq(rq);
//单位 //单位
String dw=new DataFormatter().formatCellValue(row.getCell(2)) ; String dw=new DataFormatter().formatCellValue(row.getCell(2)) ;
if(StringUtils.isEmpty(dw)){ if(StringUtils.isEmpty(dw)){
return AjaxResult.error("导入失败,单位不能为空"); return AjaxResult.error("导入失败,第"+(i+1)+"行单位不能为空");
} }
//查询单位id //查询单位id
String[] split = dw.split("/"); String[] split = dw.split("/");
if(split.length<2){ if(split.length<2){
return AjaxResult.error("导入失败,输入的单位格式有误!"); return AjaxResult.error("导入失败,第"+(i+1)+"行输入的单位格式有误!");
} }
String ejdw=split[0]; String ejdw=split[0];
SysDept ejdept = deptList.stream().filter(dept -> dept.getDeptName().equals(ejdw)).findFirst().orElse(null); SysDept ejdept = deptList.stream().filter(dept -> dept.getDeptName().equals(ejdw)).findFirst().orElse(null);
if(ejdept==null){ if(ejdept==null){
return AjaxResult.error("导入失败,未匹配到二级单位"); return AjaxResult.error("导入失败,第"+(i+1)+"行未匹配到二级单位");
} }
String sjdw=split[1]; String sjdw=split[1];
SysDept sjdept = deptList.stream().filter(dept -> dept.getDeptName().equals(sjdw) && dept.getParentId().equals(ejdept.getDeptId())).findFirst().orElse(null); SysDept sjdept = deptList.stream().filter(dept -> dept.getDeptName().equals(sjdw) && dept.getParentId().equals(ejdept.getDeptId())).findFirst().orElse(null);
if(sjdept==null){ if(sjdept==null){
return AjaxResult.error("导入失败,未匹配到三级单位"); return AjaxResult.error("导入失败,第"+(i+1)+"行未匹配到三级单位");
} }
zsdwwtcj.setDeptId(sjdept.getDeptId()); zsdwwtcj.setDeptId(sjdept.getDeptId());
//问题描述 //问题描述
String wtms=new DataFormatter().formatCellValue(row.getCell(3)) ; String wtms=new DataFormatter().formatCellValue(row.getCell(3)) ;
if(StringUtils.isEmpty(wtms)){ if(StringUtils.isEmpty(wtms)){
return AjaxResult.error("导入失败,问题描述不能为空"); return AjaxResult.error("导入失败,第"+(i+1)+"行问题描述不能为空");
} }
zsdwwtcj.setWtmc(wtms); zsdwwtcj.setWtmc(wtms);
//考核内容 //考核内容
String khnr=new DataFormatter().formatCellValue(row.getCell(4)) ; String khnr=new DataFormatter().formatCellValue(row.getCell(4)) ;
if(StringUtils.isEmpty(khnr)){ if(StringUtils.isEmpty(khnr)){
return AjaxResult.error("导入失败,考核内容不能为空"); return AjaxResult.error("导入失败,第"+(i+1)+"行考核内容不能为空");
} }
zsdwwtcj.setKhnr(khnr); zsdwwtcj.setKhnr(khnr);
//考核项点 //考核项点
String khxd=new DataFormatter().formatCellValue(row.getCell(5)) ; String khxd=new DataFormatter().formatCellValue(row.getCell(5)) ;
if(StringUtils.isEmpty(khxd)){ if(StringUtils.isEmpty(khxd)){
return AjaxResult.error("导入失败,考核项点不能为空"); return AjaxResult.error("导入失败,第"+(i+1)+"行考核项点不能为空");
} }
zsdwwtcj.setKhxd(khxd); zsdwwtcj.setKhxd(khxd);
String pjbz=new DataFormatter().formatCellValue(row.getCell(6)) ; String pjbz=new DataFormatter().formatCellValue(row.getCell(6)) ;
if(StringUtils.isEmpty(pjbz)){ if(StringUtils.isEmpty(pjbz)){
return AjaxResult.error("导入失败,评价标准不能为空"); return AjaxResult.error("导入失败,第"+(i+1)+"行评价标准不能为空");
} }
//匹配评价标准 //匹配评价标准
String substring = pjbz.substring(4); String substring = pjbz.substring(4);
...@@ -244,7 +244,7 @@ public class SjZdbfZsdwwtcjController extends BaseController ...@@ -244,7 +244,7 @@ public class SjZdbfZsdwwtcjController extends BaseController
sjZdbfKhpjbzCb.setNd(rq.substring(0,4)); sjZdbfKhpjbzCb.setNd(rq.substring(0,4));
SjZdbfKhpjbzCb cb=sjZdbfKhpjbzMapper.selectSjZdbfKhpjbzCb(sjZdbfKhpjbzCb); SjZdbfKhpjbzCb cb=sjZdbfKhpjbzMapper.selectSjZdbfKhpjbzCb(sjZdbfKhpjbzCb);
if(cb==null){ if(cb==null){
return AjaxResult.error("导入失败,未匹配到评价标准"); return AjaxResult.error("导入失败,第"+(i+1)+"行未匹配到评价标准");
} }
zsdwwtcj.setPjbzid(cb.getId()+""); zsdwwtcj.setPjbzid(cb.getId()+"");
zsdwwtcj.setPjbzmc(cb.getPjbz()); zsdwwtcj.setPjbzmc(cb.getPjbz());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment