xiaoyong931011
2022-09-15 1f7383c5e295f11a66fdfa9b75e596f72b35b4a8
20220902
4 files added
22 files modified
838 ■■■■■ changed files
src/main/java/cc/mrbird/febs/common/properties/XcxProperties.java 4 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/common/utils/excl/ExcelUtil.java 3 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/controller/AdminMallOrderController.java 2 ●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/controller/ViewMallTeamLeaderController.java 11 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/dto/AdminLeaderAddFenceDto.java 5 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/dto/MallOrderInfoDto.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/entity/MallElectronicFence.java 3 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/mapper/MallElectronicFenceMapper.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/IMallElectronicFenceService.java 18 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallTeamLeaderServiceImpl.java 157 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallTeamLeaderServiceImpl.java 11 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/IMallElectronicFenceServiceImpl.java 244 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/vo/AdminMallTeamLeaderVo.java 2 ●●●●● patch | view | raw | blame | history
src/main/resources/application-dev.yml 2 ●●●●● patch | view | raw | blame | history
src/main/resources/application-prod.yml 2 ●●●●● patch | view | raw | blame | history
src/main/resources/application-test.yml 2 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/modules/MallElectronicFenceMapper.xml 8 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/modules/MallOrderInfoMapper.xml 3 ●●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/leader/addLeader.html 6 ●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/leader/leaderFenceAdd.html 251 ●●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/leader/leaderList.html 15 ●●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/leader/leaderMapSetting.html 7 ●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/leader/leaderUpdate.html 30 ●●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/order/orderList.html 8 ●●●● patch | view | raw | blame | history
src/main/resources/templates/index.html 4 ●●●● patch | view | raw | blame | history
src/test/java/cc/mrbird/febs/ProfitTest.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/common/properties/XcxProperties.java
@@ -26,5 +26,9 @@
    private String wecharpayMchid;
    //支付秘钥
    private String wecharpaySecret;
    //高德KEY
    private String gaodeKey;
    //高德serviceName
    private String serviceName;
}
src/main/java/cc/mrbird/febs/common/utils/excl/ExcelUtil.java
@@ -224,7 +224,8 @@
    private static void buildSheetData(Workbook wb, Sheet sheet, ExcelSheetPO excelSheetPO, ExcelVersion version) {
        sheet.setDefaultRowHeight((short) 400);
        sheet.setDefaultColumnWidth((short) 10);
//        sheet.setDefaultColumnWidth((short) 10);
        sheet.autoSizeColumn(1);
        createTitle(sheet, excelSheetPO, wb, version);
        createHeader(sheet, excelSheetPO, wb, version);
        createBody(sheet, excelSheetPO, wb, version);
src/main/java/cc/mrbird/febs/mall/controller/AdminMallOrderController.java
@@ -445,7 +445,7 @@
                temp.add(item.getLeaderName());
                temp.add(item.getLeaderPhone());
                temp.add(item.getAddressArea());
                temp.add(item.getProvince()+item.getCity()+item.getTownship()+item.getDetailAddress());
                temp.add(item.getDetailAddress());
                list.add(temp);
                adminMallOrderService.updateOrderStateAndDeliveryState(item.getId(), OrderStatusEnum.WAIT_FINISH.getValue(), OrderDeliveryStateEnum.DELIVERY_ING.getValue());
src/main/java/cc/mrbird/febs/mall/controller/ViewMallTeamLeaderController.java
@@ -96,4 +96,15 @@
    public String leaderMapSetting() {
        return FebsUtil.view("modules/leader/leaderMapSetting");
    }
    /**
     * 团长信息-电子围栏设置
     */
    @GetMapping("fenceAdd/{id}")
    @RequiresPermissions("fenceAdd:add")
    public String fenceAdd(@PathVariable long id, Model model) {
        AdminMallTeamLeaderVo data = iAdminMallTeamLeaderService.getMallTeamLederInfoById(id);
        model.addAttribute("leaderInfo", data);
        return FebsUtil.view("modules/leader/leaderFenceAdd");
    }
}
src/main/java/cc/mrbird/febs/mall/dto/AdminLeaderAddFenceDto.java
@@ -6,9 +6,6 @@
@Data
@ApiModel(value = "AdminLeaderAddFenceDto", description = "接收参数类")
public class AdminLeaderAddFenceDto {
    private String fenceName;//电子围栏名称
    private Integer fenceType;//电子围栏类型,1:POI围栏,2:行政区围栏,3:圆形围栏,4:多边形围栏
    private Long id;
    private String longlatiarr;//经纬度集合
    private String teamLeaderCode;//团长特征码
    private String gaodeKey;//高德地图Key
}
src/main/java/cc/mrbird/febs/mall/dto/MallOrderInfoDto.java
@@ -26,6 +26,8 @@
    private Integer orderType;
    //配送方式 1:自提 2:快递
    private Integer deliveryType;
    //配送方式 1:自提 2:快递
    private Integer isHome;
    private String uniqueCode;
