renqianlong 1 年之前
父节点
当前提交
456d0f656c

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderInputQueryBo.java

@@ -77,4 +77,5 @@ public class OrderInputQueryBo extends BaseEntity {
 	/** 录单来源 1普通录单 2新B端下单  3旧B端下单 */
 	@ApiModelProperty("录单来源 1普通录单 2新B端下单  3旧B端下单")
 	private Integer inputFrom;
+	private List<String> inputOrderSns;
 }

+ 22 - 23
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderInputServiceImpl.java

@@ -286,7 +286,6 @@ public class OrderInputServiceImpl extends ServiceImpl<OrderInputMapper, OrderIn
     @Override
     public Map<String, Object> excelImport(List<String> ids) {
         Map<String, Object> map = new HashMap<>();
-        List<OrderInputVo> orderInputVos = new ArrayList<>();
         List<OrderInputImpotVo> orderInputImpotVos = new ArrayList<>();
         List<OrderListImportVo> orderListImportVos = new ArrayList<>();
         if (ids.size() > 50) {
@@ -294,13 +293,27 @@ public class OrderInputServiceImpl extends ServiceImpl<OrderInputMapper, OrderIn
         }
         if (ObjectUtils.isNotEmpty(ids)) {
             final Integer[] number = {Constants.NUMBER};
-            ids.forEach(id -> {
-                OrderInputQueryBo orderInputQueryBo = new OrderInputQueryBo();
-                orderInputQueryBo.setInputOrderSn(String.valueOf(id));
-                OrderInputVo orderInputVo = this.selectList(orderInputQueryBo).get(0);
-                orderInputVos.add(orderInputVo);
+            OrderInputQueryBo orderInputQueryBo = new OrderInputQueryBo();
+            orderInputQueryBo.setInputOrderSns(ids);
+            List<OrderInputVo> orderInputVos = this.selectList(orderInputQueryBo);
+            orderInputVos.forEach(item -> {
+                OrderInputImpotVo bean = BeanUtil.toBean(item, OrderInputImpotVo.class);
+                bean.setId(number[0]);
+                if (ObjectUtils.isEmpty(item.getGoodsRealPrice())) {
+                    bean.setGoodsRealPrice(BigDecimal.valueOf(0));
+                }
+                if (!ObjectUtils.isEmpty(item.getOrderFrom())){
+                    bean.setInputFrom(getGoodFromName(item.getOrderFrom()));
+                }
+                bean.setGoodBusiness(item.getEducationName() + item.getProjectName() + item.getBusinessName());
+                bean.setGoodsNoReceived(item.getPayPrice().subtract(item.getGoodsReceived()));
+                bean.setCreateTime(DateUtils.timestampToDateFormat(item.getCreateTime(),"yyyy-MM-dd HH:mm:ss"));
+                orderInputImpotVos.add(bean);
+                number[0]++;
+            });
+            orderInputVos.forEach(orderInputVo -> {
                 OrderQueryBo orderQueryBo = new OrderQueryBo();
-                orderQueryBo.setInputOrderSn(String.valueOf(id));
+                orderQueryBo.setInputOrderSn(String.valueOf(orderInputVo.getInputOrderSn()));
                 orderQueryBo.setStatus(new Integer[]{1});
                 List<OrderListVo> orderListVo = iOrderService.selectList(orderQueryBo);
                 orderListVo.forEach(orderLIst -> {
@@ -310,7 +323,8 @@ public class OrderInputServiceImpl extends ServiceImpl<OrderInputMapper, OrderIn
                     }
                     bean.setId(number[0]);
                     bean.setGoodsPayStatus(getGoodsPayStatus(orderLIst.getGoodsPayStatus()));
-                    bean.setInputOrderSn(id);
+                    bean.setInputOrderSn(orderInputVo.getInputOrderSn());
+                    bean.setCreateTime(DateUtils.timestampToDateFormat(orderLIst.getCreateTime(),"yyyy-MM-dd HH:mm:ss"));
                     bean.setGoodsBusiness(orderLIst.getEducationName() + orderLIst.getProjectName() + orderLIst.getBusinessName());
                     bean.setOrderStatus(getOrderStatus(orderLIst.getOrderStatus()));
                     bean.setRefundStatus(getRefundStatus(orderLIst.getRefundStatus()));
@@ -328,21 +342,6 @@ public class OrderInputServiceImpl extends ServiceImpl<OrderInputMapper, OrderIn
         }else {
             throw new CustomException("请先勾选数据");
         }
-        final Integer[] number = {Constants.NUMBER};
-        orderInputVos.forEach(item -> {
-            OrderInputImpotVo bean = BeanUtil.toBean(item, OrderInputImpotVo.class);
-            bean.setId(number[0]);
-            if (ObjectUtils.isEmpty(item.getGoodsRealPrice())) {
-                bean.setGoodsRealPrice(BigDecimal.valueOf(0));
-            }
-            if (!ObjectUtils.isEmpty(item.getOrderFrom())){
-                bean.setInputFrom(getGoodFromName(item.getOrderFrom()));
-            }
-            bean.setGoodBusiness(item.getEducationName() + item.getProjectName() + item.getBusinessName());
-            bean.setGoodsNoReceived(item.getPayPrice().subtract(item.getGoodsReceived()));
-            orderInputImpotVos.add(bean);
-            number[0]++;
-        });
         List<Map<String, Object>> sheetsList = new ArrayList<>();
         ExportParams deptExportParams = new ExportParams();
         deptExportParams.setSheetName("后台订单");

+ 13 - 4
zhongzheng-system/src/main/resources/mapper/modules/order/OrderInputMapper.xml

@@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <select id="selectList" parameterType="com.zhongzheng.modules.order.bo.OrderInputQueryBo" resultMap="OrderInputVoResult">
-        SELECT  u.input_order_sn,
+        SELECT u.input_order_sn,
         u.order_from,
         any_value (u.old_order_sn ) old_order_sn,
         any_value(g.goods_type) goods_type,
@@ -62,7 +62,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         any_value ( cet.education_name ) education_name,
         any_value ( cpt.project_name ) project_name,
         any_value ( cb.business_name ) business_name,
-        (select IFNULL(sum(og.goods_received),0) from order_goods og LEFT JOIN `order` o on o.order_sn = og.order_sn  where o.input_order_sn = u.input_order_sn and og.refund_status = 2) goods_refund,
+        (select IFNULL(sum(og.goods_received),0) from order_goods og LEFT JOIN `order` o on o.order_sn = og.order_sn
+        where o.input_order_sn = u.input_order_sn and og.refund_status = 2) goods_refund,
         IFNULL(sum( og.goods_received ),0) goods_received,
         IFNULL(sum(og.goods_price ),0) order_price,
         IFNULL(sum(og.goods_real_price),0) pay_price,
@@ -82,11 +83,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             AND o.order_from = #{orderFrom}
         </if>
         <if test="businessId != null and businessId != ''">
-        AND oi.business_id = #{businessId}
+            AND oi.business_id = #{businessId}
         </if>
         <if test="inputOrderSn != null and inputOrderSn != ''">
             AND oi.input_order_sn = #{inputOrderSn}
         </if>
+        <if test="inputOrderSns != null and inputOrderSns.size()!=0">
+            AND oi.input_order_sn in
+            <foreach collection="inputOrderSns" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
         <if test="educationTypeId != null and educationTypeId != ''">
             AND oi.education_type_id = #{educationTypeId}
         </if>
@@ -94,7 +101,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             AND oi.old_order_sn = #{oldOrderSn}
         </if>
         <if test="searchKey != null and searchKey != ''">
-            AND (oi.create_username like concat('%', #{searchKey}, '%') or oi.input_order_sn = #{searchKey} or (select count(*) from `user` us where us.user_id = o.user_id AND us.realname like concat('%', #{searchKey}, '%') )>0)
+            AND (oi.create_username like concat('%', #{searchKey}, '%') or oi.input_order_sn = #{searchKey} or (select
+            count(*) from `user` us where us.user_id = o.user_id AND us.realname like concat('%', #{searchKey}, '%')
+            )>0)
         </if>
         <if test="startTime != null and startTime != ''">
             AND oi.create_time >= #{startTime}