fix review

This commit is contained in:
guohb
2024-05-08 11:29:36 +08:00
parent db782d89fc
commit c0d966423e
13 changed files with 72 additions and 60 deletions

View File

@@ -174,6 +174,8 @@ public enum ErrorCodeEnum {
SIGN_FRANCHISE_NOT_FOUND(109009, "加盟合同签约信息为空", null),
UNISSUED_STATEMENT(109010, "该门店未发布账单,无法付款", null),
INSERT_OPENING_OPERATION_PLAN_AUDIT_FALSE(103001,"插入运营方案审核信息失败",null),
INSERT_OPENING_OPERATION_PLAN_FALSE(103002,"插入运营方案失败",null),

View File

@@ -33,11 +33,12 @@ public class LinePayDAO {
}
/**
* //todo 全部替换掉后弃用
*
* @param lineId
* @param payBusinessType
* @return
*/
@Deprecated
public LinePayDO getLinePayByLineIdAndPayType(Long lineId,Integer payBusinessType) {
LinePayDO linePayDO = linePayMapper.getByLineIdAndPayTypeAndShopId(lineId,payBusinessType,null);
return linePayDO;

View File

@@ -1,7 +1,10 @@
package com.cool.store.mapper;
import com.cool.store.entity.FranchiseFeeDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
public interface FranchiseFeeMapper extends Mapper<FranchiseFeeDO> {
FranchiseFeeDO selectByShopId(@Param("shopId") Long shopId);
}

View File

@@ -2,4 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.FranchiseFeeMapper">
<select id="selectByShopId" resultType="com.cool.store.entity.FranchiseFeeDO">
select *
from xfsg_franchise_fee
where shop_id = #{shopId}
</select>
</mapper>

View File

@@ -101,7 +101,10 @@
deleted,
</if>
<if test="payBusinessType !=null">
pay_business_type
pay_business_type,
</if>
<if test="shopId !=null">
shop_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -160,7 +163,10 @@
#{deleted,jdbcType=BIT},
</if>
<if test="payBusinessType !=null">
#{payBusinessType,jdbcType=TINYINT}
#{payBusinessType,jdbcType=TINYINT},
</if>
<if test="shopId !=null">
#{shopId},
</if>
</trim>
</insert>

View File

@@ -15,7 +15,6 @@ public class LinePaySubmitRequest {
private String partnerId;
@ApiModelProperty("line_info.id")
@NotNull(message = "线索id不能为空")
private Long lineId;
@ApiModelProperty("支付状态 45:待缴费 50:已缴费 55缴费失败")

View File

@@ -107,6 +107,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
@Override
public SubmitLicenseResponse getDefault(Long shopId) {
//todo 业务逻辑问题 @zhy
//1.如果已经提交过证照信息,直接查询后组装数据返回
LicenseTransactDO result = applyLicenseMapper.selectByShopId(shopId);
SubmitLicenseResponse submitLicenseResponse = new SubmitLicenseResponse();

View File

@@ -101,10 +101,11 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
shopAuditInfoDO.setRejectReason(request.getResult());
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_74;
}
//更新阶段信息
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), shopSubStageStatusEnum);
//插入audit
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
//更新阶段信息
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_80);
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), shopSubStageStatusEnum,shopAuditInfoDO.getId());
//更新auditId
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByPrimaryKey(request.getId());
franchiseFeeDO.setAuditId(shopAuditInfoDO.getId());

View File

