Commit 52db65ff by wangweidong

土工平台修改

parent fa270b41
...@@ -14,29 +14,36 @@ public class ServerHandler extends ChannelInboundHandlerAdapter { ...@@ -14,29 +14,36 @@ public class ServerHandler extends ChannelInboundHandlerAdapter {
public void channelRead(ChannelHandlerContext ctx, Object msg) { public void channelRead(ChannelHandlerContext ctx, Object msg) {
try { try {
String oid = ctx.channel().id().asLongText(); String oid = ctx.channel().id().asLongText();
ByteBuf buf = (ByteBuf) msg; byte[] req = new byte[buf.readableBytes()]; ByteBuf buf = (ByteBuf) msg; byte[] req = new byte[buf.readableBytes()];
buf.readBytes(req); buf.readBytes(req);
String body = new String(req, "UTF-8"); String body = new String(req, "UTF-8");
logger.error("天平传输的原始数据为:"+body);
logger.error("天平传输的处理数据为:"+ConvertHexStrToByteArray.balanceTextChangg(body)); if (!body.contains("PTH")){
InitBalanceMap mapInit = (InitBalanceMap)SpringUtil.getBean("initBalanceMap"); logger.error("天平传输的原始数据为:"+body);
ExpiringMap<String,String> mapId = mapInit.getMapId(); logger.error("天平传输的处理数据为:"+ConvertHexStrToByteArray.balanceTextChangg(body));
ExpiringMap<String,String> mapValue = mapInit.getMapValue(); InitBalanceMap mapInit = (InitBalanceMap)SpringUtil.getBean("initBalanceMap");
if (mapId.get(oid)==null){ ExpiringMap<String,String> mapId = mapInit.getMapId();
mapId.put(oid,ConvertHexStrToByteArray.balanceTextChangg(body)); ExpiringMap<String,String> mapValue = mapInit.getMapValue();
}else{ if (mapId.get(oid)==null){
mapValue.put(mapId.get(oid),ConvertHexStrToByteArray.balanceTextChangg(body)); mapId.put(oid,ConvertHexStrToByteArray.balanceTextChangg(body));
} }else{
mapValue.put(mapId.get(oid),ConvertHexStrToByteArray.balanceTextChangg(body));
}
System.out.println(body); System.out.println(body);
System.out.println("目前天平库的信息为:"+mapValue.toString()); System.out.println("目前天平库的信息为:"+mapValue.toString());
logger.error("目前天平库的信息为:"+mapValue.toString());
System.out.println("接收到客户端信息:" + msg.toString());
//返回的数据结构
ctx.writeAndFlush("OK");
}
logger.error("目前天平库的信息为:"+mapValue.toString());
System.out.println("接收到客户端信息:" + msg.toString());
//返回的数据结构
ctx.writeAndFlush("OK");
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -340,6 +340,9 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap ...@@ -340,6 +340,9 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
List<SoilItemVO> soilItemVOList = soilItemService.listVOByExpSampleIds(sampleIdList); List<SoilItemVO> soilItemVOList = soilItemService.listVOByExpSampleIds(sampleIdList);
Map<Long,List<SoilItemVO>> sampleSoilItemVOMap =new HashMap<>(); Map<Long,List<SoilItemVO>> sampleSoilItemVOMap =new HashMap<>();
for (SoilItemVO soilItemVO:soilItemVOList) { for (SoilItemVO soilItemVO:soilItemVOList) {
if (sampleSoilItemVOMap.containsKey(soilItemVO.getSampleId())){ if (sampleSoilItemVOMap.containsKey(soilItemVO.getSampleId())){
...@@ -353,11 +356,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap ...@@ -353,11 +356,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
} }
} }
SoilEntrust entrust = soilEntrustService.getById(voList.get(0).getEntrustId()); SoilEntrust entrust = soilEntrustService.getById(voList.get(0).getEntrustId());
logger.error("saveExcelOriginalRecord entrust"); logger.error("saveExcelOriginalRecord entrust");
InputStream io = ossClient.download(template.getObjectKey()); InputStream io = ossClient.download(template.getObjectKey());
if (null == io){ if (null == io){
...@@ -374,6 +373,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap ...@@ -374,6 +373,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
logger.error("获取证书模板错误"+e.getMessage()); logger.error("获取证书模板错误"+e.getMessage());
e.printStackTrace(); e.printStackTrace();
} }
Map<String, String> mapReplace = new HashMap<>(); Map<String, String> mapReplace = new HashMap<>();
mapReplace.put("#{projectName}",entrust.getProjectName()); mapReplace.put("#{projectName}",entrust.getProjectName());
mapReplace.put("#{client}",entrust.getClient()); mapReplace.put("#{client}",entrust.getClient());
...@@ -663,6 +663,12 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap ...@@ -663,6 +663,12 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
int xBegin2 = 10; int xBegin2 = 10;
int xBegin3 = 11; int xBegin3 = 11;
int xStep = 5; int xStep = 5;
Map<String,String> siteNoSampleCodeMap = new HashMap<>();
for (SoilExperimentVO vo:voList){
siteNoSampleCodeMap.put(vo.getSiteNo(),vo.getSampleCode());
}
for (SoilExperimentVO vo:voList) { for (SoilExperimentVO vo:voList) {
XSSFRow xssfRow = sheetOne.getRow(beginRow); XSSFRow xssfRow = sheetOne.getRow(beginRow);
...@@ -907,7 +913,16 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap ...@@ -907,7 +913,16 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
if (null != teshuRow){ if (null != teshuRow){
XSSFCell teshuCell = teshuRow.getCell(config.getColumnPlace()); XSSFCell teshuCell = teshuRow.getCell(config.getColumnPlace());
XSSFCell teshuCellSampleCode = teshuRow.getCell(1); XSSFCell teshuCellSampleCode = teshuRow.getCell(1);
teshuCell.setCellFormula("'附录"+HSSFWorkbookUtil.getJavaValue(teshuCellSampleCode).toString()+"'!B11");
String code = HSSFWorkbookUtil.getJavaValue(teshuCellSampleCode).toString();
String mapCode = siteNoSampleCodeMap.get(code);
if (StringUtils.isNotBlank(mapCode)){
teshuCell.setCellFormula("'附录"+mapCode+"'!B11");
}else{
teshuCell.setCellFormula("'附录"+code+"'!B11");
}
} }
} }
......
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