|
|
@@ -1,218 +1,218 @@
|
|
|
-package com.goafanti.order.controller;
|
|
|
-
|
|
|
-
|
|
|
-import java.io.IOException;
|
|
|
-import java.text.ParseException;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
-import com.goafanti.common.bo.Result;
|
|
|
-import com.goafanti.common.constant.ErrorConstants;
|
|
|
-import com.goafanti.common.controller.CertifyApiController;
|
|
|
-import com.goafanti.common.model.TTaskHours;
|
|
|
-import com.goafanti.common.utils.StringUtils;
|
|
|
-import com.goafanti.order.bo.TOrderTaskDetailBo;
|
|
|
-import com.goafanti.order.bo.TaskProgressBo;
|
|
|
-import com.goafanti.order.bo.inuptTaskHoursListBo;
|
|
|
-import com.goafanti.order.service.OrderProjectService;
|
|
|
-
|
|
|
-@RestController
|
|
|
-@RequestMapping(value = "/api/admin/orderProject")
|
|
|
-public class OrderProjectApiController extends CertifyApiController {
|
|
|
-
|
|
|
- @Autowired
|
|
|
-
|
|
|
- private OrderProjectService orderProjectService;
|
|
|
-
|
|
|
- /**
|
|
|
- * 项目分配
|
|
|
- * taskId 项目ID
|
|
|
- * taskReceiverId 受理人ID
|
|
|
- * specially 0 任务派单(咨询师经理派单) 1项目派单(咨询师管理员派单)2咨询师退回给经理
|
|
|
- */
|
|
|
- @RequestMapping(value = "/projectDistribution", method = RequestMethod.POST)
|
|
|
- public Result projectDistribution(Integer taskId,String taskReceiverId,Integer specially ,String remarks){
|
|
|
- Result res = new Result();
|
|
|
- if(null==taskId || StringUtils.isBlank(taskReceiverId)){
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "任务编号和受理人"));
|
|
|
- return res;
|
|
|
- }
|
|
|
- res.setData(orderProjectService.updateProjectDistribution( taskId, taskReceiverId,specially,remarks));
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 任务派单列表
|
|
|
- */
|
|
|
- @RequestMapping(value="/orderTaskList" ,method = RequestMethod.GET)
|
|
|
- public Result orderTaskList(String name,String orderNo,String taskId,Integer taskStatus,String adminName,Integer specially,String depId ,
|
|
|
- String contractNo,Integer projectStatus ,Integer approval,Integer pageNo,Integer pageSize,Integer outsource){
|
|
|
- Result res=new Result();
|
|
|
- res.setData(orderProjectService.orderTaskList( name, orderNo, taskId, taskStatus, adminName,specially , depId,contractNo,
|
|
|
- projectStatus,approval,pageNo, pageSize, outsource));
|
|
|
- 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 ,Integer pageNo,Integer pageSize){
|
|
|
- Result res=new Result();
|
|
|
- res.setData(orderProjectService.selectTaskList( name, orderNo, taskId, taskStatus, adminName,specially , depId ,pageNo, pageSize));
|
|
|
- return res;
|
|
|
- }
|
|
|
- /**
|
|
|
- * 任务详情
|
|
|
- */
|
|
|
- @RequestMapping(value="/orderTaskDetail" ,method = RequestMethod.GET)
|
|
|
- public Result orderTaskDetail(String 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();
|
|
|
- res.setData(orderProjectService.updateOrderTask(t));
|
|
|
- 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 = "/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 (StringUtils.isBlank(t.getLicenceTimes())|| null==t.getTaskId()|| null==t.getAlreadyNumber()) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
|
|
|
- }
|
|
|
- res.setData(orderProjectService.createTaskProgress(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;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 我的任务列表导出xls
|
|
|
- * @throws IOException
|
|
|
- */
|
|
|
- @RequestMapping(value = "/exportMyTaskList", method = RequestMethod.GET)
|
|
|
- public Result exportMyTaskList(HttpServletResponse response,inuptTaskHoursListBo ib, Integer pageNo, Integer pageSize) throws IOException{
|
|
|
- Result res=new Result();
|
|
|
- try {
|
|
|
- orderProjectService.exportMyTaskList( response, ib, pageNo, pageSize);
|
|
|
- } catch (Exception e) {
|
|
|
- res.getError().add(buildError("格式不正确"));
|
|
|
- e.printStackTrace();
|
|
|
- return res;
|
|
|
- }
|
|
|
- res.data(1);
|
|
|
- return res;
|
|
|
-
|
|
|
- }
|
|
|
-}
|
|
|
+package com.goafanti.order.controller;
|
|
|
+
|
|
|
+
|
|
|
+import java.io.IOException;
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import com.goafanti.common.bo.Result;
|
|
|
+import com.goafanti.common.constant.ErrorConstants;
|
|
|
+import com.goafanti.common.controller.CertifyApiController;
|
|
|
+import com.goafanti.common.model.TTaskHours;
|
|
|
+import com.goafanti.common.utils.StringUtils;
|
|
|
+import com.goafanti.order.bo.TOrderTaskDetailBo;
|
|
|
+import com.goafanti.order.bo.TaskProgressBo;
|
|
|
+import com.goafanti.order.bo.inuptTaskHoursListBo;
|
|
|
+import com.goafanti.order.service.OrderProjectService;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping(value = "/api/admin/orderProject")
|
|
|
+public class OrderProjectApiController extends CertifyApiController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+
|
|
|
+ private OrderProjectService orderProjectService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 项目分配
|
|
|
+ * taskId 项目ID
|
|
|
+ * taskReceiverId 受理人ID
|
|
|
+ * specially 0 任务派单(咨询师经理派单) 1项目派单(咨询师管理员派单)2咨询师退回给经理
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/projectDistribution", method = RequestMethod.POST)
|
|
|
+ public Result projectDistribution(Integer taskId,String taskReceiverId,Integer specially ,String remarks){
|
|
|
+ Result res = new Result();
|
|
|
+ if(null==taskId || StringUtils.isBlank(taskReceiverId)){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "任务编号和受理人"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ res.setData(orderProjectService.updateProjectDistribution( taskId, taskReceiverId,specially,remarks));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 任务派单列表
|
|
|
+ */
|
|
|
+ @RequestMapping(value="/orderTaskList" ,method = RequestMethod.GET)
|
|
|
+ public Result orderTaskList(String name,String orderNo,String taskId,Integer taskStatus,String adminName,Integer specially,String depId ,
|
|
|
+ String contractNo,Integer projectStatus ,Integer approval,Integer outsource,Integer outsourceStatus,Integer pageNo,Integer pageSize){
|
|
|
+ Result res=new Result();
|
|
|
+ res.setData(orderProjectService.orderTaskList( name, orderNo, taskId, taskStatus, adminName,specially , depId,contractNo,
|
|
|
+ projectStatus,approval, outsource, outsourceStatus,pageNo, pageSize));
|
|
|
+ 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 ,Integer pageNo,Integer pageSize){
|
|
|
+ Result res=new Result();
|
|
|
+ res.setData(orderProjectService.selectTaskList( name, orderNo, taskId, taskStatus, adminName,specially , depId ,pageNo, pageSize));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 任务详情
|
|
|
+ */
|
|
|
+ @RequestMapping(value="/orderTaskDetail" ,method = RequestMethod.GET)
|
|
|
+ public Result orderTaskDetail(String 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();
|
|
|
+ res.setData(orderProjectService.updateOrderTask(t));
|
|
|
+ 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 = "/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 (StringUtils.isBlank(t.getLicenceTimes())|| null==t.getTaskId()|| null==t.getAlreadyNumber()) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"参数","参数"));
|
|
|
+ }
|
|
|
+ res.setData(orderProjectService.createTaskProgress(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;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 我的任务列表导出xls
|
|
|
+ * @throws IOException
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/exportMyTaskList", method = RequestMethod.GET)
|
|
|
+ public Result exportMyTaskList(HttpServletResponse response,inuptTaskHoursListBo ib, Integer pageNo, Integer pageSize) throws IOException{
|
|
|
+ Result res=new Result();
|
|
|
+ try {
|
|
|
+ orderProjectService.exportMyTaskList( response, ib, pageNo, pageSize);
|
|
|
+ } catch (Exception e) {
|
|
|
+ res.getError().add(buildError("格式不正确"));
|
|
|
+ e.printStackTrace();
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ res.data(1);
|
|
|
+ return res;
|
|
|
+
|
|
|
+ }
|
|
|
+}
|