@@ -1,6 +1,7 @@
package com.cool.store.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dao.HyPartnerUserInfoDAO;
import com.cool.store.dao.LineInfoDAO;
import com.cool.store.dao.LinePayDAO;
@@ -23,6 +24,7 @@ import com.cool.store.service.LinePayService;
import com.cool.store.utils.poi.constant.Constants;
import com.cool.store.vo.LinePayVO;
import com.cool.store.vo.PartnerUserInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
@@ -38,6 +40,7 @@ import java.util.Objects;
* @Version 1.0
*/
@Service
@Slf4j
public class LinePayServiceImpl implements LinePayService {
@Resource
@@ -68,59 +71,44 @@ public class LinePayServiceImpl implements LinePayService {
@Override
@Transactional(rollbackFor = Exception.class)
public Long submitPayInfo(LinePaySubmitRequest request, PartnerUserInfoVO partnerUser) {
public Long submitPayInfo(LinePaySubmitRequest request, PartnerUserInfoVO partnerUser){
log.info("submitPayInfo request{}partnerUser{}", JSONObject.toJSONString(request),JSONObject.toJSONString(partnerUser));
LineInfoDO lineInfo = new LineInfoDO();
if (request.getLineId() != null){
lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
}
if (request.getPayBusinessType() != null
&& request.getPayBusinessType() == Constants.ONE_INTEGER
&& request.getShopId() != null) {
LinePayDO linePayDO = linePayDAO.getByLineIdAndPayTypeAndShopId(request.getLineId(), request.getPayBusinessType(),request.getShopId());
if (Objects.isNull(linePayDO)) {
fillLinePay(true, linePayDO, request, partnerUser);
Long aLong = linePayDAO.addLinePay(linePayDO);
FranchiseFeeDO franchiseFeeDO = new FranchiseFeeDO();
franchiseFeeDO.setShopId(request.getShopId());
FranchiseFeeDO result = franchiseFeeMapper.selectOneByExample(franchiseFeeDO);
result.setPayId(aLong);
franchiseFeeMapper.updateByPrimaryKeySelective(result);
} else {
fillLinePay(false, linePayDO, request, partnerUser);
linePayDAO.updateLinePay(linePayDO);
LinePayDO linePayDO = linePayDAO.getByLineIdAndPayTypeAndShopId(request.getLineId(), request.getPayBusinessType(),request.getShopId());
Long payId = checkAndFill(linePayDO, request, partnerUser);
if (PayBusinessTypeEnum.FRANCHISE_FEE.getCode().equals(request.getPayBusinessType()) && payId != null){
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(request.getShopId());
if (Objects.isNull(franchiseFeeDO)){
throw new ServiceException(ErrorCodeEnum.UNISSUED_STATEMENT);
}
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72);
} else if (request.getPayBusinessType() != null
&& request.getPayBusinessType() == PayBusinessTypeEnum.DECORATION_MODEL.getCode()
&& request.getShopId() != null) {
LinePayDO linePayDO = linePayDAO.getLinePayByLineIdAndPayType(request.getLineId(), PayBusinessTypeEnum.DECORATION_MODEL.getCode());
if (linePayDO == null) {
linePayDO = new LinePayDO();
fillLinePay(true, linePayDO, request, partnerUser);
linePayDAO.addLinePay(linePayDO);
} else {
fillLinePay(false, linePayDO, request, partnerUser);
linePayDAO.updateLinePay(linePayDO);
}
return linePayDO.getId();
} else {
LinePayDO linePayDO = linePayDAO.getLinePayByLineIdAndPayType(request.getLineId(), 0);
if (linePayDO == null) {
linePayDO = new LinePayDO();
fillLinePay(true, linePayDO, request, partnerUser);
linePayDAO.addLinePay(linePayDO);
} else {
fillLinePay(false, linePayDO, request, partnerUser);
linePayDAO.updateLinePay(linePayDO);
}
franchiseFeeDO.setPayId(payId);
franchiseFeeMapper.updateByPrimaryKeySelective(franchiseFeeDO);
}
if (PayBusinessTypeEnum.INTENT_MONEY.getCode().equals(request.getPayBusinessType())){
lineInfo.setWorkflowSubStage(WorkflowSubStageEnum.PAY_DEPOSIT.getCode());
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode());
lineInfoDAO.insertOrUpdate(lineInfo);
return linePayDO.getId();
}
return payId == null ? null : payId;
}
return null;
private Long checkAndFill(LinePayDO linePayDO,
LinePaySubmitRequest request,
PartnerUserInfoVO partnerUser) {
if (Objects.isNull(linePayDO)){
linePayDO = new LinePayDO();
fillLinePay(Boolean.TRUE, linePayDO, request, partnerUser);
Long aLong = linePayDAO.addLinePay(linePayDO);
return aLong;
}
else {
fillLinePay(Boolean.FALSE, linePayDO, request, partnerUser);
linePayDAO.updateLinePay(linePayDO);
return null;
}
}
private void fillLinePay(Boolean isAdd, LinePayDO linePayDO, LinePaySubmitRequest request, PartnerUserInfoVO partnerUser) {

View File

@@ -165,8 +165,11 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
SystemBuildingShopDO systemBuildingShopDO = systemBuildingShopMapper.selectOne(SystemBuildingShopDO.builder().shopId(shopId).lineId(lineId).build());
//证照办理
LicenseTransactDO licenseTransactDO = applyLicenseMapper.selectOne(LicenseTransactDO.builder().shopId(shopId).build());
//三方部门表
ThirdDepartmentDO thirdDepartmentDO = thirdDepartmentMapper.getByName(systemBuildingShopDO.getBigName());
ThirdDepartmentDO thirdDepartmentDO = new ThirdDepartmentDO();
if (Objects.nonNull(systemBuildingShopDO)){
//三方部门表
thirdDepartmentDO = thirdDepartmentMapper.getByName(systemBuildingShopDO.getBigName());
}
//找不到的url统一用这个
List<String> temp = new ArrayList<>();
temp.add("object");

View File

@@ -418,6 +418,11 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
shopAuditInfoDO.setRejectReason(request.getCause());
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_32;
}else if (request.getAuditResult() == Constants.ONE_INTEGER){
//更新门店编码
ShopInfoDO shopInfoDO = new ShopInfoDO();
shopInfoDO.setId(shopId);
shopInfoDO.setStoreNum(request.getStoreNum());
shopInfoMapper.updateByPrimaryKeySelective(shopInfoDO);
shopAuditInfoDO.setResultType(Constants.ZERO_INTEGER);
shopAuditInfoDO.setPassReason(request.getCause());
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33;
@@ -425,16 +430,10 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
preparationService.contractAndBuildStoreCompletion(shopId);
}
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
//更新阶段状态
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, shopSubStageStatusEnum,shopAuditInfoDO.getId());
}catch (Exception e){
throw new ServiceException(ErrorCodeEnum.UNKNOWN);
}finally {
//更新门店编码
ShopInfoDO shopInfoDO = new ShopInfoDO();
shopInfoDO.setId(shopId);
shopInfoDO.setStoreNum(request.getStoreNum());
shopInfoMapper.updateByPrimaryKeySelective(shopInfoDO);
//更新阶段状态
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, shopSubStageStatusEnum,null);
}
return true;
}

