优化上报数据;
This commit is contained in:
parent
25c843650e
commit
43349914d7
@ -5,6 +5,9 @@ import io.netty.channel.ChannelInitializer;
|
|||||||
import io.netty.handler.codec.string.StringDecoder;
|
import io.netty.handler.codec.string.StringDecoder;
|
||||||
import io.netty.handler.codec.string.StringEncoder;
|
import io.netty.handler.codec.string.StringEncoder;
|
||||||
|
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author: 刘振雷
|
* @author: 刘振雷
|
||||||
* @time: 2024/10/15
|
* @time: 2024/10/15
|
||||||
@ -14,10 +17,10 @@ public class BootNettyChannelInitializer<SocketChannel> extends ChannelInitializ
|
|||||||
@Override
|
@Override
|
||||||
protected void initChannel(Channel ch) throws Exception {
|
protected void initChannel(Channel ch) throws Exception {
|
||||||
// ChannelOutboundHandler,依照逆序执行
|
// ChannelOutboundHandler,依照逆序执行
|
||||||
ch.pipeline().addLast("encoder", new StringEncoder());
|
ch.pipeline().addLast("encoder", new StringEncoder(StandardCharsets.UTF_8));
|
||||||
|
|
||||||
// 属于ChannelInboundHandler,依照顺序执行
|
// 属于ChannelInboundHandler,依照顺序执行
|
||||||
ch.pipeline().addLast("decoder", new StringDecoder());
|
ch.pipeline().addLast("decoder", new StringDecoder(StandardCharsets.UTF_8));
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* 自定义ChannelInboundHandlerAdapter
|
* 自定义ChannelInboundHandlerAdapter
|
||||||
|
|||||||
@ -234,6 +234,12 @@ public class LocationUser implements Serializable {
|
|||||||
@TableField(value = "rid")
|
@TableField(value = "rid")
|
||||||
private String rid;
|
private String rid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡ID
|
||||||
|
*/
|
||||||
|
@TableField(value = "cid")
|
||||||
|
private String cid;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
||||||
@ -78,4 +78,9 @@ public class PersonnelModel {
|
|||||||
* 数据的源ID
|
* 数据的源ID
|
||||||
*/
|
*/
|
||||||
private long oid;
|
private long oid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡ID
|
||||||
|
*/
|
||||||
|
private String cid;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,10 +71,14 @@ public class LocationUserServiceImpl extends ServiceImpl<LocationUserMapper, Loc
|
|||||||
p.setId(uuid);
|
p.setId(uuid);
|
||||||
p.setStaffCode(uuid);
|
p.setStaffCode(uuid);
|
||||||
}
|
}
|
||||||
|
if (ObjectUtil.isNull(p.getCid())) {
|
||||||
|
p.setCid(StrUtil.uuid());
|
||||||
|
}
|
||||||
LocationUser locationUser = new LocationUser();
|
LocationUser locationUser = new LocationUser();
|
||||||
locationUser.setId(p.getOid());
|
locationUser.setId(p.getOid());
|
||||||
locationUser.setIsReportYq(1);
|
locationUser.setIsReportYq(1);
|
||||||
locationUser.setRid(p.getId());
|
locationUser.setRid(p.getId());
|
||||||
|
locationUser.setCid(p.getCid());
|
||||||
locationUsers.add(locationUser);
|
locationUsers.add(locationUser);
|
||||||
}
|
}
|
||||||
//包装数据
|
//包装数据
|
||||||
|
|||||||
@ -33,9 +33,9 @@ xxl:
|
|||||||
|
|
||||||
report-config:
|
report-config:
|
||||||
company-name: 濮阳龙德洋新材料有限公司 #企业名称
|
company-name: 濮阳龙德洋新材料有限公司 #企业名称
|
||||||
company-code: 123456789 #企业编码
|
company-code: PY45700000010 #企业编码
|
||||||
|
|
||||||
# netty 连接信息
|
# netty 连接信息
|
||||||
netty-config:
|
netty-config:
|
||||||
ip: 10.8.33.15
|
ip: 218.29.42.147
|
||||||
port: 8866
|
port: 9008
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
<select id="getRealData" resultType="com.hxl.puyang.location.model.RealDataModel">
|
<select id="getRealData" resultType="com.hxl.puyang.location.model.RealDataModel">
|
||||||
SELECT CAST(s.longitude as DECIMAL(9, 6)) AS longitude,
|
SELECT CAST(s.longitude as DECIMAL(9, 6)) AS longitude,
|
||||||
CAST(s.latitude as DECIMAL(9, 6)) AS latitude,
|
CAST(s.latitude as DECIMAL(9, 6)) AS latitude,
|
||||||
d.card_id AS locaterCode,
|
u.cid AS locaterCode,
|
||||||
u.rid AS staffCode,
|
u.rid AS staffCode,
|
||||||
0 AS deleted,
|
0 AS deleted,
|
||||||
DATE_FORMAT(IF(d.update_time IS NOT NULL, d.update_time, d.create_time), '%Y%m%d%H%i%s') AS createDate,
|
DATE_FORMAT(IF(d.update_time IS NOT NULL, d.update_time, d.create_time), '%Y%m%d%H%i%s') AS createDate,
|
||||||
|
|||||||
@ -71,7 +71,8 @@
|
|||||||
CASE USER_SEX WHEN '1' THEN '0' ELSE '1' END AS staffGender,
|
CASE USER_SEX WHEN '1' THEN '0' ELSE '1' END AS staffGender,
|
||||||
USER_CARD_NO AS idCard,
|
USER_CARD_NO AS idCard,
|
||||||
USER_PHONE AS telephone,
|
USER_PHONE AS telephone,
|
||||||
ID AS oid
|
ID AS oid,
|
||||||
|
cid AS cid
|
||||||
FROM
|
FROM
|
||||||
hxl_location_user
|
hxl_location_user
|
||||||
WHERE
|
WHERE
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user