Compare commits
No commits in common. "8f2feca49bf747a422ffd1e51c2f60b3f2e3a683" and "937f2f4c097075227b4326edc6d2a2e35760f112" have entirely different histories.
8f2feca49b
...
937f2f4c09
|
@ -2,8 +2,11 @@ package com.changhu.common.db;
|
|||
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.annotation.IEnum;
|
||||
import com.changhu.common.exception.MessageException;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* author: luozhun
|
||||
* desc: BaseEnum
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package com.changhu.common.db.enums;
|
||||
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import com.baomidou.mybatisplus.annotation.IEnum;
|
||||
import com.changhu.common.annotation.IsExtData;
|
||||
import com.changhu.common.db.BaseEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
@ -16,21 +14,10 @@ import lombok.Getter;
|
|||
@AllArgsConstructor
|
||||
public enum CheckStatus implements BaseEnum<Integer>, IEnum<Integer> {
|
||||
|
||||
checked(0, "已审核", "success"),
|
||||
unChecked(1, "未审核", "error"),
|
||||
checked(0, "已审核"),
|
||||
unChecked(1, "未审核"),
|
||||
;
|
||||
|
||||
private final Integer value;
|
||||
private final String label;
|
||||
@IsExtData
|
||||
private final String color;
|
||||
|
||||
@Override
|
||||
public Object serializer() {
|
||||
return Dict.of(
|
||||
"value", this.getValue(),
|
||||
"label", this.getLabel(),
|
||||
"extData", Dict.of("color", this.color)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.changhu.common.db.enums;
|
||||
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import com.changhu.common.db.BaseEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.changhu.common.db.enums;
|
||||
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import com.baomidou.mybatisplus.annotation.IEnum;
|
||||
import com.changhu.common.annotation.IsExtData;
|
||||
import com.changhu.common.db.BaseEnum;
|
||||
|
@ -25,12 +24,4 @@ public enum IsEnable implements BaseEnum<Integer>, IEnum<Integer> {
|
|||
@IsExtData
|
||||
private final String color;
|
||||
|
||||
@Override
|
||||
public Object serializer() {
|
||||
return Dict.of(
|
||||
"value", this.getValue(),
|
||||
"label", this.getLabel(),
|
||||
"extData", Dict.of("color", this.color)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
package com.changhu.common.db.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IEnum;
|
||||
import com.changhu.common.db.BaseEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
@ -12,7 +11,7 @@ import lombok.Getter;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum IsOrNot implements BaseEnum<Integer>, IEnum<Integer> {
|
||||
public enum IsOrNot implements BaseEnum<Integer> {
|
||||
IS(0, "是"),
|
||||
NOT(1, "否"),
|
||||
;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.changhu.common.db.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IEnum;
|
||||
import com.changhu.common.db.BaseEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
@ -13,7 +12,7 @@ import lombok.Getter;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum Sex implements BaseEnum<Integer>, IEnum<Integer> {
|
||||
public enum Sex implements BaseEnum<Integer> {
|
||||
MAN(0, "男"),
|
||||
WOMAN(1, "女"),
|
||||
UNKNOWN(2, "隐藏");
|
||||
|
|
|
@ -13,10 +13,7 @@ import lombok.NoArgsConstructor;
|
|||
import org.springframework.lang.NonNull;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.changhu.common.validator;
|
|||
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.changhu.common.utils.ValidatorUtil;
|
||||
import com.changhu.common.validator.annotation.IsMobile;
|
||||
import jakarta.validation.ConstraintValidator;
|
||||
import jakarta.validation.ConstraintValidatorContext;
|
||||
|
|
|
@ -8,7 +8,12 @@ import java.lang.annotation.Documented;
|
|||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
|
||||
import static java.lang.annotation.ElementType.CONSTRUCTOR;
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.ElementType.PARAMETER;
|
||||
import static java.lang.annotation.ElementType.TYPE_USE;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,14 +23,11 @@ public class WebConfig implements WebMvcConfigurer {
|
|||
private final List<String> whiteList = new ArrayList<>();
|
||||
|
||||
public WebConfig() {
|
||||
//todo 要删除的
|
||||
whiteList.add("/managementSuperUser/**");
|
||||
|
||||
whiteList.add("/common/**");
|
||||
whiteList.add("/test/**");
|
||||
whiteList.add("/login");
|
||||
whiteList.add("/logout");
|
||||
whiteList.add("/management/getCheckStatus");
|
||||
whiteList.add("/favicon.ico");
|
||||
//druid console
|
||||
whiteList.add("/druid/**");
|
||||
|
|
|
@ -20,6 +20,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.changhu.enums.handler;
|
|||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.changhu.common.pojo.vo.TokenInfo;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
package com.changhu.module.management.controller;
|
||||
|
||||
import com.changhu.common.annotation.JsonBody;
|
||||
import com.changhu.module.management.pojo.params.IndexCheckPassParams;
|
||||
import com.changhu.module.management.pojo.params.IndexCheckStatusParams;
|
||||
import com.changhu.module.management.pojo.vo.UnitCheckStatusVo;
|
||||
import com.changhu.module.management.service.IndexService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
* @createTime 2024/9/2 上午9:48
|
||||
* @desc IndexController...
|
||||
*/
|
||||
@Tag(name = "后台-通用接口")
|
||||
@JsonBody
|
||||
@RequestMapping("/management")
|
||||
public class IndexController {
|
||||
|
||||
@Autowired
|
||||
private IndexService indexService;
|
||||
|
||||
@Operation(summary = "审核通过")
|
||||
@PostMapping("/checkPass")
|
||||
public void checkPass(@RequestBody @Valid IndexCheckPassParams params) {
|
||||
indexService.checkPass(params);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取审核状态")
|
||||
@PostMapping("/getCheckStatus")
|
||||
public UnitCheckStatusVo getCheckStatus(@RequestBody @Valid IndexCheckStatusParams params) {
|
||||
return indexService.getCheckStatus(params);
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ package com.changhu.module.management.controller;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.changhu.common.annotation.JsonBody;
|
||||
import com.changhu.common.utils.JavaClassToTsUtil;
|
||||
import com.changhu.module.management.pojo.queryParams.PoliceUnitPagerQueryParams;
|
||||
import com.changhu.module.management.pojo.vo.PoliceUnitPagerVo;
|
||||
import com.changhu.module.management.service.PoliceUnitService;
|
||||
|
@ -32,4 +33,7 @@ public class PoliceUnitController {
|
|||
return policeUnitService.pager(queryParams);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(JavaClassToTsUtil.parse(PoliceUnitPagerVo.class));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,5 +39,4 @@ public class SecurityUnitController {
|
|||
public void saveOrUpdate(@RequestBody @Valid SecurityUnitSaveOrUpdateParams params) {
|
||||
securityUnitService.saveOrUpdate(params);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
package com.changhu.module.management.enums;
|
||||
|
||||
import com.changhu.module.management.enums.handler.AbstractUnitTypeHandler;
|
||||
import com.changhu.module.management.enums.handler.PoliceUnitTypeHandler;
|
||||
import com.changhu.module.management.enums.handler.SecurityUnitTypeHandler;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
* @createTime 2024/9/2 上午9:51
|
||||
* @desc IndexCheckPass...
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum UnitOptType {
|
||||
|
||||
SECURITY_UNIT(new SecurityUnitTypeHandler()),
|
||||
POLICE_UNIT(new PoliceUnitTypeHandler());
|
||||
|
||||
private final AbstractUnitTypeHandler handler;
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package com.changhu.module.management.enums.handler;
|
||||
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.changhu.module.management.pojo.vo.UnitCheckStatusVo;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
* @createTime 2024/9/2 上午9:53
|
||||
* @desc AbstractCheckPassHandler...
|
||||
*/
|
||||
public abstract class AbstractUnitTypeHandler {
|
||||
|
||||
final PlatformTransactionManager transactionManager = SpringUtil.getBean(PlatformTransactionManager.class);
|
||||
|
||||
/**
|
||||
* 通过
|
||||
*/
|
||||
public abstract void pass(Long checkDataId);
|
||||
|
||||
/**
|
||||
* 获取审核状态
|
||||
*
|
||||
* @param onlyCode 唯一代码
|
||||
* @return 审核状态
|
||||
*/
|
||||
public abstract UnitCheckStatusVo getCheckStatus(String onlyCode);
|
||||
}
|
|
@ -1,106 +0,0 @@
|
|||
package com.changhu.module.management.enums.handler;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.changhu.common.db.enums.CheckStatus;
|
||||
import com.changhu.common.db.enums.IsOrNot;
|
||||
import com.changhu.common.db.enums.Sex;
|
||||
import com.changhu.common.enums.ResultCode;
|
||||
import com.changhu.common.exception.MessageException;
|
||||
import com.changhu.common.utils.UserUtil;
|
||||
import com.changhu.module.management.pojo.entity.ManagementPoliceUnitUser;
|
||||
import com.changhu.module.management.pojo.entity.PoliceUnit;
|
||||
import com.changhu.module.management.pojo.vo.UnitCheckStatusVo;
|
||||
import com.changhu.module.management.service.ManagementPoliceUnitUserService;
|
||||
import com.changhu.module.management.service.PoliceUnitService;
|
||||
import com.changhu.support.mybatisplus.pojo.entity.BaseEntity;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.transaction.TransactionStatus;
|
||||
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
* @createTime 2024/9/2 上午11:03
|
||||
* @desc PoliceUnitTypeHandler...
|
||||
*/
|
||||
@Slf4j
|
||||
public class PoliceUnitTypeHandler extends AbstractUnitTypeHandler {
|
||||
|
||||
private final PoliceUnitService policeUnitService = SpringUtil.getBean(PoliceUnitService.class);
|
||||
|
||||
private final ManagementPoliceUnitUserService policeUnitUserService = SpringUtil.getBean(ManagementPoliceUnitUserService.class);
|
||||
|
||||
@Override
|
||||
|
||||
public void pass(Long checkDataId) {
|
||||
DefaultTransactionDefinition def = new DefaultTransactionDefinition();
|
||||
TransactionStatus status = transactionManager.getTransaction(def);
|
||||
|
||||
try {
|
||||
PoliceUnit policeUnit = policeUnitService.getOptById(checkDataId).orElseThrow(() -> new MessageException(ResultCode.DATA_NOT_FOUND));
|
||||
//更新状态
|
||||
boolean update = policeUnitService.lambdaUpdate()
|
||||
.set(PoliceUnit::getCheckStatus, CheckStatus.checked)
|
||||
.eq(BaseEntity::getSnowFlakeId, checkDataId)
|
||||
.update();
|
||||
if (!update) {
|
||||
throw new MessageException(ResultCode.ERROR);
|
||||
}
|
||||
//生成管理员账号密码
|
||||
String passWordEncrypt = UserUtil.passWordEncrypt(UserUtil.DEFAULT_PASSWORD);
|
||||
List<String> saltAndPassWord = StrUtil.split(passWordEncrypt, "$$");
|
||||
|
||||
ManagementPoliceUnitUser managementPoliceUnitUser = new ManagementPoliceUnitUser();
|
||||
managementPoliceUnitUser.setPoliceUnitId(policeUnit.getSnowFlakeId());
|
||||
managementPoliceUnitUser.setName("超级管理员");
|
||||
managementPoliceUnitUser.setSex(Sex.UNKNOWN);
|
||||
managementPoliceUnitUser.setAccount(RandomUtil.randomString(6));
|
||||
managementPoliceUnitUser.setTelephone("");
|
||||
managementPoliceUnitUser.setSalt(saltAndPassWord.get(0));
|
||||
managementPoliceUnitUser.setPassword(saltAndPassWord.get(1));
|
||||
managementPoliceUnitUser.setIsAdmin(IsOrNot.IS);
|
||||
|
||||
boolean save = policeUnitUserService.save(managementPoliceUnitUser);
|
||||
if (!save) {
|
||||
throw new MessageException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
//提交事务
|
||||
transactionManager.commit(status);
|
||||
} catch (Exception e) {
|
||||
//回滚事务
|
||||
transactionManager.rollback(status);
|
||||
log.error("公安单位审核通过错误:{}", e.getMessage());
|
||||
throw new MessageException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public UnitCheckStatusVo getCheckStatus(String onlyCode) {
|
||||
PoliceUnit policeUnit = policeUnitService.lambdaQuery()
|
||||
.eq(PoliceUnit::getCode, onlyCode)
|
||||
.oneOpt()
|
||||
.orElseThrow(() -> new MessageException(ResultCode.DATA_NOT_FOUND));
|
||||
|
||||
UnitCheckStatusVo unitCheckStatusVo = new UnitCheckStatusVo();
|
||||
unitCheckStatusVo.setCheckStatus(policeUnit.getCheckStatus());
|
||||
|
||||
if (policeUnit.getCheckStatus().equals(CheckStatus.checked)) {
|
||||
ManagementPoliceUnitUser managementPoliceUnitUser = policeUnitUserService.lambdaQuery()
|
||||
.eq(ManagementPoliceUnitUser::getPoliceUnitId, policeUnit.getSnowFlakeId())
|
||||
.eq(ManagementPoliceUnitUser::getIsAdmin, IsOrNot.IS)
|
||||
.oneOpt()
|
||||
.orElseThrow(() -> new MessageException("超管账号未初始化 请联系管理员"));
|
||||
unitCheckStatusVo.setAccount(managementPoliceUnitUser.getAccount());
|
||||
unitCheckStatusVo.setRemark("恭喜!单位审核通过了,请使用管理员账号前往登录页进行登录.");
|
||||
} else {
|
||||
unitCheckStatusVo.setPassword(null);
|
||||
unitCheckStatusVo.setRemark("单位注册申请正在审核中...");
|
||||
}
|
||||
return unitCheckStatusVo;
|
||||
}
|
||||
}
|
|
@ -1,108 +0,0 @@
|
|||
package com.changhu.module.management.enums.handler;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.changhu.common.db.enums.CheckStatus;
|
||||
import com.changhu.common.db.enums.IsEnable;
|
||||
import com.changhu.common.db.enums.IsOrNot;
|
||||
import com.changhu.common.db.enums.Sex;
|
||||
import com.changhu.common.enums.ResultCode;
|
||||
import com.changhu.common.exception.MessageException;
|
||||
import com.changhu.common.utils.UserUtil;
|
||||
import com.changhu.module.management.pojo.entity.ManagementSecurityUnitUser;
|
||||
import com.changhu.module.management.pojo.entity.SecurityUnit;
|
||||
import com.changhu.module.management.pojo.vo.UnitCheckStatusVo;
|
||||
import com.changhu.module.management.service.ManagementSecurityUnitUserService;
|
||||
import com.changhu.module.management.service.SecurityUnitService;
|
||||
import com.changhu.support.mybatisplus.pojo.entity.BaseEntity;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.transaction.TransactionStatus;
|
||||
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
* @createTime 2024/9/2 上午9:55
|
||||
* @desc SecurityCheckPassHandler...
|
||||
*/
|
||||
@Slf4j
|
||||
public class SecurityUnitTypeHandler extends AbstractUnitTypeHandler {
|
||||
|
||||
private final SecurityUnitService securityUnitService = SpringUtil.getBean(SecurityUnitService.class);
|
||||
|
||||
private final ManagementSecurityUnitUserService securityUnitUserService = SpringUtil.getBean(ManagementSecurityUnitUserService.class);
|
||||
|
||||
@Override
|
||||
public void pass(Long checkDataId) {
|
||||
DefaultTransactionDefinition def = new DefaultTransactionDefinition();
|
||||
TransactionStatus status = transactionManager.getTransaction(def);
|
||||
|
||||
try {
|
||||
SecurityUnit securityUnit = securityUnitService.getOptById(checkDataId).orElseThrow(() -> new MessageException(ResultCode.DATA_NOT_FOUND));
|
||||
//更新状态
|
||||
boolean update = securityUnitService.lambdaUpdate()
|
||||
.set(SecurityUnit::getCheckStatus, CheckStatus.checked)
|
||||
.eq(BaseEntity::getSnowFlakeId, checkDataId)
|
||||
.update();
|
||||
if (!update) {
|
||||
throw new MessageException(ResultCode.ERROR);
|
||||
}
|
||||
//生成简单的超级管理员账号密码
|
||||
String passWordEncrypt = UserUtil.passWordEncrypt(UserUtil.DEFAULT_PASSWORD);
|
||||
List<String> saltAndPassWord = StrUtil.split(passWordEncrypt, "$$");
|
||||
|
||||
ManagementSecurityUnitUser managementSecurityUnitUser = new ManagementSecurityUnitUser();
|
||||
managementSecurityUnitUser.setSecurityUnitId(securityUnit.getSnowFlakeId());
|
||||
managementSecurityUnitUser.setName("超级管理员");
|
||||
managementSecurityUnitUser.setSex(Sex.UNKNOWN);
|
||||
managementSecurityUnitUser.setAccount(RandomUtil.randomString(6));
|
||||
managementSecurityUnitUser.setTelephone("");
|
||||
managementSecurityUnitUser.setSalt(saltAndPassWord.get(0));
|
||||
managementSecurityUnitUser.setPassword(saltAndPassWord.get(1));
|
||||
managementSecurityUnitUser.setIsEnable(IsEnable.TRUE);
|
||||
managementSecurityUnitUser.setIsAdmin(IsOrNot.IS);
|
||||
managementSecurityUnitUser.setRemark("单位审核通过 默认分配超管账号");
|
||||
boolean save = securityUnitUserService.save(managementSecurityUnitUser);
|
||||
if (!save) {
|
||||
throw new MessageException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
//提交事务
|
||||
transactionManager.commit(status);
|
||||
} catch (Exception e) {
|
||||
//回滚事务
|
||||
transactionManager.rollback(status);
|
||||
log.error("保安单位审核通过错误:{}", e.getMessage());
|
||||
throw new MessageException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public UnitCheckStatusVo getCheckStatus(String onlyCode) {
|
||||
SecurityUnit securityUnit = securityUnitService.lambdaQuery()
|
||||
.eq(SecurityUnit::getSocialCode, onlyCode)
|
||||
.oneOpt()
|
||||
.orElseThrow(() -> new MessageException(ResultCode.DATA_NOT_FOUND));
|
||||
|
||||
UnitCheckStatusVo unitCheckStatusVo = new UnitCheckStatusVo();
|
||||
unitCheckStatusVo.setCheckStatus(securityUnit.getCheckStatus());
|
||||
|
||||
if (securityUnit.getCheckStatus().equals(CheckStatus.checked)) {
|
||||
ManagementSecurityUnitUser managementSecurityUnitUser = securityUnitUserService.lambdaQuery()
|
||||
.eq(ManagementSecurityUnitUser::getSecurityUnitId, securityUnit.getSnowFlakeId())
|
||||
.eq(ManagementSecurityUnitUser::getIsAdmin, IsOrNot.IS)
|
||||
.oneOpt()
|
||||
.orElseThrow(() -> new MessageException("超管账号未初始化 请联系管理员"));
|
||||
unitCheckStatusVo.setAccount(managementSecurityUnitUser.getAccount());
|
||||
unitCheckStatusVo.setRemark("恭喜!单位审核通过了,请使用管理员账号前往登录页进行登录.");
|
||||
} else {
|
||||
unitCheckStatusVo.setPassword(null);
|
||||
unitCheckStatusVo.setRemark("单位注册申请正在审核中...");
|
||||
}
|
||||
|
||||
return unitCheckStatusVo;
|
||||
}
|
||||
|
||||
}
|
|
@ -10,6 +10,6 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
* desc 由groovy脚本自动生成
|
||||
*/
|
||||
@Mapper
|
||||
public interface ManagementPoliceUnitUserMapper extends BaseMapper<ManagementPoliceUnitUser> {
|
||||
public interface ManagementPoliceUserMapper extends BaseMapper<ManagementPoliceUnitUser> {
|
||||
|
||||
}
|
|
@ -1,6 +1,9 @@
|
|||
package com.changhu.module.management.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.changhu.module.management.pojo.entity.SecurityUnit;
|
||||
import com.changhu.module.management.pojo.queryParams.SecurityUnitPagerQueryParams;
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
package com.changhu.module.management.pojo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.changhu.common.db.enums.IsEnable;
|
||||
import com.changhu.common.db.enums.IsOrNot;
|
||||
import com.changhu.common.db.enums.Sex;
|
||||
import com.changhu.support.mybatisplus.pojo.entity.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -46,11 +46,6 @@ public class ManagementPoliceUnitUser extends BaseEntity implements Serializable
|
|||
*/
|
||||
private Sex sex;
|
||||
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
package com.changhu.module.management.pojo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.changhu.common.db.enums.IsEnable;
|
||||
import com.changhu.common.db.enums.IsOrNot;
|
||||
import com.changhu.common.db.enums.Sex;
|
||||
import com.changhu.support.mybatisplus.pojo.entity.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -46,11 +46,6 @@ public class ManagementSecurityUnitUser extends BaseEntity implements Serializab
|
|||
*/
|
||||
private Sex sex;
|
||||
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
package com.changhu.module.management.pojo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.changhu.common.db.enums.IsEnable;
|
||||
import com.changhu.support.mybatisplus.pojo.entity.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.changhu.common.db.enums.IsEnable;
|
||||
import com.changhu.support.mybatisplus.pojo.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
|
||||
/**
|
||||
* 后台-超级后台 实体类
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
package com.changhu.module.management.pojo.entity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler;
|
||||
import com.changhu.common.db.enums.CheckStatus;
|
||||
import com.changhu.common.db.enums.IsEnable;
|
||||
import com.changhu.module.management.pojo.model.ContactPersonInfo;
|
||||
import com.changhu.support.mybatisplus.pojo.entity.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
package com.changhu.module.management.pojo.entity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler;
|
||||
import com.changhu.common.db.enums.CheckStatus;
|
||||
import com.changhu.common.db.enums.IsEnable;
|
||||
import com.changhu.module.management.pojo.model.LegalPersonInfo;
|
||||
import com.changhu.support.mybatisplus.pojo.entity.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
package com.changhu.module.management.pojo.params;
|
||||
|
||||
import com.changhu.module.management.enums.UnitOptType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
* @createTime 2024/9/2 上午9:59
|
||||
* @desc IndexCheckPassParams...
|
||||
*/
|
||||
@Data
|
||||
public class IndexCheckPassParams {
|
||||
@Schema(description = "审核数据的id")
|
||||
@NotNull(message = "审核数据的id不能为空")
|
||||
private Long checkDataId;
|
||||
|
||||
@Schema(description = "单位类型")
|
||||
@NotNull(message = "单位类型不能为空")
|
||||
private UnitOptType unitOptType;
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package com.changhu.module.management.pojo.params;
|
||||
|
||||
import com.changhu.module.management.enums.UnitOptType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
* @createTime 2024/9/2 上午10:51
|
||||
* @desc IndexCheckStatusParams...
|
||||
*/
|
||||
@Data
|
||||
public class IndexCheckStatusParams {
|
||||
|
||||
@Schema(description = "审核数据的唯一标识")
|
||||
@NotNull(message = "唯一标识不能为空")
|
||||
private String onlyCode;
|
||||
|
||||
@Schema(description = "单位类型")
|
||||
@NotNull(message = "单位类型不能为空")
|
||||
private UnitOptType unitOptType;
|
||||
}
|
|
@ -1,6 +1,10 @@
|
|||
package com.changhu.module.management.pojo.params;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler;
|
||||
import com.changhu.common.db.enums.CheckStatus;
|
||||
import com.changhu.common.db.enums.IsEnable;
|
||||
import com.changhu.common.validator.annotation.IsMobile;
|
||||
import com.changhu.module.management.pojo.model.LegalPersonInfo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
|
|
@ -4,7 +4,6 @@ import com.changhu.common.db.enums.CheckStatus;
|
|||
import com.changhu.common.db.enums.IsEnable;
|
||||
import com.changhu.module.management.pojo.model.ContactPersonInfo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
@ -13,7 +12,6 @@ import java.time.LocalDateTime;
|
|||
* @createTime 2024/8/30 下午3:55
|
||||
* @desc PoliceUnitPagerVo...
|
||||
*/
|
||||
@Data
|
||||
public class PoliceUnitPagerVo {
|
||||
|
||||
@Schema(description = "id")
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
package com.changhu.module.management.pojo.vo;
|
||||
|
||||
import com.changhu.common.db.enums.CheckStatus;
|
||||
import com.changhu.common.utils.UserUtil;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
* @createTime 2024/9/2 上午10:42
|
||||
* @desc SecurityUnitCheckStatusVo...
|
||||
*/
|
||||
@Data
|
||||
public class UnitCheckStatusVo {
|
||||
|
||||
private CheckStatus checkStatus;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String account;
|
||||
|
||||
private String password = UserUtil.DEFAULT_PASSWORD;
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package com.changhu.module.management.service;
|
||||
|
||||
import com.changhu.module.management.pojo.params.IndexCheckPassParams;
|
||||
import com.changhu.module.management.pojo.params.IndexCheckStatusParams;
|
||||
import com.changhu.module.management.pojo.vo.UnitCheckStatusVo;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
* @createTime 2024/9/2 上午9:49
|
||||
* @desc IndexService...
|
||||
*/
|
||||
public interface IndexService {
|
||||
|
||||
/**
|
||||
* 审核通过
|
||||
*
|
||||
* @param params 审核参数
|
||||
*/
|
||||
void checkPass(IndexCheckPassParams params);
|
||||
|
||||
/**
|
||||
* 获取审核状态
|
||||
*
|
||||
* @param params 参数
|
||||
* @return 结果
|
||||
*/
|
||||
UnitCheckStatusVo getCheckStatus(IndexCheckStatusParams params);
|
||||
}
|
|
@ -8,6 +8,6 @@ import com.changhu.module.management.pojo.entity.ManagementPoliceUnitUser;
|
|||
* author: luozhun
|
||||
* desc 由groovy脚本自动生成
|
||||
*/
|
||||
public interface ManagementPoliceUnitUserService extends IService<ManagementPoliceUnitUser> {
|
||||
public interface ManagementPoliceUserService extends IService<ManagementPoliceUnitUser> {
|
||||
|
||||
}
|
|
@ -29,5 +29,4 @@ public interface SecurityUnitService extends IService<SecurityUnit> {
|
|||
* @param params 参数
|
||||
*/
|
||||
void saveOrUpdate(SecurityUnitSaveOrUpdateParams params);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
package com.changhu.module.management.service.impl;
|
||||
|
||||
import com.changhu.module.management.pojo.params.IndexCheckPassParams;
|
||||
import com.changhu.module.management.pojo.params.IndexCheckStatusParams;
|
||||
import com.changhu.module.management.pojo.vo.UnitCheckStatusVo;
|
||||
import com.changhu.module.management.service.IndexService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author 20252
|
||||
* @createTime 2024/9/2 上午9:49
|
||||
* @desc IndexServiceImpl...
|
||||
*/
|
||||
@Service
|
||||
public class IndexServiceImpl implements IndexService {
|
||||
@Override
|
||||
public void checkPass(IndexCheckPassParams params) {
|
||||
params.getUnitOptType()
|
||||
.getHandler()
|
||||
.pass(params.getCheckDataId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public UnitCheckStatusVo getCheckStatus(IndexCheckStatusParams params) {
|
||||
return params.getUnitOptType()
|
||||
.getHandler()
|
||||
.getCheckStatus(params.getOnlyCode());
|
||||
}
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
package com.changhu.module.management.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.changhu.module.management.mapper.ManagementPoliceUnitUserMapper;
|
||||
import com.changhu.module.management.mapper.ManagementPoliceUserMapper;
|
||||
import com.changhu.module.management.pojo.entity.ManagementPoliceUnitUser;
|
||||
import com.changhu.module.management.service.ManagementPoliceUnitUserService;
|
||||
import com.changhu.module.management.service.ManagementPoliceUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
|
@ -12,6 +12,6 @@ import org.springframework.stereotype.Service;
|
|||
* desc 由groovy脚本自动生成
|
||||
*/
|
||||
@Service
|
||||
public class ManagementPoliceUnitUserServiceImpl extends ServiceImpl<ManagementPoliceUnitUserMapper, ManagementPoliceUnitUser> implements ManagementPoliceUnitUserService {
|
||||
public class ManagementPoliceUserServiceImpl extends ServiceImpl<ManagementPoliceUserMapper, ManagementPoliceUnitUser> implements ManagementPoliceUserService {
|
||||
|
||||
}
|
|
@ -1,18 +1,28 @@
|
|||
package com.changhu.module.management.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.changhu.common.utils.JavaClassToTsUtil;
|
||||
import com.changhu.module.management.pojo.model.LegalPersonInfo;
|
||||
import com.changhu.module.management.pojo.params.SecurityUnitSaveOrUpdateParams;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.changhu.common.db.enums.IsEnable;
|
||||
import com.changhu.common.db.enums.CheckStatus;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.changhu.common.utils.JavaClassToTsUtil;
|
||||
import com.changhu.module.management.mapper.SecurityUnitMapper;
|
||||
import com.changhu.module.management.pojo.entity.SecurityUnit;
|
||||
import com.changhu.module.management.pojo.params.SecurityUnitSaveOrUpdateParams;
|
||||
import com.changhu.module.management.pojo.queryParams.SecurityUnitPagerQueryParams;
|
||||
import com.changhu.module.management.pojo.vo.SecurityUnitPagerVo;
|
||||
import com.changhu.module.management.service.SecurityUnitService;
|
||||
import com.changhu.support.mybatisplus.pojo.params.PageParams;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
|
@ -25,7 +35,27 @@ public class SecurityUnitServiceImpl extends ServiceImpl<SecurityUnitMapper, Sec
|
|||
|
||||
@Override
|
||||
public Page<SecurityUnitPagerVo> pager(PageParams<SecurityUnitPagerQueryParams, SecurityUnitPagerVo> queryParams) {
|
||||
return baseMapper.pager(queryParams.getPage(), queryParams.getParams());
|
||||
Page<SecurityUnitPagerVo> page = queryParams.getPage();
|
||||
SecurityUnitPagerQueryParams params = queryParams.getParams();
|
||||
LambdaQueryWrapper<SecurityUnit> wrapper = Wrappers.<SecurityUnit>lambdaQuery()
|
||||
.like(StrUtil.isNotEmpty(params.getName()), SecurityUnit::getName, params.getName())
|
||||
.like(StrUtil.isNotEmpty(params.getSocialCode()), SecurityUnit::getSocialCode, params.getSocialCode());
|
||||
|
||||
if (params.getCheckStatus() != null) {
|
||||
wrapper.eq(SecurityUnit::getCheckStatus, params.getCheckStatus().getValue());
|
||||
}
|
||||
if (params.getIsEnable() != null) {
|
||||
wrapper.eq(SecurityUnit::getIsEnable, params.getIsEnable().getValue());
|
||||
}
|
||||
|
||||
List<String> administrativeDivisionCodes = params.getAdministrativeDivisionCodes();
|
||||
if (administrativeDivisionCodes != null) {
|
||||
wrapper.eq(!administrativeDivisionCodes.isEmpty(), SecurityUnit::getProvince, administrativeDivisionCodes.get(0));
|
||||
wrapper.eq(administrativeDivisionCodes.size() >= 2, SecurityUnit::getCity, administrativeDivisionCodes.get(1));
|
||||
wrapper.eq(administrativeDivisionCodes.size() >= 3, SecurityUnit::getDistricts, administrativeDivisionCodes.get(2));
|
||||
wrapper.eq(administrativeDivisionCodes.size() >= 4, SecurityUnit::getStreet, administrativeDivisionCodes.get(3));
|
||||
}
|
||||
return baseMapper.pager(page, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package com.changhu.pojo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.changhu.support.mybatisplus.pojo.entity.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.changhu.support.mybatisplus.pojo.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
|
||||
/**
|
||||
* 全国行政区划表(2023/12/04) 实体类
|
||||
|
|
|
@ -2,8 +2,10 @@ package com.changhu.pojo.params;
|
|||
|
||||
import com.changhu.module.management.pojo.model.LegalPersonInfo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.changhu.service.impl;
|
|||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.toolkit.Db;
|
||||
import com.changhu.common.enums.ResultCode;
|
||||
import com.changhu.common.exception.MessageException;
|
||||
import com.changhu.common.pojo.model.JsonResult;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.changhu.service.impl;
|
||||
|
||||
import com.changhu.common.pojo.vo.TokenInfo;
|
||||
import com.changhu.enums.ClientType;
|
||||
import com.changhu.enums.handler.AbstractLoginHandler;
|
||||
import com.changhu.pojo.params.LoginParams;
|
||||
import com.changhu.service.LoginService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.changhu.common.annotation.Desensitized;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.changhu.support.mybatisplus.pojo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.changhu.common.db.enums.DeleteFlag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.changhu.support.ws.manager;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.changhu.support.ws.enums.WsMsgType;
|
||||
import com.changhu.support.ws.pojo.dto.WsMsgDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.socket.TextMessage;
|
||||
|
@ -8,6 +9,7 @@ import org.springframework.web.socket.WebSocketSession;
|
|||
import org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
|
|
@ -9,6 +9,8 @@ import com.changhu.support.ws.manager.UserConnectWebsocketManager;
|
|||
import com.changhu.support.ws.pojo.dto.WsMsgDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.socket.CloseStatus;
|
||||
import org.springframework.web.socket.TextMessage;
|
||||
|
|
|
@ -1,43 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.changhu.module.management.mapper.PoliceUnitMapper">
|
||||
<resultMap id="PoliceUnitPagerVoResultMap" type="com.changhu.module.management.pojo.vo.PoliceUnitPagerVo">
|
||||
<result
|
||||
column="contact_person_info"
|
||||
typeHandler="com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler"
|
||||
property="contactPersonInfo"/>
|
||||
</resultMap>
|
||||
<select id="pager" resultMap="PoliceUnitPagerVoResultMap">
|
||||
select
|
||||
pu.*,
|
||||
ad1.name as provinceName,
|
||||
ad2.name as cityName,
|
||||
ad3.name as districtsName,
|
||||
ad4.name as streetName
|
||||
from police_unit pu
|
||||
left join administrative_division ad1 on pu.province = ad1.code and ad1.delete_flag = 0
|
||||
left join administrative_division ad2 on pu.city = ad2.code and ad2.delete_flag = 0
|
||||
left join administrative_division ad3 on pu.districts = ad3.code and ad3.delete_flag = 0
|
||||
left join administrative_division ad4 on pu.street = ad4.code and ad4.delete_flag = 0
|
||||
where pu.delete_flag = 0
|
||||
<if test="params.name!=null and params.name!=''">and pu.name like concat('%',#{params.name},'%')</if>
|
||||
<if test="params.code!=null and params.code!=''">and pu.code like concat('%',#{params.code},'%')</if>
|
||||
<select id="pager" resultType="com.changhu.module.management.pojo.vo.PoliceUnitPagerVo">
|
||||
select *
|
||||
from police_unit
|
||||
where delete_flag = 0
|
||||
<if test="params.name!=null and params.name!=''">and name like concat('%',#{params.name},'%')</if>
|
||||
<if test="params.code!=null and params.code!=''">and code like concat('%',#{params.code},'%')</if>
|
||||
<if test="params.administrativeDivisionCodes!=null">
|
||||
<if test="params.administrativeDivisionCodes.size>=1">
|
||||
and pu.province = #{params.administrativeDivisionCodes[0]}
|
||||
and province = #{params.administrativeDivisionCodes[0]}
|
||||
</if>
|
||||
<if test="params.administrativeDivisionCodes.size>=2">
|
||||
and pu.city = #{params.administrativeDivisionCodes[1]}
|
||||
and city = #{params.administrativeDivisionCodes[1]}
|
||||
</if>
|
||||
<if test="params.administrativeDivisionCodes.size>=3">
|
||||
and pu.districts = #{params.administrativeDivisionCodes[2]}
|
||||
and districts = #{params.administrativeDivisionCodes[2]}
|
||||
</if>
|
||||
<if test="params.administrativeDivisionCodes.size>=4">
|
||||
and pu.street = #{params.administrativeDivisionCodes[3]}
|
||||
and street = #{params.administrativeDivisionCodes[3]}
|
||||
</if>
|
||||
order by create_time desc
|
||||
</if>
|
||||
<if test="params.isEnable!=null">and pu.is_enable = #{params.isEnable.value}</if>
|
||||
<if test="params.checkStatus!=null">and pu.check_status = #{params.checkStatus.value}</if>
|
||||
order by pu.create_time desc
|
||||
<if test="params.isEnable!=null">and is_enable = #{params.isEnable.value}</if>
|
||||
<if test="params.checkStatus!=null">and check_status = #{params.checkStatus.value}</if>
|
||||
</select>
|
||||
</mapper>
|
|
@ -1,50 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.changhu.module.management.mapper.SecurityUnitMapper">
|
||||
<resultMap id="SecurityUnitPagerVoResultMap" type="com.changhu.module.management.pojo.vo.SecurityUnitPagerVo">
|
||||
<result
|
||||
column="legal_person_info"
|
||||
typeHandler="com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler"
|
||||
property="legalPersonInfo"/>
|
||||
</resultMap>
|
||||
<select id="pager" resultMap="SecurityUnitPagerVoResultMap">
|
||||
<select id="pager" resultType="com.changhu.module.management.pojo.vo.SecurityUnitPagerVo">
|
||||
select
|
||||
su.*,
|
||||
ad1.name as provinceName,
|
||||
ad2.name as cityName,
|
||||
ad3.name as districtsName,
|
||||
ad4.name as streetName
|
||||
from
|
||||
security_unit su
|
||||
left join administrative_division ad1 on su.province = ad1.code and ad1.delete_flag = 0
|
||||
left join administrative_division ad2 on su.city = ad2.code and ad2.delete_flag = 0
|
||||
left join administrative_division ad3 on su.districts = ad3.code and ad3.delete_flag = 0
|
||||
left join administrative_division ad4 on su.street = ad4.code and ad4.delete_flag = 0
|
||||
*
|
||||
from security_unit
|
||||
where
|
||||
su.delete_flag = 0
|
||||
delete_flag = 0
|
||||
<if test="params.name!=null and params.name!=''">
|
||||
and su.name like concat('%',#{params.name},'%')
|
||||
and name like concat('%',#{params.name},'%')
|
||||
</if>
|
||||
<if test="params.socialCode!=null and params.socialCode!=''">
|
||||
and su.socialCode like concat('%',#{params.socialCode},'%')
|
||||
and socialCode like concat('%',#{params.socialCode},'%')
|
||||
</if>
|
||||
<if test="params.administrativeDivisionCodes!=null">
|
||||
<if test="params.administrativeDivisionCodes.size>=1">
|
||||
and su.province = #{params.administrativeDivisionCodes[0]}
|
||||
and province = #{params.administrativeDivisionCodes[0]}
|
||||
</if>
|
||||
<if test="params.administrativeDivisionCodes.size>=2">
|
||||
and su.city = #{params.administrativeDivisionCodes[1]}
|
||||
and city = #{params.administrativeDivisionCodes[1]}
|
||||
</if>
|
||||
<if test="params.administrativeDivisionCodes.size>=3">
|
||||
and su.districts = #{params.administrativeDivisionCodes[2]}
|
||||
and districts = #{params.administrativeDivisionCodes[2]}
|
||||
</if>
|
||||
<if test="params.administrativeDivisionCodes.size>=4">
|
||||
and su.street = #{params.administrativeDivisionCodes[3]}
|
||||
and street = #{params.administrativeDivisionCodes[3]}
|
||||
</if>
|
||||
order by su.create_time desc
|
||||
order by create_time desc
|
||||
</if>
|
||||
<if test="params.isEnable!=null">and su.is_enable = #{params.isEnable.value}</if>
|
||||
<if test="params.checkStatus!=null">and su.check_status = #{params.checkStatus.value}</if>
|
||||
order by su.create_time desc
|
||||
<if test="params.isEnable!=null">and is_enable = #{params.isEnable.value}</if>
|
||||
<if test="params.checkStatus!=null">and check_status = #{params.checkStatus.value}</if>
|
||||
</select>
|
||||
</mapper>
|
|
@ -9,7 +9,7 @@
|
|||
</TableProMax>
|
||||
</template>
|
||||
|
||||
<script setup lang="tsx">
|
||||
<script setup lang="ts">
|
||||
import TableProMax from "@/components/table/TableProMax.vue";
|
||||
import {ref} from "vue";
|
||||
import {ComponentExposed} from "vue-component-type-helpers";
|
||||
|
@ -17,7 +17,6 @@ import {TableProMaxProps} from "@/types/components/table";
|
|||
import {PoliceUnitPagerQueryParams, PoliceUnitPagerVo} from "@/types/views/unitManage/policeUnit.ts";
|
||||
import api from "@/axios";
|
||||
import {enumSelectNodes} from "@/config/dict.ts";
|
||||
import {message} from "ant-design-vue";
|
||||
|
||||
type TableProps = TableProMaxProps<PoliceUnitPagerVo, PoliceUnitPagerQueryParams>
|
||||
|
||||
|
@ -31,48 +30,21 @@ const columns: TableProps['columns'] = [
|
|||
dataIndex: 'code',
|
||||
title: '代码'
|
||||
}, {
|
||||
dataIndex: 'contactPersonInfo',
|
||||
title: '联系人',
|
||||
customRender({record}) {
|
||||
return record.contactPersonInfo?.name + "/" + record.contactPersonInfo?.telephone
|
||||
},
|
||||
dataIndex: 'legalPersonInfo',
|
||||
title: '联系人'
|
||||
}, {
|
||||
dataIndex: 'provinceName',
|
||||
title: '行政区划',
|
||||
customRender: ({record}) => [record.provinceName, record.cityName, record.districtsName, record.streetName].filter(Boolean).join('/')
|
||||
}, {
|
||||
dataIndex: 'isEnable',
|
||||
title: '是否启用',
|
||||
customRender: ({text}) => <a-tag color={text?.extData?.color}>{text?.label}</a-tag>,
|
||||
title: '是否启用'
|
||||
}, {
|
||||
dataIndex: 'checkStatus',
|
||||
title: '审核状态',
|
||||
customRender: ({text}) => <a-tag color={text?.extData?.color}>{text?.label}</a-tag>,
|
||||
title: '审核状态'
|
||||
}, {
|
||||
dataIndex: 'createTime',
|
||||
title: '创建时间'
|
||||
}, {
|
||||
dataIndex: 'opt',
|
||||
title: '操作',
|
||||
customRender({record}) {
|
||||
return <a-space>
|
||||
{record.checkStatus.value === 1 && <a-popconfirm
|
||||
title="确认审核通过嘛?"
|
||||
onConfirm={async () => {
|
||||
const resp = await api.post('/management/checkPass', {
|
||||
checkDataId: record.snowFlakeId,
|
||||
unitOptType: 'POLICE_UNIT'
|
||||
})
|
||||
message.success(resp.message)
|
||||
await tableRef.value?.requestGetTableData()
|
||||
}}>
|
||||
<a-button type="primary">审核通过
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
}
|
||||
{record.isEnable.value === 0 ? <a-button danger>禁用</a-button> : <a-button>启用</a-button>}
|
||||
</a-space>
|
||||
},
|
||||
}
|
||||
]
|
||||
const searchFormOptions: TableProps["searchFormOptions"] = {
|
||||
|
|
|
@ -4,13 +4,12 @@
|
|||
:request-api="reqApi"
|
||||
:columns="columns"
|
||||
:searchFormOptions="searchFormOptions"
|
||||
:scroll="{x}"
|
||||
>
|
||||
|
||||
</TableProMax>
|
||||
</template>
|
||||
|
||||
<script setup lang="tsx">
|
||||
<script setup lang="ts">
|
||||
import TableProMax from "@/components/table/TableProMax.vue";
|
||||
import {TableProMaxProps} from "@/types/components/table";
|
||||
import {SecurityUnitPagerQueryParams, SecurityUnitPagerVo} from "@/types/views/unitManage/securityUnit.ts";
|
||||
|
@ -18,7 +17,6 @@ import api from "@/axios";
|
|||
import {ref} from "vue";
|
||||
import {ComponentExposed} from "vue-component-type-helpers";
|
||||
import {enumSelectNodes} from "@/config/dict.ts";
|
||||
import {message} from "ant-design-vue";
|
||||
|
||||
type TableProps = TableProMaxProps<SecurityUnitPagerVo, SecurityUnitPagerQueryParams>
|
||||
|
||||
|
@ -27,80 +25,34 @@ const reqApi: TableProps['requestApi'] = (params) => api.post('/securityUnit/pag
|
|||
const columns: TableProps['columns'] = [
|
||||
{
|
||||
dataIndex: 'name',
|
||||
title: '名称',
|
||||
width: 200,
|
||||
ellipsis: true
|
||||
title: '名称'
|
||||
}, {
|
||||
dataIndex: 'socialCode',
|
||||
title: '社会编码',
|
||||
width: 200,
|
||||
ellipsis: true
|
||||
title: '社会编码'
|
||||
}, {
|
||||
dataIndex: 'businessLicense',
|
||||
title: '营业执照',
|
||||
width: 150,
|
||||
customRender({text}) {
|
||||
return <a-image width={100} height={100} src={__APP_ENV.VITE_APP_MINIO_URL + text}></a-image>
|
||||
},
|
||||
title: '印业执照'
|
||||
}, {
|
||||
dataIndex: 'legalPersonInfo',
|
||||
title: '法人信息',
|
||||
width: 200,
|
||||
customRender({record}) {
|
||||
return record.legalPersonInfo?.name + "/" + record.legalPersonInfo?.telephone
|
||||
},
|
||||
title: '法人信息'
|
||||
}, {
|
||||
dataIndex: 'provinceName',
|
||||
title: '行政区划',
|
||||
customRender: ({record}) => [record.provinceName, record.cityName, record.districtsName, record.streetName].filter(Boolean).join('/'),
|
||||
width: 200,
|
||||
ellipsis: true
|
||||
customRender: ({record}) => [record.provinceName, record.cityName, record.districtsName, record.streetName].filter(Boolean).join('/')
|
||||
}, {
|
||||
dataIndex: 'nature',
|
||||
title: '性质',
|
||||
width: 200
|
||||
title: '性质'
|
||||
}, {
|
||||
dataIndex: 'isEnable',
|
||||
title: '是否启用',
|
||||
customRender: ({text}) => <a-tag color={text?.extData?.color}>{text?.label}</a-tag>,
|
||||
width: 150
|
||||
title: '是否启用'
|
||||
}, {
|
||||
dataIndex: 'checkStatus',
|
||||
title: '审核状态',
|
||||
customRender: ({text}) => <a-tag color={text?.extData?.color}>{text?.label}</a-tag>,
|
||||
width: 150
|
||||
title: '审核状态'
|
||||
}, {
|
||||
dataIndex: 'createTime',
|
||||
title: '创建时间',
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
}, {
|
||||
dataIndex: 'opt',
|
||||
title: '操作',
|
||||
fixed: "right",
|
||||
customRender({record}) {
|
||||
return <a-space>
|
||||
{record.checkStatus.value === 1 && <a-popconfirm
|
||||
title="确认审核通过嘛?"
|
||||
onConfirm={async () => {
|
||||
const resp = await api.post('/management/checkPass', {
|
||||
checkDataId: record.snowFlakeId,
|
||||
unitOptType: 'SECURITY_UNIT'
|
||||
})
|
||||
message.success(resp.message)
|
||||
await tableRef.value?.requestGetTableData()
|
||||
}}>
|
||||
<a-button type="primary">审核通过
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
}
|
||||
{record.isEnable.value === 0 ? <a-button danger>禁用</a-button> : <a-button>启用</a-button>}
|
||||
</a-space>
|
||||
},
|
||||
width: 200
|
||||
title: '创建时间'
|
||||
}
|
||||
]
|
||||
const x: number = columns.reduce((a, b) => a + (b.width as number), 0)
|
||||
const searchFormOptions: TableProps["searchFormOptions"] = {
|
||||
name: {
|
||||
type: 'input',
|
||||
|
|
|
@ -18,9 +18,3 @@ interface ImportMetaEnv {
|
|||
// RSA公钥
|
||||
readonly VITE_APP_RSA_PUBLIC_KEY: string;
|
||||
}
|
||||
|
||||
declare module '*.vue' {
|
||||
import {DefineComponent} from "vue"
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue