OrderProjectApiController.java 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760
  1. package com.goafanti.order.controller;
  2. import java.io.IOException;
  3. import java.text.ParseException;
  4. import java.text.SimpleDateFormat;
  5. import java.util.ArrayList;
  6. import java.util.Arrays;
  7. import java.util.List;
  8. import javax.servlet.http.HttpServletRequest;
  9. import javax.servlet.http.HttpServletResponse;
  10. import javax.validation.Valid;
  11. import com.goafanti.common.model.TOrderTask;
  12. import com.goafanti.common.utils.ParamUtils;
  13. import com.goafanti.core.mybatis.page.Pagination;
  14. import com.goafanti.order.bo.*;
  15. import com.goafanti.order.service.OrderNewService;
  16. import org.springframework.beans.BeanUtils;
  17. import org.springframework.beans.factory.annotation.Autowired;
  18. import org.springframework.beans.factory.annotation.Value;
  19. import org.springframework.validation.BindingResult;
  20. import org.springframework.validation.annotation.Validated;
  21. import org.springframework.web.bind.annotation.RequestMapping;
  22. import org.springframework.web.bind.annotation.RequestMethod;
  23. import org.springframework.web.bind.annotation.RestController;
  24. import com.goafanti.common.bo.Result;
  25. import com.goafanti.common.constant.AFTConstants;
  26. import com.goafanti.common.constant.ErrorConstants;
  27. import com.goafanti.common.controller.CertifyApiController;
  28. import com.goafanti.common.enums.OfficialPatentType;
  29. import com.goafanti.common.model.TTaskHours;
  30. import com.goafanti.common.utils.StringUtils;
  31. import com.goafanti.common.utils.excel.NewExcelUtil;
  32. import com.goafanti.core.shiro.token.TokenManager;
  33. import com.goafanti.order.service.OrderProjectService;
  34. @RestController
  35. @RequestMapping(value = "/api/admin/orderProject")
  36. public class OrderProjectApiController extends CertifyApiController {
  37. @Autowired
  38. private OrderProjectService orderProjectService;
  39. @Autowired
  40. private OrderNewService orderNewService;
  41. @Value(value = "${upload.path}")
  42. private String uploadPath = null;
  43. /**
  44. * 项目分配、项目派单、项目转交
  45. * taskId 项目ID
  46. * taskReceiverId 受理人ID
  47. * type 0管理员派单 1经理转交 2经理派单 3咨询师转交 4回退
  48. */
  49. @RequestMapping(value = "/projectDistribution", method = RequestMethod.POST)
  50. public Result projectDistribution(Integer taskId,String taskReceiverId ,String remarks,Integer type){
  51. Result res = new Result();
  52. if(null==taskId || StringUtils.isBlank(taskReceiverId)){
  53. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "任务编号和受理人"));
  54. return res;
  55. }
  56. if(type==null) type=0;
  57. boolean flag=true;
  58. if (type==0&&(TokenManager.hasRole(AFTConstants.TECH_ADMIN)||TokenManager.hasRole(AFTConstants.SUPERADMIN)))flag=false;
  59. else if ((type==1||type==2)&&TokenManager.hasRole(AFTConstants.TECH_MANAGER))flag=false;
  60. else if ((type==3||type==4)&&TokenManager.hasRole(AFTConstants.TECH))flag=false;
  61. if (flag) {
  62. res.getError().add(buildError("角色不正确,请勿在浏览器登录多个账号!"));
  63. return res;
  64. }
  65. res.setData(orderProjectService.updateProjectDistribution( taskId, taskReceiverId,remarks,type));
  66. return res;
  67. }
  68. /**
  69. * 任务派单列表 我的任务,我的外包任务
  70. * specially 0我的任务 1任务派单
  71. * 我的任务不看父项目,只看子项目 ,任务派单子项目父项目都会存在
  72. */
  73. @RequestMapping(value="/orderTaskList" ,method = RequestMethod.GET)
  74. public Result orderTaskList(inuptTaskListBo ib){
  75. Result res=new Result();
  76. res.setData(orderProjectService.orderTaskList(ib));
  77. return res;
  78. }
  79. /**
  80. * 任务派单查询
  81. */
  82. @RequestMapping(value="/selectTaskList" ,method = RequestMethod.GET)
  83. public Result selectTaskList(String name,String orderNo,String taskId,Integer taskStatus,String adminName,Integer specially ,String depId,String thchId
  84. ,Integer pageNo,Integer pageSize){
  85. Result res=new Result();
  86. res.setData(orderProjectService.selectTaskList( name, orderNo, taskId, taskStatus, adminName,specially , depId,thchId ,pageNo, pageSize));
  87. return res;
  88. }
  89. /**
  90. * 经理查询订单
  91. */
  92. @RequestMapping(value="/managerSelect" ,method = RequestMethod.GET)
  93. public Result managerSelect(String name,String orderNo,String contractNo,String cid,String projectType,String thchId,
  94. String depId,String techDepId ,Integer declarationBatch ,String commodityPrice,String startTime,
  95. String endTime,Integer pageNo,Integer pageSize){
  96. Result res=new Result();
  97. res.setData(orderProjectService.managerSelect( name, orderNo, contractNo, cid, projectType,thchId,
  98. depId, techDepId , declarationBatch ,commodityPrice,startTime, endTime , pageNo, pageSize));
  99. return res;
  100. }
  101. /**
  102. * 经理查询订单
  103. */
  104. @RequestMapping(value="/exportManagerSelect" ,method = RequestMethod.GET)
  105. public Result exportManagerSelect(String name,String orderNo,String contractNo,String cid,String projectType,String thchId,
  106. String depId,String techDepId ,Integer declarationBatch ,String commodityPrice,String startTime,
  107. String endTime,Integer pageNo,Integer pageSize){
  108. @SuppressWarnings("unchecked")
  109. List<managerListBo> list=(List<managerListBo>) orderProjectService.managerSelect( name, orderNo, contractNo,
  110. cid, projectType,thchId,depId, techDepId , declarationBatch ,commodityPrice,startTime, endTime , pageNo, pageSize).getList();
  111. NewExcelUtil<managerListBo> excel=new NewExcelUtil<>(managerListBo.class);
  112. return excel.exportExcel(list, "企业项目查询列表", uploadPath);
  113. }
  114. /**
  115. * 任务详情
  116. */
  117. @RequestMapping(value="/orderTaskDetail" ,method = RequestMethod.GET)
  118. public Result orderTaskDetail(Integer id){
  119. Result res=new Result();
  120. res.setData(orderProjectService.orderTaskDetail(id));
  121. return res;
  122. }
  123. /**
  124. * 任务修改(咨询师)
  125. */
  126. @RequestMapping(value="/updateOrderTask" ,method = RequestMethod.POST)
  127. public Result updateOrderTask(TOrderTaskDetailBo t){
  128. Result res=new Result();
  129. res.setData(orderProjectService.updateOrderTask(t));
  130. return res;
  131. }
  132. /**
  133. * 修改项目状态(咨询师)
  134. */
  135. @RequestMapping(value="/updateProjectStatus" ,method = RequestMethod.POST)
  136. public Result updateProjectStatus(@Valid UpdateProjectStatusBo a,BindingResult bindingResult){
  137. Result res=new Result();
  138. if (bindingResult.hasErrors()) {
  139. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage()));
  140. return res;
  141. }
  142. res.setData(orderProjectService.updateProjectStatus( a));
  143. return res;
  144. }
  145. /**
  146. * 添加工时
  147. */
  148. @RequestMapping(value="/addTaskHours" ,method = RequestMethod.POST)
  149. public Result addTaskHours(TTaskHours t,String taskDate){
  150. Result res=new Result();
  151. if (t.getHours()==null) {
  152. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "任务时间"));
  153. return res;
  154. }
  155. if (StringUtils.isBlank(taskDate)) {
  156. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "工作日期"));
  157. return res;
  158. }
  159. if (StringUtils.isBlank(t.getRemarks())) {
  160. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "工作内容"));
  161. return res;
  162. }
  163. if (StringUtils.isNotBlank(taskDate)) {
  164. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  165. try {
  166. t.setTaskDay(sdf.parse(taskDate));
  167. } catch (ParseException e) {
  168. e.printStackTrace();
  169. }
  170. }
  171. res.setData(orderProjectService.addTaskHours(t));
  172. return res;
  173. }
  174. /**
  175. * 任务工时列表
  176. */
  177. @RequestMapping(value="/taskHoursList" ,method = RequestMethod.GET)
  178. public Result taskHoursList(inuptTaskHoursListBo ib,
  179. Integer pageNo, Integer pageSize){
  180. Result res=new Result();
  181. res.setData(orderProjectService.taskHoursList(ib,pageNo, pageSize));
  182. return res;
  183. }
  184. /**
  185. * 任务工时详情列表
  186. */
  187. @RequestMapping(value="/taskHoursDetailsList" ,method = RequestMethod.GET)
  188. public Result taskHoursDetailsList( String taskId ){
  189. Result res=new Result();
  190. if (StringUtils.isBlank(taskId)) {
  191. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "项目编号"));
  192. return res;
  193. }
  194. res.setData(orderProjectService.taskHoursDetailsList(taskId));
  195. return res;
  196. }
  197. /**
  198. * 任务操作日志
  199. */
  200. @RequestMapping(value="/TaskLogList" ,method = RequestMethod.GET)
  201. public Result TaskLogList(Integer id){
  202. Result res=new Result();
  203. res.setData(orderProjectService.TaskLogList(id));
  204. return res;
  205. }
  206. /** 任务文件上传 **/
  207. @RequestMapping(value = "/uploadOrderTaskFile", method = RequestMethod.POST)
  208. public Result uploadOrderTaskFile(HttpServletRequest req,String sign){
  209. Result res = new Result();
  210. res.setData(handleFile(res, "/order_task_file/", false, req, sign));
  211. return res;
  212. }
  213. /**
  214. * 新增项目申报进度
  215. */
  216. @RequestMapping(value="/createTaskProgress" ,method = RequestMethod.POST)
  217. public Result createTaskProgress(TaskProgressBo t){
  218. Result res=new Result();
  219. if ( null==t.getTaskId()|| null==t.getAlreadyNumber()) {
  220. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
  221. }
  222. res.setData(orderProjectService.createTaskProgress(t));
  223. return res;
  224. }
  225. /**
  226. * 修改项目申报进度
  227. */
  228. @RequestMapping(value="/updateTaskProgress" ,method = RequestMethod.POST)
  229. public Result updateTaskProgress(TaskProgressBo t){
  230. Result res=new Result();
  231. if (null==t.getTaskId()|| null==t.getAlreadyNumber()) {
  232. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
  233. }
  234. res.setData(orderProjectService.updateTaskProgress(t));
  235. return res;
  236. }
  237. /**
  238. * 删除项目申报进度
  239. */
  240. @RequestMapping(value="/delectTaskProgress" ,method = RequestMethod.POST)
  241. public Result delectTaskProgress(Integer id){
  242. Result res=new Result();
  243. if (null==id) {
  244. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
  245. }
  246. res.setData(orderProjectService.delectTaskProgress(id));
  247. return res;
  248. }
  249. /**
  250. * 查看项目申报进度
  251. */
  252. @RequestMapping(value="/selectTaskProgress" ,method = RequestMethod.GET)
  253. public Result selectTaskProgress(Integer tid){
  254. Result res=new Result();
  255. if (null==tid) {
  256. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
  257. }
  258. res.setData(orderProjectService.selectTaskProgress(tid));
  259. return res;
  260. }
  261. /**
  262. * 项目申报进度日志
  263. */
  264. @RequestMapping(value="/selectTaskProgressLog" ,method = RequestMethod.GET)
  265. public Result selectTaskProgressLog(Integer tid){
  266. Result res=new Result();
  267. if (null==tid) {
  268. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
  269. }
  270. res.setData(orderProjectService.selectTaskProgressLog(tid));
  271. return res;
  272. }
  273. /**
  274. * 拆分项目
  275. */
  276. @RequestMapping(value="/addSplitProject" ,method = RequestMethod.POST)
  277. public Result addSplitProject(Integer tid,String splitList){
  278. Result res=new Result();
  279. if (null==tid||StringUtils.isBlank(splitList)) {
  280. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"项目和拆分数","项目和拆分数"));
  281. return res;
  282. }
  283. int i=orderProjectService.pushSplitProject(tid,splitList);
  284. if (i==-1) {
  285. res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"拆分数","拆分数"));
  286. return res;
  287. }
  288. res.setData(i);
  289. return res;
  290. }
  291. /**
  292. * 拆分项目列表
  293. */
  294. @RequestMapping(value="/splitProjectList" ,method = RequestMethod.GET)
  295. public Result splitProjectList(Integer tid){
  296. Result res=new Result();
  297. if (null==tid) {
  298. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"项目和拆分数","项目和拆分数"));
  299. return res;
  300. }
  301. res.setData(orderProjectService.splitProjectList(tid,1));
  302. return res;
  303. }
  304. /**
  305. * 我的工时列表导出xls
  306. * @throws IOException
  307. */
  308. @RequestMapping(value = "/exportMyTaskList", method = RequestMethod.GET)
  309. public Result exportMyTaskList(inuptTaskHoursListBo ib, Integer pageNo, Integer pageSize) {
  310. if(pageSize==null)pageSize=999999;
  311. @SuppressWarnings("unchecked")
  312. List<TOrderTaskListBo> list=(List<TOrderTaskListBo>) orderProjectService.taskHoursList(ib, pageNo, pageSize).getList();
  313. NewExcelUtil<TOrderTaskListBo> excel=new NewExcelUtil<>(TOrderTaskListBo.class);
  314. return excel.exportExcel(list, "工时信息记录表",uploadPath);
  315. }
  316. /**
  317. * 我的任务列表导出xls
  318. * @throws IOException
  319. */
  320. @RequestMapping(value = "/exporProjectList", method = RequestMethod.GET)
  321. public Result exporProjectList(HttpServletResponse response,inuptTaskListBo ib) {
  322. if(ib.getPageSize()==null)ib.setPageSize(99999);
  323. String str="项目任务列表";
  324. @SuppressWarnings("unchecked")
  325. List<TOrderTaskListBo> list=(List<TOrderTaskListBo>) orderProjectService.orderTaskList(ib).getList();
  326. NewExcelUtil<TOrderTaskListBo>excel=new NewExcelUtil<>(TOrderTaskListBo.class);
  327. return excel.exportExcel(list, str, response);
  328. }
  329. /**
  330. * 项目日志 (转交日志)
  331. * @param tid
  332. * @return
  333. */
  334. @RequestMapping(value = "/taskAttributionLog",method = RequestMethod.GET)
  335. public Result taskAttributionLog(Integer tid) {
  336. Result res =new Result();
  337. if (tid==null) {
  338. res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"项目编号","项目编号"));
  339. return res;
  340. }
  341. res.data(orderProjectService.taskAttributionLog(tid));
  342. return res;
  343. }
  344. /**
  345. * 客户项目列表
  346. * @return
  347. */
  348. @RequestMapping(value = "/selectUidByproject",method = RequestMethod.GET)
  349. public Result selectUidByproject(String uid) {
  350. Result res =new Result();
  351. if (uid==null) {
  352. res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"客户编号","客户编号"));
  353. return res;
  354. }
  355. res.data( orderProjectService.selectUidByproject(uid) );
  356. return res;
  357. }
  358. /**
  359. * 发起项目核对
  360. * @param tid
  361. * @return
  362. */
  363. @RequestMapping(value = "/addProjectCheck",method = RequestMethod.POST)
  364. public Result addProjectCheck(Integer tid) {
  365. Result res =new Result();
  366. if (tid==null) {
  367. res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"项目编号","项目编号"));
  368. return res;
  369. }
  370. res.data( orderProjectService.addProjectCheck(tid) );
  371. return res;
  372. }
  373. /**
  374. * 核对日志
  375. * @param tid
  376. * @return
  377. */
  378. @RequestMapping(value = "/projectCheckLog",method = RequestMethod.GET)
  379. public Result projectCheckLog(Integer tid) {
  380. Result res =new Result();
  381. if (tid==null) {
  382. res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"项目编号","项目编号"));
  383. return res;
  384. }
  385. res.data( orderProjectService.projectCheckLog(tid) );
  386. return res;
  387. }
  388. /**
  389. * 获取专利分类
  390. * @return
  391. */
  392. @RequestMapping(value = "/getPatentType",method = RequestMethod.GET)
  393. public Result getPatentType() {
  394. Result res =new Result();
  395. res.data(OfficialPatentType.getStatus());
  396. return res;
  397. }
  398. /**
  399. * 核对列表
  400. * @return
  401. */
  402. @RequestMapping(value = "/selectProjectCheck",method = RequestMethod.GET)
  403. public Result selectProjectCheck(InputProjectCheck in) {
  404. Result res =new Result();
  405. res.data(orderProjectService.selectProjectCheck(in));
  406. return res;
  407. }
  408. /**
  409. * 高新复审统计
  410. */
  411. @RequestMapping(value = "/highNewRetrialStatistics",method = RequestMethod.GET)
  412. public Result highNewRetrialStatistics(String depId,String startDate,String endDate) {
  413. Result res =new Result();
  414. res.data(orderProjectService.highNewRetrialStatistics(depId,startDate,endDate));
  415. return res;
  416. }
  417. /**
  418. * 高新复审统计
  419. */
  420. @RequestMapping(value = "/highNewRetrialStatistics/export",method = RequestMethod.GET)
  421. public Result highNewRetrialStatisticsExport(String depId,String startDate,String endDate,String depName) {
  422. List<OutHighNewRetrialStatistics> list=orderProjectService.highNewRetrialStatistics(depId,startDate,endDate);
  423. NewExcelUtil<OutHighNewRetrialStatistics> newExcelUtil=new NewExcelUtil<>(OutHighNewRetrialStatistics.class);
  424. StringBuffer str=new StringBuffer("搜索条件=》");
  425. if (depName!=null)str=str.append("部门:").append(depName).append(",");
  426. if (startDate!=null&&endDate!=null)str=str.append("时间:").append(startDate).append("~").append(endDate).append(",");
  427. return newExcelUtil.exportExcel(list,"高新复审统计",uploadPath,str.substring(0,str.toString().length()-1));
  428. }
  429. /**
  430. * 高新复审详情列表
  431. */
  432. @RequestMapping(value = "/highNewRetrialList",method = RequestMethod.GET)
  433. public Result highNewRetrialList(String province,String depId,String startDate,String endDate,String aid,Integer sort) {
  434. Result res =new Result();
  435. res.data(orderProjectService.highNewRetrialList(province,depId,aid,sort,startDate,endDate));
  436. return res;
  437. }
  438. @RequestMapping(value = "/highNewRetrialList/export",method = RequestMethod.GET)
  439. public Result highNewRetrialListExport(String province,String provinceName,String depId,String depName,String startDate,String endDate,String aid,
  440. String aName,Integer sort) {
  441. List<OutHighNewRetrialList> list=orderProjectService.highNewRetrialList(province,depId,aid,sort,startDate,endDate);
  442. NewExcelUtil<OutHighNewRetrialList> newExcelUtil=new NewExcelUtil<>(OutHighNewRetrialList.class);
  443. StringBuffer str=new StringBuffer("搜索条件=》");
  444. if (provinceName!=null)str=str.append("省份:").append(provinceName).append(",");
  445. if (depName!=null)str=str.append("部门:").append(depName).append(",");
  446. if (aName!=null)str=str.append("跟进人:").append(aName).append(",");
  447. if (startDate!=null&&endDate!=null)str=str.append("时间:").append(startDate).append("~").append(endDate).append(",");
  448. if(sort!=null){
  449. str=str.append("排序:");
  450. if(sort==0)str=str.append("按签通过高新排序");
  451. else if(sort==1)str=str.append("按未通过高新排序");
  452. }
  453. return newExcelUtil.exportExcel(list,"高新复审详情",uploadPath,str.substring(0,str.toString().length()-1));
  454. }
  455. /**
  456. * 新增会员项目
  457. * @param t
  458. * @return
  459. */
  460. @RequestMapping(value = "/addMemberProject" ,method = RequestMethod.POST)
  461. public Result addMemberProject(InputAddTask t){
  462. Result res = new Result();
  463. if(StringUtils.isBlank(t.getOrderNo())){
  464. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单编号"));
  465. return res;
  466. }
  467. t.setProcessStatus(1);
  468. t.setMain(0);
  469. return res.data(orderNewService.addMemberProject(t));
  470. }
  471. /**
  472. * 会员项目审核
  473. * @param in
  474. * @return
  475. */
  476. @RequestMapping(value = "/examineMemberProject" ,method = RequestMethod.POST)
  477. public Result examineMemberProject(InputMenber in){
  478. Result res = new Result();
  479. if(in.getId()==null){
  480. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"项目编号"));
  481. return res;
  482. }
  483. return res.data(orderProjectService.pushExamineMemberProject(in));
  484. }
  485. /**
  486. * 会员项目修改
  487. * @param t
  488. * @return
  489. */
  490. @RequestMapping(value = "/updateMemberProject" ,method = RequestMethod.POST)
  491. public Result updateMemberProject(InputAddTask t){
  492. Result res = new Result();
  493. if(t.getId()==null){
  494. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"项目编号"));
  495. return res;
  496. }
  497. return res.data(orderProjectService.updateMemberProject(t));
  498. }
  499. /**
  500. * 会员项目列表
  501. * @param in
  502. * @return
  503. */
  504. @RequestMapping(value = "/memberList" ,method = RequestMethod.GET)
  505. public Result memberList(InputMemberList in){
  506. Result res = new Result();
  507. return res.data(orderProjectService.memberList(in));
  508. }
  509. /**
  510. * 会员项目列表
  511. * @return
  512. */
  513. @RequestMapping(value = "/memberLog" ,method = RequestMethod.GET)
  514. public Result memberLog(Integer id){
  515. Result res = new Result();
  516. return res.data(orderProjectService.memberLog(id));
  517. }
  518. /**
  519. * 会员项目列表
  520. * @param in
  521. * @return
  522. */
  523. @RequestMapping(value = "/memberList/export" ,method = RequestMethod.GET)
  524. public Result memberListExport(InputMemberList in){
  525. return orderProjectService.memberListExport(in);
  526. }
  527. /** 文件上传 **/
  528. @RequestMapping(value = "/uploadMemberFile", method = RequestMethod.POST)
  529. public Result uploadOrderInvoiceFile(HttpServletRequest req,String sign){
  530. Result res = new Result();
  531. res.setData(handleFile(res, "/member_project/", false, req, sign));
  532. return res;
  533. }
  534. /**
  535. * 新增会员子项目
  536. *
  537. * @return
  538. */
  539. @RequestMapping(value = "/addMemberFirstSonProject" ,method = RequestMethod.POST)
  540. public Result addMemberFirstSonProject(Integer tid,String serviceYear,String taskComment){
  541. Result res = new Result();
  542. if(tid==null||StringUtils.isBlank(serviceYear)){
  543. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","参数"));
  544. return res;
  545. }
  546. if (orderProjectService.checkOrderProcessStatus(tid,0)){
  547. res.getError().add(buildError("项目已发起,不允许使用首次新增会员子项目。"));
  548. return res;
  549. }
  550. return res.data(orderProjectService.addMemberSonProject( tid, serviceYear, taskComment,null,null));
  551. }
  552. /**
  553. * 新增会员子项目
  554. *
  555. * @return
  556. */
  557. @RequestMapping(value = "/addMemberSonProject" ,method = RequestMethod.POST)
  558. public Result addMemberSonProject(Integer tid,String serviceYear,String taskComment,Integer memberType,String pictureUrl){
  559. Result res = new Result();
  560. if(tid==null||StringUtils.isBlank(serviceYear)){
  561. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","参数"));
  562. return res;
  563. }
  564. return res.data(orderProjectService.addMemberSonProject( tid, serviceYear, taskComment,memberType, pictureUrl));
  565. }
  566. /**
  567. * 删除会员子项目
  568. *
  569. * @return
  570. */
  571. @RequestMapping(value = "/deleteMemberSonProject" ,method = RequestMethod.POST)
  572. public Result deleteMemberSonProject(Integer id){
  573. Result res = new Result();
  574. if(id==null){
  575. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单编号"));
  576. return res;
  577. }
  578. return res.data(orderProjectService.deleteMemberSonProject( id));
  579. }
  580. /**
  581. * 项目暂停
  582. *
  583. */
  584. @RequestMapping(value = "/addProjectStop" ,method = RequestMethod.POST)
  585. public Result addProjectStop(@Validated InputProjectStop in,BindingResult bindingResult){
  586. Result res = new Result();
  587. if (bindingResult.hasErrors()) {
  588. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  589. ParamUtils.getParamName(in,bindingResult.getFieldError().getField())));
  590. return res;
  591. }
  592. if (in.getIds()==null){
  593. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"编号","编号"));
  594. return res;
  595. }
  596. return res.data(orderProjectService.addProjectStop( in));
  597. }
  598. /**
  599. * 项目暂停
  600. *
  601. */
  602. @RequestMapping(value = "/updateProjectStop" ,method = RequestMethod.POST)
  603. public Result updateProjectStop(@Validated InputProjectStop in,BindingResult bindingResult){
  604. Result res = new Result();
  605. if (bindingResult.hasErrors()) {
  606. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  607. ParamUtils.getParamName(in,bindingResult.getFieldError().getField())));
  608. return res;
  609. }
  610. if (in.getStopId()==null){
  611. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"暂停编号","暂停编号"));
  612. return res;
  613. }
  614. return res.data(orderProjectService.updateProjectStop(in));
  615. }
  616. /**
  617. * 项目暂停审核
  618. *
  619. */
  620. @RequestMapping(value = "/examineProjectStop" ,method = RequestMethod.POST)
  621. public Result examineProjectStop(@Validated InputTaskStopLog in,BindingResult bindingResult){
  622. Result res = new Result();
  623. if (bindingResult.hasErrors()) {
  624. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  625. ParamUtils.getParamName(in,bindingResult.getFieldError().getField())));
  626. return res;
  627. }
  628. return res.data(orderProjectService.pushExamineProjectStop( in));
  629. }
  630. /**
  631. * 项目暂停日志列表
  632. *
  633. */
  634. @RequestMapping(value = "/projectStopList" ,method = RequestMethod.GET)
  635. public Result projectStopList(Integer taskStopId){
  636. Result res = new Result();
  637. if (taskStopId==null){
  638. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"项目暂停编号","项目暂停编号"));
  639. return res;
  640. }
  641. return res.data(orderProjectService.projectStopList( taskStopId));
  642. }
  643. /**
  644. * 项目暂停列表
  645. *
  646. */
  647. @RequestMapping(value = "/selectProjectStop" ,method = RequestMethod.GET)
  648. public Result selectProjectStop(String orderNo,String userName,String depId,String contractNo, String projectName,Integer status,
  649. String startTime, String endTime, String receiverId, Integer pageNo,Integer pageSize){
  650. Result res = new Result();
  651. return res.data(orderProjectService.selectProjectStop( orderNo, userName, depId, contractNo,
  652. projectName, status,startTime,endTime,receiverId, pageNo, pageSize));
  653. }
  654. /**
  655. * 项目暂停列表
  656. *
  657. */
  658. @RequestMapping(value = "/selectProjectStop/export" ,method = RequestMethod.GET)
  659. public Result selectProjectSotpExport(String orderNo,String userName,String depId,String contractNo, String projectName,Integer status,
  660. String startTime, String endTime, String receiverId, Integer pageNo,Integer pageSize){
  661. NewExcelUtil newExcelUtil=new NewExcelUtil(OutselectProjectSotpBo.class);
  662. Pagination<?> p = orderProjectService.selectProjectStop(orderNo, userName, depId, contractNo,
  663. projectName, status, startTime, endTime, receiverId, pageNo, pageSize);
  664. List<OutselectProjectSotp> list = (List<OutselectProjectSotp>) p.getList();
  665. List<OutselectProjectSotpBo> list2=new ArrayList<>();
  666. for (OutselectProjectSotp use : list) {
  667. OutselectProjectSotpBo o = new OutselectProjectSotpBo();
  668. BeanUtils.copyProperties(use,o);
  669. StringBuffer str =new StringBuffer();
  670. if (o.getStopStatus()==0){
  671. str=str.append("已发起");
  672. }else if (o.getStopStatus()==1){
  673. str=str.append("已完成");
  674. }else if (o.getStopStatus()==2){
  675. str=str.append("已拒绝");
  676. }
  677. if (o.getStopType()==0){
  678. str=str.append("暂停");
  679. }else if (o.getStopStatus()==1){
  680. str=str.append("重启");
  681. }
  682. o.setStatusName(str.toString());
  683. list2.add(o);
  684. }
  685. return newExcelUtil.exportExcel(list2,"暂停项目列表",uploadPath);
  686. }
  687. /** 文件上传 **/
  688. @RequestMapping(value = "/uploadStopFile", method = RequestMethod.POST)
  689. public Result uploadStopFile(HttpServletRequest req,String sign){
  690. Result res = new Result();
  691. res.setData(handleFile(res, "/projectStopFile/", false, req, sign));
  692. return res;
  693. }
  694. }