|
|
|
@@ -1,11 +1,16 @@ |
|
|
|
package com.iformall.controller.sys; |
|
|
|
|
|
|
|
import com.iformall.annotation.SystemControllerLog; |
|
|
|
import com.iformall.common.Result; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.controller.base.BaseController; |
|
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import com.iformall.domain.po.WxBusiness; |
|
|
|
import com.iformall.domain.po.WxCoupon; |
|
|
|
import com.iformall.domain.vo.WxBusinessDataVo; |
|
|
|
import com.iformall.enums.EnumCouponContentType; |
|
|
|
import com.iformall.enums.EnumCouponSourceType; |
|
|
|
import com.iformall.enums.EnumRentContractAppStatus; |
|
|
|
import com.iformall.enums.EnumYesOrNo; |
|
|
|
import com.iformall.service.ExcelService; |
|
|
|
import com.iformall.service.WxBusinessService; |
|
|
|
@@ -64,6 +69,46 @@ public class WxBusinessController extends BaseController { |
|
|
|
final List<WxBusiness> busList = wxBusinessService.findTreeList(getTenantInfo()); |
|
|
|
return new ResultData(busList); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("新增/修改接口") |
|
|
|
@PostMapping("saveOrUpdate") |
|
|
|
public ResultData saveOrUpdate(@RequestBody WxBusiness wxBusiness) { |
|
|
|
TenantEntity tenantEntity = getTenantInfo(); |
|
|
|
wxBusiness.setFinalTenantId(tenantEntity.getFinalTenantId()); |
|
|
|
if (null != wxBusiness.getId()) { |
|
|
|
//不能修改系统默认的 |
|
|
|
WxBusiness b = wxBusinessService.getById(wxBusiness.getId(), wxBusiness.getFinalTenantId()); |
|
|
|
if (null == b) { |
|
|
|
return new ResultData(Result.ERROR,"未查询到业态"); |
|
|
|
} |
|
|
|
if (b.getIsSystem().intValue() == EnumYesOrNo.YES.getCode().intValue()) { |
|
|
|
return new ResultData(Result.ERROR,"不能修改系统默认业态"); |
|
|
|
} |
|
|
|
} |
|
|
|
wxBusinessService.saveOrUpdate(wxBusiness); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("删除接口") |
|
|
|
@PostMapping("del") |
|
|
|
public ResultData delete(@RequestBody WxBusiness wxBusiness) { |
|
|
|
TenantEntity tenantEntity = getTenantInfo(); |
|
|
|
wxBusiness.setFinalTenantId(tenantEntity.getFinalTenantId()); |
|
|
|
if (null == wxBusiness.getId()) { |
|
|
|
return new ResultData(Result.ERROR,"参数错误"); |
|
|
|
} |
|
|
|
//不能修改系统默认的 |
|
|
|
WxBusiness b = wxBusinessService.getById(wxBusiness.getId(), wxBusiness.getFinalTenantId()); |
|
|
|
if (null == b) { |
|
|
|
return new ResultData(Result.ERROR,"未查询到业态"); |
|
|
|
} |
|
|
|
if (b.getIsSystem().intValue() == EnumYesOrNo.YES.getCode().intValue()) { |
|
|
|
return new ResultData(Result.ERROR,"不能修改系统默认业态"); |
|
|
|
} |
|
|
|
b.setIsDel(EnumYesOrNo.YES.getCode()); |
|
|
|
wxBusinessService.saveOrUpdate(b); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("业态分析接口") |
|
|
|
@GetMapping("businessDataList") |
|
|
|
|