| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823 |
- package com.goafanti.order.controller;
- import com.goafanti.common.bo.Result;
- import com.goafanti.common.constant.AFTConstants;
- import com.goafanti.common.constant.ErrorConstants;
- import com.goafanti.common.controller.CertifyApiController;
- import com.goafanti.common.enums.OfficialPatentType;
- import com.goafanti.common.model.TTaskHours;
- import com.goafanti.common.utils.ParamUtils;
- import com.goafanti.common.utils.StringUtils;
- import com.goafanti.common.utils.excel.NewExcelUtil;
- import com.goafanti.core.mybatis.page.Pagination;
- import com.goafanti.core.shiro.token.TokenManager;
- import com.goafanti.order.bo.*;
- import com.goafanti.order.service.OrderNewService;
- import com.goafanti.order.service.OrderProjectService;
- import org.springframework.beans.BeanUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.beans.factory.annotation.Value;
- import org.springframework.validation.BindingResult;
- import org.springframework.validation.annotation.Validated;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RestController;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import javax.validation.Valid;
- import java.io.IOException;
- import java.text.ParseException;
- import java.text.SimpleDateFormat;
- import java.util.ArrayList;
- import java.util.List;
- @RestController
- @RequestMapping(value = "/api/admin/orderProject")
- public class OrderProjectApiController extends CertifyApiController {
- @Autowired
- private OrderProjectService orderProjectService;
- @Autowired
- private OrderNewService orderNewService;
- @Value(value = "${upload.path}")
- private String uploadPath = null;
- /**
- * 项目分配、项目派单、项目转交
- * taskId 项目ID
- * taskReceiverId 受理人ID
- * type 0管理员派单 1经理转交 2经理派单 3咨询师转交 4回退
- */
- @RequestMapping(value = "/projectDistribution", method = RequestMethod.POST)
- public Result projectDistribution(Integer taskId,String taskReceiverId ,String remarks,Integer type){
- Result res = new Result();
- if(null==taskId || StringUtils.isBlank(taskReceiverId)){
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "任务编号和受理人"));
- return res;
- }
- if(type==null) type=0;
- boolean flag=true;
- if (type==0&&(TokenManager.hasRole(AFTConstants.TECH_ADMIN)||TokenManager.hasRole(AFTConstants.SUPERADMIN)))flag=false;
- else if ((type==1||type==2)&&TokenManager.hasRole(AFTConstants.TECH_MANAGER))flag=false;
- else if ((type==3||type==4)&&TokenManager.hasRole(AFTConstants.TECH))flag=false;
- if (flag) {
- res.getError().add(buildError("角色不正确,请勿在浏览器登录多个账号!"));
- return res;
- }
- res.setData(orderProjectService.updateProjectDistribution( taskId, taskReceiverId,remarks,type));
- return res;
- }
- /**
- * 任务派单列表 我的任务,我的外包任务
- * specially 0我的任务 1任务派单
- * 我的任务不看父项目,只看子项目 ,任务派单子项目父项目都会存在
- */
- @RequestMapping(value="/orderTaskList" ,method = RequestMethod.GET)
- public Result orderTaskList(inuptTaskListBo ib){
- Result res=new Result();
- res.setData(orderProjectService.orderTaskList(ib));
- return res;
- }
- /**
- * 任务派单查询
- */
- @RequestMapping(value="/selectTaskList" ,method = RequestMethod.GET)
- public Result selectTaskList(String name,String orderNo,String taskId,Integer taskStatus,String adminName,Integer specially ,String depId,String thchId
- ,Integer pageNo,Integer pageSize){
- Result res=new Result();
- res.setData(orderProjectService.selectTaskList( name, orderNo, taskId, taskStatus, adminName,specially , depId,thchId ,pageNo, pageSize));
- return res;
- }
- /**
- * 经理查询订单
- */
- @RequestMapping(value="/managerSelect" ,method = RequestMethod.GET)
- public Result managerSelect(String name,String orderNo,String contractNo,String cid,String projectType,String thchId,
- String depId,String techDepId ,Integer declarationBatch ,String commodityPrice,String startTime,
- String endTime,String type,Integer pageNo,Integer pageSize){
- Result res=new Result();
- res.setData(orderProjectService.managerSelect( name, orderNo, contractNo, cid, projectType,thchId,
- depId, techDepId , declarationBatch ,commodityPrice,startTime, endTime,type , pageNo, pageSize));
- return res;
- }
- /**
- * 经理查询订单
- */
- @RequestMapping(value="/exportManagerSelect" ,method = RequestMethod.GET)
- public Result exportManagerSelect(String name,String orderNo,String contractNo,String cid,String projectType,String thchId,
- String depId,String techDepId ,Integer declarationBatch ,String commodityPrice,String startTime,
- String endTime,String type,Integer pageNo,Integer pageSize){
- @SuppressWarnings("unchecked")
- List<managerListBo> list=(List<managerListBo>) orderProjectService.managerSelect( name, orderNo, contractNo,
- cid, projectType,thchId,depId, techDepId , declarationBatch ,commodityPrice,startTime, endTime ,type, pageNo, pageSize).getList();
- NewExcelUtil<managerListBo> excel=new NewExcelUtil<>(managerListBo.class);
- return excel.exportExcel(list, "企业项目查询列表", uploadPath);
- }
- /**
- * 任务详情
- */
- @RequestMapping(value="/orderTaskDetail" ,method = RequestMethod.GET)
- public Result orderTaskDetail(Integer id){
- Result res=new Result();
- res.setData(orderProjectService.orderTaskDetail(id));
- return res;
- }
- /**
- * 任务修改(咨询师)
- */
- @RequestMapping(value="/updateOrderTask" ,method = RequestMethod.POST)
- public Result updateOrderTask(TOrderTaskDetailBo t){
- Result res=new Result();
- if (!StringUtils.isContainChinese(t.getContacts())){
- res.getError().add(buildError("联系人名称必须是中文。"));
- return res;
- }
- if (!StringUtils.isContactMobile(t.getContactMobile())){
- res.getError().add(buildError(ErrorConstants.MOBILE_PATTERN_ERROR));
- return res;
- }
- res.setData(orderProjectService.updateOrderTask(t));
- return res;
- }
- /**
- * 修改项目状态(咨询师)、项目状态修改
- */
- @RequestMapping(value="/updateProjectStatus" ,method = RequestMethod.POST)
- public Result updateProjectStatus(@Valid UpdateProjectStatusBo a,BindingResult bindingResult){
- Result res=new Result();
- if (bindingResult.hasErrors()) {
- res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage()));
- return res;
- }
- res.setData(orderProjectService.updateProjectStatus( a));
- return res;
- }
- /**
- * 添加工时
- */
- @RequestMapping(value="/addTaskHours" ,method = RequestMethod.POST)
- public Result addTaskHours(TTaskHours t,String taskDate){
- Result res=new Result();
- if (t.getHours()==null) {
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "任务时间"));
- return res;
- }
- if (StringUtils.isBlank(taskDate)) {
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "工作日期"));
- return res;
- }
- if (StringUtils.isBlank(t.getRemarks())) {
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "工作内容"));
- return res;
- }
- if (StringUtils.isNotBlank(taskDate)) {
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
- try {
- t.setTaskDay(sdf.parse(taskDate));
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
- res.setData(orderProjectService.addTaskHours(t));
- return res;
- }
- /**
- * 任务工时列表
- */
- @RequestMapping(value="/taskHoursList" ,method = RequestMethod.GET)
- public Result taskHoursList(inuptTaskHoursListBo ib,
- Integer pageNo, Integer pageSize){
- Result res=new Result();
- res.setData(orderProjectService.taskHoursList(ib,pageNo, pageSize));
- return res;
- }
- /**
- * 任务工时详情列表
- */
- @RequestMapping(value="/taskHoursDetailsList" ,method = RequestMethod.GET)
- public Result taskHoursDetailsList( String taskId ){
- Result res=new Result();
- if (StringUtils.isBlank(taskId)) {
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "项目编号"));
- return res;
- }
- res.setData(orderProjectService.taskHoursDetailsList(taskId));
- return res;
- }
- /**
- * 任务操作日志
- */
- @RequestMapping(value="/TaskLogList" ,method = RequestMethod.GET)
- public Result TaskLogList(Integer id){
- Result res=new Result();
- res.setData(orderProjectService.TaskLogList(id));
- return res;
- }
- /**
- * 任务派单日志
- */
- @RequestMapping(value="/dispatchTaskLog" ,method = RequestMethod.GET)
- public Result dispatchTaskLog(Integer id){
- Result res=new Result();
- res.setData(orderProjectService.dispatchTaskLog(id));
- return res;
- }
- /** 任务文件上传 **/
- @RequestMapping(value = "/uploadOrderTaskFile", method = RequestMethod.POST)
- public Result uploadOrderTaskFile(HttpServletRequest req,String sign){
- Result res = new Result();
- res.setData(handleFile(res, "/order_task_file/", false, req, sign));
- return res;
- }
- /**
- * 新增项目申报进度
- */
- @RequestMapping(value="/createTaskProgress" ,method = RequestMethod.POST)
- public Result createTaskProgress(TaskProgressBo t){
- Result res=new Result();
- if ( null==t.getTaskId()|| null==t.getAlreadyNumber()) {
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
- }
- res.setData(orderProjectService.createTaskProgress(t));
- return res;
- }
- /**
- * 修改项目申报进度
- */
- @RequestMapping(value="/updateTaskProgress" ,method = RequestMethod.POST)
- public Result updateTaskProgress(TaskProgressBo t){
- Result res=new Result();
- if (null==t.getTaskId()|| null==t.getAlreadyNumber()) {
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
- }
- res.setData(orderProjectService.updateTaskProgress(t));
- return res;
- }
- /**
- * 删除项目申报进度
- */
- @RequestMapping(value="/delectTaskProgress" ,method = RequestMethod.POST)
- public Result delectTaskProgress(Integer id){
- Result res=new Result();
- if (null==id) {
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
- }
- res.setData(orderProjectService.delectTaskProgress(id));
- return res;
- }
- /**
- * 查看项目申报进度
- */
- @RequestMapping(value="/selectTaskProgress" ,method = RequestMethod.GET)
- public Result selectTaskProgress(Integer tid){
- Result res=new Result();
- if (null==tid) {
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
- }
- res.setData(orderProjectService.selectTaskProgress(tid));
- return res;
- }
- /**
- * 项目申报进度日志
- */
- @RequestMapping(value="/selectTaskProgressLog" ,method = RequestMethod.GET)
- public Result selectTaskProgressLog(Integer tid){
- Result res=new Result();
- if (null==tid) {
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
- }
- res.setData(orderProjectService.selectTaskProgressLog(tid));
- return res;
- }
- /**
- * 拆分项目
- */
- @RequestMapping(value="/addSplitProject" ,method = RequestMethod.POST)
- public Result addSplitProject(Integer tid,String splitList){
- Result res=new Result();
- if (null==tid||StringUtils.isBlank(splitList)) {
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"项目和拆分数","项目和拆分数"));
- return res;
- }
- int i=orderProjectService.pushSplitProject(tid,splitList);
- if (i==-1) {
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"拆分数","拆分数"));
- return res;
- }
- res.setData(i);
- return res;
- }
- /**
- * 拆分项目列表
- */
- @RequestMapping(value="/splitProjectList" ,method = RequestMethod.GET)
- public Result splitProjectList(Integer tid){
- Result res=new Result();
- if (null==tid) {
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"项目和拆分数","项目和拆分数"));
- return res;
- }
- res.setData(orderProjectService.splitProjectList(tid,1));
- return res;
- }
- /**
- * 我的工时列表导出xls
- * @throws IOException
- */
- @RequestMapping(value = "/exportMyTaskList", method = RequestMethod.GET)
- public Result exportMyTaskList(inuptTaskHoursListBo ib, Integer pageNo, Integer pageSize) {
- if(pageSize==null)pageSize=999999;
- @SuppressWarnings("unchecked")
- List<TOrderTaskListBo> list=(List<TOrderTaskListBo>) orderProjectService.taskHoursList(ib, pageNo, pageSize).getList();
- NewExcelUtil<TOrderTaskListBo> excel=new NewExcelUtil<>(TOrderTaskListBo.class);
- return excel.exportExcel(list, "工时信息记录表",uploadPath);
- }
- /**
- * 我的任务列表导出xls
- * @throws IOException
- */
- @RequestMapping(value = "/exporProjectList", method = RequestMethod.GET)
- public Result exporProjectList(HttpServletResponse response,inuptTaskListBo ib) {
- if(ib.getPageSize()==null)ib.setPageSize(99999);
- String str="项目任务列表";
- @SuppressWarnings("unchecked")
- List<TOrderTaskListBo> list=(List<TOrderTaskListBo>) orderProjectService.orderTaskList(ib).getList();
- NewExcelUtil<TOrderTaskListBo>excel=new NewExcelUtil<>(TOrderTaskListBo.class);
- return excel.exportExcel(list, str, response);
- }
- /**
- * 项目日志 (转交日志)
- * @param tid
- * @return
- */
- @RequestMapping(value = "/taskAttributionLog",method = RequestMethod.GET)
- public Result taskAttributionLog(Integer tid) {
- Result res =new Result();
- if (tid==null) {
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"项目编号","项目编号"));
- return res;
- }
- res.data(orderProjectService.taskAttributionLog(tid));
- return res;
- }
- /**
- * 客户项目列表
- * @return
- */
- @RequestMapping(value = "/selectUidByproject",method = RequestMethod.GET)
- public Result selectUidByproject(String uid) {
- Result res =new Result();
- if (uid==null) {
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"客户编号","客户编号"));
- return res;
- }
- res.data( orderProjectService.selectUidByproject(uid) );
- return res;
- }
- /**
- * 发起项目核对
- * @param tid
- * @return
- */
- @RequestMapping(value = "/addProjectCheck",method = RequestMethod.POST)
- public Result addProjectCheck(Integer tid) {
- Result res =new Result();
- if (tid==null) {
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"项目编号","项目编号"));
- return res;
- }
- res.data( orderProjectService.addProjectCheck(tid) );
- return res;
- }
- /**
- * 核对日志
- * @param tid
- * @return
- */
- @RequestMapping(value = "/projectCheckLog",method = RequestMethod.GET)
- public Result projectCheckLog(Integer tid) {
- Result res =new Result();
- if (tid==null) {
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"项目编号","项目编号"));
- return res;
- }
- res.data( orderProjectService.projectCheckLog(tid) );
- return res;
- }
- /**
- * 获取专利分类
- * @return
- */
- @RequestMapping(value = "/getPatentType",method = RequestMethod.GET)
- public Result getPatentType() {
- Result res =new Result();
- res.data(OfficialPatentType.getStatus());
- return res;
- }
- /**
- * 核对列表
- * @return
- */
- @RequestMapping(value = "/selectProjectCheck",method = RequestMethod.GET)
- public Result selectProjectCheck(InputProjectCheck in) {
- Result res =new Result();
- res.data(orderProjectService.selectProjectCheck(in));
- return res;
- }
- /**
- * 高新复审统计
- */
- @RequestMapping(value = "/highNewRetrialStatistics",method = RequestMethod.GET)
- public Result highNewRetrialStatistics(String depId,String startDate,String endDate) {
- Result res =new Result();
- res.data(orderProjectService.highNewRetrialStatistics(depId,startDate,endDate));
- return res;
- }
- /**
- * 高新复审统计
- */
- @RequestMapping(value = "/highNewRetrialStatistics/export",method = RequestMethod.GET)
- public Result highNewRetrialStatisticsExport(String depId,String startDate,String endDate,String depName) {
- List<OutHighNewRetrialStatistics> list=orderProjectService.highNewRetrialStatistics(depId,startDate,endDate);
- NewExcelUtil<OutHighNewRetrialStatistics> newExcelUtil=new NewExcelUtil<>(OutHighNewRetrialStatistics.class);
- StringBuffer str=new StringBuffer("搜索条件=》");
- if (depName!=null)str=str.append("部门:").append(depName).append(",");
- if (startDate!=null&&endDate!=null)str=str.append("时间:").append(startDate).append("~").append(endDate).append(",");
- return newExcelUtil.exportExcel(list,"高新复审统计",uploadPath,str.substring(0,str.toString().length()-1));
- }
- /**
- * 高新复审详情列表
- */
- @RequestMapping(value = "/highNewRetrialList",method = RequestMethod.GET)
- public Result highNewRetrialList(String province,String depId,String startDate,String endDate,String aid,Integer sort) {
- Result res =new Result();
- res.data(orderProjectService.highNewRetrialList(province,depId,aid,sort,startDate,endDate));
- return res;
- }
- @RequestMapping(value = "/highNewRetrialList/export",method = RequestMethod.GET)
- public Result highNewRetrialListExport(String province,String provinceName,String depId,String depName,String startDate,String endDate,String aid,
- String aName,Integer sort) {
- List<OutHighNewRetrialList> list=orderProjectService.highNewRetrialList(province,depId,aid,sort,startDate,endDate);
- NewExcelUtil<OutHighNewRetrialList> newExcelUtil=new NewExcelUtil<>(OutHighNewRetrialList.class);
- StringBuffer str=new StringBuffer("搜索条件=》");
- if (provinceName!=null)str=str.append("省份:").append(provinceName).append(",");
- if (depName!=null)str=str.append("部门:").append(depName).append(",");
- if (aName!=null)str=str.append("跟进人:").append(aName).append(",");
- if (startDate!=null&&endDate!=null)str=str.append("时间:").append(startDate).append("~").append(endDate).append(",");
- if(sort!=null){
- str=str.append("排序:");
- if(sort==0)str=str.append("按签通过高新排序");
- else if(sort==1)str=str.append("按未通过高新排序");
- }
- return newExcelUtil.exportExcel(list,"高新复审详情",uploadPath,str.substring(0,str.toString().length()-1));
- }
- /**
- * 新增会员项目
- * @param t
- * @return
- */
- @RequestMapping(value = "/addMemberProject" ,method = RequestMethod.POST)
- public Result addMemberProject(InputAddTask t){
- Result res = new Result();
- if(StringUtils.isBlank(t.getOrderNo())){
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单编号"));
- return res;
- }
- t.setProcessStatus(1);
- t.setMain(0);
- return res.data(orderNewService.addMemberProject(t));
- }
- /**
- * 会员项目审核
- * @param in
- * @return
- */
- @RequestMapping(value = "/examineMemberProject" ,method = RequestMethod.POST)
- public Result examineMemberProject(InputMenber in){
- Result res = new Result();
- if(in.getId()==null){
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"项目编号"));
- return res;
- }
- return res.data(orderProjectService.pushExamineMemberProject(in));
- }
- /**
- * 会员项目修改
- * @param t
- * @return
- */
- @RequestMapping(value = "/updateMemberProject" ,method = RequestMethod.POST)
- public Result updateMemberProject(InputAddTask t){
- Result res = new Result();
- if(t.getId()==null){
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"项目编号"));
- return res;
- }
- return res.data(orderProjectService.updateMemberProject(t));
- }
- /**
- * 会员项目列表
- * @param in
- * @return
- */
- @RequestMapping(value = "/memberList" ,method = RequestMethod.GET)
- public Result memberList(InputMemberList in){
- Result res = new Result();
- return res.data(orderProjectService.memberList(in));
- }
- /**
- * 会员项目列表
- * @return
- */
- @RequestMapping(value = "/memberLog" ,method = RequestMethod.GET)
- public Result memberLog(Integer id){
- Result res = new Result();
- return res.data(orderProjectService.memberLog(id));
- }
- /**
- * 会员项目列表
- * @param in
- * @return
- */
- @RequestMapping(value = "/memberList/export" ,method = RequestMethod.GET)
- public Result memberListExport(InputMemberList in){
- return orderProjectService.memberListExport(in);
- }
- /** 文件上传 **/
- @RequestMapping(value = "/uploadMemberFile", method = RequestMethod.POST)
- public Result uploadOrderInvoiceFile(HttpServletRequest req,String sign){
- Result res = new Result();
- res.setData(handleFile(res, "/member_project/", false, req, sign));
- return res;
- }
- /**
- * 新增会员子项目(发起新增、无需审核)
- *
- * @return
- */
- @RequestMapping(value = "/addMemberFirstSonProject" ,method = RequestMethod.POST)
- public Result addMemberFirstSonProject(Integer tid,String serviceYear,String taskComment){
- Result res = new Result();
- if(tid==null||StringUtils.isBlank(serviceYear)){
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","参数"));
- return res;
- }
- if (orderProjectService.checkOrderProcessStatus(tid,0)){
- res.getError().add(buildError("项目已发起,不允许使用首次新增会员子项目。"));
- return res;
- }
- return res.data(orderProjectService.addMemberSonProject( tid, serviceYear, taskComment,null,null));
- }
- /**
- * 新增会员子项目(审核)
- *
- * @return
- */
- @RequestMapping(value = "/addMemberSonProject" ,method = RequestMethod.POST)
- public Result addMemberSonProject(Integer tid,String serviceYear,String taskComment,Integer memberType,String pictureUrl){
- Result res = new Result();
- if(tid==null||StringUtils.isBlank(serviceYear)){
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","参数"));
- return res;
- }
- return res.data(orderProjectService.addMemberSonProject( tid, serviceYear, taskComment,memberType, pictureUrl));
- }
- /**
- * 删除会员子项目
- *
- * @return
- */
- @RequestMapping(value = "/deleteMemberSonProject" ,method = RequestMethod.POST)
- public Result deleteMemberSonProject(Integer id){
- Result res = new Result();
- if(id==null){
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单编号"));
- return res;
- }
- return res.data(orderProjectService.deleteMemberSonProject( id));
- }
- /**
- * 项目暂停
- *
- */
- @RequestMapping(value = "/addProjectStop" ,method = RequestMethod.POST)
- public Result addProjectStop(@Validated InputProjectStop in,BindingResult bindingResult){
- Result res = new Result();
- if (bindingResult.hasErrors()) {
- res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
- ParamUtils.getParamName(in,bindingResult.getFieldError().getField())));
- return res;
- }
- if (in.getIds()==null){
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"编号","编号"));
- return res;
- }
- return res.data(orderProjectService.addProjectStop( in));
- }
- /**
- * 项目暂停
- *
- */
- @RequestMapping(value = "/updateProjectStop" ,method = RequestMethod.POST)
- public Result updateProjectStop(@Validated InputProjectStop in,BindingResult bindingResult){
- Result res = new Result();
- if (bindingResult.hasErrors()) {
- res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
- ParamUtils.getParamName(in,bindingResult.getFieldError().getField())));
- return res;
- }
- if (in.getStopId()==null){
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"暂停编号","暂停编号"));
- return res;
- }
- return res.data(orderProjectService.updateProjectStop(in));
- }
- /**
- * 项目暂停审核
- *
- */
- @RequestMapping(value = "/examineProjectStop" ,method = RequestMethod.POST)
- public Result examineProjectStop(@Validated InputTaskStopLog in,BindingResult bindingResult){
- Result res = new Result();
- if (bindingResult.hasErrors()) {
- res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
- ParamUtils.getParamName(in,bindingResult.getFieldError().getField())));
- return res;
- }
- return res.data(orderProjectService.pushExamineProjectStop( in));
- }
- /**
- * 项目暂停日志列表
- *
- */
- @RequestMapping(value = "/projectStopList" ,method = RequestMethod.GET)
- public Result projectStopList(Integer taskStopId){
- Result res = new Result();
- if (taskStopId==null){
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"项目暂停编号","项目暂停编号"));
- return res;
- }
- return res.data(orderProjectService.projectStopList( taskStopId));
- }
- /**
- * 项目暂停列表
- * @param shiroType 0=我的列表 1=审核列表
- */
- @RequestMapping(value = "/selectProjectStop" ,method = RequestMethod.GET)
- public Result selectProjectStop(String orderNo,String userName,String depId,String contractNo, String projectName,Integer status,
- String startTime, String endTime, String receiverId,
- Integer shiroType,Integer pageNo,Integer pageSize){
- Result res = new Result();
- return res.data(orderProjectService.selectProjectStop( orderNo, userName, depId, contractNo,
- projectName, status,startTime,endTime,receiverId, shiroType,pageNo, pageSize));
- }
- /**
- * 项目暂停列表
- *
- */
- @RequestMapping(value = "/selectProjectStop/export" ,method = RequestMethod.GET)
- public Result selectProjectSotpExport(String orderNo,String userName,String depId,String contractNo, String projectName,Integer status,
- String startTime, String endTime, String receiverId,Integer shiroType, Integer pageNo,Integer pageSize){
- NewExcelUtil newExcelUtil=new NewExcelUtil(OutselectProjectSotpBo.class);
- Pagination<?> p = orderProjectService.selectProjectStop(orderNo, userName, depId, contractNo,
- projectName, status, startTime, endTime, receiverId, shiroType, pageNo, pageSize);
- List<OutselectProjectSotp> list = (List<OutselectProjectSotp>) p.getList();
- List<OutselectProjectSotpBo> list2=new ArrayList<>();
- for (OutselectProjectSotp use : list) {
- OutselectProjectSotpBo o = new OutselectProjectSotpBo();
- BeanUtils.copyProperties(use,o);
- StringBuffer str =new StringBuffer();
- if (o.getStopStatus()==0){
- str=str.append("已发起");
- }else if (o.getStopStatus()==1){
- str=str.append("已完成");
- }else if (o.getStopStatus()==2){
- str=str.append("已拒绝");
- }
- if (o.getStopType()==0){
- str=str.append("暂停");
- }else if (o.getStopStatus()==1){
- str=str.append("重启");
- }
- o.setStatusName(str.toString());
- list2.add(o);
- }
- return newExcelUtil.exportExcel(list2,"暂停项目列表",uploadPath);
- }
- /** 文件上传 **/
- @RequestMapping(value = "/uploadStopFile", method = RequestMethod.POST)
- public Result uploadStopFile(HttpServletRequest req,String sign){
- Result res = new Result();
- res.setData(handleFile(res, "/projectStopFile/", false, req, sign));
- return res;
- }
- /** 文件上传 **/
- @RequestMapping(value = "/upload/satisfactionDegree", method = RequestMethod.POST)
- public Result uploadsatisfactionDegree(HttpServletRequest req,String sign,Integer id){
- Result res = new Result();
- String path="/satisfactionDegree/"+id+"/";
- res.setData(handleFile(res, path, false, req, sign));
- return res;
- }
- @RequestMapping(value="/updateSatisfactionDegree",method = RequestMethod.POST)
- public Result updateSatisfactionDegree(Integer id,Integer formRetrieve,Integer satisfactionDegree,String satisfactionDegreeUrl){
- Result res=new Result();
- if (id ==null){
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"项目编号"));
- return res;
- }
- if (formRetrieve ==null){
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"满意度回收状态"));
- return res;
- }
- if (formRetrieve==2){
- if (satisfactionDegree ==null){
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"满意度"));
- return res;
- }
- if (StringUtils.isBlank(satisfactionDegreeUrl)){
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"满意度附件"));
- return res;
- }
- }
- if (formRetrieve==4){
- if (StringUtils.isBlank(satisfactionDegreeUrl)){
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"满意度附件"));
- return res;
- }
- }
- res.setData(orderProjectService.updateSatisfactionDegree( id, formRetrieve, satisfactionDegree, satisfactionDegreeUrl));
- return res;
- }
- }
|