| | |
| | | |
| | | import com.fgkj.dto.*; |
| | | import com.fgkj.services.User_battmaint_checkService; |
| | | import com.google.gson.Gson; |
| | | 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.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @RequestMapping("maintCheck") |
| | | @RestController |
| | | @Api |
| | | @Api(tags = "maintCheck接口") |
| | | public class User_battmaint_checkController{ |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private User_battmaint_checkService service; |
| | | |
| | | private Task_Batt_Test tbt; |
| | | |
| | | //作业抽查(新建抽查作业) |
| | | @PostMapping("/") |
| | | @ApiOperation(notes = "",value="作业抽查(新建抽查作业)") |
| | | public ServiceModel add(@RequestBody User_battmaint_check ubc){ |
| | | ServiceModel model=service.add(ubc); |
| | | |
| | | return model; |
| | | } |
| | | |
| | | |
| | | //作业抽查管理(编辑抽查作业) |
| | | @PutMapping("/") |
| | | public ServiceModel update(@RequestBody User_battmaint_check ubc){ |
| | | System.out.println(ubc); |
| | | ServiceModel model=service.update(ubc); |
| | | |
| | | @ApiOperation(notes = "{ \"num\": 26, \"stationId\": 0, \"usr_id\": 0, \"master_id\": 0, \"appoint_uid\": 0, \"copy_uids\": \"\", \"task_type_id\": 0, \"task_level\": 0, \"task_caption\": \"\", \"task_time_start\": \"2021-01-05 10:37:13\", \"task_time_end\": \"2021-01-05 10:37:13\", \"task_process\": \"\", \"task_done\": 0, \"task_done_time\": \"2021-01-05 10:37:13\", \"origin_usr_work_mark\": 0, \"origin_usr_work_mark1\": 0, \"task_done_confirm\": 0, \"master_audit\": 0, \"remark\": \"ttt\" }",value="作业抽查管理(编辑抽查作业)") |
| | | public ServiceModel update(@RequestBody User_battmaint_check ubc) { |
| | | |
| | | ServiceModel model = service.update(ubc); |
| | | return model; |
| | | } |
| | | |
| | | |
| | | |
| | | //4.10作业抽查管理(编辑记录)(user_battmaint_check表修改时User_battmaint_check_process表就新增一条记录) |
| | | @PutMapping("pro") |
| | | public ServiceModel updatePro(@RequestBody User_battmaint_check ubc,@RequestBody List<User_battmaint_check_process> ubcp) { |
| | | @ApiOperation(notes = "user_battmaint_check表修改时User_battmaint_check_process表就新增一条记录 { \"ubcp\": [{ \"usr_id\": 0, \"usr_name\": \"\", \"task_rec_id\": 0, \"work_caption\": \"\", \"work_caption_time\": \"2021-01-12 08:19:54\" }],\"num\": 28, \"usr_id\": 111, \"master_id\": 0, \"appoint_uid\": 0, \"copy_uids\": \"\", \"task_type_id\": 0, \"task_level\": 0, \"task_caption\": \"\", \"task_time_start\": \"2021-01-12 08:19:54\", \"task_time_end\": \"2021-01-12 08:19:54\", \"task_process\": \"\", \"task_done\": 0, \"task_done_time\": \"2021-01-12 08:19:54\", \"origin_usr_work_mark\": 0, \"origin_usr_work_mark1\": 0, \"task_done_confirm\": 0, \"master_audit\": 0, \"remark\": \"rr\" }",value="作业抽查管理(编辑记录)") |
| | | public ServiceModel updatePro(@RequestBody User_battmaint_check ubc) { |
| | | ServiceModel model=new ServiceModel(); |
| | | User_inf user=(User_inf)ActionUtil.getUser(); |
| | | if(user!=null){ |
| | | List<User_battmaint_check_process> ubcp = ubc.getUbcp(); |
| | | |
| | | if(user!=null){ |
| | | for (User_battmaint_check_process user_battmaint_check_process : ubcp) { |
| | | user_battmaint_check_process.setUsr_id(user.getUId()); |
| | | user_battmaint_check_process.setUsr_id(user.getuId()); |
| | | } |
| | | model=service.updatePro(ubc, ubcp); |
| | | } |
| | | |
| | | |
| | | return model; |
| | | } |
| | | |
| | | |
| | | //TODO 数据不足待测试 |
| | | //4.10作业抽查管理 |
| | | @GetMapping("byCondition") |
| | | @PostMapping("byCondition") |
| | | @ApiOperation(notes = "{ \"binf\": { \"stationId\": \"\", \"stationName\": \"\", \"stationName1\": \"\", \"battGroupId\": 1000021 },\"mcheck\": { \"task_done\": 1, \"copy_uids\": \"\", \"task_time_start\": \"2001-01-05 10:37:13\", \"task_time_end\": \"2021-2-05 10:37:13\", \"origin_usr_work_mark\": 0, \"origin_usr_work_mark1\": 10, \"task_done_confirm\": 1 },\"pageBean\": { \"pageSize\": 1, \"pageNum\": 2 } }",value="作业抽查管理 TODO 数据不足待测试") |
| | | public ServiceModel serchByCondition(@RequestBody Task_Batt_Test tbt){ |
| | | ServiceModel model=service.serchByCondition(tbt); |
| | | |
| | |
| | | |
| | | //作业抽查(删除记录) |
| | | @DeleteMapping("/") |
| | | public ServiceModel delete(@RequestBody User_battmaint_check ubc){ |
| | | ServiceModel model=service.delete(ubc); |
| | | |
| | | return model; |
| | | } |
| | | @ApiOperation(notes = "",value="作业抽查(删除记录)") |
| | | public ServiceModel delete(@RequestParam Integer num) { |
| | | User_battmaint_check ubc = new User_battmaint_check(); |
| | | ubc.setNum(num); |
| | | ServiceModel model = service.delete(ubc); |
| | | |
| | | return model; |
| | | } |
| | | |
| | | //4.10作业抽查管理(删除记录(并且删除操作记录)) |
| | | @DeleteMapping("pro") |
| | | public ServiceModel deletePro(@RequestBody User_battmaint_check ubc) { |
| | | @ApiOperation(notes = "",value="作业抽查管理(删除记录(并且删除操作记录))") |
| | | public ServiceModel deletePro(@RequestParam Integer num) { |
| | | User_battmaint_check ubc = new User_battmaint_check(); |
| | | ubc.setNum(num); |
| | | ServiceModel model=service.deletePro(ubc); |
| | | |
| | | return model; |