OrderProjectApiController.java 28 KB

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