2023-06-20-01-bug

master
喻忠伟 1 year ago
parent 3ff3e9426b
commit 658e7e6349
  1. 48
      ant-design-vue-jeecg/src/utils/util.js
  2. 6
      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. 15
      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. 1
      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. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/ISysDepartService.java

@ -1,7 +1,7 @@
import * as api from '@/api/api'
import { isURL } from '@/utils/validate'
//YU-优化
import onlineCommons from '@jeecg/antd-online-mini'
// import onlineCommons from '@jeecg/antd-online-mini'
export function timeFix() {
const time = new Date()
@ -116,29 +116,29 @@ function generateChildRouters (data) {
item.meta.url = URL;
}
//YU-优化
//let componentPath=resolve => require(['@/' + component+'.vue'], resolve)
let componentPath
if(item.component=="modules/online/cgform/OnlCgformHeadList"){
componentPath = onlineCommons.OnlCgformHeadList
}else if(item.component=="modules/online/cgform/OnlCgformCopyList"){
componentPath = onlineCommons.OnlCgformCopyList
}else if(item.component=="modules/online/cgform/auto/OnlCgformAutoList"){
componentPath = onlineCommons.OnlCgformAutoList
}else if(item.component=="modules/online/cgform/auto/OnlCgformTreeList"){
componentPath = onlineCommons.OnlCgformTreeList
}else if(item.component=="modules/online/cgform/auto/erp/OnlCgformErpList"){
componentPath = onlineCommons.OnlCgformErpList
}else if(item.component=="modules/online/cgform/auto/tab/OnlCgformTabList"){
componentPath = onlineCommons.OnlCgformTabList
}else if(item.component=="modules/online/cgform/auto/innerTable/OnlCgformInnerTableList"){
componentPath = onlineCommons.OnlCgformInnerTableList
}else if(item.component=="modules/online/cgreport/OnlCgreportHeadList"){
componentPath = onlineCommons.OnlCgreportHeadList
}else if(item.component=="modules/online/cgreport/auto/OnlCgreportAutoList"){
componentPath = onlineCommons.OnlCgreportAutoList
}else{
componentPath = resolve => require(['@/' + component+'.vue'], resolve)
}
let componentPath=resolve => require(['@/' + component+'.vue'], resolve)
// let componentPath
// if(item.component=="modules/online/cgform/OnlCgformHeadList"){
// componentPath = onlineCommons.OnlCgformHeadList
// }else if(item.component=="modules/online/cgform/OnlCgformCopyList"){
// componentPath = onlineCommons.OnlCgformCopyList
// }else if(item.component=="modules/online/cgform/auto/OnlCgformAutoList"){
// componentPath = onlineCommons.OnlCgformAutoList
// }else if(item.component=="modules/online/cgform/auto/OnlCgformTreeList"){
// componentPath = onlineCommons.OnlCgformTreeList
// }else if(item.component=="modules/online/cgform/auto/erp/OnlCgformErpList"){
// componentPath = onlineCommons.OnlCgformErpList
// }else if(item.component=="modules/online/cgform/auto/tab/OnlCgformTabList"){
// componentPath = onlineCommons.OnlCgformTabList
// }else if(item.component=="modules/online/cgform/auto/innerTable/OnlCgformInnerTableList"){
// componentPath = onlineCommons.OnlCgformInnerTableList
// }else if(item.component=="modules/online/cgreport/OnlCgreportHeadList"){
// componentPath = onlineCommons.OnlCgreportHeadList
// }else if(item.component=="modules/online/cgreport/auto/OnlCgreportAutoList"){
// componentPath = onlineCommons.OnlCgreportAutoList
// }else{
// componentPath = resolve => require(['@/' + component+'.vue'], resolve)
// }
let menu = {
path: item.path,

@ -5,6 +5,8 @@ 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;
/**
@ -20,4 +22,8 @@ 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>

@ -5,9 +5,11 @@ 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: 订单基本信息管理
@ -31,4 +33,17 @@ public interface IZyOrdersService extends IService<ZyOrders> {
* @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,6 +317,7 @@ 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;
}

@ -142,4 +142,5 @@ public interface ISysDepartService extends IService<SysDepart>{
* @return
*/
List<SysDepart> queryDeptByPid(String pid);
}

Loading…
Cancel
Save