Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/master'

wanglm 4 rokov pred
rodič
commit
5ca7083e36

+ 57 - 0
src/main/java/com/minpay/mt/machine/action/MachineManageAction.java

@@ -143,6 +143,10 @@ public class MachineManageAction implements IMINAction {
     /** 绑定商户号 */
     public final static String STOP_MACHINE = "stopMachine";
 
+    /** 恢复货道 */
+    public final static String RECOVERY_EQUPRO = "recoveryEquPro";
+
+
 
     private boolean contains;
 
@@ -1917,5 +1921,58 @@ public class MachineManageAction implements IMINAction {
                 .updateByPrimaryKeySelective(pro);
         return res;
     }
+    /**
+     * 恢复货道
+     *
+     * @param equId    设备id
+     * @param session
+     * @return
+     * @throws MINBusinessException
+     */
+    @MINAction(value = RECOVERY_EQUPRO)
+    public MINActionResult recoveryEquPro(
+            @MINParam(key = "equId") String equId,
+            @MINParam(key = "perRow") String perRow,
+            @MINParam(key = "perLine") String perLine,
+            MINSession session
+    ) throws MINBusinessException {
+
+        MINActionResult res = new MINActionResult();
+        //当前时间
+        String dateTime = DateUtil.getCurrentDateTimeString();
+        User user = session.getUser();
+        //操作员id
+        String uId = user.getId();
+        //渠道
+        String channel = user.getChannel();
+        //校验设备是否正常
+        VmEquipmentInf equipmentInf = Service.lookup(IMINDataBaseService.class)
+                .getMybatisMapper(VmEquipmentInfMapper.class)
+                .selectByPrimaryKey(equId);
+        if (equipmentInf == null) {
+            throw new MINBusinessException("该设备不存在!");
+        } else if (equipmentInf.getState().equals(Constant.EQUIPMENT_STT_03)) {
+            throw new MINBusinessException("该设备已销毁!");
+        }
+        VmProEquRelExample equRelExample = new VmProEquRelExample();
+        equRelExample.createCriteria().andEquipmentIdEqualTo(equId)
+                .andCargoWayRowEqualTo(perRow)
+                .andCargoWayLineEqualTo(perLine)
+                .andChannelEqualTo(channel)
+                .andExeitStateEqualTo(Constant.PROEQUREL_STT_01);
+        List<VmProEquRel> list = Service.lookup(IMINDataBaseService.class)
+                .getMybatisMapper(VmProEquRelMapper.class)
+                .selectByExample(equRelExample);
+        if (list.size() != 1) {
+            throw new MINBusinessException("货道异常!");
+        }
+        VmProEquRel proEquRel = list.get(0);
+        proEquRel.setExeitState(Constant.PROEQUREL_STT_02);    //状态 01恢复正常
+        Service.lookup(IMINDataBaseService.class)
+                .getMybatisMapper(VmProEquRelMapper.class)
+                .updateByPrimaryKeySelective(proEquRel);
+        return res;
+    }
+
 
 }

+ 4 - 2
src/main/webapp/admin/machineManage/machineDetail.html

@@ -294,9 +294,11 @@
 	function repairProEquRel(row,line,perId) {
 		layer.confirm('确定要恢复此货道吗?', function(index){
 	    	$.request({
-				action : 'ProEquRelManageAction/delProEqu',
+				action : 'MachineManageAction/recoveryEquPro',
 				data : {
-					perId : perId //用户名
+					equId : rowData.id, 	//设备编号
+					perRow : row, 			//货道层
+					perLine : line 			//货道列
 				},
 				success : function(data) {
 					 //成功后刷新