签到+结束会销

This commit is contained in:
苏竹红
2023-12-13 16:33:26 +08:00
parent 69c3fa7714
commit a05215c89e
18 changed files with 212 additions and 39 deletions

View File

@@ -18,7 +18,9 @@ public enum SMSMsgEnum {
SMS_INVATE("短信邀约", "【沪上阿姨】感谢您对沪上阿姨品牌的关注与支持,您可通过链接登记加盟申请信息,我们的客户经理将在第一时间与您联系。{$var}", "d7772108bb7d9767494818bcd39d2ec1"), SMS_INVATE("短信邀约", "【沪上阿姨】感谢您对沪上阿姨品牌的关注与支持,您可通过链接登记加盟申请信息,我们的客户经理将在第一时间与您联系。{$var}", "d7772108bb7d9767494818bcd39d2ec1"),
EXHIBITION_INFO_UPDATE("展会信息变更","【沪上阿姨】亲爱的伙伴,您好!您近期报名的加盟推介会信息有更新。名称为{$var},日期为{$var},地址为{$var}。感谢您的关注,期待早日与您合作!{$var}","d7772108bb7d9767494818bcd39d2ec1") EXHIBITION_INFO_UPDATE("展会信息变更","【沪上阿姨】亲爱的伙伴,您好!您近期报名的加盟推介会信息有更新。名称为{$var},日期为{$var},地址为{$var}。感谢您的关注,期待早日与您合作!{$var}","d7772108bb7d9767494818bcd39d2ec1"),
EXHIBITION_CLOSE("展会结束","【沪上阿姨】亲爱的伙伴,您好!非常感谢您报名和参加我们的加盟推介会,若您想继续咨询合作事项,仍可微信联系您的客户经理为您解答。沪上阿姨祝您返程顺利,早日开店!","d7772108bb7d9767494818bcd39d2ec1")
; ;
private String title; private String title;

View File

@@ -112,4 +112,11 @@ public class HyExhibitionDAO {
return hyExhibitionMapper.lineSignUpCount(exhibitionGroupId,lineId); return hyExhibitionMapper.lineSignUpCount(exhibitionGroupId,lineId);
} }
public List<HyExhibitionDO> listByExhibitionGroupId(Integer exhibitionGroupId,Boolean includeClose){
if (exhibitionGroupId==null){
return new ArrayList<>();
}
return hyExhibitionMapper.listByExhibitionGroupId(exhibitionGroupId,includeClose);
}
} }

View File

@@ -2,10 +2,12 @@ package com.cool.store.dao;
import com.cool.store.dto.exhibition.ExhibitionLineBaseDTO; import com.cool.store.dto.exhibition.ExhibitionLineBaseDTO;
import com.cool.store.dto.exhibition.ExhibitionLineDTO; import com.cool.store.dto.exhibition.ExhibitionLineDTO;
import com.cool.store.dto.exhibition.PartnerSignUpDTO;
import com.cool.store.entity.HyExhibitionDO; import com.cool.store.entity.HyExhibitionDO;
import com.cool.store.entity.HyPartnerExhibitionDO; import com.cool.store.entity.HyPartnerExhibitionDO;
import com.cool.store.entity.HyPartnerExhibitionInterviewDO; import com.cool.store.entity.HyPartnerExhibitionInterviewDO;
import com.cool.store.mapper.HyPartnerExhibitionMapper; import com.cool.store.mapper.HyPartnerExhibitionMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@@ -135,7 +137,10 @@ public class HyPartnerExhibitionDAO {
return hyPartnerExhibitionMapper.getPartnerExhibition(exhibitionId,lindId); return hyPartnerExhibitionMapper.getPartnerExhibition(exhibitionId,lindId);
} }
public Integer partnerSignUpCount(Long lineId){ public List<PartnerSignUpDTO> partnerSignUpCount(List<Long> lineIds){
return hyPartnerExhibitionMapper.partnerSignUpCount(lineId); if (CollectionUtils.isEmpty(lineIds)){
return new ArrayList<>();
}
return hyPartnerExhibitionMapper.partnerSignUpCount(lineIds);
} }
} }

