Explorar el Código

fix 录入订单

he2802 hace 3 años
padre
commit
ccdc161832

+ 12 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/order/OrderController.java

@@ -2,6 +2,7 @@ package com.zhongzheng.controller.order;
 
 import java.util.List;
 import java.util.Arrays;
+import java.util.Map;
 
 import com.zhongzheng.common.core.domain.model.LoginUser;
 import com.zhongzheng.common.utils.DateUtils;
@@ -17,6 +18,7 @@ import com.zhongzheng.modules.order.service.IOrderService;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 import com.zhongzheng.modules.order.vo.OrderListVo;
 import com.zhongzheng.modules.order.vo.OrderVo;
+import com.zhongzheng.modules.user.bo.UserSubscribeExportBo;
 import lombok.RequiredArgsConstructor;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -128,5 +130,15 @@ public class OrderController extends BaseController {
         return AjaxResult.success(iOrderService.placePlatInputOrder(bo));
     }
 
+    /**
+     * 导出新增预约模板
+     */
+    @ApiOperation("导出错误录入订单")
+    @PreAuthorize("@ss.hasPermi('system:profile:export')")
+    @Log(title = "导出错误录入订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/exportWrongInputOrder")
+    public AjaxResult<Map<String,Object>> exportWrongInputOrder(UserSubscribeExportBo bo) {
+        return null;
+    }
 
 }

+ 28 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderInputGoodsImportBo.java

@@ -0,0 +1,28 @@
+package com.zhongzheng.modules.order.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+
+@Data
+@ApiModel("订单录入错误信息模板添加对象")
+public class OrderInputGoodsImportBo {
+
+    @ApiModelProperty("商品名称")
+    private String goodsName;
+
+    /** 商品标准价格 */
+    @ApiModelProperty("商品标准价格")
+    private BigDecimal goodsPrice;
+
+    /** 商品成交价格 */
+    @ApiModelProperty("商品成交价格")
+    private BigDecimal goodsRealPrice;
+
+    /** 已收金额 */
+    @ApiModelProperty("已收金额")
+    private BigDecimal goodsReceived;
+}

+ 34 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderInputWrongImportBo.java

@@ -0,0 +1,34 @@
+package com.zhongzheng.modules.order.bo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+
+@Data
+@ApiModel("订单录入错误信息模板添加对象")
+public class OrderInputWrongImportBo {
+
+    @ApiModelProperty("真实姓名")
+    private String realname;
+
+    /** 身份证号 */
+    @ApiModelProperty("身份证号")
+    private String idCard;
+
+    /** 手机号码 */
+    @ApiModelProperty("手机号码")
+    private String telphone;
+
+    @ApiModelProperty("科目名称")
+    private String subjectName;
+
+    @ApiModelProperty("商品列表")
+    private List<OrderInputGoodsImportBo> goodsList;
+
+    @Excel(name = "失败原因")
+    private String cause;
+}

+ 24 - 19
zhongzheng-system/src/main/resources/mapper/modules/order/OrderInputMapper.xml

@@ -46,25 +46,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <select id="selectList" parameterType="com.zhongzheng.modules.order.bo.OrderInputQueryBo" resultMap="OrderInputVoResult">
-        SELECT
-            oi.input_order_sn,
-            count( DISTINCT o.user_id ) user_num,
-            count( DISTINCT og.goods_id ) goods_num,
-            any_value ( cet.education_name ) education_name,
-            any_value ( cpt.project_name ) project_name,
-            any_value ( cb.business_name ) business_name,
-            sum( og.goods_received ) goods_received,
-            sum( o.order_price ) order_price,
-            sum( o.pay_price ) pay_price,
-            any_value ( oi.create_username ) create_username,
-            any_value ( oi.create_time ) create_time
+        SELECT  u.input_order_sn,
+        any_value (u.user_num ) user_num,
+        count( DISTINCT og.goods_id ) goods_num,
+        any_value ( cet.education_name ) education_name,
+        any_value ( cpt.project_name ) project_name,
+        any_value ( cb.business_name ) business_name,
+        sum( og.goods_received ) goods_received,
+        any_value (u.order_price ) order_price,
+        any_value (u.pay_price) pay_price,
+        any_value ( u.create_username ) create_username,
+        any_value ( u.create_time ) create_time FROM (SELECT
+        oi.*,
+        count( DISTINCT o.user_id ) user_num,
+        sum( o.order_price ) order_price,
+        sum( o.pay_price ) pay_price,
+        o.order_sn
         FROM
-            order_input oi
-                LEFT JOIN `order` o ON oi.input_order_sn = o.input_order_sn
-                LEFT JOIN order_goods og ON o.order_sn = og.order_sn
-                LEFT JOIN course_education_type cet ON oi.education_type_id = cet.id
-                LEFT JOIN course_project_type cpt ON oi.project_id = cpt.id
-                LEFT JOIN course_business cb ON oi.business_id = cb.id
+        order_input oi
+        LEFT JOIN `order` o ON oi.input_order_sn = o.input_order_sn
         where 1=1
         <if test="businessId != null and businessId != ''">
         AND oi.business_id = #{businessId}
@@ -78,8 +78,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="endTime != null and endTime != ''">
             AND #{endTime} >= oi.create_time
         </if>
+        GROUP BY oi.id,o.order_sn)u LEFT JOIN order_goods og ON u.order_sn = og.order_sn
+        LEFT JOIN course_education_type cet ON u.education_type_id = cet.id
+        LEFT JOIN course_project_type cpt ON u.project_id = cpt.id
+        LEFT JOIN course_business cb ON u.business_id = cb.id
+        where 1=1
         GROUP BY
-            oi.input_order_sn
+        u.input_order_sn
         ORDER BY create_time DESC
     </select>