AdminPreviewApiController.java 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. package com.goafanti.admin.controller;
  2. import java.util.Calendar;
  3. import javax.annotation.Resource;
  4. import org.springframework.beans.factory.annotation.Value;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.RequestMethod;
  7. import org.springframework.web.bind.annotation.RestController;
  8. import com.goafanti.cognizance.service.OrgActivityCostService;
  9. import com.goafanti.cognizance.service.OrgActivityService;
  10. import com.goafanti.cognizance.service.OrgFinanceService;
  11. import com.goafanti.cognizance.service.OrgHonorDatumService;
  12. import com.goafanti.cognizance.service.OrgIntellectualPropertyService;
  13. import com.goafanti.cognizance.service.OrgRatepayService;
  14. import com.goafanti.cognizance.service.OrgStandardService;
  15. import com.goafanti.cognizance.service.OrgTechAchievementService;
  16. import com.goafanti.cognizance.service.OrgTechCenterDetailService;
  17. import com.goafanti.cognizance.service.OrgTechProductService;
  18. import com.goafanti.common.bo.Result;
  19. import com.goafanti.common.constant.ErrorConstants;
  20. import com.goafanti.common.controller.CertifyApiController;
  21. import com.goafanti.common.enums.AttachmentType;
  22. import com.goafanti.common.model.CopyrightInfo;
  23. import com.goafanti.common.model.OrgActivity;
  24. import com.goafanti.common.model.OrgActivityCost;
  25. import com.goafanti.common.model.OrgFinance;
  26. import com.goafanti.common.model.OrgHonorDatum;
  27. import com.goafanti.common.model.OrgHumanResource;
  28. import com.goafanti.common.model.OrgIntellectualProperty;
  29. import com.goafanti.common.model.OrgRatepay;
  30. import com.goafanti.common.model.OrgStandard;
  31. import com.goafanti.common.model.OrgTechAchievement;
  32. import com.goafanti.common.model.OrgTechCenterDetail;
  33. import com.goafanti.common.model.OrgTechProduct;
  34. import com.goafanti.common.model.PatentInfo;
  35. import com.goafanti.common.model.TechProject;
  36. import com.goafanti.common.utils.SHA256Util;
  37. import com.goafanti.common.utils.StringUtils;
  38. import com.goafanti.copyright.service.CopyrightInfoService;
  39. import com.goafanti.patent.service.PatentInfoService;
  40. import com.goafanti.techproject.service.TechProjectService;
  41. import com.goafanti.user.service.OrgHumanResourceService;
  42. @RestController
  43. @RequestMapping(value = "/api/admin/preview")
  44. public class AdminPreviewApiController extends CertifyApiController {
  45. @Resource
  46. private PatentInfoService patentInfoService;
  47. @Resource
  48. private CopyrightInfoService copyrightInfoService;
  49. @Resource
  50. private TechProjectService techProjectService;
  51. @Resource
  52. private OrgTechCenterDetailService orgTechCenterDetailService;
  53. @Resource
  54. private OrgActivityService orgActivityService;
  55. @Resource
  56. private OrgActivityCostService orgActivityCostService;
  57. @Resource
  58. private OrgTechProductService orgTechProductService;
  59. @Resource
  60. private OrgIntellectualPropertyService orgIntellectualPropertyService;
  61. @Resource
  62. private OrgTechAchievementService orgTechAchievementService;
  63. @Resource
  64. private OrgRatepayService orgRatepayService;
  65. @Resource
  66. private OrgFinanceService orgFinanceService;
  67. @Resource
  68. private OrgHumanResourceService OrgHumanResourceService;
  69. @Resource
  70. private OrgHonorDatumService OrgHonorDatumService;
  71. @Resource
  72. private OrgStandardService orgStandardService;
  73. @Value(value = "${aesSecretKey}")
  74. private String secretKey = null;
  75. /**
  76. * 专利相关材料(专利代理委托书、专利稿件、授权通知书、专利证书、上年度纳税报表)预览授权
  77. *
  78. * @param id
  79. * @param sign
  80. * @param response
  81. * @return
  82. */
  83. @RequestMapping(value = "/patent", method = RequestMethod.GET)
  84. public Result previewPatent(String id, String sign) {
  85. Result res = new Result();
  86. if (StringUtils.isEmpty(id)) {
  87. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利ID"));
  88. return res;
  89. }
  90. AttachmentType attachmentType = AttachmentType.getField(sign);
  91. if (attachmentType == AttachmentType.LAST_YEAR_RATEPAY) {
  92. OrgRatepay ratepay = orgRatepayService.selectByPrimaryKey(id);
  93. if (null == ratepay) {
  94. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "纳税报表ID"));
  95. return res;
  96. }
  97. } else {
  98. PatentInfo pi = patentInfoService.selectByPrimaryKey(id);
  99. if (null == pi) {
  100. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利ID"));
  101. return res;
  102. }
  103. }
  104. if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT || attachmentType == AttachmentType.PATENT_WRITING
  105. || attachmentType == AttachmentType.AUTHORIZATION_NOTICE
  106. || attachmentType == AttachmentType.LAST_YEAR_RATEPAY
  107. || attachmentType == AttachmentType.PATENT_CERTIFICATE) {
  108. String time = String.valueOf(Calendar.getInstance().getTime().getTime());
  109. String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
  110. res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
  111. } else {
  112. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  113. }
  114. return res;
  115. }
  116. /**
  117. * 软著相关材料(软著申请书、软著证书)预览授权
  118. *
  119. * @param id
  120. * @param sign
  121. * @return
  122. */
  123. @RequestMapping(value = "/copyright", method = RequestMethod.GET)
  124. public Result previewCopyright(String id, String sign) {
  125. Result res = new Result();
  126. if (StringUtils.isEmpty(id)) {
  127. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "软著ID"));
  128. return res;
  129. }
  130. CopyrightInfo ci = copyrightInfoService.selectByPrimaryKey(id);
  131. if (null == ci) {
  132. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "软著ID"));
  133. return res;
  134. }
  135. AttachmentType attachmentType = AttachmentType.getField(sign);
  136. if (attachmentType == AttachmentType.COPYRIGHT_AUTH || attachmentType == AttachmentType.COPYRIGHT_APPLY) {
  137. String time = String.valueOf(Calendar.getInstance().getTime().getTime());
  138. String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
  139. res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
  140. } else {
  141. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  142. }
  143. return res;
  144. }
  145. /**
  146. * 科技项目材料预览授权
  147. *
  148. * @param id
  149. * @param sign
  150. * @return
  151. */
  152. @RequestMapping(value = "/techProject", method = RequestMethod.GET)
  153. public Result previewTechProject(String id, String sign) {
  154. Result res = new Result();
  155. if (StringUtils.isEmpty(id)) {
  156. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技项目申报ID"));
  157. return res;
  158. }
  159. TechProject tp = techProjectService.selectByPrimaryKey(id);
  160. if (null == tp) {
  161. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技项目申报ID"));
  162. return res;
  163. }
  164. AttachmentType attachmentType = AttachmentType.getField(sign);
  165. if (attachmentType == AttachmentType.TECH_PROJECT) {
  166. String time = String.valueOf(Calendar.getInstance().getTime().getTime());
  167. String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
  168. res.setData("sign=" + sign + "&token2=" + id + "&auth=" + auth + "&temp=" + time);
  169. } else {
  170. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  171. }
  172. return res;
  173. }
  174. /**
  175. * 企业研发机构-产学研协议附件预览授权
  176. *
  177. * @param id
  178. * @param sign
  179. * @return
  180. */
  181. @RequestMapping(value = "/techCenterDetail", method = RequestMethod.GET)
  182. public Result previewTechCenterDetail(String id, String sign) {
  183. Result res = new Result();
  184. if (StringUtils.isEmpty(id)) {
  185. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "产学研记录ID"));
  186. return res;
  187. }
  188. OrgTechCenterDetail otcd = orgTechCenterDetailService.selectByPrimaryKey(id);
  189. if (null == otcd) {
  190. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "产学研记录ID"));
  191. return res;
  192. }
  193. AttachmentType attachmentType = AttachmentType.getField(sign);
  194. if (attachmentType == AttachmentType.PROTOCOL) {
  195. String time = String.valueOf(Calendar.getInstance().getTime().getTime());
  196. String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
  197. res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
  198. } else {
  199. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  200. }
  201. return res;
  202. }
  203. /**
  204. * 研发活动立项证明材料预览授权
  205. *
  206. * @param id
  207. * @param sign
  208. * @return
  209. */
  210. @RequestMapping(value = "/activity", method = RequestMethod.GET)
  211. public Result previewActivity(String id, String sign) {
  212. Result res = new Result();
  213. if (StringUtils.isEmpty(id)) {
  214. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "研发活动ID"));
  215. return res;
  216. }
  217. OrgActivity oa = orgActivityService.selectOrgActivityByPrimaryKey(id);
  218. if (null == oa) {
  219. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "研发活动ID"));
  220. return res;
  221. }
  222. AttachmentType attachmentType = AttachmentType.getField(sign);
  223. if (attachmentType == AttachmentType.PROOF) {
  224. String time = String.valueOf(Calendar.getInstance().getTime().getTime());
  225. String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
  226. res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
  227. } else {
  228. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  229. }
  230. return res;
  231. }
  232. /**
  233. * 研发活动费用台帐预览授权
  234. *
  235. * @param id
  236. * @param sign
  237. * @return
  238. */
  239. @RequestMapping(value = "/activityCost", method = RequestMethod.GET)
  240. public Result previewActivityCost(String id, String sign) {
  241. Result res = new Result();
  242. if (StringUtils.isEmpty(id)) {
  243. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "研发活动费用ID"));
  244. return res;
  245. }
  246. OrgActivityCost oac = orgActivityCostService.selectByPrimaryKey(id);
  247. if (null == oac) {
  248. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "研发活动费用ID"));
  249. return res;
  250. }
  251. AttachmentType attachmentType = AttachmentType.getField(sign);
  252. if (attachmentType == AttachmentType.ACTIVITY_COST_ACCOUNT) {
  253. String time = String.valueOf(Calendar.getInstance().getTime().getTime());
  254. String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
  255. res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
  256. } else {
  257. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  258. }
  259. return res;
  260. }
  261. /**
  262. * 高新技术产品台帐预览授权
  263. *
  264. * @param id
  265. * @param sign
  266. * @return
  267. */
  268. @RequestMapping(value = "/techProduct", method = RequestMethod.GET)
  269. public Result previewTechProduct(String id, String sign) {
  270. Result res = new Result();
  271. if (StringUtils.isEmpty(id)) {
  272. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "高新技术产品ID"));
  273. return res;
  274. }
  275. OrgTechProduct otp = orgTechProductService.selectByPrimaryKey(id);
  276. if (null == otp) {
  277. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "高新技术产品ID"));
  278. return res;
  279. }
  280. AttachmentType attachmentType = AttachmentType.getField(sign);
  281. if (attachmentType == AttachmentType.TECH_PRODUCT) {
  282. String time = String.valueOf(Calendar.getInstance().getTime().getTime());
  283. String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
  284. res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
  285. } else {
  286. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  287. }
  288. return res;
  289. }
  290. /**
  291. * 知识产权证书及稿件预览授权
  292. *
  293. * @param id
  294. * @param sign
  295. * @return
  296. */
  297. @RequestMapping(value = "/intellectualProperty", method = RequestMethod.GET)
  298. public Result previewIntellectualProperty(String id, String sign) {
  299. Result res = new Result();
  300. if (StringUtils.isEmpty(id)) {
  301. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权ID"));
  302. return res;
  303. }
  304. AttachmentType attachmentType = AttachmentType.getField(sign);
  305. if (attachmentType == AttachmentType.PROPERTY_RIGHT) {
  306. OrgIntellectualProperty oip = orgIntellectualPropertyService.selectByPrimaryKey(id);
  307. if (null == oip) {
  308. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权ID"));
  309. return res;
  310. }
  311. } else if (attachmentType == AttachmentType.PATENT_WRITING) {
  312. PatentInfo pi = patentInfoService.selectByPrimaryKey(id);
  313. if (null == pi) {
  314. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利稿件ID"));
  315. return res;
  316. }
  317. } else if (attachmentType == AttachmentType.COPYRIGHT_APPLY) {
  318. CopyrightInfo ci = copyrightInfoService.selectByPrimaryKey(id);
  319. if (null == ci) {
  320. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "知识产权申请书ID"));
  321. return res;
  322. }
  323. } else {
  324. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  325. return res;
  326. }
  327. String time = String.valueOf(Calendar.getInstance().getTime().getTime());
  328. String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
  329. res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
  330. return res;
  331. }
  332. /**
  333. * 科技成果附件预览授权
  334. *
  335. * @param id
  336. * @param sing
  337. * @return
  338. */
  339. @RequestMapping(value = "/achievement", method = RequestMethod.GET)
  340. public Result previewAchievement(String id, String sign) {
  341. Result res = new Result();
  342. if (StringUtils.isEmpty(id)) {
  343. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技成果ID"));
  344. return res;
  345. }
  346. OrgTechAchievement ota = orgTechAchievementService.selectByPrimaryKey(id);
  347. if (null == ota) {
  348. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技成果ID"));
  349. return res;
  350. }
  351. AttachmentType attachmentType = AttachmentType.getField(sign);
  352. if (attachmentType == AttachmentType.ACHIEVEMENT) {
  353. String time = String.valueOf(Calendar.getInstance().getTime().getTime());
  354. String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
  355. res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
  356. } else {
  357. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  358. }
  359. return res;
  360. }
  361. /**
  362. * 所得税纳税申报表预览授权
  363. *
  364. * @param id
  365. * @param sign
  366. * @return
  367. */
  368. @RequestMapping(value = "/ratepay", method = RequestMethod.GET)
  369. public Result previewRatepay(String id, String sign) {
  370. Result res = new Result();
  371. if (StringUtils.isEmpty(id)) {
  372. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "纳税申报表ID"));
  373. return res;
  374. }
  375. OrgRatepay ratepay = orgRatepayService.selectByPrimaryKey(id);
  376. if (null == ratepay) {
  377. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "纳税申报表ID"));
  378. return res;
  379. }
  380. AttachmentType attachmentType = AttachmentType.getField(sign);
  381. if (attachmentType == AttachmentType.RATEPAY) {
  382. String time = String.valueOf(Calendar.getInstance().getTime().getTime());
  383. String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
  384. res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
  385. } else {
  386. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  387. }
  388. return res;
  389. }
  390. /**
  391. * 财务报表预览授权
  392. *
  393. * @param id
  394. * @param sign
  395. * @return
  396. */
  397. @RequestMapping(value = "/finance", method = RequestMethod.GET)
  398. public Result previewFinance(String id, String sign) {
  399. Result res = new Result();
  400. if (StringUtils.isEmpty(id)) {
  401. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "财务报表ID"));
  402. return res;
  403. }
  404. OrgFinance of = orgFinanceService.selectByPrimaryKey(id);
  405. if (null == of) {
  406. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "财务报表ID"));
  407. return res;
  408. }
  409. AttachmentType attachmentType = AttachmentType.getField(sign);
  410. if (attachmentType == AttachmentType.FINANCE) {
  411. String time = String.valueOf(Calendar.getInstance().getTime().getTime());
  412. String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
  413. res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
  414. } else {
  415. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  416. }
  417. return res;
  418. }
  419. /**
  420. * 人力资源情况预览授权
  421. *
  422. * @param id
  423. * @param sign
  424. * @return
  425. */
  426. @RequestMapping(value = "/humanResource", method = RequestMethod.GET)
  427. public Result previewHumanResource(String id, String sign) {
  428. Result res = new Result();
  429. if (StringUtils.isEmpty(id)) {
  430. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "人力资源ID"));
  431. return res;
  432. }
  433. OrgHumanResource ohr = OrgHumanResourceService.selectByPrimaryKey(id);
  434. if (null == ohr) {
  435. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "人力资源ID"));
  436. return res;
  437. }
  438. AttachmentType attachmentType = AttachmentType.getField(sign);
  439. if (attachmentType == AttachmentType.ROSTER || attachmentType == AttachmentType.SOCIAL_SECURITY) {
  440. String time = String.valueOf(Calendar.getInstance().getTime().getTime());
  441. String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
  442. res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
  443. } else {
  444. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  445. }
  446. return res;
  447. }
  448. /**
  449. * 企业荣誉及其他证明材料预览授权
  450. *
  451. * @param id
  452. * @param sign
  453. * @return
  454. */
  455. @RequestMapping(value = "/honor", method = RequestMethod.GET)
  456. public Result previewHonor(String id, String sign) {
  457. Result res = new Result();
  458. if (StringUtils.isEmpty(id)) {
  459. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "企业荣誉及其他证明材料ID"));
  460. return res;
  461. }
  462. OrgHonorDatum ohd = OrgHonorDatumService.selectByPrimaryKey(id);
  463. if (null == ohd) {
  464. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "企业荣誉及其他证明材料ID"));
  465. return res;
  466. }
  467. AttachmentType attachmentType = AttachmentType.getField(sign);
  468. if (attachmentType == AttachmentType.HONOR) {
  469. String time = String.valueOf(Calendar.getInstance().getTime().getTime());
  470. String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
  471. res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
  472. } else {
  473. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  474. }
  475. return res;
  476. }
  477. /**
  478. * 标准制定情况附件预览授权
  479. * @param id
  480. * @param sign
  481. * @return
  482. */
  483. @RequestMapping(value = "/standard", method = RequestMethod.GET)
  484. public Result previewStandard(String id, String sign) {
  485. Result res = new Result();
  486. if (StringUtils.isEmpty(id)) {
  487. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "标准制定情况ID"));
  488. return res;
  489. }
  490. OrgStandard os = orgStandardService.selectByPrimaryKey(id);
  491. if (null == os) {
  492. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "标准制定情况ID"));
  493. return res;
  494. }
  495. AttachmentType attachmentType = AttachmentType.getField(sign);
  496. if (attachmentType == AttachmentType.STANDARD) {
  497. String time = String.valueOf(Calendar.getInstance().getTime().getTime());
  498. String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
  499. res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
  500. } else {
  501. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
  502. }
  503. return res;
  504. }
  505. }