| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.HashSet; |
| | |
| | | List<String> strings2 = Arrays.asList(halfNames.split(",")); |
| | | model.addAttribute("halfNames",strings2); |
| | | model.addAttribute("halfName",strings2.get(0)); |
| | | }else { |
| | | model.addAttribute("halfNames", Collections.emptyList()); |
| | | model.addAttribute("halfName", ""); |
| | | } |
| | | // 显式传递运营商ID和是否可预约字段,确保回显正确 |
| | | model.addAttribute("operatorId", site.getOperatorId()); |
| | |
| | | |
| | | |
| | | String halfNames = site.getHalfName(); |
| | | ArrayList<String> strings2 = new ArrayList<>(); |
| | | String[] split = halfNames.split(","); |
| | | String halfName=null; |
| | | for (int i = 0; i < split.length; i++) { |
| | | if(i==0){ |
| | | halfName = split[0]; |
| | | }else { |
| | | strings2.add(split[i]); |
| | | } |
| | | if (StringUtils.isNotBlank(halfNames) && site.getIshalf().equals(1)) { |
| | | List<String> strings2 = Arrays.asList(halfNames.split(",")); |
| | | model.addAttribute("halfNames",strings2); |
| | | model.addAttribute("halfName",strings2.get(0)); |
| | | }else { |
| | | model.addAttribute("halfNames", Collections.emptyList()); |
| | | model.addAttribute("halfName", ""); |
| | | } |
| | | model.addAttribute("halfNames",strings2); |
| | | model.addAttribute("halfName",halfName); |
| | | |
| | | List<CityManager> accounts = cityManagerClient.getAccount(site.getCity()); |
| | | model.addAttribute("list",site); |
| | |
| | | map.put("name",site.getName()); |
| | | map.put("space_id",store.getId().toString()); |
| | | String s = HttpRequestUtil.postRequest |
| | | // ("https://port.daowepark.com/v7/user_api/general/addSpaceArea", map); |
| | | ("https://try.daowepark.com/v7/user_api/general/addSpaceArea", map); |
| | | ("https://port.daowepark.com/v7/user_api/general/addSpaceArea", map); |
| | | // ("https://try.daowepark.com/v7/user_api/general/addSpaceArea", map); |
| | | JSONObject jsonObject = JSONObject.parseObject(s); |
| | | JSONObject data = jsonObject.getJSONObject("data"); |
| | | String area_id = data.getString("area_id"); |
| | |
| | | // 保存价格数据 |
| | | if (site.getPriceDTOS() != null && !site.getPriceDTOS().isEmpty()) { |
| | | saveSitePriceDetails(site.getId(), site.getPriceDTOS()); |
| | | List<Site.PriceDTO> priceDTOS = site.getPriceDTOS(); |
| | | site.setAppointmentStartTime(priceDTOS.get(0).getStartTime()); |
| | | site.setAppointmentEndTime(priceDTOS.get(priceDTOS.size()-1).getEndTime()); |
| | | siteClient.addSite(site); |
| | | |
| | | } |
| | | |
| | | return ResultUtil.success("添加成功"); |
| | |
| | | sitePrice.setTargetAudience(detail.getTargetAudience()); |
| | | sitePrice.setFieldType(detail.getFieldType()); |
| | | sitePrice.setCashPrice(detail.getCashPrice() != null ? BigDecimal.valueOf(detail.getCashPrice()) : BigDecimal.ZERO); |
| | | sitePrice.setCoinPrice(detail.getCoinPrice() != null ? BigDecimal.valueOf(detail.getCoinPrice()) : BigDecimal.ZERO); |
| | | sitePrice.setCoinPrice(detail.getCoinPrice() != null ? detail.getCoinPrice() : 0); |
| | | sitePrice.setInsertTime(now); |
| | | sitePrice.setUpdateTime(now); |
| | | |
| | |
| | | // 先删除原有价格数据 |
| | | sitePriceService.remove(new QueryWrapper<TSitePrice>().eq("siteId", site.getId())); |
| | | saveSitePriceDetails(site.getId(), site.getPriceDTOS()); |
| | | List<Site.PriceDTO> priceDTOS = site.getPriceDTOS(); |
| | | site.setAppointmentStartTime(priceDTOS.get(0).getStartTime()); |
| | | site.setAppointmentEndTime(priceDTOS.get(priceDTOS.size()-1).getEndTime()); |
| | | siteClient.addSite(site); |
| | | |
| | | } |
| | | return ResultUtil.success(); |
| | | } |