src/main/java/cc/mrbird/febs/mall/entity/MallElectronicFence.java
@@ -13,6 +13,7 @@
    private Integer delFlag;//逻辑删除标志 1:正常 2已删除
    private String longlatiarr;//经纬度集合
    private String teamLeaderCode;//团长特征码
    private String gaodeKey;//高德地图Key
    private String gKey;//高德地图Key
    private String serviceId;//服务ID
    private String gid;//高德地图ID
}
src/main/java/cc/mrbird/febs/mall/mapper/MallElectronicFenceMapper.java
@@ -2,6 +2,9 @@
import cc.mrbird.febs.mall.entity.MallElectronicFence;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
public interface MallElectronicFenceMapper extends BaseMapper<MallElectronicFence> {
    MallElectronicFence selectByTeamLeaderCode(@Param("teamLeaderCode")String uniqueCode);
}
src/main/java/cc/mrbird/febs/mall/service/IMallElectronicFenceService.java
New file
@@ -0,0 +1,18 @@
package cc.mrbird.febs.mall.service;
import cc.mrbird.febs.mall.entity.MallElectronicFence;
import com.baomidou.mybatisplus.extension.service.IService;
public interface IMallElectronicFenceService extends IService<MallElectronicFence> {
    String trackServiceAdd(String gaodeKey,String serviceName);
    String trackServiceInfo(String gaodeKey);
    String fenceAdd(String gaodeKey,String serviceId,String fenceName,String points);
    String fenceUpdate(String gaodeKey,String serviceId,String fenceId,String fenceName,String points);
    String fenceList(String gaodeKey,String serviceId,String fenceIds);
    String fenceDelete(String gaodeKey,String serviceId,String fenceId);
}
src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallTeamLeaderServiceImpl.java
@@ -4,7 +4,9 @@
import cc.mrbird.febs.common.entity.QueryRequest;
import cc.mrbird.febs.common.enumerates.FlowTypeEnum;
import cc.mrbird.febs.common.enumerates.MoneyFlowTypeEnum;
import cc.mrbird.febs.common.properties.XcxProperties;
import cc.mrbird.febs.common.utils.HttpCurlUtil;
import cc.mrbird.febs.common.utils.SpringContextHolder;
import cc.mrbird.febs.mall.conversion.MallElectronicFenceConversion;
import cc.mrbird.febs.mall.conversion.MallTeamLeaderConversion;
import cc.mrbird.febs.mall.dto.AdminLeaderAddDto;
@@ -14,11 +16,14 @@
import cc.mrbird.febs.mall.entity.*;
import cc.mrbird.febs.mall.mapper.*;
import cc.mrbird.febs.mall.service.IAdminMallTeamLeaderService;
import cc.mrbird.febs.mall.service.IMallElectronicFenceService;
import cc.mrbird.febs.mall.vo.AdminMallActSetVo;
import cc.mrbird.febs.mall.vo.AdminMallTeamLeaderVo;
import cc.mrbird.febs.mall.vo.AdminSelectListLeaderVo;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
@@ -42,10 +47,7 @@
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
@Slf4j
@Service
@@ -58,6 +60,7 @@
    private final MallMemberMapper mallMemberMapper;
    private final MallMoneyFlowMapper mallMoneyFlowMapper;
    private final MallElectronicFenceMapper mallElectronicFenceMapper;
    private final IMallElectronicFenceService iMallElectronicFenceService;
    @Override
    public IPage<AdminMallTeamLeaderVo> getLeaderListInPage(MallTeamLeader mallTeamLeader, QueryRequest request) {
@@ -82,6 +85,10 @@
    public AdminMallTeamLeaderVo getMallTeamLederInfoById(long id) {
        MallTeamLeader mallTeamLeader = this.baseMapper.selectById(id);
        AdminMallTeamLeaderVo adminMallTeamLeaderVo = MallTeamLeaderConversion.INSTANCE.entityToVo(mallTeamLeader);
        MallElectronicFence mallElectronicFence = mallElectronicFenceMapper.selectByTeamLeaderCode(mallTeamLeader.getUniqueCode());
        if(ObjectUtil.isNotEmpty(mallElectronicFence)){
            adminMallTeamLeaderVo.setLonglatiarr(mallElectronicFence.getLonglatiarr());
        }
        return adminMallTeamLeaderVo;
    }
@@ -214,63 +221,101 @@
        return new FebsResponse().success();
    }
    @Override
    public FebsResponse addFence(AdminLeaderAddFenceDto adminLeaderAddFenceDto) {
        String gdFence = createGDFence(adminLeaderAddFenceDto);
        if("fail".equals(gdFence)){
            return new FebsResponse().fail().message("高德创建电子围栏失败!");
    public static void main(String[] args) {
        String ss = "{\"results\":[{\"name\":\"yiyuanshucai\",\"sid\":792477},{\"name\":\"yiyuanshucai1\",\"sid\":792477}]}";
        String serviceName = "";
        JSONObject jsonObject = JSONUtil.parseObj(ss);
        String results = jsonObject.get("results").toString();
        JSONArray jsonArray = JSONUtil.parseArray(results);
        System.out.print(jsonArray);
        for(Object jsonArray1 : jsonArray){
            System.out.print(jsonArray1);
            JSONObject jsonObject1 = JSONUtil.parseObj(jsonArray1);
            String name = jsonObject1.get("name").toString();
            System.out.print(name);
            if("yiyuanshucai".equals(name)){
                serviceName= name;
                break;
            }
        }
        MallElectronicFence mallElectronicFence = MallElectronicFenceConversion.INSTANCE.dtoToEntity(adminLeaderAddFenceDto);
        mallElectronicFence.setDelFlag(1);
        mallElectronicFence.setProhibit(1);
        mallElectronicFence.setGid(gdFence);
        mallElectronicFence.setGaodeKey(adminLeaderAddFenceDto.getGaodeKey());
        mallElectronicFenceMapper.insert(mallElectronicFence);
        return new FebsResponse().success();
//            String name = jsonObjectStr.get("name").toString();
//            String sid = jsonObjectStr.get("sid").toString();
//            if("yiyuanshucai".equals(name)){
//                System.out.print(name);
//                System.out.print(sid);
//            }
    }
    public String createGDFence(AdminLeaderAddFenceDto adminLeaderAddFenceDto){
        String url = "https://restapi.amap.com/v4/geofence/meta?key=";
        String gaodeKey = adminLeaderAddFenceDto.getGaodeKey();
        url =url+gaodeKey;
        HttpPost httpPost = new HttpPost(url);
        Map<String,String> map = new HashMap<>();
        String fenceName = adminLeaderAddFenceDto.getFenceName();
        map.put("name",fenceName);
        String longlatiarr = adminLeaderAddFenceDto.getLonglatiarr();
        if(null!=longlatiarr&&!"".equals(longlatiarr)){
            map.put("points",longlatiarr);
        }
        map.put("enable","true");
        map.put("valid_time","2054-12-30");
        map.put("repeat","Mon,Tues,Wed,Thur,Fri,Sat,Sun");
        //map.put("time","00:00,11:59;13:00,20:59");
        map.put("desc",fenceName);
        map.put("alert_condition","enter;leave");
        System.out.println(map);
        String  param= JSON.toJSONString(map);
        String result = null;
        try {
            result = HttpCurlUtil.sendPostHttp(url, param);
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println("==高德返回"+result);
        JSONObject maps = JSONUtil.parseObj(result);
        String errmsg = maps.get("errmsg").toString();
        String str2 = maps.get("data").toString();
        JSONObject maps2 = JSONUtil.parseObj(str2);
        String statusGaode = maps2.get("status").toString();
        String gid="";
        if(statusGaode.equals("0")){
            gid = maps2.get("gid").toString();
        }
        if(null!=gid&&!"".equals(gid)){
            return gid;
    private final XcxProperties xcxProperties = SpringContextHolder.getBean(XcxProperties.class);
    @Override
    public FebsResponse addFence(AdminLeaderAddFenceDto adminLeaderAddFenceDto) {
        //如果电子围栏表为空,
        //先查询服务是否已经创建,
        //没有,再创建服务。
        List<MallElectronicFence> mallElectronicFences = mallElectronicFenceMapper.selectList(new QueryWrapper<>());
        String serviceId = "";
        if(CollUtil.isEmpty(mallElectronicFences)){
            String resultStr = iMallElectronicFenceService.trackServiceInfo(xcxProperties.getGaodeKey());
            if("fail".equals(resultStr)){
                return new FebsResponse().fail().message("高德地图查询服务失败");
            }
            JSONObject jsonObject = JSONUtil.parseObj(resultStr);
            String results = jsonObject.get("results").toString();
            JSONArray jsonArray = JSONUtil.parseArray(results);
            for(Object jsonArray1 : jsonArray){
                JSONObject jsonObject1 = JSONUtil.parseObj(jsonArray1);
                String name = jsonObject1.get("name").toString();
                String sid = jsonObject1.get("sid").toString();
                if(xcxProperties.getServiceName().equals(name)){
                    serviceId= sid;
                    break;
                }
            }
            if(StrUtil.isBlank(serviceId)){
                serviceId = iMallElectronicFenceService.trackServiceAdd(xcxProperties.getGaodeKey(), xcxProperties.getServiceName());
            }
        }else{
            return "fail";
            serviceId = mallElectronicFences.get(0).getServiceId();
        }
        if("fail".equals(serviceId)){
            return new FebsResponse().fail().message("高德地图创建服务失败");
        }
        Long id = adminLeaderAddFenceDto.getId();
        MallTeamLeader mallTeamLeader = this.baseMapper.selectById(id);
        String uniqueCode = mallTeamLeader.getUniqueCode();
        MallElectronicFence mallElectronicFence = mallElectronicFenceMapper.selectByTeamLeaderCode(uniqueCode);
        if(ObjectUtil.isEmpty(mallElectronicFence)){
            //新增
            //新增围栏
            String fenceId = iMallElectronicFenceService.fenceAdd(xcxProperties.getGaodeKey(), serviceId
                    , mallTeamLeader.getUniqueCode()+"_fence", adminLeaderAddFenceDto.getLonglatiarr());
            if("fail".equals(fenceId)){
                return new FebsResponse().fail().message("高德地图创建多边形围栏失败");
            }
            MallElectronicFence mallElectronicFenceAdd = new MallElectronicFence();
            mallElectronicFenceAdd.setFenceName(mallTeamLeader.getUniqueCode()+"_fence");
            mallElectronicFenceAdd.setFenceType(4);
            mallElectronicFenceAdd.setGid(fenceId);
            mallElectronicFenceAdd.setProhibit(1);
            mallElectronicFenceAdd.setDelFlag(1);
            mallElectronicFenceAdd.setGKey(xcxProperties.getGaodeKey());
            mallElectronicFenceAdd.setLonglatiarr(adminLeaderAddFenceDto.getLonglatiarr());
            mallElectronicFenceAdd.setTeamLeaderCode(uniqueCode);
            mallElectronicFenceAdd.setServiceId(serviceId);
            mallElectronicFenceMapper.insert(mallElectronicFenceAdd);
        }else{
            String fenceUpdate = iMallElectronicFenceService.fenceUpdate(xcxProperties.getGaodeKey(), serviceId,
                    mallElectronicFence.getGid(), mallElectronicFence.getFenceName(),
                    adminLeaderAddFenceDto.getLonglatiarr());
            if("fail".equals(fenceUpdate)){
                return new FebsResponse().fail().message("高德地图更新多边形围栏失败");
            }
            mallElectronicFence.setLonglatiarr(adminLeaderAddFenceDto.getLonglatiarr());
            mallElectronicFenceMapper.updateById(mallElectronicFence);
        }
        return new FebsResponse().success();
    }
}
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallTeamLeaderServiceImpl.java
@@ -438,8 +438,15 @@
                null,null,
                DateUtil.date());
        apiLeaderProfitVo.setMonthProfit(monthProfit);
        BigDecimal waitProfit = mallLeaderAchieveMapper.selectProfitByStateAndDateTimeAndUniqueCode(1,null,loginUser.getInviteId()).setScale(2,BigDecimal.ROUND_DOWN);
        apiLeaderProfitVo.setWaitProfit(waitProfit);
        String inviteId = loginUser.getInviteId();
        MallTeamLeader mallTeamLeader = mallTeamLeaderMapper.selectLeaderByUniqueCode(inviteId);
        Integer profitSwitch = mallTeamLeader.getProfitSwitch() == null ? 2:mallTeamLeader.getProfitSwitch();
        if(2 == profitSwitch){
            apiLeaderProfitVo.setWaitProfit(BigDecimal.ZERO);
        }else{
            BigDecimal waitProfit = mallLeaderAchieveMapper.selectProfitByStateAndDateTimeAndUniqueCode(1,null,loginUser.getInviteId()).setScale(2,BigDecimal.ROUND_DOWN);
            apiLeaderProfitVo.setWaitProfit(waitProfit);
        }
        return new FebsResponse().success().data(apiLeaderProfitVo);
    }
src/main/java/cc/mrbird/febs/mall/service/impl/IMallElectronicFenceServiceImpl.java
New file
@@ -0,0 +1,244 @@
package cc.mrbird.febs.mall.service.impl;
import cc.mrbird.febs.common.utils.HttpCurlUtil;
import cc.mrbird.febs.mall.entity.MallElectronicFence;
import cc.mrbird.febs.mall.mapper.MallElectronicFenceMapper;
import cc.mrbird.febs.mall.service.IMallElectronicFenceService;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.client.methods.HttpPost;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@Slf4j
@Service
@RequiredArgsConstructor
public class IMallElectronicFenceServiceImpl  extends ServiceImpl<MallElectronicFenceMapper, MallElectronicFence> implements IMallElectronicFenceService {
    @Override
    public String trackServiceAdd(String gaodeKey, String serviceName) {
        String url = "https://tsapi.amap.com/v1/track/service/add?key="+gaodeKey+"&name="+serviceName;
        HttpPost httpPost = new HttpPost(url);
        Map<String,String> map = new HashMap<>();
        map.put("key",gaodeKey);
        map.put("name",serviceName);
        String  param= JSON.toJSONString(map);
        log.info(param);
        String result = null;
        try {
            result = HttpCurlUtil.sendPostHttp(url, param);
        } catch (IOException e) {
            e.printStackTrace();
        }
        log.info("创建服务"+result);
        cn.hutool.json.JSONObject maps = JSONUtil.parseObj(result);
        String errcode = maps.get("errcode").toString();
        if(!"10000".equals(errcode)){
            return "fail";
        }
        String str2 = maps.get("data").toString();
        cn.hutool.json.JSONObject maps2 = JSONUtil.parseObj(str2);
        String serviceId = maps2.get("sid").toString();
        if(null!=serviceId&&!"".equals(serviceId)){
            return serviceId;
        }else{
            return "fail";
        }
    }
    @Override
    public String trackServiceInfo(String gaodeKey) {
        String url = "https://tsapi.amap.com/v1/track/service/list";
        HttpPost httpPost = new HttpPost(url);
        Map<String,String> map = new HashMap<>();
        //高德Key
        //用户在高德地图官网申请Web服务API类型Key
        map.put("key",gaodeKey);
        log.info("查询服务"+JSON.toJSONString(map));
        String result = null;
        try {
            result = HttpCurlUtil.sendGetHttp(url, map);
        } catch (IOException e) {
            e.printStackTrace();
        }
        log.info("查询服务"+result);
        cn.hutool.json.JSONObject maps = JSONUtil.parseObj(result);
        String errCode = maps.get("errcode").toString();
        if("10000".equals(errCode)){
            String dataStr = maps.get("data").toString();
            return dataStr;
        }else{
            return "fail";
        }
    }
    @Override
    public String fenceAdd(String gaodeKey, String serviceId, String fenceName, String points) {
        String url = "https://tsapi.amap.com/v1/track/geofence/add/polygon?key="+gaodeKey+"" +
                "&sid="+serviceId+"&name="+fenceName+"&points="+points;
        HttpPost httpPost = new HttpPost(url);
        Map<String,String> map = new HashMap<>();
        //高德Key
        //用户在高德地图官网申请Web服务API类型Key
        map.put("key",gaodeKey);
        //服务唯一编号
        //sid为猎鹰service唯一编号
        map.put("sid",serviceId);
        //围栏名称
        //在同一个 sid 下不可重复,不可为空。
        //支持中文、英文大小字母、英文下划线"_"、英文横线"-"和数字,长度不大于128个字符
        map.put("name",fenceName);
        //多边形顶点坐标
        //格式 X1,Y1;X2,Y2;...
        //顶点顺序可按顺时针或逆时针排列;
        //1. 普通地理围栏:顶点个数在3-100个之间,外接矩形面积<100平方公里;
        //2. 大范围地理围栏:顶点个数在3-100个之间,外接矩形面积小于1000平方公里,请您通过工单与我们联系。
        map.put("points",points);
        String  param= JSON.toJSONString(map);
        log.info("创建多边形围栏"+param);
        String result = null;
        try {
            result = HttpCurlUtil.sendPostHttp(url, param);
        } catch (IOException e) {
            e.printStackTrace();
        }
        log.info("创建多边形围栏"+result);
        cn.hutool.json.JSONObject maps = JSONUtil.parseObj(result);
        String errCode = maps.get("errcode").toString();
        if("10000".equals(errCode)){
            String data = maps.get("data").toString();
            cn.hutool.json.JSONObject dataObject = JSONUtil.parseObj(data);
            String gfid = dataObject.get("gfid").toString();
            if(null!=gfid&&!"".equals(gfid)){
                return gfid;
            }else{
                return "fail";
            }
        }else{
            return "fail";
        }
    }
    @Override
    public String fenceUpdate(String gaodeKey, String serviceId, String fenceId, String fenceName, String points) {
        String url = "https://tsapi.amap.com/v1/track/geofence/update/polygon?key="+gaodeKey
                +"&sid="+serviceId+"&gfid="+fenceId+"&name="+fenceName+"&points="+points;
        HttpPost httpPost = new HttpPost(url);
        Map<String,String> map = new HashMap<>();
        //高德Key
        //用户在高德地图官网申请Web服务API类型Key
        map.put("key",gaodeKey);
        //服务唯一编号
        //sid为猎鹰service唯一编号
        map.put("sid",serviceId);
        //围栏id
        //围栏唯一标识,指定要更新的围栏
        map.put("gfid",fenceId);
        //围栏名称
        //在同一个 sid 下不可重复,不可为空。
        //支持中文、英文大小字母、英文下划线"_"、英文横线"-"和数字,长度不大于128个字符
        map.put("name",fenceName);
        //多边形顶点坐标
        //格式 X1,Y1;X2,Y2;...
        //顶点顺序可按顺时针或逆时针排列;
        //1. 普通地理围栏:顶点个数在3-100个之间,外接矩形面积<100平方公里;
        //2. 大范围地理围栏:顶点个数在3-100个之间,外接矩形面积小于1000平方公里,请您通过工单与我们联系。
        map.put("points",points);
        String  param= JSON.toJSONString(map);
        log.info("更新多边形围栏"+param);
        String result = null;
        try {
            result = HttpCurlUtil.sendPostHttp(url, param);
        } catch (IOException e) {
            e.printStackTrace();
        }
        log.info("更新多边形围栏"+result);
        cn.hutool.json.JSONObject maps = JSONUtil.parseObj(result);
        String errCode = maps.get("errcode").toString();
        if("10000".equals(errCode)){
            return errCode;
        }else{
            return "fail";
        }
    }
    @Override
    public String fenceList(String gaodeKey, String serviceId, String fenceIds) {
        String url = "https://tsapi.amap.com/v1/track/geofence/list";
        HttpPost httpPost = new HttpPost(url);
        Map<String,String> map = new HashMap<>();
        //高德Key
        //用户在高德地图官网申请Web服务API类型Key
        map.put("key",gaodeKey);
        //服务唯一编号
        //sid为猎鹰service唯一编号
        map.put("sid",serviceId);
        //围栏的唯一标识
        //支持一次传入多个,以","分割;
        //单次最多支持100个,如超出将只截取前100个作为输入。
        //否;
        //如传入,则只返回由 gfids 所指定的围栏,不分页(忽略 page 和 pagesize 参数);
        //如不传,则分页返回所有围栏;
        map.put("gfids",fenceIds);
        log.info("查询围栏"+JSON.toJSONString(map));
        String result = null;
        try {
            result = HttpCurlUtil.sendGetHttp(url, map);
        } catch (IOException e) {
            e.printStackTrace();
        }
        log.info("查询围栏"+result);
        cn.hutool.json.JSONObject maps = JSONUtil.parseObj(result);
        String errCode = maps.get("errcode").toString();
        if("10000".equals(errCode)){
            String dataStr = maps.get("data").toString();
            cn.hutool.json.JSONObject dataResults = JSONUtil.parseObj(dataStr);
            String resultsStr = dataResults.get("results").toString();
            return resultsStr;
        }else{
            return "fail";
        }
    }
    @Override
    public String fenceDelete(String gaodeKey, String serviceId, String fenceId) {
        String url = "https://tsapi.amap.com/v1/track/geofence/delete";
        HttpPost httpPost = new HttpPost(url);
        Map<String,String> map = new HashMap<>();
        //高德Key
        //用户在高德地图官网申请Web服务API类型Key
        map.put("key",gaodeKey);
        //服务唯一编号
        //sid为猎鹰service唯一编号
        map.put("sid",serviceId);
        //围栏id
        //围栏唯一标识,指定要更新的围栏
        map.put("gfids",fenceId);
        String  param= JSON.toJSONString(map);
        log.info("删除围栏"+param);
        String result = null;
        try {
            result = HttpCurlUtil.sendPostHttp(url, param);
        } catch (IOException e) {
            e.printStackTrace();
        }
        log.info("删除围栏"+result);
        cn.hutool.json.JSONObject maps = JSONUtil.parseObj(result);
        String errCode = maps.get("errcode").toString();
        if("10000".equals(errCode)){
            String dataStr = maps.get("data").toString();
            cn.hutool.json.JSONObject gfidsJson = JSONUtil.parseObj(dataStr);
            String gfidsStr = gfidsJson.get("gfids").toString();
            return gfidsStr;
        }else{
            return "fail";
        }
    }
}
src/main/java/cc/mrbird/febs/mall/vo/AdminMallTeamLeaderVo.java
@@ -45,4 +45,6 @@
    private Integer profitSwitch;
    //团长返利百分比如0.15表示15%
    private String bonusPercent;
    private String longlatiarr;
}
src/main/resources/application-dev.yml
@@ -73,3 +73,5 @@
  certLocalPath: /home/yyscCert/apiclient_cert.p12
  wecharpayMchid: 1631084809
  wecharpaySecret: YYSC13875978057YYSC13875978057SH
  gaodeKey: e024c63342930addc57189c8608cdb01
  serviceName: yiyuanshucai
src/main/resources/application-prod.yml
@@ -69,3 +69,5 @@
  certLocalPath: /home/yyscCert/apiclient_cert.p12
  wecharpayMchid: 1631084809
  wecharpaySecret: YYSC13875978057YYSC13875978057SH
  gaodeKey: e024c63342930addc57189c8608cdb01
  serviceName: yiyuanshucai
src/main/resources/application-test.yml
@@ -78,3 +78,5 @@
  certLocalPath: /home/yyscCert/apiclient_cert.p12
  wecharpayMchid: 1631084809
  wecharpaySecret: YYSC13875978057YYSC13875978057SH
  gaodeKey: e024c63342930addc57189c8608cdb01
  serviceName: yiyuanshucai
src/main/resources/mapper/modules/MallElectronicFenceMapper.xml
New file
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cc.mrbird.febs.mall.mapper.MallElectronicFenceMapper">
    <select id="selectByTeamLeaderCode" resultType="cc.mrbird.febs.mall.entity.MallElectronicFence">
        select * from mall_electronic_fence where team_leader_code=#{teamLeaderCode}
    </select>
</mapper>
src/main/resources/mapper/modules/MallOrderInfoMapper.xml
@@ -85,6 +85,9 @@
                <if test="record.deliveryType != null and record.deliveryType != ''">
                    and a.delivery_type = #{record.deliveryType}
                </if>
                <if test="record.isHome != null and record.isHome != ''">
                    and a.is_home = #{record.isHome}
                </if>
                <if test="record.orderNo != null and record.orderNo != ''">
                    and a.order_no like CONCAT('%', CONCAT(#{record.orderNo}, '%'))
                </if>
src/main/resources/templates/febs/views/modules/leader/addLeader.html
@@ -84,7 +84,7 @@
        <div class="layui-form-item">
            <label class="layui-form-label febs-form-item-require">地图选择:</label>
            <div class="layui-input-block">
                <div class="layui-fluid layui-anim febs-anim" id="febs-map-demo" lay-title="高德地图">
                <div class="layui-fluid layui-anim febs-anim" id="febs-map-demo-add" lay-title="高德地图">
                    <div class="layui-row febs-container">
                        <div class="layui-card">
                            <div style="padding: .1rem;">
@@ -123,7 +123,7 @@
            mallMember = [[${mallMember}]],
            upload = layui.upload,
            $view = $('#user-addLeader'),
            $viewMap = $('#febs-map-demo'),
            $viewMap = $('#febs-map-demo-add'),
            _deptTree;
        $viewMap.find('#container').css({"height": document.documentElement.clientHeight - 97 + 'px'});
@@ -135,7 +135,7 @@
        //为地图注册click事件获取鼠标点击出的经纬度坐标
        map.on('click', function (e) {
            febs.alert.success('经度:' + e.lnglat.getLng() + ',纬度:' + e.lnglat.getLat()+e.province);
            febs.alert.success('经度:' + e.lnglat.getLng() + ',纬度:' + e.lnglat.getLat());
            $("#longitude").val(e.lnglat.getLng());
            $("#latitude").val(e.lnglat.getLat());
src/main/resources/templates/febs/views/modules/leader/leaderFenceAdd.html
New file
@@ -0,0 +1,251 @@
<style>
    #user-addLeaderFence {
        padding: 20px 25px 25px 0;
    }
    #user-addLeaderFence .layui-treeSelect .ztree li a, .ztree li span {
        margin: 0 0 2px 3px !important;
    }
    #user-addLeaderFence #data-permission-tree-block {
        border: 1px solid #eee;
        border-radius: 2px;
        padding: 3px 0;
    }
    #user-addLeaderFence .layui-treeSelect .ztree li span.button.switch {
        top: 1px;
        left: 3px;
    }
    #user-addLeaderFence img{
        max-width:200px
    }
    .map{
        width: 50%;
        height: 500px!important;
    }
