OrderProjectApiController.java 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823
  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,String type,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,type , 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,String type,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 ,type, 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. if (!StringUtils.isContainChinese(t.getContacts())){
  128. res.getError().add(buildError("联系人名称必须是中文。"));
  129. return res;
  130. }
  131. if (!StringUtils.isContactMobile(t.getContactMobile())){
  132. res.getError().add(buildError(ErrorConstants.MOBILE_PATTERN_ERROR));
  133. return res;
  134. }
  135. res.setData(orderProjectService.updateOrderTask(t));
  136. return res;
  137. }
  138. /**
  139. * 修改项目状态(咨询师)、项目状态修改
  140. */
  141. @RequestMapping(value="/updateProjectStatus" ,method = RequestMethod.POST)
  142. public Result updateProjectStatus(@Valid UpdateProjectStatusBo a,BindingResult bindingResult){
  143. Result res=new Result();
  144. if (bindingResult.hasErrors()) {
  145. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage()));
  146. return res;
  147. }
  148. res.setData(orderProjectService.updateProjectStatus( a));
  149. return res;
  150. }
  151. /**
  152. * 添加工时
  153. */
  154. @RequestMapping(value="/addTaskHours" ,method = RequestMethod.POST)
  155. public Result addTaskHours(TTaskHours t,String taskDate){
  156. Result res=new Result();
  157. if (t.getHours()==null) {
  158. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "任务时间"));
  159. return res;
  160. }
  161. if (StringUtils.isBlank(taskDate)) {
  162. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "工作日期"));
  163. return res;
  164. }
  165. if (StringUtils.isBlank(t.getRemarks())) {
  166. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "工作内容"));
  167. return res;
  168. }
  169. if (StringUtils.isNotBlank(taskDate)) {
  170. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  171. try {
  172. t.setTaskDay(sdf.parse(taskDate));
  173. } catch (ParseException e) {
  174. e.printStackTrace();
  175. }
  176. }
  177. res.setData(orderProjectService.addTaskHours(t));
  178. return res;
  179. }
  180. /**
  181. * 任务工时列表
  182. */
  183. @RequestMapping(value="/taskHoursList" ,method = RequestMethod.GET)
  184. public Result taskHoursList(inuptTaskHoursListBo ib,
  185. Integer pageNo, Integer pageSize){
  186. Result res=new Result();
  187. res.setData(orderProjectService.taskHoursList(ib,pageNo, pageSize));
  188. return res;
  189. }
  190. /**
  191. * 任务工时详情列表
  192. */
  193. @RequestMapping(value="/taskHoursDetailsList" ,method = RequestMethod.GET)
  194. public Result taskHoursDetailsList( String taskId ){
  195. Result res=new Result();
  196. if (StringUtils.isBlank(taskId)) {
  197. res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "项目编号"));
  198. return res;
  199. }
  200. res.setData(orderProjectService.taskHoursDetailsList(taskId));
  201. return res;
  202. }
  203. /**
  204. * 任务操作日志
  205. */
  206. @RequestMapping(value="/TaskLogList" ,method = RequestMethod.GET)
  207. public Result TaskLogList(Integer id){
  208. Result res=new Result();
  209. res.setData(orderProjectService.TaskLogList(id));
  210. return res;
  211. }
  212. /**
  213. * 任务派单日志
  214. */
  215. @RequestMapping(value="/dispatchTaskLog" ,method = RequestMethod.GET)
  216. public Result dispatchTaskLog(Integer id){
  217. Result res=new Result();
  218. res.setData(orderProjectService.dispatchTaskLog(id));
  219. return res;
  220. }
  221. /** 任务文件上传 **/
  222. @RequestMapping(value = "/uploadOrderTaskFile", method = RequestMethod.POST)
  223. public Result uploadOrderTaskFile(HttpServletRequest req,String sign){
  224. Result res = new Result();
  225. res.setData(handleFile(res, "/order_task_file/", false, req, sign));
  226. return res;
  227. }
  228. /**
  229. * 新增项目申报进度
  230. */
  231. @RequestMapping(value="/createTaskProgress" ,method = RequestMethod.POST)
  232. public Result createTaskProgress(TaskProgressBo t){
  233. Result res=new Result();
  234. if ( null==t.getTaskId()|| null==t.getAlreadyNumber()) {
  235. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
  236. }
  237. res.setData(orderProjectService.createTaskProgress(t));
  238. return res;
  239. }
  240. /**
  241. * 修改项目申报进度
  242. */
  243. @RequestMapping(value="/updateTaskProgress" ,method = RequestMethod.POST)
  244. public Result updateTaskProgress(TaskProgressBo t){
  245. Result res=new Result();
  246. if (null==t.getTaskId()|| null==t.getAlreadyNumber()) {
  247. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
  248. }
  249. res.setData(orderProjectService.updateTaskProgress(t));
  250. return res;
  251. }
  252. /**
  253. * 删除项目申报进度
  254. */
  255. @RequestMapping(value="/delectTaskProgress" ,method = RequestMethod.POST)
  256. public Result delectTaskProgress(Integer id){
  257. Result res=new Result();
  258. if (null==id) {
  259. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
  260. }
  261. res.setData(orderProjectService.delectTaskProgress(id));
  262. return res;
  263. }
  264. /**
  265. * 查看项目申报进度
  266. */
  267. @RequestMapping(value="/selectTaskProgress" ,method = RequestMethod.GET)
  268. public Result selectTaskProgress(Integer tid){
  269. Result res=new Result();
  270. if (null==tid) {
  271. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
  272. }
  273. res.setData(orderProjectService.selectTaskProgress(tid));
  274. return res;
  275. }
  276. /**
  277. * 项目申报进度日志
  278. */
  279. @RequestMapping(value="/selectTaskProgressLog" ,method = RequestMethod.GET)
  280. public Result selectTaskProgressLog(Integer tid){
  281. Result res=new Result();
  282. if (null==tid) {
  283. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
  284. }
  285. res.setData(orderProjectService.selectTaskProgressLog(tid));
  286. return res;
  287. }
  288. /**
  289. * 拆分项目
  290. */
  291. @RequestMapping(value="/addSplitProject" ,method = RequestMethod.POST)
  292. public Result addSplitProject(Integer tid,String splitList){
  293. Result res=new Result();
  294. if (null==tid||StringUtils.isBlank(splitList)) {
  295. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"项目和拆分数","项目和拆分数"));
  296. return res;
  297. }
  298. int i=orderProjectService.pushSplitProject(tid,splitList);
  299. if (i==-1) {
  300. res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"拆分数","拆分数"));
  301. return res;
  302. }
  303. res.setData(i);
  304. return res;
  305. }
  306. /**
  307. * 拆分项目列表
  308. */
  309. @RequestMapping(value="/splitProjectList" ,method = RequestMethod.GET)
  310. public Result splitProjectList(Integer tid){
  311. Result res=new Result();
  312. if (null==tid) {
  313. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"项目和拆分数","项目和拆分数"));
  314. return res;
  315. }
  316. res.setData(orderProjectService.splitProjectList(tid,1));
  317. return res;
  318. }
  319. /**
  320. * 我的工时列表导出xls
  321. * @throws IOException
  322. */
  323. @RequestMapping(value = "/exportMyTaskList", method = RequestMethod.GET)
  324. public Result exportMyTaskList(inuptTaskHoursListBo ib, Integer pageNo, Integer pageSize) {
  325. if(pageSize==null)pageSize=999999;
  326. @SuppressWarnings("unchecked")
  327. List<TOrderTaskListBo> list=(List<TOrderTaskListBo>) orderProjectService.taskHoursList(ib, pageNo, pageSize).getList();
  328. NewExcelUtil<TOrderTaskListBo> excel=new NewExcelUtil<>(TOrderTaskListBo.class);
  329. return excel.exportExcel(list, "工时信息记录表",uploadPath);
  330. }
  331. /**
  332. * 我的任务列表导出xls
  333. * @throws IOException
  334. */
  335. @RequestMapping(value = "/exporProjectList", method = RequestMethod.GET)
  336. public Result exporProjectList(HttpServletResponse response,inuptTaskListBo ib) {
  337. if(ib.getPageSize()==null)ib.setPageSize(99999);
  338. String str="项目任务列表";
  339. @SuppressWarnings("unchecked")
  340. List<TOrderTaskListBo> list=(List<TOrderTaskListBo>) orderProjectService.orderTaskList(ib).getList();
  341. NewExcelUtil<TOrderTaskListBo>excel=new NewExcelUtil<>(TOrderTaskListBo.class);
  342. return excel.exportExcel(list, str, response);
  343. }
  344. /**
  345. * 项目日志 (转交日志)
  346. * @param tid
  347. * @return
  348. */
  349. @RequestMapping(value = "/taskAttributionLog",method = RequestMethod.GET)
  350. public Result taskAttributionLog(Integer tid) {
  351. Result res =new Result();
  352. if (tid==null) {
  353. res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"项目编号","项目编号"));
  354. return res;
  355. }
  356. res.data(orderProjectService.taskAttributionLog(tid));
  357. return res;
  358. }
  359. /**
  360. * 客户项目列表
  361. * @return
  362. */
  363. @RequestMapping(value = "/selectUidByproject",method = RequestMethod.GET)
  364. public Result selectUidByproject(String uid) {
  365. Result res =new Result();
  366. if (uid==null) {
  367. res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"客户编号","客户编号"));
  368. return res;
  369. }
  370. res.data( orderProjectService.selectUidByproject(uid) );
  371. return res;
  372. }
  373. /**
  374. * 发起项目核对
  375. * @param tid
  376. * @return
  377. */
  378. @RequestMapping(value = "/addProjectCheck",method = RequestMethod.POST)
  379. public Result addProjectCheck(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.addProjectCheck(tid) );
  386. return res;
  387. }
  388. /**
  389. * 核对日志
  390. * @param tid
  391. * @return
  392. */
  393. @RequestMapping(value = "/projectCheckLog",method = RequestMethod.GET)
  394. public Result projectCheckLog(Integer tid) {
  395. Result res =new Result();
  396. if (tid==null) {
  397. res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"项目编号","项目编号"));
  398. return res;
  399. }
  400. res.data( orderProjectService.projectCheckLog(tid) );
  401. return res;
  402. }
  403. /**
  404. * 获取专利分类
  405. * @return
  406. */
  407. @RequestMapping(value = "/getPatentType",method = RequestMethod.GET)
  408. public Result getPatentType() {
  409. Result res =new Result();
  410. res.data(OfficialPatentType.getStatus());
  411. return res;
  412. }
  413. /**
  414. * 核对列表
  415. * @return
  416. */
  417. @RequestMapping(value = "/selectProjectCheck",method = RequestMethod.GET)
  418. public Result selectProjectCheck(InputProjectCheck in) {
  419. Result res =new Result();
  420. res.data(orderProjectService.selectProjectCheck(in));
  421. return res;
  422. }
  423. /**
  424. * 高新复审统计
  425. */
  426. @RequestMapping(value = "/highNewRetrialStatistics",method = RequestMethod.GET)
  427. public Result highNewRetrialStatistics(String depId,String startDate,String endDate) {
  428. Result res =new Result();
  429. res.data(orderProjectService.highNewRetrialStatistics(depId,startDate,endDate));
  430. return res;
  431. }
  432. /**
  433. * 高新复审统计
  434. */
  435. @RequestMapping(value = "/highNewRetrialStatistics/export",method = RequestMethod.GET)
  436. public Result highNewRetrialStatisticsExport(String depId,String startDate,String endDate,String depName) {
  437. List<OutHighNewRetrialStatistics> list=orderProjectService.highNewRetrialStatistics(depId,startDate,endDate);
  438. NewExcelUtil<OutHighNewRetrialStatistics> newExcelUtil=new NewExcelUtil<>(OutHighNewRetrialStatistics.class);
  439. StringBuffer str=new StringBuffer("搜索条件=》");
  440. if (depName!=null)str=str.append("部门:").append(depName).append(",");
  441. if (startDate!=null&&endDate!=null)str=str.append("时间:").append(startDate).append("~").append(endDate).append(",");
  442. return newExcelUtil.exportExcel(list,"高新复审统计",uploadPath,str.substring(0,str.toString().length()-1));
  443. }
  444. /**
  445. * 高新复审详情列表
  446. */
  447. @RequestMapping(value = "/highNewRetrialList",method = RequestMethod.GET)
  448. public Result highNewRetrialList(String province,String depId,String startDate,String endDate,String aid,Integer sort) {
  449. Result res =new Result();
  450. res.data(orderProjectService.highNewRetrialList(province,depId,aid,sort,startDate,endDate));
  451. return res;
  452. }
  453. @RequestMapping(value = "/highNewRetrialList/export",method = RequestMethod.GET)
  454. public Result highNewRetrialListExport(String province,String provinceName,String depId,String depName,String startDate,String endDate,String aid,
  455. String aName,Integer sort) {
  456. List<OutHighNewRetrialList> list=orderProjectService.highNewRetrialList(province,depId,aid,sort,startDate,endDate);
  457. NewExcelUtil<OutHighNewRetrialList> newExcelUtil=new NewExcelUtil<>(OutHighNewRetrialList.class);
  458. StringBuffer str=new StringBuffer("搜索条件=》");
  459. if (provinceName!=null)str=str.append("省份:").append(provinceName).append(",");
  460. if (depName!=null)str=str.append("部门:").append(depName).append(",");
  461. if (aName!=null)str=str.append("跟进人:").append(aName).append(",");
  462. if (startDate!=null&&endDate!=null)str=str.append("时间:").append(startDate).append("~").append(endDate).append(",");
  463. if(sort!=null){
  464. str=str.append("排序:");
  465. if(sort==0)str=str.append("按签通过高新排序");
  466. else if(sort==1)str=str.append("按未通过高新排序");
  467. }
  468. return newExcelUtil.exportExcel(list,"高新复审详情",uploadPath,str.substring(0,str.toString().length()-1));
  469. }
  470. /**
  471. * 新增会员项目
  472. * @param t
  473. * @return
  474. */
  475. @RequestMapping(value = "/addMemberProject" ,method = RequestMethod.POST)
  476. public Result addMemberProject(InputAddTask t){
  477. Result res = new Result();
  478. if(StringUtils.isBlank(t.getOrderNo())){
  479. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单编号"));
  480. return res;
  481. }
  482. t.setProcessStatus(1);
  483. t.setMain(0);
  484. return res.data(orderNewService.addMemberProject(t));
  485. }
  486. /**
  487. * 会员项目审核
  488. * @param in
  489. * @return
  490. */
  491. @RequestMapping(value = "/examineMemberProject" ,method = RequestMethod.POST)
  492. public Result examineMemberProject(InputMenber in){
  493. Result res = new Result();
  494. if(in.getId()==null){
  495. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"项目编号"));
  496. return res;
  497. }
  498. return res.data(orderProjectService.pushExamineMemberProject(in));
  499. }
  500. /**
  501. * 会员项目修改
  502. * @param t
  503. * @return
  504. */
  505. @RequestMapping(value = "/updateMemberProject" ,method = RequestMethod.POST)
  506. public Result updateMemberProject(InputAddTask t){
  507. Result res = new Result();
  508. if(t.getId()==null){
  509. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"项目编号"));
  510. return res;
  511. }
  512. return res.data(orderProjectService.updateMemberProject(t));
  513. }
  514. /**
  515. * 会员项目列表
  516. * @param in
  517. * @return
  518. */
  519. @RequestMapping(value = "/memberList" ,method = RequestMethod.GET)
  520. public Result memberList(InputMemberList in){
  521. Result res = new Result();
  522. return res.data(orderProjectService.memberList(in));
  523. }
  524. /**
  525. * 会员项目列表
  526. * @return
  527. */
  528. @RequestMapping(value = "/memberLog" ,method = RequestMethod.GET)
  529. public Result memberLog(Integer id){
  530. Result res = new Result();
  531. return res.data(orderProjectService.memberLog(id));
  532. }
  533. /**
  534. * 会员项目列表
  535. * @param in
  536. * @return
  537. */
  538. @RequestMapping(value = "/memberList/export" ,method = RequestMethod.GET)
  539. public Result memberListExport(InputMemberList in){
  540. return orderProjectService.memberListExport(in);
  541. }
  542. /** 文件上传 **/
  543. @RequestMapping(value = "/uploadMemberFile", method = RequestMethod.POST)
  544. public Result uploadOrderInvoiceFile(HttpServletRequest req,String sign){
  545. Result res = new Result();
  546. res.setData(handleFile(res, "/member_project/", false, req, sign));
  547. return res;
  548. }
  549. /**
  550. * 新增会员子项目(发起新增、无需审核)
  551. *
  552. * @return
  553. */
  554. @RequestMapping(value = "/addMemberFirstSonProject" ,method = RequestMethod.POST)
  555. public Result addMemberFirstSonProject(Integer tid,String serviceYear,String taskComment){
  556. Result res = new Result();
  557. if(tid==null||StringUtils.isBlank(serviceYear)){
  558. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","参数"));
  559. return res;
  560. }
  561. if (orderProjectService.checkOrderProcessStatus(tid,0)){
  562. res.getError().add(buildError("项目已发起,不允许使用首次新增会员子项目。"));
  563. return res;
  564. }
  565. return res.data(orderProjectService.addMemberSonProject( tid, serviceYear, taskComment,null,null));
  566. }
  567. /**
  568. * 新增会员子项目(审核)
  569. *
  570. * @return
  571. */
  572. @RequestMapping(value = "/addMemberSonProject" ,method = RequestMethod.POST)
  573. public Result addMemberSonProject(Integer tid,String serviceYear,String taskComment,Integer memberType,String pictureUrl){
  574. Result res = new Result();
  575. if(tid==null||StringUtils.isBlank(serviceYear)){
  576. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","参数"));
  577. return res;
  578. }
  579. return res.data(orderProjectService.addMemberSonProject( tid, serviceYear, taskComment,memberType, pictureUrl));
  580. }
  581. /**
  582. * 删除会员子项目
  583. *
  584. * @return
  585. */
  586. @RequestMapping(value = "/deleteMemberSonProject" ,method = RequestMethod.POST)
  587. public Result deleteMemberSonProject(Integer id){
  588. Result res = new Result();
  589. if(id==null){
  590. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单编号"));
  591. return res;
  592. }
  593. return res.data(orderProjectService.deleteMemberSonProject( id));
  594. }
  595. /**
  596. * 项目暂停
  597. *
  598. */
  599. @RequestMapping(value = "/addProjectStop" ,method = RequestMethod.POST)
  600. public Result addProjectStop(@Validated InputProjectStop in,BindingResult bindingResult){
  601. Result res = new Result();
  602. if (bindingResult.hasErrors()) {
  603. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  604. ParamUtils.getParamName(in,bindingResult.getFieldError().getField())));
  605. return res;
  606. }
  607. if (in.getIds()==null){
  608. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"编号","编号"));
  609. return res;
  610. }
  611. return res.data(orderProjectService.addProjectStop( in));
  612. }
  613. /**
  614. * 项目暂停
  615. *
  616. */
  617. @RequestMapping(value = "/updateProjectStop" ,method = RequestMethod.POST)
  618. public Result updateProjectStop(@Validated InputProjectStop in,BindingResult bindingResult){
  619. Result res = new Result();
  620. if (bindingResult.hasErrors()) {
  621. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  622. ParamUtils.getParamName(in,bindingResult.getFieldError().getField())));
  623. return res;
  624. }
  625. if (in.getStopId()==null){
  626. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"暂停编号","暂停编号"));
  627. return res;
  628. }
  629. return res.data(orderProjectService.updateProjectStop(in));
  630. }
  631. /**
  632. * 项目暂停审核
  633. *
  634. */
  635. @RequestMapping(value = "/examineProjectStop" ,method = RequestMethod.POST)
  636. public Result examineProjectStop(@Validated InputTaskStopLog in,BindingResult bindingResult){
  637. Result res = new Result();
  638. if (bindingResult.hasErrors()) {
  639. res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
  640. ParamUtils.getParamName(in,bindingResult.getFieldError().getField())));
  641. return res;
  642. }
  643. return res.data(orderProjectService.pushExamineProjectStop( in));
  644. }
  645. /**
  646. * 项目暂停日志列表
  647. *
  648. */
  649. @RequestMapping(value = "/projectStopList" ,method = RequestMethod.GET)
  650. public Result projectStopList(Integer taskStopId){
  651. Result res = new Result();
  652. if (taskStopId==null){
  653. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"项目暂停编号","项目暂停编号"));
  654. return res;
  655. }
  656. return res.data(orderProjectService.projectStopList( taskStopId));
  657. }
  658. /**
  659. * 项目暂停列表
  660. * @param shiroType 0=我的列表 1=审核列表
  661. */
  662. @RequestMapping(value = "/selectProjectStop" ,method = RequestMethod.GET)
  663. public Result selectProjectStop(String orderNo,String userName,String depId,String contractNo, String projectName,Integer status,
  664. String startTime, String endTime, String receiverId,
  665. Integer shiroType,Integer pageNo,Integer pageSize){
  666. Result res = new Result();
  667. return res.data(orderProjectService.selectProjectStop( orderNo, userName, depId, contractNo,
  668. projectName, status,startTime,endTime,receiverId, shiroType,pageNo, pageSize));
  669. }
  670. /**
  671. * 项目暂停列表
  672. *
  673. */
  674. @RequestMapping(value = "/selectProjectStop/export" ,method = RequestMethod.GET)
  675. public Result selectProjectSotpExport(String orderNo,String userName,String depId,String contractNo, String projectName,Integer status,
  676. String startTime, String endTime, String receiverId,Integer shiroType, Integer pageNo,Integer pageSize){
  677. NewExcelUtil newExcelUtil=new NewExcelUtil(OutselectProjectSotpBo.class);
  678. Pagination<?> p = orderProjectService.selectProjectStop(orderNo, userName, depId, contractNo,
  679. projectName, status, startTime, endTime, receiverId, shiroType, pageNo, pageSize);
  680. List<OutselectProjectSotp> list = (List<OutselectProjectSotp>) p.getList();
  681. List<OutselectProjectSotpBo> list2=new ArrayList<>();
  682. for (OutselectProjectSotp use : list) {
  683. OutselectProjectSotpBo o = new OutselectProjectSotpBo();
  684. BeanUtils.copyProperties(use,o);
  685. StringBuffer str =new StringBuffer();
  686. if (o.getStopStatus()==0){
  687. str=str.append("已发起");
  688. }else if (o.getStopStatus()==1){
  689. str=str.append("已完成");
  690. }else if (o.getStopStatus()==2){
  691. str=str.append("已拒绝");
  692. }
  693. if (o.getStopType()==0){
  694. str=str.append("暂停");
  695. }else if (o.getStopStatus()==1){
  696. str=str.append("重启");
  697. }
  698. o.setStatusName(str.toString());
  699. list2.add(o);
  700. }
  701. return newExcelUtil.exportExcel(list2,"暂停项目列表",uploadPath);
  702. }
  703. /** 文件上传 **/
  704. @RequestMapping(value = "/uploadStopFile", method = RequestMethod.POST)
  705. public Result uploadStopFile(HttpServletRequest req,String sign){
  706. Result res = new Result();
  707. res.setData(handleFile(res, "/projectStopFile/", false, req, sign));
  708. return res;
  709. }
  710. /** 文件上传 **/
  711. @RequestMapping(value = "/upload/satisfactionDegree", method = RequestMethod.POST)
  712. public Result uploadsatisfactionDegree(HttpServletRequest req,String sign,Integer id){
  713. Result res = new Result();
  714. String path="/satisfactionDegree/"+id+"/";
  715. res.setData(handleFile(res, path, false, req, sign));
  716. return res;
  717. }
  718. @RequestMapping(value="/updateSatisfactionDegree",method = RequestMethod.POST)
  719. public Result updateSatisfactionDegree(Integer id,Integer formRetrieve,Integer satisfactionDegree,String satisfactionDegreeUrl){
  720. Result res=new Result();
  721. if (id ==null){
  722. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"项目编号"));
  723. return res;
  724. }
  725. if (formRetrieve ==null){
  726. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"满意度回收状态"));
  727. return res;
  728. }
  729. if (formRetrieve==2){
  730. if (satisfactionDegree ==null){
  731. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"满意度"));
  732. return res;
  733. }
  734. if (StringUtils.isBlank(satisfactionDegreeUrl)){
  735. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"满意度附件"));
  736. return res;
  737. }
  738. }
  739. if (formRetrieve==4){
  740. if (StringUtils.isBlank(satisfactionDegreeUrl)){
  741. res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"满意度附件"));
  742. return res;
  743. }
  744. }
  745. res.setData(orderProjectService.updateSatisfactionDegree( id, formRetrieve, satisfactionDegree, satisfactionDegreeUrl));
  746. return res;
  747. }
  748. }