签约相关

This commit is contained in:
guohb
2024-04-29 11:39:29 +08:00
parent 7bd55c9592
commit 3b888eef40
4 changed files with 69 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class AuditFranchiseFeeRequest {
@ApiModelProperty("原因")
private String result;
@ApiModelProperty("0通过 1不通过")
private Integer status;
@ApiModelProperty("shopId")
private Long shopId;
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.service; package com.cool.store.service;
import com.cool.store.request.AuditFranchiseFeeRequest;
import com.cool.store.request.FranchiseFeeRequest; import com.cool.store.request.FranchiseFeeRequest;
import com.cool.store.response.FranchiseFeeResponse; import com.cool.store.response.FranchiseFeeResponse;
@@ -17,4 +18,6 @@ public interface FranchiseFeeService {
* @return * @return
*/ */
FranchiseFeeResponse getDetail(Long shopId); FranchiseFeeResponse getDetail(Long shopId);
Boolean auditFranchiseFee(AuditFranchiseFeeRequest request);
} }

View File

@@ -1,15 +1,25 @@
package com.cool.store.service.impl; package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.ShopStageInfoDAO;
import com.cool.store.entity.FranchiseFeeDO; import com.cool.store.entity.FranchiseFeeDO;
import com.cool.store.entity.LinePayDO; import com.cool.store.entity.LinePayDO;
import com.cool.store.entity.ShopAuditInfoDO;
import com.cool.store.enums.AuditTypeEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.mapper.FranchiseFeeMapper; import com.cool.store.mapper.FranchiseFeeMapper;
import com.cool.store.mapper.LinePayMapper; import com.cool.store.mapper.LinePayMapper;
import com.cool.store.mapper.ShopAuditInfoMapper;
import com.cool.store.request.AuditFranchiseFeeRequest;
import com.cool.store.request.FranchiseFeeRequest; import com.cool.store.request.FranchiseFeeRequest;
import com.cool.store.response.FranchiseFeeResponse; import com.cool.store.response.FranchiseFeeResponse;
import com.cool.store.service.FranchiseFeeService; import com.cool.store.service.FranchiseFeeService;
import com.cool.store.utils.poi.constant.Constants;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
@@ -23,12 +33,19 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
@Resource @Resource
LinePayMapper linePayMapper; LinePayMapper linePayMapper;
@Resource
ShopAuditInfoMapper shopAuditInfoMapper;
@Resource
ShopStageInfoDAO shopStageInfoDAO;
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Boolean submitLicense(FranchiseFeeRequest request) { public Boolean submitLicense(FranchiseFeeRequest request) {
log.info("submitLicense request{}", JSONObject.toJSONString(request)); log.info("submitLicense request{}", JSONObject.toJSONString(request));
FranchiseFeeDO franchiseFeeDO = request.toFranchiseFeeDO(); FranchiseFeeDO franchiseFeeDO = request.toFranchiseFeeDO();
franchiseFeeMapper.insertSelective(franchiseFeeDO); shopStageInfoDAO.updateShopStageInfo(request.getShopId(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72);
return null; return franchiseFeeMapper.insertSelective(franchiseFeeDO) == 1 ? true:false;
} }
@Override @Override
@@ -41,4 +58,26 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
resp.setLinePayDO(linePayDO); resp.setLinePayDO(linePayDO);
return resp; return resp;
} }
@Override
public Boolean auditFranchiseFee(AuditFranchiseFeeRequest request) {
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
shopAuditInfoDO.setShopId(request.getShopId());
ShopSubStageStatusEnum shopSubStageStatusEnum = null;
shopAuditInfoDO.setAuditType(AuditTypeEnum.LICENSE_APPROVAL.getCode());
LoginUserInfo user = CurrentUserHolder.getUser();
shopAuditInfoDO.setSubmittedUserId(user.getUserId());
shopAuditInfoDO.setSubmittedUserName(user.getName());
shopAuditInfoDO.setDataType(1);
shopAuditInfoDO.setResultType(request.getStatus());
if (request.getStatus() == Constants.ZERO_INTEGER){
shopAuditInfoDO.setPassReason(request.getResult());
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73;
}else if (request.getStatus() == Constants.ONE_INTEGER){
shopAuditInfoDO.setRejectReason(request.getResult());
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_74;
}
shopStageInfoDAO.updateShopStageInfo(request.getShopId(),shopSubStageStatusEnum);
return shopAuditInfoMapper.insertSelective(shopAuditInfoDO) == 1 ? true : false;
}
} }

View File

@@ -1,5 +1,6 @@
package com.cool.store.controller.webb; package com.cool.store.controller.webb;
import com.cool.store.request.AuditFranchiseFeeRequest;
import com.cool.store.request.FranchiseFeeRequest; import com.cool.store.request.FranchiseFeeRequest;
import com.cool.store.request.SubmitLicenseRequest; import com.cool.store.request.SubmitLicenseRequest;
import com.cool.store.response.FranchiseFeeResponse; import com.cool.store.response.FranchiseFeeResponse;
@@ -33,4 +34,12 @@ public class PCFranchiseFeeController {
public ResponseResult<FranchiseFeeResponse> getDetail(@RequestParam("shopId") Long shopId) { public ResponseResult<FranchiseFeeResponse> getDetail(@RequestParam("shopId") Long shopId) {
return ResponseResult.success(franchiseFeeService.getDetail(shopId)); return ResponseResult.success(franchiseFeeService.getDetail(shopId));
} }
@ApiOperation("缴纳加盟费/保证金审核接口")
@PostMapping("/audit")
public ResponseResult auditFranchiseFee(@RequestBody AuditFranchiseFeeRequest request) {
return ResponseResult.success(franchiseFeeService.auditFranchiseFee(request));
}
} }