• 更新json字段代码备份


    @RequestMapping(params = "doUpdate")
    @ResponseBody
    public AjaxJson doUpdate(DecOrderEntity decOrder,DecOrderPage decOrderPage,JsonExtractPage jsonExtractPage, HttpServletRequest request) {
    List<GoodsCodeEntity> goodsCodeList = decOrderPage.getGoodsCodeList();
    AjaxJson j = new AjaxJson();
    String message = "更新成功";
    try{
    DecOrderEntity decOrder1=decOrderService.getEntity(DecOrderEntity.class, decOrder.getId());
    String jsonExtract = decOrder1.getJsonExtract();
    JsonExtractPage jsonExtractPage1;
    if(StringUtils.isNotBlank(jsonExtract)){
    jsonExtractPage1 = JSONObject.parseObject(decOrder1.getJsonExtract(), JsonExtractPage.class);
    jsonExtractPage1.setJsEta(jsonExtractPage.getJsEta());
    jsonExtractPage1.setJsHy(jsonExtractPage.getJsHy());
    jsonExtractPage1.setJsJzxNum(jsonExtractPage.getJsJzxNum());
    jsonExtractPage1.setJsWeight(jsonExtractPage.getJsWeight());
    jsonExtractPage1.setJsTj(jsonExtractPage.getJsTj());

    //json对象和字符串互转
    //JSONObject json = JSONObject.fromObject(str);
    String jsonString = JSON.toJSONString(jsonExtractPage1);
    decOrder1.setJsonExtract(jsonString);
    }else{
    String jsonString = JSON.toJSONString(jsonExtractPage);
    decOrder1.setJsonExtract(jsonString);
    }



    MyBeanUtils.copyBeanNotNull2Bean(decOrder, decOrder1);
    decOrderService.updateMain(decOrder1, goodsCodeList);
    systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
    }catch(Exception e){
    e.printStackTrace();
    message = "更新业务订单表失败";
    throw new BusinessException(e.getMessage());
    }
    j.setMsg(message);
    return j;
    }

    二、

    String str = String.valueOf(map.get("json_extract"));
    JSONObject json = JSONObject.parseObject(str);
    String jsBLorawbNo = json.getString("jsBLorawbNo");/**B/L OR AWB NO*/
    String jsEta = json.getString("jsEta");/**ETA*/
    String jsHy = json.getString("jsHy");/**海运整柜(注明箱型)*/
    String jsJzxNum = json.getString("jsJzxNum");/**集装箱数量*/
    String jsWeight = json.getString("jsWeight");/**毛重*/
    String jsTj = json.getString("jsTj");/**体积*/
    String jsSumfy = json.getString("jsSumfy");/**物流费用合计金额*/
    String jsGsje = json.getString("jsGsje");/**关税金额(必须和关税单金额核对)*/
    String jsZzs = json.getString("jsZzs");/**增值税(必须和关税单金额核对)*/
    String jsFybm = json.getString("jsFybm");/**费用部门*/

  • 相关阅读:
    洛谷.4717.[模板]快速沃尔什变换(FWT)
    BZOJ.4589.Hard Nim(FWT)
    BZOJ.1758.[WC2010]重建计划(分数规划 点分治 单调队列/长链剖分 线段树)
    BZOJ.4543.[POI2014]Hotel加强版(长链剖分 树形DP)
    Vijos.lxhgww的奇思妙想(k级祖先 长链剖分)
    Codeforces.741D.Arpa’s letter-marked tree and Mehrdad’s Dokhtar-kosh paths(dsu on tree 思路)
    Codeforces.600E.Lomsat gelral(dsu on tree)
    11.7 NOIP模拟赛
    11.5 正睿停课训练 Day16
    Maven与Nexus3.x环境构建详解
  • 原文地址:https://www.cnblogs.com/xueblvip/p/12557448.html
Copyright © 2020-2023  润新知