添加程序版本字段

This commit is contained in:
jsowell
2026-06-10 16:40:29 +08:00
parent 6686e2747f
commit 12685f528b
6 changed files with 66 additions and 2 deletions

View File

@@ -0,0 +1,2 @@
ALTER TABLE `pile_basic_info`
ADD COLUMN `program_version` varchar(64) DEFAULT NULL COMMENT '程序版本' AFTER `software_protocol`;

View File

@@ -61,6 +61,12 @@ public class PileBasicInfo extends BaseEntity {
@Excel(name = "软件协议", readConverterExp = "yunkuaichongV150--云快充V1.5yunkuaichongV160--云快充V1.6yonglianV1--永联youdianV1--友电")
private String softwareProtocol;
/**
* 程序版本
*/
@Excel(name = "程序版本")
private String programVersion;
/**
* 生产日期
*/
@@ -126,6 +132,7 @@ public class PileBasicInfo extends BaseEntity {
.append("businessType", getBusinessType())
.append("secretKey", getSecretKey())
.append("softwareProtocol", getSoftwareProtocol())
.append("programVersion", getProgramVersion())
.append("productionDate", getProductionDate())
.append("licenceId", getLicenceId())
.append("modelId", getModelId())

View File

@@ -65,6 +65,11 @@ public interface PileBasicInfoMapper {
*/
int updatePileBasicInfo(PileBasicInfo pileBasicInfo);
/**
* 更新充电桩程序版本
*/
int updateProgramVersion(@Param("pileSn") String pileSn, @Param("programVersion") String programVersion);
/**
* 删除设备管理
*

View File

@@ -65,6 +65,15 @@ public interface PileBasicInfoService {
*/
int updateSimInfo(PileBasicInfo pileBasicInfo);
/**
* 更新充电桩程序版本
*
* @param pileSn 充电桩编号
* @param programVersion 程序版本
* @return 更新行数
*/
int updateProgramVersion(String pileSn, String programVersion);
/**
* 批量删除设备管理
*

View File

@@ -220,6 +220,32 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
return pileBasicInfoMapper.updatePileBasicInfo(pileBasicInfo);
}
/**
* 更新充电桩程序版本
*
* @param pileSn 充电桩编号
* @param programVersion 程序版本
* @return 更新行数
*/
@Override
public int updateProgramVersion(String pileSn, String programVersion) {
String normalizedProgramVersion = PileProgramVersionUtils.normalize(programVersion);
if (StringUtils.isBlank(pileSn) || StringUtils.isBlank(normalizedProgramVersion)) {
return 0;
}
PileBasicInfo basicInfo = selectPileBasicInfoBySN(pileSn);
if (basicInfo == null || StringUtils.equals(normalizedProgramVersion, basicInfo.getProgramVersion())) {
return 0;
}
int row = pileBasicInfoMapper.updateProgramVersion(pileSn, normalizedProgramVersion);
if (row > 0) {
cleanRedisCache(pileSn);
}
return row;
}
/**
* 批量删除设备管理
*

View File

@@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="businessType" column="business_type" />
<result property="secretKey" column="secret_key" />
<result property="softwareProtocol" column="software_protocol" />
<result property="programVersion" column="program_version" />
<result property="productionDate" column="production_date" />
<result property="licenceId" column="licence_id" />
<result property="modelId" column="model_id" />
@@ -29,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, sn, name, business_type, secret_key, software_protocol, production_date, licence_id, model_id, sim_id,
id, sn, name, business_type, secret_key, software_protocol, program_version, production_date, licence_id, model_id, sim_id,
iccid, merchant_id, station_id, fault_reason, create_by, create_time, update_by, update_time, del_flag, remark
</sql>
@@ -46,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="businessType != null and businessType != ''"> and business_type = #{businessType}</if>
<if test="secretKey != null and secretKey != ''"> and secret_key = #{secretKey}</if>
<if test="softwareProtocol != null and softwareProtocol != ''"> and software_protocol = #{softwareProtocol}</if>
<if test="programVersion != null and programVersion != ''"> and program_version = #{programVersion}</if>
<!--<if test="params.beginProductionDate != null and params.beginProductionDate != '' and params.endProductionDate != null and params.endProductionDate != ''"> and production_date between #{params.beginProductionDate} and #{params.endProductionDate}</if>
--> <if test="licenceId != null "> and licence_id = #{licenceId}</if>
<if test="modelId != null "> and model_id = #{modelId}</if>
@@ -77,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="businessType != null">business_type,</if>
<if test="secretKey != null">secret_key,</if>
<if test="softwareProtocol != null">software_protocol,</if>
<if test="programVersion != null">program_version,</if>
<if test="productionDate != null">production_date,</if>
<if test="licenceId != null">licence_id,</if>
<if test="modelId != null">model_id,</if>
@@ -98,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="businessType != null">#{businessType},</if>
<if test="secretKey != null">#{secretKey},</if>
<if test="softwareProtocol != null">#{softwareProtocol},</if>
<if test="programVersion != null">#{programVersion},</if>
<if test="productionDate != null">#{productionDate},</if>
<if test="licenceId != null">#{licenceId},</if>
<if test="modelId != null">#{modelId},</if>
@@ -123,6 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="businessType != null">business_type = #{businessType},</if>
<if test="secretKey != null">secret_key = #{secretKey},</if>
<if test="softwareProtocol != null">software_protocol = #{softwareProtocol},</if>
<if test="programVersion != null">program_version = #{programVersion},</if>
<if test="productionDate != null">production_date = #{productionDate},</if>
<if test="licenceId != null">licence_id = #{licenceId},</if>
<if test="modelId != null">model_id = #{modelId},</if>
@@ -141,6 +146,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<update id="updateProgramVersion">
update pile_basic_info
set program_version = #{programVersion,jdbcType=VARCHAR},
update_time = now()
where del_flag = '0'
and sn = #{pileSn,jdbcType=VARCHAR}
and (program_version is null or program_version != #{programVersion,jdbcType=VARCHAR})
</update>
<delete id="deletePileBasicInfoById" parameterType="Long">
delete from pile_basic_info where id = #{id}
</delete>
@@ -208,7 +222,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="batchInsertPileBasicInfo">
insert into pile_basic_info
(sn, name, business_type, secret_key, software_protocol, production_date, licence_id, model_id, sim_id, iccid,
(sn, name, business_type, secret_key, software_protocol, program_version, production_date, licence_id, model_id, sim_id, iccid,
merchant_id, station_id, fault_reason, create_by, update_by, del_flag, remark)
values
<foreach collection="infoList" item="item" separator=",">
@@ -218,6 +232,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item.businessType,jdbcType=VARCHAR},
#{item.secretKey,jdbcType=VARCHAR},
#{item.softwareProtocol,jdbcType=VARCHAR},
#{item.programVersion,jdbcType=VARCHAR},
#{item.productionDate,jdbcType=TIMESTAMP},
#{item.licenceId,jdbcType=BIGINT},
#{item.modelId,jdbcType=BIGINT},