xubh 5 years ago
parent
commit
1b2add3556

+ 37 - 0
src/main/java/com/minpay/shouhuo/ShOrderManageAction.java

@@ -6,7 +6,10 @@ import com.minpay.common.format.IFormatService;
 import com.minpay.common.service.ILogService;
 import com.minpay.common.service.IPublicService;
 import com.minpay.common.util.RegexUtil;
+import com.minpay.db.table.mapper.VmOrderDetailsMapper;
 import com.minpay.db.table.mapper.VmRechargeRuleMapper;
+import com.minpay.db.table.model.VmOrderDetails;
+import com.minpay.db.table.model.VmOrderDetailsExample;
 import com.minpay.db.table.model.VmRechargeRule;
 import com.minpay.db.table.model.VmRechargeRuleExample;
 import com.minpay.db.table.own.mapper.OrderInfMapper;
@@ -41,6 +44,8 @@ import java.util.Map;
 @MINComponent
 public class ShOrderManageAction implements IMINAction {
 	public final static String	QUERY_ORDER				= "queryOrder";
+	public final static String	QUERY_ORDER_DETAILS				= "queryOrderDetails";
+
 
 	/**
 	 *查询订单
@@ -85,6 +90,11 @@ public class ShOrderManageAction implements IMINAction {
 		p.put("state",state);
 		p.put("dates", dates);
 		p.put("orderNo", orderNo);
+		User user = session.getUser();
+		if(!user.getBranchId().equals(Constant.ADMINISTRATION_SYSTEM_NUMBER)){
+			p.put("branchId", user.getBranchId());
+		}
+
 		// 查询OrderInfMapper.xml
 		List<Map<String, String>> ls = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ShOrderMapper.class).queryOrder(p,rows);
 		// 格式化
@@ -98,4 +108,31 @@ public class ShOrderManageAction implements IMINAction {
 	}
 
 
+
+	@MINAction(value = QUERY_ORDER_DETAILS)
+	public MINActionResult queryOrderDetails(
+			MINSession session,
+			@MINParam(key = "orderNo") String orderNo,
+			@MINParam(key = "page", defaultValue = "1") int page,
+			@MINParam(key = "limit", defaultValue = "10") int limit,
+			MINHttpServletRequestContext fapRequest
+	) throws MINBusinessException {
+		MINActionResult res = new MINActionResult();
+		MINRowBounds rows = new MINRowBounds(page, limit);
+
+		VmOrderDetailsExample vmOrderDetailsExample = new VmOrderDetailsExample();
+		vmOrderDetailsExample.createCriteria().andOrderIdEqualTo(orderNo);
+		// 查询OrderInfMapper.xml
+		List<VmOrderDetails> ls = Service.lookup(IMINDataBaseService.class)
+											.getMybatisMapper(VmOrderDetailsMapper.class).selectByExample(vmOrderDetailsExample,rows);
+
+				ls = new MINCopyFormat("{proType:'proTypedesc'}").format(ls);
+		ls = Service.lookup(IFormatService.class).formatEnum(ls, "{proTypedesc:'PRO_TYPE'}");
+
+		// 设置返回值
+		res.set(IMINBusinessConstant.F_PAGING_LAY, ls);
+		res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getCount());
+		return res;
+	}
+
 }

+ 5 - 6
src/main/resources/com/minpay/db/table/own/mapper/ShOrderMapper.xml

@@ -25,18 +25,14 @@
 		VOI_MODIFY_TIME		"modifyTime",
 		VOI_BRANCHID		"branchid",
 		VOI_PAY_MODE	    "payMode",
-		VOI_PRODUCT_NAME	"productName",
-		VOI_PRODUCT_ID		"productId",
-		VOI_EQUREL_ID		"equrelId",
+		(SELECT GROUP_CONCAT(VOD_PRO_NAME) FROM vm_order_details w WHERE a.VOI_ID= w.VOD_ORDER_ID GROUP BY w.VOD_ORDER_ID) "productName",
 		VOI_PICKUP_NO		"pickupNo",
 		VOI_PICKUP_STT		"pickupStt",
 		b.VCI_NAME  		"personName",
-		c.VEQ_NAME    		"equipmentName",
-		d.PRT_MASTER_MAP	"productImg"
+		c.VEQ_NAME    		"equipmentName"
 		FROM
 		vm_order_inf a LEFT JOIN vm_person_inf b on a.VOI_PERSON_ID = b.VCI_ID
 		LEFT JOIN  vm_equipment_inf c on a.VOI_EQUIPMENT_ID = c.VEQ_ID
-		LEFT JOIN  vm_product_inf d on a.VOI_PRODUCT_ID = d.PRT_ID
 		WHERE 1=1 and a.VOI_OPERATION = '0'
 		<if test="dates!=null and dates != ''">
 			and substr(a.VOI_CREATE_TIME,1,8) between substr((#{dates,jdbcType=VARCHAR}),1,8)
@@ -63,6 +59,9 @@
 		<if test="orderNo != null and orderNo != ''">
 			and a.VOI_ID = #{orderNo,jdbcType=VARCHAR}
 		</if>
+		<if test="branchId != null and branchId != ''">
+			and a.VOI_BRANCHID = #{branchId,jdbcType=VARCHAR}
+		</if>
 		order by  a.VOI_CREATE_TIME desc
 	</select>
 

+ 59 - 8
src/main/webapp/admin/orderManage/details.html

@@ -32,14 +32,6 @@
 
 		<div class="layui-form-item">
 			<div class="layui-inline">
-				<label class="layui-form-label" style = "width: 150px;">货道号:</label>
-				<div class="layui-input-inline">
-					<input type="tel" readonly=" readonly"  name="equrelId" id="equrelId"autocomplete="off" lay-verify="equrelId"  class="layui-input">
-				</div>
-			</div>
-		</div>
-		<div class="layui-form-item">
-			<div class="layui-inline">
 				<label class="layui-form-label" style = "width: 150px;">玩家ID:</label>
 				<div class="layui-input-inline">
 					<input type="tel" readonly=" readonly"  name="personId" id="personId"autocomplete="off" lay-verify="personId"  class="layui-input">
@@ -80,6 +72,10 @@
 		</div>
 
 	</div>
+	<div class="shadow-content" style="margin:1.5rem;">
+		<table id="orderDetail" lay-filter="orderDetail"></table>
+	</div>
+
 </form>
 <script src="../../js/min-loader-next.js"></script>
 <script>
@@ -93,7 +89,62 @@
 		layui.each(rowData, function(index, item){
 			$("#"+index+"").val(item);
 		})
+		var table;
+		layui.use('table', function(){
+			table = layui.table;
+			// 加载数据
+			table.render({
+				id: 'orderDetail'
+				,elem: '#orderDetail'
+				,limit:10
+				// ,height: 315
+				,url: 'ShOrderManageAction/queryOrderDetails' //数据接口
+				,method: 'post'
+				,where:{MINView:"JSON","orderNo":rowData.id}
+				,page: true //开启分页
+				,cols: [[ //表头
+					{field:'num', title: '序号',width:'8%', type:'numbers', fixed: true, align: 'center'}
+					,{field: 'detailsId', title: '订单编号', width:'10%', sort: true, fixed: 'left'}
+					,{field: 'proName', title: '产品信息', width:'15%'}
+					,{field: 'productId', title: '商品编号', width:'10%'}
+					,{field: 'proEquRelId', title: '货道号', width:'10%'}
+					,{field: 'cargoWay', title: '货道名称', width:'10%'}
+					,{field: 'proPrice', title: '单价', width:'10%'}
+					,{field: 'proNums', title: '数量', width:'10%'}
+					,{field: 'amount', title: '总价', width:'8%'}
+					,{field: 'proTypedesc', title: '商品交易类别', width:'8%'}
+				]]
+				,done: function(res, curr, count){
+					//如果是异步请求数据方式,res即为你接口返回的信息。
+					//如果是直接赋值的方式,res即为:{data: [], count: 99} data为当前页数据、count为数据总长度
+					console.log(res);
+
+					//得到当前页码
+					console.log(curr);
+
+					//得到数据总量
+					console.log(count);
+				}
+				,even: true //开启隔行背景
+
+			});
+
+			// 监听工具条(操作)
+			table.on('tool(tableFilter)', function(obj){ //注:tool是工具条事件名,tableFilter是table原始容器的属性 lay-filter="对应的值"
+				var data = obj.data; //获得当前行数据
+				var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
+				var tr = obj.tr; //获得当前行 tr 的DOM对象
+			});
+			$('.layui-btn').on('click', function(){
+				var type = $(this).data('type');
+				active[type] ? active[type].call(this) : '';
+			});
+
+		});
+
 	});
+
+
 </script>
 </body>
 </html>

+ 5 - 5
src/main/webapp/admin/orderManage/orderManage.html

@@ -46,10 +46,10 @@
 				<label class="f12-gray4">机器名称:</label>
 				<input onchange = "changeSelectCon(4,this,'inp')"   class="search-select" type="tel" name="equipmentName"  id ="equipmentName" lay-verify="equipmentName"  autocomplete="off" placeholder="请输入机器名称" class="layui-input">
 			</div>
-			<div class="layui-inline">
+			<!--<div class="layui-inline">
 				<label class="f12-gray4">货道号:</label>
 				<input onchange = "changeSelectCon(5,this,'inp')"   class="search-select" type="tel" name="freightwayId"  id ="freightwayId" lay-verify="freightwayId"  autocomplete="off" placeholder="请输入货道号" class="layui-input">
-			</div>
+			</div>-->
 			<div class="layui-inline">
 				<label class="f12-gray4">支付方式:</label>
 				<div  class=""  style="display:inline-block" id = 'payMode'></div>
@@ -114,11 +114,11 @@
 			,page: true //开启分页
 			,cols: [[ //表头
 				{field:'num', title: '序号',width:'5%', type:'numbers', fixed: true, align: 'center'}
-				,{field: 'id', title: '订单编号', width:'10%', sort: true, fixed: 'left'}
+				,{field: 'detailsId', title: '编号', width:'10%', sort: true, fixed: 'left'}
 				,{field: 'productName', title: '产品信息', width:'12%'}
-				,{field: 'equipmentId', title: '机器号', width:'8%'}
+				,{field: 'proEquRelId', title: '货道编号', width:'8%'}
 				,{field: 'equipmentName', title: '机器名称', width:'8%'}
-				,{field: 'equrelId', title: '货道编号', width:'8%'}
+				//,{field: 'equrelId', title: '货道编号', width:'8%'}
 				,{field: 'personId', title: '玩家ID', width:'8%'}
 				,{field: 'personName', title: '消费者信息', width:'8%'}
 				,{field: 'isDrawdesc', title: '状态', width:'8%'}