Commit 29dc04b9 authored by liwei's avatar liwei

初始化了金币流水相关代码

parent 22974429
package org.rcisoft.app.appMemGoldCoinFlow.controller;
/*固定导入*/
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.servlet.http.HttpServletResponse;
import org.rcisoft.business.memGoldCoinFlow.entity.MemGoldCoinFlow;
import org.rcisoft.business.memGoldCoinFlow.service.MemGoldCoinFlowService;
import org.rcisoft.core.anno.CyOpeLogAnno;
import org.rcisoft.core.constant.CyMessCons;
import org.rcisoft.core.controller.CyPaginationController;
import org.rcisoft.core.model.CyGridModel;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.operlog.enums.CyLogTypeEnum;
import org.rcisoft.core.result.CyResult;
import org.rcisoft.core.util.CyEpExcelUtil;
import org.rcisoft.core.util.CyResultGenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
* Created by cy on 2025年2月7日 上午10:11:22.
*/
@RestController
@RequestMapping("/app")
public class AppMemGoldCoinFlowController extends CyPaginationController<MemGoldCoinFlow> {
@Autowired
private MemGoldCoinFlowService memGoldCoinFlowServiceImpl;
@PreAuthorize("@cyPerm.hasPerm('app:goldCoinFlow:add')")
@CyOpeLogAnno(title = "system-金币流水表管理-新增金币流水表", businessType = CyLogTypeEnum.INSERT)
@Operation(summary="添加金币流水表", description="添加金币流水表")
@PostMapping(value = "/memGoldCoinFlow/add")
public CyResult add(@Valid @RequestBody MemGoldCoinFlow memGoldCoinFlow, BindingResult bindingResult) {
CyPersistModel data = memGoldCoinFlowServiceImpl.persist(memGoldCoinFlow);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
memGoldCoinFlow);
}
}
package org.rcisoft.business.memGoldCoinFlow.controller;
/*固定导入*/
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.Operation;
import org.rcisoft.business.memGoldCoinFlow.entity.MemGoldCoinFlow;
import org.rcisoft.business.memGoldCoinFlow.service.MemGoldCoinFlowService;
import org.rcisoft.core.anno.CyOpeLogAnno;
import org.rcisoft.core.operlog.enums.CyLogTypeEnum;
import org.rcisoft.core.util.CyEpExcelUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.rcisoft.core.result.CyResult;
import org.rcisoft.core.util.CyResultGenUtil;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.constant.CyMessCons;
import org.rcisoft.core.controller.CyPaginationController;
import org.rcisoft.core.model.CyGridModel;
import jakarta.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;
/**
* Created by cy on 2025年2月7日 上午10:11:22.
*/
@RestController
@RequestMapping("/memGoldCoinFlow")
public class MemGoldCoinFlowController extends CyPaginationController<MemGoldCoinFlow> {
@Autowired
private MemGoldCoinFlowService memGoldCoinFlowServiceImpl;
@PreAuthorize("@cyPerm.hasPerm('sys:goldCoinFlow:add')")
@CyOpeLogAnno(title = "system-金币流水表管理-新增金币流水表", businessType = CyLogTypeEnum.INSERT)
@Operation(summary="添加金币流水表", description="添加金币流水表")
@PostMapping(value = "/add")
public CyResult add(@Valid MemGoldCoinFlow memGoldCoinFlow, BindingResult bindingResult) {
CyPersistModel data = memGoldCoinFlowServiceImpl.persist(memGoldCoinFlow);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
memGoldCoinFlow);
}
@PreAuthorize("@cyPerm.hasPerm('sys:goldCoinFlow:delete')")
@CyOpeLogAnno(title = "system-金币流水表管理-删除金币流水表", businessType = CyLogTypeEnum.DELETE)
@Operation(summary="逻辑删除金币流水表", description="逻辑删除金币流水表")
@Parameters({@Parameter(name = "businessId", description = "businessId", required = true, schema = @Schema(type = "string"))})
@DeleteMapping("/deleteLogical/{businessId:\\w+}")
public CyResult deleteLogical(@PathVariable int businessId,MemGoldCoinFlow memGoldCoinFlow) {
memGoldCoinFlow.setBusinessId(businessId);
CyPersistModel data = memGoldCoinFlowServiceImpl.removeLogical(memGoldCoinFlow);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
businessId);
}
@PreAuthorize("@cyPerm.hasPerm('sys:goldCoinFlow:delete')")
@CyOpeLogAnno(title = "system-金币流水表管理-删除金币流水表", businessType = CyLogTypeEnum.DELETE)
@Operation(summary="删除金币流水表", description="删除金币流水表")
@Parameters({@Parameter(name = "businessId", description = "businessId", required = true, schema = @Schema(type = "string"))})
@DeleteMapping("/delete/{businessId:\\w+}")
public CyResult delete(@PathVariable int businessId,MemGoldCoinFlow memGoldCoinFlow) {
memGoldCoinFlow.setBusinessId(businessId);
CyPersistModel data = memGoldCoinFlowServiceImpl.remove(memGoldCoinFlow);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
businessId);
}
@PreAuthorize("@cyPerm.hasPerm('sys:goldCoinFlow:update')")
@CyOpeLogAnno(title = "system-金币流水表管理-修改金币流水表", businessType = CyLogTypeEnum.UPDATE)
@Operation(summary="修改金币流水表", description="修改金币流水表")
@Parameters({@Parameter(name = "businessId", description = "businessId", required = false, schema = @Schema(type = "string"))})
@PutMapping("/update/{businessId:\\w+}")
public CyResult update(@PathVariable int businessId, @Valid MemGoldCoinFlow memGoldCoinFlow, BindingResult bindingResult) {
memGoldCoinFlow.setBusinessId(businessId);
CyPersistModel data = memGoldCoinFlowServiceImpl.merge(memGoldCoinFlow);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
memGoldCoinFlow);
}
@PreAuthorize("@cyPerm.hasPerm('sys:goldCoinFlow:query')")
@CyOpeLogAnno(title = "system-金币流水表管理-查询金币流水表", businessType = CyLogTypeEnum.QUERY)
@Operation(summary="查询单一金币流水表", description="查询单一金币流水表")
@Parameters({@Parameter(name = "businessId", description = "businessId", required = true, schema = @Schema(type = "string"))})
@GetMapping("/detail/{businessId:\\w+}")
public CyResult detail(@PathVariable int businessId) {
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
memGoldCoinFlowServiceImpl.findById(businessId));
}
@PreAuthorize("@cyPerm.hasPerm('sys:goldCoinFlow:list')")
@CyOpeLogAnno(title = "system-金币流水表管理-查询金币流水表", businessType = CyLogTypeEnum.QUERY)
@Operation(summary="查询金币流水表集合", description="查询金币流水表集合")
@GetMapping(value = "/listAll")
public CyResult listAll(MemGoldCoinFlow memGoldCoinFlow) {
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
memGoldCoinFlowServiceImpl.findAll(memGoldCoinFlow));
}
@PreAuthorize("@cyPerm.hasPerm('sys:goldCoinFlow:list')")
@CyOpeLogAnno(title = "system-金币流水表管理-查询金币流水表", businessType = CyLogTypeEnum.QUERY)
@Operation(summary="分页查询金币流水表集合", description="分页查询金币流水表集合")
@GetMapping(value = "/list")
public CyGridModel listByPagination(MemGoldCoinFlow memGoldCoinFlow) {
memGoldCoinFlowServiceImpl.findAllByPagination(getPaginationUtility(), memGoldCoinFlow);
return getGridModelResponse();
}
@CyOpeLogAnno(title = "system-金币流水表管理-查询金币流水表", businessType = CyLogTypeEnum.EXPORT)
@Operation(summary = "导出金币流水表信息", description = "导出金币流水表信息")
@GetMapping(value = "/export")
public void outMemGoldCoinFlow(HttpServletResponse response,MemGoldCoinFlow memGoldCoinFlow,@PathVariable @RequestParam(defaultValue = "0") String excelId) {
String excelName="";
switch(excelId){
case "0": excelName="金币流水表信息.xls";break;
case "1": excelName="金币流水表信息.xlsx";break;
case "2": excelName="金币流水表信息.csv";break;
}
List<MemGoldCoinFlow> memGoldCoinFlowList = memGoldCoinFlowServiceImpl.export(memGoldCoinFlow);
CyEpExcelUtil.exportExcel(memGoldCoinFlowList, "金币流水表信息", "金币流水表信息", MemGoldCoinFlow.class, excelName, response);
}
}
package org.rcisoft.business.memGoldCoinFlow.dao;
import org.rcisoft.business.memGoldCoinFlow.entity.MemGoldCoinFlow;
import org.rcisoft.core.mapper.CyBaseMapper;
import org.rcisoft.core.model.CyPageInfo;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
* Created with cy on 2025年2月7日 上午10:11:22.
*/
public interface MemGoldCoinFlowRepository extends CyBaseMapper<MemGoldCoinFlow> {
List<MemGoldCoinFlow> queryMemGoldCoinFlows(@Param("entity") MemGoldCoinFlow memGoldCoinFlow);
/**
* 分页查询 memGoldCoinFlow
*
*/
IPage<MemGoldCoinFlow> queryMemGoldCoinFlowsPaged(CyPageInfo cyPageInfo,@Param("entity") MemGoldCoinFlow memGoldCoinFlow);
}
package org.rcisoft.business.memGoldCoinFlow.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import org.rcisoft.core.entity.CyIdIncreEntity;
import java.math.BigInteger;
/**
* Created with cy on 2025年2月7日 上午10:11:22.
*/
@Data
@TableName("mem_gold_coin_flow")
public class MemGoldCoinFlow extends CyIdIncreEntity<MemGoldCoinFlow> {
/**
* @desc 1:充值 2:消费
* @column type
* @default
*/
@Excel(name = "1:充值 2:消费", orderNum = "0", width = 20)
private String type;
/**
* @desc 10:用户充值 11:系统充值 20:点赞 21:发动态 22:留言 23:要微信联系方式 24:接收微信请求
* @column action_type
* @default
*/
@Excel(name = "10:用户充值 11:系统充值 20:点赞 21:发动态 22:留言", orderNum = "1", width = 20)
private String actionType;
/**
* @desc 金币数量
* @column count
* @default
*/
@Excel(name = "金币数量", orderNum = "2", width = 20)
private Integer count;
/**
* @desc 交易后的余额
* @column end_count
* @default
*/
@Excel(name = "交易后的余额", orderNum = "3", width = 20)
private Integer endCount;
/**
* @desc 订单id
* @column order_id
* @default
*/
@Excel(name = "订单id", orderNum = "4", width = 20)
private BigInteger orderId;
/**
* @desc 目标id,用户id
* @column target_id
* @default
*/
@Excel(name = "目标id,用户id", orderNum = "5", width = 20)
private BigInteger targetId;
}
package org.rcisoft.business.memGoldCoinFlow.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.rcisoft.business.memGoldCoinFlow.entity.MemGoldCoinFlow;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.model.CyPageInfo;
import java.util.List;
/**
* Created by cy on 2025年2月7日 上午10:11:22.
*/
public interface MemGoldCoinFlowService {
/**
* 保存 金币流水表
* @param memGoldCoinFlow
* @return
*/
CyPersistModel persist(MemGoldCoinFlow memGoldCoinFlow);
/**
* 删除 金币流水表
* @param memGoldCoinFlow
* @return
*/
CyPersistModel remove(MemGoldCoinFlow memGoldCoinFlow);
/**
* 逻辑删除 金币流水表
* @param memGoldCoinFlow
* @return
*/
CyPersistModel removeLogical(MemGoldCoinFlow memGoldCoinFlow);
/**
* 修改 金币流水表
* @param memGoldCoinFlow
* @return
*/
CyPersistModel merge(MemGoldCoinFlow memGoldCoinFlow);
/**
* 根据id查询 金币流水表
* @param id
* @return
*/
MemGoldCoinFlow findById(int id);
/**
* 分页查询 金币流水表
* @param memGoldCoinFlow
* @return
*/
IPage<MemGoldCoinFlow> findAllByPagination(CyPageInfo<MemGoldCoinFlow> paginationUtility,
MemGoldCoinFlow memGoldCoinFlow);
/**
* 查询list 金币流水表
* @param memGoldCoinFlow
* @return
*/
List<MemGoldCoinFlow> findAll(MemGoldCoinFlow memGoldCoinFlow);
/**
* 导出金币流水表
* @return
*/
List<MemGoldCoinFlow> export(MemGoldCoinFlow memGoldCoinFlow);
}
package org.rcisoft.business.memGoldCoinFlow.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.rcisoft.business.memGoldCoinFlow.dao.MemGoldCoinFlowRepository;
import org.rcisoft.business.memGoldCoinFlow.entity.MemGoldCoinFlow;
import org.rcisoft.business.memGoldCoinFlow.service.MemGoldCoinFlowService;
import org.rcisoft.core.util.CyUserUtil;
import org.rcisoft.core.model.CyPersistModel;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.rcisoft.core.model.CyPageInfo;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
/**
* Created by cy on 2025年2月7日 上午10:11:22.
*/
@Service
@Transactional(readOnly = true,propagation = Propagation.NOT_SUPPORTED)
@Slf4j
public class MemGoldCoinFlowServiceImpl extends ServiceImpl<MemGoldCoinFlowRepository, MemGoldCoinFlow> implements MemGoldCoinFlowService {
/**
* 保存 金币流水表
* @param memGoldCoinFlow
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel persist(MemGoldCoinFlow memGoldCoinFlow){
//增加操作
int line = baseMapper.insert(memGoldCoinFlow);
log.debug(CyUserUtil.getAuthenUsername()+"新增了ID为"+
memGoldCoinFlow.getBusinessId()+"的金币流水表信息");
return new CyPersistModel(line);
}
/**
* 删除 金币流水表
* @param memGoldCoinFlow
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel remove(MemGoldCoinFlow memGoldCoinFlow){
int line = baseMapper.realDelete(memGoldCoinFlow);
log.debug(CyUserUtil.getAuthenUsername()+"删除了ID为"+
memGoldCoinFlow.getBusinessId()+"的金币流水表信息");
return new CyPersistModel(line);
}
/**
* 逻辑删除 金币流水表
* @param memGoldCoinFlow
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel removeLogical(MemGoldCoinFlow memGoldCoinFlow){
memGoldCoinFlow.setDeleted();
int line = baseMapper.deleteById(memGoldCoinFlow);
log.debug(CyUserUtil.getAuthenUsername()+"逻辑删除了ID为"+
memGoldCoinFlow.getBusinessId()+"的金币流水表信息");
return new CyPersistModel(line);
}
/**
* 修改 金币流水表
* @param memGoldCoinFlow
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel merge(MemGoldCoinFlow memGoldCoinFlow){
int line = baseMapper.updateById(memGoldCoinFlow);
log.debug(CyUserUtil.getAuthenUsername()+"修改了ID为"+ memGoldCoinFlow.getBusinessId()+"的金币流水表信息");
return new CyPersistModel(line);
}
/**
* 根据id查询 金币流水表
* @param id
* @return
*/
@Override
public MemGoldCoinFlow findById(int id){
return baseMapper.selectById(id);
}
/**
* 分页查询 金币流水表
* @param memGoldCoinFlow
* @return
*/
@Override
public IPage<MemGoldCoinFlow> findAllByPagination(CyPageInfo<MemGoldCoinFlow> paginationUtility,
MemGoldCoinFlow memGoldCoinFlow){
return baseMapper.queryMemGoldCoinFlowsPaged(paginationUtility,memGoldCoinFlow);
}
/**
* 查询list 金币流水表
* @param memGoldCoinFlow
* @return
*/
@Override
public List<MemGoldCoinFlow> findAll(MemGoldCoinFlow memGoldCoinFlow){
return baseMapper.queryMemGoldCoinFlows(memGoldCoinFlow);
}
/**
* 导出金币流水表
* @return
*/
@Override
public List<MemGoldCoinFlow> export(MemGoldCoinFlow memGoldCoinFlow) {
List<MemGoldCoinFlow> memGoldCoinFlowList = baseMapper.queryMemGoldCoinFlows(memGoldCoinFlow);
return memGoldCoinFlowList;
}
}
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
<result column="summary" jdbcType="VARCHAR" property="summary"/> <result column="summary" jdbcType="VARCHAR" property="summary"/>
</resultMap> </resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<select id="queryCmsActivity" resultMap="BaseResultMap"> <select id="queryCmsActivity" resultMap="BaseResultMap">
select * from cms_activity select * from cms_activity
where 1=1 where 1=1
......
<?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="org.rcisoft.business.memGoldCoinFlow.dao.MemGoldCoinFlowRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.business.memGoldCoinFlow.entity.MemGoldCoinFlow">
<id column="business_id" jdbcType="BIGINT" property="businessId"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="flag" jdbcType="VARCHAR" property="flag"/>
<result column="del_flag" jdbcType="VARCHAR" property="delFlag"/>
<result column="remarks" jdbcType="VARCHAR" property="remarks"/>
<result column="type" jdbcType="CHAR" property="type"/>
<result column="action_type" jdbcType="CHAR" property="actionType"/>
<result column="count" jdbcType="INTEGER" property="count"/>
<result column="end_count" jdbcType="INTEGER" property="endCount"/>
<result column="order_id" jdbcType="BIGINT" property="orderId"/>
<result column="target_id" jdbcType="BIGINT" property="targetId"/>
</resultMap>
<select id="queryMemGoldCoinFlows" resultMap="BaseResultMap">
select * from mem_gold_coin_flow
where 1=1
and del_flag = '0'
<if test="entity.flag !=null and entity.flag != '' ">
and flag = #{entity.flag}
</if>
<if test="entity.type !=null and entity.type != '' ">
and type = #{entity.type}
</if>
<if test="entity.actionType !=null and entity.actionType != '' ">
and action_type = #{entity.actionType}
</if>
<if test="entity.count !=null and entity.count != '' ">
and count = #{entity.count}
</if>
<if test="entity.endCount !=null and entity.endCount != '' ">
and end_count = #{entity.endCount}
</if>
<if test="entity.orderId !=null and entity.orderId != '' ">
and order_id = #{entity.orderId}
</if>
<if test="entity.targetId !=null and entity.targetId != '' ">
and target_id = #{entity.targetId}
</if>
ORDER BY business_id DESC
</select>
<select id="queryMemGoldCoinFlowsPaged" resultMap="BaseResultMap">
select * from mem_gold_coin_flow
where 1=1
and del_flag = '0'
<if test="entity.flag !=null and entity.flag != '' ">
and flag = #{entity.flag}
</if>
<if test="entity.type !=null and entity.type != '' ">
and type = #{entity.type}
</if>
<if test="entity.actionType !=null and entity.actionType != '' ">
and action_type = #{entity.actionType}
</if>
<if test="entity.count !=null and entity.count != '' ">
and count = #{entity.count}
</if>
<if test="entity.endCount !=null and entity.endCount != '' ">
and end_count = #{entity.endCount}
</if>
<if test="entity.orderId !=null and entity.orderId != '' ">
and order_id = #{entity.orderId}
</if>
<if test="entity.targetId !=null and entity.targetId != '' ">
and target_id = #{entity.targetId}
</if>
ORDER BY business_id DESC
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment