优化上报数据;

This commit is contained in:
liuzhenlei 2024-10-17 13:13:41 +08:00
parent 25c843650e
commit 43349914d7
7 changed files with 26 additions and 7 deletions

View File

@ -5,6 +5,9 @@ import io.netty.channel.ChannelInitializer;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
/**
* @author: 刘振雷
* @time: 2024/10/15
@ -14,10 +17,10 @@ public class BootNettyChannelInitializer<SocketChannel> extends ChannelInitializ
@Override
protected void initChannel(Channel ch) throws Exception {
// ChannelOutboundHandler依照逆序执行
ch.pipeline().addLast("encoder", new StringEncoder());
ch.pipeline().addLast("encoder", new StringEncoder(StandardCharsets.UTF_8));
// 属于ChannelInboundHandler依照顺序执行
ch.pipeline().addLast("decoder", new StringDecoder());
ch.pipeline().addLast("decoder", new StringDecoder(StandardCharsets.UTF_8));
/*
*
* 自定义ChannelInboundHandlerAdapter

View File

@ -234,6 +234,12 @@ public class LocationUser implements Serializable {
@TableField(value = "rid")
private String rid;
/**
* 卡ID
*/
@TableField(value = "cid")
private String cid;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}

View File

@ -78,4 +78,9 @@ public class PersonnelModel {
* 数据的源ID
*/
private long oid;
/**
* 卡ID
*/
private String cid;
}

View File

@ -71,10 +71,14 @@ public class LocationUserServiceImpl extends ServiceImpl<LocationUserMapper, Loc
p.setId(uuid);
p.setStaffCode(uuid);
}
if (ObjectUtil.isNull(p.getCid())) {
p.setCid(StrUtil.uuid());
}
LocationUser locationUser = new LocationUser();
locationUser.setId(p.getOid());
locationUser.setIsReportYq(1);
locationUser.setRid(p.getId());
locationUser.setCid(p.getCid());
locationUsers.add(locationUser);
}
//包装数据

View File

@ -33,9 +33,9 @@ xxl:
report-config:
company-name: 濮阳龙德洋新材料有限公司 #企业名称
company-code: 123456789 #企业编码
company-code: PY45700000010 #企业编码
# netty 连接信息
netty-config:
ip: 10.8.33.15
port: 8866
ip: 218.29.42.147
port: 9008

View File

@ -30,7 +30,7 @@
<select id="getRealData" resultType="com.hxl.puyang.location.model.RealDataModel">
SELECT CAST(s.longitude as DECIMAL(9, 6)) AS longitude,
CAST(s.latitude as DECIMAL(9, 6)) AS latitude,
d.card_id AS locaterCode,
u.cid AS locaterCode,
u.rid AS staffCode,
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,

View File

@ -71,7 +71,8 @@
CASE USER_SEX WHEN '1' THEN '0' ELSE '1' END AS staffGender,
USER_CARD_NO AS idCard,
USER_PHONE AS telephone,
ID AS oid
ID AS oid,
cid AS cid
FROM
hxl_location_user
WHERE