| | |
| | | } |
| | | informationService.save(information); |
| | | String formatStr = new SimpleDateFormat("yyyy-MM-dd").format(information.getEstablishtime()); |
| | | Integer isDeleted = 0; |
| | | //Integer id = information.getId(); |
| | | String s = "insert into sys_information(id,creditCode,enterpriseName,representative,establishTime," + |
| | | "registeredCapital,organizationCode,registrationNumber, enterprises, address," + |
| | |
| | | information.getRegion() + "'" + "," + "'" + information.getRegistration() + "'" + "," + "'" + information.getIndustry() + "'" + "," + "'" + information.getDepartmentid() + "'" + "," + |
| | | "'" + information.getStats() + "'" + "," + "'" + information.getJurisdiction() + "'" + "," + "'" + information.getRepresentativecell() + "'" + "," + |
| | | "'" + information.getContacts() + "'" + "," + "'" + information.getContactscell() + "'" + ");" + |
| | | "insert into blade_dept(id,parent_id,tenant_id,dept_name,ancestors,dept_category) values(" + "'" + information.getDepartmentid() + "'" + "," + "'" + dept.getParentId() + "'" + "," |
| | | + "'" + dept.getTenantId() + "'" + "," + "'" + information.getEnterprisename() + "'" + "," + "'" + dept.getAncestors() + "'" + "," + "'" + dept.getDeptCategory() + "'" + ")"; |
| | | "insert into blade_dept(id,parent_id,tenant_id,dept_name,ancestors,dept_category,is_deleted) values(" + "'" + information.getDepartmentid() + "'" + "," + "'" + dept.getParentId() + "'" + "," |
| | | + "'" + dept.getTenantId() + "'" + |
| | | "," + "'" + information.getEnterprisename() + "'" + |
| | | "," + "'" + dept.getAncestors() + "'" + |
| | | "," + "'" + dept.getDeptCategory() + "'" + |
| | | "," + "'" + isDeleted + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | return R.success("成功"); |
| | | } |
| | |
| | | import org.springblade.modules.system.vo.DeptVO; |
| | | import org.springblade.modules.system.vo.UserVO; |
| | | import org.springblade.modules.system.wrapper.UserWrapper; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; |
| | | import static org.springblade.core.cache.constant.CacheConstant.USER_CACHE; |
| | |
| | | @ApiOperation(value = "修改", notes = "传入User") |
| | | public R update(@Valid @RequestBody User user) { |
| | | CacheUtil.clear(USER_CACHE); |
| | | User user1 = userService.getById(user.getId()); |
| | | user.setPassword(user1.getPassword()); |
| | | userService.updateById(user); |
| | | Date birthday1 = user.getBirthday(); |
| | | String birthday; |
| | |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R remove(@RequestParam String ids) { |
| | | CacheUtil.clear(USER_CACHE); |
| | | List<String> list = Arrays.asList(ids.split(",")); |
| | | list.forEach(id -> { |
| | | //内网同步 |
| | | String s1 = "update blade_user set is_deleted = 1 where id = " + "'" + id + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | }); |
| | | return R.status(userService.removeUser(ids)); |
| | | } |
| | | |
| | |
| | | * 保安员新增 |
| | | */ |
| | | @PostMapping("/securitySave") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R securitySave(@Valid @RequestBody Map<String, Object> userMap) { |
| | | //获取user |
| | | User user = JSON.parseObject(JSON.toJSONString(userMap.get("user")), User.class); |
| | |
| | | Role oneRole = roleService.getOne(Condition.getQueryWrapper(role)); |
| | | user.setRoleId(oneRole.getId().toString()); |
| | | user.setDispatch("1"); |
| | | user.setExaminationType("0"); |
| | | |
| | | Integer userCount = userService.selectCount(user.getAccount()); |
| | | if (userCount > 0 && Func.isEmpty(user.getId())) { |
| | |
| | | } else { |
| | | rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime()); |
| | | } |
| | | String urla = ""; |
| | | String[] split = user.getAvatar().split(","); |
| | | for (int i = 0; i < split.length; i++) { |
| | | String s = split[i].substring(26, split[i].length()); |
| | | urla += FtpConfig.ip + s + ","; |
| | | } |
| | | String substring = urla.substring(0, urla.length() - 1); |
| | | user.setAvatar(substring); |
| | | |
| | | String urlf = ""; |
| | | String[] splits = user.getFingerprint().split(","); |
| | | for (int i = 0; i < splits.length; i++) { |
| | | String s = splits[i].substring(26, splits[i].length()); |
| | | urlf += FtpConfig.ip + s + ","; |
| | | //头像 |
| | | if (null!=user.getAvatar() && !user.getAvatar().equals("")) { |
| | | user.setAvatar(FtpConfig.ip + user.getAvatar().substring(26)); |
| | | } |
| | | String substrings = urla.substring(0, urlf.length() - 1); |
| | | user.setFingerprint(substrings); |
| | | |
| | | //指纹 |
| | | if (null!=user.getFingerprint() && !user.getFingerprint().equals("")) { |
| | | user.setFingerprint(FtpConfig.ip + user.getFingerprint().substring(26)); |
| | | } |
| | | |
| | | 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,status,is_deleted,dispatch) " + |
| | | "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() + "'" + |
| | |
| | | + "," + "'" + user.getHeight() + "'" + |
| | | "," + "'" + user.getAddress() + "'" + |
| | | "," + "'" + user.getRegistered() + "'" + "," + |
| | | "'" + rtime + "'" + "," + "'" + user.getSecuritynumber() + "'" + |
| | | "'" + rtime + "'" + |
| | | "," + "'" + user.getSecuritynumber() + "'" + |
| | | "," + "'" + user.getHold() + "'" + |
| | | "," + "'" + user.getJurisdiction() + "'" + |
| | | "," + "'" + user.getExaminationType() + "'" + |
| | | "," + "'" + user.getStatus() + "'" + |
| | | "," + "'" + user.getIsDeleted() + "'" + |
| | | "," + "'" + user.getDispatch() + "'" + ")"; |
| | |
| | | */ |
| | | @SqlParser(filter = true) |
| | | List<String> getDeptName(@Param("deptId") String deptId); |
| | | |
| | | /** |
| | | * 查询用户表中未删除,未离职的用户信息 |
| | | * @param username |
| | | * @return |
| | | */ |
| | | User getUserInfo(@Param("account") String username); |
| | | } |
| | |
| | | select dept_name from blade_dept where id = (select parent_id from blade_dept where id= #{deptId} and 1=1) |
| | | ) |
| | | </select> |
| | | |
| | | <!--查询用户表中未删除,未离职的用户信息--> |
| | | <select id="getUserInfo" resultType="org.springblade.modules.system.entity.User"> |
| | | select id,account from blade_user |
| | | where account = #{account} |
| | | and is_deleted = 0 |
| | | and status = 1 |
| | | </select> |
| | | </mapper> |
| | |
| | | import org.springblade.modules.system.excel.UserExcel; |
| | | import org.springblade.modules.system.node.TreeNode; |
| | | import org.springblade.modules.system.vo.UserVO; |
| | | import org.springblade.modules.zc.entity.Zc; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @return |
| | | */ |
| | | Integer selectCount(String account); |
| | | |
| | | /** |
| | | * 查询用户表中未删除,未离职的用户信息 |
| | | * @param username |
| | | * @return |
| | | */ |
| | | User getUserInfo(String username); |
| | | } |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean updateUser(User user) { |
| | | String tenantId = user.getTenantId(); |
| | | Integer userCount = baseMapper.selectCount( |
| | | Wrappers.<User>query().lambda() |
| | | .eq(User::getTenantId, tenantId) |
| | | .eq(User::getAccount, user.getAccount()) |
| | | .notIn(User::getId, user.getId()) |
| | | ); |
| | | if (userCount > 0) { |
| | | throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount())); |
| | | } |
| | | // String tenantId = user.getTenantId(); |
| | | // Integer userCount = baseMapper.selectCount( |
| | | // Wrappers.<User>query().lambda() |
| | | // .eq(User::getTenantId, tenantId) |
| | | // .eq(User::getAccount, user.getAccount()) |
| | | // .notIn(User::getId, user.getId()) |
| | | // ); |
| | | // if (userCount > 0) { |
| | | // throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount())); |
| | | // } |
| | | return updateUserInfo(user) && submitUserDept(user); |
| | | } |
| | | |
| | |
| | | public Integer selectCount(String account) { |
| | | return baseMapper.selectCountAccount(account); |
| | | } |
| | | |
| | | /** |
| | | * 查询用户表中未删除,未离职的用户信息 |
| | | * @param username |
| | | * @return |
| | | */ |
| | | @Override |
| | | public User getUserInfo(String username) { |
| | | return baseMapper.getUserInfo(username); |
| | | } |
| | | } |
| | |
| | | user.setHold("2"); |
| | | user.setDispatch("1"); |
| | | user.setStatus(1); |
| | | user.setExaminationType("0"); |
| | | user.setIsDeleted(0); |
| | | iUserService.save(user); |
| | | |
| | | //内网数据同步 |
| | | String rtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); |
| | | String s = "insert into blade_user(id,tenant_id,account,password,real_name,role_id,dept_id,create_time,status,is_deleted,cardid,hold,dispatch) " + |
| | | String s = "insert into blade_user(id,tenant_id,account,password,real_name,role_id,dept_id,create_time,status,is_deleted,cardid,hold,examination_type,dispatch) " + |
| | | "values(" + "'" + user.getId() + "'" + |
| | | "," + "'" + user.getTenantId() + "'" + |
| | | "," + "'" + user.getAccount() + "'" + |
| | |
| | | "," + "'" + user.getIsDeleted() + "'" + |
| | | "," + "'" + user.getCardid() + "'" + |
| | | "," + "'" + user.getHold() + "'" + |
| | | "," + "'" + user.getExaminationType() + "'" + |
| | | "," + "'" + user.getDispatch() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | |
| | |
| | | @PostMapping("/inster") |
| | | @ApiOperation(value = "新增", notes = "传入zc") |
| | | public R inster(@Valid @RequestBody Zc zc) { |
| | | //获取用户名,判断该用户名是否已注册,或已有用户 |
| | | //查询注册表中是否有相同的注册信息 |
| | | Zc zc1 = zcService.getAuditSuccessInfo(zc.getUsername()); |
| | | if (null!=zc1){ |
| | | throw new com.aliyun.oss.ServiceException(StringUtil.format("当前用户名 [{}] 已被注册!", zc.getUsername())); |
| | | } |
| | | //查询用户表中未删除,未离职的用户信息 |
| | | User user = iUserService.getUserInfo(zc.getUsername()); |
| | | if (null!=user){ |
| | | throw new com.aliyun.oss.ServiceException(StringUtil.format("当前用户名 [{}] 已被注册!", zc.getUsername())); |
| | | } |
| | | //当前时间 |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String times = df.format(new Date()); |
| | |
| | | List<ZcVO> selectZcPage(IPage page, ZcVO zc); |
| | | |
| | | void inster(Zc zc); |
| | | |
| | | /** |
| | | * 根据用户名查询带审核和审核未通过的用户注册信息 |
| | | * @param username |
| | | * @return |
| | | */ |
| | | String selectType(String username); |
| | | |
| | | /** |
| | | * 查询注册审核通过的用户信息 |
| | | * @param username |
| | | * @return |
| | | */ |
| | | Zc getAuditSuccessInfo(String username); |
| | | } |
| | |
| | | values (#{username}, #{password}, #{sname}, #{cardid}, #{zctime}, #{deptid}) |
| | | </insert> |
| | | |
| | | <!--根据用户名用户注册信息--> |
| | | <select id="selectType" resultType="String"> |
| | | select type |
| | | from act_zc |
| | | where username = #{param1} |
| | | </select> |
| | | |
| | | <!--根据用户名查询注册用户注册信息--> |
| | | <select id="getAuditSuccessInfo" resultType="org.springblade.modules.zc.entity.Zc"> |
| | | select * from act_zc |
| | | where username = #{param1} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | */ |
| | | IPage<ZcVO> selectZcPage(IPage<ZcVO> page, ZcVO zc); |
| | | void inster(Zc zc); |
| | | |
| | | String selectType(String username); |
| | | |
| | | /** |
| | | * 查询注册审核通过的用户信息 |
| | | * @param username |
| | | * @return |
| | | */ |
| | | Zc getAuditSuccessInfo(String username); |
| | | } |
| | |
| | | return baseMapper.selectType(username); |
| | | } |
| | | |
| | | /** |
| | | * 查询注册审核通过的用户信息 |
| | | * @param username |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Zc getAuditSuccessInfo(String username) { |
| | | return baseMapper.getAuditSuccessInfo(username); |
| | | } |
| | | } |