Commit 6a16dbce by wuchao

修复bug

parent 01e02ff1
...@@ -91,8 +91,8 @@ public class KeyPersonVisitRecordServiceImpl { ...@@ -91,8 +91,8 @@ public class KeyPersonVisitRecordServiceImpl {
if (isBlank(map.get("visit_time"))) { if (isBlank(map.get("visit_time"))) {
throw new CustomException("回访时间不能为空"); throw new CustomException("回访时间不能为空");
} }
if (isBlank(map.get("visit_record"))) { if (isBlank(map.get("visit_record")) && isBlank(map.get("visit_img"))) {
throw new CustomException("回访记录不能为空"); throw new CustomException("请填写回访记录或上传图片,至少一项");
} }
if (isBlank(map.get("key_person_visit_id"))) { if (isBlank(map.get("key_person_visit_id"))) {
throw new CustomException("回访计划ID不能为空"); throw new CustomException("回访计划ID不能为空");
......
...@@ -73,7 +73,7 @@ public class DataScopeUtil { ...@@ -73,7 +73,7 @@ public class DataScopeUtil {
for(Map<String, Object> result : resultList) { for(Map<String, Object> result : resultList) {
String[] officeNameArray = result.get("rating_visit_office").toString().split(","); String[] officeNameArray = result.get("rating_visit_office").toString().split(",");
for(String officeName : officeNameArray) { for(String officeName : officeNameArray) {
if(companyName.contains(officeName)) { if(companyName.contains(officeName) && officeName.length() > 0) {
resultMap.put(result.get("rating_dict_value").toString(), result.get("rating_dict_label").toString()); resultMap.put(result.get("rating_dict_value").toString(), result.get("rating_dict_label").toString());
break; break;
} }
......
...@@ -201,11 +201,20 @@ ...@@ -201,11 +201,20 @@
dualRecord.push_type, dualRecord.push_type,
dualRecord.push_time, dualRecord.push_time,
dualRecord.audit_time, dualRecord.audit_time,
dualRecord.belong_region,
dualRecord.belong_city_id,
dualRecord.belong_area_id,
dualRecord.belong_street_id,
dualRecord.belong_community_id,
dualRecord.recvie_region, dualRecord.recvie_region,
dualRecord.recvie_city_id, dualRecord.recvie_city_id,
dualRecord.recvie_area_id, dualRecord.recvie_area_id,
dualRecord.recvie_street_id, dualRecord.recvie_street_id,
dualRecord.recvie_community_id, dualRecord.recvie_community_id,
belongCity.name AS belong_city_name,
belongArea.name AS belong_area_name,
belongStreet.name AS belong_street_name,
belongCommunity.name AS belong_community_name,
pushCity.name AS push_city_name, pushCity.name AS push_city_name,
pushArea.name AS push_area_name, pushArea.name AS push_area_name,
pushStreet.name AS push_street_name, pushStreet.name AS push_street_name,
...@@ -222,6 +231,10 @@ ...@@ -222,6 +231,10 @@
LEFT JOIN sys_office pushArea ON pushArea.id = dualRecord.push_area_id LEFT JOIN sys_office pushArea ON pushArea.id = dualRecord.push_area_id
LEFT JOIN sys_office pushStreet ON pushStreet.id = dualRecord.push_street_id LEFT JOIN sys_office pushStreet ON pushStreet.id = dualRecord.push_street_id
LEFT JOIN sys_office pushCommunity ON pushCommunity.id = dualRecord.push_community_id LEFT JOIN sys_office pushCommunity ON pushCommunity.id = dualRecord.push_community_id
LEFT JOIN sys_office belongCity ON belongCity.id = dualRecord.belong_city_id
LEFT JOIN sys_office belongArea ON belongArea.id = dualRecord.belong_area_id
LEFT JOIN sys_office belongStreet ON belongStreet.id = dualRecord.belong_street_id
LEFT JOIN sys_office belongCommunity ON belongCommunity.id = dualRecord.belong_community_id
LEFT JOIN sys_user pushUser ON pushUser.id = dualRecord.push_user LEFT JOIN sys_user pushUser ON pushUser.id = dualRecord.push_user
LEFT JOIN sys_user auditUser ON auditUser.id = dualRecord.audit_user LEFT JOIN sys_user auditUser ON auditUser.id = dualRecord.audit_user
<where> <where>
......
...@@ -210,31 +210,59 @@ ...@@ -210,31 +210,59 @@
<when test="sys_type != null and sys_type == '6'.toString()"> <when test="sys_type != null and sys_type == '6'.toString()">
jl_key_person_minor t1 jl_key_person_minor t1
</when> </when>
<otherwise>
jl_key_person t1
</otherwise>
</choose> </choose>
<where> <where>
<include refid="getPersonWhere"></include> <include refid="getPersonWhere"></include>
AND t1.id not in (
select
t1.id
from
<choose>
<when test="sys_type != null and (sys_type == '2'.toString() or sys_type == '3'.toString())">
jl_key_person t1,
</when>
<when test="sys_type != null and sys_type == '6'.toString()">
jl_key_person_minor t1,
</when>
</choose>
jl_key_person_rating_dual_person t2
<where>
AND t1.id = t2.key_person_id
<choose>
<when test="scope_grade == '3'.toString()">
AND t1.city_id = #{scope_area_id}
</when>
<when test="scope_grade == '4'.toString()">
AND t1.area_id = #{scope_area_id}
</when>
<when test="scope_grade == '5'.toString()">
AND t1.street_id = #{scope_area_id}
</when>
<when test="scope_grade == '6'.toString() ">
AND t1.community_id = #{scope_area_id}
</when>
</choose>
</where>
)
</where> </where>
union ALL union ALL
SELECT t1.* FROM SELECT t2.* FROM
<choose> <choose>
<when test="sys_type != null and (sys_type == '2'.toString() or sys_type == '3'.toString())"> <when test="sys_type != null and (sys_type == '2'.toString() or sys_type == '3'.toString())">
jl_key_person t1, jl_key_person t2,
</when> </when>
<when test="sys_type != null and sys_type == '6'.toString()"> <when test="sys_type != null and sys_type == '6'.toString()">
jl_key_person_minor t1, jl_key_person_minor t2,
</when> </when>
<otherwise> <otherwise>
jl_key_person t1, jl_key_person t2,
</otherwise> </otherwise>
</choose> </choose>
jl_key_person_rating_dual_person t2 jl_key_person_rating_dual_person t1
where t1.id = t2.key_person_id where t2.id = t1.key_person_id
<include refid="getPersonWhere"></include> <include refid="getPersonWhere"></include>
</sql> </sql>
...@@ -258,6 +286,7 @@ ...@@ -258,6 +286,7 @@
<select id="selectMentalPatientRatingCount1" parameterType="map" resultType="map"> <select id="selectMentalPatientRatingCount1" parameterType="map" resultType="map">
select select
coalesce(sum(case when jkprh.do_status = '0' and jkprh.is_overdue = '0' then 1 else 0 end), 0) as total_pending, coalesce(sum(case when jkprh.do_status = '0' and jkprh.is_overdue = '0' then 1 else 0 end), 0) as total_pending,
......
...@@ -117,30 +117,55 @@ ...@@ -117,30 +117,55 @@
<when test="params.sys_type != null and params.sys_type == '6'.toString()"> <when test="params.sys_type != null and params.sys_type == '6'.toString()">
jl_key_person_minor t1 jl_key_person_minor t1
</when> </when>
<otherwise>
jl_key_person t1
</otherwise>
</choose> </choose>
<where> <where>
<include refid="getPersonWhere"></include> <include refid="getPersonWhere"></include>
AND t1.id not in (
select
t1.id
from
<choose>
<when test="params.sys_type != null and (params.sys_type == '2'.toString() or params.sys_type == '3'.toString())">
jl_key_person t1,
</when>
<when test="params.sys_type != null and params.sys_type == '6'.toString()">
jl_key_person_minor t1,
</when>
</choose>
jl_key_person_rating_dual_person t2
<where>
AND t1.id = t2.key_person_id
<choose>
<when test="params.scope_grade == '3'.toString()">
AND t1.city_id = #{params.scope_area_id}
</when>
<when test="params.scope_grade == '4'.toString()">
AND t1.area_id = #{params.scope_area_id}
</when>
<when test="params.scope_grade == '5'.toString()">
AND t1.street_id = #{params.scope_area_id}
</when>
<when test="params.scope_grade == '6'.toString() ">
AND t1.community_id = #{params.scope_area_id}
</when>
</choose>
</where>
)
</where> </where>
union ALL union ALL
SELECT t1.* FROM SELECT t2.* FROM
<choose> <choose>
<when test="params.sys_type != null and (params.sys_type == '2'.toString() or params.sys_type == '3'.toString())"> <when test="params.sys_type != null and (params.sys_type == '2'.toString() or params.sys_type == '3'.toString())">
jl_key_person t1, jl_key_person t2,
</when> </when>
<when test="params.sys_type != null and params.sys_type == '6'.toString()"> <when test="params.sys_type != null and params.sys_type == '6'.toString()">
jl_key_person_minor t1, jl_key_person_minor t2,
</when> </when>
<otherwise>
jl_key_person t1,
</otherwise>
</choose> </choose>
jl_key_person_rating_dual_person t2 jl_key_person_rating_dual_person t1
where t1.id = t2.key_person_id where t2.id = t1.key_person_id
<include refid="getPersonWhere"></include> <include refid="getPersonWhere"></include>
</sql> </sql>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论