OrderProjectApiController.java 21 KB

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