update 后管sim卡管理页面新增刷新功能

This commit is contained in:
Lemon
2024-11-04 14:41:59 +08:00
parent 002b751337
commit ecb62f73e5
6 changed files with 68 additions and 15 deletions

View File

@@ -12,6 +12,7 @@ import com.jsowell.pile.dto.SimRenewDTO;
import com.jsowell.pile.service.PileSimInfoService; import com.jsowell.pile.service.PileSimInfoService;
import com.jsowell.pile.service.SimCardService; import com.jsowell.pile.service.SimCardService;
import com.jsowell.pile.vo.web.SimCardInfoVO; import com.jsowell.pile.vo.web.SimCardInfoVO;
import com.jsowell.pile.vo.web.SimCardVO;
import com.jsowell.pile.vo.web.SimRenewResultVO; import com.jsowell.pile.vo.web.SimRenewResultVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@@ -75,6 +76,16 @@ public class PileSimInfoController extends BaseController {
util.exportExcel(response, list, "充电桩SIM卡信息数据"); util.exportExcel(response, list, "充电桩SIM卡信息数据");
} }
/**
* 通过iccId查询卡最新数据
* @param iccId
*/
@PreAuthorize("@ss.hasPermi('pile:sim:list')")
@GetMapping("/getSimCardNewInfoByIccId/{iccId}")
public AjaxResult getSimCardNewInfoByIccId(@PathVariable("iccId") String iccId) {
return AjaxResult.success(simCardService.getSimCardInfoByIccId(iccId));
}
/** /**
* 获取充电桩SIM卡信息详细信息 * 获取充电桩SIM卡信息详细信息
*/ */

View File

@@ -125,7 +125,7 @@ public class SimCardService {
* @param iccId * @param iccId
* @return * @return
*/ */
SimCardVO getSimCardInfoByIccId(String iccId) { public SimCardVO getSimCardInfoByIccId(String iccId) {
PileSimInfo pileSimInfo = pileSimInfoService.getBasicInfoByIccId(iccId); PileSimInfo pileSimInfo = pileSimInfoService.getBasicInfoByIccId(iccId);
// 调用官方数据接口查询最新sim卡数据 // 调用官方数据接口查询最新sim卡数据
SimCardVO simCardVO = searchOfficialWebsiteSimInfo(iccId); SimCardVO simCardVO = searchOfficialWebsiteSimInfo(iccId);

View File

@@ -87,4 +87,10 @@ public class SimCardInfoVO {
@Excel(name = "剩余天数") @Excel(name = "剩余天数")
private String remainingDays; private String remainingDays;
/**
* 上次更新时间
*/
@Excel(name = "上次更新时间")
private String lastUpdateTime;
} }

View File

@@ -166,6 +166,7 @@
t1.total_data as totalData, t1.total_data as totalData,
t1.surplus_data as surplusData, t1.surplus_data as surplusData,
t1.expire_time as expireTime, t1.expire_time as expireTime,
t1.update_time as lastUpdateTime,
t1.operator t1.operator
from pile_sim_info t1 from pile_sim_info t1
left join pile_basic_info t2 on t1.id = t2.sim_id left join pile_basic_info t2 on t1.id = t2.sim_id

View File

@@ -59,3 +59,10 @@ export function simRenew(data) {
data: data data: data
}) })
} }
export function getSimCardNewInfoByIccId(iccId) {
return request({
url: '/pile/sim/getSimCardNewInfoByIccId/' + iccId,
method: 'get'
})
}

View File

@@ -152,7 +152,7 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="SIM卡供应商" align="center" prop="simSupplier" > <el-table-column label="SIM卡供应商" align="center" prop="simSupplier" width="140">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
:options="dict.type.sim_supplier" :options="dict.type.sim_supplier"
@@ -162,7 +162,7 @@
</el-table-column> </el-table-column>
<el-table-column label="套餐总流量" align="center" prop="totalData" /> <el-table-column label="套餐总流量" align="center" prop="totalData" />
<el-table-column label="剩余流量" align="center" prop="surplusData" /> <el-table-column label="剩余流量" align="center" prop="surplusData" />
<el-table-column label="到期时间" align="center" prop="expireTime" width="180"> <el-table-column label="到期时间" align="center" prop="expireTime" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.expireTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.expireTime, '{y}-{m}-{d}') }}</span>
</template> </template>
@@ -174,6 +174,7 @@
<span v-else-if="scope.row.remainingDays > 30 "> {{scope.row.remainingDays}}</span> <span v-else-if="scope.row.remainingDays > 30 "> {{scope.row.remainingDays}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="上次更新时间" align="center" prop="lastUpdateTime" width="180"/>
<el-table-column label="电信运营商" align="center" prop="operator" > <el-table-column label="电信运营商" align="center" prop="operator" >
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
@@ -192,21 +193,29 @@
<!-- @click="handleUpdate(scope.row)"--> <!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['pile:sim:edit']"--> <!-- v-hasPermi="['pile:sim:edit']"-->
<!-- >修改</el-button>--> <!-- >修改</el-button>-->
<el-button <!-- <el-button-->
size="mini" <!-- size="mini"-->
type="text" <!-- type="text"-->
icon="el-icon-edit" <!-- icon="el-icon-edit"-->
@click="handleRenewSim(scope.row)" <!-- @click="handleRenewSim(scope.row)"-->
v-hasPermi="['pile:sim:edit']" <!-- v-hasPermi="['pile:sim:edit']"-->
>续期</el-button> <!-- >续期</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['pile:sim:remove']"-->
<!-- >删除</el-button>-->
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-refresh"
@click="handleDelete(scope.row)" @click="getNewInfo(scope.row.iccId)"
v-hasPermi="['pile:sim:remove']" v-hasPermi="['pile:sim:edit']"
>删除</el-button> >获取最新数据</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -274,7 +283,16 @@
</template> </template>
<script> <script>
import {listSim, getSim, delSim, addSim, updateSim, simRenew, getSimInfo} from "@/api/pile/sim"; import {
listSim,
getSim,
delSim,
addSim,
updateSim,
simRenew,
getSimInfo,
getSimCardNewInfoByIccId
} from "@/api/pile/sim";
import {listStation} from "@/api/pile/station"; import {listStation} from "@/api/pile/station";
export default { export default {
@@ -436,6 +454,16 @@ export default {
this.stationList = response.rows; this.stationList = response.rows;
}); });
}, },
// 获取sim卡最新数据
getNewInfo(iccId) {
console.log("iccid", iccId)
getSimCardNewInfoByIccId(iccId).then((response) => {
console.log("getSimCardNewInfoByIccId, result", response)
if (response != null) {
this.getList();
}
})
},
// 重置 续费周期相关 // 重置 续费周期相关
resetSimRenewCycleNumber() { resetSimRenewCycleNumber() {
console.log("重置 续费周期相关"); console.log("重置 续费周期相关");