2023-06-20-01-bug

master
喻忠伟 1 year ago
parent 3ff3e9426b
commit 658e7e6349
  1. 1126
      ant-design-vue-jeecg/src/utils/util.js
  2. 52
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/mapper/ZyOrdersMapper.java
  3. 28
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/mapper/xml/ZyOrdersMapper.xml
  4. 83
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/IZyOrdersService.java
  5. 109
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java
  6. 24
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/vo/ZyNameAndPayMoney.java
  7. 13
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/vo/ZyOrderPayAndTime.java
  8. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/impl/HangerLocationServiceImpl.java
  9. 28
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/controller/LargeScreenController.java
  10. 11
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/vo/Type.java
  11. 12
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/vo/ZyShopSales.java
  12. 291
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysDepartService.java
  13. 1160
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysDepartServiceImpl.java

File diff suppressed because it is too large Load Diff

@ -1,23 +1,29 @@
package org.jeecg.modules.demo.zyorders.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo;
/**
* @Description: 订单基本信息管理
* @Author: jeecg-boot
* @Date: 2022-12-26
* @Version: V1.0
*/
public interface ZyOrdersMapper extends BaseMapper<ZyOrders> {
/**
* 获取今日订单及七日订单
* @return
*/
TodayOrderAndQIriVo getTotalOrderAndWeek();
}
package org.jeecg.modules.demo.zyorders.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.demo.zyorders.vo.ZyNameAndPayMoney;
import org.jeecg.modules.demo.zyorders.vo.ZyOrderPayAndTime;
import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo;
/**
* @Description: 订单基本信息管理
* @Author: jeecg-boot
* @Date: 2022-12-26
* @Version: V1.0
*/
public interface ZyOrdersMapper extends BaseMapper<ZyOrders> {
/**
* 获取今日订单及七日订单
* @return
*/
TodayOrderAndQIriVo getTotalOrderAndWeek();
List<ZyNameAndPayMoney> selectAllShopSalesVolumeByLastM( @Param("start_time") String start_time,@Param("end_time") String end_time,@Param("org_code") String org_code);
List<ZyOrderPayAndTime> selectCurrentSales(@Param("id")String id, @Param("start_time")String start_time, @Param("end_time")String end_time);
}

@ -18,4 +18,32 @@
WHERE
DATE_SUB( CURDATE(), INTERVAL 7 DAY ) &lt;= DATE( payment_time ) and payment_status=1 and ischild=0 ) b)
</select>
<!--查询所有店铺上月销售额 -->
<select id="selectAllShopSalesVolumeByLastM" resultType="org.jeecg.modules.demo.zyorders.vo.ZyNameAndPayMoney">
SELECT dep.depart_name as name,(order_goods.goods_num*order_goods.unit_price) AS total_money FROM
zy_orders AS orders
LEFT JOIN order_goods ON order_goods.orders_id=orders.id
LEFT JOIN zy_goods AS goods ON goods.id=order_goods.goods_id
LEFT JOIN sys_depart AS dep ON dep.id=goods.enterprises_id
<where>
orders.ischild=1 and dep.org_category=#{org_code}
AND orders.payment_time BETWEEN #{start_time} AND #{end_time}
</where>
</select>
<!-- 查询店铺12月销售额 -->
<select id="selectCurrentSales" resultType="org.jeecg.modules.demo.zyorders.vo.ZyOrderPayAndTime">
SELECT orders.payment_time as pay_time,(order_goods.goods_num*order_goods.unit_price) AS total_money FROM
zy_orders AS orders
LEFT JOIN order_goods ON order_goods.orders_id=orders.id
LEFT JOIN zy_goods AS goods ON goods.id=order_goods.goods_id
LEFT JOIN sys_depart AS dep ON dep.id=goods.enterprises_id
<where>
orders.ischild=1 and dep.id=#{id}
AND orders.payment_time BETWEEN #{start_time} AND #{end_time}
</where>
</select>
</mapper>

