AdminApiController.java 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194
  1. package com.goafanti.admin.controller;
  2. import java.io.IOException;
  3. import java.text.ParseException;
  4. import java.util.ArrayList;
  5. import java.util.Calendar;
  6. import java.util.List;
  7. import java.util.UUID;
  8. import javax.annotation.Resource;
  9. import javax.servlet.http.HttpServletRequest;
  10. import org.springframework.stereotype.Controller;
  11. import org.springframework.web.bind.annotation.RequestMapping;
  12. import org.springframework.web.bind.annotation.RequestMethod;
  13. import org.springframework.web.bind.annotation.RequestParam;
  14. import org.springframework.web.multipart.MultipartFile;
  15. import com.goafanti.admin.service.AftFileService;
  16. import com.goafanti.common.bo.Result;
  17. import com.goafanti.common.constant.ErrorConstants;
  18. import com.goafanti.common.controller.BaseApiController;
  19. import com.goafanti.common.model.AftFile;
  20. import com.goafanti.common.model.OrgActivity;
  21. import com.goafanti.common.model.OrgActivityCost;
  22. import com.goafanti.common.model.OrgAnnualReport;
  23. import com.goafanti.common.model.OrgCognizance;
  24. import com.goafanti.common.model.OrgCognizanceLog;
  25. import com.goafanti.common.model.OrgFinance;
  26. import com.goafanti.common.model.OrgHonorDatum;
  27. import com.goafanti.common.model.OrgHumanResource;
  28. import com.goafanti.common.model.OrgIntellectualProperty;
  29. import com.goafanti.common.model.OrgRatepay;
  30. import com.goafanti.common.model.OrgStandard;
  31. import com.goafanti.common.model.OrgTechAchievement;
  32. import com.goafanti.common.model.OrgTechCenter;
  33. import com.goafanti.common.model.OrgTechProduct;
  34. import com.goafanti.common.model.OrganizationIdentity;
  35. import com.goafanti.common.model.User;
  36. import com.goafanti.common.model.UserAbility;
  37. import com.goafanti.common.model.UserIdentity;
  38. import com.goafanti.common.utils.DateUtils;
  39. import com.goafanti.common.utils.LoggerUtils;
  40. import com.goafanti.common.utils.PasswordUtil;
  41. import com.goafanti.common.utils.StringUtils;
  42. import com.goafanti.core.mybatis.page.Pagination;
  43. import com.goafanti.core.shiro.token.TokenManager;
  44. import com.goafanti.techservice.cognizance.bo.ActivityNumberBo;
  45. import com.goafanti.techservice.cognizance.bo.AnnualReportBo;
  46. import com.goafanti.techservice.cognizance.bo.CognizanceDetailBo;
  47. import com.goafanti.techservice.cognizance.service.OrgActivityCostService;
  48. import com.goafanti.techservice.cognizance.service.OrgActivityService;
  49. import com.goafanti.techservice.cognizance.service.OrgAnnualReportService;
  50. import com.goafanti.techservice.cognizance.service.OrgCognizanceLogService;
  51. import com.goafanti.techservice.cognizance.service.OrgCognizanceService;
  52. import com.goafanti.techservice.cognizance.service.OrgFinanceService;
  53. import com.goafanti.techservice.cognizance.service.OrgHonorDatumService;
  54. import com.goafanti.techservice.cognizance.service.OrgIntellectualPropertyService;
  55. import com.goafanti.techservice.cognizance.service.OrgRatepayService;
  56. import com.goafanti.techservice.cognizance.service.OrgStandardService;
  57. import com.goafanti.techservice.cognizance.service.OrgTechAchievementService;
  58. import com.goafanti.techservice.cognizance.service.OrgTechCenterService;
  59. import com.goafanti.techservice.cognizance.service.OrgTechProductService;
  60. import com.goafanti.techservice.patent.service.AdminService;
  61. import com.goafanti.user.bo.OrgListBo;
  62. import com.goafanti.user.bo.UserListBo;
  63. import com.goafanti.user.service.OrgHumanResourceService;
  64. import com.goafanti.user.service.OrganizationIdentityService;
  65. import com.goafanti.user.service.UserAbilityService;
  66. import com.goafanti.user.service.UserIdentityService;
  67. import com.goafanti.user.service.UserService;
  68. @Controller
  69. @RequestMapping(value = "/api/admin")
  70. public class AdminApiController extends BaseApiController {
  71. @Resource
  72. private UserService userService;
  73. @Resource
  74. private UserIdentityService userIdentityService;
  75. @Resource
  76. private OrganizationIdentityService organizationIdentityService;
  77. @Resource
  78. private OrgHumanResourceService orgHumanResourceService;
  79. @Resource
  80. private OrgStandardService orgStandardService;
  81. @Resource
  82. private OrgIntellectualPropertyService orgIntellectualPropertyService;
  83. @Resource
  84. private OrgTechProductService orgTechProductService;
  85. @Resource
  86. private OrgRatepayService orgRatepayService;
  87. @Resource
  88. private OrgFinanceService orgFinanceService;
  89. @Resource
  90. private OrgActivityService orgActivityService;
  91. @Resource
  92. private OrgActivityCostService orgActivityCostService;
  93. @Resource
  94. private OrgTechAchievementService orgTechAchievementService;
  95. @Resource
  96. private OrgHonorDatumService orgHonorDatumService;
  97. @Resource
  98. private OrgTechCenterService orgTechCenterService;
  99. @Resource
  100. private OrgCognizanceService orgCognizanceService;
  101. @Resource
  102. private OrgCognizanceLogService orgCognizanceLogService;
  103. @Resource
  104. private UserAbilityService userAbilityService;
  105. @Resource
  106. private OrgAnnualReportService orgAnnualReportService;
  107. @Resource
  108. private AftFileService aftFileService;
  109. @Resource(name = "passwordUtil")
  110. private PasswordUtil passwordUtil;
  111. @Resource
  112. private AdminService adminService;
  113. /**
  114. * 新增用户
  115. *
  116. * @param mobile
  117. * @param type
  118. * @param unitName
  119. * @return
  120. */
  121. @RequestMapping(value = "/addNewUser", method = RequestMethod.POST)
  122. public Result addNewUser(String mobile, Integer type, String unitName) {
  123. Result res = new Result();
  124. User user = userService.selectByMobieAndType(mobile, type);
  125. if (null != user) {
  126. res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "当前用户已注册!"));
  127. return res;
  128. }
  129. User u = new User();
  130. u.setId(UUID.randomUUID().toString());
  131. u.setMobile(mobile);
  132. u.setPassword(mobile);
  133. u.setType(type);
  134. Calendar now = Calendar.getInstance();
  135. now.set(Calendar.MILLISECOND, 0);
  136. u.setCreateTime(now.getTime());
  137. u.setPassword(passwordUtil.getEncryptPwd(u));
  138. u.setLvl(0);
  139. u.setAid(TokenManager.getAdminId());
  140. userService.insertRegister(u, "", unitName);
  141. return res;
  142. }
  143. /**
  144. * 个人用户列表
  145. *
  146. * @param mobile
  147. * @param email
  148. * @param createTime
  149. * @param number
  150. * @param auditStatus
  151. * @param pageNo
  152. * @param pageSize
  153. * @return
  154. * @throws ParseException
  155. */
  156. @RequestMapping(value = "/userList", method = RequestMethod.POST)
  157. public Result userList(String mobile, String email,
  158. @RequestParam(name = "createTime[]", required = false) String[] createTime, Integer number,
  159. String aftUsername, Integer auditStatus, String pageNo, String pageSize) throws ParseException {
  160. Result res = new Result();
  161. Integer pNo = 1;
  162. Integer pSize = 10;
  163. if (StringUtils.isNumeric(pageSize)) {
  164. pSize = Integer.parseInt(pageSize);
  165. }
  166. if (StringUtils.isNumeric(pageNo)) {
  167. pNo = Integer.parseInt(pageNo);
  168. }
  169. res.setData(getUserList(mobile, email, createTime, number, aftUsername, auditStatus, pNo, pSize));
  170. return res;
  171. }
  172. /**
  173. * 个人用户信息明细
  174. *
  175. * @param uid
  176. * @return
  177. */
  178. @RequestMapping(value = "/userDetail", method = RequestMethod.POST)
  179. public Result userDetail(String uid) {
  180. Result res = new Result();
  181. res.setData(userIdentityService.selectUserIdentityByUserId(uid));
  182. return res;
  183. }
  184. /**
  185. * 修改个人用户信息
  186. *
  187. * @return
  188. * @throws ParseException
  189. */
  190. @RequestMapping(value = "updateUserDetail", method = RequestMethod.POST)
  191. public Result updateUserDetail(UserIdentity userIdentity, String paymentDateFormattedDate) throws ParseException {
  192. Result res = new Result();
  193. if (!StringUtils.isBlank(paymentDateFormattedDate)) {
  194. userIdentity.setPaymentDate(DateUtils.parseDate(paymentDateFormattedDate, "yyyy-MM-dd"));
  195. }
  196. res.setData(userIdentityService.updateByPrimaryKeySelective(userIdentity));
  197. return res;
  198. }
  199. /**
  200. * 团体用户列表
  201. *
  202. * @param mobile
  203. * @param email
  204. * @param createTime
  205. * @param number
  206. * @param auditStatus
  207. * @param pageNo
  208. * @param pageSize
  209. * @return
  210. * @throws ParseException
  211. */
  212. @RequestMapping(value = "/orgList", method = RequestMethod.POST)
  213. public Result orgList(String mobile, String email,
  214. @RequestParam(name = "createTime[]", required = false) String[] createTime, Integer number,
  215. String aftUsername, Integer auditStatus, String pageNo, String pageSize) throws ParseException {
  216. Result res = new Result();
  217. Integer pNo = 1;
  218. Integer pSize = 10;
  219. if (StringUtils.isNumeric(pageSize)) {
  220. pSize = Integer.parseInt(pageSize);
  221. }
  222. if (StringUtils.isNumeric(pageNo)) {
  223. pNo = Integer.parseInt(pageNo);
  224. }
  225. res.setData(getOrgList(mobile, email, createTime, number, aftUsername, auditStatus, pNo, pSize));
  226. return res;
  227. }
  228. /**
  229. * 团体用户明细
  230. *
  231. * @param uid
  232. * @return
  233. */
  234. @RequestMapping(value = "/orgDetail", method = RequestMethod.POST)
  235. public Result orgDetail(String uid) {
  236. Result res = new Result();
  237. res.setData(organizationIdentityService.selectOrgIdentityByUserId(uid));
  238. return res;
  239. }
  240. /**
  241. * 修改团体用户信息
  242. *
  243. * @param orgIdentity
  244. * @return
  245. * @throws ParseException
  246. */
  247. @RequestMapping(value = "/updateOrgDetail", method = RequestMethod.POST)
  248. public Result updateOrgDetail(OrganizationIdentity orgIdentity, String paymentDateFormattedDate)
  249. throws ParseException {
  250. Result res = new Result();
  251. if (!StringUtils.isBlank(paymentDateFormattedDate)) {
  252. orgIdentity.setPaymentDate(DateUtils.parseDate(paymentDateFormattedDate, "yyyy-MM-dd"));
  253. }
  254. res.setData(organizationIdentityService.updateByPrimaryKeySelective(orgIdentity));
  255. return res;
  256. }
  257. /**
  258. * 团体用户人力资源情况入口
  259. *
  260. * @param uid
  261. * 用户ID
  262. * @return
  263. */
  264. @RequestMapping(value = "/orgHumanResource", method = RequestMethod.POST)
  265. public Result orgHumanResource(Integer year, String pageNo, String pageSize, String uid) {
  266. Result res = new Result();
  267. res = checkCertify(res, uid);
  268. if (res.getError().isEmpty()) {
  269. Integer pNo = 1;
  270. Integer pSize = 10;
  271. if (StringUtils.isNumeric(pageSize)) {
  272. pSize = Integer.parseInt(pageSize);
  273. }
  274. if (StringUtils.isNumeric(pageNo)) {
  275. pNo = Integer.parseInt(pageNo);
  276. }
  277. res.setData(orgHumanResourceService.listOrgHumanResource(year, pNo, pSize, uid));
  278. }
  279. return res;
  280. }
  281. /**
  282. * 修改团体用户人力资源情况
  283. *
  284. * @param orgHumanResource
  285. * @return
  286. */
  287. @RequestMapping(value = "/updateOrgHumanResource", method = RequestMethod.POST)
  288. public Result updateOrgHumanResource(OrgHumanResource orgHumanResource) {
  289. Result res = new Result();
  290. if (null == orgHumanResource.getId()) {
  291. if (null != orgHumanResourceService.selectOrgHumanResourceByUidAndYear(orgHumanResource.getYear(),
  292. orgHumanResource.getUid())){
  293. res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度人力资源情况已录入!"));
  294. return res;
  295. }
  296. orgHumanResource.setId(UUID.randomUUID().toString());
  297. orgHumanResource.setDeletedSign(0);
  298. orgHumanResourceService.insert(orgHumanResource);
  299. } else {
  300. orgHumanResourceService.updateByPrimaryKeySelective(orgHumanResource);
  301. }
  302. return res;
  303. }
  304. /**
  305. * 企业参与国家标准或行业标准制定情况明细入口
  306. *
  307. * @param uid
  308. * 用户id
  309. * @return
  310. */
  311. @RequestMapping(value = "/standard", method = RequestMethod.POST)
  312. public Result standard(String uid, String standardName, String standardNumber, Integer standardLevel,
  313. Integer participateWay, String pageNo, String pageSize) {
  314. Result res = new Result();
  315. res = checkCertify(res, uid);
  316. if (res.getError().isEmpty()) {
  317. Integer pNo = 1;
  318. Integer pSize = 10;
  319. if (StringUtils.isNumeric(pageSize)) {
  320. pSize = Integer.parseInt(pageSize);
  321. }
  322. if (StringUtils.isNumeric(pageNo)) {
  323. pNo = Integer.parseInt(pageNo);
  324. }
  325. res.setData(orgStandardService.listOrgStandard(standardName, standardNumber, standardLevel, participateWay,
  326. pNo, pSize, uid));
  327. }
  328. return res;
  329. }
  330. /**
  331. * 企业参与国家标准或行业标准制定情况明细修改保存
  332. *
  333. * @param orgStandard
  334. * @return
  335. */
  336. @RequestMapping(value = "/developStandard", method = RequestMethod.POST)
  337. public Result developStandard(OrgStandard orgStandard) {
  338. Result res = new Result();
  339. if (StringUtils.isBlank(orgStandard.getId())) {
  340. orgStandard.setId(UUID.randomUUID().toString());
  341. orgStandard.setDeletedSign(0);
  342. Calendar now = Calendar.getInstance();
  343. now.set(Calendar.MILLISECOND, 0);
  344. orgStandard.setCreateTime(now.getTime());
  345. orgStandardService.insert(orgStandard);
  346. } else {
  347. orgStandardService.updateByPrimaryKeySelective(orgStandard);
  348. }
  349. res.setData(orgStandard);
  350. return res;
  351. }
  352. /**
  353. * 管理端录入+修改知识产权信息
  354. *
  355. * @return
  356. * @throws ParseException
  357. */
  358. @RequestMapping(value = "/intellectual", method = RequestMethod.POST)
  359. public Result intellectual(OrgIntellectualProperty orgIntellectualProperty, String authorizationDateFormattedDate,
  360. String uid) throws ParseException {
  361. Result res = new Result();
  362. if (!StringUtils.isBlank(authorizationDateFormattedDate)) {
  363. orgIntellectualProperty
  364. .setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
  365. }
  366. if (null == orgIntellectualProperty.getId()) {
  367. orgIntellectualProperty.setId(UUID.randomUUID().toString());
  368. orgIntellectualProperty.setUid(uid);
  369. orgIntellectualProperty.setEvaluationCategory(
  370. (orgIntellectualProperty.getCatagory() >= 2 && orgIntellectualProperty.getCatagory() <= 4) ? 1 : 0);
  371. orgIntellectualProperty.setDeletedSign(0);
  372. res.setData(orgIntellectualPropertyService.insert(orgIntellectualProperty));
  373. } else {
  374. orgIntellectualProperty.setEvaluationCategory(orgIntellectualProperty.getCatagory() <= 2 ? 1 : 0);
  375. res.setData(orgIntellectualPropertyService.updateByPrimaryKeySelective(orgIntellectualProperty));
  376. }
  377. return res;
  378. }
  379. /**
  380. * 知识产权列表
  381. *
  382. * @param pageNo
  383. * @param pageSize
  384. * @return
  385. */
  386. @RequestMapping(value = "/intellectualList", method = RequestMethod.POST)
  387. public Result intellectualList(String pageNo, String pageSize, String uid) {
  388. Result res = new Result();
  389. res = checkCertify(res, uid);
  390. if (res.getError().isEmpty()) {
  391. Integer pNo = 1;
  392. Integer pSize = 10;
  393. if (StringUtils.isNumeric(pageSize)) {
  394. pSize = Integer.parseInt(pageSize);
  395. }
  396. if (StringUtils.isNumeric(pageNo)) {
  397. pNo = Integer.parseInt(pageNo);
  398. }
  399. res.setData(orgIntellectualPropertyService.listIntellectual(pNo, pSize, uid));
  400. }
  401. return res;
  402. }
  403. /**
  404. * 上年度高新技术产品(服务)情况列表
  405. *
  406. * @param pageNo
  407. * @param pageSize
  408. * @return
  409. */
  410. @RequestMapping(value = "/techProductList", method = RequestMethod.POST)
  411. public Result techProductList(String pageNo, String pageSize, String uid) {
  412. Result res = new Result();
  413. res = checkCertify(res, uid);
  414. if (res.getError().isEmpty()) {
  415. Integer pNo = 1;
  416. Integer pSize = 10;
  417. if (StringUtils.isNumeric(pageSize)) {
  418. pSize = Integer.parseInt(pageSize);
  419. }
  420. if (StringUtils.isNumeric(pageNo)) {
  421. pNo = Integer.parseInt(pageNo);
  422. }
  423. res.setData(orgTechProductService.listTechProduct(pNo, pSize, uid));
  424. }
  425. return res;
  426. }
  427. /**
  428. * 企业研究开发活动情况表入口
  429. *
  430. * @param activityNumber
  431. * @param activityName
  432. * @param startDate
  433. * @param endDate
  434. * @param pageNo
  435. * @param pageSize
  436. * @return
  437. * @throws ParseException
  438. */
  439. @RequestMapping(value = "/activityList", method = RequestMethod.POST)
  440. public Result activityList(String activityNumber, String activityName, String startDateFormattedDate,
  441. String endDateFormattedDate, String pageNo, String pageSize, String uid) throws ParseException {
  442. Result res = new Result();
  443. res = checkCertify(res, uid);
  444. if (res.getError().isEmpty()) {
  445. Integer pNo = 1;
  446. Integer pSize = 10;
  447. if (StringUtils.isNumeric(pageSize)) {
  448. pSize = Integer.parseInt(pageSize);
  449. }
  450. if (StringUtils.isNumeric(pageNo)) {
  451. pNo = Integer.parseInt(pageNo);
  452. }
  453. res.setData(orgActivityService.listOrgActivity(activityNumber, activityName, startDateFormattedDate,
  454. endDateFormattedDate, pNo, pSize, uid));
  455. }
  456. return res;
  457. }
  458. /**
  459. * 企业研究开发活动情况新增、修改
  460. *
  461. * @param orgActivity
  462. * @return
  463. * @throws ParseException
  464. */
  465. @RequestMapping(value = "/activity", method = RequestMethod.POST)
  466. public Result activity(OrgActivity orgActivity, String startDateFormattedDate, String endDateFormattedDate)
  467. throws ParseException {
  468. Result res = new Result();
  469. orgActivity.setDeletedSign(0);
  470. if (!StringUtils.isBlank(startDateFormattedDate)) {
  471. orgActivity.setStartDate(DateUtils.parseDate(startDateFormattedDate, "yyyy-MM-dd"));
  472. }
  473. if (StringUtils.isBlank(endDateFormattedDate)) {
  474. orgActivity.setEndDate(DateUtils.parseDate(endDateFormattedDate, "yyyy-MM-dd"));
  475. }
  476. if (StringUtils.isBlank(orgActivity.getId())) {
  477. orgActivity.setId(UUID.randomUUID().toString());
  478. orgActivity.setUid(TokenManager.getUserId());
  479. orgActivityService.insert(orgActivity);
  480. } else {
  481. orgActivityService.updateByPrimaryKeySelective(orgActivity);
  482. Boolean flag = false;
  483. OrgActivityCost cost = orgActivityCostService.selectOrgActivityCostByAid(orgActivity.getId());
  484. if (null != cost) {
  485. if (!StringUtils.isBlank(orgActivity.getActivityNumber())) {
  486. cost.setActivityNumber(orgActivity.getActivityNumber());
  487. flag = true;
  488. }
  489. if (null == orgActivity.getStartDate()) {
  490. cost.setStartDate(orgActivity.getStartDate());
  491. flag = true;
  492. }
  493. if (null == orgActivity.getEndDate()) {
  494. cost.setEndDate(orgActivity.getEndDate());
  495. flag = true;
  496. }
  497. }
  498. if (flag) {
  499. orgActivityCostService.updateByPrimaryKeySelective(cost);
  500. }
  501. }
  502. res.setData(orgActivity);
  503. return res;
  504. }
  505. /**
  506. * 企业年度研究开发费用结构明细表列表入口
  507. *
  508. * @return
  509. * @throws ParseException
  510. */
  511. @RequestMapping(value = "/activityCostList", method = RequestMethod.POST)
  512. public Result activityCostList(String activityNumber, String startDateFormattedDate, String endDateFormattedDate,
  513. String pageNo, String pageSize, String uid) throws ParseException {
  514. Result res = new Result();
  515. res = checkCertify(res, uid);
  516. if (res.getError().isEmpty()) {
  517. Integer pNo = 1;
  518. Integer pSize = 10;
  519. if (StringUtils.isNumeric(pageSize)) {
  520. pSize = Integer.parseInt(pageSize);
  521. }
  522. if (StringUtils.isNumeric(pageNo)) {
  523. pNo = Integer.parseInt(pageNo);
  524. }
  525. res.setData(orgActivityCostService.listOrgActivityCost(activityNumber, startDateFormattedDate,
  526. endDateFormattedDate, pNo, pSize, uid));
  527. }
  528. return res;
  529. }
  530. /**
  531. * 企业年度研究开发费用结构明细表(新增+修改)
  532. *
  533. * @return
  534. * @throws ParseException
  535. */
  536. @RequestMapping(value = "/activityCost", method = RequestMethod.POST)
  537. public Result activityCost(OrgActivityCost orgActivityCost, String signDateFormattedDate) throws ParseException {
  538. Result res = new Result();
  539. if (StringUtils.isBlank(signDateFormattedDate)) {
  540. orgActivityCost.setSignDate(DateUtils.parseDate(signDateFormattedDate, "yyyy-MM-dd"));
  541. }
  542. if (null == orgActivityCost.getId()) {
  543. OrgActivity ac = orgActivityService.selectOrgActivityByPrimaryKey(orgActivityCost.getAid());
  544. orgActivityCost.setStartDate(ac.getStartDate());
  545. orgActivityCost.setEndDate(ac.getEndDate());
  546. orgActivityCost.setId(UUID.randomUUID().toString());
  547. orgActivityCost.setUid(TokenManager.getUserId());
  548. orgActivityCost.setDeletedSign(0);
  549. orgActivityCostService.insert(orgActivityCost);
  550. } else {
  551. orgActivityCostService.updateByPrimaryKeySelective(orgActivityCost);
  552. }
  553. return res;
  554. }
  555. /**
  556. * 上年度高新技术产品(服务)情况(新增+修改)
  557. *
  558. * @param orgTechProduct
  559. * @return
  560. */
  561. @RequestMapping(value = "/techProduct", method = RequestMethod.POST)
  562. public Result techProduct(OrgTechProduct orgTechProduct) {
  563. Result res = new Result();
  564. if (null == orgTechProduct.getId()) {
  565. orgTechProduct.setId(UUID.randomUUID().toString());
  566. orgTechProduct.setDeletedSign(0);
  567. Calendar now = Calendar.getInstance();
  568. now.set(Calendar.MILLISECOND, 0);
  569. orgTechProduct.setCreateTime(now.getTime());
  570. orgTechProduct.setYear(Calendar.getInstance().get(Calendar.YEAR) - 1);
  571. orgTechProductService.insert(orgTechProduct);
  572. } else {
  573. orgTechProductService.updateByPrimaryKeySelective(orgTechProduct);
  574. }
  575. res.setData(orgTechProduct);
  576. return res;
  577. }
  578. /**
  579. * 企业纳税申报信息入口
  580. *
  581. * @return
  582. */
  583. @RequestMapping(value = "/ratepay", method = RequestMethod.POST)
  584. public Result ratepay(Integer year, String pageNo, String pageSize, String uid) {
  585. Result res = new Result();
  586. res = checkCertify(res, uid);
  587. if (res.getError().isEmpty()) {
  588. Integer pNo = 1;
  589. Integer pSize = 10;
  590. if (StringUtils.isNumeric(pageSize)) {
  591. pSize = Integer.parseInt(pageSize);
  592. }
  593. if (StringUtils.isNumeric(pageNo)) {
  594. pNo = Integer.parseInt(pageNo);
  595. }
  596. res.setData(orgRatepayService.listOrgRatepay(year, pNo, pSize, uid));
  597. }
  598. return res;
  599. }
  600. /**
  601. * 企业纳税申报信息录入+修改
  602. */
  603. @RequestMapping(value = "/disposeRatepay", method = RequestMethod.POST)
  604. public Result disposeRatepay(OrgRatepay orgRatepay) {
  605. Result res = new Result();
  606. if (null == orgRatepay.getId()) {
  607. if (null == orgRatepayService.selectRatepayByUidAndYear(orgRatepay.getUid(), orgRatepay.getYear())) {
  608. orgRatepay.setId(UUID.randomUUID().toString());
  609. orgRatepay.setDeletedSign(0);
  610. orgRatepayService.insert(orgRatepay);
  611. } else {
  612. res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度纳税申报表已录入!"));
  613. return res;
  614. }
  615. } else {
  616. orgRatepayService.updateByPrimaryKeySelective(orgRatepay);
  617. }
  618. return res;
  619. }
  620. /**
  621. * 财务报表信息入口
  622. *
  623. * @return
  624. */
  625. @RequestMapping(value = "/finance", method = RequestMethod.POST)
  626. public Result finance(Integer year, String pageNo, String pageSize, String uid) {
  627. Result res = new Result();
  628. res = checkCertify(res, uid);
  629. if (res.getError().isEmpty()) {
  630. Integer pNo = 1;
  631. Integer pSize = 10;
  632. if (StringUtils.isNumeric(pageSize)) {
  633. pSize = Integer.parseInt(pageSize);
  634. }
  635. if (StringUtils.isNumeric(pageNo)) {
  636. pNo = Integer.parseInt(pageNo);
  637. }
  638. res.setData(orgFinanceService.listFinance(year, pNo, pSize, uid));
  639. }
  640. return res;
  641. }
  642. /**
  643. * 财务报表录入+修改
  644. *
  645. * @param orgFinance
  646. * @return
  647. */
  648. @RequestMapping(value = "/disposeFinance", method = RequestMethod.POST)
  649. public Result disposeFinance(OrgFinance orgFinance) {
  650. Result res = new Result();
  651. if (null == orgFinance.getId()) {
  652. if (null == orgFinanceService.selectFinanceByUidAndYear(orgFinance.getUid(), orgFinance.getYear())) {
  653. orgFinance.setId(UUID.randomUUID().toString());
  654. orgFinance.setDeletedSign(0);
  655. orgFinanceService.insert(orgFinance);
  656. } else {
  657. res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度财务报表已录入!"));
  658. return res;
  659. }
  660. } else {
  661. orgFinanceService.updateByPrimaryKeySelective(orgFinance);
  662. }
  663. return res;
  664. }
  665. /**
  666. * 获取当前用户已录入项目标号列表
  667. *
  668. * @param uid
  669. * @return
  670. */
  671. @RequestMapping(value = "/activityNumber", method = RequestMethod.POST)
  672. public Result listActivityNumber(String uid) {
  673. Result res = new Result();
  674. List<ActivityNumberBo> activityNumberBo = orgActivityService.selectOrgActivityNumberBoByUid(uid);
  675. res.setData(activityNumberBo);
  676. return res;
  677. }
  678. /**
  679. * 科技成果转化情况列表入口
  680. *
  681. * @param pageNo
  682. * @param pageSize
  683. * @return
  684. */
  685. @RequestMapping(value = "/achievementList", method = RequestMethod.POST)
  686. public Result achievementList(String pageNo, String pageSize, String uid) {
  687. Result res = new Result();
  688. res = checkCertify(res, uid);
  689. if (res.getError().isEmpty()) {
  690. Integer pNo = 1;
  691. Integer pSize = 10;
  692. if (StringUtils.isNumeric(pageSize)) {
  693. pSize = Integer.parseInt(pageSize);
  694. }
  695. if (StringUtils.isNumeric(pageNo)) {
  696. pNo = Integer.parseInt(pageNo);
  697. }
  698. res.setData(orgTechAchievementService.listOrgTechAchievement(pNo, pSize, uid));
  699. }
  700. return res;
  701. }
  702. /**
  703. * 科技成果转化情况新增+修改
  704. *
  705. * @param achievement
  706. * @return
  707. * @throws ParseException
  708. */
  709. @RequestMapping(value = "/disposeAchievement", method = RequestMethod.POST)
  710. public Result disposeAchievement(OrgTechAchievement achievement) throws ParseException {
  711. Result res = new Result();
  712. if (null == achievement.getId()) {
  713. achievement.setId(UUID.randomUUID().toString());
  714. achievement.setDeletedSign(0);
  715. orgTechAchievementService.inset(achievement);
  716. } else {
  717. orgTechAchievementService.updateByPrimaryKeySelective(achievement);
  718. }
  719. return res;
  720. }
  721. /**
  722. * 企业荣誉及其他证明材料列表入口
  723. *
  724. * @return
  725. */
  726. @RequestMapping(value = "/honorList", method = RequestMethod.POST)
  727. public Result honorList(String pageNo, String pageSize, String uid) {
  728. Result res = new Result();
  729. res = checkCertify(res, uid);
  730. if (res.getError().isEmpty()) {
  731. Integer pNo = 1;
  732. Integer pSize = 10;
  733. if (StringUtils.isNumeric(pageSize)) {
  734. pSize = Integer.parseInt(pageSize);
  735. }
  736. if (StringUtils.isNumeric(pageNo)) {
  737. pNo = Integer.parseInt(pageNo);
  738. }
  739. res.setData(orgHonorDatumService.listOrgHonorDatum(pNo, pSize, uid));
  740. }
  741. return res;
  742. }
  743. /**
  744. * 企业荣誉及其他证明材料新增+修改
  745. *
  746. * @param achievement
  747. * @return
  748. * @throws ParseException
  749. */
  750. @RequestMapping(value = "/disposeHonor", method = RequestMethod.POST)
  751. public Result disposeHonor(OrgHonorDatum honor, String issuingTimeFormattedDate, String uid) throws ParseException {
  752. Result res = new Result();
  753. if (!StringUtils.isBlank(issuingTimeFormattedDate)) {
  754. honor.setIssuingTime(DateUtils.parseDate(issuingTimeFormattedDate, "yyyy-MM-dd"));
  755. }
  756. if (null == honor.getId()) {
  757. honor.setId(UUID.randomUUID().toString());
  758. honor.setUid(uid);
  759. honor.setDeletedSign(0);
  760. orgHonorDatumService.inset(honor);
  761. } else {
  762. orgHonorDatumService.updateByPrimaryKeySelective(honor);
  763. }
  764. return res;
  765. }
  766. /**
  767. * 技术中心入口
  768. *
  769. * @return
  770. */
  771. @RequestMapping(value = "/center", method = RequestMethod.POST)
  772. public Result center(String uid) {
  773. Result res = new Result();
  774. res = checkCertify(res, uid);
  775. if (res.getError().isEmpty()) {
  776. res.setData(orgTechCenterService.selectOrgTechCenterByUid(uid));
  777. }
  778. return res;
  779. }
  780. /**
  781. * 技术中心新增+修改
  782. *
  783. * @return
  784. * @throws ParseException
  785. */
  786. @RequestMapping(value = "/disposeCenter", method = RequestMethod.POST)
  787. public Result disposeCenter(OrgTechCenter orgTechCenter, String foundingTimeFormattedDate, String uid)
  788. throws ParseException {
  789. Result res = new Result();
  790. if (!StringUtils.isBlank(foundingTimeFormattedDate)) {
  791. orgTechCenter.setFoundingTime(DateUtils.parseDate(foundingTimeFormattedDate, "yyyy-MM-dd"));
  792. }
  793. if (null == orgTechCenter.getId()) {
  794. orgTechCenter.setId(UUID.randomUUID().toString());
  795. orgTechCenter.setUid(uid);
  796. orgTechCenter.setDeletedSign(0);
  797. orgTechCenterService.insert(orgTechCenter);
  798. } else {
  799. orgTechCenterService.updateByPrimaryKeySelective(orgTechCenter);
  800. }
  801. return res;
  802. }
  803. /**
  804. * 获取公司联系人
  805. *
  806. * @return
  807. */
  808. @RequestMapping(value = "/getContacts", method = RequestMethod.POST)
  809. public Result getContacts(String uid) {
  810. Result res = new Result();
  811. res.setData(organizationIdentityService.selectContactsByUserId(uid));
  812. return res;
  813. }
  814. /**
  815. * 申请高企认定
  816. *
  817. * @return
  818. */
  819. @RequestMapping(value = "/applyCognizance", method = RequestMethod.POST)
  820. public Result applyCognizance(Integer contacts, String comment, String consultant, String uid, Integer year,
  821. Integer state) {
  822. Result res = new Result();
  823. if (null != orgCognizanceService.selectCognizanceByUidAndYear(year, uid)) {
  824. res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度高企认定已申请!"));
  825. }
  826. OrgCognizance c = new OrgCognizance();
  827. c.setId(UUID.randomUUID().toString());
  828. c.setUid(uid);
  829. c.setContacts(contacts);
  830. c.setComment(comment);
  831. c.setConsultant(consultant);
  832. c.setYear(year);
  833. c.setDeletedSign(0);
  834. c.setState(state);
  835. Calendar now = Calendar.getInstance();
  836. now.set(Calendar.MILLISECOND, 0);
  837. c.setRecordTime(now.getTime());
  838. orgCognizanceService.insert(c);
  839. OrgCognizanceLog log = new OrgCognizanceLog();
  840. log.setId(UUID.randomUUID().toString());
  841. log.setCid(c.getId());
  842. log.setRecordTime(c.getCreateTime());
  843. log.setState(state);
  844. log.setComment(comment);
  845. log.setPrincipal(userService.selectByPrimaryKey(uid).getAid());
  846. log.setOperator(TokenManager.getAdminId());
  847. orgCognizanceLogService.insert(log);
  848. return res;
  849. }
  850. /**
  851. * 高企认定列表入口
  852. *
  853. * @param locationProvince
  854. * @param unitName
  855. * @return
  856. */
  857. @RequestMapping(value = "/listCognizance", method = RequestMethod.POST)
  858. public Result listCognizance(String uid, String locationProvince, String pageNo, String pageSize) {
  859. Result res = new Result();
  860. Integer pNo = 1;
  861. Integer pSize = 10;
  862. if (StringUtils.isNumeric(pageSize)) {
  863. pSize = Integer.parseInt(pageSize);
  864. }
  865. if (StringUtils.isNumeric(pageNo)) {
  866. pNo = Integer.parseInt(pageNo);
  867. }
  868. res.setData(orgCognizanceService.listCognizance(uid, locationProvince, pNo, pSize));
  869. return res;
  870. }
  871. /**
  872. * 高企认定流转状态
  873. *
  874. * @param cid
  875. * @return
  876. */
  877. @RequestMapping(value = "/cognizanceLog", method = RequestMethod.POST)
  878. public Result cognizanceLog(String cid) {
  879. Result res = new Result();
  880. List<OrgCognizanceLog> list = orgCognizanceLogService.selectOrgCognizanceLogByCid(cid);
  881. res.setData(list);
  882. return res;
  883. }
  884. /**
  885. * 高企认定详情入口
  886. *
  887. * @param uid
  888. * @param cid
  889. * @return
  890. */
  891. @RequestMapping(value = "/cognizanceDetail", method = RequestMethod.POST)
  892. public Result cognizanceDetail(String uid, String cid, Integer year) {
  893. Result res = new Result();
  894. res.setData(handleCognizanceDetail(uid, cid, year));
  895. return res;
  896. }
  897. /**
  898. * 保存高企认定详情
  899. *
  900. * @throws ParseException
  901. */
  902. @RequestMapping(value = "/disposeCognizanceDetail", method = RequestMethod.POST)
  903. public Result disposeCognizanceDetail(OrgCognizance cog, OrgCognizanceLog log, String recordTimeFormattedDate)
  904. throws ParseException {
  905. Result res = new Result();
  906. if (null != log.getState()) {
  907. cog.setState(log.getState());
  908. switch (log.getState()) {
  909. case 1:
  910. cog.setCreateTime(log.getRecordTime());
  911. break;
  912. case 2:
  913. cog.setAcceptDate(log.getRecordTime());
  914. break;
  915. case 5:
  916. cog.setIssuingDate(log.getRecordTime());
  917. break;
  918. }
  919. log.setId(UUID.randomUUID().toString());
  920. log.setCid(cog.getId());
  921. log.setOperator(TokenManager.getAdminId());
  922. if (!StringUtils.isBlank(recordTimeFormattedDate)) {
  923. log.setRecordTime(DateUtils.parseDate(recordTimeFormattedDate, "yyyy-MM-dd"));
  924. }
  925. orgCognizanceLogService.insert(log);
  926. }
  927. orgCognizanceService.updateByPrimaryKeySelective(cog);
  928. return res;
  929. }
  930. /**
  931. * 刪除高企认定
  932. *
  933. * @param ids
  934. * @return
  935. */
  936. @RequestMapping(value = "/deleteCognizance", method = RequestMethod.POST)
  937. public Result deleteAnnualReport(@RequestParam(name = "ids[]", required = true) String[] ids) {
  938. Result res = new Result();
  939. List<String> id = new ArrayList<String>();
  940. for (String s : ids) {
  941. id.add(s);
  942. }
  943. res.setData(orgCognizanceService.batchDeleteByPrimaryKey(id));
  944. return res;
  945. }
  946. /**
  947. * 企业创新能力入口
  948. *
  949. * @param uid
  950. * @return
  951. */
  952. @RequestMapping(value = "/able", method = RequestMethod.POST)
  953. public Result able(String uid) {
  954. Result res = new Result();
  955. res.setData(userAbilityService.selectUserAbilityByUserId(uid));
  956. return res;
  957. }
  958. /**
  959. * 企业创新能力新增+保存
  960. *
  961. * @param u
  962. * @return
  963. */
  964. @RequestMapping(value = "/disposeAble", method = RequestMethod.POST)
  965. public Result disposeAble(UserAbility u) {
  966. Result res = new Result();
  967. if (null == u.getId()) {
  968. u.setId(UUID.randomUUID().toString());
  969. userAbilityService.insert(u);
  970. } else {
  971. userAbilityService.updateByPrimaryKeySelective(u);
  972. }
  973. return res;
  974. }
  975. /**
  976. * 年报列表
  977. *
  978. * @return
  979. */
  980. @RequestMapping(value = "/annualReport", method = RequestMethod.POST)
  981. public Result annualReport(String uid, Integer year, Integer state, String pageSize, String pageNo) {
  982. Result res = new Result();
  983. res = checkCertify(res, uid);
  984. if (res.getError().isEmpty()) {
  985. Integer pNo = 1;
  986. Integer pSize = 10;
  987. if (StringUtils.isNumeric(pageSize)) {
  988. pSize = Integer.parseInt(pageSize);
  989. }
  990. if (StringUtils.isNumeric(pageNo)) {
  991. pNo = Integer.parseInt(pageNo);
  992. }
  993. res.setData(orgAnnualReportService.listOrgAnnualReport(year, state, pNo, pSize, uid));
  994. }
  995. return res;
  996. }
  997. /**
  998. * 企业年报详情
  999. *
  1000. * @param uid
  1001. * @param year
  1002. * @return
  1003. */
  1004. @RequestMapping(value = "/annualReportDetail", method = RequestMethod.POST)
  1005. public Result annualReportDetail(String uid, Integer year) {
  1006. Result res = new Result();
  1007. res.setData(handleAnnualReport(uid, year));
  1008. return res;
  1009. }
  1010. /**
  1011. * 高企年报新增+修改
  1012. *
  1013. * @param orgAnnualReport
  1014. * @return
  1015. */
  1016. @RequestMapping(value = "/disposeAnnualReport", method = RequestMethod.POST)
  1017. public Result disposeAnnualReport(OrgAnnualReport orgAnnualReport) {
  1018. Result res = new Result();
  1019. if (null == orgAnnualReport.getId()) {
  1020. if (null != orgAnnualReportService.selectAnnualReportByYearAndUid(orgAnnualReport.getYear(),
  1021. orgAnnualReport.getUid())) {
  1022. res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年企业年报已录入!"));
  1023. return res;
  1024. } else {
  1025. orgAnnualReport.setId(UUID.randomUUID().toString());
  1026. Calendar now = Calendar.getInstance();
  1027. now.set(Calendar.MILLISECOND, 0);
  1028. orgAnnualReport.setCreateTime(now.getTime());
  1029. orgAnnualReport.setLastUpdateTime(orgAnnualReport.getCreateTime());
  1030. orgAnnualReport.setDeletedSign(0);
  1031. orgAnnualReportService.insert(orgAnnualReport);
  1032. }
  1033. } else {
  1034. Calendar now = Calendar.getInstance();
  1035. now.set(Calendar.MILLISECOND, 0);
  1036. orgAnnualReport.setLastUpdateTime(now.getTime());
  1037. orgAnnualReportService.updateByPrimaryKeySelective(orgAnnualReport);
  1038. }
  1039. return res;
  1040. }
  1041. /**
  1042. * 上传相关模版
  1043. *
  1044. * @param req
  1045. * @return
  1046. */
  1047. @RequestMapping(value = "/uploadTemplate", method = RequestMethod.POST)
  1048. public Result uploadPatentTemplate(HttpServletRequest req, String sign) {
  1049. Result res = new Result();
  1050. System.out.println("init");
  1051. String fileName = "";
  1052. List<MultipartFile> files = getFiles(req);
  1053. MultipartFile mf = files.get(0);
  1054. String suffix = mf.getOriginalFilename().substring(mf.getOriginalFilename().lastIndexOf("."));
  1055. System.err.println("suffix" + " " + suffix);
  1056. if (suffix.equals(".doc") || suffix.equals(".docx")) {
  1057. if ("patent_prory_statement".equals(sign)) {
  1058. fileName = "patent_prory_statement" + suffix;
  1059. } else {
  1060. fileName = System.nanoTime() + "";
  1061. }
  1062. String name = handleFile(res, req, fileName, files, mf);
  1063. res.setData(name);
  1064. System.out.println(name);
  1065. if (res.getData() != "" && res.getData() != null && null == aftFileService.selectAftFileBySign(sign)) {
  1066. AftFile f = new AftFile();
  1067. f.setId(UUID.randomUUID().toString());
  1068. if ("patent_prory_statement".equals(sign)) {
  1069. f.setFileName("专利代理委托书模版");
  1070. f.setSign(sign);
  1071. }
  1072. f.setFilePath("/admin/" + fileName);
  1073. f.setDeleletedSign(0);
  1074. aftFileService.insert(f);
  1075. }
  1076. } else {
  1077. res.getError().add(buildError(ErrorConstants.FILE_PATTERN_ERROR, "文件格式错误,请重新上传!"));
  1078. }
  1079. return res;
  1080. }
  1081. /**
  1082. *
  1083. * @return
  1084. */
  1085. // 判断用户是否通过认证
  1086. private Result checkCertify(Result res, String uid) {
  1087. OrganizationIdentity o = organizationIdentityService.selectOrgIdentityByUserId(uid);
  1088. if (null == o || 5 != o.getAuditStatus()) {
  1089. res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
  1090. }
  1091. return res;
  1092. }
  1093. // org团体列表
  1094. private Pagination<OrgListBo> getOrgList(String mobile, String email, String[] createTime, Integer number,
  1095. String aftUsername, Integer auditStatus, Integer pNo, Integer pSize) throws ParseException {
  1096. return userService.listOrg(mobile, email, createTime, number, aftUsername, auditStatus, pNo, pSize);
  1097. }
  1098. // user个人列表
  1099. private Pagination<UserListBo> getUserList(String mobile, String email, String[] createTime, Integer number,
  1100. String aftUsername, Integer auditStatus, Integer pNo, Integer pSize) throws ParseException {
  1101. return userService.listUser(mobile, email, createTime, number, aftUsername, auditStatus, pNo, pSize);
  1102. }
  1103. // 高企详情
  1104. private CognizanceDetailBo handleCognizanceDetail(String uid, String cid, Integer year) {
  1105. return orgCognizanceService.selectCognizanceDetailBo(uid, cid, year);
  1106. }
  1107. // 年报
  1108. private AnnualReportBo handleAnnualReport(String uid, Integer year) {
  1109. return orgAnnualReportService.selectAnnualReportBo(uid, year);
  1110. }
  1111. private String handleFile(Result res, HttpServletRequest req, String fileName, List<MultipartFile> files,
  1112. MultipartFile mf) {
  1113. if (!files.isEmpty()) {
  1114. try {
  1115. mf.transferTo(toAdminPrivateFile(fileName));
  1116. LoggerUtils.debug(getClass(), fileName + " 文件上传成功");
  1117. } catch (IllegalStateException | IOException e) {
  1118. LoggerUtils.error(getClass(), "文件上传失败", e);
  1119. res.getError().add(buildError("", "文件上传失败!"));
  1120. return "";
  1121. }
  1122. } else {
  1123. res.getError().add(buildError("", "文件上传失败!"));
  1124. return "";
  1125. }
  1126. return fileName;
  1127. }
  1128. }