Commit ce29f8a87dc84d6b3cad17ed54162a0b6a19211b
1 parent
16e4fc2a
产研院接口修正
Showing
1 changed file
with
29 additions
and
15 deletions
src/main/java/com/bsth/server_rs/bigdata/BigdateService.java
| @@ -23,7 +23,7 @@ import org.springframework.stereotype.Component; | @@ -23,7 +23,7 @@ import org.springframework.stereotype.Component; | ||
| 23 | import com.alibaba.fastjson.JSONObject; | 23 | import com.alibaba.fastjson.JSONObject; |
| 24 | 24 | ||
| 25 | @Component | 25 | @Component |
| 26 | -@Path("/bigdate") | 26 | +@Path("/bigdata") |
| 27 | @Produces({MediaType.APPLICATION_JSON}) | 27 | @Produces({MediaType.APPLICATION_JSON}) |
| 28 | public class BigdateService { | 28 | public class BigdateService { |
| 29 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 29 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| @@ -380,14 +380,21 @@ public class BigdateService { | @@ -380,14 +380,21 @@ public class BigdateService { | ||
| 380 | m.put("jhzlc", rs.getString("jhzlc")); | 380 | m.put("jhzlc", rs.getString("jhzlc")); |
| 381 | m.put("jhyylc", rs.getString("jhyylc")); | 381 | m.put("jhyylc", rs.getString("jhyylc")); |
| 382 | m.put("jhkslc", rs.getString("jhkslc")); | 382 | m.put("jhkslc", rs.getString("jhkslc")); |
| 383 | - m.put("sjzgl", rs.getString("sjzgl")); | 383 | + m.put("sjzlc", rs.getString("sjzlc")); |
| 384 | m.put("sjyylc", rs.getString("sjyylc")); | 384 | m.put("sjyylc", rs.getString("sjyylc")); |
| 385 | m.put("sjkslc", rs.getString("sjkslc")); | 385 | m.put("sjkslc", rs.getString("sjkslc")); |
| 386 | + if(Double.parseDouble(rs.getString("jhzlc"))>0){ | ||
| 387 | + double zlczxl=Double.parseDouble(rs.getString("sjzlc"))/Double.parseDouble(rs.getString("jhzlc")); | ||
| 388 | + m.put("zlczxl",df.format(zlczxl*100)+"%"); | ||
| 389 | + }else{ | ||
| 390 | + m.put("zlczxl","0.00%"); | ||
| 391 | + | ||
| 392 | + } | ||
| 386 | if(Double.parseDouble(rs.getString("jhyylc"))>0){ | 393 | if(Double.parseDouble(rs.getString("jhyylc"))>0){ |
| 387 | double yylczxl=Double.parseDouble(rs.getString("sjyylc"))/Double.parseDouble(rs.getString("jhyylc")); | 394 | double yylczxl=Double.parseDouble(rs.getString("sjyylc"))/Double.parseDouble(rs.getString("jhyylc")); |
| 388 | - m.put("yylczxl",df.format(yylczxl)); | 395 | + m.put("yylczxl",df.format(yylczxl*100)+"%"); |
| 389 | }else{ | 396 | }else{ |
| 390 | - m.put("yylczxl",df.format("0.00")); | 397 | + m.put("yylczxl","0.00%"); |
| 391 | } | 398 | } |
| 392 | return m; | 399 | return m; |
| 393 | } | 400 | } |
| @@ -423,14 +430,21 @@ public class BigdateService { | @@ -423,14 +430,21 @@ public class BigdateService { | ||
| 423 | m.put("jhzlc", rs.getString("jhzlc")); | 430 | m.put("jhzlc", rs.getString("jhzlc")); |
| 424 | m.put("jhyylc", rs.getString("jhyylc")); | 431 | m.put("jhyylc", rs.getString("jhyylc")); |
| 425 | m.put("jhkslc", rs.getString("jhkslc")); | 432 | m.put("jhkslc", rs.getString("jhkslc")); |
| 426 | - m.put("sjzgl", rs.getString("sjzgl")); | 433 | + m.put("sjzlc", rs.getString("sjzlc")); |
| 427 | m.put("sjyylc", rs.getString("sjyylc")); | 434 | m.put("sjyylc", rs.getString("sjyylc")); |
| 428 | m.put("sjkslc", rs.getString("sjkslc")); | 435 | m.put("sjkslc", rs.getString("sjkslc")); |
| 436 | + if(Double.parseDouble(rs.getString("jhzlc"))>0){ | ||
| 437 | + double zlczxl=Double.parseDouble(rs.getString("sjzlc"))/Double.parseDouble(rs.getString("jhzlc")); | ||
| 438 | + m.put("zlczxl",df.format(zlczxl*100)+"%"); | ||
| 439 | + }else{ | ||
| 440 | + m.put("zlczxl","0.00%"); | ||
| 441 | + | ||
| 442 | + } | ||
| 429 | if(Double.parseDouble(rs.getString("jhyylc"))>0){ | 443 | if(Double.parseDouble(rs.getString("jhyylc"))>0){ |
| 430 | double yylczxl=Double.parseDouble(rs.getString("sjyylc"))/Double.parseDouble(rs.getString("jhyylc")); | 444 | double yylczxl=Double.parseDouble(rs.getString("sjyylc"))/Double.parseDouble(rs.getString("jhyylc")); |
| 431 | - m.put("yylczxl",df.format(yylczxl)); | 445 | + m.put("yylczxl",df.format(yylczxl*100)+"%"); |
| 432 | }else{ | 446 | }else{ |
| 433 | - m.put("yylczxl",df.format("0.00")); | 447 | + m.put("yylczxl","0.00%"); |
| 434 | } | 448 | } |
| 435 | return m; | 449 | return m; |
| 436 | } | 450 | } |
| @@ -460,9 +474,9 @@ public class BigdateService { | @@ -460,9 +474,9 @@ public class BigdateService { | ||
| 460 | @Override | 474 | @Override |
| 461 | public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | 475 | public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { |
| 462 | Map<String, Object> m=new HashMap<String,Object>(); | 476 | Map<String, Object> m=new HashMap<String,Object>(); |
| 463 | - m.put("equipmentCode", rs.getString("equipment_code")); | 477 | + m.put("equipment_code", rs.getString("equipment_code")); |
| 464 | m.put("insideCode", rs.getString("inside_code")); | 478 | m.put("insideCode", rs.getString("inside_code")); |
| 465 | - m.put("supplierName",rs.getString("supplier_name")); | 479 | + m.put("supplier_name",rs.getString("supplier_name")); |
| 466 | return m; | 480 | return m; |
| 467 | } | 481 | } |
| 468 | }); | 482 | }); |
| @@ -474,8 +488,8 @@ public class BigdateService { | @@ -474,8 +488,8 @@ public class BigdateService { | ||
| 474 | Map<String, Object> m2=ddkList.get(j); | 488 | Map<String, Object> m2=ddkList.get(j); |
| 475 | String insideCode=m2.get("insideCode").toString(); | 489 | String insideCode=m2.get("insideCode").toString(); |
| 476 | if(carCode.equals(insideCode)){ | 490 | if(carCode.equals(insideCode)){ |
| 477 | - m1.put("insideCode", m2.get("insideCode")); | ||
| 478 | - m1.put("supplierName", m2.get("supplierName")); | 491 | + m1.put("equipment_code", m2.get("equipment_code")); |
| 492 | + m1.put("supplier_name", m2.get("supplier_name")); | ||
| 479 | } | 493 | } |
| 480 | 494 | ||
| 481 | } | 495 | } |
| @@ -498,9 +512,9 @@ public class BigdateService { | @@ -498,9 +512,9 @@ public class BigdateService { | ||
| 498 | @Override | 512 | @Override |
| 499 | public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | 513 | public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { |
| 500 | Map<String, Object> m=new HashMap<String,Object>(); | 514 | Map<String, Object> m=new HashMap<String,Object>(); |
| 501 | - m.put("equipmentCode", rs.getString("equipment_code")); | 515 | + m.put("equipment_code", rs.getString("equipment_code")); |
| 502 | m.put("insideCode", rs.getString("inside_code")); | 516 | m.put("insideCode", rs.getString("inside_code")); |
| 503 | - m.put("supplierName",rs.getString("supplier_name")); | 517 | + m.put("supplier_name",rs.getString("supplier_name")); |
| 504 | return m; | 518 | return m; |
| 505 | } | 519 | } |
| 506 | }); | 520 | }); |
| @@ -512,8 +526,8 @@ public class BigdateService { | @@ -512,8 +526,8 @@ public class BigdateService { | ||
| 512 | Map<String, Object> m2=ddkList.get(j); | 526 | Map<String, Object> m2=ddkList.get(j); |
| 513 | String insideCode=m2.get("insideCode").toString(); | 527 | String insideCode=m2.get("insideCode").toString(); |
| 514 | if(carCode.equals(insideCode)){ | 528 | if(carCode.equals(insideCode)){ |
| 515 | - m1.put("insideCode", m2.get("insideCode")); | ||
| 516 | - m1.put("supplierName", m2.get("supplierName")); | 529 | + m1.put("equipment_code", m2.get("equipment_code")); |
| 530 | + m1.put("supplier_name", m2.get("supplier_name")); | ||
| 517 | } | 531 | } |
| 518 | 532 | ||
| 519 | } | 533 | } |