OrderProjectApiController.java 29 KB

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