通过阿里巴巴 fastjson json 空对象转json null ,
导入maven依赖

        <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
                <version>1.2.23</version>
            </dependency>
RequestDTOitem requestDTO= new RequestDTO();
                String jsonObject =   JSON.toJSONString(requestDTO, SerializerFeature.WriteMapNullValue,
                        SerializerFeature.WriteNullListAsEmpty,
                        SerializerFeature.WriteNullStringAsEmpty,
                        SerializerFeature.WriteNullBooleanAsFalse);
        System.out.println(
                JSON.toJSONString(
                       
                )
        );

//QuoteFieldNames———-输出key时是否使用双引号,默认为true

//WriteMapNullValue——–是否输出值为null的字段,默认为false

//WriteNullNumberAsZero—-数值字段如果为null,输出为0,而非null

//WriteNullListAsEmpty—–List字段如果为null,输出为[],而非null

//WriteNullStringAsEmpty—字符类型字段如果为null,输出为”“,而非null

//WriteNullBooleanAsFalse–Boolean字段如果为null,输出为false,而非nul