审核配置
parent
60cd881d73
commit
85a67808d5
|
|
@ -4,6 +4,7 @@ import com.njzscloud.common.core.utils.R;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.supervisory.biz.pojo.entity.BizAuditConfigEntity;
|
import com.njzscloud.supervisory.biz.pojo.entity.BizAuditConfigEntity;
|
||||||
|
import com.njzscloud.supervisory.biz.pojo.result.SearchAuditConfigResult;
|
||||||
import com.njzscloud.supervisory.biz.service.BizAuditConfigService;
|
import com.njzscloud.supervisory.biz.service.BizAuditConfigService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -61,7 +62,7 @@ public class BizAuditConfigController {
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
@GetMapping("/paging")
|
@GetMapping("/paging")
|
||||||
public R<PageResult<BizAuditConfigEntity>> paging(PageParam pageParam, BizAuditConfigEntity bizAuditConfigEntity) {
|
public R<PageResult<SearchAuditConfigResult>> paging(PageParam pageParam, BizAuditConfigEntity bizAuditConfigEntity) {
|
||||||
return R.success(bizAuditConfigService.paging(pageParam, bizAuditConfigEntity));
|
return R.success(bizAuditConfigService.paging(pageParam, bizAuditConfigEntity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,13 @@
|
||||||
package com.njzscloud.supervisory.biz.mapper;
|
package com.njzscloud.supervisory.biz.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njzscloud.supervisory.biz.pojo.entity.BizAuditConfigEntity;
|
import com.njzscloud.supervisory.biz.pojo.entity.BizAuditConfigEntity;
|
||||||
|
import com.njzscloud.supervisory.biz.pojo.result.SearchAuditConfigResult;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 审核配置
|
* 审核配置
|
||||||
|
|
@ -10,4 +15,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface BizAuditConfigMapper extends BaseMapper<BizAuditConfigEntity> {
|
public interface BizAuditConfigMapper extends BaseMapper<BizAuditConfigEntity> {
|
||||||
|
|
||||||
|
IPage<SearchAuditConfigResult> paging(Page<Object> page, @Param("ew") QueryWrapper<BizAuditConfigEntity> ew);
|
||||||
|
|
||||||
|
void modify(@Param("id") Long id, @Param("cityRole") String cityRole, @Param("areaRole") String areaRole);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.njzscloud.supervisory.biz.pojo.result;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核配置
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SearchAuditConfigResult {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省; 代码
|
||||||
|
*/
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市; 代码
|
||||||
|
*/
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区县; 代码
|
||||||
|
*/
|
||||||
|
private String area;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省; 名称
|
||||||
|
*/
|
||||||
|
private String provinceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市; 名称
|
||||||
|
*/
|
||||||
|
private String cityName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区县; 名称
|
||||||
|
*/
|
||||||
|
private String areaName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市级审核员; 用户角色,空:无需审核
|
||||||
|
*/
|
||||||
|
private String cityRole;
|
||||||
|
private String cityRoleName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区级审核员; 用户角色,空:无需审核
|
||||||
|
*/
|
||||||
|
private String areaRole;
|
||||||
|
private String areaRoleName;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -10,6 +10,7 @@ import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.supervisory.biz.mapper.BizAuditConfigMapper;
|
import com.njzscloud.supervisory.biz.mapper.BizAuditConfigMapper;
|
||||||
import com.njzscloud.supervisory.biz.pojo.entity.BizAuditConfigEntity;
|
import com.njzscloud.supervisory.biz.pojo.entity.BizAuditConfigEntity;
|
||||||
|
import com.njzscloud.supervisory.biz.pojo.result.SearchAuditConfigResult;
|
||||||
import com.njzscloud.supervisory.config.AppProperties;
|
import com.njzscloud.supervisory.config.AppProperties;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -40,7 +41,10 @@ public class BizAuditConfigService extends ServiceImpl<BizAuditConfigMapper, Biz
|
||||||
|
|
||||||
Assert.isTrue(StrUtil.isNotBlank(bizAuditConfigEntity.getArea()), () -> Exceptions.clierr("区县不能为空"));
|
Assert.isTrue(StrUtil.isNotBlank(bizAuditConfigEntity.getArea()), () -> Exceptions.clierr("区县不能为空"));
|
||||||
Assert.isTrue(StrUtil.isNotBlank(bizAuditConfigEntity.getAreaName()), () -> Exceptions.clierr("区县名称不能为空"));
|
Assert.isTrue(StrUtil.isNotBlank(bizAuditConfigEntity.getAreaName()), () -> Exceptions.clierr("区县名称不能为空"));
|
||||||
|
String areaRole = bizAuditConfigEntity.getAreaRole();
|
||||||
|
if (StrUtil.isNotBlank(areaRole)) {
|
||||||
Assert.isTrue(StrUtil.isNotBlank(bizAuditConfigEntity.getCityRole()), () -> Exceptions.clierr("市级审核员不能为空"));
|
Assert.isTrue(StrUtil.isNotBlank(bizAuditConfigEntity.getCityRole()), () -> Exceptions.clierr("市级审核员不能为空"));
|
||||||
|
}
|
||||||
Assert.isTrue(StrUtil.isNotBlank(bizAuditConfigEntity.getCityRole()), () -> Exceptions.clierr("市级审核员不能为空"));
|
Assert.isTrue(StrUtil.isNotBlank(bizAuditConfigEntity.getCityRole()), () -> Exceptions.clierr("市级审核员不能为空"));
|
||||||
this.save(bizAuditConfigEntity);
|
this.save(bizAuditConfigEntity);
|
||||||
}
|
}
|
||||||
|
|
@ -48,8 +52,14 @@ public class BizAuditConfigService extends ServiceImpl<BizAuditConfigMapper, Biz
|
||||||
/**
|
/**
|
||||||
* 修改
|
* 修改
|
||||||
*/
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void modify(BizAuditConfigEntity bizAuditConfigEntity) {
|
public void modify(BizAuditConfigEntity bizAuditConfigEntity) {
|
||||||
this.updateById(bizAuditConfigEntity);
|
Long id = bizAuditConfigEntity.getId();
|
||||||
|
BizAuditConfigEntity entity = this.getById(id);
|
||||||
|
Assert.notNull(entity, () -> Exceptions.clierr("数据不存在,无法修改"));
|
||||||
|
String cityRole = bizAuditConfigEntity.getCityRole();
|
||||||
|
String areaRole = bizAuditConfigEntity.getAreaRole();
|
||||||
|
baseMapper.modify(id, cityRole, areaRole);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -70,8 +80,11 @@ public class BizAuditConfigService extends ServiceImpl<BizAuditConfigMapper, Biz
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
public PageResult<BizAuditConfigEntity> paging(PageParam pageParam, BizAuditConfigEntity bizAuditConfigEntity) {
|
public PageResult<SearchAuditConfigResult> paging(PageParam pageParam, BizAuditConfigEntity bizAuditConfigEntity) {
|
||||||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<BizAuditConfigEntity>query(bizAuditConfigEntity)));
|
String areaName = bizAuditConfigEntity.getAreaName();
|
||||||
|
return PageResult.of(baseMapper.paging(pageParam.toPage(), Wrappers.<BizAuditConfigEntity>query()
|
||||||
|
.like(StrUtil.isNotBlank(areaName), "a.area_name", areaName)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,7 @@ public class BizCompanyService extends ServiceImpl<BizCompanyMapper, BizCompanyE
|
||||||
String companyName = searchCompanyParam.getCompanyName();
|
String companyName = searchCompanyParam.getCompanyName();
|
||||||
String legalRepresentative = searchCompanyParam.getLegalRepresentative();
|
String legalRepresentative = searchCompanyParam.getLegalRepresentative();
|
||||||
return PageResult.of(baseMapper.paging(pageParam.toPage(), Wrappers.query()
|
return PageResult.of(baseMapper.paging(pageParam.toPage(), Wrappers.query()
|
||||||
|
.eq("a.station", Boolean.FALSE)
|
||||||
.eq(auditStatus != null, "a.audit_status", auditStatus)
|
.eq(auditStatus != null, "a.audit_status", auditStatus)
|
||||||
.eq(StrUtil.isNotBlank(searchCompanyParam.getStation()), "a.station", searchCompanyParam.getStation())
|
.eq(StrUtil.isNotBlank(searchCompanyParam.getStation()), "a.station", searchCompanyParam.getStation())
|
||||||
.in(CollUtil.isNotEmpty(bizObjList), "b.biz_obj", bizObjList)
|
.in(CollUtil.isNotEmpty(bizObjList), "b.biz_obj", bizObjList)
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
.select("DISTINCT area")
|
.select("DISTINCT area")
|
||||||
.in("area_role", roles)
|
.in("area_role", roles)
|
||||||
.or().in("city_role", roles)
|
.or().in("city_role", roles)
|
||||||
|
.or(it -> it.isNull("area_role")
|
||||||
|
.isNull("city_role"))
|
||||||
).stream().map(BizAuditConfigEntity::getArea).collect(Collectors.toList());
|
).stream().map(BizAuditConfigEntity::getArea).collect(Collectors.toList());
|
||||||
if (CollUtil.isEmpty(areas)) {
|
if (CollUtil.isEmpty(areas)) {
|
||||||
return PageResult.of(pageParam.toPage());
|
return PageResult.of(pageParam.toPage());
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
package com.njzscloud.supervisory.sys.role.controller;
|
package com.njzscloud.supervisory.sys.role.controller;
|
||||||
|
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.njzscloud.common.core.utils.R;
|
import com.njzscloud.common.core.utils.R;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.supervisory.sys.role.pojo.entity.RoleEntity;
|
||||||
import com.njzscloud.supervisory.sys.role.pojo.param.RoleAddParam;
|
import com.njzscloud.supervisory.sys.role.pojo.param.RoleAddParam;
|
||||||
import com.njzscloud.supervisory.sys.role.pojo.param.RoleModifyParam;
|
import com.njzscloud.supervisory.sys.role.pojo.param.RoleModifyParam;
|
||||||
import com.njzscloud.supervisory.sys.role.pojo.param.RoleQueryParam;
|
import com.njzscloud.supervisory.sys.role.pojo.param.RoleQueryParam;
|
||||||
|
|
@ -62,6 +65,14 @@ public class RoleController {
|
||||||
return R.success(roleService.detail(id));
|
return R.success(roleService.detail(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public R<List<RoleEntity>> list(@RequestParam(required = false, value = "roleName") String roleName) {
|
||||||
|
return R.success(roleService.list(Wrappers.lambdaQuery(RoleEntity.class).like(StrUtil.isNotBlank(roleName), RoleEntity::getRoleName, roleName)));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,25 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
<mapper namespace="com.njzscloud.supervisory.biz.mapper.BizAuditConfigMapper">
|
<mapper namespace="com.njzscloud.supervisory.biz.mapper.BizAuditConfigMapper">
|
||||||
|
<update id="modify">
|
||||||
|
update biz_audit_config
|
||||||
|
<set>
|
||||||
|
<if test="cityRole != null">city_role = #{cityRole},</if>
|
||||||
|
<if test="areaRole != null">area_role = #{areaRole},</if>
|
||||||
|
<if test="city_role == ''">city_role = null,</if>
|
||||||
|
<if test="areaRole == ''">area_role = null,</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
<select id="paging" resultType="com.njzscloud.supervisory.biz.pojo.result.SearchAuditConfigResult">
|
||||||
|
SELECT a.*,
|
||||||
|
b.role_name,
|
||||||
|
c.role_name
|
||||||
|
FROM biz_audit_config a
|
||||||
|
LEFT JOIN sys_role b ON b.role_code = a.city_role
|
||||||
|
LEFT JOIN sys_role c ON c.role_code = a.area_role
|
||||||
|
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue