zhc4dev
喻忠伟 2 years ago
parent 3a92312db1
commit 58f1e7e858
  1. 2
      jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
  2. 1
      jeecg-boot/jeecg-boot-module-orderbymakeclothplan/src/main/java/org/jeecg/modules/orderbymakeclothplan/service/impl/ZyOrderServiceImpl.java
  3. 6
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/IZyOrdersService.java
  4. 56
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java
  5. 64
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/LargeScreenController.java

@ -126,6 +126,8 @@ public class ShiroConfig {
//店铺管理 //店铺管理
filterChainDefinitionMap.put("/zyShop/shopInfo/**","anon"); filterChainDefinitionMap.put("/zyShop/shopInfo/**","anon");
filterChainDefinitionMap.put("/zyShopOrder/shopOrder/**","anon"); filterChainDefinitionMap.put("/zyShopOrder/shopOrder/**","anon");
//大屏数据
filterChainDefinitionMap.put("/largeScreen/**","anon");
//人员管理 //人员管理
filterChainDefinitionMap.put("/zyPerson/**","anon"); filterChainDefinitionMap.put("/zyPerson/**","anon");

@ -25,6 +25,7 @@ import java.util.*;
@Service @Service
public class ZyOrderServiceImpl implements ZyOrderService { public class ZyOrderServiceImpl implements ZyOrderService {
//虚假订单
@Autowired @Autowired
private ZyOrderMapper zyOrderMapper; private ZyOrderMapper zyOrderMapper;

@ -4,6 +4,8 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/** /**
* @Description: 订单基本信息管理 * @Description: 订单基本信息管理
* @Author: jeecg-boot * @Author: jeecg-boot
@ -12,4 +14,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface IZyOrdersService extends IService<ZyOrders> { public interface IZyOrdersService extends IService<ZyOrders> {
//大屏数据-获取订单的状态
List<ZyOrders> getOrderStatus();
//大屏数据-获取历史订单
List<ZyOrders> getOldOrder();
} }

@ -1,5 +1,6 @@
package org.jeecg.modules.demo.zyorders.service.impl; 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.entity.ZyOrders;
import org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper; import org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper;
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; 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 com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
/** /**
* @Description: 订单基本信息管理 * @Description: 订单基本信息管理
* @Author: jeecg-boot * @Author: jeecg-boot
@ -16,4 +22,54 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service @Service
public class ZyOrdersServiceImpl extends ServiceImpl<ZyOrdersMapper, ZyOrders> implements IZyOrdersService { public class ZyOrdersServiceImpl extends ServiceImpl<ZyOrdersMapper, ZyOrders> implements IZyOrdersService {
/**
* 大屏数据-获取订单的状态
* @return
*/
@Override
public List<ZyOrders> 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<ZyOrders> wrapper = new QueryWrapper<>();
wrapper.ge("create_time", starTime).le("create_time", endTime).eq("pay_status", 1);
List<ZyOrders> zyOrderList = baseMapper.selectList(wrapper);
return zyOrderList;
}
/**
* 大屏数据-获取历史订单
* @return
*/
@Override
public List<ZyOrders> getOldOrder() {
QueryWrapper<ZyOrders> wrapper = new QueryWrapper<>();
wrapper.eq("is_delete", 0).orderByDesc("create_time");
List<ZyOrders> orderList = baseMapper.selectList(wrapper);
return orderList;
}
} }

@ -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<ZyOrders> 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<ZyOrders> orderList = zyOrdersService.getOldOrder();
if (!orderList.isEmpty()){
return Result.OK("查询成功!", orderList);
}else {
return Result.error("获取订单失败!");
}
}
}
Loading…
Cancel
Save