|
@@ -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;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|