Merge remote-tracking branch 'xfsg/cc_partner_init' into cc_partner_init
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.AuditStatusDO;
|
||||
import com.cool.store.response.CheckListResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@org.apache.ibatis.annotations.Mapper
|
||||
public interface AuditStatusMapper extends Mapper<AuditStatusDO> {
|
||||
|
||||
List<CheckListResponse> checkList(@Param("keyWord") String partnerNameOrPhone,
|
||||
@Param("startTime") Date startTime,
|
||||
@Param("endTime") Date endTime,
|
||||
@Param("region") String region,
|
||||
@Param("checkStatus") Integer checkStatus,
|
||||
@Param("checkStage") Integer checkStage,
|
||||
@Param("pageNum") Integer pageNum,
|
||||
@Param("pageSize") Integer pageSize);
|
||||
}
|
||||
|
||||
@@ -28,4 +28,95 @@
|
||||
update_time,
|
||||
audit_stage
|
||||
</sql>
|
||||
<select id="checkList" resultType="com.cool.store.response.CheckListResponse">
|
||||
SELECT
|
||||
a.id AS checkId,
|
||||
a.line_id as lineId,
|
||||
a.interview_id as interviewId,
|
||||
a.audit_status as checkStatus,
|
||||
a.audit_stage,
|
||||
a.audit_user_id,
|
||||
a.audit_user_name as checkUser,
|
||||
a.create_time,
|
||||
a.update_time AS checkTime,
|
||||
l.id AS line_id,
|
||||
l.partner_id,
|
||||
l.region_id AS line_region_id,
|
||||
l.mobile AS mobile,
|
||||
l.username as interviewName,
|
||||
l.sex,
|
||||
l.want_shop_area_id as wantRegion,
|
||||
l.live_address,
|
||||
l.workflow_stage,
|
||||
l.workflow_sub_stage,
|
||||
l.workflow_sub_stage_status,
|
||||
l.want_shop_num,
|
||||
l.select_site_num,
|
||||
l.prepare_shop_num,
|
||||
l.open_shop_num,
|
||||
l.line_source,
|
||||
l.investment_manager as investmentId,
|
||||
l.development_manager,
|
||||
l.first_interviewer,
|
||||
l.second_interviewer,
|
||||
l.user_portrait,
|
||||
l.join_status,
|
||||
l.line_status,
|
||||
l.create_time AS line_create_time,
|
||||
l.update_time AS line_update_time,
|
||||
l.create_user_id,
|
||||
l.update_user_id,
|
||||
l.deleted,
|
||||
l.partner_num,
|
||||
i.id AS interview_id,
|
||||
i.interview_date,
|
||||
i.start_time,
|
||||
i.end_time,
|
||||
i.join_interview_status,
|
||||
i.actual_start_time,
|
||||
i.actual_end_time,
|
||||
i.room_id,
|
||||
i.room_password,
|
||||
i.interviewer_user_id as intervieweeId,
|
||||
i.room_status,
|
||||
i.interview_status,
|
||||
i.interview_type,
|
||||
i.video_url,
|
||||
i.audit_id AS interview_audit_id,
|
||||
i.calendars_event_id,
|
||||
i.deleted AS interview_deleted,
|
||||
i.create_time AS interview_create_time,
|
||||
i.update_time AS interview_update_time,
|
||||
lai.create_time AS intervieweePassTime
|
||||
FROM
|
||||
xfsg_audit_status a
|
||||
LEFT JOIN
|
||||
xfsg_line_info l ON a.line_id = l.id
|
||||
LEFT JOIN
|
||||
xfsg_line_interview i ON a.interview_id = i.id
|
||||
LEFT JOIN
|
||||
xfsg_line_audit_info lai ON lai.id = i.audit_id
|
||||
<where>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
l.username = #{keyWord}
|
||||
OR l.mobile = #{keyWord}
|
||||
)
|
||||
</if>
|
||||
<if test="startTime != null and endTime != null">
|
||||
AND lai.create_time BETWEEN #{startTime} AND #{endTime}
|
||||
</if>
|
||||
<if test="region != null and region != ''">
|
||||
AND l.want_shop_area_id = #{region}
|
||||
</if>
|
||||
<if test="checkStatus != null">
|
||||
AND a.audit_status = #{checkStatus}
|
||||
</if>
|
||||
<if test="checkStage != null">
|
||||
AND a.audit_stage = #{checkStage}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -20,7 +20,7 @@ public class AuditStatusDO {
|
||||
@Column(name = "audit_status")
|
||||
private Integer auditStatus;
|
||||
@Column(name = "audit_user_id")
|
||||
private Integer auditUserId;
|
||||
private Long auditUserId;
|
||||
@Column(name = "audit_user_name")
|
||||
private String auditUserName;
|
||||
@Column(name = "create_time")
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("稽核请求")
|
||||
public class AuditCheckRequest {
|
||||
|
||||
@ApiModelProperty("稽核id")
|
||||
private Long checkId;
|
||||
|
||||
@ApiModelProperty("稽核状态 0通过 1不通过")
|
||||
private Integer checkStatus;
|
||||
|
||||
@ApiModelProperty("稽核意见")
|
||||
private String checkResult;
|
||||
|
||||
private Long lineId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AuditDetailRequest {
|
||||
@ApiModelProperty("稽核id")
|
||||
private Long checkId;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.cool.store.response;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class AuditDetailResponse {
|
||||
|
||||
@ApiModelProperty("视频链接")
|
||||
private String videoUrl;
|
||||
|
||||
private String startTime;
|
||||
|
||||
private String endTime;
|
||||
|
||||
private String checkUser;
|
||||
|
||||
private String checkTime;
|
||||
|
||||
private Integer checkStatus;
|
||||
|
||||
private String checkResult;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.cool.store.response;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class CheckListResponse {
|
||||
|
||||
|
||||
private Long lineId;
|
||||
|
||||
private Long interviewId;
|
||||
|
||||
private Long auditId;
|
||||
|
||||
private Long checkId;
|
||||
|
||||
|
||||
@ApiModelProperty("面试人姓名")
|
||||
private String interviewName;
|
||||
|
||||
@ApiModelProperty("面试人手机号")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("意向区域编码")
|
||||
private Long wantRegion;
|
||||
|
||||
@ApiModelProperty("意向区域名")
|
||||
private String wantRegionName;
|
||||
|
||||
@ApiModelProperty("面审人id")
|
||||
private String intervieweeId;
|
||||
|
||||
@ApiModelProperty("面审人姓名")
|
||||
private String intervieweeName;
|
||||
|
||||
@ApiModelProperty("面审通过时间")
|
||||
private Date intervieweePassTime;
|
||||
|
||||
@ApiModelProperty("稽核状态 0:未稽核 1:合格 2:不合格")
|
||||
private Integer checkStatus;
|
||||
|
||||
@ApiModelProperty("招商经理id")
|
||||
private String investmentId;
|
||||
|
||||
@ApiModelProperty("招商经理id")
|
||||
private String investmentName;
|
||||
|
||||
@ApiModelProperty("稽核人")
|
||||
private String checkUser;
|
||||
|
||||
@ApiModelProperty("稽核时间")
|
||||
private Date checkTime;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,18 +1,22 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.entity.AuditStatusDO;
|
||||
import com.cool.store.request.AuditCheckRequest;
|
||||
import com.cool.store.request.AuditDetailRequest;
|
||||
import com.cool.store.response.AuditDetailResponse;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface AuditStatusService {
|
||||
|
||||
List<AuditStatusDO> list();
|
||||
|
||||
/**
|
||||
* 稽核
|
||||
* @return
|
||||
*/
|
||||
Boolean audit();
|
||||
Boolean audit(AuditCheckRequest request);
|
||||
|
||||
/**
|
||||
*插入数据
|
||||
@@ -22,4 +26,18 @@ public interface AuditStatusService {
|
||||
Long interviewId,
|
||||
Long auditId,
|
||||
Integer auditStage);
|
||||
|
||||
AuditDetailResponse detail(AuditDetailRequest request);
|
||||
|
||||
/**
|
||||
* 稽核列表
|
||||
* @param partnerNameOrPhone 关键字
|
||||
* @param time 时间
|
||||
* @param region 意向区域
|
||||
* @param checkStatus 稽核状态
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
PageInfo checkList(String partnerNameOrPhone, Date startTime, Date endTime, String region, Integer checkStatus, Integer checkStage, Integer pageNum, Integer pageSize);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,37 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dao.HyOpenAreaInfoDAO;
|
||||
import com.cool.store.dao.LineAuditInfoDAO;
|
||||
import com.cool.store.dao.LineInfoDAO;
|
||||
import com.cool.store.entity.AuditStatusDO;
|
||||
import com.cool.store.entity.LineAuditInfoDO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.LineInterviewDO;
|
||||
import com.cool.store.enums.AuditResultTypeEnum;
|
||||
import com.cool.store.mapper.AuditStatusMapper;
|
||||
import com.cool.store.mapper.LineInterviewMapper;
|
||||
import com.cool.store.request.AuditCheckRequest;
|
||||
import com.cool.store.request.AuditDetailRequest;
|
||||
import com.cool.store.response.AuditDetailResponse;
|
||||
import com.cool.store.response.CheckListResponse;
|
||||
import com.cool.store.service.AuditStatusService;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
import com.cool.store.vo.BaseInfoVO;
|
||||
import com.cool.store.vo.LineListVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@@ -16,18 +40,52 @@ public class AuditStatusServiceImpl implements AuditStatusService {
|
||||
@Resource
|
||||
AuditStatusMapper auditStatusMapper;
|
||||
|
||||
@Resource
|
||||
private LineInfoDAO lineInfoDAO;
|
||||
|
||||
@Resource
|
||||
private LineAuditInfoDAO lineAuditInfoDAO;
|
||||
|
||||
@Resource
|
||||
private LineInterviewMapper lineInterviewMapper;
|
||||
|
||||
@Resource
|
||||
HyOpenAreaInfoDAO hyOpenAreaInfoDAO;
|
||||
|
||||
@Resource
|
||||
EnterpriseUserDAO enterpriseUserDAO;
|
||||
|
||||
|
||||
@Override
|
||||
public List<AuditStatusDO> list() {
|
||||
return null;
|
||||
public Boolean audit(AuditCheckRequest request) {
|
||||
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||
//稽核信息
|
||||
AuditStatusDO auditStatusDO = auditStatusMapper.selectByPrimaryKey(request.getCheckId());
|
||||
//线索审核信息
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||
String partnerId = lineInfo.getPartnerId();
|
||||
LineAuditInfoDO auditInfo = new LineAuditInfoDO();
|
||||
auditInfo.setLineId(request.getLineId());
|
||||
auditInfo.setPartnerId(partnerId);
|
||||
if (request.getCheckStatus().equals(1)) {
|
||||
auditInfo.setResultType(AuditResultTypeEnum.PASS.getCode());
|
||||
auditInfo.setPassReason(request.getCheckResult());
|
||||
} else {
|
||||
auditInfo.setResultType(AuditResultTypeEnum.REJECT.getCode());
|
||||
auditInfo.setRejectPublicReason(request.getCheckResult());
|
||||
auditInfo.setRejectRealReason(request.getCheckResult());
|
||||
}
|
||||
Long auditId = lineAuditInfoDAO.addAuditInfo(auditInfo);
|
||||
auditStatusDO.setAuditId(auditId);
|
||||
auditStatusDO.setAuditUserId(Long.valueOf(user.getUserId()));
|
||||
auditStatusDO.setAuditUserName(user.getName());
|
||||
auditStatusDO.setAuditStatus(request.getCheckStatus());
|
||||
auditStatusMapper.updateByPrimaryKeySelective(auditStatusDO);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean audit() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insert(Long lineId, Long interviewId, Long auditId,Integer auditStage) {
|
||||
public int insert(Long lineId, Long interviewId, Long auditId, Integer auditStage) {
|
||||
AuditStatusDO auditStatusDO = new AuditStatusDO();
|
||||
auditStatusDO.setLineId(lineId);
|
||||
auditStatusDO.setInterviewId(interviewId);
|
||||
@@ -36,4 +94,61 @@ public class AuditStatusServiceImpl implements AuditStatusService {
|
||||
int result = auditStatusMapper.insertSelective(auditStatusDO);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AuditDetailResponse detail(AuditDetailRequest request) {
|
||||
AuditDetailResponse response = new AuditDetailResponse();
|
||||
AuditStatusDO auditStatusDO = auditStatusMapper.selectByPrimaryKey(request.getCheckId());
|
||||
LineInterviewDO lineInterviewDO = lineInterviewMapper.selectByPrimaryKey(auditStatusDO.getInterviewId());
|
||||
LineAuditInfoDO auditInfo = lineAuditInfoDAO.getAuditInfo(auditStatusDO.getAuditId());
|
||||
response.setVideoUrl(lineInterviewDO.getVideoUrl());
|
||||
|
||||
response.setStartTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, lineInterviewDO.getActualStartTime()));
|
||||
response.setEndTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, lineInterviewDO.getActualEndTime()));
|
||||
response.setCheckUser(auditStatusDO.getAuditUserName());
|
||||
response.setCheckTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, auditStatusDO.getCreateTime()));
|
||||
response.setCheckStatus(auditInfo.getResultType());
|
||||
if (auditInfo.getResultType() > 0) {
|
||||
response.setCheckResult(auditInfo.getRejectPublicReason());
|
||||
} else {
|
||||
response.setCheckResult(auditInfo.getPassReason());
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo checkList(String partnerNameOrPhone,
|
||||
Date startTime,
|
||||
Date endTime,
|
||||
String region,
|
||||
Integer checkStatus,
|
||||
Integer checkStage,
|
||||
Integer pageNum,
|
||||
Integer pageSize) {
|
||||
PageHelper.startPage(pageNum,pageSize);
|
||||
List<CheckListResponse> checkListResponses = auditStatusMapper.checkList(partnerNameOrPhone, startTime, endTime, region, checkStatus, checkStage, pageNum, pageSize);
|
||||
//意向区域
|
||||
List<Long> wantRegions = checkListResponses.stream().map(CheckListResponse::getWantRegion).collect(Collectors.toList());
|
||||
//面审人
|
||||
List<String> intervieweeIds = checkListResponses.stream().map(CheckListResponse::getIntervieweeId).collect(Collectors.toList());
|
||||
//招商经理
|
||||
List<String> investmentIds = checkListResponses.stream().map(CheckListResponse::getInvestmentId).collect(Collectors.toList());
|
||||
//意向区域Map
|
||||
Map<Long, String> wantShopAreaMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantRegions);
|
||||
//招商经理Map
|
||||
Map<String, String> investmentIdMap = enterpriseUserDAO.getUserNameMap(investmentIds);
|
||||
//面审人Map
|
||||
Map<String, String> intervieweeIdMap = enterpriseUserDAO.getUserNameMap(intervieweeIds);
|
||||
|
||||
checkListResponses.forEach(x->{
|
||||
x.setIntervieweeName(intervieweeIdMap.get(x.getIntervieweeId()));
|
||||
x.setWantRegionName(wantShopAreaMap.get(x.getWantRegion()));
|
||||
x.setInvestmentName(investmentIdMap.get(x.getIntervieweeId()));
|
||||
});
|
||||
|
||||
PageInfo pageInfo = new PageInfo<>(checkListResponses);
|
||||
return pageInfo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
|
||||
import com.cool.store.request.AuditCheckRequest;
|
||||
import com.cool.store.request.AuditDetailRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.AuditStatusService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
|
||||
@Api(tags = "稽核相关")
|
||||
@RestController
|
||||
@RequestMapping("pc/audit/stage")
|
||||
public class AuditStatusController {
|
||||
|
||||
@Resource
|
||||
AuditStatusService auditStatusService;
|
||||
|
||||
@ApiOperation("稽核")
|
||||
@PostMapping("/check")
|
||||
public ResponseResult check(@RequestBody AuditCheckRequest request) {
|
||||
return ResponseResult.success(auditStatusService.audit(request));
|
||||
}
|
||||
|
||||
@ApiOperation("查看/稽核按钮")
|
||||
@PostMapping("/detail")
|
||||
public ResponseResult detail(@RequestBody AuditDetailRequest request) {
|
||||
return ResponseResult.success(auditStatusService.detail(request));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("稽核列表")
|
||||
@GetMapping("/checkList")
|
||||
public ResponseResult checkList(@RequestParam(value = "partnerNameOrPhone",required = false) String partnerNameOrPhone,
|
||||
@RequestParam(value = "startTime",required = false) Date startTime,
|
||||
@RequestParam(value = "endTime",required = false) Date endTime,
|
||||
@RequestParam(value = "region",required = false) String region,
|
||||
@RequestParam(value = "checkStatus",required = false) Integer checkStatus,
|
||||
@RequestParam(value = "checkStage",defaultValue = "1") Integer checkStage,
|
||||
@RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10")Integer pageSize) {
|
||||
|
||||
return ResponseResult.success(auditStatusService.checkList(partnerNameOrPhone,startTime,endTime,region,checkStatus,checkStage,pageNum,pageSize));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user