AdminApiController.java 105 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115
  1. package com.goafanti.admin.controller;
  2. import java.math.BigDecimal;
  3. import java.text.ParseException;
  4. import java.util.Arrays;
  5. import java.util.Calendar;
  6. import java.util.Date;
  7. import java.util.HashMap;
  8. import java.util.List;
  9. import java.util.Map;
  10. import java.util.TreeMap;
  11. import java.util.UUID;
  12. import javax.annotation.Resource;
  13. import javax.servlet.http.HttpServletRequest;
  14. import javax.servlet.http.HttpServletResponse;
  15. import javax.validation.Valid;
  16. import org.springframework.beans.BeanUtils;
  17. import org.springframework.beans.factory.annotation.Autowired;
  18. import org.springframework.stereotype.Controller;
  19. import org.springframework.validation.BindingResult;
  20. import org.springframework.web.bind.annotation.RequestMapping;
  21. import org.springframework.web.bind.annotation.RequestMethod;
  22. import org.springframework.web.bind.annotation.RequestParam;
  23. import com.goafanti.admin.bo.InputAdmin;
  24. import com.goafanti.admin.service.AdminService;
  25. import com.goafanti.cognizance.bo.ActivityNumberBo;
  26. import com.goafanti.cognizance.bo.AnnualReportBo;
  27. import com.goafanti.cognizance.bo.CognizanceDetailBo;
  28. import com.goafanti.cognizance.bo.InputApplyCognizance;
  29. import com.goafanti.cognizance.bo.InputOrgActivity;
  30. import com.goafanti.cognizance.bo.InputOrgActivityCost;
  31. import com.goafanti.cognizance.bo.InputOrgAnnualReport;
  32. import com.goafanti.cognizance.bo.InputOrgCognizance;
  33. import com.goafanti.cognizance.bo.InputOrgFinance;
  34. import com.goafanti.cognizance.bo.InputOrgHonorDatum;
  35. import com.goafanti.cognizance.bo.InputOrgHumanResource;
  36. import com.goafanti.cognizance.bo.InputOrgIntellectualProperty;
  37. import com.goafanti.cognizance.bo.InputOrgRatepay;
  38. import com.goafanti.cognizance.bo.InputOrgStandard;
  39. import com.goafanti.cognizance.bo.InputOrgTechAchievement;
  40. import com.goafanti.cognizance.bo.InputOrgTechCenter;
  41. import com.goafanti.cognizance.bo.InputOrgTechCenterDetail;
  42. import com.goafanti.cognizance.bo.InputOrgTechProduct;
  43. import com.goafanti.cognizance.bo.OrgIntellectualPropertyDetailBo;
  44. import com.goafanti.cognizance.service.OrgActivityCostService;
  45. import com.goafanti.cognizance.service.OrgActivityService;
  46. import com.goafanti.cognizance.service.OrgAnnualReportService;
  47. import com.goafanti.cognizance.service.OrgCognizanceLogService;
  48. import com.goafanti.cognizance.service.OrgCognizanceProportionService;
  49. import com.goafanti.cognizance.service.OrgCognizanceService;
  50. import com.goafanti.cognizance.service.OrgFinanceService;
  51. import com.goafanti.cognizance.service.OrgHonorDatumService;
  52. import com.goafanti.cognizance.service.OrgIntellectualPropertyService;
  53. import com.goafanti.cognizance.service.OrgRatepayService;
  54. import com.goafanti.cognizance.service.OrgStandardService;
  55. import com.goafanti.cognizance.service.OrgTechAchievementService;
  56. import com.goafanti.cognizance.service.OrgTechCenterDetailService;
  57. import com.goafanti.cognizance.service.OrgTechCenterService;
  58. import com.goafanti.cognizance.service.OrgTechProductService;
  59. import com.goafanti.common.bo.Result;
  60. import com.goafanti.common.constant.AFTConstants;
  61. import com.goafanti.common.constant.ErrorConstants;
  62. import com.goafanti.common.controller.CertifyApiController;
  63. import com.goafanti.common.enums.AdminFields;
  64. import com.goafanti.common.enums.AttachmentType;
  65. import com.goafanti.common.enums.CertifySubmitType;
  66. import com.goafanti.common.enums.CognizanceApplyFields;
  67. import com.goafanti.common.enums.DeleteStatus;
  68. import com.goafanti.common.enums.FinanceRatepayFields;
  69. import com.goafanti.common.enums.IdentityAuditStatus;
  70. import com.goafanti.common.enums.IdentityProcess;
  71. import com.goafanti.common.enums.IntellectualPropertyType;
  72. import com.goafanti.common.enums.OrgActivityFields;
  73. import com.goafanti.common.enums.OrgAnnualReportFields;
  74. import com.goafanti.common.enums.OrgCognizanceFields;
  75. import com.goafanti.common.enums.OrgCognizanceStatus;
  76. import com.goafanti.common.enums.OrgFinanceFields;
  77. import com.goafanti.common.enums.OrgHonorDatumFields;
  78. import com.goafanti.common.enums.OrgHumanResourceFields;
  79. import com.goafanti.common.enums.OrgIntellectualPropertyFields;
  80. import com.goafanti.common.enums.OrgRatepayFields;
  81. import com.goafanti.common.enums.OrgStandardFields;
  82. import com.goafanti.common.enums.OrgTechAchievementFields;
  83. import com.goafanti.common.enums.OrgTechCenterDetailFields;
  84. import com.goafanti.common.enums.OrgTechCenterFields;
  85. import com.goafanti.common.enums.OrgTechProductFields;
  86. import com.goafanti.common.enums.OrganizationIdentityFields;
  87. import com.goafanti.common.enums.ProportionStatus;
  88. import com.goafanti.common.enums.ProprotionFields;
  89. import com.goafanti.common.enums.UserAbilityFields;
  90. import com.goafanti.common.enums.UserFields;
  91. import com.goafanti.common.enums.UserIdentityFields;
  92. import com.goafanti.common.enums.UserLevel;
  93. import com.goafanti.common.enums.UserType;
  94. import com.goafanti.common.model.Admin;
  95. import com.goafanti.common.model.OrgActivity;
  96. import com.goafanti.common.model.OrgActivityCost;
  97. import com.goafanti.common.model.OrgAnnualReport;
  98. import com.goafanti.common.model.OrgCognizance;
  99. import com.goafanti.common.model.OrgCognizanceLog;
  100. import com.goafanti.common.model.OrgCognizanceProportion;
  101. import com.goafanti.common.model.OrgFinance;
  102. import com.goafanti.common.model.OrgHonorDatum;
  103. import com.goafanti.common.model.OrgHumanResource;
  104. import com.goafanti.common.model.OrgIntellectualProperty;
  105. import com.goafanti.common.model.OrgRatepay;
  106. import com.goafanti.common.model.OrgStandard;
  107. import com.goafanti.common.model.OrgTechAchievement;
  108. import com.goafanti.common.model.OrgTechCenter;
  109. import com.goafanti.common.model.OrgTechCenterDetail;
  110. import com.goafanti.common.model.OrgTechProduct;
  111. import com.goafanti.common.model.OrganizationIdentity;
  112. import com.goafanti.common.model.PatentInfo;
  113. import com.goafanti.common.model.User;
  114. import com.goafanti.common.model.UserAbility;
  115. import com.goafanti.common.model.UserIdentity;
  116. import com.goafanti.common.utils.DateUtils;
  117. import com.goafanti.common.utils.PasswordUtil;
  118. import com.goafanti.common.utils.StringUtils;
  119. import com.goafanti.copyright.bo.CopyrightInfoDetail;
  120. import com.goafanti.copyright.service.CopyrightInfoService;
  121. import com.goafanti.core.shiro.token.TokenManager;
  122. import com.goafanti.easemob.EasemobUtils;
  123. import com.goafanti.easemob.enums.EasemonSysUsers;
  124. import com.goafanti.patent.service.PatentInfoService;
  125. import com.goafanti.user.bo.InputOrganizationIdentity;
  126. import com.goafanti.user.bo.InputUser;
  127. import com.goafanti.user.bo.InputUserAbility;
  128. import com.goafanti.user.bo.InputUserIdentity;
  129. import com.goafanti.user.bo.OrgUnitNames;
  130. import com.goafanti.user.service.OrgHumanResourceService;
  131. import com.goafanti.user.service.OrganizationIdentityService;
  132. import com.goafanti.user.service.UserAbilityService;
  133. import com.goafanti.user.service.UserIdentityService;
  134. import com.goafanti.user.service.UserService;
  135. @Controller
  136. @RequestMapping(value = "/api/admin")
  137. public class AdminApiController extends CertifyApiController {
  138. @Resource
  139. private UserService userService;
  140. @Resource
  141. private UserIdentityService userIdentityService;
  142. @Resource
  143. private OrganizationIdentityService organizationIdentityService;
  144. @Resource
  145. private OrgHumanResourceService orgHumanResourceService;
  146. @Resource
  147. private OrgStandardService orgStandardService;
  148. @Resource
  149. private OrgIntellectualPropertyService orgIntellectualPropertyService;
  150. @Resource
  151. private OrgTechProductService orgTechProductService;
  152. @Resource
  153. private OrgRatepayService orgRatepayService;
  154. @Resource
  155. private OrgFinanceService orgFinanceService;
  156. @Resource
  157. private OrgActivityService orgActivityService;
  158. @Resource
  159. private OrgActivityCostService orgActivityCostService;
  160. @Resource
  161. private OrgTechAchievementService orgTechAchievementService;
  162. @Resource
  163. private OrgHonorDatumService orgHonorDatumService;
  164. @Resource
  165. private OrgTechCenterService orgTechCenterService;
  166. @Resource
  167. private OrgCognizanceService orgCognizanceService;
  168. @Resource
  169. private OrgCognizanceLogService orgCognizanceLogService;
  170. @Resource
  171. private UserAbilityService userAbilityService;
  172. @Resource
  173. private OrgAnnualReportService orgAnnualReportService;
  174. @Resource(name = "passwordUtil")
  175. private PasswordUtil passwordUtil;
  176. @Resource
  177. private AdminService adminService;
  178. @Resource
  179. private OrgTechCenterDetailService orgTechCenterDetailService;
  180. @Resource
  181. private PatentInfoService patentInfoService;
  182. @Resource
  183. private CopyrightInfoService copyrightInfoService;
  184. @Resource
  185. private OrgCognizanceProportionService orgCognizanceProportionService;
  186. @Autowired
  187. EasemobUtils easemobUtils;
  188. /**
  189. * 获取营销员及营销经理下拉
  190. */
  191. @RequestMapping(value = "/salesman", method = RequestMethod.GET)
  192. public Result getSalesMan() {
  193. Result res = new Result();
  194. res.setData(adminService.selectSalesman());
  195. return res;
  196. }
  197. /**
  198. * 统计专利、软著及科技项目申报业务情况
  199. */
  200. @RequestMapping(value = "/getBusinessCount", method = RequestMethod.GET)
  201. public Result countBusiness(String uid, Integer year) {
  202. Result res = new Result();
  203. if (StringUtils.isBlank(uid)) {
  204. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户ID"));
  205. return res;
  206. }
  207. if (null == year) {
  208. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到年份", "年份"));
  209. return res;
  210. }
  211. res.setData(orgCognizanceService.countBusiness(uid, year));
  212. return res;
  213. }
  214. /**
  215. * 更改资料填写完成状态
  216. */
  217. @RequestMapping(value = "/confirmProportion", method = RequestMethod.POST)
  218. public Result confirmProportion(String id, String uid, String sign, Integer status) {
  219. Result res = new Result();
  220. if (StringUtils.isBlank(uid)) {
  221. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户ID"));
  222. return res;
  223. }
  224. if (StringUtils.isBlank(sign)) {
  225. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到类别标记", "类别标记"));
  226. return res;
  227. }
  228. if (null == status) {
  229. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到资料完成状态", "资料完成状态"));
  230. return res;
  231. }
  232. if (ProportionStatus.FINISHED.getCode() != status && ProportionStatus.UNFINISHED.getCode() != status) {
  233. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "资料完成状态"));
  234. return res;
  235. }
  236. OrgCognizanceProportion oo = orgCognizanceProportionService.selectByUid(uid);
  237. if (null == oo && StringUtils.isBlank(id)) {
  238. OrgCognizanceProportion cp = new OrgCognizanceProportion();
  239. cp.setId(UUID.randomUUID().toString());
  240. cp.setUid(uid);
  241. res.setData(orgCognizanceProportionService.insert(disposeProportionStatus(sign, status, cp)));
  242. return res;
  243. }
  244. if (StringUtils.isBlank(id)) {
  245. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "比重ID"));
  246. return res;
  247. }
  248. OrgCognizanceProportion ocp = orgCognizanceProportionService.selectByPrimaryKey(id);
  249. if (null == ocp) {
  250. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "比重ID"));
  251. return res;
  252. }
  253. res.setData(
  254. orgCognizanceProportionService.updateByPrimaryKeySelective(disposeProportionStatus(sign, status, ocp)));
  255. return res;
  256. }
  257. /**
  258. * 高企培育资料完成情况(比重)
  259. */
  260. @RequestMapping(value = "/proportion", method = RequestMethod.GET)
  261. public Result proportion(String uid) {
  262. Result res = new Result();
  263. if (StringUtils.isBlank(uid)) {
  264. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "用户ID"));
  265. return res;
  266. }
  267. res.setData(orgCognizanceProportionService.selectByUid(uid));
  268. return res;
  269. }
  270. /**
  271. * 管理员角色
  272. */
  273. @RequestMapping(value = "/role", method = RequestMethod.GET)
  274. public Result getRole(String uid) {
  275. Result res = new Result();
  276. if (StringUtils.isBlank(uid)) {
  277. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "管理员ID"));
  278. return res;
  279. }
  280. res.setData(adminService.selectRoleByPrimaryKey(uid));
  281. return res;
  282. }
  283. /**
  284. * 管理员"我的客户"列表
  285. */
  286. @RequestMapping(value = "/customer", method = RequestMethod.GET)
  287. public Result getCustomer(Integer number, String mobile, Integer auditStatus, String auditName, String email,
  288. String startCreateTime, String endCreateTime, Integer type, String pageNo, String pageSize) {
  289. Result res = new Result();
  290. if (null == type) {
  291. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "用户类型", "用户类型"));
  292. return res;
  293. }
  294. if (!UserType.PERSONAL.getCode().equals(type) && !UserType.ORGANIZATION.getCode().equals(type)) {
  295. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "用户类型", "用户类型"));
  296. return res;
  297. }
  298. Integer pNo = 1;
  299. Integer pSize = 10;
  300. if (StringUtils.isNumeric(pageSize)) {
  301. pSize = Integer.parseInt(pageSize);
  302. }
  303. if (StringUtils.isNumeric(pageNo)) {
  304. pNo = Integer.parseInt(pageNo);
  305. }
  306. res.setData(userService.selectUserByAid(number, mobile, auditStatus, auditName, email,
  307. TokenManager.getAdminId(), startCreateTime, endCreateTime, type, pNo, pSize));
  308. return res;
  309. }
  310. /**
  311. * 管理员本人信息详情
  312. */
  313. @RequestMapping(value = "/adminInfo", method = RequestMethod.GET)
  314. public Result adminInfo() {
  315. Result res = new Result();
  316. if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
  317. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "超级管理员"));
  318. return res;
  319. }
  320. res.setData(adminService.selectByPrimaryKey(TokenManager.getAdminId()));
  321. return res;
  322. }
  323. /**
  324. * 管理员修改本人信息
  325. */
  326. @RequestMapping(value = "/updateAdminInfo", method = RequestMethod.POST)
  327. public Result updateAdminInfo(@Valid InputAdmin admin, String pwd, BindingResult bindingResult) {
  328. Result res = new Result();
  329. if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
  330. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "超级管理员"));
  331. return res;
  332. }
  333. if (bindingResult.hasErrors()) {
  334. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  335. AdminFields.getFieldDesc(bindingResult.getFieldError().getField())));
  336. return res;
  337. }
  338. if (StringUtils.isBlank(admin.getId())) {
  339. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "用户id"));
  340. return res;
  341. }
  342. if (StringUtils.isBlank(admin.getMobile())) {
  343. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "登录帐号为空", "登录帐号"));
  344. return res;
  345. }
  346. if (StringUtils.isBlank(admin.getName())) {
  347. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "用户名为空", "用户名"));
  348. return res;
  349. }
  350. Admin a = adminService.selectByMobile(admin.getMobile().trim());
  351. if (!TokenManager.getAdminId().equals(a.getId())) {
  352. res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "当前用户已注册!"));
  353. return res;
  354. }
  355. Admin ad = new Admin();
  356. BeanUtils.copyProperties(admin, ad);
  357. Admin aa = adminService.selectByPrimaryKey(TokenManager.getAdminId());
  358. ad.setMobile(ad.getMobile().trim());
  359. ad.setCreateTime(aa.getCreateTime());
  360. if (!StringUtils.isBlank(ad.getPassword())) {
  361. if (StringUtils.isBlank(pwd)) {
  362. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "原密码"));
  363. return res;
  364. }
  365. if (!aa.getPassword().equals(passwordUtil.getEncryptPwd(pwd, aa.getCreateTime()))) {
  366. res.getError().add(buildError(ErrorConstants.PWD_NOT_MATCH_ERROR, "", "原密码"));
  367. return res;
  368. }
  369. } else {
  370. ad.setPassword(aa.getPassword());
  371. }
  372. ad.setPassword(passwordUtil.getEncryptPwd(ad));
  373. res.setData(adminService.updateByPrimaryKey(ad));
  374. return res;
  375. }
  376. /**
  377. * 新增用户
  378. */
  379. @RequestMapping(value = "/addNewUser", method = RequestMethod.POST)
  380. public Result addNewUser(@Valid InputUser inputUser, BindingResult bindingResult) {
  381. Result res = new Result();
  382. if (bindingResult.hasErrors()) {
  383. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  384. UserFields.getFieldDesc(bindingResult.getFieldError().getField())));
  385. return res;
  386. }
  387. if (StringUtils.isBlank(inputUser.getMobile())) {
  388. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "mobile", "mobile"));
  389. return res;
  390. }
  391. User user = userService.selectByMobieAndType(inputUser.getMobile().trim(), null);
  392. if (null != user) {
  393. res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "当前用户已注册!"));
  394. return res;
  395. }
  396. User u = new User();
  397. u.setId(UUID.randomUUID().toString());
  398. u.setMobile(inputUser.getMobile().trim());
  399. u.setPassword(inputUser.getMobile().trim());
  400. Calendar now = Calendar.getInstance();
  401. now.set(Calendar.MILLISECOND, 0);
  402. u.setCreateTime(now.getTime());
  403. u.setPassword(passwordUtil.getEncryptPwd(u));
  404. u.setLvl(UserLevel.GENERAL.getCode());
  405. u.setAid(TokenManager.getAdminId());
  406. userService.insertRegister(u,inputUser.getUnitName(), inputUser.getUsername());
  407. return res;
  408. }
  409. /**
  410. * 个人用户信息明细
  411. */
  412. @RequestMapping(value = "/userDetail", method = RequestMethod.POST)
  413. public Result userDetail(String uid) {
  414. Result res = new Result();
  415. if (StringUtils.isBlank(uid)) {
  416. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  417. return res;
  418. }
  419. res.setData(userIdentityService.selectUserIdentityByUserIdAdmin(uid));
  420. return res;
  421. }
  422. /**
  423. * 修改个人用户信息
  424. */
  425. @RequestMapping(value = "/updateUserDetail", method = RequestMethod.POST)
  426. public Result updateUserDetail(@Valid InputUserIdentity userIdentity, BindingResult bindingResult,
  427. String paymentDateFormattedDate, String saveSign) {
  428. Result res = new Result();
  429. if (bindingResult.hasErrors()) {
  430. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  431. UserIdentityFields.getFieldDesc(bindingResult.getFieldError().getField())));
  432. return res;
  433. }
  434. if (StringUtils.isBlank(userIdentity.getId())) {
  435. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到认证ID", "认证ID"));
  436. return res;
  437. }
  438. if (StringUtils.isBlank(userIdentity.getUid())) {
  439. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  440. return res;
  441. }
  442. if (StringUtils.isBlank(saveSign)) {
  443. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到保存提交方式", "保存提交方式"));
  444. return res;
  445. }
  446. UserIdentity idd = userIdentityService.selectUserIdentityByUserId(userIdentity.getUid());
  447. if (IdentityAuditStatus.COMMITTED.getCode().equals(idd.getAuditStatus())) {
  448. res.getError().add(buildError("", "审核中,无法保存或提交!"));
  449. return res;
  450. }
  451. Integer level = userIdentity.getLevel();
  452. if (!UserLevel.GENERAL.getCode().equals(level)) {
  453. User u = userService.selectByPrimaryKey(userIdentity.getUid());
  454. if (UserLevel.GENERAL.getCode().equals(u.getLvl())) {
  455. res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
  456. return res;
  457. }
  458. }
  459. if (!saveSign.equals(CertifySubmitType.SAVE.getCode())
  460. && !saveSign.equals(CertifySubmitType.SUBMIT.getCode())) {
  461. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "保存提交方式"));
  462. return res;
  463. }
  464. if (!StringUtils.isBlank(paymentDateFormattedDate)) {
  465. try {
  466. userIdentity.setPaymentDate(DateUtils.parseDate(paymentDateFormattedDate, AFTConstants.YYYYMMDD));
  467. } catch (ParseException e) {
  468. }
  469. }
  470. UserIdentity ui = new UserIdentity();
  471. BeanUtils.copyProperties(userIdentity, ui);
  472. if (CertifySubmitType.SUBMIT.getCode().equals(saveSign)) {
  473. User u = userService.selectByPrimaryKey(userIdentity.getUid());
  474. if (!UserLevel.GENERAL.getCode().equals(u.getLvl())) {
  475. res.getError().add(buildError("", "已通过实名认证,无法操作!"));
  476. return res;
  477. }
  478. ui.setProcess(IdentityProcess.COMMITTED.getCode());
  479. ui.setAuditStatus(IdentityAuditStatus.COMMITTED.getCode());
  480. }
  481. res.setData(userIdentityService.updateUserDetail(ui, saveSign, level));
  482. return res;
  483. }
  484. /**
  485. * 团体用户明细
  486. */
  487. @RequestMapping(value = "/orgDetail", method = RequestMethod.POST)
  488. public Result orgDetail(String uid) {
  489. Result res = new Result();
  490. if (StringUtils.isBlank(uid)) {
  491. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  492. return res;
  493. }
  494. res.setData(organizationIdentityService.selectOrgIdentityDetailByUserIdAdmin(uid));
  495. return res;
  496. }
  497. /**
  498. * 修改团体用户信息
  499. */
  500. @RequestMapping(value = "/updateOrgDetail", method = RequestMethod.POST)
  501. public Result updateOrgDetail(@Valid InputOrganizationIdentity orgIdentity, BindingResult bindingResult,
  502. String paymentDateFormattedDate, String saveSign) {
  503. Result res = new Result();
  504. if (bindingResult.hasErrors()) {
  505. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  506. OrganizationIdentityFields.getFieldDesc(bindingResult.getFieldError().getField())));
  507. return res;
  508. }
  509. if (StringUtils.isBlank(orgIdentity.getUid())) {
  510. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  511. return res;
  512. }
  513. if (StringUtils.isBlank(saveSign)) {
  514. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到保存提交方式", "保存提交方式"));
  515. return res;
  516. }
  517. if (!saveSign.equals(CertifySubmitType.SAVE.getCode())
  518. && !saveSign.equals(CertifySubmitType.SUBMIT.getCode())) {
  519. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "保存提交方式"));
  520. return res;
  521. }
  522. OrganizationIdentity idd = organizationIdentityService.selectOrgIdentityByUserId(orgIdentity.getUid());
  523. if (IdentityAuditStatus.COMMITTED.getCode().equals(idd.getAuditStatus())) {
  524. res.getError().add(buildError("", "审核中,无法保存或提交!"));
  525. return res;
  526. }
  527. Integer level = orgIdentity.getLevel();
  528. if (!UserLevel.GENERAL.getCode().equals(level)) {
  529. User u = userService.selectByPrimaryKey(orgIdentity.getUid());
  530. if (UserLevel.GENERAL.getCode().equals(u.getLvl())) {
  531. res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
  532. return res;
  533. }
  534. }
  535. if (!StringUtils.isBlank(paymentDateFormattedDate)) {
  536. try {
  537. orgIdentity.setPaymentDate(DateUtils.parseDate(paymentDateFormattedDate, AFTConstants.YYYYMMDD));
  538. } catch (ParseException e) {
  539. }
  540. }
  541. OrganizationIdentity oi = new OrganizationIdentity();
  542. BeanUtils.copyProperties(orgIdentity, oi);
  543. if (orgIdentity.getRegisteredCapital() != null) {
  544. oi.setRegisteredCapital(new BigDecimal(orgIdentity.getRegisteredCapital()));
  545. }
  546. if (CertifySubmitType.SUBMIT.getCode().equals(saveSign)) {
  547. User u = userService.selectByPrimaryKey(oi.getUid());
  548. if (!UserLevel.GENERAL.getCode().equals(u.getLvl())) {
  549. res.getError().add(buildError("", "已通过实名认证,无法操作!"));
  550. return res;
  551. }
  552. oi.setProcess(IdentityProcess.COMMITTED.getCode());
  553. oi.setAuditStatus(IdentityAuditStatus.COMMITTED.getCode());
  554. }
  555. res.setData(organizationIdentityService.updateOrgDetail(oi, saveSign, level));
  556. return res;
  557. }
  558. /**
  559. * 团体用户人力资源情况列表
  560. */
  561. @RequestMapping(value = "/orgHumanResource", method = RequestMethod.POST)
  562. public Result orgHumanResource(Integer year, String pageNo, String pageSize, String uid) {
  563. Result res = new Result();
  564. if (StringUtils.isBlank(uid)) {
  565. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  566. return res;
  567. }
  568. if (!checkCertify(res, uid).getError().isEmpty()) {
  569. return res;
  570. }
  571. Integer pNo = 1;
  572. Integer pSize = 10;
  573. if (StringUtils.isNumeric(pageSize)) {
  574. pSize = Integer.parseInt(pageSize);
  575. }
  576. if (StringUtils.isNumeric(pageNo)) {
  577. pNo = Integer.parseInt(pageNo);
  578. }
  579. res.setData(orgHumanResourceService.listOrgHumanResource(year, pNo, pSize, uid));
  580. return res;
  581. }
  582. /**
  583. * 新增及修改团体用户人力资源情况
  584. */
  585. @RequestMapping(value = "/updateOrgHumanResource", method = RequestMethod.POST)
  586. public Result updateOrgHumanResource(@Valid InputOrgHumanResource orgHumanResource, BindingResult bindingResult) {
  587. Result res = new Result();
  588. if (bindingResult.hasErrors()) {
  589. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  590. OrgHumanResourceFields.getFieldDesc(bindingResult.getFieldError().getField())));
  591. return res;
  592. }
  593. if (StringUtils.isBlank(orgHumanResource.getUid())) {
  594. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  595. return res;
  596. }
  597. if (null == orgHumanResource.getYear()) {
  598. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到年份", "年份"));
  599. return res;
  600. }
  601. if (!checkCertify(res, orgHumanResource.getUid()).getError().isEmpty()) {
  602. return res;
  603. }
  604. OrgHumanResource ohr = new OrgHumanResource();
  605. BeanUtils.copyProperties(orgHumanResource, ohr);
  606. if (StringUtils.isBlank(ohr.getId())) {
  607. if (null != orgHumanResourceService.selectOrgHumanResourceByUidAndYear(ohr.getYear(), ohr.getUid())) {
  608. res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度人力资源情况已录入!"));
  609. return res;
  610. }
  611. ohr.setId(UUID.randomUUID().toString());
  612. ohr.setDeletedSign(DeleteStatus.UNDELETE.getCode());
  613. orgHumanResourceService.insert(ohr);
  614. } else {
  615. orgHumanResourceService.updateByPrimaryKeySelective(ohr);
  616. }
  617. return res;
  618. }
  619. /**
  620. * 企业花名册上传
  621. */
  622. @RequestMapping(value = "/uploadRoster", method = RequestMethod.POST)
  623. public Result uploadRoster(HttpServletRequest req, String sign, String uid, String year) {
  624. Result res = new Result();
  625. if (StringUtils.isBlank(year)) {
  626. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示年份"));
  627. return res;
  628. }
  629. User curUser = userService.selectByPrimaryKey(uid);
  630. if (!checkCertify(res, curUser)) {
  631. return res;
  632. }
  633. AttachmentType attachmentType = AttachmentType.getField(sign);
  634. if (attachmentType == AttachmentType.ROSTER) {
  635. sign = sign + "_" + year;
  636. res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
  637. } else {
  638. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  639. }
  640. return res;
  641. }
  642. /**
  643. * 企业社保情况表上传
  644. */
  645. @RequestMapping(value = "/uploadSocialSecurity", method = RequestMethod.POST)
  646. public Result uploadSocialSecurity(HttpServletRequest req, String sign, String uid, String year) {
  647. Result res = new Result();
  648. if (StringUtils.isBlank(year)) {
  649. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示年份"));
  650. return res;
  651. }
  652. User curUser = userService.selectByPrimaryKey(uid);
  653. if (!checkCertify(res, curUser)) {
  654. return res;
  655. }
  656. AttachmentType attachmentType = AttachmentType.getField(sign);
  657. if (attachmentType == AttachmentType.SOCIAL_SECURITY) {
  658. sign = sign + "_" + year;
  659. res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
  660. } else {
  661. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  662. }
  663. return res;
  664. }
  665. /**
  666. * 企业花名册及社保情况表下载
  667. */
  668. @RequestMapping(value = "/downloadHumanResource", method = RequestMethod.GET)
  669. public Result downloadHumanResource(HttpServletResponse response, String sign, String id) {
  670. Result res = new Result();
  671. if (StringUtils.isEmpty(id)) {
  672. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "企业人员情况id"));
  673. return res;
  674. }
  675. OrgHumanResource ohr = orgHumanResourceService.selectByPrimaryKey(id);
  676. if (ohr == null) {
  677. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "企业人员情况id"));
  678. return res;
  679. }
  680. AttachmentType attachmentType = AttachmentType.getField(sign);
  681. if (attachmentType == AttachmentType.ROSTER) {
  682. downloadFile(response, ohr.getRosterDownloadFileName(), ohr.getRosterUrl());
  683. } else if (attachmentType == AttachmentType.SOCIAL_SECURITY) {
  684. downloadFile(response, ohr.getSocialSecurityDownloadFileName(), ohr.getSocialSecurityUrl());
  685. } else {
  686. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  687. }
  688. return res;
  689. }
  690. /**
  691. * 删除团体人力资源
  692. *
  693. * @return
  694. */
  695. @RequestMapping(value = "/deleteHumanResource", method = RequestMethod.POST)
  696. public Result deleteHumanResource(@RequestParam(name = "ids[]", required = false) String[] ids) {
  697. Result res = new Result();
  698. if (ids == null || ids.length < 1) {
  699. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
  700. } else {
  701. orgHumanResourceService.batchDeleteByPrimaryKey(Arrays.asList(ids));
  702. }
  703. return res;
  704. }
  705. /**
  706. * 企业参与国家标准或行业标准制定情况明细列表
  707. */
  708. @RequestMapping(value = "/standard", method = RequestMethod.POST)
  709. public Result standard(Integer year, String uid, String standardName, String standardNumber, Integer standardLevel,
  710. Integer participateWay, String pageNo, String pageSize) {
  711. Result res = new Result();
  712. if (StringUtils.isBlank(uid)) {
  713. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  714. return res;
  715. }
  716. if (!checkCertify(res, uid).getError().isEmpty()) {
  717. return res;
  718. }
  719. Integer pNo = 1;
  720. Integer pSize = 10;
  721. if (StringUtils.isNumeric(pageSize)) {
  722. pSize = Integer.parseInt(pageSize);
  723. }
  724. if (StringUtils.isNumeric(pageNo)) {
  725. pNo = Integer.parseInt(pageNo);
  726. }
  727. res.setData(orgStandardService.listOrgStandard(year, standardName, standardNumber, standardLevel,
  728. participateWay, pNo, pSize, uid));
  729. return res;
  730. }
  731. /**
  732. * 企业参与国家标准或行业标准制定情况明细新增及修改
  733. */
  734. @RequestMapping(value = "/developStandard", method = RequestMethod.POST)
  735. public Result developStandard(@Valid InputOrgStandard orgStandard, BindingResult bindingResult) {
  736. Result res = new Result();
  737. if (bindingResult.hasErrors()) {
  738. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  739. OrgStandardFields.getFieldDesc(bindingResult.getFieldError().getField())));
  740. return res;
  741. }
  742. if (StringUtils.isBlank(orgStandard.getUid())) {
  743. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  744. return res;
  745. }
  746. if (null == orgStandard.getYear()) {
  747. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "年份"));
  748. return res;
  749. }
  750. if (!checkCertify(res, orgStandard.getUid()).getError().isEmpty()) {
  751. return res;
  752. }
  753. OrgStandard os = new OrgStandard();
  754. BeanUtils.copyProperties(orgStandard, os);
  755. if (StringUtils.isBlank(os.getId())) {
  756. os.setId(UUID.randomUUID().toString());
  757. os.setDeletedSign(DeleteStatus.UNDELETE.getCode());
  758. Calendar now = Calendar.getInstance();
  759. now.set(Calendar.MILLISECOND, 0);
  760. os.setCreateTime(now.getTime());
  761. orgStandardService.insert(os);
  762. } else {
  763. orgStandardService.updateByPrimaryKeySelective(os);
  764. }
  765. res.setData(orgStandard);
  766. return res;
  767. }
  768. /**
  769. * 上传标准制定附件
  770. */
  771. @RequestMapping(value = "/uploadStandard", method = RequestMethod.POST)
  772. public Result uploadStandard(HttpServletRequest req, String sign, String uid) {
  773. Result res = new Result();
  774. User curUser = userService.selectByPrimaryKey(uid);
  775. if (!checkCertify(res, curUser)) {
  776. return res;
  777. }
  778. AttachmentType attachmentType = AttachmentType.getField(sign);
  779. if (attachmentType == AttachmentType.STANDARD) {
  780. res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
  781. } else {
  782. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  783. }
  784. return res;
  785. }
  786. /**
  787. * 下载标准制定附件
  788. */
  789. @RequestMapping(value = "/downloadStandard", method = RequestMethod.GET)
  790. public Result downloadStandard(HttpServletResponse response, String sign, String id) {
  791. Result res = new Result();
  792. if (StringUtils.isEmpty(id)) {
  793. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "标准制定id"));
  794. return res;
  795. }
  796. OrgStandard os = orgStandardService.selectByPrimaryKey(id);
  797. if (os == null) {
  798. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "标准指定id"));
  799. return res;
  800. }
  801. AttachmentType attachmentType = AttachmentType.getField(sign);
  802. if (attachmentType == AttachmentType.STANDARD) {
  803. downloadFile(response, os.getStandardDownloadFileName(), os.getEnclosureUrl());
  804. } else {
  805. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  806. }
  807. return res;
  808. }
  809. /**
  810. * 删除标准制定情况记录
  811. */
  812. @RequestMapping(value = "/deleteStandard", method = RequestMethod.POST)
  813. public Result deleteStandard(@RequestParam(name = "ids[]", required = false) String[] ids) {
  814. Result res = new Result();
  815. if (ids == null || ids.length < 1) {
  816. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
  817. } else {
  818. res.setData(orgStandardService.deleteByPrimaryKey(Arrays.asList(ids)));
  819. }
  820. return res;
  821. }
  822. /**
  823. * 知识产权列表
  824. */
  825. @RequestMapping(value = "/intellectualList", method = RequestMethod.POST)
  826. public Result intellectualList(String pageNo, String pageSize, String uid, String startDate, String endDate) {
  827. Result res = new Result();
  828. if (StringUtils.isBlank(uid)) {
  829. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  830. return res;
  831. }
  832. if (!checkCertify(res, uid).getError().isEmpty()) {
  833. return res;
  834. }
  835. Integer pNo = 1;
  836. Integer pSize = 10;
  837. if (StringUtils.isNumeric(pageSize)) {
  838. pSize = Integer.parseInt(pageSize);
  839. }
  840. if (StringUtils.isNumeric(pageNo)) {
  841. pNo = Integer.parseInt(pageNo);
  842. }
  843. res.setData(orgIntellectualPropertyService.listIntellectual(pNo, pSize, uid, startDate, endDate));
  844. return res;
  845. }
  846. /**
  847. * 知识产权详情
  848. */
  849. @RequestMapping(value = "/intellectualDetail", method = RequestMethod.GET)
  850. public Result intellectualDetail(String id, Integer type) {
  851. Result res = new Result();
  852. if (StringUtils.isBlank(id)) {
  853. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "知识产权ID"));
  854. return res;
  855. }
  856. if (null == type) {
  857. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "知识产权TYPE"));
  858. return res;
  859. }
  860. OrgIntellectualProperty oip = orgIntellectualPropertyService.selectByPrimaryKey(id);
  861. if (null == oip) {
  862. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权ID"));
  863. return res;
  864. }
  865. if (IntellectualPropertyType.PATENT.getCode().equals(type)) {
  866. res.setData(orgIntellectualPropertyService.selectPatentTypeDetail(id));
  867. } else if (IntellectualPropertyType.COPYRIGHT.getCode().equals(type)) {
  868. res.setData(orgIntellectualPropertyService.selectCopyrightTypeDetail(id));
  869. } else if (IntellectualPropertyType.COMMON.getCode().equals(type)) {
  870. OrgIntellectualPropertyDetailBo oipdb = new OrgIntellectualPropertyDetailBo();
  871. BeanUtils.copyProperties(oip, oipdb);
  872. res.setData(oipdb);
  873. } else {
  874. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权TYPE"));
  875. }
  876. return res;
  877. }
  878. /**
  879. * 知识产权信息新增及修改
  880. */
  881. @RequestMapping(value = "/intellectual", method = RequestMethod.POST)
  882. public Result intellectual(@Valid InputOrgIntellectualProperty orgIntellectualProperty, BindingResult bindingResult,
  883. String authorizationDateFormattedDate) {
  884. Result res = new Result();
  885. if (bindingResult.hasErrors()) {
  886. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  887. OrgIntellectualPropertyFields.getFieldDesc(bindingResult.getFieldError().getField())));
  888. return res;
  889. }
  890. if (StringUtils.isBlank(orgIntellectualProperty.getUid())) {
  891. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  892. return res;
  893. }
  894. if (null == orgIntellectualProperty.getCatagory()) {
  895. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到类别", "类别"));
  896. return res;
  897. }
  898. if (!checkCertify(res, orgIntellectualProperty.getUid()).getError().isEmpty()) {
  899. return res;
  900. }
  901. OrgIntellectualProperty p = orgIntellectualPropertyService.findByUidAndIntellectualPropertyNumber(
  902. orgIntellectualProperty.getUid(), orgIntellectualProperty.getIntellectualPropertyNumber());
  903. if (!StringUtils.isBlank(authorizationDateFormattedDate)) {
  904. try {
  905. orgIntellectualProperty.setAuthorizationDate(
  906. DateUtils.parseDate(authorizationDateFormattedDate, AFTConstants.YYYYMMDD));
  907. } catch (ParseException e) {
  908. }
  909. }
  910. OrgIntellectualProperty oip = new OrgIntellectualProperty();
  911. BeanUtils.copyProperties(orgIntellectualProperty, oip);
  912. if (StringUtils.isBlank(oip.getId())) {
  913. if (null != p) {
  914. res.getError().add(buildError("", "当前知识产权编号已录入,无法重复提交!"));
  915. return res;
  916. }
  917. oip.setId(UUID.randomUUID().toString());
  918. oip.setEvaluationCategory((oip.getCatagory() >= 2 && oip.getCatagory() <= 4) ? 1 : 0);
  919. oip.setDeletedSign(DeleteStatus.UNDELETE.getCode());
  920. oip.setType(IntellectualPropertyType.COMMON.getCode());
  921. res.setData(orgIntellectualPropertyService.insert(oip));
  922. } else {
  923. if (null != p && !p.getId().equals(oip.getId())) {
  924. res.getError().add(buildError("", "当前知识产权编号已录入,无法重复提交!"));
  925. return res;
  926. }
  927. oip.setEvaluationCategory((oip.getCatagory() >= 2 && oip.getCatagory() <= 4) ? 1 : 0);
  928. res.setData(orgIntellectualPropertyService.updateByPrimaryKeySelective(oip));
  929. }
  930. return res;
  931. }
  932. /**
  933. * 知识产权证书上传
  934. */
  935. @RequestMapping(value = "/uploadPropertyRight", method = RequestMethod.POST)
  936. public Result uploadPropertyRight(HttpServletRequest req, String sign, String uid) {
  937. Result res = new Result();
  938. User curUser = userService.selectByPrimaryKey(uid);
  939. if (!checkCertify(res, curUser)) {
  940. return res;
  941. }
  942. AttachmentType attachmentType = AttachmentType.getField(sign);
  943. if (attachmentType == AttachmentType.PROPERTY_RIGHT) {
  944. res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
  945. } else {
  946. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  947. }
  948. return res;
  949. }
  950. /**
  951. * 知识产权证书下载
  952. */
  953. @RequestMapping(value = "/downloadPropertyRight", method = RequestMethod.GET)
  954. public Result downloadPropertyRight(HttpServletResponse response, String sign, String id) {
  955. Result res = new Result();
  956. if (StringUtils.isEmpty(id)) {
  957. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权id"));
  958. return res;
  959. }
  960. OrgIntellectualProperty olp = orgIntellectualPropertyService.selectByPrimaryKey(id);
  961. if (olp == null) {
  962. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权id"));
  963. return res;
  964. }
  965. AttachmentType attachmentType = AttachmentType.getField(sign);
  966. if (attachmentType == AttachmentType.PROPERTY_RIGHT) {
  967. downloadFile(response, olp.getPropertyRightDownloadFileName(), olp.getPropertyRightUrl());
  968. } else {
  969. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  970. }
  971. return res;
  972. }
  973. /**
  974. * 知识产权稿件下载
  975. */
  976. @RequestMapping(value = "/downloadManuscript", method = RequestMethod.GET)
  977. public Result downloadManuscript(HttpServletResponse response, String sign, String id, Integer type) {
  978. Result res = new Result();
  979. if (StringUtils.isEmpty(id)) {
  980. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "知识产权id"));
  981. return res;
  982. }
  983. if (null == type) {
  984. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "知识产权TYPE"));
  985. return res;
  986. }
  987. OrgIntellectualProperty olp = orgIntellectualPropertyService.selectByPrimaryKey(id);
  988. if (olp == null) {
  989. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权ID"));
  990. return res;
  991. }
  992. String fileName = null;
  993. String downloadUrl = null;
  994. if (IntellectualPropertyType.PATENT.getCode() == type) {
  995. PatentInfo pi = patentInfoService.selectByPrimaryKey(olp.getPid());
  996. if (null == pi) {
  997. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权ID及TYPE"));
  998. return res;
  999. }
  1000. fileName = pi.getPatentWritingDownloadFileName();
  1001. downloadUrl = pi.getPatentWritingUrl();
  1002. } else if (IntellectualPropertyType.COPYRIGHT.getCode() == type) {
  1003. CopyrightInfoDetail ci = copyrightInfoService.findByPrimaryKey(olp.getPid());
  1004. if (null == ci) {
  1005. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权ID及TYPE"));
  1006. return res;
  1007. }
  1008. fileName = ci.getApplicationUrlDownloadFileName();
  1009. downloadUrl = ci.getApplicationUrl();
  1010. } else {
  1011. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权TYPE"));
  1012. return res;
  1013. }
  1014. AttachmentType attachmentType = AttachmentType.getField(sign);
  1015. if (attachmentType == AttachmentType.MANUSCRIPT) {
  1016. downloadFile(response, fileName, downloadUrl);
  1017. } else {
  1018. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  1019. }
  1020. return res;
  1021. }
  1022. /**
  1023. * 删除知识产权记录
  1024. */
  1025. @RequestMapping(value = "/deleteIntellectual", method = RequestMethod.POST)
  1026. public Result deleteIntellectual(@RequestParam(name = "ids[]", required = false) String[] ids) {
  1027. Result res = new Result();
  1028. if (ids == null || ids.length < 1) {
  1029. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
  1030. } else {
  1031. res.setData(orgIntellectualPropertyService.deleteByPrimaryKey(Arrays.asList(ids)));
  1032. }
  1033. return res;
  1034. }
  1035. /**
  1036. * 上年度高新技术产品(服务)情况列表
  1037. */
  1038. @RequestMapping(value = "/techProductList", method = RequestMethod.POST)
  1039. public Result techProductList(String pageNo, String pageSize, String uid) {
  1040. Result res = new Result();
  1041. if (StringUtils.isBlank(uid)) {
  1042. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1043. return res;
  1044. }
  1045. if (!checkCertify(res, uid).getError().isEmpty()) {
  1046. return res;
  1047. }
  1048. Integer pNo = 1;
  1049. Integer pSize = 10;
  1050. if (StringUtils.isNumeric(pageSize)) {
  1051. pSize = Integer.parseInt(pageSize);
  1052. }
  1053. if (StringUtils.isNumeric(pageNo)) {
  1054. pNo = Integer.parseInt(pageNo);
  1055. }
  1056. res.setData(orgTechProductService.listTechProduct(pNo, pSize, uid));
  1057. return res;
  1058. }
  1059. /**
  1060. * 上年度高新技术产品(服务)情况(新增+修改)
  1061. */
  1062. @RequestMapping(value = "/techProduct", method = RequestMethod.POST)
  1063. public Result techProduct(@Valid InputOrgTechProduct orgTechProduct, BindingResult bindingResult) {
  1064. Result res = new Result();
  1065. if (bindingResult.hasErrors()) {
  1066. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  1067. OrgTechProductFields.getFieldDesc(bindingResult.getFieldError().getField())));
  1068. return res;
  1069. }
  1070. if (StringUtils.isBlank(orgTechProduct.getUid())) {
  1071. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1072. return res;
  1073. }
  1074. if (!checkCertify(res, orgTechProduct.getUid()).getError().isEmpty()) {
  1075. return res;
  1076. }
  1077. OrgTechProduct otp = new OrgTechProduct();
  1078. BeanUtils.copyProperties(orgTechProduct, otp);
  1079. if (StringUtils.isBlank(otp.getId())) {
  1080. OrgTechProduct product = orgTechProductService.findBySerialNumberAndUid(otp.getSerialNumber(),
  1081. otp.getUid());
  1082. if (null != product) {
  1083. res.getError().add(buildError("", "产品编号重复,无法保存!"));
  1084. return res;
  1085. }
  1086. otp.setId(UUID.randomUUID().toString());
  1087. otp.setDeletedSign(DeleteStatus.UNDELETE.getCode());
  1088. Calendar now = Calendar.getInstance();
  1089. now.set(Calendar.MILLISECOND, 0);
  1090. otp.setCreateTime(now.getTime());
  1091. otp.setYear(Calendar.getInstance().get(Calendar.YEAR) - 1);
  1092. orgTechProductService.insert(otp);
  1093. } else {
  1094. orgTechProductService.updateByPrimaryKeySelective(otp);
  1095. }
  1096. res.setData(orgTechProduct);
  1097. return res;
  1098. }
  1099. /**
  1100. * 高新技术产品台帐上传
  1101. */
  1102. @RequestMapping(value = "/uploadTecProduct", method = RequestMethod.POST)
  1103. public Result uploadTecProduct(HttpServletRequest req, String sign, String uid) {
  1104. Result res = new Result();
  1105. User curUser = userService.selectByPrimaryKey(uid);
  1106. if (!checkCertify(res, curUser)) {
  1107. return res;
  1108. }
  1109. AttachmentType attachmentType = AttachmentType.getField(sign);
  1110. if (attachmentType == AttachmentType.TECH_PRODUCT) {
  1111. res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
  1112. } else {
  1113. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  1114. }
  1115. return res;
  1116. }
  1117. /**
  1118. * 高新技术产品台帐下载
  1119. */
  1120. @RequestMapping(value = "/downloadTecProduct", method = RequestMethod.GET)
  1121. public Result downloadTecProduct(HttpServletResponse response, String sign, String id) {
  1122. Result res = new Result();
  1123. if (StringUtils.isEmpty(id)) {
  1124. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "高新技术产品id"));
  1125. return res;
  1126. }
  1127. OrgTechProduct otp = orgTechProductService.selectByPrimaryKey(id);
  1128. if (otp == null) {
  1129. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "高新技术产品id"));
  1130. return res;
  1131. }
  1132. AttachmentType attachmentType = AttachmentType.getField(sign);
  1133. if (attachmentType == AttachmentType.TECH_PRODUCT) {
  1134. downloadFile(response, otp.getAccountDownloadFileName(), otp.getAccountUrl());
  1135. } else {
  1136. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  1137. }
  1138. return res;
  1139. }
  1140. /**
  1141. * 删除上年度高新技术产品(服务)情况记录
  1142. */
  1143. @RequestMapping(value = "/deleteTechProduct", method = RequestMethod.POST)
  1144. public Result deleteTechProduct(@RequestParam(name = "ids[]", required = false) String[] ids) {
  1145. Result res = new Result();
  1146. if (ids == null || ids.length < 1) {
  1147. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
  1148. } else {
  1149. res.setData(orgTechProductService.deleteByPrimaryKey(Arrays.asList(ids)));
  1150. }
  1151. return res;
  1152. }
  1153. /**
  1154. * 企业研究开发活动情况表入口
  1155. */
  1156. @RequestMapping(value = "/activityList", method = RequestMethod.POST)
  1157. public Result activityList(String activityNumber, String activityName, String startDateFormattedDate,
  1158. String endDateFormattedDate, String pageNo, String pageSize, String uid) throws ParseException {
  1159. Result res = new Result();
  1160. if (StringUtils.isBlank(uid)) {
  1161. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1162. }
  1163. if (!checkCertify(res, uid).getError().isEmpty()) {
  1164. return res;
  1165. }
  1166. Integer pNo = 1;
  1167. Integer pSize = 10;
  1168. if (StringUtils.isNumeric(pageSize)) {
  1169. pSize = Integer.parseInt(pageSize);
  1170. }
  1171. if (StringUtils.isNumeric(pageNo)) {
  1172. pNo = Integer.parseInt(pageNo);
  1173. }
  1174. res.setData(orgActivityService.listOrgActivity(activityNumber, activityName, startDateFormattedDate,
  1175. endDateFormattedDate, pNo, pSize, uid));
  1176. return res;
  1177. }
  1178. /**
  1179. * 研发活动详情
  1180. */
  1181. @RequestMapping(value = "/activityDetail", method = RequestMethod.GET)
  1182. public Result activityDetail(String id) {
  1183. Result res = new Result();
  1184. if (StringUtils.isBlank(id)) {
  1185. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "研发活动id"));
  1186. return res;
  1187. }
  1188. Calendar a = Calendar.getInstance();
  1189. res.setData(orgActivityService.selectDetailByIdAndYear(id, a.get(Calendar.YEAR) - 1));
  1190. return res;
  1191. }
  1192. /**
  1193. * 企业研究开发活动情况新增、修改
  1194. */
  1195. @RequestMapping(value = "/activity", method = RequestMethod.POST)
  1196. public Result activity(@Valid InputOrgActivity orgActivity, BindingResult bindingResult,
  1197. String startDateFormattedDate, String endDateFormattedDate) {
  1198. Result res = new Result();
  1199. if (bindingResult.hasErrors()) {
  1200. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  1201. OrgActivityFields.getFieldDesc(bindingResult.getFieldError().getField())));
  1202. return res;
  1203. }
  1204. if (StringUtils.isBlank(orgActivity.getUid())) {
  1205. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1206. return res;
  1207. }
  1208. if (!checkCertify(res, orgActivity.getUid()).getError().isEmpty()) {
  1209. return res;
  1210. }
  1211. if (StringUtils.isBlank(orgActivity.getActivityNumber())) {
  1212. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "研发活动编号"));
  1213. return res;
  1214. }
  1215. if (StringUtils.isBlank(startDateFormattedDate)) {
  1216. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "开始时间"));
  1217. return res;
  1218. }
  1219. if (StringUtils.isBlank(endDateFormattedDate)) {
  1220. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "结束时间"));
  1221. return res;
  1222. }
  1223. try {
  1224. orgActivity.setStartDate(DateUtils.parseDate(startDateFormattedDate, AFTConstants.YYYYMMDD));
  1225. } catch (ParseException e) {
  1226. }
  1227. try {
  1228. orgActivity.setEndDate(DateUtils.parseDate(endDateFormattedDate, AFTConstants.YYYYMMDD));
  1229. } catch (ParseException e) {
  1230. }
  1231. OrgActivity oa = new OrgActivity();
  1232. BeanUtils.copyProperties(orgActivity, oa);
  1233. if (StringUtils.isBlank(oa.getId())) {
  1234. oa.setId(UUID.randomUUID().toString());
  1235. oa.setDeletedSign(DeleteStatus.UNDELETE.getCode());
  1236. orgActivityService.insert(oa);
  1237. } else {
  1238. orgActivityService.updateOrgActivity(oa);
  1239. }
  1240. res.setData(orgActivity);
  1241. return res;
  1242. }
  1243. /**
  1244. * 研发活动立项证明材料上传
  1245. */
  1246. @RequestMapping(value = "/uploadProof", method = RequestMethod.POST)
  1247. public Result uploadProof(HttpServletRequest req, String sign, String uid) {
  1248. Result res = new Result();
  1249. User curUser = userService.selectByPrimaryKey(uid);
  1250. if (!checkCertify(res, curUser)) {
  1251. return res;
  1252. }
  1253. AttachmentType attachmentType = AttachmentType.getField(sign);
  1254. if (attachmentType == AttachmentType.PROOF) {
  1255. res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
  1256. } else {
  1257. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  1258. }
  1259. return res;
  1260. }
  1261. /**
  1262. * 研发活动立项证明材料下载
  1263. */
  1264. @RequestMapping(value = "/downloadProof", method = RequestMethod.GET)
  1265. public Result downloadProof(HttpServletResponse response, String sign, String id) {
  1266. Result res = new Result();
  1267. if (StringUtils.isEmpty(id)) {
  1268. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "研发活动id"));
  1269. return res;
  1270. }
  1271. OrgActivity oa = orgActivityService.selectOrgActivityByPrimaryKey(id);
  1272. if (oa == null) {
  1273. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "研发活动id"));
  1274. return res;
  1275. }
  1276. AttachmentType attachmentType = AttachmentType.getField(sign);
  1277. if (attachmentType == AttachmentType.PROOF) {
  1278. downloadFile(response, oa.getProofDownloadFileName(), oa.getProofUrl());
  1279. } else {
  1280. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  1281. }
  1282. return res;
  1283. }
  1284. /**
  1285. * 删除企业研究开发活动情况
  1286. */
  1287. @RequestMapping(value = "/deleteActivity", method = RequestMethod.POST)
  1288. public Result deleteActivity(@RequestParam(name = "ids[]", required = false) String[] ids) {
  1289. Result res = new Result();
  1290. if (ids == null || ids.length < 1) {
  1291. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
  1292. } else {
  1293. res.setData(orgActivityService.deleteByPrimaryKey(Arrays.asList(ids)));
  1294. orgActivityCostService.deleteByAid(Arrays.asList(ids));
  1295. }
  1296. return res;
  1297. }
  1298. /**
  1299. * 企业年度研究开发费用结构明细表列表
  1300. */
  1301. @RequestMapping(value = "/activityCostList", method = RequestMethod.POST)
  1302. public Result activityCostList(String activityNumber, String startDateFormattedDate, String endDateFormattedDate,
  1303. String pageNo, String pageSize, String uid, Integer year) throws ParseException {
  1304. Result res = new Result();
  1305. if (StringUtils.isBlank(uid)) {
  1306. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1307. return res;
  1308. }
  1309. if (!checkCertify(res, uid).getError().isEmpty()) {
  1310. return res;
  1311. }
  1312. Integer pNo = 1;
  1313. Integer pSize = 10;
  1314. if (StringUtils.isNumeric(pageSize)) {
  1315. pSize = Integer.parseInt(pageSize);
  1316. }
  1317. if (StringUtils.isNumeric(pageNo)) {
  1318. pNo = Integer.parseInt(pageNo);
  1319. }
  1320. res.setData(orgActivityCostService.listOrgActivityCost(activityNumber, startDateFormattedDate,
  1321. endDateFormattedDate, pNo, pSize, uid, year));
  1322. return res;
  1323. }
  1324. /**
  1325. * 企业年度研究开发费用结构明细表(新增+修改)
  1326. */
  1327. @RequestMapping(value = "/activityCost", method = RequestMethod.POST)
  1328. public Result activityCost(@Valid InputOrgActivityCost orgActivityCost, BindingResult bindingResult,
  1329. String signDateFormattedDate) {
  1330. Result res = new Result();
  1331. if (bindingResult.hasErrors()) {
  1332. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  1333. OrgActivityFields.getFieldDesc(bindingResult.getFieldError().getField())));
  1334. return res;
  1335. }
  1336. if (StringUtils.isBlank(orgActivityCost.getUid())) {
  1337. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1338. return res;
  1339. }
  1340. if (StringUtils.isBlank(orgActivityCost.getAid())) {
  1341. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到研发活动", "研发活动ID"));
  1342. return res;
  1343. }
  1344. if (null == orgActivityCost.getYear()) {
  1345. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到年份", "年份"));
  1346. return res;
  1347. }
  1348. if (!checkCertify(res, orgActivityCost.getUid()).getError().isEmpty()) {
  1349. return res;
  1350. }
  1351. if (!StringUtils.isBlank(signDateFormattedDate)) {
  1352. try {
  1353. orgActivityCost.setSignDate(DateUtils.parseDate(signDateFormattedDate, AFTConstants.YYYYMMDD));
  1354. } catch (ParseException e) {
  1355. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "企业填报人签字日期"));
  1356. return res;
  1357. }
  1358. }
  1359. OrgActivityCost oac = new OrgActivityCost();
  1360. BeanUtils.copyProperties(orgActivityCost, oac);
  1361. OrgActivityCost ccc = orgActivityCostService.selectOrgActivityCostByAidAndYear(oac.getAid(), oac.getYear());
  1362. OrgActivity ac = orgActivityService.selectOrgActivityByPrimaryKey(oac.getAid());
  1363. if (StringUtils.isBlank(oac.getId())) {
  1364. if (null != ccc) {
  1365. res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "该研究项目当前年份费用详情已录入!"));
  1366. return res;
  1367. }
  1368. if (null != ac) {
  1369. res = disposeActivityYear(res, ac, oac);
  1370. if (!res.getError().isEmpty()) {
  1371. return res;
  1372. }
  1373. oac.setStartDate(null == ac.getStartDate() ? null : ac.getStartDate());
  1374. oac.setEndDate(null == ac.getEndDate() ? null : ac.getEndDate());
  1375. oac.setId(UUID.randomUUID().toString());
  1376. oac.setDeletedSign(DeleteStatus.UNDELETE.getCode());
  1377. orgActivityCostService.insert(oac);
  1378. } else {
  1379. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到研发活动", "研发活动ID"));
  1380. return res;
  1381. }
  1382. } else {
  1383. if (null != ccc && !ccc.getId().equals(oac.getId())) {
  1384. res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "该研究项目当前年份费用详情已录入!"));
  1385. return res;
  1386. }
  1387. res = disposeActivityYear(res, ac, oac);
  1388. if (!res.getError().isEmpty()) {
  1389. return res;
  1390. }
  1391. orgActivityCostService.updateByPrimaryKeySelective(oac);
  1392. }
  1393. return res;
  1394. }
  1395. /**
  1396. * 研发活动费用台帐上传
  1397. */
  1398. @RequestMapping(value = "/uploadActivityCost", method = RequestMethod.POST)
  1399. public Result uploadActivityCost(HttpServletRequest req, String sign, String uid) {
  1400. Result res = new Result();
  1401. User curUser = userService.selectByPrimaryKey(uid);
  1402. if (!checkCertify(res, curUser)) {
  1403. return res;
  1404. }
  1405. AttachmentType attachmentType = AttachmentType.getField(sign);
  1406. if (attachmentType == AttachmentType.ACTIVITY_COST_ACCOUNT) {
  1407. res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
  1408. } else {
  1409. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  1410. }
  1411. return res;
  1412. }
  1413. /**
  1414. * 研发活动费用台帐下载
  1415. */
  1416. @RequestMapping(value = "/downloadActivityCost", method = RequestMethod.GET)
  1417. public Result downloadActivityCost(HttpServletResponse response, String sign, String id) {
  1418. Result res = new Result();
  1419. if (StringUtils.isEmpty(id)) {
  1420. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", " 研发活动费用id"));
  1421. return res;
  1422. }
  1423. OrgActivityCost oac = orgActivityCostService.selectByPrimaryKey(id);
  1424. if (oac == null) {
  1425. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", " 研发活动费用id"));
  1426. return res;
  1427. }
  1428. AttachmentType attachmentType = AttachmentType.getField(sign);
  1429. if (attachmentType == AttachmentType.ACTIVITY_COST_ACCOUNT) {
  1430. downloadFile(response, oac.getAccountDownloadFileName(), oac.getAccountUrl());
  1431. } else {
  1432. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  1433. }
  1434. return res;
  1435. }
  1436. /**
  1437. * 删除企业年度研究开发费用结构明细记录
  1438. *
  1439. * @param ids
  1440. * @return
  1441. */
  1442. @RequestMapping(value = "/deleteActivityCost", method = RequestMethod.POST)
  1443. public Result deleteActivityCost(@RequestParam(name = "ids[]", required = false) String[] ids) {
  1444. Result res = new Result();
  1445. if (ids == null || ids.length < 1) {
  1446. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
  1447. } else {
  1448. res.setData(orgActivityCostService.batchDeleteByPrimaryKey(Arrays.asList(ids)));
  1449. }
  1450. return res;
  1451. }
  1452. /**
  1453. * 获取当前用户已录入项目标号列表
  1454. */
  1455. @RequestMapping(value = "/activityNumber", method = RequestMethod.POST)
  1456. public Result listActivityNumber(String uid) {
  1457. Result res = new Result();
  1458. if (StringUtils.isBlank(uid)) {
  1459. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1460. return res;
  1461. }
  1462. List<ActivityNumberBo> activityNumberBo = orgActivityService.selectOrgActivityNumberBoByUid(uid);
  1463. res.setData(activityNumberBo);
  1464. return res;
  1465. }
  1466. /**
  1467. * 企业纳税申报信息列表
  1468. */
  1469. @RequestMapping(value = "/ratepay", method = RequestMethod.POST)
  1470. public Result ratepay(Integer year, String pageNo, String pageSize, String uid) {
  1471. Result res = new Result();
  1472. if (StringUtils.isBlank(uid)) {
  1473. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1474. return res;
  1475. }
  1476. if (!checkCertify(res, uid).getError().isEmpty()) {
  1477. return res;
  1478. }
  1479. Integer pNo = 1;
  1480. Integer pSize = 10;
  1481. if (StringUtils.isNumeric(pageSize)) {
  1482. pSize = Integer.parseInt(pageSize);
  1483. }
  1484. if (StringUtils.isNumeric(pageNo)) {
  1485. pNo = Integer.parseInt(pageNo);
  1486. }
  1487. res.setData(orgRatepayService.listOrgRatepay(year, pNo, pSize, uid));
  1488. return res;
  1489. }
  1490. /**
  1491. * 企业纳税信息详情(获取同年度财务报表重复数据)
  1492. */
  1493. @RequestMapping(value = "/ratepayDetail", method = RequestMethod.GET)
  1494. public Result ratepayDetail(String uid, Integer year) {
  1495. Result res = new Result();
  1496. if (null == uid) {
  1497. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1498. return res;
  1499. }
  1500. if (null == year) {
  1501. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到年份", "年份"));
  1502. return res;
  1503. }
  1504. OrgFinance of = orgFinanceService.selectFinanceByUidAndYear(uid, year);
  1505. if (null != of) {
  1506. Map<String, BigDecimal> map = new HashMap<String, BigDecimal>();
  1507. map.put(FinanceRatepayFields.GROSSPROFIT.getCode(), of.getGrossProfit());
  1508. map.put(FinanceRatepayFields.MANAGEMENTCOST.getCode(), of.getManagementCost());
  1509. map.put(FinanceRatepayFields.OPERATINGPROFIT.getCode(), of.getOperatingProfit());
  1510. map.put(FinanceRatepayFields.RESEARCHCOST.getCode(), of.getResearchCost());
  1511. res.setData(map);
  1512. }
  1513. return res;
  1514. }
  1515. /**
  1516. * 企业纳税申报信息录入+修改
  1517. */
  1518. @RequestMapping(value = "/disposeRatepay", method = RequestMethod.POST)
  1519. public Result disposeRatepay(@Valid InputOrgRatepay orgRatepay, BindingResult bindingResult) {
  1520. Result res = new Result();
  1521. if (bindingResult.hasErrors()) {
  1522. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  1523. OrgRatepayFields.getFieldDesc(bindingResult.getFieldError().getField())));
  1524. return res;
  1525. }
  1526. if (StringUtils.isBlank(orgRatepay.getUid())) {
  1527. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1528. return res;
  1529. }
  1530. if (null == orgRatepay.getYear()) {
  1531. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到年份", "年份"));
  1532. return res;
  1533. }
  1534. if (!checkCertify(res, orgRatepay.getUid()).getError().isEmpty()) {
  1535. return res;
  1536. }
  1537. OrgRatepay rate = new OrgRatepay();
  1538. BeanUtils.copyProperties(orgRatepay, rate);
  1539. if (StringUtils.isBlank(rate.getId())) {
  1540. if (null == orgRatepayService.selectRatepayByUidAndYear(rate.getUid(), rate.getYear())) {
  1541. rate.setId(UUID.randomUUID().toString());
  1542. rate.setDeletedSign(DeleteStatus.UNDELETE.getCode());
  1543. orgRatepayService.insert(rate);
  1544. } else {
  1545. res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度纳税申报表已录入!"));
  1546. return res;
  1547. }
  1548. } else {
  1549. orgRatepayService.updateByPrimaryKeySelective(rate);
  1550. }
  1551. return res;
  1552. }
  1553. /**
  1554. * 企业纳税申报表上传
  1555. */
  1556. @RequestMapping(value = "/uploadRatepay", method = RequestMethod.POST)
  1557. public Result uploadRatepay(HttpServletRequest req, String sign, String uid, String year) {
  1558. Result res = new Result();
  1559. User curUser = userService.selectByPrimaryKey(uid);
  1560. if (!checkCertify(res, curUser)) {
  1561. return res;
  1562. }
  1563. if (StringUtils.isBlank(year)) {
  1564. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示年份"));
  1565. return res;
  1566. }
  1567. AttachmentType attachmentType = AttachmentType.getField(sign);
  1568. if (attachmentType == AttachmentType.RATEPAY) {
  1569. sign = sign + "_" + year;
  1570. res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
  1571. } else {
  1572. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  1573. }
  1574. return res;
  1575. }
  1576. /**
  1577. * 企业纳税申报表下载
  1578. */
  1579. @RequestMapping(value = "/downloadRatepay", method = RequestMethod.GET)
  1580. public Result downloadRatepay(HttpServletResponse response, String sign, String id) {
  1581. Result res = new Result();
  1582. if (StringUtils.isBlank(id)) {
  1583. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "企业纳税申报id"));
  1584. return res;
  1585. }
  1586. OrgRatepay ratepay = orgRatepayService.selectByPrimaryKey(id);
  1587. if (ratepay == null) {
  1588. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "企业纳税申报id"));
  1589. return res;
  1590. }
  1591. AttachmentType attachmentType = AttachmentType.getField(sign);
  1592. if (attachmentType == AttachmentType.RATEPAY) {
  1593. downloadFile(response, ratepay.getTaxReturnDownloadFileName(), ratepay.getTaxReturnUrl());
  1594. } else {
  1595. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  1596. }
  1597. return res;
  1598. }
  1599. /**
  1600. * 刪除企业纳税申报信息
  1601. */
  1602. @RequestMapping(value = "/deleteRatepay", method = RequestMethod.POST)
  1603. public Result deleteRatepay(@RequestParam(name = "ids[]", required = false) String[] ids) {
  1604. Result res = new Result();
  1605. if (ids == null || ids.length < 1) {
  1606. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
  1607. } else {
  1608. res.setData(orgRatepayService.deleteByPrimaryKey(Arrays.asList(ids)));
  1609. }
  1610. return res;
  1611. }
  1612. /**
  1613. * 财务报表信息列表
  1614. */
  1615. @RequestMapping(value = "/finance", method = RequestMethod.POST)
  1616. public Result finance(Integer year, String pageNo, String pageSize, String uid) {
  1617. Result res = new Result();
  1618. if (StringUtils.isBlank(uid)) {
  1619. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1620. return res;
  1621. }
  1622. if (!checkCertify(res, uid).getError().isEmpty()) {
  1623. return res;
  1624. }
  1625. Integer pNo = 1;
  1626. Integer pSize = 10;
  1627. if (StringUtils.isNumeric(pageSize)) {
  1628. pSize = Integer.parseInt(pageSize);
  1629. }
  1630. if (StringUtils.isNumeric(pageNo)) {
  1631. pNo = Integer.parseInt(pageNo);
  1632. }
  1633. res.setData(orgFinanceService.listFinance(year, pNo, pSize, uid));
  1634. return res;
  1635. }
  1636. /**
  1637. * 财务报表详情(获取同年度纳税申报表重复数据)
  1638. */
  1639. @RequestMapping(value = "/financeDetail", method = RequestMethod.GET)
  1640. public Result financeDetail(String uid, Integer year) {
  1641. Result res = new Result();
  1642. if (null == uid) {
  1643. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1644. return res;
  1645. }
  1646. if (null == year) {
  1647. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到年份", "年份"));
  1648. return res;
  1649. }
  1650. OrgRatepay ratepay = orgRatepayService.selectRatepayByUidAndYear(uid, year);
  1651. if (null != ratepay) {
  1652. Map<String, BigDecimal> map = new HashMap<String, BigDecimal>();
  1653. map.put(FinanceRatepayFields.GROSSPROFIT.getCode(), ratepay.getGrossProfit());
  1654. map.put(FinanceRatepayFields.MANAGEMENTCOST.getCode(), ratepay.getManagementCost());
  1655. map.put(FinanceRatepayFields.OPERATINGPROFIT.getCode(), ratepay.getOperatingProfit());
  1656. map.put(FinanceRatepayFields.RESEARCHCOST.getCode(), ratepay.getResearchCost());
  1657. res.setData(map);
  1658. }
  1659. return res;
  1660. }
  1661. /**
  1662. * 财务报表录入+修改
  1663. */
  1664. @RequestMapping(value = "/disposeFinance", method = RequestMethod.POST)
  1665. public Result disposeFinance(@Valid InputOrgFinance orgFinance, BindingResult bindingResult) {
  1666. Result res = new Result();
  1667. if (bindingResult.hasErrors()) {
  1668. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  1669. OrgFinanceFields.getFieldDesc(bindingResult.getFieldError().getField())));
  1670. return res;
  1671. }
  1672. if (StringUtils.isBlank(orgFinance.getUid())) {
  1673. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1674. return res;
  1675. }
  1676. if (null == orgFinance.getYear()) {
  1677. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到年份", "年份"));
  1678. return res;
  1679. }
  1680. if (!checkCertify(res, orgFinance.getUid()).getError().isEmpty()) {
  1681. return res;
  1682. }
  1683. OrgFinance of = new OrgFinance();
  1684. BeanUtils.copyProperties(orgFinance, of);
  1685. if (StringUtils.isBlank(of.getId())) {
  1686. if (null == orgFinanceService.selectFinanceByUidAndYear(of.getUid(), of.getYear())) {
  1687. of.setId(UUID.randomUUID().toString());
  1688. of.setDeletedSign(DeleteStatus.UNDELETE.getCode());
  1689. orgFinanceService.insert(of);
  1690. } else {
  1691. res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度财务报表已录入!"));
  1692. return res;
  1693. }
  1694. } else {
  1695. orgFinanceService.updateByPrimaryKeySelective(of);
  1696. }
  1697. return res;
  1698. }
  1699. /**
  1700. * 企业财务报表上传
  1701. */
  1702. @RequestMapping(value = "/uploadFinance", method = RequestMethod.POST)
  1703. public Result uploadFinance(HttpServletRequest req, String sign, String uid, String year) {
  1704. Result res = new Result();
  1705. if (StringUtils.isBlank(year)) {
  1706. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示年份"));
  1707. return res;
  1708. }
  1709. User curUser = userService.selectByPrimaryKey(uid);
  1710. if (!checkCertify(res, curUser)) {
  1711. return res;
  1712. }
  1713. AttachmentType attachmentType = AttachmentType.getField(sign);
  1714. if (attachmentType == AttachmentType.FINANCE) {
  1715. sign = sign + "_" + year;
  1716. res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
  1717. } else {
  1718. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  1719. }
  1720. return res;
  1721. }
  1722. /**
  1723. * 企业财务报表下载
  1724. */
  1725. @RequestMapping(value = "/downloadFinance", method = RequestMethod.GET)
  1726. public Result downloadFinance(HttpServletResponse response, String sign, String id) {
  1727. Result res = new Result();
  1728. if (StringUtils.isEmpty(id)) {
  1729. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "企业财务报表id"));
  1730. return res;
  1731. }
  1732. OrgFinance of = orgFinanceService.selectByPrimaryKey(id);
  1733. if (of == null) {
  1734. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "企业财务报表id"));
  1735. return res;
  1736. }
  1737. AttachmentType attachmentType = AttachmentType.getField(sign);
  1738. if (attachmentType == AttachmentType.FINANCE) {
  1739. downloadFile(response, of.getFinanceDownloadFileName(), of.getFinanceUrl());
  1740. } else {
  1741. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  1742. }
  1743. return res;
  1744. }
  1745. /**
  1746. * 删除财务报表
  1747. */
  1748. @RequestMapping(value = "/deleteFinance", method = RequestMethod.POST)
  1749. public Result deleteFinance(@RequestParam(name = "ids[]", required = false) String[] ids) {
  1750. Result res = new Result();
  1751. if (ids == null || ids.length < 1) {
  1752. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
  1753. } else {
  1754. res.setData(orgFinanceService.deleteByPrimaryKey(Arrays.asList(ids)));
  1755. }
  1756. return res;
  1757. }
  1758. /**
  1759. * 科技成果转化情况列表
  1760. */
  1761. @RequestMapping(value = "/achievementList", method = RequestMethod.POST)
  1762. public Result achievementList(String pageNo, String pageSize, String uid) {
  1763. Result res = new Result();
  1764. if (StringUtils.isBlank(uid)) {
  1765. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1766. return res;
  1767. }
  1768. if (!checkCertify(res, uid).getError().isEmpty()) {
  1769. return res;
  1770. }
  1771. Integer pNo = 1;
  1772. Integer pSize = 10;
  1773. if (StringUtils.isNumeric(pageSize)) {
  1774. pSize = Integer.parseInt(pageSize);
  1775. }
  1776. if (StringUtils.isNumeric(pageNo)) {
  1777. pNo = Integer.parseInt(pageNo);
  1778. }
  1779. res.setData(orgTechAchievementService.listOrgTechAchievement(pNo, pSize, uid));
  1780. return res;
  1781. }
  1782. /**
  1783. * 科技成果转化情况新增+修改
  1784. */
  1785. @RequestMapping(value = "/disposeAchievement", method = RequestMethod.POST)
  1786. public Result disposeAchievement(@Valid InputOrgTechAchievement achievement, BindingResult bindingResult) {
  1787. Result res = new Result();
  1788. if (bindingResult.hasErrors()) {
  1789. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  1790. OrgTechAchievementFields.getFieldDesc(bindingResult.getFieldError().getField())));
  1791. return res;
  1792. }
  1793. if (StringUtils.isBlank(achievement.getUid())) {
  1794. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1795. return res;
  1796. }
  1797. if (!checkCertify(res, achievement.getUid()).getError().isEmpty()) {
  1798. return res;
  1799. }
  1800. OrgTechAchievement ota = new OrgTechAchievement();
  1801. BeanUtils.copyProperties(achievement, ota);
  1802. if (StringUtils.isBlank(ota.getId())) {
  1803. ota.setId(UUID.randomUUID().toString());
  1804. ota.setDeletedSign(DeleteStatus.UNDELETE.getCode());
  1805. orgTechAchievementService.insert(ota);
  1806. } else {
  1807. orgTechAchievementService.updateByPrimaryKeySelective(ota);
  1808. }
  1809. return res;
  1810. }
  1811. /**
  1812. * 科技成果附件上传
  1813. */
  1814. @RequestMapping(value = "/uploadAchievement", method = RequestMethod.POST)
  1815. public Result uploadAchievement(HttpServletRequest req, String sign, String uid) {
  1816. Result res = new Result();
  1817. User curUser = userService.selectByPrimaryKey(uid);
  1818. if (!checkCertify(res, curUser)) {
  1819. return res;
  1820. }
  1821. AttachmentType attachmentType = AttachmentType.getField(sign);
  1822. if (attachmentType == AttachmentType.ACHIEVEMENT) {
  1823. res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
  1824. } else {
  1825. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  1826. }
  1827. return res;
  1828. }
  1829. /**
  1830. * 科技成果附件下载
  1831. */
  1832. @RequestMapping(value = "/downloadAchievement", method = RequestMethod.GET)
  1833. public Result downloadAchievement(HttpServletResponse response, String sign, String id) {
  1834. Result res = new Result();
  1835. if (StringUtils.isEmpty(id)) {
  1836. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技成果id"));
  1837. return res;
  1838. }
  1839. OrgTechAchievement ota = orgTechAchievementService.selectByPrimaryKey(id);
  1840. if (ota == null) {
  1841. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技成果id"));
  1842. return res;
  1843. }
  1844. AttachmentType attachmentType = AttachmentType.getField(sign);
  1845. if (attachmentType == AttachmentType.ACHIEVEMENT) {
  1846. downloadFile(response, ota.getEnclosureDownloadFileName(), ota.getEnclosureUrl());
  1847. } else {
  1848. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  1849. }
  1850. return res;
  1851. }
  1852. /**
  1853. * 删除科技成果转化情况
  1854. */
  1855. @RequestMapping(value = "/deleteAchievement", method = RequestMethod.POST)
  1856. public Result deleteAchievement(@RequestParam(name = "ids[]", required = false) String[] ids) {
  1857. Result res = new Result();
  1858. if (ids == null || ids.length < 1) {
  1859. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
  1860. } else {
  1861. res.setData(orgTechAchievementService.deleteByPrimaryKey(Arrays.asList(ids)));
  1862. }
  1863. return res;
  1864. }
  1865. /**
  1866. * 企业荣誉及其他证明材料列表
  1867. */
  1868. @RequestMapping(value = "/honorList", method = RequestMethod.POST)
  1869. public Result honorList(String pageNo, String pageSize, String uid) {
  1870. Result res = new Result();
  1871. if (StringUtils.isBlank(uid)) {
  1872. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1873. return res;
  1874. }
  1875. if (!checkCertify(res, uid).getError().isEmpty()) {
  1876. return res;
  1877. }
  1878. Integer pNo = 1;
  1879. Integer pSize = 10;
  1880. if (StringUtils.isNumeric(pageSize)) {
  1881. pSize = Integer.parseInt(pageSize);
  1882. }
  1883. if (StringUtils.isNumeric(pageNo)) {
  1884. pNo = Integer.parseInt(pageNo);
  1885. }
  1886. res.setData(orgHonorDatumService.listOrgHonorDatum(pNo, pSize, uid));
  1887. return res;
  1888. }
  1889. /**
  1890. * 企业荣誉及其他证明材料新增+修改
  1891. */
  1892. @RequestMapping(value = "/disposeHonor", method = RequestMethod.POST)
  1893. public Result disposeHonor(@Valid InputOrgHonorDatum honor, BindingResult bindingResult,
  1894. String issuingTimeFormattedDate) {
  1895. Result res = new Result();
  1896. if (bindingResult.hasErrors()) {
  1897. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  1898. OrgHonorDatumFields.getFieldDesc(bindingResult.getFieldError().getField())));
  1899. return res;
  1900. }
  1901. if (StringUtils.isBlank(honor.getUid())) {
  1902. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1903. return res;
  1904. }
  1905. if (null == honor.getYear()) {
  1906. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "年份"));
  1907. return res;
  1908. }
  1909. if (!checkCertify(res, honor.getUid()).getError().isEmpty()) {
  1910. return res;
  1911. }
  1912. if (!StringUtils.isBlank(issuingTimeFormattedDate)) {
  1913. try {
  1914. honor.setIssuingTime(DateUtils.parseDate(issuingTimeFormattedDate, AFTConstants.YYYYMMDD));
  1915. } catch (ParseException e) {
  1916. }
  1917. }
  1918. OrgHonorDatum ohd = new OrgHonorDatum();
  1919. BeanUtils.copyProperties(honor, ohd);
  1920. if (StringUtils.isBlank(ohd.getId())) {
  1921. ohd.setId(UUID.randomUUID().toString());
  1922. ohd.setDeletedSign(DeleteStatus.UNDELETE.getCode());
  1923. orgHonorDatumService.insert(ohd);
  1924. } else {
  1925. orgHonorDatumService.updateByPrimaryKeySelective(ohd);
  1926. }
  1927. return res;
  1928. }
  1929. /**
  1930. * 荣誉及其他证明材料上传
  1931. */
  1932. @RequestMapping(value = "/uploadHonor", method = RequestMethod.POST)
  1933. public Result uploadHonor(HttpServletRequest req, String sign, String uid) {
  1934. Result res = new Result();
  1935. User curUser = userService.selectByPrimaryKey(uid);
  1936. if (!checkCertify(res, curUser)) {
  1937. return res;
  1938. }
  1939. AttachmentType attachmentType = AttachmentType.getField(sign);
  1940. if (attachmentType == AttachmentType.HONOR) {
  1941. res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
  1942. } else {
  1943. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  1944. }
  1945. return res;
  1946. }
  1947. /**
  1948. * 荣誉及其他证明材料下载
  1949. */
  1950. @RequestMapping(value = "/downloadHonor", method = RequestMethod.GET)
  1951. public Result downloadHonor(HttpServletResponse response, String sign, String id) {
  1952. Result res = new Result();
  1953. if (StringUtils.isEmpty(id)) {
  1954. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "荣誉及其他证明材料id"));
  1955. return res;
  1956. }
  1957. OrgHonorDatum ohd = orgHonorDatumService.selectByPrimaryKey(id);
  1958. if (ohd == null) {
  1959. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "荣誉及其他证明材料id"));
  1960. return res;
  1961. }
  1962. AttachmentType attachmentType = AttachmentType.getField(sign);
  1963. if (attachmentType == AttachmentType.HONOR) {
  1964. downloadFile(response, ohd.getEnclosureDownloadFileName(), ohd.getEnclosureUrl());
  1965. } else {
  1966. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  1967. }
  1968. return res;
  1969. }
  1970. /**
  1971. * 删除企业荣誉及其他证明材料
  1972. */
  1973. @RequestMapping(value = "/deleteHonor", method = RequestMethod.POST)
  1974. public Result deleteHonor(@RequestParam(name = "ids[]", required = false) String[] ids) {
  1975. Result res = new Result();
  1976. if (ids == null || ids.length < 1) {
  1977. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
  1978. } else {
  1979. res.setData(orgHonorDatumService.deleteByPrimaryKey(Arrays.asList(ids)));
  1980. }
  1981. return res;
  1982. }
  1983. /**
  1984. * 技术中心入口
  1985. */
  1986. @RequestMapping(value = "/center", method = RequestMethod.POST)
  1987. public Result center(String uid) {
  1988. Result res = new Result();
  1989. if (StringUtils.isBlank(uid)) {
  1990. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  1991. return res;
  1992. }
  1993. if (!checkCertify(res, uid).getError().isEmpty()) {
  1994. return res;
  1995. }
  1996. res.setData(orgTechCenterService.selectOrgTechCenterByUid(uid));
  1997. return res;
  1998. }
  1999. /**
  2000. * 技术中心新增+修改
  2001. */
  2002. @RequestMapping(value = "/disposeCenter", method = RequestMethod.POST)
  2003. public Result disposeCenter(@Valid InputOrgTechCenter orgTechCenter, BindingResult bindingResult,
  2004. String foundingTimeFormattedDate) {
  2005. Result res = new Result();
  2006. if (bindingResult.hasErrors()) {
  2007. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  2008. OrgTechCenterFields.getFieldDesc(bindingResult.getFieldError().getField())));
  2009. return res;
  2010. }
  2011. if (StringUtils.isBlank(orgTechCenter.getUid())) {
  2012. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  2013. return res;
  2014. }
  2015. if (StringUtils.isBlank(orgTechCenter.getCenterName())) {
  2016. res.getError().add(buildError(ErrorConstants.DATA_EMPTY_ERROR, "", "研发部门名称"));
  2017. return res;
  2018. }
  2019. if (!checkCertify(res, orgTechCenter.getUid()).getError().isEmpty()) {
  2020. return res;
  2021. }
  2022. if (!StringUtils.isBlank(foundingTimeFormattedDate)) {
  2023. try {
  2024. orgTechCenter.setFoundingTime(DateUtils.parseDate(foundingTimeFormattedDate, AFTConstants.YYYYMMDD));
  2025. } catch (ParseException e) {
  2026. }
  2027. }
  2028. OrgTechCenter otc = new OrgTechCenter();
  2029. BeanUtils.copyProperties(orgTechCenter, otc);
  2030. if (StringUtils.isBlank(otc.getId())) {
  2031. otc.setId(UUID.randomUUID().toString());
  2032. otc.setDeletedSign(DeleteStatus.UNDELETE.getCode());
  2033. orgTechCenterService.insert(otc);
  2034. } else {
  2035. orgTechCenterService.updateByPrimaryKeySelective(otc);
  2036. }
  2037. return res;
  2038. }
  2039. /**
  2040. * 研发部门制度上传
  2041. */
  2042. @RequestMapping(value = "/uploadInstitution", method = RequestMethod.POST)
  2043. public Result uploadInstitution(HttpServletRequest req, String sign, String uid) {
  2044. Result res = new Result();
  2045. User curUser = userService.selectByPrimaryKey(uid);
  2046. if (!checkCertify(res, curUser)) {
  2047. return res;
  2048. }
  2049. AttachmentType attachmentType = AttachmentType.getField(sign);
  2050. if (attachmentType == AttachmentType.INSTITUTION) {
  2051. res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
  2052. } else {
  2053. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  2054. }
  2055. return res;
  2056. }
  2057. /**
  2058. * 研发部门制度下载
  2059. */
  2060. @RequestMapping(value = "/downloadInstitution", method = RequestMethod.GET)
  2061. public Result downloadInstitution(HttpServletResponse response, String sign, String id) {
  2062. Result res = new Result();
  2063. if (StringUtils.isEmpty(id)) {
  2064. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "研发部门id"));
  2065. return res;
  2066. }
  2067. OrgTechCenter otc = orgTechCenterService.selectByPrimaryKey(id);
  2068. if (otc == null) {
  2069. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "研发部门id"));
  2070. return res;
  2071. }
  2072. AttachmentType attachmentType = AttachmentType.getField(sign);
  2073. if (attachmentType == AttachmentType.INSTITUTION) {
  2074. downloadFile(response, otc.getSystemDownloadFileName(), otc.getSystemUrl());
  2075. } else {
  2076. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  2077. }
  2078. return res;
  2079. }
  2080. /**
  2081. * 产学研情况列表
  2082. */
  2083. @RequestMapping(value = "/centerDetail", method = RequestMethod.GET)
  2084. public Result centerDetail(String pageNo, String pageSize, String cid) {
  2085. Result res = new Result();
  2086. Integer pNo = 1;
  2087. Integer pSize = 10;
  2088. if (StringUtils.isNumeric(pageSize)) {
  2089. pSize = Integer.parseInt(pageSize);
  2090. }
  2091. if (StringUtils.isNumeric(pageNo)) {
  2092. pNo = Integer.parseInt(pageNo);
  2093. }
  2094. res.setData(orgTechCenterDetailService.listOrgTechCenterDetail(pNo, pSize, cid));
  2095. return res;
  2096. }
  2097. /**
  2098. * 产学研情况新增+修改
  2099. */
  2100. @RequestMapping(value = "/disposeCenterDetail", method = RequestMethod.POST)
  2101. public Result disposeCenterDetail(@Valid InputOrgTechCenterDetail orgTechCenterDetail, BindingResult bindingResult,
  2102. String projectTimeFormattedDate, String termStartTimeFormattedDate, String termEndTimeFormattedDate) {
  2103. Result res = new Result();
  2104. if (bindingResult.hasErrors()) {
  2105. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  2106. OrgTechCenterDetailFields.getFieldDesc(bindingResult.getFieldError().getField())));
  2107. return res;
  2108. }
  2109. if (StringUtils.isBlank(orgTechCenterDetail.getCid())) {
  2110. res.getError().add(buildError(ErrorConstants.STATUS_ERROR, "研发部门相关信息未保存,无法保存!"));
  2111. return res;
  2112. }
  2113. if (!StringUtils.isBlank(projectTimeFormattedDate)) {
  2114. try {
  2115. orgTechCenterDetail
  2116. .setProjectTime(DateUtils.parseDate(projectTimeFormattedDate, AFTConstants.YYYYMMDD));
  2117. } catch (ParseException e) {
  2118. }
  2119. }
  2120. if (!StringUtils.isBlank(termStartTimeFormattedDate)) {
  2121. try {
  2122. orgTechCenterDetail
  2123. .setTermStartTime(DateUtils.parseDate(termStartTimeFormattedDate, AFTConstants.YYYYMMDD));
  2124. } catch (ParseException e) {
  2125. }
  2126. }
  2127. if (!StringUtils.isBlank(termEndTimeFormattedDate)) {
  2128. try {
  2129. orgTechCenterDetail
  2130. .setTermEndTime(DateUtils.parseDate(termEndTimeFormattedDate, AFTConstants.YYYYMMDD));
  2131. } catch (ParseException e) {
  2132. }
  2133. }
  2134. OrgTechCenterDetail otcd = new OrgTechCenterDetail();
  2135. BeanUtils.copyProperties(orgTechCenterDetail, otcd);
  2136. if (StringUtils.isBlank(otcd.getId())) {
  2137. otcd.setId(UUID.randomUUID().toString());
  2138. otcd.setDeletedSign(DeleteStatus.UNDELETE.getCode());
  2139. orgTechCenterDetailService.insert(otcd);
  2140. } else {
  2141. orgTechCenterDetailService.updateByPrimaryKeySelective(otcd);
  2142. }
  2143. return res;
  2144. }
  2145. /**
  2146. * 产学研技术中心协议上传
  2147. */
  2148. @RequestMapping(value = "/uploadProtocol", method = RequestMethod.POST)
  2149. public Result uploadProtocol(HttpServletRequest req, String sign, String uid) {
  2150. Result res = new Result();
  2151. if (null == uid) {
  2152. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "用户ID"));
  2153. return res;
  2154. }
  2155. User curUser = userService.selectByPrimaryKey(uid);
  2156. if (!checkCertify(res, curUser)) {
  2157. return res;
  2158. }
  2159. AttachmentType attachmentType = AttachmentType.getField(sign);
  2160. if (attachmentType == AttachmentType.PROTOCOL) {
  2161. res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
  2162. } else {
  2163. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  2164. }
  2165. return res;
  2166. }
  2167. /**
  2168. * 产学研技术中心协议下载
  2169. */
  2170. @RequestMapping(value = "/downloadProtocol", method = RequestMethod.GET)
  2171. public Result downloadProtocol(HttpServletResponse response, String sign, String id) {
  2172. Result res = new Result();
  2173. if (StringUtils.isEmpty(id)) {
  2174. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "产学研技术中心id"));
  2175. return res;
  2176. }
  2177. OrgTechCenterDetail otcd = orgTechCenterDetailService.selectByPrimaryKey(id);
  2178. if (otcd == null) {
  2179. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "产学研技术中心id"));
  2180. return res;
  2181. }
  2182. AttachmentType attachmentType = AttachmentType.getField(sign);
  2183. if (attachmentType == AttachmentType.PROTOCOL) {
  2184. downloadFile(response, otcd.getProtocolDownloadFileName(), otcd.getProtocolUrl());
  2185. } else {
  2186. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  2187. }
  2188. return res;
  2189. }
  2190. /**
  2191. * 删除技术中心明细
  2192. */
  2193. @RequestMapping(value = "/deleteOrgTechCenterDetail", method = RequestMethod.POST)
  2194. public Result deleteOrgTechCenterDetail(@RequestParam(name = "ids[]", required = false) String[] ids) {
  2195. Result res = new Result();
  2196. if (ids == null || ids.length < 1) {
  2197. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
  2198. } else {
  2199. res.setData(orgTechCenterDetailService.deleteByPrimaryKey(Arrays.asList(ids)));
  2200. }
  2201. return res;
  2202. }
  2203. /**
  2204. * 获取公司联系人
  2205. */
  2206. @RequestMapping(value = "/getContacts", method = RequestMethod.GET)
  2207. public Result getContacts(String uid) {
  2208. Result res = new Result();
  2209. if (StringUtils.isBlank(uid)) {
  2210. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  2211. return res;
  2212. }
  2213. res.setData(organizationIdentityService.selectContactsByUserId(uid));
  2214. return res;
  2215. }
  2216. /**
  2217. * 获取公司
  2218. */
  2219. @RequestMapping(value = "/getUnitNames", method = RequestMethod.GET)
  2220. public Result getUnitNames() {
  2221. Result res = new Result();
  2222. List<OrgUnitNames> list = organizationIdentityService.selectAllOrgIndentity();
  2223. Map<String, String> map = new TreeMap<String, String>();
  2224. for (OrgUnitNames o : list) {
  2225. map.put(o.getUid(), o.getUnitName());
  2226. }
  2227. res.setData(map);
  2228. return res;
  2229. }
  2230. /**
  2231. * 高企认定列表
  2232. */
  2233. @RequestMapping(value = "/listCognizance", method = RequestMethod.POST)
  2234. public Result listCognizance(String contractId, String uid, String unitName, Integer locationProvince,
  2235. String pageNo, String pageSize) {
  2236. Result res = new Result();
  2237. Integer pNo = 1;
  2238. Integer pSize = 10;
  2239. if (StringUtils.isNumeric(pageSize)) {
  2240. pSize = Integer.parseInt(pageSize);
  2241. }
  2242. if (StringUtils.isNumeric(pageNo)) {
  2243. pNo = Integer.parseInt(pageNo);
  2244. }
  2245. res.setData(orgCognizanceService.listCognizance(contractId, uid, unitName, locationProvince, pNo, pSize));
  2246. return res;
  2247. }
  2248. /**
  2249. * 高企认定咨询师下拉列表
  2250. */
  2251. @RequestMapping(value = "/getConsultant", method = RequestMethod.GET)
  2252. public Result getConsultant() {
  2253. Result res = new Result();
  2254. List<Admin> list = adminService.selectCognizanceConsultant();
  2255. Map<String, String> map = new TreeMap<String, String>();
  2256. for (Admin o : list) {
  2257. map.put(o.getId(), o.getName());
  2258. }
  2259. res.setData(map);
  2260. return res;
  2261. }
  2262. /**
  2263. * 高企负责人下拉
  2264. */
  2265. @RequestMapping(value = "/getPrincipal", method = RequestMethod.GET)
  2266. public Result getPrincipal() {
  2267. Result res = new Result();
  2268. List<Admin> list = adminService.selectCognizancePrincipal();
  2269. Map<String, String> map = new TreeMap<String, String>();
  2270. for (Admin o : list) {
  2271. map.put(o.getId(), o.getName() + " " + (null == o.getPosition() ? "" : o.getPosition()));
  2272. }
  2273. res.setData(map);
  2274. return res;
  2275. }
  2276. /**
  2277. * 申请高企认定
  2278. */
  2279. @RequestMapping(value = "/applyCognizance", method = RequestMethod.POST)
  2280. public Result applyCognizance(@Valid InputApplyCognizance cog, BindingResult bindingResult) {
  2281. Result res = new Result();
  2282. if (bindingResult.hasErrors()) {
  2283. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  2284. CognizanceApplyFields.getFieldDesc(bindingResult.getFieldError().getField())));
  2285. return res;
  2286. }
  2287. if (StringUtils.isBlank(cog.getUid())) {
  2288. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  2289. return res;
  2290. }
  2291. if (StringUtils.isBlank(cog.getSalesman())) {
  2292. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到营销员", "营销员"));
  2293. return res;
  2294. }
  2295. if (null == cog.getYear()) {
  2296. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "年份"));
  2297. return res;
  2298. }
  2299. if (!checkCertify(res, cog.getUid()).getError().isEmpty()) {
  2300. return res;
  2301. }
  2302. Integer latelyYear = orgCognizanceService.selectLatelyRecordYear(cog.getUid());
  2303. if (null != latelyYear && cog.getYear() - latelyYear < 4) {
  2304. res.getError()
  2305. .add(buildError(ErrorConstants.STATUS_ERROR, "高企认定申请中或认定未到期!无法提交新申请!", "高企认定申请中或认定未到期!无法提交新申请!"));
  2306. return res;
  2307. }
  2308. String salesman = cog.getSalesman();
  2309. OrgCognizance oc = new OrgCognizance();
  2310. BeanUtils.copyProperties(cog, oc);
  2311. orgCognizanceService.saveCognizance(oc, salesman);
  2312. return res;
  2313. }
  2314. /**
  2315. * 高企认定详情入口
  2316. */
  2317. @RequestMapping(value = "/cognizanceDetail", method = RequestMethod.POST)
  2318. public Result cognizanceDetail(String uid, String cid, Integer year) {
  2319. Result res = new Result();
  2320. if (StringUtils.isBlank(uid)) {
  2321. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  2322. return res;
  2323. }
  2324. if (StringUtils.isBlank(cid)) {
  2325. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "高企ID"));
  2326. return res;
  2327. }
  2328. if (null == year) {
  2329. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "年份"));
  2330. return res;
  2331. }
  2332. if (!checkCertify(res, uid).getError().isEmpty()) {
  2333. return res;
  2334. }
  2335. OrgCognizance oc = orgCognizanceService.selectByPrimaryKey(cid);
  2336. if (null == oc) {
  2337. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "高企ID"));
  2338. return res;
  2339. }
  2340. /*
  2341. * if (year - oc.getYear() != 0) {
  2342. * res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "",
  2343. * "高企ID及年份")); return res; }
  2344. */
  2345. res.setData(handleCognizanceDetail(uid, cid, year));
  2346. return res;
  2347. }
  2348. /**
  2349. * 高企认定流转状态下拉
  2350. */
  2351. @RequestMapping(value = "/cognizanceStatus", method = RequestMethod.GET)
  2352. public Result cognizanceStatus() {
  2353. Result res = new Result();
  2354. res.setData(disposeCognizanceStatus());
  2355. return res;
  2356. }
  2357. /**
  2358. * 高企认定流转状态
  2359. */
  2360. @RequestMapping(value = "/cognizanceLog", method = RequestMethod.POST)
  2361. public Result cognizanceLog(String cid) {
  2362. Result res = new Result();
  2363. if (StringUtils.isBlank(cid)) {
  2364. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "高企ID"));
  2365. return res;
  2366. }
  2367. res.setData(orgCognizanceLogService.selectOrgCognizanceLogByCid(cid));
  2368. return res;
  2369. }
  2370. /**
  2371. * 保存高企认定详情
  2372. */
  2373. @RequestMapping(value = "/disposeCognizanceDetail", method = RequestMethod.POST)
  2374. public Result disposeCognizanceDetail(@Valid InputOrgCognizance cog, BindingResult bindingResult,
  2375. String recordTimeFormattedDate) {
  2376. Result res = new Result();
  2377. if (bindingResult.hasErrors()) {
  2378. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  2379. OrgCognizanceFields.getFieldDesc(bindingResult.getFieldError().getField())));
  2380. return res;
  2381. }
  2382. if (StringUtils.isBlank(cog.getId())) {
  2383. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到", "高企认定"));
  2384. return res;
  2385. }
  2386. if (null == cog.getYear()) {
  2387. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到", "年份"));
  2388. return res;
  2389. }
  2390. OrgCognizance o = orgCognizanceService.selectByPrimaryKey(cog.getId());
  2391. if (null == o) {
  2392. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到", "高企认定"));
  2393. return res;
  2394. }
  2395. if (OrgCognizanceStatus.CALLBACK.getCode() == o.getState()) {
  2396. res.getError().add(buildError(ErrorConstants.RECORD_CALLBACK, "当前记录已退单,无法修改!"));
  2397. return res;
  2398. }
  2399. if (OrgCognizanceStatus.SETTLEMENT.getCode() == o.getState()) {
  2400. res.getError().add(buildError(ErrorConstants.RECORD_SETTLEMENT, "当前记录已结款,无法修改!"));
  2401. return res;
  2402. }
  2403. if (OrgCognizanceStatus.REJECT.getCode() == o.getState()) {
  2404. res.getError().add(buildError(ErrorConstants.RECORD_REJECT, "当前申请未通过,无法修改,请重新申请"));
  2405. return res;
  2406. }
  2407. if (!checkCertify(res, cog.getUid()).getError().isEmpty()) {
  2408. return res;
  2409. }
  2410. if (OrgCognizanceStatus.getStatus(cog.getState()) == OrgCognizanceStatus.ISSUING
  2411. && StringUtils.isBlank(cog.getCertificateNumber())) {
  2412. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "证书编号"));
  2413. return res;
  2414. }
  2415. Date recordTime = null;
  2416. if (!StringUtils.isBlank(recordTimeFormattedDate)) {
  2417. try {
  2418. recordTime = DateUtils.parseDate(recordTimeFormattedDate, AFTConstants.YYYYMMDDHHMMSS);
  2419. } catch (ParseException e) {
  2420. }
  2421. }
  2422. OrgCognizance oc = new OrgCognizance();
  2423. OrgCognizanceLog ocl = new OrgCognizanceLog();
  2424. BeanUtils.copyProperties(cog, oc);
  2425. BeanUtils.copyProperties(cog, ocl);
  2426. orgCognizanceService.updateCognizance(oc, ocl, recordTime, TokenManager.getAdminId());
  2427. if (cog.getState() != null && !cog.getState().equals(o.getState())
  2428. && cog.getState() <= OrgCognizanceStatus.CALLBACK.getCode()
  2429. && cog.getState() >= OrgCognizanceStatus.PREPARE.getCode()) {
  2430. easemobUtils.sendMessage(EasemonSysUsers.ADMIN_DDDT.getUsername(),
  2431. userService.selectNumberByPrimaryKey(o.getUid()), "您的科技项目申报订单:#%s,状态变更为%s", o.getSerialNumber(),
  2432. OrgCognizanceStatus.getStatus(cog.getState()).getDesc());
  2433. }
  2434. return res;
  2435. }
  2436. /**
  2437. * 刪除高企认定
  2438. */
  2439. @RequestMapping(value = "/deleteCognizance", method = RequestMethod.POST)
  2440. public Result deleteCognizance(@RequestParam(name = "ids[]", required = false) String[] ids) {
  2441. Result res = new Result();
  2442. if (ids == null || ids.length < 1) {
  2443. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
  2444. } else {
  2445. res.setData(orgCognizanceService.deleteByPrimaryKey(Arrays.asList(ids)));
  2446. }
  2447. return res;
  2448. }
  2449. /**
  2450. * 企业创新能力入口
  2451. */
  2452. @RequestMapping(value = "/able", method = RequestMethod.POST)
  2453. public Result able(String uid) {
  2454. Result res = new Result();
  2455. if (StringUtils.isBlank(uid)) {
  2456. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  2457. return res;
  2458. }
  2459. res.setData(userAbilityService.selectUserAbilityByUserId(uid));
  2460. return res;
  2461. }
  2462. /**
  2463. * 企业创新能力新增+保存
  2464. */
  2465. @RequestMapping(value = "/disposeAble", method = RequestMethod.POST)
  2466. public Result disposeAble(@Valid InputUserAbility u, BindingResult bindingResult) {
  2467. Result res = new Result();
  2468. if (bindingResult.hasErrors()) {
  2469. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  2470. UserAbilityFields.getFieldDesc(bindingResult.getFieldError().getField())));
  2471. return res;
  2472. }
  2473. if (StringUtils.isBlank(u.getUid())) {
  2474. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  2475. return res;
  2476. }
  2477. UserAbility user = new UserAbility();
  2478. BeanUtils.copyProperties(u, user);
  2479. if (StringUtils.isBlank(user.getId())) {
  2480. UserAbility uu = userAbilityService.selectUserAbilityByUserId(user.getUid());
  2481. if (null != uu) {
  2482. BeanUtils.copyProperties(user, uu);
  2483. userAbilityService.updateByPrimaryKeySelective(uu);
  2484. } else {
  2485. user.setId(UUID.randomUUID().toString());
  2486. userAbilityService.insert(user);
  2487. }
  2488. } else {
  2489. userAbilityService.updateByPrimaryKeySelective(user);
  2490. }
  2491. return res;
  2492. }
  2493. /**
  2494. * 年报列表
  2495. */
  2496. @RequestMapping(value = "/annualReport", method = RequestMethod.POST)
  2497. public Result annualReport(String uid, Integer year, Integer state, String pageSize, String pageNo) {
  2498. Result res = new Result();
  2499. res = checkCertify(res, uid);
  2500. if (res.getError().isEmpty()) {
  2501. Integer pNo = 1;
  2502. Integer pSize = 10;
  2503. if (StringUtils.isNumeric(pageSize)) {
  2504. pSize = Integer.parseInt(pageSize);
  2505. }
  2506. if (StringUtils.isNumeric(pageNo)) {
  2507. pNo = Integer.parseInt(pageNo);
  2508. }
  2509. res.setData(orgAnnualReportService.listOrgAnnualReport(year, state, pNo, pSize, uid));
  2510. }
  2511. return res;
  2512. }
  2513. /**
  2514. * 企业年报详情
  2515. */
  2516. @RequestMapping(value = "/annualReportDetail", method = RequestMethod.POST)
  2517. public Result annualReportDetail(String uid, Integer year) {
  2518. Result res = new Result();
  2519. if (StringUtils.isBlank(uid)) {
  2520. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  2521. return res;
  2522. }
  2523. if (null == year) {
  2524. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "年份"));
  2525. return res;
  2526. }
  2527. if (!checkCertify(res, uid).getError().isEmpty()) {
  2528. return res;
  2529. }
  2530. res.setData(handleAnnualReport(uid, year));
  2531. return res;
  2532. }
  2533. /**
  2534. * 高企年报新增+修改
  2535. */
  2536. @RequestMapping(value = "/disposeAnnualReport", method = RequestMethod.POST)
  2537. public Result disposeAnnualReport(@Valid InputOrgAnnualReport orgAnnualReport, BindingResult bindingResult) {
  2538. Result res = new Result();
  2539. if (bindingResult.hasErrors()) {
  2540. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  2541. OrgAnnualReportFields.getFieldDesc(bindingResult.getFieldError().getField())));
  2542. return res;
  2543. }
  2544. if (StringUtils.isBlank(orgAnnualReport.getUid())) {
  2545. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
  2546. return res;
  2547. }
  2548. if (!checkCertify(res, orgAnnualReport.getUid()).getError().isEmpty()) {
  2549. res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
  2550. return res;
  2551. }
  2552. OrgAnnualReport oar = new OrgAnnualReport();
  2553. BeanUtils.copyProperties(orgAnnualReport, oar);
  2554. if (StringUtils.isBlank(oar.getId())) {
  2555. if (null != orgAnnualReportService.selectAnnualReportByYearAndUid(oar.getYear(), oar.getUid())) {
  2556. res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年企业年报已录入!"));
  2557. return res;
  2558. } else {
  2559. oar.setId(UUID.randomUUID().toString());
  2560. Calendar now = Calendar.getInstance();
  2561. now.set(Calendar.MILLISECOND, 0);
  2562. oar.setCreateTime(now.getTime());
  2563. oar.setLastUpdateTime(oar.getCreateTime());
  2564. oar.setDeletedSign(DeleteStatus.UNDELETE.getCode());
  2565. orgAnnualReportService.insert(oar);
  2566. }
  2567. } else {
  2568. Calendar now = Calendar.getInstance();
  2569. now.set(Calendar.MILLISECOND, 0);
  2570. oar.setLastUpdateTime(now.getTime());
  2571. orgAnnualReportService.updateByPrimaryKeySelective(oar);
  2572. }
  2573. return res;
  2574. }
  2575. /**
  2576. * 删除企业年报记录
  2577. */
  2578. @RequestMapping(value = "/deleteAnnualReport", method = RequestMethod.POST)
  2579. public Result deleteAnnualReport(@RequestParam(name = "ids[]", required = false) String[] ids) {
  2580. Result res = new Result();
  2581. if (ids == null || ids.length < 1) {
  2582. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
  2583. } else {
  2584. res.setData(orgAnnualReportService.deleteByPrimaryKey(Arrays.asList(ids)));
  2585. }
  2586. return res;
  2587. }
  2588. /**
  2589. * 高企培育列表
  2590. */
  2591. @RequestMapping(value = "/cultivate", method = RequestMethod.POST)
  2592. public Result cultivationList(String uid, Integer locationProvince, String unitName, String pageNo,
  2593. String pageSize) {
  2594. Result res = new Result();
  2595. Integer pNo = 1;
  2596. Integer pSize = 10;
  2597. if (StringUtils.isNumeric(pageSize)) {
  2598. pSize = Integer.parseInt(pageSize);
  2599. }
  2600. if (StringUtils.isNumeric(pageNo)) {
  2601. pNo = Integer.parseInt(pageNo);
  2602. }
  2603. res.setData(orgCognizanceService.listCultivation(uid, locationProvince, unitName, pNo, pSize));
  2604. return res;
  2605. }
  2606. // 判断用户是否通过认证
  2607. private Result checkCertify(Result res, String uid) {
  2608. OrganizationIdentity o = organizationIdentityService.selectOrgIdentityByUserId(uid);
  2609. if (null == o || 5 != o.getAuditStatus()) {
  2610. res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
  2611. }
  2612. return res;
  2613. }
  2614. // 高企详情
  2615. private CognizanceDetailBo handleCognizanceDetail(String uid, String cid, Integer year) {
  2616. return orgCognizanceService.selectCognizanceDetailBo(uid, cid, year);
  2617. }
  2618. // 年报
  2619. private AnnualReportBo handleAnnualReport(String uid, Integer year) {
  2620. return orgAnnualReportService.selectAnnualReportBo(uid, year);
  2621. }
  2622. private Map<String, String> disposeCognizanceStatus() {
  2623. Map<String, String> status = new TreeMap<String, String>();
  2624. if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
  2625. for (OrgCognizanceStatus p : OrgCognizanceStatus.values()) {
  2626. status.put(p.getCode().toString(), p.getDesc());
  2627. status.remove(OrgCognizanceStatus.OTHER.getCode().toString());
  2628. }
  2629. } else {
  2630. if (TokenManager.hasPermission("CognizanceStatus" + OrgCognizanceStatus.CREATE.getCode())) {
  2631. status.put(OrgCognizanceStatus.CREATE.getCode().toString(), OrgCognizanceStatus.CREATE.getDesc());
  2632. }
  2633. if (TokenManager.hasPermission("CognizanceStatus" + OrgCognizanceStatus.SIGN.getCode())) {
  2634. status.put(OrgCognizanceStatus.SIGN.getCode().toString(), OrgCognizanceStatus.SIGN.getDesc());
  2635. }
  2636. if (TokenManager.hasPermission("CognizanceStatus" + OrgCognizanceStatus.DELIVERD.getCode())) {
  2637. status.put(OrgCognizanceStatus.DELIVERD.getCode().toString(), OrgCognizanceStatus.DELIVERD.getDesc());
  2638. }
  2639. if (TokenManager.hasPermission("CognizanceStatus" + OrgCognizanceStatus.CIRCULATION.getCode())) {
  2640. status.put(OrgCognizanceStatus.CIRCULATION.getCode().toString(),
  2641. OrgCognizanceStatus.CIRCULATION.getDesc());
  2642. }
  2643. if (TokenManager.hasPermission("CognizanceStatus" + OrgCognizanceStatus.PREPARE.getCode())) {
  2644. status.put(OrgCognizanceStatus.PREPARE.getCode().toString(), OrgCognizanceStatus.PREPARE.getDesc());
  2645. }
  2646. if (TokenManager.hasPermission("CognizanceStatus" + OrgCognizanceStatus.SUBMIT.getCode())) {
  2647. status.put(OrgCognizanceStatus.SUBMIT.getCode().toString(), OrgCognizanceStatus.SUBMIT.getDesc());
  2648. }
  2649. if (TokenManager.hasPermission("CognizanceStatus" + OrgCognizanceStatus.ACCEPT.getCode())) {
  2650. status.put(OrgCognizanceStatus.ACCEPT.getCode().toString(), OrgCognizanceStatus.ACCEPT.getDesc());
  2651. }
  2652. if (TokenManager.hasPermission("CognizanceStatus" + OrgCognizanceStatus.APPRVOVED.getCode())) {
  2653. status.put(OrgCognizanceStatus.APPRVOVED.getCode().toString(), OrgCognizanceStatus.APPRVOVED.getDesc());
  2654. }
  2655. if (TokenManager.hasPermission("CognizanceStatus" + OrgCognizanceStatus.REJECT.getCode())) {
  2656. status.put(OrgCognizanceStatus.REJECT.getCode().toString(), OrgCognizanceStatus.REJECT.getDesc());
  2657. }
  2658. if (TokenManager.hasPermission("CognizanceStatus" + OrgCognizanceStatus.ISSUING.getCode())) {
  2659. status.put(OrgCognizanceStatus.ISSUING.getCode().toString(), OrgCognizanceStatus.ISSUING.getDesc());
  2660. }
  2661. if (TokenManager.hasPermission("CognizanceStatus" + OrgCognizanceStatus.EXPIRED.getCode())) {
  2662. status.put(OrgCognizanceStatus.EXPIRED.getCode().toString(), OrgCognizanceStatus.EXPIRED.getDesc());
  2663. }
  2664. if (TokenManager.hasPermission("CognizanceStatus" + OrgCognizanceStatus.FOSTER.getCode())) {
  2665. status.put(OrgCognizanceStatus.FOSTER.getCode().toString(), OrgCognizanceStatus.FOSTER.getDesc());
  2666. }
  2667. if (TokenManager.hasPermission("CognizanceStatus" + OrgCognizanceStatus.SETTLEMENT.getCode())) {
  2668. status.put(OrgCognizanceStatus.SETTLEMENT.getCode().toString(),
  2669. OrgCognizanceStatus.SETTLEMENT.getDesc());
  2670. }
  2671. if (TokenManager.hasPermission("CognizanceStatus" + OrgCognizanceStatus.CALLBACK.getCode())) {
  2672. status.put(OrgCognizanceStatus.CALLBACK.getCode().toString(), OrgCognizanceStatus.CALLBACK.getDesc());
  2673. }
  2674. }
  2675. return status;
  2676. }
  2677. private OrgCognizanceProportion disposeProportionStatus(String sign, Integer status, OrgCognizanceProportion ocp) {
  2678. if (ProprotionFields.INSTITUTION.getCode().equals(sign)) {
  2679. if (ProportionStatus.FINISHED.getCode() == status) {
  2680. ocp.setInstitution(ProportionStatus.FINISHED.getCode());
  2681. } else {
  2682. ocp.setInstitution(ProportionStatus.UNFINISHED.getCode());
  2683. }
  2684. } else if (ProprotionFields.ACTIVITY.getCode().equals(sign)) {
  2685. if (ProportionStatus.FINISHED.getCode() == status) {
  2686. ocp.setActivity(ProportionStatus.FINISHED.getCode());
  2687. } else {
  2688. ocp.setActivity(ProportionStatus.UNFINISHED.getCode());
  2689. }
  2690. } else if (ProprotionFields.ACTIVITYCOST.getCode().equals(sign)) {
  2691. if (ProportionStatus.FINISHED.getCode() == status) {
  2692. ocp.setActivityCost(ProportionStatus.FINISHED.getCode());
  2693. } else {
  2694. ocp.setActivityCost(ProportionStatus.UNFINISHED.getCode());
  2695. }
  2696. } else if (ProprotionFields.TECHPROJECT.getCode().equals(sign)) {
  2697. if (ProportionStatus.FINISHED.getCode() == status) {
  2698. ocp.setTechProject(ProportionStatus.FINISHED.getCode());
  2699. } else {
  2700. ocp.setTechProject(ProportionStatus.UNFINISHED.getCode());
  2701. }
  2702. } else if (ProprotionFields.INTELLECTUALPROPERTY.getCode().equals(sign)) {
  2703. if (ProportionStatus.FINISHED.getCode() == status) {
  2704. ocp.setIntellectualProperty(ProportionStatus.FINISHED.getCode());
  2705. } else {
  2706. ocp.setIntellectualProperty(ProportionStatus.UNFINISHED.getCode());
  2707. }
  2708. } else if (ProprotionFields.ACHIEVEMENT.getCode().equals(sign)) {
  2709. if (ProportionStatus.FINISHED.getCode() == status) {
  2710. ocp.setAchievement(ProportionStatus.FINISHED.getCode());
  2711. } else {
  2712. ocp.setAchievement(ProportionStatus.UNFINISHED.getCode());
  2713. }
  2714. } else if (ProprotionFields.RATEPAY.getCode().equals(sign)) {
  2715. if (ProportionStatus.FINISHED.getCode() == status) {
  2716. ocp.setRatepay(ProportionStatus.FINISHED.getCode());
  2717. } else {
  2718. ocp.setRatepay(ProportionStatus.UNFINISHED.getCode());
  2719. }
  2720. } else if (ProprotionFields.FINANCE.getCode().equals(sign)) {
  2721. if (ProportionStatus.FINISHED.getCode() == status) {
  2722. ocp.setFinance(ProportionStatus.FINISHED.getCode());
  2723. } else {
  2724. ocp.setFinance(ProportionStatus.UNFINISHED.getCode());
  2725. }
  2726. } else if (ProprotionFields.HUMANRESOURCE.getCode().equals(sign)) {
  2727. if (ProportionStatus.FINISHED.getCode() == status) {
  2728. ocp.setHumanResource(ProportionStatus.FINISHED.getCode());
  2729. } else {
  2730. ocp.setHumanResource(ProportionStatus.UNFINISHED.getCode());
  2731. }
  2732. } else if (ProprotionFields.HONORDATUM.getCode().equals(sign)) {
  2733. if (ProportionStatus.FINISHED.getCode() == status) {
  2734. ocp.setHonorDatum(ProportionStatus.FINISHED.getCode());
  2735. } else {
  2736. ocp.setHonorDatum(ProportionStatus.UNFINISHED.getCode());
  2737. }
  2738. } else if (ProprotionFields.STANDARD.getCode().equals(sign)) {
  2739. if (ProportionStatus.FINISHED.getCode() == status) {
  2740. ocp.setStandard(ProportionStatus.FINISHED.getCode());
  2741. } else {
  2742. ocp.setStandard(ProportionStatus.UNFINISHED.getCode());
  2743. }
  2744. } else if (ProprotionFields.ABILITY.getCode().equals(sign)) {
  2745. if (ProportionStatus.FINISHED.getCode() == status) {
  2746. ocp.setAbility(ProportionStatus.FINISHED.getCode());
  2747. } else {
  2748. ocp.setAbility(ProportionStatus.UNFINISHED.getCode());
  2749. }
  2750. }
  2751. return ocp;
  2752. }
  2753. private Result disposeActivityYear(Result res, OrgActivity ac, OrgActivityCost oac) {
  2754. Calendar c = Calendar.getInstance();
  2755. c.setTime(ac.getStartDate());
  2756. Integer s = c.get(Calendar.YEAR);
  2757. c.setTime(ac.getEndDate());
  2758. Integer e = c.get(Calendar.YEAR);
  2759. if (oac.getYear() < s || oac.getYear() > e) {
  2760. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "年份"));
  2761. return res;
  2762. }
  2763. return res;
  2764. }
  2765. }