|
@@ -77,6 +77,12 @@ public class MonthlyCustomersController {
|
|
|
*/
|
|
|
@RequestMapping("/customersQuery")
|
|
|
public R queryMonthlyCustomers(@RequestParam("startMonth") String startMonth, @RequestParam("endMonth") String endMonth) {
|
|
|
+ if (Objects.isNull(startMonth) || "".equals(startMonth)){
|
|
|
+ return R.error("请先选择开始时间");
|
|
|
+ }
|
|
|
+ if (Objects.isNull(endMonth) || "".equals(endMonth)){
|
|
|
+ return R.error("请先选择结束时间");
|
|
|
+ }
|
|
|
List<String> dateList = new ArrayList<>();
|
|
|
Map<String, Object> returnMap = new HashMap<>();
|
|
|
try {
|
|
@@ -199,7 +205,12 @@ public class MonthlyCustomersController {
|
|
|
*/
|
|
|
@RequestMapping("/top10ForProduct")
|
|
|
public R top10ForProduct(@RequestParam("month") String month, @RequestParam("week") String week){
|
|
|
-
|
|
|
+ if (Objects.isNull(month) || "".equals(month)){
|
|
|
+ return R.error("请先选择开始时间");
|
|
|
+ }
|
|
|
+ if (Objects.isNull(week) || "".equals(week)){
|
|
|
+ return R.error("请先选择结束时间");
|
|
|
+ }
|
|
|
String merchSn = null;
|
|
|
SysUserEntity sysUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
|
|
|
if(!"1".equals(sysUser.getRoleType())){
|
|
@@ -221,7 +232,12 @@ public class MonthlyCustomersController {
|
|
|
@RequestMapping("/top10ByBrandAndSupplier")
|
|
|
public R top10ByBrandAndSupplier(@RequestParam("startDate") String startDate,
|
|
|
@RequestParam("endDate") String endDate){
|
|
|
-
|
|
|
+ if (Objects.isNull(startDate) || "".equals(startDate)){
|
|
|
+ return R.error("请先选择开始时间");
|
|
|
+ }
|
|
|
+ if (Objects.isNull(endDate) || "".equals(endDate)){
|
|
|
+ return R.error("请先选择结束时间");
|
|
|
+ }
|
|
|
String merchSn = null;
|
|
|
SysUserEntity sysUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
|
|
|
if(!"1".equals(sysUser.getRoleType())){
|
|
@@ -236,7 +252,12 @@ public class MonthlyCustomersController {
|
|
|
@RequestMapping("/top10ByBrandAndSupplierExport")
|
|
|
public R top10ByBrandAndSupplierExport(@RequestParam("startDate") String startDate,
|
|
|
@RequestParam("endDate") String endDate, HttpServletResponse response, HttpServletRequest request){
|
|
|
-
|
|
|
+ if (Objects.isNull(startDate) || "".equals(startDate)){
|
|
|
+ return R.error("请先选择开始时间");
|
|
|
+ }
|
|
|
+ if (Objects.isNull(endDate) || "".equals(endDate)){
|
|
|
+ return R.error("请先选择结束时间");
|
|
|
+ }
|
|
|
String merchSn = null;
|
|
|
SysUserEntity sysUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
|
|
|
if(!"1".equals(sysUser.getRoleType())){
|
|
@@ -296,7 +317,12 @@ public class MonthlyCustomersController {
|
|
|
*/
|
|
|
@RequestMapping("/customersQueryByWeek")
|
|
|
public R queryWeeklyCustomers(@RequestParam("startWeek") String startWeek, @RequestParam("endWeek") String endWeek) throws ParseException {
|
|
|
-
|
|
|
+ if (Objects.isNull(startWeek) || "".equals(startWeek)){
|
|
|
+ return R.error("请先选择开始时间");
|
|
|
+ }
|
|
|
+ if (Objects.isNull(endWeek) || "".equals(endWeek)){
|
|
|
+ return R.error("请先选择结束时间");
|
|
|
+ }
|
|
|
List<String> dateList = new ArrayList<>();
|
|
|
try {
|
|
|
calculateDifferentWeek(dateList, startWeek, endWeek);
|
|
@@ -431,6 +457,12 @@ public class MonthlyCustomersController {
|
|
|
*/
|
|
|
@RequestMapping("/queryMonthlyWechatFollowers")
|
|
|
public R queryMonthlyWechatFollowers(@RequestParam("startMonth") String startMonth, @RequestParam("endMonth") String endMonth) {
|
|
|
+ if (Objects.isNull(startMonth) || "".equals(startMonth)){
|
|
|
+ return R.error("请先选择开始时间");
|
|
|
+ }
|
|
|
+ if (Objects.isNull(endMonth) || "".equals(endMonth)){
|
|
|
+ return R.error("请先选择结束时间");
|
|
|
+ }
|
|
|
List<String> dateList = new ArrayList<>();
|
|
|
Map<String, Object> returnMap = new HashMap<>();
|
|
|
try {
|
|
@@ -535,7 +567,12 @@ public class MonthlyCustomersController {
|
|
|
*/
|
|
|
@RequestMapping("/salesByCategory")
|
|
|
public R salesByCategory(@RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate){
|
|
|
-
|
|
|
+ if (Objects.isNull(startDate) || "".equals(startDate)){
|
|
|
+ return R.error("请先选择开始时间");
|
|
|
+ }
|
|
|
+ if (Objects.isNull(endDate) || "".equals(endDate)){
|
|
|
+ return R.error("请先选择结束时间");
|
|
|
+ }
|
|
|
String merchSn = null;
|
|
|
SysUserEntity sysUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
|
|
|
if(!"1".equals(sysUser.getRoleType())){
|
|
@@ -553,6 +590,12 @@ public class MonthlyCustomersController {
|
|
|
*/
|
|
|
@RequestMapping("/monthlyCategory")
|
|
|
public R monthlyCategory(@RequestParam("startMonth") String startMonth, @RequestParam("endMonth") String endMonth) {
|
|
|
+ if (Objects.isNull(startMonth) || "".equals(startMonth)){
|
|
|
+ return R.error("请先选择开始时间");
|
|
|
+ }
|
|
|
+ if (Objects.isNull(endMonth) || "".equals(endMonth)){
|
|
|
+ return R.error("请先选择结束时间");
|
|
|
+ }
|
|
|
List<String> dateList = new ArrayList<>();
|
|
|
Map<String, Object> returnMap = new HashMap<>();
|
|
|
try {
|