Browse Source

商户收款账户优化

xubh 5 years ago
parent
commit
6b3954faf9

+ 27 - 25
src/main/java/com/minpay/payManage/action/BusinessNumManageAction.java

@@ -6,12 +6,13 @@ import com.minpay.common.format.IFormatService;
 import com.minpay.common.service.ILogService;
 import com.minpay.common.service.ILogService;
 import com.minpay.common.service.IPublicService;
 import com.minpay.common.service.IPublicService;
 import com.minpay.common.util.DateUtil;
 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.mapper.VmAccountMapper;
-import com.minpay.db.table.model.ImUser;
+import com.minpay.db.table.mapper.VmHlAccountMapper;
 import com.minpay.db.table.model.VmAccount;
 import com.minpay.db.table.model.VmAccount;
 import com.minpay.db.table.model.VmAccountExample;
 import com.minpay.db.table.model.VmAccountExample;
-import com.minpay.db.table.own.mapper.BusinessNumMapper;
+import com.minpay.db.table.model.VmHlAccount;
+import com.minpay.db.table.model.VmHlAccountExample;
+import com.mysql.jdbc.StringUtils;
 import com.startup.minpay.frame.business.IMINAction;
 import com.startup.minpay.frame.business.IMINAction;
 import com.startup.minpay.frame.business.res.MINActionResult;
 import com.startup.minpay.frame.business.res.MINActionResult;
 import com.startup.minpay.frame.constant.IMINBusinessConstant;
 import com.startup.minpay.frame.constant.IMINBusinessConstant;
@@ -26,9 +27,7 @@ import com.startup.minpay.frame.target.MINAction;
 import com.startup.minpay.frame.target.MINComponent;
 import com.startup.minpay.frame.target.MINComponent;
 import com.startup.minpay.frame.target.MINParam;
 import com.startup.minpay.frame.target.MINParam;
 
 
-import java.util.HashMap;
 import java.util.List;
 import java.util.List;
