From a1aff53bf391f645d14ac0726e929b7cf3a9d139 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=88=86=E7=B1=B3=E8=8A=B1?= <417727563@qq.com> Date: Thu, 27 Apr 2023 16:44:36 +0800 Subject: [PATCH] 2023-04-27 --- .../ZyProductionOrderList.vue | 928 +++++++++--------- .../controller/ZyOrderController.java | 2 +- .../service/impl/ZyOrderServiceImpl.java | 16 +- .../shop/Service/impl/ZyShopServiceImpl.java | 4 +- .../modules/shop/mapper/xml/ZyShopMapper.xml | 6 +- .../demo/zyorders/entity/ZyOrders.java | 412 ++++---- .../zyorders/mapper/xml/ZyOrdersMapper.xml | 42 +- .../service/impl/ZyOrdersServiceImpl.java | 682 +++++++------ .../largeScreen/LargeScreenController.java | 27 + 9 files changed, 1065 insertions(+), 1054 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/zyWorkorderManagement/ZyProductionOrderList.vue b/ant-design-vue-jeecg/src/views/zyWorkorderManagement/ZyProductionOrderList.vue index d88bc2aa..8fdccd14 100644 --- a/ant-design-vue-jeecg/src/views/zyWorkorderManagement/ZyProductionOrderList.vue +++ b/ant-design-vue-jeecg/src/views/zyWorkorderManagement/ZyProductionOrderList.vue @@ -1,465 +1,465 @@ - - - - \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-orderbymakeclothplan/src/main/java/org/jeecg/modules/orderbymakeclothplan/controller/ZyOrderController.java b/jeecg-boot/jeecg-boot-module-orderbymakeclothplan/src/main/java/org/jeecg/modules/orderbymakeclothplan/controller/ZyOrderController.java index 805df17e..ff69acde 100644 --- a/jeecg-boot/jeecg-boot-module-orderbymakeclothplan/src/main/java/org/jeecg/modules/orderbymakeclothplan/controller/ZyOrderController.java +++ b/jeecg-boot/jeecg-boot-module-orderbymakeclothplan/src/main/java/org/jeecg/modules/orderbymakeclothplan/controller/ZyOrderController.java @@ -238,7 +238,7 @@ public class ZyOrderController { @ApiOperation(value = "获取完成订单的百分比", notes = "获取完成订单的百分比") @GetMapping("/percentageProduction") public Result percentageProduction() { - Double percent = orderService.percentageProduction(); + Double percent = orderService.percentageProduction(); return Result.OK(percent); } 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 8efc678d..b8e720d5 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 @@ -66,11 +66,8 @@ public class ZyOrderServiceImpl implements ZyOrderService { String endTime; Date date = new Date(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); - String todayStr = formatter.format(date);//今天 - System.out.println(todayStr); - - + //System.out.println(todayStr); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); //把日期往后增加一天.整数往后推,负数往前移动(1:表示明天、-1:表示昨天,0:表示今天) @@ -78,16 +75,11 @@ public class ZyOrderServiceImpl implements ZyOrderService { //这个时间就是日期往后推一天的结果,明天 date = calendar.getTime(); String tomorrowStr = formatter.format(date); - - System.out.println(tomorrowStr); - - + //System.out.println(tomorrowStr); starTime = todayStr + " 00:00:00"; endTime = tomorrowStr + " 00:00:00"; - - System.out.println(starTime); - System.out.println(endTime); - +// 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); diff --git a/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/Service/impl/ZyShopServiceImpl.java b/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/Service/impl/ZyShopServiceImpl.java index b375e94a..6e9be809 100644 --- a/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/Service/impl/ZyShopServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/Service/impl/ZyShopServiceImpl.java @@ -91,7 +91,7 @@ public class ZyShopServiceImpl implements ZyShopService { @Override public String selectOrderBetweenThisW() { String start_time = GetTime.getLastSevenDay(7); - String end_time = String.format("%tF", date); + String end_time = String.format("%tF", date)+" 23:59:59"; return zyShopMapper.selectOrderBetweenThisW(start_time, end_time); } @@ -103,7 +103,7 @@ public class ZyShopServiceImpl implements ZyShopService { @Override public Double selectSalesVolumeBetweenThisW() { String start_time = GetTime.getLastSevenDay(7); - String end_time = String.format("%tF", date); + String end_time = String.format("%tF", date)+" 23:59:59";; return zyShopMapper.selectSalesVolumeBetweenThisW(start_time, end_time); } diff --git a/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/mapper/xml/ZyShopMapper.xml b/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/mapper/xml/ZyShopMapper.xml index 312b418a..0e029866 100644 --- a/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/mapper/xml/ZyShopMapper.xml +++ b/jeecg-boot/jeecg-boot-module-shop/src/main/java/org/jeecg/modules/shop/mapper/xml/ZyShopMapper.xml @@ -15,7 +15,7 @@ - SELECT total_money FROM zy_order WHERE shop_id = #{id} @@ -23,14 +23,14 @@ - select count(*) from zy_orders where payment_time BETWEEN #{start_time} AND #{end_time} AND ischild=0 - SELECT sum(money) as total_money FROM zy_orders WHERE payment_time between #{start_time} and #{end_time} AND ischild=0 diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrders.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrders.java index 930cf595..636a3e39 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrders.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrders.java @@ -1,206 +1,206 @@ -package org.jeecg.modules.demo.zyorders.entity; - -import java.io.Serializable; -import java.io.UnsupportedEncodingException; -import java.util.Date; -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import org.jeecgframework.poi.excel.annotation.Excel; -import org.jeecg.common.aspect.annotation.Dict; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - * @Description: 订单基本信息管理 - * @Author: jeecg-boot - * @Date: 2022-12-26 - * @Version: V1.0 - */ -@Data -@TableName("zy_orders") -@Accessors(chain = true) -@EqualsAndHashCode(callSuper = false) -@ApiModel(value="zy_orders对象", description="订单基本信息管理") -public class ZyOrders implements Serializable { - private static final long serialVersionUID = 1L; - - /**主键*/ - @TableId(type = IdType.ASSIGN_ID) - @ApiModelProperty(value = "主键") - private java.lang.String id; - /**创建人*/ - @ApiModelProperty(value = "创建人") - private java.lang.String createBy; - /**创建日期*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - @ApiModelProperty(value = "创建日期") - private java.util.Date createTime; - /**更新人*/ - @ApiModelProperty(value = "更新人") - private java.lang.String updateBy; - /**更新日期*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - @ApiModelProperty(value = "更新日期") - private java.util.Date updateTime; - /**所属部门*/ - @ApiModelProperty(value = "所属部门") - private java.lang.String sysOrgCode; - /**是否子单*/ - @Excel(name = "是否子单", width = 15, dicCode = "ischild") - @Dict(dicCode = "ischild") - @ApiModelProperty(value = "是否子单") - private java.lang.Integer ischild; - /**原订单id*/ - @Excel(name = "原订单id", width = 15) - @Dict(dictTable = "zy_orders", dicText = "orders_num", dicCode = "id") - @ApiModelProperty(value = "原订单id") - private java.lang.String orderId; - /**下单时间*/ - @Excel(name = "下单时间", width = 15, format = "yyyy-MM-dd") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern="yyyy-MM-dd") - @ApiModelProperty(value = "下单时间") - private java.util.Date orderTime; - /**订单编号*/ - @Excel(name = "订单编号", width = 15) - @ApiModelProperty(value = "订单编号") - private java.lang.String ordersNum; - /**总金额*/ - @Excel(name = "总金额", width = 15) - @ApiModelProperty(value = "总金额") - private java.lang.Double money; - /**运费*/ - @Excel(name = "运费", width = 15) - @ApiModelProperty(value = "运费") - private java.lang.Double freight; - /**促销*/ - @Excel(name = "促销", width = 15) - @ApiModelProperty(value = "促销") - private java.lang.Double promotionPrice; - /**实付款*/ - @Excel(name = "实付款", width = 15) - @ApiModelProperty(value = "实付款") - private java.lang.Double actualPayment; - /**交货期*/ - @Excel(name = "交货期", width = 15) - @ApiModelProperty(value = "交货期") - private java.lang.Integer deliveryTime; - /**订单类型*/ - @Excel(name = "订单类型", width = 15, dicCode = "orders_type") - @Dict(dicCode = "orders_type") - @ApiModelProperty(value = "订单类型") - private java.lang.Integer ordersType; - /**顾客id*/ - @Excel(name = "顾客id", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") - @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") - @ApiModelProperty(value = "顾客id") - private java.lang.String userId; - /**商品条目数量*/ - @Excel(name = "商品条目数量", width = 15) - @ApiModelProperty(value = "商品条目数量") - private java.lang.Integer goodsQuantity; - /**支付方式*/ - @Excel(name = "支付方式", width = 15, dicCode = "payment_method") - @Dict(dicCode = "payment_method") - @ApiModelProperty(value = "支付方式") - private java.lang.Integer paymentMethod; - /**支付状态*/ - @Excel(name = "支付状态", width = 15, dicCode = "payment_status") - @Dict(dicCode = "payment_status") - @ApiModelProperty(value = "支付状态") - private java.lang.Integer paymentStatus; - /**账号/卡号*/ - @Excel(name = "账号/卡号", width = 15) - @ApiModelProperty(value = "账号/卡号") - private java.lang.String accountNo; - /**开户银行*/ - @Excel(name = "开户银行", width = 15) - @ApiModelProperty(value = "开户银行") - private java.lang.String bankDeposit; - /**支付时间*/ - @Excel(name = "支付时间", width = 15, format = "yyyy-MM-dd") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern="yyyy-MM-dd") - @ApiModelProperty(value = "支付时间") - private java.util.Date paymentTime; - /**城市*/ - @Excel(name = "城市", width = 15) - @ApiModelProperty(value = "城市") - private java.lang.String cityId; - /**地址*/ - @Excel(name = "地址", width = 15) - @ApiModelProperty(value = "地址") - private java.lang.String address; - /**邮编*/ - @Excel(name = "邮编", width = 15) - @ApiModelProperty(value = "邮编") - private java.lang.String zipCode; - /**收货人*/ - @Excel(name = "收货人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") - @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") - @ApiModelProperty(value = "收货人") - private java.lang.String receiver; - /**联系电话*/ - @Excel(name = "联系电话", width = 15) - @ApiModelProperty(value = "联系电话") - private java.lang.String mobile; - /**发票客户类型*/ - @Excel(name = "发票客户类型", width = 15, dicCode = "invoice_customer_type") - @Dict(dicCode = "invoice_customer_type") - @ApiModelProperty(value = "发票客户类型") - private java.lang.Integer invoiceCustomerType; - /**发票类型*/ - @Excel(name = "发票类型", width = 15, dicCode = "invoice_type") - @Dict(dicCode = "invoice_type") - @ApiModelProperty(value = "发票类型") - private java.lang.Integer invoiceType; - /**纳税人识别号*/ - @Excel(name = "纳税人识别号", width = 15) - @ApiModelProperty(value = "纳税人识别号") - private java.lang.String taxIdentificationNumber; - /**开票地址*/ - @Excel(name = "开票地址", width = 15) - @ApiModelProperty(value = "开票地址") - private java.lang.String addressBilling; - /**电话*/ - @Excel(name = "电话", width = 15) - @ApiModelProperty(value = "电话") - private java.lang.String telephone; - /**公户开户行*/ - @Excel(name = "公户开户行", width = 15) - @ApiModelProperty(value = "公户开户行") - private java.lang.String bankPublic; - /**公户账号*/ - @Excel(name = "公户账号", width = 15) - @ApiModelProperty(value = "公户账号") - private java.lang.String accountNumber; - /**销售门店*/ - @Excel(name = "销售门店", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") - @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") - @ApiModelProperty(value = "销售门店") - private java.lang.String salesEnterpriseId; - /**销售员*/ - @Excel(name = "销售员", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") - @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") - @ApiModelProperty(value = "销售员") - private java.lang.String salespersonId; - /**物流企业*/ - @Excel(name = "物流企业", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") - @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") - @ApiModelProperty(value = "物流企业") - private java.lang.String logisticsEnterprisesId; - /**交付状态*/ - @Excel(name = "交付状态", width = 15, dicCode = "delivery_status") - @Dict(dicCode = "delivery_status") - @ApiModelProperty(value = "交付状态") - private java.lang.Integer deliveryStatus; -} +package org.jeecg.modules.demo.zyorders.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 订单基本信息管理 + * @Author: jeecg-boot + * @Date: 2022-12-26 + * @Version: V1.0 + */ +@Data +@TableName("zy_orders") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="zy_orders对象", description="订单基本信息管理") +public class ZyOrders implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private java.lang.String sysOrgCode; + /**是否子单*/ + @Excel(name = "是否子单", width = 15, dicCode = "ischild") + @Dict(dicCode = "ischild") + @ApiModelProperty(value = "是否子单") + private java.lang.Integer ischild; + /**原订单id*/ + @Excel(name = "原订单id", width = 15) + @Dict(dictTable = "zy_orders", dicText = "orders_num", dicCode = "id") + @ApiModelProperty(value = "原订单id") + private java.lang.String orderId; + /**下单时间*/ + @Excel(name = "下单时间", width = 15, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "下单时间") + private java.util.Date orderTime; + /**订单编号*/ + @Excel(name = "订单编号", width = 15) + @ApiModelProperty(value = "订单编号") + private java.lang.String ordersNum; + /**总金额*/ + @Excel(name = "总金额", width = 15) + @ApiModelProperty(value = "总金额") + private java.lang.Double money; + /**运费*/ + @Excel(name = "运费", width = 15) + @ApiModelProperty(value = "运费") + private java.lang.Double freight; + /**促销*/ + @Excel(name = "促销", width = 15) + @ApiModelProperty(value = "促销") + private java.lang.Double promotionPrice; + /**实付款*/ + @Excel(name = "实付款", width = 15) + @ApiModelProperty(value = "实付款") + private java.lang.Double actualPayment; + /**交货期*/ + @Excel(name = "交货期", width = 15) + @ApiModelProperty(value = "交货期") + private java.lang.Integer deliveryTime; + /**订单类型*/ + @Excel(name = "订单类型", width = 15, dicCode = "orders_type") + @Dict(dicCode = "orders_type") + @ApiModelProperty(value = "订单类型") + private java.lang.Integer ordersType; + /**顾客id*/ + @Excel(name = "顾客id", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id") + @ApiModelProperty(value = "顾客id") + private java.lang.String userId; + /**商品条目数量*/ + @Excel(name = "商品条目数量", width = 15) + @ApiModelProperty(value = "商品条目数量") + private java.lang.Integer goodsQuantity; + /**支付方式*/ + @Excel(name = "支付方式", width = 15, dicCode = "payment_method") + @Dict(dicCode = "payment_method") + @ApiModelProperty(value = "支付方式") + private java.lang.Integer paymentMethod; + /**支付状态*/ + @Excel(name = "支付状态", width = 15, dicCode = "payment_status") + @Dict(dicCode = "payment_status") + @ApiModelProperty(value = "支付状态") + private java.lang.Integer paymentStatus; + /**账号/卡号*/ + @Excel(name = "账号/卡号", width = 15) + @ApiModelProperty(value = "账号/卡号") + private java.lang.String accountNo; + /**开户银行*/ + @Excel(name = "开户银行", width = 15) + @ApiModelProperty(value = "开户银行") + private java.lang.String bankDeposit; + /**支付时间*/ + @Excel(name = "支付时间", width = 15, format = "yyyy-MM-dd hh:mm:ss") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "支付时间") + private java.util.Date paymentTime; + /**城市*/ + @Excel(name = "城市", width = 15) + @ApiModelProperty(value = "城市") + private java.lang.String cityId; + /**地址*/ + @Excel(name = "地址", width = 15) + @ApiModelProperty(value = "地址") + private java.lang.String address; + /**邮编*/ + @Excel(name = "邮编", width = 15) + @ApiModelProperty(value = "邮编") + private java.lang.String zipCode; + /**收货人*/ + @Excel(name = "收货人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") + @ApiModelProperty(value = "收货人") + private java.lang.String receiver; + /**联系电话*/ + @Excel(name = "联系电话", width = 15) + @ApiModelProperty(value = "联系电话") + private java.lang.String mobile; + /**发票客户类型*/ + @Excel(name = "发票客户类型", width = 15, dicCode = "invoice_customer_type") + @Dict(dicCode = "invoice_customer_type") + @ApiModelProperty(value = "发票客户类型") + private java.lang.Integer invoiceCustomerType; + /**发票类型*/ + @Excel(name = "发票类型", width = 15, dicCode = "invoice_type") + @Dict(dicCode = "invoice_type") + @ApiModelProperty(value = "发票类型") + private java.lang.Integer invoiceType; + /**纳税人识别号*/ + @Excel(name = "纳税人识别号", width = 15) + @ApiModelProperty(value = "纳税人识别号") + private java.lang.String taxIdentificationNumber; + /**开票地址*/ + @Excel(name = "开票地址", width = 15) + @ApiModelProperty(value = "开票地址") + private java.lang.String addressBilling; + /**电话*/ + @Excel(name = "电话", width = 15) + @ApiModelProperty(value = "电话") + private java.lang.String telephone; + /**公户开户行*/ + @Excel(name = "公户开户行", width = 15) + @ApiModelProperty(value = "公户开户行") + private java.lang.String bankPublic; + /**公户账号*/ + @Excel(name = "公户账号", width = 15) + @ApiModelProperty(value = "公户账号") + private java.lang.String accountNumber; + /**销售门店*/ + @Excel(name = "销售门店", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + @ApiModelProperty(value = "销售门店") + private java.lang.String salesEnterpriseId; + /**销售员*/ + @Excel(name = "销售员", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") + @ApiModelProperty(value = "销售员") + private java.lang.String salespersonId; + /**物流企业*/ + @Excel(name = "物流企业", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + @ApiModelProperty(value = "物流企业") + private java.lang.String logisticsEnterprisesId; + /**交付状态*/ + @Excel(name = "交付状态", width = 15, dicCode = "delivery_status") + @Dict(dicCode = "delivery_status") + @ApiModelProperty(value = "交付状态") + private java.lang.Integer deliveryStatus; +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/mapper/xml/ZyOrdersMapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/mapper/xml/ZyOrdersMapper.xml index 6c40fc2e..10a898bf 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/mapper/xml/ZyOrdersMapper.xml +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/mapper/xml/ZyOrdersMapper.xml @@ -1,21 +1,21 @@ - - - - - - - + + + + + + + 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 0410502a..76970ffb 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,345 +1,337 @@ -package org.jeecg.modules.demo.zyorders.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import org.jeecg.modules.demo.customerinvoice.entity.CustomerInvoice; -import org.jeecg.modules.demo.customerinvoice.mapper.CustomerInvoiceMapper; -import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress; -import org.jeecg.modules.demo.customerreceivingaddress.mapper.CustomerReceivingAddressMapper; -import org.jeecg.modules.demo.goodsaccessories.entity.GoodsAccessories; -import org.jeecg.modules.demo.goodsaccessories.mapper.GoodsAccessoriesMapper; -import org.jeecg.modules.demo.goodsfabric.entity.GoodsFabric; -import org.jeecg.modules.demo.goodsfabric.mapper.GoodsFabricMapper; -import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule; -import org.jeecg.modules.demo.goodsmodule.mapper.GoodsModuleMapper; -import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; -import org.jeecg.modules.demo.ordergoods.entity.OrderGoodsJk; -import org.jeecg.modules.demo.ordergoods.mapper.OrderGoodsMapper; -import org.jeecg.modules.demo.ordergoodsaccessories.entity.OrderGoodsAccessories; -import org.jeecg.modules.demo.ordergoodsaccessories.mapper.OrderGoodsAccessoriesMapper; -import org.jeecg.modules.demo.ordergoodsfabric.entity.OrderGoodsFabric; -import org.jeecg.modules.demo.ordergoodsfabric.mapper.OrderGoodsFabricMapper; -import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule; -import org.jeecg.modules.demo.ordergoodsmodule.mapper.OrderGoodsModuleMapper; -import org.jeecg.modules.demo.zygoods.entity.ZyGoods; -import org.jeecg.modules.demo.zygoods.mapper.ZyGoodsMapper; -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.orderbymakeclothplan.vo.TodayOrderAndQIriVo; -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; - -/** - * @Description: 订单基本信息管理 - * @Author: jeecg-boot - * @Date: 2022-12-26 - * @Version: V1.0 - */ -@Service -public class ZyOrdersServiceImpl extends ServiceImpl implements IZyOrdersService { - - //商品 - @Autowired - private ZyGoodsMapper zyGoodsMapper; - - //订单商品表 - @Autowired - private OrderGoodsMapper zyOrderGoodsMapper; - - //商品模块表 - @Autowired - private GoodsModuleMapper zyGoodsModuleMapper; - - - //订单商品模块表 - @Autowired - private OrderGoodsModuleMapper zyOrderGoodsModuleMapper; - - - //商品面料表 - @Autowired - private GoodsFabricMapper zyGoodsFabricMapper; - - //订单商品面料表 - @Autowired - private OrderGoodsFabricMapper zyOrderGoodsFabricMapper; - - //商品辅料表 - @Autowired - private GoodsAccessoriesMapper zyGoodsAccessoriesMapper; - - //订单商品辅料表 - @Autowired - private OrderGoodsAccessoriesMapper zyOrderGoodsAccessoriesMapper; - - - - //顾客地址表 - @Autowired - CustomerReceivingAddressMapper customerReceivingAddressMapper; - - //客户发票信息 - @Autowired - CustomerInvoiceMapper customerInvoiceMapper; - - - - /** - * 大屏数据-获取订单的状态 - * @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("payment_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; - } - - /** - * 获取今日订单及七日订单 - * @return - */ - @Override - public TodayOrderAndQIriVo getOrder() { - TodayOrderAndQIriVo todayOrderAndQIriVo = baseMapper.getTotalOrderAndWeek(); - if (todayOrderAndQIriVo != null) { - return todayOrderAndQIriVo; - } else { - return null; - } - } - - /** - * - * @param zyOrdersJk - * @param orderGoodsJkList - * @return - */ - @Override - public List orderJk(ZyOrdersJk zyOrdersJk, List orderGoodsJkList) { - - Double actual_payment = 0.00; - Double money = 0.00; - for(int i = 0 ; i < orderGoodsJkList.size() ; i++){ - ZyGoods zyGoods = zyGoodsMapper.selectById(orderGoodsJkList.get(i).getGoodsId()); - money = money + zyGoods.getUnitPrice()*orderGoodsJkList.get(i).getGoodsNum(); - actual_payment = actual_payment + zyGoods.getPromotionPrice()*orderGoodsJkList.get(i).getGoodsNum(); - } - ZyOrders zyOrders = new ZyOrders(); - zyOrders.setIschild(0); - zyOrders.setOrderTime(new Date()); - zyOrders.setOrdersNum(getOrdersNum()); - zyOrders.setMoney(money); - zyOrders.setFreight(zyOrdersJk.getFreight()); - zyOrders.setPromotionPrice(money-actual_payment); - zyOrders.setActualPayment(actual_payment); - zyOrders.setDeliveryTime(zyOrdersJk.getDeliveryTime()); - zyOrders.setOrdersType(zyOrdersJk.getOrdersType()); - zyOrders.setUserId(zyOrdersJk.getUserId()); - zyOrders.setGoodsQuantity(zyOrdersJk.getGoodsQuantity()); - //顾客地址 - if(zyOrdersJk.getAddressId()!=null&&zyOrdersJk.getAddressId()!="") - { - CustomerReceivingAddress customerReceivingAddress = customerReceivingAddressMapper.selectById(zyOrdersJk.getAddressId()); - zyOrders.setCityId(customerReceivingAddress.getCityId()); - zyOrders.setAddress(customerReceivingAddress.getAddress()); - zyOrders.setZipCode(customerReceivingAddress.getZipCode()); - zyOrders.setReceiver(zyOrdersJk.getReceiver()); - zyOrders.setMobile(customerReceivingAddress.getMobile()); - } - - //顾客发票 - if(zyOrdersJk.getInvoiceId()!=null&&zyOrdersJk.getInvoiceId()!="") - { - CustomerInvoice customerInvoice = customerInvoiceMapper.selectById(zyOrdersJk.getInvoiceId()); - zyOrders.setInvoiceCustomerType(Integer.parseInt(customerInvoice.getCustomerType())); - zyOrders.setInvoiceType(Integer.parseInt(customerInvoice.getInvoiceType())); - zyOrders.setTaxIdentificationNumber(customerInvoice.getTaxIdentificationNumber()); - zyOrders.setAddressBilling(customerInvoice.getAddress()); - zyOrders.setTelephone(customerInvoice.getTelephone()); - zyOrders.setBankPublic(customerInvoice.getBankDeposit()); - zyOrders.setAccountNumber(customerInvoice.getAccountNumber()); - } - - zyOrders.setSalesEnterpriseId(zyOrdersJk.getSalesEnterpriseId()); - zyOrders.setSalespersonId(zyOrdersJk.getSalespersonId()); - zyOrders.setLogisticsEnterprisesId(zyOrdersJk.getLogisticsEnterprisesId()); - zyOrders.setDeliveryStatus(0); - baseMapper.insert(zyOrders); - for(int j = 0 ; j < orderGoodsJkList.size() ; j++){ - ZyGoods zyGoods = zyGoodsMapper.selectById(orderGoodsJkList.get(j).getGoodsId()); - OrderGoods orderGoods = new OrderGoods(); - orderGoods.setOrdersId(zyOrders.getId()); - orderGoods.setGoodsId(orderGoodsJkList.get(j).getGoodsId()); - orderGoods.setGoodsNum(orderGoodsJkList.get(j).getGoodsNum()); - orderGoods.setGoodsCode(zyGoods.getGoodsCode()); - orderGoods.setGoodsName(zyGoods.getGoodsName()); - orderGoods.setGoodsIntr(zyGoods.getGoodsIntr()); - orderGoods.setCustomized(zyGoods.getCustomized()); - orderGoods.setMeasureId(zyOrdersJk.getMeasureId()); - orderGoods.setGoodsPicture(zyGoods.getGoodsPicture()); - orderGoods.setDefaultPicture(zyGoods.getDefaultPicture()); - orderGoods.setGoodsVideo(zyGoods.getGoodsVideo()); - orderGoods.setClothsTypeId(zyGoods.getClothsTypeId()); - orderGoods.setStyleId(zyGoods.getStyleId()); - orderGoods.setModelId(zyGoods.getModelId()); - orderGoods.setUnit(zyGoods.getUnit()); - orderGoods.setNumber(zyGoods.getNumber()); - orderGoods.setUnitPrice(zyGoods.getUnitPrice()); - orderGoods.setDiscount(zyGoods.getDiscount()); - orderGoods.setPromotionPrice(zyGoods.getPromotionPrice()); - orderGoods.setRecommend(zyGoods.getRecommend()); - orderGoods.setPlaceOrigin(zyGoods.getPlaceOrigin()); - orderGoods.setStatus(zyGoods.getStatus()); - orderGoods.setTotalPrice(zyGoods.getUnitPrice()*orderGoodsJkList.get(j).getGoodsNum()); - orderGoods.setPayTotalPrice(zyGoods.getPromotionPrice()*orderGoodsJkList.get(j).getGoodsNum()); - zyOrderGoodsMapper.insert(orderGoods); - GoodsModule goodsModule = new GoodsModule(); - QueryWrapper queryWrapperzsm = new QueryWrapper(); - queryWrapperzsm.eq("goods_id",zyGoods.getId()); - queryWrapperzsm.eq("style_id",zyGoods.getStyleId()); - List listzsm = zyGoodsModuleMapper.selectList(queryWrapperzsm); - for (int k = 0 ; k < listzsm.size() ; k++){ - OrderGoodsModule orderGoodsModule = new OrderGoodsModule(); - orderGoodsModule.setOrderGoodsId(orderGoods.getId()); - orderGoodsModule.setGoodsId(zyGoods.getId()); - orderGoodsModule.setStyleId(zyGoods.getStyleId()); - orderGoodsModule.setStyleModuleId(listzsm.get(k).getStyleModuleId()); - orderGoodsModule.setModuleId(listzsm.get(k).getModuleId()); - zyOrderGoodsModuleMapper.insert(orderGoodsModule); - } - GoodsFabric goodsFabric = new GoodsFabric(); - QueryWrapper queryWrapperzsf =new QueryWrapper(); - queryWrapperzsf.eq("goods_id",zyGoods.getId()); - List listzsf = zyGoodsFabricMapper.selectList(queryWrapperzsf); - for (int o = 0 ; o < listzsf.size() ; o++){ - OrderGoodsFabric orderGoodsFabric = new OrderGoodsFabric(); - orderGoodsFabric.setOrderGoodsId(orderGoods.getId()); - orderGoodsFabric.setGoodsId(zyGoods.getId()); - orderGoodsFabric.setFabricId(listzsf.get(o).getFabricId()); - zyOrderGoodsFabricMapper.insert(orderGoodsFabric); - } - GoodsAccessories goodsAccessories = new GoodsAccessories(); - QueryWrapper queryWrapperzsa = new QueryWrapper(); - queryWrapperzsa.eq("goods_id",zyGoods.getId()); - List listzsa = zyGoodsAccessoriesMapper.selectList(queryWrapperzsa); - for (int p = 0 ; p < listzsa.size() ; p++){ - OrderGoodsAccessories orderGoodsAccessories = new OrderGoodsAccessories(); - orderGoodsAccessories.setOrderGoodsId(orderGoods.getId()); - orderGoodsAccessories.setGoodsId(zyGoods.getId()); - orderGoodsAccessories.setAccessoriesId(listzsa.get(p).getAccessoriesId()); - zyOrderGoodsAccessoriesMapper.insert(orderGoodsAccessories); - } - - - } - List ids = new ArrayList<>(); - ZyOrders zos = new ZyOrders(); - QueryWrapper queryWrapperzos = new QueryWrapper(); - queryWrapperzos.eq("order_id",zyOrders.getId()); - List listzos = baseMapper.selectList(queryWrapperzos); - if(listzos.size()>0){ - //return Result.error("该订单已经拆分,不可以再次拆单!"); - return null; - }else{ - OrderGoods orderGoods = new OrderGoods(); - QueryWrapper queryWrapperog = new QueryWrapper(); - queryWrapperog.eq("orders_id",zyOrders.getId()); - List listog = zyOrderGoodsMapper.selectList(queryWrapperog); - if(listog.size()>0){ - for (int i = 0 ; i < listog.size() ; i++){ - ZyOrders zo = new ZyOrders(); - zo = zyOrders; - zo.setId(null); - zo.setOrdersNum(getOrdersNum()); - zo.setOrderId(listog.get(i).getId()); - zo.setFreight(Double.parseDouble("0")); - zo.setIschild(1); - zo.setOrderId(zyOrders.getId()); - zo.setMoney(listog.get(i).getTotalPrice()); - zo.setPromotionPrice(listog.get(i).getPromotionPrice()); - zo.setActualPayment(listog.get(i).getPayTotalPrice()); - zo.setGoodsQuantity(1); - baseMapper.insert(zo); - ids.add(zo.getId()); - OrderGoods og = new OrderGoods(); - og = listog.get(i); - og.setOrdersId(zo.getId()); - zyOrderGoodsMapper.updateById(og); - } - } - } - return ids; - } - - - /** - * 生成订单编号 - * - * @param - * @return - */ - public String getOrdersNum() { - String mrstr = "000000000000000000"; - QueryWrapper qw=new QueryWrapper(); - int listsize = baseMapper.selectCount(qw); - int strsize = listsize+1; - String str = strsize+""; - int strlength = str.length(); - String substr = mrstr.substring(0,mrstr.length()-strlength); - String OrdersNum = substr+str; - return OrdersNum; - } - -} +package org.jeecg.modules.demo.zyorders.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.jeecg.modules.demo.customerinvoice.entity.CustomerInvoice; +import org.jeecg.modules.demo.customerinvoice.mapper.CustomerInvoiceMapper; +import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress; +import org.jeecg.modules.demo.customerreceivingaddress.mapper.CustomerReceivingAddressMapper; +import org.jeecg.modules.demo.goodsaccessories.entity.GoodsAccessories; +import org.jeecg.modules.demo.goodsaccessories.mapper.GoodsAccessoriesMapper; +import org.jeecg.modules.demo.goodsfabric.entity.GoodsFabric; +import org.jeecg.modules.demo.goodsfabric.mapper.GoodsFabricMapper; +import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule; +import org.jeecg.modules.demo.goodsmodule.mapper.GoodsModuleMapper; +import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; +import org.jeecg.modules.demo.ordergoods.entity.OrderGoodsJk; +import org.jeecg.modules.demo.ordergoods.mapper.OrderGoodsMapper; +import org.jeecg.modules.demo.ordergoodsaccessories.entity.OrderGoodsAccessories; +import org.jeecg.modules.demo.ordergoodsaccessories.mapper.OrderGoodsAccessoriesMapper; +import org.jeecg.modules.demo.ordergoodsfabric.entity.OrderGoodsFabric; +import org.jeecg.modules.demo.ordergoodsfabric.mapper.OrderGoodsFabricMapper; +import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule; +import org.jeecg.modules.demo.ordergoodsmodule.mapper.OrderGoodsModuleMapper; +import org.jeecg.modules.demo.zygoods.entity.ZyGoods; +import org.jeecg.modules.demo.zygoods.mapper.ZyGoodsMapper; +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.orderbymakeclothplan.vo.TodayOrderAndQIriVo; +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; + +/** + * @Description: 订单基本信息管理 + * @Author: jeecg-boot + * @Date: 2022-12-26 + * @Version: V1.0 + */ +@Service +public class ZyOrdersServiceImpl extends ServiceImpl implements IZyOrdersService { + + //商品 + @Autowired + private ZyGoodsMapper zyGoodsMapper; + + //订单商品表 + @Autowired + private OrderGoodsMapper zyOrderGoodsMapper; + + //商品模块表 + @Autowired + private GoodsModuleMapper zyGoodsModuleMapper; + + + //订单商品模块表 + @Autowired + private OrderGoodsModuleMapper zyOrderGoodsModuleMapper; + + + //商品面料表 + @Autowired + private GoodsFabricMapper zyGoodsFabricMapper; + + //订单商品面料表 + @Autowired + private OrderGoodsFabricMapper zyOrderGoodsFabricMapper; + + //商品辅料表 + @Autowired + private GoodsAccessoriesMapper zyGoodsAccessoriesMapper; + + //订单商品辅料表 + @Autowired + private OrderGoodsAccessoriesMapper zyOrderGoodsAccessoriesMapper; + + + + //顾客地址表 + @Autowired + CustomerReceivingAddressMapper customerReceivingAddressMapper; + + //客户发票信息 + @Autowired + CustomerInvoiceMapper customerInvoiceMapper; + + + + /** + * 大屏数据-获取订单的状态 + * @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);//今天 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + //把日期往后增加一天.整数往后推,负数往前移动(1:表示明天、-1:表示昨天,0:表示今天) + calendar.add(Calendar.DATE, 1); + //这个时间就是日期往后推一天的结果,明天 + date = calendar.getTime(); + String tomorrowStr = formatter.format(date); + + starTime = todayStr + " 00:00:00"; + endTime = tomorrowStr + " 00:00:00"; + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.ge("create_time", starTime).le("create_time", endTime).eq("payment_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; + } + + /** + * 获取今日订单及七日订单 + * @return + */ + @Override + public TodayOrderAndQIriVo getOrder() { + TodayOrderAndQIriVo todayOrderAndQIriVo = baseMapper.getTotalOrderAndWeek(); + if (todayOrderAndQIriVo != null) { + return todayOrderAndQIriVo; + } else { + return null; + } + } + + /** + * + * @param zyOrdersJk + * @param orderGoodsJkList + * @return + */ + @Override + public List orderJk(ZyOrdersJk zyOrdersJk, List orderGoodsJkList) { + + Double actual_payment = 0.00; + Double money = 0.00; + for(int i = 0 ; i < orderGoodsJkList.size() ; i++){ + ZyGoods zyGoods = zyGoodsMapper.selectById(orderGoodsJkList.get(i).getGoodsId()); + money = money + zyGoods.getUnitPrice()*orderGoodsJkList.get(i).getGoodsNum(); + actual_payment = actual_payment + zyGoods.getPromotionPrice()*orderGoodsJkList.get(i).getGoodsNum(); + } + ZyOrders zyOrders = new ZyOrders(); + zyOrders.setIschild(0); + zyOrders.setOrderTime(new Date()); + zyOrders.setOrdersNum(getOrdersNum()); + zyOrders.setMoney(money); + zyOrders.setFreight(zyOrdersJk.getFreight()); + zyOrders.setPromotionPrice(money-actual_payment); + zyOrders.setActualPayment(actual_payment); + zyOrders.setDeliveryTime(zyOrdersJk.getDeliveryTime()); + zyOrders.setOrdersType(zyOrdersJk.getOrdersType()); + zyOrders.setUserId(zyOrdersJk.getUserId()); + zyOrders.setGoodsQuantity(zyOrdersJk.getGoodsQuantity()); + //顾客地址 + if(zyOrdersJk.getAddressId()!=null&&zyOrdersJk.getAddressId()!="") + { + CustomerReceivingAddress customerReceivingAddress = customerReceivingAddressMapper.selectById(zyOrdersJk.getAddressId()); + zyOrders.setCityId(customerReceivingAddress.getCityId()); + zyOrders.setAddress(customerReceivingAddress.getAddress()); + zyOrders.setZipCode(customerReceivingAddress.getZipCode()); + zyOrders.setReceiver(zyOrdersJk.getReceiver()); + zyOrders.setMobile(customerReceivingAddress.getMobile()); + } + + //顾客发票 + if(zyOrdersJk.getInvoiceId()!=null&&zyOrdersJk.getInvoiceId()!="") + { + CustomerInvoice customerInvoice = customerInvoiceMapper.selectById(zyOrdersJk.getInvoiceId()); + zyOrders.setInvoiceCustomerType(Integer.parseInt(customerInvoice.getCustomerType())); + zyOrders.setInvoiceType(Integer.parseInt(customerInvoice.getInvoiceType())); + zyOrders.setTaxIdentificationNumber(customerInvoice.getTaxIdentificationNumber()); + zyOrders.setAddressBilling(customerInvoice.getAddress()); + zyOrders.setTelephone(customerInvoice.getTelephone()); + zyOrders.setBankPublic(customerInvoice.getBankDeposit()); + zyOrders.setAccountNumber(customerInvoice.getAccountNumber()); + } + + zyOrders.setSalesEnterpriseId(zyOrdersJk.getSalesEnterpriseId()); + zyOrders.setSalespersonId(zyOrdersJk.getSalespersonId()); + zyOrders.setLogisticsEnterprisesId(zyOrdersJk.getLogisticsEnterprisesId()); + zyOrders.setDeliveryStatus(0); + zyOrders.setPaymentStatus(1); + zyOrders.setPaymentTime(new Date()); + baseMapper.insert(zyOrders); + for(int j = 0 ; j < orderGoodsJkList.size() ; j++){ + ZyGoods zyGoods = zyGoodsMapper.selectById(orderGoodsJkList.get(j).getGoodsId()); + OrderGoods orderGoods = new OrderGoods(); + orderGoods.setOrdersId(zyOrders.getId()); + orderGoods.setGoodsId(orderGoodsJkList.get(j).getGoodsId()); + orderGoods.setGoodsNum(orderGoodsJkList.get(j).getGoodsNum()); + orderGoods.setGoodsCode(zyGoods.getGoodsCode()); + orderGoods.setGoodsName(zyGoods.getGoodsName()); + orderGoods.setGoodsIntr(zyGoods.getGoodsIntr()); + orderGoods.setCustomized(zyGoods.getCustomized()); + orderGoods.setMeasureId(zyOrdersJk.getMeasureId()); + orderGoods.setGoodsPicture(zyGoods.getGoodsPicture()); + orderGoods.setDefaultPicture(zyGoods.getDefaultPicture()); + orderGoods.setGoodsVideo(zyGoods.getGoodsVideo()); + orderGoods.setClothsTypeId(zyGoods.getClothsTypeId()); + orderGoods.setStyleId(zyGoods.getStyleId()); + orderGoods.setModelId(zyGoods.getModelId()); + orderGoods.setUnit(zyGoods.getUnit()); + orderGoods.setNumber(zyGoods.getNumber()); + orderGoods.setUnitPrice(zyGoods.getUnitPrice()); + orderGoods.setDiscount(zyGoods.getDiscount()); + orderGoods.setPromotionPrice(zyGoods.getPromotionPrice()); + orderGoods.setRecommend(zyGoods.getRecommend()); + orderGoods.setPlaceOrigin(zyGoods.getPlaceOrigin()); + orderGoods.setStatus(zyGoods.getStatus()); + orderGoods.setTotalPrice(zyGoods.getUnitPrice()*orderGoodsJkList.get(j).getGoodsNum()); + orderGoods.setPayTotalPrice(zyGoods.getPromotionPrice()*orderGoodsJkList.get(j).getGoodsNum()); + zyOrderGoodsMapper.insert(orderGoods); + GoodsModule goodsModule = new GoodsModule(); + QueryWrapper queryWrapperzsm = new QueryWrapper(); + queryWrapperzsm.eq("goods_id",zyGoods.getId()); + queryWrapperzsm.eq("style_id",zyGoods.getStyleId()); + List listzsm = zyGoodsModuleMapper.selectList(queryWrapperzsm); + for (int k = 0 ; k < listzsm.size() ; k++){ + OrderGoodsModule orderGoodsModule = new OrderGoodsModule(); + orderGoodsModule.setOrderGoodsId(orderGoods.getId()); + orderGoodsModule.setGoodsId(zyGoods.getId()); + orderGoodsModule.setStyleId(zyGoods.getStyleId()); + orderGoodsModule.setStyleModuleId(listzsm.get(k).getStyleModuleId()); + orderGoodsModule.setModuleId(listzsm.get(k).getModuleId()); + zyOrderGoodsModuleMapper.insert(orderGoodsModule); + } + GoodsFabric goodsFabric = new GoodsFabric(); + QueryWrapper queryWrapperzsf =new QueryWrapper(); + queryWrapperzsf.eq("goods_id",zyGoods.getId()); + List listzsf = zyGoodsFabricMapper.selectList(queryWrapperzsf); + for (int o = 0 ; o < listzsf.size() ; o++){ + OrderGoodsFabric orderGoodsFabric = new OrderGoodsFabric(); + orderGoodsFabric.setOrderGoodsId(orderGoods.getId()); + orderGoodsFabric.setGoodsId(zyGoods.getId()); + orderGoodsFabric.setFabricId(listzsf.get(o).getFabricId()); + zyOrderGoodsFabricMapper.insert(orderGoodsFabric); + } + GoodsAccessories goodsAccessories = new GoodsAccessories(); + QueryWrapper queryWrapperzsa = new QueryWrapper(); + queryWrapperzsa.eq("goods_id",zyGoods.getId()); + List listzsa = zyGoodsAccessoriesMapper.selectList(queryWrapperzsa); + for (int p = 0 ; p < listzsa.size() ; p++){ + OrderGoodsAccessories orderGoodsAccessories = new OrderGoodsAccessories(); + orderGoodsAccessories.setOrderGoodsId(orderGoods.getId()); + orderGoodsAccessories.setGoodsId(zyGoods.getId()); + orderGoodsAccessories.setAccessoriesId(listzsa.get(p).getAccessoriesId()); + zyOrderGoodsAccessoriesMapper.insert(orderGoodsAccessories); + } + + + } + List ids = new ArrayList<>(); + ZyOrders zos = new ZyOrders(); + QueryWrapper queryWrapperzos = new QueryWrapper(); + queryWrapperzos.eq("order_id",zyOrders.getId()); + List listzos = baseMapper.selectList(queryWrapperzos); + if(listzos.size()>0){ + //return Result.error("该订单已经拆分,不可以再次拆单!"); + return null; + }else{ + OrderGoods orderGoods = new OrderGoods(); + QueryWrapper queryWrapperog = new QueryWrapper(); + queryWrapperog.eq("orders_id",zyOrders.getId()); + List listog = zyOrderGoodsMapper.selectList(queryWrapperog); + if(listog.size()>0){ + for (int i = 0 ; i < listog.size() ; i++){ + ZyOrders zo = new ZyOrders(); + zo = zyOrders; + zo.setId(null); + zo.setOrdersNum(getOrdersNum()); + zo.setOrderId(listog.get(i).getId()); + zo.setFreight(Double.parseDouble("0")); + zo.setIschild(1); + zo.setOrderId(zyOrders.getId()); + zo.setMoney(listog.get(i).getTotalPrice()); + zo.setPromotionPrice(listog.get(i).getPromotionPrice()); + zo.setActualPayment(listog.get(i).getPayTotalPrice()); + zo.setGoodsQuantity(1); + baseMapper.insert(zo); + ids.add(zo.getId()); + OrderGoods og = new OrderGoods(); + og = listog.get(i); + og.setOrdersId(zo.getId()); + zyOrderGoodsMapper.updateById(og); + } + } + } + return ids; + } + + + /** + * 生成订单编号 + * + * @param + * @return + */ + public String getOrdersNum() { + String mrstr = "000000000000000000"; + QueryWrapper qw=new QueryWrapper(); + int listsize = baseMapper.selectCount(qw); + int strsize = listsize+1; + String str = strsize+""; + int strlength = str.length(); + String substr = mrstr.substring(0,mrstr.length()-strlength); + String OrdersNum = substr+str; + return OrdersNum; + } + +} 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 index bd9277d1..da82cbee 100644 --- 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 @@ -1,5 +1,6 @@ package org.jeecg.modules.largeScreen; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -9,9 +10,12 @@ import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo; import org.jeecg.modules.shop.vo.OrderSales; +import org.jeecg.modules.system.entity.SysDepart; +import org.jeecg.modules.system.service.ISysDepartService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; import java.util.List; /** @@ -28,6 +32,9 @@ public class LargeScreenController { @Autowired private IZyOrdersService zyOrdersService; + @Autowired + private ISysDepartService sysDepartService; + /********************************************订单大数据监控系统********************************************/ @@ -88,4 +95,24 @@ public class LargeScreenController { } } + //店铺list + + @AutoLog(value = "获取今日订单及七日订单") + @ApiOperation(value = "获取今日订单及七日订单", notes = "获取今日订单及七日订单") + @GetMapping("/getShopList") + public Result getShopList() { + QueryWrapper qw=new QueryWrapper(); + //查询店铺和网店 + List data=new ArrayList<>(); + data.add("5"); + data.add("4"); + qw.in("org_category",data); + List list = sysDepartService.list(qw); + if (list.isEmpty()){ + return Result.OK("未查询到店铺信息"); + } + return Result.OK(list); + } + + }