Commit 2b842ea6 authored by 查济's avatar 查济

Merge branch 'feature-zhaji' into 'develop'

Feature zhaji

See merge request fangxinjiang/yifu!201
parents 61705ee2 4367a7db
......@@ -49,6 +49,7 @@ public class InsurancesDataSourceConfig {
GlobalConfig globalConfig = new GlobalConfig();
globalConfig.setMetaObjectHandler(new MybatisPlusMetaObjectHandler());
globalConfig.setDbConfig(new GlobalConfig.DbConfig());
globalConfig.setBanner(false);
bean.setGlobalConfig(globalConfig);
//添加XML目录
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
......@@ -57,9 +58,8 @@ public class InsurancesDataSourceConfig {
//分页插件配置,不配置分页插件无效,否则会出现total为0的情况
bean.setPlugins(insurancesPlusInterceptor());
SqlSessionFactory sqlSessionFactory = bean.getObject();
assert sqlSessionFactory != null;
sqlSessionFactory.getConfiguration().setMapUnderscoreToCamelCase(true);
return bean.getObject();
return sqlSessionFactory;
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
......@@ -75,7 +75,8 @@ public class InsurancesDataSourceConfig {
}
@Bean
@Bean(name = "insurancesTransactionManager")
@Primary
public DataSourceTransactionManager insurancesTransactionManager(@Qualifier("insurancesDataSource") DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
......
......@@ -2748,9 +2748,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @param displayFlag 是否显示 0不显示/1显示
* @return void
*/
private void addOperate(List<TInsuranceDetail> detailList,YifuUser user,String operateDesc,String remark,Integer displayFlag){
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public void addOperate(List<TInsuranceDetail> detailList,YifuUser user,String operateDesc,String remark,Integer displayFlag){
if (CollectionUtils.isNotEmpty(detailList)){
try {
List<TInsuranceOperate> operateList = new ArrayList<>();
for (TInsuranceDetail detail : detailList) {
TInsuranceOperate operate = new TInsuranceOperate();
......@@ -2764,9 +2764,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
operateList.add(operate);
}
tInsuranceOperateService.saveBatch(operateList);
}catch (Exception e){
e.getStackTrace();
}
}
}
......@@ -2779,7 +2776,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @param operateDesc 操作描述
* @return void
*/
private void addOperate(List<InsuranceHandleParam> paramList,YifuUser user,String operateDesc){
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public void addOperate(List<InsuranceHandleParam> paramList,YifuUser user,String operateDesc){
if (CollectionUtils.isNotEmpty(paramList)){
try {
List<TInsuranceOperate> operateList = new ArrayList<>();
......@@ -4640,7 +4638,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//查数据是否存在权限范围内
String regionSQL = getRegionSQL(user);
TInsuranceDetail detailByRegionSQL = this.baseMapper.selectByregionSQL(regionSQL,detailId);
if (!Optional.ofNullable(detailByRegionSQL).isPresent()){
if (!Optional.ofNullable(detailByRegionSQL).isPresent() || !user.getId().equals(detailByRegionSQL.getUpdateBy())){
param.setErrorMessage(InsurancesConstants.NO_DETAIL_JURISDICTION);
errorList.add(param);
continue;
......
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