diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiItemController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiItemController.java index 9d16a6547..ab65460a2 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiItemController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiItemController.java @@ -8,6 +8,8 @@ import com.elink.esua.epdc.dto.item.result.ItemCategoryStatisticsResultDTO; import com.elink.esua.epdc.dto.item.result.ItemDetailResultDTO; import com.elink.esua.epdc.dto.item.result.ItemHandleProgressResultDTO; import com.elink.esua.epdc.dto.item.result.ItemResultDTO; +import com.elink.esua.epdc.dto.share.form.ShareEnterpriseFormDTO; +import com.elink.esua.epdc.dto.share.result.ShareEnterpriseResultDTO; import com.elink.esua.epdc.service.ItemService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -132,4 +134,17 @@ public class ApiItemController { return itemService.pushItemProcess(formDto); } + /** + * 获取企业信息 + * + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author zhy + * @date 2022/9/15 16:10 + */ + @PostMapping("company") + public Result> getCompany(@RequestBody ShareEnterpriseFormDTO formDTO) { + return itemService.getCompany(formDTO); + } + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ItemFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ItemFeignClient.java index 43160b279..0a8c8948d 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ItemFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ItemFeignClient.java @@ -7,6 +7,8 @@ import com.elink.esua.epdc.dto.item.result.ItemCategoryStatisticsResultDTO; import com.elink.esua.epdc.dto.item.result.ItemDetailResultDTO; import com.elink.esua.epdc.dto.item.result.ItemHandleProgressResultDTO; import com.elink.esua.epdc.dto.item.result.ItemResultDTO; +import com.elink.esua.epdc.dto.share.form.ShareEnterpriseFormDTO; +import com.elink.esua.epdc.dto.share.result.ShareEnterpriseResultDTO; import com.elink.esua.epdc.feign.fallback.ItemFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; @@ -131,4 +133,15 @@ public interface ItemFeignClient { */ @PostMapping(value = "events/item/pushItemProcess", consumes = MediaType.APPLICATION_JSON_VALUE) Result pushItemProcess(AcceptPlantformProcessDTO formDto); + + /** + * 获取企业信息 + * + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author zhy + * @date 2022/9/15 16:06 + */ + @PostMapping(value = "events/shareenterprise/company", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> getCompany(ShareEnterpriseFormDTO formDTO); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ItemFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ItemFeignClientFallback.java index 9b669425f..61da20d08 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ItemFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ItemFeignClientFallback.java @@ -8,6 +8,8 @@ import com.elink.esua.epdc.dto.item.result.ItemCategoryStatisticsResultDTO; import com.elink.esua.epdc.dto.item.result.ItemDetailResultDTO; import com.elink.esua.epdc.dto.item.result.ItemHandleProgressResultDTO; import com.elink.esua.epdc.dto.item.result.ItemResultDTO; +import com.elink.esua.epdc.dto.share.form.ShareEnterpriseFormDTO; +import com.elink.esua.epdc.dto.share.result.ShareEnterpriseResultDTO; import com.elink.esua.epdc.feign.ItemFeignClient; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.PathVariable; @@ -75,4 +77,9 @@ public class ItemFeignClientFallback implements ItemFeignClient { public Result pushItemProcess(AcceptPlantformProcessDTO formDto) { return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "pushItemProcess", formDto); } + + @Override + public Result> getCompany(ShareEnterpriseFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "getCompany", formDTO); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ItemService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ItemService.java index 339f2b404..a2a26d3c9 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ItemService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ItemService.java @@ -7,6 +7,8 @@ import com.elink.esua.epdc.dto.item.result.ItemCategoryStatisticsResultDTO; import com.elink.esua.epdc.dto.item.result.ItemDetailResultDTO; import com.elink.esua.epdc.dto.item.result.ItemHandleProgressResultDTO; import com.elink.esua.epdc.dto.item.result.ItemResultDTO; +import com.elink.esua.epdc.dto.share.form.ShareEnterpriseFormDTO; +import com.elink.esua.epdc.dto.share.result.ShareEnterpriseResultDTO; import java.util.List; @@ -113,4 +115,14 @@ public interface ItemService { * @return com.elink.esua.epdc.commons.tools.utils.Result */ Result pushItemProcess(AcceptPlantformProcessDTO formDto); + + /** + * 获取企业信息 + * + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author zhy + * @date 2022/9/15 16:06 + */ + Result> getCompany(ShareEnterpriseFormDTO formDTO); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ItemServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ItemServiceImpl.java index 1c2122f67..a2b3ec3f7 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ItemServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ItemServiceImpl.java @@ -14,6 +14,8 @@ import com.elink.esua.epdc.dto.item.result.ItemCategoryStatisticsResultDTO; import com.elink.esua.epdc.dto.item.result.ItemDetailResultDTO; import com.elink.esua.epdc.dto.item.result.ItemHandleProgressResultDTO; import com.elink.esua.epdc.dto.item.result.ItemResultDTO; +import com.elink.esua.epdc.dto.share.form.ShareEnterpriseFormDTO; +import com.elink.esua.epdc.dto.share.result.ShareEnterpriseResultDTO; import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.feign.ItemFeignClient; import com.elink.esua.epdc.feign.PointsFeignClient; @@ -217,4 +219,9 @@ public class ItemServiceImpl implements ItemService { public Result pushItemProcess(AcceptPlantformProcessDTO formDto) { return itemFeignClient.pushItemProcess(formDto); } + + @Override + public Result> getCompany(ShareEnterpriseFormDTO formDTO){ + return itemFeignClient.getCompany(formDTO); + } } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/constant/EventZwyDataConstant.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/constant/EventZwyDataConstant.java new file mode 100644 index 000000000..940671ea9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/constant/EventZwyDataConstant.java @@ -0,0 +1,65 @@ +package com.elink.esua.epdc.constant; + +/*** + * 综治及网格化常量 + * @author work@yujt.net.cn + * @date 2022/6/8/0008 10:00 + */ +public interface EventZwyDataConstant { + + int PAGE_LIMIT = 200; + + String AESKEY = "hriajrutnbghajsd"; + + String TABLESCHEMA_UNICOM = "unicom"; + String TABLESCHEMA_SHARE = "share"; + String TABLESCHEMA_WGH = "wgh"; + String TABLESCHEMA_COMPANY = "company"; + + + String UNICOM_PINGFANG = "ca_pingfang"; + String UNICOM_LOUDONG = "ca_loudong"; + String UNICOM_RESIDENT = "ca_resident"; + String UNICOM_ROTATORS = "ca_rotators"; + String UNICOM_RENTAL = "ca_rental"; + String UNICOM_BM_CATEGORY = "ca_bm_category"; + String UNICOM_SYS_DICT = "ca_sys_dict"; + String UNICOM_KETTLE = "ca_kettle_base_dispute_process"; + + String SHARE_BASE_GRID = "wgh_base_grid"; + String SHARE_WGH_SUB = "wgh_subdistrict_office"; + String SHARE_BM_GRID = "ca_bm_grid"; + String SHARE_COMMUNITY = "wgh_community"; + String SHARE_WGH_DYWG = "wgh_dywg"; + String SHARE_WGH_JDB = "wgh_jdb"; + String SHARE_WGH_JQZ = "wgh_jqz"; + String SHARE_WGH_JXCS = "wgh_jxcs"; + String SHARE_WGH_JYZ = "wgh_jyz"; + String SHARE_WGH_SJXXB = "wgh_sjxxb"; + String SHARE_WGH_SQXX = "wgh_sqxx"; + String SHARE_WGH_SZCGWGH = "wgh_szcgwgh"; + String SHARE_WGH_SZZRWG = "wgh_szzrwg"; + String SHARE_WGH_WHPDW = "wgh_whpdw"; + String SHARE_WGH_YJBMCS = "wgh_yjbmcs"; + String SHARE_WGH_YQHJZ = "wgh_yqhjz"; + + + String SHARE_WGH_SJXX = "wgh_sjxx"; + + /** + * 政务云接口地址 + */ + String DATA_URL_UNICON = "http://120.221.72.83:9090/bridge/unicom/page"; + String DATA_URL_SHARE = "http://120.221.72.83:9090/bridge/share/sharePage"; + String DATA_URL_WGH = "http://120.221.72.83:9090/bridge/wgh/wghPage"; + String DATA_URL_COMPANY = "http://120.221.72.83:9090/bridge/company/page"; + + /** + * 接口鉴权 + */ + String UNICOM_CONDITION = "unicomCondition"; + String SHARE_CONDITION = "shareCondition"; + String WGH_CONDITION = "wghCondition"; + String COMPANY_CONDITION = "companyCondition"; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/share/ShareEnterpriseDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/share/ShareEnterpriseDTO.java new file mode 100644 index 000000000..63eea1315 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/share/ShareEnterpriseDTO.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.share; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 政务网企业信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2022-09-15 + */ +@Data +public class ShareEnterpriseDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 企业名称 + */ + private String entName; + + /** + * 企业编码 + */ + private String uniscid; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识 0:否,1:是 + */ + private String delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/share/form/ShareEnterpriseFormDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/share/form/ShareEnterpriseFormDTO.java new file mode 100644 index 000000000..f123c4fc9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/share/form/ShareEnterpriseFormDTO.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.share.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.Date; + + +/** + * 政务网企业信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2022-09-15 + */ +@Data +public class ShareEnterpriseFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 企业名称 + */ + @NotBlank(message = "企业名称不可为空") + private String entName; + + /** + * 企业编码 + */ + private String uniscid; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/share/result/ShareEnterpriseResultDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/share/result/ShareEnterpriseResultDTO.java new file mode 100644 index 000000000..8432fa990 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/share/result/ShareEnterpriseResultDTO.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto.share.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 政务网企业信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2022-09-15 + */ +@Data +public class ShareEnterpriseResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 企业名称 + */ + private String entName; + + /** + * 企业编码 + */ + private String uniscid; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/EpdcPlatformItemController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/EpdcPlatformItemController.java index a67501e72..371192144 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/EpdcPlatformItemController.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/EpdcPlatformItemController.java @@ -48,4 +48,18 @@ public class EpdcPlatformItemController { public Result queryItemHandleOne(@PathVariable String itemId) { return itemService.queryItemHandle(itemId); } + + /** + * 拉取市北政务网企业信息 + * + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author zhy + * @date 2022/9/14 17:24 + */ + @GetMapping(value = "company") + public Result saveCompany() { + return new Result(); + } + } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/share/controller/ShareEnterpriseController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/share/controller/ShareEnterpriseController.java new file mode 100644 index 000000000..a90df2587 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/share/controller/ShareEnterpriseController.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.share.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.share.ShareEnterpriseDTO; +import com.elink.esua.epdc.dto.share.form.ShareEnterpriseFormDTO; +import com.elink.esua.epdc.dto.share.result.ShareEnterpriseResultDTO; +import com.elink.esua.epdc.modules.share.service.ShareEnterpriseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 政务网企业信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2022-09-15 + */ +@RestController +@RequestMapping("shareenterprise") +public class ShareEnterpriseController { + + @Autowired + private ShareEnterpriseService shareEnterpriseService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = shareEnterpriseService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ShareEnterpriseDTO data = shareEnterpriseService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ShareEnterpriseDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + shareEnterpriseService.save(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + shareEnterpriseService.delete(ids); + return new Result(); + } + + /** + * 获取企业信息 + * + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author zhy + * @date 2022/9/15 16:13 + */ + @PostMapping("company") + public Result> getCompany(@RequestBody ShareEnterpriseFormDTO formDTO){ + List list = shareEnterpriseService.getCompany(formDTO); + return new Result>().ok(list); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/share/dao/ShareEnterpriseDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/share/dao/ShareEnterpriseDao.java new file mode 100644 index 000000000..a61127509 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/share/dao/ShareEnterpriseDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.share.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.share.entity.ShareEnterpriseEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 政务网企业信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2022-09-15 + */ +@Mapper +public interface ShareEnterpriseDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/share/entity/ShareEnterpriseEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/share/entity/ShareEnterpriseEntity.java new file mode 100644 index 000000000..65ed0fbc8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/share/entity/ShareEnterpriseEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.share.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 政务网企业信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2022-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_share_enterprise") +public class ShareEnterpriseEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 企业名称 + */ + private String entName; + + /** + * 企业编码 + */ + private String uniscid; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/share/service/ShareEnterpriseService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/share/service/ShareEnterpriseService.java new file mode 100644 index 000000000..0364ebad7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/share/service/ShareEnterpriseService.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.share.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.share.ShareEnterpriseDTO; +import com.elink.esua.epdc.dto.share.form.ShareEnterpriseFormDTO; +import com.elink.esua.epdc.dto.share.result.ShareEnterpriseResultDTO; +import com.elink.esua.epdc.modules.share.entity.ShareEnterpriseEntity; + +import java.util.List; +import java.util.Map; + +/** + * 政务网企业信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2022-09-15 + */ +public interface ShareEnterpriseService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-09-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-09-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ShareEnterpriseDTO + * @author generator + * @date 2022-09-15 + */ + ShareEnterpriseDTO get(String id); + + /** + * 查询企业信息 + * + * @param formDTO + * @return ShareEnterpriseDTO + * @author generator + * @date 2022-09-15 + */ + List getCompany(ShareEnterpriseFormDTO formDTO); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-09-15 + */ + void save(ShareEnterpriseDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-09-15 + */ + void update(ShareEnterpriseDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-09-15 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/share/service/impl/ShareEnterpriseServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/share/service/impl/ShareEnterpriseServiceImpl.java new file mode 100644 index 000000000..75433dc96 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/share/service/impl/ShareEnterpriseServiceImpl.java @@ -0,0 +1,113 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.share.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.share.ShareEnterpriseDTO; +import com.elink.esua.epdc.dto.share.form.ShareEnterpriseFormDTO; +import com.elink.esua.epdc.dto.share.result.ShareEnterpriseResultDTO; +import com.elink.esua.epdc.modules.share.dao.ShareEnterpriseDao; +import com.elink.esua.epdc.modules.share.entity.ShareEnterpriseEntity; +import com.elink.esua.epdc.modules.share.service.ShareEnterpriseService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 政务网企业信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2022-09-15 + */ +@Service +public class ShareEnterpriseServiceImpl extends BaseServiceImpl implements ShareEnterpriseService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ShareEnterpriseDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ShareEnterpriseDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + String entName = (String) params.get("entName"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.like(StringUtils.isNotBlank(entName), "ent_name", entName); + + return wrapper; + } + + @Override + public ShareEnterpriseDTO get(String id) { + ShareEnterpriseEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ShareEnterpriseDTO.class); + } + + @Override + public List getCompany(ShareEnterpriseFormDTO formDTO) { + Map params = new HashMap<>(4); + params.put("entName", formDTO.getEntName()); + List list = list(params); + return ConvertUtils.sourceToTarget(list, ShareEnterpriseResultDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ShareEnterpriseDTO dto) { + ShareEnterpriseEntity entity = ConvertUtils.sourceToTarget(dto, ShareEnterpriseEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ShareEnterpriseDTO dto) { + ShareEnterpriseEntity entity = ConvertUtils.sourceToTarget(dto, ShareEnterpriseEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/share/ShareEnterpriseDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/share/ShareEnterpriseDao.xml new file mode 100644 index 000000000..017d3b261 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/share/ShareEnterpriseDao.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/ItemFeignClient.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/ItemFeignClient.java index ebb8ccc7a..43e04f0da 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/ItemFeignClient.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/ItemFeignClient.java @@ -31,4 +31,15 @@ public interface ItemFeignClient { @GetMapping(value = "events/item/itemTimeOut", consumes = MediaType.APPLICATION_JSON_VALUE) Result itemTimeOut(); + + /** + * 拉取市北政务网企业信息 + * + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author zhy + * @date 2022/9/14 17:20 + */ + @GetMapping(value = "events/platform/item/company", consumes = MediaType.APPLICATION_JSON_VALUE) + Result saveCompany(); } diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/ItemFeignClientFallback.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/ItemFeignClientFallback.java index 378d33a9d..f1b21d890 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/ItemFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/ItemFeignClientFallback.java @@ -21,4 +21,9 @@ public class ItemFeignClientFallback implements ItemFeignClient { public Result itemTimeOut() { return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "itemTimeOut", ""); } + + @Override + public Result saveCompany() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "saveCompany", ""); + } }