44323
2023-10-16 d9f331e175611a68f00a50cab63ea35442a4b0e6
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopController.java
@@ -18,6 +18,7 @@
import com.dsh.guns.modular.system.model.*;
import com.dsh.guns.modular.system.service.*;
import com.dsh.guns.modular.system.util.GaoDeMapUtil;
import com.dsh.guns.modular.system.util.HttpRequestUtil;
import io.swagger.models.auth.In;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils;
@@ -29,10 +30,7 @@
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -106,7 +104,11 @@
//        if (!roleid.equals("1")){
            TOperator operator1 = tOperatorService.getOne(new QueryWrapper<TOperator>().eq("userId", UserExt.getUser().getId()));
            model.addAttribute("operator",operator1.getId());
            if (operator1!=null){
                model.addAttribute("operator",operator1.getId());
            }else {
                model.addAttribute("operator",0);
            }
//        }
        model.addAttribute("yysList",list1);
@@ -315,7 +317,7 @@
    @RequestMapping(value = "/add")
    @ResponseBody
    public Object list(TStore tStore,String time,String userName,String userPhone,String ids,Integer type,Integer yyId,String lat,String lon,String pCode1,String cCode1) {
    public Object list(TStore tStore,String time,String userName,String userPhone,String ids,Integer type,Integer yyId,String lat,String lon,String pCode1,String cCode1,String provinceCode,String cityCode) {
        try {
@@ -384,6 +386,15 @@
                tStore.setLat(lat);
            storeService.save(tStore);
            HashMap<String, String> map = new HashMap<>();
            map.put("sign","0DB011836143EEE2C2E072967C9F4E4B");
            map.put("space_id","");
            map.put("device_id",tStore.getIds()+"");
            map.put("region_id",tStore.getId()+"");
            // 添加门禁
            String s = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map);
            ArrayList<StoreConfig> storeConfigs = new ArrayList<>();
            for (int i = 1; i < 9; i++) {
@@ -472,6 +483,16 @@
            tStore.setLon(lon);
            tStore.setLat(lat);
            storeService.updateById(tStore);
            HashMap<String, String> map = new HashMap<>();
            map.put("sign","0DB011836143EEE2C2E072967C9F4E4B");
            map.put("space_id","");
            map.put("device_id",tStore.getIds());
            map.put("region_id",tStore.getId()+"");
            // 编辑门禁
            String s = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/editDevice/ids/82", map);
            JSONObject jsonObject = JSONObject.parseObject(s);
            JSONObject data = jsonObject.getJSONObject("data");
            String spaceId = data.getString("space_id");
            return new SuccessTip<>();
        }catch (Exception e){
            e.printStackTrace();