StatisticsController.java 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. package com.ruoyi.project.statistics.controller;
  2. import com.ruoyi.common.core.controller.BaseController;
  3. import com.ruoyi.common.core.domain.AjaxResult;
  4. import com.ruoyi.common.utils.DateUtils;
  5. import com.ruoyi.project.statistics.domain.Statistics;
  6. import com.ruoyi.project.statistics.service.IStatisticsService;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.GetMapping;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.web.bind.annotation.RestController;
  11. import java.math.BigDecimal;
  12. import java.math.RoundingMode;
  13. import java.util.*;
  14. import java.util.concurrent.atomic.AtomicInteger;
  15. @RestController
  16. @RequestMapping("/statistics/statistics")
  17. public class StatisticsController extends BaseController {
  18. @Autowired
  19. private IStatisticsService statisticsService;
  20. @GetMapping("/list")
  21. public AjaxResult list(Statistics statistics) {
  22. List<Statistics> resultList = new ArrayList<>();
  23. // 根据装查询
  24. List<Statistics> countPlant = statisticsService.countPlant(statistics);
  25. for (Statistics plant : countPlant) {
  26. Statistics result = new Statistics();
  27. setStatistics(result);
  28. result.setPlantName(plant.getPlantName());
  29. result.setPlantCount(plant.getCount());
  30. // 统计设备数量
  31. Statistics countDevice = statisticsService.countDevice(plant);
  32. result.setDevCount(countDevice.getCount());
  33. // 根据密封点类型统计数量
  34. int qyljCount = 0;//取样连接系统
  35. for (Statistics countPoint : statisticsService.countPoint(plant)) {
  36. switch (countPoint.getContent()) {
  37. case "泵":
  38. result.setbCount(countPoint.getCount());
  39. break;
  40. case "阀门":
  41. result.setFmCount(countPoint.getCount());
  42. break;
  43. case "法兰":
  44. result.setFlCount(countPoint.getCount());
  45. break;
  46. case "搅拌器":
  47. result.setJbqCount(countPoint.getCount());
  48. break;
  49. case "连接件":
  50. result.setLjjCount(countPoint.getCount());
  51. break;
  52. case "泄压设备":
  53. result.setXysbCount(countPoint.getCount());
  54. break;
  55. case "压缩机":
  56. result.setYsjCount(countPoint.getCount());
  57. break;
  58. case "开口阀或开口管线":
  59. result.setKkfCount(countPoint.getCount());
  60. break;
  61. case "取样连接系统(开口取样-无残液置换、处置措施)":
  62. case "取样连接系统(密闭取样-取样瓶长期与取样口连接)":
  63. case "取样连接系统(开口取样-有残液置换、处置措施)":
  64. case "取样连接系统(密闭取样-取样瓶不与取样口连接)":
  65. qyljCount += countPoint.getCount();
  66. break;
  67. case "其他":
  68. result.setQtCount(countPoint.getCount());
  69. break;
  70. }
  71. }
  72. result.setQyljCount(qyljCount);
  73. // 计算总数量
  74. result.setPointCount(result.getbCount() + result.getYsjCount() + result.getJbqCount() + result.getFmCount() + result.getXysbCount() + result.getLjjCount() + result.getFlCount() + result.getKkfCount() + result.getQyljCount() + result.getQtCount());
  75. // 根据泄露程度统计
  76. statistics.setPlantId(plant.getPlantId());
  77. for (Statistics countXlcd : statisticsService.countXlcd(statistics)) {
  78. switch (countXlcd.getContent()) {
  79. case "1":
  80. result.setWxlCount(countXlcd.getCount());
  81. break;
  82. case "2":
  83. result.setYbxlCount(countXlcd.getCount());
  84. break;
  85. case "3":
  86. result.setYzxlCount(countXlcd.getCount());
  87. break;
  88. }
  89. }
  90. // 未检测数量统计
  91. result.setWjcCount(result.getPointCount() - result.getWxlCount() - result.getYbxlCount() - result.getYzxlCount());
  92. // 总数统记
  93. result.setXlcdCount(result.getPointCount());
  94. // 查询所有检测点的净检测值
  95. List<Statistics> countPfl = statisticsService.countPfl(statistics);
  96. resultList.add(getCountValue(countPfl, result));
  97. }
  98. Statistics total = new Statistics();
  99. setStatistics(total);
  100. total.setPlantName("合计");
  101. for (Statistics item : resultList) {
  102. total.setPlantCount(item.getPlantCount() + total.getPlantCount());
  103. total.setDevCount(item.getDevCount() + total.getDevCount());
  104. total.setbCount(item.getbCount() + total.getbCount());
  105. total.setYsjCount(item.getYsjCount() + total.getYsjCount());
  106. total.setJbqCount(item.getJbqCount() + total.getJbqCount());
  107. total.setFmCount(item.getFmCount() + total.getFmCount());
  108. total.setXysbCount(item.getXysbCount() + total.getXysbCount());
  109. total.setLjjCount(item.getLjjCount() + total.getLjjCount());
  110. total.setFlCount(item.getFlCount() + total.getFlCount());
  111. total.setKkfCount(item.getKkfCount() + total.getKkfCount());
  112. total.setQyljCount(item.getQyljCount() + total.getQyljCount());
  113. total.setQtCount(item.getQtCount() + total.getQtCount());
  114. total.setPointCount(item.getPointCount() + total.getPointCount());
  115. total.setWxlCount(item.getWxlCount() + total.getWxlCount());
  116. total.setYbxlCount(item.getYbxlCount() + total.getYbxlCount());
  117. total.setYzxlCount(item.getYzxlCount() + total.getYzxlCount());
  118. total.setWjcCount(item.getWjcCount() + total.getWjcCount());
  119. total.setXlcdCount(item.getXlcdCount() + total.getXlcdCount());
  120. total.setXll(new BigDecimal(item.getXll()).add(new BigDecimal(total.getXll())).toString());
  121. total.setJpl(new BigDecimal(item.getJpl()).add(new BigDecimal(total.getJpl())).toString());
  122. total.setPfl(new BigDecimal(item.getPfl()).add(new BigDecimal(total.getPfl())).toString());
  123. total.setSjpfl(new BigDecimal(item.getSjpfl()).add(new BigDecimal(total.getSjpfl())).toString());
  124. }
  125. resultList.add(total);
  126. return AjaxResult.success(resultList);
  127. }
  128. private void setStatistics(Statistics total) {
  129. total.setPlantCount(0);
  130. total.setDevCount(0);
  131. total.setbCount(0);
  132. total.setYsjCount(0);
  133. total.setJbqCount(0);
  134. total.setFmCount(0);
  135. total.setXysbCount(0);
  136. total.setLjjCount(0);
  137. total.setFlCount(0);
  138. total.setKkfCount(0);
  139. total.setQyljCount(0);
  140. total.setQtCount(0);
  141. total.setPointCount(0);
  142. total.setWxlCount(0);
  143. total.setYbxlCount(0);
  144. total.setYzxlCount(0);
  145. total.setWjcCount(0);
  146. total.setXlcdCount(0);
  147. total.setXll("0");
  148. total.setJpl("0");
  149. total.setPfl("0");
  150. total.setSjpfl("0");
  151. }
  152. private Statistics getCountValue(List<Statistics> countPfl, Statistics result) {
  153. // 设置当年时间
  154. Calendar nc = Calendar.getInstance();//当年的1月1日
  155. nc.set(nc.get(Calendar.YEAR), 0, 1, 0, 0, 0);
  156. nc.set(Calendar.MILLISECOND, 0);//设置毫秒值为0否则会减掉 一天
  157. Calendar nm = Calendar.getInstance();//次年的1月1日
  158. nm.set(nm.get(Calendar.YEAR), 12, 1, 0, 0, 0);
  159. nm.set(Calendar.MILLISECOND, 0);//设置毫秒值为0否则会减掉 一天
  160. double zpfl = 0;//初始排放量
  161. double sjpfl = 0;//实际排放量
  162. double zxll = 0;//总泄漏量
  163. long pid = 0;
  164. double temp = 0;
  165. for (int i = 0; i < countPfl.size(); i++) {
  166. Statistics point = countPfl.get(i);
  167. double netTestValue = Double.parseDouble(point.getNetTestValue());
  168. if (netTestValue < 50) {
  169. if (i == 0 || !Objects.equals(countPfl.get(i - 1).getPointId(), point.getPointId())) {//如果是第一条||前一条和当前这条不是是同一个点
  170. sjpfl += getETOC(netTestValue, point.getPointType()) * DateUtils.differentDaysByMillisecond(nc.getTime(), point.getCheckDate()) * 24;
  171. } else if (Objects.equals(countPfl.get(i - 1).getPointId(), point.getPointId())) {//如果前一条和当前这条是同一个点
  172. if (new BigDecimal(countPfl.get(i - 1).getNetTestValue()).compareTo(new BigDecimal("50")) < 0) { // 如果前一条检测值小于泄漏标准
  173. sjpfl += getETOC(netTestValue, point.getPointType()) * DateUtils.differentDaysByMillisecond(point.getCheckDate(), countPfl.get(i - 1).getCheckDate()) * 24;
  174. }
  175. }
  176. if (i + 1 == countPfl.size() || !Objects.equals(countPfl.get(i + 1).getPointId(), point.getPointId())) {//如果下一条和当前这条不是同一个点
  177. sjpfl += getETOC(netTestValue, point.getPointType()) * (DateUtils.differentDaysByMillisecond(nm.getTime(), point.getCheckDate())) * 24;
  178. }
  179. } else {
  180. if (i == 0 || !Objects.equals(countPfl.get(i - 1).getPointId(), point.getPointId())) {//如果是第一条||前一条和当前这条不是是同一个点
  181. sjpfl += getETOC(netTestValue, point.getPointType()) * DateUtils.differentDaysByMillisecond(nc.getTime(), point.getCheckDate()) * 24;
  182. } else if (Objects.equals(countPfl.get(i - 1).getPointId(), point.getPointId())) {//如果前一条和当前这条是同一个点
  183. sjpfl += getETOC(netTestValue, point.getPointType()) * DateUtils.differentDaysByMillisecond(point.getCheckDate(), countPfl.get(i - 1).getCheckDate()) * 24;
  184. }
  185. if (i + 1 == countPfl.size() || !Objects.equals(countPfl.get(i + 1).getPointId(), point.getPointId())) {//如果下一条和当前这条不是同一个点
  186. sjpfl += getETOC(netTestValue, point.getPointType()) * (DateUtils.differentDaysByMillisecond(nm.getTime(), point.getCheckDate())) * 24;
  187. } else {
  188. sjpfl += getETOC(netTestValue, point.getPointType()) * (DateUtils.differentDaysByMillisecond(countPfl.get(i + 1).getCheckDate(), point.getCheckDate())) * 24;
  189. }
  190. }
  191. if (pid == point.getPointId()) {
  192. continue;
  193. }
  194. if (netTestValue >= 50) {
  195. pid = point.getPointId();
  196. if (i == 0 || !Objects.equals(countPfl.get(i - 1).getPointId(), point.getPointId())) {//如果是第一条||前一条和当前这条不是是同一个点
  197. double pfl = getETOC(netTestValue, point.getPointType()) * DateUtils.differentDaysByMillisecond(nc.getTime(), nm.getTime()) * 24;
  198. zxll += pfl;
  199. zpfl += pfl;
  200. } else {
  201. double pfl = getETOC(netTestValue, point.getPointType()) * DateUtils.differentDaysByMillisecond(countPfl.get(i - 1).getCheckDate(), nm.getTime()) * 24;
  202. zxll += pfl + (zpfl - temp);
  203. zpfl += pfl;
  204. temp = 0;
  205. }
  206. } else {
  207. if (i == 0 || !Objects.equals(countPfl.get(i - 1).getPointId(), point.getPointId())) {//如果是第一条||前一条和当前这条不是是同一个点
  208. temp = zpfl;
  209. zpfl += getETOC(netTestValue, point.getPointType()) * DateUtils.differentDaysByMillisecond(nc.getTime(), point.getCheckDate()) * 24;
  210. } else if (Objects.equals(countPfl.get(i - 1).getPointId(), point.getPointId())) {//如果前一条和当前这条是同一个点
  211. zpfl += getETOC(netTestValue, point.getPointType()) * DateUtils.differentDaysByMillisecond(point.getCheckDate(), countPfl.get(i - 1).getCheckDate()) * 24;
  212. }
  213. if (i + 1 == countPfl.size() || !Objects.equals(countPfl.get(i + 1).getPointId(), point.getPointId())) {//如果下一条和当前这条不是同一个点
  214. zpfl += getETOC(netTestValue, point.getPointType()) * (DateUtils.differentDaysByMillisecond(nm.getTime(), point.getCheckDate())) * 24;
  215. }
  216. }
  217. }
  218. // 排放量(t/年)
  219. result.setPfl(new BigDecimal(String.valueOf(zpfl)).divide(new BigDecimal("1000"), 4, RoundingMode.HALF_UP).stripTrailingZeros().toString());
  220. // 泄漏量(t/年)
  221. result.setXll(new BigDecimal(String.valueOf(zxll)).divide(new BigDecimal("1000"), 4, RoundingMode.HALF_UP).stripTrailingZeros().toString());
  222. // 减排量(t/年)
  223. result.setJpl(new BigDecimal(String.valueOf(zpfl - sjpfl)).divide(new BigDecimal("1000"), 4, RoundingMode.HALF_UP).stripTrailingZeros().toString());
  224. result.setSjpfl(new BigDecimal(String.valueOf(sjpfl)).divide(new BigDecimal("1000"), 4, RoundingMode.HALF_UP).stripTrailingZeros().toString());
  225. return result;
  226. }
  227. @GetMapping("/xlcdByPoint")
  228. public AjaxResult xlcdByPoint(Statistics statistics) {
  229. Map<String, Statistics> map = new HashMap<>();
  230. List<Statistics> xlcdByPoint = statisticsService.countXlcdByPoint(statistics);
  231. Statistics result = null;
  232. for (Statistics point : xlcdByPoint) {
  233. String pointType = point.getPointType();
  234. Integer count = point.getCount();
  235. if (map.get(pointType) == null) {
  236. result = new Statistics();
  237. }
  238. switch (point.getContent()) {
  239. case "1":
  240. result.setWxlCount(count);
  241. break;
  242. case "2":
  243. result.setYbxlCount(count);
  244. break;
  245. case "3":
  246. result.setYzxlCount(count);
  247. break;
  248. }
  249. result.setPointType(pointType);
  250. map.put(pointType, result);
  251. }
  252. return AjaxResult.success(map.values());
  253. }
  254. @GetMapping("/pflByPoint")
  255. public AjaxResult pflByPoint(Statistics statistics) {
  256. List<Statistics> resultList = new ArrayList<>();
  257. // 根据装查询
  258. List<Statistics> countPlant = statisticsService.countPlant(statistics);
  259. for (Statistics plant : countPlant) {
  260. statistics.setPlantId(plant.getPlantId());
  261. List<Statistics> countPfl = statisticsService.countPfl(statistics);
  262. // 设置当年时间
  263. Calendar nc = Calendar.getInstance();//当年的1月1日
  264. nc.set(nc.get(Calendar.YEAR), 0, 1, 0, 0, 0);
  265. nc.set(Calendar.MILLISECOND, 0);//设置毫秒值为0否则会减掉 一天
  266. Calendar nm = Calendar.getInstance();//次年的1月1日
  267. nm.set(nm.get(Calendar.YEAR), 12, 1, 0, 0, 0);
  268. nm.set(Calendar.MILLISECOND, 0);//设置毫秒值为0否则会减掉 一天
  269. Statistics result = null;
  270. double zpfl = 0;//初始排放量
  271. double sjpfl = 0;//实际排放量
  272. double zxll = 0;//总泄漏量
  273. long pid = 0;
  274. double temp = 0;
  275. for (int i = 0; i < countPfl.size(); i++) {
  276. Statistics item = countPfl.get(i);
  277. //如果是第一条或者下一条的密封点类型和当前的密封点类型不一致
  278. if (i == 0 || !countPfl.get(i).getPointType().equals(result.getPointType())) {
  279. result = new Statistics();
  280. result.setPointType(item.getPointType());
  281. zpfl = 0;//初始排放量
  282. sjpfl = 0;//实际排放量
  283. zxll = 0;//总泄漏量
  284. }
  285. result.setPlantName(plant.getPlantName());
  286. double netTestValue = Double.parseDouble(item.getNetTestValue());
  287. if (netTestValue < 50) {
  288. if (i == 0 || !Objects.equals(countPfl.get(i - 1).getPointId(), item.getPointId())) {//如果是第一条||前一条和当前这条不是是同一个点
  289. sjpfl += getETOC(netTestValue, item.getPointType()) * DateUtils.differentDaysByMillisecond(nc.getTime(), item.getCheckDate()) * 24;
  290. } else if (Objects.equals(countPfl.get(i - 1).getPointId(), item.getPointId())) {//如果前一条和当前这条是同一个点
  291. if (new BigDecimal(countPfl.get(i - 1).getNetTestValue()).compareTo(new BigDecimal("50")) < 0) { // 如果前一条检测值小于泄漏标准
  292. sjpfl += getETOC(netTestValue, item.getPointType()) * DateUtils.differentDaysByMillisecond(item.getCheckDate(), countPfl.get(i - 1).getCheckDate()) * 24;
  293. }
  294. }
  295. if (i + 1 == countPfl.size() || !Objects.equals(countPfl.get(i + 1).getPointId(), item.getPointId())) {//如果下一条和当前这条不是同一个点
  296. sjpfl += getETOC(netTestValue, item.getPointType()) * (DateUtils.differentDaysByMillisecond(nm.getTime(), item.getCheckDate())) * 24;
  297. }
  298. } else {
  299. if (i == 0 || !Objects.equals(countPfl.get(i - 1).getPointId(), item.getPointId())) {//如果是第一条||前一条和当前这条不是是同一个点
  300. sjpfl += getETOC(netTestValue, item.getPointType()) * DateUtils.differentDaysByMillisecond(nc.getTime(), item.getCheckDate()) * 24;
  301. } else if (Objects.equals(countPfl.get(i - 1).getPointId(), item.getPointId())) {//如果前一条和当前这条是同一个点
  302. sjpfl += getETOC(netTestValue, item.getPointType()) * DateUtils.differentDaysByMillisecond(item.getCheckDate(), countPfl.get(i - 1).getCheckDate()) * 24;
  303. }
  304. if (i + 1 == countPfl.size() || !Objects.equals(countPfl.get(i + 1).getPointId(), item.getPointId())) {//如果下一条和当前这条不是同一个点
  305. sjpfl += getETOC(netTestValue, item.getPointType()) * (DateUtils.differentDaysByMillisecond(nm.getTime(), item.getCheckDate())) * 24;
  306. } else {
  307. sjpfl += getETOC(netTestValue, item.getPointType()) * (DateUtils.differentDaysByMillisecond(countPfl.get(i + 1).getCheckDate(), item.getCheckDate())) * 24;
  308. }
  309. }
  310. if (pid == item.getPointId()) {
  311. if (i != 0 && (i + 1 == countPfl.size() || !countPfl.get(i + 1).getPointType().equals(item.getPointType()))) {
  312. // 排放量(t/年)
  313. result.setPfl(new BigDecimal(String.valueOf(zpfl)).divide(new BigDecimal("1000"), 8, RoundingMode.HALF_UP).stripTrailingZeros().toString());
  314. // 泄漏量(t/年)
  315. result.setXll(new BigDecimal(String.valueOf(zxll)).divide(new BigDecimal("1000"), 8, RoundingMode.HALF_UP).stripTrailingZeros().toString());
  316. // 减排量(t/年)
  317. result.setJpl(new BigDecimal(String.valueOf(zpfl - sjpfl)).divide(new BigDecimal("1000"), 8, RoundingMode.HALF_UP).stripTrailingZeros().toString());
  318. resultList.add(result);
  319. }
  320. continue;
  321. }
  322. if (netTestValue >= 50) {
  323. pid = item.getPointId();
  324. if (i == 0 || !Objects.equals(countPfl.get(i - 1).getPointId(), item.getPointId())) {//如果是第一条||前一条和当前这条不是是同一个点
  325. double pfl = getETOC(netTestValue, item.getPointType()) * DateUtils.differentDaysByMillisecond(nc.getTime(), nm.getTime()) * 24;
  326. zxll += pfl;
  327. zpfl += pfl;
  328. } else {
  329. double pfl = getETOC(netTestValue, item.getPointType()) * DateUtils.differentDaysByMillisecond(countPfl.get(i - 1).getCheckDate(), nm.getTime()) * 24;
  330. zxll += pfl + (zpfl - temp);
  331. zpfl += pfl;
  332. temp = 0;
  333. }
  334. } else {
  335. if (i == 0 || !Objects.equals(countPfl.get(i - 1).getPointId(), item.getPointId())) {//如果是第一条||前一条和当前这条不是是同一个点
  336. temp = zpfl;
  337. zpfl += getETOC(netTestValue, item.getPointType()) * DateUtils.differentDaysByMillisecond(nc.getTime(), item.getCheckDate()) * 24;
  338. } else if (Objects.equals(countPfl.get(i - 1).getPointId(), item.getPointId())) {//如果前一条和当前这条是同一个点
  339. zpfl += getETOC(netTestValue, item.getPointType()) * DateUtils.differentDaysByMillisecond(item.getCheckDate(), countPfl.get(i - 1).getCheckDate()) * 24;
  340. }
  341. if (i + 1 == countPfl.size() || !Objects.equals(countPfl.get(i + 1).getPointId(), item.getPointId())) {//如果下一条和当前这条不是同一个点
  342. zpfl += getETOC(netTestValue, item.getPointType()) * (DateUtils.differentDaysByMillisecond(nm.getTime(), item.getCheckDate())) * 24;
  343. }
  344. }
  345. if (i != 0 && (i + 1 == countPfl.size() || !countPfl.get(i + 1).getPointType().equals(item.getPointType()))) {
  346. // 排放量(t/年)
  347. result.setPfl(new BigDecimal(String.valueOf(zpfl)).divide(new BigDecimal("1000"), 8, RoundingMode.HALF_UP).stripTrailingZeros().toString());
  348. // 泄漏量(t/年)
  349. result.setXll(new BigDecimal(String.valueOf(zxll)).divide(new BigDecimal("1000"), 8, RoundingMode.HALF_UP).stripTrailingZeros().toString());
  350. // 减排量(t/年)
  351. result.setJpl(new BigDecimal(String.valueOf(zpfl - sjpfl)).divide(new BigDecimal("1000"), 8, RoundingMode.HALF_UP).stripTrailingZeros().toString());
  352. resultList.add(result);
  353. }
  354. }
  355. }
  356. return AjaxResult.success(resultList);
  357. }
  358. /**
  359. * 计算排放速率(kg/h)
  360. *
  361. * @param netTestValue
  362. * @param pointType
  363. * @return
  364. */
  365. public double getETOC(double netTestValue, String pointType) {
  366. switch (pointType) {
  367. case "泵":
  368. if (netTestValue < 1) {
  369. return 2.4 * Math.pow(10, -5);
  370. } else if (netTestValue >= 1 && netTestValue < 50000) {
  371. return 5.03 * Math.pow(10, -5) * Math.pow(netTestValue, 0.61);
  372. } else {
  373. return 0.16;
  374. }
  375. case "阀门":
  376. if (netTestValue < 1) {
  377. return 7.8 * Math.pow(10, -6);
  378. } else if (netTestValue >= 1 && netTestValue < 50000) {
  379. return 2.29 * Math.pow(10, -6) * Math.pow(netTestValue, 0.746);
  380. } else {
  381. return 0.14;
  382. }
  383. case "法兰":
  384. if (netTestValue < 1) {
  385. return 3.1 * Math.pow(10, -7);
  386. } else if (netTestValue >= 1 && netTestValue < 50000) {
  387. return 4.61 * Math.pow(10, -6) * Math.pow(netTestValue, 0.703);
  388. } else {
  389. return 0.084;
  390. }
  391. case "连接件":
  392. if (netTestValue < 1) {
  393. return 7.5 * Math.pow(10, -6);
  394. } else if (netTestValue >= 1 && netTestValue < 50000) {
  395. return 1.53 * Math.pow(10, -6) * Math.pow(netTestValue, 0.735);
  396. } else {
  397. return 0.03;
  398. }
  399. case "开口阀或开口管线":
  400. if (netTestValue < 1) {
  401. return 2 * Math.pow(10, -6);
  402. } else if (netTestValue >= 1 && netTestValue < 50000) {
  403. return 2.2 * Math.pow(10, -6) * Math.pow(netTestValue, 0.704);
  404. } else {
  405. return 0.079;
  406. }
  407. default://其他
  408. if (netTestValue < 1) {
  409. return 4 * Math.pow(10, -6);
  410. } else if (netTestValue >= 1 && netTestValue < 50000) {
  411. return 1.36 * Math.pow(10, -5) * Math.pow(netTestValue, 0.589);
  412. } else {
  413. return 0.11;
  414. }
  415. }
  416. }
  417. }