</style>
<div class="layui-fluid" id="user-addLeaderFence">
    <form class="layui-form" action="" lay-filter="user-addLeaderFence-form">
        <div class="layui-form-item febs-hide">
            <label class="layui-form-label">id:</label>
            <div class="layui-input-block">
                <input type="text" name="id">
            </div>
        </div>
        <div class="layui-form-item febs-hide">
            <label class="layui-form-label">memberId:</label>
            <div class="layui-input-block">
                <input type="text" name="memberId">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label febs-form-item-require">姓名:</label>
            <div class="layui-input-block">
                <input type="text" name="name" lay-verify="required" placeholder="" autocomplete="off" class="layui-input" readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label febs-form-item-require">手机号码:</label>
            <div class="layui-input-block">
                <input type="text" name="phone" lay-verify="required" placeholder="" autocomplete="off" class="layui-input" readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label febs-form-item-require">自提点名称:</label>
            <div class="layui-input-block">
                <input type="text" name="addressArea" lay-verify="required" placeholder="" autocomplete="off" class="layui-input" readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label febs-form-item-require">详细地址:</label>
            <div class="layui-input-block">
                <input type="text" id="detailAddress" name="detailAddress" class="layui-input" readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label febs-form-item-require">地图选择:</label>
            <div class="layui-input-block">
                <div class="layui-fluid layui-anim febs-anim" id="febs-fenceMap-demo" lay-title="高德地图">
                    <div class="layui-row febs-container">
                        <div class="layui-card">
                            <div style="padding: .1rem;">
                                <div id="container" class="map"></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-mid layui-word-aux">鼠标左键点击地图位置,出现【标记*】,则代表选点成功</div>
                <div class="layui-form-mid layui-word-aux">最少请选择三个点</div>
            </div>
            <button class="layui-btn" type="button" id="clearMap">重新设置配送范围</button>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label febs-form-item-require">经度:</label>
            <div class="layui-input-block">
                <input type="text" id="longitude" name="longitude" lay-verify="required" placeholder="" class="layui-input" readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label febs-form-item-require">纬度:</label>
            <div class="layui-input-block">
                <input type="text" id="latitude" name="latitude" lay-verify="required" placeholder="" class="layui-input" readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label febs-form-item-require">经纬度串:</label>
            <div class="layui-input-block">
                <input type="text" id="longlatiarr" name="longlatiarr" lay-verify="required" placeholder="" class="layui-input" readonly>
            </div>
        </div>
        <div class="layui-form-item febs-hide">
            <button class="layui-btn" lay-submit="" lay-filter="user-addLeaderFence-submit" id="submit"></button>
        </div>
    </form>
