select※ 2021-11-16 14:16 采纳率: 90.9%
浏览 49
已结题

代码看不明白,需要各位老人的帮助


    @Override
//1
    public OrderStopEntity stayStop(JSONObject params) {
//2       orderStopEntity 是工具类      =  TypeUtils.castToJavaBean(params, OrderStopEntity.class);
        OrderStopEntity orderStopEntity = TypeUtils.castToJavaBean(params, OrderStopEntity.class);
        String userId = params.getString("userId");
        orderStopEntity.setOrderId(IdUtil.createSerial23(""));
        orderStopEntity.setCustomerInsurance(1);
        orderStopEntity.setCreatedTime(new Date());
        orderStopEntity.setCreatedUserId(userId);
        orderStopEntity.setDeleteType(Const.DELETE_TYPE_1);
        orderStopEntity.setXsStopRemark(sysUserService.selectById(userId).getUsername()+":"+params.getString("xsStopRemark"));
        this.insert(orderStopEntity);
        return orderStopEntity;
    }

请问各位老人,TypeUtils.castToJavaBean(params, OrderStopEntity.class);这段代码是什么意思,可以实现什么功能,难道是特有的方法,拿出来就能用吗?

  • 写回答

2条回答 默认 最新

  • 热心的小伙子 2021-11-16 14:20
    关注

    TypeUtils这应该是你们自己的工具类,将Json数据转成对象

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 2月23日
  • 已采纳回答 2月15日
  • 创建了问题 11月16日