@ -1,34 +1,49 @@
package org.jeecg.modules.demo.zyorders.service;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.ordergoods.entity.OrderGoodsJk;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.demo.zyorders.entity.ZyOrdersJk;
import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo;
import java.util.List;
/**
* @Description: 订单基本信息管理
* @Author: jeecg-boot
* @Date: 2022-12-26
* @Version: V1.0
*/
public interface IZyOrdersService extends IService<ZyOrders> {
//大屏数据-获取订单的状态
List<ZyOrders> getOrderStatus();
//大屏数据-获取历史订单
List<ZyOrders> getOldOrder();
//大屏数据-获取今日订单及七日订单
TodayOrderAndQIriVo getOrder();
/**
*订单和订单商品接口
* @param ordersJk
* @param ogjkList
* @return
*/
List<String> orderJk(ZyOrdersJk ordersJk, List<OrderGoodsJk> ogjkList);
}
package org.jeecg.modules.demo.zyorders.service;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.ordergoods.entity.OrderGoodsJk;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.demo.zyorders.entity.ZyOrdersJk;
import org.jeecg.modules.largeScreen.vo.Type;
import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo;
import java.util.List;
import java.util.Map;
/**
* @Description: 订单基本信息管理
* @Author: jeecg-boot
* @Date: 2022-12-26
* @Version: V1.0
*/
public interface IZyOrdersService extends IService<ZyOrders> {
//大屏数据-获取订单的状态
List<ZyOrders> getOrderStatus();
//大屏数据-获取历史订单
List<ZyOrders> getOldOrder();
//大屏数据-获取今日订单及七日订单
TodayOrderAndQIriVo getOrder();
/**
*订单和订单商品接口
* @param ordersJk
* @param ogjkList
* @return
*/
List<String> orderJk(ZyOrdersJk ordersJk, List<OrderGoodsJk> ogjkList);
/**
*
* @param org_code 店铺类型
* @return
*/
List<Map.Entry<String, Integer>> selectAllShopSalesVolumeByLastM(String org_code);
/**
*查询所有店铺前十二个月的月销售额
* @return
*/
List<Type> getsales12Month();
}

