|
@@ -3,14 +3,13 @@ package com.huijy.web.controller.api;
|
|
|
import com.huijy.common.core.domain.AjaxResult;
|
|
|
import com.huijy.common.core.page.TableDataInfo;
|
|
|
import com.huijy.management.domain.*;
|
|
|
-import com.huijy.management.service.IAboutUsService;
|
|
|
-import com.huijy.management.service.IContentService;
|
|
|
-import com.huijy.management.service.IMemberLocationService;
|
|
|
-import com.huijy.management.service.IMemberService;
|
|
|
+import com.huijy.management.service.*;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import jdk.nashorn.internal.ir.annotations.Ignore;
|
|
|
+import org.apache.catalina.Store;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
@@ -32,6 +31,10 @@ public class ApiIndexController extends ApiAbstractController {
|
|
|
private IAboutUsService aboutUsService;
|
|
|
@Autowired
|
|
|
private IContentService contentService;
|
|
|
+ @Autowired
|
|
|
+ private IShopService shopService;
|
|
|
+ @Autowired
|
|
|
+ private IShopSalesRecordService shopSalesRecordService;
|
|
|
|
|
|
@PostMapping("/pushLatLng")
|
|
|
@ApiOperation("上传会员坐标")
|
|
@@ -61,9 +64,9 @@ public class ApiIndexController extends ApiAbstractController {
|
|
|
@PostMapping("/pushHelp")
|
|
|
@ApiOperation("上传会员拨打记录")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "lat", value = "坐标的lat", paramType = "body"),
|
|
|
- @ApiImplicitParam(name = "lng", value = "坐标的lng", paramType = "body"),
|
|
|
- @ApiImplicitParam(name = "phone", value = "求助电话", paramType = "body")
|
|
|
+ @ApiImplicitParam(name = "lat", value = "坐标的lat",dataType = "String", paramType = "body"),
|
|
|
+ @ApiImplicitParam(name = "lng", value = "坐标的lng",dataType = "String",paramType = "body"),
|
|
|
+ @ApiImplicitParam(name = "phone", value = "求助电话",dataType = "String", paramType = "body")
|
|
|
})
|
|
|
public AjaxResult pushHelp(@ApiIgnore Member member, @RequestBody Map params) {
|
|
|
String lat = (String) params.get("lat");
|
|
@@ -105,4 +108,64 @@ public class ApiIndexController extends ApiAbstractController {
|
|
|
return getDataTable(list);
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ //门店开通申请
|
|
|
+ @PostMapping("/shopApply")
|
|
|
+ @ApiOperation("商铺开通申请")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "name", value = "商铺名称",required = true,paramType = "body"),
|
|
|
+ @ApiImplicitParam(name = "addres", value = "地址", paramType = "body"),
|
|
|
+ @ApiImplicitParam(name = "bossName", value = "老板名称",required = true, paramType = "body"),
|
|
|
+ @ApiImplicitParam(name = "bossPhone", value = "老板电话",required = true, paramType = "body"),
|
|
|
+ @ApiImplicitParam(name = "businessHours", value = "营业时间", paramType = "body"),
|
|
|
+ @ApiImplicitParam(name = "briefContent", value = "简介", paramType = "body"),
|
|
|
+ @ApiImplicitParam(name = "lat", value = "坐标的lat", paramType = "body"),
|
|
|
+ @ApiImplicitParam(name = "lng", value = "坐标的lng", paramType = "body")
|
|
|
+ })
|
|
|
+ public AjaxResult storeApply(@ApiIgnore Member member, @RequestBody Shop shop) {
|
|
|
+ if (shop == null){
|
|
|
+ AjaxResult.error("提交数据为空");
|
|
|
+ }
|
|
|
+ shop.setAuditFlag("0");
|
|
|
+ shop.setEnableFlag("0");
|
|
|
+ shopService.insertShop(shop);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ //更新门店坐标
|
|
|
+ @PostMapping("/updateLatLng")
|
|
|
+ @ApiOperation("更新门店坐标")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "shopId", value = "商铺id",required = true,paramType = "body"),
|
|
|
+ @ApiImplicitParam(name = "lat", value = "坐标的lat", paramType = "body"),
|
|
|
+ @ApiImplicitParam(name = "lng", value = "坐标的lng", paramType = "body")
|
|
|
+ })
|
|
|
+ public AjaxResult storeApply(@ApiIgnore Member member, @RequestBody Map params) {
|
|
|
+ String lat = (String) params.get("lat");
|
|
|
+ String lng = (String) params.get("lng");
|
|
|
+ Integer shopId = (Integer) params.get("shopId");
|
|
|
+ if (shopId==null || shopId<=0){
|
|
|
+ return AjaxResult.error("店铺id不能为空");
|
|
|
+ }
|
|
|
+ Shop shop = shopService.selectShopByShopId(shopId.longValue());
|
|
|
+ if (shop == null){
|
|
|
+ return AjaxResult.error("获取店铺信息出错");
|
|
|
+ }
|
|
|
+ shop.setLat(lat);
|
|
|
+ shop.setLng(lng);
|
|
|
+ shopService.updateShop(shop);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ //门店数据上报
|
|
|
+
|
|
|
+ @PostMapping("/pushRecord")
|
|
|
+ @ApiOperation("门店数据上报")
|
|
|
+ public AjaxResult storeApply(@ApiIgnore Member member, @RequestBody ShopSalesRecord shopSalesRecord) {
|
|
|
+ if (shopSalesRecord==null){
|
|
|
+ AjaxResult.error("上传数据为空");
|
|
|
+ }
|
|
|
+ shopSalesRecordService.insertShopSalesRecord(shopSalesRecord);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
}
|