增加一个根据部门id查询商户信息的接口

This commit is contained in:
mactj 2021-01-20 17:32:20 +08:00
parent b38b66a217
commit 8af6287c39
4 changed files with 62 additions and 28 deletions

View File

@ -48,8 +48,7 @@ public class AppMerchantController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('winery:merchant:list')")
@GetMapping("/list")
public TableDataInfo list(AppMerchant appMerchant)
{
public TableDataInfo list(AppMerchant appMerchant) {
startPage();
LambdaQueryWrapper<AppMerchant> lqw = Wrappers.lambdaQuery(appMerchant);
if (StringUtils.isNotBlank(appMerchant.getMchName())) {
@ -91,6 +90,17 @@ public class AppMerchantController extends BaseController {
return AjaxResult.success(iAppMerchantService.getById(id));
}
/**
* 获取商户详细信息
*/
@PreAuthorize("@ss.hasPermi('winery:merchant:query')")
@GetMapping(value = "dept/{id}")
public AjaxResult getInfoByDeptId(@PathVariable("deptId") String deptId) {
return AjaxResult.success(iAppMerchantService.getOne(new LambdaQueryWrapper<AppMerchant>().eq(AppMerchant::getDeptId, deptId)));
}
/**
* 新增商户
*/

View File

@ -36,6 +36,11 @@ private static final long serialVersionUID=1L;
@TableId(value = "id", type = IdType.ASSIGN_UUID)
private String id;
/**
* 部门id
*/
private Long deptId;
/** 商户名称 */
@Excel(name = "商户名称")
private String mchName;

View File

@ -19,6 +19,12 @@ class MerchanApis {
url: baseUrl + 'winery/merchant/' + id
})
}
getMerchantInfoByDeptId(deptId) {
return request.get({
url: baseUrl + 'winery/merchant/dept/' + deptId
})
}
}
export default new MerchanApis()

View File

@ -116,11 +116,24 @@ wepy.page({
merchanApis.getMerchantInfo(id).then(r => {
this.wineryItem = r.data
})
},
async initByDept(deptId) {
merchanApis.getMerchantInfoByDeptId(deptId).then(r => {
this.wineryItem = r.data
})
}
},
onLoad(options) {
if (options.id) {
this.init(options.id)
} else if (options.deptId) {
this.initByDept(options.deptId)
}
}
}
})