mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-19 18:45:03 +08:00
add 新增sim卡充值记录实体类
This commit is contained in:
@@ -0,0 +1,64 @@
|
|||||||
|
package com.jsowell.pile.domain;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.jsowell.common.annotation.Excel;
|
||||||
|
import com.jsowell.common.core.domain.BaseEntity;
|
||||||
|
import lombok.*;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sim卡续费记录表对象 sim_recharge_record
|
||||||
|
*
|
||||||
|
* @author jsowell
|
||||||
|
* @date 2026-03-06
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class SimRechargeRecord extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值订单号
|
||||||
|
*/
|
||||||
|
@Excel(name = "充值订单号")
|
||||||
|
private String rechargeOrderCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* iccid
|
||||||
|
*/
|
||||||
|
@Excel(name = "iccId")
|
||||||
|
private String iccId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付金额
|
||||||
|
*/
|
||||||
|
@Excel(name = "支付金额")
|
||||||
|
private BigDecimal payAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0-成功;1-失败)
|
||||||
|
*/
|
||||||
|
@Excel(name = "状态", readConverterExp = "0=-成功;1-失败")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单金额
|
||||||
|
*/
|
||||||
|
@Excel(name = "订单金额")
|
||||||
|
private BigDecimal orderAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标识
|
||||||
|
*/
|
||||||
|
private String delFlag;
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.jsowell.pile.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.jsowell.pile.domain.SimRechargeRecord;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sim卡续费记录表Mapper接口
|
||||||
|
*
|
||||||
|
* @author jsowell
|
||||||
|
* @date 2026-03-06
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface SimRechargeRecordMapper {
|
||||||
|
/**
|
||||||
|
* 查询sim卡续费记录表
|
||||||
|
*
|
||||||
|
* @param id sim卡续费记录表主键
|
||||||
|
* @return sim卡续费记录表
|
||||||
|
*/
|
||||||
|
public SimRechargeRecord selectSimRechargeRecordById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询sim卡续费记录表列表
|
||||||
|
*
|
||||||
|
* @param simRechargeRecord sim卡续费记录表
|
||||||
|
* @return sim卡续费记录表集合
|
||||||
|
*/
|
||||||
|
public List<SimRechargeRecord> selectSimRechargeRecordList(SimRechargeRecord simRechargeRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增sim卡续费记录表
|
||||||
|
*
|
||||||
|
* @param simRechargeRecord sim卡续费记录表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertSimRechargeRecord(SimRechargeRecord simRechargeRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改sim卡续费记录表
|
||||||
|
*
|
||||||
|
* @param simRechargeRecord sim卡续费记录表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSimRechargeRecord(SimRechargeRecord simRechargeRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除sim卡续费记录表
|
||||||
|
*
|
||||||
|
* @param id sim卡续费记录表主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSimRechargeRecordById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除sim卡续费记录表
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSimRechargeRecordByIds(Long[] ids);
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
|
|||||||
import com.alibaba.fastjson2.JSONArray;
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
import com.jsowell.common.enums.sim.SimCardStatusCorrespondEnum;
|
import com.jsowell.common.enums.sim.SimCardStatusCorrespondEnum;
|
||||||
import com.jsowell.common.enums.sim.SimSupplierEnum;
|
import com.jsowell.common.enums.sim.SimSupplierEnum;
|
||||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||||
@@ -27,6 +28,7 @@ import java.math.BigDecimal;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@@ -193,6 +195,43 @@ public class SimCardService {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将iccid按照卡商分组
|
||||||
|
* @param iccIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Map<String, List<String>> goupingBySimSupplier(List<String> iccIds) {
|
||||||
|
Map<String, List<String>> map = Maps.newHashMap();
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(iccIds)) {
|
||||||
|
return Maps.newHashMap();
|
||||||
|
}
|
||||||
|
// 将集合中为空和0的过滤
|
||||||
|
iccIds = iccIds.stream()
|
||||||
|
.filter(StringUtils::isNotEmpty)
|
||||||
|
.filter(x -> !StringUtils.equals(x, "0"))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<String> xunzhongList = new ArrayList<>();
|
||||||
|
List<String> wulianList = new ArrayList<>();
|
||||||
|
for (String iccId : iccIds) {
|
||||||
|
// 查出此卡属于哪家公司(拿到code)
|
||||||
|
SimCardVO simCardVO = searchByLoop(Lists.newArrayList(iccId)).get(0);
|
||||||
|
String simSupplierCode = simCardVO.getSimCardFactory();
|
||||||
|
|
||||||
|
// 根据 code 分组
|
||||||
|
if (StringUtils.equals(simSupplierCode, SimSupplierEnum.XUN_ZHONG.getCode())) {
|
||||||
|
xunzhongList.add(iccId);
|
||||||
|
}
|
||||||
|
if (StringUtils.equals(simSupplierCode, SimSupplierEnum.WU_LIAN_INTERNET.getCode())) {
|
||||||
|
wulianList.add(iccId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
map.put("xunzhong", xunzhongList);
|
||||||
|
map.put("wulian", wulianList);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据不同的公司执行不同的续费方法
|
* 根据不同的公司执行不同的续费方法
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.jsowell.pile.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.jsowell.pile.domain.SimRechargeRecord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sim卡续费记录表Service接口
|
||||||
|
*
|
||||||
|
* @author jsowell
|
||||||
|
* @date 2026-03-06
|
||||||
|
*/
|
||||||
|
public interface SimRechargeRecordService {
|
||||||
|
/**
|
||||||
|
* 查询sim卡续费记录表
|
||||||
|
*
|
||||||
|
* @param id sim卡续费记录表主键
|
||||||
|
* @return sim卡续费记录表
|
||||||
|
*/
|
||||||
|
public SimRechargeRecord selectSimRechargeRecordById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询sim卡续费记录表列表
|
||||||
|
*
|
||||||
|
* @param simRechargeRecord sim卡续费记录表
|
||||||
|
* @return sim卡续费记录表集合
|
||||||
|
*/
|
||||||
|
public List<SimRechargeRecord> selectSimRechargeRecordList(SimRechargeRecord simRechargeRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增sim卡续费记录表
|
||||||
|
*
|
||||||
|
* @param simRechargeRecord sim卡续费记录表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertSimRechargeRecord(SimRechargeRecord simRechargeRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改sim卡续费记录表
|
||||||
|
*
|
||||||
|
* @param simRechargeRecord sim卡续费记录表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSimRechargeRecord(SimRechargeRecord simRechargeRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除sim卡续费记录表
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的sim卡续费记录表主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSimRechargeRecordByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除sim卡续费记录表信息
|
||||||
|
*
|
||||||
|
* @param id sim卡续费记录表主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSimRechargeRecordById(Long id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package com.jsowell.pile.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.jsowell.common.util.DateUtils;
|
||||||
|
import com.jsowell.pile.service.SimRechargeRecordService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.jsowell.pile.mapper.SimRechargeRecordMapper;
|
||||||
|
import com.jsowell.pile.domain.SimRechargeRecord;
|
||||||
|
import com.jsowell.pile.service.SimRechargeRecordService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sim卡续费记录表Service业务层处理
|
||||||
|
*
|
||||||
|
* @author jsowell
|
||||||
|
* @date 2026-03-06
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SimRechargeRecordServiceImpl implements SimRechargeRecordService {
|
||||||
|
@Autowired
|
||||||
|
private SimRechargeRecordMapper simRechargeRecordMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询sim卡续费记录表
|
||||||
|
*
|
||||||
|
* @param id sim卡续费记录表主键
|
||||||
|
* @return sim卡续费记录表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SimRechargeRecord selectSimRechargeRecordById(Long id) {
|
||||||
|
return simRechargeRecordMapper.selectSimRechargeRecordById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询sim卡续费记录表列表
|
||||||
|
*
|
||||||
|
* @param simRechargeRecord sim卡续费记录表
|
||||||
|
* @return sim卡续费记录表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SimRechargeRecord> selectSimRechargeRecordList(SimRechargeRecord simRechargeRecord) {
|
||||||
|
return simRechargeRecordMapper.selectSimRechargeRecordList(simRechargeRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增sim卡续费记录表
|
||||||
|
*
|
||||||
|
* @param simRechargeRecord sim卡续费记录表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertSimRechargeRecord(SimRechargeRecord simRechargeRecord) {
|
||||||
|
simRechargeRecord.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return simRechargeRecordMapper.insertSimRechargeRecord(simRechargeRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改sim卡续费记录表
|
||||||
|
*
|
||||||
|
* @param simRechargeRecord sim卡续费记录表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateSimRechargeRecord(SimRechargeRecord simRechargeRecord) {
|
||||||
|
simRechargeRecord.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return simRechargeRecordMapper.updateSimRechargeRecord(simRechargeRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除sim卡续费记录表
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的sim卡续费记录表主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSimRechargeRecordByIds(Long[] ids) {
|
||||||
|
return simRechargeRecordMapper.deleteSimRechargeRecordByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除sim卡续费记录表信息
|
||||||
|
*
|
||||||
|
* @param id sim卡续费记录表主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSimRechargeRecordById(Long id) {
|
||||||
|
return simRechargeRecordMapper.deleteSimRechargeRecordById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.jsowell.pile.mapper.SimRechargeRecordMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.jsowell.pile.domain.SimRechargeRecord" id="SimRechargeRecordResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="rechargeOrderCode" column="recharge_order_code" />
|
||||||
|
<result property="iccId" column="iccid" />
|
||||||
|
<result property="payAmount" column="pay_amount" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="orderAmount" column="order_amount" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="delFlag" column="del_flag" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectSimRechargeRecordVo">
|
||||||
|
select id, recharge_order_code, iccid, pay_amount, status, order_amount, create_by, create_time, update_by, update_time, del_flag from sim_recharge_record
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectSimRechargeRecordList" parameterType="com.jsowell.pile.domain.SimRechargeRecord" resultMap="SimRechargeRecordResult">
|
||||||
|
<include refid="selectSimRechargeRecordVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="rechargeOrderCode != null and rechargeOrderCode != ''"> and recharge_order_code = #{rechargeOrderCode}</if>
|
||||||
|
<if test="iccId != null and iccId != ''"> and iccid = #{iccId}</if>
|
||||||
|
<if test="payAmount != null "> and pay_amount = #{payAmount}</if>
|
||||||
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||||
|
<if test="orderAmount != null "> and order_amount = #{orderAmount}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSimRechargeRecordById" parameterType="Long" resultMap="SimRechargeRecordResult">
|
||||||
|
<include refid="selectSimRechargeRecordVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertSimRechargeRecord" parameterType="com.jsowell.pile.domain.SimRechargeRecord" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into sim_recharge_record
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="rechargeOrderCode != null">recharge_order_code,</if>
|
||||||
|
<if test="iccId != null">iccid,</if>
|
||||||
|
<if test="payAmount != null">pay_amount,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
|
<if test="orderAmount != null">order_amount,</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>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="rechargeOrderCode != null">#{rechargeOrderCode},</if>
|
||||||
|
<if test="iccId != null">#{iccId},</if>
|
||||||
|
<if test="payAmount != null">#{payAmount},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
<if test="orderAmount != null">#{orderAmount},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="delFlag != null">#{delFlag},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateSimRechargeRecord" parameterType="com.jsowell.pile.domain.SimRechargeRecord">
|
||||||
|
update sim_recharge_record
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="rechargeOrderCode != null">recharge_order_code = #{rechargeOrderCode},</if>
|
||||||
|
<if test="iccId != null">iccid = #{iccid},</if>
|
||||||
|
<if test="payAmount != null">pay_amount = #{payAmount},</if>
|
||||||
|
<if test="status != null">status = #{status},</if>
|
||||||
|
<if test="orderAmount != null">order_amount = #{orderAmount},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteSimRechargeRecordById" parameterType="Long">
|
||||||
|
delete from sim_recharge_record where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteSimRechargeRecordByIds" parameterType="String">
|
||||||
|
delete from sim_recharge_record where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user