whycrzg
2021-02-02 4fefb85e524b4b6e00efba04457797d8a32829a5
update
4个文件已修改
553 ■■■■ 已修改文件
src/main/java/com/fgkj/controller/User_battmaint_checkController.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/controller/User_infController.java 457 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/services/User_battmaint_checkService.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/services/User_infService.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/controller/User_battmaint_checkController.java
@@ -33,19 +33,20 @@
        
        return model;
    }
    //作业抽查管理(编辑抽查作业)
    @PutMapping("/")
    @ApiOperation(notes = "",value="作业抽查管理(编辑抽查作业)")
    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")
    @ApiOperation(notes = "user_battmaint_check表修改时User_battmaint_check_process表就新增一条记录",value="作业抽查管理(编辑记录)")
    @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();
@@ -64,7 +65,7 @@
    //TODO  数据不足待测试
    //4.10作业抽查管理
    @PostMapping("byCondition")
    @ApiOperation(notes = "数据不足待测试",value="作业抽查管理")
    @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);
        
@@ -74,16 +75,20 @@
    //作业抽查(删除记录)
    @DeleteMapping("/")
    @ApiOperation(notes = "",value="作业抽查(删除记录)")
    public ServiceModel delete(@RequestBody User_battmaint_check ubc){
        ServiceModel model=service.delete(ubc);
        return model;
    }
    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")
    @ApiOperation(notes = "",value="作业抽查管理(删除记录(并且删除操作记录))")
    public ServiceModel deletePro(@RequestBody User_battmaint_check ubc) {
    public ServiceModel deletePro(@RequestParam Integer num) {
        User_battmaint_check ubc = new User_battmaint_check();
        ubc.setNum(num);
        ServiceModel model=service.deletePro(ubc);
        
        return model;
src/main/java/com/fgkj/controller/User_infController.java
@@ -11,6 +11,7 @@
import com.google.gson.Gson;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -22,140 +23,165 @@
@RequestMapping("userInf")
@RestController
@Api(tags = "userInf接口")
public class User_infController{
    @Resource
    private User_infService service;
    @Resource
    private User_logService uservice;
    @Resource
    private UtilityFactoryService utilityFactoryService;
public class User_infController {
    @Resource
    private User_infService service;
    @Resource
    private User_logService uservice;
    @Resource
    private UtilityFactoryService utilityFactoryService;
    // private Batt_User_Permit bup;
    // ServiceModel model = new ServiceModel();
    // private User_inf uif;
    // private String result;
    // private String addjson;            //添加用户的用户json数组
    // private String upjson;            //更新用户的用户json数组
    //添加用户
    @PostMapping("/")
    @ApiOperation(notes = "",value="添加用户")
    public ServiceModel add(@RequestBody User_inf uif) {
        System.out.println("uif = " + uif);
        uif.setUpassword(ActionUtil.EncryptionMD5(uif.getUpassword()).toString());
        ServiceModel model = service.add(uif);
        {
            String msg="添加新用户:"+uif.getuName();
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Increase, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
        return model;
    }
    // private Batt_User_Permit bup;
    // ServiceModel model = new ServiceModel();
    // private User_inf uif;
    // private String result;
    // private String addjson;            //添加用户的用户json数组
    // private String upjson;            //更新用户的用户json数组
    //添加用户
    @PostMapping("/")
    @ApiOperation(notes = "{ \"uSnId\": \"1\", \"uName\": \"t2\", \"uShenFenId\": \"\", \"uEmployeeId\": \"\", \"uTelephone\": \"\", \"uMobilephone\": \"\", \"uEmail\": \"\", \"uAddr\": \"\", \"uBirthDay\": \"2021-01-11 08:26:29\", \"uAccessionDay\": \"2021-01-11 08:26:29\", \"uSex\": \"\", \"uDepartment\": \"\", \"uProTitle\": \"\", \"uAuthority\": \"\", \"uJobGroup\": \"\", \"uDuties\": \"\", \"uTasks\": \"\", \"uBaojiusr\": 0, \"uNote\": \"ss\", \"permitgroupName\": \"\", \"upassword\": \"ss\", \"license\": \"\" }", value = "添加用户")
    public ServiceModel add(@RequestBody User_inf uif) {
//        System.out.println("uif = " + uif);
        uif.setUpassword(ActionUtil.EncryptionMD5(uif.getUpassword()).toString());
        ServiceModel model = service.add(uif);
        {
            String msg = "添加新用户:" + uif.getuName();
            User_log ulog = UinfDaoFactory.CreateULog(UinfDaoFactory.Increase, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
        return model;
    }
    //修改用户信息
    @PutMapping("/")
    @ApiOperation(notes = "",value="修改用户信息")
    public ServiceModel update(@RequestBody User_inf uif) {
        ServiceModel model = new ServiceModel();
        model = service.update(uif);
        {
            String msg="修改"+uif.getuName()+"的用户信息";
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
        return model;
    }
    @PutMapping("/")
    @ApiOperation(notes = "{ \"uId\": \"1012\", \"uSnId\": \"1\", \"uName\": \"news\", \"uShenFenId\": \"\", \"uEmployeeId\": \"\", \"uTelephone\": \"\", \"uMobilephone\": \"\", \"uEmail\": \"\", \"uAddr\": \"\", \"uBirthDay\": \"2021-01-11 08:26:29\", \"uAccessionDay\": \"2021-01-11 08:26:29\", \"uSex\": \"\", \"uDepartment\": \"\", \"uProTitle\": \"\", \"uAuthority\": \"\", \"uJobGroup\": \"\", \"uDuties\": \"\", \"uTasks\": \"\", \"uBaojiusr\": 0, \"uNote\": \"ss\", \"permitgroupName\": \"\", \"upassword\": \"ss\", \"license\": \"\" }", value = "修改用户信息")
    public ServiceModel update(@RequestBody User_inf uif) {
        ServiceModel model = new ServiceModel();
        model = service.update(uif);
        {
            String msg = "修改" + uif.getuName() + "的用户信息";
            User_log ulog = UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
        return model;
    }
    //删除用户信息
    @DeleteMapping("/")
    @ApiOperation(notes = "",value="删除用户信息")
    public ServiceModel delete(@RequestBody User_inf uif) {
        ServiceModel model = new ServiceModel();
        if(uif!=null){
            model = service.delete(uif);
            {
                String msg="删除"+uif.getuName()+"的用户信息";
                User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Delete, msg);
                uservice.add(ulog);//将用户的操作记录下来
            }
        }
        return model;
    }
    @PostMapping("byCondition")
    @ApiOperation(notes = "",value="byCondition")
    public ServiceModel serchByCondition(@RequestBody User_inf uif) {
        return service.serchByCondition(uif);
    }
    @DeleteMapping("/")
    @ApiOperation(notes = "", value = "删除用户信息")
    public ServiceModel delete(@RequestParam Integer uId, @RequestParam String uName) {
        User_inf uif = new User_inf();
        uif.setuId(uId);
        uif.setuName(uName);
        ServiceModel model = service.delete(uif);
        {
            String msg = "删除" + uif.getuName() + "的用户信息";
            User_log ulog = UinfDaoFactory.CreateULog(UinfDaoFactory.Delete, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
        return model;
    }
    @PostMapping("all")
    @ApiOperation(notes = "TODO 待测",value="all")
    public ServiceModel searchAll(@RequestBody Batt_User_Permit bup) {
        ServiceModel model = new ServiceModel();
        System.out.println("bup = " + bup);
        if (bup.getPageBean() == null) {
            model = service.searchAll();
        } else {
            model = service.searchAll(bup);
        }
        return model;
    }
    //根据员工信息和员工编号去匹配合适的员工
    @PostMapping("byNameOrId")
    @ApiOperation(notes = "",value="员工信息和员工编号去匹配合适的员工")
    public ServiceModel searchByNameOrId(@RequestBody Batt_User_Permit bup) {
        ServiceModel model = service.searchByNameOrId(bup);
        return model;
    }
    //重置用户密码
    @PutMapping("resetPassword")
    @ApiOperation(notes = "",value="重置用户密码")
    public ServiceModel resetPassword(@RequestBody User_inf uif){
        ServiceModel model = new ServiceModel();
        model=service.resetPassword(uif);
        {
            String msg="重置"+uif.getuName()+"用户的密码";
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
        return model;
    }
    @PostMapping("byCondition")
    @ApiOperation(notes = "", value = "byCondition")
    public ServiceModel serchByCondition(@RequestParam String uName) {
        User_inf uif = new User_inf();
        uif.setuName(uName);
        return service.serchByCondition(uif);
    }
    //根据用户的id查询用户所在的包机组
    @PostMapping("byInfo")
    @ApiOperation(notes = "",value="用户的id查询用户所在的包机组")
    public ServiceModel serchByInfo(@RequestBody User_inf uif){
        ServiceModel model=service.serchByInfo(uif);
        return model;
    }
    @PostMapping("all")
    @ApiOperation(notes = "pageSize&pageNum传0时不分页,查询条件不同 ", value = "all")
    public ServiceModel searchAll(@ApiParam(value = "页面条数", required = true) @RequestParam Integer pageSize, @ApiParam(value = "页码", required = true) @RequestParam Integer pageNum) {
        ServiceModel model = new ServiceModel();
        if (pageSize == 0 && pageNum == 0) {
            model = service.searchAll();
        } else {
            Batt_User_Permit bup = new Batt_User_Permit();
            PageBean pageBean = new PageBean();
            pageBean.setPageSize(pageSize);
            pageBean.setPageNum(pageNum);
            bup.setPageBean(pageBean);
            model = service.searchAll(bup);
        }
        return model;
    }
    //添加新的用户模板
    @PostMapping("newUser")
    @ApiOperation(notes = "",value="添加新的用户模板")
    public ServiceModel createNewUser(){
        User_inf uinf=utilityFactoryService.CreateUinf();
        System.out.println("uinf = " + uinf);
        ServiceModel model=new ServiceModel();
        if(uinf!=null){
            model.setCode(1);
            model.setData(uinf);
        }
        return model;
    }
    //更新多个用户
    @PutMapping("user")
    @ApiOperation(notes = "",value="更新多个用户")
    public ServiceModel updateUser(@RequestBody List<User_inf> addlist){
        Gson gson=ActionUtil.getGson("yyyy-MM-dd");
        String msg="";
        ServiceModel model = new ServiceModel();
    //根据员工信息和员工编号去匹配合适的员工
    @PostMapping("byNameOrId")
    @ApiOperation(notes = "", value = "员工信息和员工编号去匹配合适的员工")
    public ServiceModel searchByNameOrId(@ApiParam(value = "员工信息", required = true) @RequestParam String uName, @ApiParam(value = "员工编号", required = true) @RequestParam String uEmployeeId, @ApiParam(value = "页面条数", required = true) @RequestParam Integer pageSize, @ApiParam(value = "页码", required = true) @RequestParam Integer pageNum) {
        Batt_User_Permit bup = new Batt_User_Permit();
        User_inf user_inf = new User_inf();
        user_inf.setuName(uName);
        user_inf.setuEmployeeId(uEmployeeId);
        PageBean pageBean = new PageBean();
        pageBean.setPageSize(pageSize);
        pageBean.setPageNum(pageNum);
        bup.setUinf(user_inf);
        bup.setPageBean(pageBean);
        ServiceModel model = service.searchByNameOrId(bup);
        return model;
    }
    //重置用户密码
    @PutMapping("resetPassword")
    @ApiOperation(notes = "", value = "重置用户密码")
    public ServiceModel resetPassword(@RequestParam Integer uId, @RequestParam String upassword, @RequestParam String uName) {
        User_inf uif = new User_inf();
        ServiceModel model = new ServiceModel();
        uif.setuId(uId);
        uif.setUpassword(upassword);
        uif.setuName(uName);
        model = service.resetPassword(uif);
        if (model.getCode() == 1) {
            String msg = "重置" + uif.getuName() + "用户的密码";
            User_log ulog = UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
        return model;
    }
    //根据用户的id查询用户所在的包机组
    @PostMapping("byInfo")
    @ApiOperation(notes = "", value = "用户的id查询用户所在的包机组")
    public ServiceModel serchByInfo(@RequestParam Integer uId) {
        User_inf uif = new User_inf();
        uif.setuId(uId);
        ServiceModel model = service.serchByInfo(uif);
        return model;
    }
    //添加新的用户模板
    @PostMapping("newUser")
    @ApiOperation(notes = "", value = "添加新的用户模板")
    public ServiceModel createNewUser() {
        User_inf uinf = utilityFactoryService.CreateUinf();
        System.out.println("uinf = " + uinf);
        ServiceModel model = new ServiceModel();
        if (uinf != null) {
            model.setCode(1);
            model.setData(uinf);
        }
        return model;
    }
    //更新多个用户
    @PutMapping("user")
    @ApiOperation(notes = "", value = "更新多个用户 TODO")
    public ServiceModel updateUser(@RequestBody List<User_inf> addlist) {
        Gson gson = ActionUtil.getGson("yyyy-MM-dd");
        String msg = "";
        ServiceModel model = new ServiceModel();
        /*if(addjson!=null && addjson.length()>0){
            List<User_inf> addlist=gson.fromJson(addjson, new TypeToken<List<User_inf>>(){}.getType());
            if(addlist!=null && addlist.size()>0){
@@ -173,99 +199,98 @@
        }*/
        model.setMsg(msg);
        model.setMsg(msg);
        //System.out.println(result);
        return model;
    }
    //修改多个用户
    @PostMapping("user")
    @ApiOperation(notes = "",value="修改多个用户")
    public ServiceModel addUser(@RequestBody List<Battalarm_data> list){
        ServiceModel model = new ServiceModel();
        //System.out.println(result);
        return model;
    }
    //修改多个用户
    @PostMapping("user")
    @ApiOperation(notes = "", value = "修改多个用户 TODO")
    public ServiceModel addUser(@RequestBody List<Battalarm_data> list) {
        ServiceModel model = new ServiceModel();
        /*if(addjson!=null && addjson.length()>0){
            Gson gson=new Gson();
            List<Battalarm_data> list=gson.fromJson(addjson, new TypeToken<List<User_inf>>(){}.getType());
        }*/
        return model;
    }
    //修改密码
    @PutMapping("password")
    @ApiOperation(notes = "",value="修改密码")
    public ServiceModel updatePassword(@RequestBody User_inf uif){
        ServiceModel model = new ServiceModel();
        User_inf uinf=(User_inf)ActionUtil.getUser();
        if(uinf!=null && uif!=null){
            uinf.setuSnId(uif.getuSnId());
            model=service.updatePassword(uinf);
        }
        return model;
    }
    //查询当前用户的信息
    @GetMapping("userFromSession")
    @ApiOperation(notes = "",value="查询当前用户的信息")
    public ServiceModel serchUserfromSession(){
        ServiceModel model = new ServiceModel();
        User_inf uif= (User_inf) ActionUtil.getUser();
        if (uif!=null) {
            model.setCode(1);
            model.setData(uif);
        }
        return model;
    }
    //检查用户的密码
    @GetMapping("checkUserPass")
    @ApiOperation(notes = "",value="检查用户的密码")
    public ServiceModel checkUserPass(@RequestParam String addjson){
        User_inf user = (User_inf)ActionUtil.getUser();
        ServiceModel model = new ServiceModel();
        if(user != null && null != user.getUpassword() && user.getUpassword().equals(addjson)){
            model.setCode(1);
        }else{
            model.setCode(0);
        }
        model.setData(null);
        return model;
    }
    //查询当前用户的用户名
    @GetMapping("uName")
    @ApiOperation(notes = "",value="查询当前用户的用户名")
    public ServiceModelImpl searchUname(){
        User_inf user = (User_inf)ActionUtil.getUser();
        ServiceModelImpl model = new ServiceModelImpl();
        if(user != null){
            model.setCode(1);
             model.setMsgN(user.getuName());
        }else{
            model.setCode(0);
            model.setMsg("You are not logged in, please log in");
        }
        return model;
    }
    //界面请求监测服务是否断开
    @PostMapping("checkService")
    @ApiOperation(notes = "",value="界面请求监测服务是否断开")
    public ServiceModel checkService(@RequestBody ServiceModel model){
        return model;
    }
    //包机组重做(穿梭框)查询所有的用户
    @GetMapping("csAll")
    @ApiOperation(notes = "",value="包机组重做(穿梭框)查询所有的用户")
    public ServiceModel searchCS_All() {
        ServiceModel model=service.searchCS_All();
        return model;
    }
        return model;
    }
    //修改密码
    @PutMapping("password")
    @ApiOperation(notes = "session 中获取uId", value = "修改密码")
    public ServiceModel updatePassword(@ApiParam(value = "明文密码", required = true) @RequestParam String pwd) {
        ServiceModel model = new ServiceModel();
        User_inf uinf = (User_inf) ActionUtil.getUser();
        if (uinf != null && !pwd.isEmpty()) {
            uinf.setuSnId(pwd);
            model = service.updatePassword(uinf);
        }
        return model;
    }
    //查询当前用户的信息
    @GetMapping("userFromSession")
    @ApiOperation(notes = "", value = "查询当前用户的信息")
    public ServiceModel serchUserfromSession() {
        ServiceModel model = new ServiceModel();
        User_inf uif = (User_inf) ActionUtil.getUser();
        if (uif != null) {
            model.setCode(1);
            model.setData(uif);
        }
        return model;
    }
    //检查用户的密码
    @GetMapping("checkUserPass")
    @ApiOperation(notes = "", value = "检查用户的密码")
    public ServiceModel checkUserPass(@ApiParam(value = "需要检查的密码", required = true) @RequestParam String checkpwd) {
        User_inf user = (User_inf) ActionUtil.getUser();
        ServiceModel model = new ServiceModel();
        if (user != null && null != user.getUpassword() && user.getUpassword().equals(checkpwd)) {
            model.setCode(1);
        } else {
            model.setCode(0);
        }
        model.setData(null);
        return model;
    }
    //查询当前用户的用户名
    @GetMapping("uName")
    @ApiOperation(notes = "", value = "查询当前用户的用户名")
    public ServiceModelImpl searchUname() {
        User_inf user = (User_inf) ActionUtil.getUser();
        ServiceModelImpl model = new ServiceModelImpl();
        if (user != null) {
            model.setCode(1);
            model.setMsgN(user.getuName());
        } else {
            model.setCode(0);
            model.setMsg("You are not logged in, please log in");
        }
        return model;
    }
    //界面请求监测服务是否断开
    @PostMapping("checkService")
    @ApiOperation(notes = "", value = "界面请求监测服务是否断开")
    public ServiceModel checkService(@RequestBody ServiceModel model) {
        return model;
    }
    //包机组重做(穿梭框)查询所有的用户
    @GetMapping("csAll")
    @ApiOperation(notes = "", value = "包机组重做(穿梭框)查询所有的用户")
    public ServiceModel searchCS_All() {
        ServiceModel model = service.searchCS_All();
        return model;
    }
}
src/main/java/com/fgkj/services/User_battmaint_checkService.java
@@ -105,28 +105,27 @@
    }
    //4.10作业抽查管理(删除记录)
    public ServiceModel deletePro(User_battmaint_check ucheck) {
        ServiceModel model=new ServiceModel();
        ServiceModel model = new ServiceModel();
        TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition);
        //TODO perry待查
        boolean bl=true;
        //删除对应的User_battmaint_check_process
        User_battmaint_check_process uprocess=new User_battmaint_check_process();
        uprocess.setTask_rec_id(ucheck.getNum());
        //删除User_battmaint_check表
        bl=mapper.delPro(ucheck)>0;
        //删除User_battmaint_check_process表中task_rec_id对应的记录
        bl=processMapper.delPro(uprocess)>0;
        //Boolean bl= DateUtil.makeManualCommit(DBUtil.getConn(), str_sql);
        if(bl){
        boolean bl = true;
        //删除对应的User_battmaint_check_process
        User_battmaint_check_process uprocess = new User_battmaint_check_process();
        uprocess.setTask_rec_id(ucheck.getNum());
        //删除User_battmaint_check表
        bl = mapper.delPro(ucheck) > 0;
        //删除User_battmaint_check_process表中task_rec_id对应的记录
        if (bl) {
            bl = processMapper.delPro(uprocess) > 0;
        }
        if (bl) {
            dataSourceTransactionManager.commit(transactionStatus);     //手动提交
            model.setCode(1);
            model.setMsg("修改成功!");
        }
        else{
        } else {
            dataSourceTransactionManager.rollback(transactionStatus);       //事务回滚
            model.setMsg("修改失败!");
        }
        return model;
        return model;
    }
    //TODO  数据不足待测试
    //4.10作业抽查管理
src/main/java/com/fgkj/services/User_infService.java
@@ -36,18 +36,26 @@
    //5.1用户管理(添加)
    public ServiceModel add(User_inf obj) {
        ServiceModel model = new ServiceModel();
        int flag=mapper.addJudge(obj); //查询,不需要开启事务
        int flag = mapper.addJudge(obj); //查询,不需要开启事务
        //System.out.println(flag);
        if(flag==0){
            Boolean bl=mapper.add(obj)>0;
            if(bl){
        if (flag == 0) {
            Boolean bl = null;
            try {
                bl = mapper.add(obj) > 0;
            } catch (Exception e) {
                e.printStackTrace();
                model.setCode(0);
                model.setMsg("添加失败!");
                return model;
            }
            if (bl) {
                model.setCode(1);
                model.setMsg("添加成功!");
            } else{
            } else {
                model.setCode(0);
                model.setMsg("添加失败!");
            }
        }else{
        } else {
            model.setCode(0);
            model.setMsg("用户名存在,请重新输入!");
        }
@@ -58,11 +66,18 @@
    public ServiceModel update(User_inf obj) {
        ServiceModel model = new ServiceModel();
        Boolean bl = false;
        bl=mapper.update(obj);
        if(bl){
        try {
            bl = mapper.update(obj);
        } catch (Exception e) {
            e.printStackTrace();
            model.setCode(0);
            model.setMsg("添加失败!");
            return model;
        }
        if (bl) {
            model.setCode(1);
            model.setMsg("修改成功");
        }else{
        } else {
            model.setCode(0);
            model.setMsg("修改失败");
        }
@@ -84,6 +99,7 @@
    }
    
    public ServiceModel serchByCondition(User_inf obj) {
        ServiceModel model = new ServiceModel();
        List list = mapper.serchByCondition(obj);
        /*
         * for (Object object : list) { System.out.println(object); }