1
0
Преглед на файлове

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

张创标 преди 4 години
родител
ревизия
29b8a75ec2
променени са 30 файла, в които са добавени 696 реда и са изтрити 202 реда
  1. 8 0
      kmall-admin/pom.xml
  2. 220 8
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java
  3. 47 18
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java
  4. 4 0
      kmall-admin/src/main/java/com/kmall/admin/dao/GoodsDao.java
  5. 3 2
      kmall-admin/src/main/java/com/kmall/admin/dao/MkActivitiesCouponDao.java
  6. 11 0
      kmall-admin/src/main/java/com/kmall/admin/entity/OrderEntity.java
  7. 10 0
      kmall-admin/src/main/java/com/kmall/admin/entity/OrderGoodsEntity.java
  8. 6 1
      kmall-admin/src/main/java/com/kmall/admin/fromcomm/controller/SysLoginController.java
  9. 17 0
      kmall-admin/src/main/java/com/kmall/admin/service/GoodsService.java
  10. 2 2
      kmall-admin/src/main/java/com/kmall/admin/service/MkActivitiesCouponService.java
  11. 2 0
      kmall-admin/src/main/java/com/kmall/admin/service/UserService.java
  12. 39 4
      kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java
  13. 5 5
      kmall-admin/src/main/java/com/kmall/admin/service/impl/MkActivitiesCouponServiceImpl.java
  14. 91 42
      kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java
  15. 5 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/UserServiceImpl.java
  16. 1 1
      kmall-admin/src/main/java/com/kmall/admin/task/TestTask.java
  17. 13 0
      kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml
  18. 6 0
      kmall-admin/src/main/resources/mybatis/mapper/MkActivitiesCouponDao.xml
  19. 13 6
      kmall-admin/src/main/webapp/WEB-INF/page/sale/sale.html
  20. 16 2
      kmall-admin/src/main/webapp/WEB-INF/page/shop/goods.html
  21. 13 6
      kmall-admin/src/main/webapp/WEB-INF/page/shop/offilineOrderList.html
  22. 23 26
      kmall-admin/src/main/webapp/js/sale/sale.js
  23. 16 0
      kmall-admin/src/main/webapp/js/shop/offilineOrderList.js
  24. 1 0
      kmall-admin/src/main/webapp/js/shop/storeProductStock.js
  25. 8 43
      kmall-admin/src/main/webapp/login.html
  26. 1 1
      kmall-admin/src/main/webapp/statics/css/login.css
  27. 103 0
      kmall-admin/src/main/webapp/statics/css/userLogin.css
  28. BIN
      kmall-admin/src/main/webapp/statics/img/login.jpg
  29. BIN
      kmall-admin/src/main/webapp/statics/img/login2.jpg
  30. 12 35
      kmall-admin/src/main/webapp/userLogin.html

+ 8 - 0
kmall-admin/pom.xml

@@ -122,6 +122,14 @@
             <scope>compile</scope>
         </dependency>
 
+
+        <dependency>
+            <groupId>org.apache.ant</groupId>
+            <artifactId>ant</artifactId>
+            <version>1.9.7</version>
+        </dependency>
+
+
     </dependencies>
 
     <build>

+ 220 - 8
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java

@@ -1,34 +1,39 @@
 package com.kmall.admin.controller;
 
-import com.kmall.admin.dto.GoodsDetailsDto;
+import com.alibaba.fastjson.JSON;
 import com.kmall.admin.dto.GoodsDto;
 import com.kmall.admin.dto.GoodsPanoramaDto;
 import com.kmall.admin.entity.GoodsEntity;
 import com.kmall.admin.entity.GoodsGalleryEntity;
-import com.kmall.admin.entity.mk.MkActivitiesEntity;
-import com.kmall.admin.entity.mk.MkActivityFormEntity;
+import com.kmall.admin.entity.SysOssEntity;
 import com.kmall.admin.service.*;
-import com.kmall.admin.service.mk.MkActivitiesService;
-import com.kmall.admin.service.mk.MkActivityFormService;
 import com.kmall.admin.utils.ParamUtils;
 import com.kmall.admin.utils.ShiroUtils;
 import com.kmall.common.constant.Dict;
 import com.kmall.common.constant.JxlsXmlTemplateName;
 import com.kmall.admin.fromcomm.entity.SysUserEntity;
+import com.kmall.common.fileserver.util.FileManager;
 import com.kmall.common.utils.*;
 import com.kmall.common.utils.excel.ExcelExport;
 import com.kmall.common.utils.excel.ExcelUtil;
-import com.kmall.common.utils.print.ticket.item.Goods;
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileItemFactory;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.apache.tools.zip.ZipEntry;
+import org.apache.tools.zip.ZipFile;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.text.SimpleDateFormat;
+import java.io.*;
 import java.util.*;
