diff --git a/inventory-dao/src/main/java/com/rzyc/bean/pro/EntInfo.java b/inventory-dao/src/main/java/com/rzyc/bean/pro/EntInfo.java new file mode 100644 index 0000000..eb0f1b7 --- /dev/null +++ b/inventory-dao/src/main/java/com/rzyc/bean/pro/EntInfo.java @@ -0,0 +1,98 @@ +package com.rzyc.bean.pro; + +import lombok.Data; + +import java.util.Date; + +/** + * 省厅企业信息 + * @author dong + * @date 2025-04-01 14:30 + * @Version V1.0 + */ +@Data +public class EntInfo { + + + //平台唯一标识 + private String sysUniqueCode; + + //企业唯一编码标识 + private String uniqueCode; + + //企业名称 + private String entName; + + //企业所属区域id + private String areaId; + + //企业所属行业id + private String industryId; + + //统一信用代码 + private String unifiedCode; + + //风险等级 1-红 2-橙3-黄 4-蓝 + private Integer riskLevel; + + //企业规模 + private String scale; + + //组建时间 + private Date setUpDate; + + //法人代表 + private String legalPerson; + + //法人代表联系电话 + private String legalPersonPhone; + + //主要负责人 + private String chargePerson; + + //主要负责人联系电话 + private String chargePersonPhone; + + //安全管理负责人 + private String safetyAdminPerson; + + //安全管理负责人联系方式 + private String safetyAdminPersonPhone; + + //安全管理员 + private String safetyAdmin; + + //安全管理员联系方式 + private String safetyAdminPhone; + + //实际经营地址 + private String operationPlace; + + //从业人数 + private String staffNumber; + + //经营范围 + private String busScope; + + //纬度 + private String lat; + + //经度 + private String lon; + + //理化性质 + private String physicochemical; + + //企业人数是否10人以下 1.是 0.否 + private String isUnderTen; + + //是否是集团公司 1.是 2.否 + private String isGroupCompany; + + //公司属性 1:总公司 2:分公司 + private String companyAttribute; + + //上级公司唯一编码(公司属性为分公司时传值) + private String superCompany; + +} diff --git a/inventory-dao/src/main/java/com/rzyc/model/ent/BaseInClass.java b/inventory-dao/src/main/java/com/rzyc/model/ent/BaseInClass.java index ad63e50..6c6fe08 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/ent/BaseInClass.java +++ b/inventory-dao/src/main/java/com/rzyc/model/ent/BaseInClass.java @@ -41,6 +41,9 @@ public class BaseInClass implements Serializable { @ApiModelProperty("工作单元分类 多个逗号隔开") private String workType; + @ApiModelProperty("工作单元分类 多个逗号隔开") + private String industryId; + @ApiModelProperty("创建时间") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") private Date createdon; @@ -55,6 +58,22 @@ public class BaseInClass implements Serializable { private List baseInClassList; + public String getIndustryId() { + return industryId; + } + + public void setIndustryId(String industryId) { + this.industryId = industryId; + } + + public String getUnitTradeId() { + return unitTradeId; + } + + public void setUnitTradeId(String unitTradeId) { + this.unitTradeId = unitTradeId; + } + public Integer getInType() { return inType; } diff --git a/inventory-dao/src/main/java/com/rzyc/service/ProvinceService.java b/inventory-dao/src/main/java/com/rzyc/service/ProvinceService.java index 7bd21a0..58fdfa2 100644 --- a/inventory-dao/src/main/java/com/rzyc/service/ProvinceService.java +++ b/inventory-dao/src/main/java/com/rzyc/service/ProvinceService.java @@ -5,18 +5,17 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.common.utils.StringUtils; import com.common.utils.TypeConversion; -import com.google.gson.Gson; -import com.google.zxing.Result; +import com.rzyc.bean.pro.EntInfo; +import com.rzyc.model.ent.BaseInClass; import com.rzyc.model.ent.PvIndustry; +import com.rzyc.model.ent.SysEnterprise; import com.rzyc.provinceUtil.EnedUtils; import com.rzyc.provinceUtil.JsonUtils; import com.rzyc.provinceUtil.ProvData; import com.rzyc.provinceUtil.bean.DeptInfo; -import com.rzyc.provinceUtil.bean.IndustryVo; import com.rzyc.provinceUtil.bean.TokenData; import org.springframework.stereotype.Service; -import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -128,15 +127,15 @@ public class ProvinceService extends BaseService{ ProvData> data = JsonUtils.fromJsonComplex(responseStr,ProvData.class, dataListType); Integer index = 1; - for (PvIndustry pvIndustry : data.getData()){ - pvIndustry.setSortId(index); - pvIndustry.setCreateTime(new Date()); - pvIndustry.setModifyTime(new Date()); - pvIndustry.setCreateBy("excel"); - pvIndustry.setModifyBy("excel"); - pvIndustryMapper.insert(pvIndustry); - index++; - } +// for (PvIndustry pvIndustry : data.getData()){ +// pvIndustry.setSortId(index); +// pvIndustry.setCreateTime(new Date()); +// pvIndustry.setModifyTime(new Date()); +// pvIndustry.setCreateBy("excel"); +// pvIndustry.setModifyBy("excel"); +// pvIndustryMapper.insert(pvIndustry); +// index++; +// } System.out.println("data --> "+JSONArray.toJSONString(data)); } @@ -187,6 +186,62 @@ public class ProvinceService extends BaseService{ System.out.println("responseStr --> "+responseStr); } + + //获取隐患类型信息 + private static String ENT_INFO = "/gov/sync/ent/info"; + + + /** + * 推送企业信息 + * @version v1.0 + * @author dong + * @date 2025/4/1 14:47 + */ + public void entInfoSend(String entId){ + String token = getToken(); + + + SysEnterprise enterprise = sysEnterpriseMapper.selectByPrimaryKey(entId); + if(null != enterprise){ + + + EntInfo entInfo = new EntInfo(); + entInfo.setSysUniqueCode(SYS_UNIQUE_CODE); + entInfo.setUniqueCode(enterprise.getSysenterpriseid()); + entInfo.setEntName(enterprise.getEntname()); + entInfo.setUniqueCode(enterprise.getSysenterpriseid()); + entInfo.setAreaId(constantsConfigure.getSuperiorOrgCode()); + + BaseInClass baseInClass = baseInClassMapper.selectByPrimaryKey(enterprise.getWorkClassId()); + if(null != baseInClass){ + entInfo.setIndustryId(baseInClass.getIndustryId()); + } + + entInfo.setUnifiedCode(enterprise.getOrgpassno()); + if(StringUtils.isNotBlank(enterprise.getInherentRisk())){ + entInfo.setRiskLevel(TypeConversion.StringToInteger(enterprise.getInherentRisk())); + } + + entInfo.setLegalPerson(enterprise.getLegalrepre()); + entInfo.setLegalPersonPhone(enterprise.getLrlinktel()); + entInfo.setSafetyAdminPerson(enterprise.getSafeManager()); + entInfo.setSafetyAdminPersonPhone(enterprise.getSafeTelephone()); + entInfo.setOperationPlace(enterprise.getSysaddress()); + entInfo.setStaffNumber(enterprise.getPersoncount()+""); + entInfo.setLat(enterprise.getLatitude()); + entInfo.setLon(enterprise.getLongitude()); + entInfo.setIsUnderTen(1+""); + entInfo.setIsGroupCompany(2+""); + entInfo.setCompanyAttribute(1+""); + //加密请求参数 + String responseStr = EnedUtils.doPost(BASE_URL+ENT_INFO,JSONObject.toJSONString(entInfo),token); + + System.out.println("responseStr --> "+responseStr); + } + + + } + /** * 数据测试 * @version v1.0 @@ -197,7 +252,7 @@ public class ProvinceService extends BaseService{ //部门信息 // getDeptApi(); //行业信息 -// getIndustryApi(); + getIndustryApi(); //隐患类型 // getUpgradeTypeApi(); //地区信息 diff --git a/inventory-dao/src/main/resources/mapper/ent/BaseInClassMapper.xml b/inventory-dao/src/main/resources/mapper/ent/BaseInClassMapper.xml index 733c86e..f25af13 100644 --- a/inventory-dao/src/main/resources/mapper/ent/BaseInClassMapper.xml +++ b/inventory-dao/src/main/resources/mapper/ent/BaseInClassMapper.xml @@ -10,6 +10,7 @@ + @@ -75,6 +76,7 @@ BaseInClassId, ClassCode, IndustryClassName, SuperInId, SuperInCode, SysLevel, SortId,in_type, + industry_id, CreatedOn, CreatedBy, ModifiedOn, ModifiedBy