增加一个根据部门id查询商户信息的接口
This commit is contained in:
parent
b38b66a217
commit
8af6287c39
@ -38,7 +38,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||||||
*/
|
*/
|
||||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/winery/merchant" )
|
@RequestMapping("/winery/merchant")
|
||||||
public class AppMerchantController extends BaseController {
|
public class AppMerchantController extends BaseController {
|
||||||
|
|
||||||
private final IAppMerchantService iAppMerchantService;
|
private final IAppMerchantService iAppMerchantService;
|
||||||
@ -48,21 +48,20 @@ public class AppMerchantController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('winery:merchant:list')")
|
@PreAuthorize("@ss.hasPermi('winery:merchant:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(AppMerchant appMerchant)
|
public TableDataInfo list(AppMerchant appMerchant) {
|
||||||
{
|
|
||||||
startPage();
|
startPage();
|
||||||
LambdaQueryWrapper<AppMerchant> lqw = Wrappers.lambdaQuery(appMerchant);
|
LambdaQueryWrapper<AppMerchant> lqw = Wrappers.lambdaQuery(appMerchant);
|
||||||
if (StringUtils.isNotBlank(appMerchant.getMchName())){
|
if (StringUtils.isNotBlank(appMerchant.getMchName())) {
|
||||||
lqw.like(AppMerchant::getMchName ,appMerchant.getMchName());
|
lqw.like(AppMerchant::getMchName, appMerchant.getMchName());
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(appMerchant.getSubtitle())){
|
if (StringUtils.isNotBlank(appMerchant.getSubtitle())) {
|
||||||
lqw.eq(AppMerchant::getSubtitle ,appMerchant.getSubtitle());
|
lqw.eq(AppMerchant::getSubtitle, appMerchant.getSubtitle());
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(appMerchant.getAvatar())){
|
if (StringUtils.isNotBlank(appMerchant.getAvatar())) {
|
||||||
lqw.eq(AppMerchant::getAvatar ,appMerchant.getAvatar());
|
lqw.eq(AppMerchant::getAvatar, appMerchant.getAvatar());
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(appMerchant.getMchDesc())){
|
if (StringUtils.isNotBlank(appMerchant.getMchDesc())) {
|
||||||
lqw.eq(AppMerchant::getMchDesc ,appMerchant.getMchDesc());
|
lqw.eq(AppMerchant::getMchDesc, appMerchant.getMchDesc());
|
||||||
}
|
}
|
||||||
lqw.orderByAsc(AppMerchant::getSort);
|
lqw.orderByAsc(AppMerchant::getSort);
|
||||||
List<AppMerchant> list = iAppMerchantService.list(lqw);
|
List<AppMerchant> list = iAppMerchantService.list(lqw);
|
||||||
@ -72,30 +71,41 @@ public class AppMerchantController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 导出商户列表
|
* 导出商户列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('winery:merchant:export')" )
|
@PreAuthorize("@ss.hasPermi('winery:merchant:export')")
|
||||||
@Log(title = "商户" , businessType = BusinessType.EXPORT)
|
@Log(title = "商户", businessType = BusinessType.EXPORT)
|
||||||
@GetMapping("/export" )
|
@GetMapping("/export")
|
||||||
public AjaxResult export(AppMerchant appMerchant) {
|
public AjaxResult export(AppMerchant appMerchant) {
|
||||||
LambdaQueryWrapper<AppMerchant> lqw = new LambdaQueryWrapper<AppMerchant>(appMerchant);
|
LambdaQueryWrapper<AppMerchant> lqw = new LambdaQueryWrapper<AppMerchant>(appMerchant);
|
||||||
List<AppMerchant> list = iAppMerchantService.list(lqw);
|
List<AppMerchant> list = iAppMerchantService.list(lqw);
|
||||||
ExcelUtil<AppMerchant> util = new ExcelUtil<AppMerchant>(AppMerchant. class);
|
ExcelUtil<AppMerchant> util = new ExcelUtil<AppMerchant>(AppMerchant.class);
|
||||||
return util.exportExcel(list, "merchant" );
|
return util.exportExcel(list, "merchant");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取商户详细信息
|
* 获取商户详细信息
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('winery:merchant:query')" )
|
@PreAuthorize("@ss.hasPermi('winery:merchant:query')")
|
||||||
@GetMapping(value = "/{id}" )
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id" ) String id) {
|
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||||
return AjaxResult.success(iAppMerchantService.getById(id));
|
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)));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增商户
|
* 新增商户
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('winery:merchant:add')" )
|
@PreAuthorize("@ss.hasPermi('winery:merchant:add')")
|
||||||
@Log(title = "商户" , businessType = BusinessType.INSERT)
|
@Log(title = "商户", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody AppMerchant appMerchant) {
|
public AjaxResult add(@RequestBody AppMerchant appMerchant) {
|
||||||
String richText = appMerchant.getMchDesc();
|
String richText = appMerchant.getMchDesc();
|
||||||
@ -109,8 +119,8 @@ public class AppMerchantController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 修改商户
|
* 修改商户
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('winery:merchant:edit')" )
|
@PreAuthorize("@ss.hasPermi('winery:merchant:edit')")
|
||||||
@Log(title = "商户" , businessType = BusinessType.UPDATE)
|
@Log(title = "商户", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody AppMerchant appMerchant) {
|
public AjaxResult edit(@RequestBody AppMerchant appMerchant) {
|
||||||
String richText = appMerchant.getMchDesc();
|
String richText = appMerchant.getMchDesc();
|
||||||
@ -124,9 +134,9 @@ public class AppMerchantController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 删除商户
|
* 删除商户
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('winery:merchant:remove')" )
|
@PreAuthorize("@ss.hasPermi('winery:merchant:remove')")
|
||||||
@Log(title = "商户" , businessType = BusinessType.DELETE)
|
@Log(title = "商户", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}" )
|
@DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable String[] ids) {
|
public AjaxResult remove(@PathVariable String[] ids) {
|
||||||
return toAjax(iAppMerchantService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
return toAjax(iAppMerchantService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,11 @@ private static final long serialVersionUID=1L;
|
|||||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门id
|
||||||
|
*/
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
/** 商户名称 */
|
/** 商户名称 */
|
||||||
@Excel(name = "商户名称")
|
@Excel(name = "商户名称")
|
||||||
private String mchName;
|
private String mchName;
|
||||||
|
@ -19,6 +19,12 @@ class MerchanApis {
|
|||||||
url: baseUrl + 'winery/merchant/' + id
|
url: baseUrl + 'winery/merchant/' + id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getMerchantInfoByDeptId(deptId) {
|
||||||
|
return request.get({
|
||||||
|
url: baseUrl + 'winery/merchant/dept/' + deptId
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new MerchanApis()
|
export default new MerchanApis()
|
||||||
|
@ -116,12 +116,25 @@ wepy.page({
|
|||||||
merchanApis.getMerchantInfo(id).then(r => {
|
merchanApis.getMerchantInfo(id).then(r => {
|
||||||
this.wineryItem = r.data
|
this.wineryItem = r.data
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
async initByDept(deptId) {
|
||||||
|
merchanApis.getMerchantInfoByDeptId(deptId).then(r => {
|
||||||
|
this.wineryItem = r.data
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.init(options.id)
|
|
||||||
|
if (options.id) {
|
||||||
|
this.init(options.id)
|
||||||
|
} else if (options.deptId) {
|
||||||
|
this.initByDept(options.deptId)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user