|
|
@@ -10,14 +10,14 @@ import com.minpay.common.service.IPropertiesService;
|
|
|
import com.minpay.common.service.IPublicService;
|
|
|
import com.minpay.common.util.DateUtil;
|
|
|
import com.minpay.common.util.UpLoadFile;
|
|
|
+import com.minpay.db.table.mapper.ImBranchMapper;
|
|
|
import com.minpay.db.table.mapper.VmEquipmentInfMapper;
|
|
|
+import com.minpay.db.table.mapper.VmHlAccountMapper;
|
|
|
import com.minpay.db.table.mapper.VmProEquRelMapper;
|
|
|
-import com.minpay.db.table.model.VmEquipmentInf;
|
|
|
-import com.minpay.db.table.model.VmEquipmentInfExample;
|
|
|
-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.huicai.util.EquCodeCreateUtil;
|
|
|
+import com.mysql.jdbc.StringUtils;
|
|
|
import com.startup.minpay.frame.business.IMINAction;
|
|
|
import com.startup.minpay.frame.business.res.MINActionResult;
|
|
|
import com.startup.minpay.frame.constant.IMINBusinessConstant;
|
|
|
@@ -130,6 +130,12 @@ public class MachineManageAction implements IMINAction {
|
|
|
public final static String QUERY_FUNCTION = "queryFunction";
|
|
|
/**清空累计金额*/
|
|
|
public final static String EMPTY_PROEQUREL = "emptyProEquRel";
|
|
|
+ /** 收款商户号信息查询 */
|
|
|
+ public final static String TENCENTMANAGE_QUERY = "businessNumManageQuery";
|
|
|
+ /** 商户号信息查询 */
|
|
|
+ public final static String QUERY_BRANCH = "queryBranch";
|
|
|
+ /** 绑定商户号 */
|
|
|
+ public final static String BIND_BRANCH = "bindBranch";
|
|
|
|
|
|
|
|
|
private boolean contains;
|
|
|
@@ -301,7 +307,7 @@ public class MachineManageAction implements IMINAction {
|
|
|
pro.setLines(temLine);
|
|
|
pro.setUrlCode(url);
|
|
|
pro.setEquType("00"); //默认支付盒子售货机
|
|
|
- pro.setBranchid(user.getBranchid());
|
|
|
+ pro.setBranchid(Constant.DEFAULT_INSTITUTIONS);
|
|
|
Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmEquipmentInfMapper.class)
|
|
|
.insertSelective(pro);
|
|
|
@@ -336,7 +342,7 @@ public class MachineManageAction implements IMINAction {
|
|
|
pros.setRows(temRow);
|
|
|
pros.setLines(temLine);
|
|
|
pros.setUrlCode(url);
|
|
|
- pros.setBranchid(user.getBranchid());
|
|
|
+ pros.setBranchid(Constant.DEFAULT_INSTITUTIONS);
|
|
|
Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmEquipmentInfMapper.class)
|
|
|
.insertSelective(pros);
|
|
|
@@ -1625,4 +1631,126 @@ public class MachineManageAction implements IMINAction {
|
|
|
Service.lookup(ILogService.class).logging(session, logInfo);
|
|
|
return res;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 收款商户号信息查询
|
|
|
+ * @param session
|
|
|
+ * @param accountName 商户名称
|
|
|
+ * @param accountId 商户号
|
|
|
+ * @param type 商户类型
|
|
|
+ * @param page
|
|
|
+ * @param limit
|
|
|
+ * @return
|
|
|
+ * @throws MINBusinessException
|
|
|
+ */
|
|
|
+ @MINAction(value = TENCENTMANAGE_QUERY)
|
|
|
+ public MINActionResult businessNumManageQuery(MINSession session,
|
|
|
+ @MINParam(key = "branchId") String branchId,
|
|
|
+ @MINParam(key = "accountName") String accountName,
|
|
|
+ @MINParam(key = "accountId") String accountId,
|
|
|
+ @MINParam(key = "type") String type,
|
|
|
+ @MINParam(key = "page", defaultValue = "1") int page,
|
|
|
+ @MINParam(key = "limit", defaultValue = "10") int limit) throws MINBusinessException {
|
|
|
+ MINActionResult res = new MINActionResult();
|
|
|
+ // 查询当前角色编号
|
|
|
+ User u = session.getUser();
|
|
|
+ MINRowBounds rows = new MINRowBounds(page, limit);
|
|
|
+ VmHlAccountExample vmHlAccountExample = new VmHlAccountExample();
|
|
|
+ VmHlAccountExample.Criteria createCriteria = vmHlAccountExample.createCriteria();
|
|
|
+ if(!StringUtils.isNullOrEmpty(accountName)){
|
|
|
+ createCriteria.andNameLike("%"+accountName+"%");
|
|
|
+ }
|
|
|
+ if(!StringUtils.isNullOrEmpty(accountId)){
|
|
|
+ createCriteria.andUsridEqualTo(accountId);
|
|
|
+ }
|
|
|
+ if(!StringUtils.isNullOrEmpty(type)){
|
|
|
+ createCriteria.andTypeEqualTo(type);
|
|
|
+ }
|
|
|
+ if(!StringUtils.isNullOrEmpty(branchId)){
|
|
|
+ createCriteria.andUsridEqualTo(branchId);
|
|
|
+ }
|
|
|
+ List<VmHlAccount> businessNumList = Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmHlAccountMapper.class).selectByExample(vmHlAccountExample,rows);
|
|
|
+
|
|
|
+ businessNumList = new MINCopyFormat("{type:'typeDesc'}").format(businessNumList);
|
|
|
+ businessNumList = Service.lookup(IFormatService.class).formatEnum(businessNumList, "{typeDesc:'BUSINESSNUM_TYPE'}");
|
|
|
+ businessNumList = Service.lookup(IFormatService.class).formatDateTime(businessNumList, "createTime");
|
|
|
+
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_LAY, businessNumList);
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getMaxRows());
|
|
|
+
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 商户号信息查询
|
|
|
+ * @param session
|
|
|
+ * @param accountName 商户名称
|
|
|
+ * @param accountId 商户号
|
|
|
+ * @param page
|
|
|
+ * @param limit
|
|
|
+ * @return
|
|
|
+ * @throws MINBusinessException
|
|
|
+ */
|
|
|
+ @MINAction(value = QUERY_BRANCH)
|
|
|
+ public MINActionResult queryBranch(MINSession session,
|
|
|
+ @MINParam(key = "accountName") String accountName,
|
|
|
+ @MINParam(key = "accountId") String accountId,
|
|
|
+ @MINParam(key = "type") String type,
|
|
|
+ @MINParam(key = "page", defaultValue = "1") int page,
|
|
|
+ @MINParam(key = "limit", defaultValue = "10") int limit) throws MINBusinessException {
|
|
|
+ MINActionResult res = new MINActionResult();
|
|
|
+ // 查询当前角色编号
|
|
|
+ User u = session.getUser();
|
|
|
+ MINRowBounds rows = new MINRowBounds(page, limit);
|
|
|
+ ImBranchExample imBranchExample = new ImBranchExample();
|
|
|
+ ImBranchExample.Criteria createCriteria = imBranchExample.createCriteria();
|
|
|
+ if(!StringUtils.isNullOrEmpty(accountName)){
|
|
|
+ createCriteria.andNameLike("%"+accountName+"%");
|
|
|
+ }
|
|
|
+ if(!StringUtils.isNullOrEmpty(accountId)){
|
|
|
+ createCriteria.andIdEqualTo(accountId);
|
|
|
+ }
|
|
|
+ List<ImBranch> branchList = Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(ImBranchMapper.class).selectByExample(imBranchExample,rows);
|
|
|
+
|
|
|
+ branchList = Service.lookup(IFormatService.class).formatDateTime(branchList, "createTime");
|
|
|
+
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_LAY, branchList);
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getMaxRows());
|
|
|
+
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 添加设备
|
|
|
+ *
|
|
|
+ * @param session
|
|
|
+ * @return
|
|
|
+ * @throws MINBusinessException
|
|
|
+ */
|
|
|
+ @MINAction(value = BIND_BRANCH, transaction = IMINTransactionEnum.CMT)
|
|
|
+ public MINActionResult bindBranch(
|
|
|
+ @MINParam(key = "equId") String equId,
|
|
|
+ @MINParam(key = "branchId") String branchId,
|
|
|
+ MINSession session) throws MINBusinessException, IOException {
|
|
|
+
|
|
|
+ MINActionResult res = new MINActionResult();
|
|
|
+ //获取当前时间
|
|
|
+ String nowTime = DateUtil.getCurrentDateTimeString();
|
|
|
+ // 获取操作员信息
|
|
|
+ User user = session.getUser();
|
|
|
+ VmEquipmentInf vmEquipmentInf = Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmEquipmentInfMapper.class)
|
|
|
+ .selectByPrimaryKey(equId);
|
|
|
+ if (null == vmEquipmentInf) {
|
|
|
+ throw new MINBusinessException("机器不存在");
|
|
|
+ }
|
|
|
+ vmEquipmentInf.setBranchid(branchId);
|
|
|
+ Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmEquipmentInfMapper.class)
|
|
|
+ .updateByPrimaryKeySelective(vmEquipmentInf);
|
|
|
+
|
|
|
+ /*// 记录操作日志
|
|
|
+ String logInfo = "操作员:" + user.getName() + "添加商品,商品编号:" + id;
|
|
|
+ Service.lookup(ILogService.class).logging(session, logInfo);*/
|
|
|
+ return res;
|
|
|
+ }
|
|
|
}
|