Commit 6cadd7f4 authored by suhuiguang's avatar suhuiguang

Merge branch 'dev_upgrade' of http://172.16.10.76/station/YeeAmosFireAutoSysRoot into dev_upgrade

parents 5aa8b503 40c05da8
...@@ -42,7 +42,7 @@ public class RiskLevelController extends BaseController { ...@@ -42,7 +42,7 @@ public class RiskLevelController extends BaseController {
public CommonResponse queryRiskLevelPage(@ApiParam(value = "查询条件") @RequestBody(required = false) List<CommonRequest> queryRequests, public CommonResponse queryRiskLevelPage(@ApiParam(value = "查询条件") @RequestBody(required = false) List<CommonRequest> queryRequests,
@ApiParam(value = "分页参数", required = true) CommonPageable commonPageable) { @ApiParam(value = "分页参数", required = true) CommonPageable commonPageable) {
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable); CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
Page<HashMap<String, Object>> list = iRiskLevelService.queryRiskLevelPage(param); Page<HashMap<String, Object>> list = iRiskLevelService.queryRiskLevelPage(getToken(),getProduct(),getAppKey(),param);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
} }
......
...@@ -85,28 +85,36 @@ public class AccidentTypeServiceImpl implements IAccidentTypeService { ...@@ -85,28 +85,36 @@ public class AccidentTypeServiceImpl implements IAccidentTypeService {
{ {
String userId = String.valueOf(map.get("createBy")); String userId = String.valueOf(map.get("createBy"));
String deptId = String.valueOf(map.get("deptId")); String deptId = String.valueOf(map.get("deptId"));
if(userId!=null) if(userId!=null&&!userIdList.contains(userId))
{ {
userIdList.add(userId); userIdList.add(userId);
} }
if(deptId!=null) if(deptId!=null&&!deptIdList.contains(deptId))
{ {
deptIdList.add(deptId); deptIdList.add(deptId);
} }
} }
List<AgencyUserModel> users =remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIdList));
Map<String, String> userMap = new HashMap<String,String>(); Map<String, String> userMap = new HashMap<String,String>();
for (int i = 0; i < users.size(); i++) { Map<String, String> deptMap = new HashMap<String,String>();
userMap.put(users.get(i).getUserId(), users.get(i).getUserName());
} if(userIdList.size()>0)
List<LinkedHashMap> depts =remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIdList)); {
Map<String, String> deptMap = new HashMap<String,String>(); List<AgencyUserModel> users =remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIdList));
for (int i = 0; i < depts.size(); i++) { for (int i = 0; i < users.size(); i++) {
deptMap.put(depts.get(i).get("sequenceNbr").toString(), depts.get(i).get("departmentName").toString()); userMap.put(users.get(i).getUserId(), users.get(i).getUserName());
} }
}
if(deptIdList.size()>0)
{
List<LinkedHashMap> depts =remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIdList));
for (int i = 0; i < depts.size(); i++) {
deptMap.put(depts.get(i).get("sequenceNbr").toString(), depts.get(i).get("departmentName").toString());
}
}
content.forEach(e -> { content.forEach(e -> {
e.put("userName",userMap.get(e.get("createBy"))); e.put("userName",userMap.get(String.valueOf(e.get("createBy"))));
e.put("deptName",deptMap.get(e.get("deptId"))); e.put("deptName",deptMap.get(String.valueOf(e.get("deptId"))));
}); });
Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total); Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total);
return result; return result;
......
...@@ -12,7 +12,6 @@ import com.yeejoin.amos.fas.core.common.request.CommonPageable; ...@@ -12,7 +12,6 @@ import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil; import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import com.yeejoin.amos.fas.core.util.StringUtil; import com.yeejoin.amos.fas.core.util.StringUtil;
import com.yeejoin.amos.fas.dao.entity.FireCar;
import com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint; import com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint;
import org.assertj.core.util.Lists; import org.assertj.core.util.Lists;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
......
...@@ -52,28 +52,37 @@ public class RiskFactorServiceImpl implements IRiskFactorService { ...@@ -52,28 +52,37 @@ public class RiskFactorServiceImpl implements IRiskFactorService {
{ {
String userId = String.valueOf(map.get("createBy")); String userId = String.valueOf(map.get("createBy"));
String deptId = String.valueOf(map.get("deptId")); String deptId = String.valueOf(map.get("deptId"));
if(userId!=null) if(userId!=null&&!userIdList.contains(userId))
{ {
userIdList.add(userId); userIdList.add(userId);
} }
if(deptId!=null) if(deptId!=null&&!deptIdList.contains(deptId))
{ {
deptIdList.add(deptId); deptIdList.add(deptId);
} }
} }
List<AgencyUserModel> users =remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIdList));
Map<String, String> userMap = new HashMap<String,String>(); Map<String, String> userMap = new HashMap<String,String>();
for (int i = 0; i < users.size(); i++) { Map<String, String> deptMap = new HashMap<String,String>();
userMap.put(users.get(i).getUserId(), users.get(i).getUserName());
} if(userIdList.size()>0)
List<LinkedHashMap> depts =remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIdList)); {
Map<String, String> deptMap = new HashMap<String,String>(); List<AgencyUserModel> users =remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIdList));
for (int i = 0; i < depts.size(); i++) { for (int i = 0; i < users.size(); i++) {
deptMap.put(depts.get(i).get("sequenceNbr").toString(), depts.get(i).get("departmentName").toString()); userMap.put(users.get(i).getUserId(), users.get(i).getUserName());
} }
}
if(deptIdList.size()>0)
{
List<LinkedHashMap> depts =remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIdList));
for (int i = 0; i < depts.size(); i++) {
deptMap.put(depts.get(i).get("sequenceNbr").toString(), depts.get(i).get("departmentName").toString());
}
}
content.forEach(e -> { content.forEach(e -> {
e.put("userName",userMap.get(e.get("createBy"))); e.put("userName",userMap.get(String.valueOf(e.get("createBy"))));
e.put("deptName",deptMap.get(e.get("deptId"))); e.put("deptName",deptMap.get(String.valueOf(e.get("deptId"))));
}); });
Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total); Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total);
return result; return result;
......
...@@ -3,17 +3,22 @@ package com.yeejoin.amos.fas.business.service.impl; ...@@ -3,17 +3,22 @@ package com.yeejoin.amos.fas.business.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.google.common.base.Joiner;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.fas.business.dao.mapper.RiskLevelMapper; import com.yeejoin.amos.fas.business.dao.mapper.RiskLevelMapper;
import com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao; import com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao;
import com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao; import com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam; import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.service.intfc.IRiskLevelService; import com.yeejoin.amos.fas.business.service.intfc.IRiskLevelService;
import com.yeejoin.amos.fas.dao.entity.RiskLevel; import com.yeejoin.amos.fas.dao.entity.RiskLevel;
...@@ -29,31 +34,29 @@ public class RiskLevelServiceImpl implements IRiskLevelService { ...@@ -29,31 +34,29 @@ public class RiskLevelServiceImpl implements IRiskLevelService {
IRiskLevelDao iRiskLevelDao; IRiskLevelDao iRiskLevelDao;
@Autowired @Autowired
IRiskSourceDao iRiskSourceDao; IRiskSourceDao iRiskSourceDao;
@Autowired
private RemoteSecurityService remoteSecurityService;
@Override @Override
public Page<HashMap<String, Object>> queryRiskLevelPage(CommonPageInfoParam param) { public Page<HashMap<String, Object>> queryRiskLevelPage(String toke,String product,String appKey,CommonPageInfoParam param) {
long total = riskLevelMapper.countPageData(param); long total = riskLevelMapper.countPageData(param);
List<HashMap<String, Object>> content = riskLevelMapper.queryRiskLevelPage(param); List<HashMap<String, Object>> content = riskLevelMapper.queryRiskLevelPage(param);
StringBuffer sb = new StringBuffer(); Set<String> userIdList = new HashSet<String>();
for(HashMap<String, Object> map : content) for(HashMap<String, Object> map : content)
{ {
sb.append(map.get("createBy")); userIdList.add(String.valueOf(map.get("createBy")));
sb.append(map.get(","));
} }
sb.deleteCharAt(sb.length()-1); Map<String, String> userMap = new HashMap<String,String>();
FeignClientResult<List<AgencyUserModel>> resultSec = Privilege.agencyUserClient.queryByIds(sb.toString()); if(userIdList.size()>0)
for(HashMap<String, Object> map : content)
{ {
String userId =String.valueOf(map.get("createBy")) ; List<AgencyUserModel> users =remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIdList));
for(AgencyUserModel user : resultSec.getResult()) for (int i = 0; i < users.size(); i++) {
{ userMap.put(users.get(i).getUserId(), users.get(i).getUserName());
if(userId!=null&& userId.equals(user.getUserId())) }
{
map.put("userName", user.getRealName());
break;
}
}
} }
content.forEach(e -> {
e.put("userName",userMap.get(String.valueOf(e.get("createBy"))));
});
Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total); Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total);
return result; return result;
} }
......
...@@ -587,30 +587,37 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -587,30 +587,37 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
{ {
String userId = String.valueOf(map.get("userId")); String userId = String.valueOf(map.get("userId"));
String deptId = String.valueOf(map.get("deptId")); String deptId = String.valueOf(map.get("deptId"));
if(userId!=null) if(userId!=null&&!userIdList.contains(userId))
{ {
userIdList.add(userId); userIdList.add(userId);
} }
if(deptId!=null) if(deptId!=null&&!deptIdList.contains(deptId))
{ {
deptIdList.add(deptId); deptIdList.add(deptId);
} }
} }
List<AgencyUserModel> users =remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIdList));
Map<String, String> userMap = new HashMap<String,String>(); Map<String, String> userMap = new HashMap<String,String>();
for (int i = 0; i < users.size(); i++) { Map<String, String> deptMap = new HashMap<String,String>();
userMap.put(users.get(i).getUserId(), users.get(i).getUserName());
userMap.put(users.get(i).getUserId()+"tel", users.get(i).getMobile()); if(userIdList.size()>0)
} {
List<LinkedHashMap> depts =remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIdList)); List<AgencyUserModel> users =remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIdList));
Map<String, String> deptMap = new HashMap<String,String>(); for (int i = 0; i < users.size(); i++) {
for (int i = 0; i < depts.size(); i++) { userMap.put(users.get(i).getUserId(), users.get(i).getUserName());
deptMap.put(depts.get(i).get("sequenceNbr").toString(), depts.get(i).get("departmentName").toString()); }
} }
if(deptIdList.size()>0)
{
List<LinkedHashMap> depts =remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIdList));
for (int i = 0; i < depts.size(); i++) {
deptMap.put(depts.get(i).get("sequenceNbr").toString(), depts.get(i).get("departmentName").toString());
}
}
content.forEach(e -> { content.forEach(e -> {
e.put("username",userMap.get(e.get("userId"))); e.put("username",userMap.get(String.valueOf(e.get("userId"))));
e.put("depName",deptMap.get(e.get("deptId"))); e.put("depName",deptMap.get(String.valueOf(e.get("deptId"))));
e.put("tel",userMap.get(e.get("deptId")+"tel")); e.put("tel",userMap.get(String.valueOf(e.get("deptId")+"tel")));
}); });
return new PageImpl<>(content, null, total); return new PageImpl<>(content, null, total);
} }
......
...@@ -10,7 +10,7 @@ import com.yeejoin.amos.fas.dao.entity.RiskLevel; ...@@ -10,7 +10,7 @@ import com.yeejoin.amos.fas.dao.entity.RiskLevel;
public interface IRiskLevelService { public interface IRiskLevelService {
Page<HashMap<String, Object>> queryRiskLevelPage(CommonPageInfoParam param); Page<HashMap<String, Object>> queryRiskLevelPage(String toke,String product,String appKey,CommonPageInfoParam param);
void editRiskLevel(HashMap<String, Object> map); void editRiskLevel(HashMap<String, Object> map);
......
spring.application.name = AMOS-FIREAUTOSYS-SUHG spring.application.name = AMOS-AUTOSYS-XKQ1
server.port = 8083 server.port = 8083
spring.profiles.active=dev spring.profiles.active=dev
#spring.freemarker.cache=false #spring.freemarker.cache=false
spring.devtools.restart.enabled=true spring.devtools.restart.enabled=true
spring.devtools.restart.additional-paths=src/main/java spring.devtools.restart.additional-paths=src/main/java
spring.devtools.restart.exclude=WEB-INF/** spring.devtools.restart.exclude=WEB-INF/**
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
#JPA Configuration: #JPA Configuration:
# Show or not log for each sql query # Show or not log for each sql query
spring.jpa.show-sql = true spring.jpa.show-sql = true
# Hibernate ddl auto (create, create-drop, update): with "update" the database # Hibernate ddl auto (create, create-drop, update): with "update" the database
# schema will be automatically updated accordingly to java entities found in # schema will be automatically updated accordingly to java entities found in
# the project # the project
spring.jpa.hibernate.ddl-auto = none spring.jpa.hibernate.ddl-auto = none
# Naming strategy # Naming strategy
#spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl #spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
# Allows Hibernate to generate SQL optimized for a particular DBMS # Allows Hibernate to generate SQL optimized for a particular DBMS
spring.jpa.database-platform = org.hibernate.dialect.MySQLDialect spring.jpa.database-platform = org.hibernate.dialect.MySQLDialect
spring.jpa.open-in-view = true spring.jpa.open-in-view = true
#mybatis mapper file #mybatis mapper file
mybatis.mapper-locations = classpath:db/mapper/*.xml mybatis.mapper-locations = classpath:db/mapper/*.xml
# mybatis entity package # mybatis entity package
mybatis.type-aliases-package = com.yeejoin.amos.fas.business.entity.mybatis mybatis.type-aliases-package = com.yeejoin.amos.fas.business.entity.mybatis
mybatis.configuration.mapUnderscoreToCamelCase=true mybatis.configuration.mapUnderscoreToCamelCase=true
logging.level.com.yeejoin.amos.fas.business.dao.mapper=debug logging.level.com.yeejoin.amos.fas.business.dao.mapper=debug
#liquibase #liquibase
spring.liquibase.change-log = classpath:/db/changelog/changelog-master.xml spring.liquibase.change-log = classpath:/db/changelog/changelog-master.xml
spring.liquibase.enabled= false spring.liquibase.enabled= false
param.system.online.date = 2020-02-12 param.system.online.date = 2020-02-12
visual.fegin.name=maas-visual visual.fegin.name=maas-visual
spring.http.multipart.maxFileSize = 10480000 spring.http.multipart.maxFileSize = 10480000
spring.http.multipart.MaxRequestSize = 50480000 spring.http.multipart.MaxRequestSize = 50480000
windows.img.path = D:\\ windows.img.path = D:\\
linux.img.path = / linux.img.path = /
dutyMode.fegin.name=AMOSDUTYMODE
param.safetyIndexChange.cron = 0 0 2 * * ? Push.fegin.name=PPMESSAGEPUSHSERVICE15
dutyMode.fegin.name=AMOSDUTYMODE
param.safetyIndexChange.cron = 0 0 2 * * ?
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
a.accident_type_id as accidentTypeId, a.accident_type_id as accidentTypeId,
d.name as accidentName, d.name as accidentName,
a.type, a.type,
a.dept_id as deptId,, a.dept_id as deptId,
a.create_by as createBy, a.create_by as createBy,
a.create_date as createDate, a.create_date as createDate,
a.remark a.remark
......
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