Quellcode durchsuchen

添加了查询代理商配置方法

liuzhiwei vor 7 Jahren
Ursprung
Commit
a086b1830b

+ 38 - 0
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/agentInfo/AgentConfig.java

@@ -1,5 +1,7 @@
 package com.iamberry.wechat.core.entity.agentInfo;
 
+import com.iamberry.wechat.core.entity.PageBean;
+
 import java.util.Date;
 
 /**
@@ -15,6 +17,42 @@ public class AgentConfig implements java.io.Serializable{
     private Integer configAmount;   //采购金额
     private Integer configStatus;   //状态
     private Date configCreateTime;  //创建时间
+    private PageBean page;			//分页
+    private String agentName;       //商户姓名
+    private String productName;     //产品名称
+    private String colorName;       //产品颜色名称
+
+    public String getAgentName() {
+        return agentName;
+    }
+
+    public void setAgentName(String agentName) {
+        this.agentName = agentName;
+    }
+
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
+
+    public String getColorName() {
+        return colorName;
+    }
+
+    public void setColorName(String colorName) {
+        this.colorName = colorName;
+    }
+
+    public PageBean getPage() {
+        return page;
+    }
+
+    public void setPage(PageBean page) {
+        this.page = page;
+    }
 
     public Integer getConfigId() {
         return configId;

+ 18 - 0
tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/agentInfo/AgentInfoService.java

@@ -0,0 +1,18 @@
+package com.iamberry.wechat.face.agentInfo;
+
+import com.iamberry.wechat.core.entity.agentInfo.AgentConfig;
+
+import java.util.List;
+
+/**
+ * Created by Administrator on 2017/10/11.
+ */
+public interface AgentInfoService {
+
+    /**
+     * 查询代理商配置金额集合
+     * @param config
+     * @return
+     */
+    List<AgentConfig> ListAgentConfig(AgentConfig config);
+}

+ 24 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/agentInfo/AgentInfoServiceImpl.java

@@ -0,0 +1,24 @@
+package com.iamberry.wechat.service.agentInfo;
+
+import com.iamberry.wechat.core.entity.agentInfo.AgentConfig;
+import com.iamberry.wechat.face.agentInfo.AgentInfoService;
+import com.iamberry.wechat.service.mapper.AgentInfoMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * Created by liuzhiwei on 2017/10/11.
+ */
+@Service
+public class AgentInfoServiceImpl implements AgentInfoService {
+
+    @Autowired
+    private AgentInfoMapper agentInfoMapper;
+
+    @Override
+    public List<AgentConfig> ListAgentConfig(AgentConfig config) {
+        return agentInfoMapper.ListAgentConfig(config);
+    }
+}

+ 18 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/AgentInfoMapper.java

@@ -0,0 +1,18 @@
+package com.iamberry.wechat.service.mapper;
+
+import com.iamberry.wechat.core.entity.agentInfo.AgentConfig;
+
+import java.util.List;
+
+/**
+ * Created by liuzhiwei on 2017/10/11.
+ */
+public interface AgentInfoMapper {
+
+    /**
+     * 查询代理商配置金额集合
+     * @param config
+     * @return
+     */
+    List<AgentConfig> ListAgentConfig(AgentConfig config);
+}

+ 24 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/agentInfoMapper.xml

@@ -0,0 +1,24 @@
+<?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.iamberry.wechat.service.mapper.AgentInfoMapper">
+
+    <sql id="agentConfig">
+        config_id configId,
+        agent_id agentId,
+        color_id colorId,
+        config_amount configAmount,
+        config_status configStatus,
+        config_create_time configCreateTime
+    </sql>
+
+    <!-- 查询代理商配置金额集合 -->
+    <select id="ListAgentConfig" parameterType="AgentConfig" resultType="AgentConfig">
+      select
+        <include refid="agentConfig"/>
+      from
+        tb_iamberry_agent_config
+        <if test="page!=null and page.pageSize>0 ">
+            LIMIT ${page.recordBegin},${page.pageSize}
+        </if>
+    </select>
+</mapper>

+ 44 - 0
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/admin/AdminAgentToothHandler.java

