Commit 956e5822 authored by Lambertliu's avatar Lambertliu

fix(jg):工业管道详情返回单位类型

parent 887017f1
...@@ -13,6 +13,8 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams; ...@@ -13,6 +13,8 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory; import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.EquipSourceEnum; import com.yeejoin.amos.boot.module.jg.api.enums.EquipSourceEnum;
...@@ -33,11 +35,11 @@ import org.springframework.stereotype.Service; ...@@ -33,11 +35,11 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StopWatch; import org.springframework.util.StopWatch;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
...@@ -116,6 +118,8 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP ...@@ -116,6 +118,8 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
private ESEquipmentCategory esEquipmentCategory; private ESEquipmentCategory esEquipmentCategory;
@Autowired @Autowired
private DataDictionaryServiceImpl dataDictionaryServiceImpl; private DataDictionaryServiceImpl dataDictionaryServiceImpl;
@Autowired
private RedisUtils redisUtils;
@Override @Override
public boolean saveOrUpdateData(IdxBizJgProjectContraption projectContraption) { public boolean saveOrUpdateData(IdxBizJgProjectContraption projectContraption) {
...@@ -340,6 +344,8 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP ...@@ -340,6 +344,8 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
} }
public Map<String, Map<String, Object>> details(String sequenceNbr) { public Map<String, Map<String, Object>> details(String sequenceNbr) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())) + "", ReginParams.class);
CompanyBo company = reginParams.getCompany();
Map<String, Map<String, Object>> resultMap = new HashMap<>(); Map<String, Map<String, Object>> resultMap = new HashMap<>();
if (ObjectUtils.isEmpty(sequenceNbr)) { if (ObjectUtils.isEmpty(sequenceNbr)) {
resultMap.put(EQUIP_INFO_FORM_ID, Collections.emptyMap()); resultMap.put(EQUIP_INFO_FORM_ID, Collections.emptyMap());
...@@ -349,6 +355,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP ...@@ -349,6 +355,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
Map<String, Object> projectContraptionMap = Optional.ofNullable(baseMapper.getDetail(sequenceNbr)) Map<String, Object> projectContraptionMap = Optional.ofNullable(baseMapper.getDetail(sequenceNbr))
.map(map -> { .map(map -> {
commonServiceImpl.convertStringToJsonobject(map, jsonFields); commonServiceImpl.convertStringToJsonobject(map, jsonFields);
map.put("unitType", company.getCompanyType());
map.put("pipelineList", baseMapper.selectEquipList((String) map.get("SEQUENCE_NBR"))); map.put("pipelineList", baseMapper.selectEquipList((String) map.get("SEQUENCE_NBR")));
return map; return map;
}) })
......
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