pangjl преди 4 години
родител
ревизия
ac328fc492

+ 53 - 2
src/main/java/com/minpay/mt/machine/action/MachineManageAction.java

@@ -35,6 +35,7 @@ import java.io.*;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * 设备管理
@@ -115,6 +116,10 @@ public class MachineManageAction implements IMINAction {
 
     /**解绑机台号*/
     public final static String	DELETE_EQU			= "deleteEqu";
+
+    /**生成指定机器指定行列的货道*/
+    public final static String	ADD_PRO_EQU_REL			= "addProEquRelLineRow";
+
     private boolean contains;
 
 
@@ -149,6 +154,7 @@ public class MachineManageAction implements IMINAction {
         map.put("equType", equType);
         map.put("machineName", machineName);
         map.put("createUser", createUser);
+        map.put("state", state);
         map.put("channel", user.getChannel());//渠道号
         //验证操作员权限
         MINRowBounds rows = new MINRowBounds(page, limit);
@@ -156,6 +162,9 @@ public class MachineManageAction implements IMINAction {
         List<Map<String, String>> list = Service.lookup(IMINDataBaseService.class)
                 .getMybatisMapper(MachineManageMapper.class)
                 .machineInf(map, rows);
+        //在线数
+        int online = list.stream().filter(item -> item.get("state").equals("00")).collect(Collectors.toList()).size();
+        int unOnline = list.stream().filter(item -> item.get("state").equals("01")).collect(Collectors.toList()).size();
         //格式化时间和状态
         list = Service.lookup(IFormatService.class).formatDateTime(list, "createTime", "modifyTime");
         list = new MINCopyFormat("{state:'stateDesc',equType :'equTypeDesc'}").format(list);
@@ -163,6 +172,8 @@ public class MachineManageAction implements IMINAction {
         //返回数据
         res.set(IMINBusinessConstant.F_PAGING_LAY, list);
         res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getMaxRows());
+        res.set("online",String.valueOf(online));
+        res.set("unOnline",String.valueOf(unOnline));
         return res;
     }
 
@@ -223,7 +234,7 @@ public class MachineManageAction implements IMINAction {
         pro.setId(id);
         pro.setMachineNo(equCode);
         pro.setChannel("V01");
-        pro.setState("00");
+        pro.setState("01");
         pro.setCreateUser(user.getId());
         pro.setCreateTime(nowTime);
         pro.setRows(temRow);
@@ -237,7 +248,7 @@ public class MachineManageAction implements IMINAction {
             pros.setId(ids);
             pros.setChannel("V01");
             pros.setMachineNo(CommonUtil.add(equCode, String.valueOf(i)));
-            pros.setState("00");
+            pros.setState("01");
             pros.setCreateUser(user.getId());
             pros.setCreateTime(nowTime);
             pros.setRows(temRow);
@@ -1357,4 +1368,44 @@ public class MachineManageAction implements IMINAction {
 		Service.lookup(ILogService.class).logging(session, logInfo);*/
         return res;
     }
+    /**
+     * 添加设备货道
+     *
+     * @param session
+     * @return
+     * @throws MINBusinessException
+     */
+    @MINAction(value = ADD_PRO_EQU_REL, transaction = IMINTransactionEnum.CMT)
+    public MINActionResult addProEquRelLineRow(
+            @MINParam(key = "line") String line,
+            @MINParam(key = "row") String row,
+            @MINParam(key = "equId") String equId,
+            MINSession session) throws MINBusinessException {
+
+        MINActionResult res = new MINActionResult();
+        //获取当前时间
+        String nowTime = DateUtil.getCurrentDateTimeString();
+        // 获取操作员信息
+        User user = session.getUser();
+        VmProEquRelExample example = new VmProEquRelExample();
+        example.createCriteria().andIdEqualTo(equId).andCargoWayLineEqualTo(CommonUtil.subtract(line,"1")).andCargoWayRowEqualTo(CommonUtil.subtract(row,"1"));
+        List<VmProEquRel> List = Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmProEquRelMapper.class).selectByExample(example);
+        if (List.size()>0){
+            throw new MINBusinessException("货道已存在");
+        }
+        String id = Service.lookup(IPublicService.class).getSequence("VM_PROEQUREL_ID");
+        VmProEquRel vmProEquRel = new VmProEquRel();
+        vmProEquRel.setId(id);
+        vmProEquRel.setEquipmentId(equId);
+        vmProEquRel.setCargoWayLine(CommonUtil.subtract(line,"1"));
+        vmProEquRel.setCargoWayRow(CommonUtil.subtract(row,"1"));
+        vmProEquRel.setExeitState("00");
+        vmProEquRel.setCreateTime(nowTime);
+        vmProEquRel.setCreateUser(user.getId());
+        Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmProEquRelMapper.class).insertSelective(vmProEquRel);
+		/*// 记录操作日志
+		String logInfo = "操作员:" + user.getName() + "添加商品,商品编号:" + id;
+		Service.lookup(ILogService.class).logging(session, logInfo);*/
+        return res;
+    }
 }

+ 16 - 2
src/main/resources/com/minpay/db/table/own/mapper/MachineManageMapper.xml

@@ -40,14 +40,25 @@
 		e.USR_NAME				'modifyUser',
 		p.VEQ_ROWS				'temRow',
 		p.VEQ_LINES				'temLine',
-		p.VEQ_SONG_STATUS  		'songStatus'
+		p.VEQ_SONG_STATUS  		'songStatus',
+		ib.BRH_NAME 			'branchName',
+		CASE
+		WHEN p.VEQ_CREDIT_CHANNEL = '00' THEN '富有扫呗'
+		WHEN p.VEQ_CREDIT_CHANNEL = '01' THEN '合利宝'
+		WHEN p.VEQ_CREDIT_CHANNEL = '02' THEN '收钱吧'
+		WHEN p.VEQ_CREDIT_CHANNEL = '00,01' THEN '富有扫呗/合利宝'
+		WHEN p.VEQ_CREDIT_CHANNEL = '01,02' THEN '合利宝/收钱吧'
+		WHEN p.VEQ_CREDIT_CHANNEL = '00,02' THEN '富有扫呗/收钱吧'
+		ELSE '富有扫呗/合利宝/收钱吧'
+		END  'creditChannels'
      	FROM vm_equipment_inf  p
      		LEFT JOIN 	im_user u ON u.USR_ID = p.VEQ_CREATE_USER
      		LEFT JOIN im_user e on e.USR_ID = p.VEQ_MODIFY_USER
      		LEFT JOIN vm_tencent_inf vti ON vti.VTI_ID = p.VEQ_WC_ACCOUNT
 			LEFT JOIN vm_account va ON va.ACT_ID = p.VEQ_PAYEE_NO
+			LEFT JOIN im_branch ib ON p.VEQ_BRANCHID = ib.BRH_ID
      	WHERE 1=1
-     	AND p.VEQ_STATE = '00'
+     	AND p.VEQ_STATE in ("00","01")
 		<if test="dates!=null and dates!= ''">
 	    	AND SUBSTR(p.MEI_CREATE_TIME,1,8) BETWEEN SUBSTR((#{dates, jdbcType=VARCHAR}),1,8)
 	       		AND SUBSTR((#{dates, jdbcType=VARCHAR}),12,19)
@@ -64,6 +75,9 @@
 		<if test="equType != null and equType != ''">
 			AND p.VEQ_EQU_TYPE = #{equType, jdbcType = VARCHAR}
 		</if>
+		<if test="state != null and state != ''">
+			AND p.VEQ_STATE = #{state, jdbcType = VARCHAR}
+		</if>
       	ORDER BY p.VEQ_CREATE_TIME  DESC
 	</select>
 	<select id="queryProEquRel" resultType="hashmap"

+ 5 - 5
src/main/webapp/admin/machineManage/addEquproduct.html

@@ -65,16 +65,16 @@
 		    </div>
 		    
 		</div>		
-		<div class="layui-form-item" ondblclick="openGame()">
+		<div class="layui-form-item" >
+			<label class="layui-form-label">*游戏类型:</label>
+			<div class="layui-input-inline" id ="type">
+			</div>
 		    <label class="layui-form-label">*游戏价:</label>
 		    <div class="layui-input-inline">
 		        <input type="text" name="gamePrice" maxlength="30" id ="gamePrice" lay-verify="gamePrice" autocomplete="off" placeholder="请输入游戏价" class="layui-input">
 		    </div>
 		</div>
 		<div class="layui-form-item" id = "game" ondblclick="closeGame()">
-			 <label class="layui-form-label">*游戏类型:</label>
-	            	<div class="layui-input-inline" id ="type">
-	          	 	</div>
 	         <div class="layui-inline" id ="luckno" style="display: none">
 	       <label class="layui-form-label">幸运值:</label>
 		    <div class="layui-input-inline">
@@ -278,7 +278,7 @@
 	 }) 
 	  initSelect('isPromotton', "IS_PROMOTION", "isPromotton", '', true);
 	  initSelect('isFragile', "IS_FRAGILE", "isFragile", '', true);
-	  initSelect('type', 'GAME_TYPE', 'type', '', true);
+	  initSelect('type', 'GAME_SETUP_TYPE', 'type', '', true);
     </script>
 </body>
 

+ 6 - 11
src/main/webapp/admin/machineManage/editEquproduct.html

@@ -64,16 +64,16 @@
 		    </div>
 		    
 		</div>		
-		<div class="layui-form-item" ondblclick="openGame()">
+		<div class="layui-form-item" >
+			<label class="layui-form-label">*游戏类型:</label>
+			<div class="layui-input-inline" id ="type">
+			</div>
 		    <label class="layui-form-label">*游戏价:</label>
 		    <div class="layui-input-inline">
 		        <input type="text" name="gamePrice" maxlength="30" id ="gamePrice" lay-verify="gamePrice" autocomplete="off" placeholder="请输入游戏价" class="layui-input">
 		    </div>
 		</div>
-		<div class="layui-form-item" id = "game" ondblclick="closeGame()">
-			 <label class="layui-form-label">*游戏类型:</label>
-	            	<div class="layui-input-inline" id ="type">
-	          	 	</div>
+		<div class="layui-form-item" id = "game" >
 	       <div class="layui-inline" id ="luckno" style="display: none">
 	       <label class="layui-form-label">幸运值:</label>
 		    <div class="layui-input-inline">
@@ -122,12 +122,7 @@
    						  initSelect('isFragile', "IS_FRAGILE", "isFragile", item, true);
    						 }else if(index == 'type'){
    							$("#"+index+"").val(item);
-   		     		    	if(item == '30'){
-   		     	        		  $('#luckno').show();
-   		     	        	  }else{
-   		     	        		  $('#luckno').hide();
-   		     	        	  }
-   		     		    initSelect('type',"GAME_TYPE","type",item, true);
+   		     		    initSelect('type',"GAME_SETUP_TYPE","type",item, true);
    						 }else{
      			 	    	$("#"+index+"").val(item);
     					 }

+ 12 - 1
src/main/webapp/admin/machineManage/machineDetail.html

@@ -19,6 +19,7 @@
 	             <button class="layui-btn" lay-submit="" lay-filter="demo3" lay-filter="demo3" >一键设置价格</button>
 <!--	             <button class="layui-btn" lay-submit="" lay-filter="demo2" lay-filter="demo2" >一键上货</button>-->
 	             <button class="layui-btn" lay-submit="" lay-filter="demo1" lay-filter="demo1" >一键补货</button>
+				<button class="layui-btn" lay-submit="" lay-filter="demo5" lay-filter="demo5" >新增货道</button>
 	        </div>
 	    
     	</div>
@@ -70,7 +71,6 @@
 				
 				
 				for(var k = 0 ; k < data.data.length ; k++){
-					debugger
 					var html1 = '';
 					if(data.data[k].perState == '01'){
 						html1 +='<p>货道已删除</p>'+
@@ -142,6 +142,17 @@
 			});
   	        return false;
   	    });
