Browse Source

1.出货提醒,订货提醒excel导出功能
2.价格过低预警 页面、实体类、逻辑类增加
3.登录时获取机器码
4.判断机器码跟门店是否添加

zcb 4 years ago
parent
commit
0168eb64f2
26 changed files with 1149 additions and 29 deletions
  1. 1 1
      kmall-admin/src/main/java/com/kmall/admin/controller/CashierController.java
  2. 3 0
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java
  3. 107 0
      kmall-admin/src/main/java/com/kmall/admin/controller/alarm/Mall2LowPriceWarningController.java
  4. 57 0
      kmall-admin/src/main/java/com/kmall/admin/controller/alarm/Mall2OrderingEarlyWarningRemindsController.java
  5. 58 0
      kmall-admin/src/main/java/com/kmall/admin/controller/alarm/Mall2ShippingReminderAlarmController.java
  6. 2 1
      kmall-admin/src/main/java/com/kmall/admin/dao/CashierDao.java
  7. 15 0
      kmall-admin/src/main/java/com/kmall/admin/dao/alarm/Mall2LowPriceWarningDao.java
  8. 11 0
      kmall-admin/src/main/java/com/kmall/admin/entity/CashierEntity.java
  9. 268 0
      kmall-admin/src/main/java/com/kmall/admin/entity/alarm/Mall2LowPriceWarningEntity.java
  10. 4 2
      kmall-admin/src/main/java/com/kmall/admin/fromcomm/controller/SysLoginController.java
  11. 72 0
      kmall-admin/src/main/java/com/kmall/admin/service/alarm/Mall2LowPriceWarningService.java
  12. 2 2
      kmall-admin/src/main/java/com/kmall/admin/service/impl/CashierServiceImpl.java
  13. 42 3
      kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java
  14. 59 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/alarm/Mall2LowPriceWarningServiceImpl.java
  15. 2 1
      kmall-admin/src/main/resources/mybatis/mapper/CashierDao.xml
  16. 3 0
      kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml
  17. 147 0
      kmall-admin/src/main/resources/mybatis/mapper/alarm/Mall2LowPriceWarningDao.xml
  18. 69 0
      kmall-admin/src/main/webapp/WEB-INF/page/alarm/mall2lowpricewarning.html
  19. 5 0
      kmall-admin/src/main/webapp/WEB-INF/page/alarm/mall2orderingearlywarningreminds.html
  20. 3 0
      kmall-admin/src/main/webapp/WEB-INF/page/alarm/mall2shippingreminderalarm.html
  21. 14 4
      kmall-admin/src/main/webapp/WEB-INF/page/cashier/cashierManager.html
  22. 154 0
      kmall-admin/src/main/webapp/js/alarm/mall2lowpricewarning.js
  23. 5 1
      kmall-admin/src/main/webapp/js/alarm/mall2orderingearlywarningreminds.js
  24. 5 2
      kmall-admin/src/main/webapp/js/alarm/mall2shippingreminderalarm.js
  25. 24 7
      kmall-admin/src/main/webapp/js/cashier/cashierManager.js
  26. 17 5
      kmall-admin/src/main/webapp/login.html

+ 1 - 1
kmall-admin/src/main/java/com/kmall/admin/controller/CashierController.java

