liujiankang 6 rokov pred
rodič
commit
4182f8e1f9

+ 10 - 0
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/channel/ChildChannel.java

@@ -50,6 +50,8 @@ public class ChildChannel  implements  Serializable{
 
     private String mainChannelName;
 
+    private String rebackAmount;//账户余额
+
     public Integer getChildChannelId(){
         return childChannelId;
     }
@@ -185,4 +187,12 @@ public class ChildChannel  implements  Serializable{
     public void setMainChannelName(String mainChannelName) {
         this.mainChannelName = mainChannelName;
     }
+
+    public String getRebackAmount() {
+        return rebackAmount;
+    }
+
+    public void setRebackAmount(String rebackAmount) {
+        this.rebackAmount = rebackAmount;
+    }
 }

+ 9 - 0
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/channel/MainChannel.java

@@ -44,6 +44,7 @@ public class MainChannel  implements  Serializable{
     @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
     private Date mainChannelUpdateTime;
 
+    private String rebackAmount;//账户余额
     public Integer getMainChannelId(){
         return mainChannelId;
     }
@@ -155,4 +156,12 @@ public class MainChannel  implements  Serializable{
     public void setMainChannelQrcode(String mainChannelQrcode) {
         this.mainChannelQrcode = mainChannelQrcode;
     }
+
+    public String getRebackAmount() {
+        return rebackAmount;
+    }
+
+    public void setRebackAmount(String rebackAmount) {
+        this.rebackAmount = rebackAmount;
+    }
 }

+ 6 - 1
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/childChannelMapper.xml

@@ -52,10 +52,15 @@
         t.child_channel_desc,
         t.child_channel_create_time,
         t.child_channel_update_time,
-        mt.main_channel_name
+        mt.main_channel_name,
+        SUM(cr.reback_amount) rebackAmount
         from tb_iamberry_child_channel t
         left JOIN tb_iamberry_main_channel mt
         ON t.main_channel_id = mt.main_channel_id
+        left JOIN tb_iamberry_channel_rebate cr
+        on t.child_channel_id = cr.reback_channel_id
+        where cr.reback_channel_type = 2
+        GROUP BY child_channel_id
         <where>
             <if test="childChannelId != null ">
                 AND t.child_channel_id = #{childChannelId}

+ 14 - 4
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/mainChannelMapper.xml

@@ -34,10 +34,15 @@
         t.main_channel_update_time
     </sql>
 
-    <select id="getMainChannelList" resultMap="BaseResultMap" parameterType="MainChannel" >
+    <select id="getMainChannelList" resultType="MainChannel" parameterType="MainChannel" >
         select
-        <include refid="Base_List" />
+        <include refid="Base_List" />,
+        SUM(cr.reback_amount) rebackAmount
         from tb_iamberry_main_channel t
+        left JOIN tb_iamberry_channel_rebate cr
+        on t.main_channel_id = cr.reback_channel_id
+        where cr.reback_channel_type = 1
+        GROUP BY t.main_channel_id
         <where>
             <if test="mainChannelId != null ">
                 AND t.main_channel_id = #{mainChannelId}
@@ -59,10 +64,15 @@
             </if >
         </where>
     </select>
-    <select id="getMainChannelById" resultMap="BaseResultMap" parameterType="Integer" >
+    <select id="getMainChannelById" resultType="MainChannel" parameterType="Integer" >
         select
-        <include refid="Base_List" />
+        <include refid="Base_List" />,
+        SUM(cr.reback_amount) rebackAmount
         from tb_iamberry_main_channel t
+        left JOIN tb_iamberry_channel_rebate cr
+        on t.main_channel_id = cr.reback_channel_id
+        where cr.reback_channel_type = 1
+        GROUP BY t.main_channel_id
         where t.main_channel_id= #{mainChannelId}
     </select>
     <insert id="save" parameterType="MainChannel" >

+ 29 - 2
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/channel/AdminChannelHandler.java

@@ -29,6 +29,7 @@ import java.net.URLEncoder;
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
 
 @Controller
@@ -89,9 +90,9 @@ public class AdminChannelHandler {
 	}
 
 	/**
-	 * 发货
+	 * 修改状态
 	 * 2018年2月24日
-	 * @author mzx
+	 * @author
 	 * @return
 	 */
 	@ResponseBody
@@ -105,6 +106,7 @@ public class AdminChannelHandler {
 			msg.setStatus(false);
 			return msg;
 		}
+		channelRebate.setRebackTime(new Date());
 		Integer flag = channelRebateService.update(channelRebate);
 		if(flag == 1){
 			msg.setMessage(NameUtils.getConfig("SUCCESSINFO"));
@@ -169,4 +171,29 @@ public class AdminChannelHandler {
 		sa.setModelAndView(childChannel, mv, "/admin/channel/listChildChannel", result);
 		return mv;
 	}
+	/**
+	 * 结算
+	 *
+	 * @return
+	 * @author LJK
+	 */
+	@RequestMapping("/settlement")
+	public ModelAndView settlement(HttpServletRequest request) {
+		ModelAndView mv = new ModelAndView("/admin/adminChannel/settlement");
+		String rebackChannelId = request.getParameter("rebackChannelId");
+		String rebackChannelType = request.getParameter("rebackChannelType");
+		if(rebackChannelId == null || rebackChannelId.equals("")|| rebackChannelType == null || rebackChannelType.equals("")){
+			return mv;
+		}
+		if(rebackChannelType.equals("1")){
+			MainChannel mainChannel = mainChannelService.getMainChannelById(Integer.valueOf(rebackChannelId));
+			mv.addObject("info",mainChannel);
+		}
+		if(rebackChannelType.equals("2")){
+			ChildChannel childChannel = childChannelService.getChildChannelById(Integer.valueOf(rebackChannelId));
+			mv.addObject("info",childChannel);
+		}
+
+		return mv;
+	}
 }

+ 2 - 0
tooth-wechat-web/src/main/webapp/WEB-INF/views/admin/adminChannel/child_channel_list.jsp

@@ -55,6 +55,7 @@
                 <th width="150">所属渠道</th>
                 <th width="150">对接人</th>
                 <th width="90">对接人手机</th>
+                <th width="90">账户余额</th>
                 <th width="130">账户银行</th>
                 <th width="100">收款账号</th>
                 <th width="100">开户名称</th>
@@ -72,6 +73,7 @@
                 <td>${infolist.mainChannelName }</td>
                 <td>${infolist.childChannelDockingName }</td>
                 <td>${infolist.childChannelDockingTel }</td>
+                <td>${infolist.rebackAmount }</td>
                 <td>${infolist.childChannelBank }</td>
                 <td>${infolist.childChannelBankAccount}</td>
                 <td>${infolist.childChannelBankName}</td>

+ 58 - 1
tooth-wechat-web/src/main/webapp/WEB-INF/views/admin/adminChannel/main_channel_list.jsp

@@ -54,6 +54,7 @@
                 <th width="150">渠道名称</th>
                 <th width="150">对接人</th>
                 <th width="90">对接人手机</th>
+                <th width="90">账户余额</th>
                 <th width="130">账户银行</th>
                 <th width="100">收款账号</th>
                 <th width="100">开户名称</th>
@@ -70,6 +71,7 @@
                 <td>${infolist.mainChannelName }</td>
                 <td>${infolist.mainChannelDockingName }</td>
                 <td>${infolist.mainChannelDockingTel }</td>
+                <td>${infolist.rebackAmount }</td>
                 <td>${infolist.mainChannelBank }</td>
                 <td>${infolist.mainChannelBankAccount}</td>
                 <td>${infolist.mainChannelBankName}</td>
@@ -77,7 +79,8 @@
                 <td>${infolist.mainChannelDesc}</td>
                 <td><fmt:formatDate value="${infolist.mainChannelCreateTime}" pattern="yyyy-MM-dd"/></td>
                 <td>
-                    <a onclick="toRebateList(${infolist.mainChannelId})">查看明细</a>
+                    <a onclick="toRebateList(${infolist.mainChannelId})">查看明细</a><br>
+                    <a href="#" onclick="settlement(${infolist.mainChannelId});">结算</a>
                 </td>
                 </c:forEach>
                 </c:if>
@@ -90,6 +93,56 @@
             <%@include file="/common/other/paper/pager.jsp"%>
         </div>
     </form>
+    <div class="layui-layer layui-anim layui-layer-iframe" id="layui-layer4" times="4" showtime="0" contype="string" style="display:none;z-index: 19891018; width: 550px; height: 360px; position: absolute; top: 100px; left: 379px;">
+        <div class="layui-layer-title" id="sendOrderNote" style="cursor: move;" move="ok">结算</div>
+        <br>
+        <div class="row cl">
+            <label class="form-label col-2">&nbsp;&nbsp;渠道名称:</label>
+            <div class="formControls col-3">
+                    <span class="">
+                        鄂锐鄂锐
+					</span>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-2">&nbsp;&nbsp;本次金额:</label>
+            <div class="formControls col-3">
+                        <span class="">
+                            10000元
+                        </span>
+            </div>
+        </div>
+        <br>
+        <div class="row cl">
+            <div class="formControls col-5">
+            <table class="table table-border table-bordered table-bg" style="width: 450px;">
+                <thead>
+                <tr class="text-c">
+                    <th width="150">账户银行</th>
+                    <th width="150">收款账号</th>
+                    <th width="150">开户名称</th>
+                    <th width="90">开户支行</th>
+                </tr>
+                </thead>
+                <tbody>
+                <tr class="text-c">
+                    <td>1</td>
+                    <td>1</td>
+                    <td>1</td>
+                    <td>1</td>
+                </tbody>
+            </table>
+            </div>
+        </div>
+        <br>
+
+        <div class="col-9 col-offset-3">
+            <input class="btn btn-danger" type="button" onclick="remrakSumbit()" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
+        </div>
+        <span class="layui-layer-setwin">
+			<a class="layui-layer-ico layui-layer-close layui-layer-close1" onclick="exitWindowsDiv(this)" href="javascript:;"></a>
+		</span>
+    </div>
 </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>
@@ -126,6 +179,10 @@
         window.location.href = '${pageContext.request.contextPath }/admin/channel/listChannelRebate?rebackChannelType=1&rebackChannelId='+id;
     }
 
+    function settlement(type,id) {
+        $("#layui-layer4").show();
+    }
+
 </script>
 </body>
 </html>

+ 124 - 0
tooth-wechat-web/src/main/webapp/WEB-INF/views/admin/adminChannel/settlement.jsp

@@ -0,0 +1,124 @@
+<%@ 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" />
+    <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> 结算
+</nav>
+<div class="pd-20">
+    <div class="layui-layer layui-anim layui-layer-iframe" id="layui-remark" times="4" showtime="0" contype="string" style="display:none;z-index: 19891018; width: 600px; height: 400px; position: absolute; top: 100px; left: 379px;">
+            <div class="layui-layer-title" id="sendOrderNote" style="cursor: move;" move="ok">结算</div>
+            <br>
+            <div class="row cl">
+                <label class="form-label col-3"><span class="c-red">*</span>&nbsp;&nbsp;渠道名称:</label>
+                <div class="formControls col-5">
+                    <span class="">
+                        鄂锐鄂锐
+					</span>
+                </div>
+            </div>
+            <div class="row cl">
+                <label class="form-label col-3"><span class="c-red">*</span>&nbsp;&nbsp;本次金额:</label>
+                <div class="formControls col-5">
+                        <span class="">
+                            10000元
+                        </span>
+                </div>
+            </div>
+            <br>
+            <div class="row cl">
+                <table class="table table-border table-bordered table-bg">
+                    <thead>
+                    <tr class="text-c">
+                        <th width="150">账户银行</th>
+                        <th width="150">收款账号</th>
+                        <th width="150">开户名称</th>
+                        <th width="90">开户支行</th>
+                    </tr>
+                    </thead>
+                    <tbody>
+                    <tr class="text-c">
+                        <td>1</td>
+                        <td>1</td>
+                        <td>1</td>
+                        <td>1</td>
+                    </tbody>
+                </table>
+            </div>
+            <br>
+
+            <div class="col-9 col-offset-3">
+                <input class="btn btn-danger" type="button" onclick="remrakSumbit()" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
+            </div>
+        <span class="layui-layer-setwin">
+			<a class="layui-layer-ico layui-layer-close layui-layer-close1" onclick="exitWindowsDiv(this)" href="javascript:;"></a>
+		</span>
+    </div>
+</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">
+
+    /*function update_status(id){
+        layer.confirm('确认要修改返利状态吗?',function(index){
+                $.ajax({
+                    url: '${pageContext.request.contextPath }/admin/channel/updateState',
+                    type: "POST",
+                    dataType: "json",
+                    data: {rebateId : id,rebackStatus : 3},
+                    error:function(data){
+                        layer.msg(data.status,{icon: 5,time:2000});
+                    },
+                    success:  function(data){
+                        if(data.status){
+                            layer.msg("已修改为已打款",{icon: 1,time:2000});
+                        }else{
+                            layer.msg("修改状态失败",{icon: 5,time:2000});
+                        }
+
+                    }
+                });
+            }
+        );
+
+    }*/
+    function toRebateList(id) {
+        window.location.href = '${pageContext.request.contextPath }/admin/channel/listChannelRebate?rebackChannelType=1&rebackChannelId='+id;
+    }
+
+    function settlement(title, url, w, h) {
+        layer_show(title,url,w,h);
+    }
+
+</script>
+</body>
+</html>