Commit ce29f8a87dc84d6b3cad17ed54162a0b6a19211b

Authored by 廖磊
1 parent 16e4fc2a

产研院接口修正

src/main/java/com/bsth/server_rs/bigdata/BigdateService.java
... ... @@ -23,7 +23,7 @@ import org.springframework.stereotype.Component;
23 23 import com.alibaba.fastjson.JSONObject;
24 24  
25 25 @Component
26   -@Path("/bigdate")
  26 +@Path("/bigdata")
27 27 @Produces({MediaType.APPLICATION_JSON})
28 28 public class BigdateService {
29 29 Logger logger = LoggerFactory.getLogger(this.getClass());
... ... @@ -380,14 +380,21 @@ public class BigdateService {
380 380 m.put("jhzlc", rs.getString("jhzlc"));
381 381 m.put("jhyylc", rs.getString("jhyylc"));
382 382 m.put("jhkslc", rs.getString("jhkslc"));
383   - m.put("sjzgl", rs.getString("sjzgl"));
  383 + m.put("sjzlc", rs.getString("sjzlc"));
384 384 m.put("sjyylc", rs.getString("sjyylc"));
385 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 393 if(Double.parseDouble(rs.getString("jhyylc"))>0){
387 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 396 }else{
390   - m.put("yylczxl",df.format("0.00"));
  397 + m.put("yylczxl","0.00%");
391 398 }
392 399 return m;
393 400 }
... ... @@ -423,14 +430,21 @@ public class BigdateService {
423 430 m.put("jhzlc", rs.getString("jhzlc"));
424 431 m.put("jhyylc", rs.getString("jhyylc"));
425 432 m.put("jhkslc", rs.getString("jhkslc"));
426   - m.put("sjzgl", rs.getString("sjzgl"));
  433 + m.put("sjzlc", rs.getString("sjzlc"));
427 434 m.put("sjyylc", rs.getString("sjyylc"));
428 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 443 if(Double.parseDouble(rs.getString("jhyylc"))>0){
430 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 446 }else{
433   - m.put("yylczxl",df.format("0.00"));
  447 + m.put("yylczxl","0.00%");
434 448 }
435 449 return m;
436 450 }
... ... @@ -460,9 +474,9 @@ public class BigdateService {
460 474 @Override
461 475 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
462 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 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 480 return m;
467 481 }
468 482 });
... ... @@ -474,8 +488,8 @@ public class BigdateService {
474 488 Map<String, Object> m2=ddkList.get(j);
475 489 String insideCode=m2.get("insideCode").toString();
476 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 512 @Override
499 513 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
500 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 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 518 return m;
505 519 }
506 520 });
... ... @@ -512,8 +526,8 @@ public class BigdateService {
512 526 Map<String, Object> m2=ddkList.get(j);
513 527 String insideCode=m2.get("insideCode").toString();
514 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 }
... ...