-import java.util.Map;
 
 
 /**
 /**
  * 收款商户号管理
  * 收款商户号管理
@@ -78,17 +77,21 @@ public class BusinessNumManageAction implements IMINAction {
 		// 查询当前角色编号
 		// 查询当前角色编号
 		User u = session.getUser();
 		User u = session.getUser();
 		String imUserId = u.getId();
 		String imUserId = u.getId();
-		ImUser user = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ImUserMapper.class)
-				.selectByPrimaryKey(imUserId);
-
-		Map<String, String> params = new HashMap<String, String>();
-		params.put("accountName", accountName);
-		params.put("accountId", accountId);
-		params.put("type", type);
-
 		MINRowBounds rows = new MINRowBounds(page, limit);
 		MINRowBounds rows = new MINRowBounds(page, limit);
-		List<Map<String, Object>> businessNumList = Service.lookup(IMINDataBaseService.class)
-				.getMybatisMapper(BusinessNumMapper.class).querybusinessNum(params, rows);
+		VmHlAccountExample vmHlAccountExample = new VmHlAccountExample();
+		VmHlAccountExample.Criteria createCriteria = vmHlAccountExample.createCriteria();
+		if(!StringUtils.isNullOrEmpty(accountName)){
+			createCriteria.andNameLike("%"+accountName+"%");
+		}
+		if(!StringUtils.isNullOrEmpty(accountId)){
+			createCriteria.andUsridEqualTo(accountId);
+		}
+		if(!StringUtils.isNullOrEmpty(type)){
+			createCriteria.andTypeEqualTo(type);
+		}
+		List<VmHlAccount> businessNumList = Service.lookup(IMINDataBaseService.class)
+				.getMybatisMapper(VmHlAccountMapper.class).selectByExample(vmHlAccountExample,rows);
+
 		businessNumList = new MINCopyFormat("{type:'typeDesc'}").format(businessNumList);
 		businessNumList = new MINCopyFormat("{type:'typeDesc'}").format(businessNumList);
 		businessNumList = Service.lookup(IFormatService.class).formatEnum(businessNumList, "{typeDesc:'BUSINESSNUM_TYPE'}");
 		businessNumList = Service.lookup(IFormatService.class).formatEnum(businessNumList, "{typeDesc:'BUSINESSNUM_TYPE'}");
 		businessNumList = Service.lookup(IFormatService.class).formatDateTime(businessNumList, "createTime");
 		businessNumList = Service.lookup(IFormatService.class).formatDateTime(businessNumList, "createTime");
@@ -135,7 +138,7 @@ public class BusinessNumManageAction implements IMINAction {
 
 
 		// 获取商品主键
 		// 获取商品主键
 		String id = Service.lookup(IPublicService.class).getSequence("VM_ACT_ID");
 		String id = Service.lookup(IPublicService.class).getSequence("VM_ACT_ID");
-		VmAccount vti = new VmAccount();
+		VmHlAccount vti = new VmHlAccount();
 		vti.setId(id); 							// 账户ID
 		vti.setId(id); 							// 账户ID
 		vti.setName(name); 						// 账户名称
 		vti.setName(name); 						// 账户名称
 		vti.setUsrid(accountId); 				// 存储机构编号
 		vti.setUsrid(accountId); 				// 存储机构编号
@@ -146,10 +149,9 @@ public class BusinessNumManageAction implements IMINAction {
 		vti.setCreateTime(nowTime); 			// 创建时间
 		vti.setCreateTime(nowTime); 			// 创建时间
 		vti.setModifyUser(user.getId());		// 修改人
 		vti.setModifyUser(user.getId());		// 修改人
 		vti.setModifyTime(nowTime);				// 修改时间
 		vti.setModifyTime(nowTime);				// 修改时间
-		vti.setIsbranch("1");
 		// 新增收款商户号信息,执行插入数据
 		// 新增收款商户号信息,执行插入数据
 		Service.lookup(IMINDataBaseService.class)
 		Service.lookup(IMINDataBaseService.class)
-				.getMybatisMapper(VmAccountMapper.class)
+				.getMybatisMapper(VmHlAccountMapper.class)
 				.insertSelective(vti);
 				.insertSelective(vti);
 		// 记录操作日志
 		// 记录操作日志
 		String logInfo = "操作员:" + user.getName() + "添加收款商户号,收款商户号编号:" + accountId;
 		String logInfo = "操作员:" + user.getName() + "添加收款商户号,收款商户号编号:" + accountId;
@@ -181,7 +183,7 @@ public class BusinessNumManageAction implements IMINAction {
 		User user = session.getUser();
 		User user = session.getUser();
 		//获取当前时间
 		//获取当前时间
 		String dateTime = com.min.util.DateUtil.getCurrentDateTimeString();
 		String dateTime = com.min.util.DateUtil.getCurrentDateTimeString();
-		VmAccount  vti = new VmAccount();
+		VmHlAccount  vti = new VmHlAccount();
 		vti.setId(id); 							// 账户ID
 		vti.setId(id); 							// 账户ID
 		vti.setName(accountName); 						// 账户名称
 		vti.setName(accountName); 						// 账户名称
 		vti.setType(accountType); 						// 账户类型
 		vti.setType(accountType); 						// 账户类型
@@ -192,7 +194,7 @@ public class BusinessNumManageAction implements IMINAction {
 
 
 		//执行修改
 		//执行修改
 		Service.lookup(IMINDataBaseService.class)
 		Service.lookup(IMINDataBaseService.class)
-				.getMybatisMapper(VmAccountMapper.class)
+				.getMybatisMapper(VmHlAccountMapper.class)
 				.updateByPrimaryKeySelective(vti);
 				.updateByPrimaryKeySelective(vti);
 		//记录日志信息
 		//记录日志信息
 		String logInfo = "操作员:"+user.getName() +"修改收款商户号,名称:"+ accountName +",编号: "+ id;
 		String logInfo = "操作员:"+user.getName() +"修改收款商户号,名称:"+ accountName +",编号: "+ id;
@@ -213,11 +215,11 @@ public class BusinessNumManageAction implements IMINAction {
 			MINSession session
 			MINSession session
 	) throws MINBusinessException {
 	) throws MINBusinessException {
 		MINActionResult res = new MINActionResult();
 		MINActionResult res = new MINActionResult();
-		VmAccount ta = new VmAccount();
+		VmHlAccount ta = new VmHlAccount();
 		ta.setState("01"); //删除
 		ta.setState("01"); //删除
 		ta.setId(id);
 		ta.setId(id);
 		//更新数据
 		//更新数据
-		Service.lookup(IMINDataBaseService.class).updateByPrimaryKeySelective(VmAccountMapper.class, ta);
+		Service.lookup(IMINDataBaseService.class).updateByPrimaryKeySelective(VmHlAccountMapper.class, ta);
 		Service.lookup(ILogService.class).logging(session, "删除收款商户号id:" + id);
 		Service.lookup(ILogService.class).logging(session, "删除收款商户号id:" + id);
 		return res;
 		return res;
 	}
 	}
@@ -232,14 +234,14 @@ public class BusinessNumManageAction implements IMINAction {
 	@MINAction(value = QUERY_TENCENT)
 	@MINAction(value = QUERY_TENCENT)
 	public MINActionResult queryTencent(MINSession session) throws MINBusinessException {
 	public MINActionResult queryTencent(MINSession session) throws MINBusinessException {
 		MINActionResult res = new MINActionResult();
 		MINActionResult res = new MINActionResult();
-		VmAccountExample example = new VmAccountExample();
-		VmAccountExample.Criteria criteria = example.createCriteria();
+		VmHlAccountExample example = new VmHlAccountExample();
+		VmHlAccountExample.Criteria criteria = example.createCriteria();
 		User user = session.getUser();
 		User user = session.getUser();
 		criteria.andStateNotEqualTo("00");
 		criteria.andStateNotEqualTo("00");
 		if(!user.getBranchId().equals(Constant.DEFAULT_INSTITUTIONS)){
 		if(!user.getBranchId().equals(Constant.DEFAULT_INSTITUTIONS)){
 			criteria.andIdEqualTo(user.getBranchId());
 			criteria.andIdEqualTo(user.getBranchId());
 		}
 		}
-		List<VmAccount> ls = Service.lookup(IMINDataBaseService.class).selectByExample(VmAccountMapper.class, example);
+		List<VmHlAccount> ls = Service.lookup(IMINDataBaseService.class).selectByExample(VmHlAccountMapper.class, example);
 		res.set(IMINBusinessConstant.F_QUERY_RESULT, ls);
 		res.set(IMINBusinessConstant.F_QUERY_RESULT, ls);
 		return res;
 		return res;
 	}
 	}

+ 1 - 1
src/main/webapp/admin/businessNumManage/businessNumAdd.html

@@ -17,7 +17,7 @@
             <label class="layui-form-label">商户类型</label>
             <label class="layui-form-label">商户类型</label>
             <div class="layui-input-block">
             <div class="layui-input-block">
                 <input type="radio" name="accountType" value="04" title="富友扫呗" checked="">
                 <input type="radio" name="accountType" value="04" title="富友扫呗" checked="">
-                <input type="radio" name="accountType" value="05" title="合利宝" >
+                <input type="radio" name="accountType" value="09" title="合利宝" >
                 <input type="radio" name="accountType" value="06" title="收钱吧" >
                 <input type="radio" name="accountType" value="06" title="收钱吧" >
             </div>
             </div>
         </div>
         </div>

+ 3 - 2
src/main/webapp/admin/businessNumManage/businessNumManage.html

@@ -74,8 +74,9 @@
 		    ,page: true //开启分页
 		    ,page: true //开启分页
 		    ,cols: [[ //表头
 		    ,cols: [[ //表头
 		      {field:'num', title: '序号',width:'10%', type:'numbers', fixed: true, align: 'center'}
 		      {field:'num', title: '序号',width:'10%', type:'numbers', fixed: true, align: 'center'}
-		      ,{field: 'accountName', title: '商户名称', width:'20%', sort: true, fixed: 'left'}
-		      ,{field: 'accountId', title: '商户号', width:'20%'}
+		      ,{field: 'id', title: '编号', width:'10%'}
+		      ,{field: 'name', title: '商户名称', width:'20%'}
+		      ,{field: 'usrid', title: '商户号', width:'20%'}
 		      ,{field: 'number', title: '终端号', width:'10%'}
 		      ,{field: 'number', title: '终端号', width:'10%'}
 		      ,{field: 'typeDesc', title: '商户类型', width:'10%'}
 		      ,{field: 'typeDesc', title: '商户类型', width:'10%'}
 		      ,{field: 'createTime', title: '创建时间', width: '20%'}
 		      ,{field: 'createTime', title: '创建时间', width: '20%'}

+ 5 - 5
src/main/webapp/admin/businessNumManage/businessNumUpdate.html

@@ -28,7 +28,7 @@
 			<label class="layui-form-label">商户类型</label>
 			<label class="layui-form-label">商户类型</label>
 			<div class="layui-input-block">
 			<div class="layui-input-block">
 				<input type="radio" name="accountType"   lay-filter="accountType"  value="04" title="富友扫呗" checked="" >
 				<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="09" title="合利宝" >
 				<input type="radio" name="accountType" lay-filter="accountType" value="06" title="收钱吧" >
 				<input type="radio" name="accountType" lay-filter="accountType" value="06" title="收钱吧" >
 			</div>
 			</div>
 		</div>
 		</div>
@@ -58,8 +58,8 @@
     <!-- 注意:如果你直接复制所有代码到本地,上述js路径需要改成你本地的 -->
     <!-- 注意:如果你直接复制所有代码到本地,上述js路径需要改成你本地的 -->
     <script>
     <script>
 		var rowData = layui.sessionData("ROW_DATA").NOW_ROW;
 		var rowData = layui.sessionData("ROW_DATA").NOW_ROW;
-		$("#accountId").val(rowData.accountId);
-		$("#accountName").val(rowData.accountName);
+		$("#accountId").val(rowData.usrid);
+		$("#accountName").val(rowData.name);
 		$("#number").val(rowData.number);
 		$("#number").val(rowData.number);
 		$("#id").val(rowData.id);
 		$("#id").val(rowData.id);
 
 
@@ -69,8 +69,8 @@
 				if(item == '04'){
 				if(item == '04'){
 					$("[name='accountType'][value='04']").prop("checked", "checked");
 					$("[name='accountType'][value='04']").prop("checked", "checked");
 
 
-				} else if (item == '05') {
-					$("[name='accountType'][value='05']").prop("checked", "checked");
+				} else if (item == '09') {
+					$("[name='accountType'][value='09']").prop("checked", "checked");
 				} else if (item == '06') {
 				} else if (item == '06') {
 					$("[name='accountType'][value='06']").prop("checked", "checked");
 					$("[name='accountType'][value='06']").prop("checked", "checked");
 				}
 				}