src/main/java/com/fgkj/controller/User_ChartController.java
@@ -28,7 +28,7 @@ @RequestMapping("userChart") @RestController @Api(tags = "userChart接口") @Api(tags = "userChart接口TODO") public class User_ChartController{ @Resource private User_ChartService service; src/main/java/com/fgkj/controller/User_taskController.java
@@ -12,6 +12,7 @@ import java.text.ParseException; import java.util.List; import java.util.Map; import javax.annotation.Resource; @@ -22,23 +23,35 @@ @Resource private User_taskService service; // ,@RequestBody User_task_param utparam,@RequestBody List<BattInf> addlist, @RequestBody User_inf uinf //添加作业 @PostMapping("/") @ApiOperation(notes = "",value="添加作业") 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 = "修改作业名称,作业使能,作业开始时间,作业提醒次数,作业提醒时间,作业主管提醒使能,确认作业,完成作业,完成作业确认",value="作业管理") @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); @@ -48,15 +61,52 @@ //4.1删除指定的作业 @DeleteMapping("/") @ApiOperation(notes = "",value="删除指定的作业") public ServiceModel delete(@RequestBody User_task utask){ 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所有信息 @PostMapping("byCondition") @ApiOperation(notes = "",value="作业管理查询user_task所有信息") @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); @@ -65,11 +115,12 @@ } //4.1根据task_id查询user_task_test/user_task_check @GetMapping("byInfo") @PostMapping("byInfo") @ApiOperation(notes = "",value="task_id查询user_task_test/user_task_check") public ServiceModel serchByInfo(Integer task_id){ User_task utask= new User_task(); 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; @@ -77,7 +128,34 @@ //4.1查询符合条件的电池组信息 @PostMapping("battGroup") @ApiOperation(notes = "",value="查询符合条件的电池组信息") @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(); @@ -91,7 +169,21 @@ //0.1查询指定用户的作业信息 @PostMapping("byUid") @ApiOperation(notes = "",value="查询指定用户的作业信息") @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.getUser(); // User_inf user= new User_inf(); @@ -107,7 +199,52 @@ //0.1作业管理查询user_task所有信息 @PostMapping("byTask") @ApiOperation(notes = "",value="作业管理查询user_task所有信息") @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); @@ -115,7 +252,7 @@ } //4.1根据维护区查询所有的电池组和对应的包机人(模板创建)和维护人员信息以及各类作业对应的电池组信息 @PostMapping("serchBytemplate") @ApiOperation(notes = "",value="根据维护区查询所有的电池组和对应的包机人(模板创建)和维护人员信息以及各类作业对应的电池组信息") @ApiOperation(notes = "",value="TODO 维护区查询所有的电池组和对应的包机人(模板创建)和维护人员信息以及各类作业对应的电池组信息") public ServiceModel serchBytemplate(@RequestBody User_task_batt_template utbt){ ServiceModel model=new ServiceModel(); @@ -128,7 +265,7 @@ //4.1由模板添加作业(向utask,utest,ucheck中添加数据) @PostMapping("addBytemplate") @ApiOperation(notes = "",value="由模板添加作业(向utask,utest,ucheck中添加数据)") @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()); src/main/java/com/fgkj/controller/User_task_batt_checkController.java
@@ -30,7 +30,7 @@ } //4.1提交,复查作业 @PutMapping("/") @ApiOperation(notes = "",value="提交,复查作业") @ApiOperation(notes = "num 为update条件",value="提交,复查作业") public ServiceModel update(@RequestBody User_task_batt_check utbc) { ServiceModel model=service.update(utbc); @@ -38,16 +38,20 @@ } @DeleteMapping("/") @ApiOperation(notes = "",value="删除") public ServiceModel delete(@RequestBody User_task_batt_check utbc) { ServiceModel model=service.delete(utbc); @ApiOperation(notes = "", value = "删除") public ServiceModel delete(@RequestParam Integer num) { User_task_batt_check utbc = new User_task_batt_check(); utbc.setNum(num); ServiceModel model = service.delete(utbc); return model; } @GetMapping("byCondition") @PostMapping("byCondition") @ApiOperation(notes = "",value="task_id查询user_task_batt_check信息") public ServiceModel serchByCondition(@RequestBody User_task_batt_check utbc){ public ServiceModel serchByCondition(@RequestParam Integer task_id) { User_task_batt_check utbc = new User_task_batt_check(); utbc.setTask_id(task_id); ServiceModel model=service.serchByCondition(utbc); return model; src/main/java/com/fgkj/controller/User_task_batt_templateController.java
@@ -42,7 +42,9 @@ //4.4 作业模板管理(删除) @DeleteMapping("/") @ApiOperation(notes = "",value="作业模板管理(删除)") public ServiceModel delete(@RequestBody User_task_batt_template utbt){ public ServiceModel delete(@RequestParam Integer template_id){ User_task_batt_template utbt = new User_task_batt_template(); utbt.setTemplate_id(template_id); ServiceModel model=service.delete(utbt); return model; @@ -51,7 +53,9 @@ //4.4根据模板id查询模板的信息 @PostMapping("byCondition") @ApiOperation(notes = "",value="模板id查询模板的信息") public ServiceModel serchByCondition(@RequestBody User_task_batt_template utbt){ public ServiceModel serchByCondition(@RequestParam Integer template_id){ User_task_batt_template utbt = new User_task_batt_template(); utbt.setTemplate_id(template_id); ServiceModel model=service.serchByCondition(utbt); return model; src/main/java/com/fgkj/controller/User_task_changeController.java
@@ -40,15 +40,17 @@ //4.5作业变更查询(删除记录) @DeleteMapping("/") @ApiOperation(notes = "",value="作业变更查询(删除记录)") public ServiceModel delete(@RequestBody User_task_change utc) { public ServiceModel delete(@RequestParam Integer num) { User_task_change utc = new User_task_change(); utc.setNum(num); ServiceModel model=service.delete(utc); return model; } //4.5作业变更查询 @PostMapping("byCondition") @ApiOperation(notes = "",value="作业变更查询") @ApiOperation(notes = "{ \"binf\": { \"stationName\": \"湖北省-武汉市-东西湖区-61850机房-2G-2G-2\", \"stationName1\": \"湖北省\", \"battGroupId\": 0, \"battGroupName\": \"tt\", \"battGroupName1\": \"t\", \"monCapStd\": 150, \"monVolStd\": 2, \"battProducer\": \"理士\" },\"uchange\": { \"usr_id\": 0, \"change_type_id\": 0, \"task_type_id\": 0, \"task_change_approve_res\": 0, \"change_ask_time\": \"2001-01-23 08:14:23\", \"change_ask_time1\": \"2021-01-23 08:14:23\" },\"pageBean\": { \"pageSize\": 11, \"pageNum\": 0 } }",value="作业变更查询") public ServiceModel serchByCondition(@RequestBody Task_Batt_Test tbt){ ServiceModel model=service.serchByCondition(tbt); @@ -57,11 +59,11 @@ //查询所有 @GetMapping("all") @ApiOperation(notes = "",value="查询所有") @ApiOperation(notes = "未实现",value="查询所有") public ServiceModel searchAll(){ ServiceModel model=service.searchAll(); // ServiceModel model=service.searchAll(); return model; return new ServiceModel(); } } src/main/java/com/fgkj/controller/User_task_paramController.java
@@ -20,10 +20,10 @@ public class User_task_paramController{ @Resource private User_task_paramService service; //4.2作业参数(新增作业参数) @PostMapping("/") @ApiOperation(notes = "",value="作业参数(新增作业参数)") @ApiOperation(notes = "tp_task_notice_starttime 等时间参数不能为空 { \"tp_name\": \"\", \"tp_taskname\": \"\", \"tp_tasktype\": 0, \"tp_autoinc_daycount\": 0, \"tp_taskdelay_daycount\": 0, \"tp_pass_saturday\": 0, \"tp_pass_sunday\": 0, \"tp_pass_jiejiari\": 0, \"tp_task_notice_count\": 0, \"tp_task_notice_time_interval\": 0, \"tp_task_notice_starttime\": \"2021-01-07 08:16:26\", \"tp_task_notice_endtime\": \"2021-01-07 08:16:26\", \"tp_task_enabled\": 0, \"tp_master_id\": \"\", \"tp_notice_master_enabled\": 0, \"tp_task_battlife_var\": 0, \"tp_task_battyong_test80_month\": 0, \"tp_task_battold_test80_month\": 0, \"tp_task_battyong_test40_month\": 0, \"tp_task_battold_test40_month\": 0, \"tp_task_batt_checkcircle_month\": 0, \"tp_task_batt_checklimit_month\": 0, \"tp_task_batt_lazhacircle_month\": 0, \"tp_task_batt_lazhalimit_month\": 0 }",value="作业参数(新增作业参数)") public ServiceModel add(@RequestBody User_task_param utp) { ServiceModel model=service.add(utp); @@ -42,7 +42,7 @@ //4.2作业参数(重命名操作) @PutMapping("pro") @ApiOperation(notes = "",value="作业参数(重命名操作)") @ApiOperation(notes = "tp_task_notice_starttime 时间参数不能为空",value="作业参数(重命名操作)") public ServiceModel updatePro(@RequestBody List<User_task_param> uplist) { ServiceModel model=service.updatePro(uplist); @@ -67,10 +67,12 @@ return model; } //4.2根据参数id查基本参数和模板参数 @GetMapping("byCondition") //4.2根据参数id查基本参数和模板参数 100001 @PostMapping("byCondition") @ApiOperation(notes = "",value="参数id查基本参数和模板参数") public ServiceModel serchByCondition(@RequestBody User_task_param utp){ public ServiceModel serchByCondition(@RequestParam Integer tp_num){ User_task_param utp = new User_task_param(); utp.setTp_num(tp_num); ServiceModel model=service.serchByCondition(utp); return model; src/main/java/com/fgkj/mapper/impl/User_task_user_listMapper.java
@@ -19,7 +19,7 @@ public List searchAll() ; //4.1作业管理----根据task_id查主管姓名和指派人姓名 @Select("select num,task_id,uid,usr_type from db_user.tb_user_task_user_list where task_id=#{uId}") @Select("select num,task_id,uid,usr_type from db_user.tb_user_task_user_list where task_id=#{task_id}") public List<User_task_user_list> serchByCondition(User_task_user_list obj); } src/main/java/com/fgkj/services/User_taskService.java
@@ -253,33 +253,31 @@ public ServiceModel delete(User_task obj) { TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); ServiceModel model = new ServiceModel(); Boolean bl=true; if (obj.getTask_type()==2){ if (!(mapper.del(obj)>0)) { bl=false; Boolean bl = true; try { if (obj.getTask_type() == 2) { bl = mapper.del(obj) > 0; if (bl) bl = mapper.delsqlC(obj) > 0; //check } else { bl = mapper.del(obj) > 0; if (bl) bl = mapper.delsqlT(obj) > 0; //test } if (!(mapper.delsqlC(obj)>0)) { bl=false; } }else{ if (!(mapper.del(obj)>0)) { bl=false; } if (!(mapper.delsqlT(obj)>0)) { bl=false; } } if(bl){ dataSourceTransactionManager.commit(transactionStatus); model.setCode(1); model.setMsg("删除作业成功!"); } else{ } catch (Exception e) { e.printStackTrace(); dataSourceTransactionManager.rollback(transactionStatus); model.setMsg("删除作业失败!"); } return model; } model.setMsg("删除作业失败!"); return model; } if (bl) { dataSourceTransactionManager.commit(transactionStatus); model.setCode(1); model.setMsg("删除作业成功!"); } else { dataSourceTransactionManager.rollback(transactionStatus); model.setMsg("删除作业失败!"); } return model; } //4.1作业管理查询user_task所有信息 public ServiceModel serchByCondition(Task_Batt_Test tbt){ src/main/java/com/fgkj/services/User_task_batt_checkService.java
@@ -17,7 +17,14 @@ public ServiceModel add(User_task_batt_check obj) { ServiceModel model = new ServiceModel(); Boolean bl=mapper.add(obj); Boolean bl= null; try { bl = mapper.add(obj); } catch (Exception e) { e.printStackTrace(); model.setMsg("添加失败!"); return model; } if(bl){ model.setCode(1); model.setMsg("添加成功!"); @@ -31,7 +38,14 @@ //4.1提交,复查作业 public ServiceModel update(User_task_batt_check obj) { ServiceModel model = new ServiceModel(); Boolean bl=mapper.update(obj); Boolean bl= null; try { bl = mapper.update(obj); } catch (Exception e) { e.printStackTrace(); model.setMsg("修改失败!"); return model; } if(bl){ model.setCode(1); model.setMsg("修改成功!"); src/main/java/com/fgkj/services/User_task_batt_templateService.java
@@ -26,7 +26,14 @@ //4.4作业模板管理(新建模板) public ServiceModel add(User_task_batt_template obj) { ServiceModel model = new ServiceModel(); Boolean bl=mapper.add(obj); Boolean bl= null; try { bl = mapper.add(obj); } catch (Exception e) { e.printStackTrace(); model.setMsg("添加失败!"); return model; } if(bl){ model.setCode(1); model.setMsg("添加成功!"); @@ -41,25 +48,28 @@ public ServiceModel update(List<User_task_batt_template> list) { TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); ServiceModel model = new ServiceModel(); //TODO perry待查 boolean bl=true; if(list!=null&&list.size()>0){ for (int i=0;i<list.size();i++) { if(!mapper.updatePro(list.get(i))){ bl=false; boolean bl = true; if (list != null && list.size() > 0) { for (int i = 0; i < list.size(); i++) { try { bl = mapper.updatePro(list.get(i)); } catch (Exception e) { e.printStackTrace(); dataSourceTransactionManager.rollback(transactionStatus); model.setMsg("修改失败!"); return model; } } } if(bl){ if (bl) { dataSourceTransactionManager.commit(transactionStatus); model.setCode(1); model.setMsg("修改成功!"); } else{ } else { dataSourceTransactionManager.rollback(transactionStatus); model.setMsg("修改失败!"); } return model; return model; } //4.4 作业模板管理(删除) public ServiceModel delete(User_task_batt_template obj) { src/main/java/com/fgkj/services/User_task_changeService.java
@@ -22,7 +22,14 @@ //4.1作业变更申请 public ServiceModel add(User_task_change obj) { ServiceModel model = new ServiceModel(); Boolean bl=mapper.add(obj); Boolean bl= null; try { bl = mapper.add(obj); } catch (Exception e) { e.printStackTrace(); model.setMsg("提交变更申请失败!"); return model; } if(bl){ model.setCode(1); model.setMsg("提交变更申请成功!"); @@ -36,7 +43,14 @@ //4.5作业变更查询(审批) public ServiceModel update(User_task_change obj) { ServiceModel model = new ServiceModel(); Boolean bl=mapper.update(obj); Boolean bl= null; try { bl = mapper.update(obj); } catch (Exception e) { e.printStackTrace(); model.setMsg("作业审批失败!"); return model; } if(bl){ model.setCode(1); model.setMsg("作业审批成功!"); src/main/java/com/fgkj/services/User_task_paramService.java
@@ -30,7 +30,14 @@ //4.2作业参数(新增作业参数) public ServiceModel add(User_task_param obj) { ServiceModel model = new ServiceModel(); Boolean bl=mapper.add(obj); Boolean bl= null; try { bl = mapper.add(obj); } catch (Exception e) { e.printStackTrace(); model.setMsg("添加失败!"); return model; } if(bl){ model.setCode(1); model.setMsg("添加成功!"); @@ -44,7 +51,14 @@ //4.2作业参数(修改操作/重命名操作) public ServiceModel update(User_task_param obj) { ServiceModel model = new ServiceModel(); Boolean bl=mapper.update(obj); Boolean bl= null; try { bl = mapper.update(obj); } catch (Exception e) { e.printStackTrace(); model.setMsg("修改失败!"); return model; } if(bl){ model.setCode(1); model.setMsg("修改成功!"); src/main/resources/mapper/UserTaskMapper.xml
@@ -161,7 +161,7 @@ <result column="task_close_date" property="task_close_date"></result> </association> <association property="ulist" javaType="User_task_user_list"> <result column="uId" property="UId"></result> <result column="uId" property="uId"></result> </association> </resultMap>