Quellcode durchsuchen

修改客户信息

liujiankang vor 6 Jahren
Ursprung
Commit
2423a7dfd0

+ 9 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/SalesOrder.java

@@ -86,6 +86,7 @@ public class SalesOrder implements Serializable {
     private String itemProductColor;    //产品颜色
     private Integer itemNum;            //产品数量
     private String itemColorBar;        //产品69码
+    private List<String> listColorBar;  //产品69码集合
 
     private String[] salesIds;        //传入mybatis的订单编号
     private String ids;        //前台传过来的订单编号
@@ -545,4 +546,12 @@ public class SalesOrder implements Serializable {
     public void setSalesBatchId(String salesBatchId) {
         this.salesBatchId = salesBatchId;
     }
+
+    public List<String> getListColorBar() {
+        return listColorBar;
+    }
+
+    public void setListColorBar(List<String> listColorBar) {
+        this.listColorBar = listColorBar;
+    }
 }

+ 25 - 5
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/customerInfoMapper.xml

@@ -1097,7 +1097,11 @@ LEFT JOIN tb_rst_sales_order_item soi ON soi.item_order_id = oi.sales_id
     <where>
       oi.sales_shipping_status = 1
       <if test="itemColorBar != null and itemColorBar != ''" >
-        AND soi.item_color_bar = #{itemColorBar}
+        AND soi.item_color_bar in
+        <foreach collection="listColorBar" item="colorBar" index="index"
+                 open="(" close=")" separator=",">
+          #{colorBar}
+        </foreach>
       </if>
       <if test="startDate!=null and startDate!='' ">
         AND oi.sales_create_time &gt; #{startDate}
@@ -1123,7 +1127,11 @@ LEFT JOIN tb_rst_sales_order_item soi ON soi.item_order_id = oi.sales_id
     <where>
       oi.sales_shipping_status = 1
       <if test="itemColorBar != null and itemColorBar != ''" >
-        AND soi.item_color_bar = #{itemColorBar}
+        AND soi.item_color_bar in
+        <foreach collection="listColorBar" item="colorBar" index="index"
+                                           open="(" close=")" separator=",">
+        #{colorBar}
+      </foreach>
       </if>
       <if test="startDate!=null and startDate!='' ">
         AND oi.sales_create_time &gt; #{startDate}
@@ -1153,7 +1161,11 @@ LEFT JOIN tb_rst_sales_order_item soi ON soi.item_order_id = oi.sales_id
     <where>
       oi.sales_shipping_status = 1
       <if test="itemColorBar != null and itemColorBar != ''" >
-        AND soi.item_color_bar = #{itemColorBar}
+        AND soi.item_color_bar in
+        <foreach collection="listColorBar" item="colorBar" index="index"
+                 open="(" close=")" separator=",">
+          #{colorBar}
+        </foreach>
       </if>
       <if test="startDate!=null and startDate!='' ">
         AND oi.sales_create_time &gt; #{startDate}
@@ -1183,7 +1195,11 @@ LEFT JOIN tb_rst_sales_order_item soi ON soi.item_order_id = oi.sales_id
     <where>
       oi.sales_shipping_status = 1
       <if test="itemColorBar != null and itemColorBar != ''" >
-        AND soi.item_color_bar = #{itemColorBar}
+        AND soi.item_color_bar in
+        <foreach collection="listColorBar" item="colorBar" index="index"
+                 open="(" close=")" separator=",">
+          #{colorBar}
+        </foreach>
       </if>
       <if test="startDate!=null and startDate!='' ">
         AND oi.sales_create_time &gt; #{startDate}
@@ -1217,7 +1233,11 @@ LEFT JOIN tb_rst_sales_order_item soi ON soi.item_order_id = oi.sales_id
     <where>
       oi.sales_shipping_status = 1
       <if test="itemColorBar != null and itemColorBar != ''" >
-        AND soi.item_color_bar = #{itemColorBar}
+        AND soi.item_color_bar in
+        <foreach collection="listColorBar" item="colorBar" index="index"
+                 open="(" close=")" separator=",">
+          #{colorBar}
+        </foreach>
       </if>
       <if test="startDate!=null and startDate!='' ">
         AND oi.sales_create_time &gt; #{startDate}

+ 4 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -2215,6 +2215,10 @@ public class AdminCustomerController {
             c.set(Calendar.SECOND, 59);
             salesOrder.setEndDate(c.getTime());
         }
+        if(salesOrder.getItemColorBar() != null && !salesOrder.getItemColorBar().equals("")){
+            List<String> listColorBar = Arrays.asList(salesOrder.getItemColorBar().split(","));
+            salesOrder.setListColorBar(listColorBar);
+        }
         /*销售总数*/
         List<ReturnStatisticsInfo> listTotalSales = customerService.salesTotalSales(salesOrder);
         /*总换货*/

+ 31 - 9
watero-rst-web/src/main/webapp/WEB-INF/views/cm/report/return_statistics.ftl

@@ -81,15 +81,22 @@
                              <option value="">产品</option>
                         <#if productColorList?? &&  (productColorList?size > 0) >
                             <#list productColorList as productColorInfo>
-                                <option value ="${productColorInfo.colorBar!""}">${productColorInfo.productName!""}</option>
+                                <option value ="${productColorInfo.colorBar!""}">${productColorInfo.productName!""} - ${productColorInfo.colorName!""}(${productColorInfo.colorBar!""})</option>
                             </#list>
                         </#if>
                         </select>
                         </span>
+
+                    </div>
+                    <div class="formControls col-2 col-sm-2" >
+                        <input id="colorBars" name="colorBars" type="text" class="input-text" placeholder="请选择产品">
+                    </div>
+                    <div class="formControls col-1 col-sm-1" >
+                        <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" onclick="seleteBar();" id="" name="">删除</button>
                     </div>
                     <div class="formControls col-3 col-sm-3" >
-                     <input type="text" style="width:120px;height:36px;margin-right: 0px;margin-bottom: 10px;" name="startTime" id="startTime" class="input-text" placeholder="开始时间" onClick="WdatePicker({startDate: '%y-01-01 00:00:00' ,dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate: true })" value="${(customerInfo.startTime?string("yyyyy-MM-dd HH:mm:ss"))!''}" readonly="readonly"/>-
-                     <input type="text" style="width:120px;height:36px;margin-right: 0px;margin-bottom: 10px;" name="endTime" id="endTime" class="input-text" placeholder="结束时间" onClick="WdatePicker({startDate: '%y-01-01 00:00:00' ,dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate: true })" value="${(customerInfo.endTime?string("yyyy-MM-dd HH:mm:ss"))!''}" readonly="readonly"/>
+                     <input type="text" style="width:120px;height:36px;margin-right: 0px;margin-bottom: 10px;" name="startDate" id="startDate" class="input-text" placeholder="开始时间" onClick="WdatePicker({startDate: '%y-01-01 00:00:00' ,dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate: true })" value="" readonly="readonly"/>-
+                     <input type="text" style="width:120px;height:36px;margin-right: 0px;margin-bottom: 10px;" name="endDate" id="endDate" class="input-text" placeholder="结束时间" onClick="WdatePicker({startDate: '%y-01-01 00:00:00' ,dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate: true })" value="" readonly="readonly"/>
                     </div>
                      <div class="formControls col-1 col-sm-1" >
                          <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" onclick="statistical();" id="" name="">搜索</button>
@@ -147,20 +154,35 @@
         statistical();
     })
 
