获取线索报名的会销列表及详情

This commit is contained in:
feng.li
2023-12-18 17:45:54 +08:00
parent ee013f8c13
commit fae3b4408e
8 changed files with 166 additions and 6 deletions

View File

@@ -5,9 +5,9 @@ import com.cool.store.dto.exhibition.ExhibitionStatisticsDTO;
import com.cool.store.entity.HyExhibitionDO;
import com.cool.store.mapper.HyExhibitionMapper;
import com.cool.store.utils.StringUtil;
import io.swagger.models.auth.In;
import com.cool.store.vo.exhibition.PartnerExhibitionInfoVO;
import com.cool.store.vo.exhibition.PartnerExhibitionListVO;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
@@ -119,4 +119,17 @@ public class HyExhibitionDAO {
return hyExhibitionMapper.listByExhibitionGroupId(exhibitionGroupId,includeClose);
}
public List<PartnerExhibitionListVO> getPartnerExhibitionList(Long partnerLineId) {
if (partnerLineId == null) {
return new ArrayList<>();
}
return hyExhibitionMapper.getPartnerExhibitionList(partnerLineId);
}
public PartnerExhibitionInfoVO getPartnerExhibitionInfo(Integer exhibitionId, Long partnerLineId) {
if (exhibitionId == null || partnerLineId == null) {
return new PartnerExhibitionInfoVO();
}
return hyExhibitionMapper.getPartnerExhibitionInfo(exhibitionId, partnerLineId);
}
}

View File

@@ -3,9 +3,9 @@ package com.cool.store.mapper;
import com.cool.store.dto.exhibition.ExhibitionDTO;
import com.cool.store.dto.exhibition.ExhibitionStatisticsDTO;
import com.cool.store.entity.HyExhibitionDO;
import io.swagger.models.auth.In;
import com.cool.store.vo.exhibition.PartnerExhibitionInfoVO;
import com.cool.store.vo.exhibition.PartnerExhibitionListVO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
@@ -66,4 +66,19 @@ public interface HyExhibitionMapper {
*/
List<HyExhibitionDO> listByExhibitionGroupId(@Param("exhibitionGroupId") Integer exhibitionGroupId, @Param("includeClose") Boolean includeClose);
/**
* 获取线索报名参加的会销列表
* @param partnerLineId
* @return
*/
List<PartnerExhibitionListVO> getPartnerExhibitionList(@Param("partnerLineId") Long partnerLineId);
/**
* 获取线索报名的会销详情
*
* @param exhibitionId
* @param partnerLineId
* @return
*/
PartnerExhibitionInfoVO getPartnerExhibitionInfo(@Param("exhibitionId") Integer exhibitionId, @Param("partnerLineId") Long partnerLineId);
}

View File

@@ -372,4 +372,37 @@
</if>
</trim>
</sql>
<select id="getPartnerExhibitionList" resultType="com.cool.store.vo.exhibition.PartnerExhibitionListVO">
SELECT
t2.id AS exhibitionId,
t2.exhibition_code AS exhibitionCode,
t2.exhibition_name AS exhibitionName,
t2.start_date AS exhibitionDate
FROM `hy_partner_exhibition` t1
INNER JOIN `hy_exhibition` t2 ON t1.exhibition_id = t2.id
WHERE t1.deleted = 0
AND t2.deleted = 0
AND t1.participation_status != 7
AND t2.closed_type = 0
AND t1.partner_line_id = #{partnerLineId}
</select>
<select id="getPartnerExhibitionInfo" resultType="com.cool.store.vo.exhibition.PartnerExhibitionInfoVO">
SELECT
t1.id AS exhibitionId,
t1.exhibition_code AS exhibitionCode,
t1.exhibition_name AS exhibitionName,
t1.start_date AS exhibitionDate,
t1.location AS exhibitionPosition
FROM `hy_exhibition` t1
INNER JOIN `hy_partner_exhibition` t2 ON t1.id = t2.exhibition_id
WHERE t1.deleted = 0
AND t1.closed_type = 0
AND t2.deleted = 0
AND t2.participation_status != 7
AND t2.partner_line_id = #{partnerLineId}
AND t1.id = #{exhibitionId}
</select>
</mapper>

View File

