package com.sinata.modular.member.controller;
|
|
import com.sinata.core.base.controller.BaseController;
|
import org.springframework.stereotype.Controller;
|
import com.baomidou.mybatisplus.plugins.Page;
|
import com.sinata.core.common.constant.factory.PageFactory;
|
import com.baomidou.mybatisplus.mapper.Wrapper;
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
import com.sinata.core.common.annotion.BussinessLog;
|
import com.sinata.core.common.annotion.Permission;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.ui.Model;
|
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import com.sinata.core.log.LogObjectHolder;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import com.sinata.modular.member.model.MemMerchantBankDetail;
|
import com.sinata.modular.member.service.IMemMerchantBankDetailService;
|
|
import java.util.List;
|
import java.util.Map;
|
|
import org.springframework.util.StringUtils;
|
|
/**
|
* 商家账户明细控制器
|
*
|
* @author goku
|
*/
|
@Controller
|
@RequestMapping("/memMerchantBankDetail")
|
public class MemMerchantBankDetailController extends BaseController {
|
|
private String PREFIX = "/member/memMerchantBankDetail/";
|
|
@Autowired
|
private IMemMerchantBankDetailService memMerchantBankDetailService;
|
|
/**
|
* 跳转到商家账户明细首页
|
*/
|
@RequestMapping("")
|
public String index() {
|
return PREFIX + "memMerchantBankDetail.html";
|
}
|
|
/**
|
* 跳转到添加商家账户明细
|
*/
|
@RequestMapping("/memMerchantBankDetail_add")
|
public String memMerchantBankDetailAdd() {
|
return PREFIX + "memMerchantBankDetail_add.html";
|
}
|
|
/**
|
* 跳转到修改商家账户明细
|
*/
|
@RequestMapping("/memMerchantBankDetail_update/{memMerchantBankDetailId}")
|
public String memMerchantBankDetailUpdate(@PathVariable Integer memMerchantBankDetailId, Model model) {
|
MemMerchantBankDetail memMerchantBankDetail = memMerchantBankDetailService.selectById(memMerchantBankDetailId);
|
model.addAttribute("item", memMerchantBankDetail);
|
LogObjectHolder.me().set(memMerchantBankDetail);
|
return PREFIX + "memMerchantBankDetail_edit.html";
|
}
|
|
/**
|
* 获取商家账户明细列表
|
*/
|
@ResponseBody
|
@RequestMapping(value = "/list")
|
public Object list(String beginTime, String endTime, String condition) {
|
Page<Map<String, Object>> page = new PageFactory().defaultPage();
|
Wrapper wrapper = new EntityWrapper<MemMerchantBankDetail>().orderBy("id", false);
|
|
// 时间搜索
|
if (!StringUtils.isEmpty(beginTime)) {
|
wrapper.ge("create_time", beginTime + " 00:00:00");
|
}
|
if (!StringUtils.isEmpty(endTime)) {
|
wrapper.le("create_time", endTime + " 23:59:59");
|
}
|
|
// 查询数据列表
|
List<Map<String, Object>> list = memMerchantBankDetailService.selectMapsPage(page, wrapper).getRecords();
|
|
page.setRecords(list);
|
return super.packForBT(page);
|
}
|
|
/**
|
* 新增商家账户明细
|
*/
|
@Permission
|
@ResponseBody
|
@BussinessLog(value = "新增商家账户明细")
|
@RequestMapping(value = "/add")
|
public Object add(MemMerchantBankDetail memMerchantBankDetail) {
|
memMerchantBankDetailService.insert(memMerchantBankDetail);
|
return SUCCESS_TIP;
|
}
|
|
/**
|
* 删除/批量删除
|
*/
|
@Permission
|
@ResponseBody
|
@BussinessLog(value = "删除/批量删除商家账户明细")
|
@RequestMapping(value = "/delete")
|
public Object delete(@RequestParam String ids) {
|
// 逻辑删除
|
memMerchantBankDetailService.updateForSet("is_delete = 1", new EntityWrapper<MemMerchantBankDetail>().in("id", ids.split(",")));
|
return SUCCESS_TIP;
|
}
|
|
/**
|
* 修改商家账户明细
|
*/
|
@Permission
|
@ResponseBody
|
@BussinessLog(value = "修改商家账户明细")
|
@RequestMapping(value = "/update")
|
public Object update(MemMerchantBankDetail memMerchantBankDetail) {
|
memMerchantBankDetailService.updateById(memMerchantBankDetail);
|
return SUCCESS_TIP;
|
}
|
|
/**
|
* 修改商家账户明细状态
|
*/
|
@ResponseBody
|
@BussinessLog(value = "修改商家账户明细状态")
|
@RequestMapping(value = "/updateState")
|
public Object updateState(Integer memMerchantBankDetailId, Integer state) {
|
memMerchantBankDetailService.updateForSet("state = " + state, new EntityWrapper<MemMerchantBankDetail>().eq("id", memMerchantBankDetailId));
|
return SUCCESS_TIP;
|
}
|
|
/**
|
* 跳转商家账户明细详情
|
*/
|
@RequestMapping(value = "/detail/{memMerchantBankDetailId}")
|
public Object detail(@PathVariable("memMerchantBankDetailId") Integer memMerchantBankDetailId, Model model) {
|
MemMerchantBankDetail memMerchantBankDetail = memMerchantBankDetailService.selectById(memMerchantBankDetailId);
|
model.addAttribute("item", memMerchantBankDetail);
|
return PREFIX + "memMerchantBankDetail_detail.html";
|
}
|
}
|