智慧保安后台管理-外网
src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -235,15 +235,7 @@
      User user1 = userService.getById(user.getId());
      user.setPassword(user1.getPassword());
      userService.updateById(user);
      Date birthday1 = user.getBirthday();
      String birthday;
      String rtime;
      if (user.getBirthday() == null) {
         birthday = null;
      } else {
         birthday = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getBirthday());
      }
      if (user.getRtime() == null) {
         rtime = null;
      } else {
@@ -602,10 +594,6 @@
   public R securitySave(@Valid @RequestBody Map<String, Object> userMap) {
      //获取user
      User user = JSON.parseObject(JSON.toJSONString(userMap.get("user")), User.class);
      //判断是否为空
//      if (null!=user.getHold()){
      //持证
//         if (user.getHold().equals("1")){
      //分配保安角色
      Role role = new Role();
      role.setRoleAlias("保安");
@@ -613,6 +601,7 @@
      user.setRoleId(oneRole.getId().toString());
      user.setDispatch("1");
      user.setExaminationType("0");
      user.setAccount(user.getCardid());
      Integer userCount = userService.selectCount(user.getAccount());
      if (userCount > 0 && Func.isEmpty(user.getId())) {
@@ -629,27 +618,20 @@
//         }
//      }
      //密码加密
      if (Func.isNotEmpty(user.getPassword())) {
         user.setPassword(DigestUtil.encrypt(user.getPassword()));
      if (Func.isNotEmpty(user.getCardid())) {
//         user.setPassword(DigestUtil.encrypt(user.getPassword()));
         //取身份证号码后6位作为密码
         user.setPassword(DigestUtil.encrypt(user.getCardid().substring(user.getCardid().length() - 6)));
      }
      user.setTenantId("000000");
      //用户新增
      boolean status = userService.save(user);
      String birthday;
      String rtime;
      if (user.getBirthday() == null) {
         birthday = null;
      } else {
         birthday = new SimpleDateFormat("yyyy-MM-dd").format(user.getBirthday());
      }
      if (user.getRtime() == null) {
         rtime = null;
      } else {
         rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime());
      }
      //头像
      if (null!=user.getAvatar() && !user.getAvatar().equals("")) {
         user.setAvatar(FtpConfig.ip + user.getAvatar().substring(26));
@@ -662,9 +644,17 @@
      String s = "insert into blade_user(id,tenant_id,account,password,name,real_name,avatar,email,phone,sex,role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
         "politicaloutlook,healstats,height,address,registered,rtime,securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch) " +
         "values(" + "'" + user.getId() + "'" + "," + "'" + user.getTenantId() + "'" + "," + "'" + user.getAccount() + "'" + "," +
         "'" + user.getPassword() + "'" + "," + "'" + user.getName() + "'" + "," + "'" + user.getRealName() + "'" + "," + "'" + user.getAvatar() + "'" + "," +
         "'" + user.getEmail() + "'" + "," + "'" + user.getPhone() + "'" + "," + "'" + user.getSex() + "'" + "," + "'" + user.getRoleId() + "'" +
         "values(" + "'" + user.getId() + "'" +
         "," + "'" + user.getTenantId() + "'" +
         "," + "'" + user.getAccount() + "'" +
         "," + "'" + user.getPassword() + "'" +
         "," + "'" + user.getName() + "'" +
         "," + "'" + user.getRealName() + "'" +
         "," + "'" + user.getAvatar() + "'" +
         "," + "'" + user.getEmail() + "'" +
         "," + "'" + user.getPhone() + "'" +
         "," + "'" + user.getSex() + "'" +
         "," + "'" + user.getRoleId() + "'" +
         "," + "'" + user.getDeptId() + "'" +
         "," + "'" + user.getCardid() + "'" +
         "," + "'" + user.getNativeplace() + "'" +