View File

@@ -4,6 +4,7 @@ import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
import com.cool.store.entity.HyPartnerIntentInfoDO; import com.cool.store.entity.HyPartnerIntentInfoDO;
import com.cool.store.mapper.HyPartnerIntentInfoMapper; import com.cool.store.mapper.HyPartnerIntentInfoMapper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@@ -85,5 +86,4 @@ public class HyPartnerIntentInfoDAO {
return hyPartnerIntentInfoMapper.updateAcquaintanceFlag(id,acquaintanceFlag,acquaintanceName,acquaintanceRelationshipType,otherRelationshipType); return hyPartnerIntentInfoMapper.updateAcquaintanceFlag(id,acquaintanceFlag,acquaintanceName,acquaintanceRelationshipType,otherRelationshipType);
} }
} }

View File

@@ -228,18 +228,25 @@ public class HyPartnerLineInfoDAO {
} }
public List<LineInterviewDTO> lineInterviewList(List<Integer> lineIds){ public List<LineInterviewDTO> lineInterviewList(List<Long> lineIds){
if (CollectionUtils.isEmpty(lineIds)){ if (CollectionUtils.isEmpty(lineIds)){
return new ArrayList<>(); return new ArrayList<>();
} }
return hyPartnerLineInfoMapper.lineInterviewList(lineIds); return hyPartnerLineInfoMapper.lineInterviewList(lineIds);
} }
public List<LineInterviewDTO> lineInvestmentList(List<Integer> lineIds){ public List<LineInterviewDTO> lineInvestmentList(List<Long> lineIds){
if (CollectionUtils.isEmpty(lineIds)){ if (CollectionUtils.isEmpty(lineIds)){
return new ArrayList<>(); return new ArrayList<>();
} }
return hyPartnerLineInfoMapper.lineInvestmentList(lineIds); return hyPartnerLineInfoMapper.lineInvestmentList(lineIds);
} }
public int batchUpdate(List<HyPartnerLineInfoDO> records){
if (CollectionUtils.isEmpty(records)){
return -1;
}
return hyPartnerLineInfoMapper.batchUpdate(records);
}
} }

View File

@@ -58,4 +58,12 @@ public interface HyExhibitionMapper {
Integer lineSignUpCount(@Param("exhibitionGroupId") Integer exhibitionGroupId, @Param("lineId") Long lineId); Integer lineSignUpCount(@Param("exhibitionGroupId") Integer exhibitionGroupId, @Param("lineId") Long lineId);
/**
* 查询展会组下展会 (参数控制是否包含关闭的展会)
* @param exhibitionGroupId
* @param includeClose true-包含 false-不包含
* @return
*/
List<HyExhibitionDO> listByExhibitionGroupId(@Param("exhibitionGroupId") Integer exhibitionGroupId, @Param("includeClose") Boolean includeClose);
} }

View File

@@ -2,6 +2,7 @@ package com.cool.store.mapper;
import com.cool.store.dto.exhibition.ExhibitionLineBaseDTO; import com.cool.store.dto.exhibition.ExhibitionLineBaseDTO;
import com.cool.store.dto.exhibition.ExhibitionLineDTO; import com.cool.store.dto.exhibition.ExhibitionLineDTO;
import com.cool.store.dto.exhibition.PartnerSignUpDTO;
import com.cool.store.entity.HyExhibitionDO; import com.cool.store.entity.HyExhibitionDO;
import com.cool.store.entity.HyPartnerExhibitionDO; import com.cool.store.entity.HyPartnerExhibitionDO;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;
@@ -102,5 +103,5 @@ public interface HyPartnerExhibitionMapper {
* @param lineId * @param lineId
* @return * @return
*/ */
Integer partnerSignUpCount(@Param("lineId") Long lineId ); List<PartnerSignUpDTO> partnerSignUpCount(@Param("lineIds") List<Long> lineIds );
} }

View File

