diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAdminController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAdminController.java index fb9dabe4..e1522510 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAdminController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAdminController.java @@ -4,9 +4,11 @@ import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.annotation.LoginUser; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.dto.DeptOption; import com.elink.esua.epdc.dto.epdc.form.WorkUserEventTagRelationFormDTO; import com.elink.esua.epdc.dto.epdc.result.WorkUserEventTagRelationResultDTO; import com.elink.esua.epdc.service.AdminService; +import com.elink.esua.epdc.service.AppUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -29,6 +31,9 @@ public class ApiAdminController { @Autowired private AdminService adminService; + @Autowired + private AppUserService appUserService; + /** * 获取完整机构名称(市区/街道/社区/网格) * @@ -67,5 +72,17 @@ public class ApiAdminController { ValidatorUtils.validateEntity(formDto); return adminService.eventTagWorkUser(formDto); } + /** + * @Description 获取机构树 + * @Author songyunpeng + * @Date 2021/8/4 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @GetMapping("getDeptTreeWithTypeKey") + public Result getDeptTreeWithTypeKey() { + return appUserService.getDeptTreeWithTypeKey(); + } + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomInfoController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomInfoController.java index 1f2ba19f..8fa3f286 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomInfoController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomInfoController.java @@ -4,6 +4,7 @@ import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.annotation.LoginUser; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.dto.EnterpriseReportDTO; import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.service.CustomService; @@ -408,4 +409,39 @@ public class ApiCustomInfoController { public Result adviceDetail(@PathVariable("id") String id) { return customService.getAdviceById(id); } + + + /** + * @Description 小程序获取企业上报列表 + * @Author songyunpeng + * @Date 2021/8/2 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @GetMapping("/getEnterpriseReportList") + public Result> getEnterpriseReportList(@LoginUser TokenDto userDetail, EnterpriseReportFormDTO enterpriseReportFormDTO){ + return customService.getEnterpriseReportList(userDetail,enterpriseReportFormDTO); + } + /** + * @Description 小程序获取企业上报详情 + * @Author songyunpeng + * @Date 2021/8/2 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @GetMapping("/getEnterpriseReportDetail/{id}") + public Result getEnterpriseReportList(@PathVariable String id){ + return customService.getEnterpriseReportList(id); + } + /** + * @Description 新增企业上报 + * @Author songyunpeng + * @Date 2021/8/2 + * @Param [enterpriseReportAddFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping("/addEnterpriseReport") + public Result addEnterpriseReport(@LoginUser TokenDto userDetail, @RequestBody EnterpriseReportAddFormDTO enterpriseReportAddFormDTO){ + return customService.addEnterpriseReport(userDetail,enterpriseReportAddFormDTO); + } } 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 b48aead9..7d8d889d 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 @@ -3,6 +3,7 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.EnterpriseReportDTO; import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.feign.fallback.CustomFeignClientFallback; @@ -367,4 +368,34 @@ public interface CustomFeignClient { @GetMapping(value = "custom/epdc-app/advice/detail/{id}", consumes = MediaType.APPLICATION_JSON_VALUE) Result adviceDetail(@PathVariable("id") String id); + /** + * @Description 小程序获取企业上报列表 + * @Author songyunpeng + * @Date 2021/8/2 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @GetMapping(value = "custom/enterprisereport/getEnterpriseReportList", consumes = MediaType.APPLICATION_JSON_VALUE) + + Result> getEnterpriseReportList(EnterpriseReportFormDTO enterpriseReportFormDTO); + /** + * @Description 小程序获取企业上报详情 + * @Author songyunpeng + * @Date 2021/8/2 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @GetMapping(value = "custom/enterprisereport/getEnterpriseReportDetail/{id}", consumes = MediaType.APPLICATION_JSON_VALUE) + + Result getEnterpriseReportList(@PathVariable String id); + /** + * @Description 新增企业上报 + * @Author songyunpeng + * @Date 2021/8/2 + * @Param [enterpriseReportAddFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping(value = "custom/enterprisereport/addEnterpriseReport", consumes = MediaType.APPLICATION_JSON_VALUE) + Result addEnterpriseReport(@RequestBody EnterpriseReportAddFormDTO enterpriseReportAddFormDTO); + } 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 f2cea8e2..a55ced8a 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 @@ -4,6 +4,7 @@ import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.EnterpriseReportDTO; import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.feign.CustomFeignClient; @@ -199,4 +200,19 @@ public class CustomFeignClientFallback implements CustomFeignClient { public Result adviceDetail(String id) { return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "AdviceDetail", id); } + + @Override + public Result> getEnterpriseReportList(EnterpriseReportFormDTO enterpriseReportFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "getEnterpriseReportList", enterpriseReportFormDTO); + } + + @Override + public Result getEnterpriseReportList(String id) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "getEnterpriseReportList", id); + } + + @Override + public Result addEnterpriseReport(EnterpriseReportAddFormDTO enterpriseReportAddFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "addEnterpriseReport", enterpriseReportAddFormDTO); + } } 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 46e4c556..39a9b4de 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 @@ -4,6 +4,7 @@ import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.DeptOption; +import com.elink.esua.epdc.dto.EnterpriseReportDTO; import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.result.*; @@ -332,7 +333,7 @@ public interface CustomService { **/ Result> getEvaluationList(EpdcSelectEvaluationListFormDTO formDTO); /** - * @Description 提交建议 + * @Description 提交建议 * @Author songyunpeng * @Date 2021/3/4 * @Param [formDto, tokenDto] @@ -340,7 +341,7 @@ public interface CustomService { **/ Result adviceSubmit(AdviceSubmitFormDTO formDto, TokenDto tokenDto); /** - * @Description 建议列表 + * @Description 建议列表 * @Author songyunpeng * @Date 2021/3/4 * @Param [formDto, tokenDto] @@ -348,11 +349,37 @@ public interface CustomService { **/ Result> listAdvice(AdviceListFormDTO formDto, TokenDto tokenDto); /** - * @Description 建议详情 + * @Description 建议详情 * @Author songyunpeng * @Date 2021/3/4 * @Param [id] * @return com.elink.esua.epdc.commons.tools.utils.Result **/ Result getAdviceById(String id); + + /** + * @Description 小程序获取企业上报列表 + * @Author songyunpeng + * @Date 2021/8/2 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result> getEnterpriseReportList(TokenDto userDetail, EnterpriseReportFormDTO enterpriseReportFormDTO); + /** + * @Description 新增企业上报 + * @Author songyunpeng + * @Date 2021/8/2 + * @Param [enterpriseReportAddFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result addEnterpriseReport(TokenDto userDetail, EnterpriseReportAddFormDTO enterpriseReportAddFormDTO); + + /** + * @Description 小程序获取企业上报详情 + * @Author songyunpeng + * @Date 2021/8/2 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result getEnterpriseReportList(String id); } 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 98a09d8b..5c33c52f 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 @@ -5,6 +5,7 @@ import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.DeptOption; +import com.elink.esua.epdc.dto.EnterpriseReportDTO; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; import com.elink.esua.epdc.dto.VolunteerInfoDTO; import com.elink.esua.epdc.dto.form.*; @@ -391,4 +392,29 @@ public class CustomServiceImpl implements CustomService { return customFeignClient.adviceDetail(id); } + @Override + public Result> getEnterpriseReportList(TokenDto userDetail,EnterpriseReportFormDTO enterpriseReportFormDTO) { + enterpriseReportFormDTO.setUserId(userDetail.getUserId()); + return customFeignClient.getEnterpriseReportList(enterpriseReportFormDTO); + } + + @Override + public Result addEnterpriseReport(TokenDto userDetail, EnterpriseReportAddFormDTO enterpriseReportAddFormDTO) { + // 机构信息 + Result dtoResult = adminFeignClient.getParentAndAllDept(userDetail.getGridId()); + ParentAndAllDeptDTO deptDTO = dtoResult.getData(); + enterpriseReportAddFormDTO.setDept(deptDTO.getGrid()); + enterpriseReportAddFormDTO.setDeptId(deptDTO.getGridId()); + enterpriseReportAddFormDTO.setMobile(userDetail.getMobile()); + enterpriseReportAddFormDTO.setRealName(userDetail.getRealName()); + enterpriseReportAddFormDTO.setFaceImg(userDetail.getFaceImg()); + enterpriseReportAddFormDTO.setUserId(userDetail.getUserId()); + return customFeignClient.addEnterpriseReport(enterpriseReportAddFormDTO); + } + + @Override + public Result getEnterpriseReportList(String id) { + return customFeignClient.getEnterpriseReportList(id); + } + } diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/pom.xml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/pom.xml index cea8e19d..5f8904a4 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/pom.xml +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/pom.xml @@ -23,6 +23,11 @@ epdc-news-client 1.0.0 + + com.esua.epdc + epdc-user-client + 1.0.0 + diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/EnterpriseReportDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/EnterpriseReportDTO.java new file mode 100644 index 00000000..0278aea1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/EnterpriseReportDTO.java @@ -0,0 +1,177 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 企业信息上报 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-08-02 + */ +@Data +public class EnterpriseReportDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 企业所属网格 + */ + private String grid; + + /** + * 企业所属网格ID + */ + private Long gridId; + + /** + * 发布人所属网格 + */ + private String dept; + + /** + * 发布人所属网格ID + */ + private Long deptId; + + /** + * 发布人ID + */ + private String userId; + + /** + * 发布人手机号 + */ + private String mobile; + + /** + * 发布人头像 + */ + private String faceImg; + + /** + * 发布人真实姓名 + */ + private String realName; + + /** + * 所属年度 + */ + private String year; + + /** + * 所属季度 + */ + private String quarter; + + /** + * 公司名称 + */ + private String enterpriseName; + + /** + * 法人或联络人 + */ + private String legalPerson; + + /** + * 联系电话 + */ + private String concat; + + /** + * 公司状态 + */ + private String enterpriseStatus; + + /** + * 营业收入 + */ + private BigDecimal enterpriseIncome; + + /** + * 用工人数 + */ + private Integer enterprisePeopleNum; + + /** + * 问题 + */ + private String question; + + /** + * 删除标识 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 企业父所有部门 + */ + private String parentDeptIds; + + /** + * 企业父所有部门 + */ + private String parentDeptNames; + + /** + * 企业所有部门ID + */ + private String allDeptIds; + + /** + * 企业所有部门名称 + */ + private String allDeptNames; + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EnterpriseReportAddFormDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EnterpriseReportAddFormDTO.java new file mode 100644 index 00000000..708eeea7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EnterpriseReportAddFormDTO.java @@ -0,0 +1,104 @@ +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * + * + * @author songyunpeng + * @since v1.0.0 2020-05-20 + */ +@Data +public class EnterpriseReportAddFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 企业所属网格ID + */ + @NotBlank(message = "企业所属网格ID不能为空") + private String gridId; + + /** + * 所属年度 + */ + @NotBlank(message = "所属年度不能为空") + private String year; + + /** + * 所属季度 + */ + @NotBlank(message = "所属季度不能为空") + private String quarter; + + /** + * 公司名称 + */ + @NotBlank(message = "公司名称不能为空") + @Size(min = 1, max = 100, message = "公司名称不能为空且在100个字以内") + private String enterpriseName; + + /** + * 法人或联络人 + */ + @NotBlank(message = " 法人或联络人不能为空") + @Size(min = 1, max = 50, message = "法人或联络人不能为空且在50个字以内") + private String legalPerson; + + /** + * 联系电话 + */ + private String concat; + + /** + * 公司状态 + */ + private String enterpriseStatus; + + /** + * 营业收入 + */ + private BigDecimal enterpriseIncome; + + /** + * 用工人数 + */ + private Integer enterprisePeopleNum; + + /** + * 问题 + */ + private String question; + + + /** + * 发布人手机号 + */ + private String mobile; + + /** + * 发布人头像 + */ + private String faceImg; + + /** + * 发布人真实姓名 + */ + private String realName; + + /** + * 发布人所属网格 + */ + private String dept; + + /** + * 发布人所属网格ID + */ + private Long deptId; + + private String userId; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EnterpriseReportFormDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EnterpriseReportFormDTO.java new file mode 100644 index 00000000..ad57f0f4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EnterpriseReportFormDTO.java @@ -0,0 +1,33 @@ +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * + * + * @author songyunpeng + * @since v1.0.0 2020-05-20 + */ +@Data +public class EnterpriseReportFormDTO 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 userId; + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAddGroupBuyInfoFormDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAddGroupBuyInfoFormDTO.java index 77910054..6ddc1ca0 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAddGroupBuyInfoFormDTO.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAddGroupBuyInfoFormDTO.java @@ -69,12 +69,12 @@ public class EpdcAddGroupBuyInfoFormDTO implements Serializable { * 团购价格人数(最多五条) */ @NotNull(message = "团购价格人数不能为空") - List groupBuyPriceNumber; + private List groupBuyPriceNumber; /** * 团购图片(最多三张) */ - List groupBuyImg; + private List groupBuyImg; /** * 截止时间 diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/controller/EnterpriseReportController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/controller/EnterpriseReportController.java new file mode 100644 index 00000000..927cfd59 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/controller/EnterpriseReportController.java @@ -0,0 +1,130 @@ +/** + * 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.enterprisereport.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.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.EnterpriseReportDTO; +import com.elink.esua.epdc.dto.form.EnterpriseReportAddFormDTO; +import com.elink.esua.epdc.dto.form.EnterpriseReportFormDTO; +import com.elink.esua.epdc.modules.enterprisereport.excel.EnterpriseReportExcel; +import com.elink.esua.epdc.modules.enterprisereport.service.EnterpriseReportService; +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-08-02 + */ +@RestController +@RequestMapping("enterprisereport") +public class EnterpriseReportController { + + @Autowired + private EnterpriseReportService enterpriseReportService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = enterpriseReportService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + EnterpriseReportDTO data = enterpriseReportService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody EnterpriseReportDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + enterpriseReportService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody EnterpriseReportDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + enterpriseReportService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + enterpriseReportService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = enterpriseReportService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, EnterpriseReportExcel.class); + } + + /** + * @Description 小程序获取企业上报列表 + * @Author songyunpeng + * @Date 2021/8/2 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @GetMapping("/getEnterpriseReportList") + public Result> getEnterpriseReportList(@RequestBody EnterpriseReportFormDTO enterpriseReportFormDTO){ + return enterpriseReportService.getEnterpriseReportList(enterpriseReportFormDTO); + } + /** + * @Description 小程序获取企业上报详情 + * @Author songyunpeng + * @Date 2021/8/2 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @GetMapping("/getEnterpriseReportDetail/{id}") + public Result getEnterpriseReportDetail(@PathVariable String id){ + return enterpriseReportService.getEnterpriseReportDetail(id); + } + /** + * @Description 新增企业上报 + * @Author songyunpeng + * @Date 2021/8/2 + * @Param [enterpriseReportAddFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping("/addEnterpriseReport") + public Result addEnterpriseReport(@RequestBody EnterpriseReportAddFormDTO enterpriseReportAddFormDTO){ + return enterpriseReportService.addEnterpriseReport(enterpriseReportAddFormDTO); + } + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/dao/EnterpriseReportDao.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/dao/EnterpriseReportDao.java new file mode 100644 index 00000000..19d94241 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/dao/EnterpriseReportDao.java @@ -0,0 +1,44 @@ +/** + * 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.enterprisereport.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.EnterpriseReportDTO; +import com.elink.esua.epdc.dto.form.EnterpriseReportFormDTO; +import com.elink.esua.epdc.modules.enterprisereport.entity.EnterpriseReportEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 企业信息上报 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-08-02 + */ +@Mapper +public interface EnterpriseReportDao extends BaseDao { + /** + * @Description 企业上报列表 + * @Author songyunpeng + * @Date 2021/8/2 + * @Param [formDTO] + * @return java.util.List + **/ + List getEnterpriseReportList(EnterpriseReportFormDTO formDTO); +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/entity/EnterpriseReportEntity.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/entity/EnterpriseReportEntity.java new file mode 100644 index 00000000..fcdbc37d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/entity/EnterpriseReportEntity.java @@ -0,0 +1,145 @@ +/** + * 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.enterprisereport.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 企业信息上报 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-08-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_enterprise_report") +public class EnterpriseReportEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 企业所属网格 + */ + private String grid; + + /** + * 企业所属网格ID + */ + private Long gridId; + + /** + * 发布人所属网格 + */ + private String dept; + + /** + * 发布人所属网格ID + */ + private Long deptId; + + /** + * 发布人ID + */ + private String userId; + + /** + * 发布人手机号 + */ + private String mobile; + + /** + * 发布人头像 + */ + private String faceImg; + + /** + * 发布人真实姓名 + */ + private String realName; + + /** + * 所属年度 + */ + private String year; + + /** + * 所属季度 + */ + private String quarter; + + /** + * 公司名称 + */ + private String enterpriseName; + + /** + * 法人或联络人 + */ + private String legalPerson; + + /** + * 联系电话 + */ + private String concat; + + /** + * 公司状态 + */ + private String enterpriseStatus; + + /** + * 营业收入 + */ + private BigDecimal enterpriseIncome; + + /** + * 用工人数 + */ + private Integer enterprisePeopleNum; + + /** + * 问题 + */ + private String question; + + /** + * 企业父所有部门 + */ + private String parentDeptIds; + + /** + * 企业父所有部门 + */ + private String parentDeptNames; + + /** + * 企业所有部门ID + */ + private String allDeptIds; + + /** + * 企业所有部门名称 + */ + private String allDeptNames; + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/excel/EnterpriseReportExcel.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/excel/EnterpriseReportExcel.java new file mode 100644 index 00000000..8ecc065e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/excel/EnterpriseReportExcel.java @@ -0,0 +1,123 @@ +/** + * 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.enterprisereport.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 企业信息上报 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-08-02 + */ +@Data +public class EnterpriseReportExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "企业所属网格") + private Long grid; + + @Excel(name = "企业所属网格ID") + private String gridId; + + @Excel(name = "发布人所属网格") + private Long dept; + + @Excel(name = "发布人所属网格ID") + private String deptId; + + @Excel(name = "发布人ID") + private String userId; + + @Excel(name = "发布人昵称") + private String nickname; + + @Excel(name = "发布人手机号") + private String mobile; + + @Excel(name = "发布人头像") + private String faceImg; + + @Excel(name = "发布人真实姓名") + private String realName; + + @Excel(name = "所属年度") + private String year; + + @Excel(name = "所属季度") + private String quarter; + + @Excel(name = "公司名称") + private String enterpriseName; + + @Excel(name = "法人或联络人") + private String legalPerson; + + @Excel(name = "联系电话") + private String concat; + + @Excel(name = "公司状态") + private String enterpriseStatus; + + @Excel(name = "营业收入") + private BigDecimal enterpriseIncome; + + @Excel(name = "用工人数") + private Integer enterprisePeopleNum; + + @Excel(name = "问题") + private String question; + + @Excel(name = "删除标识 0:未删除,1:已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "企业父所有部门") + private String parentDeptIds; + + @Excel(name = "企业父所有部门") + private String parentDeptNames; + + @Excel(name = "企业所有部门ID") + private String allDeptIds; + + @Excel(name = "企业所有部门名称") + private String allDeptNames; + + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/redis/EnterpriseReportRedis.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/redis/EnterpriseReportRedis.java new file mode 100644 index 00000000..dc616b28 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/redis/EnterpriseReportRedis.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.modules.enterprisereport.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 企业信息上报 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-08-02 + */ +@Component +public class EnterpriseReportRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/service/EnterpriseReportService.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/service/EnterpriseReportService.java new file mode 100644 index 00000000..f78c8cf0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/service/EnterpriseReportService.java @@ -0,0 +1,122 @@ +/** + * 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.enterprisereport.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.EnterpriseReportDTO; +import com.elink.esua.epdc.dto.form.EnterpriseReportAddFormDTO; +import com.elink.esua.epdc.dto.form.EnterpriseReportFormDTO; +import com.elink.esua.epdc.modules.enterprisereport.entity.EnterpriseReportEntity; + +import java.util.List; +import java.util.Map; + +/** + * 企业信息上报 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-08-02 + */ +public interface EnterpriseReportService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-08-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-08-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return EnterpriseReportDTO + * @author generator + * @date 2021-08-02 + */ + EnterpriseReportDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-08-02 + */ + void save(EnterpriseReportDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-08-02 + */ + void update(EnterpriseReportDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-08-02 + */ + void delete(String[] ids); + /** + * @Description 小程序获取企业上报列表 + * @Author songyunpeng + * @Date 2021/8/2 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result> getEnterpriseReportList(EnterpriseReportFormDTO enterpriseReportFormDTO); + /** + * @Description 新增企业上报 + * @Author songyunpeng + * @Date 2021/8/2 + * @Param [enterpriseReportAddFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result addEnterpriseReport(EnterpriseReportAddFormDTO enterpriseReportAddFormDTO); + /** + * @Description 小程序获取企业上报详情 + * @Author songyunpeng + * @Date 2021/8/4 + * @Param [id] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result getEnterpriseReportDetail(String id); +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/service/impl/EnterpriseReportServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/service/impl/EnterpriseReportServiceImpl.java new file mode 100644 index 00000000..abbfff60 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/service/impl/EnterpriseReportServiceImpl.java @@ -0,0 +1,232 @@ +/** + * 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.enterprisereport.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.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.EnterpriseReportDTO; +import com.elink.esua.epdc.dto.SysSimpleDictDTO; +import com.elink.esua.epdc.dto.form.EnterpriseReportAddFormDTO; +import com.elink.esua.epdc.dto.form.EnterpriseReportFormDTO; +import com.elink.esua.epdc.modules.enterprisereport.dao.EnterpriseReportDao; +import com.elink.esua.epdc.modules.enterprisereport.entity.EnterpriseReportEntity; +import com.elink.esua.epdc.modules.enterprisereport.service.EnterpriseReportService; +import com.elink.esua.epdc.modules.feign.AdminFeignClient; +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-08-02 + */ +@Service +public class EnterpriseReportServiceImpl extends BaseServiceImpl implements EnterpriseReportService { + + @Autowired + private AdminFeignClient adminFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, EnterpriseReportDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, EnterpriseReportDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String gridId = (String)params.get("gridId"); + String communityId = (String)params.get("communityId"); + String streetId = (String)params.get("streetId"); + String year = (String)params.get("year"); + String quarter = (String)params.get("quarter"); + String enterpriseName = (String)params.get("enterpriseName"); + String legalPerson = (String)params.get("legalPerson"); + String concat = (String)params.get("concat"); + String enterpriseStatus = (String)params.get("enterpriseStatus"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.apply(StringUtils.isNotBlank(gridId),"FIND_IN_SET ("+gridId+",ALL_DEPT_IDS)"); + wrapper.apply(StringUtils.isNotBlank(communityId),"FIND_IN_SET ("+communityId+",ALL_DEPT_IDS)"); + wrapper.apply(StringUtils.isNotBlank(streetId),"FIND_IN_SET ("+streetId+",ALL_DEPT_IDS)"); + wrapper.eq(StringUtils.isNotBlank(year), "YEAR", year); + wrapper.eq(StringUtils.isNotBlank(quarter), "QUARTER", quarter); + wrapper.like(StringUtils.isNotBlank(enterpriseName), "ENTERPRISE_NAME", enterpriseName); + wrapper.like(StringUtils.isNotBlank(legalPerson), "LEGAL_PERSON", legalPerson); + wrapper.like(StringUtils.isNotBlank(concat), "CONCAT", concat); + wrapper.eq(StringUtils.isNotBlank(enterpriseStatus), "ENTERPRISE_STATUS", enterpriseStatus); + + return wrapper; + } + + @Override + public EnterpriseReportDTO get(String id) { + EnterpriseReportEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, EnterpriseReportDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(EnterpriseReportDTO dto) { + EnterpriseReportEntity entity = ConvertUtils.sourceToTarget(dto, EnterpriseReportEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(EnterpriseReportDTO dto) { + EnterpriseReportEntity entity = ConvertUtils.sourceToTarget(dto, EnterpriseReportEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result> getEnterpriseReportList(EnterpriseReportFormDTO formDTO) { + int pageIndex = (formDTO.getPageIndex() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageIndex(pageIndex); + List list = this.baseDao.getEnterpriseReportList(formDTO); + //处理字典信息 + formatList(list); + return new Result().ok(list); + } + + private void formatList(List list) { + Result> enterpriseStatusRes = adminFeignClient.getListSimpleByDictType("enterprise_status"); + if(enterpriseStatusRes.success()){ + List dict = enterpriseStatusRes.getData(); + for (SysSimpleDictDTO sysSimpleDictDTO : dict) { + for (EnterpriseReportDTO enterpriseReportDTO : list) { + if(enterpriseReportDTO.getEnterpriseStatus().equals(sysSimpleDictDTO.getDictValue())){ + enterpriseReportDTO.setEnterpriseStatus(sysSimpleDictDTO.getDictName()); + } + } + } + } + Result> enterpriseQuarterRes = adminFeignClient.getListSimpleByDictType("enterprise_quarter"); + if(enterpriseQuarterRes.success()){ + List dict = enterpriseQuarterRes.getData(); + for (SysSimpleDictDTO sysSimpleDictDTO : dict) { + for (EnterpriseReportDTO enterpriseReportDTO : list) { + if(enterpriseReportDTO.getQuarter().equals(sysSimpleDictDTO.getDictValue())){ + enterpriseReportDTO.setQuarter(sysSimpleDictDTO.getDictName()); + } + } + } + } + } + + @Override + public Result addEnterpriseReport(EnterpriseReportAddFormDTO enterpriseReportAddFormDTO) { + + EnterpriseReportEntity enterpriseReportEntity = new EnterpriseReportEntity(); + enterpriseReportEntity.setDept(enterpriseReportAddFormDTO.getDept()); + enterpriseReportEntity.setDeptId(enterpriseReportAddFormDTO.getDeptId()); + enterpriseReportEntity.setMobile(enterpriseReportAddFormDTO.getMobile()); + enterpriseReportEntity.setRealName(enterpriseReportAddFormDTO.getRealName()); + enterpriseReportEntity.setFaceImg(enterpriseReportAddFormDTO.getFaceImg()); + enterpriseReportEntity.setUserId(enterpriseReportAddFormDTO.getUserId()); + enterpriseReportEntity.setYear(enterpriseReportAddFormDTO.getYear()); + enterpriseReportEntity.setQuarter(enterpriseReportAddFormDTO.getQuarter()); + enterpriseReportEntity.setEnterpriseName(enterpriseReportAddFormDTO.getEnterpriseName()); + enterpriseReportEntity.setLegalPerson(enterpriseReportAddFormDTO.getLegalPerson()); + enterpriseReportEntity.setConcat(enterpriseReportAddFormDTO.getConcat()); + enterpriseReportEntity.setEnterpriseStatus(enterpriseReportAddFormDTO.getEnterpriseStatus()); + enterpriseReportEntity.setEnterpriseIncome(enterpriseReportAddFormDTO.getEnterpriseIncome()); + enterpriseReportEntity.setEnterprisePeopleNum(enterpriseReportAddFormDTO.getEnterprisePeopleNum()); + enterpriseReportEntity.setQuestion(enterpriseReportAddFormDTO.getQuestion()); + //获取部门信息 + Result parentAndAllDept = adminFeignClient.getParentAndAllDept(Long.parseLong(enterpriseReportAddFormDTO.getGridId())); + if(!parentAndAllDept.success()){ + return new Result().error("获取部门信息失败"); + } + ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData(); + enterpriseReportEntity.setGrid(parentAndAllDeptDTO.getGrid()); + enterpriseReportEntity.setGridId(parentAndAllDeptDTO.getGridId()); + enterpriseReportEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); + enterpriseReportEntity.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames()); + enterpriseReportEntity.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds()); + enterpriseReportEntity.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames()); + //校验唯一性 + QueryWrapper entityQueryWrapper =new QueryWrapper<>(); + entityQueryWrapper.eq("YEAR",enterpriseReportAddFormDTO.getYear()); + entityQueryWrapper.eq("QUARTER",enterpriseReportAddFormDTO.getQuarter()); + entityQueryWrapper.eq("ENTERPRISE_NAME",enterpriseReportAddFormDTO.getEnterpriseName()); + List enterpriseReportEntities = baseDao.selectList(entityQueryWrapper); + if(enterpriseReportEntities.size()>1){ + enterpriseReportEntity.setId(enterpriseReportEntities.get(0).getId()); + baseDao.updateById(enterpriseReportEntity); + return new Result(); + } + insert(enterpriseReportEntity); + return new Result(); + } + + @Override + public Result getEnterpriseReportDetail(String id) { + EnterpriseReportDTO enterpriseReportDTO = get(id); + Result> enterpriseStatusRes = adminFeignClient.getListSimpleByDictType("enterprise_status"); + if(enterpriseStatusRes.success()){ + List dict = enterpriseStatusRes.getData(); + for (SysSimpleDictDTO sysSimpleDictDTO : dict) { + if(enterpriseReportDTO.getEnterpriseStatus().equals(sysSimpleDictDTO.getDictValue())){ + enterpriseReportDTO.setEnterpriseStatus(sysSimpleDictDTO.getDictName()); + } + } + } + Result> enterpriseQuarterRes = adminFeignClient.getListSimpleByDictType("enterprise_quarter"); + if(enterpriseQuarterRes.success()){ + List dict = enterpriseQuarterRes.getData(); + for (SysSimpleDictDTO sysSimpleDictDTO : dict) { + if(enterpriseReportDTO.getQuarter().equals(sysSimpleDictDTO.getDictValue())){ + enterpriseReportDTO.setQuarter(sysSimpleDictDTO.getDictName()); + } + } + } + return new Result().ok(enterpriseReportDTO); + } + + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/enterprisereport/EnterpriseReportDao.xml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/enterprisereport/EnterpriseReportDao.xml new file mode 100644 index 00000000..2d821fe6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/enterprisereport/EnterpriseReportDao.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +