mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-18 00:38:33 +08:00
Merge branch 'dev' of https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web into dev
This commit is contained in:
@@ -928,4 +928,21 @@ public class TempController extends BaseController {
|
||||
logger.info("时间区间查询订单统计 result:{}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新钱包code为空的数据
|
||||
* http://localhost:8080/temp/updateWalletCode
|
||||
*/
|
||||
@PostMapping("/updateWalletCode")
|
||||
public RestApiResponse<?> updateWalletCode() {
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
tempService.updateWalletCode();
|
||||
response = new RestApiResponse<>();
|
||||
} catch (Exception e) {
|
||||
logger.error("更新钱包code为空数据 error", e);
|
||||
}
|
||||
logger.info("更新钱包code为空数据 result:{}", response);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,6 +80,9 @@ public class TempService {
|
||||
@Autowired
|
||||
private AdapayCallbackRecordService adapayCallbackRecordService;
|
||||
|
||||
@Autowired
|
||||
private MemberBasicInfoService memberBasicInfoService;
|
||||
|
||||
@Autowired
|
||||
protected TransactionService transactionService;
|
||||
|
||||
@@ -131,6 +134,9 @@ public class TempService {
|
||||
@Autowired
|
||||
private NotificationService notificationService;
|
||||
|
||||
@Autowired
|
||||
private MemberWalletInfoService memberWalletInfoService;
|
||||
|
||||
/**
|
||||
* 计算订单耗电量
|
||||
* 内蒙古站点
|
||||
@@ -1331,5 +1337,23 @@ public class TempService {
|
||||
logger.info("查询订单数量结果:{}", JSONObject.toJSONString(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
public void updateWalletCode() {
|
||||
// 查询钱包dode为空的数据
|
||||
List<MemberWalletInfo> memberWalletInfoList = memberWalletInfoService.queryWalletIsNull();
|
||||
|
||||
// 分批处理, 1000条为一批
|
||||
List<List<MemberWalletInfo>> partition = Lists.partition(memberWalletInfoList, 1000);
|
||||
|
||||
partition.parallelStream().forEach(walletInfoList -> {
|
||||
walletInfoList.forEach(walletInfo -> {
|
||||
// 生成钱包code
|
||||
walletInfo.setWalletCode(memberBasicInfoService.generateWalletCode());
|
||||
});
|
||||
// 批量更新钱包code
|
||||
memberWalletInfoService.updateBatchSelective(walletInfoList);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -358,12 +358,6 @@ public class UploadRealTimeMonitorHandler extends AbstractYkcHandler {
|
||||
// 异步推送第三方平台实时数据V2
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
log.info("thirdpartyTaskExecutor状态:活跃线程数={}, 队列大小={}, 任务总数={}, 拒绝任务数={}",
|
||||
thirdpartyTaskExecutor.getActiveCount(),
|
||||
thirdpartyTaskExecutor.getThreadPoolExecutor().getQueue().size(),
|
||||
thirdpartyTaskExecutor.getThreadPoolExecutor().getTaskCount(),
|
||||
thirdpartyTaskExecutor.getThreadPoolExecutor().getRejectedExecutionHandler().toString());
|
||||
|
||||
commonService.pushRealTimeInfoV2(pileSn, connectorCode, connectorStatus, realTimeMonitorData, transactionCode);
|
||||
// log.info("统一推送第三方平台实时数据V2 success, pileSn:{}, connectorCode:{}, connectorStatus:{}, realTimeMonitorData:{}, transactionCode:{}", pileSn, connectorCode, connectorStatus, realTimeMonitorData, transactionCode);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -1105,6 +1105,7 @@ public class AdapayService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 实时分账的调退款接口
|
||||
* 创建退款请求
|
||||
*/
|
||||
public RefundResponse createRefundRequest(String paymentId, BigDecimal refundAmt, String wechatAppId, String memberId, String scenarioType, String orderCode) {
|
||||
|
||||
@@ -4,15 +4,17 @@ import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 会员钱包信息表
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@SuperBuilder
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
|
||||
@@ -3,64 +3,35 @@ package com.jsowell.pile.mapper;
|
||||
import com.jsowell.pile.domain.MemberWalletInfo;
|
||||
import com.jsowell.pile.vo.base.MemberWalletVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface MemberWalletInfoMapper {
|
||||
/**
|
||||
* delete by primary key
|
||||
*
|
||||
* @param id primaryKey
|
||||
* @return deleteCount
|
||||
*/
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
/**
|
||||
* insert record to table
|
||||
*
|
||||
* @param record the record
|
||||
* @return insert count
|
||||
*/
|
||||
int insert(MemberWalletInfo record);
|
||||
|
||||
/**
|
||||
* insert record to table selective
|
||||
*
|
||||
* @param record the record
|
||||
* @return insert count
|
||||
*/
|
||||
int insertOrUpdate(MemberWalletInfo record);
|
||||
|
||||
int insertOrUpdateSelective(MemberWalletInfo record);
|
||||
|
||||
int insertSelective(MemberWalletInfo record);
|
||||
|
||||
/**
|
||||
* select by primary key
|
||||
*
|
||||
* @param id primary key
|
||||
* @return object by primary key
|
||||
*/
|
||||
MemberWalletInfo selectByPrimaryKey(Integer id);
|
||||
|
||||
/**
|
||||
* update record selective
|
||||
*
|
||||
* @param record the updated record
|
||||
* @return update count
|
||||
*/
|
||||
int updateByPrimaryKeySelective(MemberWalletInfo record);
|
||||
|
||||
/**
|
||||
* update record
|
||||
*
|
||||
* @param record the updated record
|
||||
* @return update count
|
||||
*/
|
||||
int updateByPrimaryKey(MemberWalletInfo record);
|
||||
|
||||
// MemberWalletInfo selectByMemberId(String memberId);
|
||||
int updateBatch(@Param("list") List<MemberWalletInfo> list);
|
||||
|
||||
int updateBatchSelective(@Param("list") List<MemberWalletInfo> list);
|
||||
|
||||
int batchInsert(@Param("list") List<MemberWalletInfo> list);
|
||||
|
||||
/**
|
||||
* 根据会员id和目标运营商id查询用户钱包信息
|
||||
*
|
||||
* @param memberId
|
||||
* @param merchantId
|
||||
* @return
|
||||
@@ -72,4 +43,6 @@ public interface MemberWalletInfoMapper {
|
||||
MemberWalletInfo selectByWalletCode(@Param("walletCode") String walletCode);
|
||||
|
||||
MemberWalletVO selectMemberWalletInfo(String walletCode);
|
||||
}
|
||||
|
||||
List<MemberWalletInfo> queryWalletIsNull();
|
||||
}
|
||||
|
||||
@@ -25,4 +25,8 @@ public interface MemberWalletInfoService {
|
||||
List<MemberWalletVO> selectByMemberWalletList(String memberId);
|
||||
|
||||
MemberWalletVO selectMemberWalletInfo(String walletCode);
|
||||
|
||||
List<MemberWalletInfo> queryWalletIsNull();
|
||||
|
||||
int updateBatchSelective(List<MemberWalletInfo> walletInfoList);
|
||||
}
|
||||
|
||||
@@ -120,4 +120,14 @@ public class MemberWalletInfoServiceImpl implements MemberWalletInfoService {
|
||||
return memberWalletVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MemberWalletInfo> queryWalletIsNull() {
|
||||
return memberWalletInfoMapper.queryWalletIsNull();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBatchSelective(List<MemberWalletInfo> walletInfoList) {
|
||||
return memberWalletInfoMapper.updateBatchSelective(walletInfoList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, member_id, merchant_id, wallet_code, principal_balance, gift_balance, version,
|
||||
id, member_id, merchant_id, wallet_code, principal_balance, gift_balance, version,
|
||||
create_by, create_time, update_by, update_time, del_flag
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
<!--@mbg.generated-->
|
||||
select
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from member_wallet_info
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
@@ -36,13 +36,13 @@
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletInfo" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into member_wallet_info (member_id, merchant_id, wallet_code,
|
||||
principal_balance, gift_balance, version,
|
||||
create_by, create_time, update_by,
|
||||
insert into member_wallet_info (member_id, merchant_id, wallet_code,
|
||||
principal_balance, gift_balance, version,
|
||||
create_by, create_time, update_by,
|
||||
update_time, del_flag)
|
||||
values (#{memberId,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, #{walletCode,jdbcType=VARCHAR},
|
||||
#{principalBalance,jdbcType=DECIMAL}, #{giftBalance,jdbcType=DECIMAL}, #{version,jdbcType=INTEGER},
|
||||
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
|
||||
values (#{memberId,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, #{walletCode,jdbcType=VARCHAR},
|
||||
#{principalBalance,jdbcType=DECIMAL}, #{giftBalance,jdbcType=DECIMAL}, #{version,jdbcType=INTEGER},
|
||||
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
|
||||
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=CHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletInfo" useGeneratedKeys="true">
|
||||
@@ -175,6 +175,346 @@
|
||||
del_flag = #{delFlag,jdbcType=CHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateBatch" parameterType="java.util.List">
|
||||
<!--@mbg.generated-->
|
||||
update member_wallet_info
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<trim prefix="member_id = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="merchant_id = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.merchantId,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="wallet_code = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.walletCode,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="principal_balance = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.principalBalance,jdbcType=DECIMAL}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="gift_balance = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.giftBalance,jdbcType=DECIMAL}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="version = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.version,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="create_by = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="create_time = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="update_by = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="update_time = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="del_flag = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=CHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
</trim>
|
||||
where id in
|
||||
<foreach close=")" collection="list" item="item" open="(" separator=", ">
|
||||
#{item.id,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="updateBatchSelective" parameterType="java.util.List">
|
||||
<!--@mbg.generated-->
|
||||
update member_wallet_info
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<trim prefix="member_id = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.memberId != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="merchant_id = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.merchantId != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.merchantId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="wallet_code = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.walletCode != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.walletCode,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="principal_balance = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.principalBalance != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.principalBalance,jdbcType=DECIMAL}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="gift_balance = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.giftBalance != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.giftBalance,jdbcType=DECIMAL}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="version = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.version != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.version,jdbcType=INTEGER}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="create_by = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.createBy != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="create_time = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.createTime != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="update_by = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.updateBy != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="update_time = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.updateTime != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="del_flag = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.delFlag != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=CHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
</trim>
|
||||
where id in
|
||||
<foreach close=")" collection="list" item="item" open="(" separator=", ">
|
||||
#{item.id,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</update>
|
||||
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into member_wallet_info
|
||||
(member_id, merchant_id, wallet_code, principal_balance, gift_balance, version, create_by,
|
||||
create_time, update_by, update_time, del_flag)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.memberId,jdbcType=VARCHAR}, #{item.merchantId,jdbcType=VARCHAR}, #{item.walletCode,jdbcType=VARCHAR},
|
||||
#{item.principalBalance,jdbcType=DECIMAL}, #{item.giftBalance,jdbcType=DECIMAL},
|
||||
#{item.version,jdbcType=INTEGER}, #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
|
||||
#{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.delFlag,jdbcType=CHAR}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletInfo" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into member_wallet_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
member_id,
|
||||
merchant_id,
|
||||
wallet_code,
|
||||
principal_balance,
|
||||
gift_balance,
|
||||
version,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
del_flag,
|
||||
</trim>
|
||||
values
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
#{memberId,jdbcType=VARCHAR},
|
||||
#{merchantId,jdbcType=VARCHAR},
|
||||
#{walletCode,jdbcType=VARCHAR},
|
||||
#{principalBalance,jdbcType=DECIMAL},
|
||||
#{giftBalance,jdbcType=DECIMAL},
|
||||
#{version,jdbcType=INTEGER},
|
||||
#{createBy,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
#{updateBy,jdbcType=VARCHAR},
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
#{delFlag,jdbcType=CHAR},
|
||||
</trim>
|
||||
on duplicate key update
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id = #{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
member_id = #{memberId,jdbcType=VARCHAR},
|
||||
merchant_id = #{merchantId,jdbcType=VARCHAR},
|
||||
wallet_code = #{walletCode,jdbcType=VARCHAR},
|
||||
principal_balance = #{principalBalance,jdbcType=DECIMAL},
|
||||
gift_balance = #{giftBalance,jdbcType=DECIMAL},
|
||||
version = #{version,jdbcType=INTEGER},
|
||||
create_by = #{createBy,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_by = #{updateBy,jdbcType=VARCHAR},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
del_flag = #{delFlag,jdbcType=CHAR},
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.MemberWalletInfo" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into member_wallet_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="memberId != null">
|
||||
member_id,
|
||||
</if>
|
||||
<if test="merchantId != null">
|
||||
merchant_id,
|
||||
</if>
|
||||
<if test="walletCode != null">
|
||||
wallet_code,
|
||||
</if>
|
||||
<if test="principalBalance != null">
|
||||
principal_balance,
|
||||
</if>
|
||||
<if test="giftBalance != null">
|
||||
gift_balance,
|
||||
</if>
|
||||
<if test="version != null">
|
||||
version,
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
del_flag,
|
||||
</if>
|
||||
</trim>
|
||||
values
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="memberId != null">
|
||||
#{memberId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="merchantId != null">
|
||||
#{merchantId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="walletCode != null">
|
||||
#{walletCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="principalBalance != null">
|
||||
#{principalBalance,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="giftBalance != null">
|
||||
#{giftBalance,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="version != null">
|
||||
#{version,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
#{createBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
#{updateBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
#{delFlag,jdbcType=CHAR},
|
||||
</if>
|
||||
</trim>
|
||||
on duplicate key update
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id = #{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="memberId != null">
|
||||
member_id = #{memberId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="merchantId != null">
|
||||
merchant_id = #{merchantId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="walletCode != null">
|
||||
wallet_code = #{walletCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="principalBalance != null">
|
||||
principal_balance = #{principalBalance,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="giftBalance != null">
|
||||
gift_balance = #{giftBalance,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="version != null">
|
||||
version = #{version,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by = #{createBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by = #{updateBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
del_flag = #{delFlag,jdbcType=CHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="selectByMemberId" resultMap="BaseResultMap">
|
||||
select
|
||||
@@ -226,4 +566,12 @@
|
||||
and sub_type = '11') t3 on t3.wallet_code = t1.wallet_code
|
||||
where t1.wallet_code = #{walletCode,jdbcType=VARCHAR}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
<select id="queryWalletIsNull" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from member_wallet_info
|
||||
where del_flag = '0'
|
||||
and merchant_id is null
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -419,42 +419,43 @@ public class CommonService {
|
||||
String stationId = String.valueOf(pileBasicInfo.getStationId());
|
||||
// 查询该站点是否推送第三方平台
|
||||
List<ThirdPartySecretInfoVO> thirdPartySecretInfoVOS = thirdpartySecretInfoService.queryStationToPlatformList(stationId);
|
||||
|
||||
log.info("推送实时数据到第三方平台 stationId:{}, thirdPartySecretInfoVOS:{}", stationId, thirdPartySecretInfoVOS);
|
||||
|
||||
if (CollectionUtils.isEmpty(thirdPartySecretInfoVOS)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 推送
|
||||
for (ThirdPartySecretInfoVO thirdPartySecretInfoVO : thirdPartySecretInfoVOS) {
|
||||
NotificationDTO dto = new NotificationDTO();
|
||||
dto.setStationId(stationId);
|
||||
dto.setPileConnectorCode(pileConnectorCode);
|
||||
dto.setStatus(changedStatus);
|
||||
dto.setPlatformType(thirdPartySecretInfoVO.getPlatformType());
|
||||
|
||||
notificationService.notificationStationStatus(dto);
|
||||
|
||||
log.info("交易流水号transactionCode:{}", transactionCode);
|
||||
// 查询订单信息
|
||||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
|
||||
// 新运有三个平台,当这个transactionCode为null或orderInfo为null时,这里就不会继续推送其它两家平台,直接return了
|
||||
// 也就是说,只要这台桩没有订单,为空闲状态,就只推送一家平台循环就终止了
|
||||
|
||||
//判断transactionCode和orderInfo是否为空,为空就不推送充电状态
|
||||
if (Strings.isEmpty(transactionCode)){
|
||||
// return;
|
||||
continue;
|
||||
OrderBasicInfo orderInfo = new OrderBasicInfo();
|
||||
if(Constants.ILLEGAL_TRANSACTION_CODE.equals(transactionCode)){
|
||||
//表示为非法交易流水号"00000000000000000000000000000000",不推送充电状态
|
||||
orderInfo = null;
|
||||
}else{
|
||||
// 查询订单信息,避免每个平台都查询一次
|
||||
if (transactionCode != null) {
|
||||
orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
|
||||
}
|
||||
if (Objects.isNull(orderInfo)) {
|
||||
continue;
|
||||
}
|
||||
dto.setOrderCode(orderInfo.getOrderCode());
|
||||
notificationService.notificationConnectorChargeStatus(dto);
|
||||
|
||||
}
|
||||
|
||||
for (ThirdPartySecretInfoVO thirdPartySecretInfoVO : thirdPartySecretInfoVOS) {
|
||||
try {
|
||||
NotificationDTO dto = new NotificationDTO();
|
||||
dto.setStationId(stationId);
|
||||
dto.setPileConnectorCode(pileConnectorCode);
|
||||
dto.setStatus(changedStatus);
|
||||
dto.setPlatformType(thirdPartySecretInfoVO.getPlatformType());
|
||||
|
||||
// 先推送站点状态
|
||||
notificationService.notificationStationStatus(dto);
|
||||
|
||||
// 如果有订单信息,推送充电状态
|
||||
if (orderInfo != null) {
|
||||
dto.setOrderCode(orderInfo.getOrderCode());
|
||||
notificationService.notificationConnectorChargeStatus(dto);
|
||||
} else {
|
||||
log.info("无订单信息,仅推送站点状态,平台类型:{}", thirdPartySecretInfoVO.getPlatformType());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("推送实时数据到平台失败,平台类型:{},错误信息:{}",
|
||||
thirdPartySecretInfoVO.getPlatformType(), e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -26,7 +26,7 @@
|
||||
<!--<fastjson.version>2.0.11</fastjson.version>-->
|
||||
<fastjson.version>2.0.23</fastjson.version>
|
||||
<oshi.version>6.2.2</oshi.version>
|
||||
<commons.io.version>2.11.0</commons.io.version>
|
||||
<commons.io.version>2.16.1</commons.io.version>
|
||||
<commons.fileupload.version>1.4</commons.fileupload.version>
|
||||
<commons.collections.version>3.2.2</commons.collections.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
|
||||
Reference in New Issue
Block a user