@@ -323,12 +323,14 @@ public interface HyPartnerLineInfoMapper {
* @param list * @param list
* @return * @return
*/ */
List<LineInterviewDTO> lineInterviewList(@Param("list") List<Integer> list); List<LineInterviewDTO> lineInterviewList(@Param("list") List<Long> list);
/** /**
* 查询线索招商经理信息 * 查询线索招商经理信息
* @param list * @param list
* @return * @return
*/ */
List<LineInterviewDTO> lineInvestmentList(@Param("list") List<Integer> list); List<LineInterviewDTO> lineInvestmentList(@Param("list") List<Long> list);
int batchUpdate(@Param("records") List<HyPartnerLineInfoDO> records);
} }

View File

@@ -284,7 +284,7 @@
<select id="lineSignUpCount" resultType="java.lang.Integer"> <select id="lineSignUpCount" resultType="java.lang.Integer">
select count(1) from hy_exhibition a left join hy_partner_exhibition b on a.id = b.exhibition_id select count(1) from hy_exhibition a left join hy_partner_exhibition b on a.id = b.exhibition_id
<where> <where>
and b.participation_status!=7 and b.participation_status!=7 and a.closed_type = 0
<if test="exhibitionGroupId!=null"> <if test="exhibitionGroupId!=null">
and a.exhibition_group_id = #{exhibitionGroupId} and a.exhibition_group_id = #{exhibitionGroupId}
</if> </if>
@@ -294,6 +294,16 @@
</where> </where>
</select> </select>
<select id="listByExhibitionGroupId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from hy_exhibition
where exhibition_group_id = #{exhibitionGroupId}
<if test="includeClose==false">
and closed_type = 0
</if>
</select>
<select id="exhibitionStatistic" resultType="com.cool.store.dto.exhibition.ExhibitionStatisticsDTO"> <select id="exhibitionStatistic" resultType="com.cool.store.dto.exhibition.ExhibitionStatisticsDTO">
select select

View File

@@ -144,6 +144,7 @@
<select id="getExhibitionLine" resultType="com.cool.store.dto.exhibition.ExhibitionLineDTO"> <select id="getExhibitionLine" resultType="com.cool.store.dto.exhibition.ExhibitionLineDTO">
select select
hpe.partner_id as partnerId, hpe.partner_id as partnerId,
hpe.partner_line_id as lineId,
hpe.exhibition_id as exhibitionId, hpe.exhibition_id as exhibitionId,
pu.username as partnerName, pu.username as partnerName,
pu.mobile as mobile pu.mobile as mobile
@@ -447,11 +448,16 @@
</where> </where>
</select> </select>
<select id="partnerSignUpCount" resultType="java.lang.Integer"> <select id="partnerSignUpCount" resultType="com.cool.store.dto.exhibition.PartnerSignUpDTO">
select count(1) from hy_partner_exhibition a left join hy_exhibition b on a.exhibition_id = b.id select
where a.participation_status != 7 and b.closed_type!=0 a.partner_line_id as lineId ,
<if test="lineId!=null"> count(1) as count
and a.partner_line_id = #{lineId} from hy_partner_exhibition a
</if> left join hy_exhibition b on a.exhibition_id = b.id
where a.participation_status != 7 and b.closed_type=0
<foreach collection="lineIds" item="lineId" open="and a.partner_line_id in (" separator="," close=")">
#{lineId}
</foreach>
group by a.partner_line_id
</select> </select>
</mapper> </mapper>

View File

@@ -1060,4 +1060,18 @@
</where> </where>
</select> </select>
<update id="batchUpdate">
update hy_partner_line_info
set whether_in_exhibition = CASE id
<foreach collection="records" item="record">
WHEN #{record.id} THEN #{record.whetherInExhibition}
</foreach>
END
<foreach collection="records" item="record" open="where id in (" separator="," close=")">
#{record.id}
</foreach>
</update>
</mapper> </mapper>

View File

