OrderProjectApiController.java 27 KB

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