liujie
2023-10-20 1e790795f4e2c365f604ecc0fc1b290e3ff3c35f
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGoodsController.java
@@ -158,7 +158,7 @@
                List<StoreVos> provinces = pointMercharsClient.getProvinces(id);
                model.addAttribute("city",provinces);
            }
            if (infoOneVo.getUseScope() == 2){
            if (infoOneVo.getUseScope() == 3){
                List<StoreVos> storeVos = pointMercharsClient.getStoreList(id);
                model.addAttribute("store",storeVos);
            }
@@ -483,7 +483,6 @@
        pointsMerchandise.setCoursePackageConfigId(coursePackageConfigId);
        // 代替storeId
        pointsMerchandise.setShelves(1);
        Integer id = pointMercharsClient.add(pointsMerchandise);
        if(typeAll!=2){
            if(useScope==2){
                ArrayList<Map<String,String>> objects = new ArrayList<>();
@@ -495,11 +494,25 @@
                    map.put("pCode",pCity.getCode());
                    map.put("cName",tCity.getName());
                    map.put("cCode",tCity.getCode());
                    map.put("id",id.toString());
                    map.put("id","0");
                    objects.add(map);
                }
                pointMercharsClient.addCitys(objects);
            }else if(useScope==3){
                Integer oid=null;
                String[] split = storeIds.split(",");
                for (int i = 0; i < split.length; i++) {
                    if(i==0){
                        Integer operatorId = storeService.getById(split[0]).getOperatorId();
                        oid=operatorId;
                    }
                    Integer operatorId = storeService.getById(split[i]).getOperatorId();
                    if(oid!=operatorId){
                        return "5003";
                    }
                }
                Integer id = pointMercharsClient.add(pointsMerchandise);
                String pam = id+"_"+storeIds;
                // 添加多个城市 门店
                try{
@@ -571,13 +584,21 @@
    public String tCityUpdate(@PathVariable Integer id, Model model) {
        System.out.println("id:"+id);
        PointMercharsVo pointMercharsVo = pointMercharsClient.queryPointMerchaseDetailOfId(id);
        System.out.println("pointMercharsVo:"+pointMercharsVo);
        String[] split = pointMercharsVo.getPics().split(",");
        List<String> list = Arrays.asList(split);
        StringBuilder concatenatedString = new StringBuilder();
        for (String element : split) {
            concatenatedString.append(element).append(",");
        }
        // 去除末尾的逗号
        if (concatenatedString.length() > 0) {
            concatenatedString.setLength(concatenatedString.length() - 1);
        }
        String result = concatenatedString.toString();
        model.addAttribute("id",id);
        model.addAttribute("item",pointMercharsVo);
        model.addAttribute("pictures",list);
        System.out.println(list);
        model.addAttribute("pictures",result);
        return PREFIX + "TGoods_edit.html";
    }