签约相关
This commit is contained in:
@@ -8,6 +8,7 @@ public enum AuditTypeEnum {
|
||||
SYS_BUILD(4, "系统建店"),
|
||||
SITE_SELECTION(5, "选址"),
|
||||
UPLOAD_RENT_CONTRACT(6, "上传租赁合同"),
|
||||
PAY_FRANCHISE_FEE(7,"缴纳加盟费"),
|
||||
;
|
||||
|
||||
private Integer code;
|
||||
|
||||
@@ -20,6 +20,4 @@ public interface ShopAuditInfoMapper extends Mapper<ShopAuditInfoDO> {
|
||||
* @description:根据店铺id查询审批结果
|
||||
*/
|
||||
Long selectAuditIdByShopId(@Param("shopId") Long shopId);
|
||||
|
||||
|
||||
}
|
||||
@@ -21,6 +21,8 @@ public class FranchiseFeeDO {
|
||||
private Long shopId;
|
||||
@Column(name = "pay_id")
|
||||
private Long payId;
|
||||
@Column(name = "audit_id")
|
||||
private Long auditId;
|
||||
@Column(name = "year_franchise_fee")
|
||||
private String yearFranchiseFee;
|
||||
@Column(name = "loan_margin")
|
||||
|
||||
@@ -13,4 +13,7 @@ public class AuditFranchiseFeeRequest {
|
||||
|
||||
@ApiModelProperty("shopId")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("主键id")
|
||||
private Long id;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,110 @@ public class FranchiseFeeResponse {
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
private LinePayDO linePayDO;
|
||||
private LinePay linePayDO;
|
||||
|
||||
@Data
|
||||
public static class LinePay{
|
||||
@ApiModelProperty("")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("xfsg_user_info.partner_id")
|
||||
private String partnerId;
|
||||
|
||||
@ApiModelProperty("line_info.id")
|
||||
private Long lineId;
|
||||
|
||||
@ApiModelProperty("支付状态 45:待缴费 50:已缴费 55缴费失败")
|
||||
private Integer payStatus;
|
||||
|
||||
@ApiModelProperty("支付方式 1微信 2银行转账")
|
||||
private Integer payType;
|
||||
|
||||
@ApiModelProperty("付款人姓名")
|
||||
private String payUserName;
|
||||
|
||||
@ApiModelProperty("付款账号")
|
||||
private String payAccount;
|
||||
|
||||
@ApiModelProperty("开户行code")
|
||||
private String bankCode;
|
||||
|
||||
@ApiModelProperty("开户行名称")
|
||||
private String bankName;
|
||||
|
||||
@ApiModelProperty("支行code")
|
||||
private String branchBankCode;
|
||||
|
||||
@ApiModelProperty("支行名称")
|
||||
private String branchBankName;
|
||||
|
||||
@ApiModelProperty("缴纳时间")
|
||||
private Date payTime;
|
||||
|
||||
@ApiModelProperty("付款截图")
|
||||
private String payPic;
|
||||
|
||||
@ApiModelProperty("承诺书图片")
|
||||
private String promisePic;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private String createUserId;
|
||||
|
||||
@ApiModelProperty("更新人")
|
||||
private String updateUserId;
|
||||
|
||||
@ApiModelProperty("是否删除:0.否 1.是")
|
||||
private Boolean deleted;
|
||||
|
||||
@ApiModelProperty("支付类型 0-缴纳意向金 1-缴纳加盟费 2-装修款")
|
||||
private Integer payBusinessType;
|
||||
|
||||
@ApiModelProperty("缴费金额")
|
||||
private String amount;
|
||||
|
||||
@ApiModelProperty("加盟商姓名")
|
||||
private String partnerName;
|
||||
|
||||
@ApiModelProperty("审核原因")
|
||||
private String result;
|
||||
|
||||
@ApiModelProperty("审核状态")
|
||||
private Integer status;
|
||||
|
||||
public static LinePay from(LinePayDO linePayDO) {
|
||||
if (linePayDO == null) {
|
||||
return null;
|
||||
}
|
||||
LinePay linePayDO1 = new LinePay();
|
||||
linePayDO1.setId(linePayDO.getId());
|
||||
linePayDO1.setPartnerId(linePayDO.getPartnerId());
|
||||
linePayDO1.setLineId(linePayDO.getLineId());
|
||||
linePayDO1.setPayStatus(linePayDO.getPayStatus());
|
||||
linePayDO1.setPayType(linePayDO.getPayType());
|
||||
linePayDO1.setPayUserName(linePayDO.getPayUserName());
|
||||
linePayDO1.setPayAccount(linePayDO.getPayAccount());
|
||||
linePayDO1.setBankCode(linePayDO.getBankCode());
|
||||
linePayDO1.setBankName(linePayDO.getBankName());
|
||||
linePayDO1.setBranchBankCode(linePayDO.getBranchBankCode());
|
||||
linePayDO1.setBranchBankName(linePayDO.getBranchBankName());
|
||||
linePayDO1.setPayTime(linePayDO.getPayTime());
|
||||
linePayDO1.setPayPic(linePayDO.getPayPic());
|
||||
linePayDO1.setPromisePic(linePayDO.getPromisePic());
|
||||
linePayDO1.setCreateTime(linePayDO.getCreateTime());
|
||||
linePayDO1.setUpdateTime(linePayDO.getUpdateTime());
|
||||
linePayDO1.setCreateUserId(linePayDO.getCreateUserId());
|
||||
linePayDO1.setUpdateUserId(linePayDO.getUpdateUserId());
|
||||
linePayDO1.setDeleted(linePayDO.getDeleted());
|
||||
linePayDO1.setPayBusinessType(linePayDO.getPayBusinessType());
|
||||
return linePayDO1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,11 +5,13 @@ 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.LineInfoDO;
|
||||
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.LineInfoMapper;
|
||||
import com.cool.store.mapper.LinePayMapper;
|
||||
import com.cool.store.mapper.ShopAuditInfoMapper;
|
||||
import com.cool.store.request.AuditFranchiseFeeRequest;
|
||||
@@ -22,6 +24,8 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@@ -39,6 +43,9 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
|
||||
@Resource
|
||||
ShopStageInfoDAO shopStageInfoDAO;
|
||||
|
||||
@Resource
|
||||
LineInfoMapper lineInfoMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean submitLicense(FranchiseFeeRequest request) {
|
||||
@@ -54,8 +61,17 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
|
||||
franchiseFeeDO.setShopId(shopId);
|
||||
FranchiseFeeDO result = franchiseFeeMapper.selectOneByExample(franchiseFeeDO);
|
||||
LinePayDO linePayDO = linePayMapper.selectByPrimaryKey(result.getPayId());
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(linePayDO.getLineId());
|
||||
FranchiseFeeResponse resp = FranchiseFeeResponse.from(result);
|
||||
resp.setLinePayDO(linePayDO);
|
||||
FranchiseFeeResponse.LinePay linePayResult = FranchiseFeeResponse.LinePay.from(linePayDO);
|
||||
linePayResult.setAmount(new BigInteger(result.getPerformanceBond()).add(new BigInteger(result.getFirstYearFee())).toString());
|
||||
linePayResult.setPartnerName(lineInfoDO.getUsername());
|
||||
if (Objects.nonNull(result.getAuditId())){
|
||||
ShopAuditInfoDO shopAuditInfoDO = shopAuditInfoMapper.selectByPrimaryKey(result.getAuditId());
|
||||
linePayResult.setStatus(shopAuditInfoDO.getResultType());
|
||||
linePayResult.setResult(shopAuditInfoDO.getResultType() == 0 ? shopAuditInfoDO.getPassReason() : shopAuditInfoDO.getRejectReason());
|
||||
}
|
||||
resp.setLinePayDO(linePayResult);
|
||||
return resp;
|
||||
}
|
||||
|
||||
@@ -64,7 +80,7 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
|
||||
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
|
||||
shopAuditInfoDO.setShopId(request.getShopId());
|
||||
ShopSubStageStatusEnum shopSubStageStatusEnum = null;
|
||||
shopAuditInfoDO.setAuditType(AuditTypeEnum.LICENSE_APPROVAL.getCode());
|
||||
shopAuditInfoDO.setAuditType(AuditTypeEnum.PAY_FRANCHISE_FEE.getCode());
|
||||
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||
shopAuditInfoDO.setSubmittedUserId(user.getUserId());
|
||||
shopAuditInfoDO.setSubmittedUserName(user.getName());
|
||||
@@ -77,7 +93,14 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
|
||||
shopAuditInfoDO.setRejectReason(request.getResult());
|
||||
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_74;
|
||||
}
|
||||
//更新阶段信息
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(),shopSubStageStatusEnum);
|
||||
return shopAuditInfoMapper.insertSelective(shopAuditInfoDO) == 1 ? true : false;
|
||||
//插入audit
|
||||
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
|
||||
//更新auditId
|
||||
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByPrimaryKey(request.getId());
|
||||
franchiseFeeDO.setAuditId(shopAuditInfoDO.getId());
|
||||
franchiseFeeMapper.updateByPrimaryKeySelective(franchiseFeeDO);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user