</div>
<script data-th-inline="javascript">
    layui.use(['febs', 'form', 'formSelects',  'treeSelect', 'eleTree', 'upload'], function () {
        var $ = layui.$,
            febs = layui.febs,
            layer = layui.layer,
            form = layui.form,
            leaderInfo = [[${leaderInfo}]],
            upload = layui.upload,
            $view = $('#user-addLeaderFence'),
            $viewMap = $('#febs-fenceMap-demo'),
            $clearMap = $('#clearMap')
        $viewMap.find('#container').css({"height": document.documentElement.clientHeight - 97 + 'px'});
        var map = new AMap.Map("container", {
            center: [leaderInfo.longitude, leaderInfo.latitude], //初始地图中心点
            resizeEnable: true,
            zoom: 16.8 //初始地图级别
        });
        //配送范围回显
        var pathPolygon = [];
        var polygonClear;
        // 构造点标记
        //为地图注册click事件获取鼠标点击出的经纬度坐标
        var i = 0;
        var markerList = [];
        map.on('click', function (e) {
            // febs.alert.success('经度:' + e.lnglat.getLng() + ',纬度:' + e.lnglat.getLat());
            var positonList = [];
            positonList.push(e.lnglat.getLng());
            positonList.push(e.lnglat.getLat());
            i = i +1;
            var addMaker = new AMap.Marker({
                map: map,
                content: '标记'+i,
                icon: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
                position: [positonList[0], positonList[1]],
                offset: new AMap.Pixel(-13, -30)
            });
            markerList.push(addMaker);
        });
        //为地图注册click事件获取鼠标点击出的经纬度坐标
        var path = [];
        var pathStr = "";
        var lines = [];
        map.on('click', function (e) {
            let lngLat = new AMap.LngLat(e.lnglat.getLng(),e.lnglat.getLat());
            path.push(lngLat);
            pathStr = pathStr + lngLat+";";
            console.log(path.toString());
            console.log(pathStr);
            var polyline = new AMap.Polyline({
                path: path,
                borderWeight: 3, // 线条宽度,默认为 1
                strokeColor: 'blue', // 线条颜色
                lineJoin: 'round' // 折线拐点连接处样式
            })
            map.add(polyline);
            lines.push(polyline)
            document.getElementById("longlatiarr").value=pathStr;
        });
        form.render();
        initUserValue();
        $clearMap.on('click', function (e) {
            map.remove(lines);
            lines = []
            path = []
            pathStr = ""
            document.getElementById("longlatiarr").value=pathStr;
            map.add(lines);
            map.remove(markerList);
            markerList = [];
            i = 0;
            map.remove(polygonClear);
        })
        function initUserValue() {
            var marker = new AMap.Marker({
                position: map.getCenter(),
                icon: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
                anchor:'bottom-center',
                offset: new AMap.Pixel(0, 0)
            });
            marker.setMap(map);
            // 设置鼠标划过点标记显示的文字提示
            marker.setTitle('团长位置');
            // 设置label标签
            // label默认蓝框白底左上角显示,样式className为:amap-marker-label
            marker.setLabel({
                direction:'right',
                offset: new AMap.Pixel(10, 0),  //设置文本标注偏移量
                content: "<div class='info'>团长位置</div>", //设置文本标注内容
            });
            //配送范围回显
            // var pathPolygon = [];
            let fenceLongLat = leaderInfo.longlatiarr;
            let splitList = [];
            splitList = fenceLongLat.split(';');
            if(splitList.length > 0){
                for(let splitIndex = 0;splitIndex < splitList.length-1;splitIndex++){
                    let splitLngLat = splitList[splitIndex].split(',');
                    console.log(splitLngLat[0]);
                    console.log(splitLngLat[1]);
                    let lngLat = new AMap.LngLat(splitLngLat[0],splitLngLat[1]);
                    pathPolygon.push(lngLat)
                }
            }
            var polygon = new AMap.Polygon({
                path: pathPolygon,
                fillColor: '#00B2D5', // 多边形填充颜色
                fillOpacity : 0.5, // 多边形填充透明度,取值范围 [0,1] ,0表示完全透明,1表示不透明。默认为0.5
                strokeStyle : 'dashed', // 轮廓线样式,实线:solid,虚线:dashed
                borderWeight: 2, // 线条宽度,默认为 1
                strokeColor: 'green', // 线条颜色
            });
            polygonClear = polygon;
            map.add(polygon);
            form.val("user-addLeaderFence-form", {
                "id": leaderInfo.id,
                "memberId": leaderInfo.memberId,
                "name": leaderInfo.name,
                "addressArea": leaderInfo.addressArea,
                "detailAddress": leaderInfo.detailAddress,
                "longitude": leaderInfo.longitude,
                "latitude": leaderInfo.latitude,
                "longlatiarr": leaderInfo.longlatiarr,
                "phone": leaderInfo.phone
            });
        }
        form.on('submit(user-addLeaderFence-submit)', function (data) {
            febs.post(ctx + 'admin/leader/addFence', data.field, function () {
                layer.closeAll();
                febs.alert.success('操作成功');
                $('#febs-leader').find('#reset').click();
            });
            return false;
        });
    });
