|
@@ -0,0 +1,122 @@
|
|
|
+package io.platform.app.web.controller;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import io.platform.app.web.remote.MyAppRemote;
|
|
|
+import io.platform.base.common.utils.ExecuteResult;
|
|
|
+import io.platform.base.common.utils.R;
|
|
|
+import io.platform.base.common.utils.StringUtils;
|
|
|
+import io.platform.config.annotation.FuncLogAnno;
|
|
|
+import io.platform.store.dto.StoreBasicInfoDto;
|
|
|
+import io.platform.store.dto.StoreWriteOffCouponDto;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * app我的页面接口
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/myapp")
|
|
|
+@Api(tags = "APP我的页面")
|
|
|
+public class MyAppController {
|
|
|
+ @Autowired
|
|
|
+ private MyAppRemote myAppRemote;
|
|
|
+
|
|
|
+ @PostMapping("/selectStore")
|
|
|
+ @ApiOperation("查询门店信息接口")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "storeId",value = "门店ID",required = true)
|
|
|
+ })
|
|
|
+ @FuncLogAnno(functionName = "查询门店信息接口")
|
|
|
+ public R selectStore(@RequestBody Map<String,Object> map){
|
|
|
+ if (map.size()<1){
|
|
|
+ return R.error("参数不能为空");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNullOrEmpty(map.get("storeId").toString())){
|
|
|
+ return R.error("门店ID不能为空");
|
|
|
+ }
|
|
|
+ Long storeId = Long.valueOf(map.get("storeId").toString());
|
|
|
+ return R.ok().put("data",myAppRemote.selectStore(storeId));
|
|
|
+ }
|
|
|
+ @PostMapping("/storeSettlementCenter")
|
|
|
+ @ApiOperation("门店查看结算中心")
|
|
|
+ @FuncLogAnno(functionName ="门店查看结算中心")
|
|
|
+ public R storeSettlementCenter(@RequestBody Map<String,Object> map){
|
|
|
+ if (map.size()<1){
|
|
|
+ return R.error("参数不能为空");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNullOrEmpty(map.get("storeId").toString())){
|
|
|
+ return R.error("门店ID不能为空");
|
|
|
+ }
|
|
|
+ Long storeId = Long.valueOf(map.get("storeId").toString());
|
|
|
+ return R.ok().put("data",myAppRemote.storeSettlementCenter(storeId));
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 我的核销接口
|
|
|
+ */
|
|
|
+ @PostMapping("storeCancel")
|
|
|
+ @ApiOperation("门店我的核销接口")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "storeId", value = "门店ID",required = true),
|
|
|
+ @ApiImplicitParam(name = "amount",value = "核销金额",required = true),
|
|
|
+ @ApiImplicitParam(name = "brandCode",value = "品牌名称",required = true),
|
|
|
+ @ApiImplicitParam(name = "kunnr",value = "经销商编号",required = true)
|
|
|
+ })
|
|
|
+ @FuncLogAnno(functionName = "门店核销接口")
|
|
|
+ public R storeCancel(@RequestBody List<StoreWriteOffCouponDto> storeWriteOffCouponDtoList){
|
|
|
+ if (storeWriteOffCouponDtoList.size()<0){
|
|
|
+ return R.error("参数不能为空");
|
|
|
+ }
|
|
|
+ ExecuteResult<StoreWriteOffCouponDto> result = myAppRemote.storeCancel(storeWriteOffCouponDtoList);
|
|
|
+ if (result.isSuccess()){
|
|
|
+ return R.ok().put("data",result.getResult());
|
|
|
+ }else {
|
|
|
+ return R.error(result.getErrorMessages().get(0));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ @PostMapping("/storeSelectCoupon")
|
|
|
+ @ApiOperation("门店查询核销接口")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "storeId",value = "门店Id",required = true),
|
|
|
+ @ApiImplicitParam(name = "size",value = "条数",required = true),
|
|
|
+ @ApiImplicitParam(name = "current",value = "当前页",required = true)
|
|
|
+ })
|
|
|
+ @FuncLogAnno(functionName = "门店查询核销接口")
|
|
|
+ public R storeSelectCoupon(@RequestBody StoreWriteOffCouponDto storeWriteOffCouponDto){
|
|
|
+ if (storeWriteOffCouponDto.getStoreId()==null){
|
|
|
+ return R.error("门店ID不能为空");
|
|
|
+ }
|
|
|
+ Page page = new Page();
|
|
|
+ if (storeWriteOffCouponDto.getSize() != null){
|
|
|
+ page.setSize(storeWriteOffCouponDto.getSize());
|
|
|
+ }
|
|
|
+ if (storeWriteOffCouponDto.getCurrent() != null){
|
|
|
+ page.setCurrent(storeWriteOffCouponDto.getCurrent());
|
|
|
+ }
|
|
|
+ return R.ok().put("data",myAppRemote.storeSelectCoupon(page,storeWriteOffCouponDto).getRecords());
|
|
|
+
|
|
|
+ }
|
|
|
+ @PostMapping("/storeBrandTask")
|
|
|
+ @ApiOperation("门店品牌任务完成量统计接口")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "storeId",value = "门店Id",required = true)
|
|
|
+ })
|
|
|
+ @FuncLogAnno(functionName = "门店品牌任务完成量统计接口")
|
|
|
+ public R storeBrandTask(@RequestBody Map<String,Object> map){
|
|
|
+ if (map.size()<1){
|
|
|
+ return R.error("参数不能为空");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNullOrEmpty(map.get("storeId").toString())){
|
|
|
+ return R.error("门店ID不能为空");
|
|
|
+ }
|
|
|
+ Long storeId = Long.valueOf(map.get("storeId").toString());
|
|
|
+ return R.ok().put("data",myAppRemote.storeBrandTask(storeId));
|
|
|
+ }
|
|
|
+}
|