+import java.util.logging.Logger;
 
 /**
  * Controller
@@ -50,7 +55,8 @@ public class GoodsController {
     private ExcelUtil excelUtil;
     @Autowired
     private StoreService storeService;
-
+    @Autowired
+    private SysOssService sysOssService;
 
 
 
@@ -294,6 +300,212 @@ public class GoodsController {
         return R.ok();
     }
 
+    @RequestMapping("/generalGoodsImgUploadByZip")
+    @ResponseBody
+    public R batchAddImgByZip(@RequestParam("file") MultipartFile file) throws IOException {
+        //上传文件
+        batchAdd(file,2);
+        return R.ok();
+    }
+
+    @RequestMapping("/generalGoodsImgUpload")
+    @ResponseBody
+    public R batchAddImg(@RequestParam("file") MultipartFile file) throws IOException {
+        //上传文件
+        batchAdd(file,1);
+        return R.ok();
+    }
+
+
+
+    private Map<String, Object> batchAdd(MultipartFile file, int type) throws IOException {
+        /*
+         *创建临时文件夹
+         * 解压文件
+         */
+        String fileName = file.getOriginalFilename();
+        String path = "/data/project/img/";
+        File dir = new File(path);
+        dir.mkdirs();
+        String filePath = "/data/project/img2/";
+        File fileDir = new File(filePath);
+        fileDir.mkdirs();
+        File saveFile = new File(fileDir, fileName);//将压缩包解析到指定位置
+        List<String>list = new ArrayList<>();
+        try {
+            file.transferTo(saveFile);
+            String newFilePath = filePath + fileName;
+            File zipFile = new File(newFilePath);
+            unZipFiles(zipFile, path,list,type);//解压文件,获取文件路径
+
+            System.out.println(JSON.toJSONString(list));
+        } catch (Exception e) {
+            e.printStackTrace();
+
+            System.out.println("解压执行失败");
+            throw e ;
+        }
+        //程序结束时,删除临时文件
+        deleteFiles(filePath);//删除压缩包文件夹
+        deleteFiles(path);//删除解压文件夹**
+
+        Map<String, Object> jsonMap = new HashMap<String, Object>();
+        jsonMap.put("ret",list);
+        return jsonMap;
+    }
+
+    public void unZipFiles(File srcFile, String destDirPath, List<String> list, int type) throws RuntimeException {
+        long start = System.currentTimeMillis();
+        // 判断源文件是否存在
+        if (!srcFile.exists()) {
+            throw new RuntimeException(srcFile.getPath() + "所指文件不存在");
+        }
+        // 开始解压
+        ZipFile zipFile = null;
+        try {
+            zipFile = new ZipFile(srcFile);
+            Enumeration<?> entries = zipFile.getEntries();
+            while (entries.hasMoreElements()) {
+                ZipEntry entry = (ZipEntry) entries.nextElement();
+                System.out.println("解压" + entry.getName());
+                // 如果是文件夹,就创建个文件夹
+                if (entry.isDirectory()) {
+                    String dirPath = destDirPath + "/" + entry.getName();
+                    File dir = new File(dirPath);
+                    dir.mkdirs();
+                } else {
+                    // 如果是文件,就先创建一个文件,然后用io流把内容copy过去
+                    File targetFile = new File(destDirPath + "/" + entry.getName());
+                    // 保证这个文件的父文件夹必须要存在
+
+                    if(!targetFile.getParentFile().exists()){
+
+                    }
+                    targetFile.createNewFile();
+                    // 将压缩文件内容写入到这个文件中
+                    InputStream is = zipFile.getInputStream(entry);
+                    FileOutputStream fos = new FileOutputStream(targetFile);
+                    int len;
+                    byte[] buf = new byte[1024];
+                    while ((len = is.read(buf)) != -1) {
+                        fos.write(buf, 0, len);
+                    }
+
+
+                    MultipartFile mulFileByPath = getMulFileByPath(destDirPath + "/" + entry.getName());
+                    //上传文件
+                    String url = FileManager.upload(mulFileByPath);
+                    list.add(url);
+
+
+                    if(type == 1){
+                        String sku = entry.getName().split("/")[1].split("\\.")[0];
+                        GoodsEntity goodsEntity = goodsService.queryBySku(sku);
+                        goodsEntity.setPrimaryPicUrl(url);
+                        goodsEntity.setListPicUrl(url);
+                        goodsService.updateForImgUrl(goodsEntity);
+                    }else if(type == 2){
+                        String barCode = entry.getName().split("/")[1];
+                        GoodsEntity goodsEntity = goodsService.queryByBarcode(barCode);
+                        goodsEntity.setPrimaryPicUrl(url);
+                        goodsEntity.setListPicUrl(url);
+                        goodsService.updateForImgUrl(goodsEntity);
+                    }
+
+
+
+
+                    //保存文件信息
+                    SysOssEntity ossEntity = new SysOssEntity();
+                    ossEntity.setUrl(url);
+                    ossEntity.setCreateDate(new Date());
+                    sysOssService.save(ossEntity);
+
+
+                    // 关流顺序,先打开的后关闭
+                    fos.close();
+                    is.close();
+                }
+            }
+            long end = System.currentTimeMillis();
+            System.out.println("解压完成,耗时:" + (end - start) +" ms");
+        } catch (Exception e) {
+            throw new RuntimeException("unzip error from ZipUtils", e);
+        } finally {
+            if(zipFile != null){
+                try {
+                    zipFile.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+    private static MultipartFile getMulFileByPath(String picPath) {
+        FileItem fileItem = createFileItem(picPath);
+        MultipartFile mfile = new CommonsMultipartFile(fileItem);
+        return mfile;
+    }
+
+    private static FileItem createFileItem(String filePath)
+    {
+        FileItemFactory factory = new DiskFileItemFactory(16, null);
+        String textFieldName = "textField";
+        int num = filePath.lastIndexOf(".");
+        String extFile = filePath.substring(num);
+        FileItem item = factory.createItem(textFieldName, "text/plain", true,
+                "MyFileName" + extFile);
+        File newfile = new File(filePath);
+        int bytesRead = 0;
+        byte[] buffer = new byte[8192];
+        try
+        {
+            FileInputStream fis = new FileInputStream(newfile);
+            OutputStream os = item.getOutputStream();
+            while ((bytesRead = fis.read(buffer, 0, 8192))
+                    != -1)
+            {
+                os.write(buffer, 0, bytesRead);
+            }
+            os.close();
+            fis.close();
+        }
+        catch (IOException e)
+        {
+            e.printStackTrace();
+        }
+        return item;
+    }
+
+
+    public void deleteFiles(String filePath) {
+        File file = new File(filePath);
+        if ((!file.exists()) || (!file.isDirectory())) {
+            System.out.println("file not exist");
+            return;
+        }
+        String[] tempList = file.list();
+        File temp = null;
+        for (int i = 0; i < tempList.length; i++) {
+            if (filePath.endsWith(File.separator)) {
+                temp = new File(filePath + tempList[i]);
+            }
+            else {
+                temp = new File(filePath + File.separator + tempList[i]);
+            }
+            if (temp.isFile()) {
+                temp.delete();
+            }
+            if (temp.isDirectory()) {
+                this.deleteFiles(filePath + "/" + tempList[i]);
+            }
+        }
+        // 空文件的删除
+        file.delete();
+    }
+
+
     /*@RequestMapping("/scannInfo")
     @RequiresPermissions("goods:scannInfo")
     public R scannInfo(@RequestParam Map<String, Object> params) {

+ 47 - 18
kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java

@@ -73,6 +73,8 @@ public class OrderController {
     private ShippingService shippingService;
 
     private volatile Integer code = 1;
+    @Autowired
+    private UserService userService;
 
     /**
      * 列表
@@ -655,6 +657,22 @@ public class OrderController {
         List<OrderEntity> orderList = orderService.queryOffilineOrderList(query);
         int total = orderService.queryOffilineOrderTotal(query);
 
+
+        for(OrderEntity orderEntity : orderList) {
+            BigDecimal tax = new BigDecimal(0);
+            Map map = new HashMap();
+            map.put("orderId", orderEntity.getId());
+            List<OrderGoodsEntity> goodsList = orderGoodsService.queryList(map);
+
+            for (OrderGoodsEntity orderGoodsEntity : goodsList) {
+                tax = tax
+                        .add(orderGoodsEntity.getMarketPrice() // 商品价格
+                        .multiply(orderGoodsEntity.getGoodsRate())  // 商品税率
+                        .multiply(new BigDecimal(orderGoodsEntity.getNumber()))).setScale(2,RoundingMode.HALF_UP); // 商品数量
+            }
+            orderEntity.setTax(tax);
+        }
+
         // 遍历循环订单是哪个店员销售的,根据订单号查询
 
         PageUtils pageUtil = new PageUtils(orderList, total, query.getLimit(), query.getPage());
@@ -667,6 +685,20 @@ public class OrderController {
     public R queryObjectBySysUser(@PathVariable("id") Long id) {
         OrderEntity order = orderService.queryObjectBySysUser(id);
         List<OrderWXPayRecordEntity> payRecords = orderWXPayRecordService.getRecordsByOutTradeNo(order.getOrderSn());
+        BigDecimal tax = new BigDecimal(0);
+        List<OrderGoodsEntity> goodsList = order.getOrderGoodsEntityList();
+
+        for (OrderGoodsEntity orderGoodsEntity : goodsList) {
+
+            BigDecimal goodsTax = orderGoodsEntity.getMarketPrice() // 商品价格
+                                    .multiply(orderGoodsEntity.getGoodsRate())  // 商品税率
+                                    .multiply(new BigDecimal(orderGoodsEntity.getNumber()));// 商品数量
+            orderGoodsEntity.setTax(goodsTax);
+            tax = tax.add(goodsTax).setScale(2,RoundingMode.HALF_UP);
+
+            orderGoodsEntity.setTax(goodsTax);
+        }
+        order.setTax(tax);
         order.setPayRecordList(payRecords);
         return R.ok().put("order", order);
     }
@@ -1007,10 +1039,11 @@ public class OrderController {
 
         BigDecimal tax = new BigDecimal(0);
         for(OrderGoodsEntity orderGoodsEntity : goodsList){
-            BigDecimal retailPrice = orderGoodsEntity.getRetailPrice();
+            BigDecimal marketPrice = orderGoodsEntity.getMarketPrice();
             BigDecimal goodsRate = orderGoodsEntity.getGoodsRate();
             Integer number = orderGoodsEntity.getNumber();
-            BigDecimal goodsTax = retailPrice.multiply(goodsRate).multiply(new BigDecimal(number));
+            BigDecimal goodsTax = marketPrice.multiply(goodsRate).multiply(new BigDecimal(number));
+            orderGoodsEntity.setTax(goodsTax);
             tax = tax.add(goodsTax);
         }
 
@@ -1023,22 +1056,18 @@ public class OrderController {
         return R.ok().put("resultObj", result);
     }
 
-//    @RequestMapping("/getIdCardInfo")
-//    public R getIdCardInfo() throws IOException {
-//
-//        Map map = new HashMap();
-//        String ssl = OkHttpUtils.post(map,"http://127.0.0.1:8000/idcard/read", "SSL");
-//        Pattern pattern = Pattern.compile("(\\\\u(\\p{XDigit}{4}))");
-//        Matcher matcher = pattern.matcher(ssl);
-//        char ch;
-//        while (matcher.find()) {
-//            ch = (char) Integer.parseInt(matcher.group(2), 16);
-//            ssl = ssl.replace(matcher.group(1), ch + "");
-//        }
-//
-//        return R.ok().put("info",ssl);
-//
-//    }
+    @RequestMapping("/queryIDCardInfo/{mobile}")
+    public R queryIDCardInfo(@PathVariable("mobile")String mobile) throws IOException {
+
+        UserEntity userEntity = userService.queryByMobile(mobile);
+        if (userEntity == null) {
+            return R.error("该手机号未找到对应信息");
+        }
+
+
+        return R.ok().put("userEntity",userEntity);
+
+    }
 
 
     @RequestMapping("/purchaseSalesInStockDetail")

+ 4 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/GoodsDao.java

@@ -48,4 +48,8 @@ public interface GoodsDao extends BaseDao<GoodsEntity> {
      * @return
      */
     PDFGoodsDto queryForPDFData(@Param("sku") String sku, @Param("storeId") String storeId, @Param("prodBarcode") String prodBarcode);
+
+    GoodsEntity queryByBarcode(@Param("barCode") String barCode);
+
+    GoodsEntity queryBySku(@Param("sku") String sku);
 }

+ 3 - 2
kmall-admin/src/main/java/com/kmall/admin/dao/MkActivitiesCouponDao.java

@@ -20,7 +20,8 @@ public interface MkActivitiesCouponDao extends BaseDao<MkActivitiesCouponEntity>
      * @return
      */
     MkActivitiesCouponEntity queryByBarCode(@Param("mkaId") Long mkaId,
-                                            @Param("prodBarcode") String prodBarcode);
+                                            @Param("prodBarcode") String prodBarcode
+                                            , @Param("currentTime") String currentTime);
 
-    MkActivitiesCouponEntity queryByCouponSn(@Param("couponSn") String couponSn);
+    MkActivitiesCouponEntity queryByCouponSn(@Param("couponSn") String couponSn , @Param("currentTime") String currentTime);
 }

+ 11 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/OrderEntity.java

@@ -203,6 +203,9 @@ public class OrderEntity implements Serializable {
     //供应商第三方商户
     private String supplierThirdPartyMerchCode;
 
+    private BigDecimal tax;
+
+
     public BigDecimal getTopicPrice() {
         return topicPrice;
     }
@@ -1106,4 +1109,12 @@ public class OrderEntity implements Serializable {
     public void setAliTradeNo(String aliTradeNo) {
         AliTradeNo = aliTradeNo;
     }
+
+    public BigDecimal getTax() {
+        return tax;
+    }
+
+    public void setTax(BigDecimal tax) {
+        this.tax = tax;
+    }
 }

+ 10 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/OrderGoodsEntity.java

@@ -72,6 +72,8 @@ public class OrderGoodsEntity implements Serializable {
 	// 实际支付价
 	private BigDecimal actualPaymentAmount;
 
+	private BigDecimal tax;
+
 	public String getPlu() {
 		return plu;
 	}
@@ -356,4 +358,12 @@ public class OrderGoodsEntity implements Serializable {
 	public void setActualPaymentAmount(BigDecimal actualPaymentAmount) {
 		this.actualPaymentAmount = actualPaymentAmount;
 	}
+
+	public BigDecimal getTax() {
+		return tax;
+	}
+
+	public void setTax(BigDecimal tax) {
+		this.tax = tax;
+	}
 }

+ 6 - 1
kmall-admin/src/main/java/com/kmall/admin/fromcomm/controller/SysLoginController.java

@@ -76,7 +76,7 @@ public class SysLoginController {
     @SysLog("登录")
     @ResponseBody
     @RequestMapping(value = "/sys/login", method = RequestMethod.POST)
-    public R login(String username, String password, String captcha,String machineCode ,HttpSession session) throws IOException {
+    public R login(String username, String password, String captcha,String machineCode ,HttpSession session,String loginType) throws IOException {
 
 
 
@@ -114,8 +114,13 @@ public class SysLoginController {
 
         // 判断是否是店员
         if(storeId != null){
+
             // 是店员,根据机器码查询机器
             CashierEntity cashierEntity =  cashierService.queryByMachineCode(machineCode,storeId+"");
+            if("1".equals(loginType) && cashierEntity == null){
+                return R.error("请登录收银系统!");
+
+            }
             if(cashierEntity == null){
                 return R.error("该机器未录入,请联系管理员录入机器,该机器机器码为:"+machineCode);
             }

+ 17 - 0
kmall-admin/src/main/java/com/kmall/admin/service/GoodsService.java

@@ -159,4 +159,21 @@ public interface GoodsService {
      * @return
      */
     Map<String,Object> calculateGoodsDetail(String prodBarcode, String storeId);
+
+    /**
+     * 根据条形码查询商品
+     * @param barCode
+     * @return
+     */
+    GoodsEntity queryByBarcode(String barCode);
+
+    /**
+     * 根据sku查询商品
+     * @param sku
+     * @return
+     */
+    GoodsEntity queryBySku(String sku);
+
+    void updateForImgUrl(GoodsEntity goodsEntity);
+
 }

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

@@ -86,7 +86,7 @@ public interface MkActivitiesCouponService {
      * @param prodBarcode
      * @return
      */
-    MkActivitiesCouponEntity queryByBarCode(Long mkaId, String prodBarcode);
+    MkActivitiesCouponEntity queryByBarCode(Long mkaId, String prodBarcode,String currentTime);
 
-    MkActivitiesCouponEntity queryByCouponSn(String couponSn);
+    MkActivitiesCouponEntity queryByCouponSn(String couponSn,String currentTime);
 }

+ 2 - 0
kmall-admin/src/main/java/com/kmall/admin/service/UserService.java

@@ -76,4 +76,6 @@ public interface UserService {
      * @return
      */
     Map checkFaceTimeByUserId(Long userId);
+
+    UserEntity queryByMobile(String mobile);
 }

+ 39 - 4
kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java

@@ -26,6 +26,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -333,7 +334,7 @@ public class GoodsServiceImpl implements GoodsService {
 //        builder.put("freightId", "运费模版");
         builder.put("primaryPicUrl", "商品主图");
         builder.put("listPicUrl", "商品列表图");
-        builder.put("goodsDesc", "商品描述");
+//        builder.put("goodsDesc", "商品描述");
         builder.put("isOnSale", "上架");
         builder.put("isHot", "热销");
 
@@ -382,7 +383,7 @@ public class GoodsServiceImpl implements GoodsService {
         // 商品轮播图
         List<GoodsGalleryEntity> galleryEntityList = goods.getGoodsImgList();
         if (galleryEntityList == null || galleryEntityList.size() <= 0) {
-            throw new RRException("至少保留一张商品轮播图!");
+//            throw new RRException("至少保留一张商品轮播图!");
         }
 
         List<GoodsEntity> prodbarGoodsList = goodsDao.queryObjectByProdBarcode(goods.getProdBarcode(),goods.getMerchSn(),goods.getId());
@@ -606,6 +607,13 @@ public class GoodsServiceImpl implements GoodsService {
         return 1;
     }
 
+
+    @Transactional
+    public void updateForImgUrl(GoodsEntity goodsEntity){
+        // 修改商品
+        goodsDao.update(goodsEntity);
+    }
+
     /**
      * 更新门店商品是否有修改字段
      * @param storeId
@@ -1128,7 +1136,11 @@ public class GoodsServiceImpl implements GoodsService {
             return null;
         }
         goods.setDiscountedPrice(new BigDecimal(0));
-        goods.setActualPaymentAmount(goods.getRetailPrice());
+        String goodsRate = goods.getGoodsRate();
+        BigDecimal tax = goods.getRetailPrice().multiply(new BigDecimal(goodsRate)).setScale(2, RoundingMode.HALF_UP);
+        goods.setGoodstaxes(tax.toString());
+        goods.setActualPaymentAmount(goods.getRetailPrice().add(tax).setScale(2,RoundingMode.HALF_UP));
+
         Map<String,Object> skuActivitiesMap = new HashMap<>();
 
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -1296,7 +1308,7 @@ public class GoodsServiceImpl implements GoodsService {
 
         if(coupon){
             Long mkaId = mkaIdMap.get("yhq");
-            MkActivitiesCouponEntity couponEntity =  couponService.queryByBarCode(mkaId,prodBarcode);
+            MkActivitiesCouponEntity couponEntity =  couponService.queryByBarCode(mkaId,prodBarcode,nowTime);
             if(couponEntity != null){ // 优惠券码,优惠金额
                 Map<String,Object> returnMap = new HashMap<>();
                 returnMap.put(couponEntity.getCouponSn() , couponEntity.getCouponPrice());
@@ -1355,6 +1367,29 @@ public class GoodsServiceImpl implements GoodsService {
         skuActivitiesMap.put("goods",goods);
         return skuActivitiesMap;
     }
+
+    /**
+     * 根据条形码查询商品
+     *
+     * @param barCode
+     * @return
+     */
+    @Override
+    public GoodsEntity queryByBarcode(String barCode) {
+        return goodsDao.queryByBarcode(barCode);
+    }
+
+    /**
+     * 根据sku查询商品
+     *
+     * @param sku
+     * @return
+     */
+    @Override
+    public GoodsEntity queryBySku(String sku) {
+        return goodsDao.queryBySku(sku);
+    }
+
 /*  @Override
     @Transactional
     public int uploadExcel(MultipartFile file) {

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

@@ -97,7 +97,7 @@ public class MkActivitiesCouponServiceImpl implements MkActivitiesCouponService
                     throw new RRException(r.get("msg").toString());
                 }
 
-                MkActivitiesCouponEntity old = mkActivitiesCouponDao.queryByBarCode(Long.parseLong(mkaId), couponMerchandiseDto.getBarCode());
+                MkActivitiesCouponEntity old = mkActivitiesCouponDao.queryByBarCode(Long.parseLong(mkaId), couponMerchandiseDto.getBarCode(),null);
                 if(old != null){
                     throw new RRException("该商品已经参与本次活动,商品{"+couponMerchandiseDto.getBarCode()+"}",500);
                 }
@@ -130,12 +130,12 @@ public class MkActivitiesCouponServiceImpl implements MkActivitiesCouponService
      * @return
      */
     @Override
-    public MkActivitiesCouponEntity queryByBarCode(Long mkaId, String prodBarcode) {
-        return mkActivitiesCouponDao.queryByBarCode(mkaId,prodBarcode);
+    public MkActivitiesCouponEntity queryByBarCode(Long mkaId, String prodBarcode,String currentTime) {
+        return mkActivitiesCouponDao.queryByBarCode(mkaId,prodBarcode,currentTime);
     }
 
     @Override
-    public MkActivitiesCouponEntity queryByCouponSn(String couponSn) {
-        return mkActivitiesCouponDao.queryByCouponSn(couponSn);
+    public MkActivitiesCouponEntity queryByCouponSn(String couponSn,String currentTime) {
+        return mkActivitiesCouponDao.queryByCouponSn(couponSn,currentTime);
     }
 }

+ 91 - 42
kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java

@@ -54,6 +54,7 @@ import com.kmall.common.utils.*;
 import com.kmall.common.utils.print.ticket.item.*;
 import com.kmall.manager.manager.express.kdn.KdniaoUtil;
 import com.kmall.common.utils.wechat.WechatRefundApiResult;
+import com.mysql.cj.util.TimeUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -1697,6 +1698,9 @@ public class OrderServiceImpl implements OrderService {
             Integer storeId = user.getStoreId();
 
             List<GoodsEntity> goodsEntities = new ArrayList<>();
+
+            BigDecimal totalTax = new BigDecimal(0);
+
             // 检查库存和更新库存
             for (LinkedHashMap goodsDto : goodsList) {
                 //
@@ -1736,26 +1740,26 @@ public class OrderServiceImpl implements OrderService {
                         return resultObj;
                     } else {
                         // 判断销售价是否低于底线价
-                        if(productInfo.getBottomLinePrice() != null){
-                            BigDecimal bottomLinePrice = new BigDecimal(productInfo.getBottomLinePrice());
-                            if (goodsEntity.getStoreRetailPrice().compareTo(bottomLinePrice) <= -1) {
-                                LOGGER.error("销售价格小于底线价格");
-
-                                // 记录该信息,到价格过低日志表中,这里没有活动id
-                                Mall2LowPriceWarningEntity lowPriceWarningEntity = new Mall2LowPriceWarningEntity();
-                                lowPriceWarningEntity.setSalePrice(goodsEntity.getStoreRetailPrice());
-                                lowPriceWarningEntity.setWarningPrice(bottomLinePrice);
-                                lowPriceWarningEntity.setSku(goodsEntity.getGoodsSn());
-                                lowPriceWarningEntity.setWarningType("00");
-                                lowPriceWarningEntity.setStoreId(storeId+"");
-                                lowPriceWarningEntity.setCreateTime(new Date());
-
-                                lowPriceWarningDao.save(lowPriceWarningEntity);
-                                resultObj.put("errno", 400);
-                                resultObj.put("errmsg", "商品"+goodsEntity.getName()+"的销售价格小于底线价格");
-                                return resultObj;
-                            }
-                        }
+//                        if(productInfo.getBottomLinePrice() != null){
+//                            BigDecimal bottomLinePrice = new BigDecimal(productInfo.getBottomLinePrice());
+//                            if (goodsEntity.getStoreRetailPrice().compareTo(bottomLinePrice) <= -1) {
+//                                LOGGER.error("销售价格小于底线价格");
+//
+//                                // 记录该信息,到价格过低日志表中,这里没有活动id
+//                                Mall2LowPriceWarningEntity lowPriceWarningEntity = new Mall2LowPriceWarningEntity();
+//                                lowPriceWarningEntity.setSalePrice(goodsEntity.getStoreRetailPrice());
+//                                lowPriceWarningEntity.setWarningPrice(bottomLinePrice);
+//                                lowPriceWarningEntity.setSku(goodsEntity.getGoodsSn());
+//                                lowPriceWarningEntity.setWarningType("00");
+//                                lowPriceWarningEntity.setStoreId(storeId+"");
+//                                lowPriceWarningEntity.setCreateTime(new Date());
+//
+//                                lowPriceWarningDao.save(lowPriceWarningEntity);
+//                                resultObj.put("errno", 400);
+//                                resultObj.put("errmsg", "商品"+goodsEntity.getName()+"的销售价格小于底线价格");
+//                                return resultObj;
+//                            }
+//                        }
 
 
                         productInfo.setStockNum(productInfo.getStockNum() - sellVolume);
@@ -1774,22 +1778,54 @@ public class OrderServiceImpl implements OrderService {
 
                     if(goodsDto.get("actualPaymentAmount") instanceof Double){
                         goodsEntity.setStoreRetailPrice(new BigDecimal((Double)goodsDto.get("actualPaymentAmount")));
-                        goodsEntity.setRetailPrice(new BigDecimal((Double)goodsDto.get("retailPrice"))); // 单价
-                        goodsEntity.setDiscountedPrice(new BigDecimal((Double)goodsDto.get("discountedPrice"))); // 优惠金额
-                        goodsEntity.setActualPaymentAmount(new BigDecimal((Double)goodsDto.get("actualPaymentAmount"))); // 实际支付价格
+
                     }else if(goodsDto.get("actualPaymentAmount") instanceof Integer){
                         goodsEntity.setStoreRetailPrice(new BigDecimal((Integer)goodsDto.get("actualPaymentAmount")));
-                        goodsEntity.setRetailPrice(new BigDecimal((Integer)goodsDto.get("retailPrice")));
-                        goodsEntity.setDiscountedPrice(new BigDecimal((Integer)goodsDto.get("discountedPrice")));
-                        goodsEntity.setActualPaymentAmount(new BigDecimal((Integer)goodsDto.get("actualPaymentAmount")));
+
+
+
                     }else if(goodsDto.get("actualPaymentAmount") instanceof Float){
                         goodsEntity.setStoreRetailPrice(new BigDecimal((Float)goodsDto.get("actualPaymentAmount")));
+
+
+
+                    }
+
+                    if(goodsDto.get("retailPrice") instanceof Double){
+                    goodsEntity.setRetailPrice(new BigDecimal((Double)goodsDto.get("retailPrice"))); // 单价
+
+                    }else if(goodsDto.get("retailPrice") instanceof Integer){
+                        goodsEntity.setRetailPrice(new BigDecimal((Integer)goodsDto.get("retailPrice")));
+                    }else if(goodsDto.get("retailPrice") instanceof Float){
                         goodsEntity.setRetailPrice(new BigDecimal((Float)goodsDto.get("retailPrice")));
+                    }
+                    if(goodsDto.get("discountedPrice") instanceof Double){
+                        goodsEntity.setDiscountedPrice(new BigDecimal((Integer)goodsDto.get("discountedPrice"))); // 优惠金额
+                    }else if(goodsDto.get("discountedPrice") instanceof Integer){
+                        goodsEntity.setDiscountedPrice(new BigDecimal((Integer)goodsDto.get("discountedPrice")));
+                    }else if(goodsDto.get("discountedPrice") instanceof Float){
                         goodsEntity.setDiscountedPrice(new BigDecimal((Float)goodsDto.get("discountedPrice")));
+                    }
+                    if(goodsDto.get("actualPaymentAmount") instanceof Double){
+                        goodsEntity.setActualPaymentAmount(new BigDecimal((Double)goodsDto.get("actualPaymentAmount"))); // 实际支付价格
+                    }else if(goodsDto.get("actualPaymentAmount") instanceof Integer){
+                        goodsEntity.setActualPaymentAmount(new BigDecimal((Integer)goodsDto.get("actualPaymentAmount")));
+                    }else if(goodsDto.get("actualPaymentAmount") instanceof Float){
                         goodsEntity.setActualPaymentAmount(new BigDecimal((Float)goodsDto.get("actualPaymentAmount")));
                     }
 
 
+                    if(goodsDto.get("goodstaxes") instanceof Double){
+                       totalTax =  totalTax.add(new BigDecimal((Double)goodsDto.get("goodstaxes"))); // 实际支付价格
+                    }else if(goodsDto.get("goodstaxes") instanceof Integer){
+                       totalTax = totalTax.add(new BigDecimal((Integer)goodsDto.get("goodstaxes")));
+                    }else if(goodsDto.get("goodstaxes") instanceof Float){
+                        totalTax = totalTax.add(new BigDecimal((Float)goodsDto.get("goodstaxes")));
+                    }else if(goodsDto.get("goodstaxes") instanceof String){
+                        totalTax = totalTax.add(new BigDecimal((String) goodsDto.get("goodstaxes")));
+                    }
+
+
 
 //                    goodsEntity.setStoreRetailPrice(productInfo.getRetailPrice());
                     // 借用这个字段来存储购买数
@@ -1827,7 +1863,9 @@ public class OrderServiceImpl implements OrderService {
 
             // TODO 查询使用的优惠券,并减扣金额
             String couponSn = (String) userInfo.get("couponSn");
-            MkActivitiesCouponEntity couponEntity = mkActivitiesCouponService.queryByCouponSn(couponSn);
+            // 获取当前时间
+            String currentTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
+            MkActivitiesCouponEntity couponEntity = mkActivitiesCouponService.queryByCouponSn(couponSn,currentTime);
 //            // 优惠金额
             BigDecimal disCountAmount = new BigDecimal(0);
             if(couponEntity != null){
@@ -1852,16 +1890,15 @@ public class OrderServiceImpl implements OrderService {
             }
 
 
-
             // 生成订单
             String merchOrderSn = "EMATO" + CommonUtil.generateOrderNumber();
-            OrderVo order = setOrderVo(goodsEntities, userEntity,storeId.longValue(), user.getMerchSn(),disCountAmount);
+            OrderVo order = setOrderVo(goodsEntities, userEntity,storeId.longValue(), user.getMerchSn(),disCountAmount,totalTax);
             order.setStore_id(storeId.longValue());
 //            if(storeTopic != null){
 //                order.setActivity_id(storeTopic.getId().longValue());
 //            }
             order.setMerchOrderSn(merchOrderSn);
-
+            order.setCoupon_name(couponSn); // 借用这个字段来记录是否使用优惠券
             //插入订单信息和订单商品
             orderDao.saveOrderVo(order);
 
@@ -1908,10 +1945,10 @@ public class OrderServiceImpl implements OrderService {
             // 支付宝支付
 //            AliPay(user, parCode , order, processRecordEntity, orderWXPayRecordCurrent, store);
             OrderEntity orderEntity = queryObject(order.getId());
-            orderEntity.setOrderStatus(Integer.parseInt(Dict.orderStatus.item_201.getItem()));
-            orderEntity.setPayStatus(Integer.parseInt(Dict.payStatus.item_2.getItem()));
+//            orderEntity.setOrderStatus(Integer.parseInt(Dict.orderStatus.item_201.getItem()));
+//            orderEntity.setPayStatus(Integer.parseInt(Dict.payStatus.item_2.getItem()));
 //            orderEntity.setPayFlag(payFlag);
-            orderEntity.setPayTime(new Date());
+//            orderEntity.setPayTime(new Date());
             orderDao.update(orderEntity);
             resultObj.put("shopName",store.getStoreName()); // 根据门店编号查询
             resultObj.put("userName",user.getUsername());
@@ -2355,28 +2392,40 @@ public class OrderServiceImpl implements OrderService {
      * 设置订单数据
      * @return
      */
-    public OrderVo setOrderVo(List<GoodsEntity> goodsList, UserEntity loginUser,Long storeId, String merchSn, BigDecimal disCountAmount){
+    public OrderVo setOrderVo(List<GoodsEntity> goodsList, UserEntity loginUser, Long storeId, String merchSn, BigDecimal disCountAmount, BigDecimal totalTax){
         OrderVo orderInfo = new OrderVo();
 
         BigDecimal goodsTotalPrice = new BigDecimal(0.00);
+        BigDecimal fullCutCouponDec = Constant.ZERO;  // 非现金抵扣 = 各种优惠价格 +优惠券的价格   暂时借用这个字段去,为了不改动ccnet系统
+        BigDecimal couponPrice = disCountAmount;
         BigDecimal freightPrice = Constant.ZERO;
+        BigDecimal actualPrice = Constant.ZERO;
+        //订单价格计算:订单的总价+运费
         for (GoodsEntity goodsEntity : goodsList) {
-
             goodsTotalPrice = goodsTotalPrice
-                    .add(goodsEntity.getStoreRetailPrice().multiply(new BigDecimal(goodsEntity.getGoodsNumber())));
+                    .add(goodsEntity.getRetailPrice().multiply(new BigDecimal(goodsEntity.getGoodsNumber()))).setScale(2,RoundingMode.HALF_UP);
+            fullCutCouponDec = fullCutCouponDec
+                    .add(goodsEntity.getDiscountedPrice()).setScale(2,RoundingMode.HALF_UP);
+            actualPrice = actualPrice
+                    .add(goodsEntity.getActualPaymentAmount().multiply(new BigDecimal(goodsEntity.getGoodsNumber()))).setScale(2,RoundingMode.HALF_UP);
+
         }
 
-        //订单价格计算:订单的总价+运费
+
         BigDecimal orderTotalPrice = goodsTotalPrice.add(new BigDecimal(0));
-        BigDecimal fullCutCouponDec = Constant.ZERO;
-        BigDecimal couponPrice = disCountAmount;
-        BigDecimal actualPrice = orderTotalPrice.subtract(couponPrice);
+        fullCutCouponDec = fullCutCouponDec.add(couponPrice).setScale(2,RoundingMode.HALF_UP);
+
+        // 加上税额
+        goodsTotalPrice = goodsTotalPrice.add(totalTax).setScale(2,RoundingMode.HALF_UP);
+        orderTotalPrice = orderTotalPrice.add(totalTax).setScale(2,RoundingMode.HALF_UP);
 
-        String orderSn = "CW" +  CommonUtil.generateOrderNumber();
+
+
+        String orderSn = "ZWCW" +  CommonUtil.generateOrderNumber();
         orderInfo.setOrder_sn(orderSn);
         orderInfo.setMerchSn(merchSn);
         orderInfo.setUser_id(loginUser.getId().longValue());
-
+        actualPrice = actualPrice.subtract(couponPrice);
 
         StoreEntity storeEntity = storeDao.queryObject(storeId);
         //收货地址和运费

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

@@ -100,4 +100,9 @@ public class UserServiceImpl implements UserService {
         }
         return null;
     }
+
+    @Override
+    public UserEntity queryByMobile(String mobile) {
+        return userDao.queryByMobile(mobile);
+    }
 }

+ 1 - 1
kmall-admin/src/main/java/com/kmall/admin/task/TestTask.java

@@ -41,7 +41,7 @@ public class TestTask {
 
 
 
-//    @Scheduled(cron = "0/5 * * * * ?")
+    @Scheduled(cron = "0/5 * * * * ?")
     public void flushPickUpCode() {
         logger.info("flushPickUpCode-----------------" );
 

+ 13 - 0
kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml

@@ -715,4 +715,17 @@
 
     </select>
 
+    <select id="queryByBarcode" resultType="com.kmall.admin.entity.GoodsEntity">
+        select *
+        from mall_goods
+        where prod_barcode = #{barCode}
+    </select>
+
+    <select id="queryBySku" resultType="com.kmall.admin.entity.GoodsEntity">
+        select *
+        from mall_goods
+        where sku = #{sku}
+    </select>
+
+
 </mapper>

+ 6 - 0
kmall-admin/src/main/resources/mybatis/mapper/MkActivitiesCouponDao.xml

@@ -161,6 +161,9 @@
 		from mk_activities_coupon
 		where mka_id = #{mkaId}
 		and barcode = #{prodBarcode}
+		<if test="currentTime != null and currentTime.trim() != ''">
+			and deadline &gt; #{currentTime}
+		</if>
 	</select>
 
 
@@ -180,6 +183,9 @@
 			`update_time`
 		from mk_activities_coupon
 		where coupon_sn = #{couponSn}
+		<if test="currentTime != null and currentTime.trim() != ''">
+			and deadline &gt; #{currentTime}
+		</if>
 	</select>
 
 </mapper>

+ 13 - 6
kmall-admin/src/main/webapp/WEB-INF/page/sale/sale.html

@@ -63,6 +63,7 @@
                             <img style="height: 400px;width: 400px;" :src="goods.primaryPicUrl" class="img-rounded"/>
                             <h1 style="margin: 8px;"><strong>{{goods.name}}</strong></h1>
                             <p style="margin: 8px;">单价: <strong>{{goods.retailPrice}}</strong> /元</p>
+                            <p style="margin: 8px;">税费: <strong>{{goods.goodstaxes}}</strong> /元</p>
                             <p style="margin: 8px;">规格: {{goods.specification}}</p>
                             <p style="margin: 8px;">条形码: {{goods.prodBarcode}}</p>
                             <!--<span style="margin: 8px;">商品描述: {{goods.goodsDesc}}</span>-->
@@ -80,20 +81,20 @@
                         <table id="cbec" class="table .table-striped">
                             <tr style="border: white;background-color: #F5DCB3;font-size: 1.3em" >
                                 <th style="width: 350px;padding: 7px">跨境商品名称</th>
-                                <th style="padding: 7px">规格</th>
                                 <th style="padding: 7px">单价</th>
                                 <th style="padding: 7px">优惠金额</th>
+                                <th style="padding: 7px">税费</th>
                                 <th style="padding: 7px">实际支付价</th>
-                                <!--<th>税费</th>-->
+<!--                                <th>税费</th>-->
                                 <th style="padding: 7px">数量</th>
 <!--                                <th>操作</th>-->
                                 <th style="padding: 7px">参与活动</th>
                             </tr>
                             <tr v-for="(item,i) in goodsList" v-if="item.name" style="font-size: 1.3em">
                                 <td><h3>{{item.name}}</h3></td>
-                                <td> {{item.specification}}</td>
                                 <td> {{item.retailPrice}}</td>
                                 <td> {{item.discountedPrice}}</td>
+                                <td> {{item.goodstaxes}}</td>
                                 <td> {{item.actualPaymentAmount}}</td>
                                 <td>
 <!--                                    <i class="glyphicon glyphicon-minus" aria-hidden="true" @click="minus(item.id)"></i>-->
@@ -171,6 +172,7 @@
                                     </div>
                                     <div class="modal-footer">
                                         <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+                                        <button type="button" class="btn btn-primary" @click="queryIDCardInfo">查询身份信息</button>
                                         <button type="button" class="btn btn-primary" @click="getIDCardInfo" id="IDCard">读取身份证信息</button>
                                         <button type="button" class="btn btn-primary" @click="submitCustomInfo" id="Send">去付款</button>
                                     </div>
@@ -263,10 +265,13 @@
                                 </div>
                             </div>
                             <div class="row" style="border:0">
-                                <div class="col-md-3" id="orderTotal">订单总额: {{orderEntity.actualPrice}}</div>
+                                <div class="col-md-3" id="orderTotal">订单总金额: {{orderEntity.orderPrice}}</div>
+                                <div class="col-md-3" id="actualPrice">订单实际支付金额: {{orderEntity.actualPrice}}</div>
                                 <div class="col-md-3" id="discount">订单优惠券金额: {{orderEntity.couponPrice}}</div>
-                                <div class="col-md-3" id="orderTaxes">订单税费: {{tax}}</div>
-                                <div class="col-md-3" id="invetoryReceipt">清关回执: <!--{{orderProcessRecord.eleOrderStartTime}}--></div>
+                                <div class="col-md-3" id="orderTaxes">订单预估税费: {{tax}}</div>
+                            </div>
+                            <div class="row" style="border:0">
+                                <div class="col-md-12" id="invetoryReceipt">清关回执: <!--{{orderProcessRecord.eleOrderStartTime}}--></div>
                             </div>
                             <table id="goodsDetailTable" class="table .table-striped" style="margin-top: 50px;">
                                 <tr style="border: white;background-color: orange">
@@ -277,6 +282,7 @@
                                     <th>实际支付价</th>
                                     <th>数量</th>
                                     <th>总额</th>
+                                    <th>预估税费</th>
                                     <th>参与活动</th>
                                 </tr>
                                 <tr v-for="(item,i) in goodsDetailList" >
@@ -287,6 +293,7 @@
                                     <td>{{item.actualPaymentAmount}}</td>
                                     <td>{{item.number}}</td>
                                     <td >{{item.number*item.actualPaymentAmount}}</td>
+                                    <td >{{item.tax}}</td>
                                     <td >{{item.activity}}</td>
                                 </tr>
                             </table>

+ 16 - 2
kmall-admin/src/main/webapp/WEB-INF/page/shop/goods.html

@@ -155,11 +155,25 @@
                 #if($shiro.hasPermission("goods:generalGoodsUpload"))
                 <i-col style="display: inline-grid;">
                     <Upload :show-upload-list="false" :on-success="uploadExcelSuccess" :on-error="uploadExcelError" :on-format-error="uploadExcelFormatError"
-                            :format="['xls','xlsx']"
+                            :format="['xls','xlsx','zip']"
                             action="../goods/generalGoodsUpload">
                         <i-button type="ghost" icon="ios-cloud-upload-outline">普货商品导入</i-button>
                     </Upload>
                 </i-col>
+                <i-col style="display: inline-grid;">
+                    <Upload :show-upload-list="false" :on-success="uploadExcelSuccess" :on-error="uploadExcelError" :on-format-error="uploadExcelFormatError"
+                            :format="['xls','xlsx','zip']"
+                            action="../goods/generalGoodsImgUpload">
+                        <i-button type="ghost" icon="ios-cloud-upload-outline">商品图片批量导入</i-button>
+                    </Upload>
+                </i-col>
+                <i-col style="display: inline-grid;">
+                    <Upload :show-upload-list="false" :on-success="uploadExcelSuccess" :on-error="uploadExcelError" :on-format-error="uploadExcelFormatError"
+                            :format="['xls','xlsx','zip']"
+                            action="../goods/generalGoodsImgUploadByZip">
+                        <i-button type="ghost" icon="ios-cloud-upload-outline">商品图片(文件夹)批量导入</i-button>
+                    </Upload>
+                </i-col>
                 #end
                 #if($shiro.hasPermission("goods:down"))
                 &nbsp;&nbsp;&nbsp;&nbsp;
@@ -525,4 +539,4 @@
 
 <script src="${rc.contextPath}/js/shop/goods.js?_${date.systemTime}"></script>
 </body>
-</html>
+</html>

+ 13 - 6
kmall-admin/src/main/webapp/WEB-INF/page/shop/offilineOrderList.html

@@ -156,6 +156,9 @@
                     <Form-item label="商品总价" prop="goodsPrice">
                         <i-input v-model="order.goodsPrice" readonly/>
                     </Form-item>
+                    <Form-item label="预估税额" prop="tax">
+                        <i-input v-model="order.tax" readonly/>
+                    </Form-item>
                     <Form-item label="下单时间" prop="addTime">
                         <Date-picker format="yyyy-MM-dd HH:mm:ss" v-model="order.addTime" placeholder="使用时间" readonly/>
                     </Form-item>
@@ -179,6 +182,7 @@
                         <td style="text-align: center; width: 240px; font-weight: bold;">优惠抵扣金额(元)</td>
                         <td style="text-align: center; width: 240px; font-weight: bold;">应收金额(元)</td>
                         <td style="text-align: center; width: 240px; font-weight: bold;">实收金额(元)</td>
+                        <td style="text-align: center; width: 240px; font-weight: bold;">预估税额(元)</td>
                     </tr>
                     <tr v-for="(item,index) in orderGoodsList">
                         <td width="120px">
@@ -187,13 +191,14 @@
                         <td>
                             <p style="line-height: 30px;">{{item.goodsName}}</p>
                             <p style="line-height: 30px;">数量:{{item.number}}</p>
-                            <p style="line-height: 30px;">单价:¥{{item.retailPrice}}</p>
+                            <p style="line-height: 30px;">单价:¥{{item.marketPrice}}</p>
                             <p style="line-height: 30px;">SKU:{{item.sku}}</p>
                         </td>
-                        <td align="center">¥{{item.number * item.retailPrice}}</td>
-                        <td align="center">-</td>
-                        <td align="center">-</td>
-                        <td align="center">-</td>
+                        <td align="center">¥{{item.number * item.marketPrice}}</td>
+                        <td align="center">¥{{item.number * item.discountedPrice}}</td>
+                        <td align="center">¥{{item.number * item.actualPaymentAmount}}</td>
+                        <td align="center">¥{{item.number * item.actualPaymentAmount}}</td>
+                        <td align="center">¥{{item.tax}}</td>
                     </tr>
                     <tr>
                         <td align="left" style="font-weight: bold;">运费</td>
@@ -202,15 +207,17 @@
                         <td align="center">-</td>
                         <td align="center">¥{{order.freightPrice}}</td>
                         <td align="center">-</td>
+                        <td align="center">-</td>
                     </tr>
                     <tr>
                         <td align="left" colspan="2" style="font-weight: bold;">总计</td>
                         <td align="center">¥{{order.orderPrice}}</td>
-                        <td align="center">¥{{order.couponPrice}}</td>
+                        <td align="center">¥{{order.fullCutPrice}}</td>
                         <td align="center">¥{{order.actualPrice}}</td>
                         <td align="center" v-show="order.payStatus == 0">未付款</td>
                         <td align="center" v-show="order.payStatus == 1">付款中</td>
                         <td align="center" v-show="order.payStatus == 2 || order.payStatus == 4">¥{{order.actualPrice}}</td>
+                        <td align="center">¥{{order.tax}}</td>
                     </tr>
                 </table>
                 <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>

+ 23 - 26
kmall-admin/src/main/webapp/js/sale/sale.js

@@ -499,6 +499,9 @@ let vm = new Vue({
             vm.$refs.customName.value = "";
             vm.$refs.customIDCard.value = "";
             vm.$refs.customPhone.value = "";
+            if(vm.$refs.couponSn)
+                vm.$refs.couponSn.value = "";
+            this.userInfo.couponSn = "";
         },
         submitOrder:function(){
             $('#payCode').unbind('keydown').keydown(function(event){});
@@ -558,28 +561,19 @@ let vm = new Vue({
             // 优惠券
             vm.coupons = new Map();
         },
-        // getIDCardInfo: function(){
-        //     $.get("../order/getIdCardInfo", function (r){
-        //         if(r.code === 0){
-        //             if(!r.info){
-        //                 alert("请连接设备或设备有问题,请联系管理员!");
-        //                 return ;
-        //             }
-        //             var data = JSON.parse(r.info);
-        //             if(data.code=="0"){
-        //                 vm.$refs.customName.value = data.rows[0].data.name;
-        //                 vm.$refs.customIDCard.value = data.rows[0].data.id_no;
-        //             }else{
-        //                 alert(data.msg);
-        //                 return ;
-        //             }
-        //
-        //         }else{
-        //             alter("请连接设备或设备有问题,请联系管理员!");
-        //         }
-        //     });
-        //
-        // },
+        queryIDCardInfo: function(){
+            $.get("../order/queryIDCardInfo/"+vm.$refs.customPhone.value, function (r){
+                if(r.code === 0){
+                    var data = r.userEntity;
+                    vm.$refs.customName.value = data.username;
+                    vm.$refs.customIDCard.value = data.idNo;
+
+                }else{
+                    alert(r.msg);
+                }
+            });
+
+        },
         getIDCardInfo: function(){
             $.post("http://127.0.0.1:8000/idcard/read", function (r){
                 // var dataR = JSON.parse(r);
@@ -643,13 +637,15 @@ let vm = new Vue({
                 alert("手机号码有误,请重填");
                 return ;
             }
-
             //将手机号与姓名身份证号进行绑定,下次填写手机号即可
             let userInfoBindingKey = this.userInfo.customPhone;
             let userInfoBindingValue = this.userInfo.customName+this.userInfo.customIDCard;
             this.userInfoBinding[userInfoBindingKey] = userInfoBindingValue;
 
-            if(this.userInfo.couponSn){
+            console.log(this.userInfo.couponSn);
+            if(this.userInfo.couponSn && this.userInfo.couponSn != ""){
+
+
                 var coupon = vm.coupons.get(this.userInfo.couponSn);
                 if(coupon == null){
                     alert("请输入正确的优惠券码");
@@ -880,10 +876,10 @@ function printArea2(content) {
         + '</div>');
     doc.close();
     var frameWindow = iframe.contentWindow;
-    frameWindow.close();
     frameWindow.focus();
     frameWindow.print();
     frameWindow.print();
+    frameWindow.close();
 }
 var removePrintArea = function (id) {
     $("iframe#" + id).remove();
@@ -904,6 +900,7 @@ function openWebSocket() {
         //ws对应http、wss对应https。
         // webSocket = new WebSocket("ws://183.62.225.124:8080/ws/server/"+storeId);
         webSocket = new WebSocket("ws://127.0.0.1:8080//ws/server/"+storeId);
+        // webSocket = new WebSocket("wss://cb.k1net.cn/ws/server/"+storeId);
         if (webSocket.readyState === webSocket.CONNECTING) {
             console.log('1.连接正在打开......');
         }
@@ -920,8 +917,8 @@ function openWebSocket() {
         };
         //收到消息事件
         webSocket.onmessage = function (msg) {
-
             var data = Object.assign({}, JSON.parse(msg.data));
+            console.log('3.接收到服务端信息......data:'+data);
             vm.sessionId = data.sessionId;
             vm.pickUpCodeList = [];
             if(data.pickUpCodeList.length > 0){

+ 16 - 0
kmall-admin/src/main/webapp/js/shop/offilineOrderList.js

@@ -94,7 +94,23 @@ $(function () {
             // {label: '收货人', name: 'consignee', index: 'consignee', width: 80},
             // {label: '收货地址', name: 'address', index: 'address', width: 80},
             // {label: '联系电话', name: 'mobile', index: 'mobile', width: 80},
+            {label: '是否使用优惠券', name: 'couponName', index: 'couponName', align: 'center',width: 80,
+            formatter:function(value){
+                    if(value != ""){
+                        return value + ",是";
+                    }else{
+                        return "否";
+                    }
+            }},
+            {label: '优惠券金额', name: 'couponPrice', index: 'couponPrice', align: 'center',width: 80,
+                formatter:function(value){
+                    if(value == 0 ){
+                        return "-";
+                    }
+                    return value;
+                }},
             {label: '实际支付', name: 'actualPrice', index: 'actual_price', align: 'center',width: 80},
+            {label: '预计税额', name: 'tax', index: 'tax', align: 'center',width: 80},
             {label: '订单总价', name: 'orderPrice', index: 'order_price',align: 'center', width: 80},
             {
                 label: '下单时间', name: 'addTime', index: 'add_time', width: 140,align: 'center',

+ 1 - 0
kmall-admin/src/main/webapp/js/shop/storeProductStock.js

@@ -586,6 +586,7 @@ var vm = new Vue({
         getAttributes: function (opt) {
             var value = opt.value;
             if(value){
+                vm.getBrand(value);
                 $.get("../attribute/query?attributeCategoryId=" + value , function (r) {
                     vm.attributes = r.list;
                 });

+ 8 - 43
kmall-admin/src/main/webapp/login.html

@@ -113,40 +113,10 @@
             if (self != top) {
                 top.location.href = self.location.href;
             }
-
-
-
         },
         beforeMount: function(){
             // TODO 调用接口获取机器码
 
-                // $.ajax({
-                //     url:"http://127.0.0.1:8000/api/reg/gen",
-                //     success:function(r){
-                //         if(r.code == "0"){
-                //             vm.machineCode = r.rows[0].data.code;
-                //             console.log(vm.machineCode);
-                //             vm.machineCode = vm.machineCode.replace("+","%2B");
-                //             sessionStorage.setItem("machineCode",vm.machineCode);
-                //         }
-                //     },
-                //     error:function(XMLHttpRequest, textStatus, errorThrown){
-                //         alert("获取机器码失败,请联系管理员");
-                //     }
-                // })
-
-                // $.get("http://127.0.0.1:8000/api/reg/gen" , function (r) {
-                //     console.log(r);
-                //     if(r.code == "0"){
-                //         vm.machineCode = r.rows[0].data.code;
-                //         console.log(vm.machineCode);
-                //         vm.machineCode = vm.machineCode.replace("+","%2B");
-                //         sessionStorage.setItem("machineCode",vm.machineCode);
-                //     }
-                // });
-
-
-
 
         },
         methods: {
@@ -154,13 +124,7 @@
                 this.src = "captcha.jpg?t=" + $.now();
             },
             login: function (event) {
-                var data = "username=" + vm.username + "&password=" + vm.password + "&captcha=" + vm.captcha + "&machineCode=" + vm.machineCode; //TODO  新增加一个机器码;
-                // sessionStorage.removeItem("permsSet");
-                // var code = sessionStorage.getItem("machineCode");
-                // if(!code){
-                //     alert("正在获取机器码,请稍后登录,大约5s");
-                //     return;
-                // }
+                var data = "username=" + vm.username + "&password=" + vm.password + "&captcha=" + vm.captcha + "&machineCode=" + vm.machineCode +"&loginType=1"; //TODO  新增加一个机器码;
                 $.ajax({
                     type: "POST",
                     url: "sys/login",
@@ -170,12 +134,7 @@
                         if (result.code == 0) {//登录成功
                             sessionStorage.setItem("permsSet", JSON.stringify(result.permsSet))
                             sessionStorage.setItem("storeId", result.storeId)
-
-                            // if(result.storeId != null){
-                            // parent.location.href = '/sale/sale.html';
-                            // }else{
-                                parent.location.href = 'index.html';
-                            // }
+                            parent.location.href = 'index.html';
                         } else {
                             iview.Message.error(result.msg);
                             vm.refreshCode();
@@ -185,7 +144,13 @@
             },
             changeUserLogin:function(){
                 parent.location.href = 'userLogin.html';
+            },
+            mounted:function(){
+                this.$Message.config({
+                    duration:3
+                })
             }
+
         }
     });
 </script>

+ 1 - 1
kmall-admin/src/main/webapp/statics/css/login.css

@@ -100,4 +100,4 @@ body.signin {
 }
 .authcode input{
     height: 45px;
-}
+}

+ 103 - 0
kmall-admin/src/main/webapp/statics/css/userLogin.css

@@ -0,0 +1,103 @@
+html{height: 100%;}
+body.signin {
+    background: #18c8f6;
+    height: auto;
+    background:url("../img/login.jpg") no-repeat center fixed;
+    -webkit-background-size: cover;
+    -moz-background-size: cover;
+    -o-background-size: cover;
+    background-size: cover;
+}
+
+.signinpanel {
+    width: 750px;
+    margin: 15% auto 0 auto;
+}
+
+.signinpanel .logopanel {
+    float: none;
+    width: auto;
+    padding: 0;
+    background: none;
+}
+
+.signinpanel .signin-info ul {
+    list-style: none;
+    padding: 0;
+    margin: 20px 0;
+}
+
+.signinpanel .form-control {
+    display: block;
+    margin-top: 15px;
+}
+
+.signinpanel .uname {
+    background: #fff url(../img/user.png) no-repeat 95% center;color:#333;
+}
+
+.signinpanel .pword {
+    background: #fff url(../img/locked.png) no-repeat 95% center;color:#333;
+}
+
+.signinpanel .btn {
+    margin-top: 15px;
+}
+
+.signinpanel form {
+    background: rgba(255, 255, 255, 0.2);
+    border: 1px solid rgba(255,255,255,.3);
+    -moz-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03);
+    -webkit-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03);
+    box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03);
+    -moz-border-radius: 3px;
+    -webkit-border-radius: 3px;
+    border-radius: 3px;
+    padding: 30px;
+}
+
+.signup-footer{border-top: solid 1px rgba(255,255,255,.3);margin:20px 0;padding-top: 15px;}
+
+@media screen and (max-width: 768px) {
+    .signinpanel,
+    .signuppanel {
+        margin: 0 auto;
+        width: 420px!important;
+        padding: 20px;
+    }
+    .signinpanel form {
+        margin-top: 20px;
+    }
+    .signup-footer {
+        margin-bottom: 10px;
+    }
+    .signuppanel .form-control {
+        margin-bottom: 10px;
+    }
+    .signup-footer .pull-left,
+    .signup-footer .pull-right {
+        float: none !important;
+        text-align: center;
+    }
+    .signinpanel .signin-info ul {
+        display: none;
+    }
+}
+@media screen and (max-width: 320px) {
+    .signinpanel,
+    .signuppanel {
+        margin:0 20px;
+        width:auto;
+    }
+}
+/*hhq*/
+.userinput input{
+    width: 250px;
+    height: 45px;
+}
+#authcode{
+    margin-bottom: 20px;
+}
+.authcode input{
+    height: 45px;
+}

BIN
kmall-admin/src/main/webapp/statics/img/login.jpg


BIN
kmall-admin/src/main/webapp/statics/img/login2.jpg


+ 12 - 35
kmall-admin/src/main/webapp/userLogin.html

@@ -5,11 +5,12 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <title>kmall_pt</title>
     <!-- Tell the browser to be responsive to screen width -->
+
     <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
     <link rel="stylesheet" href="statics/css/bootstrap.min.css">
     <link rel="stylesheet" href="statics/css/font-awesome.min.css">
     <link rel="stylesheet" href="statics/css/style.css">
-    <link rel="stylesheet" href="statics/css/login.css">
+    <link rel="stylesheet" href="statics/css/userLogin.css">
     <link rel="stylesheet" href="statics/css/main.css">
     <link rel="stylesheet" href="statics/css/iview.css">
     <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
@@ -17,40 +18,16 @@
     <!--[if lt IE 9]>
     <script src="statics/libs/html5shiv.min.js"></script>
     <script src="statics/libs/respond.min.js"></script>
+
     <![endif]-->
 </head>
-<body class="signin hold-transition login-page">
+<body class="signin hold-transition login-page"  >
 <div class="loginscreen animated fadeInDown signinpanel" id="loginBox" v-cloak>
-    <!--<div class="row" style="background: rgba(109, 109, 109, 0.23);border: 0px solid #dddee1;padding:72px 2px">-->
     <div class="row" style="background: rgba(109, 109, 109, 0.45);border-radius: 20px;border: 0px solid #6d6d6d;padding:13px 22px 35px 22px;">
         <div class="row" style="border: 0px solid #6d6d6d">
             <p style="font-size: 45px;font-family: 微软雅黑;color: #ffffff;text-shadow: 5px 5px 5px #000;margin-bottom: 10px" align="center"><b>跨 境 电 商 &nbsp;&nbsp;新零售</b></p>
             <hr/>
         </div>
-        <!--<div class="col-md-7">
-            <div class="signin-info">
-                <div class="logopanel m-b">
-                    <h1>中网科技</h1>
-                </div>
-                <div class="m-b"></div>
-                <h4>欢迎使用kmall_pt</h4>
-                <ul class="m-b">
-                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>完善开源版本购物流程</li>
-                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>多门店管理</li>
-                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>团购管理(团购设置、分享)</li>
-                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>优惠活动(折扣、满减、满免配送)</li>
-                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>优惠推广(下单送满减券、推荐送满减券、推荐送满减券)</li>
-                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>订单管理(普通订单、团购订单、打印订单)</li>
-                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>收货地址(用户输入、微信地址)</li>
-                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>用户评论审核</li>
-                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>快递查询接口(快递鸟)</li>
-                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>用户下单自动打印小票(飞鸽打印机)</li>
-                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>升级版UI</li>
-                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>短信平台</li>
-                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>优化退款功能和付款记录</li>
-                </ul>
-            </div>
-        </div>-->
         <div class="col-md-7" >
             <p style="font-size: 35px;font-family: 微软雅黑;color: #3bc8ff;text-shadow: 2px 2px 5px #000;padding-right: 10px;margin: 45px 0 0;" align="center">
                 <span >CW大药房</span>
@@ -80,17 +57,12 @@
                     </div>
                 </div>
                 <div>
-                    <i-button type="primary" @click="login" style="width: 125px;height: 45px">登录</i-button>
-                    <i-button type="primary" @click="change" style="width: 125px;height: 45px">切换管理端</i-button>
+                    <i-button type="warning" @click="login" style="width: 125px;height: 45px">登录</i-button>
+                    <i-button type="warning" @click="change" style="width: 125px;height: 45px">切换管理端</i-button>
                 </div>
             </div>
         </div>
     </div>
-    <!--<div class="signup-footer">-->
-        <!--<div class="pull-left" style="margin-left: 520px;">-->
-            <!--2018~2020 &copy; <a href="#" target="_blank">中网科技(深圳)有限公司</a>-->
-        <!--</div>-->
-    <!--</div>-->
 </div>
 <!-- /.login-box -->
 <script src="statics/libs/jquery.min.js"></script>
@@ -154,7 +126,7 @@
                 this.src = "captcha.jpg?t=" + $.now();
             },
             login: function (event) {
-                var data = "username=" + vm.username + "&password=" + vm.password + "&captcha=" + vm.captcha + "&machineCode=" + vm.machineCode; //TODO  新增加一个机器码;
+                var data = "username=" + vm.username + "&password=" + vm.password + "&captcha=" + vm.captcha + "&machineCode=" + vm.machineCode+"&loginType=2"; //TODO  新增加一个机器码;
                 sessionStorage.removeItem("permsSet");
                 var code = sessionStorage.getItem("machineCode");
                 if(!code){
@@ -185,6 +157,11 @@
             },
             change:function(){
                 parent.location.href = 'login.html';
+            },
+            mounted:function(){
+                this.$Message.config({
+                    duration:3
+                })
             }
         }
     });