Jelajahi Sumber

代码提交

sunqing 4 tahun lalu
induk
melakukan
8eb65899b5

+ 44 - 5
src/main/java/com/minpay/payManage/action/BusinessNumManageAction.java

@@ -1,14 +1,15 @@
 package com.minpay.payManage.action;
 
 import com.minpay.common.bean.User;
+import com.minpay.common.constant.Constant;
 import com.minpay.common.format.IFormatService;
 import com.minpay.common.service.ILogService;
-import com.minpay.common.service.IPublicService;
 import com.minpay.common.util.DateUtil;
 import com.minpay.db.table.mapper.ImUserMapper;
 import com.minpay.db.table.mapper.VmAccountMapper;
 import com.minpay.db.table.model.ImUser;
 import com.minpay.db.table.model.VmAccount;
+import com.minpay.db.table.model.VmAccountExample;
 import com.minpay.db.table.own.mapper.BusinessNumMapper;
 import com.startup.minpay.frame.business.IMINAction;
 import com.startup.minpay.frame.business.res.MINActionResult;
@@ -50,6 +51,9 @@ public class BusinessNumManageAction implements IMINAction {
 	/** 修改收款商户号 */
 	public final static String MODIFY_TENCENT 		= "modifybusinessNum";
 
+	/** 查询所有收款商户号 */
+	public final static String QUERY_TENCENT 		= "queryTencent";
+
 	/**
 	 * 收款商户号信息查询
 	 * @param session
@@ -105,6 +109,7 @@ public class BusinessNumManageAction implements IMINAction {
 	 */
 	@MINAction(value = ADD_TENCENT,transaction = IMINTransactionEnum.CMT)
 	public MINActionResult addbusinessNum(
+			@MINParam(key = "accountId") String accountId,
 			@MINParam(key = "name") String name,
 			@MINParam(key = "type") String type,
 			@MINParam(key = "number") String number,
@@ -115,12 +120,24 @@ public class BusinessNumManageAction implements IMINAction {
 		String nowTime = DateUtil.getCurrentDateTimeString();
 		// 获取操作员信息
 		User user = session.getUser();
+
+		//查询收款商户号是否重复
+		VmAccountExample accountExample = new VmAccountExample();
+		accountExample.createCriteria().andIdEqualTo(accountId);
+		List<VmAccount> list = Service.lookup(IMINDataBaseService.class)
+										.getMybatisMapper(VmAccountMapper.class)
+										.selectByExample(accountExample);
+
+		if(list.size() > 0 ){
+			throw  new MINBusinessException("收款商户号重复");
+		}
+
 		// 获取商品主键
-		String id = Service.lookup(IPublicService.class).getSequence("VM_ACT_ID");
+//		String id = Service.lookup(IPublicService.class).getSequence("VM_ACT_ID");
 		VmAccount vti = new VmAccount();
-		vti.setId(id); 							// 账户ID
+		vti.setId(accountId); 					// 账户ID
 		vti.setName(name); 						// 账户名称
-		vti.setUsrid(user.getId()); 			// 关联用户
+		vti.setUsrid(user.getBranchId()); 		// 存储机构编号
 		vti.setType(type); 						// 账户类型
 		vti.setNumber(number); 					// 账号
 		vti.setChannel(user.getChannel()); 		// 渠道(V01:自助售货机)
@@ -133,7 +150,7 @@ public class BusinessNumManageAction implements IMINAction {
 				.getMybatisMapper(VmAccountMapper.class)
 				.insertSelective(vti);
 		// 记录操作日志
-		String logInfo = "操作员:" + user.getName() + "添加收款商户号,收款商户号编号:" + id;
+		String logInfo = "操作员:" + user.getName() + "添加收款商户号,收款商户号编号:" + accountId;
 		Service.lookup(ILogService.class).logging(session, logInfo);
 		return res;
 	}
@@ -202,4 +219,26 @@ public class BusinessNumManageAction implements IMINAction {
 		return res;
 	}
 
+	/**
+	 * 查询所有商户号
+	 *
+	 * @param session
+	 * @return
+	 * @throws MINBusinessException
+	 */
+	@MINAction(value = QUERY_TENCENT)
+	public MINActionResult queryTencent(MINSession session) throws MINBusinessException {
+		MINActionResult res = new MINActionResult();
+		VmAccountExample example = new VmAccountExample();
+		VmAccountExample.Criteria criteria = example.createCriteria();
+		User user = session.getUser();
+		criteria.andStateNotEqualTo("00");
+		if(!user.getBranchId().equals(Constant.DEFAULT_INSTITUTIONS)){
+			criteria.andIdEqualTo(user.getBranchId());
+		}
+		List<VmAccount> ls = Service.lookup(IMINDataBaseService.class).selectByExample(VmAccountMapper.class, example);
+		res.set(IMINBusinessConstant.F_QUERY_RESULT, ls);
+		return res;
+	}
+
 }

+ 27 - 0
src/main/java/com/minpay/payManage/action/TencentManageAction.java

@@ -1,6 +1,7 @@
 package com.minpay.payManage.action;
 
 import com.minpay.common.bean.User;
+import com.minpay.common.constant.Constant;
 import com.minpay.common.format.IFormatService;
 import com.minpay.common.service.ILogService;
 import com.minpay.common.service.IPublicService;
@@ -9,6 +10,7 @@ import com.minpay.db.table.mapper.ImUserMapper;
 import com.minpay.db.table.mapper.VmTencentInfMapper;
 import com.minpay.db.table.model.ImUser;
 import com.minpay.db.table.model.VmTencentInf;
+import com.minpay.db.table.model.VmTencentInfExample;
 import com.minpay.db.table.own.mapper.TencentMapper;
 import com.startup.minpay.frame.business.IMINAction;
 import com.startup.minpay.frame.business.res.MINActionResult;
@@ -53,6 +55,9 @@ public class TencentManageAction implements IMINAction {
 	/** 关联客户 */
 	public final static String ASSOCIATED_CUSTOMERS = "associatedCustomers";
 
+	/** 查询公众号信息 */
+	public final static String QUERY_TENCENT 		= "queryTencent";
+
 	/**
 	 * 公众号信息查询
 	 * @param session
@@ -238,4 +243,26 @@ public class TencentManageAction implements IMINAction {
 		Service.lookup(ILogService.class).logging(session, logInfo);
 		return res;
 	}
+
+	/**
+	 * 查询所有公众号
+	 *
+	 * @param session
+	 * @return
+	 * @throws MINBusinessException
+	 */
+	@MINAction(value = QUERY_TENCENT)
+	public MINActionResult queryTencent(MINSession session) throws MINBusinessException {
+		MINActionResult res = new MINActionResult();
+		VmTencentInfExample example = new VmTencentInfExample();
+		VmTencentInfExample.Criteria criteria = example.createCriteria();
+		User user = session.getUser();
+		criteria.andStatusNotEqualTo("00");
+		if(!user.getBranchId().equals(Constant.DEFAULT_INSTITUTIONS)){
+			criteria.andIdEqualTo(user.getBranchId());
+		}
+		List<VmTencentInf> ls = Service.lookup(IMINDataBaseService.class).selectByExample(VmTencentInfMapper.class, example);
+		res.set(IMINBusinessConstant.F_QUERY_RESULT, ls);
+		return res;
+	}
 }

+ 26 - 15
src/main/webapp/admin/businessNumManage/businessNumAdd.html

@@ -29,6 +29,12 @@
            </div>
        </div>
        <div class="layui-form-item">
+           <label class="layui-form-label">商户号</label>
+           <div class="layui-input-block">
+               <input type="text" name="accountId" id="accountId" lay-verify="required" autocomplete="off" placeholder="请输入商户号" class="layui-input">
+           </div>
+       </div>
+       <div class="layui-form-item">
            <label class="layui-form-label">终端号</label>
            <div class="layui-input-block">
                <input type="text" name="number" id="number" lay-verify="required" autocomplete="off" placeholder="请输入终端号" class="layui-input">
@@ -53,6 +59,7 @@
         var itemid = "";
         var number = document.getElementById('number').value;
         var name = document.getElementById('accountName').value;
+        var accountId = document.getElementById('accountId').value;
         var type = $('input[name="accountType"]:checked').val();
         if (isEmpty(number)) {
             layui.use(['layer'], function(){
@@ -71,26 +78,30 @@
         $.request({
             action : 'BusinessNumManageAction/addbusinessNum',
             data : {
+                accountId : accountId,
                 number : number,
                 name : name,
                 type : type
             },
             success : function(data){
-                if (data.MINStatus == 0) {
-                    layui.use(['layer'], function(){
-                        layer.msg('添加成功!', {
-                            icon: 1,
-                            time: 1000 //2秒关闭(如果不配置,默认是3秒)
-                        }, function(){
-                            // 关闭当前页面
-                            deleteTabPage('515001-01');
-                        });
-                    })
-                } else {
-                    layui.use(['layer'], function(){
-                        layer.alert(data.MINErrorMessage, {icon: 2});
-                    })
-                }
+                layer.alert('保存成功!',  function(){
+                    deleteTabPage('515001-01');
+                });
+                // if (data.MINStatus == 0) {
+                //     layui.use(['layer'], function(){
+                //         layer.msg('添加成功!', {
+                //             icon: 1,
+                //             time: 1000 //2秒关闭(如果不配置,默认是3秒)
+                //         }, function(){
+                //             // 关闭当前页面
+                //             deleteTabPage('515001-01');
+                //         });
+                //     })
+                // } else {
+                //     layui.use(['layer'], function(){
+                //         layer.alert(data.MINErrorMessage, {icon: 2});
+                //     })
+                // }
             },
             error : function(data) {
                 layui.use(['layer'], function(){

+ 25 - 0
src/main/webapp/admin/businessNumManage/businessNumManage.html

@@ -212,6 +212,31 @@
 			// 打开新增页面
 			openMainTabPage('515001-01', ' 新增公众号', 'businessNumManage/businessNumAdd.html', '', '515001', reloadRole);
 		})
+
+		$.request({
+			action : 'RoleManageAction/roleQueryBranch',
+			data : { },
+			success : function(data) {
+				var selectName ="branchid";
+				var html1 = '<select lay-verify="branchid" name="';
+				html1 = html1 + selectName;
+				html1 = html1 + '" lay-filter="';
+				html1 = html1 + '"';
+				html1 = html1 + '><option value="">请选择</option>';
+				$.each(data.MINQueryResult, function(i, j) {
+					html1 = html1 + '<option ';
+					html1 = html1 + 'value="';
+					html1 = html1 + j.id + '">';
+					html1 = html1 + j.name+ '</option>';
+					//objSelect.options.add(new Option(j.id,j.name));
+					// $("#zcySelect").options.add(new Option(j.name,j.name));
+					// $("#zcySelect").append("<option value="+j.id+">"+j.name+"</option>");
+				})
+				html1 = html1 + '</select>';
+				$("#branchSelect").html(html1);
+				form.render();
+			},
+		});
     </script>
 </body>
 </html>

+ 25 - 17
src/main/webapp/admin/businessNumManage/businessNumUpdate.html

@@ -9,7 +9,7 @@
     <script src="../../js/min-loader-next.js"></script>
 </head>
 <body class="content">
-	<form class="layui-form" id = "formName" >
+	<form class="layui-form" id = "formName"  action="">
     <div style="margin-top: 20px;margin-left: 20px;margin-right: 120px;padding-bottom:60px;" >
 		<div class="layui-form-item">
 			<label class="layui-form-label">商户号</label>
@@ -21,9 +21,9 @@
 		<div class="layui-form-item">
 			<label class="layui-form-label">商户类型</label>
 			<div class="layui-input-block">
-				<input type="radio" name="accountType" value="04" lay-filter="accountType" title="富友扫呗">
-				<input type="radio" name="accountType" value="05" lay-filter="accountType" title="合利宝" >
-				<input type="radio" name="accountType" value="06" lay-filter="accountType" title="收钱吧" >
+				<input type="radio" name="accountType"   lay-filter="accountType"  value="04" title="富友扫呗" checked="" >
+				<input type="radio" name="accountType" lay-filter="accountType" value="05" title="合利宝" >
+				<input type="radio" name="accountType" lay-filter="accountType" value="06" title="收钱吧" >
 			</div>
 		</div>
 
@@ -51,20 +51,28 @@
     <script>
 		layui.use('form', function () {
 			var form = layui.form;
-		});
-	    var params = layui.sessionData("ROW_DATA").NOW_ROW;
-		var fields = params.fields;
-		$("#accountId").val(params.accountId);
-		$("#accountName").val(params.accountName);
-		$("#number").val(params.number);
+			var params = layui.sessionData("ROW_DATA").NOW_ROW;
+			var fields = params.fields;
+			$("#accountId").val(params.accountId);
+			$("#accountName").val(params.accountName);
+			$("#number").val(params.number);
+
+			layui.each(rowData, function(index, item){
+
+				if(index =="type") {
 
-		if (params.type == '04') {
-			$("[name='accountType']:eq(04)").prop("checked","true");
-		} else if (params.type == '05') {
-			$("[name='accountType']:eq(05)").prop("checked","true");
-		} else if (params.type == '06') {
-			$("[name='accountType']:eq(06)").prop("checked","true");
-		}
+					if(item == '04'){
+						$("[name='accountType']:eq(04)").prop("checked", true);
+					} else if (item == '05') {
+						$("[name='accountType']:eq(05)").prop("checked", true);
+					} else if (item == '06') {
+						$("[name='accountType']:eq(06)").prop("checked", true);
+					}
+
+				}
+
+			})
+		});
 
         // 新增角色按钮
         function updateRole(){

+ 10 - 10
src/main/webapp/admin/productManage/productManage.html

@@ -60,12 +60,12 @@
 	  <a class="layui-btn  layui-btn-xs" lay-event="show">查看</a>
      {{#  if(d.state == '0' && loginRoleId != '10000002'){ }}
 	   <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="stop">停售</a>
-	   <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
-     {{#  } }}
-      {{#  if(d.state == '1'){ }}
-       <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
-	   <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="recory">上架</a>
      {{#  } }}
+	  {{#  if(d.state == '1'){ }}
+	  <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
+	  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="recory">上架</a>
+	  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
+	  {{#  } }}
     </script>
     <script type="text/html" id="switchImg">
 			<div>
@@ -82,13 +82,13 @@
 				<img  src="{{ d.fmPic}}">
 			{{# } }}
 		</div>
-		 $("#toggle").click(function() {
-		 $(this).html($("#content").is(":hidden") ? "收起" + "<i class='iconfont up iconSelect_drop-down'/></i>" : "展开" +
-		 "<i class='iconfont up iconSelect_drop-down'/></i>");
-		 $("#content").slideToggle();
-		 });
 	</script>
     <script>
+		$("#toggle").click(function() {
+			$(this).html($("#content").is(":hidden") ? "收起" + "<i class='iconfont up iconSelect_drop-down'/></i>" : "展开" +
+					"<i class='iconfont up iconSelect_drop-down'/></i>");
+			$("#content").slideToggle();
+		});
     	var loginRoleId = getTempVal("loginRoleId");
 	    var loginIdentity = getTempVal("loginIdentity");
 	    if("00" == loginIdentity||"99" == loginIdentity){

+ 87 - 84
src/main/webapp/admin/productManage/productUpdate.html

@@ -14,13 +14,20 @@
     </fieldset>
 	<form style="margin-left: 50px;" class="layui-form" action="">
 		<div class="layui-form-item" style=" padding-top: 20px;">
-            <div class="layui-inline">
+            <!--<div class="layui-inline">
 	            <label class="layui-form-label">商品分类:</label>
 	            <div class="layui-input-block">
 	            <input type="hidden" class="layui-input" id="categoryId" name="categoryId">
 				  		<input type="text" class="layui-input" id="category" name="category" placeholder="请选择商品类别">
 	    		</div>
-            </div>
+            </div>-->
+
+			<div class="layui-inline">
+				<label class="layui-form-label">*商品分类:</label>
+				<div class="layui-input-inline" id ="categoryId" >
+				</div>
+			</div>
+
             <div class="layui-inline">
             <label class="layui-form-label">商品名称:</label>
 	            <div class="layui-input-block" >
@@ -54,91 +61,87 @@
 		</div>
 	</script>
     <script>
-    	var form;
-    	var categoryIdOld = '';
-		var categorySpData = '';
-		var imgUrl = '';	// 封面图片
-		var imgUrl2 = '';	// 商品图片
-		var describeUrl = '';	// 商品描述
-		var imgUrl4 = '';//商品主图
-		var resData = layui.sessionData("ROW_DATA").NOW_ROW;
-		var load;
-    	layui.use(['form', 'layedit', 'laydate'], function() {
-	        form = layui.form,
-	        layer = layui.layer,
-	        layedit = layui.layedit,
-	        laydate = layui.laydate;
-	        var tableSelect = layui.tableSelect;
-			tableSelect.render({
-				elem: '#category',	//定义输入框input对象
-				checkedKey: 'id', //表格的唯一建值,非常重要,影响到选中状态 必填
-				searchKey: 'keyword',	//搜索输入框的name值 默认keyword
-				searchPlaceholder: '关键词搜索',	//搜索输入框的提示文字 默认关键词搜索
-				table: {	//定义表格参数,与LAYUI的TABLE模块一致,只是无需再定义表格elem
-					url:'CategoryManageAction/queryCategoryForProduct'
-					,method: 'get'
-					,cols: [[
-						{field: 'id', title: 'ID',width:40},
-						{field: 'name', title: '分类',width:200,templet:'#switchImg'}
-					]]
-					,done: function(res, curr, count){
-						$("[data-field='id']").css('display','none');
-					}
+		layui.use('form', function(){
+			var rowData = layui.sessionData("ROW_DATA").NOW_ROW;
+			var fmPic;
+			var name;
+			layui.each(rowData, function(index, item){
+				$("#"+index+"").val(item);
+				if(index ==  "fmPic"){
+					fmPic = item;
+					$('#licence').append('<img width="100px" style="margin:10px;" height="100px" src="'+ item +'" class="layui-upload-img">')
 				}
-				/* ,done: function (elem, data) {
-					//选择完后的回调,包含2个返回值 elem:返回之前input对象;data:表格返回的选中的数据 []
-					//拿到data[]后 就按照业务需求做想做的事情啦~比如加个隐藏域放ID...
-					var NEWJSON = []
-		     		layui.each(data.data, function (index, item) {
-		                    NEWJSON.push(item.demo)
-		            });
-		          	elem.val(NEWJSON.join(","));
-				} */
 			});
-			form.render();
-	        layui.each(resData, function(index, item){
-				if(index=="fmPic"){
-					imgUrl = item;
-					if(!isEmpty(imgUrl)){
-						$('#licence').append('<img width="100px" onclick="isDelete(this,1)" style="margin:10px;" height="100px" src="'+item+'" class="layui-upload-img">')		
-					}
-				}else if(index=="discribe"){
-					/* describeUrl = item;
-					var arrays = new Array();
-					arrays = item.split(',');
-				 	for(var i = 0 ; i< arrays.length ; i++){
-				   		if(arrays[i].length > 0){
-					   		$('#describeUrl').append('<img width="100px" onclick="isDelete(this,3)"  style="margin:10px;" height="100px" src="'+ arrays[i] +'" class="layui-upload-img">')
-				   		}
-				    } */
-				}else if(index=="masterMap"){
-					/* imgUrl4 = item;
-					if(!isEmpty(imgUrl4)){
-						$('#masterMap').append('<img width="100px" onclick="isDelete(this,4)" style="margin:10px;" height="100px" src="'+item+'" class="layui-upload-img">')		
-					}	 */
-				}else if(index=="picList"){
-					/* imgUrl2 = item;
-					var arrays = new Array();
-					arrays = imgUrl2.split(',');
-				 	for(var i = 0 ; i< arrays.length ; i++){
-				   		if(arrays[i].length > 0){
-					   		$('#imgList').append('<img width="100px" onclick="isDelete(this,2)"  style="margin:10px;" height="100px" src="'+ arrays[i] +'" class="layui-upload-img">')
-				   		}
-				    }
-				 	indexs();		 */   	
-				}else if ("categoryId" == index) {
-			    	$("#categoryId").val(item);
-			    	categoryIdOld = item;
-				}else if ("categoryName" == index) {
-			    	$("#category").val(item);
-				}else if("id" == index){
-					$("#editid").val(item);
-				}else if("name" == index){
-					$("#name").val(item);
+			layui.each(rowData, function(index, item){
+				if(index=="name"){
+					name = item;
 				}
-				form.render();
-			});
-	        form.verify({
+				if(index=="categoryId"){
+					layui.use('form', function(){
+						var form = layui.form;
+						//商品分类下拉
+						$.request({
+							action : 'CategoryManageAction/queryCategoryForProduct',
+							data : { },
+							success : function(data) {
+								var selectName ="categoryId";
+								var html = '<select lay-verify="categoryId" name="';
+								html = html + selectName;
+								html = html + '" lay-filter="categoryId';
+								html = html + '"';
+								html = html + '><option value="">请选择商品分类</option>';
+								$.each(data.data, function(i, j) {
+									if( j.id == item){
+										html = html + '<option ';
+										html = html + 'selected value="';
+										html = html + j.id + '">';
+										html = html + j.name+ '</option>';
+									}else{
+										html = html + '<option ';
+										html = html + 'value="';
+										html = html + j.id + '">';
+										html = html + j.name+ '</option>';
+									}
+								})
+								html = html + '</select>';
+								$("#categoryId").html(html);
+								form.render();
+							},
+						});
+					});
+				}
+				if (rowData.aciId==null){
+					layui.use('form', function(){
+						var form = layui.form;
+						//商品分类下拉
+						$.request({
+							action : 'CategoryManageAction/queryCategoryInf',
+							data : { },
+							success : function(data) {
+								var selectName ="aciId";
+								var html = '<select lay-verify="aciId" name="';
+								html = html + selectName;
+								html = html + '" lay-filter="aciId';
+								html = html + '"';
+								html = html + '><option value="">请选择商品分类</option>';
+								$.each(data.data, function(i, j) {
+									html = html + '<option ';
+									html = html + 'value="';
+									html = html + j.id + '">';
+									html = html + j.name+ '</option>';
+								})
+								html = html + '</select>';
+								$("#aciId").html(html);
+								form.render();
+							},
+						});
+					});
+				}
+
+				$("#"+index+"").val(item);
+			})
+		});
+		form.verify({
     	 		name : function(value, item){
             	 	if (isEmpty(value)) {
                      	return '请输入商品名称';