Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner

This commit is contained in:
zhangchenbiao
2023-06-25 16:33:16 +08:00
13 changed files with 110 additions and 12 deletions

View File

@@ -66,7 +66,7 @@ public class CoolDateUtils {
LocalDate today = LocalDate.now();
LocalDate thirdDay = today.plusDays(day);
LocalDateTime thirdDayMidnight = LocalDateTime.of(thirdDay, LocalTime.MIDNIGHT);
LocalDateTime thirdDay235959 = thirdDayMidnight.with(LocalTime.MAX);
LocalDateTime thirdDay235959 = thirdDayMidnight.with(LocalTime.MIN);
ZonedDateTime zonedDateTime = ZonedDateTime.of(thirdDay235959, ZoneId.systemDefault());
return Date.from(zonedDateTime.toInstant());
}

View File

@@ -0,0 +1,30 @@
package com.cool.store.dao;
import com.cool.store.entity.HyPartnerTaskInfoLogDO;
import com.cool.store.mapper.HyPartnerTaskInfoLogMapper;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
/**
* @Author wxp
* @Date 2023/6/25 19:41
* @Version 1.0
*/
@Repository
public class HyPartnerTaskInfoLogDAO {
@Resource
HyPartnerTaskInfoLogMapper hyPartnerTaskInfoLogMapper;
public int updateByPrimaryKeySelective(HyPartnerTaskInfoLogDO hyPartnerTaskInfoLogDO){
return hyPartnerTaskInfoLogMapper.updateByPrimaryKeySelective(hyPartnerTaskInfoLogDO);
}
public int insertSelective( HyPartnerTaskInfoLogDO record){
return hyPartnerTaskInfoLogMapper.insertSelective(record);
}
}

View File

@@ -315,7 +315,7 @@
b.interviewer as interviewer,
b.create_time as createTime,
b.room_id as roomId
from hy_partner_interview a inner join hy_partner_interview_plan b on a.interview_plan_id = b.id
from hy_partner_interview a left join hy_partner_interview_plan b on a.interview_plan_id = b.id
<where>
<if test="userId!=null and userId!=''">
and a.interviewer = #{userId}

View File

@@ -265,7 +265,7 @@
select
IFNULL(sum(if(workflow_stage=1 and workflow_status = 1,1,0)),0) as intentApplyApproveCount,
IFNULL(sum(if(workflow_stage=2 and workflow_status = 1,1,0)),0) as reservationInterviewCount,
IFNULL(sum(if(workflow_stage=3 and workflow_status = 3,1,0)),0) as qualifiedInterviewCount
IFNULL(sum(if(workflow_stage=3 and workflow_status = 4,1,0)),0) as qualifiedInterviewCount
from hy_partner_line_info
<where>
<if test="userId!=null and userId!=''">
@@ -277,7 +277,7 @@
<select id="selectStageFollowCount" resultType="com.cool.store.dto.partner.StageCountDTO">
select
IFNULL(sum(if(workflow_stage=1 and workflow_status = 1,1,0)),0) as intentApplyApproveCount,
IFNULL(sum(if(workflow_stage=1 and workflow_status = 0,1,0)),0) as intentApplyApproveCount,
IFNULL(sum(if(workflow_stage=2 and workflow_status = 0,1,0)),0) as reservationInterviewCount,
IFNULL(sum(if(workflow_stage=3 and workflow_status = 4,1,0)),0) as qualifiedInterviewCount
from hy_partner_line_info

View File

@@ -11,7 +11,7 @@
<result column="message" jdbcType="VARCHAR" property="message" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="partner_id" jdbcType="BIGINT" property="partnerId" />
<result column="partner_id" jdbcType="VARCHAR" property="partnerId" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.entity.HyPartnerTaskInfoLogDO">
<result column="field_copy" jdbcType="LONGVARCHAR" property="fieldCopy" />

View File

