清空统计
This commit is contained in:
parent
ac2b834db3
commit
79a9994bfb
|
@ -5,7 +5,6 @@ import java.util.List;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.common.utils.qiniu.QiNiuUtils;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -165,12 +164,4 @@ public class CommonController
|
|||
}
|
||||
|
||||
|
||||
@ApiOperation("获取七牛云上传信息")
|
||||
@GetMapping("/qiniu/uploadInfo")
|
||||
public AjaxResult getQiNiuToken() {
|
||||
AjaxResult ajax = AjaxResult.success("操作成功");
|
||||
ajax.put("token", QiNiuUtils.getToken());
|
||||
ajax.put("domain", QiNiuUtils.DOMAIN);
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,4 +104,13 @@ public class TAgentsController extends BaseController
|
|||
{
|
||||
return toAjax(tAgentsService.deleteTAgentsByIds(ids));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:agents:edit')")
|
||||
@Log(title = "代理商信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/clearMonth/{id}")
|
||||
public AjaxResult clearMonth(@PathVariable Long id)
|
||||
{
|
||||
return toAjax(tAgentsService.clearMonth(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -115,19 +115,6 @@ pagehelper:
|
|||
supportMethodsArguments: true
|
||||
params: count=countSql
|
||||
|
||||
# 七牛云配置
|
||||
qiniu:
|
||||
# 七牛云key
|
||||
accessKey: MI4PDg9LYWXJyahzx5ec6-Ih0YNwQhew_BQUhttS
|
||||
# 七牛云密钥
|
||||
secretKey: Lk3fHHEnJuf0jD_Zte1xhtv7BTvjvmaWVCKd7O0J
|
||||
# 七牛云命名空间
|
||||
bucket: autosprout
|
||||
# 过期时间(秒)
|
||||
expireSeconds: 60000
|
||||
# 七牛云GET请求域名
|
||||
domain: https://lxnapi.ccttiot.com
|
||||
|
||||
# Swagger配置
|
||||
swagger:
|
||||
# 是否开启swagger
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
package com.ruoyi.common.utils.qiniu;
|
||||
|
||||
import com.qiniu.util.Auth;
|
||||
import com.qiniu.util.StringMap;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
|
||||
/**
|
||||
* 七牛云工具类
|
||||
* @author qzz
|
||||
* 2024/3/26
|
||||
*/
|
||||
public class QiNiuUtils {
|
||||
|
||||
public static final String ACCESS_KEY = SpringUtils.getRequiredProperty("qiniu.accessKey");
|
||||
public static final String SECRET_KEY = SpringUtils.getRequiredProperty("qiniu.secretKey");
|
||||
public static final String BUCKET = SpringUtils.getRequiredProperty("qiniu.bucket");
|
||||
public static final Long EXPIRE_SECONDS = Long.parseLong(SpringUtils.getRequiredProperty("qiniu.expireSeconds")); // 过期时间(秒)
|
||||
public static final String DOMAIN = SpringUtils.getRequiredProperty("qiniu.domain"); // 域名
|
||||
|
||||
/**
|
||||
* 获取文件上传的token
|
||||
* @return token
|
||||
*/
|
||||
public static String getToken() {
|
||||
StringMap putPolicy = new StringMap();
|
||||
Auth auth = Auth.create(ACCESS_KEY, SECRET_KEY);
|
||||
return auth.uploadToken(BUCKET,null, EXPIRE_SECONDS, putPolicy);
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// StringMap putPolicy = new StringMap();
|
||||
// Auth auth = Auth.create("MI4PDg9LYWXJyahzx5ec6-Ih0YNwQhew_BQUhttS", "Lk3fHHEnJuf0jD_Zte1xhtv7BTvjvmaWVCKd7O0J");
|
||||
// String s = auth.uploadToken("autosprout", null, 600L, putPolicy);
|
||||
// System.out.println(s);
|
||||
// }
|
||||
|
||||
}
|
|
@ -71,4 +71,11 @@ public interface TAgentsMapper
|
|||
* @return 结果
|
||||
*/
|
||||
int cumulativeAmount(@Param("agentId") Long agentId, @Param("amount") BigDecimal amount);
|
||||
|
||||
/**
|
||||
* 清除统计数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int clearMonth(@Param("id") Long id);
|
||||
}
|
||||
|
|
|
@ -97,6 +97,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where id = #{agentId}
|
||||
</update>
|
||||
|
||||
<update id="clearMonth">
|
||||
update t_agents
|
||||
set monthly_total = 0
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="updateColumns">
|
||||
<if test="data.name != null and data.name != ''">name = #{data.name},</if>
|
||||
<if test="data.walletAddresses != null">wallet_addresses = #{data.walletAddresses,typeHandler=com.ruoyi.system.mapper.typehandler.StringSplitListTypeHandler},</if>
|
||||
|
|
|
@ -70,4 +70,11 @@ public interface ITAgentsService
|
|||
* @return 结果
|
||||
*/
|
||||
int cumulativeAmount(Long agentId, BigDecimal amount);
|
||||
|
||||
/**
|
||||
* 清除统计数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int clearMonth(Long id);
|
||||
}
|
||||
|
|
|
@ -105,4 +105,9 @@ public class TAgentsServiceImpl implements ITAgentsService
|
|||
public int cumulativeAmount(Long agentId, BigDecimal amount) {
|
||||
return tAgentsMapper.cumulativeAmount(agentId,amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int clearMonth(Long id) {
|
||||
return tAgentsMapper.clearMonth(id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,3 +42,11 @@ export function delAgents(id) {
|
|||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 清除代理商统计数据
|
||||
export function clearAgentsMonth(id) {
|
||||
return request({
|
||||
url: '/system/agents//clearMonth/' + id,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -123,6 +123,13 @@
|
|||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:agents:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-refresh"
|
||||
@click="handleClearMonth(scope.row)"
|
||||
v-hasPermi="['system:agents:edit']"
|
||||
>重置统计</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
|
@ -270,7 +277,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listAgents, getAgents, delAgents, addAgents, updateAgents } from "@/api/system/agents";
|
||||
import {listAgents, getAgents, delAgents, addAgents, updateAgents, clearAgentsMonth} from "@/api/system/agents";
|
||||
import { $showColumns } from '@/utils/mixins';
|
||||
import {listChannels} from "@/api/system/channels";
|
||||
|
||||
|
@ -572,6 +579,16 @@ export default {
|
|||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
handleClearMonth(row) {
|
||||
let id = row.id;
|
||||
this.$modal.confirm('是否确认重置代理商信息编号为"' + id + '"的数据项?').then(function() {
|
||||
return clearAgentsMonth(row.id)
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("重置成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/agents/export', {
|
||||
|
|
Loading…
Reference in New Issue
Block a user