Commit e20393d3 authored by chenzhao's avatar chenzhao

Merge branch 'develop_dl_plan6_temp' of…

Merge branch 'develop_dl_plan6_temp' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6_temp
parents 4ecfe049 8ec125fe
......@@ -850,6 +850,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RuntimeException(e.getMessage());
}
// return deptMap;
}
......
......@@ -210,7 +210,7 @@ public class JobService implements IJobService {
Map<Long, Check> checkMap = new HashMap<>();
Set<Long> checkIds = new HashSet<Long>();
Map<String,String> deptMap =new HashMap<>();
Toke toke= remoteSecurityService.getServerToken();
//Toke toke= remoteSecurityService.getServerToken();
//查询用户名字
//修改巡检p_plan_task orgcode为执行人的org_coed -- add by wujunkai 20201216
......@@ -358,28 +358,28 @@ public class JobService implements IJobService {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String[] ids = usrIds.split(",");
for (String userId : usrIds.split(",")) {
Map<String,AgencyUserModel> agencyUserModelMap = remoteSecurityService.getUsersMap(toke.getToke(),toke.getProduct(),toke.getAppKey(), Collections.singleton(userIds));
List<Map<String, String>> idOrgCodeList = new ArrayList<>();
for(Map.Entry<String, AgencyUserModel> entry : agencyUserModelMap.entrySet()){
String id = entry.getKey();
AgencyUserModel agencyUserModel = entry.getValue();
StringBuffer agencyUserOrgcode = new StringBuffer();
agencyUserModel.getCompanys().forEach(companyModel -> {
agencyUserOrgcode.append(companyModel.getOrgCode()).append(",");
});
Map<String,String> map = new HashMap<>();
map.put(id,agencyUserOrgcode.toString().substring(0,agencyUserOrgcode.length()-1));
}
Map<String, String> userIdOrgCodeMap = new HashMap<>(ids.length);
if (!CollectionUtils.isEmpty(idOrgCodeList)) {
userIdOrgCodeMap = idOrgCodeList.stream().collect(Collectors.toMap(x-> String.valueOf(x.get(
"id")), x->x.get("org_code")));
}
// Map<String,AgencyUserModel> agencyUserModelMap = remoteSecurityService.getUsersMap(toke.getToke(),toke.getProduct(),toke.getAppKey(), Collections.singleton(userIds));
// List<Map<String, String>> idOrgCodeList = new ArrayList<>();
// for(Map.Entry<String, AgencyUserModel> entry : agencyUserModelMap.entrySet()){
// String id = entry.getKey();
// AgencyUserModel agencyUserModel = entry.getValue();
// StringBuffer agencyUserOrgcode = new StringBuffer();
// agencyUserModel.getCompanys().forEach(companyModel -> {
// agencyUserOrgcode.append(companyModel.getOrgCode()).append(",");
// });
// Map<String,String> map = new HashMap<>();
// map.put(id,agencyUserOrgcode.toString().substring(0,agencyUserOrgcode.length()-1));
// }
// Map<String, String> userIdOrgCodeMap = new HashMap<>(ids.length);
// if (!CollectionUtils.isEmpty(idOrgCodeList)) {
// userIdOrgCodeMap = idOrgCodeList.stream().collect(Collectors.toMap(x-> String.valueOf(x.get(
// "id")), x->x.get("org_code")));
// }
if (ObjectUtils.isEmpty(userId)) {
continue;
}
// planTaskMapper.reformStatistics(userId, sdf.format(new Date()), planTask.getOrgCode());
planTaskMapper.reformStatistics(userId, sdf.format(new Date()), userIdOrgCodeMap.get(userId));
planTaskMapper.reformStatistics(userId, sdf.format(new Date()), planTask.getOrgCode());
}
}
......
......@@ -41,7 +41,7 @@
<if test="orgCode!=null">
and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})
</if>
<if test="bizOrgCode!=null"> and d.biz_org_code = #{bizOrgCode}</if>
<if test="bizOrgCode!=null"> and a.org_Code like concat (#{bizOrgCode},"%")</if>
</where>
......@@ -118,7 +118,7 @@
<if test="status!=null"> and b.is_finish = #{status}</if>
<if test="routeId!=null"> and a.route_id = #{routeId}</if>
<if test="planId!=null"> and a.plan_id = #{planId}</if>
<if test="bizOrgCode!=null"> and d.biz_org_code = #{bizOrgCode}</if>
<if test="bizOrgCode!=null"> and a.org_Code like concat (#{bizOrgCode},"%")</if>
<if test="orgCode!=null">
and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})
</if>
......
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