修复查询稽核结果与稽核列表

This commit is contained in:
xiaodong.hu
2023-07-24 17:28:20 +08:00
parent 629d392533
commit 8f8bcc4e99
12 changed files with 226 additions and 53 deletions

View File

@@ -1,5 +1,6 @@
package com.cool.store.dao;
import cn.hutool.core.convert.Convert;
import com.cool.store.dto.partner.ApplyReservationProvinceDTO;
import com.cool.store.entity.HyOpenAreaInfoDO;
import com.cool.store.entity.HyPartnerBaseInfoDO;
@@ -129,4 +130,22 @@ public class HyOpenAreaInfoDAO {
return hyOpenAreaInfoMapper.filterLeafNode(openAreaIds);
}
public List<HyOpenAreaInfoDO> getAllAreaCode(String id) {
if (StringUtils.isEmpty(id)){
return new ArrayList<>();
}
//获取省下所有数据
List<HyOpenAreaInfoDO> provinceCodeList= hyOpenAreaInfoMapper.getProvinceAllCode(id);
if(CollectionUtils.isEmpty(provinceCodeList)){
//获取市区下所有数据
List<HyOpenAreaInfoDO> cityCodeList= hyOpenAreaInfoMapper.getSonArea(id);
if(CollectionUtils.isEmpty(cityCodeList)){
return new ArrayList<HyOpenAreaInfoDO>(){{ add(hyOpenAreaInfoMapper.selectById(Convert.toLong(id)));}};
}else {
return cityCodeList;
}
}else {
return provinceCodeList;
}
}
}

View File

@@ -28,9 +28,14 @@ public interface HyInspectionMapper {
List<InterviewInspectionVO> interviewInspectionGetList(GetInterviewInspectionListReq request);
List<InterviewInspectionVO> interviewInspectionGetProvinceList(GetInterviewInspectionListReq request);
InterviewInspectionInfo interviewInspectionGetDetail(@Param("id") Long id);
List<InterviewInspectionResultVO> interviewInspectionResultGetList(GetInterviewInspectionResultListReq request);
List<InterviewInspectionResultVO> interviewInspectionResultGetProvinceList(GetInterviewInspectionResultListReq setUserId);
}

View File

@@ -118,4 +118,7 @@ public interface HyOpenAreaInfoMapper {
*/
List<Long> filterLeafNode(@Param("openAreaIds") List<Long> openAreaIds);
List<HyOpenAreaInfoDO> getSonArea(@Param("id") String id);
List<HyOpenAreaInfoDO> getProvinceAllCode(@Param("id") String id);
}

View File

