Commit 7d49b426 authored by tangwei's avatar tangwei

修改转换类

parent 5c599972
......@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationNodeEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationProcessStateEnum;
import com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationDto;
......@@ -237,14 +238,6 @@ public void updateSeve(String peasantHouseholdId, Map<String, Object> kv ){
designInformationnew.setRecUserId(designInformation.getRecUserId());
designInformationnew.setRecUserName(designInformation.getRecUserName());
designInformationnew.setIsDelete(designInformation.getIsDelete());
designInformationnew.setComponentLayout(kv.containsKey("componentLayout")?(List<Object>)kv.get("componentLayout"):null);
designInformationnew.setComponentBracket( kv.containsKey("componentBracket")?(List<Object>)kv.get("componentLayout"):null);
designInformationnew.setConnectionLine( kv.containsKey("connectionLine")?(List<Object>)kv.get("componentLayout"):null);
designInformationnew.setOnceLine( kv.containsKey("onceLine")?(List<Object>)kv.get("componentLayout"):null);
designInformationnew.setAssembly( kv.containsKey("assembly")?(List<Object>)kv.get("componentLayout"):null);
designInformationnew.setInverter( kv.containsKey("inverter")?(List<Object>)kv.get("componentLayout"):null);
designInformationnew.setElectricityMeter( kv.containsKey("electricityMeter")?(List<Object>)kv.get("componentLayout"):null);
designInformationnew.setSupport( kv.containsKey("support")?(List<Object>)kv.get("componentLayout"):null);
designInformationMapper.updateById(designInformationnew);
}else{
......@@ -259,11 +252,12 @@ public void updateSeve(String peasantHouseholdId, Map<String, Object> kv ){
public <T> T mapToBean(Map<String, Object> map, Class<T> clazz) {
ObjectMapper objectMapper= new ObjectMapper();
T bean =null;
try {
bean = clazz.newInstance();
BeanMap beanMap = BeanMap.create(bean);
beanMap.putAll(map);
bean = objectMapper.convertValue(map,clazz);
}catch (Exception e){
throw new BaseException(" 数据转化异常!","400","数据转化异常!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment