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

This commit is contained in:
zhangchenbiao
2024-04-29 19:18:52 +08:00
13 changed files with 148 additions and 13 deletions

View File

@@ -9,6 +9,7 @@ public enum AuditTypeEnum {
SITE_SELECTION(5, "选址"),
UPLOAD_RENT_CONTRACT(6, "上传租赁合同"),
PAY_FRANCHISE_FEE(7,"缴纳加盟费"),
SIGN_FRANCHISE(8,"加盟合同签约"),
;
private Integer code;

View File

@@ -2,7 +2,10 @@ package com.cool.store.mapper;
import com.cool.store.entity.SystemBuildingShopDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface SystemBuildingShopMapper extends tk.mybatis.mapper.common.Mapper<SystemBuildingShopDO> {
void updateAuditByShopId(@Param("auditId") Long auditId,
@Param("shopId") Long shopId);
}

View File

@@ -107,7 +107,7 @@
AND lai.create_time BETWEEN #{startTime} AND #{endTime}
</if>
<if test="region != null and region != ''">
and l.want_shop_area_id in (select id from xfsg_open_area_info where area_path like concat(#{areaPath}, '%'))
and l.want_shop_area_id in (select id from xfsg_open_area_info where area_path like concat(#{region}, '%'))
</if>
<if test="checkStatus != null">
AND a.audit_status = #{checkStatus}

View File

@@ -8,5 +8,10 @@
<sql id="Base_Column_List">
</sql>
<update id="updateAuditByShopId">
update xfsg_system_building_shop
set audit_id = #{auditId}
where shop_id = #{shopId}
</update>
</mapper>

View File

@@ -18,8 +18,10 @@ public class SignFranchiseDO {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "xfsg_shop_info.id")
@Column(name = "shop_id")
private Long shopId;
@Column(name = "audit_id")
private Long auditId;
@Column(name = "sign_type")
private Integer signType;
@Column(name = "brand_fee")

View File

@@ -143,5 +143,14 @@ public class AddSignFranchiseResponse {
@ApiModelProperty("享受加盟费和保证金优惠原因")
private String reasons;
@ApiModelProperty("状态 0通过,1拒绝")
private Integer status;
@ApiModelProperty("原因")
private String result;
@ApiModelProperty("失败时间")
private Date resultTime;
}

View File

@@ -82,8 +82,8 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
shopAuditInfoDO.setSubmittedUserName(user.getName());
shopAuditInfoDO.setDataType(0);
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_41,null);
}
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_41,null);
return true;
}

View File

@@ -98,11 +98,16 @@ public class AuditStatusServiceImpl implements AuditStatusService {
LineInterviewDO lineInterviewDO = lineInterviewMapper.selectByPrimaryKey(auditStatusDO.getInterviewId());
LineAuditInfoDO auditInfo = lineAuditInfoDAO.getAuditInfo(auditStatusDO.getAuditId());
response.setVideoUrl(JSONObject.parseArray(lineInterviewDO.getVideoUrl(), String.class));
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()));
if (Objects.nonNull(lineInterviewDO.getActualStartTime())){
response.setStartTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, lineInterviewDO.getActualStartTime()));
}
if (Objects.nonNull(lineInterviewDO.getActualEndTime())){
response.setEndTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, lineInterviewDO.getActualEndTime()));
}
if (Objects.nonNull(auditStatusDO.getCreateTime())){
response.setCheckTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, auditStatusDO.getCreateTime()));
}
response.setCheckUser(auditStatusDO.getAuditUserName());
response.setCheckTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, auditStatusDO.getCreateTime()));
response.setCheckStatus(auditStatusDO.getAuditStatus());
if (auditInfo.getResultType() > 0) {
response.setCheckResult(auditInfo.getRejectPublicReason());

View File

@@ -51,7 +51,7 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
public Boolean submitLicense(FranchiseFeeRequest request) {
log.info("submitLicense request{}", JSONObject.toJSONString(request));
FranchiseFeeDO franchiseFeeDO = request.toFranchiseFeeDO();
shopStageInfoDAO.updateShopStageInfo(request.getShopId(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72);
shopStageInfoDAO.updateShopStageInfo(request.getShopId(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_71);
return franchiseFeeMapper.insertSelective(franchiseFeeDO) == 1 ? true:false;
}
@@ -59,7 +59,7 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
public FranchiseFeeResponse getDetail(Long shopId) {
FranchiseFeeDO franchiseFeeDO = new FranchiseFeeDO();
franchiseFeeDO.setShopId(shopId);
FranchiseFeeDO result = franchiseFeeMapper.selectOneByExample(franchiseFeeDO);
FranchiseFeeDO result = franchiseFeeMapper.selectOne(franchiseFeeDO);
LinePayDO linePayDO = linePayMapper.selectByPrimaryKey(result.getPayId());
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(linePayDO.getLineId());
FranchiseFeeResponse resp = FranchiseFeeResponse.from(result);

View File

@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import com.cool.store.dao.HyPartnerUserInfoDAO;
import com.cool.store.dao.LineInfoDAO;
import com.cool.store.dao.LinePayDAO;
import com.cool.store.dao.ShopStageInfoDAO;
import com.cool.store.entity.FranchiseFeeDO;
import com.cool.store.entity.HyPartnerUserInfoDO;
import com.cool.store.entity.LineInfoDO;
@@ -13,6 +14,7 @@ import com.cool.store.enums.WorkflowSubStageEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.enums.point.PayBusinessTypeEnum;
import com.cool.store.enums.point.PayTypeEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.FranchiseFeeMapper;
import com.cool.store.mapper.LineInfoMapper;
@@ -47,6 +49,9 @@ public class LinePayServiceImpl implements LinePayService {
@Resource
FranchiseFeeMapper franchiseFeeMapper;
@Resource
ShopStageInfoDAO shopStageInfoDAO;
@Override
public LinePayVO getLinePayInfo(Long lineId) {
LinePayVO result = null;
@@ -84,6 +89,7 @@ public class LinePayServiceImpl implements LinePayService {
fillLinePay(false, linePayDO, request, partnerUser);
linePayDAO.updateLinePay(linePayDO);
}
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72);
}
if(request.getPayBusinessType() != null
&& request.getPayBusinessType() == 0

View File

@@ -7,10 +7,7 @@ import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.ShopStageInfoDAO;
import com.cool.store.entity.*;
import com.cool.store.enums.AuditEnum;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.FranchiseeTypeEnum;
import com.cool.store.enums.SignTypeEnum;
import com.cool.store.enums.*;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.*;
@@ -22,6 +19,7 @@ import com.cool.store.response.ResponseResult;
import com.cool.store.service.CoolStoreStartFlowService;
import com.cool.store.service.SignFranchiseService;
import com.cool.store.utils.poi.DateUtils;
import com.cool.store.utils.poi.constant.Constants;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -75,6 +73,9 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
@Resource
ShopStageInfoDAO shopStageInfoDAO;
@Resource
ShopAuditInfoMapper shopAuditInfoMapper;
@Override
public Boolean auditResult(AuditResultRequest request) {
log.info("SignFranchiseServiceImpl auditResult request{}", JSONObject.toJSONString(request));
@@ -86,6 +87,22 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_85;
}
shopStageInfoDAO.updateShopStageInfo(shopId, shopSubStageStatusEnum);
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
shopAuditInfoDO.setShopId(shopId);
shopAuditInfoDO.setAuditType(AuditTypeEnum.SIGN_FRANCHISE.getCode());
LoginUserInfo user = CurrentUserHolder.getUser();
shopAuditInfoDO.setSubmittedUserId(user.getUserId());
shopAuditInfoDO.setSubmittedUserName(user.getName());
if (request.getAuditResult() == Constants.ZERO_INTEGER){
shopAuditInfoDO.setResultType(Constants.ONE_INTEGER);
shopAuditInfoDO.setRejectReason(request.getCause());
}else if (request.getAuditResult() == Constants.ONE_INTEGER){
shopAuditInfoDO.setResultType(Constants.ZERO_INTEGER);
shopAuditInfoDO.setPassReason(request.getCause());
}
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
Long auditId = shopAuditInfoDO.getId();
systemBuildingShopMapper.updateAuditByShopId(auditId,shopId);
return null;
}
@@ -261,6 +278,16 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
public AddSignFranchiseResponse getSignFranchise(Long shopId) {
SignFranchiseDO signFranchiseDO = signFranchiseMapper.selectByShopId(shopId);
AddSignFranchiseResponse response = from(signFranchiseDO, shopId);
if (Objects.nonNull(signFranchiseDO)){
ShopAuditInfoDO shopAuditInfoDO = shopAuditInfoMapper.selectByPrimaryKey(signFranchiseDO.getAuditId());
response.setStatus(shopAuditInfoDO.getResultType());
if (shopAuditInfoDO.getResultType() == 0){
response.setResult(shopAuditInfoDO.getPassReason());
}else {
response.setResult(shopAuditInfoDO.getRejectReason());
}
response.setResultTime(shopAuditInfoDO.getCreateTime());
}
return response;
}

View File

@@ -0,0 +1,44 @@
package com.cool.store.controller.webc;
import com.cool.store.request.AuditFranchiseFeeRequest;
import com.cool.store.request.FranchiseFeeRequest;
import com.cool.store.response.FranchiseFeeResponse;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.FranchiseFeeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping("/mini/franchiseFee")
@Api(tags = "Mini 加盟费/保证金")
@Slf4j
public class MiniFranchiseFeeController {
@Resource
FranchiseFeeService franchiseFeeService;
@ApiOperation("基本信息提交")
@PostMapping("/submit")
public ResponseResult submitLicense(@RequestBody FranchiseFeeRequest request) {
return ResponseResult.success(franchiseFeeService.submitLicense(request));
}
@ApiOperation("基本信息查询")
@GetMapping("/getDetail")
public ResponseResult<FranchiseFeeResponse> getDetail(@RequestParam("shopId") Long shopId) {
return ResponseResult.success(franchiseFeeService.getDetail(shopId));
}
@ApiOperation("缴纳加盟费/保证金审核接口")
@PostMapping("/audit")
public ResponseResult auditFranchiseFee(@RequestBody AuditFranchiseFeeRequest request) {
return ResponseResult.success(franchiseFeeService.auditFranchiseFee(request));
}
}

View File

@@ -0,0 +1,33 @@
package com.cool.store.controller.webc;
import com.cool.store.request.AddSignFranchiseRequest;
import com.cool.store.response.AddSignFranchiseResponse;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.SignFranchiseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@Api(tags = "pc加盟合同签约")
@RestController
@RequestMapping("/mini/signFranchise")
public class MiniSignFranchiseController {
@Resource
SignFranchiseService signFranchiseService;
@ApiOperation("提交(更新)加盟合同签约")
@PostMapping("/submitOrUpdate")
public ResponseResult<Boolean> submitSignFranchise(@RequestBody AddSignFranchiseRequest request) {
return signFranchiseService.submitSignFranchise(request);
}
@ApiOperation("获取默认值")
@GetMapping("/default/get")
public ResponseResult<AddSignFranchiseResponse> getSignFranchise(@RequestParam("shopId") Long shopId) {
return ResponseResult.success(signFranchiseService.getSignFranchise(shopId));
}
}