| | |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入zc") |
| | | public R update(@Valid @RequestBody Zc zc) { |
| | | String type = zc.getType(); |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String times = df.format(new Date()); |
| | | zc.setZctime(times); |
| | | if (type.equals("1")){ |
| | | User user = new User(); |
| | | user.setAccount(zc.getUsername()); |
| | | user.setPassword(DigestUtil.encrypt(zc.getPassword())); |
| | | user.setRealName(zc.getSname()); |
| | | user.setCardid(zc.getCardid()); |
| | | user.setRoleId("1433232531179704321"); |
| | | user.setDeptId(zc.getDeptid()); |
| | | iUserService.saveOrUpdate(user); |
| | | } |
| | | return R.status(zcService.updateById(zc)); |
| | | } |
| | | |
| | |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入zc") |
| | | public R submit(@Valid @RequestBody Zc zc) { |
| | | String type = zc.getType(); |
| | | if (type.equals("1")){ |
| | | User user = new User(); |
| | | user.setAccount(zc.getUsername()); |
| | | user.setPassword(DigestUtil.encrypt(zc.getPassword())); |
| | | user.setRealName(zc.getSname()); |
| | | user.setSex(Integer.valueOf(zc.getSex())); |
| | | user.setPhone(zc.getPhone()); |
| | | user.setDeptId(zc.getDeptid()); |
| | | user.setRoleId(zc.getParentId()); |
| | | iUserService.saveOrUpdate(user); |
| | | } |
| | | return R.status(zcService.saveOrUpdate(zc)); |
| | | } |
| | | |