Commit 75a2fa0e authored by lcl's avatar lcl

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys...

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys into V20231129-中建一局二公司
parents e3c74abb 3c3ed822
...@@ -167,6 +167,7 @@ tenant: ...@@ -167,6 +167,7 @@ tenant:
- d_project - d_project
- d_subcontract - d_subcontract
- dim_area - dim_area
- biz_dict_data
# MyBatisPlus配置 # MyBatisPlus配置
......
package com.dsk.cscec.controller;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.R;
import com.dsk.cscec.domain.TreeSelect;
import com.dsk.cscec.domain.bo.BizDictDataBo;
import com.dsk.cscec.service.IBizDictDataService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 字典相关
*
* @author
* @since 2023-12-10
*/
@RequiredArgsConstructor
@RestController
@RequestMapping("/bizDictData")
public class BizDictDataController extends BaseController {
/**
* 服务对象
*/
private final IBizDictDataService iBizDictDataService;
/**
* 查询业务数据字典树形列表
*
* @return
*/
@GetMapping("/tree")
public R<List<TreeSelect>> tree(@Validated BizDictDataBo bo) {
return R.ok(iBizDictDataService.buildDeptTreeSelect(bo));
}
}
package com.dsk.cscec.controller;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.cscec.domain.bo.CustomerInfoBo;
import com.dsk.cscec.domain.vo.CustomerInfoVo;
import com.dsk.cscec.service.ICustomerInfoService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* 供应商相关
*
* @author
* @since 2023-12-10
*/
@RequiredArgsConstructor
@RestController
@RequestMapping("/customerInfo")
public class CustomerInfoController extends BaseController {
/**
* 服务对象
*/
private final ICustomerInfoService iCustomerInfoService;
/**
* 供应商分类列表
*/
@PostMapping("/list")
public TableDataInfo<CustomerInfoVo> list(@Validated @RequestBody CustomerInfoBo bo,@RequestBody PageQuery query) {
return iCustomerInfoService.queryPageList(bo, query);
}
}
package com.dsk.cscec.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 业务数据字典对象 biz_dict_data
*
* @author ruoyi
* @date 2021-11-08
*/
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("biz_dict_data")
public class BizDictData implements Serializable {
private static final long serialVersionUID=1L;
/**
* 编码
*/
@TableId(value = "id")
private String id;
private String ancestors;
/**
* 字典编码
*/
private String code;
/**
* 字典名称
*/
private String name;
/**
* 系统字典表 biz_dict_data_type
*/
private String type;
/**
* 字典父级id
*/
private String parentId;
@TableField(exist = false)
private String parentName;
/**
* 备注
*/
private String remark;
/**
* 删除标志(0代表存在 2代表删除)
*/
@TableLogic
private String delFlag;
@TableField(exist = false)
private List<BizDictData> children = new ArrayList<BizDictData>();
}
package com.dsk.cscec.domain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;
/**
* Treeselect树结构实体类
*
* @author ruoyi
*/
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class TreeSelect implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 节点ID
*/
private String id;
/**
* 节点名称
*/
private String label;
/**
* 子节点
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<TreeSelect> children;
public TreeSelect(BizDictData dept) {
this.id = dept.getId();
this.label = dept.getName();
this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
}
}
package com.dsk.cscec.domain.bo;
import com.dsk.common.core.domain.BaseEntity;
import com.dsk.common.core.validate.AddGroup;
import com.dsk.common.core.validate.EditGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* 业务数据字典业务对象 biz_dict_data
*
* @author ruoyi
* @date 2021-11-08
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BizDictDataBo extends BaseEntity {
/**
* 编码
*/
@NotNull(message = "编码不能为空", groups = { EditGroup.class })
private String id;
/**
* 字典编码
*/
private String code;
/**
* 字典名称
*/
@NotBlank(message = "字典名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String name;
/**
* 系统字典表 biz_dict_data_type
*/
@NotBlank(message = "系统字典表 biz_dict_data_type不能为空", groups = { AddGroup.class, EditGroup.class })
private String type;
/**
* 字典父级id
*/
@NotNull(message = "字典父级id不能为空", groups = { AddGroup.class, EditGroup.class })
private String parentId;
/**
* 分页大小
*/
private Integer pageSize;
/**
* 当前页数
*/
private Integer pageNum;
/**
* 排序列
*/
private String orderByColumn;
/**
* 排序的方向desc或者asc
*/
private String isAsc;
/**
* 祖级列表
*/
private String ancestors;
}
package com.dsk.cscec.domain.bo;
import com.dsk.common.core.domain.BaseEntity;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotEmpty;
import java.util.Date;
import java.util.List;
/**
* 供应商分类查询
*
* @author
* @since 2023-12-10
*/
@Data
public class CustomerInfoBo extends BaseEntity {
/**
* 供应商类别(分供,劳务分包,专业分包,租赁,劳务分包队伍)
*/
@NotEmpty(message = "供应商类别不能为空")
private String customerClass;
/**
* 劳务队伍标志(Y N)
*/
private String serviceTeamLogo;
/**
* 供应商名称
*/
private String customerName;
/**
* 注册地区域(东北地区,华东地区,华中地区,华北地区,华南地区,西北地区,西南地区)
*/
private List<String> registerRegion;
/**
* 省份
*/
private List<String> registerProvince;
/**
* 城市
*/
private List<String> registerCity;
/**
* 供应商状态(不合格,优质,合格,移出,预警)
*/
private List<String> customerState;
/**
* 资质等级(一级,二级,三级,不分等级,特级)
*/
private List<String> credential;
/**
* 专业类别id
*/
private List<String> groupSpecialtyId;
/**
* 集团专业类别
*/
private String groupSpecialty;
/**
* 考评等级(A,B,C,Z)
*/
private List<String> creditLevel;
/**
* 纳税人身份(一般纳税人,小规模纳税人)
*/
private List<String> paytaxType;
/**
* 纳税人税率(免税,3%,6%,11%,17%)
*/
private List<String> taxRate;
/**
* 准入时间开始
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date approveDate2Start;
/**
* 准入时间结束
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date approveDate2End;
/**
* 队长名称
*/
private String leaderName;
}
package com.dsk.cscec.domain.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import lombok.Data;
import java.util.Date;
/**
* 供应商分类查询
*
* @author
* @since 2023-12-10
*/
@Data
@ExcelIgnoreUnannotated
public class CustomerInfoVo {
private static final long serialVersionUID = 1L;
/**
* 客商主键
*/
private Long customerKey;
/**
* ipm供应商id
*/
private String customerId;
/**
* 供应商编号
*/
private String customerCode;
/**
* 供应商名称
*/
private String customerName;
/**
* 供应商状态
*/
private String customerState;
/**
* 推荐公司ID
*/
private String recommendOrgId;
/**
* 推荐公司
*/
private String recommendOrg;
/**
* 注册地区域
*/
private String registerRegion;
/**
* 省份
*/
private String registerProvince;
/**
* 城市
*/
private String registerCity;
/**
* 集团专业类别
*/
private String groupSpecialty;
/**
* 法人代表
*/
private String representative;
/**
* 纳税人身份
*/
private String paytaxType;
/**
* 纳税人税率
*/
private String taxRate;
/**
* 施工承包范围
*/
private String constructJobScope;
/**
* 资质等级
*/
private String credential;
/**
* 注册资金
*/
private Double registerCapital;
/**
* 联系人
*/
private String contactPerson;
/**
* 联系人电话
*/
private String contactPhone;
/**
* 准入时间
*/
private Date approveDate2;
/**
* 供应商类别
*/
private String customerClass;
/**
* 考评等级
*/
private String creditLevel;
/**
* 二级市场企业编码
*/
private String secondaryCode;
/**
* 统一社会信用代码/营业执照号码
*/
private String unifySocialCode;
/**
* 队长名称
*/
private String leaderName;
/**
* 劳务队长身份证号
*/
private String laborCaptainIdcard;
/**
* 劳务队长联系电话
*/
private String laborCaptainPhone;
/**
* 队伍规模人数
*/
private Double serviceTeamPersonnum;
/**
* 专业特长
*/
private String serviceTeamSpeciality;
/**
* 公司合作数量
*/
private Integer enterpriseCooperationCount;
/**
* 合作项目数量
*/
private Integer projectCooperationCount;
/**
* 资源平台分类
*/
}
package com.dsk.cscec.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.cscec.domain.BizDictData;
import com.dsk.cscec.domain.bo.BizDictDataBo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 业务数据字典Mapper接口
*
* @author ruoyi
* @date 2021-11-08
*/
public interface BizDictDataMapper extends BaseMapper<BizDictData> {
public List<Long> findIdByName(String name);
BizDictData findByNameAndType(@Param("name") String name, @Param("type") String type);
int countByName(@Param("name") String name, @Param("type") String type);
List<BizDictData> exportListVo(@Param("bo") BizDictDataBo bo);
/**
* 根据ID查询相关数据
*
* @param id
* @return 查询到的数据
*/
BizDictData queryByID(Long id);
}
...@@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsk.cscec.domain.DCustomer; import com.dsk.cscec.domain.DCustomer;
import com.dsk.cscec.domain.bo.CustomerInfoBo;
import com.dsk.cscec.domain.bo.DCustomerSearchBo; import com.dsk.cscec.domain.bo.DCustomerSearchBo;
import com.dsk.cscec.domain.vo.CustomerInfoVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -20,5 +22,13 @@ public interface DCustomerMapper extends BaseMapper<DCustomer> { ...@@ -20,5 +22,13 @@ public interface DCustomerMapper extends BaseMapper<DCustomer> {
Page<DCustomer> allSearchList(IPage<DCustomerSearchBo> build, @Param("bo") DCustomerSearchBo bo); Page<DCustomer> allSearchList(IPage<DCustomerSearchBo> build, @Param("bo") DCustomerSearchBo bo);
/**
* 分类查询供应商列表
* @param build
* @param bo
* @return
*/
Page<CustomerInfoVo> queryListByType(IPage<CustomerInfoBo> build, @Param("bo") CustomerInfoBo bo);
} }
package com.dsk.cscec.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.cscec.domain.BizDictData;
import com.dsk.cscec.domain.TreeSelect;
import com.dsk.cscec.domain.bo.BizDictDataBo;
import java.util.List;
/**
* 业务数据字典Service接口
*
* @author ruoyi
* @date 2021-11-08
*/
public interface IBizDictDataService extends IService<BizDictData> {
/**
* 查询单个
*
* @return
*/
BizDictData queryById(Long id);
/**
* 查询列表
*/
TableDataInfo<BizDictData> queryPageList(BizDictDataBo bo, PageQuery query);
/**
* 查询列表
*/
List<BizDictData> queryList(BizDictDataBo bo);
String importDict(List<BizDictData> dictList, String type, String operName);
List<TreeSelect> buildDeptTreeSelect(BizDictDataBo bo);
}
package com.dsk.cscec.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.cscec.domain.DCustomer;
import com.dsk.cscec.domain.bo.CustomerInfoBo;
import com.dsk.cscec.domain.vo.CustomerInfoVo;
/**
* 组织维表(DCustomer)表服务接口
*
* @author
* @since 2023-12-10
*/
public interface ICustomerInfoService extends IService<DCustomer> {
TableDataInfo<CustomerInfoVo> queryPageList(CustomerInfoBo bo, PageQuery query);
}
package com.dsk.cscec.service.impl;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.exception.ServiceException;
import com.dsk.common.utils.StringUtils;
import com.dsk.cscec.domain.BizDictData;
import com.dsk.cscec.domain.TreeSelect;
import com.dsk.cscec.domain.bo.BizDictDataBo;
import com.dsk.cscec.mapper.BizDictDataMapper;
import com.dsk.cscec.service.IBizDictDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 业务数据字典Service业务层处理
*
* @author ruoyi
* @date 2021-11-08
*/
@Slf4j
@Service
public class BizDictDataServiceImpl extends ServiceImpl<BizDictDataMapper, BizDictData> implements IBizDictDataService {
@Override
public BizDictData queryById(Long id) {
return baseMapper.queryByID(id);
}
@Override
public TableDataInfo<BizDictData> queryPageList(BizDictDataBo bo, PageQuery query) {
Page<BizDictData> result = baseMapper.selectPage(query.build(), buildQueryWrapper(bo));
return TableDataInfo.build(result);
}
@Override
public List<BizDictData> queryList(BizDictDataBo bo) {
return baseMapper.selectList(buildQueryWrapper(bo));
}
private LambdaQueryWrapper<BizDictData> buildQueryWrapper(BizDictDataBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<BizDictData> lqw = Wrappers.lambdaQuery();
lqw.like(StringUtils.isNotBlank(bo.getCode()), BizDictData::getCode, bo.getCode());
lqw.like(StringUtils.isNotBlank(bo.getName()), BizDictData::getName, bo.getName());
lqw.eq(StringUtils.isNotBlank(bo.getType()), BizDictData::getType, bo.getType());
lqw.eq(bo.getParentId() != null, BizDictData::getParentId, bo.getParentId());
return lqw;
}
/**
* 保存前的数据校验
*
* @param entity 实体类数据
*/
private void validEntityBeforeSave(BizDictData entity) {
//TODO 做一些数据校验,如唯一约束
//code唯一校验
if (StringUtils.isNotBlank(entity.getCode())) {
LambdaQueryWrapper<BizDictData> lqw = Wrappers.lambdaQuery();
lqw.eq(BizDictData::getType, entity.getType());
lqw.eq(BizDictData::getCode, entity.getCode());
lqw.ne(ObjectUtil.isNotNull(entity.getId()), BizDictData::getId, entity.getId());
List<BizDictData> dictDataList = baseMapper.selectList(lqw);
if (CollectionUtils.isNotEmpty(dictDataList)) {
Assert.isTrue(false, "编码 " + entity.getCode() + " 已存在");
}
}
}
public List<BizDictData> buildDeptTree(List<BizDictData> depts) {
List<BizDictData> returnList = new ArrayList<BizDictData>();
List<String> tempList = new ArrayList<String>();
for (BizDictData dept : depts) {
tempList.add(dept.getId());
}
for (BizDictData dept : depts) {
// 如果是顶级节点, 遍历该父节点的所有子节点
if (!tempList.contains(dept.getParentId())) {
recursionFn(depts, dept);
returnList.add(dept);
}
}
if (returnList.isEmpty()) {
returnList = depts;
}
return returnList;
}
/**
* 递归列表
*/
private void recursionFn(List<BizDictData> list, BizDictData t) {
// 得到子节点列表
List<BizDictData> childList = getChildList(list, t);
t.setChildren(childList);
for (BizDictData tChild : childList) {
if (hasChild(list, tChild)) {
recursionFn(list, tChild);
}
}
}
/**
* 得到子节点列表
*/
private List<BizDictData> getChildList(List<BizDictData> list, BizDictData t) {
List<BizDictData> tlist = new ArrayList<BizDictData>();
for (BizDictData n : list) {
if (ObjectUtil.isNotNull(n.getParentId()) && n.getParentId().equals(t.getId())) {
tlist.add(n);
}
}
return tlist;
}
/**
* 判断是否有子节点
*/
private boolean hasChild(List<BizDictData> list, BizDictData t) {
return getChildList(list, t).size() > 0;
}
@Override
public String importDict(List<BizDictData> dictList, String type, String operName) {
int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
for (BizDictData dictData : dictList) {
try {
Assert.notNull(dictData.getName(), "字典名称不能为空");
dictData.setType(type);
//查询编码是否重复
validEntityBeforeSave(dictData);
//查询名称是否重复
Assert.isFalse(baseMapper.countByName(dictData.getName(), type) != 0, "字典名称已存在");
//查询是否有父级
if (StrUtil.isNotBlank(dictData.getParentName())) {
BizDictData bizDictData = baseMapper.findByNameAndType(dictData.getParentName(), type);
if (bizDictData != null) {
dictData.setParentId(bizDictData.getId());
dictData.setAncestors(bizDictData.getAncestors() + "," + bizDictData.getId());
} else {
// bizDictData = new BizDictData();
// bizDictData.setName(dictData.getParentName());
// bizDictData.setType(type);
// this.save(bizDictData);
// dictData.setParentId(bizDictData.getId());
Assert.isTrue(false, "父级 " + dictData.getParentName() + " 不存在");
}
} else {
dictData.setParentId("0");
}
this.save(dictData);
successNum++;
successMsg.append("<br/>" + successNum + "、字典 " + dictData.getName() + " 导入成功");
} catch (Exception e) {
failureNum++;
String msg = "<br/>" + failureNum + "、字典 " + dictData.getName() + " 导入失败:";
failureMsg.append(msg + e.getMessage());
log.error("BizDictDataServiceImpl.importDict() error:" + msg, e);
}
}
if (failureNum > 0) {
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
throw new ServiceException(failureMsg.toString());
} else {
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
}
@Override
public List<TreeSelect> buildDeptTreeSelect(BizDictDataBo bo) {
List<BizDictData> list = baseMapper.selectList(buildQueryWrapper(bo));
List<BizDictData> deptTrees = buildDeptTree(list);
return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
}
}
package com.dsk.cscec.service.impl;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.cscec.domain.DCustomer;
import com.dsk.cscec.domain.bo.CustomerInfoBo;
import com.dsk.cscec.domain.vo.CustomerInfoVo;
import com.dsk.cscec.mapper.DCustomerMapper;
import com.dsk.cscec.mapper.DSubcontractMapper;
import com.dsk.cscec.service.ICustomerInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 组织维表(DCustomer)表服务实现类
*
* @author
* @since 2023-12-10
*/
@Service
public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer> implements ICustomerInfoService {
@Autowired
private DSubcontractMapper subcontractMapper;
@Override
public TableDataInfo<CustomerInfoVo> queryPageList(CustomerInfoBo bo, PageQuery query) {
if("劳务分包".equals(bo.getCustomerClass())){
bo.setServiceTeamLogo("N");
}
if("劳务分包队伍".equals(bo.getCustomerClass())){
bo.setCustomerClass("劳务分包");
bo.setServiceTeamLogo("Y");
}
Page<CustomerInfoVo> page = baseMapper.queryListByType(query.build(), bo);
if (CollectionUtils.isNotEmpty(page.getRecords())) {
for (CustomerInfoVo customerInfoVo : page.getRecords()) {
//公司合作数量
customerInfoVo.setEnterpriseCooperationCount(subcontractMapper.selectEnterpriseCountByCustomerId(customerInfoVo.getCustomerId()));
//项目合作数量
customerInfoVo.setProjectCooperationCount(subcontractMapper.selectProjectCountByCustomerId(customerInfoVo.getCustomerId()));
}
}
return TableDataInfo.build(page);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dsk.cscec.mapper.BizDictDataMapper">
<resultMap type="com.dsk.cscec.domain.BizDictData" id="BizDictDataResult">
<result property="id" column="id"/>
<result property="code" column="code"/>
<result property="name" column="name"/>
<result property="type" column="type"/>
<result property="parentId" column="parent_id"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="Base_Column_List">
id,code,name,type,parent_id,remark
</sql>
<select id="findIdByName" resultType="java.lang.Long">
select id from biz_dict_data where `name` like concat('%',#{name},'%')
</select>
<select id="findByNameAndType" resultType="com.dsk.cscec.domain.BizDictData">
select id,name,code,ancestors from biz_dict_data
where `name` = #{name}
and type = #{type}
and del_flag = 0
</select>
<select id="countByName" resultType="java.lang.Integer">
SELECT
count( id )
FROM
biz_dict_data
WHERE
del_flag = 0
<if test="type != null and type != ''">
AND `type` = #{type}
</if>
AND `name` = #{name}
</select>
<select id="exportListVo" resultType="com.dsk.cscec.domain.BizDictData">
select t.id,t.name,t.parent_id,t1.name parentName, t.unit,t.remark,t.code,t.feature from biz_dict_data t
left join biz_dict_data t1 on t.parent_id=t1.id
where
t.del_flag=0
and t.`type`=#{bo.type}
<if test="bo.name != null and bo.name != ''">
and (t.name like concat('%',#{bo.name},'%') or t1.name like concat('%',#{bo.name},'%'))
</if>
</select>
<select id="queryByID" resultType="com.dsk.cscec.domain.BizDictData">
select <include refid="Base_Column_List"/>
from biz_dict_data where del_flag = 0
and id = #{id}
</select>
</mapper>
...@@ -65,4 +65,119 @@ ...@@ -65,4 +65,119 @@
order by approve_date2 desc order by approve_date2 desc
</select> </select>
<sql id="allColumn">
customer_key, customer_id, cusomer_name, fin_customer_code, fin_customer_name, tax_number, isvalid, customer_code,
customer_name, customer_state, recommend_org_id, recommend_org, approve_date2, version, supplier_id, customer_category_code,
representative, register_no, unify_social_code, business_license, orgnization_code, register_capital, primary_business,
credential, brand, address, register_city_id, register_region, register_province, register_city, open_bank, bank_account,
contact_person, contact_phone, mobile, zipcode, email, website, remark, area_code, currency, orgnization_id, customer_type,
credit_situation, employee_id, establish_date, phone_code, customer_property, sector_position, scope, fax, customer_class,
id_card, sub_company, allied_company, turn_over, main_customer, main_resource, main_region, raw_material, productline,
customer_category_type, customer_firm, customertype_id, customer_category_type_id, register_address, warehouse_address,
teamwork_product, isfactoryorfranchise, expire_date1, expire_date2, expire_date3, expire_date4, expire_date5, leader_name,
group_specialty_id, group_specialty, manage_ability, product_quality_ability, construct_job_scope, responsible_person,
approve_date1, isagree, business_manager, project_manager, purchase_principal, upper_company_code, service_team_logo,
labor_captain_idcard, labor_captain_phone, service_team_personnum, service_team_speciality, secondary_code, approve_date3,
approve_date4, flow_state, isenterbjlaborcomany, expire_date6, expire_date7, credit_level, base_logo, recommend_project,
recommend_project_id, recommend_date, aptitude_card, work_safety_license, master_id, paytax_type, tax_rate, card_type,
customer_score, customer_name2, customer_name3, customer_name4, country, fin_customer_type, company_code, owner_kind,
customer_kind, data_source, isowner, iscustomer, abbr_name1, abbr_name2, tax_type, isfreeze, update_date, load_time
</sql>
<sql id="columnByType">
customer_key, customer_id, customer_code, customer_name, customer_state, recommend_org_id, recommend_org,
register_region,register_province,register_city,group_specialty,representative,paytax_type,tax_rate,
construct_job_scope,credential,register_capital,contact_person,contact_phone,approve_date2,credit_level,
secondary_code,unify_social_code,primary_business,leader_name,labor_captain_phone,labor_captain_idcard,
service_team_personnum,service_team_speciality
</sql>
<select id="queryListByType" resultType="com.dsk.cscec.domain.vo.CustomerInfoVo">
select
<include refid="columnByType"></include>
from d_customer
where
recommend_org_id = 'F17305B4EA4444CBAB12892C7B99E475'
<if test="bo.customerClass != null and bo.customerClass != ''">
and customer_class = #{bo.customerClass}
</if>
<if test="bo.serviceTeamLogo != null and bo.serviceTeamLogo == 'Y'.toString()">
and leader_name is not null
</if>
<if test="bo.serviceTeamLogo != null and bo.serviceTeamLogo == 'N'.toString()">
and leader_name is null
</if>
<if test="bo.leaderName != null and bo.leaderName != ''">
and leader_name like concat('%',#{bo.leaderName},'%')
</if>
<if test="bo.customerName != null and bo.customerName != '' ">
and customer_name like concat('%',#{bo.customerName},'%')
</if>
<if test="bo.registerProvince != null and bo.registerCity == null">
and register_province in
<foreach collection="bo.registerProvince" item="registerProvince" separator="," open="(" close=")">
#{registerProvince}
</foreach>
</if>
<if test="bo.registerProvince == null and bo.registerCity != null ">
and register_city in
<foreach collection="bo.registerCity" item="registerCity" separator="," open="(" close=")">
#{registerCity}
</foreach>
</if>
<if test="bo.registerProvince != null and bo.registerCity != null ">
and (
register_province in
<foreach collection="bo.registerProvince" item="registerProvince" separator="," open="(" close=")">
#{registerProvince}
</foreach>
or register_city in
<foreach collection="bo.registerCity" item="registerCity" separator="," open="(" close=")">
#{registerCity}
</foreach>
)
</if>
<if test="bo.groupSpecialtyId != null ">
<foreach collection="bo.groupSpecialtyId" item="groupSpecialtyId">
and find_in_set(#{groupSpecialtyId},group_specialty_id) > 0
</foreach>
</if>
<if test="bo.customerState != null ">
and customer_state in
<foreach collection="bo.customerState" item="customerState" separator="," open="(" close=")">
#{customerState}
</foreach>
</if>
<if test="bo.credential != null ">
and credential in
<foreach collection="bo.credential" item="credential" separator="," open="(" close=")">
#{credential}
</foreach>
</if>
<if test="bo.creditLevel != null ">
and credit_level in
<foreach collection="bo.creditLevel" item="creditLevel" separator="," open="(" close=")">
#{creditLevel}
</foreach>
</if>
<if test="bo.paytaxType != null">
and paytax_type in
<foreach collection="bo.paytaxType" item="paytaxType" separator="," open="(" close=")">
#{paytaxType}
</foreach>
</if>
<if test="bo.taxRate != null">
and tax_rate in
<foreach collection="bo.taxRate" item="taxRate" separator="," open="(" close=")">
#{taxRate}
</foreach>
</if>
<if test="bo.approveDate2Start != null">
and approve_date2 &gt;= #{bo.approveDate2Start}
</if>
<if test="bo.approveDate2End != null">
and date(approve_date2) &lt;= #{bo.approveDate2End}
</if>
order by approve_date2 desc
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -13,7 +13,7 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true ...@@ -13,7 +13,7 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
# 子系统地址 # 子系统地址
# VUE_APP_SUB_SYSTEM_ADDRESS = "https://pre-plug.jiansheku.com" # VUE_APP_SUB_SYSTEM_ADDRESS = "https://pre-plug.jiansheku.com"
VUE_APP_SUB_SYSTEM_ADDRESS = "http://192.168.60.104:3400" VUE_APP_SUB_SYSTEM_ADDRESS = "http://192.168.60.210:3400"
# Bi大屏系统地址 # Bi大屏系统地址
VUE_APP_BI_SYSTEM_ADDRESS = "https://192.168.60.104:8001" VUE_APP_BI_SYSTEM_ADDRESS = "https://192.168.60.104:8001"
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="master_svg0_233_92225/11_04941"><rect x="0" y="0" width="16" height="16" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_233_92225/11_04941)"><g><path d="M0.5,3.5L0.5,12.5Q0.5,13.1213,0.93934,13.5607Q1.3786800000000001,14,2,14L14,14Q14.6213,14,15.0607,13.5607Q15.5,13.1213,15.5,12.5L15.5,3.5Q15.5,2.878679,15.0607,2.4393399Q14.6213,2,14,2L2,2Q1.3786800000000001,2,0.9393398,2.4393399Q0.5,2.87868,0.5,3.5ZM1.646447,12.8536Q1.5,12.7071,1.5,12.5L1.5,3.5Q1.5,3.292893,1.646447,3.146447Q1.7928929999999998,3,2,3L14,3Q14.2071,3,14.3536,3.146447Q14.5,3.292894,14.5,3.5L14.5,12.5Q14.5,12.7071,14.3536,12.8536Q14.2071,13,14,13L2,13Q1.792894,13,1.646447,12.8536Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M7.5,10L7.5,11Q7.5,11.04925,7.509607,11.09755Q7.519215,11.14585,7.53806,11.19134Q7.556906,11.23684,7.584265,11.27779Q7.611625,11.31873,7.646447,11.35356Q7.681269,11.38838,7.722215,11.41574Q7.763161,11.4431,7.808658,11.46194Q7.854155,11.48079,7.9024549,11.49039Q7.9507543,11.5,8,11.5Q8.0492457,11.5,8.0975451,11.49039Q8.145845,11.48079,8.191342,11.46194Q8.236839,11.4431,8.277785,11.41574Q8.318731,11.38838,8.353553,11.35356Q8.388375,11.31873,8.415735,11.27779Q8.443094,11.23684,8.46194,11.19134Q8.480785000000001,11.14585,8.490393,11.09755Q8.5,11.04925,8.5,11L8.5,10Q8.5,9.9507543,8.490393,9.9024549Q8.480785000000001,9.854155,8.46194,9.808658Q8.443094,9.763161,8.415735,9.722215Q8.388375,9.681269,8.353553,9.646447Q8.318731,9.611625,8.277785,9.584265Q8.236839,9.556906,8.191342,9.53806Q8.145845,9.519214999999999,8.0975451,9.509607Q8.0492457,9.5,8,9.5Q7.9507543,9.5,7.9024549,9.509607Q7.854155,9.519214999999999,7.808658,9.53806Q7.763161,9.556906,7.722215,9.584265Q7.681269,9.611625,7.646447,9.646447Q7.611625,9.681269,7.584265,9.722215Q7.556906,9.763161,7.53806,9.808658Q7.519215,9.854155,7.509607,9.9024549Q7.5,9.9507543,7.5,10Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M5.5,9L5.5,11Q5.5,11.04925,5.509607,11.09754Q5.519215,11.14584,5.53806,11.19134Q5.556906,11.23684,5.584265,11.27778Q5.611625,11.31873,5.646447,11.35355Q5.681269,11.38838,5.722215,11.41573Q5.763161,11.44309,5.808658,11.46194Q5.854155,11.48078,5.9024549,11.49039Q5.9507543,11.5,6,11.5Q6.0492457,11.5,6.0975451,11.49039Q6.145845,11.48078,6.191342,11.46194Q6.236839,11.44309,6.277785,11.41573Q6.318731,11.38838,6.353553,11.35355Q6.388375,11.31873,6.415735,11.27779Q6.443094,11.23684,6.46194,11.19134Q6.480785,11.14584,6.490393,11.09754Q6.5,11.04925,6.5,11L6.5,9Q6.5,8.9507543,6.490393,8.9024549Q6.480785,8.854155,6.46194,8.808658Q6.443094,8.763161,6.415735,8.722215Q6.388375,8.681269,6.353553,8.646447Q6.318731,8.611625,6.277785,8.584265Q6.236839,8.556906,6.191342,8.53806Q6.145845,8.519214999999999,6.0975451,8.509607Q6.0492457,8.5,6,8.5Q5.9507543,8.5,5.9024549,8.509607Q5.854155,8.519214999999999,5.808658,8.53806Q5.763161,8.556906,5.722215,8.584265Q5.681269,8.611625,5.646447,8.646447Q5.611625,8.681269,5.584265,8.722215Q5.556906,8.763161,5.53806,8.808658Q5.519215,8.854155,5.509607,8.9024549Q5.5,8.9507543,5.5,9Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M3.5,7L3.5,11Q3.5,11.04925,3.509607,11.09755Q3.519215,11.14584,3.5380599999999998,11.19134Q3.556906,11.23684,3.584265,11.27778Q3.611625,11.31873,3.646447,11.35355Q3.681269,11.38837,3.722215,11.41573Q3.763161,11.44309,3.808658,11.46194Q3.854155,11.48078,3.9024549,11.49039Q3.9507543,11.5,4,11.5Q4.0492457,11.5,4.0975451,11.49039Q4.145845,11.48078,4.191342,11.46194Q4.236839,11.44309,4.277785,11.41573Q4.318731,11.38837,4.353553,11.35355Q4.388375,11.31873,4.415735,11.27778Q4.443094,11.23684,4.46194,11.19134Q4.480785,11.14584,4.490393,11.09755Q4.5,11.04925,4.5,11L4.5,7Q4.5,6.9507543,4.490393,6.9024549Q4.480785,6.854155,4.46194,6.808658Q4.443094,6.763161,4.415735,6.722215Q4.388375,6.681269,4.353553,6.646447Q4.318731,6.611625,4.277785,6.584265Q4.236839,6.556906,4.191342,6.53806Q4.145845,6.519215,4.0975451,6.509607Q4.0492457,6.5,4,6.5Q3.9507543,6.5,3.9024549,6.509607Q3.854155,6.519215,3.808658,6.53806Q3.763161,6.556906,3.722215,6.584265Q3.681269,6.611625,3.646447,6.646447Q3.611625,6.681269,3.584265,6.722215Q3.556906,6.763161,3.5380599999999998,6.808658Q3.519215,6.854155,3.509607,6.9024549Q3.5,6.9507543,3.5,7Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g><g><ellipse cx="10.3787841796875" cy="6.1363677978515625" rx="1.5" ry="1.5" fill-opacity="0" stroke-opacity="1" stroke="#FFFFFF" fill="none" stroke-width="1"/></g><g><path d="M11.5252901796875,7.989980797851563L12.5252311796875,8.989917797851563Q12.5955571796875,9.060247797851563,12.6874421796875,9.098307797851563Q12.7793281796875,9.136367797851562,12.8787841796875,9.136367797851562Q12.9782441796875,9.136367797851562,13.0701241796875,9.098307797851563Q13.1620141796875,9.060247797851563,13.2323341796875,8.989917797851563Q13.3026641796875,8.919597797851562,13.3407241796875,8.827707797851563Q13.3787841796875,8.735827797851563,13.3787841796875,8.636367797851562Q13.3787841796875,8.536911797851563,13.3407241796875,8.445025797851562Q13.3026641796875,8.353140797851562,13.2323341796875,8.282814797851563L12.2323971796875,7.282873797851563L12.2323371796875,7.282814797851563Q12.1620111796875,7.212487797851563,12.0701261796875,7.174427797851562Q11.9782403796875,7.1363677978515625,11.8787841796875,7.1363677978515625Q11.7793279796875,7.1363677978515625,11.6874421796875,7.174427797851562Q11.5955571796875,7.212487797851563,11.5252311796875,7.282814797851563Q11.4549041796875,7.353140797851562,11.4168441796875,7.445025797851563Q11.3787841796875,7.536911597851563,11.3787841796875,7.6363677978515625Q11.3787841796875,7.735823997851562,11.4168441796875,7.827709797851562Q11.4549041796875,7.919594797851563,11.5252311796875,7.989920797851562L11.5252901796875,7.989980797851563Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="14" height="14" viewBox="0 0 14 14"><defs><clipPath id="master_svg0_264_80202"><rect x="0" y="0" width="14" height="14" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_264_80202)"><g><path d="M0.5,3L0.5,11Q0.5,11.62132,0.93934,12.0607Q1.3786800000000001,12.5,2,12.5L12,12.5Q12.6213,12.5,13.0607,12.0607Q13.5,11.62132,13.5,11L13.5,3Q13.5,2.378679,13.0607,1.9393399Q12.6213,1.5,12,1.5L2,1.5Q1.3786800000000001,1.5,0.9393398,1.9393399Q0.5,2.37868,0.5,3ZM1.646447,11.35355Q1.5,11.20711,1.5,11L1.5,3Q1.5,2.792893,1.646447,2.646447Q1.7928929999999998,2.5,2,2.5L12,2.5Q12.2071,2.5,12.3536,2.646447Q12.5,2.792894,12.5,3L12.5,11Q12.5,11.20711,12.3536,11.35355Q12.2071,11.5,12,11.5L2,11.5Q1.792894,11.5,1.646447,11.35355Z" fill-rule="evenodd" fill="#86909C" fill-opacity="1"/></g><g><path d="M6.5,8.75L6.5,9.625002Q6.5,9.674248,6.509607,9.722547Q6.519215,9.77085,6.53806,9.81634Q6.556906,9.86184,6.584265,9.90279Q6.611625,9.94373,6.646447,9.97856Q6.681269,10.01338,6.722215,10.04074Q6.763161,10.0681,6.808658,10.08694Q6.854155,10.10579,6.9024549,10.11539Q6.9507543,10.125,7,10.125Q7.0492457,10.125,7.0975451,10.11539Q7.145845,10.10579,7.191342,10.08694Q7.236839,10.0681,7.277785,10.04074Q7.318731,10.01338,7.353553,9.97856Q7.388375,9.94373,7.415735,9.90279Q7.443094,9.86184,7.46194,9.81634Q7.480785,9.77085,7.490393,9.722547Q7.5,9.674248,7.5,9.625002L7.5,8.75Q7.5,8.7007543,7.490393,8.6524549Q7.480785,8.604155,7.46194,8.558658Q7.443094,8.513161,7.415735,8.472215Q7.388375,8.431269,7.353553,8.396447Q7.318731,8.361625,7.277785,8.334265Q7.236839,8.306906,7.191342,8.28806Q7.145845,8.269214999999999,7.0975451,8.259607Q7.0492457,8.25,7,8.25Q6.9507543,8.25,6.9024549,8.259607Q6.854155,8.269214999999999,6.808658,8.28806Q6.763161,8.306906,6.722215,8.334265Q6.681269,8.361625,6.646447,8.396447Q6.611625,8.431269,6.584265,8.472215Q6.556906,8.513161,6.53806,8.558658Q6.519215,8.604155,6.509607,8.6524549Q6.5,8.7007543,6.5,8.75Z" fill-rule="evenodd" fill="#86909C" fill-opacity="1"/></g><g><path d="M4.75,7.875L4.75,9.625Q4.75,9.67425,4.759607,9.72254Q4.769215,9.77084,4.78806,9.81634Q4.806906,9.86184,4.834265,9.90278Q4.861625,9.94373,4.896447,9.97855Q4.931269,10.01337,4.972215,10.04073Q5.013161,10.06809,5.058658,10.08694Q5.104155,10.10578,5.1524549,10.11539Q5.2007543,10.125,5.25,10.125Q5.2992457,10.125,5.3475451,10.11539Q5.395845,10.10578,5.441342,10.08694Q5.486839,10.06809,5.527785,10.04073Q5.568731,10.01337,5.603553,9.97855Q5.638375,9.94373,5.665735,9.90278Q5.693094,9.86184,5.71194,9.81634Q5.730785,9.77084,5.740393,9.72254Q5.75,9.67425,5.75,9.625L5.75,7.875Q5.75,7.8257543,5.740393,7.7774549Q5.730785,7.729155,5.71194,7.683658Q5.693094,7.638161,5.665735,7.597215Q5.638375,7.556269,5.603553,7.521447Q5.568731,7.486625,5.527785,7.459265Q5.486839,7.431906,5.441342,7.41306Q5.395845,7.394215,5.3475451,7.384607Q5.2992457,7.375,5.25,7.375Q5.2007543,7.375,5.1524549,7.384607Q5.104155,7.394215,5.058658,7.41306Q5.013161,7.431906,4.972215,7.459265Q4.931269,7.486625,4.896447,7.521447Q4.861625,7.556269,4.834265,7.597215Q4.806906,7.638161,4.78806,7.683658Q4.769215,7.729155,4.759607,7.7774549Q4.75,7.8257543,4.75,7.875Z" fill-rule="evenodd" fill="#86909C" fill-opacity="1"/></g><g><path d="M3,6.125L3,9.625Q3,9.67425,3.009607,9.72254Q3.019215,9.77084,3.0380599999999998,9.81634Q3.056906,9.86184,3.084265,9.90278Q3.111625,9.94373,3.146447,9.97855Q3.181269,10.01338,3.222215,10.04073Q3.263161,10.06809,3.308658,10.08694Q3.354155,10.10578,3.4024549,10.11539Q3.4507543,10.125,3.5,10.125Q3.5492457,10.125,3.5975451,10.11539Q3.645845,10.10578,3.691342,10.08694Q3.736839,10.06809,3.777785,10.04073Q3.818731,10.01338,3.853553,9.97855Q3.888375,9.94373,3.915735,9.90278Q3.943094,9.86184,3.9619400000000002,9.81634Q3.980785,9.77084,3.990393,9.72254Q4,9.67425,4,9.625L4,6.125Q4,6.0757543,3.990393,6.0274549Q3.980785,5.979155,3.9619400000000002,5.933658Q3.943094,5.888161,3.915735,5.847215Q3.888375,5.806269,3.853553,5.771447Q3.818731,5.736625,3.777785,5.709265Q3.736839,5.681906,3.691342,5.66306Q3.645845,5.644215,3.5975451,5.634607Q3.5492457,5.625,3.5,5.625Q3.4507543,5.625,3.4024549,5.634607Q3.354155,5.644215,3.308658,5.66306Q3.263161,5.681906,3.222215,5.709265Q3.181269,5.736625,3.146447,5.771447Q3.111625,5.806269,3.084265,5.847215Q3.056906,5.888161,3.0380599999999998,5.933658Q3.019215,5.979155,3.009607,6.0274549Q3,6.0757543,3,6.125Z" fill-rule="evenodd" fill="#86909C" fill-opacity="1"/></g><g><ellipse cx="9.081436157226562" cy="5.36932373046875" rx="1.3125" ry="1.3125" fill-opacity="0" stroke-opacity="1" stroke="#86909C" fill="none" stroke-width="1"/></g><g><path d="M10.040442157226563,7.03543673046875L10.915383157226563,7.91037373046875Q10.985709157226562,7.9807037304687505,11.077594157226562,8.01876373046875Q11.169480157226563,8.05682373046875,11.268936157226562,8.05682373046875Q11.368392157226562,8.05682373046875,11.460276157226563,8.01876373046875Q11.552166157226562,7.9807037304687505,11.622486157226563,7.91037373046875Q11.692816157226563,7.84005373046875,11.730876157226563,7.74816373046875Q11.768936157226562,7.65627973046875,11.768936157226562,7.55682373046875Q11.768936157226562,7.45736773046875,11.730876157226563,7.36548173046875Q11.692816157226563,7.27359673046875,11.622486157226563,7.20327073046875L10.747549157226562,6.3283297304687505L10.747489157226562,6.32827073046875Q10.677163157226563,6.25794373046875,10.585278157226563,6.21988373046875Q10.493392357226563,6.18182373046875,10.393936157226562,6.18182373046875Q10.294479957226562,6.18182373046875,10.202594157226562,6.21988373046875Q10.110709157226562,6.25794373046875,10.040383157226563,6.32827073046875Q9.970056157226562,6.39859673046875,9.931996157226562,6.49048173046875Q9.893936157226562,6.58236753046875,9.893936157226562,6.68182373046875Q9.893936157226562,6.78127993046875,9.931996157226562,6.87316573046875Q9.970056157226562,6.96505073046875,10.040383157226563,7.03537673046875L10.040442157226563,7.03543673046875Z" fill-rule="evenodd" fill="#86909C" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
<template> <template>
<div v-loading="loading" class="market-container">
<iframe id="companyIframe" class="market-iframe" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" width="100%" :src="src" />
</div>
</template> </template>
<script> <script>
import { steerScroll } from '@/assets/js/jskplug';
import { dskAccessToken } from '@/api/common';
import { encodeStr } from "@/assets/js/common";
import MaxPageSizeTip from "@/views/components/MaxPageSizeTip.vue";
import { getUipIdByCid } from '@/api/macro/macro';
export default { export default {
name: 'Enterprise',
components: {
MaxPageSizeTip
},
data() {
return {
encodeStr,
loading: false, // 是否加载完成-当前页控制
iframeTimer: '', // 是否加载中定时器-当前页控制
footHeight: 0, //底部高度,若为0(页面内部嵌套或者没有底部板块)
iframeHight: `${window.innerHeight}px`, // iframe高度-当前页控制
navigation: { isFixed: true, fixedHeight: 56, totalHeight: 68 }, // iframe之外页面顶部对象,ifFixed:是否浮动;fixedHeight:浮动对象高度;totalHeight:顶部整体高度
src: '', //iframe嵌套页面地址
// domain: 'https://plug.jiansheku.com', // 插件地址
// domain: 'https://pre-plug.jiansheku.com', // 插件地址测试
domain: 'http://192.168.60.210:3400',
ak: 'aec7b3ff2y2q8x6t49a7e2c463ce21912', // 需要携带的sdkId
timelongs: 7200,//刷新token时间
tokentimer: null,
showMaxPageTip: false,
iframeIns: null,
};
},
created() {
this.domain = process.env.VUE_APP_SUB_SYSTEM_ADDRESS;
this.gettokens();
this.iframeObserver();
let that = this;
window.addEventListener("message", this.pagecapListener, { passive: true });
window.addEventListener('message', this.linkListener, false);
},
mounted() {
this.iframeLoading(); // 判断iframe页面是否加载完成-当前页控制
// steerScroll('companyIframe', this.navigation, this.footHeight, true); // iframeId: iframe的id;navigation:页面排除iframe后剩下的顶部高度;footHeight: 页面排除iframe后剩下的底部高度;state:监听or移除监听;parentId: 父级id[不带默认就是铺满整个页面]];_this:指向当前实例(可忽略)
},
beforeDestroy() {
clearInterval(this.iframeTimer); // -当前页控制
steerScroll('companyIframe', this.navigation, this.footHeight); // iframeId: iframe的id;navigation:页面排除iframe后剩下的顶部高度;footHeight: 页面排除iframe后剩下的底部高度;state:监听or移除监听;parentId: 父级id[不带默认就是铺满整个页面]];_this:指向当前实例(可忽略)
clearInterval(this.tokentimer);
window.removeEventListener("message", this.pagecapListener, { passive: true });
window.removeEventListener("message", this.linkListener);
// 移除layout样式
this.iframeIns?.contentWindow ? this.iframeIns.contentWindow.postMessage("removeHtmlLayoutStyle", { targetOrigin: this.domain, }) : null;
},
methods: {
linkListener(event) {
let { data, origin } = event;
if (origin != this.domain) return;
if (data.id) {
getUipIdByCid([data.id]).then(res => {
if (res.code == 200) {
if (res.data && res.data.length > 0 && res.data[0].uipId) {
this.$router.push({ path: '/enterprise/' + this.encodeStr(data.id) });
} else {
this.$tab.openPage(data.title, '/company/' + this.encodeStr(data.id));
}
} }
}).catch(error => {
});
} else {
if (data.url) {
this.$tab.openPage(data.title, data.url);
}
}
},
async iframeObserver() {
try {
await this.$nextTick();
this.iframeIns = document.querySelector(".market-iframe");
} catch (error) {
console.log(error);
}
},
// 列表翻页上限
pagecapListener(e) {
const { origin, data } = e;
if (origin != this.domain) return;
if (data == "pageCurrentMaxSize") {
this.$maxTip("您可通过筛选工具来查询数据~若有更多需求请联系客服 0262798729!").then(({ done, uid }) => {
done();
});
}
},
gettokens() {
dskAccessToken().then(res => {
if (res.code == 200) {
this.timelongs = res.data.expire;
this.ak = res.data.accessToken;
this.src = `${this.domain}/search/market?ak=${this.ak}&initTime=${new Date().getTime()}&uid=${this.ak}&origin=${window.location.origin}`;
this.refreshtoken();
} else {
clearTimeout(this.tokentimer);
}
});
},
refreshtoken() {
this.tokentimer = setTimeout(() => {
dskAccessToken().then(res => {
if (res.code == 200) {
this.timelongs = res.data.expire;
this.ak = res.data.accessToken;
let ifam = document.getElementById('companyIframe'); //iframe的id
let akObj = res.data.expire; //accessToken接口的返回值
let initTime = new Date().getTime(); //accessToken接口返回后的当前时间戳
ifam.contentWindow.postMessage({ 'accessToken': akObj.accessToken, 'initTime': initTime }, '*');
} else {
clearTimeout(this.tokentimer);
}
});
}, this.timelongs * 1000);
},
//判断iframe页面是否加载完成-当前页控制
iframeLoading() {
let iframeHeight = document.getElementById("companyIframe").clientHeight, number = 0;
this.iframeTimer = setInterval(() => {
number++;
if (document.getElementById("companyIframe").clientHeight != iframeHeight || number == 5000) {
this.loading = false;
clearInterval(this.iframeTimer);
}
});
}
}
};
</script> </script>
<style> <style lang="scss" scoped>
.market-container {
width: 100%;
height: 100%;
padding: 16px 24px;
padding-right: 15px;
box-sizing: border-box;
position: absolute;
left: 0;
top: 0;
</style> .market-iframe {
\ No newline at end of file width: 100%;
height: 100%;
}
}
</style>
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
border-bottom: 1px solid #EEEEEE; border-bottom: 1px solid #EEEEEE;
color: #232323; color: #232323;
position: sticky; position: sticky;
top: 54px; top: 0;
z-index: 999; z-index: 999;
::v-deep .el-tabs{ ::v-deep .el-tabs{
height: 48px; height: 48px;
......
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