@@ -31,47 +31,47 @@
</select>
<select id="interviewInspectionGetList" resultType="com.cool.store.vo.interview.InterviewInspectionVO">
SELECT
eu.`name` AS interviewerName,
eu.mobile AS interviewerMobile,
hpui.username AS intervieweeName,
hpui.mobile AS intervieweeMobile,
hoai.area_name AS wantShopAreaName,
hi.create_time AS interviewPassTime,
hi.`status` AS `status`,
euj.`name` AS auditorName,
euj.mobile AS auditorMobile,
hi.inspection_time AS inspectionTime,
hi.id AS id,
hi.interview_plan_id AS interviewPlanId
eu.`name` AS interviewerName,
eu.mobile AS interviewerMobile,
hpui.username AS intervieweeName,
hpui.mobile AS intervieweeMobile,
trim(BOTH '/' FROM trim(hoai.area_path)) AS wantShopAreaName,
hi.create_time AS interviewPassTime,
hi.`status` AS `status`,
euj.`name` AS auditorName,
euj.mobile AS auditorMobile,
hi.inspection_time AS inspectionTime,
hi.id AS id,
hi.interview_plan_id AS interviewPlanId
FROM
hy_inspection hi
LEFT JOIN enterprise_user euj ON hi.operator_user_id = euj.user_id
LEFT JOIN hy_partner_interview_plan hpip ON hi.interview_plan_id = hpip.id
AND hi.deleted = 0
AND hpip.deleted = 0
LEFT JOIN hy_partner_interview hpi ON hpi.interview_plan_id = hpip.id
AND hpi.deleted = 0
LEFT JOIN enterprise_user eu ON hpi.interviewer = eu.user_id
LEFT JOIN hy_partner_user_info hpui ON hpip.partner_id = hpui.partner_id
LEFT JOIN hy_inspection_setting_mapping hism ON hpui.want_shop_area = hism.open_area_mapping_id
AND hism.deleted = 0
LEFT JOIN hy_inspection_setting his ON hism.inspection_setting_id = his.id
AND his.deleted = 0
AND eu.deleted = 0
LEFT JOIN hy_open_area_info hoai ON hpui.want_shop_area = hoai.id
AND hoai.deleted = 0
hy_inspection hi
LEFT JOIN enterprise_user euj ON hi.operator_user_id = euj.user_id
LEFT JOIN hy_partner_interview_plan hpip ON hi.interview_plan_id = hpip.id
AND hi.deleted = 0
AND hpip.deleted = 0
LEFT JOIN hy_partner_interview hpi ON hpi.interview_plan_id = hpip.id
AND hpi.deleted = 0
LEFT JOIN enterprise_user eu ON hpi.interviewer = eu.user_id
LEFT JOIN hy_partner_user_info hpui ON hpip.partner_id = hpui.partner_id
LEFT JOIN hy_inspection_setting_mapping hism ON hpui.want_shop_area = hism.open_area_mapping_id
AND hism.deleted = 0
LEFT JOIN hy_inspection_setting his ON hism.inspection_setting_id = his.id
AND his.deleted = 0
AND eu.deleted = 0
LEFT JOIN hy_open_area_info hoai ON hpui.want_shop_area = hoai.id
AND hoai.deleted = 0
<where>
<if test="userId !=null and userId !=''">
and (his.inspection_user_id = #{userId} OR hi.operator_user_id = #{userId})
</if>
<if test="interviewerName !=null and interviewerName !=''">
and eu.`name`=#{interviewerName}
and eu.`name` like concat('%',#{interviewerName},'%')
</if>
<if test="interviewerMobile !=null and interviewerMobile !=''">
and eu.mobile=#{interviewerMobile}
</if>
<if test="intervieweeName !=null and intervieweeName !=''">
and hpui.username=#{intervieweeName}
and hpui.username like concat('%',#{intervieweeName},'%')
</if>
<if test="intervieweeMobile !=null and intervieweeMobile !=''">
and hpui.mobile=#{intervieweeMobile}
@@ -79,8 +79,9 @@
<if test="status !=null">
and hi.`status`=#{status}
</if>
<if test="codeList !=null">
and hpui.want_shop_area in <foreach collection="codeList" separator="," open="(" close=")" item="code" >#{code}</foreach>
<if test="codeList !=null and codeList.size>0">
and hpui.want_shop_area in
<foreach collection="codeList" separator="," open="(" close=")" item="code" >#{code}</foreach>
</if>
<if test="startTime != null and startTime != ''">
and hpi.pass_time &gt;= #{startTime}
@@ -98,9 +99,10 @@
</select>
<select id="interviewInspectionResultGetList" resultType="com.cool.store.vo.interview.InterviewInspectionResultVO">
SELECT
hi.id,hi.interview_plan_id as interviewPlanId,
hpui.username AS intervieweeName,
hpui.mobile AS intervieweeMobile,
hoai.area_name AS wantShopAreaName,
trim(BOTH '/' FROM trim(hoai.area_path)) AS wantShopAreaName,
hi.create_time AS interviewPassTime,
hi.`status` AS `status`,
euj.`name` AS auditorName,
@@ -113,7 +115,7 @@
LEFT JOIN enterprise_user euj ON hi.operator_user_id = euj.user_id
LEFT JOIN hy_partner_interview_plan hpip ON hi.interview_plan_id = hpip.id
AND hi.deleted = 0
AND hpip.deleted = 0
AND hpip.deleted = 0 and `status`!=0
LEFT JOIN hy_partner_interview hpi ON hpi.interview_plan_id = hpip.id
AND hpi.deleted = 0
LEFT JOIN hy_partner_user_info hpui ON hpip.partner_id = hpui.partner_id
@@ -124,7 +126,7 @@
and hpi.interviewer = #{userId}
</if>
<if test="intervieweeName !=null and intervieweeName !=''">
and hpui.username=#{intervieweeName}
and hpui.username like concat('%',#{intervieweeName},'%')
</if>
<if test="intervieweeMobile !=null and intervieweeMobile !=''">
and hpui.mobile=#{intervieweeMobile}
@@ -144,7 +146,124 @@
</where>
order by hi.id desc
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<select id="interviewInspectionGetProvinceList" resultType="com.cool.store.vo.interview.InterviewInspectionVO">
SELECT
eu.`name` AS interviewerName,
eu.mobile AS interviewerMobile,
hpui.username AS intervieweeName,
hpui.mobile AS intervieweeMobile,
trim(BOTH '/' FROM trim(hoai.area_path)) AS wantShopAreaName,
hi.create_time AS interviewPassTime,
hi.`status` AS `status`,
euj.`name` AS auditorName,
euj.mobile AS auditorMobile,
hi.inspection_time AS inspectionTime,
hi.id AS id,
hi.interview_plan_id AS interviewPlanId
FROM
hy_inspection hi
LEFT JOIN enterprise_user euj ON hi.operator_user_id = euj.user_id
LEFT JOIN hy_partner_interview_plan hpip ON hi.interview_plan_id = hpip.id
AND hi.deleted = 0
AND hpip.deleted = 0
LEFT JOIN hy_partner_interview hpi ON hpi.interview_plan_id = hpip.id
AND hpi.deleted = 0
LEFT JOIN enterprise_user eu ON hpi.interviewer = eu.user_id
LEFT JOIN hy_partner_user_info hpui ON hpip.partner_id = hpui.partner_id
LEFT JOIN hy_inspection_setting_mapping hism ON hpui.want_shop_area = hism.open_area_mapping_id
AND hism.deleted = 0
LEFT JOIN hy_inspection_setting his ON hism.inspection_setting_id = his.id
AND his.deleted = 0
AND eu.deleted = 0
LEFT JOIN hy_open_area_info hoai ON hpui.want_shop_area = hoai.id
AND hoai.deleted = 0
left join ( SELECT c.* FROM `hy_open_area_info` a left join hy_open_area_info b on a.`id`=b.`parent_id`
left join hy_open_area_info c on b.`id`=c.`parent_id`
WHERE a.`id`=#{wantShopArea} ) mdd on hpui.want_shop_area=mdd.`id`
<where>
<if test="true">
and mdd.id is not null
</if>
<if test="userId !=null and userId !=''">
and (his.inspection_user_id = #{userId} OR hi.operator_user_id = #{userId})
</if>
<if test="interviewerName !=null and interviewerName !=''">
and eu.`name` like concat('%',#{interviewerName},'%')
</if>
<if test="interviewerMobile !=null and interviewerMobile !=''">
and eu.mobile=#{interviewerMobile}
</if>
<if test="intervieweeName !=null and intervieweeName !=''">
and hpui.username like concat('%',#{intervieweeName},'%')
</if>
<if test="intervieweeMobile !=null and intervieweeMobile !=''">
and hpui.mobile=#{intervieweeMobile}
</if>
<if test="status !=null">
and hi.`status`=#{status}
</if>
<if test="startTime != null and startTime != ''">
and hpi.pass_time &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and hpi.pass_time &lt;= #{endTime}
</if>
</where>
order by hi.id desc
</select>
<select id="interviewInspectionResultGetProvinceList" resultType="com.cool.store.vo.interview.InterviewInspectionResultVO">
SELECT
hi.id,hi.interview_plan_id as interviewPlanId,
hpui.username AS intervieweeName,
hpui.mobile AS intervieweeMobile,
trim(BOTH '/' FROM trim(hoai.area_path)) AS wantShopAreaName,
hi.create_time AS interviewPassTime,
hi.`status` AS `status`,
euj.`name` AS auditorName,
euj.mobile AS auditorMobile,
hi.inspection_time AS inspectionTime,
hi.id AS id,
hi.interview_plan_id AS interviewPlanId
FROM
hy_inspection hi
LEFT JOIN enterprise_user euj ON hi.operator_user_id = euj.user_id
LEFT JOIN hy_partner_interview_plan hpip ON hi.interview_plan_id = hpip.id
AND hi.deleted = 0
AND hpip.deleted = 0 and `status`!=0
LEFT JOIN hy_partner_interview hpi ON hpi.interview_plan_id = hpip.id
AND hpi.deleted = 0
LEFT JOIN hy_partner_user_info hpui ON hpip.partner_id = hpui.partner_id
LEFT JOIN hy_open_area_info hoai ON hpui.want_shop_area = hoai.id
AND hoai.deleted = 0
left join ( SELECT c.* FROM `hy_open_area_info` a left join hy_open_area_info b on a.`id`=b.`parent_id`
left join hy_open_area_info c on b.`id`=c.`parent_id`
WHERE a.`id`=#{wantShopArea} ) mdd on hpui.want_shop_area=mdd.`id`
<where>
<if test="true">
and mdd.id is not null
</if>
<if test="userId !=null and userId !=''">
and hpi.interviewer = #{userId}
</if>
<if test="intervieweeName !=null and intervieweeName !=''">
and hpui.username like concat('%',#{intervieweeName},'%')
</if>
<if test="intervieweeMobile !=null and intervieweeMobile !=''">
and hpui.mobile=#{intervieweeMobile}
</if>
<if test="status !=null">
and hi.`status`=#{status}
</if>
<if test="startTime != null and startTime != ''">
and hpi.pass_time &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and hpi.pass_time &lt;= #{endTime}
</if>
</where>
order by hi.id desc
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from hy_inspection
where id = #{id}
</delete>

View File

@@ -26,7 +26,7 @@
where id = #{id}
</select>
<select id="interviewInspectionGetHistoryDetail" resultType="com.cool.store.vo.interview.InterviewInspectionHistoryInfo">
SELECT a.id, b.`name` as auditorName, b.mobile as auditorMobile,operation_time as inspectionTime, operation_type as operationType ,description,files as filesStr
SELECT a.id, b.`name` as operatorUserName, b.mobile as operatorUserMobile,operation_time as inspectionTime, operation_type as operationType ,description,files as filesStr
FROM hy_interview_inspection_log a left join enterprise_user b on a.operator_user_id=b.user_id and b.deleted=0 WHERE inspection_id=#{inspectionId} ORDER BY a.id
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">

View File

@@ -293,5 +293,15 @@
where
deleted = '0' and province_city_flag = '0' and id in <foreach collection="openAreaIds" item="openAreaId" separator="," open="(" close=")">#{openAreaId}</foreach>
</select>
<select id="getSonArea" resultType="com.cool.store.entity.HyOpenAreaInfoDO">
SELECT
<include refid="Base_Column_List"></include>
FROM hy_open_area_info
WHERE parent_id = #{id}
</select>
<select id="getProvinceAllCode" resultMap="BaseResultMap">
SELECT b.* FROM `hy_open_area_info` a inner join hy_open_area_info b on a.`id`=b.`parent_id`
WHERE a.parent_id=#{id} ORDER BY b.id desc
</select>
</mapper>