AdminReleaseApiController.java 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. package com.goafanti.weChat.controller;
  2. import com.goafanti.common.bo.Error;
  3. import com.goafanti.common.bo.Result;
  4. import com.goafanti.common.constant.AFTConstants;
  5. import com.goafanti.common.constant.ErrorConstants;
  6. import com.goafanti.common.controller.CertifyApiController;
  7. import com.goafanti.common.error.BusinessException;
  8. import com.goafanti.common.model.OrderPublicReleaseLog;
  9. import com.goafanti.common.model.PublicConfig;
  10. import com.goafanti.common.utils.DateUtils;
  11. import com.goafanti.common.utils.StringUtils;
  12. import com.goafanti.common.utils.excel.NewExcelUtil;
  13. import com.goafanti.weChat.bo.*;
  14. import com.goafanti.weChat.service.PublicReleaseService;
  15. import org.apache.commons.beanutils.BeanUtils;
  16. import org.apache.poi.ss.formula.functions.T;
  17. import org.springframework.beans.factory.annotation.Value;
  18. import org.springframework.web.bind.annotation.RequestMapping;
  19. import org.springframework.web.bind.annotation.RequestMethod;
  20. import org.springframework.web.bind.annotation.RestController;
  21. import javax.annotation.Resource;
  22. import javax.servlet.http.HttpServletRequest;
  23. import javax.servlet.http.HttpServletResponse;
  24. import java.text.ParseException;
  25. import java.util.ArrayList;
  26. import java.util.List;
  27. @RestController
  28. @RequestMapping(value = "/api/admin/release")
  29. public class AdminReleaseApiController extends CertifyApiController{
  30. @Resource
  31. private PublicReleaseService publicReleaseService;
  32. @Value(value = "${upload.path}")
  33. private String uploadPath = null;
  34. /**
  35. * 发起外出申请、发起公出
  36. */
  37. @RequestMapping(value = "/addPublicRelease", method = RequestMethod.POST)
  38. public Result addPublicRelease(InputPublicRelease in){
  39. Result res = new Result();
  40. if (StringUtils.isBlank(in.getUids())) {
  41. res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"用户编号"));
  42. return res;
  43. }
  44. if (StringUtils.isBlank(in.getReleaseStarts())) {
  45. res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"公出时间"));
  46. return res;
  47. }
  48. try {
  49. String format = AFTConstants.YYYYMMDDHHMMSS;
  50. if (in.getType()==5){
  51. format = AFTConstants.YYYYMMDD;
  52. }
  53. in.setReleaseStart(DateUtils.parseDate(in.getReleaseStarts(), format));
  54. in.setReleaseEnd(DateUtils.parseDate(in.getReleaseEnds(), format));
  55. } catch (ParseException e) {
  56. e.printStackTrace();
  57. throw new BusinessException("转换异常");
  58. }
  59. //新增5和6非公出协单,不用判断公出时间
  60. if (in.getType()<4){
  61. if (StringUtils.isBlank(in.getDistrictName())) {
  62. res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"公出地点"));
  63. return res;
  64. }
  65. int i = publicReleaseService.checkTime(in);
  66. if (i==1) {
  67. res.getError().add(buildError("发起人公出时段已经被使用!","发起人公出时段已经被使用!"));
  68. return res;
  69. }
  70. if (i==2) {
  71. res.getError().add(buildError("协单人公出时段已经被使用!","协单人公出时段已经被使用!"));
  72. return res;
  73. }
  74. }else{
  75. if (in.getAssistType()==null){
  76. res.getError().add(buildError("请选择协单类型!"));
  77. return res;
  78. }
  79. if (in.getAssistContentType()==null){
  80. res.getError().add(buildError("请选择协单内容"));
  81. }
  82. }
  83. if(in.getAssist()==null)in.setAssist(0);
  84. if (in.getAssist()==1&&in.getAssistAid()==null) {
  85. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"协单人员"));
  86. return res;
  87. }
  88. if (publicReleaseService.checkPublicReviewer(in)){
  89. res.getError().add(buildError("请让管理员先设置公出审核人。"));
  90. return res;
  91. }
  92. res.setData(publicReleaseService.addPublicRelease(in));
  93. return res;
  94. }
  95. /**
  96. * 判定客户是否完成了客户档案
  97. */
  98. @RequestMapping(value = "/checkUserArchives", method = RequestMethod.GET)
  99. public Result checkUserArchives(String uid){
  100. Result res = new Result();
  101. if (StringUtils.isBlank(uid)) {
  102. res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"用户编号"));
  103. return res;
  104. }
  105. //小程序去掉判定,先改接口
  106. // res.setData(publicReleaseService.checkUserArchives(uid));
  107. res.setData(true);
  108. return res;
  109. }
  110. /**
  111. * 修改外出申请、修改公出
  112. */
  113. @RequestMapping(value = "/updatePublicRelease", method = RequestMethod.POST)
  114. public Result updatePublicRelease(InputPublicRelease in){
  115. Result res = new Result();
  116. if (in.getId()==null){
  117. res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"编号"));
  118. return res;
  119. }
  120. if (in.getStatus()!=3&&in.getType()<4) {
  121. int i = publicReleaseService.checkTime(in);
  122. if (i==1) {
  123. res.getError().add(buildError("发起人公出时段已经被使用!","发起人公出时段已经被使用!"));
  124. return res;
  125. }
  126. if (i==2) {
  127. res.getError().add(buildError("协单人公出时段已经被使用!","协单人公出时段已经被使用!"));
  128. return res;
  129. }
  130. }
  131. res.setData(publicReleaseService.updatePublicRelease(in));
  132. return res;
  133. }
  134. /**
  135. * 修改打卡地址
  136. */
  137. @RequestMapping(value = "/updateLocation", method = RequestMethod.POST)
  138. public Result updateLocation(InputPublicRelease in){
  139. Result res = new Result();
  140. if (in.getId()==null||in.getUid()==null){
  141. res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"编号"));
  142. return res;
  143. }
  144. if (in.getLatitude()==null||in.getLongitude()==null||in.getDistrictName()==null){
  145. res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"位置"));
  146. return res;
  147. }
  148. res.setData(publicReleaseService.updateLocation(in));
  149. return res;
  150. }
  151. /**
  152. * 外出打卡、公出打卡
  153. */
  154. @RequestMapping(value = "/publicReleaseClockIn", method = RequestMethod.POST)
  155. public Result publicReleaseClockIn(Integer id,String photoUrl,Integer clockIn ,String clockInRemarks,String uid ){
  156. Result res =new Result();
  157. int x=publicReleaseService.pushPublicReleaseClockIn(id,photoUrl,clockIn,clockInRemarks,uid);
  158. if (x==-1){
  159. res.getError().add(buildError("公出他人企业!需通过审核,才可以打卡!"));
  160. return res;
  161. }
  162. // 取消打卡限制
  163. if (x==-2){
  164. res.getError().add(buildError("公出审核中,不可打卡!"));
  165. return res;
  166. }
  167. if (x==-3){
  168. res.getError().add(buildError("技术协单,必须先写协单意见,才可打卡!"));
  169. return res;
  170. }
  171. if (x==-4){
  172. res.getError().add(buildError("当前打卡不在公出/非公出时间范围内!"));
  173. return res;
  174. }
  175. res.setData(x);
  176. return res;
  177. }
  178. /**
  179. * 外出申请详情、公出详情
  180. */
  181. @RequestMapping(value = "/dtails", method = RequestMethod.GET)
  182. public Result details(Integer id){
  183. Result res =new Result();
  184. res.setData(publicReleaseService.dtails(id));
  185. return res;
  186. }
  187. /**
  188. * 外出申请详情
  189. */
  190. @RequestMapping(value = "/followDtails", method = RequestMethod.GET)
  191. public Result followDetails(String id){
  192. Result res =new Result();
  193. res.setData(publicReleaseService.followDtails(id));
  194. return res;
  195. }
  196. /**
  197. * 外出申请列表.公出列表,我的协单列表,协单审核,
  198. */
  199. @RequestMapping(value = "/listPublicRelease", method = RequestMethod.GET)
  200. public Result listPublicRelease(InputPublicReleaseList in){
  201. Result res =new Result();
  202. res.setData(publicReleaseService.listPublicRelease(in));
  203. return res;
  204. }
  205. /**
  206. * 公出审核、外出审核 上级,二级审核
  207. */
  208. @RequestMapping(value = "/examinePublicRelease", method = RequestMethod.POST)
  209. public Result examinePublicRelease(Integer id ,Integer status,String remarks,Integer evaluateType){
  210. Result res =new Result();
  211. if (id==null) {
  212. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"公出编号"));
  213. return res;
  214. }
  215. if (status!=0&&status!=2) {
  216. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"审核状态"));
  217. return res;
  218. }
  219. // if (remarks.length()>20) {
  220. // res.getError().add(buildError("备注长度不能超过20个字符。"));
  221. // return res;
  222. // }
  223. res.setData(publicReleaseService.pushExaminePublicRelease(id,status,remarks,0,evaluateType));
  224. return res;
  225. }
  226. /**
  227. * 公出审核、外出审核 客户归属人
  228. */
  229. @RequestMapping(value = "/marketersExamine", method = RequestMethod.POST)
  230. public Result<T> marketersExamine(Integer id , Integer status, String remarks, Integer evaluateType){
  231. Result res =new Result();
  232. if (id==null) {
  233. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"公出编号"));
  234. return res;
  235. }
  236. if (status!=0&&status!=2) {
  237. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"审核状态"));
  238. return res;
  239. }
  240. if (remarks.length()>20) {
  241. res.getError().add(buildError("备注长度不能超过20个字符。"));
  242. return res;
  243. }
  244. res.setData(publicReleaseService.pushExaminePublicRelease(id,status,remarks,1, evaluateType));
  245. return res;
  246. }
  247. /**
  248. * 公出审核、外出审核 协单审核
  249. */
  250. @RequestMapping(value = "/assistExamine", method = RequestMethod.POST)
  251. public Result assistExamine(Integer id ,Integer status,String remarks,Integer evaluateType){
  252. Result res =new Result();
  253. if (id==null) {
  254. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"公出编号"));
  255. return res;
  256. }
  257. if (status!=0&&status!=2) {
  258. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"审核状态"));
  259. return res;
  260. }
  261. if (remarks.length()>20) {
  262. res.getError().add(buildError("备注长度不能超过20个字符。"));
  263. return res;
  264. }
  265. res.setData(publicReleaseService.updateAssistExamine(id,status,remarks,evaluateType));
  266. return res;
  267. }
  268. /**
  269. * 技术公出审核 公出他人企业
  270. */
  271. @RequestMapping(value = "/techExamine", method = RequestMethod.POST)
  272. public Result techExamine(Integer id ,Integer status,String remarks,Integer evaluateType){
  273. Result res =new Result();
  274. if (id==null) {
  275. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"公出编号"));
  276. return res;
  277. }
  278. if (status!=0&&status!=2) {
  279. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"审核状态"));
  280. return res;
  281. }
  282. if (remarks.length()>20) {
  283. res.getError().add(buildError("备注长度不能超过20个字符。"));
  284. return res;
  285. }
  286. res.setData(publicReleaseService.pushExaminePublicRelease(id,status,remarks,2,evaluateType));
  287. return res;
  288. }
  289. /**
  290. * 咨询驳回
  291. */
  292. @RequestMapping(value = "/techReject", method = RequestMethod.POST)
  293. public Result techReject(Integer id ,String remarks){
  294. Result res =new Result();
  295. if (id==null) {
  296. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"公出编号"));
  297. return res;
  298. }
  299. if (remarks.length()>20) {
  300. res.getError().add(buildError("备注长度不能超过20个字符。"));
  301. return res;
  302. }
  303. res.setData(publicReleaseService.pushTechReject( id , remarks));
  304. return res;
  305. }
  306. /**
  307. * 外出审核日志列表
  308. */
  309. @RequestMapping(value = "/listPublicReleaseLog", method = RequestMethod.GET)
  310. public Result listPublicReleaseLog(Integer id,String ufid){
  311. Result res =new Result();
  312. res.data(publicReleaseService.listPublicReleaseLog(id,ufid));
  313. return res;
  314. }
  315. /**
  316. * 公出统计
  317. */
  318. @RequestMapping(value = "/publicReleaseStatistics", method = RequestMethod.GET)
  319. public Result publicReleaseStatistics(InputPublicStatistics in){
  320. Result res =new Result();
  321. res.data(publicReleaseService.publicReleaseStatistics(in));
  322. return res;
  323. }
  324. /**
  325. * 公出统计导出
  326. */
  327. @RequestMapping(value = "/publicReleaseStatistics/export", method = RequestMethod.GET)
  328. public Result publicReleaseStatisticsExport(InputPublicStatistics in,HttpServletResponse response){
  329. List<OutPublicStatistics> list =publicReleaseService.publicReleaseStatisticsList(in);
  330. NewExcelUtil<OutPublicStatistics>excel=new NewExcelUtil<>(OutPublicStatistics.class);
  331. return excel.exportExcel(list,"公出统计列表",response);
  332. }
  333. /**
  334. * 公出详情列表
  335. */
  336. @RequestMapping(value = "/publicReleaseDtails", method = RequestMethod.GET)
  337. public Result publicReleaseListDtails(InputPublicDtails in){
  338. Result res =new Result();
  339. res.data(publicReleaseService.publicReleaseListDtails(in));
  340. return res;
  341. }
  342. @RequestMapping(value = "/publicReleaseAndCount", method = RequestMethod.GET)
  343. public Result publicReleaseAndCount(InputPublicDtails in){
  344. Result res =new Result();
  345. res.data(publicReleaseService.publicReleaseAndCount(in));
  346. return res;
  347. }
  348. /**
  349. * 公出详情列表
  350. */
  351. @RequestMapping(value = "/publicReleaseDtails/export", method = RequestMethod.GET)
  352. public Result publicReleaseListDtailsExport(InputPublicDtails in ,Integer exportType){
  353. if (exportType==null)exportType=0;
  354. List<OutPublicDtails> outList=publicReleaseService.publicReleaseListDtailsList(in);
  355. publicReleaseService.pushOutPublicDtails(outList);
  356. if (exportType==0){
  357. NewExcelUtil<OutPublicDtails>excel=new NewExcelUtil<>(OutPublicDtails.class);
  358. return excel.exportExcel(outList,"公出详细列表",uploadPath);
  359. }else if (exportType==1){
  360. List<OutPublicDtailsFinance> list = new ArrayList<>();
  361. for (OutPublicDtails outPublicDtails : outList) {
  362. OutPublicDtailsFinance of= new OutPublicDtailsFinance();
  363. try {
  364. BeanUtils.copyProperties( of,outPublicDtails);
  365. } catch (Exception e) {
  366. throw new BusinessException("数据转换异常");
  367. }
  368. list.add(of);
  369. }
  370. NewExcelUtil<OutPublicDtailsFinance>excel=new NewExcelUtil<>(OutPublicDtailsFinance.class);
  371. return excel.exportExcel(list,"公出详细列表",uploadPath);
  372. }
  373. return null;
  374. }
  375. /** 上传图片 **/
  376. @RequestMapping(value = "/upload", method = RequestMethod.POST)
  377. public Result uploadOrderInvoiceFile(HttpServletRequest req){
  378. Result res = new Result();
  379. res.setData(handleFile(res, "/publicRelease/", false, req, "publicRelease"));
  380. return res;
  381. }
  382. /**
  383. * 搜索
  384. */
  385. @RequestMapping(value = "/addSupplement", method = RequestMethod.POST)
  386. public Result addSupplement(Integer id,String supplement,String nextPlan){
  387. Result res =new Result();
  388. if (id==null) {
  389. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"公出编号"));
  390. return res;
  391. }
  392. res.setData(publicReleaseService.addSupplement( id ,supplement,nextPlan));
  393. return res;
  394. }
  395. /**
  396. * 根据客户返回订单
  397. */
  398. @RequestMapping(value = "/selectOrderByUid",method =RequestMethod.GET)
  399. public Result selectOrderByUid(String uid){
  400. Result res = new Result();
  401. if (uid==null){
  402. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,ErrorConstants.PARAM_EMPTY_ERROR,"客户编号"));
  403. return res;
  404. }
  405. res.data(publicReleaseService.selectOrderByUid(uid));
  406. return res;
  407. }
  408. /**
  409. * 查看上门记录
  410. */
  411. @RequestMapping(value = "/publicByOrder",method =RequestMethod.GET)
  412. public Result publicByOrder(String orderNo){
  413. Result res = new Result();
  414. if (orderNo==null){
  415. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,ErrorConstants.PARAM_EMPTY_ERROR,"订单编号"));
  416. return res;
  417. }
  418. res.data(publicReleaseService.publicByOrder(orderNo));
  419. return res;
  420. }
  421. /**
  422. * 打卡页面获取自己最新的打卡
  423. */
  424. @RequestMapping(value = "/getMyNewPublic",method = RequestMethod.GET)
  425. public Result getMyNewPublic (){
  426. Result res =new Result();
  427. res.data(publicReleaseService.getMyNewPublic());
  428. return res;
  429. }
  430. /**
  431. * 新增协单助手
  432. * @param id 公出编号
  433. * @param aid 协单助手编号
  434. */
  435. @RequestMapping(value = "/addAssistant",method = RequestMethod.POST)
  436. public Result addAssistant (Integer id,String aid){
  437. Result res =new Result();
  438. if (id==null||aid==null){
  439. res.getError().add(new Error(ErrorConstants.PARAM_EMPTY_ERROR,"公出编号与人员编号"));
  440. return res;
  441. }
  442. if (publicReleaseService.checkaddAssistant(id,aid)){
  443. res.getError().add(new Error("协单助手已经存在"));
  444. return res;
  445. }
  446. res.data(publicReleaseService.addAssistant(id,aid));
  447. return res;
  448. }
  449. /**
  450. * 删除协单助手
  451. * @param id 公出编号
  452. * @param aid 协单助手编号
  453. */
  454. @RequestMapping(value = "/deleteAssistant",method = RequestMethod.POST)
  455. public Result deleteAssistant (Integer id,String aid){
  456. Result res =new Result();
  457. if (id==null||aid==null){
  458. res.getError().add(new Error(ErrorConstants.PARAM_EMPTY_ERROR,"公出编号与人员编号"));
  459. return res;
  460. }
  461. if (publicReleaseService.checkdeleteAssistant(id,aid)){
  462. res.getError().add(new Error("协单助手已经打卡,无法删除"));
  463. return res;
  464. }
  465. res.data(publicReleaseService.deleteAssistant(id,aid));
  466. return res;
  467. }
  468. /**
  469. * 技术发起公出查询发起情况
  470. */
  471. @RequestMapping(value = "/checkOrderNoDuration",method = RequestMethod.GET)
  472. public Result checkOrderNoDuration (InputPublicRelease in){
  473. Result res =new Result();
  474. return res.data(publicReleaseService.checkOrderNoDuration(in));
  475. }
  476. /**
  477. * 技术发起公出查询发起情况
  478. */
  479. @RequestMapping(value = "/pushDateClock",method = RequestMethod.POST)
  480. public Result pushDateClock (){
  481. Result res =new Result();
  482. return res.data(publicReleaseService.pushDateClock());
  483. }
  484. /**
  485. * 公出&报销表
  486. */
  487. @RequestMapping(value = "/releaseAndExpenseCount",method = RequestMethod.GET)
  488. public Result releaseAndExpenseCount (InputreleaseAndExpenseCount in){
  489. Result res =new Result();
  490. return res.data(publicReleaseService.releaseAndExpenseCount(in));
  491. }/**
  492. * 公出&报销缓存清除
  493. */
  494. @RequestMapping(value = "/releaseAndExpenseCountClear",method = RequestMethod.GET)
  495. public Result releaseAndExpenseCountClear (){
  496. Result res =new Result();
  497. return res.data(publicReleaseService.releaseAndExpenseCountClear());
  498. }
  499. /**
  500. * 公出&报销表导出
  501. */
  502. @RequestMapping(value = "/releaseAndExpenseCount/Export",method = RequestMethod.GET)
  503. public Result releaseAndExpenseCountExport (InputreleaseAndExpenseCount in){
  504. List<releaseAndExpenseCountOut> list = publicReleaseService.releaseAndExpenseCount(in);
  505. NewExcelUtil<releaseAndExpenseCountOut> excelUtil=new NewExcelUtil<>(releaseAndExpenseCountOut.class);
  506. return excelUtil.exportExcel(list,"公出与报销表",uploadPath);
  507. }
  508. /**
  509. * 协单审核是否有未审核查询
  510. */
  511. @RequestMapping(value = "/unaudited",method = RequestMethod.GET)
  512. public Result assistUnaudited (){
  513. Result res =new Result();
  514. return res.data(publicReleaseService.assistUnaudited());
  515. }
  516. /**
  517. * 分享限时查询
  518. */
  519. @RequestMapping(value = "/limitUser",method = RequestMethod.POST)
  520. public Result limitUser (String uid,Integer hours){
  521. Result res =new Result();
  522. int i = publicReleaseService.pushLimitUser(uid,hours);
  523. if (i==0){
  524. return res().error(buildError(ErrorConstants.PARAM_ERROR,"只有客户归属人可以分享"));
  525. }
  526. return res.data(i);
  527. }
  528. /**
  529. * 修改最大公出
  530. */
  531. @RequestMapping(value = "/updateMaxDuration",method = RequestMethod.POST)
  532. public Result updateMaxDuration (String orderNo, Double maxDuration, String remarks){
  533. Result res =new Result();
  534. if (StringUtils.isEmpty(orderNo)){
  535. return res().error(buildError(ErrorConstants.PARAM_ERROR,"订单编号"));
  536. }
  537. if (maxDuration.isNaN()){
  538. return res().error(buildError(ErrorConstants.PARAM_ERROR,"最大公出"));
  539. }
  540. return res.data(publicReleaseService.updateMaxDuration(orderNo,maxDuration,remarks));
  541. }
  542. /**
  543. * 审核最大公出
  544. */
  545. @RequestMapping(value = "/examineMaxDuration",method = RequestMethod.POST)
  546. public Result examineMaxDuration (String orderNo,Integer status,String remarks){
  547. Result res =new Result();
  548. if (StringUtils.isEmpty(orderNo)){
  549. return res().error(buildError(ErrorConstants.PARAM_ERROR,"订单编号"));
  550. }
  551. return res.data(publicReleaseService.pushExamineMaxDuration(orderNo,status,remarks));
  552. }
  553. /**
  554. * 最大公出日志
  555. */
  556. @RequestMapping(value = "/maxDurationLog",method = RequestMethod.GET)
  557. public Result<List<OrderPublicReleaseLog>> maxDurationLog (String orderNo){
  558. Result res =new Result();
  559. if (StringUtils.isEmpty(orderNo)){
  560. return res().error(buildError(ErrorConstants.PARAM_ERROR,"订单编号"));
  561. }
  562. return res.data(publicReleaseService.maxDurationLog(orderNo));
  563. }
  564. /**
  565. * 修改最大公出审核配置
  566. */
  567. @RequestMapping(value = "/updatePublicConfig",method = RequestMethod.POST)
  568. public Result updatePublicConfig (PublicConfig in){
  569. Result res =new Result();
  570. return res.data(publicReleaseService.updatePublicConfig(in));
  571. }
  572. /**
  573. * 获取最大公出审核配置
  574. */
  575. @RequestMapping(value = "/getPublicConfig",method = RequestMethod.GET)
  576. public Result<OutPublicConfig> getPublicConfig (){
  577. Result res =new Result();
  578. return res.data(publicReleaseService.getPublicConfig());
  579. }
  580. /**
  581. * 协单统计列表
  582. */
  583. @RequestMapping(value = "/listAssist", method = RequestMethod.GET)
  584. public Result listAssist(InputListAssist in){
  585. Result res =new Result();
  586. res.setData(publicReleaseService.listAssist(in));
  587. return res;
  588. }
  589. /**
  590. * 协单统计列表-导出
  591. */
  592. @RequestMapping(value = "/listAssistExprot", method = RequestMethod.GET)
  593. public Result listAssistExprot(InputListAssist in){
  594. return publicReleaseService.listAssistExprot(in,uploadPath);
  595. }
  596. }