</script>
src/main/resources/templates/febs/views/modules/leader/leaderList.html
@@ -117,6 +117,18 @@
                    }
                });
            }
            if (layEvent === 'fenceAdd') {
                febs.modal.open('设置配送范围', 'modules/leader/fenceAdd/' + data.id, {
                    btn: ['提交', '取消'],
                    area:['100%','100%'],
                    yes: function (index, layero) {
                        $('#user-addLeaderFence').find('#submit').trigger('click');
                    },
                    btn2: function () {
                        layer.closeAll();
                    }
                });
            }
            if (layEvent === 'leaderCancel') {
                febs.modal.confirm('拉黑', '团长被拉黑,将无法再次申请团长', function () {
                    leaderCancel(data.id);
@@ -200,12 +212,13 @@
                            }else if(d.state === 1) {
                                return ''
                                    + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="leaderUpdate" shiro:hasPermission="user:update">修改</button>'
                                    + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="fenceAdd" shiro:hasPermission="user:update">设置配送范围</button>'
                                    + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="leaderCancel" shiro:hasPermission="user:update">拉黑</button>'
                                    // + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="leaderGoodsUpdate" shiro:hasPermission="user:update">团长商品设置</button>'
                            }else{
                                return '';
                            }
                        },minWidth: 160,align:'center'}
                        },minWidth: 200,align:'center'}
                ]]
            });
        }
