积分记录管理端
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
package com.peanut.modules.master.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.common.entity.JfTransactionDetails;
|
||||
import com.peanut.modules.master.service.JfTransactionDetailsService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 积分记录
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController("masterJfTransactionDetails")
|
||||
@RequestMapping("master/jfTransactionDetails")
|
||||
public class JfTransactionDetailsController {
|
||||
|
||||
@Autowired
|
||||
private JfTransactionDetailsService jfService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/listByPage")
|
||||
public R listByPage(@RequestBody Map<String, Object> params) {
|
||||
MPJLambdaWrapper<JfTransactionDetails> wrapper = new MPJLambdaWrapper();
|
||||
if (params.containsKey("userId")&& StringUtils.isNotEmpty(params.get("userId").toString())) {
|
||||
wrapper.eq(JfTransactionDetails::getUserId,params.get("userId"));
|
||||
}
|
||||
if (params.containsKey("actType")&&StringUtils.isNotEmpty(params.get("actType").toString())) {
|
||||
wrapper.eq(JfTransactionDetails::getActType,params.get("actType"));
|
||||
}
|
||||
if (params.containsKey("remark")&&StringUtils.isNotEmpty(params.get("remark").toString())) {
|
||||
wrapper.like(JfTransactionDetails::getRemark,params.get("remark"));
|
||||
}
|
||||
wrapper.orderByDesc(JfTransactionDetails::getCreateTime);
|
||||
Page<JfTransactionDetails> records = jfService.page(new Page<>(
|
||||
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())), wrapper);
|
||||
return R.ok().put("result", records);
|
||||
}
|
||||
|
||||
@RequestMapping("/getJfTransactionDetailsById")
|
||||
public R getJfTransactionDetailsById(String id) {
|
||||
return R.ok().put("result", jfService.getById(id));
|
||||
}
|
||||
|
||||
@RequestMapping("/saveOrUpdateJfTransactionDetails")
|
||||
public R saveOrUpdateJfTransactionDetails(@RequestBody JfTransactionDetails jf) {
|
||||
jfService.saveOrUpdate(jf);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@RequestMapping("/delJfTransactionDetails")
|
||||
public R delJfTransactionDetails(String id) {
|
||||
jfService.removeById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user