@@ -46,8 +46,18 @@ public class HyPartnerTaskInfoLogDO implements Serializable {
private Date updateTime;
@ApiModelProperty("hy_partner_user_info.partner_id")
private Long partnerId;
private String partnerId;
@ApiModelProperty("字段备份")
private String fieldCopy;
public HyPartnerTaskInfoLogDO(String partnerId, Long partnerLineId, String workflowStage, String workflowStatus, String operateUserId, String operateUsername, String message) {
this.partnerId = partnerId;
this.partnerLineId = partnerLineId;
this.workflowStage = workflowStage;
this.workflowStatus = workflowStatus;
this.operateUserId = operateUserId;
this.operateUsername = operateUsername;
this.message = message;
}
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.vo;
import com.cool.store.request.WantShopInfoRequest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -51,7 +52,7 @@ public class PartnerIntentInfoVO {
private Integer isHaveWantShop;
@ApiModelProperty("意向铺位信息,json字段,最多5个")
private String wantShopInfo;
private List<WantShopInfoVO> wantShopInfo;
@ApiModelProperty("最大预算")
private String maxBudget;

View File

@@ -0,0 +1,43 @@
package com.cool.store.vo;
import com.cool.store.request.WantShopInfoRequest;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2023/6/25 15:53
* @Version 1.0
*/
@Data
public class WantShopInfoVO {
private ShopInfoVO shopInfo;
private String uuid;
@Data
static class ShopInfoVO{
private ShopAddressVO shopAddress;
private String storeIsTakeDown;
private String takeDown;
}
@Data
static class ShopAddressVO{
private String address;
private String longitude;
private String latitude;
}
}

View File

@@ -22,7 +22,7 @@ public interface HyPartnerBaseInfoService {
*/
Boolean addTags(AddTagsRequest addTagsRequest);
Boolean submitPartnerBaseInfo(PartnerBaseInfoRequest request);
Boolean submitPartnerBaseInfo(PartnerBaseInfoRequest request, PartnerUserInfoVO currentUser);
PartnerBaseInfoVO queryPartnerBaseInfo(String partnerId, Long lineId);

View File

@@ -5,9 +5,11 @@ import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.RedisConstant;
import com.cool.store.dao.HyPartnerBaseInfoDAO;
import com.cool.store.dao.HyPartnerLineInfoDAO;
import com.cool.store.dao.HyPartnerTaskInfoLogDAO;
import com.cool.store.dao.HyPartnerUserInfoDAO;
import com.cool.store.entity.HyPartnerBaseInfoDO;
import com.cool.store.entity.HyPartnerLineInfoDO;
import com.cool.store.entity.HyPartnerTaskInfoLogDO;
import com.cool.store.entity.HyPartnerUserInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.LineStatusEnum;
@@ -53,6 +55,10 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
@Resource
private RedisUtilPool redisUtilPool;
@Resource
HyPartnerTaskInfoLogDAO hyPartnerTaskInfoLogDAO;
@Override
public Boolean addTags(AddTagsRequest addTagsRequest) {
HyPartnerBaseInfoDO hyPartnerBaseInfoDO = new HyPartnerBaseInfoDO();
@@ -69,7 +75,7 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
* @return
*/
@Override
public Boolean submitPartnerBaseInfo(PartnerBaseInfoRequest request) {
public Boolean submitPartnerBaseInfo(PartnerBaseInfoRequest request, PartnerUserInfoVO currentUser) {
String cacheKey = MessageFormat.format(RedisConstant.PARTNER_BASEINFO_CACHE_KEY, request.getPartnerId(), request.getPartnerLineId());
if(!request.getSubmitFlag()){
// 自动保存时
@@ -94,6 +100,10 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
HyPartnerBaseInfoDO hyPartnerBaseInfoDO = hyPartnerBaseInfoDAO.getByPartnerIdAndLineId(request.getPartnerId(), request.getPartnerLineId());
hyPartnerBaseInfoDO.setStatus(Integer.valueOf(WorkflowStatusEnum.INTENT_1.getCode()));
hyPartnerBaseInfoDAO.updateByPrimaryKeySelective(hyPartnerBaseInfoDO);
HyPartnerTaskInfoLogDO logDO = new HyPartnerTaskInfoLogDO(request.getPartnerId(), request.getPartnerLineId(), WorkflowStageEnum.INTENT.getCode(), WorkflowStatusEnum.INTENT_1.getCode(), currentUser.getPartnerId(), currentUser.getUsername(), null);
hyPartnerTaskInfoLogDAO.insertSelective(logDO);
}
// 清空暂存信息
redisUtilPool.delKey(cacheKey);

View File

@@ -23,6 +23,7 @@ import com.cool.store.utils.StringUtil;
import com.cool.store.vo.PartnerIntentApplyInfoVO;
import com.cool.store.vo.PartnerIntentInfoVO;
import com.cool.store.vo.PartnerUserInfoVO;
import com.cool.store.vo.WantShopInfoVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
@@ -159,7 +160,9 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
}
HyPartnerIntentInfoDO intentInfoDO = hyPartnerIntentInfoDAO.getByPartnerIdAndLineId(userInfoVO.getPartnerId(), lineId);
PartnerIntentInfoVO intentInfoVO = new PartnerIntentInfoVO();
intentInfoVO.setLiveArea(userInfoVO.getLiveArea());
intentInfoVO.setWantShopArea(userInfoVO.getWantShopArea());
intentInfoVO.setAcceptAdjustType(userInfoVO.getAcceptAdjustType());
if (intentInfoDO != null){
BeanUtil.copyProperties(intentInfoDO, intentInfoVO);
}
@@ -223,7 +226,7 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
partnerIntentInfoVO.setOtherBand(hyPartnerIntentInfoDO.getOtherBand());
partnerIntentInfoVO.setStrength(hyPartnerIntentInfoDO.getStrength());
partnerIntentInfoVO.setNeedImprove(hyPartnerIntentInfoDO.getNeedImprove());
partnerIntentInfoVO.setWantShopInfo(hyPartnerIntentInfoDO.getWantShopInfo());
partnerIntentInfoVO.setWantShopInfo(JSONObject.parseArray(hyPartnerIntentInfoDO.getWantShopInfo(), WantShopInfoVO.class));
return partnerIntentInfoVO;
}

View File

@@ -45,7 +45,7 @@ public class RegionController {
@ApiOperation("查询所有被绑定战区的组织机构")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "intent-意向区域 development 开发区域", required = false)
@ApiImplicitParam(name = "type", value = "intent-意向区域 dev 开发区域", required = false)
})
@GetMapping("/queryAllBingZoneRegionList")
public ResponseResult<List<String>> queryAllBingZoneRegionList(@RequestParam(value = "type",required = false)String type){

View File

@@ -96,7 +96,8 @@ public class PartnerController {
public ResponseResult<Boolean> submitPartnerBaseInfo(@RequestBody PartnerBaseInfoRequest baseInfoRequest){
//前提 未提交加盟申请
//成功 意向区域变更成功 失败 您已进入意向申请流程,当前不可变更意向区域
return ResponseResult.success(hyPartnerBaseInfoService.submitPartnerBaseInfo(baseInfoRequest));
PartnerUserInfoVO currentUser = PartnerUserHolder.getUser();
return ResponseResult.success(hyPartnerBaseInfoService.submitPartnerBaseInfo(baseInfoRequest, currentUser));
}
@PostMapping(path = "/submitPartnerClerkInfo")