diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java index de7a5042..eec5c228 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java @@ -14,6 +14,7 @@ public interface NumConstant { int TWO = 2; int THREE = 3; int FOUR = 4; + int FIVE = 5; int SIX = 6; int ONE_NEG = -1; diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/ImgConfigDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/ImgConfigDTO.java new file mode 100644 index 00000000..9f41c5a7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/ImgConfigDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 图片配置表 + * + * @author zhangyong + * @since v1.0.0 2020-05-27 + */ +@Data +public class ImgConfigDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 类型(0-志愿者咨询热线) + */ + private String imgType; + + /** + * 图片地址 + */ + private String imgUrl; + + /** + * 排序 + */ + private Integer sort; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识 0:未删除 1:删除 + */ + private String delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/v2/EpdcCompleteUserInfoFormV2DTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/v2/EpdcCompleteUserInfoFormV2DTO.java index 30262ad2..149c47af 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/v2/EpdcCompleteUserInfoFormV2DTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/v2/EpdcCompleteUserInfoFormV2DTO.java @@ -3,6 +3,7 @@ package com.elink.esua.epdc.dto.form.v2; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; import java.io.Serializable; /** @@ -78,4 +79,24 @@ public class EpdcCompleteUserInfoFormV2DTO implements Serializable { * 认证类型 参考 UserAuthTypeEnum */ private String userAuthType; + + /** + * 志愿者昵称 + */ + private String volunteerNickname; + + /** + * 志愿者头像 + */ + private String volunteerFaceImg; + + /** + * 志愿者签名 + */ + private String volunteerSignature; + + /** + * 自我介绍 + */ + private String introduce; } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcCompleteUserInfoDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcCompleteUserInfoDTO.java index 7fe641f4..a2ba7ae8 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcCompleteUserInfoDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcCompleteUserInfoDTO.java @@ -72,4 +72,25 @@ public class EpdcCompleteUserInfoDTO implements Serializable { * 居住网格名称 */ private String gridName; + + + /** + * 志愿者昵称 + */ + private String volunteerNickname; + + /** + * 志愿者头像 + */ + private String volunteerFaceImg; + + /** + * 志愿者签名 + */ + private String volunteerSignature; + + /** + * 自我介绍 + */ + private String introduce; } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcImgConfigResultDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcImgConfigResultDTO.java new file mode 100644 index 00000000..428c438f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcImgConfigResultDTO.java @@ -0,0 +1,22 @@ +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * APP 获取咨询热线图片 返回参数 + * + * @author zhangyong + * @date 2020/05/27 18:30 + */ +@Data +public class EpdcImgConfigResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 图片地址 + */ + private String imgUrl; +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActBannerController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActBannerController.java new file mode 100644 index 00000000..b639fe2d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActBannerController.java @@ -0,0 +1,41 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; +import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.service.ActBannerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * APP 活动Banner相关接口 + * + * @author zhangyong + * @date 2020/05/25 18:30 + */ +@RestController +@RequestMapping("heart/actbanner") +public class ApiActBannerController { + + @Autowired + private ActBannerService actBannerService; + + /** + * 获取上架的banner列表 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 18:27 2020-05-25 + **/ + @GetMapping("banner/list") + public Result> bannerList(EpdcAppActBannerFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return actBannerService.getBannerList(formDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java index 6843aeb5..4ea45e3d 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java @@ -6,6 +6,7 @@ import com.elink.esua.epdc.commons.tools.enums.BehaviorEnum; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.dto.epdc.form.*; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserGridResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; import com.elink.esua.epdc.dto.epdc.result.UserInvitationRecordResultDTO; @@ -328,4 +329,18 @@ public class ApiAppUserController { ValidatorUtils.validateEntity(formDto); return appUserService.getUserWxPhone(formDto); } + + /* + * 志愿者列表 + * @param tokenDto + * @param dto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 15:33 2020-05-18 + **/ + @GetMapping("volunteer/list") + public Result> volunteerList(@LoginUser TokenDto tokenDto, EpdcAppVolunteerListFormDTO dto) { + ValidatorUtils.validateEntity(dto); + return appUserService.listVolunteer(tokenDto, dto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiImgConfigController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiImgConfigController.java new file mode 100644 index 00000000..866b0714 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiImgConfigController.java @@ -0,0 +1,38 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.result.EpdcImgConfigResultDTO; +import com.elink.esua.epdc.service.ImgConfigService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * APP 获取咨询热线图片 + * + * @author zhangyong + * @date 2020/05/27 18:30 + */ +@RestController +@RequestMapping("imgConfig") +public class ApiImgConfigController { + + @Autowired + private ImgConfigService imgConfigService; + + /** + * 根据 志愿者模块图片类型 查询图片列表 + * @param imgType 志愿者模块图片类型 + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 17:04 2020-05-27 + **/ + @GetMapping("getImgUrl/{imgType}") + public Result> getImgUrlList(@PathVariable("imgType") String imgType){ + return imgConfigService.listImgUrl(imgType); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ImgConfigController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ImgConfigController.java new file mode 100644 index 00000000..b9ff6f45 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ImgConfigController.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.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.ImgConfigDTO; +import com.elink.esua.epdc.dto.SysSimpleDictDTO; +import com.elink.esua.epdc.excel.ImgConfigExcel; +import com.elink.esua.epdc.service.ImgConfigService; +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 zhangyong + * @since v1.0.0 2020-05-27 + */ +@RestController +@RequestMapping("imgconfig") +public class ImgConfigController { + + @Autowired + private ImgConfigService imgConfigService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = imgConfigService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ImgConfigDTO data = imgConfigService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ImgConfigDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + imgConfigService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ImgConfigDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + imgConfigService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + imgConfigService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = imgConfigService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ImgConfigExcel.class); + } + + /** + * 根据数据字典类型获取简版数据字典列表,用于页面下拉菜单 + * + * @param dictType + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 15:27 2020-05-27 + **/ + @GetMapping("heartImgType/{dictType}") + public Result> listSimpleDictInfo(@PathVariable("dictType") String dictType){ + return imgConfigService.getListSimpleDictInfo(dictType); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/v2/ApiAppUserV2Controller.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/v2/ApiAppUserV2Controller.java index e5a2ed91..9145382a 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/v2/ApiAppUserV2Controller.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/v2/ApiAppUserV2Controller.java @@ -7,6 +7,7 @@ import com.elink.esua.epdc.commons.tools.constant.Constant; import com.elink.esua.epdc.commons.tools.enums.BehaviorEnum; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; import com.elink.esua.epdc.dto.form.EpdcAppUserRegisterFormDTO; import com.elink.esua.epdc.dto.form.v2.EpdcCompleteUserInfoFormV2DTO; import com.elink.esua.epdc.dto.result.EpdcAppAuthorizationDTO; @@ -89,4 +90,20 @@ public class ApiAppUserV2Controller { ValidatorUtils.validateEntity(formDto); return appUserService.completeUserInfo(tokenDto, formDto); } + + /** + * 志愿者认证 V2接口 + * + * @param tokenDto + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:49 2020-05-26 + **/ + @PostMapping("volunteer/" + Constant.VERSION_CONTROL + "/authenticate") + public Result volunteerAuthenticate(@LoginUser TokenDto tokenDto, @RequestBody EpdcCompleteVolunteerInfoV2FormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return appUserService.volunteerV2Authenticate(tokenDto, formDto); + + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/dao/ImgConfigDao.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/dao/ImgConfigDao.java new file mode 100644 index 00000000..d12a9a0f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/dao/ImgConfigDao.java @@ -0,0 +1,56 @@ +/** + * 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.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.ImgConfigDTO; +import com.elink.esua.epdc.dto.result.EpdcImgConfigResultDTO; +import com.elink.esua.epdc.entity.ImgConfigEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + + +/** + * 图片配置表 + * + * @author zhangyong + * @since v1.0.0 2020-05-27 + */ +@Mapper +public interface ImgConfigDao extends BaseDao { + + /** + * 图片配置 首页查询 + * @param params + * @return java.util.List + * @Author zhangyong + * @Date 17:25 2020-05-27 + **/ + List selectListImgConfig(Map params); + + /** + * 根据 志愿者模块图片类型 查询图片列表 + * @param imgType 志愿者模块图片类型 + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 17:04 2020-05-27 + **/ + List selectListImgConfigByImgType(String imgType); +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/entity/ImgConfigEntity.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/entity/ImgConfigEntity.java new file mode 100644 index 00000000..17012679 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/entity/ImgConfigEntity.java @@ -0,0 +1,56 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 图片配置表 + * + * @author zhangyong + * @since v1.0.0 2020-05-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_img_config") +public class ImgConfigEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 类型(0-志愿者咨询热线) + */ + private String imgType; + + /** + * 图片地址 + */ + private String imgUrl; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/excel/ImgConfigExcel.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/excel/ImgConfigExcel.java new file mode 100644 index 00000000..d797c58f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/excel/ImgConfigExcel.java @@ -0,0 +1,65 @@ +/** + * 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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 图片配置表 + * + * @author zhangyong + * @since v1.0.0 2020-05-27 + */ +@Data +public class ImgConfigExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "类型(0-志愿者咨询热线)") + private String imgType; + + @Excel(name = "图片地址") + private String imgUrl; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "删除标识 0:未删除 1:删除") + private String delFlag; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActBannerFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActBannerFeignClient.java new file mode 100644 index 00000000..8775e71f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActBannerFeignClient.java @@ -0,0 +1,32 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; +import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.fallback.ActBannerFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; + +import java.util.List; + +/** + * Banner-移动app端 + * @Author zhangyong + * @Date 18:27 2020-05-25 + */ +@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = ActBannerFeignClientFallback.class) +public interface ActBannerFeignClient { + + /** + * 获取上架的banner列表 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 18:27 2020-05-25 + **/ + @GetMapping(value = "heart/epdc-app/actbanner/banner/list", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> selectBannerList(EpdcAppActBannerFormDTO formDto); +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java index 9b41b246..93a7813b 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java @@ -2,10 +2,7 @@ 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.CompleteDeptDTO; -import com.elink.esua.epdc.dto.DeptOption; -import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; -import com.elink.esua.epdc.dto.SysUserDTO; +import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.epdc.GridLeaderRegisterDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAppIndexPanelResultDTO; import com.elink.esua.epdc.feign.fallback.AdminFeignClientFallback; @@ -90,4 +87,15 @@ public interface AdminFeignClient { **/ @GetMapping("sys/dept/party/getDeptTreeForEpiDemic") Result getDeptTreeForEpiDemic(); + + /** + * 根据数据字典类型获取简版数据字典列表,用于页面下拉菜单 + * + * @param dictType + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 15:27 2020-05-27 + **/ + @GetMapping("sys/dict/listSimple/{dictType}") + Result> getListSimpleDictInfo(@PathVariable("dictType") String dictType); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java index 0b49de4d..b7425375 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java @@ -2,11 +2,9 @@ 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.CachingUserInfoDTO; -import com.elink.esua.epdc.dto.UserDTO; -import com.elink.esua.epdc.dto.UserGridRelationDTO; -import com.elink.esua.epdc.dto.UserWxFormIdDTO; +import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.epdc.form.*; +import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; import com.elink.esua.epdc.dto.epdc.result.*; import com.elink.esua.epdc.dto.epdc.result.EpdcWorkUserResultDTO; import com.elink.esua.epdc.feign.fallback.UserFeignClientFallback; @@ -367,4 +365,37 @@ public interface UserFeignClient { */ @PostMapping(value = "app-user/epdc-app/user/needCachingUserInfo", consumes = MediaType.APPLICATION_JSON_VALUE) Result needCachingUserInfo(EpdcAppQueryUserInfoFormDTO formDTO); + + /* + * 志愿者列表 + * @param dto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 15:33 2020-05-18 + **/ + @GetMapping("app-user/epdc-app/volunteerinfo/list") + Result> listVolunteer(EpdcAppVolunteerListFormDTO dto); + + /** + * 志愿者添加 V2接口 + * + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:49 2020-05-26 + **/ + @PostMapping(value = "app-user/epdc-app/volunteerinfo/v2/insertVolunteerInfo", consumes = MediaType.APPLICATION_JSON_VALUE) + Result insertV2VolunteerInfo(EpdcCompleteVolunteerInfoV2FormDTO formDTO); + + + /** + * 根据用户id,获取志愿者详情 + * + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:49 2020-05-26 + **/ + @GetMapping(value = "app-user/volunteerinfo/getVolunteerInfoDTOByUserId/{userId}") + Result selectUserVolunteerInfo(@PathVariable("userId") String userId); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActBannerFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActBannerFeignClientFallback.java new file mode 100644 index 00000000..e834e5e9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActBannerFeignClientFallback.java @@ -0,0 +1,25 @@ +package com.elink.esua.epdc.feign.fallback; + +import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; +import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; +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.feign.ActBannerFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * Banner-移动app端 + * @Author zhangyong + * @Date 18:27 2020-05-25 + */ +@Component +public class ActBannerFeignClientFallback implements ActBannerFeignClient { + + @Override + public Result> selectBannerList(EpdcAppActBannerFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "selectBannerList", formDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java index e7f13a42..d3f757a0 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java @@ -3,10 +3,7 @@ package com.elink.esua.epdc.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.CompleteDeptDTO; -import com.elink.esua.epdc.dto.DeptOption; -import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; -import com.elink.esua.epdc.dto.SysUserDTO; +import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.epdc.GridLeaderRegisterDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAppIndexPanelResultDTO; import com.elink.esua.epdc.feign.AdminFeignClient; @@ -51,4 +48,9 @@ public class AdminFeignClientFallback implements AdminFeignClient { public Result getDeptTreeForEpiDemic() { return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getDeptTreeForEpiDemic"); } + + @Override + public Result> getListSimpleDictInfo(String dictType) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getListSimpleDictInfo", dictType); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java index cd942c73..2d63a9fc 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java @@ -3,11 +3,9 @@ package com.elink.esua.epdc.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.CachingUserInfoDTO; -import com.elink.esua.epdc.dto.UserDTO; -import com.elink.esua.epdc.dto.UserGridRelationDTO; -import com.elink.esua.epdc.dto.UserWxFormIdDTO; +import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.epdc.form.*; +import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; import com.elink.esua.epdc.dto.epdc.result.*; import com.elink.esua.epdc.feign.UserFeignClient; import org.springframework.stereotype.Component; @@ -180,4 +178,19 @@ public class UserFeignClientFallback implements UserFeignClient { public Result needCachingUserInfo(EpdcAppQueryUserInfoFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "needCachingUserInfo", formDTO); } + + @Override + public Result> listVolunteer(EpdcAppVolunteerListFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "listVolunteer", dto); + } + + @Override + public Result insertV2VolunteerInfo(EpdcCompleteVolunteerInfoV2FormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "insertV2VolunteerInfo", dto); + } + + @Override + public Result selectUserVolunteerInfo(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "selectUserVolunteerInfo", "userId"); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/redis/ImgConfigRedis.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/redis/ImgConfigRedis.java new file mode 100644 index 00000000..edd6478c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/redis/ImgConfigRedis.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.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 图片配置表 + * + * @author zhangyong + * @since v1.0.0 2020-05-27 + */ +@Component +public class ImgConfigRedis { + @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-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActBannerService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActBannerService.java new file mode 100644 index 00000000..d0a4d258 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActBannerService.java @@ -0,0 +1,26 @@ +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; +import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; +import com.elink.esua.epdc.commons.tools.utils.Result; + +import java.util.List; + +/** + * APP 活动Banner相关接口 + * + * @author zhangyong + * @date 2020/05/25 18:30 + */ +public interface ActBannerService { + + /** + * 获取上架的banner列表 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 18:27 2020-05-25 + **/ + Result> getBannerList(EpdcAppActBannerFormDTO formDto); +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java index ef9ce9f4..675ebb90 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java @@ -3,6 +3,8 @@ package com.elink.esua.epdc.service; import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.epdc.form.*; +import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserGridResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; import com.elink.esua.epdc.dto.epdc.result.UserInvitationRecordResultDTO; @@ -258,4 +260,25 @@ public interface AppUserService { * @date 2020/2/20 17:24 */ Result getUserWxPhone(EpdcAppUserMaInfoFormDTO formDto); + + /* + * 志愿者列表 + * @param tokenDto + * @param dto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 15:33 2020-05-18 + **/ + Result> listVolunteer(TokenDto tokenDto, EpdcAppVolunteerListFormDTO dto); + + /** + * 志愿者认证 V2接口 + * + * @param tokenDto + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:49 2020-05-26 + **/ + Result volunteerV2Authenticate(TokenDto tokenDto, EpdcCompleteVolunteerInfoV2FormDTO formDto); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ImgConfigService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ImgConfigService.java new file mode 100644 index 00000000..d5eea760 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ImgConfigService.java @@ -0,0 +1,117 @@ +/** + * 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.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.ImgConfigDTO; +import com.elink.esua.epdc.dto.SysSimpleDictDTO; +import com.elink.esua.epdc.dto.result.EpdcImgConfigResultDTO; +import com.elink.esua.epdc.entity.ImgConfigEntity; + +import java.util.List; +import java.util.Map; + +/** + * 图片配置表 + * + * @author zhangyong + * @since v1.0.0 2020-05-27 + */ +public interface ImgConfigService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-05-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-05-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ImgConfigDTO + * @author generator + * @date 2020-05-27 + */ + ImgConfigDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-05-27 + */ + void save(ImgConfigDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-05-27 + */ + void update(ImgConfigDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-05-27 + */ + void delete(String[] ids); + + /** + * 根据数据字典类型获取简版数据字典列表,用于页面下拉菜单 + * + * @param dictType + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 15:27 2020-05-27 + **/ + Result> getListSimpleDictInfo(String dictType); + + /** + * 根据 志愿者模块图片类型 查询图片列表 + * @param imgType 志愿者模块图片类型 + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 17:04 2020-05-27 + **/ + Result> listImgUrl(String imgType); +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActBannerServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActBannerServiceImpl.java new file mode 100644 index 00000000..9808ee05 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActBannerServiceImpl.java @@ -0,0 +1,23 @@ +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; +import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.ActBannerFeignClient; +import com.elink.esua.epdc.service.ActBannerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ActBannerServiceImpl implements ActBannerService { + + @Autowired + private ActBannerFeignClient actBannerFeignClient; + + @Override + public Result> getBannerList(EpdcAppActBannerFormDTO formDto) { + return actBannerFeignClient.selectBannerList(formDto); + } +} 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 0be66d94..71e1b936 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 @@ -16,6 +16,9 @@ import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import com.elink.esua.epdc.commons.tools.redis.UserDetailRedis; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; import com.elink.esua.epdc.commons.tools.utils.*; import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.enums.GroupUserStateEnum; @@ -24,10 +27,8 @@ import com.elink.esua.epdc.dto.epdc.EpdcGridLeaderRegisterDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcGridLeaderRegisterFormDTO; import com.elink.esua.epdc.dto.epdc.GridLeaderRegisterDTO; import com.elink.esua.epdc.dto.epdc.form.*; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserGridResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterInfoResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; -import com.elink.esua.epdc.dto.epdc.result.UserInvitationRecordResultDTO; +import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; +import com.elink.esua.epdc.dto.epdc.result.*; import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.form.v2.EpdcCompleteUserInfoFormV2DTO; import com.elink.esua.epdc.dto.group.form.GroupUserFormDTO; @@ -879,6 +880,18 @@ public class AppUserServiceImpl implements AppUserService { Result result = userFeignClient.getUserInfoById(tokenDto.getUserId()); if (result.success() && null != result.getData()) { EpdcCompleteUserInfoDTO dto = ConvertUtils.sourceToTarget(result.getData(), EpdcCompleteUserInfoDTO.class); + // 获取志愿者表中的新增字段 + Result volunteerInfoDTO = userFeignClient.selectUserVolunteerInfo(tokenDto.getUserId()); + if (volunteerInfoDTO.success() && null != volunteerInfoDTO.getData()){ + dto.setVolunteerFaceImg(volunteerInfoDTO.getData().getVolunteerFaceImg()); + dto.setVolunteerNickname(volunteerInfoDTO.getData().getVolunteerNickname()); + dto.setVolunteerSignature(volunteerInfoDTO.getData().getVolunteerSignature()); + dto.setIntroduce(volunteerInfoDTO.getData().getIntroduce()); + // 如果用户表的身份证号为空,则尝试使用志愿者表中的身份证 + if (null == dto.getIdentityNo() || "".equals(dto.getIdentityNo())) { + dto.setIdentityNo(volunteerInfoDTO.getData().getIdentityNo()); + } + } if (("0").equals(result.getData().getState())) { dto.setGridId(tokenDto.getGridId()); //未完善信息获取用户当前所在的网格的后两级机构(社区-网格),返回给前端 @@ -1415,4 +1428,60 @@ public class AppUserServiceImpl implements AppUserService { } return new Result().ok(authorizationDto); } + + @Override + public Result> listVolunteer(TokenDto tokenDto, EpdcAppVolunteerListFormDTO dto) { + dto.setGridId(tokenDto.getGridId()); + return userFeignClient.listVolunteer(dto); + } + + @Override + public Result volunteerV2Authenticate(TokenDto tokenDto, EpdcCompleteVolunteerInfoV2FormDTO formDto) { + logger.info("志愿者认证wxCode=" + formDto.getWxCode() + ";userId=" + tokenDto.getUserId()); + + if (StringUtils.isNotBlank(formDto.getSmsCode())) { + this.checkSmsCode(formDto.getMobile(), formDto.getSmsCode()); + } + // 此次完善信息后是否变为党员 + boolean newPartyFlag = Boolean.FALSE; + + UserDTO user = getUserInfoById(tokenDto.getUserId()); + + // 处理和验证身份证号码 + String identityNo = fixAndCheckIdentityNo(formDto.getIdentityNo()); + + // 调用用户完善个人信息接口 + EpdcCompleteUserInfoFormV2DTO epdcCompleteUserInfoFormDTO = ConvertUtils.sourceToTarget(formDto, EpdcCompleteUserInfoFormV2DTO.class); + // set 党员标识,将志愿者完善信息视为党员完善信息,方便身份证号码唯一校验等操作 + epdcCompleteUserInfoFormDTO.setPartyFlag(YesOrNoEnum.YES.value()); + epdcCompleteUserInfoFormDTO.setUserAuthType(UserAuthTypeEnum.VOLUNTEER_AUTH.value()); + Result result = completeUserInfoCore(tokenDto, epdcCompleteUserInfoFormDTO); + + UserDTO completeUser = result.getData(); + user.setGrid(completeUser.getGrid()); + user.setState(completeUser.getState()); + if (YesOrNoEnum.YES.value().equals(completeUser.getPartyFlag())) { + newPartyFlag = Boolean.TRUE; + } + + formDto.setSex(IdentityNoUtils.getSex(identityNo)); + formDto.setBirthday(DateUtils.parse(IdentityNoUtils.getBirthday(identityNo), DateUtils.DATE_PATTERN)); + formDto.setUserId(tokenDto.getUserId()); + formDto.setGridId(tokenDto.getGridId()); + // 新增 or 修改 志愿者信息 + Result insertCountResult = userFeignClient.insertV2VolunteerInfo(formDto); + if (!insertCountResult.success()) { + return insertCountResult; + } + // 更新用户缓存信息 + Result cachingUserResult = userFeignClient.needCachingUserInfoByUserId(tokenDto.getUserId()); + CachingUserInfoDTO cachingUserInfoDTO = cachingUserResult.getData(); + + EpdcAppAuthorizationDTO authorizationDto = cachingUserInfoForAuthorization(cachingUserInfoDTO, user.getGrid(), user.getState()); + if ( newPartyFlag) { + initPartyGroupInfo(cachingUserInfoDTO); + } + + return new Result().ok(authorizationDto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ImgConfigServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ImgConfigServiceImpl.java new file mode 100644 index 00000000..13d0f3f5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ImgConfigServiceImpl.java @@ -0,0 +1,120 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.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.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.dao.ImgConfigDao; +import com.elink.esua.epdc.dto.ImgConfigDTO; +import com.elink.esua.epdc.dto.SysSimpleDictDTO; +import com.elink.esua.epdc.dto.result.EpdcImgConfigResultDTO; +import com.elink.esua.epdc.entity.ImgConfigEntity; +import com.elink.esua.epdc.feign.AdminFeignClient; +import com.elink.esua.epdc.redis.ImgConfigRedis; +import com.elink.esua.epdc.service.ImgConfigService; +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 zhangyong + * @since v1.0.0 2020-05-27 + */ +@Service +public class ImgConfigServiceImpl extends BaseServiceImpl implements ImgConfigService { + + @Autowired + private ImgConfigRedis imgConfigRedis; + + @Autowired + private AdminFeignClient adminFeignClient; + + @Override + public PageData page(Map params) { + IPage page = getPage(params); + List list = baseDao.selectListImgConfig(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ImgConfigDTO.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 ImgConfigDTO get(String id) { + ImgConfigEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ImgConfigDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ImgConfigDTO dto) { + ImgConfigEntity entity = ConvertUtils.sourceToTarget(dto, ImgConfigEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ImgConfigDTO dto) { + ImgConfigEntity entity = ConvertUtils.sourceToTarget(dto, ImgConfigEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result> getListSimpleDictInfo(String dictType) { + return adminFeignClient.getListSimpleDictInfo(dictType); + } + + @Override + public Result> listImgUrl(String imgType) { + List list = baseDao.selectListImgConfigByImgType(imgType); + return new Result>().ok(list); + } + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/mapper/ImgConfigDao.xml b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/mapper/ImgConfigDao.xml new file mode 100644 index 00000000..4fae1725 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/mapper/ImgConfigDao.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java index fcf5644e..1bfff225 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java @@ -98,5 +98,8 @@ public class ActBannerDTO implements Serializable { */ private Date createdTime; - -} \ No newline at end of file + /** + * banner排序 + */ + private String sort; +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/EpdcAppActBannerFormDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/EpdcAppActBannerFormDTO.java new file mode 100644 index 00000000..2a3146bd --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/EpdcAppActBannerFormDTO.java @@ -0,0 +1,30 @@ +package com.elink.esua.epdc.activity.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * banner 列表入参 + * + * @author zhangyong + * @since v1.0.0 2020-05-25 + */ +@Data +public class EpdcAppActBannerFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 页码 + */ + @Min(value = 1, message = "页码必须大于0") + private Integer pageIndex; + + /** + * 页容量 + */ + @Min(value = 1, message = "页容量必须大于0") + private Integer pageSize; +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/EpdcAppActBannerResultDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/EpdcAppActBannerResultDTO.java new file mode 100644 index 00000000..ca958060 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/EpdcAppActBannerResultDTO.java @@ -0,0 +1,27 @@ +package com.elink.esua.epdc.activity.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * banner 列表返回列表 + * + * @author zhangyong + * @since v1.0.0 2020-05-25 + */ +@Data +public class EpdcAppActBannerResultDTO implements Serializable { + + private static final long serialVersionUID = 3908231797102233188L; + + /** + * banner标题 + */ + private String title; + + /** + * banner图片 + */ + private String bannerImg; +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActBannerController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActBannerController.java index a0a9a2ad..40d0d321 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActBannerController.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActBannerController.java @@ -46,7 +46,7 @@ import java.util.Map; @RestController @RequestMapping("actbanner") public class ActBannerController { - + @Autowired private ActBannerService actBannerService; @@ -78,8 +78,7 @@ public class ActBannerController { public Result save(@RequestBody ActBannerDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - actBannerService.save(dto); - return new Result(); + return actBannerService.save(dto); } @PutMapping @@ -104,4 +103,4 @@ public class ActBannerController { ExcelUtils.exportExcelToTarget(response, null, list, ActBannerExcel.class); } -} \ No newline at end of file +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/EpdcActBannerController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/EpdcActBannerController.java new file mode 100644 index 00000000..cbb560ce --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/EpdcActBannerController.java @@ -0,0 +1,52 @@ +/** + * 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.activity.controller; + +import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; +import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.modules.activity.service.ActBannerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +@RestController +@RequestMapping(Constant.EPDC_APP + "actbanner") +public class EpdcActBannerController { + + @Autowired + private ActBannerService actBannerService; + + /** + * 获取上架的banner列表 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 18:27 2020-05-25 + **/ + @GetMapping("banner/list") + public Result> bannerList(@RequestBody EpdcAppActBannerFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return actBannerService.getBannerList(formDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java index 19006032..408fae91 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java @@ -18,6 +18,8 @@ package com.elink.esua.epdc.modules.activity.dao; import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; +import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity; import org.apache.ibatis.annotations.Mapper; @@ -67,12 +69,32 @@ public interface ActBannerDao extends BaseDao { */ void updateBannerByActId(String actId); - /** - * @Description: 手机端banner查询,根据创建时间 正序排列 - * @Param: [params] - * @return: java.util.List - * @Author: zy - * @Date: 2020-02-08 - */ + /** + * @Description: 手机端banner查询,根据创建时间 正序排列 + * @Param: [params] + * @return: java.util.List + * @Author: zy + * @Date: 2020-02-08 + */ List getAppActBannerlist(Map params); -} \ No newline at end of file + + /** + * 获取已经上架的banner数量 + * + * @param + * @return int + * @Author zhangyong + * @Date 16:47 2020-05-25 + **/ + int getBannerStatusNumber(); + + /** + * 获取上架的banner列表 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 18:27 2020-05-25 + **/ + List selectListBannerList(EpdcAppActBannerFormDTO formDto); +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActBannerEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActBannerEntity.java index ac696aad..7e895f91 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActBannerEntity.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActBannerEntity.java @@ -87,4 +87,8 @@ public class ActBannerEntity extends BaseEpdcEntity { */ private Long deptId; -} \ No newline at end of file + /** + * banner排序 + */ + private String sort; +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java index 40b4d88c..b9180038 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java @@ -18,6 +18,8 @@ package com.elink.esua.epdc.modules.activity.service; import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; +import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; 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; @@ -77,7 +79,7 @@ public interface ActBannerService extends BaseService { * @author generator * @date 2019-12-19 */ - void save(ActBannerDTO dto); + Result save(ActBannerDTO dto); /** * 默认更新 @@ -130,4 +132,14 @@ public interface ActBannerService extends BaseService { * @since 2020/2/6 21:22 */ void takeOffBannerByActId(String actId); -} \ No newline at end of file + + /** + * 获取上架的banner列表 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 18:27 2020-05-25 + **/ + Result> getBannerList(EpdcAppActBannerFormDTO formDto); +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java index 4a16fe7b..6476371d 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java @@ -20,8 +20,11 @@ package com.elink.esua.epdc.modules.activity.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.elink.esua.epdc.activity.ActBannerDTO; +import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; +import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; 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.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.Result; @@ -101,10 +104,13 @@ public class ActBannerServiceImpl extends BaseServiceImpl baseDao.getBannerStatusNumber()) { + updateEntity.setStatus(ActStateConstant.ACT_BANNER_STATUS_GROUNDING); + updateById(updateEntity); + } else { + return new Result().error("Banner上架数量不能超过5条"); + } // 下架 } else if (ActStateConstant.ACT_BANNER_STATUS_GROUNDING.equals(entity.getStatus())) { updateEntity.setStatus(ActStateConstant.ACT_BANNER_STATUS_UNDERCARRIAGE); @@ -115,9 +121,15 @@ public class ActBannerServiceImpl extends BaseServiceImpl baseDao.getBannerStatusNumber()) { + insert(entity); + } else { + return new Result().error("Banner上架数量不能超过5条"); + } + return new Result(); } @Override @@ -152,4 +164,12 @@ public class ActBannerServiceImpl extends BaseServiceImpl> getBannerList(EpdcAppActBannerFormDTO formDto) { + int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageIndex(pageIndex); + List data = baseDao.selectListBannerList(formDto); + return new Result().ok(data); + } + } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java index db2a4ded..cf255f09 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java @@ -128,10 +128,6 @@ public class ActInfoServiceImpl extends BaseServiceImpl + - \ 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/VolunteerInfoDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerInfoDTO.java index b66da6c4..c96e068e 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerInfoDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/VolunteerInfoDTO.java @@ -196,4 +196,19 @@ public class VolunteerInfoDTO implements Serializable { * 志愿者注册时间 */ private String registTimeString; -} \ No newline at end of file + + /** + * 志愿者昵称 + */ + private String volunteerNickname; + + /** + * 志愿者头像 + */ + private String volunteerFaceImg; + + /** + * 志愿者签名 + */ + private String volunteerSignature; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcAppVolunteerListFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcAppVolunteerListFormDTO.java new file mode 100644 index 00000000..5b76ff64 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcAppVolunteerListFormDTO.java @@ -0,0 +1,33 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.util.List; + +/** + * 志愿者列表 + * + * @author zhangyong + * @since v1.0.0 2020-05-18 + */ +@Data +public class EpdcAppVolunteerListFormDTO { + + /** + * 页码 + */ + @Min(value = 1, message = "页码必须大于0") + private Integer pageIndex; + + /** + * 页容量 + */ + @Min(value = 1, message = "页容量必须大于0") + private Integer pageSize; + + /** + * 数据权限 + */ + private Long gridId; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/v2/EpdcCompleteVolunteerInfoV2FormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/v2/EpdcCompleteVolunteerInfoV2FormDTO.java new file mode 100644 index 00000000..804bbbf4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/v2/EpdcCompleteVolunteerInfoV2FormDTO.java @@ -0,0 +1,123 @@ +package com.elink.esua.epdc.dto.epdc.form.v2; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.util.Date; + +/** + * 移动端完善用户信息 v2接口 + * + * @author zhangyong + * @date 2020/05/26 10:56 + */ +@Data +public class EpdcCompleteVolunteerInfoV2FormDTO implements Serializable { + + private static final long serialVersionUID = 8364421744640317634L; + + /** + * 用户Id + */ + private String userId; + + /** + * 真实姓名 + */ + @NotBlank(message = "真实姓名不能为空") + private String realName; + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空") + private String mobile; + + /** + * 短信验证码 + * 移动端决定是否上送验证码。 + */ + private String smsCode; + + /** + * 身份证号码 + */ + @NotBlank(message = "身份证号码不能为空") + private String identityNo; + + /** + * 所在道路 + */ + @NotBlank(message = "所在道路不能为空") + private String road; + + /** + * 小区名 + */ + private String villageName; + + /** + * 住处(楼栋-单元-房间) + */ + private String dwellingPlace; + + /** + * 居住网格id + */ + private Long gridId; + + /** + * 微信code + */ + private String wxCode; + + /** + * 用户信息 + */ + private String encryptedData; + + /** + * 加密算法的初始向量 + */ + private String iv; + + /** + * 自我介绍 + */ + private String introduce; + + /*----------------------志愿者新增所需字段---------------------------*/ + + /** + * 出生日期 + */ + private Date birthday; + + /*----------------------用户认证所需字段-----------------------------*/ + + /** + * 0女,1男 + */ + private String sex; + + /** + * 志愿者昵称 + */ + @Size(min = 1, max = 10, message = "志愿者昵称不能为空,不能超过10字") + private String volunteerNickname; + + /** + * 志愿者头像 + */ + @NotBlank(message = "志愿者头像不能为空") + private String volunteerFaceImg; + + /** + * 志愿者签名 + */ + @Size(min = 1, max = 30, message = "志愿者签名,不能超过30字") + private String volunteerSignature; +} + diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcAppVolunteerListResultDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcAppVolunteerListResultDTO.java new file mode 100644 index 00000000..08f4fe0f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcAppVolunteerListResultDTO.java @@ -0,0 +1,36 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 移动端接口-志愿者列表接口返回值 + * @Author zhangyong + * @Date 2020-05-18 + */ +@Data +public class EpdcAppVolunteerListResultDTO implements Serializable { + + private static final long serialVersionUID = 3908231797102233188L; + + /** + * 志愿者ID + */ + private String id; + + /** + * 用户昵称 + */ + private String nickname; + + /** + * 头像 + */ + private String faceImg; + + /** + * 志愿者签名 + */ + private String volunteerSignature; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java index 99306f05..f35f6536 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java @@ -5,7 +5,10 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; 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.epdc.form.EpdcAppVolunteerListFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcCompleteVolunteerInfoFormDTO; +import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; import com.elink.esua.epdc.service.VolunteerInfoService; import org.springframework.beans.factory.annotation.Autowired; @@ -60,6 +63,32 @@ public class EpdcAppVolunteerInfoController { return volunteerInfoService.getRankingList(); } + /** + * 志愿者列表 + * @param dto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 15:08 2020-05-18 + **/ + @GetMapping("list") + public Result> volunteerList(@RequestBody EpdcAppVolunteerListFormDTO dto) { + return volunteerInfoService.listVolunteer(dto); + } + /** + * 志愿者添加 V2接口 + * + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:49 2020-05-26 + **/ + @PostMapping("v2/insertVolunteerInfo") + public Result insertV2VolunteerInfo(@RequestBody EpdcCompleteVolunteerInfoV2FormDTO formDTO) { + //效验数据 + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); + Result result = volunteerInfoService.insertV2VolunteerInfo(formDTO); + return result; + } } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java index ad70599b..b537fc28 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java @@ -20,8 +20,11 @@ package com.elink.esua.epdc.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.dto.UserTagDTO; import com.elink.esua.epdc.dto.VolunteerInfoDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcAppVolunteerListFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeFormDTO; +import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; import com.elink.esua.epdc.entity.VolunteerInfoEntity; import org.apache.ibatis.annotations.Mapper; @@ -128,4 +131,22 @@ public interface VolunteerInfoDao extends BaseDao { * @since 2020/2/7 18:34 */ void updateVolunteerKindnessTime(EpdcVolunteerKindnessTimeFormDTO formDto); + + /** + * 志愿者列表 + * @param dto + * @return java.util.List + * @Author zhangyong + * @Date 15:08 2020-05-18 + **/ + List selectListVolunteer(EpdcAppVolunteerListFormDTO dto); + + /** + * 志愿者认证,修改 + * @param formDTO + * @return void + * @Author zhangyong + * @Date 19:52 2020-05-27 + **/ + void updateVolunteerAauthentication(EpdcCompleteVolunteerInfoV2FormDTO formDTO); } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerInfoEntity.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerInfoEntity.java index 6d331802..c8a84e04 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerInfoEntity.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/VolunteerInfoEntity.java @@ -134,4 +134,18 @@ public class VolunteerInfoEntity extends DeptScope { */ private Long auditor; -} \ No newline at end of file + /** + * 志愿者昵称 + */ + private String volunteerNickname; + + /** + * 志愿者头像 + */ + private String volunteerFaceImg; + + /** + * 志愿者签名 + */ + private String volunteerSignature; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java index 4f02ec83..cb39bb71 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java @@ -22,9 +22,12 @@ import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.UserTagDTO; import com.elink.esua.epdc.dto.VolunteerInfoDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcAppVolunteerListFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcCompleteVolunteerInfoFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeFormDTO; +import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; import com.elink.esua.epdc.entity.VolunteerInfoEntity; @@ -204,4 +207,24 @@ public interface VolunteerInfoService extends BaseService { * @since 2020/2/7 18:37 */ Result modifyVolunteerKindnessTime(EpdcVolunteerKindnessTimeFormDTO formDto); + + /* + * 志愿者列表 + * @param dto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author zhangyong + * @Date 15:33 2020-05-18 + **/ + Result> listVolunteer(EpdcAppVolunteerListFormDTO dto); + + /** + * 插入一条志愿者数据 + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:49 2020-05-26 + */ + Result insertV2VolunteerInfo(EpdcCompleteVolunteerInfoV2FormDTO formDTO); + + } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java index 7156605c..90e65549 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java @@ -28,6 +28,7 @@ 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.enums.UserTagEnum; import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.constant.UserFieldConsant; @@ -36,10 +37,13 @@ import com.elink.esua.epdc.dao.VolunteerInfoDao; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; import com.elink.esua.epdc.dto.UserTagDTO; import com.elink.esua.epdc.dto.VolunteerInfoDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcAppVolunteerListFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcCompleteVolunteerInfoFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeFormDTO; +import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; import com.elink.esua.epdc.entity.VolunteerInfoEntity; import com.elink.esua.epdc.feign.AdminFeignClient; @@ -386,4 +390,48 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl> listVolunteer(EpdcAppVolunteerListFormDTO dto) { + int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); + dto.setPageIndex(pageIndex); + List data = baseDao.selectListVolunteer(dto); + return new Result().ok(data); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result insertV2VolunteerInfo(EpdcCompleteVolunteerInfoV2FormDTO formDTO) { + + VolunteerInfoEntity volunteerEntity = ConvertUtils.sourceToTarget(formDTO, VolunteerInfoEntity.class); + + // 补全其他字段 + volunteerEntity.setRegistTime(new Date());// 注册时间 + volunteerEntity.setAuditStatus(NumConstant.ZERO_STR); // 审核状态 默认自动审核通过 + volunteerEntity.setAuditTime(volunteerEntity.getRegistTime()); // 审核时间 + String address = volunteerEntity.getRoad() + .concat(StringUtils.isNotBlank(volunteerEntity.getVillageName()) ? volunteerEntity.getVillageName() : StringUtils.EMPTY) + .concat(StringUtils.isNotBlank(volunteerEntity.getDwellingPlace()) ? volunteerEntity.getDwellingPlace() : StringUtils.EMPTY); + volunteerEntity.setAddress(address); // 居住地址 + + // 获取部门信息 + Result dtoResult = adminFeignClient.getParentAndAllDept(String.valueOf(volunteerEntity.getGridId())); + + // 机构信息 + DeptEntityUtils.loadDeptInfo( + ConvertUtils.sourceToTarget(dtoResult.getData(), DeptEntityUtils.DeptDto.class), + volunteerEntity + ); + + // deleteVolunteerByUserId(volunteerEntity.getUserId()); + VolunteerInfoDTO dto = baseDao.selectOneVolunteerInfoDTO(formDTO.getUserId()); + if(null != dto) { + volunteerEntity.setId(dto.getId()); + updateById(volunteerEntity); + } else { + insert(volunteerEntity); + this.sendNotice(volunteerEntity); + userTagRelationService.addUserTagRelation(volunteerEntity.getUserId(), UserTagEnum.VOLUNTEER.value()); + } + return new Result().ok(NumConstant.ONE); + } } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml index fde2ddd6..3ccc45f2 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml @@ -13,7 +13,10 @@ eu.NICKNAME AS nickname, eu.FACE_IMG AS faceImg, eu.MOBILE AS mobile, - eu.IDENTITY_NO AS identityNo, + CASE SUM(IFNULL(eu.IDENTITY_NO,0)) + WHEN 0 THEN v.IDENTITY_NO + ELSE eu.IDENTITY_NO + END AS identityNo, eugr.ALL_DEPT_NAMES AS deptName, eu.REAL_NAME AS realName, eu.ROAD AS road, @@ -31,6 +34,7 @@ Left Join (select * from epdc_user_grid_relation where USER_ID = #{id} order by UPDATED_TIME desc limit 0,1) eugr on(eu.id=eugr.USER_ID) left join epdc_points_grade g ON 1=1 AND g.DEL_FLAG = 0 + LEFT JOIN epdc_volunteer_info v ON eu.ID = v.USER_ID WHERE eu.ID = #{id} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml index 73ba68b5..94f4c39b 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml @@ -34,6 +34,9 @@ + + + @@ -178,8 +181,8 @@ DATE_FORMAT(NOW(),'%Y-%m-%d') generate_date, vi.ID volunteer_id, vi.USER_ID, - eu.FACE_IMG, - eu.NICKNAME, + vi.VOLUNTEER_FACE_IMG as FACE_IMG, + vi.VOLUNTEER_NICKNAME as NICKNAME, eu.PARTY_FLAG, vi.KINDNESS_TIME, vi.PARTICIPATION_NUM @@ -206,4 +209,69 @@ USER_ID = #{userId} AND DEL_FLAG = '0' + + + + + UPDATE epdc_volunteer_info + SET + + REAL_NAME = #{realName}, + + + MOBILE = #{mobile}, + + + IDENTITY_NO = #{identityNo}, + + + ROAD = #{road}, + + + VILLAGE_NAME = #{villageName}, + + + DWELLING_PLACE = #{dwellingPlace}, + + + GRID_ID = #{gridId}, + + + INTRODUCE = #{introduce}, + + + BIRTHDAY = #{birthday}, + + + SEX = #{sex}, + + + VOLUNTEER_NICKNAME = #{volunteerNickname}, + + + VOLUNTEER_FACE_IMG = #{volunteerFaceImg}, + + + VOLUNTEER_SIGNATURE = #{volunteerSignature} + + WHERE + USER_ID = #{userId} + AND DEL_FLAG = '0' +