|
@@ -4,12 +4,12 @@ import com.min.util.CommonUtil;
|
|
|
import com.minpay.common.bean.User;
|
|
import com.minpay.common.bean.User;
|
|
|
import com.minpay.common.constant.Constant;
|
|
import com.minpay.common.constant.Constant;
|
|
|
import com.minpay.common.format.IFormatService;
|
|
import com.minpay.common.format.IFormatService;
|
|
|
|
|
+import com.minpay.common.service.ILogService;
|
|
|
import com.minpay.common.util.DateUtil;
|
|
import com.minpay.common.util.DateUtil;
|
|
|
import com.minpay.db.table.mapper.VmEquipmentInfMapper;
|
|
import com.minpay.db.table.mapper.VmEquipmentInfMapper;
|
|
|
|
|
+import com.minpay.db.table.mapper.VmPersonRoleInfMapper;
|
|
|
import com.minpay.db.table.mapper.VmProEquRelMapper;
|
|
import com.minpay.db.table.mapper.VmProEquRelMapper;
|
|
|
-import com.minpay.db.table.model.VmEquipmentInf;
|
|
|
|
|
-import com.minpay.db.table.model.VmProEquRel;
|
|
|
|
|
-import com.minpay.db.table.model.VmProEquRelExample;
|
|
|
|
|
|
|
+import com.minpay.db.table.model.*;
|
|
|
import com.minpay.db.table.own.mapper.MachineManageMapper;
|
|
import com.minpay.db.table.own.mapper.MachineManageMapper;
|
|
|
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;
|
|
@@ -60,6 +60,11 @@ public class MachineManageAction implements IMINAction {
|
|
|
/**主页数据*/
|
|
/**主页数据*/
|
|
|
public final static String HOME_PAGE_DATA = "homePageData";
|
|
public final static String HOME_PAGE_DATA = "homePageData";
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 编辑售货机二维码状态
|
|
|
|
|
+ */
|
|
|
|
|
+ public final static String EDIT_MACHINE_CODE_STATE = "editMachineCodeState";
|
|
|
|
|
+
|
|
|
private boolean contains;
|
|
private boolean contains;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -367,4 +372,44 @@ public class MachineManageAction implements IMINAction {
|
|
|
res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getMaxRows());
|
|
res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getMaxRows());
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 调整售货机二维码状态
|
|
|
|
|
+ * @param equId 机器编号
|
|
|
|
|
+ * @param applyState 二维码状态
|
|
|
|
|
+ * @param session
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @throws MINBusinessException
|
|
|
|
|
+ */
|
|
|
|
|
+ @MINAction(value = EDIT_MACHINE_CODE_STATE)
|
|
|
|
|
+ public MINActionResult editMachineCodeState(
|
|
|
|
|
+ @MINParam(key = "equId") String equId,
|
|
|
|
|
+ @MINParam(key = "applyState") String applyState,
|
|
|
|
|
+ MINSession session
|
|
|
|
|
+ ) throws MINBusinessException {
|
|
|
|
|
+ MINActionResult res = new MINActionResult();
|
|
|
|
|
+ //查询当前用户是否是本机器的管理员
|
|
|
|
|
+ User user = session.getUser();
|
|
|
|
|
+ String personId = user.getId();
|
|
|
|
|
+ String branchid = user.getBranchId();
|
|
|
|
|
+ /**校验用户是否是商户的内管员*/
|
|
|
|
|
+ VmPersonRoleInfExample vmPersonRoleInfExample = new VmPersonRoleInfExample();
|
|
|
|
|
+ vmPersonRoleInfExample.createCriteria().andBranchIdEqualTo(branchid)
|
|
|
|
|
+ .andStateEqualTo("00").andPersonIdEqualTo(personId).andRoleEqualTo("02");
|
|
|
|
|
+ List<VmPersonRoleInf> vmPersonRoleInfList = Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmPersonRoleInfMapper.class).selectByExample(vmPersonRoleInfExample);
|
|
|
|
|
+ if(vmPersonRoleInfList.size() != 1){
|
|
|
|
|
+ throw new MINBusinessException("权限不足!");
|
|
|
|
|
+ }
|
|
|
|
|
+ /**进行编辑*/
|
|
|
|
|
+ VmEquipmentInf vmEquipmentInf = new VmEquipmentInf();
|
|
|
|
|
+ vmEquipmentInf.setId(equId);
|
|
|
|
|
+ vmEquipmentInf.setApplystate(applyState);
|
|
|
|
|
+ Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmEquipmentInfMapper.class)
|
|
|
|
|
+ .updateByPrimaryKeySelective(vmEquipmentInf);
|
|
|
|
|
+
|
|
|
|
|
+ /**记录日志*/
|
|
|
|
|
+ String logInfo = "H5操作员:" + user.getName() + "编辑设备二维码状态,编号:" + equId+"调整状态为:"+applyState;
|
|
|
|
|
+ Service.lookup(ILogService.class).logging(session, logInfo);
|
|
|
|
|
+ return res;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|