AdminApiController.java 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877
  1. package com.goafanti.admin.controller;
  2. import java.text.ParseException;
  3. import java.util.Calendar;
  4. import java.util.LinkedHashMap;
  5. import java.util.List;
  6. import java.util.Map;
  7. import java.util.UUID;
  8. import javax.annotation.Resource;
  9. import org.springframework.stereotype.Controller;
  10. import org.springframework.web.bind.annotation.RequestMapping;
  11. import org.springframework.web.bind.annotation.RequestMethod;
  12. import org.springframework.web.bind.annotation.RequestParam;
  13. import com.goafanti.common.bo.Result;
  14. import com.goafanti.common.constant.ErrorConstants;
  15. import com.goafanti.common.controller.BaseApiController;
  16. import com.goafanti.common.model.OrgActivity;
  17. import com.goafanti.common.model.OrgActivityCost;
  18. import com.goafanti.common.model.OrgCognizance;
  19. import com.goafanti.common.model.OrgCognizanceLog;
  20. import com.goafanti.common.model.OrgFinance;
  21. import com.goafanti.common.model.OrgHonorDatum;
  22. import com.goafanti.common.model.OrgHumanResource;
  23. import com.goafanti.common.model.OrgIntellectualProperty;
  24. import com.goafanti.common.model.OrgRatepay;
  25. import com.goafanti.common.model.OrgStandard;
  26. import com.goafanti.common.model.OrgTechAchievement;
  27. import com.goafanti.common.model.OrgTechCenter;
  28. import com.goafanti.common.model.OrgTechProduct;
  29. import com.goafanti.common.model.OrganizationIdentity;
  30. import com.goafanti.common.model.UserIdentity;
  31. import com.goafanti.common.utils.DateUtils;
  32. import com.goafanti.common.utils.StringUtils;
  33. import com.goafanti.core.mybatis.page.Pagination;
  34. import com.goafanti.core.shiro.token.TokenManager;
  35. import com.goafanti.techservice.cognizance.bo.ActivityNumberBo;
  36. import com.goafanti.techservice.cognizance.service.OrgActivityCostService;
  37. import com.goafanti.techservice.cognizance.service.OrgActivityService;
  38. import com.goafanti.techservice.cognizance.service.OrgCognizanceLogService;
  39. import com.goafanti.techservice.cognizance.service.OrgCognizanceService;
  40. import com.goafanti.techservice.cognizance.service.OrgFinanceService;
  41. import com.goafanti.techservice.cognizance.service.OrgHonorDatumService;
  42. import com.goafanti.techservice.cognizance.service.OrgIntellectualPropertyService;
  43. import com.goafanti.techservice.cognizance.service.OrgRatepayService;
  44. import com.goafanti.techservice.cognizance.service.OrgStandardService;
  45. import com.goafanti.techservice.cognizance.service.OrgTechAchievementService;
  46. import com.goafanti.techservice.cognizance.service.OrgTechCenterService;
  47. import com.goafanti.techservice.cognizance.service.OrgTechProductService;
  48. import com.goafanti.user.bo.OrgListBo;
  49. import com.goafanti.user.bo.UserListBo;
  50. import com.goafanti.user.service.OrgHumanResourceService;
  51. import com.goafanti.user.service.OrganizationIdentityService;
  52. import com.goafanti.user.service.UserIdentityService;
  53. import com.goafanti.user.service.UserService;
  54. @Controller
  55. @RequestMapping(value = "/api/admin")
  56. public class AdminApiController extends BaseApiController {
  57. @Resource
  58. private UserService userService;
  59. @Resource
  60. private UserIdentityService userIdentityService;
  61. @Resource
  62. private OrganizationIdentityService organizationIdentityService;
  63. @Resource
  64. private OrgHumanResourceService orgHumanResourceService;
  65. @Resource
  66. private OrgStandardService orgStandardService;
  67. @Resource
  68. private OrgIntellectualPropertyService orgIntellectualPropertyService;
  69. @Resource
  70. private OrgTechProductService orgTechProductService;
  71. @Resource
  72. private OrgRatepayService orgRatepayService;
  73. @Resource
  74. private OrgFinanceService orgFinanceService;
  75. @Resource
  76. private OrgActivityService orgActivityService;
  77. @Resource
  78. private OrgActivityCostService orgActivityCostService;
  79. @Resource
  80. private OrgTechAchievementService orgTechAchievementService;
  81. @Resource
  82. private OrgHonorDatumService orgHonorDatumService;
  83. @Resource
  84. private OrgTechCenterService orgTechCenterService;
  85. @Resource
  86. private OrgCognizanceService orgCognizanceService;
  87. @Resource
  88. private OrgCognizanceLogService orgCognizanceLogService;
  89. /**
  90. * 个人用户列表
  91. *
  92. * @param mobile
  93. * @param email
  94. * @param createTime
  95. * @param number
  96. * @param auditStatus
  97. * @param pageNo
  98. * @param pageSize
  99. * @return
  100. * @throws ParseException
  101. */
  102. @RequestMapping(value = "/userList", method = RequestMethod.POST)
  103. public Result userList(String mobile, String email,
  104. @RequestParam(name = "createTime[]", required = false) String[] createTime, Integer number,
  105. String aftUsername, Integer auditStatus, String pageNo, String pageSize) throws ParseException {
  106. Result res = new Result();
  107. Integer pNo = 1;
  108. Integer pSize = 10;
  109. if (StringUtils.isNumeric(pageSize)) {
  110. pSize = Integer.parseInt(pageSize);
  111. }
  112. if (StringUtils.isNumeric(pageNo)) {
  113. pNo = Integer.parseInt(pageNo);
  114. }
  115. res.setData(getUserList(mobile, email, createTime, number, aftUsername, auditStatus, pNo, pSize));
  116. return res;
  117. }
  118. /**
  119. * 个人用户信息明细
  120. *
  121. * @param uid
  122. * @return
  123. */
  124. @RequestMapping(value = "/userDetail", method = RequestMethod.POST)
  125. public Result userDetail(String uid) {
  126. Result res = new Result();
  127. res.setData(userIdentityService.selectUserIdentityByUserId(uid));
  128. return res;
  129. }
  130. /**
  131. * 修改个人用户信息
  132. *
  133. * @return
  134. */
  135. @RequestMapping(value = "updateUserDetail", method = RequestMethod.POST)
  136. public Result updateUserDetail(UserIdentity userIdentity) {
  137. Result res = new Result();
  138. res.setData(userIdentityService.updateByPrimaryKeySelective(userIdentity));
  139. return res;
  140. }
  141. /**
  142. * 团体用户列表
  143. *
  144. * @param mobile
  145. * @param email
  146. * @param createTime
  147. * @param number
  148. * @param auditStatus
  149. * @param pageNo
  150. * @param pageSize
  151. * @return
  152. * @throws ParseException
  153. */
  154. @RequestMapping(value = "/orgList", method = RequestMethod.POST)
  155. public Result orgList(String mobile, String email,
  156. @RequestParam(name = "createTime[]", required = false) String[] createTime, Integer number,
  157. String aftUsername, Integer auditStatus, String pageNo, String pageSize) throws ParseException {
  158. Result res = new Result();
  159. Integer pNo = 1;
  160. Integer pSize = 10;
  161. if (StringUtils.isNumeric(pageSize)) {
  162. pSize = Integer.parseInt(pageSize);
  163. }
  164. if (StringUtils.isNumeric(pageNo)) {
  165. pNo = Integer.parseInt(pageNo);
  166. }
  167. res.setData(getOrgList(mobile, email, createTime, number, aftUsername, auditStatus, pNo, pSize));
  168. return res;
  169. }
  170. /**
  171. * 团体用户明细
  172. *
  173. * @param uid
  174. * @return
  175. */
  176. @RequestMapping(value = "/orgDetail", method = RequestMethod.POST)
  177. public Result orgDetail(String uid) {
  178. Result res = new Result();
  179. res.setData(organizationIdentityService.selectOrgIdentityByUserId(uid));
  180. return res;
  181. }
  182. /**
  183. * 修改团体用户信息
  184. *
  185. * @param orgIdentity
  186. * @return
  187. */
  188. @RequestMapping(value = "/updateOrgDetail", method = RequestMethod.POST)
  189. public Result updateOrgDetail(OrganizationIdentity orgIdentity) {
  190. Result res = new Result();
  191. res.setData(organizationIdentityService.updateByPrimaryKeySelective(orgIdentity));
  192. return res;
  193. }
  194. /**
  195. * 团体用户人力资源情况入口
  196. *
  197. * @param uid
  198. * 用户ID
  199. * @return
  200. */
  201. @RequestMapping(value = "/orgHumanResource", method = RequestMethod.POST)
  202. public Result orgHumanResource(Integer year, String pageNo, String pageSize, String uid) {
  203. Result res = new Result();
  204. res = checkCertify(res,uid);
  205. if (res.getError().isEmpty()) {
  206. Integer pNo = 1;
  207. Integer pSize = 10;
  208. if (StringUtils.isNumeric(pageSize)) {
  209. pSize = Integer.parseInt(pageSize);
  210. }
  211. if (StringUtils.isNumeric(pageNo)) {
  212. pNo = Integer.parseInt(pageNo);
  213. }
  214. res.setData(orgHumanResourceService.listOrgHumanResource(year, pNo, pSize, uid));
  215. }
  216. return res;
  217. }
  218. /**
  219. * 修改团体用户人力资源情况
  220. *
  221. * @param orgHumanResource
  222. * @return
  223. */
  224. @RequestMapping(value = "/updateOrgHumanResource", method = RequestMethod.POST)
  225. public Result updateOrgHumanResource(OrgHumanResource orgHumanResource) {
  226. Result res = new Result();
  227. if (null == orgHumanResource.getId()) {
  228. orgHumanResource.setId(UUID.randomUUID().toString());
  229. orgHumanResourceService.insert(orgHumanResource);
  230. } else {
  231. orgHumanResourceService.updateByPrimaryKeySelective(orgHumanResource);
  232. }
  233. return res;
  234. }
  235. /**
  236. * 企业参与国家标准或行业标准制定情况明细入口
  237. *
  238. * @param uid
  239. * 用户id
  240. * @return
  241. */
  242. @RequestMapping(value = "/standard", method = RequestMethod.POST)
  243. public Result standard(String uid, String standardName, String standardNumber, Integer standardLevel,
  244. Integer participateWay, String pageNo, String pageSize) {
  245. Result res = new Result();
  246. res = checkCertify(res, uid);
  247. if (res.getError().isEmpty()) {
  248. Integer pNo = 1;
  249. Integer pSize = 10;
  250. if (StringUtils.isNumeric(pageSize)) {
  251. pSize = Integer.parseInt(pageSize);
  252. }
  253. if (StringUtils.isNumeric(pageNo)) {
  254. pNo = Integer.parseInt(pageNo);
  255. }
  256. res.setData(orgStandardService.listOrgStandard(standardName, standardNumber, standardLevel, participateWay,
  257. pNo, pSize, uid));
  258. }
  259. return res;
  260. }
  261. /**
  262. * 企业参与国家标准或行业标准制定情况明细修改保存
  263. *
  264. * @param orgStandard
  265. * @return
  266. */
  267. @RequestMapping(value = "/developStandard", method = RequestMethod.POST)
  268. public Result developStandard(OrgStandard orgStandard) {
  269. Result res = new Result();
  270. if (StringUtils.isBlank(orgStandard.getId())) {
  271. orgStandard.setId(UUID.randomUUID().toString());
  272. orgStandard.setDeletedSign(0);
  273. Calendar now = Calendar.getInstance();
  274. now.set(Calendar.MILLISECOND, 0);
  275. orgStandard.setCreateTime(now.getTime());
  276. orgStandardService.insert(orgStandard);
  277. } else {
  278. orgStandardService.updateByPrimaryKeySelective(orgStandard);
  279. }
  280. res.setData(orgStandard);
  281. return res;
  282. }
  283. /**
  284. * 管理端录入+修改知识产权信息
  285. *
  286. * @return
  287. * @throws ParseException
  288. */
  289. @RequestMapping(value = "/intellectual", method = RequestMethod.POST)
  290. public Result intellectual(OrgIntellectualProperty orgIntellectualProperty, String authorizationDateFormattedDate,
  291. String uid) throws ParseException {
  292. Result res = new Result();
  293. if (!StringUtils.isBlank(authorizationDateFormattedDate)) {
  294. orgIntellectualProperty
  295. .setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
  296. }
  297. if (null == orgIntellectualProperty.getId()) {
  298. orgIntellectualProperty.setId(UUID.randomUUID().toString());
  299. orgIntellectualProperty.setUid(uid);
  300. orgIntellectualProperty.setEvaluationCategory(
  301. (orgIntellectualProperty.getCatagory() >= 2 && orgIntellectualProperty.getCatagory() <= 4) ? 1 : 0);
  302. orgIntellectualProperty.setDeletedSign(0);
  303. res.setData(orgIntellectualPropertyService.insert(orgIntellectualProperty));
  304. } else {
  305. orgIntellectualProperty.setEvaluationCategory(orgIntellectualProperty.getCatagory() <= 2 ? 1 : 0);
  306. res.setData(orgIntellectualPropertyService.updateByPrimaryKeySelective(orgIntellectualProperty));
  307. }
  308. return res;
  309. }
  310. /**
  311. * 知识产权列表
  312. *
  313. * @param pageNo
  314. * @param pageSize
  315. * @return
  316. */
  317. @RequestMapping(value = "/intellectualList", method = RequestMethod.POST)
  318. public Result intellectualList(String pageNo, String pageSize, String uid) {
  319. Result res = new Result();
  320. res = checkCertify(res, uid);
  321. if (res.getError().isEmpty()) {
  322. Integer pNo = 1;
  323. Integer pSize = 10;
  324. if (StringUtils.isNumeric(pageSize)) {
  325. pSize = Integer.parseInt(pageSize);
  326. }
  327. if (StringUtils.isNumeric(pageNo)) {
  328. pNo = Integer.parseInt(pageNo);
  329. }
  330. res.setData(orgIntellectualPropertyService.listIntellectual(pNo, pSize, uid));
  331. }
  332. return res;
  333. }
  334. /**
  335. * 上年度高新技术产品(服务)情况列表
  336. *
  337. * @param pageNo
  338. * @param pageSize
  339. * @return
  340. */
  341. @RequestMapping(value = "/techProductList", method = RequestMethod.POST)
  342. public Result techProductList(String pageNo, String pageSize, String uid) {
  343. Result res = new Result();
  344. res = checkCertify(res,uid);
  345. if (res.getError().isEmpty()) {
  346. Integer pNo = 1;
  347. Integer pSize = 10;
  348. if (StringUtils.isNumeric(pageSize)) {
  349. pSize = Integer.parseInt(pageSize);
  350. }
  351. if (StringUtils.isNumeric(pageNo)) {
  352. pNo = Integer.parseInt(pageNo);
  353. }
  354. res.setData(orgTechProductService.listTechProduct(pNo, pSize, uid));
  355. }
  356. return res;
  357. }
  358. /**
  359. * 企业研究开发活动情况表入口
  360. *
  361. * @param activityNumber
  362. * @param activityName
  363. * @param startDate
  364. * @param endDate
  365. * @param pageNo
  366. * @param pageSize
  367. * @return
  368. * @throws ParseException
  369. */
  370. @RequestMapping(value = "/activityList", method = RequestMethod.POST)
  371. public Result activityList(String activityNumber, String activityName, String startDateFormattedDate,
  372. String endDateFormattedDate, String pageNo, String pageSize, String uid) throws ParseException {
  373. Result res = new Result();
  374. res = checkCertify(res,uid);
  375. if (res.getError().isEmpty()) {
  376. Integer pNo = 1;
  377. Integer pSize = 10;
  378. if (StringUtils.isNumeric(pageSize)) {
  379. pSize = Integer.parseInt(pageSize);
  380. }
  381. if (StringUtils.isNumeric(pageNo)) {
  382. pNo = Integer.parseInt(pageNo);
  383. }
  384. res.setData(orgActivityService.listOrgActivity(activityNumber, activityName, startDateFormattedDate,
  385. endDateFormattedDate, pNo, pSize, uid));
  386. }
  387. return res;
  388. }
  389. /**
  390. * 企业研究开发活动情况新增、修改
  391. *
  392. * @param orgActivity
  393. * @return
  394. * @throws ParseException
  395. */
  396. @RequestMapping(value = "/activity", method = RequestMethod.POST)
  397. public Result activity(OrgActivity orgActivity, String startDateFormattedDate, String endDateFormattedDate)
  398. throws ParseException {
  399. Result res = new Result();
  400. orgActivity.setDeletedSign(0);
  401. if (!StringUtils.isBlank(startDateFormattedDate)) {
  402. orgActivity.setStartDate(DateUtils.parseDate(startDateFormattedDate, "yyyy-MM-dd"));
  403. }
  404. if (StringUtils.isBlank(endDateFormattedDate)) {
  405. orgActivity.setEndDate(DateUtils.parseDate(endDateFormattedDate, "yyyy-MM-dd"));
  406. }
  407. if (StringUtils.isBlank(orgActivity.getId())) {
  408. orgActivity.setId(UUID.randomUUID().toString());
  409. orgActivity.setUid(TokenManager.getUserId());
  410. orgActivityService.insert(orgActivity);
  411. } else {
  412. orgActivityService.updateByPrimaryKeySelective(orgActivity);
  413. Boolean flag = false;
  414. OrgActivityCost cost = orgActivityCostService.selectOrgActivityCostByAid(orgActivity.getId());
  415. if (null != cost) {
  416. if (!StringUtils.isBlank(orgActivity.getActivityNumber())) {
  417. cost.setActivityNumber(orgActivity.getActivityNumber());
  418. flag = true;
  419. }
  420. if (null == orgActivity.getStartDate()) {
  421. cost.setStartDate(orgActivity.getStartDate());
  422. flag = true;
  423. }
  424. if (null == orgActivity.getEndDate()) {
  425. cost.setEndDate(orgActivity.getEndDate());
  426. flag = true;
  427. }
  428. }
  429. if (flag) {
  430. orgActivityCostService.updateByPrimaryKeySelective(cost);
  431. }
  432. }
  433. res.setData(orgActivity);
  434. return res;
  435. }
  436. /**
  437. * 企业年度研究开发费用结构明细表列表入口
  438. *
  439. * @return
  440. * @throws ParseException
  441. */
  442. @RequestMapping(value = "/activityCostList", method = RequestMethod.POST)
  443. public Result activityCostList(String activityNumber, String startDateFormattedDate, String endDateFormattedDate,
  444. String pageNo, String pageSize, String uid) throws ParseException {
  445. Result res = new Result();
  446. res = checkCertify(res,uid);
  447. if (res.getError().isEmpty()) {
  448. Integer pNo = 1;
  449. Integer pSize = 10;
  450. if (StringUtils.isNumeric(pageSize)) {
  451. pSize = Integer.parseInt(pageSize);
  452. }
  453. if (StringUtils.isNumeric(pageNo)) {
  454. pNo = Integer.parseInt(pageNo);
  455. }
  456. res.setData(orgActivityCostService.listOrgActivityCost(activityNumber, startDateFormattedDate,
  457. endDateFormattedDate, pNo, pSize, uid));
  458. }
  459. return res;
  460. }
  461. /**
  462. * 企业年度研究开发费用结构明细表(新增+修改)
  463. *
  464. * @return
  465. * @throws ParseException
  466. */
  467. @RequestMapping(value = "/activityCost", method = RequestMethod.POST)
  468. public Result activityCost(OrgActivityCost orgActivityCost, String signDateFormattedDate) throws ParseException {
  469. Result res = new Result();
  470. if (StringUtils.isBlank(signDateFormattedDate)) {
  471. orgActivityCost.setSignDate(DateUtils.parseDate(signDateFormattedDate, "yyyy-MM-dd"));
  472. }
  473. if (null == orgActivityCost.getId()) {
  474. OrgActivity ac = orgActivityService.selectOrgActivityByPrimaryKey(orgActivityCost.getAid());
  475. orgActivityCost.setStartDate(ac.getStartDate());
  476. orgActivityCost.setEndDate(ac.getEndDate());
  477. orgActivityCost.setId(UUID.randomUUID().toString());
  478. orgActivityCost.setUid(TokenManager.getUserId());
  479. orgActivityCost.setDeletedSign(0);
  480. orgActivityCostService.insert(orgActivityCost);
  481. } else {
  482. orgActivityCostService.updateByPrimaryKeySelective(orgActivityCost);
  483. }
  484. return res;
  485. }
  486. /**
  487. * 上年度高新技术产品(服务)情况(新增+修改)
  488. *
  489. * @param orgTechProduct
  490. * @return
  491. */
  492. @RequestMapping(value = "/techProduct", method = RequestMethod.POST)
  493. public Result techProduct(OrgTechProduct orgTechProduct) {
  494. Result res = new Result();
  495. if (null == orgTechProduct.getId()) {
  496. orgTechProduct.setId(UUID.randomUUID().toString());
  497. orgTechProduct.setDeletedSign(0);
  498. orgTechProductService.insert(orgTechProduct);
  499. } else {
  500. orgTechProductService.updateByPrimaryKeySelective(orgTechProduct);
  501. }
  502. res.setData(orgTechProduct);
  503. return res;
  504. }
  505. /**
  506. * 企业纳税申报信息入口
  507. *
  508. * @return
  509. */
  510. @RequestMapping(value = "/ratepay", method = RequestMethod.POST)
  511. public Result ratepay(Integer year, String pageNo, String pageSize, String uid) {
  512. Result res = new Result();
  513. res = checkCertify(res,uid);
  514. if (res.getError().isEmpty()) {
  515. Integer pNo = 1;
  516. Integer pSize = 10;
  517. if (StringUtils.isNumeric(pageSize)) {
  518. pSize = Integer.parseInt(pageSize);
  519. }
  520. if (StringUtils.isNumeric(pageNo)) {
  521. pNo = Integer.parseInt(pageNo);
  522. }
  523. res.setData(orgRatepayService.listOrgRatepay(year, pNo, pSize, uid));
  524. }
  525. return res;
  526. }
  527. /**
  528. * 企业纳税申报信息录入+修改
  529. */
  530. @RequestMapping(value = "/disposeRatepay", method = RequestMethod.POST)
  531. public Result disposeRatepay(OrgRatepay orgRatepay) {
  532. Result res = new Result();
  533. if (null == orgRatepay.getId()) {
  534. orgRatepay.setId(UUID.randomUUID().toString());
  535. orgRatepay.setDeletedSign(0);
  536. orgRatepayService.insert(orgRatepay);
  537. } else {
  538. orgRatepayService.updateByPrimaryKeySelective(orgRatepay);
  539. }
  540. return res;
  541. }
  542. /**
  543. * 财务报表信息入口
  544. *
  545. * @return
  546. */
  547. @RequestMapping(value = "/finance", method = RequestMethod.POST)
  548. public Result finance(Integer year, String pageNo, String pageSize, String uid) {
  549. Result res = new Result();
  550. res = checkCertify(res,uid);
  551. if (res.getError().isEmpty()) {
  552. Integer pNo = 1;
  553. Integer pSize = 10;
  554. if (StringUtils.isNumeric(pageSize)) {
  555. pSize = Integer.parseInt(pageSize);
  556. }
  557. if (StringUtils.isNumeric(pageNo)) {
  558. pNo = Integer.parseInt(pageNo);
  559. }
  560. res.setData(orgFinanceService.listFinance(year, pNo, pSize, uid));
  561. }
  562. return res;
  563. }
  564. /**
  565. * 财务报表录入+修改
  566. *
  567. * @param orgFinance
  568. * @return
  569. */
  570. @RequestMapping(value = "/disposeFinance", method = RequestMethod.POST)
  571. public Result disposeFinance(OrgFinance orgFinance) {
  572. Result res = new Result();
  573. if (null == orgFinance.getId()) {
  574. orgFinance.setId(UUID.randomUUID().toString());
  575. orgFinance.setDeletedSign(0);
  576. orgFinanceService.insert(orgFinance);
  577. } else {
  578. orgFinanceService.updateByPrimaryKeySelective(orgFinance);
  579. }
  580. return res;
  581. }
  582. /**
  583. * 获取当前用户已录入项目标号列表
  584. *
  585. * @param uid
  586. * @return
  587. */
  588. @RequestMapping(value = "/activityNumber", method = RequestMethod.POST)
  589. public Result listActivityNumber(String uid) {
  590. Result res = new Result();
  591. List<ActivityNumberBo> activityNumberBo = orgActivityService.selectOrgActivityNumberBoByUid(uid);
  592. res.setData(activityNumberBo);
  593. return res;
  594. }
  595. /**
  596. * 科技成果转化情况列表入口
  597. *
  598. * @param pageNo
  599. * @param pageSize
  600. * @return
  601. */
  602. @RequestMapping(value = "/achievementList", method = RequestMethod.POST)
  603. public Result achievementList(String pageNo, String pageSize, String uid) {
  604. Result res = new Result();
  605. res = checkCertify(res,uid);
  606. if (res.getError().isEmpty()) {
  607. Integer pNo = 1;
  608. Integer pSize = 10;
  609. if (StringUtils.isNumeric(pageSize)) {
  610. pSize = Integer.parseInt(pageSize);
  611. }
  612. if (StringUtils.isNumeric(pageNo)) {
  613. pNo = Integer.parseInt(pageNo);
  614. }
  615. res.setData(orgTechAchievementService.listOrgTechAchievement(pNo, pSize, uid));
  616. }
  617. return res;
  618. }
  619. /**
  620. * 科技成果转化情况新增+修改
  621. *
  622. * @param achievement
  623. * @return
  624. * @throws ParseException
  625. */
  626. @RequestMapping(value = "/disposeAchievement", method = RequestMethod.POST)
  627. public Result disposeAchievement(OrgTechAchievement achievement) throws ParseException {
  628. Result res = new Result();
  629. if (null == achievement.getId()) {
  630. achievement.setId(UUID.randomUUID().toString());
  631. achievement.setDeletedSign(0);
  632. orgTechAchievementService.inset(achievement);
  633. } else {
  634. orgTechAchievementService.updateByPrimaryKeySelective(achievement);
  635. }
  636. return res;
  637. }
  638. /**
  639. * 企业荣誉及其他证明材料列表入口
  640. *
  641. * @return
  642. */
  643. @RequestMapping(value = "/honorList", method = RequestMethod.POST)
  644. public Result honorList(String pageNo, String pageSize, String uid) {
  645. Result res = new Result();
  646. res = checkCertify(res,uid);
  647. if (res.getError().isEmpty()) {
  648. Integer pNo = 1;
  649. Integer pSize = 10;
  650. if (StringUtils.isNumeric(pageSize)) {
  651. pSize = Integer.parseInt(pageSize);
  652. }
  653. if (StringUtils.isNumeric(pageNo)) {
  654. pNo = Integer.parseInt(pageNo);
  655. }
  656. res.setData(orgHonorDatumService.listOrgHonorDatum(pNo, pSize, uid));
  657. }
  658. return res;
  659. }
  660. /**
  661. * 企业荣誉及其他证明材料新增+修改
  662. *
  663. * @param achievement
  664. * @return
  665. * @throws ParseException
  666. */
  667. @RequestMapping(value = "/disposeHonor", method = RequestMethod.POST)
  668. public Result disposeHonor(OrgHonorDatum honor, String issuingTimeFormattedDate, String uid) throws ParseException {
  669. Result res = new Result();
  670. if (!StringUtils.isBlank(issuingTimeFormattedDate)) {
  671. honor.setIssuingTime(DateUtils.parseDate(issuingTimeFormattedDate, "yyyy-MM-dd"));
  672. }
  673. if (null == honor.getId()) {
  674. honor.setId(UUID.randomUUID().toString());
  675. honor.setUid(uid);
  676. honor.setDeletedSign(0);
  677. orgHonorDatumService.inset(honor);
  678. } else {
  679. orgHonorDatumService.updateByPrimaryKeySelective(honor);
  680. }
  681. return res;
  682. }
  683. /**
  684. * 技术中心入口
  685. *
  686. * @return
  687. */
  688. @RequestMapping(value = "/center", method = RequestMethod.POST)
  689. public Result center(String uid) {
  690. Result res = new Result();
  691. res = checkCertify(res,uid);
  692. if (res.getError().isEmpty()) {
  693. res.setData(orgTechCenterService.selectOrgTechCenterByUid(uid));
  694. }
  695. return res;
  696. }
  697. /**
  698. * 技术中心新增+修改
  699. *
  700. * @return
  701. * @throws ParseException
  702. */
  703. @RequestMapping(value = "/disposeCenter", method = RequestMethod.POST)
  704. public Result disposeCenter(OrgTechCenter orgTechCenter, String foundingTimeFormattedDate, String uid)
  705. throws ParseException {
  706. Result res = new Result();
  707. if (!StringUtils.isBlank(foundingTimeFormattedDate)) {
  708. orgTechCenter.setFoundingTime(DateUtils.parseDate(foundingTimeFormattedDate, "yyyy-MM-dd"));
  709. }
  710. if (null == orgTechCenter.getId()) {
  711. orgTechCenter.setId(UUID.randomUUID().toString());
  712. orgTechCenter.setUid(uid);
  713. orgTechCenter.setDeletedSign(0);
  714. orgTechCenterService.insert(orgTechCenter);
  715. } else {
  716. orgTechCenterService.updateByPrimaryKeySelective(orgTechCenter);
  717. }
  718. return res;
  719. }
  720. /**
  721. * 获取公司联系人
  722. *
  723. * @return
  724. */
  725. @RequestMapping(value = "/getContacts", method = RequestMethod.POST)
  726. public Result getContacts(String uid) {
  727. Result res = new Result();
  728. OrganizationIdentity i = organizationIdentityService.selectOrgIdentityByUserId(uid);
  729. Map<String, String> map = new LinkedHashMap<String, String>();
  730. if (!StringUtils.isBlank(i.getFirstContacts()) && !StringUtils.isBlank(i.getFirstMobile())) {
  731. map.put(i.getFirstContacts(), i.getFirstMobile());
  732. }
  733. if (!StringUtils.isBlank(i.getSecondContacts()) && !StringUtils.isBlank(i.getSecondMobile())) {
  734. map.put(i.getSecondContacts(), i.getSecondMobile());
  735. }
  736. if (!StringUtils.isBlank(i.getThirdContacts()) && !StringUtils.isBlank(i.getThirdMobile())) {
  737. map.put(i.getThirdContacts(), i.getThirdMobile());
  738. }
  739. res.setData(map);
  740. return res;
  741. }
  742. /**
  743. * 申请高企认定
  744. *
  745. * @return
  746. */
  747. @RequestMapping(value = "/applyCognizance", method = RequestMethod.POST)
  748. public Result applyCognizance(String contacts, String comment, String consultant, String uid) {
  749. Result res = new Result();
  750. OrgCognizance c = new OrgCognizance();
  751. c.setId(UUID.randomUUID().toString());
  752. c.setUid(uid);
  753. c.setContacts(contacts);
  754. c.setComment(comment);
  755. c.setConsultant(consultant);
  756. c.setYear(Calendar.getInstance().get(Calendar.YEAR));
  757. c.setDeletedSign(0);
  758. orgCognizanceService.insert(c);
  759. return res;
  760. }
  761. /**
  762. * 高企认定列表入口
  763. *
  764. * @param locationProvince
  765. * @param unitName
  766. * @return
  767. */
  768. @RequestMapping(value = "/listCognizance", method = RequestMethod.POST)
  769. public Result listCognizance(String locationProvince, String unitName, String pageNo, String pageSize) {
  770. Result res = new Result();
  771. Integer pNo = 1;
  772. Integer pSize = 10;
  773. if (StringUtils.isNumeric(pageSize)) {
  774. pSize = Integer.parseInt(pageSize);
  775. }
  776. if (StringUtils.isNumeric(pageNo)) {
  777. pNo = Integer.parseInt(pageNo);
  778. }
  779. res.setData(orgCognizanceService.listCognizance(locationProvince, unitName, pNo, pSize));
  780. return res;
  781. }
  782. /**
  783. * 高企认定流转状态
  784. * @param cid
  785. * @return
  786. */
  787. @RequestMapping(value = "/cognizanceLog", method = RequestMethod.POST)
  788. public Result cognizanceLog(String cid){
  789. Result res = new Result();
  790. List<OrgCognizanceLog> list = orgCognizanceLogService.selectOrgCognizanceLogByCid(cid);
  791. System.out.println(list.size());
  792. res.setData(list);
  793. return res;
  794. }
  795. /**
  796. * 高企认定详情入口
  797. * @param uid
  798. * @param cid
  799. * @return
  800. */
  801. @RequestMapping(value = "/cognizanceDetail", method = RequestMethod.POST)
  802. public Result cognizanceDetail(String uid, String cid){
  803. Result res = new Result();
  804. return res;
  805. }
  806. // 判断用户是否通过认证
  807. private Result checkCertify(Result res, String uid) {
  808. if (5 != organizationIdentityService.selectOrgIdentityByUserId(uid).getAuditStatus()) {
  809. res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
  810. }
  811. return res;
  812. }
  813. // org团体列表
  814. private Pagination<OrgListBo> getOrgList(String mobile, String email, String[] createTime, Integer number,
  815. String aftUsername, Integer auditStatus, Integer pNo, Integer pSize) throws ParseException {
  816. return (Pagination<OrgListBo>) userService.listOrg(mobile, email, createTime, number, aftUsername, auditStatus,
  817. pNo, pSize);
  818. }
  819. // user个人列表
  820. private Pagination<UserListBo> getUserList(String mobile, String email, String[] createTime, Integer number,
  821. String aftUsername, Integer auditStatus, Integer pNo, Integer pSize) throws ParseException {
  822. return (Pagination<UserListBo>) userService.listUser(mobile, email, createTime, number, aftUsername,
  823. auditStatus, pNo, pSize);
  824. }
  825. }