src/main/resources/templates/febs/views/modules/leader/leaderMapSetting.html
@@ -35,8 +35,10 @@
        $view.find('#container').css({"height": document.documentElement.clientHeight - 97 + 'px'});
        var map = new AMap.Map("container", {
            center: [116.368904,39.913423],
            zoom: 16.8
            // center: [116.368904,39.913423],
            resizeEnable: true,
            zoom: 14
        });
        var polyEditor = new AMap.PolyEditor(map);
@@ -67,6 +69,7 @@
            });
            // 将折线添加至地图实例
            map.add(polyline);
            console.log(path.toString());
        });
src/main/resources/templates/febs/views/modules/leader/leaderUpdate.html
@@ -18,6 +18,10 @@
    #febs-leader-update img{
        max-width:200px
    }
    .map{
        width: 50%;
        height: 500px!important;
    }
</style>
<div class="layui-fluid" id="febs-leader-update">
@@ -78,7 +82,7 @@
        <div class="layui-form-item">
            <label class="layui-form-label febs-form-item-require">地图选择:</label>
            <div class="layui-input-block">
                <div class="layui-fluid layui-anim febs-anim" id="febs-map-demo" lay-title="高德地图">
                <div class="layui-fluid layui-anim febs-anim" id="febs-map-demo-update" lay-title="高德地图">
                    <div class="layui-row febs-container">
                        <div class="layui-card">
                            <div style="padding: .1rem;">
