From d8e44bc9371a654c2d92ddbe88883fc85ec90107 Mon Sep 17 00:00:00 2001 From: liuchuang <123456> Date: Fri, 3 Sep 2021 19:04:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E4=BC=81=E4=B8=9A=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=AE=A1=E7=90=86=E3=80=81=E5=A4=A7=E5=B1=8F=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApiScreenPopulationController.java | 18 +++ .../esua/epdc/feign/CustomFeignClient.java | 11 ++ .../fallback/CustomFeignClientFallback.java | 5 + .../esua/epdc/service/CustomService.java | 10 ++ .../epdc/service/impl/CustomServiceImpl.java | 5 + .../epdc/constant/CustomImageConstant.java | 5 + .../elink/esua/epdc/dto/ScreenCompanyDTO.java | 128 ++++++++++++++++++ .../form/EpdcScreenCompanyListFormDTO.java | 29 ++++ .../EpdcScreenCompanyListResultDTO.java | 57 ++++++++ .../controller/ScreenCompanyController.java | 111 +++++++++++++++ .../epidemic/dao/ScreenCompanyDao.java | 58 ++++++++ .../epidemic/entity/ScreenCompanyEntity.java | 91 +++++++++++++ .../epidemic/excel/ScreenCompanyExcel.java | 86 ++++++++++++ .../service/ScreenCompanyService.java | 107 +++++++++++++++ .../impl/ScreenCompanyServiceImpl.java | 120 ++++++++++++++++ .../modules/reportissue/dao/CustomImgDao.java | 13 +- .../reportissue/service/CustomImgService.java | 13 +- .../service/impl/CustomImgServiceImpl.java | 8 +- .../mapper/epidemic/ScreenCompanyDao.xml | 80 +++++++++++ .../mapper/reportissue/CustomImgDao.xml | 6 +- 20 files changed, 957 insertions(+), 4 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/ScreenCompanyDTO.java create mode 100644 esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcScreenCompanyListFormDTO.java create mode 100644 esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcScreenCompanyListResultDTO.java create mode 100644 esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/ScreenCompanyController.java create mode 100644 esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/dao/ScreenCompanyDao.java create mode 100644 esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/entity/ScreenCompanyEntity.java create mode 100644 esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/excel/ScreenCompanyExcel.java create mode 100644 esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/service/ScreenCompanyService.java create mode 100644 esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/ScreenCompanyServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/epidemic/ScreenCompanyDao.xml diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenPopulationController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenPopulationController.java index 4695c6dc..d7b32ee0 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenPopulationController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScreenPopulationController.java @@ -8,11 +8,15 @@ import com.elink.esua.epdc.dto.DeptOption; import com.elink.esua.epdc.dto.PopulationInfoOverviewDTO; import com.elink.esua.epdc.dto.epdc.form.*; import com.elink.esua.epdc.dto.epdc.result.*; +import com.elink.esua.epdc.dto.form.EpdcScreenCompanyListFormDTO; +import com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO; import com.elink.esua.epdc.service.AppUserService; import com.elink.esua.epdc.service.CustomService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * 用户模块 * @@ -168,4 +172,18 @@ public class ApiScreenPopulationController { public Result getPopulationInfoOverviewForScreen(@PathVariable("communityId")String communityId) { return appUserService.getPopulationInfoOverviewForScreen(communityId); } + + /** + * 大屏-企业信息 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author lc + * @since 2021/9/3 18:59 + */ + @PostMapping("screenCompany/list") + public Result> screenCompanyList(@RequestBody EpdcScreenCompanyListFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return customService.listOfCompanyListForScreen(formDto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java index 7d8d889d..3ada374a 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java @@ -398,4 +398,15 @@ public interface CustomFeignClient { @PostMapping(value = "custom/enterprisereport/addEnterpriseReport", consumes = MediaType.APPLICATION_JSON_VALUE) Result addEnterpriseReport(@RequestBody EnterpriseReportAddFormDTO enterpriseReportAddFormDTO); + /** + * 大屏-企业列表 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author lc + * @since 2021/9/3 19:02 + */ + @PostMapping(value = "custom/screencompany/screenCompanyList", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> listOfCompanyListForScreen(EpdcScreenCompanyListFormDTO formDto); + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java index a55ced8a..639b342e 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java @@ -215,4 +215,9 @@ public class CustomFeignClientFallback implements CustomFeignClient { public Result addEnterpriseReport(EnterpriseReportAddFormDTO enterpriseReportAddFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "addEnterpriseReport", enterpriseReportAddFormDTO); } + + @Override + public Result> listOfCompanyListForScreen(EpdcScreenCompanyListFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "listOfCompanyListForScreen", formDto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java index 39a9b4de..6652e41b 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java @@ -382,4 +382,14 @@ public interface CustomService { * @return com.elink.esua.epdc.commons.tools.utils.Result **/ Result getEnterpriseReportList(String id); + + /** + * 大屏-企业信息 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author lc + * @since 2021/9/3 19:00 + */ + Result> listOfCompanyListForScreen(EpdcScreenCompanyListFormDTO formDto); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java index 5c33c52f..1995d29b 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java @@ -417,4 +417,9 @@ public class CustomServiceImpl implements CustomService { return customFeignClient.getEnterpriseReportList(id); } + @Override + public Result> listOfCompanyListForScreen(EpdcScreenCompanyListFormDTO formDto) { + return customFeignClient.listOfCompanyListForScreen(formDto); + } + } diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/constant/CustomImageConstant.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/constant/CustomImageConstant.java index c4e2c294..5fde4921 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/constant/CustomImageConstant.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/constant/CustomImageConstant.java @@ -20,4 +20,9 @@ public interface CustomImageConstant { * 志愿者服务-拼团购-评价 */ String IMAGE_TYPE_GROUP_BUY_EVALUATION = "group_buy_evaluation"; + + /** + * 大屏企业管理照片 + */ + String SCREEN_COMPANY_IMAGE = "screen_company_image"; } diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/ScreenCompanyDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/ScreenCompanyDTO.java new file mode 100644 index 00000000..3d9a43a0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/ScreenCompanyDTO.java @@ -0,0 +1,128 @@ +/** + * 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; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +import lombok.Data; + + +/** + * 大屏企业信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-09-03 + */ +@Data +public class ScreenCompanyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 企业名称 + */ + private String companyName; + + /** + * 企业简介 + */ + private String companyIntroduction; + + /** + * 联系人 + */ + private String contactPerson; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 企业地址 + */ + private String companyAddress; + + /** + * 统一社会信用代码 + */ + private String uniformSocialCreditCode; + + /** + * 注册资金(万元) + */ + private Integer registeredCapital; + + /** + * 企业人数 + */ + private Integer employedPopulation; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识 0:否,1:是 + */ + private String delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 企业照片 + */ + private List images; + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcScreenCompanyListFormDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcScreenCompanyListFormDTO.java new file mode 100644 index 00000000..289f9d8d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcScreenCompanyListFormDTO.java @@ -0,0 +1,29 @@ +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +@Data +public class EpdcScreenCompanyListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 页码 + */ + @Min(value = 1, message = "页码必须大于0") + private Integer pageIndex; + + /** + * 页容量 + */ + @Min(value = 1, message = "页容量必须大于0") + private Integer pageSize; + + /** + * 企业名称 + */ + private String companyName; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcScreenCompanyListResultDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcScreenCompanyListResultDTO.java new file mode 100644 index 00000000..ecf78574 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcScreenCompanyListResultDTO.java @@ -0,0 +1,57 @@ +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class EpdcScreenCompanyListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 企业名称 + */ + private String companyName; + + /** + * 企业简介 + */ + private String companyIntroduction; + + /** + * 联系人 + */ + private String contactPerson; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 企业地址 + */ + private String companyAddress; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 企业照片 + */ + private List images; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/ScreenCompanyController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/ScreenCompanyController.java new file mode 100644 index 00000000..e49d77b8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/ScreenCompanyController.java @@ -0,0 +1,111 @@ +/** + * 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.epidemic.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +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.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.ScreenCompanyDTO; +import com.elink.esua.epdc.dto.form.EpdcScreenCompanyListFormDTO; +import com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO; +import com.elink.esua.epdc.modules.epidemic.excel.ScreenCompanyExcel; +import com.elink.esua.epdc.modules.epidemic.service.ScreenCompanyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 大屏企业信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-09-03 + */ +@RestController +@RequestMapping("screencompany") +public class ScreenCompanyController { + + @Autowired + private ScreenCompanyService screenCompanyService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = screenCompanyService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ScreenCompanyDTO data = screenCompanyService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ScreenCompanyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + screenCompanyService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ScreenCompanyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + screenCompanyService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + screenCompanyService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = screenCompanyService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ScreenCompanyExcel.class); + } + + /** + * 大屏-企业列表 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author lc + * @since 2021/9/3 18:55 + */ + @PostMapping("screenCompanyList") + public Result> screenCompanyList(@RequestBody EpdcScreenCompanyListFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + List data = screenCompanyService.listOfCompanyListForScreen(formDto); + return new Result>().ok(data); + } + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/dao/ScreenCompanyDao.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/dao/ScreenCompanyDao.java new file mode 100644 index 00000000..61b20a7a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/dao/ScreenCompanyDao.java @@ -0,0 +1,58 @@ +/** + * 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.epidemic.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.ScreenCompanyDTO; +import com.elink.esua.epdc.dto.form.EpdcScreenCompanyListFormDTO; +import com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO; +import com.elink.esua.epdc.modules.epidemic.entity.ScreenCompanyEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 大屏企业信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-09-03 + */ +@Mapper +public interface ScreenCompanyDao extends BaseDao { + + /** + * 查询大屏企业信息 + * + * @param id + * @return com.elink.esua.epdc.dto.ScreenCompanyDTO + * @author lc + * @since 2021/9/3 18:34 + */ + ScreenCompanyDTO selectCompanyInfoById(String id); + + /** + * 大屏-企业列表 + * + * @param formDto + * @return java.util.List + * @author lc + * @since 2021/9/3 18:50 + */ + List selectListOfCompanyListForScreen(EpdcScreenCompanyListFormDTO formDto); + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/entity/ScreenCompanyEntity.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/entity/ScreenCompanyEntity.java new file mode 100644 index 00000000..d76cb7f4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/entity/ScreenCompanyEntity.java @@ -0,0 +1,91 @@ +/** + * 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.epidemic.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 qu qu@elink-cn.com + * @since v1.0.0 2021-09-03 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_screen_company") +public class ScreenCompanyEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 企业名称 + */ + private String companyName; + + /** + * 企业简介 + */ + private String companyIntroduction; + + /** + * 联系人 + */ + private String contactPerson; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 企业地址 + */ + private String companyAddress; + + /** + * 统一社会信用代码 + */ + private String uniformSocialCreditCode; + + /** + * 注册资金(万元) + */ + private Integer registeredCapital; + + /** + * 企业人数 + */ + private Integer employedPopulation; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/excel/ScreenCompanyExcel.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/excel/ScreenCompanyExcel.java new file mode 100644 index 00000000..588f18eb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/excel/ScreenCompanyExcel.java @@ -0,0 +1,86 @@ +/** + * 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.epidemic.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 大屏企业信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-09-03 + */ +@Data +public class ScreenCompanyExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "企业名称") + private String companyName; + + @Excel(name = "企业简介") + private String companyIntroduction; + + @Excel(name = "联系人") + private String contactPerson; + + @Excel(name = "联系电话") + private String mobile; + + @Excel(name = "企业地址") + private String companyAddress; + + @Excel(name = "统一社会信用代码") + private String uniformSocialCreditCode; + + @Excel(name = "注册资金(万元)") + private Integer registeredCapital; + + @Excel(name = "企业人数") + private Integer employedPopulation; + + @Excel(name = "经度") + private String longitude; + + @Excel(name = "纬度") + private String latitude; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "删除标识 0:否,1:是") + private String delFlag; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/service/ScreenCompanyService.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/service/ScreenCompanyService.java new file mode 100644 index 00000000..e7b48538 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/service/ScreenCompanyService.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.epidemic.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.ScreenCompanyDTO; +import com.elink.esua.epdc.dto.form.EpdcScreenCompanyListFormDTO; +import com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO; +import com.elink.esua.epdc.modules.epidemic.entity.ScreenCompanyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 大屏企业信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-09-03 + */ +public interface ScreenCompanyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-03 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-03 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenCompanyDTO + * @author generator + * @date 2021-09-03 + */ + ScreenCompanyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-03 + */ + void save(ScreenCompanyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-03 + */ + void update(ScreenCompanyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-03 + */ + void delete(String[] ids); + + /** + * 大屏-企业列表 + * + * @param formDto + * @return java.util.List + * @author lc + * @since 2021/9/3 18:52 + */ + List listOfCompanyListForScreen(EpdcScreenCompanyListFormDTO formDto); +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/ScreenCompanyServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/ScreenCompanyServiceImpl.java new file mode 100644 index 00000000..fffb15be --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/ScreenCompanyServiceImpl.java @@ -0,0 +1,120 @@ +/** + * 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.epidemic.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.NumConstant; +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.constant.FieldConstant; +import com.elink.esua.epdc.constant.CustomImageConstant; +import com.elink.esua.epdc.dto.ScreenCompanyDTO; +import com.elink.esua.epdc.dto.form.EpdcScreenCompanyListFormDTO; +import com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO; +import com.elink.esua.epdc.modules.epidemic.dao.ScreenCompanyDao; +import com.elink.esua.epdc.modules.epidemic.entity.ScreenCompanyEntity; +import com.elink.esua.epdc.modules.epidemic.service.ScreenCompanyService; +import com.elink.esua.epdc.modules.reportissue.service.CustomImgService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 大屏企业信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-09-03 + */ +@Service +public class ScreenCompanyServiceImpl extends BaseServiceImpl implements ScreenCompanyService { + + @Autowired + private CustomImgService customImgService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenCompanyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenCompanyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String companyName = (String)params.get("companyName"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(companyName), "COMPANY_NAME", companyName.trim()); + + return wrapper; + } + + @Override + public ScreenCompanyDTO get(String id) { + return baseDao.selectCompanyInfoById(id); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenCompanyDTO dto) { + ScreenCompanyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenCompanyEntity.class); + insert(entity); + // 保存图片 + customImgService.saveImages(dto.getImages(), entity.getId(), CustomImageConstant.SCREEN_COMPANY_IMAGE); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenCompanyDTO dto) { + ScreenCompanyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenCompanyEntity.class); + updateById(entity); + // 删除已有图片 + customImgService.modifyImagesByReferenceIdAndImgType(entity.getId(), CustomImageConstant.SCREEN_COMPANY_IMAGE); + // 保存新图片 + customImgService.saveImages(dto.getImages(), entity.getId(), CustomImageConstant.SCREEN_COMPANY_IMAGE); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List listOfCompanyListForScreen(EpdcScreenCompanyListFormDTO formDto) { + int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageIndex(pageIndex); + return baseDao.selectListOfCompanyListForScreen(formDto); + } + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/dao/CustomImgDao.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/dao/CustomImgDao.java index 973bb17c..fba56cb0 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/dao/CustomImgDao.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/dao/CustomImgDao.java @@ -37,4 +37,15 @@ public interface CustomImgDao extends BaseDao { * @return void **/ void deleteByGroupBuyId(String id); -} \ No newline at end of file + + /** + * 删除照片 + * + * @param referenceId + * @param imgType + * @return void + * @author lc + * @since 2021/9/3 18:30 + */ + void modifyImagesByReferenceIdAndImgType(String referenceId, String imgType); +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/CustomImgService.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/CustomImgService.java index 0622d5be..bbac51b2 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/CustomImgService.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/CustomImgService.java @@ -104,4 +104,15 @@ public interface CustomImgService extends BaseService { * @since 2020/10/22 17:42 */ boolean saveImages(List images, String referenceId, String imgType); -} \ No newline at end of file + + /** + * 删除照片 + * + * @param referenceId + * @param imgType + * @return void + * @author lc + * @since 2021/9/3 18:29 + */ + void modifyImagesByReferenceIdAndImgType(String referenceId, String imgType); +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/CustomImgServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/CustomImgServiceImpl.java index d6469fea..7fee31ca 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/CustomImgServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/CustomImgServiceImpl.java @@ -116,4 +116,10 @@ public class CustomImgServiceImpl extends BaseServiceImpl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/reportissue/CustomImgDao.xml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/reportissue/CustomImgDao.xml index 85b98bbc..51190328 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/reportissue/CustomImgDao.xml +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/reportissue/CustomImgDao.xml @@ -19,5 +19,9 @@ delete from epdc_custom_img where REFERENCE_ID = #{id} + + update epdc_custom_img set del_flag = '1' where REFERENCE_ID = #{id} and IMG_TYPE = #{imgType} + - \ No newline at end of file + +