feat:回调
This commit is contained in:
@@ -270,6 +270,8 @@ public enum ErrorCodeEnum {
|
|||||||
CLAIM_STATUS_ERROR(1511023,"当前状态为已认领,不能进行操作",null),
|
CLAIM_STATUS_ERROR(1511023,"当前状态为已认领,不能进行操作",null),
|
||||||
PAY_USER_NAME_ERROR(1511024,"付款人最多为2人",null),
|
PAY_USER_NAME_ERROR(1511024,"付款人最多为2人",null),
|
||||||
DELETE_ERROR(1511025,"删除信息失败",null),
|
DELETE_ERROR(1511025,"删除信息失败",null),
|
||||||
|
RECEIPT_NOT_EXIST(1511026,"收款单不存在或已被删除",null),
|
||||||
|
XGJ_COLLECTION_STATUS_COMPLETE(1511027,"新管家收费状态已完成,请确认!",null),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -87,4 +87,8 @@ public class LinePayDAO {
|
|||||||
public Integer deleteById(Long id,String userId) {
|
public Integer deleteById(Long id,String userId) {
|
||||||
return linePayMapper.deleteById(id,userId);
|
return linePayMapper.deleteById(id,userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LinePayDO selectByPaymentReceiptCode(String paymentReceiptCode) {
|
||||||
|
return linePayMapper.selectByPaymentReceiptCode(paymentReceiptCode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,4 +60,6 @@ public interface LinePayMapper {
|
|||||||
List<LinePayDO>getFranchiseFeePayInfoByShopId(@Param("shopId") Long shopId);
|
List<LinePayDO>getFranchiseFeePayInfoByShopId(@Param("shopId") Long shopId);
|
||||||
|
|
||||||
Integer deleteById(@Param("id") Long id,@Param("userId")String userId);
|
Integer deleteById(@Param("id") Long id,@Param("userId")String userId);
|
||||||
|
|
||||||
|
LinePayDO selectByPaymentReceiptCode(@Param("paymentReceiptCode") String paymentReceiptCode);
|
||||||
}
|
}
|
||||||
@@ -393,4 +393,9 @@
|
|||||||
<update id="deleteById">
|
<update id="deleteById">
|
||||||
update xfsg_line_pay set deleted = 1 ,update_time = now(),update_user_id = #{userId} where id = #{id}
|
update xfsg_line_pay set deleted = 1 ,update_time = now(),update_user_id = #{userId} where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
|
||||||
|
<select id="selectByPaymentReceiptCode" resultType="com.cool.store.entity.LinePayDO">
|
||||||
|
select * from xfsg_line_pay where deleted = 0 and payment_receipt_code = #{paymentReceiptCode} and pay_business_type = 1 order by create_time desc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ public class LinePaySubmitRequest {
|
|||||||
linePayDO.setPaySerialNumber(request.getPaySerialNumber());
|
linePayDO.setPaySerialNumber(request.getPaySerialNumber());
|
||||||
linePayDO.setAmount(request.getAmount());
|
linePayDO.setAmount(request.getAmount());
|
||||||
linePayDO.setPayBusinessType(request.getPayBusinessType());
|
linePayDO.setPayBusinessType(request.getPayBusinessType());
|
||||||
|
linePayDO.setXgjClaimStatus(0);
|
||||||
linePayDO.setRemark(request.getRemark());
|
linePayDO.setRemark(request.getRemark());
|
||||||
return linePayDO;
|
return linePayDO;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.cool.store.request.xgj;
|
||||||
|
|
||||||
|
import com.cool.store.dto.region.BigRegionDTO;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/6/4 11:02
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class FranchiseFeeCallBackRequest {
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private Long shopId;
|
||||||
|
@NotNull
|
||||||
|
private BigDecimal payableFee;
|
||||||
|
@NotNull
|
||||||
|
private BigDecimal remainingFee;
|
||||||
|
@NotNull
|
||||||
|
private Integer paymentStatus;
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package com.cool.store.request.xgj;
|
||||||
|
|
||||||
|
import com.cool.store.entity.FranchiseFeeDO;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/6/3 16:52
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PushFranchiseFeeRequest {
|
||||||
|
|
||||||
|
@ApiModelProperty( "CRM系统门店ID")
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
@ApiModelProperty( "加盟商姓名")
|
||||||
|
private String partnerName;
|
||||||
|
|
||||||
|
@ApiModelProperty( "账单ID")
|
||||||
|
private Integer billId;
|
||||||
|
|
||||||
|
@ApiModelProperty( "加盟费")
|
||||||
|
private BigDecimal franchiseFee;
|
||||||
|
|
||||||
|
@ApiModelProperty( "保证金")
|
||||||
|
private BigDecimal bond;
|
||||||
|
|
||||||
|
@ApiModelProperty( "第一年度管理费")
|
||||||
|
private BigDecimal firstYearManageFee;
|
||||||
|
|
||||||
|
@ApiModelProperty( "第一年度品牌使用费")
|
||||||
|
private BigDecimal firstYearFee;
|
||||||
|
|
||||||
|
@ApiModelProperty( "设计费")
|
||||||
|
private BigDecimal designFee;
|
||||||
|
|
||||||
|
@ApiModelProperty( "应缴费合计金额")
|
||||||
|
private BigDecimal totalFee;
|
||||||
|
|
||||||
|
@ApiModelProperty( "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
public PushFranchiseFeeRequest(){}
|
||||||
|
public PushFranchiseFeeRequest(Long shopId, String partnerName, FranchiseFeeDO franchiseFeeDO){
|
||||||
|
this.setShopId(shopId);
|
||||||
|
this.setPartnerName(partnerName);
|
||||||
|
this.setBillId(franchiseFeeDO.getId().intValue());
|
||||||
|
this.setFranchiseFee(new BigDecimal(franchiseFeeDO.getYearFranchiseFee()));
|
||||||
|
this.setBond(new BigDecimal(franchiseFeeDO.getLoanMargin()));
|
||||||
|
this.setFirstYearManageFee(new BigDecimal(franchiseFeeDO.getFirstYearManageFee()));
|
||||||
|
this.setFirstYearFee(new BigDecimal(franchiseFeeDO.getFirstYearFee()));
|
||||||
|
this.setDesignFee(new BigDecimal(franchiseFeeDO.getPerformanceBond()));
|
||||||
|
this.setTotalFee(this.getBond()
|
||||||
|
.add(this.getFirstYearManageFee())
|
||||||
|
.add(this.getFirstYearFee())
|
||||||
|
.add(this.getDesignFee()));
|
||||||
|
this.setCreateTime(franchiseFeeDO.getCreateTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.cool.store.request.xgj;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Max;
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/6/4 11:01
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ReceiptCallBackRequest {
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
private String receiptId;
|
||||||
|
|
||||||
|
@Max(1)@Min(0)@NotNull
|
||||||
|
private Integer claimStatus;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package com.cool.store.request.xgj;
|
||||||
|
|
||||||
|
import com.cool.store.entity.FranchiseFeeDO;
|
||||||
|
import com.cool.store.entity.LinePayDO;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.DecimalMin;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/6/4 9:33
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ReceiptRequest {
|
||||||
|
|
||||||
|
@ApiModelProperty( "CRM系统门店ID")
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
@ApiModelProperty( "账单ID")
|
||||||
|
private Integer billId;
|
||||||
|
|
||||||
|
@ApiModelProperty( "收款单ID")
|
||||||
|
private String receiptId;
|
||||||
|
|
||||||
|
@ApiModelProperty( "付款人")
|
||||||
|
private String payer1;
|
||||||
|
|
||||||
|
@ApiModelProperty("付款金额")
|
||||||
|
private BigDecimal paymentAmount;
|
||||||
|
|
||||||
|
@ApiModelProperty("交易流水号")
|
||||||
|
private String transactionNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty( "开户行")
|
||||||
|
private String bankName;
|
||||||
|
|
||||||
|
@ApiModelProperty( "开户支行")
|
||||||
|
private String branchBankName;
|
||||||
|
|
||||||
|
@ApiModelProperty( "付款账号")
|
||||||
|
private String payAccount;
|
||||||
|
|
||||||
|
@ApiModelProperty( "付款凭证")
|
||||||
|
private String payPic;
|
||||||
|
|
||||||
|
@ApiModelProperty( "付款方式")
|
||||||
|
private Integer payWay = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty( "认领状态")
|
||||||
|
private Integer claimStatus = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty( "删除标识")
|
||||||
|
private Integer deleted = 0;
|
||||||
|
|
||||||
|
public ReceiptRequest() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReceiptRequest(Long shopId, Integer billId, LinePayDO payDO){
|
||||||
|
this.setShopId(shopId);
|
||||||
|
this.setBillId(billId);
|
||||||
|
this.setReceiptId(payDO.getPaymentReceiptCode());
|
||||||
|
this.setPayer1(payDO.getPayUserName());
|
||||||
|
this.setPayAccount(payDO.getPayAccount());
|
||||||
|
this.setTransactionNumber(payDO.getPaySerialNumber());
|
||||||
|
this.setBankName(payDO.getBankName());
|
||||||
|
this.setBranchBankName(payDO.getBranchBankName());
|
||||||
|
this.setPaymentAmount(payDO.getAmount());
|
||||||
|
this.setPayPic(payDO.getPayPic());
|
||||||
|
this.setClaimStatus(payDO.getXgjClaimStatus());
|
||||||
|
this.setDeleted(payDO.getDeleted()?1:0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.cool.store.response.bigdata;
|
package com.cool.store.response.bigdata;
|
||||||
|
|
||||||
import com.cool.store.constants.CommonConstants;
|
import com.cool.store.constants.CommonConstants;
|
||||||
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
import com.cool.store.enums.ResponseCodeEnum;
|
import com.cool.store.enums.ResponseCodeEnum;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.slf4j.MDC;
|
import org.slf4j.MDC;
|
||||||
@@ -29,4 +30,8 @@ public class ApiResponse<T> {
|
|||||||
public static<T> ApiResponse<T> success(T data) {
|
public static<T> ApiResponse<T> success(T data) {
|
||||||
return new ApiResponse(ResponseCodeEnum.SUCCESS.getCode(), "ok", data);
|
return new ApiResponse(ResponseCodeEnum.SUCCESS.getCode(), "ok", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static<T> ApiResponse<T> error(ErrorCodeEnum errorCodeEnum) {
|
||||||
|
return new ApiResponse(errorCodeEnum.getCode(), errorCodeEnum.getMessage(), null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ package com.cool.store.service;
|
|||||||
import com.cool.store.context.LoginUserInfo;
|
import com.cool.store.context.LoginUserInfo;
|
||||||
import com.cool.store.request.AuditFranchiseFeeRequest;
|
import com.cool.store.request.AuditFranchiseFeeRequest;
|
||||||
import com.cool.store.request.FranchiseFeeRequest;
|
import com.cool.store.request.FranchiseFeeRequest;
|
||||||
|
import com.cool.store.request.xgj.FranchiseFeeCallBackRequest;
|
||||||
import com.cool.store.response.FranchiseFeeResponse;
|
import com.cool.store.response.FranchiseFeeResponse;
|
||||||
|
import com.cool.store.response.bigdata.ApiResponse;
|
||||||
|
|
||||||
public interface FranchiseFeeService {
|
public interface FranchiseFeeService {
|
||||||
/**
|
/**
|
||||||
@@ -22,4 +24,6 @@ public interface FranchiseFeeService {
|
|||||||
FranchiseFeeResponse getDetail(Long shopId);
|
FranchiseFeeResponse getDetail(Long shopId);
|
||||||
|
|
||||||
Boolean auditFranchiseFee(AuditFranchiseFeeRequest request, LoginUserInfo user);
|
Boolean auditFranchiseFee(AuditFranchiseFeeRequest request, LoginUserInfo user);
|
||||||
|
|
||||||
|
ApiResponse<Boolean> changePaymentStatus(FranchiseFeeCallBackRequest request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,11 @@ package com.cool.store.service;
|
|||||||
import com.cool.store.context.CurrentUserHolder;
|
import com.cool.store.context.CurrentUserHolder;
|
||||||
import com.cool.store.context.LoginUserInfo;
|
import com.cool.store.context.LoginUserInfo;
|
||||||
import com.cool.store.dto.AmountDTO;
|
import com.cool.store.dto.AmountDTO;
|
||||||
|
import com.cool.store.entity.LinePayDO;
|
||||||
import com.cool.store.request.LinePaySubmitRequest;
|
import com.cool.store.request.LinePaySubmitRequest;
|
||||||
|
import com.cool.store.request.xgj.ReceiptCallBackRequest;
|
||||||
import com.cool.store.response.FranchiseFeePayInfoResponse;
|
import com.cool.store.response.FranchiseFeePayInfoResponse;
|
||||||
|
import com.cool.store.response.bigdata.ApiResponse;
|
||||||
import com.cool.store.vo.LinePayVO;
|
import com.cool.store.vo.LinePayVO;
|
||||||
import com.cool.store.vo.PartnerUserInfoVO;
|
import com.cool.store.vo.PartnerUserInfoVO;
|
||||||
|
|
||||||
@@ -39,4 +42,16 @@ public interface LinePayService {
|
|||||||
Boolean deleteFranchiseFeePayInfo(Long id,String userId);
|
Boolean deleteFranchiseFeePayInfo(Long id,String userId);
|
||||||
|
|
||||||
FranchiseFeePayInfoResponse getById(Long id);
|
FranchiseFeePayInfoResponse getById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送数据到新管家
|
||||||
|
* @param shopId
|
||||||
|
* @param linePayDO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean pushPayInfo(Long shopId, LinePayDO linePayDO);
|
||||||
|
|
||||||
|
ApiResponse<Boolean> ReceiptCallBack(ReceiptCallBackRequest request);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package com.cool.store.service;
|
|||||||
|
|
||||||
import com.cool.store.dto.BatchStatusRefreshDTO;
|
import com.cool.store.dto.BatchStatusRefreshDTO;
|
||||||
import com.cool.store.dto.StatusRefreshDTO;
|
import com.cool.store.dto.StatusRefreshDTO;
|
||||||
|
import com.cool.store.request.xgj.FranchiseFeeCallBackRequest;
|
||||||
|
import com.cool.store.request.xgj.ReceiptCallBackRequest;
|
||||||
|
import com.cool.store.response.bigdata.ApiResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author suzhuhong
|
* @Author suzhuhong
|
||||||
@@ -19,4 +22,8 @@ public interface OpenApiService {
|
|||||||
Boolean statusRefresh(StatusRefreshDTO statusRefreshDTO);
|
Boolean statusRefresh(StatusRefreshDTO statusRefreshDTO);
|
||||||
|
|
||||||
|
|
||||||
|
ApiResponse<Boolean> changeReceiptStatus(ReceiptCallBackRequest request);
|
||||||
|
|
||||||
|
ApiResponse<Boolean> changePaymentStatus(FranchiseFeeCallBackRequest request);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import com.cool.store.dto.ModifyPasswordDTO;
|
|||||||
import com.cool.store.dto.XgjOrganizationDTO;
|
import com.cool.store.dto.XgjOrganizationDTO;
|
||||||
import com.cool.store.request.AuditRequest;
|
import com.cool.store.request.AuditRequest;
|
||||||
import com.cool.store.request.ZxjpApiRequest;
|
import com.cool.store.request.ZxjpApiRequest;
|
||||||
|
import com.cool.store.request.xgj.PushFranchiseFeeRequest;
|
||||||
|
import com.cool.store.request.xgj.ReceiptRequest;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -23,6 +25,20 @@ public interface PushService {
|
|||||||
*/
|
*/
|
||||||
Boolean pushDataToXGJ(ZxjpApiRequest zxjpApiRequest);
|
Boolean pushDataToXGJ(ZxjpApiRequest zxjpApiRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送加盟账单到新管家
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean pushFranchiseFeeToXGJ(PushFranchiseFeeRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送收款单到新管家
|
||||||
|
* @param receiptRequest
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean pushReceiptToXGJ(ReceiptRequest receiptRequest);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 推送数据到下游系统 POS
|
* 推送数据到下游系统 POS
|
||||||
* @param zxjpApiRequest
|
* @param zxjpApiRequest
|
||||||
|
|||||||
@@ -13,8 +13,12 @@ import com.cool.store.exception.ServiceException;
|
|||||||
import com.cool.store.mapper.*;
|
import com.cool.store.mapper.*;
|
||||||
import com.cool.store.request.AuditFranchiseFeeRequest;
|
import com.cool.store.request.AuditFranchiseFeeRequest;
|
||||||
import com.cool.store.request.FranchiseFeeRequest;
|
import com.cool.store.request.FranchiseFeeRequest;
|
||||||
|
import com.cool.store.request.xgj.FranchiseFeeCallBackRequest;
|
||||||
|
import com.cool.store.request.xgj.PushFranchiseFeeRequest;
|
||||||
import com.cool.store.response.FranchiseFeeResponse;
|
import com.cool.store.response.FranchiseFeeResponse;
|
||||||
|
import com.cool.store.response.bigdata.ApiResponse;
|
||||||
import com.cool.store.service.FranchiseFeeService;
|
import com.cool.store.service.FranchiseFeeService;
|
||||||
|
import com.cool.store.service.PushService;
|
||||||
import com.cool.store.service.UserAuthMappingService;
|
import com.cool.store.service.UserAuthMappingService;
|
||||||
import com.cool.store.utils.poi.constant.Constants;
|
import com.cool.store.utils.poi.constant.Constants;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -57,6 +61,8 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
|
|||||||
CommonService commonService;
|
CommonService commonService;
|
||||||
@Resource
|
@Resource
|
||||||
UserAuthMappingService userAuthMappingService;
|
UserAuthMappingService userAuthMappingService;
|
||||||
|
@Resource
|
||||||
|
PushService pushService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -81,6 +87,9 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
|
|||||||
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
|
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
|
||||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
|
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
|
||||||
commonService.sendSms(lineInfoDO.getMobile(), SMSMsgEnum.PAY_FRANCHISE_FEES);
|
commonService.sendSms(lineInfoDO.getMobile(), SMSMsgEnum.PAY_FRANCHISE_FEES);
|
||||||
|
//推送加盟费信息到新管家
|
||||||
|
PushFranchiseFeeRequest feeRequest = new PushFranchiseFeeRequest(shopInfoDO.getId(), lineInfoDO.getUsername(), franchiseFeeDO);
|
||||||
|
pushService.pushFranchiseFeeToXGJ(feeRequest);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,6 +100,12 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
|
|||||||
if (Objects.nonNull(franchiseFeeDO1)) {
|
if (Objects.nonNull(franchiseFeeDO1)) {
|
||||||
franchiseFeeDO.setId(franchiseFeeDO1.getId());
|
franchiseFeeDO.setId(franchiseFeeDO1.getId());
|
||||||
franchiseFeeMapper.updateByPrimaryKeySelective(franchiseFeeDO);
|
franchiseFeeMapper.updateByPrimaryKeySelective(franchiseFeeDO);
|
||||||
|
//推送数据
|
||||||
|
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
|
||||||
|
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
|
||||||
|
//推送加盟费信息到新管家
|
||||||
|
PushFranchiseFeeRequest feeRequest = new PushFranchiseFeeRequest(shopInfoDO.getId(), lineInfoDO.getUsername(), franchiseFeeDO);
|
||||||
|
pushService.pushFranchiseFeeToXGJ(feeRequest);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -175,4 +190,21 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
|
|||||||
// commonService.sendMessage(Collections.singletonList(lineInfoDO.getInvestmentManager()), MessageEnum.MESSAGE_18, requestMap);
|
// commonService.sendMessage(Collections.singletonList(lineInfoDO.getInvestmentManager()), MessageEnum.MESSAGE_18, requestMap);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ApiResponse<Boolean> changePaymentStatus(FranchiseFeeCallBackRequest request) {
|
||||||
|
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
|
||||||
|
if (Objects.isNull(shopInfoDO)){
|
||||||
|
return ApiResponse.error(ErrorCodeEnum.SHOP_ID_NOT_EXIST);
|
||||||
|
}
|
||||||
|
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(request.getShopId());
|
||||||
|
if (XGJCollectionStatusEnum.COMPLETED.getCode().equals(franchiseFeeDO.getXgjCollectionStatus())){
|
||||||
|
return ApiResponse.error(ErrorCodeEnum.XGJ_COLLECTION_STATUS_COMPLETE);
|
||||||
|
}
|
||||||
|
franchiseFeeDO.setXgjCollectionStatus(request.getPaymentStatus());
|
||||||
|
franchiseFeeDO.setXgjRemainderPayableAmount(request.getRemainingFee());
|
||||||
|
franchiseFeeDO.setXgjFeesPaid(request.getPayableFee());
|
||||||
|
franchiseFeeMapper.updateByPrimaryKeySelective(franchiseFeeDO);
|
||||||
|
return ApiResponse.success(Boolean.TRUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,12 @@ import com.cool.store.mapper.FranchiseFeeMapper;
|
|||||||
import com.cool.store.mapper.LineInfoMapper;
|
import com.cool.store.mapper.LineInfoMapper;
|
||||||
import com.cool.store.mapper.ShopInfoMapper;
|
import com.cool.store.mapper.ShopInfoMapper;
|
||||||
import com.cool.store.request.LinePaySubmitRequest;
|
import com.cool.store.request.LinePaySubmitRequest;
|
||||||
|
import com.cool.store.request.xgj.ReceiptCallBackRequest;
|
||||||
|
import com.cool.store.request.xgj.ReceiptRequest;
|
||||||
import com.cool.store.response.FranchiseFeePayInfoResponse;
|
import com.cool.store.response.FranchiseFeePayInfoResponse;
|
||||||
|
import com.cool.store.response.bigdata.ApiResponse;
|
||||||
import com.cool.store.service.LinePayService;
|
import com.cool.store.service.LinePayService;
|
||||||
|
import com.cool.store.service.PushService;
|
||||||
import com.cool.store.service.UserAuthMappingService;
|
import com.cool.store.service.UserAuthMappingService;
|
||||||
import com.cool.store.utils.CoolDateUtils;
|
import com.cool.store.utils.CoolDateUtils;
|
||||||
import com.cool.store.utils.RedisConstantUtil;
|
import com.cool.store.utils.RedisConstantUtil;
|
||||||
@@ -34,6 +38,7 @@ import com.cool.store.utils.poi.StringUtils;
|
|||||||
import com.cool.store.utils.poi.constant.Constants;
|
import com.cool.store.utils.poi.constant.Constants;
|
||||||
import com.cool.store.vo.LinePayVO;
|
import com.cool.store.vo.LinePayVO;
|
||||||
import com.cool.store.vo.PartnerUserInfoVO;
|
import com.cool.store.vo.PartnerUserInfoVO;
|
||||||
|
import jdk.nashorn.internal.codegen.types.BooleanType;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -84,6 +89,8 @@ public class LinePayServiceImpl implements LinePayService {
|
|||||||
private UserAuthMappingService userAuthMappingService;
|
private UserAuthMappingService userAuthMappingService;
|
||||||
@Resource
|
@Resource
|
||||||
RedisConstantUtil redisConstantUtil;
|
RedisConstantUtil redisConstantUtil;
|
||||||
|
@Resource
|
||||||
|
PushService pushService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LinePayVO getLinePayInfo(Long lineId, Integer businessType, Long shopId) {
|
public LinePayVO getLinePayInfo(Long lineId, Integer businessType, Long shopId) {
|
||||||
@@ -196,7 +203,8 @@ public class LinePayServiceImpl implements LinePayService {
|
|||||||
{
|
{
|
||||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72);
|
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72);
|
||||||
}
|
}
|
||||||
//todo 苏竹红推送数据
|
//推送数据
|
||||||
|
this.pushPayInfo(request.getShopId(),linePayDO);
|
||||||
return linePayDO.getId();
|
return linePayDO.getId();
|
||||||
} else {
|
} else {
|
||||||
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
|
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
|
||||||
@@ -254,10 +262,35 @@ public class LinePayServiceImpl implements LinePayService {
|
|||||||
throw new ServiceException(ErrorCodeEnum.CLAIM_STATUS_ERROR);
|
throw new ServiceException(ErrorCodeEnum.CLAIM_STATUS_ERROR);
|
||||||
}
|
}
|
||||||
linePayDAO.deleteById(id,userId);
|
linePayDAO.deleteById(id,userId);
|
||||||
//todo 苏竹红推送数据
|
//置为删除状态
|
||||||
|
linePay.setDeleted(Boolean.TRUE);
|
||||||
|
//推送数据
|
||||||
|
this.pushPayInfo(linePay.getShopId(),linePay);
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean pushPayInfo(Long shopId, LinePayDO linePayDO) {
|
||||||
|
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(shopId);
|
||||||
|
ReceiptRequest receiptRequest = new ReceiptRequest(shopId, franchiseFeeDO.getId().intValue(), linePayDO);
|
||||||
|
//推送缴费单数据到新管家
|
||||||
|
pushService.pushReceiptToXGJ(receiptRequest);
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ApiResponse<Boolean> ReceiptCallBack(ReceiptCallBackRequest request) {
|
||||||
|
LinePayDO linePayDO = linePayDAO.selectByPaymentReceiptCode(request.getReceiptId());
|
||||||
|
if (Objects.isNull(linePayDO)){
|
||||||
|
return ApiResponse.error(ErrorCodeEnum.RECEIPT_NOT_EXIST);
|
||||||
|
}
|
||||||
|
linePayDO.setXgjClaimStatus(request.getClaimStatus());
|
||||||
|
linePayDAO.updateLinePay(linePayDO);
|
||||||
|
return ApiResponse.success(Boolean.TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FranchiseFeePayInfoResponse getById(Long id) {
|
public FranchiseFeePayInfoResponse getById(Long id) {
|
||||||
if (id == null){
|
if (id == null){
|
||||||
@@ -405,4 +438,5 @@ public class LinePayServiceImpl implements LinePayService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,11 @@ import com.cool.store.enums.ShopAccountEnum;
|
|||||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.request.PostAndOrderRequest;
|
import com.cool.store.request.PostAndOrderRequest;
|
||||||
|
import com.cool.store.request.xgj.FranchiseFeeCallBackRequest;
|
||||||
|
import com.cool.store.request.xgj.ReceiptCallBackRequest;
|
||||||
|
import com.cool.store.response.bigdata.ApiResponse;
|
||||||
|
import com.cool.store.service.FranchiseFeeService;
|
||||||
|
import com.cool.store.service.LinePayService;
|
||||||
import com.cool.store.service.OpenApiService;
|
import com.cool.store.service.OpenApiService;
|
||||||
import com.cool.store.service.PosAndOrderInfoService;
|
import com.cool.store.service.PosAndOrderInfoService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -49,6 +54,10 @@ public class OpenApiServiceImpl implements OpenApiService {
|
|||||||
PosAndOrderInfoService posAndOrderInfoService;
|
PosAndOrderInfoService posAndOrderInfoService;
|
||||||
@Resource
|
@Resource
|
||||||
PosAndOrderInfoDAO posAndOrderInfoDAO;
|
PosAndOrderInfoDAO posAndOrderInfoDAO;
|
||||||
|
@Resource
|
||||||
|
LinePayService linePayService;
|
||||||
|
@Resource
|
||||||
|
FranchiseFeeService franchiseFeeService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -87,4 +96,14 @@ public class OpenApiServiceImpl implements OpenApiService {
|
|||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ApiResponse<Boolean> changeReceiptStatus(ReceiptCallBackRequest request) {
|
||||||
|
return linePayService.ReceiptCallBack(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ApiResponse<Boolean> changePaymentStatus(FranchiseFeeCallBackRequest request) {
|
||||||
|
return franchiseFeeService.changePaymentStatus(request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import com.cool.store.dto.XgjOrganizationDTO;
|
|||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.request.ZxjpApiRequest;
|
import com.cool.store.request.ZxjpApiRequest;
|
||||||
|
import com.cool.store.request.xgj.PushFranchiseFeeRequest;
|
||||||
|
import com.cool.store.request.xgj.ReceiptRequest;
|
||||||
import com.cool.store.response.XgjBaseResponse;
|
import com.cool.store.response.XgjBaseResponse;
|
||||||
import com.cool.store.response.XgjOrganizationResponse;
|
import com.cool.store.response.XgjOrganizationResponse;
|
||||||
import com.cool.store.response.huoma.ShopBaseInfoResponse;
|
import com.cool.store.response.huoma.ShopBaseInfoResponse;
|
||||||
@@ -92,10 +94,22 @@ public class PushServiceImpl implements PushService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean pushDataToXGJ(ZxjpApiRequest zxjpApiRequest) {
|
public Boolean pushDataToXGJ(ZxjpApiRequest zxjpApiRequest) {
|
||||||
String apiUrl = xgjUrl + "/open/addStore";
|
String apiUrl = xgjUrl + "/dmp/one-id/open/addStore";
|
||||||
return executeApiCall(apiUrl, zxjpApiRequest, Boolean.class, xgjUsername, xgjSecret);
|
return executeApiCall(apiUrl, zxjpApiRequest, Boolean.class, xgjUsername, xgjSecret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean pushFranchiseFeeToXGJ(PushFranchiseFeeRequest request) {
|
||||||
|
String apiUrl = xgjUrl + "/dmp/dmp-join/open/franchiseeBill";
|
||||||
|
return executeApiCall(apiUrl, request, Boolean.class, xgjUsername, xgjSecret);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean pushReceiptToXGJ(ReceiptRequest request) {
|
||||||
|
String apiUrl = xgjUrl + "/dmp/dmp-join/open/franchiseeReceipts";
|
||||||
|
return executeApiCall(apiUrl, request, Boolean.class, xgjUsername, xgjSecret);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean pushDataToPOS(ZxjpApiRequest zxjpApiRequest) {
|
public Boolean pushDataToPOS(ZxjpApiRequest zxjpApiRequest) {
|
||||||
String apiUrl = url + "/dzgV1/zxcrm/shop/upsert";
|
String apiUrl = url + "/dzgV1/zxcrm/shop/upsert";
|
||||||
@@ -103,7 +117,7 @@ public class PushServiceImpl implements PushService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Boolean modifyXGJPassword(ModifyPasswordDTO dto) {
|
private Boolean modifyXGJPassword(ModifyPasswordDTO dto) {
|
||||||
String apiUrl = xgjUrl + "/open/updateStorePassword";
|
String apiUrl = xgjUrl + "/dmp/one-id/open/updateStorePassword";
|
||||||
return executeApiCall(apiUrl, dto, Boolean.class, xgjUsername, xgjSecret);
|
return executeApiCall(apiUrl, dto, Boolean.class, xgjUsername, xgjSecret);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,6 +127,7 @@ public class PushServiceImpl implements PushService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean modifyDownstreamSystem(ModifyPasswordDTO modifyPasswordDTO) {
|
public Boolean modifyDownstreamSystem(ModifyPasswordDTO modifyPasswordDTO) {
|
||||||
this.modifyPosPassword(modifyPasswordDTO);
|
this.modifyPosPassword(modifyPasswordDTO);
|
||||||
@@ -145,7 +160,7 @@ public class PushServiceImpl implements PushService {
|
|||||||
String key = active+"_XgjOrganization_" + eid;
|
String key = active+"_XgjOrganization_" + eid;
|
||||||
String resObject = redisUtilPool.getString(key);
|
String resObject = redisUtilPool.getString(key);
|
||||||
if (StringUtils.isBlank(resObject)) {
|
if (StringUtils.isBlank(resObject)) {
|
||||||
String apiUrl = xgjUrl + "/open/organization";
|
String apiUrl = xgjUrl + "/dmp/one-id/open/organization";
|
||||||
resObject = JSONObject.toJSONString(executeApiGetCall(apiUrl, null, Object.class, xgjUsername, xgjSecret));
|
resObject = JSONObject.toJSONString(executeApiGetCall(apiUrl, null, Object.class, xgjUsername, xgjSecret));
|
||||||
redisUtilPool.setNxExpire(key, resObject, 7200000);
|
redisUtilPool.setNxExpire(key, resObject, 7200000);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.cool.store.controller.webb;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.dto.*;
|
import com.cool.store.dto.*;
|
||||||
import com.cool.store.request.OpenApiStoreRequest;
|
import com.cool.store.request.OpenApiStoreRequest;
|
||||||
|
import com.cool.store.request.xgj.FranchiseFeeCallBackRequest;
|
||||||
|
import com.cool.store.request.xgj.ReceiptCallBackRequest;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.response.bigdata.ApiResponse;
|
import com.cool.store.response.bigdata.ApiResponse;
|
||||||
import com.cool.store.service.OpenApiService;
|
import com.cool.store.service.OpenApiService;
|
||||||
@@ -51,12 +53,23 @@ public class OpenApiController {
|
|||||||
return ApiResponse.success(pushService.getYlsToken(new GetAccessTokenDTO(ylsCode,ylsCode)));
|
return ApiResponse.success(pushService.getYlsToken(new GetAccessTokenDTO(ylsCode,ylsCode)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("获取门店信息")
|
@ApiOperation("获取门店信息")
|
||||||
@PostMapping("/getStoreList")
|
@PostMapping("/getStoreList")
|
||||||
public ApiResponse<PageInfo<StoreDTO>> getStoreList(@RequestBody @Validated OpenApiStoreRequest dto) {
|
public ApiResponse<PageInfo<StoreDTO>> getStoreList(@RequestBody @Validated OpenApiStoreRequest dto) {
|
||||||
return ApiResponse.success(storeService.getStoreExtendFieldInfo(dto.getPageSize(),dto.getPageNum()));
|
return ApiResponse.success(storeService.getStoreExtendFieldInfo(dto.getPageSize(),dto.getPageNum()));
|
||||||
}
|
}
|
||||||
|
@ApiOperation("新管家回调 刷新收款单状态")
|
||||||
|
@PostMapping("/changeReceiptStatus")
|
||||||
|
public ApiResponse<Boolean> changeReceiptStatus(@RequestBody @Validated ReceiptCallBackRequest request){
|
||||||
|
log.info("changeReceiptStatus request:{}", JSONObject.toJSONString(request));
|
||||||
|
return openApiService.changeReceiptStatus(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("新管家回调 账单收款状态及缴款金额")
|
||||||
|
@PostMapping("/changePaymentStatus")
|
||||||
|
public ApiResponse<Boolean> changePaymentStatus(@RequestBody @Validated FranchiseFeeCallBackRequest request){
|
||||||
|
log.info("changePaymentStatus request:{}", JSONObject.toJSONString(request));
|
||||||
|
return openApiService.changePaymentStatus(request);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ api.auth.username=GkqgAhUJ7p9swJo
|
|||||||
api.auth.secret=NzVrnS3OWiupdDY
|
api.auth.secret=NzVrnS3OWiupdDY
|
||||||
|
|
||||||
#xingguanjia
|
#xingguanjia
|
||||||
xgj.api.auth.url=https://masterdata.zhengxinfood.com/dmp/one-id
|
xgj.api.auth.url=https://masterdata.zhengxinfood.com
|
||||||
xgj.api.auth.username=6446346061e043e392dd53c9c8d1af0b
|
xgj.api.auth.username=6446346061e043e392dd53c9c8d1af0b
|
||||||
xgj.api.auth.secret=3ba6e4c5632547b8b2b3acefe08667bb
|
xgj.api.auth.secret=3ba6e4c5632547b8b2b3acefe08667bb
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ api.auth.username=VA59C0ubfcpcVpl
|
|||||||
api.auth.secret=H9YKHF6R7N16Fvy
|
api.auth.secret=H9YKHF6R7N16Fvy
|
||||||
|
|
||||||
#新管家账号
|
#新管家账号
|
||||||
xgj.api.auth.url=http://117.139.13.24:11180/dmp/one-id
|
xgj.api.auth.url=http://117.139.13.24:11180
|
||||||
xgj.api.auth.username=6446346061e043e392dd53c9c8d1af0b
|
xgj.api.auth.username=6446346061e043e392dd53c9c8d1af0b
|
||||||
xgj.api.auth.secret=3ba6e4c5632547b8b2b3acefe08667bb
|
xgj.api.auth.secret=3ba6e4c5632547b8b2b3acefe08667bb
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user