@@ -57,7 +57,7 @@ public class CashierController {
     @ResponseBody
     public R info(@PathVariable("mcId") String mcId) {
         CashierEntity cashier = cashierService.queryObject(mcId);
-
+        cashier.setId(cashier.getShopSn());
         return R.ok().put("cashier", cashier);
     }
 

+ 3 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java

@@ -921,6 +921,9 @@ public class OrderController {
         try {
 //            throw new RuntimeException("系统异常");
             resultObj = orderService.offlineRetailSubmit(param,user);
+            if(resultObj.get("errno") != null && ((Integer)resultObj.get("errno")) == 400){
+                return R.error((String) resultObj.get("errmsg"));
+            }
             return R.ok().put("resultObj", resultObj);
         } catch (Exception e) {
             return R.error(e.getMessage());

+ 107 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/alarm/Mall2LowPriceWarningController.java

@@ -0,0 +1,107 @@
+package com.kmall.admin.controller.alarm;
+
+import java.util.List;
+import java.util.Map;
+
+import com.kmall.common.utils.PageUtils;
+import com.kmall.common.utils.Query;
+import com.kmall.common.utils.R;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import com.kmall.admin.entity.alarm.Mall2LowPriceWarningEntity;
+import com.kmall.admin.service.alarm.Mall2LowPriceWarningService;
+
+/**
+ * 价格过低预警表Controller
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2020-06-23 11:40:02
+ */
+@Controller
+@RequestMapping("mall2lowpricewarning")
+public class Mall2LowPriceWarningController {
+    @Autowired
+    private Mall2LowPriceWarningService mall2LowPriceWarningService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+//    @RequiresPermissions("mall2lowpricewarning:list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<Mall2LowPriceWarningEntity> mall2LowPriceWarningList = mall2LowPriceWarningService.queryList(query);
+        int total = mall2LowPriceWarningService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(mall2LowPriceWarningList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{mlrwId}")
+//    @RequiresPermissions("mall2lowpricewarning:info")
+    @ResponseBody
+    public R info(@PathVariable("mlrwId") Integer mlrwId) {
+        Mall2LowPriceWarningEntity mall2LowPriceWarning = mall2LowPriceWarningService.queryObject(mlrwId);
+
+        return R.ok().put("mall2LowPriceWarning", mall2LowPriceWarning);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+//    @RequiresPermissions("mall2lowpricewarning:save")
+    @ResponseBody
+    public R save(@RequestBody Mall2LowPriceWarningEntity mall2LowPriceWarning) {
+        mall2LowPriceWarningService.save(mall2LowPriceWarning);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+//    @RequiresPermissions("mall2lowpricewarning:update")
+    @ResponseBody
+    public R update(@RequestBody Mall2LowPriceWarningEntity mall2LowPriceWarning) {
+        mall2LowPriceWarningService.update(mall2LowPriceWarning);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+//    @RequiresPermissions("mall2lowpricewarning:delete")
+    @ResponseBody
+    public R delete(@RequestBody Integer[]mlrwIds) {
+        mall2LowPriceWarningService.deleteBatch(mlrwIds);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<Mall2LowPriceWarningEntity> list = mall2LowPriceWarningService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 57 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/alarm/Mall2OrderingEarlyWarningRemindsController.java

@@ -1,12 +1,22 @@
 package com.kmall.admin.controller.alarm;
 
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.kmall.admin.entity.alarm.Mall2ShippingReminderAlarmEntity;
+import com.kmall.common.utils.JacksonUtils;
 import com.kmall.common.utils.PageUtils;
 import com.kmall.common.utils.Query;
 import com.kmall.common.utils.R;
+import com.kmall.common.utils.excel.ExcelUtil;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
@@ -14,6 +24,9 @@ import org.springframework.web.bind.annotation.*;
 import com.kmall.admin.entity.alarm.Mall2OrderingEarlyWarningRemindsEntity;
 import com.kmall.admin.service.alarm.Mall2OrderingEarlyWarningRemindsService;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 /**
  * 订货提醒预警表Controller
  *
@@ -27,6 +40,9 @@ public class Mall2OrderingEarlyWarningRemindsController {
     @Autowired
     private Mall2OrderingEarlyWarningRemindsService mall2OrderingEarlyWarningRemindsService;
 
+    private final Logger LOGGER = LoggerFactory.getLogger(Mall2OrderingEarlyWarningRemindsController.class);
+
+
     /**
      * 查看列表
      */
@@ -104,4 +120,45 @@ public class Mall2OrderingEarlyWarningRemindsController {
 
         return R.ok().put("list", list);
     }
+
+
+    // exportInfo
+    /**
+     * 导出订单数据
+     */
+    @RequestMapping("/exportInfo")
+    public R exportInfo(HttpServletResponse response, HttpServletRequest request) {
+        Map<String, Object> params = new HashMap<>();
+
+        List<Mall2OrderingEarlyWarningRemindsEntity> list = mall2OrderingEarlyWarningRemindsService.queryList(params);
+
+        LOGGER.info(JacksonUtils.toJson(list));
+        List<Map<Integer, String>> lists = Lists.newArrayList();
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+        for (int i = 0; i < list.size(); i++) {
+            HashMap<Integer, String> map = Maps.newHashMap();
+
+            map.put(map.size(), (i+1)+"");
+            map.put(map.size(), list.get(i).getGoodsId()+"");
+            map.put(map.size(), list.get(i).getGoodsName());
+            map.put(map.size(), list.get(i).getSku());
+            map.put(map.size(), list.get(i).getAverageSales()+"");
+            map.put(map.size(), list.get(i).getTotalNum()+"");
+            map.put(map.size(), format.format(list.get(i).getAlarmTime()));
+
+            lists.add(map);
+        }
+        String fileName = "订货提醒";
+        String titles[] = {"序号", "商品id","商品名称","商品sku","平均销量","总库存数","预警时间"};
+        try {
+            ExcelUtil.exportExcel(fileName, titles, lists, response, request);
+        } catch (IOException e) {
+            e.printStackTrace();
+            return R.error("导出失败!");
+        }
+        return R.error("导出成功!");
+    }
+
 }

+ 58 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/alarm/Mall2ShippingReminderAlarmController.java

@@ -1,18 +1,31 @@
 package com.kmall.admin.controller.alarm;
 
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.kmall.common.utils.JacksonUtils;
 import com.kmall.common.utils.PageUtils;
 import com.kmall.common.utils.Query;
 import com.kmall.common.utils.R;
+import com.kmall.common.utils.excel.ExcelUtil;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 
 import com.kmall.admin.entity.alarm.Mall2ShippingReminderAlarmEntity;
 import com.kmall.admin.service.alarm.Mall2ShippingReminderAlarmService;
+import sun.nio.ch.SelectorImpl;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
 /**
  * 出货提醒预警表Controller
@@ -27,6 +40,9 @@ public class Mall2ShippingReminderAlarmController {
     @Autowired
     private Mall2ShippingReminderAlarmService mall2ShippingReminderAlarmService;
 
+
+    private final Logger LOGGER = LoggerFactory.getLogger(Mall2ShippingReminderAlarmController.class);
+
     /**
      * 查看列表
      */
@@ -104,4 +120,46 @@ public class Mall2ShippingReminderAlarmController {
 
         return R.ok().put("list", list);
     }
+
+
+    // exportInfo
+    /**
+     * 导出订单数据
+     */
+    @RequestMapping("/exportInfo")
+    public R exportInfo(HttpServletResponse response, HttpServletRequest request) {
+        Map<String, Object> params = new HashMap<>();
+
+        List<Mall2ShippingReminderAlarmEntity> list = mall2ShippingReminderAlarmService.queryList(params);
+
+        LOGGER.info(JacksonUtils.toJson(list));
+        List<Map<Integer, String>> lists = Lists.newArrayList();
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+        for (int i = 0; i < list.size(); i++) {
+            HashMap<Integer, String> map = Maps.newHashMap();
+
+            map.put(map.size(), (i+1)+"");
+            map.put(map.size(), list.get(i).getStoreId()+"");
+            map.put(map.size(), list.get(i).getStoreName());
+            map.put(map.size(), list.get(i).getSku());
+            map.put(map.size(), list.get(i).getGoodsName());
+            map.put(map.size(), list.get(i).getStockNum()+"");
+            map.put(map.size(), list.get(i).getAverageSales()+"");
+            map.put(map.size(), format.format(list.get(i).getAlarmTime()));
+
+            lists.add(map);
+        }
+        String fileName = "出货提醒";
+        String titles[] = {"序号", "门店id","门店名称","门店商品sku","商品名称","剩余库存数","平均销量","预警时间"};
+        try {
+            ExcelUtil.exportExcel(fileName, titles, lists, response, request);
+        } catch (IOException e) {
+            e.printStackTrace();
+            return R.error("导出失败!");
+        }
+        return R.error("导出成功!");
+    }
+
 }

+ 2 - 1
kmall-admin/src/main/java/com/kmall/admin/dao/CashierDao.java

@@ -2,6 +2,7 @@ package com.kmall.admin.dao;
 
 import com.kmall.admin.entity.CashierEntity;
 import com.kmall.manager.dao.BaseDao;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 收银机表Dao
@@ -12,5 +13,5 @@ import com.kmall.manager.dao.BaseDao;
  */
 public interface CashierDao extends BaseDao<CashierEntity> {
 
-    CashierEntity queryByMachineCode(String machineCode);
+    CashierEntity queryByMachineCode(@Param("machineCode") String machineCode, @Param("storeId") String storeId);
 }

+ 15 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/alarm/Mall2LowPriceWarningDao.java

@@ -0,0 +1,15 @@
+package com.kmall.admin.dao.alarm;
+
+import com.kmall.admin.entity.alarm.Mall2LowPriceWarningEntity;
+import com.kmall.manager.dao.BaseDao;
+
+/**
+ * 价格过低预警表Dao
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2020-06-23 11:40:02
+ */
+public interface Mall2LowPriceWarningDao extends BaseDao<Mall2LowPriceWarningEntity> {
+
+}

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

@@ -14,6 +14,8 @@ import java.util.Date;
 public class CashierEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
+
+
     /**
      * 主键
      */
@@ -68,6 +70,7 @@ public class CashierEntity implements Serializable {
      * 时间戳
      */
     private Date tstm;
+    private String id ;
 
     /**
      * 设置:主键
@@ -254,4 +257,12 @@ public class CashierEntity implements Serializable {
     public void setMerchName(String merchName) {
         this.merchName = merchName;
     }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
 }

+ 268 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/alarm/Mall2LowPriceWarningEntity.java

@@ -0,0 +1,268 @@
+package com.kmall.admin.entity.alarm;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 价格过低预警表实体
+ * 表名 mall2_low_price_warning
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2020-06-23 11:40:02
+ */
+public class Mall2LowPriceWarningEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 价格过低预警id
+     */
+    private Integer mlrwId;
+    /**
+     * 销售价格
+     */
+    private BigDecimal salePrice;
+    /**
+     * 预警价格
+     */
+    private BigDecimal warningPrice;
+    /**
+     * 预警类别  00.底线价    10.活动价
+     */
+    private String warningType;
+    /**
+     * 产品sku
+     */
+    private String sku;
+    private String goodsName;
+    /**
+     * 门店id
+     */
+    private String storeId;
+    private String storeName;
+    /**
+     * 活动id
+     */
+    private Integer activityId;
+    private String storeTopicName;
+    /**
+     * 创建人编号
+     */
+    private String createrSn;
+    /**
+     * 创建时间,yyyy-MM-dd HH:mm:ss
+     */
+    private Date createTime;
+    /**
+     * 修改人编号
+     */
+    private String moderSn;
+    /**
+     * 修改时间,yyyy-MM-dd HH:mm:ss
+     */
+    private Date modTime;
+    /**
+     * 时间戳
+     */
+    private Date tstm;
+    /**
+     * 是否已查看  0.否  1.是
+     */
+    private Integer viewed;
+
+    /**
+     * 设置:价格过低预警id
+     */
+    public void setMlrwId(Integer mlrwId) {
+        this.mlrwId = mlrwId;
+    }
+
+    /**
+     * 获取:价格过低预警id
+     */
+    public Integer getMlrwId() {
+        return mlrwId;
+    }
+    /**
+     * 设置:销售价格
+     */
+    public void setSalePrice(BigDecimal salePrice) {
+        this.salePrice = salePrice;
+    }
+
+    /**
+     * 获取:销售价格
+     */
+    public BigDecimal getSalePrice() {
+        return salePrice;
+    }
+    /**
+     * 设置:预警价格
+     */
+    public void setWarningPrice(BigDecimal warningPrice) {
+        this.warningPrice = warningPrice;
+    }
+
+    /**
+     * 获取:预警价格
+     */
+    public BigDecimal getWarningPrice() {
+        return warningPrice;
+    }
+    /**
+     * 设置:预警类别  00.底线价    10.活动价
+     */
+    public void setWarningType(String warningType) {
+        this.warningType = warningType;
+    }
+
+    /**
+     * 获取:预警类别  00.底线价    10.活动价
+     */
+    public String getWarningType() {
+        return warningType;
+    }
+    /**
+     * 设置:产品sku
+     */
+    public void setSku(String sku) {
+        this.sku = sku;
+    }
+
+    /**
+     * 获取:产品sku
+     */
+    public String getSku() {
+        return sku;
+    }
+    /**
+     * 设置:门店id
+     */
+    public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
+
+    /**
+     * 获取:门店id
+     */
+    public String getStoreId() {
+        return storeId;
+    }
+    /**
+     * 设置:活动id
+     */
+    public void setActivityId(Integer activityId) {
+        this.activityId = activityId;
+    }
+
+    /**
+     * 获取:活动id
+     */
+    public Integer getActivityId() {
+        return activityId;
+    }
+    /**
+     * 设置:创建人编号
+     */
+    public void setCreaterSn(String createrSn) {
+        this.createrSn = createrSn;
+    }
+
+    /**
+     * 获取:创建人编号
+     */
+    public String getCreaterSn() {
+        return createrSn;
+    }
+    /**
+     * 设置:创建时间,yyyy-MM-dd HH:mm:ss
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * 获取:创建时间,yyyy-MM-dd HH:mm:ss
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+    /**
+     * 设置:修改人编号
+     */
+    public void setModerSn(String moderSn) {
+        this.moderSn = moderSn;
+    }
+
+    /**
+     * 获取:修改人编号
+     */
+    public String getModerSn() {
+        return moderSn;
+    }
+    /**
+     * 设置:修改时间,yyyy-MM-dd HH:mm:ss
+     */
+    public void setModTime(Date modTime) {
+        this.modTime = modTime;
+    }
+
+    /**
+     * 获取:修改时间,yyyy-MM-dd HH:mm:ss
+     */
+    public Date getModTime() {
+        return modTime;
+    }
+    /**
+     * 设置:时间戳
+     */
+    public void setTstm(Date tstm) {
+        this.tstm = tstm;
+    }
+
+    /**
+     * 获取:时间戳
+     */
+    public Date getTstm() {
+        return tstm;
+    }
+    /**
+     * 设置:是否已查看  0.否  1.是
+     */
+    public void setViewed(Integer viewed) {
+        this.viewed = viewed;
+    }
+
+    /**
+     * 获取:是否已查看  0.否  1.是
+     */
+    public Integer getViewed() {
+        return viewed;
+    }
+
+
+    public String getGoodsName() {
+        return goodsName;
+    }
+
+    public void setGoodsName(String goodsName) {
+        this.goodsName = goodsName;
+    }
+
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
+
+    public String getStoreTopicName() {
+        return storeTopicName;
+    }
+
+    public void setStoreTopicName(String storeTopicName) {
+        this.storeTopicName = storeTopicName;
+    }
+}

+ 4 - 2
kmall-admin/src/main/java/com/kmall/admin/fromcomm/controller/SysLoginController.java

@@ -115,8 +115,10 @@ public class SysLoginController {
         // 判断是否是店员
         if(storeId != null){
             // 是店员,根据机器码查询机器
-            CashierEntity cashierEntity =  cashierService.queryByMachineCode(machineCode);
-
+            CashierEntity cashierEntity =  cashierService.queryByMachineCode(machineCode,storeId+"");
+            if(cashierEntity == null){
+                return R.error("该机器未录入,请联系管理员录入机器,该机器机器码为:"+machineCode);
+            }
             // 记录登录记录
             CashierLoginRecordEntity cashierLoginRecordEntity = new CashierLoginRecordEntity();
             cashierLoginRecordEntity.setSallerId(ShiroUtils.getUserEntity().getUsername());

+ 72 - 0
kmall-admin/src/main/java/com/kmall/admin/service/alarm/Mall2LowPriceWarningService.java

@@ -0,0 +1,72 @@
+package com.kmall.admin.service.alarm;
+
+import com.kmall.admin.entity.alarm.Mall2LowPriceWarningEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 价格过低预警表Service接口
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2020-06-23 11:40:02
+ */
+public interface Mall2LowPriceWarningService {
+
+    /**
+     * 根据主键查询实体
+     *
+     * @param id 主键
+     * @return 实体
+     */
+    Mall2LowPriceWarningEntity queryObject(Integer mlrwId);
+
+    /**
+     * 分页查询
+     *
+     * @param map 参数
+     * @return list
+     */
+    List<Mall2LowPriceWarningEntity> queryList(Map<String, Object> map);
+
+    /**
+     * 分页统计总数
+     *
+     * @param map 参数
+     * @return 总数
+     */
+    int queryTotal(Map<String, Object> map);
+
+    /**
+     * 保存实体
+     *
+     * @param mall2LowPriceWarning 实体
+     * @return 保存条数
+     */
+    int save(Mall2LowPriceWarningEntity mall2LowPriceWarning);
+
+    /**
+     * 根据主键更新实体
+     *
+     * @param mall2LowPriceWarning 实体
+     * @return 更新条数
+     */
+    int update(Mall2LowPriceWarningEntity mall2LowPriceWarning);
+
+    /**
+     * 根据主键删除
+     *
+     * @param mlrwId
+     * @return 删除条数
+     */
+    int delete(Integer mlrwId);
+
+    /**
+     * 根据主键批量删除
+     *
+     * @param mlrwIds
+     * @return 删除条数
+     */
+    int deleteBatch(Integer[] mlrwIds);
+}

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

@@ -65,7 +65,7 @@ public class CashierServiceImpl implements CashierService {
      * @return
      */
     @Override
-    public CashierEntity queryByMachineCode(String machineCode) {
-        return cashierDao.queryByMachineCode(machineCode);
+    public CashierEntity queryByMachineCode(String machineCode,String storeId) {
+        return cashierDao.queryByMachineCode(machineCode,storeId);
     }
 }

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

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.google.common.collect.ImmutableBiMap;
 import com.google.common.collect.Maps;
 import com.kmall.admin.dao.*;
+import com.kmall.admin.dao.alarm.Mall2LowPriceWarningDao;
 import com.kmall.admin.dao.mk.Mk2GoodsTopicPriceDao;
 import com.kmall.admin.dao.mk.Mk2MemberBirthdayDao;
 import com.kmall.admin.dao.mk.store.MkStorePromOrderRealDao;
@@ -16,6 +17,7 @@ import com.kmall.admin.dto.OrderExpressDto;
 import com.kmall.admin.dto.OrderRecognitionDto;
 import com.kmall.admin.entity.*;
 import com.kmall.admin.entity.OrderProcessRecordEntity;
+import com.kmall.admin.entity.alarm.Mall2LowPriceWarningEntity;
 import com.kmall.admin.entity.mk.Mk2GoodsTopicPriceEntity;
 import com.kmall.admin.entity.mk.store.*;
 import com.kmall.admin.entity.vip.Mall2MemberConsumptionRecordsEntity;
@@ -150,6 +152,8 @@ public class OrderServiceImpl implements OrderService {
     private Mk2MemberBirthdayDao memberBirthdayDao; // 生日优惠
     @Autowired
     private MerchUserDao merchUserDao;
+    @Autowired
+    private Mall2LowPriceWarningDao lowPriceWarningDao;
 
     @Override
     public OrderEntity queryObject(Long id) {
@@ -1691,7 +1695,25 @@ public class OrderServiceImpl implements OrderService {
                         return resultObj;
                     } else {
 
-                        // TODO 判断销售价是否低于底线价
+                        // 判断销售价是否低于底线价
+                        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);
                         productInfo.setStoreId(Long.valueOf(storeId));
@@ -1703,12 +1725,15 @@ public class OrderServiceImpl implements OrderService {
                             goodsDao.update(goodsEntity);
                         }
                     }
+                    // 实际取的是门店商品的价格,所以借这个字段来存储销售价
+                    goodsEntity.setStoreRetailPrice(productInfo.getRetailPrice());
                     // 借用这个字段来存储购买数
                     goodsEntity.setGoodsNumber(sellVolume);
                     goodsEntities.add(goodsEntity);
                 }
             }
 
+
             UserEntity userEntity = userDao.queryByMobile((String) userInfo.get("customPhone"));
             if(userEntity == null) {
                 // 保存用户信息
@@ -1751,7 +1776,21 @@ public class OrderServiceImpl implements OrderService {
                             mk2GoodsTopicPriceDao.queryByTopicIdAndGoodsId(storeTopic.getId(),goodsEntity.getSku());
                     if (goodsEntity.getStoreRetailPrice().compareTo(goodsTopicPriceEntity.getTopicPrice()) <= -1) {
                         LOGGER.error("销售价格小于活动价格");
-                        throw new RuntimeException("商品"+goodsEntity.getName()+"的销售价格小于活动价格");
+
+                        // 记录该信息,到价格过低日志表中,这里有活动id
+                        Mall2LowPriceWarningEntity lowPriceWarningEntity = new Mall2LowPriceWarningEntity();
+                        lowPriceWarningEntity.setSalePrice(goodsEntity.getStoreRetailPrice());
+                        lowPriceWarningEntity.setWarningPrice(goodsTopicPriceEntity.getTopicPrice());
+                        lowPriceWarningEntity.setActivityId(goodsTopicPriceEntity.getTopicId());
+                        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;
                     }
                     goodsEntity.setStoreRetailPrice(goodsTopicPriceEntity.getTopicPrice());
                 }
@@ -1851,7 +1890,7 @@ public class OrderServiceImpl implements OrderService {
             SaleRecordEntity saleRecordEntity = new SaleRecordEntity();
 
             // 根据收银机机器码,查询收银机
-            CashierEntity cashierEntity = cashierDao.queryByMachineCode(machineCode);
+            CashierEntity cashierEntity = cashierDao.queryByMachineCode(machineCode,storeId+"");
             if(cashierEntity != null){
                 saleRecordEntity.setCashierSn(cashierEntity.getCashierSn());
                 saleRecordEntity.setOrderSn(order.getOrder_sn());

+ 59 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/alarm/Mall2LowPriceWarningServiceImpl.java

@@ -0,0 +1,59 @@
+package com.kmall.admin.service.impl.alarm;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+import com.kmall.admin.dao.alarm.Mall2LowPriceWarningDao;
+import com.kmall.admin.entity.alarm.Mall2LowPriceWarningEntity;
+import com.kmall.admin.service.alarm.Mall2LowPriceWarningService;
+
+/**
+ * 价格过低预警表Service实现类
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2020-06-23 11:40:02
+ */
+@Service("mall2LowPriceWarningService")
+public class Mall2LowPriceWarningServiceImpl implements Mall2LowPriceWarningService {
+    @Autowired
+    private Mall2LowPriceWarningDao mall2LowPriceWarningDao;
+
+    @Override
+    public Mall2LowPriceWarningEntity queryObject(Integer mlrwId) {
+        return mall2LowPriceWarningDao.queryObject(mlrwId);
+    }
+
+    @Override
+    public List<Mall2LowPriceWarningEntity> queryList(Map<String, Object> map) {
+        return mall2LowPriceWarningDao.queryList(map);
+    }
+
+    @Override
+    public int queryTotal(Map<String, Object> map) {
+        return mall2LowPriceWarningDao.queryTotal(map);
+    }
+
+    @Override
+    public int save(Mall2LowPriceWarningEntity mall2LowPriceWarning) {
+        return mall2LowPriceWarningDao.save(mall2LowPriceWarning);
+    }
+
+    @Override
+    public int update(Mall2LowPriceWarningEntity mall2LowPriceWarning) {
+        return mall2LowPriceWarningDao.update(mall2LowPriceWarning);
+    }
+
+    @Override
+    public int delete(Integer mlrwId) {
+        return mall2LowPriceWarningDao.delete(mlrwId);
+    }
+
+    @Override
+    public int deleteBatch(Integer[]mlrwIds) {
+        return mall2LowPriceWarningDao.deleteBatch(mlrwIds);
+    }
+}

+ 2 - 1
kmall-admin/src/main/resources/mybatis/mapper/CashierDao.xml

@@ -56,7 +56,7 @@
     		store.store_name as shopName,
 			merch.merch_name as merchName
 		from mall2_cashier cashier
-		left join mall_store store on cashier.shop_sn = store.store_number
+		left join mall_store store on cashier.shop_sn = store.id
 		left join mall_merch merch on cashier.merch_sn = merch.merch_sn
 		WHERE 1=1
 		<if test="machineCode != null and machineCode.trim() != ''">
@@ -160,6 +160,7 @@
 			`tstm`
 		from mall2_cashier
 		where machine_code = #{machineCode}
+		and shop_sn = #{storeId}
 	</select>
 
 </mapper>

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

@@ -432,6 +432,9 @@
         <if test="merchSn != null and merchSn.trim() != ''">
             AND o.merch_sn = #{merchSn}
         </if>
+        <if test="goodsSn != null and goodsSn.trim() != ''">
+            AND gs.goodsSn = #{goodsSn}
+        </if>
         <if test="sku != null and sku.trim() != ''">
             AND gs.sku = #{sku}
         </if>

+ 147 - 0
kmall-admin/src/main/resources/mybatis/mapper/alarm/Mall2LowPriceWarningDao.xml

@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.kmall.admin.dao.alarm.Mall2LowPriceWarningDao">
+
+    <resultMap type="com.kmall.admin.entity.alarm.Mall2LowPriceWarningEntity" id="mall2LowPriceWarningMap">
+        <result property="mlrwId" column="mlrw_id"/>
+        <result property="salePrice" column="sale_price"/>
+        <result property="warningPrice" column="warning_price"/>
+        <result property="warningType" column="warning_type"/>
+        <result property="sku" column="sku"/>
+        <result property="storeId" column="store_id"/>
+        <result property="activityId" column="activity_id"/>
+        <result property="createrSn" column="creater_sn"/>
+        <result property="createTime" column="create_time"/>
+        <result property="moderSn" column="moder_sn"/>
+        <result property="modTime" column="mod_time"/>
+        <result property="tstm" column="tstm"/>
+        <result property="viewed" column="viewed"/>
+    </resultMap>
+
+	<select id="queryObject" resultType="com.kmall.admin.entity.alarm.Mall2LowPriceWarningEntity">
+		select
+			`mlrw_id`,
+			`sale_price`,
+			`warning_price`,
+			`warning_type`,
+			`sku`,
+			`store_id`,
+			`activity_id`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`,
+			`viewed`
+		from mall2_low_price_warning
+		where mlrw_id = #{id}
+	</select>
+
+	<select id="queryList" resultType="com.kmall.admin.entity.alarm.Mall2LowPriceWarningEntity">
+		select
+    		warning.mlrw_id,
+    		warning.sale_price,
+    		warning.warning_price,
+    		warning.warning_type,
+    		warning.sku,
+    		warning.store_id,
+    		warning.activity_id,
+    		warning.creater_sn,
+    		warning.create_time,
+    		warning.moder_sn,
+    		warning.mod_time,
+    		warning.tstm,
+    		warning.viewed,
+    		goods.name as goodsName,
+    		store.store_name as storeName,
+			p.title as storeTopicName
+		from mall2_low_price_warning warning
+		left join mall_goods goods on goods.sku = warning.sku
+		left join mall_store store on store.id = warning.store_id
+		LEFT JOIN mall_store_topic p ON p.id = warning.activity_id
+		WHERE 1=1
+		<if test="name != null and name.trim() != ''">
+			AND name LIKE concat('%',#{name},'%')
+		</if>
+        <choose>
+            <when test="sidx != null and sidx.trim() != ''">
+                order by ${sidx} ${order}
+            </when>
+			<otherwise>
+                order by mlrw_id desc
+			</otherwise>
+        </choose>
+		<if test="offset != null and limit != null">
+			limit #{offset}, #{limit}
+		</if>
+	</select>
+
+ 	<select id="queryTotal" resultType="int">
+		select count(*) from mall2_low_price_warning
+		WHERE 1=1
+        <if test="name != null and name.trim() != ''">
+            AND name LIKE concat('%',#{name},'%')
+        </if>
+	</select>
+
+	<insert id="save" parameterType="com.kmall.admin.entity.alarm.Mall2LowPriceWarningEntity" useGeneratedKeys="true" keyProperty="mlrwId">
+		insert into mall2_low_price_warning(
+			`sale_price`,
+			`warning_price`,
+			`warning_type`,
+			`sku`,
+			`store_id`,
+			`activity_id`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`,
+			`viewed`)
+		values(
+			#{salePrice},
+			#{warningPrice},
+			#{warningType},
+			#{sku},
+			#{storeId},
+			#{activityId},
+			#{createrSn},
+			#{createTime},
+			#{moderSn},
+			#{modTime},
+			#{tstm},
+			#{viewed})
+	</insert>
+
+	<update id="update" parameterType="com.kmall.admin.entity.alarm.Mall2LowPriceWarningEntity">
+		update mall2_low_price_warning
+		<set>
+			<if test="salePrice != null">`sale_price` = #{salePrice}, </if>
+			<if test="warningPrice != null">`warning_price` = #{warningPrice}, </if>
+			<if test="warningType != null">`warning_type` = #{warningType}, </if>
+			<if test="sku != null">`sku` = #{sku}, </if>
+			<if test="storeId != null">`store_id` = #{storeId}, </if>
+			<if test="activityId != null">`activity_id` = #{activityId}, </if>
+			<if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
+			<if test="createTime != null">`create_time` = #{createTime}, </if>
+			<if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
+			<if test="modTime != null">`mod_time` = #{modTime}, </if>
+			<if test="tstm != null">`tstm` = #{tstm}, </if>
+			<if test="viewed != null">`viewed` = #{viewed}</if>
+		</set>
+		where mlrw_id = #{mlrwId}
+	</update>
+
+	<delete id="delete">
+		delete from mall2_low_price_warning where mlrw_id = #{value}
+	</delete>
+
+	<delete id="deleteBatch">
+		delete from mall2_low_price_warning where mlrw_id in
+		<foreach item="mlrwId" collection="array" open="(" separator="," close=")">
+			#{mlrwId}
+		</foreach>
+	</delete>
+
+</mapper>

+ 69 - 0
kmall-admin/src/main/webapp/WEB-INF/page/alarm/mall2lowpricewarning.html

@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>价格过低预警表</title>
+    #parse("sys/header.html")
+</head>
+<body>
+<div id="rrapp" v-cloak>
+	<div v-show="showList">
+        <Row :gutter="16">
+            <div class="search-group">
+                <i-col span="4">
+                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
+                </i-col>
+                <i-button @click="query">查询</i-button>
+                <i-button @click="reloadSearch">重置</i-button>
+            </div>
+            <div class="buttons-group">
+                #if($shiro.hasPermission("mall2lowpricewarning:save"))
+                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
+                #end
+                #if($shiro.hasPermission("mall2lowpricewarning:update"))
+                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
+                #end
+                #if($shiro.hasPermission("mall2lowpricewarning:delete"))
+                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
+                #end
+            </div>
+        </Row>
+	    <table id="jqGrid"></table>
+	    <div id="jqGridPager"></div>
+    </div>
+
+    <Card v-show="!showList">
+        <p slot="title">{{title}}</p>
+		<i-form ref="formValidate" :model="mall2LowPriceWarning" :rules="ruleValidate" :label-width="80">
+            <Form-item label="销售价格" prop="salePrice">
+                <i-input v-model="mall2LowPriceWarning.salePrice" placeholder="销售价格"/>
+            </Form-item>
+            <Form-item label="预警价格" prop="warningPrice">
+                <i-input v-model="mall2LowPriceWarning.warningPrice" placeholder="预警价格"/>
+            </Form-item>
+            <Form-item label="预警类别  00.底线价    10.活动价" prop="warningType">
+                <i-input v-model="mall2LowPriceWarning.warningType" placeholder="预警类别  00.底线价    10.活动价"/>
+            </Form-item>
+            <Form-item label="产品sku" prop="sku">
+                <i-input v-model="mall2LowPriceWarning.sku" placeholder="产品sku"/>
+            </Form-item>
+            <Form-item label="门店id" prop="storeId">
+                <i-input v-model="mall2LowPriceWarning.storeId" placeholder="门店id"/>
+            </Form-item>
+            <Form-item label="活动id" prop="activityId">
+                <i-input v-model="mall2LowPriceWarning.activityId" placeholder="活动id"/>
+            </Form-item>
+            <Form-item label="是否已查看" prop="viewed">
+                <i-input v-model="mall2LowPriceWarning.viewed" placeholder="是否已查看  0.否  1.是"/>
+            </Form-item>
+            <Form-item>
+                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
+                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
+                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
+            </Form-item>
+        </i-form>
+	</Card>
+</div>
+
+<script src="${rc.contextPath}/js/alarm/mall2lowpricewarning.js?_${date.systemTime}"></script>
+</body>
+</html>

+ 5 - 0
kmall-admin/src/main/webapp/WEB-INF/page/alarm/mall2orderingearlywarningreminds.html

@@ -7,6 +7,11 @@
 <body>
 <div id="rrapp" v-cloak>
 	<div v-show="showList">
+        <Row :gutter="16">
+            <div class="buttons-group">
+                <i-button type="warning" @click="exportInfo"><i class="fa fa-pencil-square-o"></i>&nbsp;导出</i-button>
+            </div>
+        </Row>
 	    <table id="jqGrid"></table>
 	    <div id="jqGridPager"></div>
     </div>

+ 3 - 0
kmall-admin/src/main/webapp/WEB-INF/page/alarm/mall2shippingreminderalarm.html

@@ -8,6 +8,9 @@
 <div id="rrapp" v-cloak>
 	<div v-show="showList">
         <Row :gutter="16">
+            <div class="buttons-group">
+                <i-button type="warning" @click="exportInfo"><i class="fa fa-pencil-square-o"></i>&nbsp;导出</i-button>
+            </div>
         </Row>
 	    <table id="jqGrid"></table>
 	    <div id="jqGridPager"></div>

+ 14 - 4
kmall-admin/src/main/webapp/WEB-INF/page/cashier/cashierManager.html

@@ -40,12 +40,22 @@
           <!--  <Form-item label="站点编码" prop="stationCode">
                 <i-input v-model="cashier.stationCode" placeholder="站点编码"/>
             </Form-item>-->
-            <Form-item label="门店编号" prop="shopSn">
-                <i-input v-model="cashier.shopSn" placeholder="门店编号"/>
+            <Form-item label="商户" prop="merchSn">
+                <i-select v-model="cashier.merchSn" filterable placeholder="商户"  label-in-value>
+                    <i-option v-for="merch in merchList" :value="merch.merchSn" :key="merch.merchSn">{{merch.merchName}}</i-option>
+                </i-select>
             </Form-item>
-            <Form-item label="商户编号" prop="merchSn">
-                <i-input v-model="cashier.merchSn" placeholder="商户编号"/>
+            <Form-item label="门店" prop="shopSn">
+                <i-select v-model="cashier.shopSn" filterable placeholder="门店" label-in-value>
+                    <i-option v-for="store in storeList" :value="store.id" :key="store.id">{{store.storeName}}</i-option>
+                </i-select>
             </Form-item>
+            <!--<Form-item label="门店编号" prop="shopSn">
+                <i-input v-model="cashier.shopSn" placeholder="门店编号"/>
+            </Form-item>-->
+           <!-- <Form-item label="商户编号" prop="merchSn">
+                <i-input v-model="cashier.merchSn" placeholder="商户编号"/>
+            </Form-item>-->
            <!-- <Form-item label="第三方商户编号" prop="thirdMerchSn">
                 <i-input v-model="cashier.thirdMerchSn" placeholder="第三方商户编号"/>
             </Form-item>-->

+ 154 - 0
kmall-admin/src/main/webapp/js/alarm/mall2lowpricewarning.js

@@ -0,0 +1,154 @@
+$(function () {
+    $("#jqGrid").jqGrid({
+        url: '../mall2lowpricewarning/list',
+        datatype: "json",
+        colModel: [
+			{label: 'mlrwId', name: 'mlrwId', index: 'mlrw_id', key: true, hidden: true},
+			{label: '销售价格', name: 'salePrice', index: 'sale_price', width: 80, align: 'center'},
+			{label: '预警价格', name: 'warningPrice', index: 'warning_price', width: 80, align: 'center'},
+			{label: '预警类别', name: 'warningType', index: 'warning_type', width: 80, align: 'center',formatter:function(value){
+					if(value === "00"){
+						return "底线价";
+					}else if(value === "10"){
+						return "活动价";
+					}
+					return "-";
+				}},
+			{label: '产品sku', name: 'sku', index: 'sku', width: 80, align: 'center'},
+			{label: '产品名称', name: 'goodsName', index: 'sku', width: 80, align: 'center'},
+			{label: '门店id', name: 'storeId', index: 'store_id', width: 80, align: 'center'},
+			{label: '门店名称', name: 'storeName', index: 'store_id', width: 80, align: 'center'},
+			{label: '活动id', name: 'activityId', index: 'activity_id', width: 80, align: 'center'},
+			{label: '活动名称', name: 'storeTopicName', index: 'storeTopicName', width: 80, align: 'center'}],
+		viewrecords: true,
+        height: 550,
+        rowNum: 10,
+        rowList: [10, 30, 50],
+        rownumbers: true,
+        rownumWidth: 25,
+        autowidth: true,
+        multiselect: true,
+        pager: "#jqGridPager",
+        jsonReader: {
+            root: "page.list",
+            page: "page.currPage",
+            total: "page.totalPage",
+            records: "page.totalCount"
+        },
+        prmNames: {
+            page: "page",
+            rows: "limit",
+            order: "order"
+        },
+        gridComplete: function () {
+            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "hidden"});
+        }
+    });
+});
+
+let vm = new Vue({
+	el: '#rrapp',
+	data: {
+        showList: true,
+        title: null,
+		mall2LowPriceWarning: {},
+		ruleValidate: {
+			name: [
+				{required: true, message: '名称不能为空', trigger: 'blur'}
+			]
+		},
+		q: {
+		    name: ''
+		}
+	},
+	methods: {
+		query: function () {
+			vm.reload();
+		},
+		add: function () {
+			vm.showList = false;
+			vm.title = "新增";
+			vm.mall2LowPriceWarning = {};
+		},
+		update: function (event) {
+            let mlrwId = getSelectedRow();
+			if (mlrwId == null) {
+				return;
+			}
+			vm.showList = false;
+            vm.title = "修改";
+
+            vm.getInfo(mlrwId)
+		},
+		saveOrUpdate: function (event) {
+            let url = vm.mall2LowPriceWarning.mlrwId == null ? "../mall2lowpricewarning/save" : "../mall2lowpricewarning/update";
+			$.ajax({
+				type: "POST",
+			    url: url,
+			    contentType: "application/json",
+			    data: JSON.stringify(vm.mall2LowPriceWarning),
+                success: function (r) {
+                    if (r.code === 0) {
+                        alert('操作成功', function (index) {
+                            vm.reload();
+                        });
+                    } else {
+                        alert(r.msg);
+                    }
+                }
+			});
+		},
+		del: function (event) {
+            let mlrwIds = getSelectedRows();
+			if (mlrwIds == null){
+				return;
+			}
+
+			confirm('确定要删除选中的记录?', function () {
+				$.ajax({
+					type: "POST",
+				    url: "../mall2lowpricewarning/delete",
+				    contentType: "application/json",
+				    data: JSON.stringify(mlrwIds),
+				    success: function (r) {
+						if (r.code == 0) {
+							alert('操作成功', function (index) {
+								$("#jqGrid").trigger("reloadGrid");
+							});
+						} else {
+							alert(r.msg);
+						}
+					}
+				});
+			});
+		},
+		getInfo: function(mlrwId){
+			$.get("../mall2lowpricewarning/info/"+mlrwId, function (r) {
+                vm.mall2LowPriceWarning = r.mall2LowPriceWarning;
+            });
+		},
+        reloadSearch: function() {
+            vm.q = {
+                name: ''
+            }
+            vm.reload();
+		},
+		reload: function (event) {
+			vm.showList = true;
+            let page = $("#jqGrid").jqGrid('getGridParam', 'page');
+			$("#jqGrid").jqGrid('setGridParam', {
+                postData: {'name': vm.q.name},
+                page: page
+            }).trigger("reloadGrid");
+            vm.handleReset('formValidate');
+		},
+        handleSubmit: function (name) {
+            handleSubmitValidate(this, name, function () {
+                vm.saveOrUpdate()
+            });
+        },
+        handleReset: function (name) {
+            handleResetForm(this, name);
+        }
+	}
+});

+ 5 - 1
kmall-admin/src/main/webapp/js/alarm/mall2orderingearlywarningreminds.js

@@ -6,6 +6,7 @@ $(function () {
 			{label: 'moewrId', name: 'moewrId', index: 'moewr_id', key: true, hidden: true},
 			{label: '商品id', name: 'goodsId', index: 'goods_id', align:"center",width: 80},
 			{label: '商品名称', name: 'goodsName', index: 'goods_name',align:"center", width: 80},
+			{label: '商品sku', name: 'sku', index: 'sku',align:"center", width: 80},
 			{label: '平均销量', name: 'averageSales', index: 'average_sales',align:"center", width: 80},
 			{label: '总库存数', name: 'totalNum', index: 'total_num',align:"center", width: 80},
 			{
@@ -143,6 +144,9 @@ let vm = new Vue({
         },
         handleReset: function (name) {
             handleResetForm(this, name);
-        }
+        },
+		exportInfo: function () {
+			location.href= '../mall2orderingearlywarningreminds/exportInfo';
+		}
 	}
 });

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

@@ -5,8 +5,8 @@ $(function () {
         colModel: [
 			{label: 'msraId', name: 'msraId', index: 'msra_id',  key: true, hidden: true},
 			{label: '门店id', name: 'storeId', index: 'store_id',align:"center", width: 80},
-			{label: '门店商品sku', name: 'sku', index: 'sku',align:"center", width: 80},
 			{label: '门店名称', name: 'storeName', index: 'store_name',align:"center", width: 80},
+			{label: '门店商品sku', name: 'sku', index: 'sku',align:"center", width: 80},
 			{label: '商品名称', name: 'goodsName', index: 'goods_name',align:"center", width: 100},
 			{label: '剩余库存数', name: 'stockNum', index: 'stock_num',align:"center", width: 80},
 			{label: '平均销量', name: 'averageSales', index: 'average_sales',align:"center", width: 80,formatter:function(value){
@@ -151,6 +151,9 @@ let vm = new Vue({
         },
         handleReset: function (name) {
             handleResetForm(this, name);
-        }
+        },
+		exportInfo: function () {
+			location.href= '../mall2shippingreminderalarm/exportInfo';
+		}
 	}
 });

+ 24 - 7
kmall-admin/src/main/webapp/js/cashier/cashierManager.js

@@ -52,6 +52,8 @@ let vm = new Vue({
         showList: true,
         title: null,
 		cashier: {},
+        merchList:[],
+        storeList:[],
 		ruleValidate: {
             machineCodeType: [
 				{required: true, message: '机器码类型不能为空', trigger: 'blur'}
@@ -61,13 +63,13 @@ let vm = new Vue({
             ],
             cashierSn: [
                 {required: true, message: '收银机编号不能为空', trigger: 'blur'}
-            ],
-            shopSn: [
-                {required: true, message: '门店编号不能为空', trigger: 'blur'}
-            ],
-            merchSn: [
-                {required: true, message: '商户编号不能为空', trigger: 'blur'}
-            ]
+            ]//,
+            // shopSn: [
+            //     {required: true, message: '门店编号不能为空', trigger: 'blur'}
+            // ],
+            // merchSn: [
+            //     {required: true, message: '商户编号不能为空', trigger: 'blur'}
+            // ]
 		},
 		q: {
             machineCode: ''
@@ -81,6 +83,8 @@ let vm = new Vue({
 			vm.showList = false;
 			vm.title = "新增";
 			vm.cashier = {};
+			vm.getMerchList();
+			vm.getStoreList();
 		},
 		update: function (event) {
             let mcId = getSelectedRow();
@@ -90,10 +94,13 @@ let vm = new Vue({
 			vm.showList = false;
             vm.title = "修改";
 
+            vm.getMerchList();
+            vm.getStoreList();
             vm.getInfo(mcId)
 		},
 		saveOrUpdate: function (event) {
             let url = vm.cashier.mcId == null ? "../cashier/save" : "../cashier/update";
+            console.log(vm.cashier);
 			$.ajax({
 				type: "POST",
 			    url: url,
@@ -161,6 +168,16 @@ let vm = new Vue({
         },
         handleReset: function (name) {
             handleResetForm(this, name);
+        },
+        getMerchList: function() {
+            $.get("../merch/queryAll", function (r) {
+                vm.merchList = r.list;
+            });
+        },
+        getStoreList: function() {
+            $.get("../store/queryAll", function (r) {
+                vm.storeList = r.list;
+            });
         }
 	}
 });

+ 17 - 5
kmall-admin/src/main/webapp/login.html

@@ -118,10 +118,18 @@
         },
         beforeMount: function(){
             // TODO 调用接口获取机器码
-            console.log("获取机器码");
-            this.machineCode = "MxMmJQvK+KQ=";
-            this.machineCode = this.machineCode.replace("+","%2B");
-            sessionStorage.setItem("machineCode",this.machineCode);
+            $.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: {
             refreshCode: function () {
@@ -129,8 +137,12 @@
             },
             login: function (event) {
                 var data = "username=" + vm.username + "&password=" + vm.password + "&captcha=" + vm.captcha + "&machineCode=" + vm.machineCode; //TODO  新增加一个机器码;
-                console.log(vm.machineCode);
                 sessionStorage.removeItem("permsSet");
+                var code = sessionStorage.getItem("machineCode");
+                if(!code){
+                    alert("正在获取机器码,请稍后登录,大约5s");
+                    return;
+                }
                 $.ajax({
                     type: "POST",
                     url: "sys/login",