@@ -0,0 +1,44 @@
+package com.iamberry.wechat.handles.admin;
+
+import com.iamberry.wechat.core.entity.PageBean;
+import com.iamberry.wechat.core.entity.agentInfo.AgentConfig;
+import com.iamberry.wechat.face.agentInfo.AgentInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+/**
+ * 代理商逻辑处理类
+ * Created by liuzhiwei on 2017/10/11.
+ */
+@Controller
+@RequestMapping("/admin/agentTooth")
+public class AdminAgentToothHandler {
+
+    @Autowired
+    private AgentInfoService agentInfoService;
+
+    @RequestMapping("/select_agent_config_list")
+    public ModelAndView selectAgentConfigList(HttpServletRequest request,
+                                              @RequestParam(value = "pageSize", defaultValue = "10", required = false) Integer pageSize,
+                                              @RequestParam(value = "pageNO", defaultValue = "1", required = false) Integer pageNO) throws Exception {
+        ModelAndView mv = new ModelAndView("admin/agentInfo/agentConfigList");
+        StringBuilder url = new StringBuilder("/admin/agentTooth/select_agent_config_list");
+        AgentConfig config = new AgentConfig();
+        PageBean page = new PageBean();
+        page.setPageSize(pageSize);
+        page.setPageNumber(pageNO);
+        page.initRecordBegin();
+        config.setPage(page);
+        //查询代理商配置金额集合
+        List<AgentConfig> configList = agentInfoService.ListAgentConfig(config);
+        mv.addObject("configList", configList);
+        mv.addObject("pageNO", pageNO);
+        return mv;
+    }
+}

+ 14 - 0
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/agentInfo/AgentToothHandler.java

@@ -0,0 +1,14 @@
+package com.iamberry.wechat.handles.agentInfo;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+/**
+ * 代理商逻辑处理类
+ * Created by liuzhiwei on 2017/10/11.
+ */
+@Controller
+@RequestMapping("/wechat/agentTooth")
+public class AgentToothHandler {
+
+
+}

+ 4 - 1
tooth-wechat-web/src/main/resources/iamberry-wechat-service-mybatis.xml

@@ -220,6 +220,8 @@
 		<typeAlias type="com.iamberry.wechat.core.entity.machineNumber.MachineNumberLogs" alias="MachineNumberLogs"/>
         <typeAlias type="com.iamberry.wechat.core.entity.product.QrcodeGift" alias="QrcodeGift"/>
 		<typeAlias type="com.iamberry.wechat.core.entity.machineNumber.WarrantyCard" alias="WarrantyCard"/>
+		<!-- 代理商信息 -->
+		<typeAlias type="com.iamberry.wechat.core.entity.agentInfo.AgentConfig" alias="AgentConfig"/>
 
 		<!-- 销售统计 -->
 		<typeAlias type="com.iamberry.wechat.core.entity.statictics.StatisticsSalesOrder" alias="StatisticsSalesOrder"/>
@@ -298,7 +300,8 @@
 		<mapper resource="com/iamberry/wechat/service/mapper/agentMachineMapper.xml"/>
 		<mapper resource="com/iamberry/wechat/service/mapper/agentMapper.xml"/>
 		<mapper resource="com/iamberry/wechat/service/mapper/giftCardPayCodeMapper.xml"/>
-	
+		<!-- 代理商信息 -->
+		<mapper resource="com/iamberry/wechat/service/mapper/agentInfoMapper.xml"/>
 		<!-- 水机租赁 -->
 		<!--<mapper resource="com/iamberry/rent/service/order/mapper/rentOrderMapper.xml"/>
 		<mapper resource="com/iamberry/rent/service/machine/mapper/machineMapper.xml"/>	

+ 148 - 0
tooth-wechat-web/src/main/webapp/WEB-INF/views/admin/agentInfo/agentConfigList.jsp

