0e31300fbaf036eb0a292f8fa9ed0bd9b9863b7d.svn-base 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311
  1. package cn.com.goldenwater.dcproj.controller.ducha;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.constValue.AdCodeLabel;
  5. import cn.com.goldenwater.dcproj.constValue.CommonLabel;
  6. import cn.com.goldenwater.dcproj.dao.BisInspOrgDao;
  7. import cn.com.goldenwater.dcproj.dto.AddRlationPersDto;
  8. import cn.com.goldenwater.dcproj.dto.GroupLeaderDto;
  9. import cn.com.goldenwater.dcproj.dto.InspTypeDto;
  10. import cn.com.goldenwater.dcproj.dto.LoginDto;
  11. import cn.com.goldenwater.dcproj.dto.LoginUser;
  12. import cn.com.goldenwater.dcproj.dto.PersListDto;
  13. import cn.com.goldenwater.dcproj.model.BisInspAll;
  14. import cn.com.goldenwater.dcproj.model.BisInspAllRlation;
  15. import cn.com.goldenwater.dcproj.model.BisInspAllRlationPers;
  16. import cn.com.goldenwater.dcproj.model.BisInspOrg;
  17. import cn.com.goldenwater.dcproj.model.BisInspPersOrg;
  18. import cn.com.goldenwater.dcproj.model.GwComFile;
  19. import cn.com.goldenwater.dcproj.model.InspType;
  20. import cn.com.goldenwater.dcproj.model.OlBisInspOrg;
  21. import cn.com.goldenwater.dcproj.param.BisInspAllParam;
  22. import cn.com.goldenwater.dcproj.param.BisInspAllRlationParam;
  23. import cn.com.goldenwater.dcproj.param.BisInspAllRlationPersParam;
  24. import cn.com.goldenwater.dcproj.param.BisInspOrgParam;
  25. import cn.com.goldenwater.dcproj.param.BisInspPersOrgParam;
  26. import cn.com.goldenwater.dcproj.param.GroupLeaderParam;
  27. import cn.com.goldenwater.dcproj.param.TacInspYearBatchGroupPersParam;
  28. import cn.com.goldenwater.dcproj.param.UpdateCallNumberParam;
  29. import cn.com.goldenwater.dcproj.param.UserListByCurUserParam;
  30. import cn.com.goldenwater.dcproj.param.UserRoleParam;
  31. import cn.com.goldenwater.dcproj.service.BisInspAllRlationPersService;
  32. import cn.com.goldenwater.dcproj.service.BisInspAllRlationService;
  33. import cn.com.goldenwater.dcproj.service.BisInspAllService;
  34. import cn.com.goldenwater.dcproj.service.BisInspMeetInvitationService;
  35. import cn.com.goldenwater.dcproj.service.BisInspPersOrgService;
  36. import cn.com.goldenwater.dcproj.service.GwComFileService;
  37. import cn.com.goldenwater.dcproj.service.LoginService;
  38. import cn.com.goldenwater.dcproj.service.OlBisInspOrgService;
  39. import cn.com.goldenwater.dcproj.service.TacInspYearBatchGroupPersService;
  40. import cn.com.goldenwater.dcproj.service.impl.system.OrganizationTreeImpl;
  41. import cn.com.goldenwater.dcproj.target.Authority;
  42. import cn.com.goldenwater.dcproj.target.Log;
  43. import cn.com.goldenwater.dcproj.target.VerifyBean;
  44. import cn.com.goldenwater.dcproj.util.Base64Util;
  45. import cn.com.goldenwater.dcproj.utils.*;
  46. import cn.com.goldenwater.id.util.UuidUtil;
  47. import cn.com.goldenwater.target.CheckException;
  48. import com.github.pagehelper.PageInfo;
  49. import io.swagger.annotations.Api;
  50. import io.swagger.annotations.ApiOperation;
  51. import io.swagger.annotations.ApiParam;
  52. import org.apache.commons.collections.CollectionUtils;
  53. import org.apache.commons.collections.MapUtils;
  54. import org.apache.commons.lang3.StringUtils;
  55. import org.slf4j.Logger;
  56. import org.slf4j.LoggerFactory;
  57. import org.springframework.beans.factory.annotation.Autowired;
  58. import org.springframework.beans.factory.annotation.Value;
  59. import org.springframework.data.redis.core.RedisTemplate;
  60. import org.springframework.transaction.annotation.Transactional;
  61. import org.springframework.util.Assert;
  62. import org.springframework.web.bind.annotation.GetMapping;
  63. import org.springframework.web.bind.annotation.PathVariable;
  64. import org.springframework.web.bind.annotation.PostMapping;
  65. import org.springframework.web.bind.annotation.RequestBody;
  66. import org.springframework.web.bind.annotation.RequestMapping;
  67. import org.springframework.web.bind.annotation.RequestMethod;
  68. import org.springframework.web.bind.annotation.RequestParam;
  69. import org.springframework.web.bind.annotation.RestController;
  70. import org.springframework.web.multipart.MultipartFile;
  71. import javax.annotation.PostConstruct;
  72. import javax.servlet.http.HttpServletRequest;
  73. import java.io.File;
  74. import java.io.IOException;
  75. import java.text.SimpleDateFormat;
  76. import java.util.ArrayList;
  77. import java.util.Calendar;
  78. import java.util.Date;
  79. import java.util.HashMap;
  80. import java.util.List;
  81. import java.util.Map;
  82. import java.util.Optional;
  83. import java.util.concurrent.TimeUnit;
  84. /**
  85. * @author zhaohg
  86. * @date 2019-2-23
  87. */
  88. @Api(value = "新用户管理", tags = "006新用户管理")
  89. @RestController
  90. @RequestMapping("/bis/insp")
  91. public class BisInspAllRlationPersController extends BaseController {
  92. private Logger logger = LoggerFactory.getLogger(getClass());
  93. @Value("${api.url}")
  94. private String apiUrl;
  95. @Value("${smsCode}")
  96. private String smsCode;
  97. @Value("${getFile.prefix}")
  98. public String prefix;
  99. @Value("${web.upload-path}")
  100. public String fileDir;
  101. @Autowired
  102. private BisInspAllRlationPersService bisInspAllRlationPersService;
  103. @Autowired
  104. private BisInspAllRlationService bisInspAllRlationService;
  105. @Autowired
  106. private OrganizationTreeImpl organizationTree;
  107. @Autowired
  108. private GwComFileService gwComFileService;
  109. @Autowired
  110. private RedisTemplate redisTemplate;
  111. @Autowired
  112. private BisInspMeetInvitationService bisInspMeetInvitationService;
  113. @Autowired
  114. private TacInspYearBatchGroupPersService groupPersService;
  115. @Autowired
  116. private OlBisInspOrgService olBisInspOrgService;
  117. @Autowired
  118. private OlBisInspOrgService inspOrgService;
  119. @Autowired
  120. private BisInspPersOrgService persOrgService;
  121. @Autowired
  122. private LoginService loginService;
  123. @PostConstruct
  124. public void Cache() {
  125. Object newSmscode = redisTemplate.opsForValue().get("smsCode");
  126. if (newSmscode == null) {
  127. redisTemplate.opsForValue().set("smsCode", smsCode);
  128. }
  129. }
  130. @RequestMapping(value = "/test/{month}", method = {RequestMethod.GET})
  131. public BaseResponse test(@PathVariable String month) {
  132. // countTaskService.washWxPic(request);
  133. gwComFileService.changeSmallImg("2020", month);
  134. return buildSuccessResponse("更新完成!!");
  135. }
  136. @GetMapping("/getCaptchaImage")
  137. public BaseResponse getCaptcha() throws Exception {
  138. String uuid = UuidUtil.uuid();
  139. ImgResult imgResult = VerifyCodeUtils.VerifyCode(4);
  140. this.redisTemplate.opsForValue().set(uuid, imgResult.getCode(), 10L, TimeUnit.MINUTES);
  141. Map<String, Object> map = new HashMap<>(2);
  142. map.put("imgCodeId", uuid);
  143. map.put("img", imgResult.getImg());
  144. logger.info("--------------------imgCode:" + imgResult.getCode() + "------------------------------");
  145. return buildSuccessResponse(map);
  146. }
  147. @Log
  148. @ApiOperation(value = "用户发送短信", notes = "用户发送短信")
  149. @RequestMapping(value = "/sendMessage", method = {RequestMethod.POST})
  150. public BaseResponse sendMessage(@RequestParam(required = true) String phone, @RequestParam(required = false) String imgCodeId, @RequestParam(required = false) String code, HttpServletRequest request)
  151. throws Exception {
  152. if (code.length() != 4) {
  153. return buildFailResponse("验证码有误!");
  154. }
  155. String uuidCode = "";
  156. Object object = this.redisTemplate.opsForValue().get(imgCodeId);
  157. if (object != null) {
  158. uuidCode = object.toString();
  159. }
  160. String inputCode = Base64Util.encodeStr(code.toLowerCase());
  161. if (!(uuidCode.equalsIgnoreCase(inputCode))) {
  162. return buildFailResponse(1500, "您输入的验证码不正确或已过期,请点击验证码图片刷新,重新输入!");
  163. }
  164. uuidCode = UuidUtil.uuid();
  165. redisTemplate.opsForValue().set(phone, uuidCode + "_" + imgCodeId, 10L, TimeUnit.MINUTES);
  166. redisTemplate.delete(imgCodeId);
  167. redisTemplate.opsForValue().set(imgCodeId, uuidCode);
  168. boolean flag = this.bisInspAllRlationPersService.sendMessage(phone);
  169. if (flag) {
  170. return buildSuccessResponse();
  171. }
  172. return buildFailResponse(1002, "您还不是本系统用户,请联系系统管理员");
  173. }
  174. /**
  175. * 新版本登录接口
  176. *
  177. * @param loginDto phone、code
  178. * @param request 请求
  179. * @return 判断能否登录,登录成果返回用户信息
  180. */
  181. @ApiOperation(value = "用户验证码登录", notes = "与普通登录返回相同")
  182. @RequestMapping(value = "/loginByCode", method = {RequestMethod.POST})
  183. public BaseResponse loginByCode(@RequestBody LoginDto loginDto, HttpServletRequest request) {
  184. return loginService.login(loginDto, request);
  185. }
  186. /**
  187. * 手机号密码登录接口
  188. *
  189. * @param loginDto phone、pwd
  190. * @param request 请求
  191. * @return 判断能否登录,登录成果返回用户信息
  192. */
  193. @ApiOperation(value = "用户验证码登录", notes = "与普通登录返回相同")
  194. @RequestMapping(value = "/loginByPwd", method = {RequestMethod.POST})
  195. public BaseResponse loginByPwd(@RequestBody LoginDto loginDto, HttpServletRequest request) {
  196. return loginService.loginByPwd(loginDto, request);
  197. }
  198. /**
  199. * 更新密码为m5加密后的
  200. *
  201. * @param
  202. */
  203. @ApiOperation(value = "更新密码为m5加密后的", notes = "更新密码为m5加密后的")
  204. @RequestMapping(value = "/updatePwdMd5", method = {RequestMethod.POST})
  205. public BaseResponse updatePwdMd5() {
  206. return loginService.updatePwdMd5();
  207. }
  208. // /**
  209. // * 旧版本登录接口
  210. // *
  211. // * @param phone 手机号
  212. // * @param code 验证码
  213. // * @param request 请求
  214. // * @return 判断能否登录,登录成果返回用户信息
  215. // */
  216. // @ApiOperation(value = "用户验证码登录", notes = "与普通登录返回相同")
  217. // @RequestMapping(value = "/loginByCode", method = {RequestMethod.POST})
  218. // public BaseResponse loginByCode(@RequestParam String phone, @RequestParam String code, HttpServletRequest request) {
  219. // if (code.length() != 6) {
  220. // return buildFailResponse("验证码有误!");
  221. // }
  222. // // 根据phone-code获取用户信息
  223. // BisInspAllRlationPers bisInspAllRlationPers = bisInspAllRlationPersService.loginByCode(phone, code);
  224. // boolean logincode = true;
  225. // if (bisInspAllRlationPers == null) {
  226. // GwStaticUser gwStaticUser = gwStaticUserDao.get(phone);
  227. // if (gwStaticUser != null) {
  228. // String newSmscode = smsCode;
  229. // // 判断是否与固定验证码相同,相同时获取用户信息
  230. // if (newSmscode.equals(code)) {
  231. // BisInspAllRlationPersParam inspAllRlationPersParam = new BisInspAllRlationPersParam();
  232. // inspAllRlationPersParam.setMobilenumb(phone);
  233. // bisInspAllRlationPers = bisInspAllRlationPersService.getBy(inspAllRlationPersParam);
  234. // logincode = false;
  235. // }
  236. // }
  237. // }
  238. //
  239. // //发送信息成功后记录数据
  240. // if (logincode) {
  241. // String yzm = (String) redisTemplate.opsForValue().get(phone);
  242. // if (StringUtils.isBlank(yzm)) {
  243. // return buildFailResponse("图片验证码已经过期,请重新验证!!");
  244. // }
  245. // String[] arrays = yzm.split("_");
  246. // //验证码为arrays[0]
  247. // String yzmReal = (String) redisTemplate.opsForValue().get(arrays[1]);
  248. // if (StringUtils.isBlank(yzm) || "null".equals(yzm)) {
  249. // return buildFailResponse("图片验证码已经过期,请重新输入!!");
  250. // }
  251. // if (!yzmReal.equals(arrays[0])) {
  252. // return buildFailResponse("图片验证码已经过期,请重新验输入!");
  253. // }
  254. // redisTemplate.delete(phone);
  255. // redisTemplate.delete(arrays[1]);
  256. // }
  257. // if (bisInspAllRlationPers == null) {
  258. // BisInspAllRlationPersParam allRlationPersParam = new BisInspAllRlationPersParam();
  259. // allRlationPersParam.setMobilenumb(phone);
  260. // bisInspAllRlationPers = bisInspAllRlationPersService.getBy(allRlationPersParam);
  261. // if (bisInspAllRlationPers == null) {
  262. // return buildFailResponse(1002, "该手机号尚未注册", "", "");
  263. // }
  264. // return buildFailResponse(1001, "验证码错误", "", "");
  265. // } else {
  266. // bisInspAllRlationPers.setPwd(null);
  267. // bisInspAllRlationPers = getBisInspAllRlations(bisInspAllRlationPers);
  268. // BisInspAllRlationPers pers = new BisInspAllRlationPers();
  269. // pers.setGuid(bisInspAllRlationPers.getGuid());
  270. // pers.setLoginTm(new Date());
  271. // if (StringUtils.isBlank(bisInspAllRlationPers.getPersType())) {
  272. // bisInspAllRlationPers.setPersType("3");
  273. // pers.setPersType("3");
  274. // }
  275. // bisInspAllRlationPersService.update(pers);
  276. // String uuid = UuidUtil.uuid();
  277. // bisInspAllRlationPersService.sendChannel(uuid, bisInspAllRlationPers, request, PlusEnum.ADD.getNumber());
  278. // String accessToken = JWTTokenUtil.sign(bisInspAllRlationPersService.getLoginUser(bisInspAllRlationPers), bisInspAllRlationPers.getGuid());
  279. //
  280. // redisTemplate.opsForValue().set(uuid, accessToken, JWTTokenUtil.maxAge, TimeUnit.MILLISECONDS);
  281. // redisTemplate.opsForValue().set(uuid + bisInspAllRlationPers.getGuid(), accessToken, JWTTokenUtil.refreshmaxAge, TimeUnit.MILLISECONDS);
  282. // bisInspAllRlationPers.setMobilenumb(UserMsgSectrityUtils.blurPhone(bisInspAllRlationPers.getMobilenumb()));
  283. // return buildSuccessResponse(bisInspAllRlationPers, uuid);
  284. // }
  285. // }
  286. /**
  287. * 江苏数字看板、 需要手机号码模拟登陆。
  288. *
  289. * @param map 手机号码
  290. * @param request
  291. * @return
  292. */
  293. @ApiOperation(value = "", notes = "")
  294. @RequestMapping(value = "/getTokenByTel", method = {RequestMethod.POST})
  295. public BaseResponse<Object> loginByPhone(@RequestBody Map<String, String> map, HttpServletRequest request) {
  296. // 判断是否与固定验证码相同,相同时获取用户信息
  297. BisInspAllRlationPersParam inspAllRlationPersParam = new BisInspAllRlationPersParam();
  298. inspAllRlationPersParam.setMobilenumb(map.get("phone"));
  299. BisInspAllRlationPers bisInspAllRlationPers = bisInspAllRlationPersService.getBy(inspAllRlationPersParam);
  300. if (bisInspAllRlationPers == null) {
  301. return buildFailResponse(1002, "该手机号尚未注册", "", "");
  302. }
  303. bisInspAllRlationPers.setPwd(null);
  304. bisInspAllRlationPers = getBisInspAllRlations(bisInspAllRlationPers);
  305. BisInspAllRlationPers pers = new BisInspAllRlationPers();
  306. pers.setGuid(bisInspAllRlationPers.getGuid());
  307. pers.setLoginTm(new Date());
  308. if (StringUtils.isBlank(bisInspAllRlationPers.getPersType())) {
  309. bisInspAllRlationPers.setPersType("3");
  310. pers.setPersType("3");
  311. }
  312. bisInspAllRlationPersService.update(pers);
  313. String uuid = UuidUtil.uuid();
  314. //bisInspAllRlationPersService.sendChannel(uuid, bisInspAllRlationPers, request, PlusEnum.ADD.getNumber());
  315. String accessToken = JWTTokenUtil.sign(bisInspAllRlationPersService.getLoginUser(bisInspAllRlationPers), bisInspAllRlationPers.getGuid());
  316. redisTemplate.opsForValue().set(uuid, accessToken, JWTTokenUtil.maxAge, TimeUnit.MILLISECONDS);
  317. redisTemplate.opsForValue().set(uuid + bisInspAllRlationPers.getGuid(), accessToken, JWTTokenUtil.refreshmaxAge, TimeUnit.MILLISECONDS);
  318. bisInspAllRlationPers.setMobilenumb(UserMsgSectrityUtils.blurPhone(bisInspAllRlationPers.getMobilenumb()));
  319. // TODO 有时间做个加密处理
  320. return buildSuccessResponse(bisInspAllRlationPers, uuid);
  321. }
  322. @Autowired
  323. private BisInspOrgDao bisInspOrgDao;
  324. private BisInspAllRlationPers getBisInspAllRlations(BisInspAllRlationPers bisInspAllRlationPers) {
  325. // 1.设置默认显示机构和所能看到的所有机构
  326. BisInspOrg bisInspOrg = new BisInspOrg();
  327. if (StringUtils.isNotBlank(bisInspAllRlationPers.getOrgId())) {
  328. // 设置所有能看到的机构
  329. BisInspOrgParam inspOrgParam = new BisInspOrgParam();
  330. inspOrgParam.setPersId(bisInspAllRlationPers.getGuid());
  331. List<BisInspOrg> inspOrgList = bisInspOrgDao.findPersOrgList(inspOrgParam);
  332. bisInspAllRlationPers.setAllOrg(inspOrgList);
  333. String orgId = bisInspAllRlationPers.getOrgId();
  334. // 获取所有orgId 判断用户所属机构是否在其中,没有 选择第一个机构 为默认机构
  335. if (inspOrgList != null && inspOrgList.size() > 0) {
  336. orgId = inspOrgList.get(0).getOrgId();
  337. for (BisInspOrg org : inspOrgList) {
  338. if (org.getOrgId().equals(bisInspAllRlationPers.getOrgId())) {
  339. orgId = bisInspAllRlationPers.getOrgId();
  340. break;
  341. }
  342. }
  343. }
  344. bisInspOrg = olBisInspOrgService.getDefaultOrg(orgId);
  345. bisInspAllRlationPers.setDefaultOrg(bisInspOrg);
  346. }
  347. if (StringUtils.isNotBlank(bisInspAllRlationPers.getGuid())) {
  348. List<BisInspAll> allNode = organizationTree.getAllNode(bisInspAllRlationPers.getGuid(), "", bisInspAllRlationPers.getOrgId(), "", "", "", "", "");
  349. if (allNode.size() > 0) {
  350. StringBuffer s = new StringBuffer();
  351. s.append("1");
  352. String sk = "0";
  353. String ry = "000";
  354. String sh = "0";
  355. String ogc = "0";
  356. String dxs = "0";
  357. String sz = "0";
  358. String sd = "0";
  359. for (BisInspAll b : allNode) {
  360. if ("001".equals(b.getId().substring(0, 3))) {
  361. sk = "1";
  362. }
  363. if ("002".equals(b.getId().substring(0, 3))) {
  364. ry = "111";
  365. }
  366. if ("003".equals(b.getId().substring(0, 3))) {
  367. sh = "1";
  368. }
  369. if ("004".equals(b.getId().substring(0, 3))) {
  370. ogc = "1";
  371. }
  372. if ("005".equals(b.getId().substring(0, 3))) {
  373. dxs = "1";
  374. }
  375. if ("006".equals(b.getId().substring(0, 3))) {
  376. sz = "1";
  377. }
  378. if ("011".equals(b.getId().substring(0, 3))) {
  379. sd = "1";
  380. }
  381. }
  382. s.append(sk).append(ry).append(sh).append(ogc).append(dxs).append(sz).append(sd);
  383. bisInspAllRlationPers.setJurisdiction(s.toString());
  384. } else {
  385. bisInspAllRlationPers.setJurisdiction("100000000");
  386. }
  387. bisInspAllRlationPers.setAllNode(allNode);
  388. }
  389. return bisInspAllRlationPers;
  390. }
  391. @Authority(roles = "1")
  392. @ApiOperation(value = "添加人员")
  393. @RequestMapping(value = "/insert", method = {RequestMethod.POST})
  394. @Transactional(rollbackFor = Exception.class)
  395. public BaseResponse insert(@RequestParam(value = "file", required = false) MultipartFile file, BisInspAllRlationPers bisInspAllRlationPers) throws Exception {
  396. BisInspAllRlationPers inspAllRlationPers = bisInspAllRlationPersService.get(getCurrentPersId());
  397. if (inspAllRlationPers == null) {
  398. return buildFailResponse("当前用户不存在!!");
  399. }
  400. if (!"1".equals(inspAllRlationPers.getPersType())) {
  401. return buildFailResponse(9993, "当前用户无权限执行该操作!!");
  402. }
  403. if (file != null) {
  404. Calendar dat = Calendar.getInstance();
  405. //写入文件
  406. String originalFilename = file.getOriginalFilename();
  407. GwComFile gwComFile = new GwComFile();
  408. String uuid = UuidUtil.uuid();
  409. gwComFile.setId(uuid);
  410. gwComFile.setFileName(originalFilename);
  411. gwComFile.setFileSize((double) file.getSize());
  412. gwComFile.setFileExt(originalFilename.substring(1 + originalFilename.lastIndexOf(".")));
  413. String filePath = prefix + dat.get(Calendar.YEAR) + File.separator + (dat.get(Calendar.MONTH) + 1) + File.separator + dat.get(Calendar.DAY_OF_MONTH) + File.separator + uuid + "." + gwComFile.getFileExt();
  414. gwComFile.setFilePath(filePath);
  415. if (!FileExtUtil.valFileExt(gwComFile.getFileExt())) {
  416. return buildFailResponse(9993, "文件类型允许!!");
  417. }
  418. //写入文件
  419. String filePath2 = dat.get(Calendar.YEAR) + File.separator + (dat.get(Calendar.MONTH) + 1) + File.separator + dat.get(Calendar.DAY_OF_MONTH);
  420. gwComFileService.writeFile(gwComFile, file, filePath2);
  421. bisInspAllRlationPers.setImgurl(filePath);
  422. }
  423. BisInspAllRlationPers p = bisInspAllRlationPersService.createUser(bisInspAllRlationPers);
  424. return buildSuccessResponse(p.getGuid());
  425. }
  426. private void addPreOrg(BisInspAllRlationPers bisInspAllRlationPers) {
  427. //先删除授权,再添加机构授权
  428. BisInspPersOrgParam persOrgParam = new BisInspPersOrgParam();
  429. persOrgParam.setPersId(bisInspAllRlationPers.getGuid());
  430. persOrgService.deleteBy(persOrgParam);
  431. if (StringUtils.isNotBlank(bisInspAllRlationPers.getOrgId())) {
  432. OlBisInspOrg olBisInspOrg = olBisInspOrgService.get(bisInspAllRlationPers.getOrgId());
  433. if (olBisInspOrg != null) {
  434. bisInspAllRlationPers.setOrgNm(olBisInspOrg.getOrgNm());
  435. bisInspAllRlationPers.setProvince(olBisInspOrg.getAdCode());
  436. }
  437. BisInspPersOrg inspPersOrg = new BisInspPersOrg();
  438. inspPersOrg.setOrgId(bisInspAllRlationPers.getOrgId());
  439. inspPersOrg.setPersId(bisInspAllRlationPers.getGuid());
  440. if (StringUtils.isNotBlank(bisInspAllRlationPers.getPersType())) {
  441. inspPersOrg.setUserType(bisInspAllRlationPers.getPersType());
  442. } else {
  443. inspPersOrg.setUserType(AdCodeLabel.GROUP_LEADER);
  444. }
  445. BisInspPersOrgParam bisInspPersOrgParam = new BisInspPersOrgParam();
  446. bisInspPersOrgParam.setPersId(inspPersOrg.getPersId());
  447. bisInspPersOrgParam.setOrgId(inspPersOrg.getOrgId());
  448. if (null == persOrgService.getBy(bisInspPersOrgParam)) {
  449. persOrgService.insert(inspPersOrg);
  450. }
  451. }
  452. }
  453. @ApiOperation(value = "根据id获取人员(对象详情)")
  454. @RequestMapping(value = "/{id}", method = {RequestMethod.GET})
  455. public BaseResponse<BisInspAllRlationPers> info(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  456. String currentPersId = getCurrentPersId();
  457. BisInspAllRlationPers rlationPers = bisInspAllRlationPersService.getById(id);
  458. BisInspAllRlationPers currentPers = bisInspAllRlationPersService.getById(currentPersId);
  459. rlationPers.setMobilenumb(UserMsgSectrityUtils.blurPhoneNotExc(rlationPers.getMobilenumb()));
  460. if (rlationPers != null) {
  461. rlationPers.setPwd(null);
  462. if (!"1".equals(currentPers.getPersType()) && !getCurrentPersId().equals(rlationPers.getGuid())) {
  463. rlationPers = null;
  464. }
  465. }
  466. return buildSuccessResponse(rlationPers);
  467. }
  468. @Authority(roles = "1")
  469. @ApiOperation(value = "根据ID删除人员")
  470. @RequestMapping(value = "/delete/{id}", method = {RequestMethod.POST})
  471. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  472. if ("80df1213ad9f493e85a771d6f4b18a17".equals(id)) {
  473. return buildFailResponse("管理员账户不允许删除!");
  474. }
  475. BisInspAllRlationPers bisInspAllRlationPers = bisInspAllRlationPersService.get(id);
  476. int ret = bisInspAllRlationPersService.delete(id);
  477. /**
  478. * 删除小鱼账号信息
  479. */
  480. try {
  481. bisInspMeetInvitationService.batchUsersDel(bisInspAllRlationPers);
  482. } catch (IOException e) {
  483. e.printStackTrace();
  484. }
  485. return buildSuccessResponse();
  486. }
  487. @ApiOperation(value = "根据ID添加账号到小鱼通讯录")
  488. @RequestMapping(value = "/meeting/add/{id}", method = {RequestMethod.POST})
  489. public BaseResponse addToMeetingUser(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  490. BisInspAllRlationPers bisInspAllRlationPers = bisInspAllRlationPersService.get(id);
  491. /**
  492. * 添加小鱼账号信息
  493. */
  494. try {
  495. int code = bisInspMeetInvitationService.batchUser(bisInspAllRlationPers);
  496. if(0==code){
  497. return buildSuccessResponse();
  498. }else {
  499. return buildFailResponse();
  500. }
  501. } catch (Exception e) {
  502. logger.error("添加小鱼账号信息 Exception",e.getMessage());
  503. }
  504. return buildSuccessResponse();
  505. }
  506. @ApiOperation(value = "绑定人员机构关系")
  507. @RequestMapping(value = "/add/presorg", method = {RequestMethod.POST})
  508. public BaseResponse<List<BisInspPersOrg>> presorg(@RequestBody List<BisInspPersOrg> inspPersOrgList) {
  509. if (inspPersOrgList == null || inspPersOrgList.isEmpty()) {
  510. return buildFailResponse();
  511. }
  512. //先删除
  513. BisInspPersOrgParam persOrgParam = new BisInspPersOrgParam();
  514. BisInspPersOrg inspPersOrgOne = inspPersOrgList.get(0);
  515. persOrgParam.setPersId(inspPersOrgOne.getPersId());
  516. if (StringUtils.isNotBlank(inspPersOrgOne.getPersId())) {
  517. persOrgService.deleteBy(persOrgParam);
  518. }
  519. //添加
  520. for (BisInspPersOrg inspPersOrg : inspPersOrgList) {
  521. inspPersOrg.setUserType(AdCodeLabel.GROUP_LEADER);
  522. persOrgService.insert(inspPersOrg);
  523. }
  524. /* OlBisInspOrg olBisInspOrg = olBisInspOrgService.get(inspPersOrgOne.getOrgId());
  525. if (olBisInspOrg != null) {
  526. //更新默认
  527. BisInspAllRlationPers inspAllRlationPers = new BisInspAllRlationPers();
  528. inspAllRlationPers.setOrgId(inspPersOrgOne.getOrgId());
  529. inspAllRlationPers.setOrgNm(olBisInspOrg.getOrgNm());
  530. inspAllRlationPers.setGuid(inspPersOrgOne.getPersId());
  531. bisInspAllRlationPersService.update(inspAllRlationPers);
  532. }*/
  533. return buildSuccessResponse(inspPersOrgList);
  534. }
  535. @Autowired
  536. private BisInspAllService bisInspAllService;
  537. @ApiOperation(value = "获取系统中的所有督查类型")
  538. @RequestMapping(value = "/listInspType", method = {RequestMethod.GET})
  539. public BaseResponse<List<InspType>> listInspType() {
  540. return buildSuccessResponse(bisInspAllService.listInspType());
  541. }
  542. @Authority(roles = "1")
  543. @ApiOperation(value = "获取系统中的已经绑定的所有督查类型")
  544. @RequestMapping(value = "/list/{orgId}/{persId}", method = {RequestMethod.GET})
  545. public BaseResponse<List<BisInspAllRlation>> listBindInspType(@PathVariable String orgId, @PathVariable String persId) {
  546. BisInspAllParam inspAllRParam = new BisInspAllParam();
  547. inspAllRParam.setOrgId(orgId);
  548. String province = inspOrgService.getProvince(orgId);
  549. inspAllRParam.setProvince(province);
  550. inspAllRParam.setPersId(persId);
  551. List<BisInspAllRlation> inspAllRlationList = bisInspAllService.findExistList(inspAllRParam);
  552. for (BisInspAllRlation allRlation : inspAllRlationList) {
  553. String id = allRlation.getId().substring(0, 3);
  554. allRlation.setId(id);
  555. allRlation.setPersid(persId);
  556. allRlation.setAdCode(province);
  557. }
  558. return buildSuccessResponse(inspAllRlationList);
  559. }
  560. @Authority(roles = "1")
  561. @ApiOperation(value = "删除系统中的已经绑定的所有督查类型,code位类型编码,如001小水库")
  562. @RequestMapping(value = "/del/{orgId}/{persId}/{code}", method = {RequestMethod.GET})
  563. public BaseResponse<String> delBindInspType(@PathVariable String orgId, @PathVariable String persId, @PathVariable String code) {
  564. String id = code + orgId;
  565. BisInspAllParam inspAllParam = new BisInspAllParam();
  566. inspAllParam.setPid(id);
  567. List<BisInspAll> inspAlls = bisInspAllService.findList(inspAllParam);
  568. if (inspAlls != null && !inspAlls.isEmpty()) {
  569. return buildFailResponse("删除失败,改督查类型已经存在关联数据!!");
  570. }
  571. bisInspAllService.delete(id);
  572. return buildSuccessResponse("删除成功");
  573. }
  574. @ApiOperation(value = "个人账户更新登录")
  575. @RequestMapping(value = "/updatePassword", method = {RequestMethod.POST})
  576. public BaseResponse updatePassword(@RequestBody BisInspAllRlationPers bisInspAllRlationPers) {
  577. String currentPersId = getCurrentPersId();
  578. BisInspAllRlationPers currentPers = bisInspAllRlationPersService.getById(currentPersId);
  579. if (currentPersId != bisInspAllRlationPers.getGuid()) {
  580. if (!currentPers.getPersType().equals("1")) {
  581. return buildFailResponse("无权限操作!");
  582. }
  583. }
  584. if (StringUtils.isNotBlank(bisInspAllRlationPers.getGuid()) && StringUtils.isNotBlank(bisInspAllRlationPers.getPwd())) {
  585. bisInspAllRlationPers.setPwd(MD5.getMD5(aesUtil.desEncrypt(bisInspAllRlationPers.getPwd())));
  586. bisInspAllRlationPersService.updatePassword(bisInspAllRlationPers);
  587. }
  588. return buildSuccessResponse();
  589. }
  590. @Autowired
  591. private BisInspAllRlationService rlationService;
  592. @Authority(roles = "1")
  593. @ApiOperation(value = "管理员绑定人员管理员和督查类型")
  594. @RequestMapping(value = "/add/inspType", method = {RequestMethod.POST})
  595. @Transactional(rollbackFor = Exception.class)
  596. public BaseResponse<List<InspType>> addInspType(@RequestBody List<InspType> inspTypeList, String delPersId, String delOrgId) {
  597. BisInspAllRlationPers inspAllRlationPers = bisInspAllRlationPersService.get(getCurrentPersId());
  598. if (inspAllRlationPers == null) {
  599. return buildFailResponse("当前用户不存在!!");
  600. }
  601. if (!"1".equals(inspAllRlationPers.getPersType())) {
  602. return buildFailResponse(9993, "当前用户无权限执行该操作!!");
  603. }
  604. // 1. 获取 OrgId、 persId、 province 删除所有 与用户-省关联的 数据
  605. BisInspAllRlationParam bisInspAllRlationParam = new BisInspAllRlationParam();
  606. OlBisInspOrg bisInspOrg = null;
  607. // 判断 inspTypeList 是否为空,空就只删除数据,不添加数据
  608. if (inspTypeList.size() == 0) {
  609. bisInspAllRlationParam.setOrgId(delOrgId);
  610. bisInspAllRlationParam.setPersid(delPersId);
  611. bisInspAllRlationParam.setProvince(inspOrgService.get(delOrgId).getRlcode());
  612. rlationService.deleteBy(bisInspAllRlationParam);
  613. return buildSuccessResponse();
  614. } else {
  615. InspType inspTypeOne = inspTypeList.get(0);
  616. bisInspAllRlationParam.setOrgId(inspTypeOne.getOrgId());
  617. bisInspAllRlationParam.setPersid(inspTypeOne.getPersId());
  618. bisInspOrg = inspOrgService.get(inspTypeOne.getOrgId());
  619. bisInspAllRlationParam.setProvince(bisInspOrg.getRlcode());
  620. rlationService.deleteBy(bisInspAllRlationParam);
  621. }
  622. // 2. 循环要添加的督查类别, 添加督查类别
  623. for (InspType inspType : inspTypeList) {
  624. BisInspAll rootBisInsp = bisInspAllService.get(inspType.getCode());
  625. // 如果没有这个督查类别就添加督查类别
  626. if (rootBisInsp == null) {
  627. rootBisInsp = new BisInspAll();
  628. rootBisInsp.setId(inspType.getCode());
  629. rootBisInsp.setPnm(inspType.getName());
  630. rootBisInsp.setPid(CommonLabel.INIT_DATA);
  631. bisInspAllService.insert(rootBisInsp);
  632. }
  633. String orgId = inspType.getOrgId();
  634. if (inspType.getOrgId().length() == 2) {
  635. orgId = "0" + orgId;
  636. }
  637. // 添加 督查 BisInspAll tree
  638. String id = inspType.getCode() + orgId;
  639. BisInspAll inspAll = bisInspAllService.get(id);
  640. if (inspAll == null) {
  641. inspAll = new BisInspAll();
  642. inspAll.setOrgId(inspType.getOrgId());
  643. inspAll.setId(id);
  644. inspAll.setPnm(bisInspOrg.getOrgNm() + inspType.getName());
  645. inspAll.setPid(inspType.getCode());
  646. inspAll.setProvince(bisInspOrg.getRlcode());
  647. if (AdCodeLabel.PARENT_ADCODE.equals(bisInspOrg.getRlcode())) {
  648. inspAll.setProvince("");
  649. }
  650. bisInspAllService.insert(inspAll);
  651. }
  652. // 重点添加督查 BisInspAllRlation
  653. BisInspAllRlationParam rlationParam = new BisInspAllRlationParam();
  654. rlationParam.setPersid(inspType.getPersId());
  655. rlationParam.setId(id);
  656. rlationParam.setProvince(bisInspOrg.getRlcode());
  657. BisInspAllRlation allRlation = rlationService.getBy(rlationParam);
  658. if (allRlation == null) {
  659. allRlation = new BisInspAllRlation();
  660. allRlation.setAdCode(bisInspOrg.getRlcode());
  661. if (AdCodeLabel.PARENT_ADCODE.equals(bisInspOrg.getRlcode())) {
  662. allRlation.setAdCode("");
  663. }
  664. allRlation.setPersid(inspType.getPersId());
  665. allRlation.setId(id);
  666. BisInspAllRlationPers allRlationPers = bisInspAllRlationPersService.get(inspType.getPersId());
  667. if (allRlationPers != null) {
  668. allRlation.setPertype(allRlationPers.getPersType());
  669. }
  670. allRlation.setOrgId(orgId);
  671. allRlation.setType(String.valueOf(Integer.parseInt(inspType.getCode())));
  672. rlationService.insert(allRlation);
  673. }
  674. }
  675. return buildSuccessResponse(inspTypeList);
  676. }
  677. @Authority(roles = "1")
  678. @ApiOperation(value = "管理员绑定人员管理员和督查类型")
  679. @RequestMapping(value = "/batchAdd/inspType", method = {RequestMethod.POST})
  680. @Transactional(rollbackFor = Exception.class)
  681. public BaseResponse batchAddInspType(@RequestBody InspTypeDto inspTypeDto) {
  682. if (CollectionUtils.isEmpty(inspTypeDto.getPersIdList()) && CollectionUtils.isEmpty(inspTypeDto.getPhoneList())) {
  683. return buildFailResponse();
  684. }
  685. if (CollectionUtils.isEmpty(inspTypeDto.getInspTypeList())) {
  686. return buildFailResponse();
  687. }
  688. List<InspType> inspTypeList = inspTypeDto.getInspTypeList();
  689. if (CollectionUtils.isNotEmpty(inspTypeDto.getPersIdList())) {
  690. inspTypeDto.getPersIdList().forEach(persId -> {
  691. BisInspAllRlationPers p = bisInspAllRlationPersService.get(persId);
  692. Optional.ofNullable(p).ifPresent(per -> {
  693. for (InspType inspType : inspTypeList) {
  694. inspType.setPersId(per.getGuid());
  695. inspType.setOrgId(per.getOrgId());
  696. }
  697. addInspType(inspTypeList, per.getGuid(), per.getOrgId());
  698. });
  699. });
  700. } else {
  701. inspTypeDto.getPhoneList().forEach(phone -> {
  702. BisInspAllRlationPers p = bisInspAllRlationPersService.getBy(Builder.of(BisInspAllRlationPersParam::new)
  703. .with(BisInspAllRlationPersParam::setMobilenumb, phone)
  704. .build());
  705. Optional.ofNullable(p).ifPresent(per -> {
  706. for (InspType inspType : inspTypeList) {
  707. inspType.setPersId(per.getGuid());
  708. inspType.setOrgId(per.getOrgId());
  709. }
  710. addInspType(inspTypeList, per.getGuid(), per.getOrgId());
  711. });
  712. });
  713. }
  714. return buildSuccessResponse();
  715. }
  716. @Authority(roles = "1")
  717. @ApiOperation(value = "更新人员信息")
  718. @RequestMapping(value = "/update", method = {RequestMethod.POST})
  719. public BaseResponse update(@RequestParam(value = "file", required = false) MultipartFile file,
  720. @ApiParam(name = "bisInspAllRlationPers", value = "BisInspAllRlationPers", required = true)
  721. BisInspAllRlationPers bisInspAllRlationPers) {
  722. Assert.notNull(bisInspAllRlationPers.getGuid(), "主键guid为必填参数");
  723. BisInspAllRlationPers inspAllRlationPers = bisInspAllRlationPersService.get(getCurrentPersId());
  724. if (inspAllRlationPers == null) {
  725. return buildFailResponse("当前用户不存在!!");
  726. }
  727. if (!getCurrentPersId().equals(bisInspAllRlationPers.getGuid()) && !"1".equals(inspAllRlationPers.getPersType())) {
  728. return buildFailResponse(9993, "当前用户无权限执行该操作!!");
  729. }
  730. if (file != null) {
  731. Calendar dat = Calendar.getInstance();
  732. //写入文件
  733. String originalFilename = file.getOriginalFilename();
  734. GwComFile gwComFile = new GwComFile();
  735. gwComFile.setId(bisInspAllRlationPers.getGuid());
  736. gwComFile.setFileName(originalFilename);
  737. gwComFile.setFileSize((double) file.getSize());
  738. gwComFile.setFileExt(originalFilename.substring(1 + originalFilename.lastIndexOf(".")));
  739. String filePath = prefix + dat.get(Calendar.YEAR) + File.separator + (dat.get(Calendar.MONTH) + 1) + File.separator + dat.get(Calendar.DAY_OF_MONTH) + File.separator + bisInspAllRlationPers.getGuid() + "." + gwComFile.getFileExt();
  740. gwComFile.setFilePath(filePath);
  741. if ("JPEG".equals(gwComFile.getFileExt().toUpperCase()) || "JPG".equals(gwComFile.getFileExt().toUpperCase()) || "PNG".equals(gwComFile.getFileExt().toUpperCase())) {
  742. //写入文件
  743. String filePath2 = dat.get(Calendar.YEAR) + File.separator + (dat.get(Calendar.MONTH) + 1) + File.separator + dat.get(Calendar.DAY_OF_MONTH);
  744. gwComFileService.writeFile(gwComFile, file, filePath2);
  745. bisInspAllRlationPers.setImgurl(filePath);
  746. }
  747. }
  748. // addPreOrg(bisInspAllRlationPers);
  749. if (StringUtils.isNotBlank(bisInspAllRlationPers.getPwd())) {
  750. bisInspAllRlationPers.setPwd(MD5.getMD5(aesUtil.desEncrypt(bisInspAllRlationPers.getPwd().replace(" ", "+"))));
  751. }
  752. bisInspAllRlationPersService.update(bisInspAllRlationPers);
  753. /* //添加人员到小鱼账号
  754. try {
  755. bisInspMeetInvitationService.batchUser(bisInspAllRlationPers);
  756. } catch (IOException e) {
  757. e.printStackTrace();
  758. }*/
  759. return buildSuccessResponse(bisInspAllRlationPers);
  760. }
  761. @Authority(roles = "1")
  762. @ApiOperation(value = "批量更新人员信息")
  763. @PostMapping("/batchUpdateType")
  764. public BaseResponse batchUpdateType(@RequestBody Map<String, Object> params) {
  765. BisInspAllRlationPers inspAllRlationPers = bisInspAllRlationPersService.get(getCurrentPersId());
  766. Optional.ofNullable(inspAllRlationPers).orElseThrow(() -> new CheckException("当前用户不存在!!"));
  767. if (!"1".equals(inspAllRlationPers.getPersType())) {
  768. return buildFailResponse(9993, "当前用户无权限执行该操作!!");
  769. }
  770. List<String> persIdList = (List<String>) params.get("persIdList");
  771. String persType = MapUtils.getString(params, "persType");
  772. if (CollectionUtils.isEmpty(persIdList)) {
  773. return buildFailResponse("persIdList is blank");
  774. }
  775. if (StringUtils.isBlank(persType)) {
  776. return buildFailResponse("persType is blank");
  777. }
  778. BisInspAllRlationPers p = new BisInspAllRlationPers();
  779. p.setPersType(persType);
  780. persIdList.forEach(id -> {
  781. p.setGuid(id);
  782. bisInspAllRlationPersService.update(p);
  783. });
  784. return buildSuccessResponse();
  785. }
  786. @ApiOperation(value = "根据条件获取人员信息列表", notes = "参数字段说明:{\n\r" +
  787. " \"guid\":\"人员ID\",\n\r" +
  788. " \"orgId\":\"机构Id\",\n\r" +
  789. " \"orgNm\":\"机构名称\",\n\r" +
  790. " \"dpnm\":\"部门名称\",\n\r" +
  791. " \"dppost\":\"职称\",\n\r" +
  792. " \"school\":\"学校\",\n\r" +
  793. " \"persName\":\"姓名\",\n\r" +
  794. " };\n\r" +
  795. "返回结构说明: {\n\r" +
  796. " \"code\":\"请求状态码\",\n\r" +
  797. " \"data(数据信息对象) \": {\n\r" +
  798. " \"endRow\":\"尾行\",\n\r" +
  799. " \"firstPage\":\"首页\",\n\r" +
  800. " \"hasNextPage\":\"是否有下一页\",\n\r" +
  801. " \"hasPreviousPage\":\"是否有前一页\",\n\r" +
  802. " \"isFirstPage\":\"是否是第一页\",\n\r" +
  803. " \"isLastPage\":\"是否是最后一页\",\n\r" +
  804. " \"lastPage\":\"最后页\",\n\r" +
  805. " \"hasPreviousPage\":\"是否有前一页\",\n\r" +
  806. " \"list(结果集)\":[\n\r" +
  807. " {\n\r" +
  808. " \"guid\":\"人员ID\",\n\r" +
  809. " \"orgId\":\"机构ID\",\n\r" +
  810. " \"orgNm\":\"机构名称\",\n\r" +
  811. " \"admDuty\":\"职务\",\n\r" +
  812. " \"orgGrad\":\"职责\",\n\r" +
  813. " \"idnm\":\"工作证号\",\n\r" +
  814. " \"plst\":\"政治面貌\",\n\r" +
  815. " \"school\":\"学校\",\n\r" +
  816. " \"specialty\":\"专业\",\n\r" +
  817. " \"imgurl\":\"照片地址\",\n\r" +
  818. " \"persName\":\"人员姓名\",\n\r" +
  819. " \"pwd\":\"密码\",\n\r" +
  820. " \"telnumb\":\"电话号码\",\n\r" +
  821. " \"mobilenumb\":\"手机号码\",\n\r" +
  822. " \"email\":\"邮箱\",\n\r" +
  823. " \"bornDate\":\"出生日期\",\n\r" +
  824. " \"collTime\":\"录入日期\",\n\r" +
  825. " \"remark\":\"备注\",\n\r" +
  826. " \"faxnumb\":\"传真号码\",\n\r" +
  827. " }\n\r" +
  828. " ],\n\r" +
  829. " \"navigateFirstPage\":\"未知\",\n\r" +
  830. " \"navigateLastPage\":\"未知\",\n\r" +
  831. " \"navigatePages\":\"未知\",\n\r" +
  832. " \"list(结果集)\":[\n\r" +
  833. " ],\n\r" +
  834. " \"nextPage\":\"下一页\",\n\r" +
  835. " \"pageNum\":\"页码\",\n\r" +
  836. " \"pageSize\":\"每页多少条\",\n\r" +
  837. " \"pages\":\"总页数\",\n\r" +
  838. " \"prePage\":\"前一页\",\n\r" +
  839. " \"size\":\"未知\",\n\r" +
  840. " \"startRow\":\"未知\",\n\r" +
  841. " \"total\":\"总条数\",\n\r" +
  842. " },\n\r" +
  843. " \"message\":\"响应消息\",\n\r" +
  844. " \"path\":\"路径\",\n\r" +
  845. " \"success\":\"是否成功\",\n\r" +
  846. " \"throwable\":\"异常\",\n\r" +
  847. " }")
  848. @Authority(roles = "1")
  849. @RequestMapping(value = "/list", method = {RequestMethod.POST})
  850. public BaseResponse<PageInfo<PersListDto>> list(@RequestBody BisInspAllRlationPersParam p) {
  851. PageInfo<PersListDto> list = bisInspAllRlationPersService.findPersData(p);
  852. for (int i = 0; i < list.getList().size(); i++) {
  853. String tel = list.getList().get(i).getMobilenumb() == null ? "" : list.getList().get(i).getMobilenumb().toString();
  854. if (!"".equals(tel)) {
  855. list.getList().get(i).setMobilenumb(TelUtil.getTel(tel));
  856. }
  857. }
  858. return buildSuccessResponse(list);
  859. }
  860. @ApiOperation(value = "根据id获取人员(对象详情)")
  861. @RequestMapping(value = "/createWork", method = {RequestMethod.GET})
  862. public BaseResponse<String> createWork() {
  863. boolean bol = bisInspAllRlationPersService.createWork();
  864. return buildSuccessResponse("true");
  865. }
  866. @ApiOperation(value = "设置组长")
  867. @RequestMapping(value = "/setHeadMan", method = {RequestMethod.GET})
  868. public BaseResponse setHeadMan(@ApiParam(name = "BisInspAllRlation", value = "BisInspAllRlation", required = true) BisInspAllRlation bisInspAllRlation) {
  869. int i = bisInspAllRlationPersService.setHeadMan(bisInspAllRlation);
  870. return buildSuccessResponse();
  871. }
  872. @ApiOperation(value = "修改密码", notes = "参数字段说明:{\n\r" +
  873. " \"userCode\":\"用户编码\",\n\r" +
  874. " \"oldPassword\":\"旧密码\",\n\r" +
  875. " \"newPassword\":\"新 密码\",\n\r" +
  876. " };\n\r" +
  877. "返回结构说明:{\n\r" +
  878. " \"success\":\"是否成功(true为成功,false为失败)\",\n\r" +
  879. " \"code\":\"错误代码\",\n\r" +
  880. " \"message\":\"描述信息\",\n\r" +
  881. " \"throwable\":\"异常信息\",\n\r" +
  882. " \"data\":null")
  883. @RequestMapping(value = "changePassword", method = RequestMethod.POST)
  884. public BaseResponse changePassword(String userCode, String password, String newPassword) {
  885. Assert.notNull(userCode, "主键id为必填参数");
  886. Assert.notNull(password, "修改前密码不能为空");
  887. Assert.notNull(newPassword, "新密码不能为空");
  888. int ret = bisInspAllRlationPersService.changePassword(userCode, password, newPassword);
  889. if (0 == ret) {
  890. return buildFailResponse(0, "用户不存在");
  891. }
  892. if (2 == ret) {
  893. return buildFailResponse(2, "原密码错误,修改密码失败");
  894. }
  895. return buildSuccessResponse();
  896. }
  897. @ApiOperation(value = "修改用户(关联角色)")
  898. @RequestMapping(value = "updateUser", method = RequestMethod.POST)
  899. public BaseResponse<String> updateUser(@ApiParam(name = "bisInspAllRlationPers", value = "bisInspAllRlationPers", required = true) @RequestBody BisInspAllRlationPers bisInspAllRlationPers) {
  900. Assert.notNull(bisInspAllRlationPers, "用户对象不能为空");
  901. Assert.notNull(bisInspAllRlationPers.getGuid(), "用户ID不能为空");
  902. BisInspAllRlationPers inspAllRlationPers = bisInspAllRlationPersService.get(getCurrentPersId());
  903. if (inspAllRlationPers == null) {
  904. return buildFailResponse("当前用户不存在!!");
  905. }
  906. //只有管理员能够操作
  907. if (!"1".equals(inspAllRlationPers.getPersType())) {
  908. return buildFailResponse(9993, "当前用户无权限执行该操作!!");
  909. }
  910. logger.info("修改用户权限1");
  911. ArrayList<UserRoleParam> userRoleParams = new ArrayList<>();
  912. if (null != bisInspAllRlationPers.getRoleIds() && bisInspAllRlationPers.getRoleIds().size() > 0) {
  913. for (String roleId : bisInspAllRlationPers.getRoleIds()) {
  914. UserRoleParam userRoleParam = new UserRoleParam();
  915. userRoleParam.setUserId(bisInspAllRlationPers.getGuid());
  916. userRoleParam.setRoleId(roleId);
  917. userRoleParams.add(userRoleParam);
  918. }
  919. }
  920. UserRoleParam param = new UserRoleParam();
  921. param.setUserId(bisInspAllRlationPers.getGuid());
  922. BisInspAllRlationPers per = new BisInspAllRlationPers();
  923. per.setGuid(bisInspAllRlationPers.getGuid());
  924. if (StringUtils.isNotBlank(bisInspAllRlationPers.getOwnerSystem())) {
  925. per.setOwnerSystem(bisInspAllRlationPers.getOwnerSystem());
  926. bisInspAllRlationPersService.update(per);
  927. }
  928. logger.info("修改用户权限2");
  929. bisInspAllRlationPersService.updateUser(userRoleParams, param);
  930. logger.info("修改用户权限3");
  931. /* //修改用户类型,为用户添加节点
  932. if (bisInspAllRlationPers.getPersType() != null) {
  933. bisInspAllRlationPersService.updateUserNode(bisInspAllRlationPers.getGuid(), bisInspAllRlationPers.getPersType(), getCurrentOrgId());
  934. }*/
  935. return buildSuccessResponse();
  936. }
  937. @Authority(roles = "1")
  938. @ApiOperation(value = "修改用户(关联角色)")
  939. @PostMapping("/batch/updateRole")
  940. public BaseResponse batchUpdateRole(@RequestBody Map<String, Object> params) {
  941. BisInspAllRlationPers inspAllRlationPers = bisInspAllRlationPersService.get(getCurrentPersId());
  942. if (inspAllRlationPers == null) {
  943. return buildFailResponse("当前用户不存在!!");
  944. }
  945. //只有管理员能够操作
  946. if (!"1".equals(inspAllRlationPers.getPersType())) {
  947. return buildFailResponse(9993, "当前用户无权限执行该操作!!");
  948. }
  949. List<String> roleIds = (List<String>) params.get("roleIds");
  950. List<String> persIdList = (List<String>) params.get("persIdList");
  951. if (CollectionUtils.isEmpty(persIdList) || CollectionUtils.isEmpty(roleIds)) {
  952. return buildFailResponse("roleIds or persIdList is blank");
  953. }
  954. persIdList.stream().distinct().forEach(id -> updateRole(id, roleIds));
  955. return buildSuccessResponse();
  956. }
  957. /**
  958. * 更新用户角色
  959. *
  960. * @param guid 用户ID
  961. * @param roleIds 角色ID
  962. */
  963. private void updateRole(String guid, List<String> roleIds) {
  964. List<UserRoleParam> userRoleParams = new ArrayList<>();
  965. for (String roleId : roleIds) {
  966. UserRoleParam userRoleParam = new UserRoleParam(guid, roleId);
  967. userRoleParams.add(userRoleParam);
  968. }
  969. UserRoleParam param = new UserRoleParam();
  970. param.setUserId(guid);
  971. bisInspAllRlationPersService.updateUser(userRoleParams, param);
  972. }
  973. @ApiOperation(value = "获取在线用户个数", notes = "参数字段说明:{\n\r" +
  974. " \"startTime\":\"统计开始时间(非必填),默认统计最近两小时的在线人员\",\n\r" +
  975. " \"endTime\":\"统计结束时间(非必填)\",\n\r" +
  976. " };\n\r" +
  977. "返回结构说明:{\n\r" +
  978. " \"success\":\"是否成功(true为成功,false为失败)\",\n\r" +
  979. " \"code\":\"错误代码\",\n\r" +
  980. " \"message\":\"描述信息\",\n\r" +
  981. " \"throwable\":\"异常信息\",\n\r" +
  982. " \"data\":\"在线人数\"")
  983. @RequestMapping(value = "/getCountOnlinePers", method = RequestMethod.GET)
  984. public BaseResponse getCountOnlinePers(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) {
  985. if (StringUtils.isBlank(endTime)) {
  986. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  987. Calendar calendar = Calendar.getInstance();
  988. endTime = sdf.format(calendar.getTime());
  989. calendar.set(Calendar.HOUR, calendar.get(Calendar.HOUR) - 2);
  990. startTime = sdf.format(calendar.getTime());
  991. }
  992. String province = olBisInspOrgService.getProvince(getCurrentOrgId());
  993. int ret = bisInspAllRlationPersService.selectCountOnlinePers(startTime, endTime, province);
  994. return buildSuccessResponse(ret);
  995. }
  996. @ApiOperation(value = "获取在线用户", notes = "参数字段说明:{\n\r" +
  997. " \"startTime\":\"统计开始时间(非必填),默认统计最近两小时的在线人员\",\n\r" +
  998. " \"endTime\":\"统计结束时间(非必填)\",\n\r" +
  999. " };\n\r" +
  1000. "返回结构说明: {\n\r" +
  1001. " \"code\":\"请求状态码\",\n\r" +
  1002. " \"data(数据信息对象) \": {\n\r" +
  1003. " \"endRow\":\"尾行\",\n\r" +
  1004. " \"firstPage\":\"首页\",\n\r" +
  1005. " \"hasNextPage\":\"是否有下一页\",\n\r" +
  1006. " \"hasPreviousPage\":\"是否有前一页\",\n\r" +
  1007. " \"isFirstPage\":\"是否是第一页\",\n\r" +
  1008. " \"isLastPage\":\"是否是最后一页\",\n\r" +
  1009. " \"lastPage\":\"最后页\",\n\r" +
  1010. " \"hasPreviousPage\":\"是否有前一页\",\n\r" +
  1011. " \"list(结果集)\":[\n\r" +
  1012. " {\n\r" +
  1013. " \"guid\":\"人员ID\",\n\r" +
  1014. " \"orgId\":\"机构ID\",\n\r" +
  1015. " \"orgNm\":\"机构名称\",\n\r" +
  1016. " \"admDuty\":\"职务\",\n\r" +
  1017. " \"orgGrad\":\"职责\",\n\r" +
  1018. " \"idnm\":\"工作证号\",\n\r" +
  1019. " \"plst\":\"政治面貌\",\n\r" +
  1020. " \"school\":\"学校\",\n\r" +
  1021. " \"specialty\":\"专业\",\n\r" +
  1022. " \"imgurl\":\"照片地址\",\n\r" +
  1023. " \"persName\":\"人员姓名\",\n\r" +
  1024. " \"pwd\":\"密码\",\n\r" +
  1025. " \"telnumb\":\"电话号码\",\n\r" +
  1026. " \"mobilenumb\":\"手机号码\",\n\r" +
  1027. " \"email\":\"邮箱\",\n\r" +
  1028. " \"bornDate\":\"出生日期\",\n\r" +
  1029. " \"collTime\":\"录入日期\",\n\r" +
  1030. " \"remark\":\"备注\",\n\r" +
  1031. " \"faxnumb\":\"传真号码\",\n\r" +
  1032. " }\n\r" +
  1033. " ],\n\r" +
  1034. " \"navigateFirstPage\":\"未知\",\n\r" +
  1035. " \"navigateLastPage\":\"未知\",\n\r" +
  1036. " \"navigatePages\":\"未知\",\n\r" +
  1037. " \"list(结果集)\":[\n\r" +
  1038. " ],\n\r" +
  1039. " \"nextPage\":\"下一页\",\n\r" +
  1040. " \"pageNum\":\"页码\",\n\r" +
  1041. " \"pageSize\":\"每页多少条\",\n\r" +
  1042. " \"pages\":\"总页数\",\n\r" +
  1043. " \"prePage\":\"前一页\",\n\r" +
  1044. " \"size\":\"未知\",\n\r" +
  1045. " \"startRow\":\"未知\",\n\r" +
  1046. " \"total\":\"总条数\",\n\r" +
  1047. " },\n\r" +
  1048. " \"message\":\"响应消息\",\n\r" +
  1049. " \"path\":\"路径\",\n\r" +
  1050. " \"success\":\"是否成功\",\n\r" +
  1051. " \"throwable\":\"异常\",\n\r" +
  1052. " }")
  1053. @RequestMapping(value = "/getOnlinePers", method = RequestMethod.GET)
  1054. public BaseResponse getCountOnlinePers2(@RequestParam(required = false) String sttm, @RequestParam(required = false) String entm) {
  1055. if (StringUtils.isBlank(entm)) {
  1056. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  1057. Calendar calendar = Calendar.getInstance();
  1058. entm = sdf.format(calendar.getTime());
  1059. calendar.set(Calendar.HOUR, calendar.get(Calendar.HOUR) - 2);
  1060. sttm = sdf.format(calendar.getTime());
  1061. }
  1062. List<HashMap<String, Object>> ret = bisInspAllRlationPersService.selectOnlinePers(sttm, entm, getCurrentOrgId());
  1063. return buildSuccessResponse(ret);
  1064. }
  1065. @ApiOperation(value = "更新人员小鱼账号")
  1066. @RequestMapping(value = "/updateCallNumber", method = {RequestMethod.POST})
  1067. public BaseResponse updateCallNumber(HttpServletRequest request, @RequestBody UpdateCallNumberParam param
  1068. ) throws Exception {
  1069. if (StringUtils.isBlank(param.getPersId())) {
  1070. param.setPersId(request.getHeader("persId"));
  1071. }
  1072. if (StringUtils.isBlank(param.getPersId())) {
  1073. throw new Exception("缺少persId");
  1074. }
  1075. if (StringUtils.isBlank(param.getCallNumber())) {
  1076. throw new Exception("缺少callNumber");
  1077. }
  1078. BisInspAllRlationPers p = new BisInspAllRlationPers();
  1079. p.setGuid(param.getPersId());
  1080. p.setCallnumber(param.getCallNumber());
  1081. int ret = bisInspAllRlationPersService.update(p);
  1082. if (ret == -2147482646) {
  1083. return buildSuccessResponse(p);
  1084. } else {
  1085. return buildFailResponse(500, "更新失败", request.getRequestURI(), "");
  1086. }
  1087. }
  1088. @ApiOperation(value = "获取小组组长信息")
  1089. @RequestMapping(value = "getLeaderByGroup", method = RequestMethod.POST)
  1090. public BaseResponse<GroupLeaderDto> getLeaderByGroup(@RequestBody GroupLeaderParam groupLeaderParam) {
  1091. BisInspOrg inspOrg = bisInspOrgDao.get(getCurrentOrgId());
  1092. if (inspOrg != null && !inspOrg.getRlcode().startsWith(AdCodeLabel.START_PARENT_ADCODE)) {
  1093. groupLeaderParam.setProvince(inspOrg.getRlcode());
  1094. }
  1095. return buildSuccessResponse(this.bisInspAllRlationPersService.getLeaderByGroup(groupLeaderParam));
  1096. }
  1097. // @Authority(roles = "1")
  1098. @VerifyBean
  1099. @ApiOperation(value = "获取用户列表(用户管理界面)")
  1100. @RequestMapping(value = "listByCurUser", method = RequestMethod.POST)
  1101. public BaseResponse<PageInfo<PersListDto>> listByCurUser(@RequestBody UserListByCurUserParam param) throws Exception {
  1102. String addvcd = AdLevelUtil.getAddvcd(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
  1103. BisInspOrg inspOrg = bisInspOrgDao.get(getCurrentOrgId());
  1104. if (inspOrg != null && !inspOrg.getRlcode().startsWith(AdCodeLabel.START_PARENT_ADCODE)) {
  1105. param.setProvince(AdLevelUtil.getAddvcd(inspOrg.getRlcode()));
  1106. } else {
  1107. param.setOrgId("");
  1108. }
  1109. PageInfo<PersListDto> list = bisInspAllRlationPersService.listByCurUser(param, addvcd);
  1110. return buildSuccessResponse(list);
  1111. }
  1112. @Authority
  1113. @ApiOperation(value = "获取督查组中人员类型--人员类型(1:组长;2:组员;3:联络员;4:专家;11:前期专家;12:监管专家;13:计划专家;14:财务专家;15:质量专家;16:安全专家;19:助理;20:特派员)")
  1114. @RequestMapping(value = "/getPerType", method = RequestMethod.POST)
  1115. public BaseResponse<List<BisInspAllRlation>> getPerType(@ApiParam(name = "inspGroupId", value = "组ID", required = true) @RequestParam String inspGroupId, @ApiParam(name = "persId", value = "人员ID", required = true) @RequestParam String persId) {
  1116. BisInspAllRlationParam param = new BisInspAllRlationParam();
  1117. param.setId(inspGroupId);
  1118. param.setPersid(persId);
  1119. List<BisInspAllRlation> list = bisInspAllRlationService.findList(param);
  1120. if (list == null || list.size() == 0) {
  1121. list = new ArrayList<>();
  1122. BisInspAllRlation bisInspAllRlation = new BisInspAllRlation();
  1123. bisInspAllRlation.setId(inspGroupId);
  1124. bisInspAllRlation.setPersid(persId);
  1125. bisInspAllRlation.setPertype("1");
  1126. list.add(bisInspAllRlation);
  1127. }
  1128. return buildSuccessResponse(list);
  1129. }
  1130. @Authority
  1131. @ApiOperation(value = "获取稽察组中人员类型--人员类型(1:组长;2:组员;3:联络员;4:专家;11:前期专家;12:监管专家;13:计划专家;14:财务专家;15:质量专家;16:安全专家;19:助理;20:特派员)")
  1132. @RequestMapping(value = "/getPerTypeNew", method = RequestMethod.GET)
  1133. public BaseResponse<List<BisInspAllRlation>> getPerTypeNew(@ApiParam(name = "inspGroupId", value = "组ID", required = true) @RequestParam String inspGroupId, @ApiParam(name = "persId", value = "人员ID", required = true) @RequestParam String persId) {
  1134. BisInspAllRlationPers pers = bisInspAllRlationPersService.get(persId);
  1135. List<BisInspAllRlation> list = new ArrayList<>();
  1136. if ("1".equals(pers.getPersType())) {
  1137. BisInspAllRlation bisInspAllRlation = new BisInspAllRlation();
  1138. bisInspAllRlation.setId(inspGroupId);
  1139. bisInspAllRlation.setPersid(persId);
  1140. bisInspAllRlation.setPertype("1");
  1141. list.add(bisInspAllRlation);
  1142. }
  1143. if (list.size() == 0) {
  1144. TacInspYearBatchGroupPersParam param = new TacInspYearBatchGroupPersParam();
  1145. param.setGroupId(inspGroupId);
  1146. param.setPersId(persId);
  1147. List<BisInspAllRlation> rlations = groupPersService.findPersList(param);
  1148. list.addAll(rlations);
  1149. }
  1150. if (list.size() == 0) {
  1151. BisInspAllRlation bisInspAllRlation = new BisInspAllRlation();
  1152. bisInspAllRlation.setId(inspGroupId);
  1153. bisInspAllRlation.setPersid(persId);
  1154. bisInspAllRlation.setPertype("1");
  1155. list.add(bisInspAllRlation);
  1156. }
  1157. return buildSuccessResponse(list);
  1158. }
  1159. @ApiOperation(value = "获取加密公钥,并且把对应私钥储存到Redis")
  1160. @RequestMapping(value = "/getPubKey", method = RequestMethod.POST)
  1161. public BaseResponse<String> getPubKey() {
  1162. Map<Integer, String> keyMap = Encryption.genKeyPair();
  1163. redisTemplate.opsForValue().set(keyMap.get(0), keyMap.get(1), 10, TimeUnit.MINUTES);
  1164. return buildSuccessResponse(keyMap.get(0));
  1165. }
  1166. @ApiOperation(value = "退出系统")
  1167. @RequestMapping(value = "/logOut", method = RequestMethod.GET)
  1168. public BaseResponse logOut(HttpServletRequest request) {
  1169. String uuid = request.getHeader(CommonLabel.ACCESS_TOKEN);
  1170. String accessToken = (String) redisTemplate.opsForValue().get(uuid);
  1171. if (StringUtils.isNotBlank(accessToken)) {
  1172. String persId = request.getHeader(CommonLabel.PERSID);
  1173. LoginUser inspAllRlationPers = JWTTokenUtil.unsign(accessToken, persId);
  1174. if (inspAllRlationPers != null) {
  1175. BisInspAllRlationPers bisInspAllRlationPers = bisInspAllRlationPersService.get(inspAllRlationPers.getPersId());
  1176. //bisInspAllRlationPersService.sendChannel(uuid, bisInspAllRlationPers, request, PlusEnum.PLUS.getNumber());
  1177. }
  1178. }
  1179. redisTemplate.delete(uuid);
  1180. return buildSuccessResponse();
  1181. }
  1182. @ApiOperation(value = "添加多用户")
  1183. @RequestMapping(value = "/updateListUsers", method = RequestMethod.POST)
  1184. public BaseResponse updateUsers(@ApiParam(name = "AddRlationPersDto", value = "AddRlationPersDto", required = true)
  1185. @RequestBody AddRlationPersDto addRlationPersDto) {
  1186. return buildSuccessResponse(bisInspAllRlationPersService.updateListUsers(addRlationPersDto));
  1187. }
  1188. @ApiOperation(value = "获取对象信息")
  1189. @RequestMapping(value = "/getUserById", method = RequestMethod.POST)
  1190. public BaseResponse<BisInspAllRlationPers> getUserById(HttpServletRequest request) {
  1191. String persId = request.getHeader(CommonLabel.PERSID);
  1192. BisInspAllRlationPers bisInspAllRlationPers = bisInspAllRlationPersService.get(persId);
  1193. return buildSuccessResponse(bisInspAllRlationPers);
  1194. }
  1195. @ApiOperation(value = "获取对象信息")
  1196. @RequestMapping(value = "/getUserInfo", method = RequestMethod.POST)
  1197. public BaseResponse<BisInspAllRlationPers> getUserInfo(@RequestParam String persId) {
  1198. BisInspAllRlationPers bisInspAllRlationPers = bisInspAllRlationPersService.get(persId);
  1199. bisInspAllRlationPers = getBisInspAllRlations(bisInspAllRlationPers);
  1200. return buildSuccessResponse(bisInspAllRlationPers);
  1201. }
  1202. }