@ -28,19 +28,24 @@ import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import org.jeecg.modules.demo.zyorders.entity.ZyOrdersJk;
import org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper;
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService;
import org.jeecg.modules.demo.zyorders.vo.ZyNameAndPayMoney;
import org.jeecg.modules.demo.zyorders.vo.ZyOrderPayAndTime;
import org.jeecg.modules.largeScreen.vo.Type;
import org.jeecg.modules.largeScreen.vo.ZyShopSales;
import org.jeecg.modules.message.entity.ZySpeechMessage;
import org.jeecg.modules.message.mapper.ZySpeechMessageMapper;
import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo;
import org.jeecg.modules.shop.utils.GetTime;
import org.jeecg.modules.shop.utils.mapSort;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.service.ISysDepartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -105,6 +110,10 @@ public class ZyOrdersServiceImpl extends ServiceImpl<ZyOrdersMapper, ZyOrders> i
@Autowired
private IZyClothsTypeService zyClothsTypeService;
//店铺/部门
@Autowired
private ISysDepartService sysDepartService;
/**
* 大屏数据-获取订单的状态
*
@ -343,6 +352,98 @@ public class ZyOrdersServiceImpl extends ServiceImpl<ZyOrdersMapper, ZyOrders> i
return ids;
}
@Override
public List<Map.Entry<String, Integer>> selectAllShopSalesVolumeByLastM(String org_code) {
Map<String, Integer> map = new HashMap<>();
String beginOfMonth = GetTime.beginOfMonth();
String endOfMonth = GetTime.endOfMonth();
List<ZyNameAndPayMoney> list = baseMapper.selectAllShopSalesVolumeByLastM(beginOfMonth, endOfMonth,org_code);
//将list转换成map,同时将所有相同店铺名称的销售额相加
if (list.isEmpty()) {
return null;
} else {
map.put(list.get(0).getName(), list.get(0).getTotalMoney());
}
for (int i = 1; i < list.size(); i++) {
if (map.containsKey(list.get(i).getName())) {
int y = map.get(list.get(i).getName()) + list.get(i).getTotalMoney();
map.put(list.get(i).getName(), y);
} else {
map.put(list.get(i).getName(), list.get(i).getTotalMoney());
}
}
List<Map.Entry<String, Integer>> list1 = mapSort.sortMapByValue(map);
return list1;
}
/**
* 查询所有店铺前十二个月的月销售额
* @return
*/
@Override
public List<Type> getsales12Month() {
Calendar calendar = Calendar.getInstance();
String start_time = GetTime.getLastTwelveMonths();
String end_time = GetTime.getLastMonthEnd();
QueryWrapper<SysDepart> depWra=new QueryWrapper();
String[] a3 = {"4","5"};
depWra.in("org_category",a3);
List<SysDepart> depList = sysDepartService.list(depWra);
List<Type> ls = new ArrayList<>();
for (int i = 0; i < depList.size(); i++) {
SysDepart item = depList.get(i);
Type type = new Type();
List<ZyOrderPayAndTime> list = baseMapper.selectCurrentSales(item.getId(), start_time, end_time);
HashMap<Integer, Integer> map1 = new HashMap<>();
List<ZyShopSales> salesList = new ArrayList<>();
int lastmonths = calendar.get(Calendar.MONTH);
int lastTwelveMonths = 12 - (12 - lastmonths) + 1;
for (int sw = lastTwelveMonths; sw <= 12; sw++) {
ZyShopSales zyShopSales = new ZyShopSales();
zyShopSales.setMonthDay(sw);
zyShopSales.setMoney(0);
salesList.add(zyShopSales);
}
for (int ws = 1; ws <= lastmonths; ws++) {
ZyShopSales zyShopSales = new ZyShopSales();
zyShopSales.setMonthDay(ws);
zyShopSales.setMoney(0);
salesList.add(zyShopSales);
}
if (!list.isEmpty()) {
Integer totalMoney = list.get(0).getTotalMoney();
Date payTime1 = list.get(0).getPayTime();
String format1 = String.format("%tm", payTime1);
int b = Integer.parseInt(format1);
map1.put(b, totalMoney);
}
for (int j = 1; j < list.size(); j++) {
Date payTime = list.get(j).getPayTime();
String format = String.format("%tm", payTime);
int a = Integer.parseInt(format);
if (map1.containsKey(a)) {
int money = map1.get(a) + list.get(j).getTotalMoney();
map1.put(a, money);
} else {
map1.put(a, list.get(j).getTotalMoney());
}
}
for (Integer key : map1.keySet()) {
for (int w = 0; w < salesList.size(); w++) {
Integer monthDay = salesList.get(w).getMonthDay();
if (monthDay.equals(key)) {
salesList.get(w).setMoney(map1.get(key));
}
}
}
type.setName(item.getDepartName());
type.setLs(salesList);
ls.add(type);
}
return ls;
}
/**
* 生成订单编号

@ -0,0 +1,24 @@
package org.jeecg.modules.demo.zyorders.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="ZyShopNameAndPayMoney对象", description="ZyShopNameAndPayMoney对象")
public class ZyNameAndPayMoney {
/**店名*/
@Excel(name = "店名", width = 15)
@ApiModelProperty(value = "店名")
private String name;
//金额
@Excel(name = "金额", width = 15)
@ApiModelProperty(value = "金额")
private Integer totalMoney;
}

@ -0,0 +1,13 @@
package org.jeecg.modules.demo.zyorders.vo;
import lombok.Data;
import java.util.Date;
@Data
public class ZyOrderPayAndTime {
private Integer totalMoney;
private Date payTime;
}

@ -317,8 +317,9 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
public void records(String id, String code) {
//根据衣架查找工单
//根据传感器查找工位
//
}

