| | |
| | | return R.data(200,null,"修改成功!"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 离职 |
| | | */ |
| | | @PostMapping("/userLeave") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入User") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R userLeave(@Valid @RequestBody Map<String, Object> userMap) throws Exception { |
| | | //获取user |
| | | User user = JSON.parseObject(JSON.toJSONString(userMap), User.class); |
| | | //分配保安角色 |
| | | CacheUtil.clear(USER_CACHE); |
| | | // 指纹设置 |
| | | fingerprintSet(user); |
| | | //如果是离职 |
| | | boolean b = leaveHandle(user); |
| | | return R.status(b); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 离职处理 |
| | | * @param user |
| | |
| | | dispatcher1.setStatus(1); |
| | | dispatcher1.setUpdateTime(new Date()); |
| | | boolean b = dispatcherService.updateById(dispatcher1); |
| | | if (b) { |
| | | String s1 = |
| | | "update sys_dispatcher set status = " + "'" + dispatcher1.getStatus() + "'" |
| | | + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher1.getUpdateTime()) + "'" |
| | | + " " + "where id = " + "'" + dispatcher1.getId() + "'"; |
| | | myAsyncService.dataSync(s1); |
| | | } |
| | | // if (b) { |
| | | // String s1 = |
| | | // "update sys_dispatcher set status = " + "'" + dispatcher1.getStatus() + "'" |
| | | // + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher1.getUpdateTime()) + "'" |
| | | // + " " + "where id = " + "'" + dispatcher1.getId() + "'"; |
| | | // myAsyncService.dataSync(s1); |
| | | // } |
| | | }); |
| | | } |
| | | |
| | |
| | | experience1.setDeparturetime(new Date()); |
| | | //更新从业记录信息 |
| | | experienceService.updateById(experience1); |
| | | //数据同步 |
| | | String s1 = |
| | | "update sys_experience set departureTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience1.getDeparturetime()) + "'" |
| | | + " " + "where id = " + "'" + experience1.getId() + "'"; |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.dataSync(s1); |
| | | // //数据同步 |
| | | // String s1 = |
| | | // "update sys_experience set departureTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience1.getDeparturetime()) + "'" |
| | | // + " " + "where id = " + "'" + experience1.getId() + "'"; |
| | | // //FtpUtil.sqlFileUpload(s1); |
| | | // myAsyncService.dataSync(s1); |
| | | } else { |
| | | experience.setDeparturetime(new Date()); |
| | | experience.setName(user.getRealName()); |