@@ -0,0 +1,29 @@
package com.cool.store.vo.exhibition;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Fun Li 2023/12/18 17:15
* @version 1.0
* 线索报名的会销详情
*/
@Data
public class PartnerExhibitionInfoVO {
@ApiModelProperty(value = "参会人名称", example = "John Doe")
private String participantName;
@ApiModelProperty(value = "报名的展会编号", example = "34632023")
private String exhibitionCode;
@ApiModelProperty(value = "参加的相应展会名称", example = "某某某次展会")
private String exhibitionName;
@ApiModelProperty(value = "展会时间", example = "2023-07-25")
private String exhibitionDate;
@ApiModelProperty(value = "展会地点", example = "维也纳大酒店")
private String exhibitionPosition;
}

View File

@@ -0,0 +1,26 @@
package com.cool.store.vo.exhibition;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Fun Li 2023/12/18 16:42
* @version 1.0
* 线索报名的会销列表
*/
@Data
public class PartnerExhibitionListVO {
@ApiModelProperty(value = "展会id", example = "123")
private String exhibitionId;
@ApiModelProperty(value = "展会编号", example = "12202312")
private String exhibitionCode;
@ApiModelProperty(value = "展会名称", example = "某某某次展会")
private String exhibitionName;
@ApiModelProperty(value = "展会时间", example = "2023-07-25")
private String exhibitionDate;
}

View File

@@ -137,4 +137,20 @@ public interface ExhibitionService {
* @return
*/
Boolean closeExhibition(Integer exhibitionId,LoginUserInfo userInfo);
/**
* 获取线索参加的会销列表
* @param partnerLineId
* @return
*/
List<PartnerExhibitionListVO> getPartnerExhibitionList(Long partnerLineId);
/**
* 获取线索参加的会销详情
*
* @param exhibitionId
* @param partnerLineId
* @return
*/
PartnerExhibitionInfoVO getExhibitionInfo(Integer exhibitionId, Long partnerLineId);
}

View File

@@ -677,6 +677,17 @@ public class ExhibitionServiceImpl implements ExhibitionService {
return Boolean.TRUE;
}
@Override
public List<PartnerExhibitionListVO> getPartnerExhibitionList(Long partnerLineId) {
return hyExhibitionDAO.getPartnerExhibitionList(partnerLineId);
}
@Override
public PartnerExhibitionInfoVO getExhibitionInfo(Integer exhibitionId, Long partnerLineId) {
return hyExhibitionDAO.getPartnerExhibitionInfo(exhibitionId, partnerLineId);
}
/**
* 计算是否会销中
* @param lineId

View File

@@ -1,11 +1,14 @@
package com.cool.store.controller;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.context.PartnerUserHolder;
import com.cool.store.dto.exhibition.SignUpExhibitionDTO;
import com.cool.store.exception.ApiException;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.ExhibitionService;
import com.cool.store.vo.PartnerUserInfoVO;
import com.cool.store.vo.exhibition.PartnerExhibitionInfoVO;
import com.cool.store.vo.exhibition.PartnerExhibitionListVO;
import com.cool.store.vo.exhibition.SignUpExhibitionVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -13,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author suzhuhong
@@ -28,7 +32,6 @@ public class ExhibitionController {
@Resource
ExhibitionService exhibitionService;
@ApiOperation("报名会销")
@PostMapping("/signUpExhibition")
public ResponseResult<SignUpExhibitionVO> signUpExhibition(@RequestBody SignUpExhibitionDTO dto) throws ApiException {
@@ -41,4 +44,18 @@ public class ExhibitionController {
return ResponseResult.success(exhibitionService.getExhibitionGroupDetail(exhibitionGroupId,Boolean.FALSE,Boolean.TRUE));
}
@GetMapping(value = "/getPartnerExhibitionList")
@ApiOperation("线索参加的会销列表")
public ResponseResult<List<PartnerExhibitionListVO>> getPartnerExhibitionList() {
PartnerUserInfoVO user = PartnerUserHolder.getUser();
return ResponseResult.success(exhibitionService.getPartnerExhibitionList(user.getPartnerLineId()));
}
@GetMapping("/getExhibitionInfo")
@ApiOperation("线索参加的会销详情")
public ResponseResult<PartnerExhibitionInfoVO> getExhibitionInfo(@RequestParam(required = true, value = "exhibitionId") Integer exhibitionId) {
PartnerUserInfoVO user = PartnerUserHolder.getUser();
return ResponseResult.success(exhibitionService.getExhibitionInfo(exhibitionId, user.getPartnerLineId()));
}
}