一个卫语句

编程技术  /  houtizong 发布于 3年前   98
修改前:
public Map updateUnitChkInfo(String billNo,Map chkMap,List chkUnitRstList,List chkPerRstList){boolean cflag = true;    int j=0;int k=0;    while(cflag){    if(j<=chkUnitRstList.size()-1){    Map utMap = (Map)chkUnitRstList.get(j);    if("00".equals(utMap.get("chkCode")+"")){    k++;    }else{    if("00".equals(chkMap.get("chkCode")+"")){    chkMap.put("chkCode", utMap.get("chkCode"));chkMap.put("chkInfo", utMap.get("chkInfo"));    }else{    chkMap.put("chkCode", chkMap.get("chkCode")+""+utMap.get("chkCode"));    chkMap.put("chkInfo", chkMap.get("chkInfo")+""+utMap.get("chkInfo"));   UpdateStateDao downloadDao = new UpdateStateDao();try{downloadDao.upSynDownflag("2", billNo, pt);    }catch(SQLException e){    e.printStackTrace();    System.out.println("------>"+e.getMessage());    }    }    cflag=false;    }    if(k==chkUnitRstList.size()-1){    cflag=false;    }    }else{    cflag=false;    }    j++;    }    j=0;k=0;cflag=true;    while(cflag){    if(j<=chkPerRstList.size()-1){    Map prMap = (Map)chkPerRstList.get(j);    if("00".equals(prMap.get("chkCode")+"")){    k++;    }else{    if("00".equals(chkMap.get("chkCode")+"")){    chkMap.put("chkCode", "XX");chkMap.put("chkInfo", "XXXXXXXXXXX;");    }else{    chkMap.put("chkCode", chkMap.get("chkCode")+"99");chkMap.put("chkInfo", chkMap.get("chkInde")+"YYYYYYYYYYYYY;");    }    cflag=false;    }    if(k==chkPerRstList.size()-1){    cflag=false;    }    }else{    cflag=false;    }    j++;    }    return chkMap;}


修改后:
private CheckResult getUnitsCheckResult(String billNo,Map chkMap,List chkUnitRstList){CheckResult unitsResult = new CheckResult();UpdateStateDao downloadDao = new UpdateStateDao();String chk_code = "";String chk_info = "";if(!("00".equals(chkMap.get("chkCode")+""))){chk_code = chkMap.get("chkCode")+"";chk_info = chkMap.get("chkInfo")+"";try{downloadDao.upSynDownflag("4", billNo, pt);}catch(SQLException e){e.printStackTrace();System.out.println("失败原因:\n"+e.getMessage());}}for(int i=0;i<chkUnitRstList.size();i++){Map utMap = (Map)chkUnitRstList.get(i);if(!("00".equals(utMap.get("chkCode")+""))){chk_code = chk_code+"YY";chk_info = chk_info+"YYYYYYY;";unitsResult.setChkCode(chk_code);unitsResult.setChkInfo(chk_info);return unitsResult;}}if("".equals(chk_code)){unitsResult.setChkCode("YY");unitsResult.setChkInfo("YYYYYYYYY");}else{unitsResult.setChkCode(chk_code);unitsResult.setChkInfo(chk_info);}return unitsResult ;}private CheckResult getPersCheckResult(CheckResult unitsResult,List chkPerRstList){CheckResult persResult = new CheckResult();UpdateStateDao downloadDao = new UpdateStateDao();String chk_code = "";String chk_info = "";if(!("00".equals(unitsResult.getChkCode()))){         chk_code = unitsResult.getChkCode();chk_info = unitsResult.getChkInfo();}for(int i=0;i<chkPerRstList.size();i++){Map prMap = (Map)chkPerRstList.get(i);if(!("00".equals(prMap.get("chkCode")+""))){//如果有错误chk_code = chk_code+"XX";chk_info = chk_info+"XXXXXXXX;";persResult.setChkCode(chk_code);persResult.setChkInfo(chk_info);return persResult;}}if("".equals(chk_code)){persResult.setChkCode("00");persResult.setChkInfo("XXXXXXYYYYYYYY");}else{persResult.setChkCode(chk_code);persResult.setChkInfo(chk_info);}return persResult ;}public Map updateUnitChkInfo(String billNo,Map chkMap,List chkUnitRstList,List chkPerRstList){Map resultMap = new HashMap();CheckResult unitsResult = getUnitsCheckResult(billNo,chkMap,chkUnitRstList);CheckResult persResult = getPersCheckResult(unitsResult,chkPerRstList);resultMap.put("chkCode", persResult.getChkCode());resultMap.put("chkInfo", persResult.getChkInfo());return resultMap;}

请勿发布不友善或者负能量的内容。与人为善,比聪明更重要!

留言需要登陆哦

技术博客集 - 网站简介:
前后端技术:
后端基于Hyperf2.1框架开发,前端使用Bootstrap可视化布局系统生成

网站主要作用:
1.编程技术分享及讨论交流,内置聊天系统;
2.测试交流框架问题,比如:Hyperf、Laravel、TP、beego;
3.本站数据是基于大数据采集等爬虫技术为基础助力分享知识,如有侵权请发邮件到站长邮箱,站长会尽快处理;
4.站长邮箱:[email protected];

      订阅博客周刊 去订阅

文章归档

文章标签

友情链接

Auther ·HouTiZong
侯体宗的博客
© 2020 zongscan.com
版权所有ICP证 : 粤ICP备20027696号
PHP交流群 也可以扫右边的二维码
侯体宗的博客