Commit a0048a45 authored by 周健威's avatar 周健威

修改代码

parent 7bcd7a7e
......@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.upyuns.platform.rs.datacenter.entity.RscpAreaImageTotal;
import com.upyuns.platform.rs.datacenter.entity.RscpAreaInfo;
import com.upyuns.platform.rs.datacenter.entity.RscpImageDataTotal;
......@@ -19,6 +20,8 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
import static com.github.wxiaoqi.security.common.util.process.ResultCode.PARAM_ILLEGAL_CODE;
@Service
public class RscpImageDataTotalBiz extends BaseBiz<RscpImageDataTotalMapper, RscpImageDataTotal> {
......@@ -30,6 +33,15 @@ public class RscpImageDataTotalBiz extends BaseBiz<RscpImageDataTotalMapper, Rsc
return mapper.queryDataList(dto);
}
public RscpImageDataTotal queryDataList(String id) {
List<RscpImageDataTotal> list2 = mapper.queryDataById(id);
if(list2.size() > 0) {
RscpImageDataTotal rscpImageDataTotal = list2.get(0);
return list2.get(0);
}
throw new BaseException("数据不存在", PARAM_ILLEGAL_CODE);
}
public List<RscpAreaImageTotal> queryDataAreaList(RscpImageDataTotalController.QueryDTO dto) {
List<RscpImageDataTotal> list = mapper.queryDataList(dto);
List<RscpAreaImageTotal> list2 = CollUtil.newArrayList();
......@@ -48,7 +60,9 @@ public class RscpImageDataTotalBiz extends BaseBiz<RscpImageDataTotalMapper, Rsc
// String param = StrUtil.format("MULTIPOLYGON((({} {} ,{} {} , {} {} ,#{rightTopLon} #{rightTopLat}, #{leftTopLon} #{leftTopLat})))");
return mapper.getBinNameByGId(dto.getLeftTopLon(), dto.getLeftTopLat(), dto.getLeftBottomLon(), dto.getLeftBottomLat(), dto.getRightBottomLon(), dto.getRightBottomLat(), dto.getRightTopLon(), dto.getRightTopLat());
}
public String geoJsonByRange(String rangeMeta){
return mapper.geoJsonByRange(rangeMeta);
}
public void aaa(ImageInputVO vo) {
ImageTotalInputDTO dto = BeanUtil.toBean(vo, ImageTotalInputDTO.class);
......
......@@ -7,16 +7,16 @@ import org.springframework.scheduling.annotation.Scheduled;
import java.time.LocalDateTime;
@Configuration //1.主要用于标记配置类,兼备Component的效果。
@EnableScheduling // 2.开启定时任务
@Slf4j
//@Configuration //1.主要用于标记配置类,兼备Component的效果。
//@EnableScheduling // 2.开启定时任务
//@Slf4j
public class SaticScheduleTask {
//3.添加定时任务
@Scheduled(cron = "0/5 * * * * ?")
//或直接指定时间间隔,例如:5秒
//@Scheduled(fixedRate=5000)
public void configureTasks() {
//查询是否有线上并且代发货的订单
//log.info("执行静态定时任务时间: " + LocalDateTime.now());
}
// //3.添加定时任务
// @Scheduled(cron = "0/5 * * * * ?")
// //或直接指定时间间隔,例如:5秒
// //@Scheduled(fixedRate=5000)
// public void configureTasks() {
// //查询是否有线上并且代发货的订单
// //log.info("执行静态定时任务时间: " + LocalDateTime.now());
// }
}
\ No newline at end of file
......@@ -4,6 +4,8 @@ import com.upyuns.platform.rs.datacenter.entity.RscpAreaInfo;
import com.upyuns.platform.rs.datacenter.entity.RscpImageDataTotal;
import com.upyuns.platform.rs.datacenter.rest.RscpImageDataTotalController;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.RequestParam;
import tk.mybatis.mapper.common.Mapper;
import java.math.BigDecimal;
......@@ -14,6 +16,8 @@ public interface RscpImageDataTotalMapper extends Mapper<RscpImageDataTotal> {
public List<RscpImageDataTotal> queryDataList(RscpImageDataTotalController.QueryDTO dto);
public List<RscpImageDataTotal> queryDataById(@Param("id")String id );
// //左上角经度
// private BigDecimal leftTopLon;
......@@ -34,6 +38,8 @@ public interface RscpImageDataTotalMapper extends Mapper<RscpImageDataTotal> {
// private BigDecimal rightTopLon;
// //右上角维度
// private BigDecimal rightTopLat;
@Select("select st_asgeojson(#{rangeMeta},16,0)")
String geoJsonByRange(@Param("rangeMeta")String rangeMeta);
@Select("SELECT st_GeomFromText('MULTIPOLYGON(((${leftTopLon} ${leftTopLat} ,${leftBottomLon} ${leftBottomLat} , ${rightBottomLon} ${rightBottomLat} ,${rightTopLon} ${rightTopLat}, ${leftTopLon} ${leftTopLat})))',4326)")
String getBinNameByGId(BigDecimal leftTopLon, BigDecimal leftTopLat, BigDecimal leftBottomLon, BigDecimal leftBottomLat, BigDecimal rightBottomLon, BigDecimal rightBottomLat, BigDecimal rightTopLon, BigDecimal rightTopLat);
......
......@@ -16,9 +16,11 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.Map;
@RestController
@Slf4j
......@@ -27,6 +29,8 @@ public class GtdataController extends CommonBaseController {
@Autowired
GtDataRestClient gtDataRestClient;
public static final String uploadP = "/rscloudmart/bg/upload/";
@RequestMapping(value = "/app/unauth/image/**", method = RequestMethod.GET)
@IgnoreUserToken
public void queryAreaInfoByAreaId() throws Exception {
......@@ -40,6 +44,19 @@ public class GtdataController extends CommonBaseController {
return;
}
@RequestMapping(value = "/download/**", method = RequestMethod.GET)
public ObjectRestResponse userDownload() throws Exception {
return download();
}
@RequestMapping(value = "/app/unauth/download/**", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse download() throws Exception {
String url = request.getRequestURI();
String fileName = url.substring(url.lastIndexOf("/web/gtdata/app/unauth/download/")+32);
return ObjectRestResponse.succ(gtDataRestClient.openUrl(uploadP+ fileName));
}
public void downloadVideoById(String fileName, String filePath, HttpServletResponse response) throws Exception {
log.info("下载请求start>>");
try {
......
......@@ -109,11 +109,13 @@ public class RscpImageDataTotalController extends BaseController<RscpImageDataTo
@RequestMapping(value = "/app/unauth/detailById", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse<List<RscpImageDataTotal>> detailById(String id){
List<RscpImageDataTotal> list2 = baseBiz.selectByAttrs(RscpImageDataTotal::getId, CollUtil.newArrayList(id));
if(list2.size() > 0) {
return ObjectRestResponse.succ(list2.get(0));
}
throw new BaseException("数据不存在", PARAM_ILLEGAL_CODE);
// List<RscpImageDataTotal> list2 = baseBiz.selectByAttrs(RscpImageDataTotal::getId, CollUtil.newArrayList(id));
// if(list2.size() > 0) {
// RscpImageDataTotal rscpImageDataTotal = list2.get(0);
// rscpImageDataTotal.setRange(baseBiz.geoJsonByRange(rscpImageDataTotal.getRange()));
// return ObjectRestResponse.succ(list2.get(0));
// }
return ObjectRestResponse.succ(baseBiz.queryDataList(id));
}
@RequestMapping(value = "/app/unauth/Fegin/queryByIds", method = RequestMethod.GET)
......
......@@ -96,6 +96,11 @@
offset 0;
</select>
<select id="queryDataById" resultMap="BaseResultMap">
select st_asgeojson(range,16,0) as range, *
from rscp_image_data_total
where id = #{id}
</select>
<sql id="geomSelectSql" >
from rscp_image_data_total
......
package com.upyuns.platform.rs.website.dto.order;
import lombok.Data;
@Data
public class OldeliveryJson {
String name;
String path;
}
......@@ -22,6 +22,12 @@ import lombok.Data;
public class OrderInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 配送方式:1、线上配送,2、快递配送
*/
public static final int SENDTYPE_OL = 1;
public static final int SENDTYPE_DL = 2;
/**
*
*/
......@@ -58,6 +64,10 @@ public class OrderInfo implements Serializable {
@ApiModelProperty(value = " 订单状态:0、定制订单无价格 1--创建订单,2--待付款,3--已支付,4--已发货, 5--已收货, 6、已完成 -1、删除,-2、取消, -3 退款")
private Integer status;
public void setStatus(Integer status) {
this.status = status;
}
/**
* 发货状态0待发货,1已发货,2收货,3退货,
*/
......@@ -152,6 +162,10 @@ public class OrderInfo implements Serializable {
@ApiModelProperty(value = "配送方式:1、线上配送,2、快递配送")
private Integer sendType;
public void setSendType(Integer sendType) {
this.sendType = sendType;
}
/**
* 收货人姓名
*/
......@@ -242,6 +256,11 @@ public class OrderInfo implements Serializable {
*/
String auditReason;
/**
* 线上交付json
*/
String oldeliveryJson;
@Transient
private List<OrderItem> orderItemList;
......
package com.upyuns.platform.rs.website.job;
import com.upyuns.platform.rs.website.biz.OrderInfoBiz;
import com.upyuns.platform.rs.website.entity.OrderInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import java.util.List;
import static com.upyuns.platform.rs.website.entity.OrderInfo.SENDTYPE_OL;
import static com.upyuns.platform.rs.website.type.OrderStatusEnum.ORDER_PAID;
@Configuration //1.主要用于标记配置类,兼备Component的效果。
@EnableScheduling // 2.开启定时任务
@Slf4j
public class WebsiteScheduleTask {
@Autowired
OrderInfoBiz orderInfoBiz;
//3.添加定时任务
@Scheduled(cron = "0/5 * * * * ?")
//或直接指定时间间隔,例如:5秒
//@Scheduled(fixedRate=5000)
public void configureTasks() {
//查询是否有线上并且代发货的订单
//log.info("执行静态定时任务时间: " + LocalDateTime.now());
List<OrderInfo> list = orderInfoBiz.selectByWeekend(w -> {
w.andEqualTo(OrderInfo::getStatus, ORDER_PAID.getType());
w.andEqualTo(OrderInfo::getSendType, SENDTYPE_OL);
return w;
});
// list.forEach(orderInfo -> {
// if(orderInfo.getType().)
// });
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment