| | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DigestUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.modules.FTP.FtpUtil; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String times = df.format(new Date()); |
| | | zc.setZctime(times); |
| | | Integer userCount = iUserService.selectCount(zc.getUsername()); |
| | | if (userCount > 0) { |
| | | throw new org.springblade.core.log.exception.ServiceException(StringUtil.format("当前用户 [{}] 已存在!", zc.getUsername())); |
| | | } |
| | | zcService.inster(zc); |
| | | |
| | | String s = "insert into act_zc(id,username,password,sname,sex,phone,zctime,deptid,parent_id,jurisdiction,cardid)" + |
| | | "values(" + "'" + zc.getId() + "'" + |
| | | "," + "'" + zc.getUsername() + "'" + |
| | |
| | | "," + "'" + zc.getParentId() + "'" + |
| | | "," + "'" + zc.getJurisdiction() + "'" + |
| | | "," + "'" + zc.getCardid() + "'" + ")"; |
| | | |
| | | System.out.println(s); |
| | | FtpUtil.sqlFileUpload(s); |
| | | |
| | | return R.success("新增成功"); |
| | | } |
| | | |
| | | /** |
| | | * 用户验证 |
| | | * @param username |
| | | * @return |
| | | */ |
| | | @GetMapping("/inspect") |
| | | public R inspect(String username) { |
| | | Integer userCount = iUserService.selectCount(username); |
| | | if (userCount > 0) { |
| | | throw new org.springblade.core.log.exception.ServiceException(StringUtil.format("当前用户{}已存在!", username)); |
| | | } |
| | | return R.success("当前用户已存在!"); |
| | | } |
| | | |
| | | } |