forked from gzzfw/backEnd/gz-dyh

liyj
2024-09-24 f84f34420604009408231793d15a5560ca0debfc
dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/service/GridCompanyService.java
@@ -4,6 +4,7 @@
import cn.huge.base.common.utils.AesUtils;
import cn.huge.base.common.utils.HttpClientUtils;
import cn.huge.base.common.utils.ObjectUtils;
import cn.huge.base.common.utils.SpringContextUtil;
import cn.huge.module.grid.domain.dto.GridCompanyDTO;
import cn.huge.module.grid.domain.vo.*;
import com.alibaba.fastjson.JSON;
@@ -55,7 +56,7 @@
            List<GridCompanyDTO.UnitDTO> records = data.getRecords();
            for(GridCompanyDTO.UnitDTO item :records){
                item.setLegalRepresent(AesUtils.decrypt(item.getLegalRepresent(),"eb4KhdJRyDwS4ndTBc2NTDNaSEP6KbwQ"));
                item.setLegalPersonTelephone(AesUtils.decrypt(item.getLegalPersonTelephone(),"eb4KhdJRyDwS4ndTBc2NTDNaSEP6KbwQ"));
            }
            return R.ok(data);
        } else {
@@ -75,12 +76,17 @@
    public Page pageQuery(GridCompanyVo gridCompanyVo) throws Exception {
        Sort sort = Sort.by(Sort.Direction.DESC, "create_time");
        PageRequest pageRequest = PageRequest.of(gridCompanyVo.getPage()-1, gridCompanyVo.getPageSize(), sort);
//        R<GridCompanyDTO> companyList = getCompanyList(gridCompanyVo);
        R<GridCompanyDTO> companyList = null;
        // 开发环境
        if (SpringContextUtil.checkDev()) {
        String url = "http://183.2.142.46:9007/api/thrid/grid/company/get-company-list";
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-Type", "application/json");
        String s = HttpClientUtils.httpPostRaw(url, JSON.toJSONString(gridCompanyVo), headers, "utf-8");
        R companyList = JSON.parseObject(s, R.class);
            companyList = JSON.parseObject(s, R.class);
        }else {
            companyList = getCompanyList(gridCompanyVo);
        }
        if(companyList.getCode() != 0){
            throw new Exception(companyList.getMsg());
        }