zcb hace 4 años
padre
commit
9834c76291
Se han modificado 26 ficheros con 569 adiciones y 127 borrados
  1. 8 0
      kmall-admin/pom.xml
  2. 216 7
      kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java
  3. 33 2
      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. 31 1
      kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java
  12. 5 5
      kmall-admin/src/main/java/com/kmall/admin/service/impl/MkActivitiesCouponServiceImpl.java
  13. 21 14
      kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java
  14. 13 0
      kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml
  15. 6 0
      kmall-admin/src/main/resources/mybatis/mapper/MkActivitiesCouponDao.xml
  16. 8 3
      kmall-admin/src/main/webapp/WEB-INF/page/sale/sale.html
  17. 16 2
      kmall-admin/src/main/webapp/WEB-INF/page/shop/goods.html
  18. 13 6
      kmall-admin/src/main/webapp/WEB-INF/page/shop/offilineOrderList.html
  19. 5 2
      kmall-admin/src/main/webapp/js/sale/sale.js
  20. 16 0
      kmall-admin/src/main/webapp/js/shop/offilineOrderList.js
  21. 8 43
      kmall-admin/src/main/webapp/login.html
  22. 1 1
      kmall-admin/src/main/webapp/statics/css/login.css
  23. 103 0
      kmall-admin/src/main/webapp/statics/css/userLogin.css
  24. BIN
      kmall-admin/src/main/webapp/statics/img/login.jpg
  25. BIN
      kmall-admin/src/main/webapp/statics/img/login2.jpg
  26. 13 36
      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>

+ 216 - 7
kmall-admin/src/main/java/com/kmall/admin/controller/GoodsController.java

@@ -1,33 +1,36 @@
 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.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.*;
 
 /**
@@ -50,6 +53,8 @@ public class GoodsController {
     private ExcelUtil excelUtil;
     @Autowired
     private StoreService storeService;
+    @Autowired
+    private SysOssService sysOssService;
 
 
 
@@ -294,6 +299,210 @@ public class GoodsController {
         return R.ok();
     }
 
+    @RequestMapping("/generalGoodsImgUploadByZip")
+    @ResponseBody
+    public R batchAddImgByZip(@RequestParam("file") MultipartFile file) {
+        //上传文件
+        batchAdd(file,2);
+        return R.ok();
+    }
+
+    @RequestMapping("/generalGoodsImgUpload")
+    @ResponseBody
+    public R batchAddImg(@RequestParam("file") MultipartFile file) {
+        //上传文件
+        batchAdd(file,1);
+        return R.ok();
+    }
+
+
+
+    private Map<String, Object> batchAdd(MultipartFile file, int type) {
+        /*
+         *创建临时文件夹
+         * 解压文件
+         */
+        String fileName = file.getOriginalFilename();
+        String path = "d:/zip/";
+        File dir = new File(path);
+        dir.mkdirs();
+        String filePath = "d:/test/";
+        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("解压执行失败");
+        }
+        //程序结束时,删除临时文件
+        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("/")[2].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) {

+ 33 - 2
kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java

@@ -655,6 +655,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 +683,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 +1037,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);
         }
 

+ 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);
 }

+ 31 - 1
kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java

@@ -604,6 +604,13 @@ public class GoodsServiceImpl implements GoodsService {
         return 1;
     }
 
+
+    @Transactional
+    public void updateForImgUrl(GoodsEntity goodsEntity){
+        // 修改商品
+        goodsDao.update(goodsEntity);
+    }
+
     /**
      * 更新门店商品是否有修改字段
      * @param storeId
@@ -1279,7 +1286,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());
@@ -1338,6 +1345,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);
     }
 }

+ 21 - 14
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;
@@ -1827,7 +1828,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){
@@ -1861,7 +1864,7 @@ public class OrderServiceImpl implements OrderService {
 //                order.setActivity_id(storeTopic.getId().longValue());
 //            }
             order.setMerchOrderSn(merchOrderSn);
-
+            order.setCoupon_name(couponSn); // 借用这个字段来记录是否使用优惠券
             //插入订单信息和订单商品
             orderDao.saveOrderVo(order);
 
@@ -1906,12 +1909,12 @@ public class OrderServiceImpl implements OrderService {
             // 微信支付
 //            wxPay(user, parCode, resultObj, order, processRecordEntity, orderWXPayRecordCurrent, store);
             // 支付宝支付
-//            AliPay(user, parCode , order, processRecordEntity, orderWXPayRecordCurrent, store);
+            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());
@@ -2359,24 +2362,28 @@ public class OrderServiceImpl implements OrderService {
         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);
 
         String orderSn = "CW" +  CommonUtil.generateOrderNumber();
         orderInfo.setOrder_sn(orderSn);
         orderInfo.setMerchSn(merchSn);
         orderInfo.setUser_id(loginUser.getId().longValue());
-
+        actualPrice = actualPrice.subtract(couponPrice);
 
         StoreEntity storeEntity = storeDao.queryObject(storeId);
         //收货地址和运费

+ 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>

+ 8 - 3
kmall-admin/src/main/webapp/WEB-INF/page/sale/sale.html

@@ -263,10 +263,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 +280,7 @@
                                     <th>实际支付价</th>
                                     <th>数量</th>
                                     <th>总额</th>
+                                    <th>预估税费</th>
                                     <th>参与活动</th>
                                 </tr>
                                 <tr v-for="(item,i) in goodsDetailList" >
@@ -287,6 +291,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;
@@ -522,4 +536,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>

+ 5 - 2
kmall-admin/src/main/webapp/js/sale/sale.js

@@ -497,6 +497,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){});
@@ -628,8 +631,8 @@ let vm = new Vue({
                 alert("手机号码有误,请重填");
                 return ;
             }
-
-            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("请输入正确的优惠券码");

+ 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',

+ 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


+ 13 - 36
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>
@@ -121,7 +93,7 @@
             // TODO 调用接口获取机器码
 
                 $.ajax({
-                    url:"http://127.0.0.1:21600/api/reg/gen",
+                    url:"http://127.0.0.1:8000/api/reg/gen",
                     success:function(r){
                         if(r.code == "0"){
                             vm.machineCode = r.rows[0].data.code;
@@ -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
+                })
             }
         }
     });