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

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>

View File

@@ -52,7 +52,7 @@ public class GetInterviewInspectionListReq extends PageBasicInfo {
/**
* 地区编码
*/
private List<String> codeList;
private List<Long> codeList;
private String userId;

View File

@@ -45,7 +45,7 @@ public class GetInterviewInspectionResultListReq extends PageBasicInfo {
/**
* 地区编码
*/
private List<String> codeList;
private List<Long> codeList;
private String userId;

View File

@@ -19,6 +19,17 @@ import java.util.Date;
@ApiModel(description = "面试稽核结果信息")
public class InterviewInspectionResultVO {
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "面试计划id")
private Integer interviewPlanId;
@ApiModelProperty(value = "被面试人姓名")
private String intervieweeName;

View File

@@ -1,14 +1,13 @@
package com.cool.store.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.dao.HyOpenAreaInfoDAO;
import com.cool.store.dto.inspection.interview.InspectionRevocationDTO;
import com.cool.store.dto.inspection.interview.InspectionSubmissionDTO;
import com.cool.store.entity.MDMAreaDO;
import com.cool.store.entity.SysMenuDO;
import com.cool.store.entity.HyInspectionDO;
import com.cool.store.entity.HyInterviewInspectionLogDO;
import com.cool.store.entity.*;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.InspectionOperationTypeEnum;
import com.cool.store.enums.InspectionStatusEnum;
@@ -19,16 +18,19 @@ import com.cool.store.request.GetInterviewInspectionResultListReq;
import com.cool.store.mapper.HyInterviewInspectionLogMapper;
import com.cool.store.service.InterviewInspectionService;
import com.cool.store.service.MDMAreaService;
import com.cool.store.service.OpenAreaService;
import com.cool.store.utils.StringUtil;
import com.cool.store.vo.interview.InterviewInspectionHistoryInfo;
import com.cool.store.vo.interview.InterviewInspectionInfo;
import com.cool.store.vo.interview.InterviewInspectionResultVO;
import com.cool.store.vo.interview.InterviewInspectionVO;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@@ -48,8 +50,8 @@ public class InterviewInspectionServiceImpl implements InterviewInspectionServic
private HyInterviewInspectionLogMapper interviewInspectionLogMapper;
@Autowired
private MDMAreaService mdmAreaService;
@Resource
private HyOpenAreaInfoDAO hyOpenAreaInfoDAO;
@Override
public void submit(InspectionSubmissionDTO dto) throws ApiException {
@@ -146,15 +148,18 @@ public class InterviewInspectionServiceImpl implements InterviewInspectionServic
}
//意向开店区域 不为空
if (StringUtil.isNotEmpty(request.getWantShopArea())) {
if (mdmAreaService.getAreaProvinceType(request.getWantShopArea())) {
HyOpenAreaInfoDO hyOpenAreaInfoDO =hyOpenAreaInfoDAO.selectById(Convert.toLong(request.getWantShopArea()));
if (ObjectUtil.isNull(hyOpenAreaInfoDO.getParentId())) {
//是省
PageHelper.startPage(request.getPageNum(), request.getPageSize());
return inspectionMapper.interviewInspectionResultGetProvinceList(request.setUserId(CurrentUserHolder.getUserId()));
} else {
//并非省
List<String> codeList = mdmAreaService.getAllAreaCode(request.getWantShopArea()).stream().map(MDMAreaDO::getCode).collect(Collectors.toList());
List<Long> codeList = hyOpenAreaInfoDAO.getAllAreaCode(request.getWantShopArea()).stream().map(HyOpenAreaInfoDO::getId).collect(Collectors.toList());
request.setCodeList(codeList);
}
}
PageHelper.startPage(request.getPageNum(), request.getPageSize());
return inspectionMapper.interviewInspectionResultGetList(request.setUserId(CurrentUserHolder.getUserId()));
}
@@ -173,15 +178,18 @@ public class InterviewInspectionServiceImpl implements InterviewInspectionServic
}
//意向开店区域 不为空
if (StringUtil.isNotEmpty(request.getWantShopArea())) {
if (mdmAreaService.getAreaProvinceType(request.getWantShopArea())) {
HyOpenAreaInfoDO hyOpenAreaInfoDO =hyOpenAreaInfoDAO.selectById(Convert.toLong(request.getWantShopArea()));
if (ObjectUtil.isNull(hyOpenAreaInfoDO.getParentId())) {
//是省
PageHelper.startPage(request.getPageNum(), request.getPageSize());
return inspectionMapper.interviewInspectionGetProvinceList(request.setUserId(CurrentUserHolder.getUserId()));
} else {
//并非省
List<String> codeList = mdmAreaService.getAllAreaCode(request.getWantShopArea()).stream().map(MDMAreaDO::getCode).collect(Collectors.toList());
List<Long> codeList = hyOpenAreaInfoDAO.getAllAreaCode(request.getWantShopArea()).stream().map(HyOpenAreaInfoDO::getId).collect(Collectors.toList());
request.setCodeList(codeList);
}
}
PageHelper.startPage(request.getPageNum(), request.getPageSize());
return inspectionMapper.interviewInspectionGetList(request.setUserId(CurrentUserHolder.getUserId()));
}

View File

@@ -38,7 +38,6 @@ public class AuditResultController {
@PostMapping("/getList")
@ApiOperation("获取面试稽核结果列表")
public ResponseResult<PageInfo<InterviewInspectionResultVO>> interviewInspectionResultGetList(@RequestBody GetInterviewInspectionResultListReq request) {
PageHelper.startPage(request.getPageNum(), request.getPageSize());
List<InterviewInspectionResultVO> interviewInspectionResultGetList = interviewInspectionService.interviewInspectionResultGetList(request);
return ResponseResult.success(new PageInfo<>(interviewInspectionResultGetList));
}

View File

@@ -56,7 +56,6 @@ public class InterviewInspectionController {
@PostMapping("/getList")
@ApiOperation("获取面试稽核列表")
public ResponseResult<PageInfo<InterviewInspectionVO>> interviewInspectionGetList(@RequestBody GetInterviewInspectionListReq request) {
PageHelper.startPage(request.getPageNum(), request.getPageSize());
List<InterviewInspectionVO> interviewInspectionVOList = interviewInspectionService.interviewInspectionGetList(request);
return ResponseResult.success(new PageInfo<>(interviewInspectionVOList));
}