| | |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.common.core.utils.GaoDeMapUtil; |
| | | import com.ruoyi.common.core.utils.SnowflakeIdWorker; |
| | |
| | | import java.net.URLEncoder; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Paths; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | String area = frozenBuckleImportDTO.getArea(); |
| | | String address = frozenBuckleImportDTO.getReservationAddress(); |
| | | |
| | | String time = frozenBuckleImportDTO.getTime(); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | try{ |
| | | format.parse(time); |
| | | }catch (Exception e){ |
| | | throw new ServiceException("上门时间格式错误"); |
| | | } |
| | | |
| | | // 解析地址经纬度 |
| | | CityInfoVO cityInfoVO = GaoDeMapUtil.getAddressInfo(province + city + area + address).getDatas(); |
| | | if(Objects.isNull(cityInfoVO.getLongitude()) || Objects.isNull(cityInfoVO.getLatitude())){ |
| | | return R.fail("地址输入不正确"); |
| | | } |
| | | String areaCode = cityInfoVO.getCode(); |
| | | String provinceCode = areaCode.substring(0, 2) + "0000"; |
| | | String cityCode = areaCode.substring(0, 4) + "00"; |
| | |
| | | order.setServeId(recoveryServe.getId()); |
| | | order.setServePrice(recoveryServe.getDefaultPrice()); |
| | | }else { |
| | | return R.fail("回收服务不存在"); |
| | | return R.fail("服务信息不存在"); |
| | | } |
| | | RecoveryServePrice one = recoveryServePriceService.lambdaQuery().eq(RecoveryServePrice::getCity, order.getCityCode()).eq(RecoveryServePrice::getRecoveryServeId, order.getServeId()).eq(BaseEntity::getIsDelete, 0).one(); |
| | | if (one==null) { |