@@ -18,7 +18,7 @@ public class ExhibitionLineDTO {
private String exhibitionId; private String exhibitionId;
private Integer lineId; private Long lineId;
private Integer wantShopArea; private Integer wantShopArea;

View File

@@ -0,0 +1,17 @@
package com.cool.store.dto.exhibition;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2023/12/13 13:25
* @Version 1.0
*/
@Data
public class PartnerSignUpDTO {
private Long lineId;
private Integer count;
}

View File

@@ -10,7 +10,7 @@ import lombok.Data;
@Data @Data
public class LineInterviewDTO { public class LineInterviewDTO {
private Integer lineId; private Long lineId;
private String investmentManager; private String investmentManager;

View File

@@ -110,6 +110,29 @@ public interface ExhibitionService {
*/ */
SignUpExhibitionVO signUpExhibition(SignUpExhibitionDTO signUpExhibitionDTO,LoginUserInfo userInfo) throws ApiException; SignUpExhibitionVO signUpExhibition(SignUpExhibitionDTO signUpExhibitionDTO,LoginUserInfo userInfo) throws ApiException;
/**
* 取消报名
* @param exhibitionId
* @param lineId
* @param userInfo
* @return
*/
Boolean cancelSignUpExhibition(Integer exhibitionId,Long lineId,LoginUserInfo userInfo); Boolean cancelSignUpExhibition(Integer exhibitionId,Long lineId,LoginUserInfo userInfo);
/**
* 签到
* @param exhibitionId
* @param lineId
* @param userInfo
* @return
*/
Boolean manualCheckIn(Integer exhibitionId,Long lineId,LoginUserInfo userInfo);
/**
* 结束展会
* @param exhibitionId
* @param userInfo
* @return
*/
Boolean closeExhibition(Integer exhibitionId,LoginUserInfo userInfo);
} }

View File

@@ -35,7 +35,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -43,7 +42,6 @@ import javax.annotation.Resource;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@@ -82,6 +80,9 @@ public class ExhibitionServiceImpl implements ExhibitionService {
@Autowired @Autowired
private TRTCUtils trtcUtils; private TRTCUtils trtcUtils;
@Resource
HyPartnerIntentInfoDAO hyPartnerIntentInfoDAO;
@Resource @Resource
HyPartnerUserInfoDAO hyPartnerUserInfoDAO; HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
// @Value("${offline.exhibition.channel.id}") // @Value("${offline.exhibition.channel.id}")
@@ -459,13 +460,13 @@ public class ExhibitionServiceImpl implements ExhibitionService {
if (CollectionUtils.isEmpty(exhibitionLineDTOS)){ if (CollectionUtils.isEmpty(exhibitionLineDTOS)){
return pageInfo; return pageInfo;
} }
List<Integer> lineIds = exhibitionLineDTOS.stream().map(ExhibitionLineDTO::getLineId).collect(Collectors.toList()); List<Long> lineIds = exhibitionLineDTOS.stream().map(ExhibitionLineDTO::getLineId).collect(Collectors.toList());
//面试官info //面试官info
List<LineInterviewDTO> lineInterviewList = hyPartnerLineInfoDAO.lineInterviewList(lineIds); List<LineInterviewDTO> lineInterviewList = hyPartnerLineInfoDAO.lineInterviewList(lineIds);
Map<Integer, LineInterviewDTO> lineInterviewMap = lineInterviewList.stream().collect(Collectors.toMap(LineInterviewDTO::getLineId, date -> date)); Map<Long, LineInterviewDTO> lineInterviewMap = lineInterviewList.stream().collect(Collectors.toMap(LineInterviewDTO::getLineId, date -> date));
//招商经理info //招商经理info
List<LineInterviewDTO> lineInvestmentList = hyPartnerLineInfoDAO.lineInvestmentList(lineIds); List<LineInterviewDTO> lineInvestmentList = hyPartnerLineInfoDAO.lineInvestmentList(lineIds);
Map<Integer, LineInterviewDTO> lineInvestmentMap = lineInvestmentList.stream().collect(Collectors.toMap(LineInterviewDTO::getLineId, date -> date)); Map<Long, LineInterviewDTO> lineInvestmentMap = lineInvestmentList.stream().collect(Collectors.toMap(LineInterviewDTO::getLineId, date -> date));
List<ExhibitionLineVO> result = new ArrayList<>(); List<ExhibitionLineVO> result = new ArrayList<>();
exhibitionLineDTOS.forEach(x->{ exhibitionLineDTOS.forEach(x->{
ExhibitionLineVO exhibitionLineVO = new ExhibitionLineVO(); ExhibitionLineVO exhibitionLineVO = new ExhibitionLineVO();
@@ -569,7 +570,7 @@ public class ExhibitionServiceImpl implements ExhibitionService {
if (signUpExhibitionVO!=null){ if (signUpExhibitionVO!=null){
return signUpExhibitionVO; return signUpExhibitionVO;
} }
//是否重复报名 //是否重复报名(已结束的展会不算)
Integer exhibitionGroupId = hyExhibitionDO.getExhibitionGroupId(); Integer exhibitionGroupId = hyExhibitionDO.getExhibitionGroupId();
Integer count = hyExhibitionDAO.lineSignUpCount(exhibitionGroupId, lineId); Integer count = hyExhibitionDAO.lineSignUpCount(exhibitionGroupId, lineId);
if (count > 0){ if (count > 0){
@@ -577,7 +578,7 @@ public class ExhibitionServiceImpl implements ExhibitionService {
return new SignUpExhibitionVO(Boolean.FALSE,CommonConstants.THREE,SignUpStatusEnum.getSignUpFailMsg(SignUpStatusEnum.Sign_UP_FAIL_3,hyExhibitionGroupDO.getExhibitionGroupName())); return new SignUpExhibitionVO(Boolean.FALSE,CommonConstants.THREE,SignUpStatusEnum.getSignUpFailMsg(SignUpStatusEnum.Sign_UP_FAIL_3,hyExhibitionGroupDO.getExhibitionGroupName()));
} }
//开始报名 //开始报名
//判断是否之前报名过会销 //判断是否之前报名过会销
HyPartnerExhibitionDO partnerExhibition = hyPartnerExhibitionDAO.getPartnerExhibition(hyExhibitionDO.getId(), lineId); HyPartnerExhibitionDO partnerExhibition = hyPartnerExhibitionDAO.getPartnerExhibition(hyExhibitionDO.getId(), lineId);
if (partnerExhibition != null){ if (partnerExhibition != null){
partnerExhibition.setParticipationStatus(ExhibitionPartnerStatus.REGISTERED.getCode()); partnerExhibition.setParticipationStatus(ExhibitionPartnerStatus.REGISTERED.getCode());
@@ -600,7 +601,7 @@ public class ExhibitionServiceImpl implements ExhibitionService {
hyPartnerExhibitionDAO.insertSelective(hyPartnerExhibitionDO); hyPartnerExhibitionDAO.insertSelective(hyPartnerExhibitionDO);
} }
//计算是否会销中 //计算是否会销中
whetherInExhibition(lineId,Boolean.TRUE); whetherInExhibition(Arrays.asList(lineId),Boolean.TRUE);
if (sendNotice){ if (sendNotice){
//发送通知 //发送通知
eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.PARTNER_SIGNUP_EXHIBITION,Arrays.asList(investManager),mobileCheckDTO.getPartnerName(),mobileCheckDTO.getMobile(), eventCenterHttpRequest.sendFeiShuNotice(FeiShuNoticeMsgEnum.PARTNER_SIGNUP_EXHIBITION,Arrays.asList(investManager),mobileCheckDTO.getPartnerName(),mobileCheckDTO.getMobile(),
@@ -620,7 +621,58 @@ public class ExhibitionServiceImpl implements ExhibitionService {
partnerExhibition.setUpdater(userInfo.getUserId()); partnerExhibition.setUpdater(userInfo.getUserId());
hyPartnerExhibitionDAO.updateByPrimaryKeySelective(partnerExhibition); hyPartnerExhibitionDAO.updateByPrimaryKeySelective(partnerExhibition);
//计算是否会销中 //计算是否会销中
whetherInExhibition(lineId,Boolean.FALSE); whetherInExhibition(Arrays.asList(lineId),Boolean.FALSE);
return Boolean.TRUE;
}
@Override
public Boolean manualCheckIn(Integer exhibitionId, Long lineId,LoginUserInfo userInfo) {
//签到
HyPartnerIntentInfoDO hyPartnerIntentInfoDO = hyPartnerIntentInfoDAO.selectByLineId(lineId);
Integer status = ExhibitionPartnerStatus.SIGNED.getCode();
if (hyPartnerIntentInfoDO != null){
status = ExhibitionPartnerStatus.APPLIED.getCode();
}
HyPartnerExhibitionDO partnerExhibition = hyPartnerExhibitionDAO.getPartnerExhibition(exhibitionId, lineId);
partnerExhibition.setParticipationStatus(status);
partnerExhibition.setUpdater(userInfo.getUserId());
hyPartnerExhibitionDAO.updateByPrimaryKeySelective(partnerExhibition);
return Boolean.TRUE;
}
@Override
public Boolean closeExhibition(Integer exhibitionId, LoginUserInfo userInfo) {
//查询展会
HyExhibitionDO hyExhibitionDO = hyExhibitionDAO.selectByPrimaryKey(exhibitionId);
if (hyExhibitionDO == null){
throw new ServiceException(ErrorCodeEnum.EXHIBITION_NOT_EXIST);
}
hyExhibitionDO.setClosedType(CommonConstants.TWO);
hyExhibitionDO.setUpdater(userInfo.getUserId());
//更新展会结束状态
hyExhibitionDAO.updateByPrimaryKeySelective(hyExhibitionDO);
//批量处理报名线索是否会销中状态
List<ExhibitionLineDTO> exhibitionLine = hyPartnerExhibitionDAO.getExhibitionLine(hyExhibitionDO.getId());
List<Long> lineIds = exhibitionLine.stream().map(ExhibitionLineDTO::getLineId).collect(Collectors.toList());
//结束是否会销中
whetherInExhibition(lineIds,Boolean.FALSE);
Integer exhibitionGroupId = hyExhibitionDO.getExhibitionGroupId();
List<HyExhibitionDO> hyExhibitionDOS = hyExhibitionDAO.listByExhibitionGroupId(exhibitionGroupId, Boolean.FALSE);
if (CollectionUtils.isEmpty(hyExhibitionDOS)){
//如果没有会销是打开状态了,则关闭会销组
HyExhibitionGroupDO hyExhibitionGroupDO = new HyExhibitionGroupDO();
hyExhibitionGroupDO.setClosed(Boolean.TRUE);
hyExhibitionGroupDO.setId(exhibitionGroupId);
hyExhibitionGroupDAO.updateByPrimaryKeySelective(hyExhibitionGroupDO);
}
//短信通知
exhibitionLine.stream().forEach(x->{
try {
eventCenterHttpRequest.sendSmsVariable(x.getMobile(),SMSMsgEnum.EXHIBITION_CLOSE);
} catch (ApiException e) {
log.info("closeExhibition 发送短信通知失败,mobile:{},exhibitionId:{}",x.getMobile(),hyExhibitionDO.getId());
}
});
return Boolean.TRUE; return Boolean.TRUE;
} }
@@ -628,16 +680,21 @@ public class ExhibitionServiceImpl implements ExhibitionService {
* 计算是否会销中 * 计算是否会销中
* @param lineId * @param lineId
*/ */
private void whetherInExhibition(Long lineId,Boolean insertFlag){ private void whetherInExhibition(List<Long> lineId,Boolean insertFlag){
//计算是否会销中(报名了会销(不能是取消报名状态) 且会销属于开发中 ) //计算是否会销中(报名了会销(不能是取消报名状态) 且会销属于开发中 )
Integer count = hyPartnerExhibitionDAO.partnerSignUpCount(lineId); List<PartnerSignUpDTO> partnerSignUpDTOS = hyPartnerExhibitionDAO.partnerSignUpCount(lineId);
log.info("partnerSignUpCount:{}",count); log.info("whetherInExhibition:{}", JSONObject.toJSONString(partnerSignUpDTOS));
//会销状态 //会销状态
Boolean exhibitionStatus = (count>CommonConstants.ZERO||insertFlag)?Boolean.TRUE:Boolean.FALSE; Map<Long, Integer> map = partnerSignUpDTOS.stream().collect(Collectors.toMap(PartnerSignUpDTO::getLineId, PartnerSignUpDTO::getCount));
HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO(); List<HyPartnerLineInfoDO> lineInfoDOS = new ArrayList<>();
hyPartnerLineInfoDO.setId(lineId); lineId.forEach(x->{
hyPartnerLineInfoDO.setWhetherInExhibition(exhibitionStatus); Boolean exhibitionStatus = (map.get(x)!=null||insertFlag)?Boolean.TRUE:Boolean.FALSE;
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO); HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO();
hyPartnerLineInfoDO.setId(x);
hyPartnerLineInfoDO.setWhetherInExhibition(exhibitionStatus);
lineInfoDOS.add(hyPartnerLineInfoDO);
});
hyPartnerLineInfoDAO.batchUpdate(lineInfoDOS);
} }
/** /**

View File

@@ -89,7 +89,7 @@ public class ExhibitionController {
} }
@GetMapping(value = "/getExhibitionLineList") @GetMapping(value = "/lineListByExhibitionId")
@ApiOperation("会销报名列表") @ApiOperation("会销报名列表")
public ResponseResult getExhibitionLineList(@RequestParam(required = true,value = "exhibitionId") Integer exhibitionId, public ResponseResult getExhibitionLineList(@RequestParam(required = true,value = "exhibitionId") Integer exhibitionId,
@RequestParam(required = false,value = "participationStatus") Integer participationStatus, @RequestParam(required = false,value = "participationStatus") Integer participationStatus,
@@ -118,9 +118,24 @@ public class ExhibitionController {
@ApiOperation("取消报名会销") @ApiOperation("取消报名会销")
@GetMapping("/cancelSignUp") @GetMapping("/cancelSignUp")
public ResponseResult<Boolean> cancelSignUp(@RequestParam(required = true,value = "exhibitionId") Integer exhibitionId, public ResponseResult<Boolean> cancelSignUp(@RequestParam(required = true,value = "exhibitionId") Integer exhibitionId,
@RequestParam(required = true,value = "lineId") Long lineId) throws ApiException { @RequestParam(required = true,value = "lineId") Long lineId) {
LoginUserInfo user = CurrentUserHolder.getUser(); LoginUserInfo user = CurrentUserHolder.getUser();
return ResponseResult.success(exhibitionService.cancelSignUpExhibition(exhibitionId,lineId,user)); return ResponseResult.success(exhibitionService.cancelSignUpExhibition(exhibitionId,lineId,user));
} }
@ApiOperation("签到")
@GetMapping("/manualCheckIn")
public ResponseResult<Boolean> manualCheckIn(@RequestParam(required = true,value = "exhibitionId") Integer exhibitionId,
@RequestParam(required = true,value = "lineId") Long lineId) {
LoginUserInfo user = CurrentUserHolder.getUser();
return ResponseResult.success(exhibitionService.manualCheckIn(exhibitionId,lineId,user));
}
@ApiOperation("结束会销")
@GetMapping("/closeExhibition")
public ResponseResult<Boolean> closeExhibition(@RequestParam(required = true,value = "exhibitionId") Integer exhibitionId) {
LoginUserInfo user = CurrentUserHolder.getUser();
return ResponseResult.success(exhibitionService.closeExhibition(exhibitionId,user));
}
} }

View File

@@ -35,8 +35,7 @@ public class ExhibitionController {
@ApiOperation("报名会销") @ApiOperation("报名会销")
@PostMapping("/signUpExhibition") @PostMapping("/signUpExhibition")
public ResponseResult<SignUpExhibitionVO> signUpExhibition(@RequestBody SignUpExhibitionDTO dto) throws ApiException { public ResponseResult<SignUpExhibitionVO> signUpExhibition(@RequestBody SignUpExhibitionDTO dto) throws ApiException {
LoginUserInfo user = CurrentUserHolder.getUser(); return ResponseResult.success(exhibitionService.signUpExhibition(dto,new LoginUserInfo()));
return ResponseResult.success(exhibitionService.signUpExhibition(dto,user));
} }
} }