消息修改,添加日志,权限

This commit is contained in:
梁琦涛
2021-09-26 09:20:35 +08:00
parent 83c31ceba7
commit 964fa0edb4
46 changed files with 928 additions and 279 deletions
@@ -1,40 +0,0 @@
package com.jero.home;
import com.jero.common.api.vo.Result;
import com.jero.payment.service.IPayPaymentRecordService;
import io.swagger.annotations.Api;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Description: 首页
* @Author: jeecg-boot
* @Date: 2021-09-24
* @Version: V1.0
*/
@Api(tags="首页")
@RestController
@RequestMapping("/home")
@Slf4j
public class HomeController {
@Autowired
private IPayPaymentRecordService payPaymentRecordService;
/**
* 首页-数据统计
*
* @return
*/
@ApiOperation(value="首页-数据统计", notes="首页-数据统计")
@GetMapping(value = "/dataStatistics")
public Result<?> dataStatistics() {
return null;
}
}
@@ -0,0 +1,69 @@
package com.jero.home.controller;
import com.jero.common.api.vo.Result;
import com.jero.home.vo.DataStatisticsVO;
import com.jero.mail.service.IPayMailBillService;
import com.jero.payment.service.IPayPaymentRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Objects;
/**
* @Description: 首页
* @Author: jeecg-boot
* @Date: 2021-09-24
* @Version: V1.0
*/
@Api(tags="首页")
@RestController
@RequestMapping("/home")
@Slf4j
public class HomeController {
@Resource
private IPayPaymentRecordService payPaymentRecordService;
@Resource
private IPayMailBillService payMailBillService;
/**
* 首页-数据统计
*
* @return
*/
@ApiOperation(value="首页-数据统计", notes="首页-数据统计")
@GetMapping(value = "/dataStatistics")
public Result<?> dataStatistics() {
DataStatisticsVO dataStatisticsVO = new DataStatisticsVO();
DateTimeFormatter formatters = DateTimeFormatter.ofPattern("yyyy-MM");
LocalDate today = LocalDate.now();
// 本月
String d1 = formatters.format(today);
// 上月
String d2 = formatters.format(today.minusMonths(1));
// 本月应收总额
BigDecimal b1 = payPaymentRecordService.getMonthAmountCount(d1);
if(Objects.isNull(b1)){
b1 = new BigDecimal("0.00");
}
// 上月应收总额
BigDecimal b2 = payPaymentRecordService.getMonthAmountCount(d2);
if(Objects.isNull(b2)){
b2 = new BigDecimal("0.00");
}
dataStatisticsVO.setNowMonthAddAmount(b1.subtract(b2));
dataStatisticsVO.setNowMonthAmount(b1.divide(new BigDecimal("10000")));
int m = payMailBillService.getMonthMailCount(d1);
dataStatisticsVO.setNowMonthMail(m);
return Result.OK(dataStatisticsVO);
}
}
@@ -0,0 +1,33 @@
package com.jero.home.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.DecimalMax;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class DataStatisticsVO implements Serializable {
/**
* 本月新增收款项
*/
@ApiModelProperty(value = "本月新增收款项")
@DecimalMax(value = "9999999999.99",message = "本月新增收款项格式错误")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal nowMonthAddAmount;
/**
* 本月到账(万元)
*/
@ApiModelProperty(value = "本月到账(万元)")
@DecimalMax(value = "9999999999.99",message = "本月到账(万元)格式错误")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal nowMonthAmount;
/**
* 本月邮寄项
*/
@ApiModelProperty(value = "本月邮寄项")
private Integer nowMonthMail;
}