Commit d019d865 authored by tianhongyang's avatar tianhongyang

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys...

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys into V20231129-中建一局二公司
parents f690cad5 ac6a5f66
package com.dsk.web.schedule;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsk.common.constant.PushConstants;
import com.dsk.common.utils.DateUtils;
import com.dsk.system.domain.SysConfig;
import com.dsk.system.domain.SysPush;
import com.dsk.system.domain.SysStatutoryHoliday;
import com.dsk.system.mapper.SysStatutoryHolidayMapper;
import com.dsk.system.service.ISysConfigService;
import com.dsk.system.service.ISysPushService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 推送相关定时任务
*
* @Author lcl
* @Data 2023/12/21 17:05
*/
@Component
@RequiredArgsConstructor
@Slf4j
public class PushTask {
@Autowired
private ISysPushService pushService;
@Autowired
private ISysConfigService configService;
@Resource
private SysStatutoryHolidayMapper statutoryHolidayMapper;
/**
* 供应商不良推送(每分钟)
*/
// @Scheduled(cron = "0 * * * * ? ")
public void customerBadness() {
//1.是否推送时间段(日期、时间)
if (!isPush()) return;
//2.推送数据(当前时段是否存在数据)
//3.推送人员
List<SysPush> list = pushService.list(Wrappers.<SysPush>lambdaQuery().eq(SysPush::getStatus, 0));
if (CollectionUtils.isNotEmpty(list)) {
list.parallelStream().forEach(item -> {
Map<String, Object> param = new HashMap<>();
param.put("name", item.getName());
});
}
}
//是否推送
private boolean isPush() {
//推送类型
SysConfig type = configService.selectConfigByKey(PushConstants.CUSTOMEER_BADNESS_TYPE_KEY);
if (ObjectUtils.isEmpty(type)) return false;
if ("1".equals(type.getConfigValue()) && !isWorkingDay()) return false;
//推送时段
SysConfig frame = configService.selectConfigByKey(PushConstants.CUSTOMEER_BADNESS_FRAME_KEY);
return !ObjectUtils.isEmpty(frame) && isPushTime(frame.getConfigValue());
}
//判断当前是否工作日
private boolean isWorkingDay() {
LocalDate date = LocalDate.now();
SysStatutoryHoliday today = statutoryHolidayMapper.selectOne(Wrappers.<SysStatutoryHoliday>lambdaQuery()
.eq(SysStatutoryHoliday::getDate, date));
if (!ObjectUtils.isEmpty(today)) return today.getIsHoliday() == 0;
return date.getDayOfWeek() != DayOfWeek.SATURDAY && date.getDayOfWeek() != DayOfWeek.SUNDAY;
}
//判断是否在当前时段推送
private boolean isPushTime(String timeFrame) {
String date = LocalDate.now().toString();
String[] split = timeFrame.split("-");
Date currentTime = new Date();
return currentTime.after(DateUtils.parseDate(date + " " + split[0])) && currentTime.before(DateUtils.parseDate(date + " " + split[1]));
}
}
...@@ -167,11 +167,11 @@ sms: ...@@ -167,11 +167,11 @@ sms:
#请求地址 默认为 dysmsapi.aliyuncs.com 如无特殊改变可以不用设置 #请求地址 默认为 dysmsapi.aliyuncs.com 如无特殊改变可以不用设置
requestUrl: dysmsapi.aliyuncs.com requestUrl: dysmsapi.aliyuncs.com
#阿里云的accessKey #阿里云的accessKey
accessKeyId: LTAIC4Pb2jJZbUmD accessKeyId: LTAIFKlRP50kOB5b
#阿里云的accessKeySecret #阿里云的accessKeySecret
accessKeySecret: L7VANFwqaTludkczLsg9jhvidk0e28 accessKeySecret: I2HvinEcSgiJPFOhRbKKP1jl1wH5E3
#短信签名 #短信签名
signature: 大司空信息科技 signature: 中建一局二公司
tencent: tencent:
#请求地址默认为 sms.tencentcloudapi.com 如无特殊改变可不用设置 #请求地址默认为 sms.tencentcloudapi.com 如无特殊改变可不用设置
requestUrl: sms.tencentcloudapi.com requestUrl: sms.tencentcloudapi.com
......
package com.dsk.common.constant;
/**
* 推送相关
*/
public interface PushConstants {
/**
* 供应商不良推送短信模板
*/
String CUSTOMEER_BADNESS_SMS = "SMS_464311026";
/**
* 供应商不良推送类型
*/
String CUSTOMEER_BADNESS_TYPE_KEY = "customer-badness-date-type";
/**
* 供应商不良推送时段
*/
String CUSTOMEER_BADNESS_FRAME_KEY = "customer-badness-time-frame";
}
...@@ -17,7 +17,7 @@ public class DCustomerListVo implements Serializable { ...@@ -17,7 +17,7 @@ public class DCustomerListVo implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Excel(name = "序号", width = 6) @Excel(name = "序号", width = 6)
private Integer num; private Integer num;
/** /**
* jsk企业id * jsk企业id
...@@ -38,136 +38,135 @@ public class DCustomerListVo implements Serializable { ...@@ -38,136 +38,135 @@ public class DCustomerListVo implements Serializable {
/** /**
* 供应商名称 * 供应商名称
*/ */
@Excel(name = "供应商名称", width = 30) @Excel(name = "供应商名称", width = 30)
private String customerName; private String customerName;
/** /**
* 供应商编号 * 供应商编号
*/ */
@Excel(name = "供应商编号", width = 15) @Excel(name = "供应商编号", width = 15)
private String customerCode; private String customerCode;
/** /**
* 推荐公司 * 推荐公司
*/ */
@Excel(name = "推荐单位", width = 30) @Excel(name = "推荐单位", width = 30)
private String recommendOrg; private String recommendOrg;
/** /**
* 注册地区域 * 注册地区域
*/ */
@Excel(name = "公司注册区域", width = 10) @Excel(name = "公司注册区域", width = 10)
private String registerRegion; private String registerRegion;
/** /**
* 省份 * 省份
*/ */
@Excel(name = "公司注册省", width = 10) @Excel(name = "公司注册省", width = 10)
private String registerProvince; private String registerProvince;
/** /**
* 城市 * 城市
*/ */
@Excel(name = "公司注册市", width = 10) @Excel(name = "公司注册市", width = 10)
private String registerCity; private String registerCity;
/** /**
* 供应商类别 * 供应商类别
*/ */
@Excel(name = "供应商类别", width = 10) @Excel(name = "供应商类别", width = 10)
private String customerClass; private String customerClass;
/** /**
* 集团专业类别 * 集团专业类别
*/ */
@Excel(name = "专业类别", width = 20) @Excel(name = "专业类别", width = 20)
private String groupSpecialty; private String groupSpecialty;
/** /**
* 纳税人身份 * 纳税人身份
*/ */
@Excel(name = "纳税人身份", width = 10) @Excel(name = "纳税人身份", width = 10)
private String paytaxType; private String paytaxType;
/** /**
* 纳税人税率 * 纳税人税率
*/ */
@Excel(name = "纳税人税率", width = 10) @Excel(name = "纳税人税率", width = 10)
private String taxRate; private String taxRate;
/** /**
* 供应商状态 * 供应商状态
*/ */
@Excel(name = "状态", width = 10) @Excel(name = "状态", width = 10)
private String customerState; private String customerState;
/** /**
* 限用/禁用状态 * 限用/禁用状态
*/ */
@Excel(name = "限用/禁用状态", width = 10) @Excel(name = "限用/禁用状态", width = 10)
private String badnessState; private String badnessState;
/** /**
* 队长名称 * 队长名称
*/ */
@Excel(name = "劳务队长", width = 10) @Excel(name = "劳务队长", width = 10)
private String leaderName; private String leaderName;
/** /**
* 劳务队长联系电话 * 劳务队长联系电话
*/ */
@Excel(name = "队长联系电话", width = 10) @Excel(name = "队长联系电话", width = 10)
private String laborCaptainPhone; private String laborCaptainPhone;
/** /**
* 劳务队长身份证号 * 劳务队长身份证号
*/ */
@Excel(name = "队长身份证号", width = 10) @Excel(name = "队长身份证号", width = 10)
private String laborCaptainIdcard; private String laborCaptainIdcard;
/** /**
* 队伍规模人数 * 队伍规模人数
*/ */
@Excel(name = "队伍规模", width = 10) @Excel(name = "队伍规模", cellType = Excel.ColumnType.NUMERIC, width = 10)
private Double serviceTeamPersonnum; private Double serviceTeamPersonnum;
/** /**
* 专业特长 * 专业特长
*/ */
@Excel(name = "专业特长", width = 10) @Excel(name = "专业特长", width = 10)
private String serviceTeamSpeciality; private String serviceTeamSpeciality;
/** /**
* 施工承包范围 * 施工承包范围
*/ */
@Excel(name = "施工承包范围", width = 25) @Excel(name = "施工承包范围", width = 25)
private String constructJobScope; private String constructJobScope;
/** /**
* 资质等级 * 资质等级
*/ */
@Excel(name = "资质等级", width = 10) @Excel(name = "资质等级", width = 10)
private String credential; private String credential;
/** /**
* 注册资金 * 注册资金
*/ */
@Excel(name = "注册资金(万元)", width = 10) @Excel(name = "注册资金(万元)", cellType = Excel.ColumnType.NUMERIC, width = 10)
private Double registerCapital; private Double registerCapital;
/** /**
* 联系人 * 联系人
*/ */
@Excel(name = "公司联系人", width = 10) @Excel(name = "公司联系人", width = 10)
private String contactPerson; private String contactPerson;
/** /**
* 电话 * 电话
*/ */
@Excel(name = "联系人电话", width = 10) @Excel(name = "联系人电话", width = 10)
private String contactPhone; private String contactPhone;
/** /**
* 准入时间 * 准入时间
*/ */
@Excel(name = "准入时间", width = 10 , dateFormat = "yyyy-MM-dd") @Excel(name = "准入时间", width = 10, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date approveDate2; private Date approveDate2;
/** /**
* 企业合作数量 * 企业合作数量
*/ */
@Excel(name = "公司合作数量", width = 10 ) @Excel(name = "公司合作数量", width = 10)
private Integer enterpriseCooperationCount; private Integer enterpriseCooperationCount;
/** /**
* 项目合作数量 * 项目合作数量
*/ */
@Excel(name = "合作项目数量", width = 10 ) @Excel(name = "合作项目数量", width = 10)
private Integer projectCooperationCount; private Integer projectCooperationCount;
/** /**
* 考评等级 * 考评等级
*/ */
@Excel(name = "分包商等级", width = 10) @Excel(name = "分包商等级", width = 10)
private String creditLevel; private String creditLevel;
} }
...@@ -33,6 +33,13 @@ public interface AdvisoryBodyMapper extends BaseMapper<AdvisoryBody> { ...@@ -33,6 +33,13 @@ public interface AdvisoryBodyMapper extends BaseMapper<AdvisoryBody> {
*/ */
Page<AdvisoryBodyVo> queryListByBo(IPage<AdvisoryBodyBo> build, @Param("bo") AdvisoryBodyBo bo); Page<AdvisoryBodyVo> queryListByBo(IPage<AdvisoryBodyBo> build, @Param("bo") AdvisoryBodyBo bo);
/**
* 咨询机构合作记录数量
* @param bo
* @return
*/
int countByBo(@Param("bo") AdvisoryBodyBo bo);
/** /**
* 根据咨询机构名称查询咨询机构Cids * 根据咨询机构名称查询咨询机构Cids
* @param advisoryBodyName 咨询机构名称 * @param advisoryBodyName 咨询机构名称
......
...@@ -31,5 +31,12 @@ public interface DSubcontractMapper extends BaseMapper<DSubcontract> { ...@@ -31,5 +31,12 @@ public interface DSubcontractMapper extends BaseMapper<DSubcontract> {
* @return * @return
*/ */
Page<CustomerCooperationVo> selectCooperationList(IPage<CustomerCooperationBo> build, @Param("bo")CustomerCooperationBo bo); Page<CustomerCooperationVo> selectCooperationList(IPage<CustomerCooperationBo> build, @Param("bo")CustomerCooperationBo bo);
/**
* 供应商合作记录数量
* @param bo
* @return
*/
int countByBo(@Param("bo")CustomerCooperationBo bo);
} }
...@@ -12,6 +12,8 @@ import com.dsk.cscec.domain.vo.CustomerApproveVo; ...@@ -12,6 +12,8 @@ import com.dsk.cscec.domain.vo.CustomerApproveVo;
import com.dsk.cscec.domain.vo.CustomerCooperationVo; import com.dsk.cscec.domain.vo.CustomerCooperationVo;
import com.dsk.cscec.domain.vo.CustomerInfoVo; import com.dsk.cscec.domain.vo.CustomerInfoVo;
import java.util.Map;
/** /**
* 组织维表(DCustomer)表服务接口 * 组织维表(DCustomer)表服务接口
* *
...@@ -20,10 +22,27 @@ import com.dsk.cscec.domain.vo.CustomerInfoVo; ...@@ -20,10 +22,27 @@ import com.dsk.cscec.domain.vo.CustomerInfoVo;
*/ */
public interface ICustomerInfoService extends IService<DCustomer> { public interface ICustomerInfoService extends IService<DCustomer> {
/**
* 供应商分类列表
* @param bo
* @param query
* @return
*/
TableDataInfo<CustomerInfoVo> queryPageList(CustomerInfoBo bo, PageQuery query); TableDataInfo<CustomerInfoVo> queryPageList(CustomerInfoBo bo, PageQuery query);
/**
* 供应商准入情况
* @param bo
* @return
*/
CustomerApproveVo queryApproveByBo(CustomerInfoBo bo); CustomerApproveVo queryApproveByBo(CustomerInfoBo bo);
/**
* 咨询机构合作记录
* @param bo
* @param query
* @return
*/
TableDataInfo<AdvisoryBodyVo> queryAdvisoryList(AdvisoryBodyBo bo, PageQuery query); TableDataInfo<AdvisoryBodyVo> queryAdvisoryList(AdvisoryBodyBo bo, PageQuery query);
/** /**
...@@ -33,4 +52,11 @@ public interface ICustomerInfoService extends IService<DCustomer> { ...@@ -33,4 +52,11 @@ public interface ICustomerInfoService extends IService<DCustomer> {
* @return * @return
*/ */
TableDataInfo<CustomerCooperationVo> queryCooperationList(CustomerCooperationBo bo,PageQuery query); TableDataInfo<CustomerCooperationVo> queryCooperationList(CustomerCooperationBo bo,PageQuery query);
/**
* 内部合作统计
* @param companyName
* @return
*/
Map<String,Object> cooperationStatistic(String companyName);
} }
...@@ -28,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -28,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
...@@ -97,6 +98,7 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto ...@@ -97,6 +98,7 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
Assert.isTrue(false,"参数不能为空"); Assert.isTrue(false,"参数不能为空");
} }
LambdaQueryWrapper<DCustomer> lqw = Wrappers.lambdaQuery(); LambdaQueryWrapper<DCustomer> lqw = Wrappers.lambdaQuery();
lqw.eq(DCustomer::getRecommendOrgId,QueryConstants.LEVEL1_COMPANY_ID);
lqw.eq(ObjectUtil.isNotNull(bo.getCustomerKey()),DCustomer::getCustomerKey,bo.getCustomerKey()); lqw.eq(ObjectUtil.isNotNull(bo.getCustomerKey()),DCustomer::getCustomerKey,bo.getCustomerKey());
lqw.eq(StringUtil.isNotBlank(bo.getUnifySocialCode()),DCustomer::getUnifySocialCode,bo.getUnifySocialCode()); lqw.eq(StringUtil.isNotBlank(bo.getUnifySocialCode()),DCustomer::getUnifySocialCode,bo.getUnifySocialCode());
lqw.eq(StringUtil.isNotBlank(bo.getCustomerName()),DCustomer::getCustomerName,bo.getCustomerName()); lqw.eq(StringUtil.isNotBlank(bo.getCustomerName()),DCustomer::getCustomerName,bo.getCustomerName());
...@@ -123,4 +125,30 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto ...@@ -123,4 +125,30 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
Page<CustomerCooperationVo> page = dSubcontractMapper.selectCooperationList(query.build(),bo); Page<CustomerCooperationVo> page = dSubcontractMapper.selectCooperationList(query.build(),bo);
return TableDataInfo.build(page); return TableDataInfo.build(page);
} }
@Override
public Map<String, Object> cooperationStatistic(String companyName) {
if (StringUtil.isBlank(companyName)) {
return new HashMap<>();
}
AdvisoryBodyBo advisoryBodyBo = new AdvisoryBodyBo();
advisoryBodyBo.setContractOrgId(QueryConstants.LEVEL1_COMPANY_ID);
advisoryBodyBo.setAdvisoryBodyName(companyName);
LambdaQueryWrapper<DCustomer> lqw = Wrappers.lambdaQuery();
lqw.eq(DCustomer::getRecommendOrgId,QueryConstants.LEVEL1_COMPANY_ID);
lqw.eq(StringUtil.isNotBlank(companyName), DCustomer::getCustomerName, companyName);
CustomerCooperationBo customerCooperationBo = new CustomerCooperationBo();
customerCooperationBo.setSignOrgId(QueryConstants.LEVEL1_COMPANY_ID);
customerCooperationBo.setCustomerName(companyName);
Map<String, Object> result = new HashMap<>();
result.put("advisoryList", advisoryBodyMapper.countByBo(advisoryBodyBo));
result.put("cooperationList", subcontractMapper.countByBo(customerCooperationBo));
result.put("approveInfo", baseMapper.exists(lqw) ? 1 : 0);
// result.put("施工业绩", 0);
// result.put("在施工程情况", 0);
return result;
}
} }
...@@ -18,6 +18,7 @@ public class EnterpriseStatisticBody ...@@ -18,6 +18,7 @@ public class EnterpriseStatisticBody
*/ */
@NotNull(message = "企业id不能为空") @NotNull(message = "企业id不能为空")
private Integer companyId; private Integer companyId;
private String companyName;
private Boolean isFy = false; private Boolean isFy = false;
......
...@@ -70,7 +70,7 @@ public class JskCompanyRelationTableV1Dto extends BasePage { ...@@ -70,7 +70,7 @@ public class JskCompanyRelationTableV1Dto extends BasePage {
/** /**
* 集团Id * 集团Id
*/ */
private Integer combineId; private String combineId;
} }
...@@ -36,7 +36,7 @@ public class CompanyRelationTableV1Service { ...@@ -36,7 +36,7 @@ public class CompanyRelationTableV1Service {
public TableDataInfo detailPage(JskCompanyRelationTableV1Dto dto) throws Exception { public TableDataInfo detailPage(JskCompanyRelationTableV1Dto dto) throws Exception {
Map<String, Object> map = null; Map<String, Object> map = null;
if (dto.getCompanyType().equals(3)) { if (dto.getCompanyType().equals(3) || dto.getCompanyType().equals(4)) {
map = dskOpenApiUtil.requestBody("/operate/consultancy/combineDetailPage", BeanUtil.beanToMap(dto, false, false)); map = dskOpenApiUtil.requestBody("/operate/consultancy/combineDetailPage", BeanUtil.beanToMap(dto, false, false));
} else { } else {
map = dskOpenApiUtil.requestBody("/operate/consultancy/detailPage", BeanUtil.beanToMap(dto, false, false)); map = dskOpenApiUtil.requestBody("/operate/consultancy/detailPage", BeanUtil.beanToMap(dto, false, false));
...@@ -69,7 +69,7 @@ public class CompanyRelationTableV1Service { ...@@ -69,7 +69,7 @@ public class CompanyRelationTableV1Service {
} }
public TableDataInfo combinePage(JskCompanyRelationTableV1Dto dto) throws Exception { public TableDataInfo combinePage(JskCompanyRelationTableV1Dto dto) throws Exception {
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/consultancy/combinePage", BeanUtil.beanToMap(dto, false, false)); Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/consultancy/combineMemberPage", BeanUtil.beanToMap(dto, false, false));
return dskOpenApiUtil.responsePage(map); return dskOpenApiUtil.responsePage(map);
} }
} }
...@@ -8,6 +8,7 @@ import com.dsk.common.core.domain.R; ...@@ -8,6 +8,7 @@ import com.dsk.common.core.domain.R;
import com.dsk.common.core.page.TableDataInfo; import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.utils.EncodeIdUtil; import com.dsk.common.utils.EncodeIdUtil;
import com.dsk.common.utils.redis.RedisUtils; import com.dsk.common.utils.redis.RedisUtils;
import com.dsk.cscec.service.ICustomerInfoService;
import com.dsk.jsk.domain.*; import com.dsk.jsk.domain.*;
import com.dsk.system.utils.DskOpenApiUtil; import com.dsk.system.utils.DskOpenApiUtil;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -39,6 +40,9 @@ public class EnterpriseService { ...@@ -39,6 +40,9 @@ public class EnterpriseService {
@Autowired @Autowired
private DskOpenApiUtil dskOpenApiUtil; private DskOpenApiUtil dskOpenApiUtil;
@Autowired
private ICustomerInfoService iCustomerInfoService;
public R label(EnterpriseInfoLabelBody body) throws Exception { public R label(EnterpriseInfoLabelBody body) throws Exception {
List<Map<String, Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
if (body.isVaildCid()) { if (body.isVaildCid()) {
...@@ -104,6 +108,10 @@ public class EnterpriseService { ...@@ -104,6 +108,10 @@ public class EnterpriseService {
Map statisticMapData = MapUtils.getMap(statisticMap, "data", null); Map statisticMapData = MapUtils.getMap(statisticMap, "data", null);
if (MapUtils.isEmpty(statisticMapData)) return R.ok(); if (MapUtils.isEmpty(statisticMapData)) return R.ok();
//内部合作
Map<String,Object> cooperation = iCustomerInfoService.cooperationStatistic(body.getCompanyName());
statisticMapData.put("cooperation",cooperation);
Map performance = MapUtils.getMap(statisticMapData, "performance"); Map performance = MapUtils.getMap(statisticMapData, "performance");
Map business = MapUtils.getMap(statisticMapData, "business"); Map business = MapUtils.getMap(statisticMapData, "business");
......
...@@ -208,13 +208,13 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -208,13 +208,13 @@ public class MonitorServiceImpl implements MonitorService {
} }
//进行excel格式判定 //进行excel格式判定
String name = sheet.getRow(0).getCell(0) + ""; String name = sheet.getRow(2).getCell(0) + "";
//只要其中一个不满足则格式有误 //只要其中一个不满足则格式有误
if (!"企业名称".equals(name)){ if (!"企业名称".equals(name)){
return R.fail("操作失败,数据异常,请使用正确的模板"); return R.fail("操作失败,数据异常,请使用正确的模板");
} }
//行列皆从0开始 //行列皆从0开始
for (int i = 1; i <= lastRowNum; i++) { for (int i = 3; i <= lastRowNum; i++) {
String companyNameStr = ""; String companyNameStr = "";
// 统一社会信用代码 // 统一社会信用代码
Cell companyName = sheet.getRow(i).getCell(0); Cell companyName = sheet.getRow(i).getCell(0);
......
...@@ -61,6 +61,30 @@ ...@@ -61,6 +61,30 @@
order by dp.contract_sign_date desc order by dp.contract_sign_date desc
</select> </select>
<select id="countByBo" resultType="int">
select count(1)
from advisory_body_project abp
left join advisory_body ab on ab.advisory_body_id = abp.advisory_body_id
left join d_project dp on dp.project_key = abp.project_key
<where>
<if test="bo.advisoryBodyId != null and bo.advisoryBodyId != ''">
and ab.advisory_body_id = #{bo.advisoryBodyId}
</if>
<if test="bo.advisoryBodyCid != null and bo.advisoryBodyCid != ''">
and ab.advisory_body_cid = #{bo.advisoryBodyCid}
</if>
<if test="bo.advisoryBodyName != null and bo.advisoryBodyName != ''">
and ab.advisory_body_name = #{bo.advisoryBodyName}
</if>
<if test="bo.contractOrgId != null and bo.contractOrgId != ''">
and dp.contract_org_id = #{bo.contractOrgId}
</if>
<if test="bo.contractOrgName != null and bo.contractOrgName != ''">
and dp.contract_org_name = #{bo.contractOrgName}
</if>
</where>
</select>
<select id="selectAdvisoryBodyCidsByName" resultType="java.lang.Long"> <select id="selectAdvisoryBodyCidsByName" resultType="java.lang.Long">
select select
ab.advisory_body_cid ab.advisory_body_cid
......
...@@ -71,4 +71,24 @@ ...@@ -71,4 +71,24 @@
</where> </where>
order by ds.sign_date desc order by ds.sign_date desc
</select> </select>
<select id="countByBo" resultType="int">
select count (1)
from d_subcontract ds
left join d_project dp on dp.project_id = ds.project_id
<where>
<if test="bo.signOrgId != null and bo.signOrgId != ''">
and ds.sign_org_id =#{bo.signOrgId}
</if>
<if test="bo.signOrgName != null and bo.signOrgName != ''">
and ds.sign_org_name =#{bo.signOrgName}
</if>
<if test="bo.customerId != null and bo.customerId != ''">
and ds.customer_id =#{bo.customerId}
</if>
<if test="bo.customerName != null and bo.customerName != ''">
and ds.customer_name =#{bo.customerName}
</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
</el-upload> </el-upload>
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button class="download" icon="el-icon-download">下载模版</el-button> <el-button class="download" icon="el-icon-download" @click="downloadClick">下载模版</el-button>
<el-button @click="handleUploadCancel1">取消</el-button> <el-button @click="handleUploadCancel1">取消</el-button>
<el-button type="primary" @click="submitUpload">确定</el-button> <el-button type="primary" @click="submitUpload">确定</el-button>
</div> </div>
...@@ -207,10 +207,12 @@ ...@@ -207,10 +207,12 @@
headers: { headers: {
Authorization: "Bearer " + getToken(), Authorization: "Bearer " + getToken(),
}, },
companyId:'' companyId:'',
downloadhref: '',//样例地址
} }
}, },
created() { created() {
this.downloadhref = '/file/Template.xlsx';
this.querySubmit() this.querySubmit()
}, },
methods: { methods: {
...@@ -369,6 +371,14 @@ ...@@ -369,6 +371,14 @@
this.fileList=[] this.fileList=[]
this.pldrVisible=false; this.pldrVisible=false;
}, },
downloadClick() {
let a = document.createElement("a");
a.setAttribute("href", this.downloadhref);
a.setAttribute("download", "批量导入模版.xlsx");
document.body.appendChild(a);
a.click();
a.remove();
},
submitUpload() { submitUpload() {
this.$refs.upload.submit(); this.$refs.upload.submit();
}, },
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<div class="m-main"> <div class="m-main">
<div class="main-item"> <div class="main-item">
<div class="label">推送频率</div> <div class="label">推送频率</div>
<el-radio v-model="queryParams.pushFrequency" label="0">每小时</el-radio> <!--<el-radio v-model="queryParams.pushFrequency" label="0">每小时</el-radio>-->
<el-radio v-model="queryParams.pushFrequency" label="1">每天</el-radio> <el-radio v-model="queryParams.pushFrequency" label="1">每天</el-radio>
<el-radio v-model="queryParams.pushFrequency" label="2">工作日(排除节假日)</el-radio> <el-radio v-model="queryParams.pushFrequency" label="2">工作日(排除节假日)</el-radio>
</div> </div>
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
checkFx: true, checkFx: true,
checkJkwd: true, checkJkwd: true,
queryParams:{ queryParams:{
pushFrequency:'0', pushFrequency:'1',
receiveMode:'0', receiveMode:'0',
phones:'' phones:''
}, },
...@@ -198,9 +198,8 @@ ...@@ -198,9 +198,8 @@
if(this.endTime){ if(this.endTime){
params.timePeriodEnd=this.endTime params.timePeriodEnd=this.endTime
} }
console.log(params)
insertOrUpdate(params).then(res => { insertOrUpdate(params).then(res => {
this.$modal.success(res.msg); this.$message.success(res.msg);
}) })
}, },
handleResetting(){ handleResetting(){
...@@ -209,7 +208,7 @@ ...@@ -209,7 +208,7 @@
this.startTime ='' this.startTime =''
this.endTime = '' this.endTime = ''
this.queryParams={ this.queryParams={
pushFrequency:'0', pushFrequency:'1',
receiveMode:'0', receiveMode:'0',
phones:'' phones:''
} }
......
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
fixed="right" fixed="right"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span style="cursor: pointer;" @click="handleDetail(scope.row)">查看详情</span> <span style="cursor: pointer;color:#0081FF;" @click="handleDetail(scope.row)">查看详情</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -168,7 +168,6 @@ ...@@ -168,7 +168,6 @@
}, },
data() { data() {
return { return {
changeTime,
isSkeleton:true, isSkeleton:true,
radio:null, radio:null,
date:'', date:'',
...@@ -352,19 +351,22 @@ ...@@ -352,19 +351,22 @@
params.condition.companyName=this.companyName params.condition.companyName=this.companyName
} }
if(this.fxjbType.length > 0){ if(this.fxjbType.length > 0){
params.condition.fxjbType=this.fxjbType.join() params.condition.riskLevel=this.fxjbType
}else {
delete params.condition.riskLevel
} }
if(this.sffx.length > 0 && this.gsfx.length > 0){ if(this.sffx.length > 0 && this.gsfx.length > 0){
params.riskType='司法风险,工商风险' params.condition.riskType='司法风险,工商风险'
params.dimension=this.sffx.join()+','+this.gsfx.join() params.condition.dimension=this.sffx.concat(this.gsfx)
console.log(this.sffx.concat(this.gsfx))
} }
if(this.sffx.length > 0 && this.gsfx.length === 0){ if(this.sffx.length > 0 && this.gsfx.length === 0){
params.riskType='司法风险' params.condition.riskType='司法风险'
params.dimension=this.sffx.join() params.condition.dimension=this.sffx
} }
if(this.sffx.length === 0 && this.gsfx.length > 0){ if(this.sffx.length === 0 && this.gsfx.length > 0){
params.riskType='工商风险' params.condition.riskType='工商风险'
params.dimension=this.gsfx.join() params.condition.dimension=this.gsfx
} }
dynamicPage(params).then(res => { dynamicPage(params).then(res => {
this.isSkeleton = false; this.isSkeleton = false;
...@@ -388,6 +390,7 @@ ...@@ -388,6 +390,7 @@
getDetail(name,id) { getDetail(name,id) {
companyDetail({dimensionName:name,sourceId:id}).then(res => { companyDetail({dimensionName:name,sourceId:id}).then(res => {
console.log(res) console.log(res)
this.dialogVisible=true;
this.detail=res.data; this.detail=res.data;
}) })
}, },
...@@ -433,33 +436,32 @@ ...@@ -433,33 +436,32 @@
switch (item.dimensionName) { switch (item.dimensionName) {
case '新增开庭公告': case '新增开庭公告':
this.title='开庭公告详情' this.title='开庭公告详情'
this.dialogVisible=true; this.getDetail(item.dimensionName,item.sourceId)
break; break;
case '新增法院公告': case '新增法院公告':
this.title='法院公告详情' this.title='法院公告详情'
this.dialogVisible=true; this.getDetail(item.dimensionName,item.sourceId)
break; break;
case '新增裁判文书': case '新增裁判文书':
this.title='裁判文书详情' this.title='裁判文书详情'
this.dialogVisible=true; this.getDetail(item.dimensionName,item.sourceId)
break; break;
case '新增经营异常': case '新增经营异常':
this.title='经营异常详情' this.title='经营异常详情'
this.dialogVisible=true; this.getDetail(item.dimensionName,item.sourceId)
break; break;
case '新增失信被执行人': case '新增失信被执行人':
this.title='失信被执行人详情' this.title='失信被执行人详情'
this.dialogVisible=true; this.getDetail(item.dimensionName,item.sourceId)
break; break;
case '新增股权冻结': case '新增股权冻结':
this.title='股权冻结详情' this.title='股权冻结详情'
this.dialogVisible=true; this.getDetail(item.dimensionName,item.sourceId)
break; break;
default: default:
this.$message.success("暂无详情"); this.$message.success("暂无详情");
break; break;
} }
this.getDetail(item.dimensionName,item.sourceId)
}, },
handleKeyword(){ handleKeyword(){
this.queryParams.pageNum=1 this.queryParams.pageNum=1
...@@ -650,7 +652,13 @@ ...@@ -650,7 +652,13 @@
} }
} }
</script> </script>
<style lang="scss">
.el-select-dropdown__item.selected,
.el-select-dropdown.is-multiple .el-select-dropdown__item.selected::after{
color: #3181fa;
font-size: 0;
}
</style>
<style lang="scss" scoped> <style lang="scss" scoped>
.MonitoringDynamics{ .MonitoringDynamics{
.search{ .search{
......
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
fixed="right" fixed="right"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span style="cursor: pointer;" @click="handleDetail">查看详情</span> <span style="cursor: pointer;color:#0081FF;" @click="handleDetail(scope.row)">查看详情</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -219,8 +219,8 @@ ...@@ -219,8 +219,8 @@
pageNum:1, pageNum:1,
pageSize:10, pageSize:10,
condition:{ condition:{
// companyId:this.$route.params.id, companyId:this.$route.params.id,
companyId:285, // companyId:285,
} }
}, },
type:[], type:[],
...@@ -352,19 +352,22 @@ ...@@ -352,19 +352,22 @@
params.condition.companyName=this.companyName params.condition.companyName=this.companyName
} }
if(this.fxjbType.length > 0){ if(this.fxjbType.length > 0){
params.condition.fxjbType=this.fxjbType.join() params.condition.riskLevel=this.fxjbType
}else {
delete params.condition.riskLevel
} }
if(this.sffx.length > 0 && this.gsfx.length > 0){ if(this.sffx.length > 0 && this.gsfx.length > 0){
params.riskType='司法风险,工商风险' params.condition.riskType='司法风险,工商风险'
params.dimension=this.sffx.join()+','+this.gsfx.join() params.condition.dimension=this.sffx.concat(this.gsfx)
console.log(this.sffx.concat(this.gsfx))
} }
if(this.sffx.length > 0 && this.gsfx.length === 0){ if(this.sffx.length > 0 && this.gsfx.length === 0){
params.riskType='司法风险' params.condition.riskType='司法风险'
params.dimension=this.sffx.join() params.condition.dimension=this.sffx
} }
if(this.sffx.length === 0 && this.gsfx.length > 0){ if(this.sffx.length === 0 && this.gsfx.length > 0){
params.riskType='工商风险' params.condition.riskType='工商风险'
params.dimension=this.gsfx.join() params.condition.dimension=this.gsfx
} }
dynamicPage(params).then(res => { dynamicPage(params).then(res => {
this.isSkeleton = false; this.isSkeleton = false;
...@@ -387,7 +390,7 @@ ...@@ -387,7 +390,7 @@
}, },
getDetail(name,id) { getDetail(name,id) {
companyDetail({dimensionName:name,sourceId:id}).then(res => { companyDetail({dimensionName:name,sourceId:id}).then(res => {
console.log(res) this.dialogVisible=true;
this.detail=res.data; this.detail=res.data;
}) })
}, },
...@@ -413,33 +416,32 @@ ...@@ -413,33 +416,32 @@
switch (item.dimensionName) { switch (item.dimensionName) {
case '新增开庭公告': case '新增开庭公告':
this.title='开庭公告详情' this.title='开庭公告详情'
this.dialogVisible=true; this.getDetail(item.dimensionName,item.sourceId)
break; break;
case '新增法院公告': case '新增法院公告':
this.title='法院公告详情' this.title='法院公告详情'
this.dialogVisible=true; this.getDetail(item.dimensionName,item.sourceId)
break; break;
case '新增裁判文书': case '新增裁判文书':
this.title='裁判文书详情' this.title='裁判文书详情'
this.dialogVisible=true; this.getDetail(item.dimensionName,item.sourceId)
break; break;
case '新增经营异常': case '新增经营异常':
this.title='经营异常详情' this.title='经营异常详情'
this.dialogVisible=true; this.getDetail(item.dimensionName,item.sourceId)
break; break;
case '新增失信被执行人': case '新增失信被执行人':
this.title='失信被执行人详情' this.title='失信被执行人详情'
this.dialogVisible=true; this.getDetail(item.dimensionName,item.sourceId)
break; break;
case '新增股权冻结': case '新增股权冻结':
this.title='股权冻结详情' this.title='股权冻结详情'
this.dialogVisible=true; this.getDetail(item.dimensionName,item.sourceId)
break; break;
default: default:
this.$message.success("暂无详情"); this.$message.success("暂无详情");
break; break;
} }
this.getDetail(item.dimensionName,item.sourceId)
}, },
// 重置页数 // 重置页数
handleSizeChange(val) { handleSizeChange(val) {
...@@ -575,7 +577,13 @@ ...@@ -575,7 +577,13 @@
} }
} }
</script> </script>
<style lang="scss">
.el-select-dropdown__item.selected,
.el-select-dropdown.is-multiple .el-select-dropdown__item.selected::after{
color: #3181fa;
font-size: 0;
}
</style>
<style lang="scss" scoped> <style lang="scss" scoped>
.MonitoringReportDetails{ .MonitoringReportDetails{
.search{ .search{
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="renling"> <div class="renling">
<div style="display:flex;align-items:center"> <div style="display:flex;align-items:center">
<router-link :to="`/enterprise/${encodeStr(scope.row.id)}`" tag="a" <router-link :to="`/enterprise/${encodeStr(scope.row.id)}?path=cooperationRecord`" tag="a"
class="wordprimary" v-html="scope.row.name"></router-link> class="wordprimary" v-html="scope.row.name"></router-link>
</div> </div>
</div> </div>
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="renling"> <div class="renling">
<div style="display:flex;align-items:center"> <div style="display:flex;align-items:center">
<router-link :to="`/enterprise/${encodeStr(scope.row.id)}`" tag="a" <router-link :to="`/enterprise/${encodeStr(scope.row.id)}?path=cooperationRecord`" tag="a"
class="wordprimary" v-html="scope.row.name"></router-link> class="wordprimary" v-html="scope.row.name"></router-link>
</div> </div>
</div> </div>
......
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="renling"> <div class="renling">
<div style="display:flex;align-items:center"> <div style="display:flex;align-items:center">
<router-link v-if="scope.row.companyId" :to="`/enterprise/${encodeStr(scope.row.companyId)}`" tag="a" <router-link v-if="scope.row.companyId" :to="`/enterprise/${encodeStr(scope.row.companyId)}?path=cooperationRecord&companyName=${scope.row.customerName}`" tag="a"
class="wordprimary" v-html="scope.row.customerName"></router-link> class="wordprimary" v-html="scope.row.customerName"></router-link>
<span v-else v-html="scope.row.customerName"></span> <span v-else v-html="scope.row.customerName"></span>
</div> </div>
......
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="renling"> <div class="renling">
<div style="display:flex;align-items:center"> <div style="display:flex;align-items:center">
<router-link v-if="scope.row.companyId" :to="`/enterprise/${encodeStr(scope.row.companyId)}`" tag="a" <router-link v-if="scope.row.companyId" :to="`/enterprise/${encodeStr(scope.row.companyId)}?path=cooperationRecord&companyName=${scope.row.customerName}`" tag="a"
class="wordprimary" v-html="scope.row.customerName"></router-link> class="wordprimary" v-html="scope.row.customerName"></router-link>
<span v-else v-html="scope.row.customerName"></span> <span v-else v-html="scope.row.customerName"></span>
</div> </div>
......
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="renling"> <div class="renling">
<div style="display:flex;align-items:center"> <div style="display:flex;align-items:center">
<router-link v-if="scope.row.companyId" :to="`/enterprise/${encodeStr(scope.row.companyId)}`" tag="a" <router-link v-if="scope.row.companyId" :to="`/enterprise/${encodeStr(scope.row.companyId)}?path=cooperationRecord&companyName=${scope.row.customerName}`" tag="a"
class="wordprimary" v-html="scope.row.customerName"></router-link> class="wordprimary" v-html="scope.row.customerName"></router-link>
<span v-else v-html="scope.row.customerName"></span> <span v-else v-html="scope.row.customerName"></span>
</div> </div>
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="renling"> <div class="renling">
<div style="display:flex;align-items:center"> <div style="display:flex;align-items:center">
<router-link v-if="scope.row.companyId" :to="`/enterprise/${encodeStr(scope.row.companyId)}`" tag="a" <router-link v-if="scope.row.companyId" :to="`/enterprise/${encodeStr(scope.row.companyId)}?path=cooperationRecord&companyName=${scope.row.customerName}`" tag="a"
class="wordprimary" v-html="scope.row.customerName"></router-link> class="wordprimary" v-html="scope.row.customerName"></router-link>
<span v-else v-html="scope.row.customerName"></span> <span v-else v-html="scope.row.customerName"></span>
</div> </div>
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="renling"> <div class="renling">
<div style="display:flex;align-items:center"> <div style="display:flex;align-items:center">
<router-link v-if="scope.row.companyId" :to="`/enterprise/${encodeStr(scope.row.companyId)}`" tag="a" <router-link v-if="scope.row.companyId" :to="`/enterprise/${encodeStr(scope.row.companyId)}?path=cooperationRecord&companyName=${scope.row.customerName}`" tag="a"
class="wordprimary" v-html="scope.row.customerName"></router-link> class="wordprimary" v-html="scope.row.customerName"></router-link>
<span v-else v-html="scope.row.customerName"></span> <span v-else v-html="scope.row.customerName"></span>
</div> </div>
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="renling"> <div class="renling">
<div style="display:flex;align-items:center"> <div style="display:flex;align-items:center">
<router-link v-if="scope.row.companyId" :to="`/enterprise/${encodeStr(scope.row.companyId)}`" tag="a" <router-link v-if="scope.row.companyId" :to="`/enterprise/${encodeStr(scope.row.companyId)}?path=cooperationRecord&companyName=${scope.row.customerName}`" tag="a"
class="wordprimary" v-html="scope.row.customerName"></router-link> class="wordprimary" v-html="scope.row.customerName"></router-link>
<span v-else v-html="scope.row.customerName"></span> <span v-else v-html="scope.row.customerName"></span>
</div> </div>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="c-title">推送人信息</div> <div class="c-title">推送人信息</div>
<div class="main"> <div class="main">
<div class="table-item" v-if="tableDataTotal > 0 && !isSkeleton"> <div class="table-item" v-if="tableDataTotal > 0 && !isSkeleton">
<el-button class="btn" icon="el-icon-plus" type="primary">添加推送人</el-button> <el-button class="btn" icon="el-icon-plus" type="primary" @click="visible=true">添加推送人</el-button>
<el-table <el-table
class="fixed-table" class="fixed-table"
:data="tableData" :data="tableData"
...@@ -160,8 +160,8 @@ ...@@ -160,8 +160,8 @@
}); });
configKey("customer-badness-time-frame").then(response => { configKey("customer-badness-time-frame").then(response => {
let times = response.data.configValue.split("-"); let times = response.data.configValue.split("-");
this.startTime = times[0].length<2 ?'0'+times[0]+':00':times[0] this.startTime = times[0].length<2 ?'0'+times[0]+':00':times[0]+':00'
this.endTime = times[1].length<2 ?'0'+times[1]+':00':times[1] this.endTime = times[1].length<2 ?'0'+times[1]+':00':times[1]+':00'
}); });
this.getList() this.getList()
}, },
......
package com.dsk.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.system.domain.SysStatutoryHoliday;
public interface SysStatutoryHolidayMapper extends BaseMapper<SysStatutoryHoliday> {
}
...@@ -7,13 +7,9 @@ import cn.hutool.core.util.ObjectUtil; ...@@ -7,13 +7,9 @@ import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Assert;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsk.common.constant.TenantConstants; import com.dsk.common.constant.TenantConstants;
import com.dsk.system.domain.*;
import com.dsk.system.mapper.*;
import com.dsk.system.service.ISysRoleService;
import com.dsk.common.constant.UserConstants; import com.dsk.common.constant.UserConstants;
import com.dsk.common.core.domain.PageQuery; import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.domain.model.LoginUser; import com.dsk.common.core.domain.model.LoginUser;
...@@ -22,6 +18,9 @@ import com.dsk.common.exception.ServiceException; ...@@ -22,6 +18,9 @@ import com.dsk.common.exception.ServiceException;
import com.dsk.common.helper.LoginHelper; import com.dsk.common.helper.LoginHelper;
import com.dsk.common.utils.StreamUtils; import com.dsk.common.utils.StreamUtils;
import com.dsk.common.utils.StringUtils; import com.dsk.common.utils.StringUtils;
import com.dsk.system.domain.*;
import com.dsk.system.mapper.*;
import com.dsk.system.service.ISysRoleService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -406,8 +405,12 @@ public class SysRoleServiceImpl implements ISysRoleService { ...@@ -406,8 +405,12 @@ public class SysRoleServiceImpl implements ISysRoleService {
*/ */
@Override @Override
public int deleteAuthUser(SysUserRole userRole) { public int deleteAuthUser(SysUserRole userRole) {
//校验企业管理员角色下是否至少有一个账号 Set<String> rolePermission = Objects.requireNonNull(LoginHelper.getLoginUser()).getRolePermission();
checkAdminHasUsers(userRole.getRoleId()); if (rolePermission.contains(TenantConstants.TENANT_SUPER_ADMIN_ROLE_KEY)
|| rolePermission.contains(TenantConstants.TENANT_ADMIN_ROLE_KEY)) {
//校验企业管理员角色下是否至少有一个可用账号
checkAdminHasUsers(userRole.getRoleId());
}
//若该账号仅有一个角色,则不允许取消授权 //若该账号仅有一个角色,则不允许取消授权
SysUser sysUser = userMapper.selectUserById(userRole.getUserId()); SysUser sysUser = userMapper.selectUserById(userRole.getUserId());
...@@ -447,7 +450,7 @@ public class SysRoleServiceImpl implements ISysRoleService { ...@@ -447,7 +450,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
//将缺少角色的账号返回给前端 //将缺少角色的账号返回给前端
if (lackRoleAccount.toString().contains(",")) { if (lackRoleAccount.toString().contains(",")) {
throw new ServiceException(lackRoleAccount.substring(0, lackRoleAccount.length()-1)); throw new ServiceException(lackRoleAccount.substring(0, lackRoleAccount.length() - 1));
} }
//如果取消授权企业管理员角色下所有账号,则抛异常 //如果取消授权企业管理员角色下所有账号,则抛异常
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment