diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomEnterpriseController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomEnterpriseController.java new file mode 100644 index 000000000..41ef8bf2e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomEnterpriseController.java @@ -0,0 +1,66 @@ +package com.elink.esua.epdc.controller; + +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.dto.enterprise.form.EnterpriseInfoFormDTO; +import com.elink.esua.epdc.dto.enterprise.result.EnterpriseInfoResultDTO; +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.dto.form.CompleteRequisiteInfoDTO; +import com.elink.esua.epdc.service.CustomEnterpriseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 企业认证 + * + * @author work@yujt.net.cn + * @date 2020/2/28 11:27 + */ +@RestController +@RequestMapping("custom/enterprise") +public class ApiCustomEnterpriseController { + + @Autowired + private CustomEnterpriseService customEnterpriseService; + + /** + * @Description 企业信息完善 + * @Author songyunpeng + * @Date 2020/2/28 + * @Param [enterpriseInfoDTO] + * @return void + **/ + @GetMapping("/completeSelectiveInfo") + public Result completeEnterpriseInfo(EnterpriseInfoFormDTO enterpriseInfoFormDTO) { + return customEnterpriseService.completeEnterpriseInfo(enterpriseInfoFormDTO); + } + /** + * @Description 查询企业信息 + * @Author songyunpeng + * @Date 2020/2/28 + * @Param [userId] + * @return com.elink.esua.epdc.dto.enterprise.result.EnterpriseInfoResultDTO + **/ + + @GetMapping("/getByUserId") + public Result getByUserId(@LoginUser TokenDto tokenDto) { + String userId = tokenDto.getUserId(); + return customEnterpriseService.selectOneEnterpriseInfo(userId); + } + + + /*** + * 完善企业信息,必填表单 + * @param + * @return Result + * @author qushutong + * @date 2020/2/28 13:34 + */ + @PostMapping("completeRequisiteInfo") + public Result completeRequisiteInfo(@RequestBody CompleteRequisiteInfoDTO fromDto, @LoginUser TokenDto tokenDto) { + return customEnterpriseService.completeRequisiteInfo(fromDto, tokenDto); + } +} 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 b67a06116..a65feb0c1 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,21 +3,24 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.EpidemicSentryPostDTO; +import com.elink.esua.epdc.dto.enterprise.form.EnterpriseInfoFormDTO; +import com.elink.esua.epdc.dto.enterprise.result.EnterpriseInfoResultDTO; +import com.elink.esua.epdc.dto.form.CompleteRequisiteInfoDTO; import com.elink.esua.epdc.dto.form.EpiDemicReportFormDTO; -import com.elink.esua.epdc.dto.result.EpdcSentryPostInfoResultDTO; import com.elink.esua.epdc.feign.fallback.CustomFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; /** * @author yzm * @Date: 2020/1/28 13:24 * @Description: 定制化功能模块fegin */ -@FeignClient(name = ServiceConstant.EPDC_CUSTOM_SERVER, fallback = CustomFeignClientFallback.class) +@FeignClient(name = ServiceConstant.EPDC_CUSTOM_SERVER, fallback = CustomFeignClientFallback.class,url = "http://127.0.0.1:9076") public interface CustomFeignClient { /** * @param formDTO @@ -51,4 +54,20 @@ public interface CustomFeignClient { @GetMapping(value = "custom/epidemicSentryPost/selectOneByThirdSentryPostid/{thirdSentryPostid}", consumes = MediaType.APPLICATION_JSON_VALUE) Result getEpidemicSentryByThirdSentryPostid(@PathVariable("thirdSentryPostid") String thirdSentryPostid); + @GetMapping(value = "custom/enterpriseinfo/completeSelectiveInfo", consumes = MediaType.APPLICATION_JSON_VALUE) + Result completeEnterpriseInfo(EnterpriseInfoFormDTO enterpriseInfoFormDTO); + + + @GetMapping(value = "custom/enterpriseinfo/getByUserId/{userId}", consumes = MediaType.APPLICATION_JSON_VALUE) + Result getEnterpriseInfoByUserId(@PathVariable("userId")String userId); + + /*** + * 完善企业信息,必填表单 + * @param fromDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2020/2/28 13:49 + */ + @PostMapping(value = "custom/enterpriseinfo/completeRequisiteInfo", consumes = MediaType.APPLICATION_JSON_VALUE) + Result completeRequisiteInfo(@RequestBody CompleteRequisiteInfoDTO fromDto); } 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 00829eb3e..2cc170f57 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,10 @@ import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.EpidemicSentryPostDTO; +import com.elink.esua.epdc.dto.enterprise.EnterpriseInfoDTO; +import com.elink.esua.epdc.dto.enterprise.form.EnterpriseInfoFormDTO; +import com.elink.esua.epdc.dto.enterprise.result.EnterpriseInfoResultDTO; +import com.elink.esua.epdc.dto.form.CompleteRequisiteInfoDTO; import com.elink.esua.epdc.dto.form.EpiDemicReportFormDTO; import com.elink.esua.epdc.feign.CustomFeignClient; import org.springframework.stereotype.Component; @@ -30,4 +34,19 @@ public class CustomFeignClientFallback implements CustomFeignClient { public Result getEpidemicSentryByThirdSentryPostid(String thirdSentryPostid) { return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "getEpidemicSentryByThirdSentryPostid", thirdSentryPostid); } + + @Override + public Result completeEnterpriseInfo(EnterpriseInfoFormDTO enterpriseInfoFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "completeEnterpriseInfo", enterpriseInfoFormDTO); + } + + @Override + public Result getEnterpriseInfoByUserId(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "getEnterpriseInfoByUserId", userId); + } + + @Override + public Result completeRequisiteInfo(CompleteRequisiteInfoDTO fromDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "completeRequisiteInfo", fromDto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomEnterpriseService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomEnterpriseService.java new file mode 100644 index 000000000..5db5925cf --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomEnterpriseService.java @@ -0,0 +1,47 @@ +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.enterprise.EnterpriseInfoDTO; +import com.elink.esua.epdc.dto.enterprise.form.EnterpriseInfoFormDTO; +import com.elink.esua.epdc.dto.enterprise.result.EnterpriseInfoResultDTO; + +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.form.CompleteRequisiteInfoDTO; + +/** + * 企业认证 + * + * @author work@yujt.net.cn + * @date 2020/2/28 11:28 + */ +public interface CustomEnterpriseService { + + /** + * @Description 企业信息完善 + * @Author songyunpeng + * @Date 2020/2/28 + * @Param [enterpriseInfoDTO] + * @return void + **/ + Result completeEnterpriseInfo(EnterpriseInfoFormDTO enterpriseInfoFormDTO); + + /** + * @Description 查询企业信息 + * @Author songyunpeng + * @Date 2020/2/28 + * @Param [userId] + * @return com.elink.esua.epdc.dto.enterprise.result.EnterpriseInfoResultDTO + **/ + Result selectOneEnterpriseInfo(String userId); + + /*** + * 完善企业信息,必填表单 + * @param + * @return + * @author qushutong + * @date 2020/2/28 13:44 + */ + Result completeRequisiteInfo(CompleteRequisiteInfoDTO fromDto, TokenDto tokenDto); + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java index be093aef7..c1b39f271 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java @@ -793,15 +793,7 @@ public class AppUserServiceImpl implements AppUserService { return new Result().error(verifyResult.getMsg()); } String userState = verifyResult.getData(); - - if (StringUtils.isNotBlank(infoDto.getWxCode())) { - String sessionKey = this.getUserSessionKey(infoDto.getWxCode()); - WxMaUserInfo wxMaUserInfo = wxMaServiceUtils.normalWxMaService().getUserService().getUserInfo(sessionKey, infoDto.getEncryptedData(), infoDto.getIv()); - if (StringUtils.isBlank(wxMaUserInfo.getUnionId())) { - return new Result().error("解析微信开放平台ID失败"); - } - userDto.setWxUnionId(wxMaUserInfo.getUnionId()); - } + userDto.setWxUnionId(getWxUnionId(infoDto.getWxCode(), infoDto.getIv(), infoDto.getEncryptedData())); UserGridRelationDTO userGrid = this.packageUserGridRelationInfo(infoDto.getGridId()); EpdcCompleteAppUserDTO completeAppUserDto = ConvertUtils.sourceToTarget(userDto, EpdcCompleteAppUserDTO.class); @@ -846,6 +838,32 @@ public class AppUserServiceImpl implements AppUserService { return new Result().ok(authorizationDto); } + /** + * 解析微信用户unionid + *

代码说明: + * 小程序端用户完善信息界面,提交数据前会调用{@link com.elink.esua.epdc.controller.ApiAppUserController#checkWxUnionId(TokenDto)} + * 获取用户是否已绑定了微信unionId + * 如果用户保存过unionId,前端不会再上送encryptedData,wxCode,iv这三个参数。

+ * + * @param wxCode + * @param iv + * @param encryptedData + * @return java.lang.String + * @author work@yujt.net.cn + * @date 2020/2/28 14:51 + */ + private String getWxUnionId(String wxCode, String iv, String encryptedData) { + if (StringUtils.isBlank(wxCode) || StringUtils.isBlank(iv) || StringUtils.isBlank(encryptedData)) { + return null; + } + String sessionKey = this.getUserSessionKey(wxCode); + WxMaUserInfo wxMaUserInfo = wxMaServiceUtils.normalWxMaService().getUserService().getUserInfo(sessionKey, encryptedData, iv); + if (null == wxMaUserInfo || StringUtils.isBlank(wxMaUserInfo.getUnionId())) { + throw new RenException("解析微信数据失败,请刷新后重试"); + } + return wxMaUserInfo.getUnionId(); + } + @Override public Result prepareCompleteUserInfo(TokenDto tokenDto) { @@ -1008,6 +1026,9 @@ public class AppUserServiceImpl implements AppUserService { } } catch (WxErrorException e) { e.printStackTrace(); + if (e.getError().getErrorCode() == 40163) { + throw new RenException("禁止重复提交,请刷新页面后重试"); + } throw new RenException(e.getError().getErrorMsg()); } return null; diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomEnterpriseServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomEnterpriseServiceImpl.java new file mode 100644 index 000000000..dd6234b8b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomEnterpriseServiceImpl.java @@ -0,0 +1,101 @@ +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.enterprise.form.EnterpriseInfoFormDTO; +import com.elink.esua.epdc.dto.enterprise.result.EnterpriseInfoResultDTO; +import com.elink.esua.epdc.feign.CustomFeignClient; +import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; +import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.form.CompleteRequisiteInfoDTO; +import com.elink.esua.epdc.feign.CustomFeignClient; +import com.elink.esua.epdc.redis.AppUserRedis; +import com.elink.esua.epdc.service.CustomEnterpriseService; +import com.elink.esua.epdc.utils.WxMaServiceUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import me.chanjar.weixin.common.error.WxErrorException; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 企业认证 + * + * @author work@yujt.net.cn + * @date 2020/2/28 11:28 + */ +@Slf4j +@Service +public class CustomEnterpriseServiceImpl implements CustomEnterpriseService { + + @Autowired + private AppUserRedis appUserRedis; + + @Autowired + private CustomFeignClient customFeignClient; + + @Autowired + private WxMaServiceUtils wxMaServiceUtils; + + @Override + public Result completeEnterpriseInfo(EnterpriseInfoFormDTO enterpriseInfoDTO) { + return customFeignClient.completeEnterpriseInfo(enterpriseInfoDTO); + } + + @Override + public Result selectOneEnterpriseInfo(String userId) { + return customFeignClient.getEnterpriseInfoByUserId(userId); + } + + + @Override + public Result completeRequisiteInfo(CompleteRequisiteInfoDTO fromDto, TokenDto tokenDto) { + // 验证手机号 + this.checkSmsCode(fromDto.getMobile(), fromDto.getSmsCode()); + fromDto.setUserId(tokenDto.getUserId()); + if (StringUtils.isNotBlank(fromDto.getWxCode())&&StringUtils.isNotBlank(fromDto.getIv())&&StringUtils.isNotBlank(fromDto.getEncryptedData())) { + String sessionKey = this.getUserSessionKey(fromDto.getWxCode()); + WxMaUserInfo wxMaUserInfo = wxMaServiceUtils.normalWxMaService().getUserService().getUserInfo(sessionKey, fromDto.getEncryptedData(), fromDto.getIv()); + if (StringUtils.isBlank(wxMaUserInfo.getUnionId())) { + return new Result().error("解析微信开放平台ID失败"); + } + fromDto.setWxUnionId(wxMaUserInfo.getUnionId()); + } + + return customFeignClient.completeRequisiteInfo(fromDto); + } + + /** + * 校验手机验证码 + */ + private void checkSmsCode(String mobile, String smsCode) { + String redisSmsCode = appUserRedis.getSmsCode(mobile); + if (StringUtils.isBlank(redisSmsCode) || !redisSmsCode.equals(smsCode)) { + throw new RenException("手机验证码错误"); + } + } + + /** + * 根据微信code获取session_key + * + * @return java.lang.String + * @params [code] + * @author liuchuang + * @since 2019/10/25 16:31 + */ + private String getUserSessionKey(String code) { + try { + WxMaJscode2SessionResult wxMaJscode2SessionResult = wxMaServiceUtils.normalWxMaService().jsCode2SessionInfo(code); + if (wxMaJscode2SessionResult != null) { + return wxMaJscode2SessionResult.getSessionKey(); + } + } catch (WxErrorException e) { + e.printStackTrace(); + throw new RenException(e.getError().getErrorMsg()); + } + return null; + } +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/enterprise/EnterpriseInfoDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/enterprise/EnterpriseInfoDTO.java new file mode 100644 index 000000000..e33ac120a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/enterprise/EnterpriseInfoDTO.java @@ -0,0 +1,156 @@ +/** + * 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.enterprise; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 企业信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-02-28 + */ +@Data +public class EnterpriseInfoDTO implements Serializable { + + private static final long serialVersionUID = 6426517740744532420L; + + /** + * 主键 + */ + private String id; + + /** + * 用户id + */ + private String userId; + + /** + * 用户姓名 + */ + private String realName; + + /** + * 性别 0女 1男 + */ + private String sex; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 企业名称 + */ + private String enterpriseName; + + /** + * 统一社会信用代码 + */ + private String uniformSocialCreditCode; + + /** + * 企业地址 + */ + private String enterpriseAddress; + + /** + * 法定代表人 + */ + private String legalPerson; + + /** + * 注册资金(万元) + */ + private Integer registeredCapital; + + /** + * 从业人数 + */ + private Integer employedPopulation; + + /** + * 所属行业 + */ + private String industry; + + /** + * 经营范围 + */ + private String businessScope; + + /** + * 居住网格id + */ + private Long deptId; + + /** + * 父所有部门 + */ + private String parentDeptIds; + + /** + * 父所有部门 + */ + private String parentDeptNames; + + /** + * 所有部门ID + */ + private String allDeptIds; + + /** + * 所有部门名称 + */ + private String allDeptNames; + + /** + * 乐观锁 + */ + 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-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/enterprise/form/EnterpriseInfoFormDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/enterprise/form/EnterpriseInfoFormDTO.java new file mode 100644 index 000000000..97efd8aaa --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/enterprise/form/EnterpriseInfoFormDTO.java @@ -0,0 +1,75 @@ +/** + * 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.enterprise.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 2020-02-28 + */ +@Data +public class EnterpriseInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 6426517740744532420L; + + /** + * 主键 + */ + @NotBlank(message = "ID不能为空") + private String id; + + /** + * 用户id + */ + private String userId; + + /** + * 法定代表人 + */ + private String legalPerson; + + /** + * 注册资金(万元) + */ + private Integer registeredCapital; + + /** + * 从业人数 + */ + private Integer employedPopulation; + + /** + * 所属行业 + */ + private String industry; + + /** + * 经营范围 + */ + private String businessScope; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/enterprise/result/EnterpriseInfoResultDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/enterprise/result/EnterpriseInfoResultDTO.java new file mode 100644 index 000000000..7cdc325aa --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/enterprise/result/EnterpriseInfoResultDTO.java @@ -0,0 +1,112 @@ +/** + * 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.enterprise.result; + +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 2020-02-28 + */ +@Data +public class EnterpriseInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 6426517740744532420L; + + /** + * 主键 + */ + private String id; + + /** + * 用户id + */ + private String userId; + + /** + * 用户姓名 + */ + private String realName; + + /** + * 性别 0女 1男 + */ + private String sex; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 企业名称 + */ + private String enterpriseName; + + /** + * 统一社会信用代码 + */ + private String uniformSocialCreditCode; + + /** + * 企业地址 + */ + private String enterpriseAddress; + + /** + * 法定代表人 + */ + private String legalPerson; + + /** + * 注册资金(万元) + */ + private Integer registeredCapital; + + /** + * 从业人数 + */ + private Integer employedPopulation; + + /** + * 所属行业 + */ + private String industry; + + /** + * 经营范围 + */ + private String businessScope; + + /** + * 居住网格id + */ + private Long deptId; + /** + * 所有部门名称 + */ + private String allDeptNames; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/CompleteRequisiteInfoDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/CompleteRequisiteInfoDTO.java new file mode 100644 index 000000000..e518229cb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/CompleteRequisiteInfoDTO.java @@ -0,0 +1,73 @@ +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author: qushutong + * @Date: 2020/2/28 13:36 + * @Description: + */ +@Data +public class CompleteRequisiteInfoDTO implements Serializable { + private static final long serialVersionUID = 1371157927862793721L; + + + @NotBlank(message = "姓名不能为空") + private String realName; + + /*** + *性别 0女 1男 + */ + @NotBlank(message = "性别不能为空") + private String sex; + + @NotBlank(message = "联系电话电话不能为空") + private String mobile; + + @NotBlank(message = "企业名称不能为空") + private String enterpriseName; + + @NotBlank(message = "统一社会信用代码不能为空") + private String uniformSocialCreditCode; + + @NotBlank(message = "企业地址不能为空") + private String enterpriseAddress; + + @NotBlank(message = "居住网格ID不能为空") + private Long deptId; + + /** + * 企业id(修改时必填) + */ + + private String id; + + @NotBlank(message = "手机号验证码不能为空") + private String smsCode; + + /** + * 微信code不能为空 + */ + private String wxCode; + + /** + * 微信信息加密向量(用户unionid为空时传入) + */ + private String iv; + + /** + * 微信加密数据(用户unionid为空时传入) + */ + private String encryptedData; + + + private String userId; + + + private String wxUnionId; + + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml index 7c54b78e0..83037907b 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml @@ -13,6 +13,11 @@ jar + + com.esua.epdc + epdc-user-client + 1.0.0 + com.esua.epdc epdc-custom-client diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/controller/EnterpriseInfoController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/controller/EnterpriseInfoController.java new file mode 100644 index 000000000..70ef79807 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/controller/EnterpriseInfoController.java @@ -0,0 +1,125 @@ +/** + * 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.enterprise.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.enterprise.EnterpriseInfoDTO; +import com.elink.esua.epdc.dto.enterprise.form.EnterpriseInfoFormDTO; +import com.elink.esua.epdc.dto.enterprise.result.EnterpriseInfoResultDTO; +import com.elink.esua.epdc.dto.form.CompleteRequisiteInfoDTO; +import com.elink.esua.epdc.modules.enterprise.excel.EnterpriseInfoExcel; +import com.elink.esua.epdc.modules.enterprise.service.EnterpriseInfoService; +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 elink elink@elink-cn.com + * @since v1.0.0 2020-02-28 + */ +@RestController +@RequestMapping("enterpriseinfo") +public class EnterpriseInfoController { + + @Autowired + private EnterpriseInfoService enterpriseInfoService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = enterpriseInfoService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + EnterpriseInfoDTO data = enterpriseInfoService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody EnterpriseInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + enterpriseInfoService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody EnterpriseInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + enterpriseInfoService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + enterpriseInfoService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = enterpriseInfoService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, EnterpriseInfoExcel.class); + } + + + /*** + * 完善企业信息,必填表单 + * @param + * @return Result + * @author qushutong + * @date 2020/2/28 13:34 + */ + @PostMapping("completeRequisiteInfo") + public Result completeRequisiteInfo(@RequestBody CompleteRequisiteInfoDTO fromDto) { + return enterpriseInfoService.completeRequisiteInfo(fromDto); + } + + @GetMapping("completeSelectiveInfo") + public Result completeEnterpriseInfo(@RequestBody EnterpriseInfoFormDTO dto){ + ValidatorUtils.validateEntity(dto); + enterpriseInfoService.completeEnterpriseInfo(dto); + return new Result().ok(true); + } + + @GetMapping("getByUserId/{userId}") + public Result getEnterpriseInfoByUserId(@PathVariable("userId") String userId){ + if(userId==null){ + return new Result().error("用户ID为空"); + } + EnterpriseInfoResultDTO enterpriseInfoDTO = enterpriseInfoService.selectOneEnterpriseInfo(userId); + return new Result().ok(enterpriseInfoDTO); + } +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/dao/EnterpriseInfoDao.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/dao/EnterpriseInfoDao.java new file mode 100644 index 000000000..834f19192 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/dao/EnterpriseInfoDao.java @@ -0,0 +1,53 @@ +/** + * 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.enterprise.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.enterprise.EnterpriseInfoDTO; +import com.elink.esua.epdc.dto.enterprise.form.EnterpriseInfoFormDTO; +import com.elink.esua.epdc.dto.enterprise.result.EnterpriseInfoResultDTO; +import com.elink.esua.epdc.modules.enterprise.entity.EnterpriseInfoEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 企业信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-02-28 + */ +@Mapper +public interface EnterpriseInfoDao extends BaseDao { + /** + * @Description 企业信息完善 + * @Author songyunpeng + * @Date 2020/2/28 + * @Param [enterpriseInfoDTO] + * @return void + **/ + void completeEnterpriseInfo(EnterpriseInfoFormDTO formDTO); + + /** + * @Description 查询企业信息 + * @Author songyunpeng + * @Date 2020/2/28 + * @Param [userId] + * @return com.elink.esua.epdc.dto.enterprise.result.EnterpriseInfoResultDTO + **/ + EnterpriseInfoResultDTO selectOneEnterpriseInfo(@Param("userId") String userId); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/entity/EnterpriseInfoEntity.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/entity/EnterpriseInfoEntity.java new file mode 100644 index 000000000..32e3800a9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/entity/EnterpriseInfoEntity.java @@ -0,0 +1,124 @@ +/** + * 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.enterprise.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 企业信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-02-28 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("epdc_enterprise_info") +public class EnterpriseInfoEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 178250149688071757L; + + /** + * 用户id + */ + private String userId; + + /** + * 用户姓名 + */ + private String realName; + + /** + * 性别 0女 1男 + */ + private String sex; + + /** + * 联系电话 + */ + private String mobile; + + /** + * 企业名称 + */ + private String enterpriseName; + + /** + * 统一社会信用代码 + */ + private String uniformSocialCreditCode; + + /** + * 企业地址 + */ + private String enterpriseAddress; + + /** + * 法定代表人 + */ + private String legalPerson; + + /** + * 注册资金(万元) + */ + private Integer registeredCapital; + + /** + * 从业人数 + */ + private Integer employedPopulation; + + /** + * 所属行业 + */ + private String industry; + + /** + * 经营范围 + */ + private String businessScope; + + /** + * 居住网格id + */ + private Long deptId; + + /** + * 父所有部门 + */ + private String parentDeptIds; + + /** + * 父所有部门 + */ + private String parentDeptNames; + + /** + * 所有部门ID + */ + private String allDeptIds; + + /** + * 所有部门名称 + */ + private String allDeptNames; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/excel/EnterpriseInfoExcel.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/excel/EnterpriseInfoExcel.java new file mode 100644 index 000000000..665e03084 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/excel/EnterpriseInfoExcel.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.enterprise.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 企业信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-02-28 + */ +@Data +public class EnterpriseInfoExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "用户id") + private String userId; + + @Excel(name = "用户姓名") + private String realName; + + @Excel(name = "性别 0女 1男") + private String sex; + + @Excel(name = "联系电话") + private String mobile; + + @Excel(name = "企业名称") + private String enterpriseName; + + @Excel(name = "统一社会信用代码") + private String uniformSocialCreditCode; + + @Excel(name = "企业地址") + private String enterpriseAddress; + + @Excel(name = "法定代表人") + private String legalPerson; + + @Excel(name = "注册资金(万元)") + private Integer registeredCapital; + + @Excel(name = "从业人数") + private Integer employedPopulation; + + @Excel(name = "所属行业") + private String industry; + + @Excel(name = "经营范围") + private String businessScope; + + @Excel(name = "居住网格id") + private Long deptId; + + @Excel(name = "父所有部门") + private String parentDeptIds; + + @Excel(name = "父所有部门") + private String parentDeptNames; + + @Excel(name = "所有部门ID") + private String allDeptIds; + + @Excel(name = "所有部门名称") + private String allDeptNames; + + @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; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/redis/EnterpriseInfoRedis.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/redis/EnterpriseInfoRedis.java new file mode 100644 index 000000000..6cd9ee4ae --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/redis/EnterpriseInfoRedis.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.enterprise.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 企业信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-02-28 + */ +@Component +public class EnterpriseInfoRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/service/EnterpriseInfoService.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/service/EnterpriseInfoService.java new file mode 100644 index 000000000..abfef760e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/service/EnterpriseInfoService.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.modules.enterprise.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.enterprise.EnterpriseInfoDTO; +import com.elink.esua.epdc.dto.enterprise.form.EnterpriseInfoFormDTO; +import com.elink.esua.epdc.dto.enterprise.result.EnterpriseInfoResultDTO; +import com.elink.esua.epdc.dto.form.CompleteRequisiteInfoDTO; +import com.elink.esua.epdc.modules.enterprise.entity.EnterpriseInfoEntity; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 企业信息表 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-02-28 + */ +public interface EnterpriseInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-02-28 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-02-28 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return EnterpriseInfoDTO + * @author generator + * @date 2020-02-28 + */ + EnterpriseInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-02-28 + */ + void save(EnterpriseInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-02-28 + */ + void update(EnterpriseInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-02-28 + */ + void delete(String[] ids); + + /** + * @Description 企业信息完善 + * @Author songyunpeng + * @Date 2020/2/28 + * @Param [enterpriseInfoDTO] + * @return void + **/ + void completeEnterpriseInfo(EnterpriseInfoFormDTO enterpriseInfoFormDTO); + + /** + * @Description 查询企业信息 + * @Author songyunpeng + * @Date 2020/2/28 + * @Param [userId] + * @return com.elink.esua.epdc.dto.enterprise.result.EnterpriseInfoResultDTO + **/ + EnterpriseInfoResultDTO selectOneEnterpriseInfo(String userId); + + + /*** + * 完善企业信息,必填表单 + * @param + * @return + * @author qushutong + * @date 2020/2/28 13:44 + */ + Result completeRequisiteInfo(CompleteRequisiteInfoDTO fromDto); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/service/impl/EnterpriseInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/service/impl/EnterpriseInfoServiceImpl.java new file mode 100644 index 000000000..5fb591b34 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprise/service/impl/EnterpriseInfoServiceImpl.java @@ -0,0 +1,156 @@ +/** + * 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.enterprise.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.exception.RenException; +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.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; +import com.elink.esua.epdc.dto.enterprise.EnterpriseInfoDTO; +import com.elink.esua.epdc.dto.enterprise.form.EnterpriseInfoFormDTO; +import com.elink.esua.epdc.dto.enterprise.result.EnterpriseInfoResultDTO; +import com.elink.esua.epdc.dto.epdc.form.CompleteRequisiteUserInfoDTO; +import com.elink.esua.epdc.dto.form.CompleteRequisiteInfoDTO; +import com.elink.esua.epdc.modules.enterprise.dao.EnterpriseInfoDao; +import com.elink.esua.epdc.modules.enterprise.entity.EnterpriseInfoEntity; +import com.elink.esua.epdc.modules.enterprise.redis.EnterpriseInfoRedis; +import com.elink.esua.epdc.modules.enterprise.service.EnterpriseInfoService; +import com.elink.esua.epdc.modules.feign.AdminFeignClient; +import com.elink.esua.epdc.modules.feign.UserFeignClient; +import io.seata.spring.annotation.GlobalTransactional; +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 elink elink@elink-cn.com + * @since v1.0.0 2020-02-28 + */ +@Service +public class EnterpriseInfoServiceImpl extends BaseServiceImpl implements EnterpriseInfoService { + + @Autowired + private EnterpriseInfoRedis enterpriseInfoRedis; + + + @Autowired + private AdminFeignClient adminFeignClient; + + @Autowired + private UserFeignClient userFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, EnterpriseInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, EnterpriseInfoDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public EnterpriseInfoDTO get(String id) { + EnterpriseInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, EnterpriseInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(EnterpriseInfoDTO dto) { + EnterpriseInfoEntity entity = ConvertUtils.sourceToTarget(dto, EnterpriseInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(EnterpriseInfoDTO dto) { + EnterpriseInfoEntity entity = ConvertUtils.sourceToTarget(dto, EnterpriseInfoEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void completeEnterpriseInfo(EnterpriseInfoFormDTO enterpriseInfoFormDTO) { + baseDao.completeEnterpriseInfo(enterpriseInfoFormDTO); + } + + @Override + public EnterpriseInfoResultDTO selectOneEnterpriseInfo(String userId) { + return baseDao.selectOneEnterpriseInfo(userId); + } + + @GlobalTransactional + @Override + public Result completeRequisiteInfo(CompleteRequisiteInfoDTO fromDto) { + //保存到企业数据库 + EnterpriseInfoDTO enterpriseInfoDTO = ConvertUtils.sourceToTarget(fromDto, EnterpriseInfoDTO.class); + Result parentResult = adminFeignClient.getParentAndAllDept(String.valueOf(fromDto.getDeptId())); + if (!parentResult.success() || parentResult.getData() == null) { + throw new RenException("获取部门信息失败"); + } else { + ParentAndAllDeptDTO deptDTO = parentResult.getData(); + enterpriseInfoDTO.setAllDeptIds(deptDTO.getAllDeptIds()); + enterpriseInfoDTO.setAllDeptNames(deptDTO.getAllDeptNames()); + enterpriseInfoDTO.setParentDeptIds(deptDTO.getParentDeptIds()); + enterpriseInfoDTO.setParentDeptNames(deptDTO.getParentDeptNames()); + } + save(enterpriseInfoDTO); + //更新用户表数据 + CompleteRequisiteUserInfoDTO userInfoDTO = ConvertUtils.sourceToTarget(fromDto, CompleteRequisiteUserInfoDTO.class); + userInfoDTO.setDwellingPlace(enterpriseInfoDTO.getEnterpriseAddress()); + userInfoDTO.setNickName(parentResult.getData().getGrid()+"-"+ fromDto.getRealName().substring(NumConstant.ZERO, NumConstant.ONE) + + (Integer.parseInt(fromDto.getSex()) == NumConstant.ZERO ? "女士" : "先生")); + userFeignClient.completeRequisiteInfo(userInfoDTO); + return new Result(); + } +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/AdminFeignClient.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/AdminFeignClient.java new file mode 100644 index 000000000..fe70966ce --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/AdminFeignClient.java @@ -0,0 +1,42 @@ +package com.elink.esua.epdc.modules.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; +import com.elink.esua.epdc.modules.feign.fallback.AdminFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +import java.util.List; + +/** + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2019/9/5 14:44 + */ +@FeignClient(name = ServiceConstant.EPDC_ADMIN_SERVER, fallback = AdminFeignClientFallback.class) +public interface AdminFeignClient { + + /** + * 根据部门ID,获取下属所有网格ID + * + * @param pid + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author yujintao + * @date 2019/9/5 14:49 + */ + @GetMapping("/sys/dept/listGridId/{pid}") + Result> listGridIdByDeptPid(@PathVariable("pid") Long pid); + + /** + * 根据部门ID获取上级所有部门信息 + * + * @param deptId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author gp + * @date 2019-11-29 + */ + @GetMapping("/sys/dept/getParentAndAllDept/{deptId}") + Result getParentAndAllDept(@PathVariable("deptId") String deptId); +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/UserFeignClient.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/UserFeignClient.java new file mode 100644 index 000000000..e4a3e5e6e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/UserFeignClient.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.modules.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.form.CompleteRequisiteUserInfoDTO; +import com.elink.esua.epdc.modules.feign.fallback.UserFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * @author: qushutong + * @Date: 2020/2/28 14:41 + * @Description: 更新用户 + */ +@FeignClient(name = ServiceConstant.EPDC_USER_SERVER, fallback = UserFeignClientFallback.class) +public interface UserFeignClient { + + /*** + * 更新用户 + * @param + * @return Result> + * @author qushutong + * @date 2020/2/28 14:43 + */ + @PostMapping("app-user/epdc-app/user/completeRequisiteInfo") + Result completeRequisiteInfo(@RequestBody CompleteRequisiteUserInfoDTO fromDto); +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java new file mode 100644 index 000000000..b4f7c3f79 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java @@ -0,0 +1,29 @@ +package com.elink.esua.epdc.modules.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; +import com.elink.esua.epdc.modules.feign.AdminFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2019/9/5 14:44 + */ +@Component +public class AdminFeignClientFallback implements AdminFeignClient { + + @Override + public Result> listGridIdByDeptPid(Long pid) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "listGridIdByDeptPid", pid); + } + + @Override + public Result getParentAndAllDept(String depId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getParentAndAllDept", depId); + } +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserFeignClientFallback.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserFeignClientFallback.java new file mode 100644 index 000000000..f19fb6bea --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserFeignClientFallback.java @@ -0,0 +1,16 @@ +package com.elink.esua.epdc.modules.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.form.CompleteRequisiteUserInfoDTO; +import com.elink.esua.epdc.dto.form.CompleteRequisiteInfoDTO; +import com.elink.esua.epdc.modules.feign.UserFeignClient; + +public class UserFeignClientFallback implements UserFeignClient { + + @Override + public Result completeRequisiteInfo(CompleteRequisiteUserInfoDTO fromDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "completeRequisiteInfo", fromDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/enterprise/EnterpriseInfoDao.xml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/enterprise/EnterpriseInfoDao.xml new file mode 100644 index 000000000..bec467004 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/enterprise/EnterpriseInfoDao.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE epdc_enterprise_info + + LEGAL_PERSON=#{legalPerson}, + REGISTERED_CAPITAL=#{registeredCapital}, + EMPLOYED_POPULATION=#{employedPopulation}, + INDUSTRY=#{industry}, + BUSINESS_SCOPE=#{businessScope}, + + WHERE ID=#{id} + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/CompleteRequisiteUserInfoDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/CompleteRequisiteUserInfoDTO.java new file mode 100644 index 000000000..4a8fce2cb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/CompleteRequisiteUserInfoDTO.java @@ -0,0 +1,35 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author: qushutong + * @Date: 2020/2/28 13:36 + * @Description: + */ +@Data +public class CompleteRequisiteUserInfoDTO implements Serializable { + private static final long serialVersionUID = -6935440742503633316L; + + + private String realName; + + + private String mobile; + + private Long deptId; + + + private String userId; + + private String dwellingPlace; + + private String wxUnionId; + + private String nickName; + + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java index 7c42cf0b8..a0557fc4a 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java @@ -188,7 +188,7 @@ public class EpdcAppUserController { /** * 社群添加好友列表 * - * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @return com.elink.esua.epdc.commons.tools.utils.Result> * @params [formDto] * @author liuchuang * @since 2019/10/23 16:22 @@ -240,7 +240,7 @@ public class EpdcAppUserController { // 查询此用户是否已经注册并且完善了用户信息 UserDTO userDTO = userService.get(userDto.getId()); // 除了注册之外的 几个状态都不需要更新Nickname - if(AppUserStatesEnum.STATE_REGISTERED.value().equals(userDTO.getState())){ + if (AppUserStatesEnum.STATE_REGISTERED.value().equals(userDTO.getState())) { user.setNickname(userDto.getNickname()); } user.setId(userDto.getId()); @@ -338,7 +338,7 @@ public class EpdcAppUserController { /** * 获取邀请记录 * - * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @return com.elink.esua.epdc.commons.tools.utils.Result> * @params [formDto] * @author liuchuang * @since 2019/10/23 16:22 @@ -364,7 +364,7 @@ public class EpdcAppUserController { /** * @param gridIdList - * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @return com.elink.esua.epdc.commons.tools.utils.Result> * @Author yinzuomei * @Description 根据网格id查询网格下所有的用户 * @Date 2019/12/19 15:02 @@ -373,11 +373,11 @@ public class EpdcAppUserController { public Result> queryGroupUsers(@RequestBody List gridIdList) { return userService.listGridUserResultDTO(gridIdList); } - + /*** * 居民在防疫哨卡进行登记时,上送数据并完善党群系统个人信息 * @param formDTO - * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @return com.elink.esua.epdc.commons.tools.utils.Result> * @author qushutong * @date 2020/2/15 11:06 */ @@ -385,4 +385,17 @@ public class EpdcAppUserController { public Result> sentPidemicInfo(@RequestBody EpdcAppPidemicCompleteInfoFromDTO formDTO) { return userService.createPidemicInfo(formDTO); } + + + /*** + * 完善企业信息,必填表单 跟新用户 + * @param + * @return Result + * @author qushutong + * @date 2020/2/28 13:34 + */ + @PostMapping("completeRequisiteInfo") + public Result completeRequisiteInfo(@RequestBody CompleteRequisiteUserInfoDTO fromDto) { + return userService.completeRequisiteInfo(fromDto); + } } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java index 5b9d53ef1..07da036b7 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java @@ -206,28 +206,32 @@ public interface UserService extends BaseService { /** * 获取居民详情(已认证或待认证(提交信息待审核)的居民用户) + * * @param userId 用户Id * @return */ - Result residentDetail(String userId); + Result residentDetail(String userId); /** * 获取党员详情(已认证或未认证的党员用户) + * * @param userId * @return */ - Result partyMemberDetail(String userId); + Result partyMemberDetail(String userId); /** * 认证用户(用户信息审核) + * * @param formDTO * @return */ Result authenticateResident(EpdcAppAuthenticateResidentFormDTO formDTO); + /*** * 获取用户列表 * @param workUserFromDto - * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @return com.elink.esua.epdc.commons.tools.utils.Result> * @author qushutong * @date 2019/11/18 14:00 */ @@ -243,11 +247,10 @@ public interface UserService extends BaseService { Result getUnauthorizedAmount(EpdcUnauthorizedAmountFromDTO fromDto); /** - * * 获取用户最后一次切换的网格信息 * - * @params [openId] * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [openId] * @author liuchuang * @since 2019/12/6 10:59 */ @@ -264,13 +267,12 @@ public interface UserService extends BaseService { /** * @param gridIdList - * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @return com.elink.esua.epdc.commons.tools.utils.Result> * @Author yinzuomei * @Description 根据网格id查询网格下所有的用户 * @Date 2019/12/19 15:03 **/ - Result> listGridUserResultDTO(List gridIdList); - + Result> listGridUserResultDTO(List gridIdList); /*** @@ -283,5 +285,15 @@ public interface UserService extends BaseService { Result createPidemicInfo(EpdcAppPidemicCompleteInfoFromDTO completeInfoFromDto); - Result insertUserList(MultipartFile file,Map params); + Result insertUserList(MultipartFile file, Map params); + + + /*** + * 完善企业信息,必填表单 + * @param + * @return + * @author qushutong + * @date 2020/2/28 13:44 + */ + Result completeRequisiteInfo(CompleteRequisiteUserInfoDTO fromDto); } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java index 1e78377f8..262d11e5f 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java @@ -620,9 +620,6 @@ public class UserServiceImpl extends BaseServiceImpl implem partyMembersEntity.setRegistFlag(PartyMemberRegFlagEnum.AUTO.getValue()); partyMembersEntity.setMobile(userDto.getMobile()); partyMembersEntity.setRegistTime(oldEntity.getRegisterTime()); - if(StringUtils.isNotBlank(userDto.getMobile())){ - partyMembersEntity.setMobile(userDto.getMobile()); - } QueryWrapper partyWrapper = new QueryWrapper<>(); partyWrapper.eq(UserFieldConsant.IDENTITY_NO, identityNo) .eq(UserFieldConsant.REAL_NAME, userDto.getRealName()); @@ -865,7 +862,7 @@ public class UserServiceImpl extends BaseServiceImpl implem /** * @param gridIdList - * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @return com.elink.esua.epdc.commons.tools.utils.Result> * @Author yinzuomei * @Description 根据网格id查询网格下所有的用户 * @Date 2019/12/19 15:03 @@ -1089,4 +1086,18 @@ public class UserServiceImpl extends BaseServiceImpl implem System.out.println("从Excel导入数据一共 {} 行 " + userExcelList.size()); return new Result(); } + + @Override + public Result completeRequisiteInfo(CompleteRequisiteUserInfoDTO fromDto) { + UserDTO userDTO = ConvertUtils.sourceToTarget(fromDto, UserDTO.class); + UserEntity userEntity = baseDao.selectById(fromDto.getUserId()); + //而且姓名必须与用户表中原来的姓名一致,否则不更新姓名与昵称。 + if (!userEntity.getRealName().equals(userDTO.getRealName())) { + userDTO.setRealName(userEntity.getRealName()); + userDTO.setNickname(userEntity.getNickname()); + } + userDTO.setId(fromDto.getUserId()); + update(userDTO); + return new Result(); + } } diff --git a/renren-cloud-generator/src/main/resources/generator.properties b/renren-cloud-generator/src/main/resources/generator.properties index 7cdad8a6b..2a9a27305 100644 --- a/renren-cloud-generator/src/main/resources/generator.properties +++ b/renren-cloud-generator/src/main/resources/generator.properties @@ -3,13 +3,13 @@ main= #\u5305\u540D package=com.elink.esua.epdc -moduleName=news +moduleName= #\u4F5C\u8005 -author=qu +author=elink #\u7248\u672C\u53F7 version=v1.0.0 #Email -email=qu@elink-cn.com +email=elink@elink-cn.com #\u8868\u524D\u7F00(\u7C7B\u540D\u4E0D\u4F1A\u5305\u542B\u8868\u524D\u7F00) tablePrefix=epdc_