|
@@ -5,6 +5,8 @@ import com.xingxi.common.core.controller.BaseController;
|
|
|
import com.xingxi.common.core.domain.AjaxResult;
|
|
import com.xingxi.common.core.domain.AjaxResult;
|
|
|
import com.xingxi.common.core.page.TableDataInfo;
|
|
import com.xingxi.common.core.page.TableDataInfo;
|
|
|
import com.xingxi.common.enums.BusinessType;
|
|
import com.xingxi.common.enums.BusinessType;
|
|
|
|
|
+import com.xingxi.common.enums.EDelFlag;
|
|
|
|
|
+import com.xingxi.common.exception.BusinessException;
|
|
|
import com.xingxi.common.utils.poi.ExcelUtil;
|
|
import com.xingxi.common.utils.poi.ExcelUtil;
|
|
|
import com.xingxi.master.merchant.domain.Merchant;
|
|
import com.xingxi.master.merchant.domain.Merchant;
|
|
|
import com.xingxi.master.merchant.service.IMerchantService;
|
|
import com.xingxi.master.merchant.service.IMerchantService;
|
|
@@ -23,14 +25,14 @@ import java.util.List;
|
|
|
* @date 2025-03-09
|
|
* @date 2025-03-09
|
|
|
*/
|
|
*/
|
|
|
@Controller
|
|
@Controller
|
|
|
-@RequestMapping("/system/merchant")
|
|
|
|
|
|
|
+@RequestMapping("/master/merchant")
|
|
|
public class MerchantController extends BaseController {
|
|
public class MerchantController extends BaseController {
|
|
|
- private final String prefix = "system/merchant";
|
|
|
|
|
|
|
+ private final String prefix = "master/merchant";
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
private IMerchantService merchantService;
|
|
private IMerchantService merchantService;
|
|
|
|
|
|
|
|
- @RequiresPermissions("system:merchant:view")
|
|
|
|
|
|
|
+ @RequiresPermissions("master:merchant:view")
|
|
|
@GetMapping()
|
|
@GetMapping()
|
|
|
public String merchant() {
|
|
public String merchant() {
|
|
|
return prefix + "/merchant";
|
|
return prefix + "/merchant";
|
|
@@ -39,11 +41,12 @@ public class MerchantController extends BaseController {
|
|
|
/**
|
|
/**
|
|
|
* 查询商户列表
|
|
* 查询商户列表
|
|
|
*/
|
|
*/
|
|
|
- @RequiresPermissions("system:merchant:list")
|
|
|
|
|
|
|
+ @RequiresPermissions("master:merchant:list")
|
|
|
@PostMapping("/list")
|
|
@PostMapping("/list")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public TableDataInfo list(Merchant merchant) {
|
|
public TableDataInfo list(Merchant merchant) {
|
|
|
startPage();
|
|
startPage();
|
|
|
|
|
+ merchant.setDelFlag(EDelFlag.NO.getVal());
|
|
|
List<Merchant> list = merchantService.selectMerchantList(merchant);
|
|
List<Merchant> list = merchantService.selectMerchantList(merchant);
|
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
|
}
|
|
}
|
|
@@ -51,7 +54,7 @@ public class MerchantController extends BaseController {
|
|
|
/**
|
|
/**
|
|
|
* 导出商户列表
|
|
* 导出商户列表
|
|
|
*/
|
|
*/
|
|
|
- @RequiresPermissions("system:merchant:export")
|
|
|
|
|
|
|
+ @RequiresPermissions("master:merchant:export")
|
|
|
@Log(title = "商户", businessType = BusinessType.EXPORT)
|
|
@Log(title = "商户", businessType = BusinessType.EXPORT)
|
|
|
@PostMapping("/export")
|
|
@PostMapping("/export")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@@ -72,18 +75,27 @@ public class MerchantController extends BaseController {
|
|
|
/**
|
|
/**
|
|
|
* 新增保存商户
|
|
* 新增保存商户
|
|
|
*/
|
|
*/
|
|
|
- @RequiresPermissions("system:merchant:add")
|
|
|
|
|
|
|
+ @RequiresPermissions("master:merchant:add")
|
|
|
@Log(title = "商户", businessType = BusinessType.INSERT)
|
|
@Log(title = "商户", businessType = BusinessType.INSERT)
|
|
|
@PostMapping("/add")
|
|
@PostMapping("/add")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public AjaxResult addSave(Merchant merchant) {
|
|
public AjaxResult addSave(Merchant merchant) {
|
|
|
|
|
+ Merchant cond;
|
|
|
|
|
+ List<Merchant> checkResult;
|
|
|
|
|
+ cond = new Merchant();
|
|
|
|
|
+ cond.setMercName(merchant.getMercName());
|
|
|
|
|
+ cond.setDelFlag(EDelFlag.NO.getVal());
|
|
|
|
|
+ checkResult = merchantService.selectMerchantList(cond);
|
|
|
|
|
+ if (checkResult.size() > 0) {
|
|
|
|
|
+ throw new BusinessException("商户名已存在!");
|
|
|
|
|
+ }
|
|
|
return toAjax(merchantService.insertMerchant(merchant));
|
|
return toAjax(merchantService.insertMerchant(merchant));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 修改商户
|
|
* 修改商户
|
|
|
*/
|
|
*/
|
|
|
- @RequiresPermissions("system:merchant:edit")
|
|
|
|
|
|
|
+ @RequiresPermissions("master:merchant:edit")
|
|
|
@GetMapping("/edit/{merchantId}")
|
|
@GetMapping("/edit/{merchantId}")
|
|
|
public String edit(@PathVariable("merchantId") Long merchantId, ModelMap mMap) {
|
|
public String edit(@PathVariable("merchantId") Long merchantId, ModelMap mMap) {
|
|
|
Merchant merchant = merchantService.selectMerchantByMercId(merchantId);
|
|
Merchant merchant = merchantService.selectMerchantByMercId(merchantId);
|
|
@@ -94,22 +106,31 @@ public class MerchantController extends BaseController {
|
|
|
/**
|
|
/**
|
|
|
* 修改保存商户
|
|
* 修改保存商户
|
|
|
*/
|
|
*/
|
|
|
- @RequiresPermissions("system:merchant:edit")
|
|
|
|
|
|
|
+ @RequiresPermissions("master:merchant:edit")
|
|
|
@Log(title = "商户", businessType = BusinessType.UPDATE)
|
|
@Log(title = "商户", businessType = BusinessType.UPDATE)
|
|
|
@PostMapping("/edit")
|
|
@PostMapping("/edit")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public AjaxResult editSave(Merchant merchant) {
|
|
public AjaxResult editSave(Merchant merchant) {
|
|
|
|
|
+ Merchant cond;
|
|
|
|
|
+ List<Merchant> checkResult;
|
|
|
|
|
+ cond = new Merchant();
|
|
|
|
|
+ cond.setMercName(merchant.getMercName());
|
|
|
|
|
+ cond.setDelFlag(EDelFlag.NO.getVal());
|
|
|
|
|
+ checkResult = merchantService.selectMerchantList(cond);
|
|
|
|
|
+ if (checkResult.size() > 0) {
|
|
|
|
|
+ throw new BusinessException("商户名已存在!");
|
|
|
|
|
+ }
|
|
|
return toAjax(merchantService.updateMerchant(merchant));
|
|
return toAjax(merchantService.updateMerchant(merchant));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 删除商户
|
|
* 删除商户
|
|
|
*/
|
|
*/
|
|
|
- @RequiresPermissions("system:merchant:remove")
|
|
|
|
|
|
|
+ @RequiresPermissions("master:merchant:remove")
|
|
|
@Log(title = "商户", businessType = BusinessType.DELETE)
|
|
@Log(title = "商户", businessType = BusinessType.DELETE)
|
|
|
@PostMapping("/remove")
|
|
@PostMapping("/remove")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public AjaxResult remove(String ids) {
|
|
public AjaxResult remove(String ids) {
|
|
|
- return toAjax(merchantService.deleteMerchantByMercIds(ids));
|
|
|
|
|
|
|
+ return toAjax(merchantService.logicDeleteMerchantByMercId(Long.parseLong(ids)));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|