Commit 97ad9136 authored by 周健威's avatar 周健威

修改代码

parent 3c81ac98
package com.github.wxiaoqi.security.common.biz;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.msg.TableResultResponse;
import com.github.wxiaoqi.security.common.util.EntityUtils;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.util.ReflectionUtils;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import org.springframework.beans.factory.annotation.Autowired;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.weekend.Fn;
import tk.mybatis.mapper.weekend.WeekendSqls;
import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.util.Collection;
import java.util.List;
......@@ -188,6 +194,23 @@ public abstract class BaseBiz<M extends Mapper<T>, T> {
return new TableResultResponse<T>(result.getTotal(), list);
}
public PageDataVO<T> selectByQueryPage(Query query) {
Class<T> clazz = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[1];
Example example = new Example(clazz);
if(query.entrySet().size()>0) {
Example.Criteria criteria = example.createCriteria();
for (Map.Entry<String, Object> entry : query.entrySet()) {
criteria.andLike(entry.getKey(), "%" + entry.getValue().toString() + "%");
}
}
Field field = ReflectUtil.getField(clazz, "updTime");
if(null != field) {
example.setOrderByClause("upd_time desc");
}
return PageDataVO.pageInfo(query, ()-> mapper.selectByExample(example));
}
}
......@@ -6,6 +6,7 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.msg.TableResultResponse;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.util.ReflectionUtils;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
......@@ -82,6 +83,15 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
return baseBiz.selectByQuery(query);
}
@ApiOperation("查询分页-ObjectRestResponse")
@RequestMapping(value = "/pages",method = RequestMethod.GET)
@ResponseBody
public ObjectRestResponse<PageDataVO<Entity>> pages(@RequestParam Map<String, Object> params){
//查询列表数据
Query query = new Query(params);
return ObjectRestResponse.succ(baseBiz.selectByQueryPage(query));
}
@ApiOperation("根据参数查询,等于")
@RequestMapping(value = "/entityList",method = RequestMethod.GET)
@ResponseBody
......
......@@ -115,7 +115,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
jsonObject.put("userId", appUserLogin.getId());
jsonObject.put("integralRuleCode", "CRETIFICATION");
jsonObject.put("channelId", idInformation.getId());
mqSenderFeign.sendMessage(RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
//mqSenderFeign.sendMessage(RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
}
try {
Thread.sleep(3000);
......@@ -125,7 +125,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
jsonObject.put("userId", appUserLogin.getId());
jsonObject.put("integralRuleCode", "REGISTER");
jsonObject.put("channelId", appUserLogin.getId());
mqSenderFeign.sendMessage(RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
//mqSenderFeign.sendMessage(RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
}
}
......
......@@ -15,32 +15,32 @@ import static com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant.*;
* @author zhoujw
* @date 2019/7/15
*/
@Configuration
public class RabbitAdminConfig extends RabbitCommonConfig {
public static final String ORDER_WATER_QUEUE = "order.water.queue";
public static final String ORDER_FINLISH_USER_RE_QUEUE = "order.cancel.userRe.queue";
//钱包50入账
public static final String WALLET_ADD_QUEUE = "wallet.add.queue";
//支付完成后永久绑定关系
public static final String ORDER_RELATION_QUEUE = "order.relation.queue";
static {
myQueue = new ArrayList<BindDTO>() {{
//支付完成后永久绑定关系
add(new BindDTO(ORDER_RELATION_QUEUE, ORDER_TOPIC, KEY_ORDER_PAY));
//拥金计算
add(new BindDTO(ORDER_WATER_QUEUE, ORDER_TOPIC, KEY_ORDER_PAY));
add(new BindDTO(ORDER_WATER_QUEUE, ORDER_TOPIC, KEY_ORDER_FINLISH));
add(new BindDTO(ORDER_WATER_QUEUE, ORDER_TOPIC, KEY_ORDER_CANCEL));
add(new BindDTO(ORDER_WATER_QUEUE, ORDER_TOPIC, KEY_ORDER_PART_DEPOSIT));
add(new BindDTO(ORDER_FINLISH_USER_RE_QUEUE, ORDER_TOPIC, KEY_ORDER_FINLISH));
//钱包
add(new BindDTO(WALLET_ADD_QUEUE, ADMIN_TOPIC, KEY_WALLET_ADD));
}};
}
}
//@Configuration
//public class RabbitAdminConfig extends RabbitCommonConfig {
//
// public static final String ORDER_WATER_QUEUE = "order.water.queue";
//
// public static final String ORDER_FINLISH_USER_RE_QUEUE = "order.cancel.userRe.queue";
// //钱包50入账
// public static final String WALLET_ADD_QUEUE = "wallet.add.queue";
//
// //支付完成后永久绑定关系
// public static final String ORDER_RELATION_QUEUE = "order.relation.queue";
//
//
// static {
// myQueue = new ArrayList<BindDTO>() {{
// //支付完成后永久绑定关系
// add(new BindDTO(ORDER_RELATION_QUEUE, ORDER_TOPIC, KEY_ORDER_PAY));
// //拥金计算
// add(new BindDTO(ORDER_WATER_QUEUE, ORDER_TOPIC, KEY_ORDER_PAY));
// add(new BindDTO(ORDER_WATER_QUEUE, ORDER_TOPIC, KEY_ORDER_FINLISH));
// add(new BindDTO(ORDER_WATER_QUEUE, ORDER_TOPIC, KEY_ORDER_CANCEL));
// add(new BindDTO(ORDER_WATER_QUEUE, ORDER_TOPIC, KEY_ORDER_PART_DEPOSIT));
// add(new BindDTO(ORDER_FINLISH_USER_RE_QUEUE, ORDER_TOPIC, KEY_ORDER_FINLISH));
// //钱包
// add(new BindDTO(WALLET_ADD_QUEUE, ADMIN_TOPIC, KEY_WALLET_ADD));
// }};
// }
//}
package com.github.wxiaoqi.security.admin.rest;
import com.github.wxiaoqi.security.admin.vo.InviteMemberVo;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil;
import com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.admin.biz.AppUserRelationBiz;
import com.github.wxiaoqi.security.admin.entity.AppUserRelation;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.HashSet;
@Slf4j
@RestController
@RequestMapping("relation")
public class AppUserRelationController extends BaseController<AppUserRelationBiz,AppUserRelation> {
@Autowired
private UserAuthUtil userAuthUtil;
@Autowired
private UserAuthConfig userAuthConfig;
@RequestMapping(value = "app/unauth/small/share",method = RequestMethod.GET)
@ApiModelProperty("小程序分享绑定")
public ObjectRestResponse share(
@RequestParam(value = "userid",defaultValue = "0")Integer userid,
@RequestParam(value = "pid",defaultValue = "0")Integer pid,
@RequestParam(value = "platform_userid",defaultValue = "0")Integer platform_userid
){
return baseBiz.shareParentByUserId(userid,pid,platform_userid);
}
@RequestMapping(value = "/bind",method = RequestMethod.POST)
@ApiModelProperty("app分享绑定")
public ObjectRestResponse bind(
@RequestParam(value = "code",defaultValue = "")String code,
HttpServletRequest request){
try {
//屏蔽分享绑定
/*Integer userid = Integer.parseInt(userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request)).getId());
return baseBiz.appBindRelation(userid,code);*/
return ObjectRestResponse.succ();
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new BaseException(e);
}
}
@ApiOperation("查询邀请的成员")
@GetMapping("/pages")
public ObjectRestResponse<InviteMemberVo> findInviteMemberByActivitState(@RequestParam(value = "state",required = false) Integer state,
@RequestParam("page") Integer page,
@RequestParam("limit") Integer limit,
HttpServletRequest request){
try {
IJWTInfo infoFromToken = userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request));
InviteMemberVo inviteMemberVo = baseBiz.findInviteMemberByActivitState(Integer.valueOf(infoFromToken.getId()),state,page,limit);
return ObjectRestResponse.succ(inviteMemberVo);
} catch (Exception e) {
throw new BaseException(e);
}
}
}
\ No newline at end of file
//package com.github.wxiaoqi.security.admin.rest;
//
//import com.github.wxiaoqi.security.admin.vo.InviteMemberVo;
//import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
//import com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil;
//import com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo;
//import com.github.wxiaoqi.security.common.exception.BaseException;
//import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
//import com.github.wxiaoqi.security.common.rest.BaseController;
//import com.github.wxiaoqi.security.admin.biz.AppUserRelationBiz;
//import com.github.wxiaoqi.security.admin.entity.AppUserRelation;
//import com.github.wxiaoqi.security.common.util.process.ResultCode;
//import io.swagger.annotations.ApiModelProperty;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import javax.servlet.http.HttpServletRequest;
//import java.util.HashSet;
//
//@Slf4j
//@RestController
//@RequestMapping("relation")
//public class AppUserRelationController extends BaseController<AppUserRelationBiz,AppUserRelation> {
//
// @Autowired
// private UserAuthUtil userAuthUtil;
//
// @Autowired
// private UserAuthConfig userAuthConfig;
//
//
// @RequestMapping(value = "app/unauth/small/share",method = RequestMethod.GET)
// @ApiModelProperty("小程序分享绑定")
// public ObjectRestResponse share(
// @RequestParam(value = "userid",defaultValue = "0")Integer userid,
// @RequestParam(value = "pid",defaultValue = "0")Integer pid,
// @RequestParam(value = "platform_userid",defaultValue = "0")Integer platform_userid
// ){
// return baseBiz.shareParentByUserId(userid,pid,platform_userid);
// }
//
// @RequestMapping(value = "/bind",method = RequestMethod.POST)
// @ApiModelProperty("app分享绑定")
// public ObjectRestResponse bind(
// @RequestParam(value = "code",defaultValue = "")String code,
// HttpServletRequest request){
// try {
// //屏蔽分享绑定
// /*Integer userid = Integer.parseInt(userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request)).getId());
// return baseBiz.appBindRelation(userid,code);*/
// return ObjectRestResponse.succ();
// } catch (Exception e) {
// log.error(e.getMessage(), e);
// throw new BaseException(e);
// }
// }
//
// @ApiOperation("查询邀请的成员")
// @GetMapping("/pages")
// public ObjectRestResponse<InviteMemberVo> findInviteMemberByActivitState(@RequestParam(value = "state",required = false) Integer state,
// @RequestParam("page") Integer page,
// @RequestParam("limit") Integer limit,
// HttpServletRequest request){
// try {
// IJWTInfo infoFromToken = userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request));
// InviteMemberVo inviteMemberVo = baseBiz.findInviteMemberByActivitState(Integer.valueOf(infoFromToken.getId()),state,page,limit);
// return ObjectRestResponse.succ(inviteMemberVo);
// } catch (Exception e) {
// throw new BaseException(e);
// }
// }
//
//}
\ No newline at end of file
......@@ -1096,8 +1096,8 @@ public class AppPermissionService {
JSONObject jsonObject = new JSONObject();
jsonObject.put("userId", userid);
jsonObject.put("integralRuleCode", "REGISTER");
log.info("注册成功获取积分:发送消息 exchange = {}, routingKey = {}, json = {}", RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
mqSenderFeign.sendMessage(RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
//log.info("注册成功获取积分:发送消息 exchange = {}, routingKey = {}, json = {}", RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
//mqSenderFeign.sendMessage(RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
sendQueue(username, password, headimgurl, nickname, null, null, null, 0, code, activityCode, userid,RegisterQueueDTO.SIGN_NEW);
log.info("注册:发消息队列: " + userid+"---time===="+System.currentTimeMillis()/1000L);
return JsonResultUtil.createSuccessResultWithObj(data);
......
......@@ -20,5 +20,11 @@
<artifactId>postgresql</artifactId>
<version>9.4.1212</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.6</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -4,6 +4,9 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
......@@ -17,6 +20,8 @@ public class RscpAreaImageTotal implements java.io.Serializable {
/* This code was generated by TableGo tools, mark 1 begin. */
/** id */
@Id
@GeneratedValue(generator = "JDBC")
@ApiModelProperty(value = "")
private String id;
......
......@@ -4,6 +4,9 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
......@@ -17,6 +20,8 @@ public class RscpImageDataInputFail implements java.io.Serializable {
/* This code was generated by TableGo tools, mark 1 begin. */
/** 标识id */
@Id
@GeneratedValue(generator = "JDBC")
@ApiModelProperty(value = "标识id")
private Long id;
......
......@@ -3,7 +3,11 @@ package com.upyuns.platform.rs.datacenter.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import tk.mybatis.mapper.annotation.ColumnType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.sql.Timestamp;
......@@ -18,6 +22,8 @@ public class RscpImageDataTotal implements java.io.Serializable {
/* This code was generated by TableGo tools, mark 1 begin. */
/** 标识id */
@Id
@GeneratedValue(generator = "JDBC")
@ApiModelProperty(value = "标识id")
private Long id;
......@@ -47,15 +53,18 @@ public class RscpImageDataTotal implements java.io.Serializable {
/** 分辨率[数组] */
@ApiModelProperty(value = "分辨率[数组]")
private String imageResolution;
@ColumnType(typeHandler = com.upyuns.platform.rs.datacenter.mybatis.ArrayTypeHandler.class)
private BigDecimal[] imageResolution;
/** 光谱 */
@ApiModelProperty(value = "光谱")
private String imageSpectrumType;
@ColumnType(typeHandler = com.upyuns.platform.rs.datacenter.mybatis.ArrayTypeHandler.class)
private String[] imageSpectrumType;
/** 光谱名称 */
@ApiModelProperty(value = "光谱名称")
private String imageSpectrumTypeDisplay;
@ColumnType(typeHandler = com.upyuns.platform.rs.datacenter.mybatis.ArrayTypeHandler.class)
private String[] imageSpectrumTypeDisplay;
/** 行列号 */
@ApiModelProperty(value = "行列号")
......@@ -147,7 +156,8 @@ public class RscpImageDataTotal implements java.io.Serializable {
/** 包含那几个文件名称[数组] */
@ApiModelProperty(value = "包含那几个文件名称[数组]")
private String files;
@ColumnType(typeHandler = com.upyuns.platform.rs.datacenter.mybatis.ArrayTypeHandler.class)
private String[] files;
/** wms服务地址 */
@ApiModelProperty(value = "wms服务地址")
......
......@@ -4,6 +4,9 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Data
......@@ -20,6 +23,8 @@ public class RscpImageInputLog implements java.io.Serializable {
/* This code was generated by TableGo tools, mark 1 begin. */
/** id */
@Id
@GeneratedValue(generator = "JDBC")
@ApiModelProperty(value = "")
private Long id;
......
......@@ -4,6 +4,9 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.sql.Timestamp;
......@@ -18,6 +21,8 @@ public class RscpImagePrice implements java.io.Serializable {
/* This code was generated by TableGo tools, mark 1 begin. */
/** 标识 */
@Id
@GeneratedValue(generator = "JDBC")
@ApiModelProperty(value = "标识")
private String id;
......
......@@ -4,6 +4,9 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Data
......@@ -16,6 +19,8 @@ public class RscpResolution implements java.io.Serializable {
/* This code was generated by TableGo tools, mark 1 begin. */
/** id */
@Id
@GeneratedValue(generator = "JDBC")
@ApiModelProperty(value = "")
private String id;
......
package com.upyuns.platform.rs.datacenter.mybatis;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.TypeException;
import java.math.BigDecimal;
import java.sql.*;
public class ArrayTypeHandler extends BaseTypeHandler<Object[]> {
private static final String TYPE_NAME_VARCHAR = "varchar";
private static final String TYPE_NAME_INTEGER = "integer";
private static final String TYPE_NAME_BOOLEAN = "boolean";
private static final String TYPE_NAME_NUMERIC = "numeric";
@Override
public void setNonNullParameter(PreparedStatement preparedStatement, int i, Object[] objects, JdbcType jdbcType) throws SQLException {
String typeName = null;
if (objects instanceof Integer[]) {
typeName = TYPE_NAME_INTEGER;
} else if (objects instanceof String[]) {
typeName = TYPE_NAME_VARCHAR;
} else if (objects instanceof Boolean[]) {
typeName = TYPE_NAME_BOOLEAN;
} else if (objects instanceof Double[] || objects instanceof BigDecimal[]) {
typeName = TYPE_NAME_NUMERIC;
}
if (typeName == null) {
throw new TypeException("ArrayTypeHandler parameter typeName error, your type is " + objects.getClass().getName());
}
// 这3行是关键的代码,创建Array,然后ps.setArray(i, array)就可以了
Connection conn = preparedStatement.getConnection();
Array array = conn.createArrayOf(typeName, objects);
preparedStatement.setArray(i, array);
}
@Override
public Object[] getNullableResult(ResultSet resultSet, String s) throws SQLException {
return getArray(resultSet.getArray(s));
}
@Override
public Object[] getNullableResult(ResultSet resultSet, int i) throws SQLException {
return getArray(resultSet.getArray(i));
}
@Override
public Object[] getNullableResult(CallableStatement callableStatement, int i) throws SQLException {
return getArray(callableStatement.getArray(i));
}
private Object[] getArray(Array array) {
if (array == null) {
return null;
}
try {
return (Object[]) array.getArray();
} catch (Exception e) {
}
return null;
}
}
\ No newline at end of file
package com.upyuns.platform.rs.datacenter.pojo;
import com.upyuns.platform.rs.datacenter.entity.RscpImageDataTotal;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ImageTotalInputDTO extends RscpImageDataTotal {
//左上角经度
private BigDecimal leftTopLon;
//左上角维度
private BigDecimal leftTopLat;
//左下角经度
private BigDecimal leftBottomLon;
//左下角维度
private BigDecimal leftBottomLat;
//右下角经度
private BigDecimal rightBottomLon;
//右下角维度
private BigDecimal rightBottomLat;
//右上角经度
private BigDecimal rightTopLon;
//右上角维度
private BigDecimal rightTopLat;
}
......@@ -3,13 +3,16 @@ package com.upyuns.platform.rs.datacenter.biz;
import cn.hutool.core.bean.BeanUtil;
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.upyuns.platform.rs.datacenter.entity.RscpAreaImageTotal;
import com.upyuns.platform.rs.datacenter.entity.RscpImageDataTotal;
import com.upyuns.platform.rs.datacenter.mapper.RscpImageDataTotalMapper;
import com.upyuns.platform.rs.datacenter.pojo.ImageTotalInputDTO;
import com.upyuns.platform.rs.datacenter.rest.RscpImageDataTotalController;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
@Service
......@@ -32,5 +35,9 @@ public class RscpImageDataTotalBiz extends BaseBiz<RscpImageDataTotalMapper, Rsc
return list2;
}
public String getBinNameByGId(ImageTotalInputDTO dto){
// 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());
}
}
......@@ -51,7 +51,8 @@ public class WebConfiguration implements WebMvcConfigurer {
private ArrayList<String> getIncludePathPatterns() {
ArrayList<String> list = new ArrayList<>();
String[] urls = {
"/web/**",
"/bg/**",
};
Collections.addAll(list, urls);
return list;
......
......@@ -2,8 +2,10 @@ package com.upyuns.platform.rs.datacenter.mapper;
import com.upyuns.platform.rs.datacenter.entity.RscpImageDataTotal;
import com.upyuns.platform.rs.datacenter.rest.RscpImageDataTotalController;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;
import java.math.BigDecimal;
import java.util.List;
import java.util.Set;
......@@ -11,4 +13,28 @@ public interface RscpImageDataTotalMapper extends Mapper<RscpImageDataTotal> {
public List<RscpImageDataTotal> queryDataList(RscpImageDataTotalController.QueryDTO dto);
// //左上角经度
// private BigDecimal leftTopLon;
// //左上角维度
// private BigDecimal leftTopLat;
//
// //左下角经度
// private BigDecimal leftBottomLon;
// //左下角维度
// private BigDecimal leftBottomLat;
//
// //右下角经度
// private BigDecimal rightBottomLon;
// //右下角维度
// private BigDecimal rightBottomLat;
//
// //右上角经度
// private BigDecimal rightTopLon;
// //右上角维度
// private BigDecimal rightTopLat;
@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);
}
\ No newline at end of file
package com.upyuns.platform.rs.datacenter.mqhandler;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.json.JSONUtil;
import com.rabbitmq.client.Channel;
import com.upyuns.platform.rs.datacenter.biz.RscpImageDataTotalBiz;
......@@ -46,10 +47,11 @@ public class ImageInputLogMQHandler {
String messageId = message.getMessageProperties().getMessageId();
String msg = new String(message.getBody(), "UTF-8");
ImageInputVO ii = JSONUtil.toBean(msg, ImageInputVO.class);
rscpImageInputLogBiz.insertSelective(new RscpImageInputLog(){{
RscpImageInputLog insertLog = new RscpImageInputLog(){{
setContextJson(JSONUtil.toJsonStr(ii));
setStatus(STATU_ING);
}});
}};
rscpImageInputLogBiz.insertSelective(insertLog);
executorService.shutdown();
Long deliveryTag = (Long) headers.get(AmqpHeaders.DELIVERY_TAG);
// 手动签收
......@@ -58,9 +60,18 @@ public class ImageInputLogMQHandler {
executorService2.execute(() -> {
try {
//查询数据是否存在
rscpImageDataTotalBiz.selectCount(new RscpImageDataTotal(){{
Long count = rscpImageDataTotalBiz.selectCount(new RscpImageDataTotal(){{
setName(ii.getName());
}});
// ImageTotalInputDTO imageTotalInputDTO = BeanUtil.toBean(ii, ImageTotalInputDTO.class);
// //生成几何范围
if(count > 0L) {
//更新
}
}catch (Exception e) {
log.error(e.getMessage(), e);
throw e;
......
......@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
......@@ -20,10 +21,13 @@ import com.upyuns.platform.rs.datacenter.entity.RscpAreaImageTotal;
import com.upyuns.platform.rs.datacenter.entity.RscpImageDataTotal;
import com.upyuns.platform.rs.datacenter.entity.RscpImagePrice;
import com.upyuns.platform.rs.datacenter.pojo.ImageDataVO;
import com.upyuns.platform.rs.datacenter.pojo.ImageTotalInputDTO;
import com.upyuns.platform.rs.datacenter.vo.ImageInputVO;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.*;
import sun.nio.cs.ext.Big5;
......@@ -50,6 +54,16 @@ public class RscpImageDataTotalController extends BaseController<RscpImageDataTo
return ObjectRestResponse.succ(baseBiz.selectByQuery(new Query(pageParam)));
}
@RequestMapping(value = "/app/unauth/aaa", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse unauthAaaa(PageParam pageParam) {
ImageInputVO vo = JSONUtil.toBean("{\"rightTopLon\":87.33106598951404,\"leftBottomLon\":87.26891697286784,\"imageCloudage\":0.18,\"imageSensorType\":\"micro\",\"imageWidthInPixels\":5001,\"imageSpectrumTypeDisplay\":\"{全色,多光谱}\",\"imageSatelliteTypeDisplay\":\"newsat8\",\"supplier\":\"Satellogic\",\"imageSensorId\":\"micro\",\"imageProductTime\":\"2020-09-14 04:42:05\",\"leftTopLat\":44.022589860423246,\"imageResolution\":[1,1],\"rightBottomLon\":87.33106598951404,\"imageStartTime\":\"2020-09-14 04:42:05\",\"imageCenterTime\":\"2020-09-14 04:42:05\",\"imageProjection\":\"WGS-84\",\"imageFilePath\":\"/users/rscloudmart/data/sateLLogic/20201220/20200914_044205_SN8_L1_Changji-China\",\"imageSpectrumType\":\"{QS,DGP}\",\"imageSatelliteType\":\"newsat8\",\"imageSceneId\":\"newsat8_micro_L1_radiance_dca17df4-754d-4f02-ac65-3de4bfc66254_0_11_0\",\"imageCenterPointLon\":87.29999148119094,\"imageTakeTime\":\"2020-09-14 04:42:05\",\"leftTopLon\":87.26891697286784,\"imageEndTime\":\"2020-09-14 04:42:05\",\"rightTopLat\":44.022589860423246,\"leftBottomLat\":43.9774001602467,\"name\":\"20200914_044205_SN8_L1_Changji-China\",\"thumbnailPath\":\"/users/rscloudmart/thumbnail/data/sateLLogic/20201220/20200914_044205_SN8_L1_Changji-China\",\"imageCenterPointLat\":43.99999501033497,\"files\":[\"/20200914_044205_SN8_L1_Metadata.xml\",\"/20200914_044205_SN8_L1_RGB_Changji-China_showcase_Quicklook_800_800.png\",\"/20200914_044205_SN8_L1_RGB_Changji-China_showcase_Quicklook_800_800.jpeg\",\"/20200914_044205_SN8_L1_RGB_Changji-China_showcase_Quicklook_205_205.jpeg\",\"/20200914_044205_SN8_L1_RGB_Changji-China_showcase_Quicklook_98_98.jpeg\"],\"imageProductFormat\":\"TIFF\",\"imageHeightInPixels\":\"5001\",\"rightBottomLat\":43.9774001602467}", ImageInputVO.class);
//ImageTotalInputDTO dto = BeanUtil.toBean(vo, ImageTotalInputDTO.class);
RscpImageDataTotal rscpImageDataTotal = BeanUtil.toBean(vo, RscpImageDataTotal.class);
// rscpImageDataTotal.setImageResolution(rscpImageDataTotal.getImageResolution().replace("[", "{").replace("]", "}"));
return ObjectRestResponse.succ(baseBiz.insertSelectiveRe(rscpImageDataTotal));
}
// resolution
// 分辨率
// spectrum
......
package com.upyuns.platform.rs.datacenter.rest.backstage;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.vo.PageParam;
import com.upyuns.platform.rs.datacenter.biz.RscpAreaImageTotalBiz;
import com.upyuns.platform.rs.datacenter.biz.RscpImageDataTotalBiz;
import com.upyuns.platform.rs.datacenter.biz.RscpImagePriceBiz;
import com.upyuns.platform.rs.datacenter.entity.RscpImageDataTotal;
import com.upyuns.platform.rs.datacenter.entity.RscpImagePrice;
import com.upyuns.platform.rs.datacenter.pojo.ImageDataVO;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.List;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
@RestController
@RequestMapping("/bg/imageData")
public class BgRscpImageDataTotalController extends BaseController<RscpImageDataTotalBiz, RscpImageDataTotal> {
}
\ No newline at end of file
package com.upyuns.platform.rs.datacenter.rest.backstage;
import cn.hutool.core.collection.CollUtil;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.upyuns.platform.rs.datacenter.biz.RscpImagePriceBiz;
import com.upyuns.platform.rs.datacenter.entity.RscpImagePrice;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.stream.Collectors;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
@RestController
@RequestMapping("/bg/imagePrice")
public class BgRscpImagePriceController extends BaseController<RscpImagePriceBiz, RscpImagePrice> {
}
\ No newline at end of file
package com.upyuns.platform.rs.datacenter.rest.backstage;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.upyuns.platform.rs.datacenter.biz.RscpResolutionBiz;
import com.upyuns.platform.rs.datacenter.entity.RscpResolution;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
@RestController
@RequestMapping("/bg/resolution")
public class BgRscpResolutionController extends BaseController<RscpResolutionBiz, RscpResolution> {
}
\ No newline at end of file
......@@ -13,9 +13,9 @@
<result column="range" property="range" jdbcType="VARCHAR" />
<result column="thumbnail_path" property="thumbnailPath" jdbcType="VARCHAR" />
<result column="display_name" property="displayName" jdbcType="VARCHAR" />
<result column="image_resolution" property="imageResolution" jdbcType="VARCHAR" />
<result column="image_spectrum_type" property="imageSpectrumType" jdbcType="VARCHAR" />
<result column="image_spectrum_type_display" property="imageSpectrumTypeDisplay" jdbcType="VARCHAR" />
<result column="image_resolution" property="imageResolution" jdbcType="VARCHAR" typeHandler="com.upyuns.platform.rs.datacenter.mybatis.ArrayTypeHandler"/>
<result column="image_spectrum_type" property="imageSpectrumType" jdbcType="VARCHAR" typeHandler="com.upyuns.platform.rs.datacenter.mybatis.ArrayTypeHandler"/>
<result column="image_spectrum_type_display" property="imageSpectrumTypeDisplay" jdbcType="VARCHAR" typeHandler="com.upyuns.platform.rs.datacenter.mybatis.ArrayTypeHandler"/>
<result column="image_row_col" property="imageRowCol" jdbcType="VARCHAR" />
<result column="image_row" property="imageRow" jdbcType="VARCHAR" />
<result column="image_col" property="imageCol" jdbcType="VARCHAR" />
......@@ -38,7 +38,7 @@
<result column="is_sell" property="isSell" jdbcType="INTEGER" />
<result column="is_del" property="isDel" jdbcType="INTEGER" />
<result column="remark" property="remark" jdbcType="VARCHAR" />
<result column="files" property="files" jdbcType="VARCHAR" />
<result column="files" property="files" jdbcType="VARCHAR" typeHandler="com.upyuns.platform.rs.datacenter.mybatis.ArrayTypeHandler"/>
<result column="image_wms_path" property="imageWmsPath" jdbcType="VARCHAR" />
<result column="image_out_path" property="imageOutPath" jdbcType="VARCHAR" />
<result column="image_is_save" property="imageIsSave" jdbcType="INTEGER" />
......
......@@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.UUID;
import static com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant.INTEGRAL_TOPIC;
//import static com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant.INTEGRAL_TOPIC;
@Service
@Slf4j
......@@ -28,7 +28,7 @@ public class MQServiceBiZ {
log.info("发送消息到消息队列:exchange = {}, routingKey = {}, json = {}", exchange, routKey, json);
log.info("开始发送消息。。。");
if(StringUtils.isBlank(exchange)) {
exchange = INTEGRAL_TOPIC;
// exchange = INTEGRAL_TOPIC;
}
if (StringUtils.isBlank(routKey)) {
routKey = RabbitConstant.INTEGRAL_ROUTING_KEY;
......
......@@ -184,8 +184,8 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
jsonObject.put("integralRuleCode", "BUYMEMBER");
}
log.info("支付订单号:orderNo = {}, orderType = {}", newValue.getOrderNo(), newValue.getChannel());
log.info("支付成功获取积分:发送消息 exchange = {}, routingKey = {}, json = {}", RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
mqServiceBiZ.sendMessage(RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
// log.info("支付成功获取积分:发送消息 exchange = {}, routingKey = {}, json = {}", RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
// mqServiceBiZ.sendMessage(RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
}
if (StringUtils.isNotBlank(pay.getNotifyUrl())) {
String url = pay.getNotifyUrl();
......
......@@ -6,8 +6,8 @@ import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
import static com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant.ADMIN_TOPIC;
import static com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant.KEY_WALLET_WITH_DRAW;
//import static com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant.ADMIN_TOPIC;
//import static com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant.KEY_WALLET_WITH_DRAW;
/**
* @author libin
......@@ -15,19 +15,19 @@ import static com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant.KE
* @description
* @data 2019/10/17 17:23
*/
@Configuration
//@Configuration
public class RabbitUniversalConfig extends RabbitCommonConfig {
/**
* 提现支付
*/
public static final String WITH_DRAW_QUEUE = "withdraw.wallet.queue";
static {
myQueue = new ArrayList<BindDTO>() {{
//钱包提现
add(new BindDTO(WITH_DRAW_QUEUE, ADMIN_TOPIC, KEY_WALLET_WITH_DRAW));
}};
}
// /**
// * 提现支付
// */
// public static final String WITH_DRAW_QUEUE = "withdraw.wallet.queue";
//
// static {
// myQueue = new ArrayList<BindDTO>() {{
// //钱包提现
// add(new BindDTO(WITH_DRAW_QUEUE, ADMIN_TOPIC, KEY_WALLET_WITH_DRAW));
// }};
// }
}
......@@ -117,7 +117,7 @@ public class CertificationController {
jsonObject.put("userId", userid);
jsonObject.put("integralRuleCode", "CRETIFICATION");
jsonObject.put("channelId", iId);
mqServiceBiZ.sendMessage(RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
//mqServiceBiZ.sendMessage(RabbitConstant.INTEGRAL_TOPIC, RabbitConstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
}
@GetMapping(value = "/app/unauth/selectByUser")
......
......@@ -33,7 +33,7 @@ import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static com.upyuns.platform.rs.universal.config.RabbitUniversalConfig.WITH_DRAW_QUEUE;
//import static com.upyuns.platform.rs.universal.config.RabbitUniversalConfig.WITH_DRAW_QUEUE;
/**
* @author libin
......@@ -61,7 +61,7 @@ public class WithDrawMqHandler implements InitializingBean {
*
* @param
*/
@RabbitListener(queues = WITH_DRAW_QUEUE)
//@RabbitListener(queues = WITH_DRAW_QUEUE)
public void integralHandler(Message message, @Headers Map<String, Object> headers, Channel channel) {
FundPayVo fundPayVo = null;
String pay_way = "";
......
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