Commit 1f16a595 authored by wzp's avatar wzp

修改bug

parent b04e2710
......@@ -79,11 +79,11 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
Map<String, String> map = null;
map = (Map<String, String>) excelList.get(i);
TOrgan organ = new TOrgan();
organ.setName(map.get("名称"));
//机构名称不能重复
QueryWrapper<TOrgan> ew = new QueryWrapper<>();
if (StringUtils.isNoneBlank(organ.getName())) {
if (StringUtils.isNotBlank(map.get("名称"))) {
organ.setName(organ.getName().trim());
ew.eq("is_deleted", 0);
ew.eq("name", organ.getName());
......@@ -91,6 +91,9 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
if (list != null&&list.size()>0&&list.get(0)!=null) {
throw new Exception("机构名称不能重复!");
}
organ.setName(map.get("名称"));
}else {
throw new Exception("没有填写机构名称!");
}
try {
String parent = map.get("上级机构");
......
......@@ -300,15 +300,15 @@ public class TOrganController extends BaseController {
flag = tOrganService.batchUpload(excelList);
if (!flag) {
resultMap.put("resultCode", "500");
resultMap.put("massage", "导入失败!");
resultMap.put("message", "导入失败!");
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(resultMap);
}
resultMap.put("resultCode", "200");
resultMap.put("massage", "导入成功!");
resultMap.put("message", "导入成功!");
return ResponseEntity.ok(resultMap);
} catch (Exception e) {
resultMap.put("resultCode", "500");
resultMap.put("massage", e.getMessage());
resultMap.put("message", e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(resultMap);
}
}
......
......@@ -49,7 +49,7 @@
from t_user u
left join t_organ o on o.id = u.org_id
left join t_area a on u.area_id = a.id
where u.user_name =#{userName}
where binary u.user_name =#{userName}
</select>
<select id="getById" resultMap="BaseResultMap">
......
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