+    $("#itemColorBar").on("change",function () {
+        var selected=$(this).children('option:selected').val();
+        if($("#colorBars").val() == null || $("#colorBars").val() == ""){
+            $("#colorBars").val(selected);
+        }else{
+            $("#colorBars").val($("#colorBars").val()+","+selected);
+        }
+    });
+    function seleteBar() {
+        var strs= new Array();
+        var colorBars = $("#colorBars").val();
+        strs = colorBars.split(",");
+        strs.pop();
+        $("#colorBars").val(strs);
+    }
     /**
      * 搜索订单
      */
     function statistical(){
         var salesStoreId = convertUndefinedToEmpty($("#salesStoreId").val());
-        var startTime = convertUndefinedToEmpty($("#startTime").val());
-        var endTime = convertUndefinedToEmpty($("endTime").val());
-        var itemColorBar = convertUndefinedToEmpty($("itemColorBar").val());
+        var startDate = convertUndefinedToEmpty($("#startDate").val());
+        var endDate = convertUndefinedToEmpty($("#endDate").val());
+        var itemColorBar = convertUndefinedToEmpty($("#colorBars").val());
         $.ajax({
             type: "POST",
             data: {
                 salesStoreId : salesStoreId,
-                startTime : startTime,
-                endTime : endTime,
+                startDate : startDate,
+                endDate : endDate,
                 itemColorBar : itemColorBar
             },
             url: "${path}/admin/customer/return_statistics",
@@ -178,7 +200,7 @@
                         //总退换货率计算
                         /*alert(returnStatisticsInfo.totalSales+" "+returnStatisticsInfo.totalExchange+" "+returnStatisticsInfo.totalReturn+" "+returnStatisticsInfo.secondaryChangeNew+" "+returnStatisticsInfo.returnForSecond);*/
                         html += '<tr class="text-c">' +
-                                ' <td>'+ returnStatisticsInfo.months +'</td>' +
+                                ' <td>'+ returnStatisticsInfo.months +'</td>' +
                                 ' <td>'+ returnStatisticsInfo.totalSales +'</td>' +
                                 ' <td>'+ (Number(returnStatisticsInfo.totalSales)-(Number(returnStatisticsInfo.totalExchange) - Number(returnStatisticsInfo.totalReturn)))  +'</td>' +
                                 ' <td>'+ toDecimal(Number((returnStatisticsInfo.totalExchange + returnStatisticsInfo.totalReturn))/Number(returnStatisticsInfo.totalSales)* 100)  +'%</td>' +