@@ -0,0 +1,148 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+         pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+    <LINK rel="Bookmark" href="/favicon.ico">
+    <LINK rel="Shortcut Icon" href="/favicon.ico" />
+    <!--[if lt IE 9]>
+    <script type="text/javascript" src="lib/html5.js"></script>
+    <script type="text/javascript" src="lib/respond.min.js"></script>
+    <script type="text/javascript" src="lib/PIE_IE678.js"></script>
+    <![endif]-->
+    <link href="${pageContext.request.contextPath }/common/admin/css/H-ui.min.css" rel="stylesheet" type="text/css" />
+    <link href="${pageContext.request.contextPath }/common/admin/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
+    <link href="${pageContext.request.contextPath }/common/admin/skin/default/skin.css" rel="stylesheet" type="text/css" id="skin" />
+    <link href="${pageContext.request.contextPath }/common/admin/lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
+    <link href="${pageContext.request.contextPath }/common/admin/css/style.css" rel="stylesheet" type="text/css" />
+
+    <!--[if IE 6]>
+    <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
+    <script>DD_belatedPNG.fix('*');</script>
+    <![endif]-->
+    <title>产品列表</title>
+</head>
+<body>
+<nav class="breadcrumb">
+    <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>
+    商城管理 <span class="c-gray en">&gt;</span>扫描优惠二维码赠品列表 <a
+        class="btn btn-success radius r mr-20"
+        style="line-height: 1.6em; margin-top: 3px"
+        href="javascript:location.replace(location.href);" title="刷新"><i
+        class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<div class="pd-20">
+    <div class="cl pd-5 bg-1 bk-gray mt-20">
+		<span class="l">
+			<a href="${pageContext.request.contextPath }/admin/product/_add_product_price" class="btn btn-primary radius">
+				<i class="Hui-iconfont">&#xe600;</i> 添加优惠价格
+			</a>
+		</span>
+    </div>
+    <form id="goodsform" >
+        <table class="table table-border table-bordered table-bg" id="example">
+            <thead>
+            <tr>
+                <th scope="col" colspan="11">赠品列表</th>
+            </tr>
+            <tr class="text-c">
+                <th width="150">商户名称</th>
+                <th width="100">产品名称</th>
+                <th width="100">产品颜色</th>
+                <th width="130">采购金额</th>
+                <th width="90">状态</th>
+                <th width="130">创建时间</th>
+                <th width="100">操作</th>
+            </tr>
+            </thead>
+            <tbody>
+            <c:if test="${! (empty configList) }">
+            <c:forEach items="${configList }" var="config">
+            <tr class="text-c">
+                <input type="hidden" value="${config.configId }" name="configId">
+                <td>${config.agentName }</td>
+                <td>${config.productName }</td>
+                <td>${config.colorName }</td>
+                <td>${config.configAmount==null?"":config.configAmount/100 }</td>
+                <td id="config_status">${config.configStatus==1?'启用':''}${config.configStatus==2?'停用':''}</td>
+                <td><fmt:formatDate value="${config.configCreateTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
+                <td class="td-manage">
+                    <input id="qrcodeStatus" type="hidden" value="${config.configStatus }">
+                    <select id="Goodstatus" name="" onchange="updateGiftState(this,${config.configId })">
+                        <option value="1" ${config.configStatus==1?'selected':''}>正常</option>
+                        <option value="2" ${config.configStatus==2?'selected':''}>停用</option>
+                    </select>
+                    <a onclick="goods_edit('${pageContext.request.contextPath }/admin/product/_update_product_price?qrcodeId=${config.qrcodeId }')"
+                       title="编辑" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
+                </td>
+                </c:forEach>
+                </c:if>
+            </tbody>
+        </table>
+        <div align="right" class="mt-10 mb-10 mr-10">
+            <%@include file="/common/other/paper/pager.jsp"%>
+        </div>
+    </form>
+</div>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/jquery/1.9.1/jquery.min.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/layer/1.9.3/layer.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.admin.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/tips.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/My97DatePicker/WdatePicker.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/js/page/jqPaginator.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/goods/js/utils.js"></script>
+<script type="text/javascript">
+    function updateGiftState(_this,id){
+        var obj = $(_this);
+        layer.confirm('确认要修改状态吗?',function(index){
+                $.ajax({
+                    url: '${pageContext.request.contextPath }/admin/product/update_gift_status',
+                    type: "POST",
+                    dataType: "json",
+                    data: {giftId : id,giftStatus : obj.val()},
+                    error:function(data){
+                        layer.msg("修改失败</br>",{icon: 5,time:2000});
+                    },
+                    success:  function(data){
+                        if (data.status) {
+                            layer.msg("修改成功</br>",{icon: 1,time:2000});
+                            var message = '';
+                            switch (obj.val()) {
+                                case "1":
+                                    message = '启用';
+                                    break;
+                                case "2":
+                                    message = '停用';
+                                    break;
+                            }
+                            $('#qrcode_status').html(message);
+                        } else {
+                            layer.msg("修改失败</br>",{icon: 5,time:2000});
+                        }
+                    }
+                });
+            }, function () {
+                window.location.reload(location.href);
+            }
+        );
+
+    }
+    /**
+     * 打开修改商品界面
+     */
+    function goods_edit(url){
+        window.location.href = url;
+    }
+</script>
+</body>
+</html>