package com.fgkj.controller;
|
|
import com.fgkj.util.*;
|
|
import com.fgkj.dto.*;
|
import com.fgkj.services.User_battmaint_checkService;
|
import io.swagger.annotations.Api;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
|
import javax.annotation.Resource;
|
|
@RequestMapping("maintCheck")
|
@RestController
|
@Api
|
public class User_battmaint_checkController{
|
|
@Resource
|
private User_battmaint_checkService service;
|
|
private Task_Batt_Test tbt;
|
|
//作业抽查(新建抽查作业)
|
@PostMapping("/")
|
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);
|
|
return model;
|
}
|
//TODO 参数传递
|
/***
|
* [
|
* {
|
* "num": 0,
|
* "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": ""
|
* },
|
* [{
|
* "num": 0,
|
* "usr_id": 0,
|
* "usr_name": "",
|
* "task_rec_id": 0,
|
* "work_caption": "",
|
* "work_caption_time": "2021-01-05 10:37:13"
|
* }]
|
* ]
|
*/
|
//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) {
|
ServiceModel model=new ServiceModel();
|
User_inf user=(User_inf)ActionUtil.getUser();
|
|
if(user!=null){
|
for (User_battmaint_check_process user_battmaint_check_process : ubcp) {
|
user_battmaint_check_process.setUsr_id(user.getUId());
|
}
|
model=service.updatePro(ubc, ubcp);
|
}
|
|
return model;
|
}
|
|
//TODO 未完成
|
//4.10作业抽查管理
|
@GetMapping("byCondition")
|
public ServiceModel serchByCondition(@RequestBody Task_Batt_Test tbt){
|
ServiceModel model=service.serchByCondition(tbt);
|
|
return model;
|
}
|
|
//作业抽查(删除记录)
|
@DeleteMapping("/")
|
public ServiceModel delete(@RequestBody User_battmaint_check ubc){
|
ServiceModel model=service.delete(ubc);
|
|
return model;
|
}
|
|
//4.10作业抽查管理(删除记录(并且删除操作记录))
|
@DeleteMapping("pro")
|
public ServiceModel deletePro(@RequestBody User_battmaint_check ubc) {
|
ServiceModel model=service.deletePro(ubc);
|
|
return model;
|
}
|
|
}
|