统一将 bms_region 替换为 region,更新相关注释和文档以反映这一变化。

This commit is contained in:
wuweihua
2026-09-29 08:57:41 +08:00
parent 0ad90f6183
commit b8e1f8cd40
23 changed files with 68 additions and 54 deletions
@@ -5,7 +5,7 @@ import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/** Zone under bms_region: prc_zone */
/** Zone under region: prc_zone */
@Data
public class PrcZone implements Serializable
{
@@ -25,6 +25,6 @@ public class PrcZone implements Serializable
private Date updateTime;
/** list display, not a table column */
private Integer detailCount;
/** list display from bms_region */
/** list display from region */
private String countryNameCn;
}
@@ -4,7 +4,7 @@ import java.io.Serializable;
import lombok.Data;
/**
* Zone country list row: bms_region + zone aggregates (not a table)
* Zone country list row: region + zone aggregates (not a table)
*/
@Data
public class PrcZoneRegion implements Serializable
@@ -49,7 +49,7 @@ public interface IBmsProductService
* The destination country is chosen by the user, not read from the sheet.
*
* @param file uploaded xlsx/xls
* @param countryCode ISO country code (bms_region.country_code_2)
* @param countryCode ISO country code (region.country_code_2)
* @param operName operator
* @return HTML result message
*/
@@ -18,7 +18,7 @@ public interface IPrcBillingTaskService
List<PrcBillingTask> selectList(PrcBillingTask query);
/**
* Manual resync: reset to WAITING then process again.
* Manual resync: reset to WAITING then process again (including SUCCESS for correction).
* @return task after retry
*/
PrcBillingTask retryTask(Long taskId);
@@ -12,7 +12,7 @@ public interface IPrcZoneService
public List<PrcZoneRegion> selectZoneRegionList(PrcZoneRegion query);
/** Delete all zones (and details) for the given bms_region ids */
/** Delete all zones (and details) for the given region ids */
public int deleteZonesByRegionIds(Long[] regionIds);
public PrcZone selectPrcZoneById(Long zoneId);
@@ -1179,7 +1179,7 @@ public class BmsProductServiceImpl implements IBmsProductService
}
/**
* Load bms_region map: country_name_cn -> region (for country_code_2).
* Load region map: country_name_cn -> region (for country_code_2).
*/
private Map<String, BmsRegion> loadRegionByNameCn()
{
@@ -342,12 +342,8 @@ public class PrcBillingTaskServiceImpl implements IPrcBillingTaskService
{
throw new ServiceException("billing task not found");
}
String st = task.getSuccessStatus();
if (BillTaskSuccessStatus.SUCCESS.getCode().equals(st))
{
throw new ServiceException("SUCCESS task cannot retry");
}
// Reset to WAITING so UI reflects re-queue; then sync process (admin expects immediate result).
// Allow SUCCESS retry: billing result may be wrong and needs re-run.
// Reset to WAITING so processTask does not short-circuit on SUCCESS; then sync process.
PrcBillingTask reset = new PrcBillingTask();
reset.setTaskId(taskId);
reset.setSuccessStatus(BillTaskSuccessStatus.WAITING.getCode());
@@ -36,7 +36,7 @@ import com.bms.system.domain.BmsRegion;
import com.bms.system.mapper.BmsRegionMapper;
/**
* Zone management: bms_region -> prc_zone -> postcode detail
* Zone management: region -> prc_zone -> postcode detail
*/
@Service
public class PrcZoneServiceImpl implements IPrcZoneService
@@ -6,7 +6,7 @@ import com.bms.common.annotation.Excel;
import com.bms.common.core.domain.BaseEntity;
/**
* 国家/区域 bms_region
* 国家/区域 region
*
* @author bms
*/
@@ -6,7 +6,7 @@ import com.bms.common.annotation.Excel;
import com.bms.common.core.domain.BaseEntity;
/**
* 区域数据同步日志 bms_region_sync_log
* 区域数据同步日志 region_sync_log
*
* @author bms
*/
@@ -34,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
continent, sub_region, currency_code, currency_name, currency_symbol,
phone_prefix, flag_emoji, flag_url, is_independent, is_eu,
status, del_flag, create_by, create_time, update_by, update_time, remark
from bms_region
from region
</sql>
<select id="selectRegionById" parameterType="Long" resultMap="BmsRegionResult">
@@ -76,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insert id="insertRegion" parameterType="BmsRegion" useGeneratedKeys="true" keyProperty="regionId">
insert into bms_region (
insert into region (
<if test="countryNameCn != null">country_name_cn,</if>
<if test="countryNameEn != null and countryNameEn != ''">country_name_en,</if>
<if test="countryCode2 != null and countryCode2 != ''">country_code_2,</if>
@@ -120,7 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<update id="updateRegion" parameterType="BmsRegion">
update bms_region
update region
<set>
<if test="countryNameCn != null">country_name_cn = #{countryNameCn},</if>
<if test="countryNameEn != null and countryNameEn != ''">country_name_en = #{countryNameEn},</if>
@@ -145,14 +145,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteRegionByIds" parameterType="Long">
delete from bms_region where region_id in
delete from region where region_id in
<foreach item="regionId" collection="array" open="(" separator="," close=")">
#{regionId}
</foreach>
</delete>
<insert id="upsertByCode2" parameterType="BmsRegion">
insert into bms_region (
insert into region (
country_name_cn, country_name_en, country_code_2, country_code_3,
continent, sub_region, currency_code, currency_name, currency_symbol,
phone_prefix, flag_emoji, flag_url, is_independent, is_eu,
@@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectSyncLogVo">
select log_id, sync_type, status, total_count, insert_count, update_count,
fail_count, duration_ms, error_msg, create_by, create_time, update_by, update_time
from bms_region_sync_log
from region_sync_log
</sql>
<select id="selectSyncLogById" parameterType="Long" resultMap="BmsRegionSyncLogResult">
@@ -51,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insert id="insertSyncLog" parameterType="BmsRegionSyncLog" useGeneratedKeys="true" keyProperty="logId">
insert into bms_region_sync_log (
insert into region_sync_log (
<if test="syncType != null and syncType != ''">sync_type,</if>
<if test="status != null and status != ''">status,</if>
<if test="totalCount != null">total_count,</if>
@@ -77,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<update id="updateSyncLog" parameterType="BmsRegionSyncLog">
update bms_region_sync_log
update region_sync_log
<set>
<if test="status != null and status != ''">status = #{status},</if>
<if test="totalCount != null">total_count = #{totalCount},</if>
@@ -92,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteSyncLogByIds" parameterType="Long">
delete from bms_region_sync_log where log_id in
delete from region_sync_log where log_id in
<foreach item="logId" collection="array" open="(" separator="," close=")">
#{logId}
</foreach>
@@ -54,10 +54,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND fail_code = #{failCode}
</if>
<if test="params.beginTime != null and params.beginTime != ''">
AND create_time &gt;= #{params.beginTime}
AND date_format(bill_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''">
AND create_time &lt;= #{params.endTime}
AND date_format(bill_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
</if>
</where>
order by task_id desc
@@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
r.country_name_cn,
(select count(1) from prc_zone_detail d where d.zone_id = z.zone_id) as detail_count
from prc_zone z
left join bms_region r on r.region_id = z.region_id
left join region r on r.region_id = z.region_id
<where>
<if test="regionId != null">
AND z.region_id = #{regionId}
@@ -76,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
count(distinct z.zone_id) as zone_count,
count(d.detail_id) as detail_count
from prc_zone z
inner join bms_region r on r.region_id = z.region_id
inner join region r on r.region_id = z.region_id
left join prc_zone_detail d on d.zone_id = z.zone_id
<where>
<if test="countryNameCn != null and countryNameCn != ''">
@@ -99,7 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
(select count(1) from prc_zone_detail d
inner join prc_zone z on z.zone_id = d.zone_id
where z.region_id = r.region_id) as detail_count
from bms_region r
from region r
where r.region_id = #{regionId}
</select>