支付新增shopId

This commit is contained in:
guohb
2024-05-07 14:35:08 +08:00
parent 76ec232a80
commit d58f2aeba7
5 changed files with 34 additions and 10 deletions

View File

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

View File

@@ -40,8 +40,10 @@ public interface LinePayMapper {
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
LinePayDO getLinePayByLineId(@Param("lineId") Long lineId); LinePayDO getLinePayByLineId(@Param("lineId") Long lineId);
LinePayDO getLinePayByLineIdAndPayType(@Param("lineId") Long lineId,
@Param("payBusinessType")Integer payBusinessType); LinePayDO getByLineIdAndPayTypeAndShopId(@Param("lineId") Long lineId,
@Param("payBusinessType")Integer payBusinessType,
@Param("shopId") Long shopId);
/** /**
* getLinePayByLineIds * getLinePayByLineIds

View File

@@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="com.cool.store.entity.LinePayDO"> <resultMap id="BaseResultMap" type="com.cool.store.entity.LinePayDO">
<id column="id" jdbcType="BIGINT" property="id"/> <id column="id" jdbcType="BIGINT" property="id"/>
<result column="partner_id" jdbcType="VARCHAR" property="partnerId"/> <result column="partner_id" jdbcType="VARCHAR" property="partnerId"/>
<result column="shop_id" jdbcType="BIGINT" property="shopId"/>
<result column="line_id" jdbcType="BIGINT" property="lineId"/> <result column="line_id" jdbcType="BIGINT" property="lineId"/>
<result column="pay_status" jdbcType="TINYINT" property="payStatus"/> <result column="pay_status" jdbcType="TINYINT" property="payStatus"/>
<result column="pay_type" jdbcType="TINYINT" property="payType"/> <result column="pay_type" jdbcType="TINYINT" property="payType"/>
@@ -24,8 +25,7 @@
<result column="pay_business_type" jdbcType="TINYINT" property="payBusinessType"/> <result column="pay_business_type" jdbcType="TINYINT" property="payBusinessType"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id,shop_id, partner_id, line_id, pay_status, pay_type, pay_user_name, pay_account, bank_code,
, partner_id, line_id, pay_status, pay_type, pay_user_name, pay_account, bank_code,
bank_name, branch_bank_code, branch_bank_name, pay_time, pay_pic, promise_pic, create_time, bank_name, branch_bank_code, branch_bank_name, pay_time, pay_pic, promise_pic, create_time,
update_time, create_user_id, update_user_id, deleted,pay_business_type update_time, create_user_id, update_user_id, deleted,pay_business_type
</sql> </sql>
@@ -299,12 +299,17 @@
and deleted = '0' limit 1 and deleted = '0' limit 1
</select> </select>
<select id="getLinePayByLineIdAndPayType" resultMap="BaseResultMap"> <select id="getByLineIdAndPayTypeAndShopId" resultMap="BaseResultMap">
select * select *
from xfsg_line_pay from xfsg_line_pay
where line_id = #{lineId} <where>
and deleted = '0' line_id = #{lineId}
and pay_business_type = #{payBusinessType} and deleted = '0'
and pay_business_type = #{payBusinessType}
<if test="shop_id != null and shopId != ''">
and shop_id = #{shopId}
</if>
</where>
</select> </select>
<select id="getLinePayByLineIds" resultMap="BaseResultMap"> <select id="getLinePayByLineIds" resultMap="BaseResultMap">

View File

@@ -21,6 +21,9 @@ public class LinePayDO implements Serializable {
@ApiModelProperty("") @ApiModelProperty("")
private Long id; private Long id;
@ApiModelProperty("shopId")
private Long shopId;
@ApiModelProperty("xfsg_user_info.partner_id") @ApiModelProperty("xfsg_user_info.partner_id")
private String partnerId; private String partnerId;

View File

@@ -76,7 +76,7 @@ public class LinePayServiceImpl implements LinePayService {
if (request.getPayBusinessType() != null if (request.getPayBusinessType() != null
&& request.getPayBusinessType() == Constants.ONE_INTEGER && request.getPayBusinessType() == Constants.ONE_INTEGER
&& request.getShopId() != null) { && request.getShopId() != null) {
LinePayDO linePayDO = linePayDAO.getLinePayByLineIdAndPayType(request.getLineId(), request.getPayBusinessType()); LinePayDO linePayDO = linePayDAO.getByLineIdAndPayTypeAndShopId(request.getLineId(), request.getPayBusinessType(),request.getShopId());
if (Objects.isNull(linePayDO)) { if (Objects.isNull(linePayDO)) {
fillLinePay(true, linePayDO, request, partnerUser); fillLinePay(true, linePayDO, request, partnerUser);
Long aLong = linePayDAO.addLinePay(linePayDO); Long aLong = linePayDAO.addLinePay(linePayDO);
@@ -136,6 +136,9 @@ public class LinePayServiceImpl implements LinePayService {
linePayDO.setPromisePic(request.getPromisePic()); linePayDO.setPromisePic(request.getPromisePic());
linePayDO.setPayStatus(WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode()); linePayDO.setPayStatus(WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode());
linePayDO.setPayBusinessType(request.getPayBusinessType()); linePayDO.setPayBusinessType(request.getPayBusinessType());
if (Objects.nonNull(request.getShopId())){
linePayDO.setShopId(request.getShopId());
}
if (isAdd) { if (isAdd) {
linePayDO.setPartnerId(partnerUser.getPartnerId()); linePayDO.setPartnerId(partnerUser.getPartnerId());
linePayDO.setLineId(request.getLineId()); linePayDO.setLineId(request.getLineId());