Commit 2d311b0b authored by lisong's avatar lisong

Merge remote-tracking branch 'origin/develop_dl_plan6' into develop_dl_plan6

parents 66a1a530 e0d40437
......@@ -71,8 +71,8 @@ public class PermissionInterceptor implements Interceptor {
// 被拦截方法
Method method = getTargetDataAuthMethod(mappedStatement);
DataAuth dataAuth = getTargetDataAuthAnnotation(mappedStatement);
// 没有DataAuth定义注解的跳过及没有手动指定使用数据规则的跳过
if (null == dataAuth && ValidationUtil.isEmpty(dataAuthRule)) {
// 没有DataAuth定义注解或注解为空的跳过及没有手动指定使用数据规则的跳过
if ((null == dataAuth || ValidationUtil.isEmpty(dataAuth.interfacePath())) && ValidationUtil.isEmpty(dataAuthRule)) {
PermissionInterceptorContext.clean();
return invocation.proceed();
}
......@@ -94,11 +94,11 @@ public class PermissionInterceptor implements Interceptor {
try {
sql = processSelectSql(sql, dataAuthorization, reginParam, boundSql);
} catch (Exception e) {
PermissionInterceptorContext.clean();
PermissionInterceptorContext.clean(dataAuthRule);
logger.debug(e.getMessage());
}
metaObject.setValue("delegate.boundSql.sql", sql);
PermissionInterceptorContext.clean();
PermissionInterceptorContext.clean(dataAuthRule);
return invocation.proceed();
}
......
......@@ -22,9 +22,17 @@ public class PermissionInterceptorContext {
public static void clean() {
if (requestContext != null) {
logger.info("clean RestThreadLocal......Begin");
logger.info("PermissionInterceptorContext clean RestThreadLocal......Begin");
requestContext.remove();
logger.info("clean RestThreadLocal......Done");
logger.info("PermissionInterceptorContext clean RestThreadLocal......Done");
}
}
public static void clean(String info) {
if (requestContext != null) {
logger.info("......" + info + "......PermissionInterceptorContext clean RestThreadLocal......Begin");
requestContext.remove();
logger.info("......" + info + "......PermissionInterceptorContext clean RestThreadLocal......Done");
}
}
}
......@@ -104,14 +104,12 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
OrgUsr queryByUserId(@Param("userId")Long userId);
@DataAuth(interfacePath = "")
List<OrgUsr> companyTreeByUserAndType(Map<String, Object> param);
List<OrgUsr> equipCompanyExport(String bizOrgCode);
OrgUsr queryBySequenceNbr(@Param("parentId") String parentId);
@DataAuth(interfacePath="")
List<OrgUsr> companyDeptListWithPersonCount(Map<String, Object> param);
List<OrgUsr> companyTreeByUser(String bizOrgCode);
......
......@@ -147,20 +147,16 @@ public class EqEqDynamicFormServiceImpl implements IEqDynamicFormService {
//3.处理子分组数据
List<DynamicFormGroup> groupList = iEqDynamicFormGroupService.list(new LambdaQueryWrapper<DynamicFormGroup>()
.eq(DynamicFormGroup::getParentId, dynamicFormGroupVo.getId()).eq(DynamicFormGroup::getParentId, dynamicFormGroupVo.getId()).orderByAsc(DynamicFormGroup::getSort));
List<DynamicFormGroupVo> formGroupVos=new ArrayList<>();
List<DynamicFormGroupVo> formGroupVos1 = groupList.stream().map(s -> {
List<DynamicFormGroupVo> formGroupVos = new ArrayList<>();
groupList.forEach(s -> {
this.stringToJsonGroupConfig(s);
JSONObject jsonObject =s.getGroupConfig();
if((jsonObject.get("isSelect").toString()).equals("true")){
if(jsonObject.get("isSelect") != null && "true".equals(jsonObject.get("isSelect").toString())){
DynamicFormGroupVo target = new DynamicFormGroupVo();
Bean.copyExistPropertis(s, target);
formGroupVos.add(target);
return target;
}
return null;
}).collect(Collectors.toList());
});
formGroupVos.forEach(v -> {
this.fillFormColumnWithFiledValue(v, formInstanceMap);
buildGroupsAndColumnsTreeWithValue(v, dynamicFormInstances);
......
......@@ -226,8 +226,6 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// AST数据同步
List<FireFightingSystem> fireFightingSystemDetail = getFireFightingSystemDetail(vo);
syncDataService.syncCreatedFireFightingSystem(fireFightingSystemDetail);
} else {
return s;
}
// 3.保存图片数据
this.insertFiles(vo);
......@@ -241,8 +239,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
// 验证必填项 BUG 2725 by kongfm 2021-09-09
List<DynamicFormInstance> formInstance = vo.getFormInstances();
formInstance.stream().forEach(item -> {
if (item.getNotNull() == true && StringUtils.isEmpty(item.getFieldValue())) {
formInstance.forEach(item -> {
if (item.getNotNull() && StringUtils.isEmpty(item.getFieldValue())) {
throw new BadRequest(item.getFieldLabel() + "为必填项,请确认");
}
});
......@@ -262,8 +260,6 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// AST数据同步
List<FireFightingSystem> fireFightingSystemDetail = getFireFightingSystemDetail(vo);
syncDataService.syncCreatedFireFightingSystem(fireFightingSystemDetail);
} else {
return null;
}
// 1.更新消防系统数据
String sequenceNbr = vo.getId();
......
......@@ -492,7 +492,8 @@ public class DataSourcesImpl implements DataSources {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
// 权限处理
PermissionInterceptorContext.setDataAuthRule("key_site_info");
List<OrgMenuDto> orgUsrTree = iOrgUsrService.companyTreeByUserAndType(reginParams, OrgPersonEnum.公司.getKey());
// 修改bug6829 查询单位和部门数据
List<OrgMenuDto> orgUsrTree = iOrgUsrService.companyTreeByUserAndType(reginParams, null);
// List<OrgMenuDto> orgUsrTree = orgUsrService.getTree(null, orgUsrService.getCompanyDetailTree(),
// OrgUsr.class.getName(), "getSequenceNbr", 2, "getBizOrgName", "getParentId", "getBizOrgType");
......
......@@ -2488,38 +2488,41 @@
</select>
<select id="getFireCarInfoByWL" resultType="java.util.Map">
SELECT
`wc`.`id` AS `id`,
`wc`.`name` AS `name`,
max( CASE WHEN ( `wcp`.`equipment_index_key` = 'FireCar_WaterCapacity' ) THEN `wcp`.`value` END ) AS `waterCapacity`,
max( CASE WHEN ( `wcp`.`equipment_index_key` = 'FireCar_FoamCapacity' ) THEN `wcp`.`value` END ) AS `foamCapacity`,
max(
CASE
WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'true' ) THEN
'启动'
WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'false' ) THEN
'熄火'
END
) AS `carState`,
max(
CASE
WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'true' ) THEN
`wcp`.`update_date`
WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'false' ) THEN
`wcp`.`update_date`
END
) AS `carStateDate`
select a.* from
(SELECT
`wc`.`id` AS `id`,
`wc`.`name` AS `name`,
max( CASE WHEN ( `wcp`.`equipment_index_key` = 'FireCar_WaterCapacity' ) THEN `wcp`.`value` END ) AS
`waterCapacity`,
max( CASE WHEN ( `wcp`.`equipment_index_key` = 'FireCar_FoamCapacity' ) THEN `wcp`.`value` END ) AS
`foamCapacity`,
max(
CASE
WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'true' ) THEN
'启动'
WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'false' ) THEN
'熄火'
END
) AS `carState`,
max(
CASE
WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'true' ) THEN
`wcp`.`update_date`
WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'false' ) THEN
`wcp`.`update_date`
END
) AS `carStateDate`
FROM
`wl_car` `wc`
LEFT JOIN `wl_car_property` `wcp` ON `wcp`.`car_id` = `wc`.`id`
`wl_car` `wc`
LEFT JOIN `wl_car_property` `wcp` ON `wcp`.`car_id` = `wc`.`id`
<where>
1=1
<if test="bizOrgCode!=null and bizOrgCode!=''">
AND wc.biz_org_code = #{bizOrgCode,jdbcType=VARCHAR}
</if>
</where>
</where>) a
</select>
<select id="getWaterInfo" resultType="java.util.Map">
......
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