@ -13,6 +13,7 @@ import org.jeecg.modules.demo.ordergoods.service.IOrderGoodsService;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService;
import org.jeecg.modules.largeScreen.vo.LargeOrderVo;
import org.jeecg.modules.largeScreen.vo.Type;
import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo;
import org.jeecg.modules.shop.vo.OrderSales;
import org.jeecg.modules.system.entity.SysDepart;
@ -57,7 +58,7 @@ public class LargeScreenController {
@Autowired
private IZyStyleModuleService zyStyleModuleService;
//部门
@Autowired
private ISysDepartService sysDepartService;
@ -198,5 +199,30 @@ public class LargeScreenController {
return Result.OK(vo);
}
@AutoLog(value = "查询门店店铺本月销售额")
@ApiOperation(value = "查询门店店铺本月销售额", notes = "查询门店店铺本月销售额")
@GetMapping("/selectAllShopSalesVolumeByThisD")
public Result<?> selectAllShopSalesVolumeByThisD() {
List list = zyOrdersService.selectAllShopSalesVolumeByLastM("4");
return Result.OK(list);
}
@AutoLog(value = "查询网店店铺本月销售额")
@ApiOperation(value = "查询网店店铺本月销售额", notes = "查询网店店铺本月销售额")
@GetMapping("/selectAllShopSalesVolumeByThisW")
public Result<?> selectAllShopSalesVolumeByThisW() {
List list = zyOrdersService.selectAllShopSalesVolumeByLastM("5");
return Result.OK(list);
}
@AutoLog(value = "查询所有店铺前十二个月的月销售额")
@ApiOperation(value = "查询所有店铺前十二个月的月销售额", notes = "查询所有店铺前十二个月的月销售额")
@GetMapping("/getsales12Month")
public Result<?> getsales12Month() {
List<Type> list = zyOrdersService.getsales12Month();
if (list.isEmpty()){
return Result.OK("未查询到结果");
}
return Result.OK(list);
}
}

@ -0,0 +1,11 @@
package org.jeecg.modules.largeScreen.vo;
import lombok.Data;
import java.util.List;
@Data
public class Type {
private String name;
List<ZyShopSales> ls;
}

@ -0,0 +1,12 @@
package org.jeecg.modules.largeScreen.vo;
import lombok.Data;
@Data
public class ZyShopSales {
private Integer monthDay;
private Integer money;
}

