master
parent
07cf0b9e26
commit
c39e36eacd
@ -0,0 +1,28 @@ |
|||||||
|
package digital.laboratory.platform.entrustment.convert; |
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray; |
||||||
|
import digital.laboratory.platform.sys.entity.DrugLite; |
||||||
|
|
||||||
|
import java.util.Collections; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* 毒品概要实体 转换类 |
||||||
|
* |
||||||
|
*/ |
||||||
|
public class DrugLiteConvert { |
||||||
|
/** |
||||||
|
* 因为从数据库取出来的字段属性实际是一个JSONObject数组,没有对应的getset方法,所以需要转换 |
||||||
|
* @param drugLitesJson |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
public static List<DrugLite> convertDirtyLiteByJSON(List<DrugLite> drugLitesJson) { |
||||||
|
if (drugLitesJson == null) { |
||||||
|
return Collections.emptyList(); |
||||||
|
} |
||||||
|
String drugToString = JSONArray.toJSONString(drugLitesJson); |
||||||
|
List<DrugLite> drugLiteList = JSONArray.parseArray(drugToString, DrugLite.class); |
||||||
|
return drugLiteList; |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue