From 58f1e7e858dd5df58411b95a66254664ebcffad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=88=86=E7=B1=B3=E8=8A=B1?= <417727563@qq.com> Date: Tue, 14 Feb 2023 10:59:44 +0800 Subject: [PATCH] 2023-02-14 --- .../org/jeecg/config/shiro/ShiroConfig.java | 2 + .../pom.xml | 2 +- .../service/impl/ZyOrderServiceImpl.java | 1 + .../zyorders/service/IZyOrdersService.java | 6 ++ .../service/impl/ZyOrdersServiceImpl.java | 56 ++++++++++++++++ .../largeScreen/LargeScreenController.java | 64 +++++++++++++++++++ 6 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/LargeScreenController.java diff --git a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java index 1b3bbfb6..09b7afea 100644 --- a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java +++ b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java @@ -126,6 +126,8 @@ public class ShiroConfig { //店铺管理 filterChainDefinitionMap.put("/zyShop/shopInfo/**","anon"); filterChainDefinitionMap.put("/zyShopOrder/shopOrder/**","anon"); + //大屏数据 + filterChainDefinitionMap.put("/largeScreen/**","anon"); //人员管理 filterChainDefinitionMap.put("/zyPerson/**","anon"); diff --git a/jeecg-boot/jeecg-boot-module-orderbymakeclothplan/pom.xml b/jeecg-boot/jeecg-boot-module-orderbymakeclothplan/pom.xml index bb18ccc7..315d8c9e 100644 --- a/jeecg-boot/jeecg-boot-module-orderbymakeclothplan/pom.xml +++ b/jeecg-boot/jeecg-boot-module-orderbymakeclothplan/pom.xml @@ -54,4 +54,4 @@ jeecg-boot-starter-job --> - + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-orderbymakeclothplan/src/main/java/org/jeecg/modules/orderbymakeclothplan/service/impl/ZyOrderServiceImpl.java b/jeecg-boot/jeecg-boot-module-orderbymakeclothplan/src/main/java/org/jeecg/modules/orderbymakeclothplan/service/impl/ZyOrderServiceImpl.java index eaf6caf7..262002ae 100644 --- a/jeecg-boot/jeecg-boot-module-orderbymakeclothplan/src/main/java/org/jeecg/modules/orderbymakeclothplan/service/impl/ZyOrderServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-orderbymakeclothplan/src/main/java/org/jeecg/modules/orderbymakeclothplan/service/impl/ZyOrderServiceImpl.java @@ -25,6 +25,7 @@ import java.util.*; @Service public class ZyOrderServiceImpl implements ZyOrderService { + //虚假订单 @Autowired private ZyOrderMapper zyOrderMapper; diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/IZyOrdersService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/IZyOrdersService.java index 1ddb16c5..8c48a272 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/IZyOrdersService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/IZyOrdersService.java @@ -4,6 +4,8 @@ import org.jeecg.common.api.vo.Result; import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** * @Description: 订单基本信息管理 * @Author: jeecg-boot @@ -12,4 +14,8 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IZyOrdersService extends IService { + //大屏数据-获取订单的状态 + List getOrderStatus(); + //大屏数据-获取历史订单 + List getOldOrder(); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java index 626e1ff7..00f20319 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java @@ -1,5 +1,6 @@ package org.jeecg.modules.demo.zyorders.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper; import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; @@ -7,6 +8,11 @@ import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + /** * @Description: 订单基本信息管理 * @Author: jeecg-boot @@ -16,4 +22,54 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class ZyOrdersServiceImpl extends ServiceImpl implements IZyOrdersService { + /** + * 大屏数据-获取订单的状态 + * @return + */ + @Override + public List getOrderStatus() { + String starTime; + String endTime; + Date date = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + + String todayStr = formatter.format(date);//今天 + //System.out.println(todayStr); + + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + //把日期往后增加一天.整数往后推,负数往前移动(1:表示明天、-1:表示昨天,0:表示今天) + calendar.add(Calendar.DATE, 1); + //这个时间就是日期往后推一天的结果,明天 + date = calendar.getTime(); + String tomorrowStr = formatter.format(date); + + //System.out.println(tomorrowStr); + + + starTime = todayStr + " 00:00:00"; + endTime = tomorrowStr + " 00:00:00"; + +// System.out.println(starTime); +// System.out.println(endTime); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.ge("create_time", starTime).le("create_time", endTime).eq("pay_status", 1); + + List zyOrderList = baseMapper.selectList(wrapper); + return zyOrderList; + } + + /** + * 大屏数据-获取历史订单 + * @return + */ + @Override + public List getOldOrder() { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("is_delete", 0).orderByDesc("create_time"); + List orderList = baseMapper.selectList(wrapper); + return orderList; + } } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/LargeScreenController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/LargeScreenController.java new file mode 100644 index 00000000..dc654f25 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/LargeScreenController.java @@ -0,0 +1,64 @@ +package org.jeecg.modules.largeScreen; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.modules.demo.zyorders.entity.ZyOrders; +import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author Lee + *下单的时候,直接生成生产订单(zy_make_order)====> 审核生产订单 ==========>通过的话,就生成对应的zy_make_cloth_plan + */ +@Api(tags = "大屏数据") +@RequestMapping("/largeScreen") +@RestController +@Slf4j +public class LargeScreenController { + + + @Autowired + private IZyOrdersService zyOrdersService; + + + /** + * 查询订单的状态 + * + * @return + */ + @AutoLog (value = "获取订单的状态") + @ApiOperation(value = "获取订单的状态", notes = "获取订单的状态") + @GetMapping("/getOrderStatus") + public Result getOrderStatus() { + List zyOrderList = zyOrdersService.getOrderStatus(); + if (!zyOrderList.isEmpty()) + { + return Result.OK("查询成功!", zyOrderList); + } + else + { + return Result.error("今天没有生成订单!"); + } + + } + + @AutoLog(value = "获取历史订单") + @ApiOperation(value = "获取历史订单", notes = "获取历史订单") + @GetMapping("/getOldOrder") + public Result getOldOrder() { + List orderList = zyOrdersService.getOldOrder(); + if (!orderList.isEmpty()){ + return Result.OK("查询成功!", orderList); + }else { + return Result.error("获取订单失败!"); + } + } + + +}