View File

@@ -35,9 +35,11 @@ public class KdzApiController {
log.info("auditResult requestBody :{}", JSONObject.toJSONString(request));
//todo 暂时去掉验签测试
// if(!verifyMD5(request,eid)){
// log.error("验签失败,request{};eid:{}",JSONObject.toJSONString(request),eid);
// return ResponseResult.fail(ErrorCodeEnum.VERIFY_MD5_FALSE);
// }
// if(eid == null || request.getBizContent() == null){
// log.error("参数校验失败,BizContent{}",JSONObject.toJSONString(request.getBizContent()));
// return ResponseResult.fail(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
// }
AuditResultRequest auditResultRequest = JSONObject.parseObject(request.getBizContent(), AuditResultRequest.class);
@@ -50,9 +52,11 @@ public class KdzApiController {
@RequestBody XfsgOpenApiRequest request) {
log.info("auditResult requestBody :{}", JSONObject.toJSONString(request));
if(!verifyMD5(request,eid)){
log.error("验签失败,request{};eid:{}",JSONObject.toJSONString(request),eid);
return ResponseResult.fail(ErrorCodeEnum.VERIFY_MD5_FALSE);
}
if(eid == null || request.getBizContent() == null){
log.error("参数校验失败,BizContent{}",JSONObject.toJSONString(request.getBizContent()));
return ResponseResult.fail(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
LicenseBizContentRequest storeNum = JSONObject.parseObject(request.getBizContent(), LicenseBizContentRequest.class);

View File

@@ -54,7 +54,7 @@ public class PCApplyLicenseController {
* @return
*/
@GetMapping(path = "/examine")
@ApiOperation("证照审批列表")
@ApiOperation("证照审批")
public ResponseResult licenseExamine(@RequestParam("id") Long shopId,
@RequestParam("status") Integer status,
@RequestParam("result") String result) {