+		form.on('submit(demo5)', function(data) {
+			layer.open({
+				type: 2,
+				title: '新增货道',
+				shade: 0.8,
+				//maxmin: true, //开启最大化最小化按钮
+				area: ['75%', '75%'],
+				content: 'addProEquRel.html?&equId='+rowData.id
+			});
+			return false;
+		});
 	})
 	function showDetail(data) {
 		var params = {};

+ 32 - 6
src/main/webapp/admin/machineManage/machineManage.html

@@ -37,6 +37,23 @@
 				<label class="f12-gray4">机器类型:</label>
 				<div class=""  style="display:inline-block" id = 'equType'></div>
 			</div>
+			<div class="layui-inline">
+				<label class="f12-gray4">状态:</label>
+				<div class=""  style="display:inline-block" id = 'state'></div>
+			</div>
+			<div class="d-dashed" style="margin: 10px 0;"></div>
+			<div class="layui-inline">
+				<label class="f12-gray4">在线机器数:</label>
+				<div class="layui-input-inline">
+					<input type="text" class="layui-input" id="online" name="online" style="border:none;color: red" disabled="disabled" class="search-select">
+				</div>
+			</div>
+			<div class="layui-inline">
+				<label class="f12-gray4">离线机器数:</label>
+				<div class="layui-input-inline">
+					<input type="text" class="layui-input" id="unOnline" name="unOnline" style="border:none;color: red" disabled="disabled" class="search-select">
+				</div>
+			</div>
 			</div>
 	</form>
 
@@ -107,12 +124,16 @@
 			,page: true //开启分页
 			,cols: [[ //表头
 				 {type:'numbers', title: '序号',width:'5%', fixed: true, align: 'center'}
-				,{field: 'machineNo', title: '机台号', width:"15%", sort: true, fixed: 'left'}
-				,{field: 'name', title: '机器名称', width:"20%"}
-				,{field: 'stateDesc', title: '状态', width:"10%"}
+				,{field: 'machineNo', title: '机台号', width:"10%", sort: true, fixed: 'left'}
+				,{field: 'name', title: '机器名称', width:"10%"}
+				,{field: 'branchName', title: '所属商户', width:"10%"}
+				,{field: 'creditChannels', title: '收款通道', width:"10%"}
+				,{field: 'stateDesc', title: '状态', width:"5%"}
 				,{field: 'payeeNo', title: '支付账号', width:"10%"}
-				,{field: 'equTypeDesc', title: '机器类型', width:"10%"}
-				,{field: 'createTime', title: '创建时间', width:"15%"}
+				,{field: 'exchangeRate', title: '汇率', width:"5%"}
+				,{field: 'equTypeDesc', title: '机器类型', width:"5%"}
+				,{field: 'ioiCardNumber', title: '物联卡号', width:"5%"}
+				,{field: 'createTime', title: '创建时间', width:"10%"}
 				,{field: 'operate', title: '操作', width: "20%", toolbar: '#barDemo',fixed: 'right'}
 			]]
 			,done: function(res, curr, count){
@@ -122,6 +143,8 @@
 				console.log(curr);
 				//得到数据总量
 				console.log(count);
+				$('#online').val(res.online);
+				$('#unOnline').val(res.unOnline);
 			}
 			,even: true //开启隔行背景
 		});
@@ -220,6 +243,7 @@
 		var machineId = $('#machineId').val();
 		var mchntId = $('#mchntId').val();
 		var equType = $("select[name='equType']").val();
+		var state = $("select[name='state']").val();
 		var paramId = '1';
 		//执行重载
 		table.reload('newsManage', {
@@ -232,7 +256,8 @@
 				paramId : paramId,
 				mchntId : mchntId,
 				machineId 	: machineId,
-				equType : equType
+				equType : equType,
+				state : state
 			}
 		});
 	}
@@ -367,6 +392,7 @@
 		openMainTabPage('201001-03', ' 查看货道', 'machineManage/machineDetail.html', '', '201001', reload);
 	}
 	initSelect('equType', "EQUIPMENT_TYPE", "equType", ' ', true);
+	initSelect('state', "EQUIPMENT_STATE", "state", ' ', true);
 </script>
 </body>
 </html>