Commit d88bf12e authored by licc's avatar licc

新增统计月度奖金接口

parent 4bf27a2b
......@@ -5,8 +5,6 @@ import cn.wisenergy.model.app.AccountInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
/**
* @author 86187
*/
......
......@@ -16,7 +16,7 @@ public interface TradeRecordService {
*
* @return true or false
*/
Boolean monthAwardCount();
R<Boolean> monthAwardCount();
/**
* 交易流水列表查询
......
......@@ -39,7 +39,7 @@ public class TradeRecordServiceImpl extends ServiceImpl<TradeRecordMapper, Trade
private TradeRecordMapper tradeRecordMapper;
@Override
public Boolean monthAwardCount() {
public R<Boolean> monthAwardCount() {
MonthAward result = new MonthAward();
//1、获取本月新增奖金
Double monthGrow = baseMapper.queryMonthGrow(new Date());
......@@ -93,11 +93,17 @@ public class TradeRecordServiceImpl extends ServiceImpl<TradeRecordMapper, Trade
MonthAward currentMonth = monthAwardMapper.getByTime(new Date());
if (null == currentMonth) {
int count = monthAwardMapper.add(result);
return count != 0;
if (count == 0) {
return R.ok(1, false);
}
} else {
int count = monthAwardMapper.edit(result);
return count != 0;
if (count == 0) {
return R.ok(1, false);
}
}
return R.ok(0, true);
}
@Override
......
......@@ -3,7 +3,6 @@ package cn.wisenergy.web.admin.controller.app;
import cn.wisenergy.common.utils.R;
import cn.wisenergy.model.app.TradeRecord;
import cn.wisenergy.model.dto.TradeRecordQuery;
import cn.wisenergy.model.vo.TaxRateVo;
import cn.wisenergy.service.app.TradeRecordService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
......@@ -12,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -33,4 +33,12 @@ public class TradeRecordController {
log.info("shop-mall[]TradeRecordController[]queryList[]input.param.query:" + query);
return tradeRecordService.queryList(query);
}
@ApiOperation(value = "统计月度奖金", notes = "统计月度奖金", httpMethod = "POST")
@PostMapping("/monthAwardCount")
public R<Boolean> monthAwardCount() {
log.info("shop-mall[]TradeRecordController[]monthAwardCount[]input.method");
return tradeRecordService.monthAwardCount();
}
}
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