|
@@ -58,9 +58,12 @@ public class WeightImpl implements IWeight {
|
|
|
//发送日总称重服务
|
|
|
@Value("${dataCenter.service.dayWeight}")
|
|
|
private String dayWeightService;
|
|
|
- //发送称重服务
|
|
|
+ //发送批次称重服务
|
|
|
@Value("${dataCenter.service.batchWeight}")
|
|
|
private String batchWeightService;
|
|
|
+ //发送每次称重服务
|
|
|
+ @Value("${dataCenter.service.batchWeight}")
|
|
|
+ private String everyTimeWeightService;
|
|
|
//重量批次计算间隔
|
|
|
@Value("${weight.batch_interval}")
|
|
|
private Integer batchIntervalHours;
|
|
@@ -92,6 +95,8 @@ public class WeightImpl implements IWeight {
|
|
|
//保存称重数据
|
|
|
// ProdWeightEntity addeightEntity = _saveWeight(farmID,weightMap);
|
|
|
ProdWeightEntity newWeightEntity = _saveWeight(weightMap);
|
|
|
+ //发送每次重量到数据中心
|
|
|
+ sendEveryTimeWeightToCenter(newWeightEntity);
|
|
|
|
|
|
//计算每天总重
|
|
|
// _sendWeightToCenter(JSON.toJSON(addeightEntity).toString());
|
|
@@ -109,6 +114,12 @@ public class WeightImpl implements IWeight {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void sendEveryTimeWeightToCenter(ProdWeightEntity newWeightEntity) {
|
|
|
+ System.out.println("发送每次称重数据到数据中心" + newWeightEntity);
|
|
|
+ //发送数据
|
|
|
+ _doPostSimple(everyTimeWeightService, JSON.toJSONString(newWeightEntity));
|
|
|
+ }
|
|
|
+
|
|
|
//发送批次数据到数据中心
|
|
|
private void sendBatchWeightToCenter(ProdBatchWeightEntity updateBatchWeightEntity) {
|
|
|
System.out.println("发送批次数据到数据中心" + updateBatchWeightEntity);
|
|
@@ -290,10 +301,6 @@ public class WeightImpl implements IWeight {
|
|
|
private Map _parseReceiveWeight(String receiveInfo) {
|
|
|
receiveInfo = receiveInfo.replace("T", "").replace("N", "").replace("\n", "");
|
|
|
String[] weightArray = receiveInfo.split("kg");
|
|
|
-
|
|
|
-// for(int a=0;a<weightArray.length;a++){
|
|
|
-// System.out.println((a+1)+","+weightArray[a].trim());
|
|
|
-// }
|
|
|
Map weightMap = new HashMap();
|
|
|
weightMap.put("grossWeight", weightArray[0].trim());
|
|
|
weightMap.put("tareWeight", weightArray[1].trim());
|