mirror of
https://github.com/weizhiqiang1995/erp-pro.git
synced 2025-01-01 12:55:05 +08:00
feat: 支付应用:增加获取启用状态的列表查询,删除根据id和enabled更新接口。
This commit is contained in:
parent
5bd8ac3620
commit
9fc21c9593
5 changed files with 18 additions and 26 deletions
|
@ -46,18 +46,15 @@ public class PayAppController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 更新支付应用的状态信息
|
||||
* 获取全部已启用的支付应用信息
|
||||
*
|
||||
* @param inputObject 入参以及用户信息等获取对象
|
||||
* @param outputObject 出参以及提示信息的返回值对象
|
||||
*/
|
||||
@ApiOperation(id = "updateEnabled", value = "更新支付应用的状态信息", method = "POST", allUse = "1")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(id = "id", name = "id", value = "主键id", required = "required"),
|
||||
@ApiImplicitParam(id = "enabled", name = "enabled", value = "状态", required = "required")})
|
||||
@ApiOperation(id = "queryAllEnabledList", value = "获取全部已启用的支付应用信息", method = "POST", allUse = "1")
|
||||
@RequestMapping("/post/PayAppController/updateEnabled")
|
||||
public void updateEnabled(InputObject inputObject, OutputObject outputObject) {
|
||||
payAppService.updateEnabled(inputObject, outputObject);
|
||||
public void queryAllEnabledList(InputObject inputObject, OutputObject outputObject) {
|
||||
payAppService.queryList(inputObject, outputObject);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -34,7 +34,7 @@ public class PayApp extends BaseGeneralInfo {
|
|||
private String appKey;
|
||||
|
||||
@TableField("enabled")
|
||||
@ApiModelProperty(value = "状态", required = "required")
|
||||
@ApiModelProperty(value = "状态1:启用,2:禁用", required = "required")
|
||||
private String enabled;
|
||||
|
||||
@TableField("order_notify_url")
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
package com.skyeye.pay.service;
|
||||
|
||||
import com.skyeye.base.business.service.SkyeyeBusinessService;
|
||||
import com.skyeye.common.object.InputObject;
|
||||
import com.skyeye.common.object.OutputObject;
|
||||
import com.skyeye.pay.entity.PayApp;
|
||||
|
||||
/**
|
||||
|
@ -18,5 +16,4 @@ import com.skyeye.pay.entity.PayApp;
|
|||
* 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
|
||||
*/
|
||||
public interface PayAppService extends SkyeyeBusinessService<PayApp> {
|
||||
void updateEnabled(InputObject inputObject, OutputObject outputObject);
|
||||
}
|
||||
|
|
|
@ -5,11 +5,14 @@
|
|||
package com.skyeye.pay.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.skyeye.annotation.service.SkyeyeService;
|
||||
import com.skyeye.base.business.service.impl.SkyeyeBusinessServiceImpl;
|
||||
import com.skyeye.common.constans.CommonConstants;
|
||||
import com.skyeye.common.constans.CommonNumConstants;
|
||||
import com.skyeye.common.enumeration.WhetherEnum;
|
||||
import com.skyeye.common.object.InputObject;
|
||||
import com.skyeye.common.object.OutputObject;
|
||||
import com.skyeye.common.util.mybatisplus.MybatisPlusUtil;
|
||||
|
@ -19,6 +22,7 @@ import com.skyeye.pay.entity.PayApp;
|
|||
import com.skyeye.pay.service.PayAppService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@ -38,18 +42,6 @@ public class PayAppServiceImpl extends SkyeyeBusinessServiceImpl<PayAppDao, PayA
|
|||
verify(payApp.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEnabled(InputObject inputObject, OutputObject outputObject) {
|
||||
Map<String, Object> params = inputObject.getParams();
|
||||
String id = params.get("id").toString();
|
||||
String enabled = params.get("enabled").toString();
|
||||
verify(id);
|
||||
UpdateWrapper<PayApp> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.set(MybatisPlusUtil.toColumns(PayApp::getEnabled), enabled)
|
||||
.eq(CommonConstants.ID, id);
|
||||
update(updateWrapper);
|
||||
refreshCache(id);
|
||||
}
|
||||
private void verify(String id){
|
||||
QueryWrapper<PayApp> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(CommonConstants.ID, id);
|
||||
|
@ -58,4 +50,11 @@ public class PayAppServiceImpl extends SkyeyeBusinessServiceImpl<PayAppDao, PayA
|
|||
throw new CustomException("该支付应用信息不存在");
|
||||
}
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> queryDataList(InputObject inputObject) {
|
||||
QueryWrapper<PayApp> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(MybatisPlusUtil.toColumns(PayApp::getEnabled), CommonNumConstants.NUM_ONE);
|
||||
List<PayApp> list = list(queryWrapper);
|
||||
return JSONUtil.toList(JSONUtil.toJsonStr(list), null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,10 +9,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||
import com.skyeye.annotation.service.SkyeyeService;
|
||||
import com.skyeye.base.business.service.impl.SkyeyeBusinessServiceImpl;
|
||||
import com.skyeye.common.constans.CommonConstants;
|
||||
import com.skyeye.common.object.InputObject;
|
||||
import com.skyeye.exception.CustomException;
|
||||
import com.skyeye.pay.dao.PayChannelDao;
|
||||
import com.skyeye.pay.entity.PayApp;
|
||||
import com.skyeye.pay.entity.PayChannel;
|
||||
import com.skyeye.pay.service.PayChannelService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -26,7 +24,7 @@ import org.springframework.stereotype.Service;
|
|||
* 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
|
||||
*/
|
||||
@Service
|
||||
@SkyeyeService(name = "支付渠道",groupName = "支付渠道")
|
||||
@SkyeyeService(name = "支付渠道", groupName = "支付渠道")
|
||||
public class PayChannelServiceImpl extends SkyeyeBusinessServiceImpl<PayChannelDao, PayChannel> implements PayChannelService {
|
||||
|
||||
@Override
|
||||
|
@ -38,4 +36,5 @@ public class PayChannelServiceImpl extends SkyeyeBusinessServiceImpl<PayChannelD
|
|||
throw new CustomException("该支付应用信息不存在");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue