OrderProjectApiController.java 21 KB

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