@ -1,145 +1,146 @@
package org.jeecg.modules.system.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.model.DepartIdModel;
import org.jeecg.modules.system.model.SysDepartTreeModel;
import java.util.List;
/**
* <p>
* 部门表 服务实现类
* <p>
*
* @Author:Steve
* @Since 2019-01-22
*/
public interface ISysDepartService extends IService<SysDepart>{
/**
* 查询我的部门信息,并分节点进行显示
* @return
*/
List<SysDepartTreeModel> queryMyDeptTreeList(String departIds);
/**
* 查询所有部门信息,并分节点进行显示
* @return
*/
List<SysDepartTreeModel> queryTreeList();
/**
* 查询所有部门信息,并分节点进行显示
* @return
*/
List<SysDepartTreeModel> queryTreeList1();
/**
* 查询所有部门DepartId信息,并分节点进行显示
* @return
*/
public List<DepartIdModel> queryDepartIdTreeList();
/**
* 保存部门数据
* @param sysDepart
*/
void saveDepartData(SysDepart sysDepart,String username);
/**
* 更新depart数据
* @param sysDepart
* @return
*/
Boolean updateDepartDataById(SysDepart sysDepart,String username);
/**
* 删除depart数据
* @param id
* @return
*/
/* boolean removeDepartDataById(String id); */
/**
* 根据关键字搜索相关的部门数据
* @param keyWord
* @return
*/
List<SysDepartTreeModel> searhBy(String keyWord,String myDeptSearch,String departIds);
/**
* 根据部门id删除并删除其可能存在的子级部门
* @param id
* @return
*/
boolean delete(String id);
/**
* 查询SysDepart集合
* @param userId
* @return
*/
public List<SysDepart> queryUserDeparts(String userId);
/**
* 根据用户名查询部门
*
* @param username
* @return
*/
List<SysDepart> queryDepartsByUsername(String username);
/**
* 根据部门id批量删除并删除其可能存在的子级部门
* @param id
* @return
*/
void deleteBatchWithChildren(List<String> ids);
/**
* 根据部门Id查询,当前和下级所有部门IDS
* @param departId
* @return
*/
List<String> getSubDepIdsByDepId(String departId);
/**
* 获取我的部门下级所有部门IDS
* @return
*/
List<String> getMySubDepIdsByDepId(String departIds);
/**
* 根据关键字获取部门信息通讯录
* @return
*/
List<SysDepartTreeModel> queryTreeByKeyWord(String keyWord);
/**
* 获取我的部门下级所有部门
* @return
*/
List<SysDepartTreeModel> queryTreeListByPid(String parentId);
/**
* 获取某个部门的所有父级部门的ID
*
* @param departId 根据departId查
*/
JSONObject queryAllParentIdByDepartId(String departId);
/**
* 获取某个部门的所有父级部门的ID
*
* @param orgCode 根据orgCode查
*/
JSONObject queryAllParentIdByOrgCode(String orgCode);
/**
* 获取公司信息
* @return
*/
SysDepart queryCompByOrgCode(String orgCode);
/**
* 获取下级部门
* @return
*/
List<SysDepart> queryDeptByPid(String pid);
}
package org.jeecg.modules.system.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.model.DepartIdModel;
import org.jeecg.modules.system.model.SysDepartTreeModel;
import java.util.List;
/**
* <p>
* 部门表 服务实现类
* <p>
*
* @Author:Steve
* @Since 2019-01-22
*/
public interface ISysDepartService extends IService<SysDepart>{
/**
* 查询我的部门信息,并分节点进行显示
* @return
*/
List<SysDepartTreeModel> queryMyDeptTreeList(String departIds);
/**
* 查询所有部门信息,并分节点进行显示
* @return
*/
List<SysDepartTreeModel> queryTreeList();
/**
* 查询所有部门信息,并分节点进行显示
* @return
*/
List<SysDepartTreeModel> queryTreeList1();
/**
* 查询所有部门DepartId信息,并分节点进行显示
* @return
*/
public List<DepartIdModel> queryDepartIdTreeList();
/**
* 保存部门数据
* @param sysDepart
*/
void saveDepartData(SysDepart sysDepart,String username);
/**
* 更新depart数据
* @param sysDepart
* @return
*/
Boolean updateDepartDataById(SysDepart sysDepart,String username);
/**
* 删除depart数据
* @param id
* @return
*/
/* boolean removeDepartDataById(String id); */
/**
* 根据关键字搜索相关的部门数据
* @param keyWord
* @return
*/
List<SysDepartTreeModel> searhBy(String keyWord,String myDeptSearch,String departIds);
/**
* 根据部门id删除并删除其可能存在的子级部门
* @param id
* @return
*/
boolean delete(String id);
/**
* 查询SysDepart集合
* @param userId
* @return
*/
public List<SysDepart> queryUserDeparts(String userId);
/**
* 根据用户名查询部门
*
* @param username
* @return
*/
List<SysDepart> queryDepartsByUsername(String username);
/**
* 根据部门id批量删除并删除其可能存在的子级部门
* @param id
* @return
*/
void deleteBatchWithChildren(List<String> ids);
/**
* 根据部门Id查询,当前和下级所有部门IDS
* @param departId
* @return
*/
List<String> getSubDepIdsByDepId(String departId);
/**
* 获取我的部门下级所有部门IDS
* @return
*/
List<String> getMySubDepIdsByDepId(String departIds);
/**
* 根据关键字获取部门信息通讯录
* @return
*/
List<SysDepartTreeModel> queryTreeByKeyWord(String keyWord);
/**
* 获取我的部门下级所有部门
* @return
*/
List<SysDepartTreeModel> queryTreeListByPid(String parentId);
/**
* 获取某个部门的所有父级部门的ID
*
* @param departId 根据departId查
*/
JSONObject queryAllParentIdByDepartId(String departId);
/**
* 获取某个部门的所有父级部门的ID
*
* @param orgCode 根据orgCode查
*/
JSONObject queryAllParentIdByOrgCode(String orgCode);
/**
* 获取公司信息
* @return
*/
SysDepart queryCompByOrgCode(String orgCode);
/**
* 获取下级部门
* @return
*/
List<SysDepart> queryDeptByPid(String pid);
}

Loading…
Cancel
Save