瀏覽代碼

Merge branch 'master' of lsp/kmall-pt-general into master

肖文浩 4 年之前
父節點
當前提交
a75ca8e6d5

+ 18 - 9
kmall-admin/src/main/java/com/kmall/admin/controller/SalesDataUploadController.java

@@ -1,20 +1,18 @@
 package com.kmall.admin.controller;
 
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.net.InetAddress;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 import com.kmall.admin.entity.SalesDataDownloadEntity;
 import com.kmall.admin.entity.SalesDataUploadEntity;
 import com.kmall.admin.fromcomm.entity.SysUserEntity;
 import com.kmall.admin.service.SalesDataUploadService;
+import com.kmall.admin.utils.ParamUtils;
 import com.kmall.admin.utils.ShiroUtils;
 import com.kmall.common.fileserver.util.FileManager;
 import com.kmall.common.utils.*;
-import com.kmall.common.utils.excel.FileUtil;
-import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.apache.tools.ant.util.FileUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
@@ -41,6 +39,7 @@ public class SalesDataUploadController {
 //    @RequiresPermissions("salesdataupload:list")
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "shopSN", "merchSN", "thirdMerchSN");
         //查询列表数据
         Query query = new Query(params);
 
@@ -94,7 +93,7 @@ public class SalesDataUploadController {
     @RequestMapping("/delete")
 //    @RequiresPermissions("salesdataupload:delete")
     @ResponseBody
-    public R delete(@RequestBody Integer[]fileIds) {
+    public R delete(@RequestBody Integer[] fileIds) {
         salesDataUploadService.deleteBatch(fileIds);
 
         return R.ok();
@@ -120,7 +119,7 @@ public class SalesDataUploadController {
      */
     @RequestMapping("/upload")
     @ResponseBody
-    public R upload(@RequestParam("file") MultipartFile file) throws Exception {
+    public R upload(@RequestParam("file") MultipartFile file,@RequestParam Map<String, Object> params) throws Exception {
         if (file.isEmpty()) {
             throw new RRException("上传文件不能为空");
         }
@@ -134,6 +133,13 @@ public class SalesDataUploadController {
         salesDataUploadEntity.setUploadAddress(url);
         salesDataUploadEntity.setCreaterSn(ShiroUtils.getUserId().intValue());
         salesDataUploadEntity.setCreaterTime(new Date());
+        salesDataUploadEntity.setMerchSN((String) params.get("merchSN"));
+        salesDataUploadEntity.setThirdMerchSN((String) params.get("thirdMerchSN"));
+        salesDataUploadEntity.setShopSN((String) params.get("shopSN"));
+
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        salesDataUploadEntity.setBillTime(sdf.parse((String) params.get("billTime")));
+        salesDataUploadEntity.setCheckTime(sdf.parse((String) params.get("checkTime")));
         salesDataUploadService.save(salesDataUploadEntity);
 
         R r = R.ok();
@@ -155,9 +161,12 @@ public class SalesDataUploadController {
             salesDataDownloadEntity.setFileId(Integer.valueOf(fileId));
             salesDataDownloadEntity.setDownloadSn(ShiroUtils.getUserId().intValue());
             salesDataDownloadEntity.setDownloadTime(new Date());
+
+            InetAddress localHost = InetAddress.getLocalHost();
+            salesDataDownloadEntity.setDownloadIP(localHost.getHostAddress());
             salesDataUploadService.saveSalesDownload(salesDataDownloadEntity);
 
-            return FileManager.download(filePath, fileName);
+            return FileManager.download(filePath, fileName.substring(0,fileName.lastIndexOf(".")));
         }
         return null;
     }

+ 2 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/SalesDataUploadDao.java

@@ -4,6 +4,7 @@ import com.kmall.admin.entity.SalesDataDownloadEntity;
 import com.kmall.admin.entity.SalesDataUploadEntity;
 import com.kmall.manager.dao.BaseDao;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -17,4 +18,5 @@ public interface SalesDataUploadDao extends BaseDao<SalesDataUploadEntity> {
 
     int saveSalesDownload(SalesDataDownloadEntity salesDataDownload);
 
+    List<SalesDataUploadEntity> queryObjects(Integer[] fileIds);
 }

+ 12 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/SalesDataDownloadEntity.java

@@ -23,6 +23,10 @@ public class SalesDataDownloadEntity implements Serializable {
      */
     private Integer fileId;
     /**
+     * 下载人IP
+     */
+    private String downloadIP;
+    /**
      * 下载人编号
      */
     private Integer downloadSn;
@@ -83,4 +87,12 @@ public class SalesDataDownloadEntity implements Serializable {
     public Date getDownloadTime() {
         return downloadTime;
     }
+
+    public String getDownloadIP() {
+        return downloadIP;
+    }
+
+    public void setDownloadIP(String downloadIP) {
+        this.downloadIP = downloadIP;
+    }
 }

+ 61 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/SalesDataUploadEntity.java

@@ -42,6 +42,27 @@ public class SalesDataUploadEntity implements Serializable {
      * 加入时间
      */
     private Date createrTime;
+    /**
+     * 账单时间
+     */
+    private Date billTime;
+    /**
+     * 核对时间
+     */
+    private Date checkTime;
+    /**
+     * 商户编号
+     */
+    private String merchSN;
+    /**
+     * 第三方商户编号
+     */
+    private String thirdMerchSN;
+    /**
+     * 门店编号
+     */
+    private String shopSN;
+
 
     /**
      * 设置:上传文件编号
@@ -129,4 +150,44 @@ public class SalesDataUploadEntity implements Serializable {
     public void setUsername(String username) {
         this.username = username;
     }
+
+    public Date getBillTime() {
+        return billTime;
+    }
+
+    public void setBillTime(Date billTime) {
+        this.billTime = billTime;
+    }
+
+    public Date getCheckTime() {
+        return checkTime;
+    }
+
+    public void setCheckTime(Date checkTime) {
+        this.checkTime = checkTime;
+    }
+
+    public String getMerchSN() {
+        return merchSN;
+    }
+
+    public void setMerchSN(String merchSN) {
+        this.merchSN = merchSN;
+    }
+
+    public String getShopSN() {
+        return shopSN;
+    }
+
+    public void setShopSN(String shopSN) {
+        this.shopSN = shopSN;
+    }
+
+    public String getThirdMerchSN() {
+        return thirdMerchSN;
+    }
+
+    public void setThirdMerchSN(String thirdMerchSN) {
+        this.thirdMerchSN = thirdMerchSN;
+    }
 }

+ 7 - 0
kmall-admin/src/main/java/com/kmall/admin/service/SalesDataUploadService.java

@@ -77,4 +77,11 @@ public interface SalesDataUploadService {
      * @return
      */
     int saveSalesDownload(SalesDataDownloadEntity salesDataDownload);
+
+    /**
+     * 根据主键查询实体
+     * @param fileIds
+     * @return
+     */
+    List<SalesDataUploadEntity> queryObjects(Integer[] fileIds);
 }

+ 2 - 2
kmall-admin/src/main/java/com/kmall/admin/service/impl/PickUpCodeServiceImpl.java

@@ -51,11 +51,11 @@ public class PickUpCodeServiceImpl implements PickUpCodeService {
 
         String pickUpCodeSn = pickUpCodeDao.queryMaxPickUpCode(nowTime);
         if(pickUpCodeSn == null){
-            pickUpCodeSn = "000001";
+            pickUpCodeSn = "0001";
         }else{
             AtomicInteger integer = new AtomicInteger(Integer.valueOf(pickUpCodeSn.substring(pickUpCodeSn.indexOf("-")+1)));
             int i = integer.incrementAndGet();
-            pickUpCodeSn= String.format("%06d", i);
+            pickUpCodeSn= String.format("%04d", i);
         }
 
 

+ 5 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/SalesDataUploadServiceImpl.java

@@ -61,4 +61,9 @@ public class SalesDataUploadServiceImpl implements SalesDataUploadService {
     public int saveSalesDownload(SalesDataDownloadEntity salesDataDownload) {
         return salesDataUploadDao.saveSalesDownload(salesDataDownload);
     }
+
+    @Override
+    public List<SalesDataUploadEntity> queryObjects(Integer[] fileIds) {
+        return salesDataUploadDao.queryObjects(fileIds);
+    }
 }

+ 0 - 2
kmall-admin/src/main/java/com/kmall/admin/websocket/WebSocketServer.java

@@ -79,7 +79,6 @@ public class WebSocketServer {
             // 查询所有的取货码
         Map<String,Object> dataParam = new HashMap<>();
         dataParam.put("pickUpCodeCreatetime",new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
-        dataParam.put("unEqualPickUpCodeStatus", "5");
 //        dataParam.put("pickUpCodeStatus","0");
         pickUpList = pickUpCodeService.queryList(dataParam);
         pickUpCodeMap.put(param,pickUpList);
@@ -156,7 +155,6 @@ public class WebSocketServer {
                 if("broadcast".equalsIgnoreCase(message)){
                     Map<String,Object> dataParam = new HashMap<>();
                     dataParam.put("pickUpCodeCreatetime",new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
-                    dataParam.put("unEqualPickUpCodeStatus", "5");
                     List<PickUpCodeEntity> pickUpList = pickUpCodeService.queryList(dataParam);
                     data.put("pickUpCodeList", pickUpList);
                     String info = JSONObject.toJSONString(data);

+ 3 - 3
kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml

@@ -2021,13 +2021,13 @@
             AND o.pay_name LIKE concat('%',#{payName},'%')
         </if>
         <if test="payMobile != null and payMobile.trim() != ''">
-            AND o.pay_mobile LIKE concat('%',#{pay_mobile},'%')
+            AND o.pay_mobile LIKE concat('%',#{payMobile},'%')
         </if>
         <if test="startTime != null and startTime.trim() != ''">
-            AND o.add_time &gt;= #{startTime}
+            AND c.pick_up_code_createtime &gt;= #{startTime}
         </if>
         <if test="endTime != null and endTime.trim() != ''">
-            AND o.add_time &lt; #{endTime}
+            AND c.pick_up_code_createtime &lt;= #{endTime}
         </if>
         order by o.id desc
     </select>

+ 0 - 3
kmall-admin/src/main/resources/mybatis/mapper/PickUpCodeDao.xml

@@ -66,9 +66,6 @@
 		<if test="pickUpCodeStatus != null and pickUpCodeStatus.trim() != ''">
 			AND `pick_up_code_status` = #{pickUpCodeStatus}
 		</if>
-		<if test="unEqualPickUpCodeStatus != null and unEqualPickUpCodeStatus.trim() != ''">
-			AND `pick_up_code_status` != #{unEqualPickUpCodeStatus}
-		</if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}

+ 64 - 4
kmall-admin/src/main/resources/mybatis/mapper/SalesDataUploadDao.xml

@@ -10,6 +10,11 @@
         <result property="uploadAddress" column="upload_address"/>
         <result property="createrSn" column="creater_sn"/>
         <result property="createrTime" column="creater_time"/>
+		<result property="billTime" column="bill_time"/>
+		<result property="checkTime" column="check_time"/>
+		<result property="merchSN" column="merch_sn"/>
+		<result property="shopSN" column="shop_sn"/>
+		<result property="thirdMerchSN" column="third_merch_sn"/>
     </resultMap>
 
 	<select id="queryObject" resultType="com.kmall.admin.entity.SalesDataUploadEntity">
@@ -35,6 +40,11 @@
 			u.upload_address,
 			u.creater_sn,
 			u.creater_time,
+			u.bill_time,
+			u.check_time,
+			u.merch_sn,
+			u.third_merch_sn,
+			u.shop_sn,
 			su.username
 		from mall_sales_data_upload u
 		left join sys_user su
@@ -49,6 +59,15 @@
 		<if test="endTime != null and endTime.trim() != ''">
 			AND u.creater_time &lt;= #{endTime}
 		</if>
+		<if test="merchSN != null and merchSN.trim() != ''">
+			AND u.merch_sn = #{merchSN}
+		</if>
+		<if test="thirdMerchSN != null and thirdMerchSN.trim() != ''">
+			AND u.third_merch_sn = #{thirdMerchSN}
+		</if>
+		<if test="shopSN != null and shopSN.trim() != ''">
+			AND u.shop_sn = #{shopSN}
+		</if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}
@@ -69,11 +88,40 @@
             AND file_name LIKE concat('%',#{name},'%')
         </if>
 		<if test="startTime != null and startTime.trim() != ''">
-			AND u.creater_time >= #{startTime}
+			AND creater_time >= #{startTime}
 		</if>
 		<if test="endTime != null and endTime.trim() != ''">
-			AND u.creater_time &lt;= #{endTime}
+			AND creater_time &lt;= #{endTime}
+		</if>
+		<if test="merchSN != null and merchSN.trim() != ''">
+			AND merch_sn = #{merchSN}
+		</if>
+		<if test="thirdMerchSN != null and thirdMerchSN.trim() != ''">
+			AND third_merch_sn = #{thirdMerchSN}
 		</if>
+		<if test="shopSN != null and shopSN.trim() != ''">
+			AND shop_sn = #{shopSN}
+		</if>
+	</select>
+
+    <select id="queryObjects" resultType="com.kmall.admin.entity.SalesDataUploadEntity">
+		select
+			file_id,
+			file_name,
+			file_type,
+			upload_address,
+			creater_sn,
+			creater_time,
+			bill_time,
+			check_time,
+			merch_sn,
+			third_merch_sn,
+			shop_sn
+		from mall_sales_data_upload
+		where file_id in
+		<foreach item="fileId" collection="array" open="(" separator="," close=")">
+			#{fileId}
+		</foreach>
 	</select>
 
     <insert id="save" parameterType="com.kmall.admin.entity.SalesDataUploadEntity" useGeneratedKeys="true" keyProperty="fileId">
@@ -82,21 +130,33 @@
 			`file_type`,
 			`upload_address`,
 			`creater_sn`,
-			`creater_time`)
+			`creater_time`,
+			`bill_time`,
+			`check_time`,
+			`merch_sn`,
+			`third_merch_sn`,
+			`shop_sn`)
 		values(
 			#{fileName},
 			#{fileType},
 			#{uploadAddress},
 			#{createrSn},
-			#{createrTime})
+			#{createrTime},
+			#{billTime},
+			#{checkTime},
+			#{merchSN},
+			#{thirdMerchSN},
+			#{shopSN})
 	</insert>
 	<insert id="saveSalesDownload" parameterType="com.kmall.admin.entity.SalesDataDownloadEntity" useGeneratedKeys="true" keyProperty="id">
 		insert into mall_sales_data_download(
 			`file_id`,
+			`download_ip`,
 			`download_sn`,
 			`download_time`)
 		values(
 			#{fileId},
+			#{downloadIP},
 			#{downloadSn},
 			#{downloadTime})
 	</insert>

+ 15 - 13
kmall-admin/src/main/webapp/WEB-INF/page/pcd/hbk6zzez.html

@@ -6,37 +6,39 @@
 </head>
 <body>
 <div id="rrapp" v-cloak>
-	<div v-show="showList" class="col-md-12">
+    <div v-show="showList" class="col-md-12">
         <div class="row-fluid">
-            <div class="col-md-4">
-                <h2 class="text-center" style="border: white;background-color: #F5DCB3;padding: 8px;font-weight: 600;" >清关成功,可取货</h2><br/>
+            <div class="col-md-3">
+                <br/><h2 class="text-center" style="border: white;background-color: #F5DCB3;padding: 8px;font-weight: 600;" >待清关,请等待</h2><br/>
                 <div class="row" style="border: white;background-color: #f0f0f0; overflow: auto; height: 750px;">
-                    <div class="col-xs-4 col-sm-4" v-for="item in pickUpCodeList" v-if="item.pickUpCodeStatus == 1" style="margin-bottom: 12px;">
-                        <i-button data-toggle="modal" style="background-color:#83e7b4;width: 100px;font-family: 微软雅黑;height: 50px;font-size: 20px;" v-if="item.pickUpCodeStatus == 1" >{{item.pickUpCodeSn}}</i-button>
+                    <div class="col-xs-6 col-sm-6" v-for="item in pickUpCodeList" v-if="item.pickUpCodeStatus == 0" style="margin-bottom: 12px;padding-left: 10px;">
+                        <i-button data-toggle="modal" style="width: 110px;font-family: 微软雅黑;height: 50px;font-size: 17px; font-weight: 600;" v-if="item.pickUpCodeStatus == 0" >{{item.pickUpCodeSn}}</i-button>
                     </div>
                 </div>
             </div>
+
             <div class="col-md-3">
-                <h2 class="text-center" style="border: white;background-color: #F5DCB3;padding: 8px;font-weight: 600;" >清关成功,待取货</h2><br/>
+                <br/><h2 class="text-center" style="border: white;background-color: #F5DCB3;padding: 8px;font-weight: 600;" >清关成功,待取货</h2><br/>
                 <div class="row" style="border: white;background-color: #f0f0f0; overflow: auto; height: 750px;">
                     <div class="col-xs-6 col-sm-6" v-for="item in pickUpCodeList" v-if="item.pickUpCodeStatus == 2" style="margin-bottom: 12px;padding-left: 10px;">
-                        <i-button data-toggle="modal" style="background-color:#808080;width: 110px;font-family: 微软雅黑;height: 50px;font-size: 20px;color: white;" v-if="item.pickUpCodeStatus == 2" >{{item.pickUpCodeSn}}</i-button>
+                        <i-button data-toggle="modal" style="background-color:#808080;width: 110px;font-family: 微软雅黑;height: 50px;font-size: 17px; font-weight: 600;color: white;" v-if="item.pickUpCodeStatus == 2" >{{item.pickUpCodeSn}}</i-button>
                     </div>
                 </div>
             </div>
-            <div class="col-md-3">
-                <h2 class="text-center" style="border: white;background-color: #F5DCB3;padding: 8px;font-weight: 600;" >待清关,请等待</h2><br/>
+
+            <div class="col-md-4">
+                <br/><h2 class="text-center" style="border: white;background-color: #F5DCB3;padding: 8px;font-weight: 600;" >清关成功,可取货</h2><br/>
                 <div class="row" style="border: white;background-color: #f0f0f0; overflow: auto; height: 750px;">
-                    <div class="col-xs-6 col-sm-6" v-for="item in pickUpCodeList" v-if="item.pickUpCodeStatus == 0" style="margin-bottom: 12px;padding-left: 10px;">
-                        <i-button data-toggle="modal" style="width: 110px;font-family: 微软雅黑;height: 50px;font-size: 20px;" v-if="item.pickUpCodeStatus == 0" >{{item.pickUpCodeSn}}</i-button>
+                    <div class="col-xs-4 col-sm-4" v-for="item in pickUpCodeList" v-if="item.pickUpCodeStatus == 1" style="margin-bottom: 12px;">
+                        <i-button data-toggle="modal" style="background-color:#83e7b4;width: 100px;font-family: 微软雅黑;height: 50px;font-size: 17px; font-weight: 600;" v-if="item.pickUpCodeStatus == 1" >{{item.pickUpCodeSn}}</i-button>
                     </div>
                 </div>
             </div>
             <div class="col-md-2">
-                <h2 class="text-center" style="border: white;background-color: #F5DCB3;padding: 8px;font-weight: 600;" >清关失败</h2><br/>
+                <br/><h2 class="text-center" style="border: white;background-color: #F5DCB3;padding: 8px;font-weight: 600;" >清关失败</h2><br/>
                 <div class="row" style="border: white;background-color: #f0f0f0; overflow: auto; height: 750px;">
                     <div class="col-xs-12 col-sm-12" v-for="item in pickUpCodeList" v-if="item.pickUpCodeStatus == 4" style="margin-bottom: 12px;">
-                        <i-button data-toggle="modal" style="background-color:#FF0000;width: 110px;font-family: 微软雅黑;height: 50px;font-size: 20px;color: white;" v-if="item.pickUpCodeStatus == 4" >{{item.pickUpCodeSn}}</i-button>
+                        <i-button data-toggle="modal" style="background-color:#FF0000;width: 110px;font-family: 微软雅黑;height: 50px;font-size: 17px;color: white;font-weight: 600" v-if="item.pickUpCodeStatus == 4" >{{item.pickUpCodeSn}}</i-button>
                     </div>
                 </div>
             </div>

+ 1 - 1
kmall-admin/src/main/webapp/WEB-INF/page/sale/pickupcode.html

@@ -45,7 +45,7 @@
 <!--	    <div id="jqGridPager"></div>-->
         <div class="col-md-12">
             <div class="row" style="border: white;background-color: #f0f0f0;height: 800px;overflow: auto;">
-                <div class="col-xs-2 col-sm-2" v-for="item in pickUpCodeList" style="margin-bottom: 8px;">
+                <div class="col-xs-2 col-sm-2" v-for="item in pickUpCodeList" style="margin-bottom: 8px;" v-if="item.pickUpCodeStatus != 3">
                     <i-button data-toggle="modal" data-target="#orderDetail" style="width: 110px;font-family: 微软雅黑" @click="queryOrderDetail(item.orderSn,item.pickUpCodeSn)" v-if="item.pickUpCodeStatus == 0" >{{item.pickUpCodeSn}}</i-button>
                     <i-button data-toggle="modal" data-target="#orderDetail" style="background-color:#83e7b4;width: 110px;font-family: 微软雅黑" @click="queryOrderDetail(item.orderSn,item.pickUpCodeSn)" v-if="item.pickUpCodeStatus == 1" >{{item.pickUpCodeSn}}</i-button>
                     <i-button data-toggle="modal" data-target="#orderDetail" style="background-color:#808080;width: 110px;font-family: 微软雅黑" @click="queryOrderDetail(item.orderSn,item.pickUpCodeSn)" v-if="item.pickUpCodeStatus == 2" >{{item.pickUpCodeSn}}</i-button>

+ 2 - 1
kmall-admin/src/main/webapp/WEB-INF/page/sale/sale.html

@@ -90,7 +90,7 @@
                 </div>
                 <div v-show="prodBarcode" class="search_menu">
                     <ul>
-                        <li v-for="item in searchGoodsList" :key="item.id" @click="searchQuery(item.prodBarcode)" title="item.prodBarcode">
+                        <li v-for="item in searchGoodsList" :key="item.id" @click="searchQuery(item.prodBarcode)">
                             {{item.name}}
                         </li>
                     </ul>
@@ -256,6 +256,7 @@
                         <i-button data-toggle="modal" data-target="#orderDetail" style="background-color:#83e7b4;width: 110px;font-family: 微软雅黑" @click="queryOrderDetail(item.orderSn,item.pickUpCodeSn)" v-if="item.pickUpCodeStatus == 1" >{{item.pickUpCodeSn}}</i-button>
                         <i-button data-toggle="modal" data-target="#orderDetail" style="background-color:#808080;width: 110px;font-family: 微软雅黑" @click="queryOrderDetail(item.orderSn,item.pickUpCodeSn)" v-if="item.pickUpCodeStatus == 2" >{{item.pickUpCodeSn}}</i-button>
                         <i-button data-toggle="modal" data-target="#orderDetail" style="background-color:#FF0000;width: 110px;font-family: 微软雅黑" @click="queryOrderDetail(item.orderSn,item.pickUpCodeSn)" v-if="item.pickUpCodeStatus == 4" >{{item.pickUpCodeSn}}</i-button>
+                        <i-button data-toggle="modal" data-target="#orderDetail" style="background-color:#ffc800;width: 110px;font-family: 微软雅黑" @click="queryOrderDetail(item.orderSn,item.pickUpCodeSn)" v-if="item.pickUpCodeStatus == 5" >{{item.pickUpCodeSn}}</i-button>
                     </div>
                 </div>
             </div>

+ 47 - 7
kmall-admin/src/main/webapp/WEB-INF/page/sale/salesdataupload.html

@@ -32,13 +32,7 @@
                 <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                 #end-->
                 <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
-                <i-col style="display: inline-grid;">
-                    <Upload :show-upload-list="false" :on-success="uploadExcelSuccess" :on-error="uploadExcelError" :on-format-error="uploadExcelFormatError"
-                            :format="['xlsx','xls']"
-                            action="../salesdataupload/upload">
-                        <i-button type="ghost" icon="ios-cloud-upload-outline">销售数据导入</i-button>
-                    </Upload>
-                </i-col>
+                <i-button type="ghost" @click="upload" icon="ios-cloud-upload-outline">&nbsp;销售数据导入</i-button>
                 <i-button type="primary" @click="download"><i class="fa fa-cloud-download"></i>&nbsp;下载</i-button>
             </div>
         </Row>
@@ -46,6 +40,52 @@
 	    <div id="jqGridPager"></div>
     </div>
 
+    <div class="modal fade" id="salesDataFormDiv"  role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
+        <div class="modal-dialog">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+                    <h4 class="modal-title" id="exampleModalLabel">上传数据</h4>
+                </div>
+                <div class="modal-body">
+                    <form id="salesDataUploadForm">
+                        <div class="form-group">
+                            账单时间:<Date-picker v-model="billTime" placeholder="账单时间"/>
+                        </div>
+                        <div class="form-group">
+                            核对时间:<Date-picker v-model="checkTime" placeholder="核对时间"/>
+                        </div>
+                        <div class="form-group">
+                            商户名称:<i-select v-model="merchSN" filterable placeholder="商户" @on-change="changeMerch" label-in-value style="width:300px;">
+                                <i-option v-for="merch in merchList" :value="merch.merchSn" :key="merch.merchSn">{{merch.merchName}}</i-option>
+                            </i-select>
+                        </div>
+                        <div class="form-group">
+                            三分商户:<i-select v-model="thirdMerchSN" filterable placeholder="第三方商户" @on-change="changeThirdMerchantBiz" label-in-value style="width:300px;">
+                                <i-option v-for="thirdMerchant in thirdMerchantBizList" :value="thirdMerchant.thirdPartyMerchCode"
+                                          :key="thirdMerchant.thirdPartyMerchCode">{{thirdMerchant.thirdPartyMerchName}}</i-option>
+                            </i-select>
+                        </div>
+                        <div class="form-group">
+                            门店名称:<i-select v-model="shopSN" filterable placeholder="门店" label-in-value style="width:300px;">
+                                <i-option v-for="store in storeList" :value="store.id" :key="store.id">{{store.storeName}}</i-option>
+                            </i-select>
+                        </div>
+                        <div class="form-group">
+                            <input type="file" name="file" id="file">
+                            <br>
+                            <span style="display: block;">温馨提示: 请选择Excel文件进行导入</span>
+                        </div>
+                    </form>
+                </div>
+                <div class="modal-footer">
+                    <button type="button" id="cancel" class="btn btn-default" data-dismiss="modal">取消</button>
+                    <button type="button" class="btn btn-primary" @click="uploadFormSubmit">确认</button>
+                </div>
+            </div>
+        </div>
+    </div>
+
     <Card v-show="!showList">
         <p slot="title">{{title}}</p>
 		<i-form ref="formValidate" :model="salesDataUpload" :rules="ruleValidate" :label-width="80">

+ 11 - 12
kmall-admin/src/main/webapp/js/sale/pickupcode.js

@@ -206,7 +206,7 @@ let vm = new Vue({
 				startTime: '',
 				endTime: ''
             }
-            vm.reload();
+            vm.pickUpCodeList = {};
 		},
 		reload: function () {
 			if(!vm.q.startTime || !vm.q.endTime){
@@ -219,8 +219,8 @@ let vm = new Vue({
 				'orderSn': vm.q.orderSn,
 				'payName': vm.q.payName,
 				'payMobile': vm.q.payMobile,
-				'startTime': vm.timestampToDate(vm.q.startTime),
-				'endTime': vm.timestampToDate(vm.q.endTime)
+				'startTime': new Date(vm.q.startTime).dateFormat('yyyy-MM-dd hh:mm:ss'),
+				'endTime': new Date(vm.q.endTime).dateFormat('yyyy-MM-dd')+' 23:59:59'
 			}
 			$.ajax({
 				type: "POST",
@@ -257,12 +257,6 @@ let vm = new Vue({
         handleReset: function (name) {
             handleResetForm(this, name);
         },
-		timestampToDate: function (timestamp){
-			if(timestamp){
-				return new Date(timestamp).toLocaleDateString().replace(/\//g, '-')
-			}
-			return '';
-		},
 		//订单详情
 		queryOrderDetail:function(orderSn,pickUpCode){
 			var storeId = sessionStorage.getItem("storeId");
@@ -506,7 +500,10 @@ function printArea(content) {
 		+ '</div>');
 	doc.close();
 	var frameWindow = iframe.contentWindow;
-	if(!vm.firstPrint){
+	frameWindow.focus();
+	frameWindow.print();
+	alert('打印小票完成');
+	/*if(!vm.firstPrint){
 		setTimeout(function() {
 			// frameWindow.close();
 			frameWindow.focus();
@@ -521,9 +518,11 @@ function printArea(content) {
 		frameWindow.print();
 		frameWindow.print();
 		alert('打印小票完成');
-	}
+	}*/
 }
-
+var removePrintArea = function (id) {
+	$("iframe#" + id).remove();
+};
 function parsedate(value){
 	var date = new Date(value);
 	var year = date.getFullYear();

+ 103 - 35
kmall-admin/src/main/webapp/js/sale/salesdataupload.js

@@ -8,6 +8,16 @@ $(function () {
 			{label: '文件类型', name: 'fileType', index: 'file_type', width: 80, align: 'center'},
 			{label: '上传地址', name: 'uploadAddress', index: 'upload_address', width: 80 ,align: 'center'},
 			{label: '添加人', name: 'username', index: 'username', width: 80, align: 'center'},
+			{label: '账单时间', name: 'billTime', index: 'bill_time', width: 80, align: 'center',
+				formatter: function (value) {
+					return transDate(value, 'yyyy-MM-dd');
+				}
+			},
+			{label: '核对时间', name: 'checkTime', index: 'check_time', width: 80, align: 'center',
+				formatter: function (value) {
+					return transDate(value, 'yyyy-MM-dd');
+				}
+			},
 			{label: '上传时间', name: 'createrTime', index: 'creater_time', width: 80, align: 'center',
 				formatter: function (value) {
 					return transDate(value, 'yyyy-MM-dd hh:mm:ss');
@@ -45,16 +55,24 @@ let vm = new Vue({
         showList: true,
         title: null,
 		salesDataUpload: {},
-		/*ruleValidate: {
+		ruleValidate: {
 			name: [
 				{required: true, message: '名称不能为空', trigger: 'blur'}
 			]
-		},*/
+		},
 		q: {
 		    name: '',
 			startTime: '',
 			endTime: ''
-		}
+		},
+		billTime: '',
+		checkTime: '',
+		merchSN: '',
+		thirdMerchSN: '',
+		shopSN: '',
+		merchList: [],
+		thirdMerchantBizList: [],
+		storeList: []
 	},
 	methods: {
 		query: function () {
@@ -124,24 +142,21 @@ let vm = new Vue({
 		},
         reloadSearch: function() {
             vm.q = {
-                name: ''
+                name: '',
+				startTime: '',
+				endTime: ''
             }
             vm.reload();
 		},
 		reload: function (event) {
 			vm.showList = true;
 
-			if(!vm.q.startTime && !vm.q.endTime){
-				alert("请选择上传时间!");
-				return;
-			}
-
             let page = $("#jqGrid").jqGrid('getGridParam', 'page');
 			$("#jqGrid").jqGrid('setGridParam', {
                 postData: {
                 	'name': vm.q.name,
-					'startTime': vm.timestampToDate(vm.q.startTime)+" 00:00:00",
-					'endTime': vm.timestampToDate(vm.q.endTime)+" 23:59:59"
+					'startTime': vm.q.startTime==''?'':new Date(vm.q.startTime).dateFormat('yyyy-MM-dd hh:mm:ss'),
+					'endTime': vm.q.endTime==''?'':new Date(vm.q.endTime).dateFormat('yyyy-MM-dd')+' 23:59:59'
 				},
                 page: page
             }).trigger("reloadGrid");
@@ -155,38 +170,91 @@ let vm = new Vue({
         handleReset: function (name) {
             handleResetForm(this, name);
         },
-		uploadExcelSuccess: function (data) {
-			if(data.code==0){
-				alert('导入成功', function (index) {
-					$("#jqGrid").trigger("reloadGrid");
-				});
-			}else{
-				alert(data.msg);
-			}
-		},
-		uploadExcelError: function () {
-			alert('上传出现异常,请重试!');
-		},
-		uploadExcelFormatError: function (file) {
-			this.$Notice.warning({
-				title: '文件格式不正确',
-				desc: '文件 ' + file.name + ' 格式不正确,请上传 xls 或 xlsx 格式的文件。'
-			});
-		},
 		download: function (event){
-			let fileIds = getSelectedRows();
+			let fileData = getSelectedRowData();
+			if (fileData.length != 1 && fileData.length != undefined){
+				return;
+			}
+			window.location.href = "../salesdataupload/download?filePath="+fileData.uploadAddress+"&fileName="+fileData.fileName+"&fileId="+fileData.fileId;
+			/*let fileIds = getSelectedRows();
 			if(null != fileIds && fileIds.length < 3){
 				for(let i=0; i<fileIds.length; i++){
 					let fileData = $("#jqGrid").jqGrid('getRowData', fileIds[i]);
 					window.location.href = "../salesdataupload/download?filePath="+fileData.uploadAddress+"&fileName="+fileData.fileName+"&fileId="+fileData.fileId;
 				}
-			}
+			}*/
 		},
-		timestampToDate: function (timestamp){
-			if(timestamp){
-				return new Date(timestamp).toLocaleDateString().replace(/\//g, '-')
+		upload: function (){
+			$('#salesDataFormDiv').modal('show');
+			vm.getMerchList();
+		},
+		uploadFormSubmit: function () {
+			debugger;
+			if(!vm.billTime){
+				alert("请选择账单时间");
+				return ;
+			}
+			if(!vm.checkTime){
+				alert("请选择核对时间");
+			}
+			let fileName = $('#file').val();
+			if(!fileName){
+				alert("选择上传文件");
+				return ;
 			}
-			return '';
+			if(fileName.lastIndexOf(".xlsx") == -1 || fileName.lastIndexOf(".xls") == -1){
+				fileName = fileName.substring(fileName.lastIndexOf("\\")+1);
+				alert("文件 " + fileName + " 格式不正确,请上传 xls 或 xlsx 格式的文件。");
+				return ;
+			}
+
+			let formData = new FormData();
+			formData.append("file", document.getElementById("file").files[0]);
+			formData.append("billTime", new Date(vm.billTime).dateFormat('yyyy-MM-dd hh:mm:ss'));
+			formData.append("checkTime", new Date(vm.checkTime).dateFormat('yyyy-MM-dd hh:mm:ss'));
+			formData.append("merchSN", vm.merchSN);
+			formData.append("thirdMerchSN", vm.thirdMerchSN);
+			formData.append("shopSN", vm.shopSN);
+
+			$.ajax({
+				async: false,
+				type: "POST",
+				url: "../salesdataupload/upload",
+				data: formData,
+				mimeType: "multipart/form-data",
+				contentType: false,
+				processData: false,
+				success: function (data) {
+					if(data.code==0){
+						$('#cancel').click();
+						alert('导入成功', function (index) {
+							$("#jqGrid").trigger("reloadGrid");
+						});
+					}else{
+						alert(data.msg);
+					}
+				}
+			});
+		},
+		getMerchList: function() {
+			$.get("../merch/queryAll", function (r) {
+				vm.merchList = r.list;
+			});
+		},
+		changeMerch: function(opt) {
+			var value = opt.value;
+			vm.getThirdMerchantBizList(value);
+		},
+		getThirdMerchantBizList: function(merchSn) {
+			$.get("../thirdmerchantbiz/queryAll?merchSn=" + merchSn, function (r) {
+				vm.thirdMerchantBizList = r.list;
+			});
+		},
+		changeThirdMerchantBiz: function (opt) {
+			var value = opt.value;
+			$.get("../store/getStoresByThirdMerch?thirdPartyMerchCode=" + value, function (r) {
+				vm.storeList = r.list;
+			});
 		}
 	}
 });

+ 23 - 1
kmall-admin/src/main/webapp/js/shop/offilineOrderList.js

@@ -481,12 +481,34 @@ let vm = new Vue({
             params.orderStatus=vm.q.orderStatus;
             params.startTime=vm.q.startTime;
             params.endTime=vm.q.endTime;
+
+            /*if(!params.orderStatus){
+                alert("请选择订单状态");
+                return ;
+            }*/
+            if(!params.startTime || !params.endTime){
+                alert("请选择创建订单时间");
+                return ;
+            }
+            let startDateTime = Date.parse(new Date(params.startTime));
+            let endDateTime = Date.parse(new Date(params.endTime));
+            if(startDateTime > endDateTime){
+                alert("创建订单开始时间不能大于创建订单结束时间");
+                return ;
+            }
+
+            let day = Math.abs(parseInt((endDateTime - startDateTime)/1000/3600/24));
+            if(day > 30 || Object.is(day,NaN)){
+                alert("导出时间不能相差大于30天");
+                return ;
+            }
+
             exportFile('#rrapp', '../order/exportOffilineOrder', params);
         },
         exportSystemFormat : function () {
             var params = {};
             params.orderSn=vm.q.orderSn,
-                params.orderStatus=vm.q.orderStatus;
+            params.orderStatus=vm.q.orderStatus;
             params.startTime=vm.q.startTime;
             params.endTime=vm.q.endTime;
             exportFile('#rrapp', '../order/exportSystemFormat', params);