whycrzg
2021-02-23 351b9a53cb9ecebdf8f79db0117f540d9c42c2a4
src/main/java/com/fgkj/controller/User_taskController.java
@@ -6,36 +6,52 @@
import com.fgkj.services.User_taskService;
import com.google.gson.reflect.TypeToken;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
@RequestMapping("userTask")
@RestController
@Api
@Api(tags = "userTask接口")
public class User_taskController{
   @Resource
   private User_taskService service;
//   ,@RequestBody User_task_param utparam,@RequestBody List<BattInf> addlist, @RequestBody User_inf uinf
   //添加作业
   @PostMapping("/")
   public ServiceModel add(@RequestBody User_task_param utparam,@RequestBody List<BattInf> addlist,
                     @RequestBody User_inf uinf) throws ParseException{
   @ApiOperation(notes = "",value="添加作业TODO")
   public ServiceModel add(@RequestBody Map<String,Object> map) throws ParseException{
      ServiceModel model=new ServiceModel();
      if(uinf!=null){
         utparam.setTp_name(uinf.getuId().toString());
         model=service.add(addlist, utparam);
      try {
         User_task_param utparam = (User_task_param) map.get("utparam");   //TODO 参数未知
         List<BattInf> listbinf = (List<BattInf>) map.get("listbinf");
         User_inf uinf = (User_inf) map.get("uinf");
         if(uinf!=null){
            utparam.setTp_name(uinf.getuId().toString());
            model=service.add(listbinf, utparam);
         }
      } catch (ParseException e) {
         e.printStackTrace();
         model.setMsg("添加失败");
         return model;
      }
      return model;
   }
   //4.1作业管理(修改作业名称,作业使能,作业开始时间,作业提醒次数,作业提醒时间,作业主管提醒使能,确认作业,完成作业,完成作业确认)
   @PutMapping("/")
   @ApiOperation(notes = "修改作业名称,作业使能,作业开始时间,作业提醒次数,作业提醒时间,作业主管提醒使能,确认作业,完成作业,完成作业确认" +
         "{ \"task_id\": 1000009, \"task_name\": \"\", \"task_enabled\": 0, \"task_start_date\": \"2021-01-18 08:18:59\", \"task_notice_sum\": 0, \"task_notice_starttime\": \"2021-01-18 08:18:59\", \"task_notice_endtime\": \"2021-01-18 08:18:59\", \"task_confirm\": 0, \"task_confirm_date\": \"2021-01-18 08:18:59\", \"task_complete\": 0, \"task_complete_confirm\": 0, \"notice_master_enabled\": 0 }" +
         "",value="作业管理")
   public ServiceModel update(@RequestBody User_task utask) {
        ServiceModel model=service.update(utask);
        
@@ -44,14 +60,53 @@
     
     //4.1删除指定的作业
   @DeleteMapping("/")
     public ServiceModel delete(@RequestBody User_task utask){
   @ApiOperation(notes = "",value="删除指定的作业")
     public ServiceModel delete(@RequestParam Integer task_id,@RequestParam Integer task_type){
      User_task utask = new User_task();
      utask.setTask_id(task_id);
      utask.setTask_type(task_type);
        ServiceModel model=service.delete(utask);
        
        return model;
     }
   //4.1作业管理查询user_task所有信息
   @GetMapping("byCondition")
   @PostMapping("byCondition")
   @ApiOperation(notes = "{\n" +
         "  \"utask\": {\n" +
         "    \"task_type\": 1,\n" +
         "    \"task_create_date\": \"2001-01-25 08:19:35\",\n" +
         "    \"task_create_date1\": \"2021-01-25 08:19:35\",\n" +
         "    \"task_complete\": 1,\n" +
         "    \"task_complete_date\": \"2001-01-25 08:19:35\",\n" +
         "    \"task_complete_date1\": \"2021-01-25 08:19:35\"\n" +
         "  },\n" +
         "  \"utest\": {\n" +
         "    \"task_usr_ids\": \"1002\",\n" +
         "    \"task_exe_date\": \"2001-01-25 08:19:35\",\n" +
         "    \"task_exe_date1\": \"2021-01-25 08:19:35\"\n" +
         "  },\n" +
         "  \"ulist\": {\n" +
         "    \"uId\": 0\n" +
         "  },\n" +
         "  \"binf\": {\n" +
         "    \"stationName\": \"\",\n" +
         "    \"stationName1\": \"\",\n" +
         "    \"battGroupId\": 0,\n" +
         "    \"battGroupName1\": \"\",\n" +
         "    \"monCapStd\": 0.0,\n" +
         "    \"monVolStd\": 0.0,\n" +
         "    \"battProducer\": \"\"\n" +
         "  },\n" +
         "  \"ucheck\": {\n" +
         "    \"task_id\": 0,\n" +
         "    \"task_exe_date\": \"2021-01-25 08:19:35\",\n" +
         "    \"task_exe_date1\": \"2021-01-25 08:19:35\"\n" +
         "  },\n" +
         "  \"uinf\": {\n" +
         "    \"uId\": 1001\n" +
         "  }\n" +
         "}",value="作业管理查询user_task所有信息")
    public ServiceModel serchByCondition(@RequestBody Task_Batt_Test tbt){
       ServiceModel model=service.serchByCondition(tbt);
       
@@ -60,15 +115,47 @@
    }
    
    //4.1根据task_id查询user_task_test/user_task_check
   @GetMapping("byInfo")
    public ServiceModel serchByInfo(@RequestBody User_task utask){
   @PostMapping("byInfo")
   @ApiOperation(notes = "",value="task_id查询user_task_test/user_task_check")
    public ServiceModel serchByInfo(@RequestParam Integer task_id,@RequestParam Integer task_type){
      User_task utask = new User_task();
      utask.setTask_id(task_id);
      utask.setTask_type(task_type);
       ServiceModel model=service.serchByInfo(utask);
       
       return model;
    }
    
    //4.1查询符合条件的电池组信息
   @GetMapping("battGroup")
   @PostMapping("battGroup")
   @ApiOperation(notes = "{\n" +
         "  \"binf\": {\n" +
         "    \"stationName\": \"\",\n" +
         "    \"stationName1\": \"\",\n" +
         "    \"battGroupId\": 0,\n" +
         "    \"battGroupName1\": \"电池组1\",\n" +
         "    \"battProductDate\": \"1901-01-18 08:18:59\",\n" +
         "    \"battProductDate1\": \"2021-01-18 08:18:59\",\n" +
         "    \"battInUseDate\": \"1901-01-18 08:18:59\",\n" +
         "    \"battInUseDate1\": \"2021-01-18 08:18:59\",\n" +
         "    \"monVolStd\": 0.0,\n" +
         "    \"monCapStd\": 0.0\n" +
         "\n" +
         "\n" +
         "  },\n" +
         "  \"mainf\": {\n" +
         "    \"maint_done_time\": \"1901-01-18 08:18:59\",\n" +
         "    \"maint_done_time1\": \"2021-01-18 08:18:59\"\n" +
         "  },\n" +
         "  \"uinf\": {\n" +
         "    \"uName\": \"\"\n" +
         "  },\n" +
         "  \"tdata\": {\n" +
         "    \"test_type\": 0,\n" +
         "    \"record_time\": \"1901-01-18 08:18:59\",\n" +
         "    \"record_time1\": \"2021-01-18 08:18:59\"\n" +
         "  }\n" +
         "}",value="查询符合条件的电池组信息")
    public ServiceModel serchBattgroup(@RequestBody Batt_Maint_Dealarm bmd){
      ServiceModel model = new ServiceModel();
@@ -81,9 +168,24 @@
    }
    
    //0.1查询指定用户的作业信息
   @GetMapping("byUid")
   @PostMapping("byUid")
   @ApiOperation(notes = "{\n" +
         "  \"utask\": {\n" +
         "    \"task_type\": 0,\n" +
         "    \"task_close_date\": \"2006-12-30 13:26:38\",\n" +
         "    \"task_close_date1\": \"2021-01-19 13:26:38\",\n" +
         "    \"task_complete\": 1\n" +
         "  },\n" +
         "  \"uinf\": {\n" +
         "    \"uId\": 1001\n" +
         "  },\n" +
         "  \"pageBean\": {\n" +
         "    \"pageSize\":12,\n" +
         "    \"pageNum\": 0\n" +
         "  }\n" +
         "}",value="查询指定用户的作业信息")
    public ServiceModelOnce serchByUid(@RequestBody Task_Batt_Test tbt){
       User_inf user=(User_inf)ActionUtil.getSession().getAttribute("user");
       User_inf user=(User_inf)ActionUtil.getUser();
//      User_inf user= new User_inf();
//      user.setuId(1001);
      ServiceModelOnce model=new ServiceModelOnce();
@@ -96,14 +198,61 @@
    }
    
    //0.1作业管理查询user_task所有信息
   @GetMapping("byTask")
   @PostMapping("byTask")
   @ApiOperation(notes = "task_type==2 " +
         "{\n" +
         "  \"utask\": {\n" +
         "    \"task_type\": 2,\n" +
         "    \"task_complete\": 1,\n" +
         "    \"task_complete_date\": \"2000-01-20 11:48:46\",\n" +
         "    \"task_complete_date1\": \"2031-01-20 11:48:46\"\n" +
         "  },\n" +
         "  \"binf\": {\n" +
         "    \"stationName\": \"\",\n" +
         "    \"stationName1\": \"\",\n" +
         "    \"battGroupId\": 1000003\n" +
         "  },\n" +
         "  \"ucheck\": {\n" +
         "    \"task_exe_date\": \"2001-01-20 11:48:46\",\n" +
         "    \"task_exe_date1\": \"2021-01-20 11:48:46\"\n" +
         "  },\n" +
         "    \"pageBean\": {\n" +
         "    \"pageSize\": 1,\n" +
         "    \"pageNum\": 0\n" +
         "    }\n" +
         "}" +
         "-------------------------" +
         "task_type!=2 " +
         "{\n" +
         "  \"utask\": {\n" +
         "    \"task_type\": 1,\n" +
         "    \"task_complete\": 1,\n" +
         "    \"task_complete_date\": \"2000-01-20 11:48:46\",\n" +
         "    \"task_complete_date1\": \"2031-01-20 11:48:46\"\n" +
         "  },\n" +
         "  \"utest\": {\n" +
         "    \"task_usr_ids\": \"\",\n" +
         "    \"task_exe_date\": \"2001-01-20 11:48:46\",\n" +
         "    \"task_exe_date1\": \"2031-01-20 11:48:46\"\n" +
         "  },\n" +
         "  \"binf\": {\n" +
         "    \"stationName\": \"太原市\",\n" +
         "    \"stationName1\": \"\",\n" +
         "    \"battGroupId\": 1000003\n" +
         "  },\n" +
         "    \"pageBean\": {\n" +
         "    \"pageSize\": 6,\n" +
         "    \"pageNum\": 0\n" +
         "    }\n" +
         "}",value="作业管理查询user_task所有信息")
    public ServiceModel serchByTask(@RequestBody Task_Batt_Test tbt){
       ServiceModel model=service.serchByTask(tbt);
       
       return model;
    }
    //4.1根据维护区查询所有的电池组和对应的包机人(模板创建)和维护人员信息以及各类作业对应的电池组信息
   @GetMapping("byTemplate")
   @PostMapping("serchBytemplate")
   @ApiOperation(notes = "",value="TODO 维护区查询所有的电池组和对应的包机人(模板创建)和维护人员信息以及各类作业对应的电池组信息")
    public ServiceModel serchBytemplate(@RequestBody User_task_batt_template utbt){
      ServiceModel model=new ServiceModel();
@@ -115,7 +264,8 @@
    }
    
     //4.1由模板添加作业(向utask,utest,ucheck中添加数据)
   @PostMapping("byTemplate")
   @PostMapping("addBytemplate")
   @ApiOperation(notes = "",value="TODO由模板添加作业(向utask,utest,ucheck中添加数据)")
    public ServiceModel addBytemplate(@RequestBody AllModel allmodel){
       User_inf uinf=(User_inf)ActionUtil.getSession().getAttribute("user");
       //System.out.println(allmodel.getPmodel());