@@ -123,7 +127,7 @@
            form = layui.form,
            leaderInfo = [[${leaderInfo}]],
            $view = $('#febs-leader-update'),
            $viewMap = $('#febs-map-demo'),
            $viewMap = $('#febs-map-demo-update'),
            upload = layui.upload,
            _deptTree;
@@ -131,7 +135,7 @@
        var map = new AMap.Map("container", {
            center: [leaderInfo.longitude, leaderInfo.latitude],
            resizeEnable: true,
            zoom: 14 //初始地图级别
            zoom: 16.8 //初始地图级别
        });
        //为地图注册click事件获取鼠标点击出的经纬度坐标
        map.on('click', function (e) {
@@ -158,6 +162,7 @@
        }
        function geocoder_CallBack(data) {
            var address = data.regeocode.formattedAddress; //返回地址描述
            febs.alert.success('地址:' +address);
            document.getElementById("detailAddress").value=address;
        }
@@ -180,6 +185,25 @@
        initUserValue();
        function initUserValue() {
            var marker = new AMap.Marker({
                position: map.getCenter(),
                icon: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
                anchor:'bottom-center',
                offset: new AMap.Pixel(0, 0)
            });
            marker.setMap(map);
            // 设置鼠标划过点标记显示的文字提示
            marker.setTitle('团长位置');
            // 设置label标签
            // label默认蓝框白底左上角显示,样式className为:amap-marker-label
            marker.setLabel({
                direction:'right',
                offset: new AMap.Pixel(10, 0),  //设置文本标注偏移量
                content: "<div class='info'>团长位置</div>", //设置文本标注内容
            });
            //图片回显
            if(leaderInfo.addressPic != null || leaderInfo.addressPic != ''){
                $('#addressPicImage').append('<img src="'+ leaderInfo.addressPic +'" class="layui-upload-img" style="width: 100px">')
src/main/resources/templates/febs/views/modules/order/orderList.html
@@ -42,10 +42,10 @@
                                <div class="layui-inline">
                                    <label class="layui-form-label layui-form-label-sm">配送方式</label>
                                    <div class="layui-input-inline">
                                        <select name="deliveryType">
                                        <select name="isHome">
                                            <option value="">请选择</option>
                                            <option value="1">自提</option>
                                            <option value="2">快递</option>
                                            <option value="1">送货上门</option>
                                            <option value="2">自提</option>
                                        </select>
                                    </div>
                                </div>
@@ -366,7 +366,7 @@
                orderNo: $searchForm.find('input[name="orderNo"]').val().trim(),
                payResult: $searchForm.find("select[name='payResult']").val(),
                status: $searchForm.find("select[name='status']").val(),
                deliveryType: $searchForm.find("select[name='deliveryType']").val(),
                isHome: $searchForm.find("select[name='isHome']").val(),
                uniqueCode: $searchForm.find("select[name='uniqueCode']").val(),
            };
        }
src/main/resources/templates/index.html
@@ -17,10 +17,10 @@
    <!-- 高德地图,key为演示作用,请勿滥用-->
    <script type="text/javascript">
        window._AMapSecurityConfig = {
            securityJsCode:'8fd9b92f6e07b1f18d3ae39b42ff71bc',
            securityJsCode:'50d73a585f300cccf7fc2bf31d0c38c8',
        }
    </script>
    <script src="https://webapi.amap.com/maps?v=1.4.15&key=04934a2cf5cfa8a29ffcf0fdcfaabb5f&plugin=AMap.Autocomplete,AMap.PolyEditor,AMap.Geocoder,AMap.PolylineEditor"></script>
    <script src="https://webapi.amap.com/maps?v=1.4.15&key=e32064fc8a9dfe7af7d2d0a947b8df32&plugin=AMap.Autocomplete,AMap.PolyEditor,AMap.Geocoder,AMap.PolylineEditor"></script>
    <link href="https://unpkg.com/@wangeditor/editor@5.0.1/dist/css/style.css" rel="stylesheet">
    <script src="https://unpkg.com/@wangeditor/editor@latest/dist/index.js"></script>
    <link rel="icon" th:href="@{febs/images/favicon.ico}" type="image/x-icon"/>
src/test/java/cc/mrbird/febs/ProfitTest.java
@@ -5,8 +5,10 @@
import cc.mrbird.febs.common.enumerates.FlowTypeEnum;
import cc.mrbird.febs.common.enumerates.MoneyFlowTypeEnum;
import cc.mrbird.febs.common.enumerates.OrderStatusEnum;
import cc.mrbird.febs.common.utils.HttpCurlUtil;
import cc.mrbird.febs.common.utils.MallUtils;
import cc.mrbird.febs.common.utils.RedisUtils;
import cc.mrbird.febs.mall.dto.AdminLeaderAddFenceDto;
import cc.mrbird.febs.mall.dto.ApiLeaderRefundOrderDto;
import cc.mrbird.febs.mall.entity.*;
import cc.mrbird.febs.mall.mapper.*;
@@ -200,18 +202,47 @@
    private IXcxPayService iXcxPayService;
    @Autowired
    private MallGoodsMapper mallGoodsMapper;
    @Autowired
    private IAdminMallTeamLeaderService iAdminMallTeamLeaderService;
    @Test
    public void qrcodeBase64(){
        Integer integer = mallGoodsMapper.upDateStockAndVolumeByGoodsId(35L, 3);
        System.out.println(integer);
//        Integer integer = mallGoodsMapper.upDateStockAndVolumeByGoodsId(35L, 3);
//        System.out.println(integer);
//        WxGenerateQrCodeDto wxGenerateQrCodeDto = new WxGenerateQrCodeDto();
//        wxGenerateQrCodeDto.setPage("pages/product/details");
//        wxGenerateQrCodeDto.setScene("35");
//        FebsResponse febsResponse = iXcxPayService.generateQrCode(wxGenerateQrCodeDto);
//        String data = febsResponse.get("data").toString();
//        System.out.println(data);
        trackServiceInfo("e024c63342930addc57189c8608cdb01",null);
    }
    public String trackServiceInfo(String gaodeKey, String serviceName) {
        String url = "https://tsapi.amap.com/v1/track/service/list";
        HttpPost httpPost = new HttpPost(url);
        Map<String,String> map = new HashMap<>();
        //高德Key
        //用户在高德地图官网申请Web服务API类型Key
        map.put("key",gaodeKey);
        System.out.println("==高德返回"+map);
        String result = null;
        try {
            result = HttpCurlUtil.sendGetHttp(url, map);
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println("==高德返回"+result);
        cn.hutool.json.JSONObject maps = JSONUtil.parseObj(result);
        String errCode = maps.get("errcode").toString();
        if("10000".equals(errCode)){
            String dataStr = maps.get("data").toString();
            cn.hutool.json.JSONObject dataResults = JSONUtil.parseObj(dataStr);
            String resultsStr = dataResults.get("results").toString();
            return resultsStr;
        }else{
            return "fail";
        }
    }