This commit is contained in:
DirectionOfMind 2020-12-28 15:08:36 +08:00
commit 33471799e3
7 changed files with 46 additions and 4 deletions

View File

@ -63,11 +63,12 @@ public class DataScopeInterceptor extends AbstractSqlParserHandler implements In
String originalSql = boundSql.getSql(); String originalSql = boundSql.getSql();
Object parameterObject = boundSql.getParameterObject(); Object parameterObject = boundSql.getParameterObject();
MappedStatement mappedStatement = (MappedStatement) metaObject.getValue("delegate.mappedStatement"); MappedStatement mappedStatement = (MappedStatement) metaObject.getValue("delegate.mappedStatement");
String sqlCommandTypePre = "SELECT SQL = "; String mapperdId = getMapperId(mappedStatement);
String sqlCommandTypePre = "SELECT SQL = " + mapperdId + " ";
if(SqlCommandType.INSERT.equals(mappedStatement.getSqlCommandType())){ if(SqlCommandType.INSERT.equals(mappedStatement.getSqlCommandType())){
sqlCommandTypePre = "INSERT SQL = "; sqlCommandTypePre = "INSERT SQL = " + mapperdId + " ";
}else if (SqlCommandType.UPDATE.equals(mappedStatement.getSqlCommandType())){ }else if (SqlCommandType.UPDATE.equals(mappedStatement.getSqlCommandType())){
sqlCommandTypePre = "UPDATE SQL = "; sqlCommandTypePre = "UPDATE SQL = " + mapperdId + " ";
} }
Configuration configuration = mappedStatement.getConfiguration(); Configuration configuration = mappedStatement.getConfiguration();
@ -170,6 +171,26 @@ public class DataScopeInterceptor extends AbstractSqlParserHandler implements In
} }
public static String getMapperId(MappedStatement mappedStatement) {
try {
String id = mappedStatement.getId();
if(id.contains(".")){
String ids []= id.split("\\.");
return ids[ids.length -2 ] +"."+ ids[ids.length -1 ];
}
return null;
} catch (Exception e) {
e.printStackTrace();
} finally {
}
return "";
}
public static void main(String[] args) {
}
/** /**
* 查找参数是否包括DataScope对象 * 查找参数是否包括DataScope对象
* *

View File

@ -63,6 +63,8 @@ public class ShiroConfig {
filterMap.put("/swagger-resources/**", "anon"); filterMap.put("/swagger-resources/**", "anon");
filterMap.put("/captcha.jpg", "anon"); filterMap.put("/captcha.jpg", "anon");
filterMap.put("/aaa.txt", "anon"); filterMap.put("/aaa.txt", "anon");
filterMap.put("/oneCode/update/prints", "anon");
filterMap.put("/oneCode/no/prints", "anon");
filterMap.put("/dtlg/login", "anon"); filterMap.put("/dtlg/login", "anon");
filterMap.put("/dtlg/luck", "anon"); filterMap.put("/dtlg/luck", "anon");
filterMap.put("/dtlg/look", "anon"); filterMap.put("/dtlg/look", "anon");

View File

@ -109,4 +109,6 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
List<FlowRecord> selectFlowRecordByRecordIdsFlowProcess(@Param("recordIds") List<Long> recordIds, @Param("flowProcess") Long flowProcess); List<FlowRecord> selectFlowRecordByRecordIdsFlowProcess(@Param("recordIds") List<Long> recordIds, @Param("flowProcess") Long flowProcess);
List<FlowRecord> selectFlowRecordByRecordIdsStatus(@Param("recordIds") List<Long> recordIds, @Param("status") int status); List<FlowRecord> selectFlowRecordByRecordIdsStatus(@Param("recordIds") List<Long> recordIds, @Param("status") int status);
List<FlowRecord> selectFlowRecordByRecordIdsFlowProcessAndStatus(List<Long> recordIds, Long flowProcess, int status);
} }

View File

@ -105,4 +105,6 @@ public interface FlowRecordService extends IService<FlowRecord> {
List<FlowRecord> selectFlowRecordByRecordIdsFlowProcess(List<Long> recordIds, Long flowProcess); List<FlowRecord> selectFlowRecordByRecordIdsFlowProcess(List<Long> recordIds, Long flowProcess);
List<FlowRecord> selectFlowRecordByRecordIdsStatus(List<Long> recordIds, int status); List<FlowRecord> selectFlowRecordByRecordIdsStatus(List<Long> recordIds, int status);
List<FlowRecord> selectFlowRecordByRecordIdsFlowProcessAndStatus(List<Long> recordIds, Long flowProcess, int status);
} }

View File

@ -276,4 +276,9 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
return flowRecordMapper.selectFlowRecordByRecordIdsStatus(recordIds,status); return flowRecordMapper.selectFlowRecordByRecordIdsStatus(recordIds,status);
} }
@Override
public List<FlowRecord> selectFlowRecordByRecordIdsFlowProcessAndStatus(List<Long> recordIds, Long flowProcess, int status){
return flowRecordMapper.selectFlowRecordByRecordIdsFlowProcessAndStatus(recordIds, flowProcess, status);
}
} }

View File

@ -301,7 +301,7 @@ public class AssessManagerController extends AbstractController{
log.info("催当前节点的人员,数量{}", flowRecords.size()); log.info("催当前节点的人员,数量{}", flowRecords.size());
}else{ }else{
flowRecords = flowRecords =
flowRecordService.selectFlowRecordByRecordIdsFlowProcess(recordIds, flowProcess); flowRecordService.selectFlowRecordByRecordIdsFlowProcessAndStatus(recordIds, flowProcess, 2);
log.info("催指定节点的人员,数量{}", flowRecords.size()); log.info("催指定节点的人员,数量{}", flowRecords.size());
} }

View File

@ -384,5 +384,15 @@
</select> </select>
<select id="selectFlowRecordByRecordIdsFlowProcessAndStatus" resultType="com.lz.modules.flow.entity.FlowRecord">
select * from lz_flow_record where is_delete = 0
and record_id in
<foreach item="recordId" collection="recordIds" open="(" separator="," close=")">
#{recordId}
</foreach>
and flow_process = #{flowProcess} and status=#{status}
</select>
</mapper> </mapper>