diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java index de796f3760..e4dde4f2fa 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java @@ -20,12 +20,10 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.security.user.SecurityUser; import com.epmet.commons.tools.security.user.UserDetail; -import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.reflection.MetaObject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import javax.swing.text.html.Option; import java.util.Date; import java.util.Optional; @@ -110,6 +108,27 @@ public class FieldMetaObjectHandler implements MetaObjectHandler { } return loginUserUtil.getLoginUserCustomerId(); } + /** + * @Description 获取用户ID + * @Param metaObject + * @Return {@link Object} + * @Author zhaoqifeng + * @Date 2021/9/16 10:04 + */ + public Object getUserIdByFieldValue(MetaObject metaObject) { + if (!metaObject.hasSetter(FieldConstant.USER_ID_HUMP)) { + // 如果该entity对象,没有userId属性,那么返回null; + return null; + } + + Object userId; + userId = getFieldValByName(FieldConstant.USER_ID_HUMP, metaObject); + if (userId != null && !userId.equals("")) { + // 看entity是否手动设置了,设置了就用设置的 + return userId; + } + return loginUserUtil.getLoginUserId(); + } public Object getCreatedTimeByFieldValue(MetaObject metaObject) { Object createdTime = null; diff --git a/epmet-commons/epmet-commons-tools/pom.xml b/epmet-commons/epmet-commons-tools/pom.xml index 7bde49e357..5929139632 100644 --- a/epmet-commons/epmet-commons-tools/pom.xml +++ b/epmet-commons/epmet-commons-tools/pom.xml @@ -153,6 +153,12 @@ com.squareup.okhttp3 okhttp + + io.github.wnjustdoit + pinyin4j + 2.6.0 + compile + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java index 29a7dcda6b..400e3893e4 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java @@ -160,4 +160,15 @@ public interface Constant { // resi_footbar_highlight_num // gov_footbar_highlight_num String FOOTBAR_HIGHLIGHT_NUM="_footbar_highlight_num"; + + + /** + * 未被禁用标识 + * */ + String ENABLE = "enable"; + + /** + * 被禁用标识 + * */ + String DISABLE = "disable"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java index d8cf9a8265..c5db9c6718 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java @@ -22,6 +22,11 @@ public class CustomerStaffInfoCacheResult implements Serializable { */ private String agencyId; + /** + * 工作人员所属组织ID的pids + */ + private String agencyPIds; + /** * 工作人员所属组织名称 */ @@ -57,6 +62,11 @@ public class CustomerStaffInfoCacheResult implements Serializable { */ private String headPhoto; + /** + * 工作人员是从哪中组织添加的 组织Id + */ + private String fromOrgId; + /** * 工作人员是从哪中组织类型添加的 3个值:agency,grid,dept * @see com.epmet.commons.tools.enums.OrgTypeEnum diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index aa74cd8e2a..f078bd4bb6 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -74,6 +74,8 @@ public enum EpmetErrorCode { AREA_CODE_ALREADY_EXISTS(8208,"组织区划已被占用,请重新选择"), AGENCY_NAME_ALREADY_EXISTS(8209,"当前组织名称已存在,请重新修改"), SET_PARENT_AREA_CODE(8210,"请先设置上级组织区划"), + HAVE_GUIDE_CANNOT_DEL(8211,"当前分类已经存在办事指南,不允许删除"), + GUIDE_CATEGORY_NAME_EXITS(8212,"分类已存在"), REQUIRE_PERMISSION(8301, "您没有足够的操作权限"), THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"), @@ -108,6 +110,8 @@ public enum EpmetErrorCode { PLEASE_CHOOSE_MEMBER(8611,"请选择成员"), INFO_GROUP_NAME_EXISTS(8612,"名称已存在"), INFO_REPLY_CONTENT_LENGTH_LIMIT(8613,"回复内容最多输入500字"), + INFO_GROUP_NOT_EXISTS(8614,"群不存在"), + INFO_GROUP_OPE_PERMISSION_REQUIRED(8615,"无权操作"), // 爱心互助 居民端 NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"), @@ -155,7 +159,8 @@ public enum EpmetErrorCode { EXISTED_SPECIAL_PROJECT(8807, "已经添加过此专题"), CAN_NOT_DEL_SPECIAL_PROJECT(8808, "您没有权限删除此专题"), TAG_NOT_EXIST(8809,"标签不存在"), - + GUIDE_IS_NULL(8810,"指南内容不能为空"), + GUIDE_IS_NOT_YOURS(8811,"只能删除自己创建的指南"), //公众号 865..开头的码 PUBLIC_NOT_EXISTS(8651,"手机号未注册,请先完成信息注册"), SELECT_CUSTOMER_ERROR(8652,"未查询到注册客户信息"), diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index bcbded2bd6..6fe4130225 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -522,4 +522,29 @@ public class RedisKeys { public static String getCustomerStaffInfoKey(String customerId, String staffId) { return rootPrefix.concat("gov:staff:").concat(customerId).concat(StrConstant.COLON).concat(staffId); } + + /** + * @description 网格信息 + * + * @param gridId + * @return + * @author wxz + * @date 2021.09.08 11:03:48 + */ + public static String getGridInfoKey(String gridId) { + return rootPrefix.concat("gov:grid:").concat(gridId); + } + + /** + * @description 调查问卷accessKey + * + * @param userId + * @param qKey + * @return + * @author wxz + * @date 2021.09.23 17:38:37 + */ + public static String getQuestionnaireAccessKey(String userId, String qKey) { + return rootPrefix.concat("questionnaire:accesskey:").concat(userId).concat(":").concat(qKey); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java index 577bdf3910..98adecdc97 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java @@ -22,6 +22,11 @@ public class CustomerStaffInfoCache implements Serializable { */ private String agencyId; + /** + * 工作人员所属组织ID的pids + */ + private String agencyPIds; + /** * 工作人员所属组织名称 */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java index 5c725c2ec4..79ee2d538a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java @@ -27,8 +27,14 @@ import org.springframework.core.MethodParameter; import org.springframework.stereotype.Service; import org.springframework.web.bind.support.WebDataBinderFactory; import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.method.support.ModelAndViewContainer; +import org.springframework.web.servlet.HandlerMapping; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import java.util.Map; /** * 有@LoginUser注解的方法参数,注入当前登录用户 @@ -68,6 +74,12 @@ public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgu @Override public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer container, NativeWebRequest request, WebDataBinderFactory factory) throws Exception { + + HttpServletRequest nativeReq = (HttpServletRequest) request.getNativeRequest(); + String requestURI = nativeReq.getRequestURI(); + + logger.info("【LoginUserHandlerMethodArgumentResolver】请求uri:{}", requestURI); + //app-client-userId String redisKey = request.getHeader(Constant.APP_USER_KEY); if (StringUtils.isEmpty(redisKey)) { diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 55793d7d56..66313a3cb6 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -418,6 +418,23 @@ public class DateUtils { return DateUtils.format(date,DateUtils.DATE_PATTERN_YYYYMMDD); } + public static String getMonthDay(String month){ + SimpleDateFormat sdf = new SimpleDateFormat(DATE_PATTERN_YYYYMM); + String now = sdf.format(new Date());//当前时间 + if (month.equals(now)) { + Calendar c = Calendar.getInstance(); + c.add(Calendar.DATE, - NumConstant.ONE); + Date date = c.getTime(); + return DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); + } + Date nowDate = parse(month, DATE_PATTERN_YYYYMM); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(nowDate); + calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); + return DateUtils.format(calendar.getTime(), DateUtils.DATE_PATTERN_YYYYMMDD); + + } + /** * @return java.lang.String * @param beforDay diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java index 2ac6af82a5..773291dfcc 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java @@ -14,11 +14,13 @@ import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.springframework.beans.BeanUtils; +import org.springframework.util.CollectionUtils; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.Date; @@ -80,4 +82,44 @@ public class ExcelUtils { exportExcel(response, fileName, targetList, targetClass); } + + public static void exportExcelToTargetDisposeAll(HttpServletResponse response, String fileName, Collection sourceList, + Class targetClass) throws Exception { + if (!CollectionUtils.isEmpty(sourceList)){ + List targetList = new ArrayList<>(sourceList.size()); + for(Object source : sourceList){ + Object target = targetClass.newInstance(); + BeanUtils.copyProperties(source, target); + targetList.add(target); + } + exportExcelDispose(response, fileName, targetList, targetClass); + }else { + exportExcelDispose(response, fileName, new ArrayList<>(), targetClass); + } + + + } + + public static void exportExcelDispose(HttpServletResponse response, String fileName, Collection list, + Class pojoClass) throws IOException { + if(StringUtils.isBlank(fileName)){ + //当前日期 + fileName = DateUtils.format(new Date()); + } + ExportParams params = new ExportParams(fileName,fileName); + Workbook workbook = ExcelExportUtil.exportExcel(params, pojoClass, list); + Sheet sheet1 = workbook.getSheetAt(0); + sheet1.setDefaultColumnWidth(50*256); + sheet1.setDefaultRowHeight((short)(2*256)); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-Type", "application/vnd.ms-excel"); + fileName = fileName + ".xls"; + response.setHeader("Content-Disposition", + "attachment;filename=" +fileName); + ServletOutputStream out = response.getOutputStream(); + workbook.write(out); + out.flush(); + out.close(); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java similarity index 97% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java rename to epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java index 8d392a2c21..331febcfe9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java @@ -1,4 +1,4 @@ -package com.epmet.util; +package com.epmet.commons.tools.utils; import net.sourceforge.pinyin4j.PinyinHelper; import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; @@ -31,6 +31,7 @@ public class Pinyin4jUtil { duoyinMap.put('均',new String[]{"jun"}); duoyinMap.put('会', new String[]{"hui"}); duoyinMap.put('属', new String[]{"shu"}); + duoyinMap.put('调', new String[]{"diao"}); } /** @@ -42,7 +43,6 @@ public class Pinyin4jUtil { */ public static String getFirstSpellPinYin(String src, boolean isFullSpell) { String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, 1)); - System.out.println(targetStr); String[] split = targetStr.split(","); if (split.length > 1) { targetStr = split[0]; @@ -59,7 +59,6 @@ public class Pinyin4jUtil { */ public static String getSpellPinYin(String src, boolean isFullSpell,Integer preFont) { String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, preFont)); - System.out.println(targetStr); String[] split = targetStr.split(","); if (split.length > 1) { targetStr = split[0]; @@ -139,8 +138,8 @@ public class Pinyin4jUtil { } else if (((int) c >= 65 && (int) c <= 90) || ((int) c >= 97 && (int) c <= 122)) {//英文 temp[i] = new String[]{String.valueOf(srcChar[i])}; - } else { - temp[i] = new String[]{""}; + } else {//非汉字全盘返回即可 + temp[i] = new String[]{String.valueOf(srcChar[i])}; } } String[] pingyinArray = exchange(temp); diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index b02b4c211f..42e93411bf 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -224,6 +224,9 @@ lb://epmet-openapi-adv-server + + lb://tduck-api + https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd @@ -355,6 +358,9 @@ lb://epmet-openapi-adv-server + + lb://tduck-api + https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd @@ -452,6 +458,8 @@ lb://epmet-ext-server lb://data-aggregator-server + + lb://tduck-api lb://epmet-openapi-adv-server @@ -552,6 +560,8 @@ lb://epmet-openapi-adv-server + + lb://tduck-api https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 diff --git a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java index 538467d2e1..ee9125db57 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java @@ -105,10 +105,10 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory().error(e.getCode(), e.getMessage())); } catch (Exception e) { - logger.error("CpAuthGatewayFilterFactory认证出错,错误信息:{}", ExceptionUtils.getErrorStackTrace(e)); + logger.error("CpAuthGatewayFilterFactory认证出错Exception,错误信息:{}", ExceptionUtils.getErrorStackTrace(e)); return response(exchange, new Result<>().error(e.getMessage())); } diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 4f65034c7d..ca78ab64aa 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -336,12 +336,20 @@ spring: # 宣传服务 - id: epmet-openapi-adv-server uri: @gateway.routes.epmet-openapi-adv-server.url@ - order: 35 + order: 36 predicates: - Path=${server.servlet.context-path}/adv/** filters: - StripPrefix=1 - CpAuth=true + - id: tduck-api + uri: @gateway.routes.tduck-api.url@ + order: 37 + predicates: + - Path=${server.servlet.context-path}/tduck-api/** + filters: + - StripPrefix=1 + - CpAuth=true nacos: discovery: server-addr: @nacos.server-addr@ @@ -472,6 +480,7 @@ epmet: - /epmetuser/customerstaff/customerlist - /gov/project/project/platformcallback - /oper/customize/customerstartpage/homestartpage + - /tduck-api/** # 外部应用认证,使用AccessToken等头进行认证 externalOpenUrls: diff --git a/epmet-module/data-aggregator/data-aggregator-client/pom.xml b/epmet-module/data-aggregator/data-aggregator-client/pom.xml index 4e8beca881..7f6f4cd2ff 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-client/pom.xml @@ -17,6 +17,12 @@ epmet-commons-tools 2.0.0 + + com.baomidou + mybatis-plus-annotation + 3.2.0 + compile + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java index dd9ab18035..8ae93cc5d4 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java @@ -32,5 +32,9 @@ public interface DataSourceConstant { String EVALUATION_INDEX = "evaluationIndex"; String OPERCUSTOMIZE="opercustomize"; + String EPMET_MESSAGE="epmetmessage"; + + String EPMET_T_DUCK = "epmettduck"; + String EPMETTDUCK="epmettduck"; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/TDuckConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/TDuckConstant.java new file mode 100644 index 0000000000..87ef2de7cb --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/TDuckConstant.java @@ -0,0 +1,17 @@ +package com.epmet.dataaggre.constant; + +/** + * @Author zxc + * @DateTime 2021/9/23 4:06 下午 + * @DESC + */ +public interface TDuckConstant { + + String CLIENT_GOV = "gov"; + String CLIENT_RESI = "resi"; + + String ORG_TYPE_AGENCY = "agency"; + String ORG_TYPE_GRID = "grid"; + String ORG_TYPE_DEPT = "dept"; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/CustomerDataManageFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/CustomerDataManageFormDTO.java new file mode 100644 index 0000000000..e707ef6d6c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/CustomerDataManageFormDTO.java @@ -0,0 +1,67 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/9/10 11:04 上午 + * @DESC + */ +@Data +public class CustomerDataManageFormDTO implements Serializable { + + private static final long serialVersionUID = 6462094914874831738L; + + public interface CustomerDataManageForm{} + + /** + * 客户ID + */ + @NotBlank(message = "客户ID不能为空",groups = CustomerDataManageForm.class) + private String customerId; + + /** + * 组织ID + */ + @NotBlank(message = "组织ID不能为空",groups = CustomerDataManageForm.class) + private String agencyId; + + /** + * 区间:Interval 截止:end + */ + @NotBlank(message = "type不能为空",groups = CustomerDataManageForm.class) + private String type; + + /** + * 开始时间【yyyymmdd】 + */ + private String startTime; + + /** + * 结束时间【yyyymmdd】 + */ + @NotBlank(message = "结束时间不能为空",groups = CustomerDataManageForm.class) + private String endTime; + + private Integer pageNo = 1; + + private Integer pageSize = 20; + + /** + * 是否分页【true分 false不分】 + */ + @NotNull(message = "是否分页不能为空",groups = CustomerDataManageForm.class) + private Boolean isPage; + + //组织或网格Id集合 + private List idList; + //按起始时间还是结束时间查数据【start end】 + private String sourceType; + //数据类型【组织agency 网格grid】 + private String dataType; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/PartyMemberVanguardFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/PartyMemberVanguardFormDTO.java index 2b70bbeaa0..cf67f5b14c 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/PartyMemberVanguardFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/PartyMemberVanguardFormDTO.java @@ -15,4 +15,9 @@ public class PartyMemberVanguardFormDTO implements Serializable { private String agencyId; private String orgId; private String orgType; + private String dateId; + /** + * 月份是当月取前一天,不是当月取那个月最后一天 + */ + private String monthId; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/CustomerDataManageResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/CustomerDataManageResultDTO.java new file mode 100644 index 0000000000..e736309945 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/CustomerDataManageResultDTO.java @@ -0,0 +1,57 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 运营情况数据导出-接口返参 + * @Auth sun + */ +@Data +public class CustomerDataManageResultDTO { + + List list = new ArrayList<>(); + private Integer total; + + @Data + public static class CustomerDataManage { + //组织、网格Id + private String orgId; + //组织、网格名称 + private String orgName; + //用户数 + private Integer userCount = 0; + //居民数 + private Integer residentCount = 0; + //党员数 + private Integer partyMemberCount = 0; + //小组数 + private Integer groupCount = 0; + //话题数 + private Integer topicCount = 0; + //议题数 + private Integer issueCount = 0; + //项目数 + private Integer projectCount = 0; + //结案项目数 + private Integer closedProjectCount = 0; + //巡查人数 + private Integer patrolPeopleCount = 0; + //巡查次数 + private Integer patrolCount = 0; + //巡查时长 + private String patrolDuration; + //未转换前的巡查时长 + private Integer patrolDurationInteger = 0; + //数据对应dateId + @JsonIgnore + private String dateId; + @JsonIgnore + private String staffId; + } + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/AcUserAuthorizeDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/AcUserAuthorizeDTO.java new file mode 100644 index 0000000000..3db0c9939d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/AcUserAuthorizeDTO.java @@ -0,0 +1,85 @@ +package com.epmet.dataaggre.dto.epmettduck; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 第三方用户授权信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +public class AcUserAuthorizeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 第三方平台类型 + */ + private Integer type; + + /** + * 平台AppId + */ + private String appId; + + /** + * 平台OpenId + */ + private String openId; + + /** + * 平台用户名 + */ + private String userName; + + /** + * 用户Id + */ + private String userId; + + /** + * 平台用户信息 + */ + private String userInfo; + + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/AcUserDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/AcUserDTO.java new file mode 100644 index 0000000000..a1bb83f55b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/AcUserDTO.java @@ -0,0 +1,121 @@ +/** + * 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.epmet.dataaggre.dto.epmettduck; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +public class AcUserDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 姓名 + */ + private String name; + + /** + * 头像 + */ + private String avatar; + + /** + * 性别0未知 1男2女 + */ + private Integer gender; + + /** + * 邮箱 + */ + private String email; + + /** + * 手机号 + */ + private String phoneNumber; + + /** + * 密码 + */ + private String password; + + /** + * 注册渠道 + */ + private String regChannel; + + /** + * 最后登录渠道 + */ + private Integer lastLoginChannel; + + /** + * 最后登录时间 + */ + private Date lastLoginTime; + + /** + * 最后登录Ip + */ + private String lastLoginIp; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/InputMapDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/InputMapDTO.java new file mode 100644 index 0000000000..befdf3ae93 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/InputMapDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dataaggre.dto.epmettduck; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description TODO + * @Author yinzuomei + * @Date 2021/9/16 11:34 下午 + */ +@Data +public class InputMapDTO implements Serializable { + private BigDecimal longitude; + private BigDecimal latitude; + private String address; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrProjectTemplateCategoryDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrProjectTemplateCategoryDTO.java new file mode 100644 index 0000000000..8c0956058f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrProjectTemplateCategoryDTO.java @@ -0,0 +1,85 @@ +/** + * 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.epmet.dataaggre.dto.epmettduck; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目模板分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +public class PrProjectTemplateCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 主题名称 + */ + private String name; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrProjectTemplateDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrProjectTemplateDTO.java new file mode 100644 index 0000000000..1b995189c6 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrProjectTemplateDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.epmettduck; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +public class PrProjectTemplateDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 模板唯一标识 + */ + private String key; + + /** + * 封面图 + */ + private String coverImg; + + /** + * 项目名称 + */ + private String name; + + /** + * 项目描述 + */ + private String describe; + + /** + * 喜欢数 + */ + private Integer likeCount; + + /** + * 项目类型 + */ + private String categoryId; + + /** + * 状态 + */ + private Integer status; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrProjectTemplateItemDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrProjectTemplateItemDTO.java new file mode 100644 index 0000000000..2174d4f39d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrProjectTemplateItemDTO.java @@ -0,0 +1,141 @@ +/** + * 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.epmet.dataaggre.dto.epmettduck; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +public class PrProjectTemplateItemDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 项目key + */ + private String projectKey; + + /** + * 表单项Id + */ + private String formItemId; + + /** + * 表单项类型 + */ + private String type; + + /** + * 表单项标题 + */ + private String label; + + /** + * 是否显示标签 + */ + private Integer showLabel; + + /** + * 表单项默认值 + */ + private String defaultValue; + + /** + * 是否必填 + */ + private Integer required; + + /** + * 输入型提示文字 + */ + private String placeholder; + + /** + * 排序 + */ + private Long sort; + + /** + * 栅格宽度 + */ + private Integer span; + + /** + * 扩展字段 表单项独有字段 + */ + private String expand; + + /** + * 正则表达式 + */ + private String regList; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 展示类型组件 + */ + private Integer isDisplayType; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrProjectThemeDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrProjectThemeDTO.java new file mode 100644 index 0000000000..8bf8538c2a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrProjectThemeDTO.java @@ -0,0 +1,101 @@ +/** + * 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.epmet.dataaggre.dto.epmettduck; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目主题外观模板 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +public class PrProjectThemeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 主题名称 + */ + private String name; + + /** + * 主题风格 + + */ + private String style; + + /** + * 头部图片 + */ + private String headImgUrl; + + /** + * 颜色代码 + */ + private String color; + + /** + * 按钮颜色 + */ + private String btnsColor; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrPublishRangeDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrPublishRangeDTO.java new file mode 100644 index 0000000000..944965d1ec --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrPublishRangeDTO.java @@ -0,0 +1,96 @@ +/** + * 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.epmet.dataaggre.dto.epmettduck; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +public class PrPublishRangeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 项目key + */ + private String projectKey; + + /** + * 范围组织ids,格式与组织维度一致 冒号隔开 即选中节点的全路径id + */ + private String orgIds; + + /** + * 最后发布组织的ID + */ + private String orgId; + + /** + * 最后发布组织的类型;department,agency;grid + */ + private String orgType; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrResultExtDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrResultExtDTO.java new file mode 100644 index 0000000000..4f0ade42a5 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrResultExtDTO.java @@ -0,0 +1,101 @@ +/** + * 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.epmet.dataaggre.dto.epmettduck; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 问卷填写附属信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +public class PrResultExtDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 姓名 + */ + private String userId; + + /** + * 结果Id + */ + private String resultId; + + /** + * 工作端小程序:gov、居民端小程序:resi、运营端:oper、其他:other + */ + private String userType; + + /** + * 在哪个组织填写的 + */ + private String fromOrgId; + + /** + * 组织:agency;部门:department;网格:grid + */ + private String fromOrgType; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectDTO.java new file mode 100644 index 0000000000..7f9bba34cb --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectDTO.java @@ -0,0 +1,121 @@ +/** + * 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.epmet.dataaggre.dto.epmettduck; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +public class PrUserProjectDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 项目code + */ + private String key; + + /** + * 来源Id + */ + private String sourceId; + + /** + * 来源类型 + */ + private Integer sourceType; + + /** + * 项目名称 + */ + private String name; + + /** + * 项目描述 + */ + private String describe; + + /** + * 用户ID + */ + private String userId; + + /** + * 项目类型 + */ + private Integer type; + + /** + * 状态 + */ + private Integer status; + + /** + * 适用于哪个端 resi:居民端用户;gov:工作端用户;运营端用户:oper + */ + private String client; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectItemDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectItemDTO.java new file mode 100644 index 0000000000..614236b09c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectItemDTO.java @@ -0,0 +1,141 @@ +/** + * 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.epmet.dataaggre.dto.epmettduck; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +public class PrUserProjectItemDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 项目key + */ + private String projectKey; + + /** + * 表单项Id + */ + private String formItemId; + + /** + * 表单项类型 + */ + private String type; + + /** + * 表单项标题 + */ + private String label; + + /** + * 展示类型组件 + */ + private Integer isDisplayType; + + /** + * 是否显示标签 + */ + private Integer showLabel; + + /** + * 表单项默认值 + */ + private String defaultValue; + + /** + * 是否必填 + */ + private Integer required; + + /** + * 输入型提示文字 + */ + private String placeholder; + + /** + * 排序 + */ + private Long sort; + + /** + * 栅格宽度 + */ + private Integer span; + + /** + * 扩展字段 表单项独有字段 + */ + private String expand; + + /** + * 正则表达式 + */ + private String regList; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectLogicDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectLogicDTO.java new file mode 100644 index 0000000000..901a8b41ba --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectLogicDTO.java @@ -0,0 +1,96 @@ +/** + * 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.epmet.dataaggre.dto.epmettduck; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目逻辑 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +public class PrUserProjectLogicDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 逻辑Id + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 项目key + */ + private String projectKey; + + /** + * 问题Id + */ + private String formItemId; + + /** + * 条件选项 + */ + private Integer expression; + + /** + * 条件列表 + */ + private String conditionList; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectResultDTO.java new file mode 100644 index 0000000000..dd81d962fc --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectResultDTO.java @@ -0,0 +1,141 @@ +/** + * 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.epmet.dataaggre.dto.epmettduck; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +public class PrUserProjectResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 项目key + */ + private String projectKey; + + /** + * 序号 + */ + private Integer serialNumber; + + /** + * 填写结果 + */ + private String originalData; + + /** + * 填写结果 + */ + private String processData; + + /** + * 提交ua + */ + private String submitUa; + + /** + * 提交系统 + */ + private String submitOs; + + /** + * 提交浏览器 + */ + private String submitBrowser; + + /** + * 请求ip + */ + private String submitRequestIp; + + /** + * 提交地址 + */ + private String submitAddress; + + /** + * 完成时间 毫秒 + */ + private Integer completeTime; + + /** + * 用户Id + */ + private String userId; + + /** + * 微信openId + */ + private String wxOpenId; + + /** + * 微信用户信息 + */ + private String wxUserInfo; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectSettingDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectSettingDTO.java new file mode 100644 index 0000000000..bb44c7e351 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectSettingDTO.java @@ -0,0 +1,186 @@ +/** + * 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.epmet.dataaggre.dto.epmettduck; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +public class PrUserProjectSettingDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 项目key + */ + private String projectKey; + + /** + * 提交提示图片 + */ + private String submitPromptImg; + + /** + * 提交提示文字 + */ + private String submitPromptText; + + /** + * 提交跳转连接 + */ + private String submitJumpUrl; + + /** + * 公开提交结果 + */ + private Integer isPublicResult; + + /** + * 只在微信填写 + */ + private Integer isWxWrite; + + /** + * + */ + private Integer isWxWriteOnce; + + /** + * 每人只能填写一次 + */ + private Integer isEveryoneWriteOnce; + + /** + * 每人每天只能填写一次 + */ + private Integer isEveryoneDayWriteOnce; + + /** + * 填写之后提示 + */ + private String writeOncePromptText; + + /** + * 新反馈通知邮件 + */ + private String newWriteNotifyEmail; + + /** + * 新反馈通知微信 + */ + private String newWriteNotifyWx; + + /** + * 记录微信用户个人信息 + */ + private Integer isRecordWxUser; + + /** + * 定时收集开始时间 + */ + private Date timedCollectionBeginTime; + + /** + * 定时收集结束时间 + */ + private Date timedCollectionEndTime; + + /** + * 定时未启动提示文字 + */ + private String timedNotEnabledPromptText; + + /** + * 定时停用会提示文字 + */ + private String timedDeactivatePromptText; + + /** + * 定时定量数量 + */ + private Integer timedQuantitativeQuantity; + + /** + * 定时定量完成提示 + */ + private String timedEndPromptText; + + /** + * 分享图片 + */ + private String shareImg; + + /** + * 分享标题 + */ + private String shareTitle; + + /** + * 分享描述 + */ + private String shareDesc; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectThemeDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectThemeDTO.java new file mode 100644 index 0000000000..e42dd917fc --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrUserProjectThemeDTO.java @@ -0,0 +1,126 @@ +/** + * 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.epmet.dataaggre.dto.epmettduck; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +public class PrUserProjectThemeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 项目key + */ + private String projectKey; + + /** + * 主题Id + */ + private String themeId; + + /** + * 提交按钮文字 + */ + private String submitBtnText; + + /** + * logo图片 + */ + private String logoImg; + + /** + * logo位置 + */ + private String logoPosition; + + /** + * 背景颜色 + */ + private String backgroundColor; + + /** + * 背景图片 + */ + private String backgroundImg; + + /** + * 是否显示标题 + */ + private Integer showTitle; + + /** + * 是否显示描述语 + */ + private Integer showDescribe; + + /** + * 显示序号 + */ + private Integer showNumber; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrVistRecordDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrVistRecordDTO.java new file mode 100644 index 0000000000..7e747c2680 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/PrVistRecordDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.epmettduck; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户访问问卷记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +public class PrVistRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 姓名 + */ + private String userId; + + /** + * 工作端小程序:gov、居民端小程序:resi、运营端:oper、其他:other + */ + private String userType; + + /** + * 项目key + */ + private String projectKey; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/ProjectItemTypeEnum.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/ProjectItemTypeEnum.java new file mode 100644 index 0000000000..8083aeb077 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/ProjectItemTypeEnum.java @@ -0,0 +1,75 @@ +package com.epmet.dataaggre.dto.epmettduck; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.epmet.dataaggre.dto.epmettduck.struct.*; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @Author zxc + * @DateTime 2021/9/16 2:28 下午 + * @DESC + */ +@AllArgsConstructor +@Getter +public enum ProjectItemTypeEnum { + + //联系人组件: + INPUT("INPUT", "单行文本", InputExpandStruct.class), + TEXTAREA("TEXTAREA", "多行文本", TextareaExpandStruct.class), + PASSWORD_INPUT("PASSWORD_INPUT", "密码输入", null), + NUMBER_INPUT("NUMBER_INPUT", "数字输入", NumberExpandStruct.class), + SELECT("SELECT", "下拉框", SelectExpandStruct.class), + CASCADER("CASCADER", "级联选择", CascaderExpandStruct.class), + RADIO("RADIO", "单选框", RadioExpandStruct.class), + CHECKBOX("CHECKBOX", "多选框", CheckboxExpandStruct.class), + SWITCH("SWITCH", "开关", SwitchExpandStruct.class), + TIME("TIME", "时间选择", TimeExpandStruct.class), + TIME_RANGE("TIME_RANGE", "时间范围", TimeRangeExpandStruct.class), + DATE("DATE", "日期选择", DateExpandStruct.class), + DATE_RANGE("DATE_RANGE", "日期范围", DateRangeExpandStruct.class), + RATE("RATE", "评分", RateExpandStruct.class), + PROVINCE_CITY("PROVINCE_CITY", "省市联动", EmptyExpandStruct.class), + INPUT_MAP("INPUT_MAP", "地理位置", EmptyExpandStruct.class), + + // 以下不分析 + PHONE_VERIFICATION("PHONE_VERIFICATION", "手机号验证", EmptyExpandStruct.class), + SLIDER("SLIDER", "滑块", SliderExpandStruct.class), + COLOR("COLOR", "颜色", ColorExpandStruct.class), + UPLOAD("UPLOAD", "文件上传组件", UploadExpandStruct.class), + IMAGE("IMAGE", "图片展示", ImageExpandStruct.class), + IMAGE_SELECT("IMAGE_SELECT", "图片选择", ImageSelectExpandStruct.class), + IMAGE_CAROUSEL("IMAGE_CAROUSEL", "图片轮播", ImageCarouselExpandStruct.class), + DESC_TEXT("DESC_TEXT", "文字描述", DescTextExpandStruct.class), + SIGN_PAD("SIGN_PAD", "手写签名", SignPadExpandStruct.class), + PAGINATION("PAGINATION", "分页", PaginationExpandStruct.class), + DIVIDER("DIVIDER", "分割线", DividerExpandStruct.class); + + @EnumValue + @JsonValue + private String value; + + private String desc; + /** + * 扩展属性类 + */ + private Class expandClass; + + /** + * 枚举入参注解 + * + * @param value + * @return + */ + @JsonCreator + public static ProjectItemTypeEnum getByValue(String value) { + for (ProjectItemTypeEnum typeEnum : values()) { + if (typeEnum.getValue().equals(value)) { + return typeEnum; + } + } + return null; + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/WxMpUserDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/WxMpUserDTO.java new file mode 100644 index 0000000000..e50b5fffab --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/WxMpUserDTO.java @@ -0,0 +1,126 @@ +/** + * 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.epmet.dataaggre.dto.epmettduck; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 微信公众号用户 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +public class WxMpUserDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 公众号AppId + */ + private String appid; + + /** + * 昵称 + */ + private String nickname; + + /** + * 性别 + */ + private Integer sex; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * + */ + private String unionId; + + /** + * + */ + private String openId; + + /** + * 国家 + */ + private String country; + + /** + * 省 + */ + private String province; + + /** + * 城市 + */ + private String city; + + /** + * 是否关注 + */ + private Integer isSubscribe; + + /** + * 用户Id + */ + private String userId; + + /** + * 删除标识 1删除;0未删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/ItemResDetailFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/ItemResDetailFormDTO.java new file mode 100644 index 0000000000..a107080eea --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/ItemResDetailFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dataaggre.dto.epmettduck.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description 问卷-数据分析-查看详情 + * @Author yinzuomei + * @Date 2021/9/22 1:29 下午 + */ +@Data +public class ItemResDetailFormDTO extends ProjectKeyCommonDTO{ + + @NotBlank(message = "formItemId不能为空",groups = AddUserInternalGroup.class) + private String formItemId; + /** + * 表单项类型 + */ + @NotBlank(message = "type不能为空",groups = AddUserInternalGroup.class) + private String type; + + + /** + * 09.22目前产品没要求分页 + */ + //@NotNull(message = "pageNo不能为空",groups = AddUserInternalGroup.class) + //private Integer pageNo; + //@NotNull(message = "pageSize不能为空",groups = AddUserInternalGroup.class) + //private Integer pageSize; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/ProjectKeyCommonDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/ProjectKeyCommonDTO.java new file mode 100644 index 0000000000..9ed0db927c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/ProjectKeyCommonDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dataaggre.dto.epmettduck.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description projectKey通用 + * @Author yinzuomei + * @Date 2021/9/16 1:32 下午 + */ +@Data +public class ProjectKeyCommonDTO implements Serializable { + public interface AddUserInternalGroup { + } + /** + * 问卷id, 对应pr_user_project.key + */ + @NotBlank(message = "projectKey不能为空",groups = AddUserInternalGroup.class) + private String projectKey; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/TDuckDetailFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/TDuckDetailFormDTO.java new file mode 100644 index 0000000000..3a9b934b69 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/TDuckDetailFormDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dataaggre.dto.epmettduck.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/16 2:00 下午 + * @DESC + */ +@Data +public class TDuckDetailFormDTO implements Serializable { + + private static final long serialVersionUID = 3793280475377993346L; + + public interface TDuckDetailForm{} + public interface PermissionValidate{} + + /** + * 项目key + */ + @NotBlank(message = "项目key不能为空",groups = { TDuckDetailForm.class, PermissionValidate.class }) + private String key; + /** + * 是否显示类型 + */ + @NotNull(message = "是否显示类型不能为空",groups = TDuckDetailForm.class) + private Boolean displayType; + + /** 当前操作人所在的组织的类型(grid:网格,agency:单位) */ + private String orgType; + + /** 当前操作人所在的组织的ID(当orgType为grid的时候必填,为agency的时候留空) */ + private String orgId; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/TDuckHeaderInfoFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/TDuckHeaderInfoFormDTO.java new file mode 100644 index 0000000000..2e0a1a953f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/TDuckHeaderInfoFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dataaggre.dto.epmettduck.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/17 10:47 上午 + * @DESC + */ +@Data +public class TDuckHeaderInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 3624352114576287768L; + + public interface TDuckHeaderInfoForm{} + + @NotBlank(message = "projectKey不能为空",groups = TDuckHeaderInfoForm.class) + private String projectKey; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/TDuckListFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/TDuckListFormDTO.java new file mode 100644 index 0000000000..83fc43fd6f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/TDuckListFormDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dataaggre.dto.epmettduck.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/17 10:47 上午 + * @DESC + */ +@Data +public class TDuckListFormDTO implements Serializable { + + private static final long serialVersionUID = 3624352114576287768L; + + public interface TDuckListForm{} + + /** + * 1:未发布,2:收集中,3:已结束 + */ + @NotNull(message = "问卷调查状态不能为空",groups = TDuckListForm.class) + private Integer status; + + @NotNull(message = "pageNo不能为空",groups = TDuckListForm.class) + private Integer pageNo; + + @NotNull(message = "pageSize不能为空",groups = TDuckListForm.class) + private Integer pageSize; + + private String orgId; + + private String orgType; + + @NotBlank(message = "client不能为空",groups = TDuckListForm.class) + private String client; + + private String userId; + + private String customerId; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/AnalysisReportResDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/AnalysisReportResDTO.java new file mode 100644 index 0000000000..e532068afa --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/AnalysisReportResDTO.java @@ -0,0 +1,68 @@ +package com.epmet.dataaggre.dto.epmettduck.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Map; + +/** + * @Description TODO + * @Author yinzuomei + * @Date 2021/9/16 5:30 下午 + */ +@Data +public class AnalysisReportResDTO implements Serializable { + private static final long serialVersionUID = -1637286883477938648L; + + /** + * 项目key + */ + private String projectKey; + + /** + * 表单项类型 + */ + private String type; + + /** + * 表单项标题 + */ + private String label; + + /** + * 表单项Id + */ + private String formItemId; + + /** + * 展示类型组件 + */ + private Integer isDisplayType; + + /** + * 是否显示标签 + */ + private Integer showLabel; + + /** + * 是否必填 + */ + private Integer required; + + /** + * 排序 + */ + private Long sort; + + private Map detail; + + /** + * 扩展字段 表单项独有字段 + */ + @JsonIgnore + private String expand; + + private String moduleType; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/CascaderDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/CascaderDTO.java new file mode 100644 index 0000000000..3b5888a543 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/CascaderDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dataaggre.dto.epmettduck.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 级联选择组件答案参数格式 + * @Author yinzuomei + * @Date 2021/9/18 3:40 下午 + */ +@Data +public class CascaderDTO implements Serializable { + /** + * 当前选择的选项id + */ + private Integer id; + /** + * 选项名 + */ + private String label; + + /** + * 选项名 + */ + private String value; + + /** + * pid + */ + private Integer pid; + + /** + * 全路径名字 + */ + private List labels; + public String pathName; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/ConcatTableHeaderDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/ConcatTableHeaderDTO.java new file mode 100644 index 0000000000..b44f736854 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/ConcatTableHeaderDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dataaggre.dto.epmettduck.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 表头 + * @Author yinzuomei + * @Date 2021/9/22 3:41 下午 + */ +@Data +public class ConcatTableHeaderDTO implements Serializable { + private static final long serialVersionUID = -1133629000511948034L; + + /** + * 显示名称 + */ + private String label; + /** + * 表单项Id + */ + private String formItemId; + + private String type; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/GetRangeResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/GetRangeResultDTO.java new file mode 100644 index 0000000000..d1ea08f6fe --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/GetRangeResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dataaggre.dto.epmettduck.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/18 14:41 + */ +@Data +public class GetRangeResultDTO implements Serializable { + private static final long serialVersionUID = 3208245365454855156L; + /** + * 适用于哪个端 resi:居民端用户;gov:工作端用户 + */ + private String client; + /** + * 发布范围组织列表 + */ + private List orgList; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/ItemResDetailConcatResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/ItemResDetailConcatResultDTO.java new file mode 100644 index 0000000000..8bb7fb8ccc --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/ItemResDetailConcatResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dataaggre.dto.epmettduck.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * @Description 联系人组件 + * @Author yinzuomei + * @Date 2021/9/22 2:54 下午 + */ +@Data +public class ItemResDetailConcatResultDTO implements Serializable { + private static final long serialVersionUID = -3695200094740706700L; + private List tableHeaderList; + private List> dataMap; + //private List> dataList; + + public ItemResDetailConcatResultDTO(){ + this.tableHeaderList=new ArrayList<>(); + this.dataMap=new ArrayList<>(); + } +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/OptionDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/OptionDTO.java new file mode 100644 index 0000000000..c1d64bba1e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/OptionDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dataaggre.dto.epmettduck.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author yinzuomei + * @Date 2021/9/17 3:25 下午 + */ +@Data +public class OptionDTO implements Serializable { + /** + * 选项题目 + */ + private String label; + + /** + * 答案值 + */ + private Integer value; + + /** + * 多少个人选择此答案 + */ + private Integer currentCount=0; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/PermissionValidateResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/PermissionValidateResultDTO.java new file mode 100644 index 0000000000..45897428d9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/PermissionValidateResultDTO.java @@ -0,0 +1,9 @@ +package com.epmet.dataaggre.dto.epmettduck.result; + +import lombok.Data; + +@Data +public class PermissionValidateResultDTO { + private Boolean permitted; + private String accessKey; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/ProjectProfileResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/ProjectProfileResultDTO.java new file mode 100644 index 0000000000..c5df187969 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/ProjectProfileResultDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dataaggre.dto.epmettduck.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 统计图标,上面的一行 + * @Author yinzuomei + * @Date 2021/9/16 2:10 下午 + */ +@Data +public class ProjectProfileResultDTO implements Serializable { + private static final long serialVersionUID = -6087175682515652086L; + + /** + * 问卷id, 对应pr_user_project.key + */ + private String projectKey; + + /** + * 采集数量 + */ + private Integer collectionTotal; + + //CREATE(1, "未发布"), + //RELEASE(2, "收集中"), + //STOP(3, "停止发布"); + private Integer status; + + /** + * 采集数量 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; +} + diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/RedPointResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/RedPointResultDTO.java new file mode 100644 index 0000000000..38654cfd7c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/RedPointResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dataaggre.dto.epmettduck.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/23 10:03 + */ +@Data +public class RedPointResultDTO implements Serializable { + private static final long serialVersionUID = -2230123089546481389L; + /** + * redPoint + */ + private String redPoint; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/TDuckListResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/TDuckListResultDTO.java new file mode 100644 index 0000000000..5b2346cb97 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/result/TDuckListResultDTO.java @@ -0,0 +1,114 @@ +package com.epmet.dataaggre.dto.epmettduck.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/17 10:47 上午 + * @DESC + */ +@Data +public class TDuckListResultDTO implements Serializable { + + private static final long serialVersionUID = 3624352114576287768L; + + /** + * 客户id + */ + private String customerId; + + /** + * 项目code + */ + private String key; + + /** + * 来源Id + */ + private String sourceId; + + /** + * 来源类型 + */ + private Integer sourceType; + + /** + * 项目名称 + */ + private String name; + + /** + * 项目描述 + */ + private String describe; + + /** + * 用户ID + */ + private String userId; + + /** + * 项目类型 + */ + private Integer type; + + /** + * 状态 + */ + private Integer status; + + /** + * 适用于哪个端 resi:居民端用户;gov:工作端用户;运营端用户:oper + */ + private String client; + + private String createdTime; + private String updatedTime; + + /** + * 是否填写问卷,true:是,false:否 + */ + private Boolean fillStatus; + + /** + * 是否还能填写问卷,能:true,不能:false + */ + private Boolean isFillQuestion; + + /** + * 回收状态 0:未回收;1已回收 + */ + private Integer recycled; + + /** + * 组织名 + */ + private String orgName; + + private String createdBy; + + @JsonIgnore + private Integer isEveryoneWriteOnceUid; + + public TDuckListResultDTO() { + this.customerId = ""; + this.key = ""; + this.sourceId = ""; + this.sourceType = NumConstant.ONE; + this.name = ""; + this.describe = ""; + this.userId = ""; + this.type = NumConstant.ONE; + this.status = NumConstant.ONE; + this.client = ""; + this.createdTime = ""; + this.updatedTime = ""; + this.fillStatus = false; + this.isFillQuestion = true; + this.orgName = ""; + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/struct/CascaderExpandStruct.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/struct/CascaderExpandStruct.java new file mode 100644 index 0000000000..7961fdbf5d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/struct/CascaderExpandStruct.java @@ -0,0 +1,50 @@ +package com.epmet.dataaggre.dto.epmettduck.struct; + +import lombok.Data; + +import java.util.List; + +/** + * @author : smalljop + * @description : 级联选择 + * @create : 2020-11-19 15:13 + **/ +@Data +public class CascaderExpandStruct { + /** + * 选项 + */ + private List

+ * 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.epmet.dataaggre.entity.epmettduck; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 第三方用户授权信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ac_user_authorize") +public class AcUserAuthorizeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 第三方平台类型 + */ + private Integer type; + + /** + * 平台AppId + */ + private String appId; + + /** + * 平台OpenId + */ + private String openId; + + /** + * 平台用户名 + */ + private String userName; + + /** + * 用户Id + */ + private String userId; + + /** + * 平台用户信息 + */ + private String userInfo; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/AcUserEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/AcUserEntity.java new file mode 100644 index 0000000000..3b6f74e8ab --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/AcUserEntity.java @@ -0,0 +1,97 @@ +/** + * 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.epmet.dataaggre.entity.epmettduck; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ac_user") +public class AcUserEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 姓名 + */ + private String name; + + /** + * 头像 + */ + private String avatar; + + /** + * 性别0未知 1男2女 + */ + private Integer gender; + + /** + * 邮箱 + */ + private String email; + + /** + * 手机号 + */ + private String phoneNumber; + + /** + * 密码 + */ + private String password; + + /** + * 注册渠道 + */ + private String regChannel; + + /** + * 最后登录渠道 + */ + private Integer lastLoginChannel; + + /** + * 最后登录时间 + */ + private Date lastLoginTime; + + /** + * 最后登录Ip + */ + private String lastLoginIp; + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrProjectTemplateCategoryEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrProjectTemplateCategoryEntity.java new file mode 100644 index 0000000000..c575a16456 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrProjectTemplateCategoryEntity.java @@ -0,0 +1,62 @@ +/** + * 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.epmet.dataaggre.entity.epmettduck; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目模板分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pr_project_template_category") +public class PrProjectTemplateCategoryEntity extends BaseEpmetEntity{ + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 主题名称 + */ + private String name; + + /** + * 排序 + */ + private Integer sort; + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrProjectTemplateEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrProjectTemplateEntity.java new file mode 100644 index 0000000000..6d87744261 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrProjectTemplateEntity.java @@ -0,0 +1,87 @@ +/** + * 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.epmet.dataaggre.entity.epmettduck; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pr_project_template") +public class PrProjectTemplateEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 模板唯一标识 + */ + private String key; + + /** + * 封面图 + */ + private String coverImg; + + /** + * 项目名称 + */ + private String name; + + /** + * 项目描述 + */ + private String describe; + + /** + * 喜欢数 + */ + private Integer likeCount; + + /** + * 项目类型 + */ + private String categoryId; + + /** + * 状态 + */ + private Integer status; + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrProjectTemplateItemEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrProjectTemplateItemEntity.java new file mode 100644 index 0000000000..4b109d6df9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrProjectTemplateItemEntity.java @@ -0,0 +1,116 @@ +/** + * 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.epmet.dataaggre.entity.epmettduck; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pr_project_template_item") +public class PrProjectTemplateItemEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 项目key + */ + private String projectKey; + + /** + * 表单项Id + */ + private String formItemId; + + /** + * 表单项类型 + */ + private String type; + + /** + * 表单项标题 + */ + private String label; + + /** + * 是否显示标签 + */ + private Integer showLabel; + + /** + * 表单项默认值 + */ + private String defaultValue; + + /** + * 是否必填 + */ + private Integer required; + + /** + * 输入型提示文字 + */ + private String placeholder; + + /** + * 排序 + */ + private Long sort; + + /** + * 栅格宽度 + */ + private Integer span; + + /** + * 扩展字段 表单项独有字段 + */ + private String expand; + + /** + * 正则表达式 + */ + private String regList; + + /** + * 展示类型组件 + */ + private Integer isDisplayType; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrProjectThemeEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrProjectThemeEntity.java new file mode 100644 index 0000000000..b3790a9b43 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrProjectThemeEntity.java @@ -0,0 +1,77 @@ +/** + * 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.epmet.dataaggre.entity.epmettduck; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目主题外观模板 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pr_project_theme") +public class PrProjectThemeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 主题名称 + */ + private String name; + + /** + * 主题风格 + + */ + private String style; + + /** + * 头部图片 + */ + private String headImgUrl; + + /** + * 颜色代码 + */ + private String color; + + /** + * 按钮颜色 + */ + private String btnsColor; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrPublishRangeEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrPublishRangeEntity.java new file mode 100644 index 0000000000..c69e65d3f1 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrPublishRangeEntity.java @@ -0,0 +1,71 @@ +/** + * 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.epmet.dataaggre.entity.epmettduck; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pr_publish_range") +public class PrPublishRangeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 项目key + */ + private String projectKey; + + /** + * 范围组织ids,格式与组织维度一致 冒号隔开 即选中节点的全路径id + */ + private String orgIds; + + /** + * 最后发布组织的ID + */ + private String orgId; + + /** + * 最后发布组织的类型;department,agency;grid + */ + private String orgType; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrResultExtEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrResultExtEntity.java new file mode 100644 index 0000000000..00029fd51b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrResultExtEntity.java @@ -0,0 +1,76 @@ +/** + * 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.epmet.dataaggre.entity.epmettduck; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 问卷填写附属信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pr_result_ext") +public class PrResultExtEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 姓名 + */ + private String userId; + + /** + * 结果Id + */ + private String resultId; + + /** + * 工作端小程序:gov、居民端小程序:resi、运营端:oper、其他:other + */ + private String userType; + + /** + * 在哪个组织填写的 + */ + private String fromOrgId; + + /** + * 组织:agency;部门:department;网格:grid + */ + private String fromOrgType; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectEntity.java new file mode 100644 index 0000000000..5d06a44213 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectEntity.java @@ -0,0 +1,99 @@ +/** + * 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.epmet.dataaggre.entity.epmettduck; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pr_user_project") +public class PrUserProjectEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 项目code + */ + @TableField("`key`") + private String key; + + /** + * 来源Id + */ + private String sourceId; + + /** + * 来源类型 + */ + private Integer sourceType; + + /** + * 项目名称 + */ + private String name; + + /** + * 项目描述 + */ + @TableField("`describe`") + private String describe; + + /** + * 用户ID + */ + private String userId; + + /** + * 项目类型 + */ + private Integer type; + + /** + * 状态 + */ + private Integer status; + + /** + * 适用于哪个端 resi:居民端用户;gov:工作端用户;运营端用户:oper + */ + private String client; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectItemEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectItemEntity.java new file mode 100644 index 0000000000..e3ce844e69 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectItemEntity.java @@ -0,0 +1,133 @@ +/** + * 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.epmet.dataaggre.entity.epmettduck; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import com.epmet.dataaggre.dto.epmettduck.ProjectItemTypeEnum; +import com.epmet.dataaggre.dto.epmettduck.struct.ItemDefaultValueStruct; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import lombok.experimental.FieldNameConstants; +import org.apache.ibatis.type.EnumTypeHandler; + +import java.util.List; +import java.util.Map; + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@Accessors(chain = true) +@TableName(value = "pr_user_project_item", autoResultMap = true) +@FieldNameConstants +public class PrUserProjectItemEntity extends BaseEpmetEntity{ + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 项目key + */ + private String projectKey; + + /** + * 表单项Id + */ + private String formItemId; + + /** + * 表单项类型 + */ + @TableField(typeHandler = EnumTypeHandler.class) + private ProjectItemTypeEnum type; + + /** + * 表单项标题 + */ + private String label; + + /** + * 展示类型组件 + */ + @TableField("is_display_type") + private Integer displayType; + + /** + * 是否显示标签 + */ + private Boolean showLabel; + + /** + * 表单项默认值 + */ + @TableField(value = "default_value",typeHandler = JacksonTypeHandler.class) + private ItemDefaultValueStruct defaultValue; + + /** + * 是否必填 + */ + private Boolean required; + + /** + * 输入型提示文字 + */ + private String placeholder; + + /** + * 排序 + */ + private Long sort; + + /** + * 栅格宽度 + */ + private Integer span; + + /** + * 扩展字段 表单项独有字段 + */ + @TableField(typeHandler = JacksonTypeHandler.class) + private Map expand; + + /** + * 正则表达式 + */ + @TableField(typeHandler = JacksonTypeHandler.class) + private List> regList; + + /** + * 组件类型:联系人组件:concat;输入型组件:input;图片型组件:image;辅助型组件:assist;选择性组件:choose + */ + private String moduleType; + /** + * 与type一致,手机号:phone;邮箱:email;身份证号:idCard。。。。详见数据库 + */ + private String itemKey; +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectLogicEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectLogicEntity.java new file mode 100644 index 0000000000..7c565fed9e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectLogicEntity.java @@ -0,0 +1,71 @@ +/** + * 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.epmet.dataaggre.entity.epmettduck; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目逻辑 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pr_user_project_logic") +public class PrUserProjectLogicEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 逻辑Id + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 项目key + */ + private String projectKey; + + /** + * 问题Id + */ + private String formItemId; + + /** + * 条件选项 + */ + private Integer expression; + + /** + * 条件列表 + */ + private String conditionList; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectResultEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectResultEntity.java new file mode 100644 index 0000000000..9f46a03222 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectResultEntity.java @@ -0,0 +1,116 @@ +/** + * 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.epmet.dataaggre.entity.epmettduck; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pr_user_project_result") +public class PrUserProjectResultEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 项目key + */ + private String projectKey; + + /** + * 序号 + */ + private Integer serialNumber; + + /** + * 填写结果 + */ + private String originalData; + + /** + * 填写结果 + */ + private String processData; + + /** + * 提交ua + */ + private String submitUa; + + /** + * 提交系统 + */ + private String submitOs; + + /** + * 提交浏览器 + */ + private String submitBrowser; + + /** + * 请求ip + */ + private String submitRequestIp; + + /** + * 提交地址 + */ + private String submitAddress; + + /** + * 完成时间 毫秒 + */ + private Integer completeTime; + + /** + * 用户Id + */ + private String userId; + + /** + * 微信openId + */ + private String wxOpenId; + + /** + * 微信用户信息 + */ + private String wxUserInfo; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectSettingEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectSettingEntity.java new file mode 100644 index 0000000000..d4b352e21b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectSettingEntity.java @@ -0,0 +1,161 @@ +/** + * 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.epmet.dataaggre.entity.epmettduck; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pr_user_project_setting") +public class PrUserProjectSettingEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 项目key + */ + private String projectKey; + + /** + * 提交提示图片 + */ + private String submitPromptImg; + + /** + * 提交提示文字 + */ + private String submitPromptText; + + /** + * 提交跳转连接 + */ + private String submitJumpUrl; + + /** + * 公开提交结果 + */ + private Integer isPublicResult; + + /** + * 只在微信填写 + */ + private Integer isWxWrite; + + /** + * + */ + private Integer isWxWriteOnce; + + /** + * 每人只能填写一次 + */ + private Integer isEveryoneWriteOnce; + + /** + * 每人每天只能填写一次 + */ + private Integer isEveryoneDayWriteOnce; + + /** + * 填写之后提示 + */ + private String writeOncePromptText; + + /** + * 新反馈通知邮件 + */ + private String newWriteNotifyEmail; + + /** + * 新反馈通知微信 + */ + private String newWriteNotifyWx; + + /** + * 记录微信用户个人信息 + */ + private Integer isRecordWxUser; + + /** + * 定时收集开始时间 + */ + private Date timedCollectionBeginTime; + + /** + * 定时收集结束时间 + */ + private Date timedCollectionEndTime; + + /** + * 定时未启动提示文字 + */ + private String timedNotEnabledPromptText; + + /** + * 定时停用会提示文字 + */ + private String timedDeactivatePromptText; + + /** + * 定时定量数量 + */ + private Integer timedQuantitativeQuantity; + + /** + * 定时定量完成提示 + */ + private String timedEndPromptText; + + /** + * 分享图片 + */ + private String shareImg; + + /** + * 分享标题 + */ + private String shareTitle; + + /** + * 分享描述 + */ + private String shareDesc; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectThemeEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectThemeEntity.java new file mode 100644 index 0000000000..db6d6192a8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrUserProjectThemeEntity.java @@ -0,0 +1,101 @@ +/** + * 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.epmet.dataaggre.entity.epmettduck; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pr_user_project_theme") +public class PrUserProjectThemeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 项目key + */ + private String projectKey; + + /** + * 主题Id + */ + private String themeId; + + /** + * 提交按钮文字 + */ + private String submitBtnText; + + /** + * logo图片 + */ + private String logoImg; + + /** + * logo位置 + */ + private String logoPosition; + + /** + * 背景颜色 + */ + private String backgroundColor; + + /** + * 背景图片 + */ + private String backgroundImg; + + /** + * 是否显示标题 + */ + private Integer showTitle; + + /** + * 是否显示描述语 + */ + private Integer showDescribe; + + /** + * 显示序号 + */ + private Integer showNumber; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrVistRecordEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrVistRecordEntity.java new file mode 100644 index 0000000000..61f7c117cb --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/PrVistRecordEntity.java @@ -0,0 +1,61 @@ +/** + * 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.epmet.dataaggre.entity.epmettduck; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户访问问卷记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pr_vist_record") +public class PrVistRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId(type = IdType.ID_WORKER_STR) + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 姓名 + */ + private String userId; + + /** + * 工作端小程序:gov、居民端小程序:resi、运营端:oper、其他:other + */ + private String userType; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/WxMpUserEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/WxMpUserEntity.java new file mode 100644 index 0000000000..e51905536c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmettduck/WxMpUserEntity.java @@ -0,0 +1,101 @@ +/** + * 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.epmet.dataaggre.entity.epmettduck; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 微信公众号用户 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("wx_mp_user") +public class WxMpUserEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 公众号AppId + */ + private String appid; + + /** + * 昵称 + */ + private String nickname; + + /** + * 性别 + */ + private Integer sex; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * + */ + private String unionId; + + /** + * + */ + private String openId; + + /** + * 国家 + */ + private String country; + + /** + * 省 + */ + private String province; + + /** + * 城市 + */ + private String city; + + /** + * 是否关注 + */ + private Integer isSubscribe; + + /** + * 用户Id + */ + private String userId; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java new file mode 100644 index 0000000000..821a11426f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java @@ -0,0 +1,55 @@ +package com.epmet.dataaggre.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2021/9/10 10:15 上午 + * @DESC + */ +@Data +public class CustomerDataManageExcel { + + @Excel(name = "组织") + private String orgName; + + @Excel(name = "用户数") + private Integer userCount; + + @Excel(name = "居民数") + private Integer residentCount; + + @Excel(name = "党员数") + private Integer partyMemberCount; + + @Excel(name = "小组数") + private Integer groupCount; + + @Excel(name = "话题数") + private Integer topicCount; + + @Excel(name = "议题数") + private Integer issueCount; + + @Excel(name = "项目数") + private Integer projectCount; + + @Excel(name = "结案项目数") + private Integer closedProjectCount; + + @Excel(name = "巡查人数") + private Integer patrolPeopleCount; + + @Excel(name = "巡查次数") + private Integer patrolCount; + + @Excel(name = "巡查时长") + private String patrolDuration; + + /** + * 未转换前的巡查时长 + */ + private Integer patrolDurationInteger; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/QuestionnaireService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/QuestionnaireService.java new file mode 100644 index 0000000000..c23f7f1245 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/QuestionnaireService.java @@ -0,0 +1,9 @@ +package com.epmet.dataaggre.service; + +import com.epmet.dataaggre.dto.epmettduck.result.PermissionValidateResultDTO; + +public interface QuestionnaireService { + PermissionValidateResultDTO resiPermissionValidate(String projectKey, String userId, String gridId); + + PermissionValidateResultDTO govPermissionValidate(String projectKey, String staffId, String customerId); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java index d4756648a0..36fa24c7b2 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -9,6 +9,8 @@ import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; +import javax.servlet.http.HttpServletResponse; +import java.text.ParseException; import java.util.List; /** @@ -229,4 +231,20 @@ public interface DataStatsService { * @author sun */ List getGirdMemberPatrol(GridMemberPatrolListFormDTO formDTO); + + /** + * @Description 客户数据管理导出 + * @Param formDTO + * @Param response + * @author zxc + * @date 2021/9/10 3:52 下午 + */ + void CustomerDataManage(CustomerDataManageFormDTO formDTO, HttpServletResponse response) throws Exception; + + /** + * @Description 运营情况数据查询 + * @author sun + */ + CustomerDataManageResultDTO operateExport(CustomerDataManageFormDTO formDTO) throws ParseException; + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 1002b8c34a..b175478e6e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -2,47 +2,53 @@ import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.tools.constant.NumConstant; + import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.enums.OrgLevelEnum; -import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.dataaggre.constant.DataSourceConstant; -import com.epmet.dataaggre.constant.OrgConstant; -import com.epmet.dataaggre.dao.datastats.DataStatsDao; -import com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao; -import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; -import com.epmet.dataaggre.dto.datastats.form.*; -import com.epmet.dataaggre.dto.datastats.result.*; + import com.epmet.commons.tools.exception.RenException; + import com.epmet.commons.tools.utils.DateUtils; + import com.epmet.commons.tools.utils.ExcelUtils; + import com.epmet.dataaggre.constant.DataSourceConstant; + import com.epmet.dataaggre.constant.OrgConstant; + import com.epmet.dataaggre.dao.datastats.DataStatsDao; + import com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao; + import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; + import com.epmet.dataaggre.dto.datastats.form.*; + import com.epmet.dataaggre.dto.datastats.result.*; import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult; -import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO; -import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; -import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; -import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; -import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; -import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; -import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; -import com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity; -import com.epmet.dataaggre.service.datastats.DataStatsService; -import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService; -import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; -import com.epmet.dataaggre.service.opercrm.CustomerRelation; -import com.github.pagehelper.PageHelper; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.NumberFormat; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicReference; -import java.util.stream.Collectors; + import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO; + import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO; + import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; + import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; + import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; + import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; + import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; + import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; + import com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity; + import com.epmet.dataaggre.excel.CustomerDataManageExcel; + import com.epmet.dataaggre.service.datastats.DataStatsService; + import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService; + import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; + import com.epmet.dataaggre.service.opercrm.CustomerRelation; + import com.github.pagehelper.PageHelper; + import lombok.extern.slf4j.Slf4j; + import org.apache.commons.collections4.CollectionUtils; + import org.apache.commons.lang3.StringUtils; + import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.stereotype.Service; + + import javax.servlet.http.HttpServletResponse; + import java.math.BigDecimal; + import java.math.RoundingMode; + import java.text.NumberFormat; + import java.text.ParseException; + import java.text.SimpleDateFormat; + import java.util.*; + import java.util.concurrent.atomic.AtomicInteger; + import java.util.concurrent.atomic.AtomicReference; + import java.util.stream.Collectors; /** * @Author sun @@ -1029,10 +1035,17 @@ public class DataStatsServiceImpl implements DataStatsService { @Override public PartyMemberVanguardDetailResultDTO vanguardDetail(PartyMemberVanguardFormDTO formDTO) { PartyMemberVanguardDetailResultDTO result; + if (StringUtils.isNotBlank(formDTO.getMonthId())) { + formDTO.setDateId(DateUtils.getMonthDay(formDTO.getMonthId())); + } else { + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); + } + } if (OrgConstant.AGENCY.equals(formDTO.getOrgType())) { - result = dataStatsDao.selectAgencyVanguardDetail(formDTO.getOrgId()); + result = dataStatsDao.selectAgencyVanguardDetail(formDTO.getOrgId(), formDTO.getDateId()); } else { - result = dataStatsDao.selectGridVanguardDetail(formDTO.getOrgId()); + result = dataStatsDao.selectGridVanguardDetail(formDTO.getOrgId(), formDTO.getDateId()); } if (null == result) { result = new PartyMemberVanguardDetailResultDTO(); @@ -1065,13 +1078,20 @@ public class DataStatsServiceImpl implements DataStatsService { public PartyMemberVanguardRankResultDTO vanguardRank(PartyMemberVanguardFormDTO formDTO) { //获取组织级别 DimAgencyEntity agency = dataStatsDao.getAgencyInfo(formDTO.getAgencyId()); + if (StringUtils.isNotBlank(formDTO.getMonthId())) { + formDTO.setDateId(DateUtils.getMonthDay(formDTO.getMonthId())); + } else { + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); + } + } if (null == agency) { return new PartyMemberVanguardRankResultDTO(); } //组织排行 - List agencyRank = dataStatsDao.selectAgencyVanguardRank(formDTO.getAgencyId()); + List agencyRank = dataStatsDao.selectAgencyVanguardRank(formDTO.getAgencyId(), formDTO.getDateId()); //网格排行 - List gridRank = dataStatsDao.selectGridVanguardRank(formDTO.getAgencyId()); + List gridRank = dataStatsDao.selectGridVanguardRank(formDTO.getAgencyId(), formDTO.getDateId()); PartyMemberVanguardRankResultDTO result = new PartyMemberVanguardRankResultDTO(); result.setAgencyRank(CollectionUtils.isNotEmpty(agencyRank)?agencyRank:Collections.emptyList()); result.setGridRank(CollectionUtils.isNotEmpty(gridRank)?gridRank:Collections.emptyList()); @@ -1841,4 +1861,264 @@ public class DataStatsServiceImpl implements DataStatsService { return dataStatsDao.selectGirdMemberPatrol(formDTO); } + /** + * @Description 客户数据管理导出 + * @Param formDTO + * @Param response + * @author zxc + * @date 2021/9/10 3:52 下午 + */ + @Override + public void CustomerDataManage(CustomerDataManageFormDTO formDTO, HttpServletResponse response) throws Exception { + List result = operateExport(formDTO).getList(); + if (!CollectionUtils.isEmpty(result)){ + CustomerDataManageResultDTO.CustomerDataManage c = new CustomerDataManageResultDTO.CustomerDataManage(); + c.setOrgName("合计"); + c.setUserCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getUserCount))); + c.setResidentCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getResidentCount))); + c.setPartyMemberCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getPartyMemberCount))); + c.setGroupCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getGroupCount))); + c.setTopicCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getTopicCount))); + c.setIssueCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getIssueCount))); + c.setProjectCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getProjectCount))); + c.setClosedProjectCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getClosedProjectCount))); + c.setPatrolPeopleCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getPatrolPeopleCount))); + c.setPatrolCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getPatrolCount))); + c.setPatrolDurationInteger(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getPatrolDurationInteger))); + c.setPatrolDuration(getHm(c.getPatrolDurationInteger())); + result.add(c); + } + String fileName = excelName(formDTO); + ExcelUtils.exportExcelToTargetDisposeAll(response,fileName,result, CustomerDataManageExcel.class); + } + + /** + * @Description 秒转换时分 + * @Param seconds + * @author zxc + * @date 2021/9/13 10:03 上午 + */ + public String getHm(Integer seconds){ + String result = "0分钟"; + if (seconds >= NumConstant.SIXTY) { + Integer hours = seconds / 3600; + Integer minutes = seconds % 3600 / 60; + result = (hours < NumConstant.ONE ? "" : hours + "小时") + (minutes < NumConstant.ONE ? "" : minutes + "分钟"); + }else if (seconds < NumConstant.SIXTY && seconds > NumConstant.ZERO){ + result = "1分钟"; + } + return result; + } + + /** + * @Description 表头获取 + * @Param formDTO + * @author zxc + * @date 2021/9/13 10:02 上午 + */ + public String excelName(CustomerDataManageFormDTO formDTO){ + StringBuffer s = new StringBuffer(); + String agencyName = indexService.selectAgencyNameByAgencyId(formDTO.getAgencyId()); + s.append(agencyName); + if (StringUtils.isNotBlank(formDTO.getStartTime())){ + String startTime = formDTO.getStartTime(); + String sYear = startTime.substring(0, 4); + String sMonth = startTime.substring(4, 6); + String sDay = startTime.substring(6, 8); + String endTime = formDTO.getEndTime(); + String eYear = endTime.substring(0, 4); + String eMonth = endTime.substring(4, 6); + String eDay = endTime.substring(6, 8); + s.append(sYear).append("年").append(sMonth).append("月").append(sDay).append("日-") + .append(eYear).append("年").append(eMonth).append("月").append(eDay).append("日区间新增值"); + }else { + String endTime = formDTO.getEndTime(); + String eYear = endTime.substring(0, 4); + String eMonth = endTime.substring(4, 6); + String eDay = endTime.substring(6, 8); + s.append(eYear).append("年").append(eMonth).append("月").append(eDay).append("日截止累计值"); + } + return s.toString(); + } + + /** + * @Param formDTO + * @Description 运营情况数据查询 + * @author sun + */ + @Override + public CustomerDataManageResultDTO operateExport(CustomerDataManageFormDTO formDTO) throws ParseException { + CustomerDataManageResultDTO resultDTO = new CustomerDataManageResultDTO(); + List dataManageList = new ArrayList<>(); + //1.必要参数校验及处理 + if ("Interval".equals(formDTO.getType()) && StringUtils.isEmpty(formDTO.getStartTime())) { + throw new RenException("请选择开始时间或查询累计值"); + } + //入参有开始时间的则需要减去一天 + if (StringUtils.isNotBlank(formDTO.getStartTime())) { + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + Date date = format.parse(formDTO.getStartTime()); + Date yesterday = DateUtils.addDateDays(date, -1); + formDTO.setStartTime(format.format(yesterday)); + } + + //2.查询组织信息,判断查询下级组织还是网格数据 + ScreenAgencyOrGridListDTO agencyGrid = indexService.getSubAgencyOrGridList(formDTO.getAgencyId()); + if (null == agencyGrid) { + return new CustomerDataManageResultDTO(); + } + //组织或网格Id集合 + List idList = agencyGrid.getAgencyGridList().stream().map(ScreenAgencyOrGridListDTO.AgencyGrid::getOrgId).collect(Collectors.toList()); + formDTO.setDataType(!"community".equals(agencyGrid.getLevel()) ? "agency" : "grid"); + formDTO.setIdList(idList); + resultDTO.setTotal(idList.size()); + + //3.查询截止日期用户、群组、话题、议题、项目、巡查数据 + formDTO.setSourceType("end"); + List userEnd = dataStatsDao.regUserList(formDTO); + HashMap uEndMap = new HashMap<>(); + userEnd.stream().forEach(u->uEndMap.put(u.getOrgId(),u)); + List groupEnd = dataStatsDao.groupList(formDTO); + HashMap gEndMap = new HashMap<>(); + groupEnd.stream().forEach(u->gEndMap.put(u.getOrgId(),u)); + List topicEnd = dataStatsDao.topicList(formDTO); + HashMap tEndMap = new HashMap<>(); + topicEnd.stream().forEach(u->tEndMap.put(u.getOrgId(),u)); + List issueEnd = dataStatsDao.issueList(formDTO); + HashMap iEndMap = new HashMap<>(); + issueEnd.stream().forEach(u->iEndMap.put(u.getOrgId(),u)); + List projectEnd = dataStatsDao.projectList(formDTO); + HashMap pEndMap = new HashMap<>(); + projectEnd.stream().forEach(u->pEndMap.put(u.getOrgId(),u)); + //巡查数据不区分区间差值,只计算累计值,人员做去重处理且是有巡查记录的人员 + List patrolEnd = statsStaffPatrolRecordDailyService.patrolList(formDTO); + + //4.判断是否需要查询起始日期用户、群组、话题、议题、项目、巡查数据 + HashMap uStartMap = new HashMap<>(); + HashMap gStartMap = new HashMap<>(); + HashMap tStartMap = new HashMap<>(); + HashMap iStartMap = new HashMap<>(); + HashMap pStartMap = new HashMap<>(); + if ("Interval".equals(formDTO.getType())) { + formDTO.setSourceType("start"); + List userStart = dataStatsDao.regUserList(formDTO); + userStart.stream().forEach(u->uStartMap.put(u.getOrgId(),u)); + List groupStart = dataStatsDao.groupList(formDTO); + groupStart.stream().forEach(u->gStartMap.put(u.getOrgId(),u)); + List topicStart = dataStatsDao.topicList(formDTO); + topicStart.stream().forEach(u->tStartMap.put(u.getOrgId(),u)); + List issueStart = dataStatsDao.issueList(formDTO); + issueStart.stream().forEach(u->iStartMap.put(u.getOrgId(),u)); + List projectStart = dataStatsDao.projectList(formDTO); + projectStart.stream().forEach(u->pStartMap.put(u.getOrgId(),u)); + } + + //5.封装数据 + agencyGrid.getAgencyGridList().forEach(org -> { + CustomerDataManageResultDTO.CustomerDataManage dto = new CustomerDataManageResultDTO.CustomerDataManage(); + dto.setOrgId(org.getOrgId()); + dto.setOrgName(org.getOrgName()); + int user = 0; + int resi = 0; + int part = 0; + if(uEndMap.containsKey(org.getOrgId())){ + user = uEndMap.get(org.getOrgId()).getUserCount(); + resi = uEndMap.get(org.getOrgId()).getResidentCount(); + part = uEndMap.get(org.getOrgId()).getPartyMemberCount(); + if ("Interval".equals(formDTO.getType())&&uStartMap.containsKey(org.getOrgId())) { + user = user - uStartMap.get(org.getOrgId()).getUserCount(); + resi = resi - uStartMap.get(org.getOrgId()).getResidentCount(); + part = part - uStartMap.get(org.getOrgId()).getPartyMemberCount(); + } + } + int group = 0; + if(gEndMap.containsKey(org.getOrgId())){ + group = gEndMap.get(org.getOrgId()).getGroupCount(); + if ("Interval".equals(formDTO.getType())&&gStartMap.containsKey(org.getOrgId())) { + group = group - gStartMap.get(org.getOrgId()).getGroupCount(); + } + } + int topic = 0; + if(tEndMap.containsKey(org.getOrgId())){ + topic = tEndMap.get(org.getOrgId()).getTopicCount(); + if ("Interval".equals(formDTO.getType())&&tStartMap.containsKey(org.getOrgId())) { + topic = topic - tStartMap.get(org.getOrgId()).getTopicCount(); + } + } + int issue = 0; + if(iEndMap.containsKey(org.getOrgId())){ + issue = iEndMap.get(org.getOrgId()).getIssueCount(); + if ("Interval".equals(formDTO.getType())&&iStartMap.containsKey(org.getOrgId())) { + issue = issue - iStartMap.get(org.getOrgId()).getIssueCount(); + } + } + int project = 0; + int closed = 0; + if(pEndMap.containsKey(org.getOrgId())){ + project = pEndMap.get(org.getOrgId()).getProjectCount(); + closed = pEndMap.get(org.getOrgId()).getClosedProjectCount(); + if ("Interval".equals(formDTO.getType())&&pStartMap.containsKey(org.getOrgId())) { + project = project - pStartMap.get(org.getOrgId()).getProjectCount(); + closed = closed - pStartMap.get(org.getOrgId()).getClosedProjectCount(); + } + } + int patro = 0; + int patroCount = 0; + String patrolDuration = ""; + int patrolDurationInteger = 0; + HashSet set = new HashSet(); + for (CustomerDataManageResultDTO.CustomerDataManage u : patrolEnd) { + if ("community".equals(agencyGrid.getLevel()) && org.getOrgId().equals(u.getOrgId())) { + patroCount += u.getPatrolCount(); + patrolDurationInteger += u.getPatrolDurationInteger(); + set.add(u.getStaffId()); + } + if (!"community".equals(agencyGrid.getLevel()) && u.getOrgId().contains(org.getOrgId())) { + patroCount += u.getPatrolCount(); + patrolDurationInteger += u.getPatrolDurationInteger(); + set.add(u.getStaffId()); + } + + } + patro = set.size(); + Integer minutes = patrolDurationInteger / 60; + patrolDuration = (minutes / 60 > 0 ? minutes / 60 + "小时" : "") + (minutes % 60 > 0 ? minutes % 60 + "分钟" : "0分钟"); + + dto.setUserCount(user); + dto.setResidentCount(resi); + dto.setPartyMemberCount(part); + dto.setGroupCount(group); + dto.setTopicCount(topic); + dto.setIssueCount(issue); + dto.setProjectCount(project); + dto.setClosedProjectCount(closed); + dto.setPatrolPeopleCount(patro); + dto.setPatrolCount(patroCount); + dto.setPatrolDuration(patrolDuration); + dto.setPatrolDurationInteger(patrolDurationInteger); + + dataManageList.add(dto); + }); + + //6.默认按用户总数降序 + Collections.sort(dataManageList, new Comparator() { + @Override + public int compare(CustomerDataManageResultDTO.CustomerDataManage o1, CustomerDataManageResultDTO.CustomerDataManage o2) { + return o2.getUserCount().compareTo(o1.getUserCount()); + } + }); + + //7.物理分页并返回 + if (formDTO.getIsPage()) { + int firstIndex = (formDTO.getPageNo() - 1) * formDTO.getPageSize(); + int lastIndex = formDTO.getPageNo() * formDTO.getPageSize(); + List list = dataManageList.subList((firstIndex > dataManageList.size() ? dataManageList.size() : firstIndex), (lastIndex > dataManageList.size() ? dataManageList.size() : lastIndex)); + resultDTO.setList(list); + return resultDTO; + } + resultDTO.setList(dataManageList); + return resultDTO; + } + + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/AcUserAuthorizeService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/AcUserAuthorizeService.java new file mode 100644 index 0000000000..84b2002e8a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/AcUserAuthorizeService.java @@ -0,0 +1,78 @@ +package com.epmet.dataaggre.service.epmettduck; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.dto.epmettduck.AcUserAuthorizeDTO; +import com.epmet.dataaggre.entity.epmettduck.AcUserAuthorizeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 第三方用户授权信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +public interface AcUserAuthorizeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return AcUserAuthorizeDTO + * @author generator + * @date 2021-09-15 + */ + AcUserAuthorizeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void save(AcUserAuthorizeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void update(AcUserAuthorizeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-15 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/AcUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/AcUserService.java new file mode 100644 index 0000000000..3ab7e664e9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/AcUserService.java @@ -0,0 +1,78 @@ +package com.epmet.dataaggre.service.epmettduck; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.dto.epmettduck.AcUserDTO; +import com.epmet.dataaggre.entity.epmettduck.AcUserEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +public interface AcUserService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return AcUserDTO + * @author generator + * @date 2021-09-15 + */ + AcUserDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void save(AcUserDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void update(AcUserDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-15 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrProjectTemplateCategoryService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrProjectTemplateCategoryService.java new file mode 100644 index 0000000000..360af280e9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrProjectTemplateCategoryService.java @@ -0,0 +1,14 @@ +package com.epmet.dataaggre.service.epmettduck; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dataaggre.entity.epmettduck.PrProjectTemplateCategoryEntity; + +/** + * 项目模板分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +public interface PrProjectTemplateCategoryService { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrProjectTemplateItemService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrProjectTemplateItemService.java new file mode 100644 index 0000000000..26803febd3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrProjectTemplateItemService.java @@ -0,0 +1,95 @@ +/** + * 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.epmet.dataaggre.service.epmettduck; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.dto.epmettduck.PrProjectTemplateItemDTO; +import com.epmet.dataaggre.entity.epmettduck.PrProjectTemplateItemEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +public interface PrProjectTemplateItemService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PrProjectTemplateItemDTO + * @author generator + * @date 2021-09-15 + */ + PrProjectTemplateItemDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void save(PrProjectTemplateItemDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void update(PrProjectTemplateItemDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-15 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrProjectTemplateService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrProjectTemplateService.java new file mode 100644 index 0000000000..52b6f23deb --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrProjectTemplateService.java @@ -0,0 +1,95 @@ +/** + * 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.epmet.dataaggre.service.epmettduck; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.dto.epmettduck.PrProjectTemplateDTO; +import com.epmet.dataaggre.entity.epmettduck.PrProjectTemplateEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +public interface PrProjectTemplateService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PrProjectTemplateDTO + * @author generator + * @date 2021-09-15 + */ + PrProjectTemplateDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void save(PrProjectTemplateDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void update(PrProjectTemplateDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-15 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrProjectThemeService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrProjectThemeService.java new file mode 100644 index 0000000000..5144ceb67a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrProjectThemeService.java @@ -0,0 +1,95 @@ +/** + * 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.epmet.dataaggre.service.epmettduck; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.dto.epmettduck.PrProjectThemeDTO; +import com.epmet.dataaggre.entity.epmettduck.PrProjectThemeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目主题外观模板 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +public interface PrProjectThemeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PrProjectThemeDTO + * @author generator + * @date 2021-09-15 + */ + PrProjectThemeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void save(PrProjectThemeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void update(PrProjectThemeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-15 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrPublishRangeService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrPublishRangeService.java new file mode 100644 index 0000000000..66a2dbb79e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrPublishRangeService.java @@ -0,0 +1,123 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.service.epmettduck; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.dto.epmettduck.PrPublishRangeDTO; +import com.epmet.dataaggre.entity.epmettduck.PrPublishRangeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +public interface PrPublishRangeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PrPublishRangeDTO + * @author generator + * @date 2021-09-15 + */ + PrPublishRangeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void save(PrPublishRangeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void update(PrPublishRangeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-15 + */ + void delete(String[] ids); + + /** + * @Description 发布范围组织列表 + * @Param projectKey + * @Return {@link List< String>} + * @Author zhaoqifeng + * @Date 2021/9/18 15:28 + */ + List getRangeOrgList(String projectKey); + + /** + * @description 使用projectKey查询发布范围entity + * + * @param projectKey + * @return + * @author wxz + * @date 2021.09.23 23:04:23 + */ + List getPublishRangeEntity(String projectKey); + + /** + * @Description 获取组织范围内的问卷 + * @Param orgList + * @Return {@link List< PrPublishRangeDTO>} + * @Author zhaoqifeng + * @Date 2021/9/23 10:27 + */ + List getListByOrg(List orgList); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrResultExtService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrResultExtService.java new file mode 100644 index 0000000000..98f7e0b713 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrResultExtService.java @@ -0,0 +1,95 @@ +/** + * 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.epmet.dataaggre.service.epmettduck; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.dto.epmettduck.PrResultExtDTO; +import com.epmet.dataaggre.entity.epmettduck.PrResultExtEntity; + +import java.util.List; +import java.util.Map; + +/** + * 问卷填写附属信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +public interface PrResultExtService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PrResultExtDTO + * @author generator + * @date 2021-09-15 + */ + PrResultExtDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void save(PrResultExtDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void update(PrResultExtDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-15 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectItemService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectItemService.java new file mode 100644 index 0000000000..74d1ddd332 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectItemService.java @@ -0,0 +1,28 @@ +package com.epmet.dataaggre.service.epmettduck; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.dto.epmettduck.PrUserProjectItemDTO; +import com.epmet.dataaggre.dto.epmettduck.form.TDuckDetailFormDTO; +import com.epmet.dataaggre.entity.epmettduck.PrUserProjectItemEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +public interface PrUserProjectItemService extends IService { + + /** + * @Description 问卷调查详情 + * @Param formDTO + * @author zxc + * @date 2021/9/16 2:51 下午 + */ + List queryProjectItem(TDuckDetailFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectLogicService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectLogicService.java new file mode 100644 index 0000000000..5440d9a334 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectLogicService.java @@ -0,0 +1,95 @@ +/** + * 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.epmet.dataaggre.service.epmettduck; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.dto.epmettduck.PrUserProjectLogicDTO; +import com.epmet.dataaggre.entity.epmettduck.PrUserProjectLogicEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目逻辑 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +public interface PrUserProjectLogicService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PrUserProjectLogicDTO + * @author generator + * @date 2021-09-15 + */ + PrUserProjectLogicDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void save(PrUserProjectLogicDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void update(PrUserProjectLogicDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-15 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectResultService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectResultService.java new file mode 100644 index 0000000000..aaa8a131e6 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectResultService.java @@ -0,0 +1,95 @@ +/** + * 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.epmet.dataaggre.service.epmettduck; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.dto.epmettduck.PrUserProjectResultDTO; +import com.epmet.dataaggre.entity.epmettduck.PrUserProjectResultEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +public interface PrUserProjectResultService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PrUserProjectResultDTO + * @author generator + * @date 2021-09-15 + */ + PrUserProjectResultDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void save(PrUserProjectResultDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void update(PrUserProjectResultDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-15 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectService.java new file mode 100644 index 0000000000..93e437a043 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectService.java @@ -0,0 +1,187 @@ +/** + * 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.epmet.dataaggre.service.epmettduck; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dataaggre.dto.epmettduck.PrUserProjectDTO; +import com.epmet.dataaggre.dto.epmettduck.form.ItemResDetailFormDTO; +import com.epmet.dataaggre.dto.epmettduck.form.ProjectKeyCommonDTO; +import com.epmet.dataaggre.dto.epmettduck.form.TDuckHeaderInfoFormDTO; +import com.epmet.dataaggre.dto.epmettduck.form.TDuckListFormDTO; +import com.epmet.dataaggre.dto.epmettduck.result.*; +import com.epmet.dataaggre.entity.epmettduck.PrUserProjectEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +public interface PrUserProjectService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PrUserProjectDTO + * @author generator + * @date 2021-09-15 + */ + PrUserProjectDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void save(PrUserProjectDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void update(PrUserProjectDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-15 + */ + void delete(String[] ids); + + /** + * 问卷概要 + * + * @param projectKey + * @return com.epmet.dataaggre.dto.epmettduck.result.ProjectProfileResultDTO + * @author yinzuomei + * @date 2021/9/16 2:54 下午 + */ + ProjectProfileResultDTO queryProjectProfile(String projectKey); + + /** + * @Description 问卷调查列表 + * @Param formDTO + * @author zxc + * @date 2021/9/18 10:29 上午 + */ + List queryProjectList(TDuckListFormDTO formDTO); + + /** + * 分析报告 + * + * @param projectKey + * @return com.epmet.dataaggre.dto.epmettduck.result.AnalysisReportResDTO + * @author yinzuomei + * @date 2021/9/16 5:57 下午 + */ + List queryAnalysisReport(String projectKey); + + /** + * @Description 查询问卷调查的头部信息 + * @Param formDTO + * @author zxc + * @date 2021/9/18 10:35 上午 + */ + PrUserProjectEntity headerInfo(TDuckHeaderInfoFormDTO formDTO); + + /** + * @Description 获取发布范围 + * @Param projectKey + * @Return {@link GetRangeResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/18 15:18 + */ + GetRangeResultDTO getRange(String projectKey); + + /** + * 查看详情 + * 1、联系人组件统一用一个统计显示多少条,点击查看更多显示汇总列表,如有非必填项没有填写显示空(手机号验证不需要统计) + * 2、单行文本、多行文本、时间选择、时间范围、日期选择、日期范围,统计填写人数,点击查看列表 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/9/22 1:37 下午 + */ + List queryItemResDetail(ItemResDetailFormDTO formDTO); + + /** + * 联系人组件 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.epmettduck.result.ItemResDetailConcatResultDTO + * @author yinzuomei + * @date 2021/9/22 2:57 下午 + */ + ItemResDetailConcatResultDTO queryItemResDetailConcat(ProjectKeyCommonDTO formDTO); + + /** + * 有新的问卷显示小红点 + * @Param tokenDto + * @Return {@link RedPointResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/23 10:05 + */ + RedPointResultDTO redPoint(TokenDto tokenDto); + + /** + * @description 根据key查询问卷 + * + * @param key + * @return + * @author wxz + * @date 2021.09.23 22:25:57 + */ + PrUserProjectEntity getProjectEntityBykey(String key); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectSettingService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectSettingService.java new file mode 100644 index 0000000000..67111d9eb4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectSettingService.java @@ -0,0 +1,78 @@ +package com.epmet.dataaggre.service.epmettduck; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.dto.epmettduck.PrUserProjectSettingDTO; +import com.epmet.dataaggre.entity.epmettduck.PrUserProjectSettingEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +public interface PrUserProjectSettingService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PrUserProjectSettingDTO + * @author generator + * @date 2021-09-15 + */ + PrUserProjectSettingDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void save(PrUserProjectSettingDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void update(PrUserProjectSettingDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-15 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectThemeService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectThemeService.java new file mode 100644 index 0000000000..48fc3f1d63 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectThemeService.java @@ -0,0 +1,95 @@ +/** + * 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.epmet.dataaggre.service.epmettduck; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.dto.epmettduck.PrUserProjectThemeDTO; +import com.epmet.dataaggre.entity.epmettduck.PrUserProjectThemeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +public interface PrUserProjectThemeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PrUserProjectThemeDTO + * @author generator + * @date 2021-09-15 + */ + PrUserProjectThemeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void save(PrUserProjectThemeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void update(PrUserProjectThemeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-15 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrVistRecordService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrVistRecordService.java new file mode 100644 index 0000000000..e505cf6995 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrVistRecordService.java @@ -0,0 +1,110 @@ +/** + * 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.epmet.dataaggre.service.epmettduck; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.dto.epmettduck.PrVistRecordDTO; +import com.epmet.dataaggre.entity.epmettduck.PrVistRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户访问问卷记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +public interface PrVistRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PrVistRecordDTO + * @author generator + * @date 2021-09-15 + */ + PrVistRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void save(PrVistRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void update(PrVistRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-15 + */ + void delete(String[] ids); + + /** + * @Description 获取最新访问记录 + * @Param staffId + * @Return {@link PrVistRecordDTO} + * @Author zhaoqifeng + * @Date 2021/9/23 14:16 + */ + PrVistRecordDTO getNewestRecord(String staffId); + + /** + * desc:插入或更新记录 + * @param param + */ + void insertOrUpdate(PrVistRecordDTO param); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/WxMpUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/WxMpUserService.java new file mode 100644 index 0000000000..b65983748c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/WxMpUserService.java @@ -0,0 +1,95 @@ +/** + * 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.epmet.dataaggre.service.epmettduck; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.dto.epmettduck.WxMpUserDTO; +import com.epmet.dataaggre.entity.epmettduck.WxMpUserEntity; + +import java.util.List; +import java.util.Map; + +/** + * 微信公众号用户 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +public interface WxMpUserService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return WxMpUserDTO + * @author generator + * @date 2021-09-15 + */ + WxMpUserDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void save(WxMpUserDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-15 + */ + void update(WxMpUserDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-15 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/AcUserAuthorizeServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/AcUserAuthorizeServiceImpl.java new file mode 100644 index 0000000000..2887bd8ecf --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/AcUserAuthorizeServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.epmet.dataaggre.service.epmettduck.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmettduck.AcUserAuthorizeDao; +import com.epmet.dataaggre.dto.epmettduck.AcUserAuthorizeDTO; +import com.epmet.dataaggre.entity.epmettduck.AcUserAuthorizeEntity; +import com.epmet.dataaggre.service.epmettduck.AcUserAuthorizeService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 第三方用户授权信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Slf4j +@DataSource(DataSourceConstant.EPMETTDUCK) +@Service +public class AcUserAuthorizeServiceImpl extends BaseServiceImpl implements AcUserAuthorizeService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, AcUserAuthorizeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, AcUserAuthorizeDTO.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 AcUserAuthorizeDTO get(String id) { + AcUserAuthorizeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, AcUserAuthorizeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(AcUserAuthorizeDTO dto) { + AcUserAuthorizeEntity entity = ConvertUtils.sourceToTarget(dto, AcUserAuthorizeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(AcUserAuthorizeDTO dto) { + AcUserAuthorizeEntity entity = ConvertUtils.sourceToTarget(dto, AcUserAuthorizeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/AcUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/AcUserServiceImpl.java new file mode 100644 index 0000000000..c53ce7da8e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/AcUserServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.epmet.dataaggre.service.epmettduck.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmettduck.AcUserDao; +import com.epmet.dataaggre.dto.epmettduck.AcUserDTO; +import com.epmet.dataaggre.entity.epmettduck.AcUserEntity; +import com.epmet.dataaggre.service.epmettduck.AcUserService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 用户 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Slf4j +@DataSource(DataSourceConstant.EPMETTDUCK) +@Service +public class AcUserServiceImpl extends BaseServiceImpl implements AcUserService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, AcUserDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, AcUserDTO.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 AcUserDTO get(String id) { + AcUserEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, AcUserDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(AcUserDTO dto) { + AcUserEntity entity = ConvertUtils.sourceToTarget(dto, AcUserEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(AcUserDTO dto) { + AcUserEntity entity = ConvertUtils.sourceToTarget(dto, AcUserEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateCategoryServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateCategoryServiceImpl.java new file mode 100644 index 0000000000..bf82320282 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateCategoryServiceImpl.java @@ -0,0 +1,37 @@ +/** + * 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.epmet.dataaggre.service.epmettduck.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.service.epmettduck.PrProjectTemplateCategoryService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 项目模板分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Slf4j +@DataSource(DataSourceConstant.EPMETTDUCK) +@Service +public class PrProjectTemplateCategoryServiceImpl implements PrProjectTemplateCategoryService { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateItemServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateItemServiceImpl.java new file mode 100644 index 0000000000..a903234d27 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateItemServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.epmet.dataaggre.service.epmettduck.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmettduck.PrProjectTemplateItemDao; +import com.epmet.dataaggre.dto.epmettduck.PrProjectTemplateItemDTO; +import com.epmet.dataaggre.entity.epmettduck.PrProjectTemplateItemEntity; +import com.epmet.dataaggre.service.epmettduck.PrProjectTemplateItemService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Slf4j +@DataSource(DataSourceConstant.EPMETTDUCK) +@Service +public class PrProjectTemplateItemServiceImpl extends BaseServiceImpl implements PrProjectTemplateItemService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PrProjectTemplateItemDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PrProjectTemplateItemDTO.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 PrProjectTemplateItemDTO get(String id) { + PrProjectTemplateItemEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PrProjectTemplateItemDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PrProjectTemplateItemDTO dto) { + PrProjectTemplateItemEntity entity = ConvertUtils.sourceToTarget(dto, PrProjectTemplateItemEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PrProjectTemplateItemDTO dto) { + PrProjectTemplateItemEntity entity = ConvertUtils.sourceToTarget(dto, PrProjectTemplateItemEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateServiceImpl.java new file mode 100644 index 0000000000..29eabe1520 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectTemplateServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.epmet.dataaggre.service.epmettduck.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmettduck.PrProjectTemplateDao; +import com.epmet.dataaggre.dto.epmettduck.PrProjectTemplateDTO; +import com.epmet.dataaggre.entity.epmettduck.PrProjectTemplateEntity; +import com.epmet.dataaggre.service.epmettduck.PrProjectTemplateService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Slf4j +@DataSource(DataSourceConstant.EPMETTDUCK) +@Service +public class PrProjectTemplateServiceImpl extends BaseServiceImpl implements PrProjectTemplateService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PrProjectTemplateDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PrProjectTemplateDTO.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 PrProjectTemplateDTO get(String id) { + PrProjectTemplateEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PrProjectTemplateDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PrProjectTemplateDTO dto) { + PrProjectTemplateEntity entity = ConvertUtils.sourceToTarget(dto, PrProjectTemplateEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PrProjectTemplateDTO dto) { + PrProjectTemplateEntity entity = ConvertUtils.sourceToTarget(dto, PrProjectTemplateEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectThemeServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectThemeServiceImpl.java new file mode 100644 index 0000000000..07345640c1 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrProjectThemeServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.epmet.dataaggre.service.epmettduck.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmettduck.PrProjectThemeDao; +import com.epmet.dataaggre.dto.epmettduck.PrProjectThemeDTO; +import com.epmet.dataaggre.entity.epmettduck.PrProjectThemeEntity; +import com.epmet.dataaggre.service.epmettduck.PrProjectThemeService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目主题外观模板 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Slf4j +@DataSource(DataSourceConstant.EPMETTDUCK) +@Service +public class PrProjectThemeServiceImpl extends BaseServiceImpl implements PrProjectThemeService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PrProjectThemeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PrProjectThemeDTO.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 PrProjectThemeDTO get(String id) { + PrProjectThemeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PrProjectThemeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PrProjectThemeDTO dto) { + PrProjectThemeEntity entity = ConvertUtils.sourceToTarget(dto, PrProjectThemeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PrProjectThemeDTO dto) { + PrProjectThemeEntity entity = ConvertUtils.sourceToTarget(dto, PrProjectThemeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrPublishRangeServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrPublishRangeServiceImpl.java new file mode 100644 index 0000000000..6865f8764e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrPublishRangeServiceImpl.java @@ -0,0 +1,160 @@ +/** + * 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.epmet.dataaggre.service.epmettduck.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmettduck.PrPublishRangeDao; +import com.epmet.dataaggre.dto.epmettduck.PrPublishRangeDTO; +import com.epmet.dataaggre.entity.epmettduck.PrPublishRangeEntity; +import com.epmet.dataaggre.service.epmettduck.PrPublishRangeService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 项目发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Slf4j +@DataSource(DataSourceConstant.EPMETTDUCK) +@Service +public class PrPublishRangeServiceImpl extends BaseServiceImpl implements PrPublishRangeService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PrPublishRangeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PrPublishRangeDTO.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 PrPublishRangeDTO get(String id) { + PrPublishRangeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PrPublishRangeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PrPublishRangeDTO dto) { + PrPublishRangeEntity entity = ConvertUtils.sourceToTarget(dto, PrPublishRangeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PrPublishRangeDTO dto) { + PrPublishRangeEntity entity = ConvertUtils.sourceToTarget(dto, PrPublishRangeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param projectKey + * @Description 发布范围组织列表 + * @Param projectKey + * @Return {@link List< String>} + * @Author zhaoqifeng + * @Date 2021/9/18 15:28 + */ + @Override + public List getRangeOrgList(String projectKey) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(PrPublishRangeEntity::getProjectKey, projectKey); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(PrPublishRangeEntity::getOrgId).collect(Collectors.toList()); + } + + @Override + public List getPublishRangeEntity(String projectKey) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(PrPublishRangeEntity::getProjectKey, projectKey); + return baseDao.selectList(wrapper); + } + + /** + * @param orgList + * @Description 获取组织范围内的问卷 + * @Param orgList + * @Return {@link List< PrPublishRangeDTO>} + * @Author zhaoqifeng + * @Date 2021/9/23 10:27 + */ + @Override + public List getListByOrg(List orgList) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.and(w -> { + for (int i = 0; i < orgList.size(); i++) { + if (NumConstant.ZERO == i) { + w.like(PrPublishRangeEntity :: getOrgId, orgList.get(i)); + } else { + w.or().like(PrPublishRangeEntity :: getOrgId, orgList.get(i)); + } + } + }); + wrapper.orderByDesc(PrPublishRangeEntity::getCreatedTime); + List list = baseDao.selectList(wrapper); + return ConvertUtils.sourceToTarget(list, PrPublishRangeDTO.class); + } + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrResultExtServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrResultExtServiceImpl.java new file mode 100644 index 0000000000..00bff5e49e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrResultExtServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.epmet.dataaggre.service.epmettduck.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmettduck.PrResultExtDao; +import com.epmet.dataaggre.dto.epmettduck.PrResultExtDTO; +import com.epmet.dataaggre.entity.epmettduck.PrResultExtEntity; +import com.epmet.dataaggre.service.epmettduck.PrResultExtService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 问卷填写附属信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Slf4j +@DataSource(DataSourceConstant.EPMETTDUCK) +@Service +public class PrResultExtServiceImpl extends BaseServiceImpl implements PrResultExtService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PrResultExtDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PrResultExtDTO.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 PrResultExtDTO get(String id) { + PrResultExtEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PrResultExtDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PrResultExtDTO dto) { + PrResultExtEntity entity = ConvertUtils.sourceToTarget(dto, PrResultExtEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PrResultExtDTO dto) { + PrResultExtEntity entity = ConvertUtils.sourceToTarget(dto, PrResultExtEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectItemServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectItemServiceImpl.java new file mode 100644 index 0000000000..3078d9221c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectItemServiceImpl.java @@ -0,0 +1,64 @@ +/** + * 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.epmet.dataaggre.service.epmettduck.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmettduck.PrUserProjectItemDao; +import com.epmet.dataaggre.dto.epmettduck.form.TDuckDetailFormDTO; +import com.epmet.dataaggre.entity.epmettduck.PrUserProjectItemEntity; +import com.epmet.dataaggre.service.epmettduck.PrUserProjectItemService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EPMET_T_DUCK) +public class PrUserProjectItemServiceImpl extends ServiceImpl implements PrUserProjectItemService { + + /** + * @Description 问卷调查详情 + * @Param formDTO + * @author zxc + * @date 2021/9/16 2:51 下午 + */ + @Override + public List queryProjectItem(TDuckDetailFormDTO formDTO) { + List itemEntityList = list(Wrappers.lambdaQuery() + .eq(PrUserProjectItemEntity::getProjectKey, formDTO.getKey()) + .eq(PrUserProjectItemEntity::getDisplayType,formDTO.getDisplayType()) + .orderByAsc(PrUserProjectItemEntity::getSort) + ); + if (CollectionUtils.isEmpty(itemEntityList)){ + return new ArrayList<>(); + } + return itemEntityList; + } +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectLogicServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectLogicServiceImpl.java new file mode 100644 index 0000000000..052d9252a6 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectLogicServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.epmet.dataaggre.service.epmettduck.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmettduck.PrUserProjectLogicDao; +import com.epmet.dataaggre.dto.epmettduck.PrUserProjectLogicDTO; +import com.epmet.dataaggre.entity.epmettduck.PrUserProjectLogicEntity; +import com.epmet.dataaggre.service.epmettduck.PrUserProjectLogicService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目逻辑 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Slf4j +@DataSource(DataSourceConstant.EPMETTDUCK) +@Service +public class PrUserProjectLogicServiceImpl extends BaseServiceImpl implements PrUserProjectLogicService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PrUserProjectLogicDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PrUserProjectLogicDTO.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 PrUserProjectLogicDTO get(String id) { + PrUserProjectLogicEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PrUserProjectLogicDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PrUserProjectLogicDTO dto) { + PrUserProjectLogicEntity entity = ConvertUtils.sourceToTarget(dto, PrUserProjectLogicEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PrUserProjectLogicDTO dto) { + PrUserProjectLogicEntity entity = ConvertUtils.sourceToTarget(dto, PrUserProjectLogicEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectResultServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectResultServiceImpl.java new file mode 100644 index 0000000000..884b2f2384 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectResultServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.epmet.dataaggre.service.epmettduck.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmettduck.PrUserProjectResultDao; +import com.epmet.dataaggre.dto.epmettduck.PrUserProjectResultDTO; +import com.epmet.dataaggre.entity.epmettduck.PrUserProjectResultEntity; +import com.epmet.dataaggre.service.epmettduck.PrUserProjectResultService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Slf4j +@DataSource(DataSourceConstant.EPMETTDUCK) +@Service +public class PrUserProjectResultServiceImpl extends BaseServiceImpl implements PrUserProjectResultService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PrUserProjectResultDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PrUserProjectResultDTO.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 PrUserProjectResultDTO get(String id) { + PrUserProjectResultEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PrUserProjectResultDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PrUserProjectResultDTO dto) { + PrUserProjectResultEntity entity = ConvertUtils.sourceToTarget(dto, PrUserProjectResultEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PrUserProjectResultDTO dto) { + PrUserProjectResultEntity entity = ConvertUtils.sourceToTarget(dto, PrUserProjectResultEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java new file mode 100644 index 0000000000..56d4512f97 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java @@ -0,0 +1,828 @@ +/** + * 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.epmet.dataaggre.service.epmettduck.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.form.IdAndNameDTO; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.constant.TDuckConstant; +import com.epmet.dataaggre.dao.epmettduck.PrUserProjectDao; +import com.epmet.dataaggre.dao.epmettduck.PrUserProjectResultDao; +import com.epmet.dataaggre.dto.epmettduck.PrPublishRangeDTO; +import com.epmet.dataaggre.dto.epmettduck.PrUserProjectDTO; +import com.epmet.dataaggre.dto.epmettduck.PrVistRecordDTO; +import com.epmet.dataaggre.dto.epmettduck.ProjectItemTypeEnum; +import com.epmet.dataaggre.dto.epmettduck.form.ItemResDetailFormDTO; +import com.epmet.dataaggre.dto.epmettduck.form.ProjectKeyCommonDTO; +import com.epmet.dataaggre.dto.epmettduck.form.TDuckHeaderInfoFormDTO; +import com.epmet.dataaggre.dto.epmettduck.form.TDuckListFormDTO; +import com.epmet.dataaggre.dto.epmettduck.result.*; +import com.epmet.dataaggre.dto.epmettduck.struct.*; +import com.epmet.dataaggre.entity.epmettduck.PrUserProjectEntity; +import com.epmet.dataaggre.entity.epmettduck.PrUserProjectResultEntity; +import com.epmet.dataaggre.service.epmettduck.PrPublishRangeService; +import com.epmet.dataaggre.service.epmettduck.PrUserProjectService; +import com.epmet.dataaggre.service.epmettduck.PrVistRecordService; +import com.epmet.dataaggre.service.govorg.GovOrgService; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +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 org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Slf4j +@DataSource(DataSourceConstant.EPMETTDUCK) +@Service +public class PrUserProjectServiceImpl extends BaseServiceImpl implements PrUserProjectService { + + @Autowired + private PrUserProjectResultDao prUserProjectResultDao; + @Resource + private PrPublishRangeService prPublishRangeService; + @Resource + private GovOrgService govOrgService; + @Resource + private PrVistRecordService prVistRecordService; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PrUserProjectDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PrUserProjectDTO.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 PrUserProjectDTO get(String id) { + PrUserProjectEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PrUserProjectDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PrUserProjectDTO dto) { + PrUserProjectEntity entity = ConvertUtils.sourceToTarget(dto, PrUserProjectEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PrUserProjectDTO dto) { + PrUserProjectEntity entity = ConvertUtils.sourceToTarget(dto, PrUserProjectEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 问卷概要 + * + * @param projectKey + * @return com.epmet.dataaggre.dto.epmettduck.result.ProjectProfileResultDTO + * @author yinzuomei + * @date 2021/9/16 2:54 下午 + */ + @Override + public ProjectProfileResultDTO queryProjectProfile(String projectKey) { + return baseDao.queryProjectProfile(projectKey); + } + + /** + * @Description 问卷调查列表 + * @Param formDTO + * @author zxc + * @date 2021/9/18 10:29 上午 + */ + @Override + public List queryProjectList(TDuckListFormDTO formDTO) { + List orgIds = new ArrayList<>(); + // 工作端不需要传orgId + if (formDTO.getClient().equals(TDuckConstant.CLIENT_GOV)){ + // 根据 客户ID 和 人ID 从redis获取信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + String pids = staffInfo.getAgencyPIds(); + String agencyId = staffInfo.getAgencyId(); + // 来源于 部门 + if (staffInfo.getFromOrgType().equals(TDuckConstant.ORG_TYPE_DEPT)){ + List deptList = staffInfo.getDeptList(); + if (CollectionUtils.isEmpty(deptList)){ + return new ArrayList<>(); + } + orgIds = joint(pids,agencyId,deptList); + // 来源于 网格 + }else if (staffInfo.getFromOrgType().equals(TDuckConstant.ORG_TYPE_GRID)){ + List gridList = staffInfo.getGridList(); + if (CollectionUtils.isEmpty(gridList)){ + return new ArrayList<>(); + } + orgIds = joint(pids,agencyId,gridList); + }else { + String selfOrg = agencyId; + if (StringUtils.isNotBlank(pids)){ + selfOrg = pids + ":" + agencyId; + } + orgIds.add(selfOrg); + } + }else { + CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO(); + customerGridFormDTO.setGridId(formDTO.getOrgId()); + // 查询网格信息 + Result gridResult = govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); + if (!gridResult.success()){ + throw new RenException("查询网格信息失败了..."); + } + CustomerGridDTO data = gridResult.getData(); + String oneOrg = data.getPids() + ":" + data.getId(); + orgIds.add(oneOrg); + } + // 根据orgIds查询 问卷调查的key + List projectKeys = baseDao.selectProjectKey(orgIds); + if (CollectionUtils.isEmpty(projectKeys)){ + return new ArrayList<>(); + } + PageInfo projectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.queryProjectList(projectKeys, formDTO.getStatus(), formDTO.getClient())); + List result = projectPageInfo.getList(); + // 查询此人已填写过的问卷 并赋值已填写字段 + List records = prUserProjectResultDao.selectFillRecordByUserId(formDTO.getUserId()); + if (!CollectionUtils.isEmpty(records)){ + for (String r : records) { + for (TDuckListResultDTO t : result) { + if (t.getIsEveryoneWriteOnceUid() == NumConstant.ONE && r.equals(t.getKey())){ + t.setIsFillQuestion(false); + } + if (r.equals(t.getKey())){ + t.setFillStatus(true); + } + } + } + } + //赋值 orgName + result.forEach(r -> { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), r.getCreatedBy()); + String orgName = ""; + if (null != staffInfo){ + if (staffInfo.getFromOrgType().equals(TDuckConstant.ORG_TYPE_AGENCY)){ + orgName = staffInfo.getAgencyName(); + }else if (staffInfo.getFromOrgType().equals(TDuckConstant.ORG_TYPE_GRID)){ + for (IdAndNameDTO g : staffInfo.getGridList()) { + if (g.getId().equals(staffInfo.getFromOrgId())){ + orgName = g.getName(); + continue; + } + } + }else if (staffInfo.getFromOrgType().equals(TDuckConstant.ORG_TYPE_DEPT)){ + for (IdAndNameDTO d : staffInfo.getDeptList()) { + if (d.getId().equals(staffInfo.getFromOrgId())){ + orgName = d.getName(); + continue; + } + } + } + } + r.setOrgName(orgName); + }); + PrVistRecordDTO param = new PrVistRecordDTO(); + param.setCustomerId(formDTO.getCustomerId()); + param.setUserId(formDTO.getUserId()); + param.setUserType(formDTO.getClient()); + param.setCustomerId(formDTO.getCustomerId()); + prVistRecordService.insertOrUpdate(param); + + return result; + } + + /** + * @Description orgIds拼接 + * @Param pids + * @Param agencyId + * @Param list + * @author zxc + * @date 2021/9/23 4:48 下午 + */ + public List joint(String pids, String agencyId, List list){ + List orgIds = new ArrayList<>(); + if (StringUtils.isNotBlank(pids)){ + list.forEach(l -> { + String oneOrg = pids + ":" + agencyId + ":" + l.getId(); + orgIds.add(oneOrg); + }); + }else {// pids为空的时候 + list.forEach(l -> { + String oneOrg = agencyId + ":" + l.getId(); + orgIds.add(oneOrg); + }); + } + return orgIds; + } + + /** + * 分析报告 + * + * @param projectKey + * @return com.epmet.dataaggre.dto.epmettduck.result.AnalysisReportResDTO + * @author yinzuomei + * @date 2021/9/16 5:57 下午 + */ + @Override + public List queryAnalysisReport(String projectKey) { + List itemList=baseDao.selectItems(projectKey); + if(CollectionUtils.isEmpty(itemList)){ + return new ArrayList<>(); + } + List resultList=baseDao.selectResults(projectKey); + if(CollectionUtils.isEmpty(resultList)){ + return new ArrayList<>(); + } + for(AnalysisReportResDTO item:itemList){ + String currentType=item.getType(); + String key="field".concat(item.getFormItemId()); + log.info("key="+key); + + Map detail=new HashMap<>(); + //总采集数 + detail.put("collectionTotal",resultList.size()); + //有效记录 + int validTotal=0; + + //1、联系人组件统一用一个统计显示多少条,点击查看更多显示汇总列表,如有非必填项没有填写显示空(手机号验证不需要统计) + //2、单行文本、多行文本、时间选择、时间范围、日期选择、日期范围,统计填写人数,点击查看列表 + if(ProjectItemTypeEnum.INPUT.getValue().equals(currentType) + ||ProjectItemTypeEnum.PROVINCE_CITY.getValue().equals(currentType) + ||ProjectItemTypeEnum.INPUT_MAP.getValue().equals(currentType) + ||ProjectItemTypeEnum.TEXTAREA.getValue().equals(currentType) + ||ProjectItemTypeEnum.TIME.getValue().equals(currentType) + ||ProjectItemTypeEnum.TIME_RANGE.getValue().equals(currentType) + ||ProjectItemTypeEnum.DATE.getValue().equals(currentType) + ||ProjectItemTypeEnum.DATE_RANGE.getValue().equals(currentType)){ + + for(PrUserProjectResultEntity res:resultList){ + + JSONObject originalData = JSON.parseObject(res.getOriginalData()); + //手机号、邮箱、身份证、单行文本: INPUT + //多行文本 + //时间选择 + //日期选择 + if(ProjectItemTypeEnum.INPUT.getValue().equals(currentType) + ||ProjectItemTypeEnum.TEXTAREA.getValue().equals(currentType) + ||ProjectItemTypeEnum.TIME.getValue().equals(currentType) + ||ProjectItemTypeEnum.DATE.getValue().equals(currentType)){ + if(originalData.containsKey(key)){ + if(StringUtils.isNotBlank(originalData.get(key).toString())){ + validTotal+=1; + } + }else{ + log.warn("没有当前的key:,可能用户没填写吧"+key); + } + continue; + } + //省市联动: PROVINCE_CITY + //时间范围选择 + //日期范围选择 + if(ProjectItemTypeEnum.PROVINCE_CITY.getValue().equals(currentType) + ||ProjectItemTypeEnum.TIME_RANGE.getValue().equals(currentType) + ||ProjectItemTypeEnum.DATE_RANGE.getValue().equals(currentType)){ + if(originalData.containsKey(key)){ + List provinceCityList= (List) originalData.get(key); + if(!CollectionUtils.isEmpty(provinceCityList)){ + validTotal+=1; + } + } + continue; + } + + //地理位置:INPUT_MAP + if(ProjectItemTypeEnum.INPUT_MAP.getValue().equals(currentType)){ + if(originalData.containsKey(key)){ + List provinceCityList= (List) originalData.get(key); + log.info("地理位置:"+JSON.toJSONString(provinceCityList,true)); + if (!CollectionUtils.isEmpty(provinceCityList) && provinceCityList.size() == 3) { + validTotal += 1; + } + } + //不加也行,后面也没有代码块了 + continue; + } + } + + detail.put("validTotal",validTotal); + item.setDetail(detail); + continue; + } + // 3、下拉选择、级联选择、单选框组、多选框组显示不同选项选择次数、所占比例 + //3.1、下拉选择 + if (ProjectItemTypeEnum.SELECT.getValue().equals(currentType)) { + SelectExpandStruct selectExpandStruct = JSON.parseObject(item.getExpand(), SelectExpandStruct.class); + List options = new ArrayList<>(); + if (null != selectExpandStruct) { + options = ConvertUtils.sourceToTarget(selectExpandStruct.getOptions(), OptionDTO.class); + } + + //共选择了多少次,每道题相加 + int totalCount = 0; + for (OptionDTO optionDTO : options) { + //currentCount:每道题,被选了多少次? + int currentCount = 0; + for (PrUserProjectResultEntity res : resultList) { + JSONObject originalData = JSON.parseObject(res.getOriginalData()); + if (null != selectExpandStruct.getMultiple() && selectExpandStruct.getMultiple()) { + //多选 + if(originalData.containsKey(key)){ + List answers = (List) originalData.get(key); + if (!CollectionUtils.isEmpty(answers) && answers.contains(optionDTO.getValue())) { + currentCount += 1; + } + } + + } else { + //单选 + if(originalData.containsKey(key)){ + Integer answer = (Integer) originalData.get(key); + if (null != answer && optionDTO.getValue() == answer) { + currentCount += 1; + } + } + } + } + optionDTO.setCurrentCount(currentCount); + totalCount += currentCount; + } + detail.put("totalCount", totalCount); + detail.put("options", options); + item.setDetail(detail); + continue; + } + // 3.2 单选 + if (ProjectItemTypeEnum.RADIO.getValue().equals(currentType)) { + RadioExpandStruct radioExpandStruct = JSON.parseObject(item.getExpand(), RadioExpandStruct.class); + List options = new ArrayList<>(); + if (null != radioExpandStruct) { + options = ConvertUtils.sourceToTarget(radioExpandStruct.getOptions(), OptionDTO.class); + } + + //共选择了多少次,每道题相加 + int totalCount = 0; + for (OptionDTO optionDTO : options) { + //currentCount:每道题,被选了多少次? + int currentCount = 0; + for (PrUserProjectResultEntity res : resultList) { + JSONObject originalData = JSON.parseObject(res.getOriginalData()); + //单选 + if(originalData.containsKey(key)){ + Integer answer = (Integer) originalData.get(key); + if (null != answer && optionDTO.getValue() == answer) { + currentCount += 1; + } + } + } + optionDTO.setCurrentCount(currentCount); + totalCount += currentCount; + } + detail.put("totalCount", totalCount); + detail.put("options", options); + item.setDetail(detail); + continue; + } + + // 3.3多选 + if (ProjectItemTypeEnum.CHECKBOX.getValue().equals(currentType)) { + CheckboxExpandStruct checkboxExpandStruct = JSON.parseObject(item.getExpand(), CheckboxExpandStruct.class); + List options = new ArrayList<>(); + if (null != checkboxExpandStruct) { + options = ConvertUtils.sourceToTarget(checkboxExpandStruct.getOptions(), OptionDTO.class); + } + + //共选择了多少次,每道题相加 + int totalCount = 0; + for (OptionDTO optionDTO : options) { + //currentCount:每道题,被选了多少次? + int currentCount = 0; + for (PrUserProjectResultEntity res : resultList) { + JSONObject originalData = JSON.parseObject(res.getOriginalData()); + //多选 + if(originalData.containsKey(key)){ + List answers = (List) originalData.get(key); + if (!CollectionUtils.isEmpty(answers) && answers.contains(optionDTO.getValue())) { + currentCount += 1; + } + } + } + optionDTO.setCurrentCount(currentCount); + totalCount += currentCount; + } + detail.put("totalCount", totalCount); + detail.put("options", options); + item.setDetail(detail); + continue; + } + + //3.4级联 todo + if(ProjectItemTypeEnum.CASCADER.getValue().equals(currentType)){ + //目前cascaderExpandStruct 没啥用 + CascaderExpandStruct cascaderExpandStruct = JSON.parseObject(item.getExpand(), CascaderExpandStruct.class); + //共选择了多少次,每道题相加 + int totalCount = 0; + Map resMap = new HashMap<>(); + for (PrUserProjectResultEntity res : resultList) { + //级联组件,用processdata特殊处理下 + JSONObject originalData = JSON.parseObject(res.getProcessData()); + if(originalData.containsKey(key)){ + List dtoList = JSON.parseArray(originalData.get(key).toString(), CascaderDTO.class); + if(CollectionUtils.isEmpty(dtoList)){ + log.info(String.format("当前userId:%s,没有填写本题itemId:%s",res.getUserId(),key)); + continue; + } + + for (CascaderDTO cascaderDTO : dtoList) { + if (null != cascaderDTO && !CollectionUtils.isEmpty(cascaderDTO.getLabels())) { + totalCount += 1; + String pathName = StringUtils.join(cascaderDTO.getLabels(), StringUtils.isNotBlank(cascaderExpandStruct.getSeparator()) ? cascaderExpandStruct.getSeparator() : StrConstant.HYPHEN); + Integer count = resMap.get(pathName); + resMap.put(pathName, count == null ? 1 : count + 1); + } + } + } + } + detail.put("totalCount", totalCount); + detail.put("profile", resMap); + item.setDetail(detail); + continue; + } + + //4、计数器显示所有填写者选择的数字总和 + if(ProjectItemTypeEnum.NUMBER_INPUT.getValue().equals(currentType)){ + int sumTotal=0; + for(PrUserProjectResultEntity res:resultList){ + JSONObject originalData = JSON.parseObject(res.getOriginalData()); + if(originalData.containsKey(key)){ + Integer score= (Integer) originalData.get(key); + if(null!=score){ + sumTotal+=score; + validTotal+=1; + } + } + } + detail.put("validTotal",validTotal); + detail.put("sumTotal",sumTotal); + item.setDetail(detail); + continue; + } + + + //5、开关统计开有多少、关有多少 + if(ProjectItemTypeEnum.SWITCH.getValue().equals(currentType)){ + int openTotal=0; + int closedTotal=0; + for(PrUserProjectResultEntity res:resultList){ + JSONObject originalData = JSON.parseObject(res.getOriginalData()); + if(originalData.containsKey(key)){ + Boolean result= (Boolean) originalData.get(key); + if(null!=result){ + validTotal+=1; + if(result){ + openTotal+=1; + }else{ + closedTotal+=1; + } + } + } + } + detail.put("validTotal",validTotal); + detail.put("openTotal",openTotal); + detail.put("closedTotal",closedTotal); + item.setDetail(detail); + continue; + } + + //6、滑块、颜色选择、上传不统计 + + //7、评分统计1星几人,2星几人,3星几人......,显示平均分 + if (ProjectItemTypeEnum.RATE.getValue().equals(currentType)) { + // 1、标签设置的满星是几个星星? + RateExpandStruct rateExpandStruct = JSON.parseObject(item.getExpand(), RateExpandStruct.class); + if (null != rateExpandStruct && null != rateExpandStruct.getMax()) { + detail.put("maxStarNum", rateExpandStruct.getMax()); + } else { + log.warn(String.format("当前评分组件未设置最大值,默认赋值5,projectKey:%s,itemId:%s",projectKey,item.getFormItemId())); + detail.put("maxStarNum", NumConstant.FIVE); + } + + //总分 + int totalStarNum = 0; + Map starMap = new HashMap<>(); + for (PrUserProjectResultEntity res : resultList) { + JSONObject originalData = JSON.parseObject(res.getOriginalData()); + if(originalData.containsKey(key)){ + Integer starNum = (Integer) originalData.get(key); + if (null != starNum) { + validTotal += 1; + totalStarNum += starNum; + Integer count = starMap.get(starNum); + starMap.put(starNum, count == null ? 1 : count + 1); + + } + } + } + //按照星星大小升序排列 + this.sortMap(starMap, true); + //2、平均分 (09.30,产品需求:直接显示平均星数,保留小数点后两位,无需四舍五入) + detail.put("avgStarNum", new BigDecimal((float)totalStarNum / validTotal).setScale(2, BigDecimal.ROUND_DOWN)); + //3、几条有效记录 + detail.put("validTotal", validTotal); + //4、得分列表 + detail.put("starProfile", starMap); + item.setDetail(detail); + continue; + } + + + } + return itemList; + } + + /** + * @Description 查询问卷调查的头部信息 + * @Param formDTO + * @author zxc + * @date 2021/9/18 10:35 上午 + */ + @Override + public PrUserProjectEntity headerInfo(TDuckHeaderInfoFormDTO formDTO) { + PrUserProjectEntity prUserProjectEntity = baseDao.selectOne(new QueryWrapper().lambda().eq(PrUserProjectEntity::getKey, formDTO.getProjectKey())); + return prUserProjectEntity; + } + + /** + * @param projectKey + * @Description 获取发布范围 + * @Param projectKey + * @Return {@link GetRangeResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/18 15:18 + */ + @Override + public GetRangeResultDTO getRange(String projectKey) { + GetRangeResultDTO result = new GetRangeResultDTO(); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(PrUserProjectEntity :: getKey, projectKey); + PrUserProjectEntity entity = baseDao.selectOne(wrapper); + result.setClient(entity.getClient()); + result.setOrgList(prPublishRangeService.getRangeOrgList(projectKey)); + return result; + } + + private List> sortMap(Map map, boolean asc) { + + Stream> stream = null; + if (asc) { + stream = map.entrySet().stream().sorted(Map.Entry.comparingByValue()); + } else { + stream = map.entrySet().stream().sorted(Collections.reverseOrder(Map.Entry.comparingByValue())); + } + return stream.collect(Collectors.toList()); + } + + + /** + * 查看详情 + * 1、联系人组件统一用一个统计显示多少条,点击查看更多显示汇总列表,如有非必填项没有填写显示空(手机号验证不需要统计) + * 2、单行文本、多行文本、时间选择、时间范围、日期选择、日期范围,统计填写人数,点击查看列表 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/9/22 1:37 下午 + */ + @Override + public List queryItemResDetail(ItemResDetailFormDTO formDTO) { + List resultList=baseDao.selectResults(formDTO.getProjectKey()); + if(CollectionUtils.isEmpty(resultList)){ + return new ArrayList<>(); + } + List stringList=new ArrayList<>(); + String key="field".concat(formDTO.getFormItemId()); + for(PrUserProjectResultEntity res:resultList){ + JSONObject originalData = JSON.parseObject(res.getOriginalData()); + if(ProjectItemTypeEnum.INPUT.getValue().equals(formDTO.getType()) + ||ProjectItemTypeEnum.TEXTAREA.getValue().equals(formDTO.getType()) + ||ProjectItemTypeEnum.TIME.getValue().equals(formDTO.getType()) + ||ProjectItemTypeEnum.DATE.getValue().equals(formDTO.getType())){ + if(originalData.containsKey(key)){ + stringList.add((String) originalData.get(key)); + continue; + } + }else if(ProjectItemTypeEnum.TIME_RANGE.getValue().equals(formDTO.getType()) + ||ProjectItemTypeEnum.DATE_RANGE.getValue().equals(formDTO.getType())){ + if(originalData.containsKey(key)){ + List originalList= (List) originalData.get(key); + if(!CollectionUtils.isEmpty(originalList)){ + String rangeStr=StringUtils.join(originalList,StrConstant.COMMA); + stringList.add(rangeStr); + } + } + } + } + return stringList; + } + + /** + * 联系人组件 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.epmettduck.result.ItemResDetailConcatResultDTO + * @author yinzuomei + * @date 2021/9/22 2:57 下午 + */ + @Override + public ItemResDetailConcatResultDTO queryItemResDetailConcat(ProjectKeyCommonDTO formDTO) { + // 联系人题目 + List itemList=baseDao.selectCocatItems(formDTO.getProjectKey()); + if(CollectionUtils.isEmpty(itemList)){ + return new ItemResDetailConcatResultDTO(); + } + //答案 + List resultList=baseDao.selectResults(formDTO.getProjectKey()); + if(CollectionUtils.isEmpty(resultList)){ + return new ItemResDetailConcatResultDTO(); + } + + ItemResDetailConcatResultDTO resultDTO=new ItemResDetailConcatResultDTO(); + + List tableHeaderList=new ArrayList<>(); + for(AnalysisReportResDTO item:itemList){ + ConcatTableHeaderDTO headerDTO=new ConcatTableHeaderDTO(); + headerDTO.setFormItemId(item.getFormItemId()); + headerDTO.setLabel(item.getLabel()); + headerDTO.setType(item.getType()); + tableHeaderList.add(headerDTO); + } + + List> dataMap=new ArrayList<>(); + + for (PrUserProjectResultEntity res : resultList) { + JSONObject originalData = JSON.parseObject(res.getOriginalData()); + Map mapUnit=new HashMap<>(); + //start + for (ConcatTableHeaderDTO header : tableHeaderList) { + String key = "field".concat(header.getFormItemId()); + //手机号、邮箱、身份证、单行文本: INPUT + if (ProjectItemTypeEnum.INPUT.getValue().equals(header.getType())) { + if (originalData.containsKey(key)) { + if (StringUtils.isNotBlank(originalData.get(key).toString())) { + mapUnit.put(header.getFormItemId(),(String) originalData.get(key)); + } else { + mapUnit.put(header.getFormItemId(),StrConstant.EPMETY_STR); + } + } else { + log.warn("没有当前的key:,可能用户没填写吧" + key); + mapUnit.put(header.getFormItemId(),StrConstant.HYPHEN); + } + } + //省市联动: PROVINCE_CITY + if (ProjectItemTypeEnum.PROVINCE_CITY.getValue().equals(header.getType())) { + if (originalData.containsKey(key)) { + List provinceCityList = (List) originalData.get(key); + if (!CollectionUtils.isEmpty(provinceCityList)) { + mapUnit.put(header.getFormItemId(),StringUtils.join(provinceCityList, StrConstant.HYPHEN)); + } else { + mapUnit.put(header.getFormItemId(),StrConstant.EPMETY_STR); + } + } else { + log.warn("没有当前的key:,可能用户没填写吧" + key); + mapUnit.put(header.getFormItemId(),StrConstant.HYPHEN); + } + } + + //地理位置:INPUT_MAP + if (ProjectItemTypeEnum.INPUT_MAP.getValue().equals(header.getType())) { + if (originalData.containsKey(key)) { + List inputMap = (List) originalData.get(key); + log.info("地理位置:" + JSON.toJSONString(inputMap, true)); + if (!CollectionUtils.isEmpty(inputMap) && inputMap.size() == 3) { + mapUnit.put(header.getFormItemId(),inputMap.get(2)); + } else { + mapUnit.put(header.getFormItemId(),StrConstant.EPMETY_STR); + } + } else { + log.warn("没有当前的key:,可能用户没填写吧" + key); + mapUnit.put(header.getFormItemId(),StrConstant.HYPHEN); + } + } + }//end + dataMap.add(mapUnit); + } + resultDTO.setTableHeaderList(tableHeaderList); + resultDTO.setDataMap(dataMap); + return resultDTO; + } + + /** + * 有新的问卷显示小红点 + * + * @param tokenDto + * @Param tokenDto + * @Return {@link RedPointResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/23 10:05 + */ + @Override + public RedPointResultDTO redPoint(TokenDto tokenDto) { + RedPointResultDTO result = new RedPointResultDTO(); + List orgList = govOrgService.getStaffOrgList(tokenDto.getUserId()); + List list = prPublishRangeService.getListByOrg(orgList); + if (CollectionUtils.isEmpty(list)) { + result.setRedPoint(NumConstant.ZERO_STR); + return result; + } + PrVistRecordDTO visitRecord = prVistRecordService.getNewestRecord(tokenDto.getUserId()); + if (null == visitRecord) { + result.setRedPoint(NumConstant.ONE_STR); + return result; + } + if (list.get(0).getCreatedTime().compareTo(visitRecord.getUpdatedTime()) > 0) { + result.setRedPoint(NumConstant.ONE_STR); + } else { + result.setRedPoint(NumConstant.ZERO_STR); + } + return result; + } + + @Override + public PrUserProjectEntity getProjectEntityBykey(String key) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(PrUserProjectEntity::getKey, key); + return baseDao.selectOne(query); + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectSettingServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectSettingServiceImpl.java new file mode 100644 index 0000000000..cbfb3989f0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectSettingServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.epmet.dataaggre.service.epmettduck.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmettduck.PrUserProjectSettingDao; +import com.epmet.dataaggre.dto.epmettduck.PrUserProjectSettingDTO; +import com.epmet.dataaggre.entity.epmettduck.PrUserProjectSettingEntity; +import com.epmet.dataaggre.service.epmettduck.PrUserProjectSettingService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Slf4j +@DataSource(DataSourceConstant.EPMETTDUCK) +@Service +public class PrUserProjectSettingServiceImpl extends BaseServiceImpl implements PrUserProjectSettingService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PrUserProjectSettingDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PrUserProjectSettingDTO.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 PrUserProjectSettingDTO get(String id) { + PrUserProjectSettingEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PrUserProjectSettingDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PrUserProjectSettingDTO dto) { + PrUserProjectSettingEntity entity = ConvertUtils.sourceToTarget(dto, PrUserProjectSettingEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PrUserProjectSettingDTO dto) { + PrUserProjectSettingEntity entity = ConvertUtils.sourceToTarget(dto, PrUserProjectSettingEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectThemeServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectThemeServiceImpl.java new file mode 100644 index 0000000000..ef204311f3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectThemeServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.epmet.dataaggre.service.epmettduck.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmettduck.PrUserProjectThemeDao; +import com.epmet.dataaggre.dto.epmettduck.PrUserProjectThemeDTO; +import com.epmet.dataaggre.entity.epmettduck.PrUserProjectThemeEntity; +import com.epmet.dataaggre.service.epmettduck.PrUserProjectThemeService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目表单项 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Slf4j +@DataSource(DataSourceConstant.EPMETTDUCK) +@Service +public class PrUserProjectThemeServiceImpl extends BaseServiceImpl implements PrUserProjectThemeService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PrUserProjectThemeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PrUserProjectThemeDTO.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 PrUserProjectThemeDTO get(String id) { + PrUserProjectThemeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PrUserProjectThemeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PrUserProjectThemeDTO dto) { + PrUserProjectThemeEntity entity = ConvertUtils.sourceToTarget(dto, PrUserProjectThemeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PrUserProjectThemeDTO dto) { + PrUserProjectThemeEntity entity = ConvertUtils.sourceToTarget(dto, PrUserProjectThemeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrVistRecordServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrVistRecordServiceImpl.java new file mode 100644 index 0000000000..7c25410b56 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrVistRecordServiceImpl.java @@ -0,0 +1,147 @@ +/** + * 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.epmet.dataaggre.service.epmettduck.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmettduck.PrVistRecordDao; +import com.epmet.dataaggre.dto.epmettduck.PrVistRecordDTO; +import com.epmet.dataaggre.entity.epmettduck.PrVistRecordEntity; +import com.epmet.dataaggre.service.epmettduck.PrVistRecordService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 用户访问问卷记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Slf4j +@DataSource(DataSourceConstant.EPMETTDUCK) +@Service +public class PrVistRecordServiceImpl extends BaseServiceImpl implements PrVistRecordService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PrVistRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PrVistRecordDTO.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 PrVistRecordDTO get(String id) { + PrVistRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PrVistRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PrVistRecordDTO dto) { + PrVistRecordEntity entity = ConvertUtils.sourceToTarget(dto, PrVistRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PrVistRecordDTO dto) { + PrVistRecordEntity entity = ConvertUtils.sourceToTarget(dto, PrVistRecordEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param staffId + * @Description 获取最新访问记录 + * @Param staffId + * @Return {@link PrVistRecordDTO} + * @Author zhaoqifeng + * @Date 2021/9/23 14:16 + */ + @Override + public PrVistRecordDTO getNewestRecord(String staffId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(PrVistRecordEntity::getUserId, staffId); + wrapper.orderByDesc(PrVistRecordEntity::getUpdatedTime); + wrapper.last("limit 1"); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return null; + } + return ConvertUtils.sourceToTarget(list.get(0), PrVistRecordDTO.class); + } + + @Override + public void insertOrUpdate(PrVistRecordDTO param) { + //Executors.newCachedThreadPool().submit(()-> { + try { + + PrVistRecordDTO newestRecord = this.getNewestRecord(param.getUserId()); + if (newestRecord == null) { + PrVistRecordEntity entity = ConvertUtils.sourceToTarget(param, PrVistRecordEntity.class); + this.insert(entity); + } else { + PrVistRecordEntity entity = new PrVistRecordEntity(); + entity.setId(newestRecord.getId()); + this.updateById(entity); + } + } catch (Exception e) { + log.error("insertPrVistRecord excption", e); + } + //}); + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/WxMpUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/WxMpUserServiceImpl.java new file mode 100644 index 0000000000..ac4e961890 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/WxMpUserServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.epmet.dataaggre.service.epmettduck.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmettduck.WxMpUserDao; +import com.epmet.dataaggre.dto.epmettduck.WxMpUserDTO; +import com.epmet.dataaggre.entity.epmettduck.WxMpUserEntity; +import com.epmet.dataaggre.service.epmettduck.WxMpUserService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 微信公众号用户 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-15 + */ +@Slf4j +@DataSource(DataSourceConstant.EPMETTDUCK) +@Service +public class WxMpUserServiceImpl extends BaseServiceImpl implements WxMpUserService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, WxMpUserDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, WxMpUserDTO.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 WxMpUserDTO get(String id) { + WxMpUserEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, WxMpUserDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(WxMpUserDTO dto) { + WxMpUserEntity entity = ConvertUtils.sourceToTarget(dto, WxMpUserEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(WxMpUserDTO dto) { + WxMpUserEntity entity = ConvertUtils.sourceToTarget(dto, WxMpUserEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java index e8ec143b3c..ce49c18f73 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java @@ -18,6 +18,8 @@ package com.epmet.dataaggre.service.epmetuser; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dataaggre.dto.datastats.form.CustomerDataManageFormDTO; +import com.epmet.dataaggre.dto.datastats.result.CustomerDataManageResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult; import com.epmet.dataaggre.entity.epmetuser.StatsStaffPatrolRecordDailyEntity; @@ -40,4 +42,9 @@ public interface StatsStaffPatrolRecordDailyService extends BaseService getPatrolSumList(List agencyList, String startDateId, String endDateId); + /** + * @Description 直属组织或网格下巡查数据 + * @author sun + */ + List patrolList(CustomerDataManageFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 92a02290bd..a131ca29dd 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -598,7 +598,9 @@ public class EpmetUserServiceImpl implements EpmetUserService { log.error("getStaffInfo have any agency staffId:{}",staffId); return null; } + result.setAgencyId(agencyDTO.getId()); result.setAgencyName(agencyDTO.getOrganizationName()); + result.setAgencyPIds(agencyDTO.getPids()); StaffOrgRelationResultDTO fromOrgTypeDto = govOrgService.getStaffFromOrgType(staffId); String fromOrgType = OrgTypeEnum.AGENCY.getCode(); if (fromOrgTypeDto != null){ diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java index aad90034f3..d24dcbe10c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java @@ -4,6 +4,8 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.epmetuser.StatsStaffPatrolRecordDailyDao; +import com.epmet.dataaggre.dto.datastats.form.CustomerDataManageFormDTO; +import com.epmet.dataaggre.dto.datastats.result.CustomerDataManageResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult; import com.epmet.dataaggre.entity.epmetuser.StatsStaffPatrolRecordDailyEntity; import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService; @@ -36,4 +38,13 @@ public class StatsStaffPatrolRecordDailyServiceImpl extends BaseServiceImpl patrolList(CustomerDataManageFormDTO formDTO) { + return baseDao.patrolList(formDTO); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java index 43be38a84f..67468e32de 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java @@ -2,6 +2,7 @@ package com.epmet.dataaggre.service.evaluationindex; import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO; import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO; +import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; @@ -71,4 +72,18 @@ public interface EvaluationIndexService { */ List getSubAgencyListByAgency(String agencyId); + /** + * @Description 根据组织ID查询组织名 + * @Param agencyId + * @author zxc + * @date 2021/9/10 3:54 下午 + */ + String selectAgencyNameByAgencyId(String agencyId); + + /** + * @Description 根据组织Id判断查询直属下级组织/网格列表,组织存在子客户的查询包含子客户组织数据 + * @author sun + */ + ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String agencyId); + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java index f8c7eb301a..abb0f137f5 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java @@ -2,10 +2,12 @@ package com.epmet.dataaggre.service.evaluationindex.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.evaluationindex.EvaluationIndexDao; import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO; import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO; +import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; @@ -143,4 +145,65 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { } } + /** + * @Description 根据组织ID查询组织名 + * @Param agencyId + * @author zxc + * @date 2021/9/10 3:54 下午 + */ + @Override + public String selectAgencyNameByAgencyId(String agencyId) { + return evaluationIndexDao.selectAgencyNameByAgencyId(agencyId); + } + + /** + * @Description 根据组织Id判断查询直属下级组织/网格列表,组织存在子客户的查询包含子客户组织数据 + * @author sun + */ + @Override + public ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String agencyId) { + ScreenAgencyOrGridListDTO resultDTO = new ScreenAgencyOrGridListDTO(); + List agencyGridList = new ArrayList<>(); + //1.查询组织信息 + ScreenCustomerAgencyDTO dto = evaluationIndexDao.getByAgencyId(agencyId); + if (dto == null) { + log.error(String.format("组织信息不存在,组织Id->%s", agencyId)); + return new ScreenAgencyOrGridListDTO(); + } + //2.根据组织级别判断查询直属组织或网格列表 + List agencyList = new ArrayList<>(); + List gridList = new ArrayList<>(); + List finalAgencyGridList = agencyGridList; + if (!"community".equals(dto.getLevel())) { + //2-1.直属下级组织列表 + //2.判断客户是否存在子客户 + List list = customerRelation.haveSubCustomer(dto.getCustomerId()); + if (!CollectionUtils.isNotEmpty(list)) { + agencyList = evaluationIndexDao.getSubAgencyListByAgency(agencyId, null, null); + } else { + list.add(dto.getCustomerId()); + agencyList = evaluationIndexDao.getSubAgencyListByAgency(null, dto.getAreaCode(), list); + } + agencyList.forEach(gr->{ + ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid(); + org.setOrgId(gr.getAgencyId()); + org.setOrgName(gr.getAgencyName()); + finalAgencyGridList.add(org); + }); + } else { + //2-2.直属下级网格列表 + gridList = evaluationIndexDao.getSubGridList(agencyId); + gridList.forEach(gr->{ + ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid(); + org.setOrgId(gr.getGridId()); + org.setOrgName(gr.getGridName()); + finalAgencyGridList.add(org); + }); + } + + resultDTO.setLevel(dto.getLevel()); + resultDTO.setAgencyGridList(agencyGridList); + return resultDTO; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index a641be3095..41b97b57ac 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -135,4 +135,23 @@ public interface GovOrgService { * @return */ StaffOrgRelationResultDTO getStaffFromOrgType(String staffId); + + /** + * @Description 当前组织级下级组织树 + * @Param tokenDto + * @Param formDTO + * @Return {@link OrgTreeResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/17 14:03 + */ + List getAgencyTree(TokenDto tokenDto, SubOrgFormDTO formDTO); + + /** + * @Description 工作人员所在的组织,部门,网格 + * @Param staffId + * @Return {@link List< String>} + * @Author zhaoqifeng + * @Date 2021/9/23 10:14 + */ + List getStaffOrgList(String staffId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index b7b23299ab..d4e265cdec 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -3,8 +3,10 @@ package com.epmet.dataaggre.service.govorg.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.govorg.*; @@ -28,10 +30,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; /** @@ -393,6 +392,13 @@ public class GovOrgServiceImpl implements GovOrgService { staffIds.removeIf(s->s.equals(formDTO.getStaffId())); } + //是否具有超级管理员或管理员角色 + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + Map roleMap = staffInfoCache.getRoleMap(); + if (roleMap.containsKey("root_manager") || roleMap.containsKey("manager")) { + formDTO.setEnableFlag("disabled"); + } + //2.分页查询工作人员基础信息、角色信息【组织人员单位领导角色人员在前;部门人员部门领导角色人员在前;网格人员网格长角色人员在前】 List staffList = epmetUserService.getStaffInfoList(formDTO); @@ -491,4 +497,39 @@ public class GovOrgServiceImpl implements GovOrgService { return customerAgencyDao.getStaffFromOrgType(staffId); } + /** + * @param tokenDto + * @param formDTO + * @Description 当前组织级下级组织树 + * @Param tokenDto + * @Param formDTO + * @Return {@link OrgTreeResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/17 14:03 + */ + @Override + public List getAgencyTree(TokenDto tokenDto, SubOrgFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + List list = new ArrayList<>(); + if ("resi".equals(formDTO.getClient())) { + list.add(customerAgencyDao.getResiOrgTree(staffInfo.getAgencyId())); + return list; + } + list.add(customerAgencyDao.getOrgTree(staffInfo.getAgencyId())); + return list; + } + + /** + * @param staffId + * @Description 工作人员所在的组织,部门,网格 + * @Param staffId + * @Return {@link List< String>} + * @Author zhaoqifeng + * @Date 2021/9/23 10:14 + */ + @Override + public List getStaffOrgList(String staffId) { + return customerAgencyDao.getOrgList(staffId); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/QuestionnaireServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/QuestionnaireServiceImpl.java new file mode 100644 index 0000000000..1c6aab452d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/QuestionnaireServiceImpl.java @@ -0,0 +1,193 @@ +package com.epmet.dataaggre.service.impl; + +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.form.IdAndNameDTO; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dataaggre.dto.epmettduck.result.PermissionValidateResultDTO; +import com.epmet.dataaggre.entity.epmettduck.PrPublishRangeEntity; +import com.epmet.dataaggre.entity.epmettduck.PrUserProjectEntity; +import com.epmet.dataaggre.service.QuestionnaireService; +import com.epmet.dataaggre.service.epmettduck.PrPublishRangeService; +import com.epmet.dataaggre.service.epmettduck.PrUserProjectService; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.feign.GovOrgOpenFeignClient; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +@Service +@Slf4j +public class QuestionnaireServiceImpl implements QuestionnaireService, ResultDataResolver { + + /** 调查问卷有效期 15min */ + public static final long QUESTIONNAIRE_EXPIRE_SECONDS = 15 * 60; + + @Autowired + private PrUserProjectService prUserProjectService; + + @Autowired + private PrPublishRangeService prPublishRangeService; + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Autowired + private RedisUtils redisUtils; + + @Autowired + private CustomerStaffRedis customerStaffRedis; + + /** + * @description 居民端调查问卷权限校验 + * + * @param projectKey + * @param userId + * @param gridId + * @return + * @author wxz + * @date 2021.09.23 17:45:25 + */ + public PermissionValidateResultDTO resiPermissionValidate(String projectKey, String userId, String gridId) { + + PrUserProjectEntity project = prUserProjectService.getProjectEntityBykey(projectKey); + if (project == null || !AppClientConstant.APP_RESI.equals(project.getClient())) { + // 工作端只能看到发布到居民端的 + log.warn("【调查问卷】居民端无法查看发布到工作端的调查问卷,staffId:{}, projectKey:{}", userId, projectKey); + return generateValidateResult(userId, projectKey, false); + } + + CustomerGridFormDTO form = new CustomerGridFormDTO(); + form.setGridId(gridId); + Result gridInfoResult = govOrgOpenFeignClient.getGridBaseInfoByGridId(form); + CustomerGridDTO gridInfo = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【调查问卷】校验访问权限,查询网格信息失败"); + // 网格父级ID列表:网格ID(拼接起来,冒号分割) + String gridIdPath = gridInfo.getPids().concat(":").concat(gridInfo.getId()); + List publishRangeEntity = prPublishRangeService.getPublishRangeEntity(projectKey); + PermissionValidateResultDTO r = new PermissionValidateResultDTO(); + for (PrPublishRangeEntity rangeEntity : publishRangeEntity) { + if (gridIdPath.contains(rangeEntity.getOrgIds())) { + return generateValidateResult(userId, projectKey, true); + } + } + r.setPermitted(false); + return r; + } + + @Override + public PermissionValidateResultDTO govPermissionValidate(String projectKey, String staffId, String customerId) { + PrUserProjectEntity project = prUserProjectService.getProjectEntityBykey(projectKey); + if (project == null || !"gov".equals(project.getClient())) { + // 工作端只能看到发布到工作端的 + log.warn("【调查问卷】工作端无法查看发布到居民端的调查问卷,staffId:{}, projectKey:{}", staffId, projectKey); + return generateValidateResult(staffId, projectKey, false); + } + + List gridRangeOrgIds = new ArrayList<>(); + List agencyRangeOrgIds = new ArrayList<>(); + List deptRangeOrgIds = new ArrayList<>(); + + // 将发布范围分别放到3个不同的列表中 + List publishRangeEntitys = prPublishRangeService.getPublishRangeEntity(projectKey); + publishRangeEntitys.forEach(rangeEntity -> { + if ("grid".equals(rangeEntity.getOrgType())) { + gridRangeOrgIds.add(rangeEntity.getOrgIds()); + } else if ("agency".equals(rangeEntity.getOrgType())) { + agencyRangeOrgIds.add(rangeEntity.getOrgIds()); + } else if ("dept".equals(rangeEntity.getOrgType())) { + deptRangeOrgIds.add(rangeEntity.getOrgIds()); + } else { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), String.format("【调查问卷】未知的发布范围类型:%s", rangeEntity.getOrgType())); + } + }); + + CustomerStaffInfoCacheResult staffInfo = customerStaffRedis.getStaffInfo(customerId, staffId); + PermissionValidateResultDTO r = null; + //if ("agency".equals(staffInfo.getFromOrgType())) { + // // 来自agency + // + //} else if ("grid".equals(staffInfo.getFromOrgType())) { + // List belongGridList = staffInfo.getGridList(); + // + //} else if ("dept".equals(staffInfo.getFromOrgType())) { + // + //} + + String agencyId = staffInfo.getAgencyId(); + String agencyPIds = staffInfo.getAgencyPIds(); + + // 网格范围内的权限判断 + List staffGridList = staffInfo.getGridList(); + for (IdAndNameDTO gridIdAndName : staffGridList) { + // 工作人员所属的 父orgId路径:网格id + String staffGridIdPath = (StringUtils.isEmpty(agencyPIds) ? "" : agencyPIds.concat(":")).concat(agencyId).concat(":").concat(gridIdAndName.getId()); + for (String gridRangeOrgId : gridRangeOrgIds) { + if (staffGridIdPath.contains(gridRangeOrgId)) { + r = generateValidateResult(staffId, projectKey, true); + return r; + } + } + } + + // dept范围内的权限判断 + List staffDeptList = staffInfo.getDeptList(); + for (IdAndNameDTO deptIdAndName : staffDeptList) { + // 工作人员所属的 父orgId路径:网格id + String staffDeptIdPath = (StringUtils.isEmpty(agencyPIds) ? "" : agencyPIds.concat(":")).concat(agencyId).concat(":").concat(deptIdAndName.getId()); + for (String deptRangeOrgIdPath : deptRangeOrgIds) { + if (staffDeptIdPath.contains(deptRangeOrgIdPath)) { + r = generateValidateResult(staffId, projectKey, true); + return r; + } + } + } + + // agency范围内的权限判断 + String staffAgencyIdPath = (StringUtils.isEmpty(agencyPIds) ? "" : agencyPIds.concat(":")).concat(agencyId); + for (String agencyRangeOrgId : agencyRangeOrgIds) { + if (staffAgencyIdPath.contains(agencyRangeOrgId)) { + r = generateValidateResult(staffId, projectKey, true); + return r; + } + } + + // 如果上述范围中都不能判断通过,那么返回一个不通过的结果给到前端 + r = generateValidateResult(staffId, projectKey, false); + return r; + } + + /** + * @description 生成权限允许的返回结果 + * + * @param userId + * @param projectKey + * @param permitted 是否允许访问 + * @return + * @author wxz + * @date 2021.09.23 23:19:17 + */ + private PermissionValidateResultDTO generateValidateResult(String userId, String projectKey, Boolean permitted) { + PermissionValidateResultDTO d = new PermissionValidateResultDTO(); + d.setPermitted(permitted); + if (permitted) { + String accessKey = UUID.randomUUID().toString().replace("-", ""); + redisUtils.set(RedisKeys.getQuestionnaireAccessKey(userId, projectKey), accessKey, QUESTIONNAIRE_EXPIRE_SECONDS); + d.setAccessKey(accessKey); + } + return d; + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java index 4a9cd89119..374db9eedf 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java @@ -22,10 +22,10 @@ import com.epmet.dataaggre.service.resigroup.ResiGroupService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; import java.util.ArrayList; import java.util.Comparator; @@ -120,9 +120,16 @@ public class ResiGroupServiceImpl implements ResiGroupService { if (CollectionUtils.isEmpty(categoryList)) { return new BranchConAnalysisResultDTO(); } - String dateId = DateUtils.getBeforeNDay(NumConstant.ONE); + if (StringUtils.isNotBlank(formDTO.getMonthId())) { + formDTO.setDateId(DateUtils.getMonthDay(formDTO.getMonthId())); + } else { + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); + } + } + List factGroupActDailyDTOList = dataStatsService.branchConAnalysis(formDTO.getCustomerId(), formDTO.getOrgId(), formDTO.getOrgType(), - dateId, formDTO.getFirstCategoryCode()); + formDTO.getDateId(), formDTO.getFirstCategoryCode()); /** * List -> Map * 需要注意的是: @@ -285,7 +292,13 @@ public class ResiGroupServiceImpl implements ResiGroupService { return new ArrayList<>(); } List resultDTOList=new ArrayList<>(); - String dateId = DateUtils.getBeforeNDay(NumConstant.ONE); + if (StringUtils.isNotBlank(formDTO.getMonthId())) { + formDTO.setDateId(DateUtils.getMonthDay(formDTO.getMonthId())); + } else { + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); + } + } // 1、根据以及编码查询出二级编码列表 List actCategoryDictDTOList=queryActCategoryDictList(formDTO.getCustomerId(),formDTO.getFirstCategoryCode()); for(OrgInfoCommonDTO orgInfo:orgInfoDTOList){ @@ -296,7 +309,7 @@ public class ResiGroupServiceImpl implements ResiGroupService { if(!CollectionUtils.isEmpty(actCategoryDictDTOList)){ List detailList=new ArrayList<>(); - List detailRecords=dataStatsService.selectGroupActRankDetail(formDTO.getCustomerId(),dateId,orgInfo.getOrgId(),actCategoryDictDTOList); + List detailRecords=dataStatsService.selectGroupActRankDetail(formDTO.getCustomerId(),formDTO.getDateId(),orgInfo.getOrgId(),actCategoryDictDTOList); Map map = detailRecords.stream().collect(Collectors.toMap(GroupActRankDetailDTO::getCategoryCode, a -> a, (k1, k2) -> k1)); for(ActCategoryDictDTO actCategoryDictDTO:actCategoryDictDTOList){ diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml index f84136b69a..102666f3d7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml @@ -149,6 +149,11 @@ dynamic: url: @datasource.druid.epmetmessage.url@ username: @datasource.druid.epmetmessage.username@ password: @datasource.druid.epmetmessage.password@ + epmettduck: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.epmettduck.url@ + username: @datasource.druid.epmettduck.username@ + password: @datasource.druid.epmettduck.password@ feign: hystrix: enabled: true diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 9f99415f2b..90029209ad 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -395,13 +395,13 @@ PROJECT_COUNT, PROJECT_RATIO, PROJECT_CLOSED_COUNT, - PROJECT_CLOSED_RATIO, - MAX( DATE_ID ) + PROJECT_CLOSED_RATIO FROM fact_party_member_vanguard_agency_daily a INNER JOIN dim_agency b ON a.AGENCY_ID = b.ID WHERE a.AGENCY_ID = #{agencyId} + AND a.DATE_ID = #{dateId} GROUP BY AGENCY_ID ) a @@ -438,13 +438,13 @@ PROJECT_COUNT, PROJECT_RATIO, PROJECT_CLOSED_COUNT, - PROJECT_CLOSED_RATIO, - MAX( DATE_ID ) + PROJECT_CLOSED_RATIO FROM fact_party_member_vanguard_grid_daily a INNER JOIN dim_grid b ON a.GRID_ID = b.ID WHERE a.GRID_ID = #{grid} + AND a.DATE_ID = #{dateId} GROUP BY GRID_ID ) a @@ -481,13 +481,13 @@ PROJECT_COUNT, PROJECT_RATIO, PROJECT_CLOSED_COUNT, - PROJECT_CLOSED_RATIO, - MAX( DATE_ID ) + PROJECT_CLOSED_RATIO FROM fact_party_member_vanguard_agency_daily a INNER JOIN dim_agency b ON a.AGENCY_ID = b.ID WHERE a.PID = #{agencyId} + AND a.DATE_ID = #{dateId} GROUP BY AGENCY_ID ) a @@ -525,13 +525,13 @@ PROJECT_COUNT, PROJECT_RATIO, PROJECT_CLOSED_COUNT, - PROJECT_CLOSED_RATIO, - MAX( DATE_ID ) + PROJECT_CLOSED_RATIO FROM fact_party_member_vanguard_grid_daily a INNER JOIN dim_grid b ON a.GRID_ID = b.ID WHERE a.AGENCY_ID = #{agencyId} + AND a.DATE_ID = #{dateId} GROUP BY GRID_ID ) a @@ -797,4 +797,205 @@ GROUP BY staff_id + + + + + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/AcUserAuthorizeDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/AcUserAuthorizeDao.xml new file mode 100644 index 0000000000..1cc4a2cb90 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/AcUserAuthorizeDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/AcUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/AcUserDao.xml new file mode 100644 index 0000000000..4f535b8f2e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/AcUserDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrProjectTemplateCategoryDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrProjectTemplateCategoryDao.xml new file mode 100644 index 0000000000..96c8a210a6 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrProjectTemplateCategoryDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrProjectTemplateDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrProjectTemplateDao.xml new file mode 100644 index 0000000000..c30a76a1f1 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrProjectTemplateDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrProjectTemplateItemDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrProjectTemplateItemDao.xml new file mode 100644 index 0000000000..197a181c03 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrProjectTemplateItemDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrProjectThemeDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrProjectThemeDao.xml new file mode 100644 index 0000000000..8f4279bdb3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrProjectThemeDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrPublishRangeDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrPublishRangeDao.xml new file mode 100644 index 0000000000..cc492bd0c7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrPublishRangeDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrResultExtDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrResultExtDao.xml new file mode 100644 index 0000000000..55290a422c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrResultExtDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectDao.xml new file mode 100644 index 0000000000..48bd2f41bc --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectDao.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectItemDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectItemDao.xml new file mode 100644 index 0000000000..f607213e79 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectItemDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectLogicDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectLogicDao.xml new file mode 100644 index 0000000000..79457b8115 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectLogicDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectResultDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectResultDao.xml new file mode 100644 index 0000000000..76fc783368 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectResultDao.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectSettingDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectSettingDao.xml new file mode 100644 index 0000000000..690165fcd8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectSettingDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectThemeDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectThemeDao.xml new file mode 100644 index 0000000000..aacfe09e64 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectThemeDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrVistRecordDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrVistRecordDao.xml new file mode 100644 index 0000000000..8ea675b0e9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrVistRecordDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/WxMpUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/WxMpUserDao.xml new file mode 100644 index 0000000000..c4886d8ded --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/WxMpUserDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml index 07039eeed0..a4ebcae961 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml @@ -61,7 +61,7 @@ SELECT DISTINCT sr.staff_id, cs.created_time, - case when gsr.role_key = + case when cs.enable_flag = 'enable' AND gsr.role_key = 'agency_leader' @@ -73,9 +73,14 @@ 'grid_manager' - then 1 else 0 end is_first + then 0 + when cs.enable_flag = 'enable' AND gsr.role_key != 'agency_leader' + then 1 else 2 end is_first FROM staff_role sr INNER JOIN customer_staff cs ON sr.staff_id = cs.user_id + + AND cs.enable_flag = 'enable' + INNER JOIN gov_staff_role gsr ON sr.role_id = gsr.id AND gsr.customer_id = #{customerId} WHERE sr.del_flag = '0' @@ -100,7 +105,7 @@ ) t GROUP BY t.staff_id - ORDER BY t.is_first ]]> 1, t.created_time desc + ORDER BY t.is_first ]]> 0, t.is_first asc, t.created_time desc LIMIT #{pageNo}, #{pageSize} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StatsStaffPatrolRecordDailyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StatsStaffPatrolRecordDailyDao.xml index 5642d17f40..b3f6e59aa9 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StatsStaffPatrolRecordDailyDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StatsStaffPatrolRecordDailyDao.xml @@ -15,4 +15,45 @@ + + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml index 7ad70627dc..afa7e56c2d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml @@ -175,4 +175,11 @@ + + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml index 2573d8b674..7a0760d0a3 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml @@ -142,4 +142,148 @@ SELECT STAFF_ID,ORG_ID,ORG_TYPE FROM staff_org_relation WHERE del_flag = '0' AND staff_id = #{staffId} + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AdvancedBranchRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AdvancedBranchRankFormDTO.java index cd3cf536af..a3116f7c96 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AdvancedBranchRankFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AdvancedBranchRankFormDTO.java @@ -24,7 +24,7 @@ public class AdvancedBranchRankFormDTO implements Serializable { @Min(value = 1, message = "查询条数必须大于0", groups = {AdvancedBranchRankFormDTO.AddUserInternalGroup.class }) private Integer topNum; /** - * 月份Id + * 月份Id 没有月份传参时查询的是上一个月的数据 * */ private String monthId; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java index 5e4d3e9cc4..a47f3e2cb1 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java @@ -31,5 +31,10 @@ public class PartyPointRankFormDTO implements Serializable { private Integer topNum; public interface AddUserInternalGroup {} + /** + * 月份Id 没有月份传参时查询的是上一个月的数据 + * */ + private String monthId; + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/UserPointRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/UserPointRankFormDTO.java index cc1ad2bd36..397f50aa7d 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/UserPointRankFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/UserPointRankFormDTO.java @@ -31,5 +31,10 @@ public class UserPointRankFormDTO implements Serializable { private Integer topNum; public interface AddUserInternalGroup {} + /** + * 月份Id 没有月份传参时查询的是上一个月的数据 + * */ + private String monthId; + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index 95446fac0d..aa6c86490c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -380,7 +380,9 @@ public class IndexServiceImpl implements IndexService { public List advancedBranchRank(AdvancedBranchRankFormDTO formDTO) { //根据当前所选组织,查询screen_index_data_monthly中类型为网格的按照总指数倒序,关联screen_org_rank_data表取其他数据 //1.级联查询组织下所有网格的先进支部排行数据,按总指数降序 - formDTO.setMonthId(DateUtils.getBeforeNMonth(1)); + if (StringUtils.isBlank(formDTO.getMonthId())) { + formDTO.setMonthId(DateUtils.getBeforeNMonth(1)); + } List list = screenIndexDataMonthlyDao.selectRankList(formDTO); //2.遍历数据,小数保留一位小数,百分数添加百分号 NumberFormat nf = NumberFormat.getPercentInstance(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java index f5184b653a..2b12a4344e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java @@ -64,6 +64,6 @@ public interface FactGroupAgencyDailyDao extends BaseDao agencyList,String customerId) { - if (agencyList.size() != NumConstant.ZERO){ - baseDao.deleteInsertAgencyDailyByDateId(agencyList.get(NumConstant.ZERO).getDateId(),customerId); - baseDao.insertGroupAgencyDaily(agencyList); + if (!CollectionUtils.isEmpty(agencyList)){ + Integer delNum; + do { + delNum = baseDao.deleteInsertAgencyDailyByDateId(agencyList.get(NumConstant.ZERO).getDateId(),customerId); + }while (delNum > NumConstant.ZERO && delNum == NumConstant.ONE_THOUSAND); + List> partition = ListUtils.partition(agencyList, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseDao.insertGroupAgencyDaily(p); + }); } - } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml index fbdcbe322e..229b7daa24 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml @@ -122,6 +122,7 @@ WHERE date_id = #{dateId} AND customer_id = #{customerId} + LIMIT 1000 \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index 15f6ee311f..b552ee29bc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -21,6 +21,7 @@ import com.epmet.commons.tools.utils.*; import com.epmet.constant.ActConstant; import com.epmet.constant.ActMessageConstant; import com.epmet.constant.ReadFlagConstant; +import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dao.*; import com.epmet.dto.*; import com.epmet.dto.form.UserMessageFormDTO; @@ -32,7 +33,6 @@ import com.epmet.entity.*; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.*; -import com.epmet.utils.ModuleConstant; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -694,6 +694,11 @@ public class WorkActServiceImpl implements WorkActService { userMessageFormDTO.setMessageContent(String.format(ActMessageConstant.ACT_CANCELED, actInfoDTO.getTitle(), formDTO.getCancelReason())); + + //21.09.10:记录消息类型和对应的业务id + userMessageFormDTO.setMessageType(UserMessageTypeConstant.HEART_CANCEL_ACT); + userMessageFormDTO.setTargetId(formDTO.getActId()); + userMessageFormDTOS.add(userMessageFormDTO); //2020.10.26 添加发送微信订阅消息功能 sun WxSubscribeMessageFormDTO dto = new WxSubscribeMessageFormDTO(); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java index 735c82dda1..2a67649019 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.ActConstant; import com.epmet.constant.ActMessageConstant; import com.epmet.constant.ReadFlagConstant; +import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dao.ActInfoDao; import com.epmet.dao.ActUserLogDao; import com.epmet.dao.ActUserRelationDao; @@ -639,6 +640,11 @@ public class WorkActUserServiceImpl implements WorkActUserService { } else if (ActConstant.ACT_USER_STATUS_REFUSED.equals(type)) { userMessageFormDTO.setMessageContent(String.format(ActMessageConstant.AUDIT_REFUSED, actInfo.getTitle(), actUserRelationEntity.getFailureReason())); } + + //21.09.10:记录消息类型和对应的业务id + userMessageFormDTO.setMessageType(UserMessageTypeConstant.HEART_SIGIN_UP_RES); + userMessageFormDTO.setTargetId(actUserRelationEntity.getId()); + Result result = epmetMessageOpenFeignClient.saveUserMessage(userMessageFormDTO); if (result.success()) { logger.info("审核成功,已成功发送站内信"); diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml index aa0d5545ed..e0dc62b7f0 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml @@ -113,7 +113,7 @@ hystrix: execution: isolation: thread: - timeoutInMilliseconds: 90000 #缺省为1000 + timeoutInMilliseconds: 600000 #缺省为1000 ribbon: ReadTimeout: 300000 diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java index 1dcdce9821..adcea05711 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java @@ -16,9 +16,179 @@ public interface UserMessageTypeConstant { /** * 居民端提交热心居民申请,通知网格长 + * targetId:resi_warmhearted_apply.id */ String WARMHEARTED_APPLY="warmhearted_apply"; + /** + * 工作端审核完热心居民申请,通知居民结果 + * targetId:resi_warmhearted_apply.id + */ + String WARMHEARTED_APPLY_RES="warmhearted_apply_res"; + + + /** + * 居民端认证党员时,补充信息填写完成提交后,通知网格长,人工审核党员申请 + * targetId:partymember_info.id + */ + String PARTY_CERTIFY_APPLY="party_certify_apply"; + + /** + * 工作端审核居民是否是党员,通知居民。 + * targetId:partymember_info.id + */ + String PARTY_CERTIFY_APPLY_RES="party_certify_apply_res"; + + + + /** + * 居民端用户申请创建小组,提交小组信息后,通知网格长 + * targetId:resi_group.id + */ + String GROUP_CREATE_GROUP_APPLY="group_create_group_apply"; + + /** + * 工作端审核建群申请后,通知建组人结果 + * targetId:resi_group.id + */ + String GROUP_CREATE_GROUP_RES="group_create_group_res"; + + /** + * 居民单申请入群,通知组长审核 + * targetId:resi_group.id + */ + String GROUP_APPLY_ENTER="group_apply_enter"; + + /** + * 组长审核完入群申请,通知居民结果 + * targetId:resi_group.id + */ + String GROUP_APPLY_ENTER_RES="group_apply_enter_res"; + + /** + * 组员通过连接自动入组的,通知组长 + * targetId:resi_group.id + */ + String GROUP_ENTER_GROUP_BY_LINK_RES="group_enter_group_by_link_res"; + + /** + * 组内发布活动 + * targetId:group_act_info.id + */ + String GROUP_ACT_PUBLISH="group_act_publish"; + /** + * 组内发布活动,进行编辑 + * targetId:group_act_info.id + */ + String GROUP_ACT_CHANGE="group_act_change"; + /** + * 组内活动,取消 + * targetId:group_act_info.id + */ + String GROUP_ACT_CANCEL="group_act_cancel"; + + /** + * 工作端转交组长,通知原组长 + * targetId:resi_group.id + */ + String GROUP_ORIGINAL_LEADER_DOWN="group_original_leader_down"; + /** + * 新任组长,告诉他这个好消息 + * targetId:resi_group.id + */ + String GROUP_NEW_LEADER_UP="group_new_leader_up"; + /** + * 禁言组员 + * targetId:resi_group.id + */ + String GROUP_SLIENT_MEMBER="group_slient_member"; + + /** + * 发布小组内通知 + * targetId:notice.id + */ + String GROUP_MESSAGE_PUBLISH="group_message_publish"; + /** + * 发布小组内通知 + * targetId:notice.id + */ + String GROUP_MESSAGE_EDIT="group_message_edit"; + + + + + /** + * 关闭议题时,已解决或者无需解决,通知议题发起人、话题创建人 + * targetId:issue.id + */ + String ISSUE_CLOSE_ISSUE="issue_close_issue"; + + /** + * 议题转项目时给话题创建人、议题发起人、勾选的工作人员分别推送消息 + * targetId:居民端用户:issue.id工作端:project.id + */ + String ISSUE_SHIFT_PROJECT="issue_shift_project"; + /** + * 项目流转 + * targetId:project.id + */ + String PROJECT_TRANSFER="project_transfer"; + + /** + * 项目结案 + * targetId:project.id + */ + String PROJECT_CLOSED="project_closed"; + + /** + * 项目退回 + * targetId:project.id + */ + String PROJECT_RETURN="project_return"; + + /** + * 项目立项 + * targetId:project.id + */ + String PROJECT_APPROVAL="project_approval"; + /** + * 事件立项 + * targetId:project.id + */ + String PROJECT_FROM_RESI_EVENT="project_from_resi_event"; + + /** + * 项目滞留超期提醒 + */ + String PROJECT_REMIND="project_remind"; + + + + /** + * 发布党建声音 + * targetId:article.DRAFT_ID + */ + String PARTY_VOICE_PUBLISH="party_voice_publish"; + + + + /** + * 爱心互助:通过审核的用户,发送消息 + * targetId:act_info.id + */ + String HEART_CANCEL_ACT="heart_cancel_act"; + /** + * 活动报名结果通知居民 + * act_user_relation.id + */ + String HEART_SIGIN_UP_RES="heart_sigin_up_res"; + + + /** + * 居民端提交徽章认证申请 + * user_badge_certificate_record.id + */ + String BADGE_AUTH_APPLY="badge_auth_apply"; } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/UserMessageDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/UserMessageDTO.java index d44c80ae47..2a86b7a7d3 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/UserMessageDTO.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/UserMessageDTO.java @@ -109,4 +109,12 @@ public class UserMessageDTO implements Serializable { */ private Date updatedTime; + /** + * 消息分类:info-上传下达消息 详见UserMessageTypeConstant + */ + private String messageType; + /** + * 消息对应的业务id,比如message_type=info时,此列存储的是消息id,可跳转到消息详情 + */ + private String targetId; } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ReceiverGroupCommonFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ReceiverGroupCommonFormDTO.java new file mode 100644 index 0000000000..afcf24e16e --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ReceiverGroupCommonFormDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.util.List; +import java.util.Set; + +/** + * @Description 通用的ReceiverGroup 入参dto + * @author wxz + * @date 2021.09.11 22:03:02 +*/ +@Data +public class ReceiverGroupCommonFormDTO { + + public interface UpdateGroup {} + public interface RemoveMember {} + public interface AddMember {} + public interface DeleteGroup {} + + /** 群id */ + @NotBlank(message = "群ID不能为空", groups = { UpdateGroup.class, AddMember.class, RemoveMember.class, DeleteGroup.class }) + private String receiverGroupId; + + /** 群名字 */ + @NotBlank(message = "群名字不能为空", groups = { UpdateGroup.class }) + private String name; + + /** 成员id */ + @NotBlank(message = "组成员ID不能为空", groups = { RemoveMember.class }) + private String staffId; + + /** 成员ID列表 */ + private List staffIdList; + + /** + * 按架构选择的,组织或者网格或者部门的集合 + */ + private Set orgList; + +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/UserMessageFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/UserMessageFormDTO.java index e00bb88342..309a1222cc 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/UserMessageFormDTO.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/UserMessageFormDTO.java @@ -1,8 +1,6 @@ package com.epmet.dto.form; -import lombok.Builder; import lombok.Data; -import net.bytebuddy.implementation.bind.annotation.Default; import javax.validation.constraints.NotBlank; import java.io.Serializable; @@ -61,4 +59,13 @@ public class UserMessageFormDTO implements Serializable { * 调用者 【分内部调用和外部调用,内部调用值为空,外部默认为:外挂-站内信】 */ private String referer; + + /** + * 消息分类:info-上传下达消息 详见UserMessageTypeConstant + */ + private String messageType; + /** + * 消息对应的业务id,比如message_type=info时,此列存储的是消息id,可跳转到消息详情 + */ + private String targetId; } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/ReceiverGroupCommonResultDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/ReceiverGroupCommonResultDTO.java new file mode 100644 index 0000000000..5d072c938d --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/ReceiverGroupCommonResultDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.result; + +import lombok.Data; + +/** + * @Description 群通用Result dto + * @author wxz + * @date 2021.09.11 22:08:36 +*/ +@Data +public class ReceiverGroupCommonResultDTO { + + private String receiverGroupId; + private String name; + +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/StaffMessageResultDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/StaffMessageResultDTO.java index 43a31a5e00..0e29e1175f 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/StaffMessageResultDTO.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/StaffMessageResultDTO.java @@ -35,5 +35,17 @@ public class StaffMessageResultDTO implements Serializable { * 通知时间 */ private Long createdTime; + + + + + /** + * 消息分类:info-上传下达消息 详见UserMessageTypeConstant + */ + private String messageType; + /** + * 消息对应的业务id,比如message_type=info时,此列存储的是消息id,可跳转到消息详情 + */ + private String targetId; } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/InfoController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/InfoController.java index 25b0414b59..81bd630e91 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/InfoController.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/InfoController.java @@ -33,6 +33,10 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.validation.constraints.NotBlank; +import java.util.List; +import java.util.Set; + /** * 消息主表 @@ -139,10 +143,83 @@ public class InfoController { return new Result().ok(infoService.addReceiverGroup(formDTO)); } + /** + * @description 【发送消息】更新群信息 + * + * @param form + * @param tokenDto + * @return + * @author wxz + * @date 2021.09.11 22:05:08 + */ + @PostMapping("/receivergroup/update") + public Result updateInfoReceiverGroup(@RequestBody ReceiverGroupCommonFormDTO form, @LoginUser TokenDto tokenDto) { + ValidatorUtils.validateEntity(form, ReceiverGroupCommonFormDTO.UpdateGroup.class); + String userId = tokenDto.getUserId(); + String receiverGroupId = form.getReceiverGroupId(); + String name = form.getName(); + + infoService.updateReceiverGroup(userId, receiverGroupId, name); + return new Result(); + } + /** + * @description 【发送消息】移除群成员 + * + * @param form + * @param tokenDto + * @return + * @author wxz + * @date 2021.09.11 22:26:44 + */ + @PostMapping("/receivergroup/member/remove") + public Result removeInfoGroupMember(@RequestBody ReceiverGroupCommonFormDTO form, @LoginUser TokenDto tokenDto) { + ValidatorUtils.validateEntity(form, ReceiverGroupCommonFormDTO.RemoveMember.class); + String userId = tokenDto.getUserId(); + String receiverGroupId = form.getReceiverGroupId(); + String staffId = form.getStaffId(); + infoService.removeGroupMember(receiverGroupId, staffId, userId); + return new Result(); + } + /** + * @description 【发送消息】添加新成员 + * + * @param form + * @param tokenDto + * @return + * @author wxz + * @date 2021.09.13 13:54:02 + */ + @PostMapping("/receivergroup/member/add") + public Result addInfoGroupMember(@RequestBody ReceiverGroupCommonFormDTO form, @LoginUser TokenDto tokenDto) { + ValidatorUtils.validateEntity(form, ReceiverGroupCommonFormDTO.AddMember.class); + String userId = tokenDto.getUserId(); + String receiverGroupId = form.getReceiverGroupId(); + Set orgList = form.getOrgList(); + List staffIdList = form.getStaffIdList(); + + infoService.addInfoGroupMember(receiverGroupId, userId, orgList, staffIdList); + return new Result(); + } - + /** + * @description 【发送消息】删除群组 + * + * @param form + * @param tokenDto + * @return + * @author wxz + * @date 2021.09.11 22:35:21 + */ + @PostMapping("/receivergroup/remove") + public Result deleteInfoGroup(@RequestBody ReceiverGroupCommonFormDTO form, @LoginUser TokenDto tokenDto) { + ValidatorUtils.validateEntity(form, ReceiverGroupCommonFormDTO.DeleteGroup.class); + String operatorId = tokenDto.getUserId(); + String receiverGroupId = form.getReceiverGroupId(); + infoService.deleteInfoGroup(receiverGroupId, operatorId); + return new Result(); + } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/InfoService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/InfoService.java index 601cbb4ab0..277bb43a64 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/InfoService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/InfoService.java @@ -20,10 +20,14 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.form.*; import com.epmet.dto.result.AddReceiverGroupResultDTO; +import com.epmet.dto.result.ReceiverGroupCommonResultDTO; import com.epmet.dto.result.ReplyInfoResultDTO; import com.epmet.dto.result.SendInfoResultDTO; import com.epmet.entity.InfoEntity; +import java.util.List; +import java.util.Set; + /** * 消息主表 * @@ -81,4 +85,53 @@ public interface InfoService extends BaseService { * @date 2021/8/20 9:58 上午 */ AddReceiverGroupResultDTO addReceiverGroup(AddReceiverGroupFormDTO formDTO); + + /** + * @description 更新群信息 + * + * @param operatorId + * @param receiverGroupId + * @param name + * @return + * @author wxz + * @date 2021.09.11 22:07:25 + */ + void updateReceiverGroup(String operatorId, String receiverGroupId, String name); + + /** + * @description 移除群成员 + * + * @param receiverGroupId + * + * @param staffId + * @param operatorId + * @return + * @author wxz + * @date 2021.09.11 22:27:16 + */ + void removeGroupMember(String receiverGroupId, String staffId, String operatorId); + + /** + * @description 删除群 + * + * @param receiverGroupId + * @param operatorId + * @return + * @author wxz + * @date 2021.09.11 22:36:27 + */ + void deleteInfoGroup(String receiverGroupId, String operatorId); + + /** + * @description 【发送消息】添加新成员 + * + * @param receiverGroupId + * @param operatorId + * @param orgList + * @param staffIdList + * @return + * @author wxz + * @date 2021.09.13 13:54:45 + */ + void addInfoGroupMember(String receiverGroupId, String operatorId, Set orgList, List staffIdList); } \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/InfoServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/InfoServiceImpl.java index 292cf37b2d..1b15da4495 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/InfoServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/InfoServiceImpl.java @@ -17,6 +17,8 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.NumConstant; @@ -31,6 +33,7 @@ import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dao.*; import com.epmet.dto.form.*; import com.epmet.dto.result.AddReceiverGroupResultDTO; +import com.epmet.dto.result.ReceiverGroupCommonResultDTO; import com.epmet.dto.result.ReplyInfoResultDTO; import com.epmet.dto.result.SendInfoResultDTO; import com.epmet.entity.*; @@ -44,9 +47,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Collections; -import java.util.LinkedHashSet; -import java.util.Set; +import java.util.*; +import java.util.stream.Collectors; /** * 消息主表 @@ -428,20 +430,100 @@ public class InfoServiceImpl extends BaseServiceImpl implem } + @Override + public void updateReceiverGroup(String operatorId, String receiverGroupId, String name) { + InfoReceiverGroupEntity groupEntity = baseValidate(receiverGroupId, operatorId); + // 检查重名 + if (infoReceiverGroupDao.selectCountName(name.trim(),groupEntity.getCustomerId(),operatorId) > 1) { + throw new RenException(EpmetErrorCode.INFO_GROUP_NAME_EXISTS.getCode(), EpmetErrorCode.INFO_GROUP_NAME_EXISTS.getMsg()); + } + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(InfoReceiverGroupEntity::getId, receiverGroupId); + updateWrapper.set(InfoReceiverGroupEntity::getName, name); + infoReceiverGroupDao.update(null, updateWrapper); + } + @Override + public void removeGroupMember(String receiverGroupId, String staffId, String operatorId) { + baseValidate(receiverGroupId, operatorId); + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(InfoGroupReceiversEntity::getStaffId, staffId); + query.eq(InfoGroupReceiversEntity::getInfoReceiverGroupId, receiverGroupId); + infoGroupReceiversDao.delete(query); + } + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteInfoGroup(String receiverGroupId, String operatorId) { + baseValidate(receiverGroupId, operatorId); + // 1.先删除群 + infoReceiverGroupDao.deleteById(receiverGroupId); + // 2.再删除成员 + LambdaQueryWrapper query = new LambdaQueryWrapper(); + query.eq(InfoGroupReceiversEntity::getInfoReceiverGroupId, receiverGroupId); + infoGroupReceiversDao.delete(query); + } + @Override + @Transactional + public void addInfoGroupMember(String receiverGroupId, String operatorId, Set orgList, List staffIdList) { + InfoReceiverGroupEntity groupInfo = baseValidate(receiverGroupId, operatorId); + // 1、人员列表和组织列表不能同时为空 + if (CollectionUtils.isEmpty(staffIdList) && CollectionUtils.isEmpty(orgList)) { + throw new RenException(EpmetErrorCode.PLEASE_CHOOSE_MEMBER.getCode(), EpmetErrorCode.PLEASE_CHOOSE_MEMBER.getMsg()); + } + // 2、如果没有单选人,选择的组织内也没有人,那么给出提示 + Set orgStaffIds = queryOrgStaffIds(groupInfo.getCustomerId(), orgList); + if (CollectionUtils.isEmpty(staffIdList) && CollectionUtils.isEmpty(orgStaffIds)) { + throw new RenException(EpmetErrorCode.PLEASE_CHOOSE_MEMBER.getCode(), EpmetErrorCode.PLEASE_CHOOSE_MEMBER.getMsg()); + } + // 3、用户合并,去重,如果当前用户也在所选成员中,去掉当前用户,不给自己发消息 + Set members = new LinkedHashSet<>(CollectionUtils.size(staffIdList) + orgStaffIds.size()); + members.addAll(staffIdList); + members.addAll(orgStaffIds); + if (CollectionUtils.isNotEmpty(members) && members.contains(operatorId)) { + members.remove(operatorId); + } + if (CollectionUtils.isEmpty(members)) { + throw new RenException(EpmetErrorCode.PLEASE_CHOOSE_MEMBER.getCode(), EpmetErrorCode.PLEASE_CHOOSE_MEMBER.getMsg()); + } + // 4、现有成员去重 + Set existingStaffIds = infoGroupReceiversDao.selectStaffIds(new HashSet<>(Arrays.asList(receiverGroupId))); + members = members.stream().filter(mId -> !existingStaffIds.contains(mId)).collect(Collectors.toSet()); + // 5、插入新成员 + members.forEach(memStaffId->{ + InfoGroupReceiversEntity memberEntity=new InfoGroupReceiversEntity(); + memberEntity.setCustomerId(groupInfo.getCustomerId()); + memberEntity.setInfoReceiverGroupId(receiverGroupId); + memberEntity.setStaffId(memStaffId); + infoGroupReceiversDao.insert(memberEntity); + }); + } - - - - - - + /** + * @description 基础检查,并且返回组信息 + * + * @param receiverGroupId + * @param operatorId + * @return + * @author wxz + * @date 2021.09.13 13:48:26 + */ + private InfoReceiverGroupEntity baseValidate(String receiverGroupId, String operatorId) { + InfoReceiverGroupEntity groupEntity = infoReceiverGroupDao.selectById(receiverGroupId); + if (groupEntity == null) { + throw new RenException(EpmetErrorCode.INFO_GROUP_NOT_EXISTS.getCode(), "群不存在"); + } + if (!groupEntity.getCreateStaffId().equals(operatorId)) { + // 不是拥有者 ,不允许删除 + throw new RenException(EpmetErrorCode.INFO_GROUP_OPE_PERMISSION_REQUIRED.getCode(), "只有群所有者可以进行此操作"); + } + return groupEntity; + } } \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/logback-spring.xml index ee1f62a8ef..00797f713e 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/logback-spring.xml @@ -139,7 +139,7 @@ - + diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml index fa4266f1e7..7aca569542 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml @@ -35,7 +35,9 @@ customer_id, created_time, grid_id, - message_content + message_content, + message_type, + target_id FROM user_message WHERE @@ -66,7 +68,9 @@ title, message_content as messageContent, read_flag as readFlag, - unix_timestamp(CREATED_TIME) as createdTime + unix_timestamp(CREATED_TIME) as createdTime, + message_type AS messageType, + target_id AS targetId from user_message where diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 91d309774d..47be7d427a 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -392,4 +392,35 @@ public class OssController { return ossService.uploadImgV2(file, PrivacyType.EXTERNAL, customerId); } + /** + * @Description 办事指南上传附件 + * @Param file + * @Param customerId + * @Return {@link Result< UploadImgResultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/8 17:14 + */ + @PostMapping("upload-guide-file") + public Result uploadGuideFile(@RequestPart(value = "file") MultipartFile file, @RequestParam("customerId") String customerId) { + String fileName = file.getOriginalFilename(); + String format = "-" + fileName.substring(fileName.lastIndexOf(".") + NumConstant.ONE) + "-"; + format = format.toLowerCase(); + // 体积限制 + int sizeMb = 10; + // 大小限制10m + int sizeThreshold = sizeMb * 1024 * 1024; + if (file.getSize() > sizeThreshold) { + throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode(), + EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg().concat(",限制在").concat(String.valueOf(sizeMb)).concat("M以内")); + } + + // 格式限制,只允许png和jpeg + if (!ModuleConstant.GUIDE_FILE_DOC.contains(format)) { + throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode() + , EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg()); + } + + return ossService.uploadImgV2(file, PrivacyType.EXTERNAL, customerId); + } + } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java index 07a11d9ed7..71d5f177e2 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -43,6 +43,7 @@ public interface ModuleConstant extends Constant { * 项目附件-允许的文件类型 */ String PROJECT_FILE_DOC = "-pdf-ppt-pptx-doc-docx-xls-xlsx-"; + String GUIDE_FILE_DOC = "-pdf-doc-docx-xls-xlsx-"; /** * 项目附件-允许的音频类型 */ diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/BizPointUserTotalDetailDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/BizPointUserTotalDetailDTO.java index 3e5dc04f11..fde907f861 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/BizPointUserTotalDetailDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/BizPointUserTotalDetailDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -103,4 +104,6 @@ public class BizPointUserTotalDetailDTO implements Serializable { */ private Date updatedTime; + private String rank; + } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AllPartyFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AllPartyFormDTO.java new file mode 100644 index 0000000000..ebfea4f918 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AllPartyFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/9/6 3:13 下午 + * @DESC + */ +@Data +public class AllPartyFormDTO implements Serializable { + + private static final long serialVersionUID = -600409785611581009L; + + + /** + * 页码 + **/ + private Integer pageNo = NumConstant.ONE; + + /** + * 每页数据条数 + **/ + private Integer pageSize = NumConstant.TEN; + + /** + * 本月 monthly 总排行 all; + * */ + private String type; + + /** + * 认证成功的党员 的用户ID + * */ + private List userIds; + + /** + * 客户ID + */ + private String customerId; + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java index b727bb5d1b..ccf55babfa 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto.form; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.sun.webkit.LoadListenerClient; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -17,8 +18,20 @@ public class GroupPointFormDTO implements Serializable { public interface GroupPoint extends CustomerClientShowGroup {} public interface GridRank extends CustomerClientShowGroup {} + public interface PointRank extends CustomerClientShowGroup {} + public interface GridScopeRank {} + public interface CustomerScopeRank {} + public interface MyGroupRank {} @NotBlank(message = "小组Id不能为空", groups = {GroupPoint.class, GridRank.class}) private String groupId; - @NotBlank(message = "网格Id不能为空", groups = {GridRank.class}) + @NotBlank(message = "网格Id不能为空", groups = {GridRank.class, PointRank.class, GridScopeRank.class, MyGroupRank.class}) private String gridId; + @NotBlank(message = "客户Id不能为空", groups = {CustomerScopeRank.class}) + private String customerId; + + /** 页码 */ + private Integer pageNo = 1; + + /** 单页条数 */ + private Integer pageSize = 10; } diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/AllPartyResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/AllPartyResultDTO.java new file mode 100644 index 0000000000..a8aabab703 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/AllPartyResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/6 3:12 下午 + * @DESC + */ +@Data +public class AllPartyResultDTO implements Serializable { + + private static final long serialVersionUID = -5889648842876122793L; + + /** + * 排序 + **/ + private Integer ranking; + + /** + * 积分 + **/ + private Integer point; + + /** + * 头像 + **/ + private String userHeadPhoto; + + /** + * 名称 + **/ + private String realName; + + /** + * 用户id + **/ + private String userId; + + public AllPartyResultDTO() { + this.point = NumConstant.ZERO; + this.userHeadPhoto = ""; + this.realName = ""; + this.userId = ""; + } +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GridPointRankResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GridPointRankResultDTO.java new file mode 100644 index 0000000000..2ef1819bcc --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GridPointRankResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/10 14:11 + */ +@NoArgsConstructor +@Data +public class GridPointRankResultDTO implements Serializable { + + private static final long serialVersionUID = 3288606889536923166L; + private String gridName; + private String agencyRank; + private String customerRank; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GroupPointRankingResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GroupPointRankingResultDTO.java index 275a5917ba..127686b68c 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GroupPointRankingResultDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GroupPointRankingResultDTO.java @@ -35,4 +35,25 @@ public class GroupPointRankingResultDTO implements Serializable { * 小组ID */ private String groupId; + + /** 头像 */ + private String groupHeadPhoto; + + /** 类型 branch 支部小组;o */ + private String groupType; + + /** 所属网格id */ + private String gridId; + + /** 所属网格名称 */ + private String gridNamePath; + + /** 网格内排名 */ + private Integer gridRanking; + + /** 客户下总排名 */ + private Integer customerRanking; + + /** 我是否是组长 */ + private String groupLeaderFlag; } diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/MyPointRankResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/MyPointRankResultDTO.java new file mode 100644 index 0000000000..2eb5afc433 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/MyPointRankResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/10 13:44 + */ +@NoArgsConstructor +@Data +public class MyPointRankResultDTO implements Serializable { + + private static final long serialVersionUID = -2438231097029179782L; + private String headPhoto; + private String gridRank; + private String customerRank; + private String userName; +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java index 9fd48f00a1..947741b69d 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java @@ -1,6 +1,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -10,16 +11,20 @@ import com.epmet.dto.result.GroupPointRankingResultDTO; import com.epmet.dto.result.GroupPointRuleResultDTO; import com.epmet.dto.result.PointRankingResultDTO; import com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO; +import com.epmet.resi.group.enums.SearchScopeTypeEnum; import com.epmet.service.BizPointTotalDetailService; import com.epmet.service.BizPointUserTotalDetailService; import com.epmet.service.PointRuleService; import com.epmet.utils.ModuleConstant; +import com.github.pagehelper.PageInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.validation.constraints.NotBlank; +import java.lang.management.MemoryManagerMXBean; import java.util.List; /** @@ -113,4 +118,58 @@ public class GroupPointController { return new Result().ok(result); } + /** + * @description 【小组排名】- 网格范围内 + * + * @param formDTO + * @return + * @author wxz + * @date 2021.09.07 13:35:45 + */ + @PostMapping("grouppointranking/gridscope") + public Result> listGroupPointRandingInGridScope(@RequestBody GroupPointFormDTO formDTO, @LoginUser TokenDto loginUser) { + ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.GridScopeRank.class); + String gridId = formDTO.getGridId(); + Integer pageNo = formDTO.getPageNo(); + Integer pageSize = formDTO.getPageSize(); + + List page = bizPointTotalDetailService.listGroupPointRandingInPercificScope(SearchScopeTypeEnum.GRID, gridId,pageNo, pageSize, loginUser.getUserId()); + return new Result>().ok(page); + } + + /** + * @description 【小组排名】- 客户范围内 + * + * @param formDTO + * @return + * @author wxz + * @date 2021.09.08 09:18:37 + */ + @PostMapping("grouppointranking/customerscope") + public Result> listGroupPointRandingInCustomerScope(@RequestBody GroupPointFormDTO formDTO, @LoginUser TokenDto loginUser) { + ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.CustomerScopeRank.class); + String customerId = formDTO.getCustomerId(); + Integer pageNo = formDTO.getPageNo(); + Integer pageSize = formDTO.getPageSize(); + + List page = bizPointTotalDetailService.listGroupPointRandingInPercificScope(SearchScopeTypeEnum.CUSTOMER, customerId, pageNo, pageSize, loginUser.getUserId()); + return new Result>().ok(page); + } + + /** + * @description 【小组排名】- 列出我所在的小组的积分排名 + * + * @param formDTO + * @return + * @author wxz + * @date 2021.09.08 13:31:09 + */ + @PostMapping("grouppointranking/mygroups") + public Result> listMyGroupPointRanding(@LoginUser TokenDto loginInfo, @RequestBody GroupPointFormDTO formDTO) { + String userId = loginInfo.getUserId(); + ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.MyGroupRank.class); + String gridId = formDTO.getGridId(); + List list = bizPointTotalDetailService.listMyGroupPointRanding(userId, gridId); + return new Result>().ok(list); + } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java index b52a602ede..795f557449 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java @@ -159,6 +159,18 @@ public class ResiPointController { return new Result>().ok(resultDTOS); } + /** + * @Description 全部党员积分排行 + * @Param formDTO + * @author zxc + * @date 2021/9/6 3:30 下午 + */ + @PostMapping("allparty") + public Result> allParty(@RequestBody AllPartyFormDTO formDTO,@LoginUser TokenDto tokenDto){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(userPointStatisticalDailyService.allParty(formDTO)); + } + /** * @return com.epmet.commons.tools.utils.Result> * @param tokenDto @@ -178,4 +190,34 @@ public class ResiPointController { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(pointActionLogService.queryMyPointTaskList(formDTO)); } + + /** + * @Description 个人当月积分在网格和客户中的排名 + * @Param tokenDto + * @Param formDTO + * @Return {@link Result< MyPointTaskResultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/10 14:13 + */ + @PostMapping("mypointrank") + public Result myPointRank(@LoginUser TokenDto tokenDto, @RequestBody GroupPointFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.PointRank.class); + return new Result().ok(userPointStatisticalDailyService.myPointRank(tokenDto, formDTO)); + } + + /** + * @Description 网格当月积分在组织和客户内排名 + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/9/10 14:13 + */ + @PostMapping("gridpointrank") + public Result gridPointRank(@LoginUser TokenDto tokenDto, @RequestBody GroupPointFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.PointRank.class); + return new Result().ok(userPointStatisticalDailyService.gridPointRank(tokenDto, formDTO)); + } + + } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/BizPointTotalDetailDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/BizPointTotalDetailDao.java index 26e05f5a7b..1fb34f99e7 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/BizPointTotalDetailDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/BizPointTotalDetailDao.java @@ -40,4 +40,27 @@ public interface BizPointTotalDetailDao extends BaseDao selectListGridPartyRankByUsablePoint(ResiAroundPartyPointRankFormDTO formDTO); + List selectListGridPartyNewRankByUsablePoint(ResiAroundPartyPointRankFormDTO formDTO); /** * 身边党员-积分排行 :按网格统计,对本月党员增加的积分 进行排序 @@ -82,4 +85,10 @@ public interface UserPointStatisticalDailyDao extends BaseDao selectListGridPartyRankByMonth(ResiAroundPartyPointRankFormDTO formDTO); + List selectListGridPartyNewRankByMonth(ResiAroundPartyPointRankFormDTO formDTO); + + List selectUserPointByMonth(@Param("customerId") String customerId, @Param("agencyId") String agencyId, + @Param("gridId") String gridId); + + List selectGridPointByMonth(@Param("customerId") String customerId, @Param("agencyId") String agencyId); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java index 8a81ff5ffb..a13fa70708 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java @@ -24,6 +24,7 @@ import com.epmet.dto.form.GroupPointFormDTO; import com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO; import com.epmet.dto.result.GroupPointRankingResultDTO; import com.epmet.entity.BizPointTotalDetailEntity; +import com.epmet.resi.group.enums.SearchScopeTypeEnum; import java.util.List; import java.util.Map; @@ -135,4 +136,28 @@ public interface BizPointTotalDetailService extends BaseService listGroupPointRandingInPercificScope(SearchScopeTypeEnum searchScopeType, String searchScopeId, Integer pageNo, Integer pageSize, String currentUserId); + + /** + * @description 【小组排名】- 列出我所在的小组的积分排名 + * + * @param userId + * @param gridId + * @return + * @author wxz + * @date 2021.09.08 13:34:49 + */ + List listMyGroupPointRanding(String userId, String gridId); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java index 6630a87891..a563768be5 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java @@ -19,11 +19,13 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.UserPointStatisticalDailyDTO; +import com.epmet.dto.form.AllPartyFormDTO; +import com.epmet.dto.form.GroupPointFormDTO; import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; -import com.epmet.dto.result.ResiAroundPartyPointRankResultDTO; -import com.epmet.dto.result.ResiPointRankListResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.UserPointStatisticalDailyEntity; import java.util.List; @@ -125,4 +127,32 @@ public interface UserPointStatisticalDailyService extends BaseService listAroundPartyPointRank(ResiAroundPartyPointRankFormDTO formDTO); + + /** + * @Description 全部党员积分排行 + * @Param formDTO + * @author zxc + * @date 2021/9/6 3:30 下午 + */ + List allParty(AllPartyFormDTO formDTO); + + /** + * @Description 个人当月积分在网格和客户中的排名 + * @Param tokenDto + * @Param formDTO + * @Return {@link MyPointRankResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/10 14:18 + */ + MyPointRankResultDTO myPointRank(TokenDto tokenDto, GroupPointFormDTO formDTO); + + /** + * @Description 网格当月积分在组织和客户内排名 + * @Param tokenDto + * @Param formDTO + * @Return {@link GridPointRankResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/10 14:18 + */ + GridPointRankResultDTO gridPointRank(TokenDto tokenDto, GroupPointFormDTO formDTO); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java index c1a7dbe14b..87b7b20a32 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java @@ -17,31 +17,49 @@ package com.epmet.service.impl; +import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.BizPointTotalDetailDao; import com.epmet.dto.BizPointTotalDetailDTO; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.GroupPointFormDTO; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.resi.group.dto.group.form.GroupFormDTO; import com.epmet.resi.group.dto.group.form.GroupPointDetailFormDTO; +import com.epmet.resi.group.dto.group.form.GroupsByMemberFormDTO; +import com.epmet.resi.group.dto.group.result.GroupDetailResultDTO; import com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO; import com.epmet.dto.result.GroupPointRankingResultDTO; import com.epmet.entity.BizPointTotalDetailEntity; import com.epmet.resi.group.dto.group.ResiGroupDTO; +import com.epmet.resi.group.enums.SearchScopeTypeEnum; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.service.BizPointTotalDetailService; import com.epmet.service.BizPointUserTotalDetailService; import com.epmet.service.UserPointActionLogService; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.HashOperations; +import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -57,7 +75,7 @@ import java.util.stream.Collectors; * @since v1.0.0 2021-04-20 */ @Service -public class BizPointTotalDetailServiceImpl extends BaseServiceImpl implements BizPointTotalDetailService { +public class BizPointTotalDetailServiceImpl extends BaseServiceImpl implements BizPointTotalDetailService, ResultDataResolver { @Autowired private ResiGroupOpenFeignClient resiGroupOpenFeignClient; @@ -65,6 +83,12 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl redisTemplate; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private RedisUtils redisUtils; @Override public PageData page(Map params) { @@ -239,4 +263,255 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl listGroupPointRandingInPercificScope(SearchScopeTypeEnum searchScopeType, String searchScopeId, + Integer pageNo, Integer pageSize, + String currentUserId) { + + // 1.查询有积分的小组得分排名 + PageInfo entityPageInfo = PageHelper.startPage(pageNo, pageSize).doSelectPageInfo(() -> { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + if (SearchScopeTypeEnum.CUSTOMER == searchScopeType) { + query.eq(BizPointTotalDetailEntity::getCustomerId, searchScopeId); + } else if (SearchScopeTypeEnum.GRID == searchScopeType) { + query.eq(BizPointTotalDetailEntity::getGridId, searchScopeId); + } + query.eq(BizPointTotalDetailEntity::getBizType, "group"); + query.orderByDesc(BizPointTotalDetailEntity::getTotalPoint); + baseDao.selectList(query); + }); + + List groupList = entityPageInfo.getList(); + + List groupIds = groupList.stream().map(g -> g.getObjectId()).collect(Collectors.toList()); + + // 2.将列表填充基本信息并且转换为dto + List rankingInfoDTOs = convertGroupRankingInfoEntity2DTOs(groupIds, groupList, currentUserId); + + Page page = new Page(pageNo, pageSize); + + // 3.如果不满一页,则填充分数为0的 + if (pageSize > groupIds.size()) { + // 查出网格下已有积分的小组id + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + if (SearchScopeTypeEnum.CUSTOMER == searchScopeType) { + query.eq(BizPointTotalDetailEntity::getCustomerId, searchScopeId); + } else if (SearchScopeTypeEnum.GRID == searchScopeType) { + query.eq(BizPointTotalDetailEntity::getGridId, searchScopeId); + } + query.eq(BizPointTotalDetailEntity::getBizType, "group"); + query.select(BizPointTotalDetailEntity::getObjectId); + List existingGroupIds = baseDao.selectObjs(query).stream().map(obj -> obj.toString()).collect(Collectors.toList()); + + int startRow = page.getStartRow() - existingGroupIds.size(); + // 不足0的从0开始 + startRow = Math.max(startRow, 0); + List gap; + gap = fillGroupPageGap(existingGroupIds, searchScopeType, searchScopeId, startRow, pageSize - groupList.size(), currentUserId); + rankingInfoDTOs.addAll(gap); + } + + // 4.排名填充。有积分的按照积分排序,分数一样的名次一样 + Integer ranking = getStartRanking(rankingInfoDTOs, searchScopeType.getScopeType(), searchScopeId); + Integer prevPoint = null; + for (GroupPointRankingResultDTO g : rankingInfoDTOs) { + Integer point = Integer.valueOf(g.getPoint()); + if (prevPoint != null && prevPoint > point) { + // 此举是为了在积分一样的情况下,给与相同的排名 + ranking ++; + } + + CustomerGridDTO gridInfo = getGridInfo(g.getGridId()); + //g.setGridId(g.getGridId()); + if (gridInfo != null) { + g.setGridNamePath(gridInfo.getGridNamePath()); + } else { + // todo 网格被删除了,应该怎么办? + g.setGridNamePath(" "); + } + g.setRanking(String.valueOf(ranking)); + prevPoint = point; + } + return rankingInfoDTOs; + } + + /** + * @description 获取起始排名 + * + * @param points 积分信息分页列表 + * @return + * @author wxz + * @date 2021.09.16 14:50:11 + */ + private Integer getStartRanking(List points, String scopeType, String scopeObjectId) { + if (CollectionUtils.isEmpty(points)) { + return 0; + } + + GroupPointRankingResultDTO firstPoint = points.get(0); + + if (firstPoint.getPoint().equals("0")) { + // 如果第一条积分就是0,那么查询出来有积分的组的最低名次+1(注意:point_total表不能有积分为0的记录,否则计算出来的名次会比实际名次+1) + Integer minRanking = baseDao.getMinRanking("group", scopeType, scopeObjectId); + return minRanking + 1; + } else { + return baseDao.getRanking("group", firstPoint.getGroupId(), scopeType); + } + } + + /** + * @description 获取分页缺口group ranking信息 + * + * @param startRow + * @param rowCount + * @return + * @author wxz + * @date 2021.09.07 16:30:28 + */ + private List fillGroupPageGap(List existingGroupIds, SearchScopeTypeEnum searchScopeType, + String searchScopeObjectId, Integer startRow, Integer rowCount, String currentUserId) { + GroupFormDTO form = new GroupFormDTO(); + form.setExcludeGroupIds(existingGroupIds); + form.setOrder(GroupFormDTO.OrderTypeEnum.DESC); + form.setSort(GroupFormDTO.SortTypeEnum.CREATE_TIME); + form.setStartRow(startRow); + form.setRowCount(rowCount); + form.setSearchScopeType(searchScopeType); + form.setSearchScopeObjectId(searchScopeObjectId); + + Result> result = resiGroupOpenFeignClient.listGroupDetailsExcludeGroupIds(form); + List groups = getResultDataOrThrowsException(result, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询积分为0的小组列表失败"); + if (CollectionUtils.isEmpty(groups)) { + return new ArrayList<>(); + } + return groups.stream().map(g -> { + GroupPointRankingResultDTO dto = new GroupPointRankingResultDTO(); + dto.setGroupType(g.getGroupType()); + dto.setPoint("0"); + dto.setGroupHeadPhoto(g.getGroupHeadPhoto()); + dto.setGroupName(g.getGroupName()); + dto.setGroupId(g.getGroupId()); + dto.setGridId(g.getGridId()); + dto.setGroupLeaderFlag(g.getLeaderId().equals(currentUserId) ? "leader" : "member"); + return dto; + }).collect(Collectors.toList()); + } + + /** + * @description 将小组排名Entity转化为dto + * + * @param groupList + * @return + * @author wxz + * @date 2021.09.07 15:52:17 + */ + private List convertGroupRankingInfoEntity2DTOs(List groupIds, List groupList, String currentUserId) { + if (CollectionUtils.isEmpty(groupIds)) { + return new ArrayList<>(); + } + + // 查询这些小组的基本信息 + Result> listResult = resiGroupOpenFeignClient.listGroupDetailsByGroupIds(groupIds); + List groupInfos = getResultDataOrThrowsException(listResult, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排行】批量查询小组信息出错"); + + // 将小组基本信息转化为map + HashMap groupMap = new HashMap<>(); + groupInfos.stream().forEach(g -> groupMap.put(g.getGroupId(), g)); + + // 将小组信息填充到排名列表中 + List rankingDTOs = groupList.stream().map(g -> { + GroupDetailResultDTO groupInfo = groupMap.get(g.getObjectId()); + GroupPointRankingResultDTO dto = new GroupPointRankingResultDTO(); + dto.setGroupId(g.getObjectId()); + dto.setGroupName(groupInfo.getGroupName()); + dto.setGroupType(groupInfo.getGroupType()); + dto.setPoint(g.getTotalPoint().toString()); + dto.setGroupHeadPhoto(groupInfo.getGroupHeadPhoto()); + dto.setGridId(g.getGridId()); + dto.setGroupLeaderFlag(groupInfo.getLeaderId().equals(currentUserId) ? "leader" : "member"); + return dto; + }).collect(Collectors.toList()); + return rankingDTOs; + } + + /** + * @description 查询网格信息 + * + * @param gridId + * @return + * @author wxz + * @date 2021.09.08 11:17:17 + */ + public CustomerGridDTO getGridInfo(String gridId) { + String redisKey = RedisKeys.getGridInfoKey(gridId); + Map gridCache = redisUtils.hGetAll(redisKey); + if (gridCache != null && gridCache.size() > 0) { + // 直接取缓存中的 + CustomerGridDTO gridInfo = BeanUtil.mapToBean(gridCache, CustomerGridDTO.class, true); + return gridInfo; + } + + CustomerGridFormDTO form = new CustomerGridFormDTO(); + form.setGridId(gridId); + Result result = govOrgOpenFeignClient.getGridBaseInfoByGridId(form); + return getResultDataOrThrowsException(result, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询网格信息失败"); + } + + @Override + public List listMyGroupPointRanding(String userId, String gridId) { + // 1.查询网格内我所在的小组 + GroupsByMemberFormDTO form = new GroupsByMemberFormDTO(); + form.setGridId(gridId); + form.setUserId(userId); + List groupList = getResultDataOrThrowsException(resiGroupOpenFeignClient.listGroupsByMember(form), + ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【我所在的小组排名】查询组列表失败"); + + if (CollectionUtils.isEmpty(groupList)) { + return new ArrayList(); + } + + // 2.填充分数和排名 + GroupDetailResultDTO firstGroup = groupList.get(0); + + // 网格和客户下,分别有多少个有积分的小组,后面用于给哪些没有任何积分记录的小组排名 + Integer gridMinRanking = baseDao.getMinRanking("group", "grid", gridId); + Integer customerMinRanking = baseDao.getMinRanking("group", "customer", firstGroup.getCustomerId()); + + List groupDtoList = groupList.stream().map(g -> { + // 积分 + Integer point = 0; + // 网格内的排名 + Integer gridRanking = null; + // 客户下的排名 + Integer customerRanking = null; + + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(BizPointTotalDetailEntity::getBizType, "group"); + query.eq(BizPointTotalDetailEntity::getObjectId, g.getGroupId()); + BizPointTotalDetailEntity groupPoint = baseDao.selectOne(query); + if (groupPoint == null) { + // 该小组没有积分 + gridRanking = gridMinRanking + 1; + customerRanking = customerMinRanking + 1; + } else { + // 该小组有积分 + point = groupPoint.getTotalPoint(); + gridRanking = baseDao.getRanking("group", g.getGroupId(), "grid"); + customerRanking = baseDao.getRanking("group", g.getGroupId(), "customer"); + } + + GroupPointRankingResultDTO dto = new GroupPointRankingResultDTO(); + dto.setGridId(g.getGridId()); + dto.setGroupHeadPhoto(g.getGroupHeadPhoto()); + dto.setGroupType(g.getGroupType()); + dto.setGroupId(g.getGroupId()); + dto.setGroupName(g.getGroupName()); + dto.setPoint(point.toString()); + dto.setGridRanking(gridRanking); + dto.setCustomerRanking(customerRanking); + dto.setGroupLeaderFlag(g.getGroupLeaderFlag()); + return dto; + }).collect(Collectors.toList()); + return groupDtoList; + } } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java index 10ed45500f..c6a23b59df 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java @@ -23,11 +23,17 @@ import com.epmet.common.enu.AroundPartyConstant; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.UserPointStatisticalDailyDao; +import com.epmet.dto.BizPointUserTotalDetailDTO; import com.epmet.dto.UserPointStatisticalDailyDTO; +import com.epmet.dto.form.AllPartyFormDTO; +import com.epmet.dto.form.GroupPointFormDTO; import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; import com.epmet.dto.result.*; @@ -41,12 +47,14 @@ import com.epmet.utils.DimIdGenerator; import com.epmet.utils.ModuleConstant; import com.github.pagehelper.PageHelper; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; 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.*; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** @@ -292,6 +300,96 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl allParty(AllPartyFormDTO formDTO) { + formDTO.setPageNo((formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize()); + Result> partyMemberInfosResult = resiPartyMemberOpenFeignClient.getPartyMemberInfoByCustomerId(formDTO.getCustomerId()); + if (!partyMemberInfosResult.success()){ + throw new RenException("查询客户下的党员失败......"); + } + if (CollectionUtils.isEmpty(partyMemberInfosResult.getData())){ + return new ArrayList<>(); + } + List partyMemberInfos = partyMemberInfosResult.getData(); + List userIds = partyMemberInfos.stream().map(m -> m.getUserId()).collect(Collectors.toList()); + ResiAroundPartyPointRankFormDTO selDto = ConvertUtils.sourceToTarget(formDTO, ResiAroundPartyPointRankFormDTO.class); + selDto.setUserIds(userIds); + List resultDTOS = new ArrayList<>(); + if (AroundPartyConstant.ALL.equals(formDTO.getType())){ + resultDTOS = baseDao.selectListGridPartyNewRankByUsablePoint(selDto); + }else if (AroundPartyConstant.MONTHLY.equals(formDTO.getType())){ + resultDTOS = baseDao.selectListGridPartyNewRankByMonth(selDto); + } + List partyBaseInfo = getPartyBaseInfo(ConvertUtils.sourceToTarget(resultDTOS, ResiAroundPartyPointRankResultDTO.class)); + List result = ConvertUtils.sourceToTarget(partyBaseInfo, AllPartyResultDTO.class); + return result; + } + + /** + * @param tokenDto + * @param formDTO + * @Description 个人当月积分在网格和客户中的排名 + * @Param tokenDto + * @Param formDTO + * @Return {@link MyPointRankResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/10 14:18 + */ + @Override + public MyPointRankResultDTO myPointRank(TokenDto tokenDto, GroupPointFormDTO formDTO) { + List userIds = new ArrayList<>(); + userIds.add(tokenDto.getUserId()); + //获取我的个人信息 + Result> myInfoResult = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); + if(!myInfoResult.success()){ + throw new RenException(myInfoResult.getCode(), myInfoResult.getMsg()); + } + MyPointRankResultDTO result = new MyPointRankResultDTO(); + result.setHeadPhoto(myInfoResult.getData().get(0).getHeadImgUrl()); + result.setUserName(myInfoResult.getData().get(0).getRealName()); + //获取客户下用户积分 + List list = getUserPointList(tokenDto.getCustomerId(), null, null); + result.setCustomerRank(getRank(list, tokenDto.getUserId())); + //获取网格用户积分 + List gridRankList = getUserPointList(tokenDto.getCustomerId(), null, formDTO.getGridId()); + result.setGridRank(getRank(gridRankList, tokenDto.getUserId())); + return result; + } + + /** + * @param tokenDto + * @param formDTO + * @Description 网格当月积分在组织和客户内排名 + * @Param tokenDto + * @Param formDTO + * @Return {@link GridPointRankResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/10 14:18 + */ + @Override + public GridPointRankResultDTO gridPointRank(TokenDto tokenDto, GroupPointFormDTO formDTO) { + GridPointRankResultDTO result = new GridPointRankResultDTO(); + //获取网格信息 + Result gridInfoResult = govOrgOpenFeignClient.queryGridInfo(formDTO.getGridId()); + if (!gridInfoResult.success()) { + throw new RenException(gridInfoResult.getCode()); + } + result.setGridName(gridInfoResult.getData().getParentAgencyName() + StrConstant.HYPHEN + gridInfoResult.getData().getGridName()); + String agencyId = gridInfoResult.getData().getParentAgencyId(); + //获取客户下用户积分 + List list = getGridPointList(tokenDto.getCustomerId(), null); + result.setCustomerRank(getGridRank(list, formDTO.getGridId())); + List agencyPointList = getGridPointList(tokenDto.getCustomerId(), agencyId); + result.setAgencyRank(getGridRank(agencyPointList, formDTO.getGridId())); + return result; + } + /** * 获取认证通过的党员的 用户id * @@ -338,4 +436,88 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2021/9/10 15:04 + */ + private List getUserPointList(String customerId, String agencyId, String gridId) { + return baseDao.selectUserPointByMonth(customerId, agencyId, gridId); + } + + private List getGridPointList(String customerId, String agencyId) { + return baseDao.selectGridPointByMonth(customerId, agencyId); + } + + private Boolean havePoint(List list, String userId) { + Map map = list.stream().collect(Collectors.toMap(BizPointUserTotalDetailDTO::getUserId, BizPointUserTotalDetailDTO::getTotalPoint)); + String point = null == map.get(userId)?"0":Integer.toString(map.get(userId)); + log.info("userPoint:" + point); + return null != map.get(userId); + } + + + private String getGridRank(List list, String gridId) { + if (CollectionUtils.isEmpty(list)) { + return NumConstant.ONE_STR; + } + //如果当月网格没有积分变动,则积分为0 + Map map = list.stream().collect(Collectors.toMap(BizPointUserTotalDetailDTO::getGridId, BizPointUserTotalDetailDTO::getTotalPoint)); + String points = null == map.get(gridId)?"0":Integer.toString(map.get(gridId)); + log.info("gridPoint:" + points); + if (null == map.get(gridId)) { + BizPointUserTotalDetailDTO dto = new BizPointUserTotalDetailDTO(); + dto.setGridId(gridId); + dto.setTotalPoint(NumConstant.ZERO); + list.add(dto); + } + //排序 + list = list.stream().sorted(Comparator.comparing(BizPointUserTotalDetailDTO :: getTotalPoint).reversed() + .thenComparing(BizPointUserTotalDetailDTO::getGridId)) + .collect(Collectors.toList()); + AtomicInteger i = new AtomicInteger(1); + AtomicInteger point = new AtomicInteger(0); + list.forEach(item -> { + if (item.getTotalPoint().equals(point.get())) { + item.setRank(String.valueOf(i)); + } else { + item.setRank(String.valueOf(i.getAndIncrement())); + } + point.set(item.getTotalPoint()); + }); + Map rankMap = list.stream().collect(Collectors.toMap(BizPointUserTotalDetailDTO::getGridId, BizPointUserTotalDetailDTO::getRank)); + return rankMap.get(gridId); + } + + private String getRank(List list, String userId) { + if (CollectionUtils.isEmpty(list)) { + return NumConstant.ONE_STR; + } + if (!havePoint(list, userId)) { + BizPointUserTotalDetailDTO dto = new BizPointUserTotalDetailDTO(); + dto.setUserId(userId); + dto.setTotalPoint(NumConstant.ZERO); + list.add(dto); + } + //排序 + list = list.stream().sorted(Comparator.comparing(BizPointUserTotalDetailDTO :: getTotalPoint).reversed() + .thenComparing(BizPointUserTotalDetailDTO::getUserId)) + .collect(Collectors.toList()); + AtomicInteger i = new AtomicInteger(1); + AtomicInteger point = new AtomicInteger(0); + list.forEach(item -> { + if (item.getTotalPoint().equals(point.get())) { + item.setRank(String.valueOf(i)); + } else { + item.setRank(String.valueOf(i.getAndIncrement())); + } + point.set(item.getTotalPoint()); + }); + Map map = list.stream().collect(Collectors.toMap(BizPointUserTotalDetailDTO::getUserId, BizPointUserTotalDetailDTO::getRank)); + return map.get(userId); + } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/BizPointTotalDetailDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/BizPointTotalDetailDao.xml index e1e8202e83..e65cfbabf5 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/BizPointTotalDetailDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/BizPointTotalDetailDao.xml @@ -29,5 +29,51 @@ and OBJECT_ID = #{objectId} + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml index d49ca80396..156860259b 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml @@ -184,4 +184,94 @@ ORDER BY P.point DESC LIMIT #{pageNo}, #{pageSize} + + + + + + + diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java index 26fed9cca7..f1b7e8f04f 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java @@ -111,7 +111,7 @@ public class IssueProjectTagDictRedis { if (!CollectionUtils.isEmpty(_default)) { result.put(ModuleConstants.DEFAULT_TAG_CATEGORY_NAME, _default); } else { - log.error("there is no default tag data in database , customerId : {},category:{}", customerId, ifOtherOnly ? null : category); + log.warn("there is no default tag data in database , customerId : {},category:{}", customerId, ifOtherOnly ? null : category); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 1a131bb685..7ca7b0551c 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -24,6 +24,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.IssueConstant; import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.UserMessageConstant; +import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dao.IssueDao; import com.epmet.dao.IssueProcessDao; import com.epmet.dao.IssueProjectRelationDao; @@ -755,6 +756,11 @@ public class IssueServiceImpl extends BaseServiceImpl imp msgDTO.setMessageContent(messageContent); msgDTO.setReadFlag(ReadFlagConstant.UN_READ); msgDTO.setUserId(topicDTO.getCreatedBy()); + + //21.09.10:记录消息类型和对应的业务id + msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_CLOSE_ISSUE); + msgDTO.setTargetId(entity.getId()); + msgList.add(msgDTO); //话题人和议题人是同一个人时则只发送一条居民消息 if (!topicDTO.getCreatedBy().equals(entity.getCreatedBy())) { @@ -1067,11 +1073,21 @@ public class IssueServiceImpl extends BaseServiceImpl imp msgDTO.setMessageContent(topicIssueMessage); msgDTO.setReadFlag(ReadFlagConstant.UN_READ); msgDTO.setUserId(formDTO.getTopicDTO().getCreatedBy()); + + //21.09.10:记录消息类型和对应的业务id + msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); + msgDTO.setTargetId(entity.getId()); + msgList.add(msgDTO); //话题人和议题人是同一个人时则只发送一条居民消息 if (!formDTO.getTopicDTO().getCreatedBy().equals(entity.getCreatedBy())) { UserMessageFormDTO msgIssue = ConvertUtils.sourceToTarget(msgDTO, UserMessageFormDTO.class); msgIssue.setUserId(entity.getCreatedBy()); + + //21.09.10:记录消息类型和对应的业务id + msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); + msgDTO.setTargetId(entity.getId()); + msgList.add(msgIssue); } //2:创建项目工作人员消息对象 @@ -1088,6 +1104,11 @@ public class IssueServiceImpl extends BaseServiceImpl imp msg.setMessageContent(projectStaffMessage); msg.setReadFlag(ReadFlagConstant.UN_READ); msg.setUserId(staff.getStaffId()); + + //21.09.10:记录消息类型和对应的业务id + msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); + msgDTO.setTargetId(issueProjectResultDTO.getProjectId()); + msgList.add(msg); map.put(staff.getStaffId(),staff.getStaffId()); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java index 39a0968121..d58682f00a 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java @@ -49,6 +49,9 @@ public class CustomerGridDTO implements Serializable { */ private String gridName; + /** 组织-网格 */ + private String gridNamePath; + /** * 中心位置经度 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetAgencyListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetAgencyListFormDTO.java new file mode 100644 index 0000000000..0d97988fd7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetAgencyListFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/13 3:20 下午 + * @DESC + */ +@Data +public class GetAgencyListFormDTO implements Serializable { + + private static final long serialVersionUID = -5846836779036328298L; + + private String customerId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgFormDTO.java new file mode 100644 index 0000000000..6975477321 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/7 15:41 + */ +@Data +public class OrgFormDTO implements Serializable { + private static final long serialVersionUID = -5975063766883885089L; + private String orgId; + private String orgType; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java new file mode 100644 index 0000000000..896ebfb57c --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/8 15:06 + */ +@Data +public class AgencyTreeResultDTO implements Serializable { + private static final long serialVersionUID = -311212619121062367L; + /** + * 机关组织Id + */ + private String agencyId; + + /** + * 机关组织名称 + */ + private String agencyName; + + private String pid; + /** + * 下级机关组织 + */ + private List subAgencyList; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MineResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MineResultDTO.java index 01b1630ebc..2e3adc0e89 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MineResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MineResultDTO.java @@ -63,4 +63,10 @@ public class MineResultDTO implements Serializable { * 根组织名 */ private String rootAgencyName; + //工作人员添加入口Id(agencyId;deptId;gridId) + private String orgId = ""; + //人员注册时所属组织名【组织-组织,组织-部门,组织-网格】 + private String orgName = ""; + //工作人员添加入口类型(组织:agency;部门:dept;网格:gridId) + private String orgType = ""; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgListResultDTO.java new file mode 100644 index 0000000000..2473c623fd --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgListResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/8 15:11 + */ +@Data +public class StaffOrgListResultDTO implements Serializable { + private static final long serialVersionUID = -7717333635633000120L; + /** + * 组织ID + */ + private String orgId; + /** + * 组织名称 + */ + private String orgName; + /** + * 组织类型机关agency 网格grid 部门dept + */ + private String orgType; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgNameResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgNameResultDTO.java new file mode 100644 index 0000000000..58424f63f0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgNameResultDTO.java @@ -0,0 +1,45 @@ +/** + * 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.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 查询工作人员注册组织信息 + * @author sun + */ +@Data +public class StaffOrgNameResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //工作人员所属组织Id + private String agencyId = ""; + //人员Id + private String staffId = ""; + //人员注册时所属组织名【组织-组织,组织-部门,组织-网格】 + private String orgName = ""; + //工作人员添加入口Id(agencyId;deptId;gridId) + private String orgId = ""; + //工作人员添加入口类型(组织:agency;部门:dept;网格:gridId) + private String orgType = ""; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index e6af374fe2..39d15fb9a5 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -417,4 +417,26 @@ public interface GovOrgOpenFeignClient { */ @PostMapping("/gov/org/customerstaffagency/queryOrgStaffs") Result> queryOrgStaffs(@RequestBody OrgStaffFormDTO formDTO); + + /** + * @Description 根据组织或网格或吧部门获取组织信息 + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/9/7 15:27 + */ + @PostMapping("/gov/org/customeragency/getAgencyInfo") + Result getAgencyInfo(@RequestBody OrgFormDTO formDTO); + + + /** + * desc: 获取网格基础数据 + * + * @param customerGridFormDTO + * @return com.epmet.commons.tools.utils.Result + * @author LiuJanJun + * @date 2021/4/19 11:19 上午 + */ + @PostMapping("/gov/org/grid/getbaseinfo") + Result getGridBaseInfoByGridId(CustomerGridFormDTO customerGridFormDTO); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index b517c20344..306ea49022 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -248,6 +248,24 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryOrgStaffs", formDTO); } + /** + * @param formDTO + * @Description 根据组织或网格或吧部门获取组织信息 + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/9/7 15:27 + */ + @Override + public Result getAgencyInfo(OrgFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyInfo", formDTO); + } + + @Override + public Result getGridBaseInfoByGridId(CustomerGridFormDTO customerGridFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridBaseInfoByGridId", customerGridFormDTO); + } + @Override public Result selectPidsByGridId(String gridId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 963c8b7b95..c3937127ba 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -312,4 +312,31 @@ public class CustomerAgencyController { return new Result().ok(customerAgencyService.staffPermissionExt(tokenDto.getUserId())); } + /** + * @Description 根据组织或网格或吧部门获取组织信息 + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/9/7 15:27 + */ + @PostMapping("getAgencyInfo") + public Result getAgencyInfo(@RequestBody OrgFormDTO formDTO) { + return new Result().ok(customerAgencyService.getAgencyInfo(formDTO)); + } + + /** + * @Description 获取客户下组织树 + * @Param tokenDTO + * @Return {@link Result< AgencyTreeResultDTO >} + * @Author zhaoqifeng + * @Date 2021/9/8 15:20 + */ + @PostMapping("agencylist") + public Result getAgencyList(@LoginUser TokenDto tokenDTO,@RequestBody GetAgencyListFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getCustomerId())){ + formDTO.setCustomerId(tokenDTO.getCustomerId()); + } + return new Result().ok(customerAgencyService.getAgencyList(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java index daf3c835cc..ce24000220 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java @@ -179,6 +179,7 @@ public class GridController { */ @PostMapping("getbaseinfo") public Result getBaseInfo(@RequestBody CustomerGridFormDTO customerGridFormDTO) { - return customerGridService.getBaseInfo(customerGridFormDTO); + CustomerGridDTO gridInfo = customerGridService.getBaseInfo(customerGridFormDTO); + return new Result().ok(gridInfo); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java index b95b96c0b9..6d3b50b408 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java @@ -195,4 +195,16 @@ public class StaffController { return staffService.addStaffV2(fromDTO); } + /** + * @Description 用户所属组织 + * @Param tokenDto + * @Return {@link Result< StaffOrgListResultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/8 16:55 + */ + @PostMapping("orgList") + public Result> staffOrgList(@LoginUser TokenDto tokenDto) { + return new Result>().ok(staffService.staffOrgList(tokenDto)); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index b0149c28d8..145178f50f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -239,4 +239,8 @@ public interface CustomerAgencyDao extends BaseDao { * @author sun */ OrgResultDTO selectAgencyDetail(@Param("orgId") String orgId, @Param("orgType") String orgType); + + AgencyTreeResultDTO getAllAgency(@Param("customerId") String customerId); + + List getSubAgencyList(@Param("pid") String pid); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffOrgRelationDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffOrgRelationDao.java index a4d6610658..97c4e875b7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffOrgRelationDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffOrgRelationDao.java @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.StaffOrgNameResultDTO; import com.epmet.entity.StaffOrgRelationEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 工作人员注册组织关系表 @@ -29,5 +33,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface StaffOrgRelationDao extends BaseDao { - + /** + * @Description 批量查询工作人员注册组织信息 + * @author sun + */ + List selelctStaffOrg(@Param("staffIdList") List staffIdList); + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index fda2f4d09e..b13bae23e7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -19,6 +19,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.*; @@ -236,4 +237,22 @@ public interface CustomerAgencyService extends BaseService OrganizeTreeResultDTO organizeTree(String agencyId); void checkAgencyName(String agencyName,String customerId,String agencyId,String parentAgencyId); + + /** + * 根据组织或网格或吧部门获取组织信息 + * @Param formDTO + * @Return {@link OrgResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/7 15:28 + */ + OrgResultDTO getAgencyInfo(OrgFormDTO formDTO); + + /** + * @Description 获取客户下组织树 + * @Param tokenDTO + * @Return {@link AgencyTreeResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/8 15:21 + */ + AgencyTreeResultDTO getAgencyList(GetAgencyListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index 78221d8fa8..91525436ba 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -286,7 +286,7 @@ public interface CustomerGridService extends BaseService { * @author LiuJanJun * @date 2021/4/19 11:53 上午 */ - Result getBaseInfo(CustomerGridFormDTO customerGridFormDTO); + CustomerGridDTO getBaseInfo(CustomerGridFormDTO customerGridFormDTO); /** * @Description 根据网格ID查询pids diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java index d88298dfbf..ccd998c0fc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java @@ -129,4 +129,13 @@ public interface StaffService { * @author sun */ Result addStaffV2(AddStaffV2FromDTO fromDTO); + + /** + * @Description 工作人员所属组织 + * @Param tokenDto + * @Return {@link StaffOrgListResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/8 16:57 + */ + List staffOrgList(TokenDto tokenDto); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 38c0fc85b0..fc9f181a20 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -1075,4 +1075,53 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl agencyList) { + for (AgencyTreeResultDTO dto : agencyList) { + if (CollectionUtils.isEmpty(dto.getSubAgencyList())) { + dto.setSubAgencyList(null); + } else { + setAgencyList(dto.getSubAgencyList()); + } + } + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index fd8be5cdbd..58faa734ac 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.impl; +import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -26,6 +27,8 @@ import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; @@ -36,6 +39,7 @@ import com.epmet.dao.CustomerStaffGridDao; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; @@ -76,6 +80,9 @@ public class CustomerGridServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -290,6 +297,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl userIdDTOS = baseDao.selectUserIdByGrid(deleteGridFormDTO.getGridId()); deleteGridFormDTO.setUserId(tokenDto.getUserId()); if (userIdDTOS.size()==0){ @@ -711,8 +719,25 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getBaseInfo(CustomerGridFormDTO customerGridFormDTO) { - return new Result().ok(ConvertUtils.sourceToTarget(baseDao.selectById(customerGridFormDTO.getGridId()), CustomerGridDTO.class)); + public CustomerGridDTO getBaseInfo(CustomerGridFormDTO customerGridFormDTO) { + String redisKey = RedisKeys.getGridInfoKey(customerGridFormDTO.getGridId()); + Map gridCache = redisUtils.hGetAll(redisKey); + if (gridCache != null && gridCache.size() > 0) { + // 直接取缓存中的 + CustomerGridDTO gridInfo = BeanUtil.mapToBean(gridCache, CustomerGridDTO.class, true); + return gridInfo; + } + + CustomerGridDTO gridInfo = ConvertUtils.sourceToTarget(baseDao.selectById(customerGridFormDTO.getGridId()), CustomerGridDTO.class); + if (null != gridInfo) { + CustomerAgencyEntity agency = customerAgencyService.selectById(gridInfo.getPid()); + gridInfo.setAgencyName(null != agency ? agency.getOrganizationName() : ""); + gridInfo.setGridNamePath(null != agency ? agency.getOrganizationName().concat("-").concat(gridInfo.getGridName()) : gridInfo.getGridName()); + + redisUtils.hMSet(redisKey, BeanUtil.beanToMap(gridInfo)); + } + + return gridInfo; } /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index 9d6504d673..b70354aceb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -11,16 +11,16 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.constant.CustomerAgencyConstant; import com.epmet.constant.OrgInfoConstant; -import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.CustomerStaffAgencyDao; +import com.epmet.dao.StaffOrgRelationDao; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.*; import com.epmet.feign.*; import com.epmet.service.*; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @@ -75,6 +76,8 @@ public class StaffServiceImpl implements StaffService { private StaffOrgRelationService staffOrgRelationService; @Resource private CustomerStaffRedis customerStaffRedis; + @Resource + private StaffOrgRelationDao staffOrgRelationDao; @Override public Result getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { @@ -243,6 +246,18 @@ public class StaffServiceImpl implements StaffService { result.setRootAgencyName(agency.getOrganizationName()); } //2021.08.27 zhaoqf end + //2021.9.17 sun 添加工作人员注册组织、类型、id返参 start + List staffIdList = new ArrayList<>(); + staffIdList.add(result.getStaffId()); + List list = staffOrgRelationDao.selelctStaffOrg(staffIdList); + list.forEach(l->{ + if(l.getStaffId().equals(result.getStaffId())){ + result.setOrgId(l.getOrgId()); + result.setOrgName(l.getOrgName()); + result.setOrgType(l.getOrgType()); + } + }); + //2021.9.17 sun 添加工作人员注册组织、类型、id返参 end return result; } @@ -566,5 +581,52 @@ public class StaffServiceImpl implements StaffService { return new Result(); } + /** + * @param tokenDto + * @Description 工作人员所属组织 + * @Param tokenDto + * @Return {@link StaffOrgListResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/8 16:57 + */ + @Override + public List staffOrgList(TokenDto tokenDto) { + //redis获取工作人员信息 + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfoCache) { + return Collections.emptyList(); + } + List list = new ArrayList<>(); + //工作人员所在组织 + StaffOrgListResultDTO agency = new StaffOrgListResultDTO(); + agency.setOrgId(staffInfoCache.getAgencyId()); + agency.setOrgName(staffInfoCache.getAgencyName()); + agency.setOrgType(OrgInfoConstant.AGENCY); + list.add(agency); + //工作人员所在部门 + if(CollectionUtils.isNotEmpty(staffInfoCache.getDeptList())) { + List deptList = staffInfoCache.getDeptList().stream().map(item -> { + StaffOrgListResultDTO dto = new StaffOrgListResultDTO(); + dto.setOrgId(item.getId()); + dto.setOrgName(item.getName()); + dto.setOrgType(OrgInfoConstant.DEPT); + return dto; + }).collect(Collectors.toList()); + list.addAll(deptList); + } + //工作人员所在网格 + if(CollectionUtils.isNotEmpty(staffInfoCache.getGridList())) { + List gridList = staffInfoCache.getGridList().stream().map(item -> { + StaffOrgListResultDTO dto = new StaffOrgListResultDTO(); + dto.setOrgId(item.getId()); + dto.setOrgName(item.getName()); + dto.setOrgType(OrgInfoConstant.GRID); + return dto; + }).collect(Collectors.toList()); + list.addAll(gridList); + } + return list; + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index a30207d922..89a5df87f4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -503,5 +503,40 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffOrgRelationDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffOrgRelationDao.xml index 350dae73ac..76f749c00a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffOrgRelationDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffOrgRelationDao.xml @@ -3,6 +3,81 @@ - + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java index ad3fec6959..de0a8347f4 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java @@ -36,10 +36,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.IpUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; -import com.epmet.constant.ProjectConstant; -import com.epmet.constant.ReadFlagConstant; -import com.epmet.constant.SmsTemplateConstant; -import com.epmet.constant.UserMessageConstant; +import com.epmet.constant.*; import com.epmet.dao.ProjectOrgRelationDao; import com.epmet.dao.ProjectDao; import com.epmet.dao.ProjectProcessDao; @@ -451,6 +448,11 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl implements ProjectTraceS //4.推送站内信、微信、短信消息 //4-1.调用epmet-message服务,给工作端勾选的工作人员发送消息 - if (!shiftProjectMessage(formDTO).success()) { + if (!shiftProjectMessage(formDTO,projectEntity.getId()).success()) { throw new RenException("项目立项,推送站内信失败"); } @@ -565,7 +562,7 @@ public class ProjectTraceServiceImpl implements ProjectTraceS * @Description 项目立项给勾选的工作人员推送站内信消息 * @author sun */ - private Result shiftProjectMessage(ProjectApprovalFormDTO formDTO) { + private Result shiftProjectMessage(ProjectApprovalFormDTO formDTO,String projectId) { List msgList = new ArrayList<>(); //1.创建项目工作人员消息对象 String projectStaffMessage = String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, formDTO.getTitle()); @@ -581,6 +578,11 @@ public class ProjectTraceServiceImpl implements ProjectTraceS msg.setMessageContent(projectStaffMessage); msg.setReadFlag(ReadFlagConstant.UN_READ); msg.setUserId(staff.getStaffId()); + + //21.09.10:记录消息类型和对应的业务id + msg.setMessageType(UserMessageTypeConstant.PROJECT_APPROVAL); + msg.setTargetId(projectId); + msgList.add(msg); map.put(staff.getStaffId(),staff.getStaffId()); } @@ -789,7 +791,7 @@ public class ProjectTraceServiceImpl implements ProjectTraceS //4.推送站内信、微信、短信消息 //4-1.调用epmet-message服务,给工作端勾选的工作人员发送消息 - if (!shiftProjectMessage(formDTO.getStaffList(),formDTO.getCustomerId(),formDTO.getTitle()).success()) { + if (!shiftProjectMessage(formDTO.getStaffList(),formDTO.getCustomerId(),formDTO.getTitle(),projectEntity.getId()).success()) { throw new RenException("事件转为项目,推送站内信失败"); } @@ -919,7 +921,7 @@ public class ProjectTraceServiceImpl implements ProjectTraceS * @Description 项目立项给勾选的工作人员推送站内信消息 * @author yinzuomei */ - private Result shiftProjectMessage(List staffList,String customerId,String title) { + private Result shiftProjectMessage(List staffList,String customerId,String title,String projectId) { List msgList = new ArrayList<>(); //1.创建项目工作人员消息对象 String projectStaffMessage = String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, title); @@ -935,6 +937,11 @@ public class ProjectTraceServiceImpl implements ProjectTraceS msg.setMessageContent(projectStaffMessage); msg.setReadFlag(ReadFlagConstant.UN_READ); msg.setUserId(staff.getStaffId()); + + //21.09.10:记录消息类型和对应的业务id + msg.setTargetId(projectId); + msg.setMessageType(UserMessageTypeConstant.PROJECT_FROM_RESI_EVENT); + msgList.add(msg); map.put(staff.getStaffId(),staff.getStaffId()); } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/AttachmentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/AttachmentDTO.java new file mode 100644 index 0000000000..08fc2f7cc5 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/AttachmentDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/7 16:21 + */ +@Data +public class AttachmentDTO implements Serializable { + private static final long serialVersionUID = 6505979559566901869L; + private String name; + private String format; + private String type; + private String url; + private Integer size; + private Integer duration; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ExternalLinkDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ExternalLinkDTO.java new file mode 100644 index 0000000000..e298d31648 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ExternalLinkDTO.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.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 指南外链表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class ExternalLinkDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 链接说明 + */ + private String description; + + /** + * 外部链接 + */ + private String externalLink; + + /** + * 外部链接 + */ + private Integer sort; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideAttachmentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideAttachmentDTO.java new file mode 100644 index 0000000000..212e9bc369 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideAttachmentDTO.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.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 办事指南附件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 办事指南ID + */ + private String guideId; + + /** + * 附件名 + */ + private String attachmentName; + + /** + * 文件大小 单位byte + */ + private Integer attachmentSize; + + /** + * 文件格式 word、excel、pdf + */ + private String attachmentFormat; + + /** + * 类型 + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDTO.java new file mode 100644 index 0000000000..7d0ed1eef4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDTO.java @@ -0,0 +1,104 @@ +/** + * 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.epmet.dto; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 指南分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-08 + */ +@Data +public class GuideCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id,产品默认配置此列存储default + */ + private String customerId; + + /** + * 分类名,客户内唯一 + */ + private String categoryName; + + /** + * 分类编码:分类名的全拼; eg:gongjijin + */ + private String categoryCode; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + + /** + * 删除标识 0未删除、1已删除 + */ + @JsonIgnore + private String delFlag; + + /** + * 乐观锁 + */ + @JsonIgnore + private Integer revision; + + /** + * 创建人 + */ + @JsonIgnore + private String createdBy; + + /** + * 创建时间 + */ + @JsonIgnore + private Date createdTime; + + /** + * 更新人 + */ + @JsonIgnore + private String updatedBy; + + /** + * 更新时间 + */ + @JsonIgnore + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCollectionDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCollectionDTO.java new file mode 100644 index 0000000000..6b9dbfaeee --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCollectionDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 指南收藏表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideCollectionDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户所属客户端 居民端resi 工作端gov + */ + private String app; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideDTO.java new file mode 100644 index 0000000000..f5fe57d143 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideDTO.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.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 办事指南表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 发布单位类型 机关agency 网格grid 部门dept + */ + private String orgType; + + /** + * 发布单位ID + */ + private String orgId; + + /** + * 发布单位名称 + */ + private String orgName; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String pid; + + /** + * 所有上级组织ID,英文:隔开 + */ + private String pids; + + /** + * 标题 + */ + private String title; + + /** + * 分类ID + */ + private String categoryCode; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideExternalLinkDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideExternalLinkDTO.java new file mode 100644 index 0000000000..39612bb4ff --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideExternalLinkDTO.java @@ -0,0 +1,96 @@ +/** + * 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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 指南外链表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideExternalLinkDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 链接说明 + */ + private String description; + + /** + * 外部链接 + */ + private String externalLink; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDTO.java new file mode 100644 index 0000000000..40e4fed74e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 指南模块关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideModuleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 模块ID + */ + private String moduleId; + + /** + * + */ + private String moduleContent; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDTO.java new file mode 100644 index 0000000000..938e7b211a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDTO.java @@ -0,0 +1,96 @@ +/** + * 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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideModuleDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 模块key + */ + private String moduleValue; + + /** + * 模块名 + */ + private String moduleName; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDefaultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDefaultDTO.java new file mode 100644 index 0000000000..6c59d906f9 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDefaultDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 指南模块默认字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideModuleDictDefaultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 模块key + */ + private String moduleValue; + + /** + * 模块名 + */ + private String moduleName; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ModuleDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ModuleDTO.java new file mode 100644 index 0000000000..548395fd96 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ModuleDTO.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class ModuleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 主键 + */ + private String guideModuleId; + /** + * 主键 + */ + private String moduleId; + + /** + * 模块key + */ + private String moduleValue; + + /** + * 模块名 + */ + private String moduleName; + + /** + * 模块内容 + */ + private String moduleContent; +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/EditGuideCategoryFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/EditGuideCategoryFormDTO.java new file mode 100644 index 0000000000..79286ba45f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/EditGuideCategoryFormDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 编辑、禁用、删除统一入参 + * @Author yinzuomei + * @Date 2021/9/8 4:15 下午 + */ +@Data +public class EditGuideCategoryFormDTO implements Serializable { + private static final long serialVersionUID = -6853534660181580456L; + + public interface AddUserInternalGroup { + } + + public interface StatusGroup { + } + + public interface UpdateInfoGroup extends CustomerClientShowGroup { + } + public interface SaveInfoGroup extends CustomerClientShowGroup { + } + + public interface DelGroup { + } + @NotBlank(message = "当前操作人id不能为空", groups = AddUserInternalGroup.class) + private String staffId; + + @NotBlank(message = "客户id不能为空",groups = {DelGroup.class,UpdateInfoGroup.class,SaveInfoGroup.class}) + private String customerId; + + @NotBlank(message = "id不能为空", groups = {StatusGroup.class,DelGroup.class,UpdateInfoGroup.class}) + private String id; + + @NotBlank(message = "status不能为空", groups = StatusGroup.class) + private String status; + + @NotBlank(message = "分类名称不能为空不能为空", groups = {UpdateInfoGroup.class,SaveInfoGroup.class}) + @Length(max = 10, message = "分类名称最多填入10个字", groups = {UpdateInfoGroup.class,SaveInfoGroup.class}) + private String categoryName; + +} + diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideAddFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideAddFormDTO.java new file mode 100644 index 0000000000..dd74b3fac6 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideAddFormDTO.java @@ -0,0 +1,61 @@ +package com.epmet.dto.form; + +import com.epmet.dto.AttachmentDTO; +import com.epmet.dto.ExternalLinkDTO; +import com.epmet.dto.ModuleDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/7 10:24 + */ +@NoArgsConstructor +@Data +public class GuideAddFormDTO implements Serializable { + + private static final long serialVersionUID = -7750999102010191460L; + /** + * 标题 + */ + @NotBlank(message = "标题不能为空") + private String title; + /** + * 标题 + */ + @NotBlank(message = "分类不能为空") + private String categoryCode; + /** + * 机关类型 机关agency 网格grid 部门dept + */ + @NotBlank(message = "所属机关类型不能为空") + private String orgType; + /** + * 所属机关 + */ + @NotBlank(message = "所属机关ID不能为空") + private String orgId; + /** + * 所属机关 + */ + @NotBlank(message = "所属机关名不能为空") + private String orgName; + /** + * 外部链接 + */ + private List externalLinks; + /** + * 内容模块 + */ + private List moduleList; + /** + * 附件 + */ + private List attachmentList; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCateOrderFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCateOrderFormDTO.java new file mode 100644 index 0000000000..6b66e9f7c5 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCateOrderFormDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 分类排序入参DTO + * @Author yinzuomei + * @Date 2021/9/8 4:03 下午 + */ +@Data +public class GuideCateOrderFormDTO implements Serializable { + private static final long serialVersionUID = 8671295475212569124L; + + public interface AddUserInternalGroup { + } + + @NotBlank(message = "当前操作人id不能为空", groups = AddUserInternalGroup.class) + private String staffId; + + + @NotEmpty(message = "顺序不能为空", groups = {AddUserInternalGroup.class}) + private List orderList; + + /** + * 排序索引号dto + */ + public static class OrderIndexDTO { + private String id; + private Integer orderIndex; + + public OrderIndexDTO() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Integer getOrderIndex() { + return orderIndex; + } + + public void setOrderIndex(Integer orderIndex) { + this.orderIndex = orderIndex; + } + } +} + diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryDropDownFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryDropDownFormDTO.java new file mode 100644 index 0000000000..a92e1c2e09 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryDropDownFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 发布指南、编辑指南、查询指南列表 分类下拉框 + * @Author yinzuomei + * @Date 2021/9/8 2:57 下午 + */ +@Data +public class GuideCategoryDropDownFormDTO implements Serializable { + private static final long serialVersionUID = 9122708701080412461L; + public interface AddUserInternalGroup { + } + /** + * 新增指南:saveorupdate;查询指南列表:query + */ + @NotBlank(message = "新增指南:saveorupdate;查询指南列表:query",groups = AddUserInternalGroup.class) + private String queryOrigin; + + @NotBlank(message = "当前工作人员所属客户id不能为空",groups = AddUserInternalGroup.class) + private String customerId; + +} + diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryPageFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryPageFormDTO.java new file mode 100644 index 0000000000..b67686e451 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryPageFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 工作端PC或者运营端分页 + * @Author yinzuomei + * @Date 2021/9/8 1:35 下午 + */ +@Data +public class GuideCategoryPageFormDTO implements Serializable { + private static final long serialVersionUID = -7551388716349439643L; + public interface AddUserInternalGroup { + } + @NotBlank(message = "客户id不能为空,运营端传default", groups = AddUserInternalGroup.class) + private String customerId; +} + diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideEditFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideEditFormDTO.java new file mode 100644 index 0000000000..a589c4c1ec --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideEditFormDTO.java @@ -0,0 +1,70 @@ +package com.epmet.dto.form; + +import com.epmet.dto.AttachmentDTO; +import com.epmet.dto.ExternalLinkDTO; +import com.epmet.dto.ModuleDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/7 10:24 + */ +@NoArgsConstructor +@Data +public class GuideEditFormDTO implements Serializable { + + private static final long serialVersionUID = -7750999102010191460L; + /** + * 工作人员ID + */ + private String staffId; + /** + * 指南ID + */ + @NotBlank(message = "指南id不能为空") + private String guideId; + /** + * 标题 + */ + @NotBlank(message = "标题不能为空") + private String title; + /** + * 标题 + */ + @NotBlank(message = "分类不能为空") + private String categoryCode; + /** + * 机关类型 机关agency 网格grid 部门dept + */ + @NotBlank(message = "所属机关类型不能为空") + private String orgType; + /** + * 所属机关 + */ + @NotBlank(message = "所属机关ID不能为空") + private String orgId; + /** + * 所属机关 + */ + @NotBlank(message = "所属机关名不能为空") + private String orgName; + /** + * 外部链接 + */ + private List externalLinks; + /** + * 内容模块 + */ + private List moduleList; + /** + * 附件 + */ + private List attachmentList; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideFormDTO.java new file mode 100644 index 0000000000..48bfde8f04 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideFormDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.form; + +import com.epmet.dto.ExternalLinkDTO; +import com.epmet.dto.GuideAttachmentDTO; +import com.epmet.dto.ModuleDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/7 10:24 + */ +@NoArgsConstructor +@Data +public class GuideFormDTO implements Serializable { + + private static final long serialVersionUID = -7750999102010191460L; + /** + * 标题 + */ + @NotBlank(message = "指南id不能为空") + private String guideId; + + /** + * 工作人员 + */ + private String staffId; + + /** + * 客户ID + */ + private String customerId; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideListFormDTO.java new file mode 100644 index 0000000000..d8edcf1308 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideListFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/7 9:38 + */ +@NoArgsConstructor +@Data +public class GuideListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = -4471422632936288213L; + private String customerId; + /** + * 组织ID + */ + private String agencyId; + /** + * 分类 + */ + private String categoryCode; + /** + * 标题 + */ + private String guideTitle; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GetCategoryResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GetCategoryResultDTO.java new file mode 100644 index 0000000000..6bf568d65d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GetCategoryResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/7 10:52 + */ +@Data +public class GetCategoryResultDTO implements Serializable { + private static final long serialVersionUID = 3527239091132653541L; + private String categoryId; + private String categoryName; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideDetailResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideDetailResultDTO.java new file mode 100644 index 0000000000..88844f301c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideDetailResultDTO.java @@ -0,0 +1,67 @@ +package com.epmet.dto.result; + +import com.epmet.dto.AttachmentDTO; +import com.epmet.dto.ExternalLinkDTO; +import com.epmet.dto.ModuleDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/7 10:24 + */ +@NoArgsConstructor +@Data +public class GuideDetailResultDTO implements Serializable { + + private static final long serialVersionUID = -7750999102010191460L; + /** + * 标题 + */ + private String guideId; + /** + * 标题 + */ + private String title; + /** + * 分类ID + */ + private String categoryCode; + /** + * 分类名 + */ + private String categoryName; + /** + * 机关类型 机关agency 网格grid 部门dept + */ + private String orgType; + /** + * 所属机关 + */ + private String orgId; + /** + * 所属机关名 + */ + private String orgName; + /** + * 是否收藏 1是, 0否 + */ + private String collectionFlag; + /** + * 外部链接 + */ + private List externalLinks; + /** + * 内容模块 + */ + private List moduleList; + /** + * 附件 + */ + private List attachmentList; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideDictResDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideDictResDTO.java new file mode 100644 index 0000000000..00f56ad3f9 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideDictResDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 办事指南】可用分类列表 新增、编辑指南时的下拉框:展示未禁用的分类; 查询指南列表:如果禁用的分类下存在指南列表,则展示,不存在直接不展示 + * @Author yinzuomei + * @Date 2021/9/8 2:44 下午 + */ +@Data +public class GuideDictResDTO implements Serializable { + + /** + * 分类名,客户内唯一 + */ + private String categoryName; + + /** + * 分类编码:分类名的全拼; eg:gongjijin + */ + private String categoryCode; + + /** + * 排序 + */ + @JsonIgnore + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + @JsonIgnore + private String status; +} + + diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideListResultDTO.java new file mode 100644 index 0000000000..7cd2400afa --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideListResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author Administrator + */ +@Data +public class GuideListResultDTO implements Serializable { + private static final long serialVersionUID = -1360741408368601140L; + private String guideId; + /** + * 标题 + */ + private String title; + /** + * 分类 + */ + private String categoryName; + /** + * 创建人ID + */ + private String createdId; + /** + * 创建人姓名 + */ + private String createdName; + /** + * 更新时间 + */ + private Date updatedTime; +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java new file mode 100644 index 0000000000..b1e8824223 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java @@ -0,0 +1,171 @@ +/** + * 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.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.GuideCategoryDTO; +import com.epmet.dto.form.EditGuideCategoryFormDTO; +import com.epmet.dto.form.GuideCateOrderFormDTO; +import com.epmet.dto.form.GuideCategoryDropDownFormDTO; +import com.epmet.dto.form.GuideCategoryPageFormDTO; +import com.epmet.dto.result.GuideDictResDTO; +import com.epmet.service.GuideCategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 指南分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("guidecategory") +public class GuideCategoryController { + + @Autowired + private GuideCategoryService guideCategoryService; + + /** + * 【办事指南】分类列表-工作端PC和运营端用不分页 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/9/8 1:33 下午 + */ + @PostMapping("page") + public Result> page(@RequestBody GuideCategoryPageFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GuideCategoryPageFormDTO.AddUserInternalGroup.class); + PageData page = guideCategoryService.page(formDTO); + return new Result>().ok(page); + } + + /** + * 办事指南】可用分类列表 新增、编辑指南时的下拉框:展示未禁用的分类; 查询指南列表:如果禁用的分类下存在指南列表,则展示,不存在直接不展示 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/9/8 2:47 下午 + */ + @PostMapping("getcategory") + public Result> getCategory(@LoginUser TokenDto tokenDto,@RequestBody GuideCategoryDropDownFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,GuideCategoryDropDownFormDTO.AddUserInternalGroup.class); + return new Result>().ok(guideCategoryService.getCategory(formDTO)); + } + + + /** + * 保存排序 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/9/8 4:09 下午 + */ + @PostMapping("saveorder") + public Result saveOrder(@LoginUser TokenDto tokenDto,@RequestBody GuideCateOrderFormDTO formDTO){ + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,GuideCateOrderFormDTO.AddUserInternalGroup.class); + guideCategoryService.saveOrder(formDTO); + return new Result(); + } + + /** + * 禁用或者启用分类 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/9/8 4:19 下午 + */ + @PostMapping("disable") + public Result disable(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){ + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.StatusGroup.class,EditGuideCategoryFormDTO.AddUserInternalGroup.class); + guideCategoryService.disableGuideCategory(formDTO); + return new Result(); + } + + /** + * 删除分类,已经存在指南的不允许删除,给予提示 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/9/8 4:45 下午 + */ + @PostMapping("delete") + public Result delete(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){ + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.AddUserInternalGroup.class,EditGuideCategoryFormDTO.DelGroup.class); + guideCategoryService.delete(formDTO); + return new Result(); + } + + + /** + * 新增分类,名称和编码客户内唯一 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/9/8 5:11 下午 + */ + @PostMapping("save") + public Result save(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){ + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.AddUserInternalGroup.class,EditGuideCategoryFormDTO.SaveInfoGroup.class); + return new Result().ok(guideCategoryService.save(formDTO)); + } + + + /** + * 编辑名称 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/9/8 5:37 下午 + */ + @PostMapping("update") + public Result update(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){ + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.AddUserInternalGroup.class,EditGuideCategoryFormDTO.UpdateInfoGroup.class); + return new Result().ok(guideCategoryService.update(formDTO)); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCollectionController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCollectionController.java new file mode 100644 index 0000000000..5c6ffe5019 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCollectionController.java @@ -0,0 +1,102 @@ +/** + * 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.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GuideCollectionDTO; +import com.epmet.dto.form.GuideFormDTO; +import com.epmet.service.GuideCollectionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 指南收藏表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("guidecollection") +public class GuideCollectionController { + + @Autowired + private GuideCollectionService guideCollectionService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = guideCollectionService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GuideCollectionDTO data = guideCollectionService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GuideCollectionDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + guideCollectionService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GuideCollectionDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + guideCollectionService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + guideCollectionService.delete(ids); + return new Result(); + } + + /** + * @Description 收藏指南 + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/9/9 9:46 + */ + @PostMapping("collection") + public Result collection(@LoginUser TokenDto tokenDto, @RequestBody GuideFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + guideCollectionService.collection(tokenDto, formDTO); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java new file mode 100644 index 0000000000..88d8115216 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java @@ -0,0 +1,180 @@ +/** + * 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.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GuideDTO; +import com.epmet.dto.form.GuideAddFormDTO; +import com.epmet.dto.form.GuideEditFormDTO; +import com.epmet.dto.form.GuideFormDTO; +import com.epmet.dto.form.GuideListFormDTO; +import com.epmet.dto.result.GuideDetailResultDTO; +import com.epmet.dto.result.GuideListResultDTO; +import com.epmet.service.GuideService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 办事指南表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("guide") +public class GuideController { + + @Autowired + private GuideService guideService; + + @GetMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = guideService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id) { + GuideDTO data = guideService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GuideDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + guideService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GuideDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + guideService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + guideService.delete(ids); + return new Result(); + } + + /** + * @Description 办事指南列表 + * @Param formDTO + * @Return {@link Result< PageData< GuideListResultDTO>>} + * @Author zhaoqifeng + * @Date 2021/9/7 13:59 + */ + @PostMapping("list") + public Result> guideList(@LoginUser TokenDto tokenDto, @RequestBody GuideListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + PageData page = guideService.guideList(tokenDto, formDTO); + return new Result>().ok(page); + } + + + /** + * @Description 添加指南 + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/9/7 14:13 + */ + @PostMapping("add") + public Result guideAdd(@LoginUser TokenDto tokenDto, @RequestBody GuideAddFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + guideService.guideAdd(tokenDto, formDTO); + return new Result(); + } + + /** + * @Description 修改指南 + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/9/7 14:13 + */ + @PostMapping("edit") + public Result guideEdit(@LoginUser TokenDto tokenDto, @RequestBody GuideEditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + formDTO.setStaffId(tokenDto.getUserId()); + guideService.guideEdit(formDTO); + return new Result(); + } + + /** + * @Description 删除指南 + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/9/7 14:13 + */ + @PostMapping("del") + public Result guideDel(@LoginUser TokenDto tokenDto, @RequestBody GuideFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + formDTO.setStaffId(tokenDto.getUserId()); + guideService.guideDel(formDTO); + return new Result(); + } + + /** + * @Description 指南详情 + * @Param tokenDto + * @Param formDTO + * @Return {@link Result< GuideDetailResultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/7 14:13 + */ + @PostMapping("detail") + public Result guideDetail(@LoginUser TokenDto tokenDto, @RequestBody GuideFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + formDTO.setCustomerId(tokenDto.getCustomerId()); + GuideDetailResultDTO result = guideService.guideDetail(tokenDto, formDTO); + return new Result().ok(result); + } + + + @PostMapping("collectionlist") + public Result> collectionList(@LoginUser TokenDto tokenDto, @RequestBody PageFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + PageData page = guideService.collectionList(tokenDto, formDTO); + return new Result>().ok(page); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleController.java new file mode 100644 index 0000000000..dcaad21808 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleController.java @@ -0,0 +1,93 @@ +/** + * 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.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GuideModuleDTO; +import com.epmet.dto.ModuleDTO; +import com.epmet.service.GuideModuleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 指南模块关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("guidemodule") +public class GuideModuleController { + + @Autowired + private GuideModuleService guideModuleService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = guideModuleService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GuideModuleDTO data = guideModuleService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GuideModuleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + guideModuleService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GuideModuleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + guideModuleService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + guideModuleService.delete(ids); + return new Result(); + } + + @PostMapping("list") + public Result> getModuleList(@LoginUser TokenDto tokenDto) { + return new Result>().ok(guideModuleService.getModuleList(tokenDto.getCustomerId())); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleDictController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleDictController.java new file mode 100644 index 0000000000..a8a59b6b8b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleDictController.java @@ -0,0 +1,84 @@ +/** + * 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.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GuideModuleDictDTO; +import com.epmet.service.GuideModuleDictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("guidemoduledict") +public class GuideModuleDictController { + + @Autowired + private GuideModuleDictService guideModuleDictService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = guideModuleDictService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GuideModuleDictDTO data = guideModuleDictService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GuideModuleDictDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + guideModuleDictService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GuideModuleDictDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + guideModuleDictService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + guideModuleDictService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideAttachmentDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideAttachmentDao.java new file mode 100644 index 0000000000..01e5baddd7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideAttachmentDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GuideAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 办事指南附件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideAttachmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDao.java new file mode 100644 index 0000000000..71f757fd23 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDao.java @@ -0,0 +1,98 @@ +/** + * 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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.GuideCategoryDTO; +import com.epmet.dto.result.GuideDictResDTO; +import com.epmet.entity.GuideCategoryEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 指南分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideCategoryDao extends BaseDao { + + /** + * 工作端PC或者运营端分类列表查询,不分页 + * + * @param customerId + * @return java.util.List + * @author yinzuomei + * @date 2021/9/8 1:57 下午 + */ + List selectPageByCid(String customerId); + + /** + * 办事指南】可用分类列表 新增、编辑指南时的下拉框:展示未禁用的分类; 查询指南列表:如果禁用的分类下存在指南列表,则展示,不存在直接不展示 + * + * @param customerId + * @param queryOrigin + * @return java.util.List + * @author yinzuomei + * @date 2021/9/8 3:15 下午 + */ + List selectCategoryDict(@Param("customerId") String customerId, @Param("queryOrigin") String queryOrigin); + + /** + * 保存排序 + * + * @param id + * @param orderIndex + * @param staffId + * @return int + * @author yinzuomei + * @date 2021/9/8 4:11 下午 + */ + int updateOrder(@Param("id") String id, @Param("orderIndex") Integer orderIndex, @Param("staffId") String staffId); + + /** + * 启用或者禁用 + * + * @param id + * @param status + * @param staffId + * @return int + * @author yinzuomei + * @date 2021/9/8 4:22 下午 + */ + int updateStatus(@Param("id") String id, @Param("status")String status, @Param("staffId")String staffId); + + /** + * 查询这个分类下的项目数 + * + * @param id + * @return int + * @author yinzuomei + * @date 2021/9/8 4:36 下午 + */ + int selectGuideTotal(@Param("id") String id,@Param("customerId") String customerId); + + int selectCategoryName(@Param("categoryName") String categoryName, @Param("customerId")String customerId, @Param("excludeId") String excludeId); + + int selectCurrentOrder(String customerId); + + int selectCategoryCode(@Param("categoryCode") String categoryCode, @Param("customerId")String customerId, @Param("excludeId") String excludeId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCollectionDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCollectionDao.java new file mode 100644 index 0000000000..905dfb9f3e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCollectionDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GuideCollectionEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 指南收藏表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideCollectionDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideDao.java new file mode 100644 index 0000000000..18644f0249 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideDao.java @@ -0,0 +1,71 @@ +/** + * 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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.GuideListFormDTO; +import com.epmet.dto.result.GuideDetailResultDTO; +import com.epmet.dto.result.GuideListResultDTO; +import com.epmet.entity.GuideEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 办事指南表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideDao extends BaseDao { + + /** + * 指南列表 + * + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/9/7 14:21 + */ + List getGuideList(GuideListFormDTO formDTO); + + /** + * 指南详情 + * + * @Param customerId + * @Param guideId + * @Return {@link GuideDetailResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/8 9:59 + */ + GuideDetailResultDTO getGuideDetail(@Param("customerId") String customerId, @Param("guideId") String guideId); + + /** + * 收藏列表 + * + * @Param tokenDto + * @Return {@link List< GuideListResultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/9 10:09 + */ + List getCollectionList(TokenDto tokenDto); + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideExternalLinkDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideExternalLinkDao.java new file mode 100644 index 0000000000..f766b71680 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideExternalLinkDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GuideExternalLinkEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 指南外链表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideExternalLinkDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDao.java new file mode 100644 index 0000000000..07518e24eb --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDao.java @@ -0,0 +1,45 @@ +/** + * 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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ModuleDTO; +import com.epmet.entity.GuideModuleEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 指南模块关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideModuleDao extends BaseDao { + /** + * @Description 获取指南的内容模块 + * @Param guideId + * @Return {@link List< ModuleDTO>} + * @Author zhaoqifeng + * @Date 2021/9/8 10:18 + */ + List selectByGuideId(@Param("customerId") String customerId, @Param("guideId") String guideId); + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDao.java new file mode 100644 index 0000000000..8af7910511 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GuideModuleDictEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideModuleDictDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDefaultDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDefaultDao.java new file mode 100644 index 0000000000..071c7ed2c1 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDefaultDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GuideModuleDictDefaultEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 指南模块默认字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideModuleDictDefaultDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideAttachmentEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideAttachmentEntity.java new file mode 100644 index 0000000000..192f52b306 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideAttachmentEntity.java @@ -0,0 +1,83 @@ +/** + * 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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 办事指南附件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_attachment") +public class GuideAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 办事指南ID + */ + private String guideId; + + /** + * 附件名 + */ + private String attachmentName; + + /** + * 文件大小 单位byte + */ + private Integer attachmentSize; + + /** + * 文件格式 word、excel、pdf + */ + private String attachmentFormat; + + /** + * 类型 + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryEntity.java new file mode 100644 index 0000000000..c13a7a3df9 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryEntity.java @@ -0,0 +1,63 @@ +/** + * 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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 指南分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_category") +public class GuideCategoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id,产品默认配置此列存储default + */ + private String customerId; + + /** + * 分类名,客户内唯一 + */ + private String categoryName; + + /** + * 分类编码:分类名的全拼; eg:gongjijin + */ + private String categoryCode; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCollectionEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCollectionEntity.java new file mode 100644 index 0000000000..f522884f79 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCollectionEntity.java @@ -0,0 +1,61 @@ +/** + * 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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 指南收藏表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_collection") +public class GuideCollectionEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户所属客户端 居民端resi 工作端gov + */ + private String app; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideEntity.java new file mode 100644 index 0000000000..5909729866 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideEntity.java @@ -0,0 +1,78 @@ +/** + * 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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 办事指南表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide") +public class GuideEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 发布单位类型 机关agency 网格grid 部门dept + */ + private String orgType; + + /** + * 发布单位ID + */ + private String orgId; + + /** + * 发布单位名称 + */ + private String orgName; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String pid; + + /** + * 所有上级组织ID,英文:隔开 + */ + private String pids; + + /** + * 标题 + */ + private String title; + + /** + * 分类ID + */ + private String categoryCode; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideExternalLinkEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideExternalLinkEntity.java new file mode 100644 index 0000000000..3773c6acea --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideExternalLinkEntity.java @@ -0,0 +1,63 @@ +/** + * 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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 指南外链表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_external_link") +public class GuideExternalLinkEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 链接说明 + */ + private String description; + + /** + * 外部链接 + */ + private String externalLink; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictDefaultEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictDefaultEntity.java new file mode 100644 index 0000000000..f01788acdc --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictDefaultEntity.java @@ -0,0 +1,61 @@ +/** + * 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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 指南模块默认字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_module_dict_default") +public class GuideModuleDictDefaultEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 模块key + */ + private String moduleValue; + + /** + * 模块名 + */ + private String moduleName; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictEntity.java new file mode 100644 index 0000000000..2816effef0 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictEntity.java @@ -0,0 +1,66 @@ +/** + * 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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_module_dict") +public class GuideModuleDictEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 模块key + */ + private String moduleValue; + + /** + * 模块名 + */ + private String moduleName; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleEntity.java new file mode 100644 index 0000000000..35d602602e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleEntity.java @@ -0,0 +1,61 @@ +/** + * 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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 指南模块关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_module") +public class GuideModuleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 模块ID + */ + private String moduleId; + + /** + * + */ + private String moduleContent; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideAttachmentService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideAttachmentService.java new file mode 100644 index 0000000000..4b297fed10 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideAttachmentService.java @@ -0,0 +1,114 @@ +/** + * 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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.AttachmentDTO; +import com.epmet.dto.GuideAttachmentDTO; +import com.epmet.entity.GuideAttachmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 办事指南附件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideAttachmentDTO + * @author generator + * @date 2021-09-06 + */ + GuideAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Description 删除指南附件 + * @Param guideId + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 17:16 + */ + void deleteByGuideId(String guideId); + + /** + * @Description 获取指南附件 + * @Param guideId + * @Return {@link List< AttachmentDTO>} + * @Author zhaoqifeng + * @Date 2021/9/8 10:49 + */ + List getByGuideId(String guideId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryService.java new file mode 100644 index 0000000000..5bde4619e6 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryService.java @@ -0,0 +1,110 @@ +/** + * 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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GuideCategoryDTO; +import com.epmet.dto.form.EditGuideCategoryFormDTO; +import com.epmet.dto.form.GuideCateOrderFormDTO; +import com.epmet.dto.form.GuideCategoryDropDownFormDTO; +import com.epmet.dto.form.GuideCategoryPageFormDTO; +import com.epmet.dto.result.GuideDictResDTO; +import com.epmet.entity.GuideCategoryEntity; + +import java.util.List; + +/** + * 指南分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideCategoryService extends BaseService { + + /** + * 【办事指南】分类列表-工作端PC和运营端用不分页 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/9/8 1:33 下午 + */ + PageData page(GuideCategoryPageFormDTO formDTO); + + /** + * 办事指南】可用分类列表 新增、编辑指南时的下拉框:展示未禁用的分类; 查询指南列表:如果禁用的分类下存在指南列表,则展示,不存在直接不展示 + * + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @date 2021/9/8 3:06 下午 + */ + List getCategory(GuideCategoryDropDownFormDTO formDTO); + + /** + * 保存排序 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/9/8 4:09 下午 + */ + void saveOrder(GuideCateOrderFormDTO formDTO); + + + /** + * 启用或者禁用分类 + * + * @param formDTO + * @return int + * @author yinzuomei + * @date 2021/9/8 4:20 下午 + */ + void disableGuideCategory(EditGuideCategoryFormDTO formDTO); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + GuideCategoryDTO save(EditGuideCategoryFormDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + GuideCategoryDTO update(EditGuideCategoryFormDTO dto); + + /** + * 删除分类,存在办事指南的不允许删除,给予提示 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/9/8 4:34 下午 + */ + void delete(EditGuideCategoryFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCollectionService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCollectionService.java new file mode 100644 index 0000000000..bd2e97c482 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCollectionService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.GuideCollectionDTO; +import com.epmet.dto.form.GuideFormDTO; +import com.epmet.entity.GuideCollectionEntity; + +import java.util.List; +import java.util.Map; + +/** + * 指南收藏表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideCollectionService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideCollectionDTO + * @author generator + * @date 2021-09-06 + */ + GuideCollectionDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideCollectionDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideCollectionDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Description 收藏指南 + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/9/9 9:46 + */ + void collection(TokenDto tokenDto, GuideFormDTO formDTO); + + /** + * @Description 获取收藏信息 + * @Param tokenDto + * @Param guideId + * @Return {@link GuideCollectionDTO} + * @Author zhaoqifeng + * @Date 2021/9/10 9:52 + */ + GuideCollectionDTO getCollection(TokenDto tokenDto, String guideId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideExternalLinkService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideExternalLinkService.java new file mode 100644 index 0000000000..e54c0d4675 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideExternalLinkService.java @@ -0,0 +1,114 @@ +/** + * 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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ExternalLinkDTO; +import com.epmet.dto.GuideExternalLinkDTO; +import com.epmet.entity.GuideExternalLinkEntity; + +import java.util.List; +import java.util.Map; + +/** + * 指南外链表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideExternalLinkService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideExternalLinkDTO + * @author generator + * @date 2021-09-06 + */ + GuideExternalLinkDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideExternalLinkDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideExternalLinkDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Description 删除指南外链 + * @Param guideId + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 17:20 + */ + void deleteByGuideId(String guideId); + + /** + * @Description 获取指南外链 + * @Param guideId + * @Return {@link List< ExternalLinkDTO>} + * @Author zhaoqifeng + * @Date 2021/9/8 11:05 + */ + List getByGuideId(String guideId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictDefaultService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictDefaultService.java new file mode 100644 index 0000000000..2bf1b3aac7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictDefaultService.java @@ -0,0 +1,104 @@ +/** + * 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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GuideModuleDictDefaultDTO; +import com.epmet.entity.GuideModuleDictDefaultEntity; + +import java.util.List; +import java.util.Map; + +/** + * 指南模块默认字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideModuleDictDefaultService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideModuleDictDefaultDTO + * @author generator + * @date 2021-09-06 + */ + GuideModuleDictDefaultDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideModuleDictDefaultDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideModuleDictDefaultDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * 获取默认配置 + * @Param + * @Return {@link List< GuideModuleDictDefaultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/8 17:44 + */ + List getList(); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictService.java new file mode 100644 index 0000000000..7f1ae4a0e4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictService.java @@ -0,0 +1,105 @@ +/** + * 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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GuideModuleDictDTO; +import com.epmet.dto.ModuleDTO; +import com.epmet.entity.GuideModuleDictEntity; + +import java.util.List; +import java.util.Map; + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideModuleDictService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideModuleDictDTO + * @author generator + * @date 2021-09-06 + */ + GuideModuleDictDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideModuleDictDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideModuleDictDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Description 获取模块列表 + * @Param customerId + * @Return {@link List< ModuleDTO>} + * @Author zhaoqifeng + * @Date 2021/9/8 17:50 + */ + List getModuleList(String customerId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleService.java new file mode 100644 index 0000000000..dc7857f8f9 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GuideModuleDTO; +import com.epmet.dto.ModuleDTO; +import com.epmet.entity.GuideModuleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 指南模块关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideModuleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideModuleDTO + * @author generator + * @date 2021-09-06 + */ + GuideModuleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideModuleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideModuleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Description 删除指南的内容模块 + * @Param guideId + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 17:01 + */ + void deleteByGuideId(String guideId); + + /** + * @Description + * @Param customerId + * @Param guideId + * @Return {@link ModuleDTO} + * @Author zhaoqifeng + * @Date 2021/9/8 10:13 + */ + List getByGuideId(String customerId, String guideId); + + /** + * @Description 获取模块列表 + * @Param customerId + * @Return {@link List< ModuleDTO>} + * @Author zhaoqifeng + * @Date 2021/9/9 14:46 + */ + List getModuleList(String customerId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java new file mode 100644 index 0000000000..a2493a88ac --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java @@ -0,0 +1,165 @@ +/** + * 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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.GuideDTO; +import com.epmet.dto.form.GuideAddFormDTO; +import com.epmet.dto.form.GuideEditFormDTO; +import com.epmet.dto.form.GuideFormDTO; +import com.epmet.dto.form.GuideListFormDTO; +import com.epmet.dto.result.GuideDetailResultDTO; +import com.epmet.dto.result.GuideListResultDTO; +import com.epmet.entity.GuideEntity; + +import java.util.List; +import java.util.Map; + +/** + * 办事指南表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideDTO + * @author generator + * @date 2021-09-06 + */ + GuideDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * 办事指南列表 + * + * @Param formDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2021/9/7 14:00 + */ + PageData guideList(TokenDto tokenDto, GuideListFormDTO formDTO); + + /** + * 添加指南 + * + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 14:12 + */ + void guideAdd(TokenDto tokenDto, GuideAddFormDTO formDTO); + + /** + * 修改指南 + * + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 14:12 + */ + void guideEdit(GuideEditFormDTO formDTO); + + /** + * 删除指南 + * + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 14:12 + */ + void guideDel(GuideFormDTO formDTO); + + /** + * 指南详情 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link GuideDetailResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/7 14:12 + */ + GuideDetailResultDTO guideDetail(TokenDto tokenDto, GuideFormDTO formDTO); + + /** + * @Description 收藏列表 + * @Param tokenDto + * @Param formDTO + * @Return {@link PageData< GuideListResultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/9 10:07 + */ + PageData collectionList(TokenDto tokenDto, PageFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index 62274c346b..1d95335423 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -976,7 +976,8 @@ public class ArticleServiceImpl extends BaseServiceImpl + * 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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideAttachmentDao; +import com.epmet.dto.AttachmentDTO; +import com.epmet.dto.GuideAttachmentDTO; +import com.epmet.entity.GuideAttachmentEntity; +import com.epmet.service.GuideAttachmentService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 办事指南附件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideAttachmentServiceImpl extends BaseServiceImpl implements GuideAttachmentService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideAttachmentDTO.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 GuideAttachmentDTO get(String id) { + GuideAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideAttachmentDTO dto) { + GuideAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, GuideAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideAttachmentDTO dto) { + GuideAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, GuideAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param guideId + * @Description 删除指南附件 + * @Param guideId + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 17:16 + */ + @Override + public void deleteByGuideId(String guideId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(GuideAttachmentEntity::getGuideId, guideId); + baseDao.delete(wrapper); + } + + /** + * @param guideId + * @Description 获取指南附件 + * @Param guideId + * @Return {@link List< AttachmentDTO >} + * @Author zhaoqifeng + * @Date 2021/9/8 10:49 + */ + @Override + public List getByGuideId(String guideId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(GuideAttachmentEntity::getGuideId, guideId); + wrapper.orderByAsc(GuideAttachmentEntity::getSort); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + AttachmentDTO dto = new AttachmentDTO(); + dto.setName(item.getAttachmentName()); + dto.setType(item.getAttachmentType()); + dto.setUrl(item.getAttachmentUrl()); + dto.setSize(item.getAttachmentSize()); + dto.setFormat(item.getAttachmentFormat()); + dto.setDuration(item.getDuration()); + return dto; + }).collect(Collectors.toList()); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryServiceImpl.java new file mode 100644 index 0000000000..6f3f7a082a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryServiceImpl.java @@ -0,0 +1,225 @@ +/** + * 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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Pinyin4jUtil; +import com.epmet.dao.GuideCategoryDao; +import com.epmet.dto.GuideCategoryDTO; +import com.epmet.dto.form.EditGuideCategoryFormDTO; +import com.epmet.dto.form.GuideCateOrderFormDTO; +import com.epmet.dto.form.GuideCategoryDropDownFormDTO; +import com.epmet.dto.form.GuideCategoryPageFormDTO; +import com.epmet.dto.result.GuideDictResDTO; +import com.epmet.entity.GuideCategoryEntity; +import com.epmet.service.GuideCategoryService; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; + +/** + * 指南分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideCategoryServiceImpl extends BaseServiceImpl implements GuideCategoryService { + + + /** + * 【办事指南】分类列表-工作端PC和运营端用不分页 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/9/8 1:33 下午 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public PageData page(GuideCategoryPageFormDTO formDTO) { + List list = baseDao.selectPageByCid(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(list) && !formDTO.getCustomerId().equals(Constant.DEFAULT_CUSTOMER)) { + //初始化默认的给客户 + initCustomerGuideCategory(formDTO.getCustomerId()); + list = baseDao.selectPageByCid(formDTO.getCustomerId()); + } + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 产品默认分类同步给客户,已经禁用的不同步 + * + * @param customerId + * @return void + * @author yinzuomei + * @date 2021/9/8 2:17 下午 + */ + private void initCustomerGuideCategory(String customerId) { + List list = baseDao.selectPageByCid(Constant.DEFAULT_CUSTOMER); + int sort = 0; + for (GuideCategoryDTO dto : list) { + // 已经禁用的,不同步给客户 + if (Constant.DISABLE.equals(dto.getStatus())) { + continue; + } + dto.setCustomerId(customerId); + //清空主键 + dto.setId(null); + dto.setSort(sort); + GuideCategoryEntity entity = ConvertUtils.sourceToTarget(dto, GuideCategoryEntity.class); + insert(entity); + sort++; + } + } + + + /** + * 办事指南】可用分类列表 新增、编辑指南时的下拉框:展示未禁用的分类; 查询指南列表:如果禁用的分类下存在指南列表,则展示,不存在直接不展示 + * + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @date 2021/9/8 3:06 下午 + */ + @Override + public List getCategory(GuideCategoryDropDownFormDTO formDTO) { + List list=baseDao.selectCategoryDict(formDTO.getCustomerId(),formDTO.getQueryOrigin()); + if (CollectionUtils.isEmpty(list) && !formDTO.getCustomerId().equals(Constant.DEFAULT_CUSTOMER)) { + //初始化默认的给客户 + initCustomerGuideCategory(formDTO.getCustomerId()); + list=baseDao.selectCategoryDict(formDTO.getCustomerId(),formDTO.getQueryOrigin()); + } + return list; + } + + /** + * 保存排序 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/9/8 4:09 下午 + */ + @Transactional + @Override + public void saveOrder(GuideCateOrderFormDTO formDTO) { + for (GuideCateOrderFormDTO.OrderIndexDTO idx : formDTO.getOrderList()) { + baseDao.updateOrder(idx.getId(), idx.getOrderIndex(),formDTO.getStaffId()); + } + } + + /** + * 启用或者禁用分类 + * + * @param formDTO + * @return int + * @author yinzuomei + * @date 2021/9/8 4:20 下午 + */ + @Override + public void disableGuideCategory(EditGuideCategoryFormDTO formDTO) { + baseDao.updateStatus(formDTO.getId(), formDTO.getStatus(),formDTO.getStaffId()); + } + + 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; + } + + /** + * 新增分类,名称和编码客户内唯一 + * + * @param dto + * @return void + * @author yinzuomei + * @date 2021/9/8 5:12 下午 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public GuideCategoryDTO save(EditGuideCategoryFormDTO dto) { + if (baseDao.selectCategoryName(dto.getCategoryName().trim(), dto.getCustomerId(), null) > 0) { + throw new RenException(EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getCode(), EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getMsg()); + } + String categoryCode = Pinyin4jUtil.getFirstSpellPinYin(dto.getCategoryName(), true); + if (baseDao.selectCategoryCode(categoryCode, dto.getCustomerId(), null) > 0) { + throw new RenException(EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getCode(), EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getMsg()); + } + GuideCategoryEntity entity = new GuideCategoryEntity(); + entity.setCustomerId(dto.getCustomerId()); + entity.setCategoryName(dto.getCategoryName()); + entity.setCategoryCode(categoryCode); + int currentMax = baseDao.selectCurrentOrder(dto.getCustomerId()); + entity.setSort(currentMax == 0 ? currentMax : currentMax + 1); + entity.setStatus(Constant.ENABLE); + insert(entity); + return ConvertUtils.sourceToTarget(entity,GuideCategoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public GuideCategoryDTO update(EditGuideCategoryFormDTO dto) { + if (baseDao.selectCategoryName(dto.getCategoryName().trim(), dto.getCustomerId(), dto.getId()) > 0) { + throw new RenException(EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getCode(), EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getMsg()); + } + String categoryCode = Pinyin4jUtil.getFirstSpellPinYin(dto.getCategoryName(), true); + if (baseDao.selectCategoryCode(categoryCode, dto.getCustomerId(), dto.getId()) > 0) { + throw new RenException(EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getCode(), EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getMsg()); + } + GuideCategoryEntity origin=baseDao.selectById(dto.getId()); + origin.setCategoryCode(categoryCode); + origin.setCategoryName(dto.getCategoryName()); + updateById(origin); + return ConvertUtils.sourceToTarget(origin,GuideCategoryDTO.class); + } + /** + * 删除分类,存在办事指南的不允许删除,给予提示 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/9/8 4:34 下午 + */ + @Override + public void delete(EditGuideCategoryFormDTO formDTO) { + // 存在指南的分类不允许删除 + if(baseDao.selectGuideTotal(formDTO.getId(),formDTO.getCustomerId())>0){ + throw new RenException(EpmetErrorCode.HAVE_GUIDE_CANNOT_DEL.getCode(),EpmetErrorCode.HAVE_GUIDE_CANNOT_DEL.getMsg()); + } + baseDao.deleteById(formDTO.getId()); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCollectionServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCollectionServiceImpl.java new file mode 100644 index 0000000000..ef0696fa12 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCollectionServiceImpl.java @@ -0,0 +1,157 @@ +/** + * 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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideCollectionDao; +import com.epmet.dto.GuideCollectionDTO; +import com.epmet.dto.form.GuideFormDTO; +import com.epmet.entity.GuideCollectionEntity; +import com.epmet.service.GuideCollectionService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 指南收藏表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideCollectionServiceImpl extends BaseServiceImpl implements GuideCollectionService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideCollectionDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideCollectionDTO.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 GuideCollectionDTO get(String id) { + GuideCollectionEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideCollectionDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideCollectionDTO dto) { + GuideCollectionEntity entity = ConvertUtils.sourceToTarget(dto, GuideCollectionEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideCollectionDTO dto) { + GuideCollectionEntity entity = ConvertUtils.sourceToTarget(dto, GuideCollectionEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param tokenDto + * @param formDTO + * @Description 收藏指南 + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/9/9 9:46 + */ + @Override + public void collection(TokenDto tokenDto, GuideFormDTO formDTO) { + //获取指南收藏信息 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(GuideCollectionEntity::getGuideId, formDTO.getGuideId()); + wrapper.eq(GuideCollectionEntity::getUserId, tokenDto.getUserId()); + wrapper.eq(GuideCollectionEntity::getApp, tokenDto.getApp()); + wrapper.eq(GuideCollectionEntity::getCustomerId, tokenDto.getCustomerId()); + GuideCollectionEntity entity = baseDao.selectOne(wrapper); + //如果没有收藏记录,则添加收藏,有就删除收藏 + if (null == entity) { + entity = new GuideCollectionEntity(); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setUserId(tokenDto.getUserId()); + entity.setGuideId(formDTO.getGuideId()); + entity.setApp(tokenDto.getApp()); + insert(entity); + } else { + deleteById(entity.getId()); + } + } + + /** + * @param tokenDto + * @param guideId + * @Description 获取收藏信息 + * @Param tokenDto + * @Param guideId + * @Return {@link GuideCollectionDTO} + * @Author zhaoqifeng + * @Date 2021/9/10 9:52 + */ + @Override + public GuideCollectionDTO getCollection(TokenDto tokenDto, String guideId) { + //获取指南收藏信息 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(GuideCollectionEntity::getGuideId, guideId); + wrapper.eq(GuideCollectionEntity::getUserId, tokenDto.getUserId()); + wrapper.eq(GuideCollectionEntity::getApp, tokenDto.getApp()); + wrapper.eq(GuideCollectionEntity::getCustomerId, tokenDto.getCustomerId()); + GuideCollectionEntity entity = baseDao.selectOne(wrapper); + return ConvertUtils.sourceToTarget(entity, GuideCollectionDTO.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideExternalLinkServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideExternalLinkServiceImpl.java new file mode 100644 index 0000000000..bd45d0b2a8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideExternalLinkServiceImpl.java @@ -0,0 +1,145 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideExternalLinkDao; +import com.epmet.dto.ExternalLinkDTO; +import com.epmet.dto.GuideExternalLinkDTO; +import com.epmet.entity.GuideExternalLinkEntity; +import com.epmet.service.GuideExternalLinkService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 指南外链表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideExternalLinkServiceImpl extends BaseServiceImpl implements GuideExternalLinkService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideExternalLinkDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideExternalLinkDTO.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 GuideExternalLinkDTO get(String id) { + GuideExternalLinkEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideExternalLinkDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideExternalLinkDTO dto) { + GuideExternalLinkEntity entity = ConvertUtils.sourceToTarget(dto, GuideExternalLinkEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideExternalLinkDTO dto) { + GuideExternalLinkEntity entity = ConvertUtils.sourceToTarget(dto, GuideExternalLinkEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param guideId + * @Description 删除指南外链 + * @Param guideId + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 17:20 + */ + @Override + public void deleteByGuideId(String guideId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(GuideExternalLinkEntity::getGuideId, guideId); + baseDao.delete(wrapper); + } + + /** + * @param guideId + * @Description 获取指南外链 + * @Param guideId + * @Return {@link List< ExternalLinkDTO >} + * @Author zhaoqifeng + * @Date 2021/9/8 11:05 + */ + @Override + public List getByGuideId(String guideId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(GuideExternalLinkEntity::getGuideId, guideId); + wrapper.orderByAsc(GuideExternalLinkEntity::getSort); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + ExternalLinkDTO dto = new ExternalLinkDTO(); + dto.setExternalLink(item.getExternalLink()); + dto.setDescription(item.getDescription()); + return dto; + }).collect(Collectors.toList()); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictDefaultServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictDefaultServiceImpl.java new file mode 100644 index 0000000000..ecc0fff0bb --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictDefaultServiceImpl.java @@ -0,0 +1,114 @@ +/** + * 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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideModuleDictDefaultDao; +import com.epmet.dto.GuideModuleDictDefaultDTO; +import com.epmet.entity.GuideModuleDictDefaultEntity; +import com.epmet.service.GuideModuleDictDefaultService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 指南模块默认字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideModuleDictDefaultServiceImpl extends BaseServiceImpl implements GuideModuleDictDefaultService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideModuleDictDefaultDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideModuleDictDefaultDTO.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 GuideModuleDictDefaultDTO get(String id) { + GuideModuleDictDefaultEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideModuleDictDefaultDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideModuleDictDefaultDTO dto) { + GuideModuleDictDefaultEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleDictDefaultEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideModuleDictDefaultDTO dto) { + GuideModuleDictDefaultEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleDictDefaultEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 获取默认配置 + * + * @Param + * @Return {@link List< GuideModuleDictDefaultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/8 17:44 + */ + @Override + public List getList() { + QueryWrapper wrapper = new QueryWrapper<>(); + return ConvertUtils.sourceToTarget(baseDao.selectList(wrapper), GuideModuleDictDefaultDTO.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictServiceImpl.java new file mode 100644 index 0000000000..e3fa3ea17b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictServiceImpl.java @@ -0,0 +1,144 @@ +/** + * 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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideModuleDictDao; +import com.epmet.dto.GuideModuleDictDTO; +import com.epmet.dto.GuideModuleDictDefaultDTO; +import com.epmet.dto.ModuleDTO; +import com.epmet.entity.GuideModuleDictEntity; +import com.epmet.service.GuideModuleDictDefaultService; +import com.epmet.service.GuideModuleDictService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideModuleDictServiceImpl extends BaseServiceImpl implements GuideModuleDictService { + + @Resource + private GuideModuleDictDefaultService guideModuleDictDefaultService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideModuleDictDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideModuleDictDTO.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 GuideModuleDictDTO get(String id) { + GuideModuleDictEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideModuleDictDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideModuleDictDTO dto) { + GuideModuleDictEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleDictEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideModuleDictDTO dto) { + GuideModuleDictEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleDictEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param customerId + * @Description 获取模块列表 + * @Param customerId + * @Return {@link List< ModuleDTO >} + * @Author zhaoqifeng + * @Date 2021/9/8 17:50 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public List getModuleList(String customerId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(GuideModuleDictEntity::getCustomerId, customerId); + wrapper.orderByAsc(GuideModuleDictEntity::getSort); + List list = baseDao.selectList(wrapper); + //结果为空,初始化默认配置 + if (CollectionUtils.isEmpty(list)) { + List defaultList = guideModuleDictDefaultService.getList(); + List moduleList = ConvertUtils.sourceToTarget(defaultList, GuideModuleDictEntity.class); + moduleList.forEach(item -> { + item.setId(null); + item.setCustomerId(customerId); + }); + insertBatch(moduleList); + list = moduleList; + } + return list.stream().map(item -> { + ModuleDTO dto = new ModuleDTO(); + dto.setModuleId(item.getId()); + dto.setModuleValue(item.getModuleValue()); + dto.setModuleName(item.getModuleName()); + return dto; + }).collect(Collectors.toList()); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleServiceImpl.java new file mode 100644 index 0000000000..0ccf158036 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleServiceImpl.java @@ -0,0 +1,147 @@ +/** + * 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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideModuleDao; +import com.epmet.dto.GuideModuleDTO; +import com.epmet.dto.ModuleDTO; +import com.epmet.entity.GuideModuleEntity; +import com.epmet.service.GuideModuleDictService; +import com.epmet.service.GuideModuleService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 指南模块关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideModuleServiceImpl extends BaseServiceImpl implements GuideModuleService { + + @Resource + private GuideModuleDictService guideModuleDictService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideModuleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideModuleDTO.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 GuideModuleDTO get(String id) { + GuideModuleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideModuleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideModuleDTO dto) { + GuideModuleEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideModuleDTO dto) { + GuideModuleEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param guideId + * @Description 删除指南的内容模块 + * @Param guideId + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 17:01 + */ + @Override + public void deleteByGuideId(String guideId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(GuideModuleEntity::getGuideId, guideId); + baseDao.delete(wrapper); + } + + /** + * @param guideId + * @Description 获取指南的内容模块 + * @Param guideId + * @Return {@link ModuleDTO} + * @Author zhaoqifeng + * @Date 2021/9/8 10:13 + */ + @Override + public List getByGuideId(String customerId, String guideId) { + return baseDao.selectByGuideId(customerId, guideId); + } + + /** + * @param customerId + * @Description 获取模块列表 + * @Param customerId + * @Return {@link List< ModuleDTO>} + * @Author zhaoqifeng + * @Date 2021/9/9 14:46 + */ + @Override + public List getModuleList(String customerId) { + return guideModuleDictService.getModuleList(customerId); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java new file mode 100644 index 0000000000..d93f21b2af --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java @@ -0,0 +1,423 @@ +/** + * 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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.OrgInfoConstant; +import com.epmet.dao.GuideDao; +import com.epmet.dto.GuideDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.GuideDetailResultDTO; +import com.epmet.dto.result.GuideListResultDTO; +import com.epmet.dto.result.OrgResultDTO; +import com.epmet.entity.GuideAttachmentEntity; +import com.epmet.entity.GuideEntity; +import com.epmet.entity.GuideExternalLinkEntity; +import com.epmet.entity.GuideModuleEntity; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.*; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +/** + * 办事指南表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideServiceImpl extends BaseServiceImpl implements GuideService { + + @Resource + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Resource + private GuideModuleService guideModuleService; + @Resource + private GuideAttachmentService guideAttachmentService; + @Resource + private GuideExternalLinkService guideExternalLinkService; + @Resource + private GuideCollectionService guideCollectionService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideDTO.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 GuideDTO get(String id) { + GuideEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideDTO dto) { + GuideEntity entity = ConvertUtils.sourceToTarget(dto, GuideEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideDTO dto) { + GuideEntity entity = ConvertUtils.sourceToTarget(dto, GuideEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 办事指南列表 + * + * @param formDTO + * @Param formDTO + * @Return {@link PageData< GuideListResultDTO >} + * @Author zhaoqifeng + * @Date 2021/9/7 14:00 + */ + @Override + public PageData guideList(TokenDto tokenDto, GuideListFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + List list = baseDao.getGuideList(formDTO); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), item.getCreatedId()); + if (null == staffInfoCache) { + item.setCategoryName(""); + } else { + item.setCreatedName(staffInfoCache.getRealName()); + } + }); + } + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 添加指南 + * + * @param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 14:12 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void guideAdd(TokenDto tokenDto, GuideAddFormDTO formDTO) { + if (CollectionUtils.isEmpty(formDTO.getModuleList()) && CollectionUtils.isEmpty(formDTO.getAttachmentList()) && + CollectionUtils.isEmpty(formDTO.getExternalLinks())) { + throw new RenException(EpmetErrorCode.GUIDE_IS_NULL.getCode()); + } + //保存办事指南表 + GuideEntity guideDTO = new GuideEntity(); + guideDTO.setCustomerId(tokenDto.getCustomerId()); + guideDTO.setOrgId(formDTO.getOrgId()); + guideDTO.setOrgType(formDTO.getOrgType()); + guideDTO.setOrgName(formDTO.getOrgName()); + guideDTO.setCategoryCode(formDTO.getCategoryCode()); + guideDTO.setTitle(formDTO.getTitle()); + OrgFormDTO orgFormDTO = new OrgFormDTO(); + orgFormDTO.setOrgId(formDTO.getOrgId()); + orgFormDTO.setOrgType(formDTO.getOrgType()); + //获取组织的pId和pIds + Result result = govOrgOpenFeignClient.getAgencyInfo(orgFormDTO); + if (!result.success() || null == result.getData()) { + throw new RenException(result.getCode(), result.getMsg()); + } + if (OrgInfoConstant.AGENCY.equals(formDTO.getOrgType())) { + guideDTO.setPid(result.getData().getPid()); + } else { + guideDTO.setPid(result.getData().getAgencyId()); + } + guideDTO.setPids(result.getData().getPids().concat(":").concat(result.getData().getAgencyId())); + insert(guideDTO); + //保存办事指南内容模块 + if (CollectionUtils.isNotEmpty(formDTO.getModuleList())) { + List guideModuleList = formDTO.getModuleList().stream().map(item -> { + GuideModuleEntity entity = new GuideModuleEntity(); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setGuideId(guideDTO.getId()); + entity.setModuleId(item.getModuleId()); + entity.setModuleContent(item.getModuleContent()); + return entity; + }).collect(Collectors.toList()); + guideModuleService.insertBatch(guideModuleList); + } + //保存附件 + if (CollectionUtils.isNotEmpty(formDTO.getAttachmentList())) { + AtomicInteger i = new AtomicInteger(1); + List attachmentList = formDTO.getAttachmentList().stream().map(item -> { + GuideAttachmentEntity entity = new GuideAttachmentEntity(); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setGuideId(guideDTO.getId()); + entity.setAttachmentName(item.getName()); + entity.setAttachmentFormat(item.getFormat()); + entity.setAttachmentSize(item.getSize()); + entity.setAttachmentType(item.getType()); + entity.setAttachmentUrl(item.getUrl()); + entity.setDuration(item.getDuration()); + entity.setSort(i.getAndIncrement()); + return entity; + }).collect(Collectors.toList()); + guideAttachmentService.insertBatch(attachmentList); + } + //保存外链地址 + if (CollectionUtils.isNotEmpty(formDTO.getExternalLinks())) { + AtomicInteger i = new AtomicInteger(1); + List linkList = formDTO.getExternalLinks().stream().map(item -> { + GuideExternalLinkEntity entity = new GuideExternalLinkEntity(); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setGuideId(guideDTO.getId()); + entity.setExternalLink(item.getExternalLink()); + entity.setDescription(item.getDescription()); + entity.setSort(i.getAndIncrement()); + return entity; + + }).collect(Collectors.toList()); + guideExternalLinkService.insertBatch(linkList); + } + + } + + /** + * 修改指南 + * + * @param formDTO + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 14:12 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void guideEdit(GuideEditFormDTO formDTO) { + if (CollectionUtils.isEmpty(formDTO.getModuleList()) && CollectionUtils.isEmpty(formDTO.getAttachmentList()) && + CollectionUtils.isEmpty(formDTO.getExternalLinks())) { + throw new RenException(EpmetErrorCode.GUIDE_IS_NULL.getCode()); + } + //保存办事指南表 + GuideDTO guideDTO = get(formDTO.getGuideId()); + if (!formDTO.getStaffId().equals(guideDTO.getCreatedBy())) { + throw new RenException(EpmetErrorCode.GUIDE_IS_NOT_YOURS.getCode()); + } + guideDTO.setOrgId(formDTO.getOrgId()); + guideDTO.setOrgType(formDTO.getOrgType()); + guideDTO.setCategoryCode(formDTO.getCategoryCode()); + guideDTO.setTitle(formDTO.getTitle()); + OrgFormDTO orgFormDTO = new OrgFormDTO(); + orgFormDTO.setOrgId(formDTO.getOrgId()); + orgFormDTO.setOrgType(formDTO.getOrgType()); + guideDTO.setOrgName(formDTO.getOrgName()); + //获取组织的pId和pIds + Result result = govOrgOpenFeignClient.getAgencyInfo(orgFormDTO); + if (!result.success() || null == result.getData()) { + throw new RenException(result.getCode(), result.getMsg()); + } + if (OrgInfoConstant.AGENCY.equals(formDTO.getOrgType())) { + guideDTO.setPid(result.getData().getPid()); + } else { + guideDTO.setPid(result.getData().getAgencyId()); + } + guideDTO.setPids(result.getData().getPids().concat(":").concat(result.getData().getAgencyId())); + update(guideDTO); + //保存办事指南内容模块 + if (CollectionUtils.isNotEmpty(formDTO.getModuleList())) { + List guideModuleList = formDTO.getModuleList().stream().map(item -> { + GuideModuleEntity entity = new GuideModuleEntity(); + entity.setCustomerId(guideDTO.getCustomerId()); + entity.setId(item.getGuideModuleId()); + entity.setGuideId(guideDTO.getId()); + entity.setModuleId(item.getModuleId()); + entity.setModuleContent(item.getModuleContent()); + return entity; + }).collect(Collectors.toList()); + guideModuleService.insertBatch(guideModuleList.stream().filter(item -> null == item.getId()).collect(Collectors.toList())); + guideModuleService.updateBatchById(guideModuleList.stream().filter(item -> null != item.getId()).collect(Collectors.toList())); + } + //保存附件 + guideAttachmentService.deleteByGuideId(formDTO.getGuideId()); + if (CollectionUtils.isNotEmpty(formDTO.getAttachmentList())) { + AtomicInteger i = new AtomicInteger(1); + List attachmentList = formDTO.getAttachmentList().stream().map(item -> { + GuideAttachmentEntity entity = new GuideAttachmentEntity(); + entity.setCustomerId(guideDTO.getCustomerId()); + entity.setGuideId(guideDTO.getId()); + entity.setAttachmentName(item.getName()); + entity.setAttachmentFormat(item.getFormat()); + entity.setAttachmentSize(item.getSize()); + entity.setAttachmentType(item.getType()); + entity.setAttachmentUrl(item.getUrl()); + entity.setDuration(item.getDuration()); + entity.setSort(i.getAndIncrement()); + return entity; + }).collect(Collectors.toList()); + guideAttachmentService.insertBatch(attachmentList); + } + //保存外链地址 + guideExternalLinkService.deleteByGuideId(formDTO.getGuideId()); + if (CollectionUtils.isNotEmpty(formDTO.getExternalLinks())) { + AtomicInteger i = new AtomicInteger(1); + List linkList = formDTO.getExternalLinks().stream().map(item -> { + GuideExternalLinkEntity entity = new GuideExternalLinkEntity(); + entity.setCustomerId(guideDTO.getCustomerId()); + entity.setGuideId(guideDTO.getId()); + entity.setExternalLink(item.getExternalLink()); + entity.setDescription(item.getDescription()); + entity.setSort(i.getAndIncrement()); + return entity; + + }).collect(Collectors.toList()); + guideExternalLinkService.insertBatch(linkList); + } + } + + /** + * 删除指南 + * + * @param formDTO + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 14:12 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void guideDel(GuideFormDTO formDTO) { + GuideDTO guide = get(formDTO.getGuideId()); + if (!formDTO.getStaffId().equals(guide.getCreatedBy())) { + throw new RenException(EpmetErrorCode.GUIDE_IS_NOT_YOURS.getCode()); + } + //删除主表 + baseDao.deleteById(formDTO.getGuideId()); + //删除内容模块 + guideModuleService.deleteByGuideId(formDTO.getGuideId()); + //删除附件 + guideAttachmentService.deleteByGuideId(formDTO.getGuideId()); + //删除外链 + guideExternalLinkService.deleteByGuideId(formDTO.getGuideId()); + } + + /** + * 指南详情 + * + * @param formDTO + * @Param formDTO + * @Return {@link GuideDetailResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/7 14:12 + */ + @Override + public GuideDetailResultDTO guideDetail(TokenDto tokenDto, GuideFormDTO formDTO) { + //获取指南详情 + GuideDetailResultDTO result = baseDao.getGuideDetail(formDTO.getCustomerId(), formDTO.getGuideId()); + if (null == result) { + result = new GuideDetailResultDTO(); + } + //获取指南内容模块 + result.setModuleList(guideModuleService.getByGuideId(formDTO.getCustomerId(), formDTO.getGuideId())); + //获取指南附件 + result.setAttachmentList(guideAttachmentService.getByGuideId(formDTO.getGuideId())); + //获取指南外链地址 + result.setExternalLinks(guideExternalLinkService.getByGuideId(formDTO.getGuideId())); + //是否收藏 + result.setCollectionFlag(NumConstant.ZERO_STR); + if (null != guideCollectionService.getCollection(tokenDto, formDTO.getGuideId())) { + result.setCollectionFlag(NumConstant.ONE_STR); + } + return result; + } + + /** + * @param tokenDto + * @Description 收藏列表 + * @Param tokenDto + * @Param formDTO + * @Return {@link PageData< GuideListResultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/9 10:03 + */ + @Override + public PageData collectionList(TokenDto tokenDto, PageFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.getCollectionList(tokenDto); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), item.getCreatedId()); + if (null == staffInfoCache) { + item.setCategoryName(""); + } else { + item.setCreatedName(staffInfoCache.getRealName()); + } + }); + } + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.7__create_guide_table.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.7__create_guide_table.sql new file mode 100644 index 0000000000..af177ee0d7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.7__create_guide_table.sql @@ -0,0 +1,139 @@ +CREATE TABLE `guide` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `ORG_TYPE` varchar(255) DEFAULT NULL COMMENT '机关agency 网格grid 部门dept', + `ORG_ID` varchar(64) NOT NULL COMMENT '发布单位ID', + `ORG_NAME` varchar(128) DEFAULT NULL COMMENT '发布单位名', + `PID` varchar(64) NOT NULL COMMENT '所属组织机构ID(customer_agency.id)', + `PIDS` varchar(1024) NOT NULL COMMENT '所有上级组织ID,英文:隔开', + `TITLE` varchar(128) NOT NULL COMMENT '标题', + `CATEGORY_CODE` varchar(32) NOT NULL COMMENT '分类ID', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='办事指南表 '; + + +CREATE TABLE `guide_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `GUIDE_ID` varchar(64) NOT NULL COMMENT '办事指南ID', + `ATTACHMENT_NAME` varchar(128) DEFAULT NULL COMMENT '附件名', + `ATTACHMENT_SIZE` int(11) DEFAULT NULL COMMENT '文件大小 单位byte', + `ATTACHMENT_FORMAT` varchar(32) DEFAULT NULL COMMENT '文件格式 word、excel、pdf', + `ATTACHMENT_TYPE` varchar(32) DEFAULT NULL COMMENT '类型 ', + `ATTACHMENT_URL` varchar(256) DEFAULT NULL COMMENT '附件地址', + `DURATION` int(11) DEFAULT NULL COMMENT '语音或视频时长,秒', + `SORT` int(11) NOT NULL COMMENT '排序', + `DEL_FLAG` int(1) NOT NULL COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='办事指南附件'; + + +CREATE TABLE `guide_category` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id,产品默认配置此列存储default', + `CATEGORY_NAME` varchar(64) NOT NULL COMMENT '分类名,客户内唯一', + `CATEGORY_CODE` varchar(64) NOT NULL COMMENT '分类编码:分类名的全拼; eg:gongjijin', + `SORT` int(11) NOT NULL COMMENT '排序', + `STATUS` varchar(10) NOT NULL COMMENT '状态 禁用disable 启用enable', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='指南分类'; + + +CREATE TABLE `guide_collection` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `GUIDE_ID` varchar(64) NOT NULL COMMENT '指南ID', + `USER_ID` varchar(64) NOT NULL COMMENT '用户ID', + `APP` varchar(64) NOT NULL COMMENT '用户所属客户端 居民端resi 工作端gov', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='指南收藏表'; + + +CREATE TABLE `guide_external_link` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `GUIDE_ID` varchar(64) NOT NULL COMMENT '指南ID', + `DESCRIPTION` varchar(64) NOT NULL COMMENT '链接说明', + `EXTERNAL_LINK` varchar(255) NOT NULL COMMENT '外部链接', + `SORT` int(11) NOT NULL COMMENT '排序', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='指南外链表'; + + +CREATE TABLE `guide_module` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `GUIDE_ID` varchar(64) NOT NULL COMMENT '指南ID', + `MODULE_ID` varchar(64) NOT NULL COMMENT '模块ID', + `MODULE_CONTENT` longtext, + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='指南模块关联表'; + + +CREATE TABLE `guide_module_dict` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `MODULE_VALUE` varchar(64) NOT NULL COMMENT '模块key', + `MODULE_NAME` varchar(64) NOT NULL COMMENT '模块名', + `SORT` int(11) NOT NULL COMMENT '排序', + `STATUS` varchar(10) NOT NULL COMMENT '状态 禁用disable 启用enable', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='指南模块字典表'; + + +CREATE TABLE `guide_module_dict_default` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `MODULE_VALUE` varchar(64) NOT NULL COMMENT '模块key', + `MODULE_NAME` varchar(64) NOT NULL COMMENT '模块名', + `SORT` int(11) NOT NULL COMMENT '排序', + `STATUS` varchar(10) NOT NULL COMMENT '状态 禁用disable 启用enable', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='指南模块默认字典表'; + diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.8__insert_default_guidecategory.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.8__insert_default_guidecategory.sql new file mode 100644 index 0000000000..8a95feaad8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.8__insert_default_guidecategory.sql @@ -0,0 +1,12 @@ +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1', 'default', '社保', 'shebao', 0, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('2', 'default', '驾驶行驶', 'jiashixingshi', 1, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3', 'default', '公积金', 'gongjijin', 2, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('4', 'default', '出入境', 'churujing', 3, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('5', 'default', '婚育收养', 'hunyushouyang', 4, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('6', 'default', '户政', 'huzheng', 5, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('7', 'default', '教育培训', 'jiaoyupeixun', 6, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('8', 'default', '劳动就业', 'laodongjiuye', 7, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('9', 'default', '办税指南', 'banshuizhinan', 8, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10', 'default', '人才', 'rencai', 9, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('11', 'default', '职业资格', 'zhiyezige', 10, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('12', 'default', '医疗健康', 'yiliaojiankang', 11, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.9__insert_default_guide_module.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.9__insert_default_guide_module.sql new file mode 100644 index 0000000000..d6a28ecaf4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.9__insert_default_guide_module.sql @@ -0,0 +1,10 @@ +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10001', 'basic_info', '基本信息', 1, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10002', 'handling_info', '办理信息', 2, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10003', 'setting_basis', '设定依据', 3, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10004', 'handling_process', '办理流程', 4, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10005', 'legal_remedy', '法律救济', 5, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10006', 'accept_condition', '受理条件', 6, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10007', 'material_catalog', '材料目录', 7, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10008', 'consultation_method', '咨询方式', 8, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10009', 'complaint_method', '投诉方式', 9, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10010', 'charging_info', '收费信息', 10, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideAttachmentDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideAttachmentDao.xml new file mode 100644 index 0000000000..7c34e2d2f2 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideAttachmentDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDao.xml new file mode 100644 index 0000000000..7bd2f78df8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDao.xml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + update guide_category + set SORT=#{orderIndex}, + UPDATED_BY=#{staffId}, + UPDATED_TIME=NOW() + where id=#{id} + and del_flag='0' + + + + + update guide_category + set status=#{status}, + UPDATED_BY=#{staffId}, + UPDATED_TIME=NOW() + where id=#{id} + and del_flag='0' + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCollectionDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCollectionDao.xml new file mode 100644 index 0000000000..69f598adf7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCollectionDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml new file mode 100644 index 0000000000..a850719121 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideExternalLinkDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideExternalLinkDao.xml new file mode 100644 index 0000000000..e570f994b4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideExternalLinkDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDao.xml new file mode 100644 index 0000000000..3d329b642d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDao.xml new file mode 100644 index 0000000000..be18e67c5d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDefaultDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDefaultDao.xml new file mode 100644 index 0000000000..89cc9ac2e3 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDefaultDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index f66c547f6c..3b31e4feac 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -215,6 +215,10 @@ public class CustomerServiceImpl extends BaseServiceImpl getCustomerInfo(CustomerDTO dto) { CustomerEntity entity = baseDao.selectById(dto.getId()); + if (null == entity) { + log.warn(String.format("当前客户id:%s,已删除", dto.getId())); + return new Result(); + } List customerIds=customerRelationService.getAllSubCustomerIds(dto.getId()); CustomerDTO customerDTO=ConvertUtils.sourceToTarget(entity, CustomerDTO.class); if(CollectionUtils.isEmpty(customerIds)){ diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/ActConstant.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/ActConstant.java new file mode 100644 index 0000000000..30f06ebaf6 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/ActConstant.java @@ -0,0 +1,17 @@ +package com.epmet.resi.group.constant; + +/** + * @Author zxc + * @DateTime 2021/9/3 4:39 下午 + * @DESC + */ +public interface ActConstant { + + /** + * 类型【组织活动次数:orgAct,应参加活动次数:joinAct,活动签到次数:signAct】 + */ + String ORG_ACT = "orgAct"; + String JOIN_ACT = "joinAct"; + String SIGN_ACT = "signAct"; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActCommentAttachmentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActCommentAttachmentDTO.java new file mode 100644 index 0000000000..5326d3783d --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActCommentAttachmentDTO.java @@ -0,0 +1,126 @@ +/** + * 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.epmet.resi.group.dto.act; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 活动评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class ActCommentAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 活动Id[group_act_info.id] + */ + private String groupActId; + + /** + * 评论Id + */ + private String actCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/LineChartDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/LineChartDTO.java new file mode 100644 index 0000000000..94ac78be16 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/LineChartDTO.java @@ -0,0 +1,25 @@ +package com.epmet.resi.group.dto.act; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/18 9:37 上午 + * @DESC + */ +@Data +public class LineChartDTO implements Serializable { + + private static final long serialVersionUID = -8479227864670104465L; + + private Integer value; + + private String month; + + public LineChartDTO() { + this.value = NumConstant.ZERO; + } +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/OrganizationalLifeLineChartDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/OrganizationalLifeLineChartDTO.java new file mode 100644 index 0000000000..ad5dca0bba --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/OrganizationalLifeLineChartDTO.java @@ -0,0 +1,44 @@ +package com.epmet.resi.group.dto.act; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/3 3:35 下午 + * @DESC + */ +@Data +public class OrganizationalLifeLineChartDTO implements Serializable { + + private static final long serialVersionUID = -4224453421929580053L; + + /** + * 月份 + */ + private String month; + + /** + * 组织活动次数 + */ + private Integer organizationalActCount; + + /** + * 应参加活动次数 + */ + private Integer shouldJoinActCount; + + /** + * 活动签到次数 + */ + private Integer actSignCount; + + public OrganizationalLifeLineChartDTO() { + this.month = ""; + this.organizationalActCount = NumConstant.ZERO; + this.shouldJoinActCount = NumConstant.ZERO; + this.actSignCount = NumConstant.ZERO; + } +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CommentFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CommentFormDTO.java index 92fce732ae..6645dce753 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CommentFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CommentFormDTO.java @@ -1,11 +1,13 @@ package com.epmet.resi.group.dto.act.form; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; import lombok.Data; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.List; /** * 005、评论活动 @@ -24,9 +26,13 @@ public class CommentFormDTO implements Serializable { @NotBlank(message = "groupActId不能为空", groups = AddUserInternalGroup.class) private String groupActId; - @NotBlank(message = "评论内容不能为空", groups = AddUserShowGroup.class) - @Length(max = 500, message = "评论内容最多输入500字", groups = AddUserShowGroup.class) + //@NotBlank(message = "评论内容不能为空", groups = AddUserShowGroup.class) + @Length(max = 500, message = "评论内容最多输入500字") private String commentContent; + /** + * 图片附件集合 + */ + private List imageList; /** * 当前用户id diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/OrganizationalLifeFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/OrganizationalLifeFormDTO.java new file mode 100644 index 0000000000..3e515c2c75 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/OrganizationalLifeFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.resi.group.dto.act.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/3 2:52 下午 + * @DESC + */ +@Data +public class OrganizationalLifeFormDTO implements Serializable { + + private static final long serialVersionUID = -8611679719504666547L; + + private String yearId; + + private String userId; + + private String customerId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/CommentResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/CommentResultDTO.java index efb8066f28..a6053ffc39 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/CommentResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/CommentResultDTO.java @@ -1,10 +1,13 @@ package com.epmet.resi.group.dto.act.result; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.Date; +import java.util.List; /** * 006、活动评论列表查询 @@ -27,4 +30,11 @@ public class CommentResultDTO implements Serializable { private Date commentTime; private String commentUserId; + + /** + * 图片附件集合 + */ + private List imageList = new ArrayList<>(); + + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/OrganizationalLifeResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/OrganizationalLifeResultDTO.java new file mode 100644 index 0000000000..e68cbd02be --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/OrganizationalLifeResultDTO.java @@ -0,0 +1,47 @@ +package com.epmet.resi.group.dto.act.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.resi.group.dto.act.OrganizationalLifeLineChartDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/9/3 2:35 下午 + * @DESC + */ +@Data +public class OrganizationalLifeResultDTO implements Serializable { + + private static final long serialVersionUID = 6991638491754890967L; + + /** + * 组织活动次数 + */ + private Integer organizationalActCount; + + /** + * 应参加活动次数 + */ + private Integer shouldJoinActCount; + + /** + * 活动签到次数 + */ + private Integer actSignCount; + + /** + * 折线图 + */ + private List lineChart; + + public OrganizationalLifeResultDTO() { + this.organizationalActCount = NumConstant.ZERO; + this.shouldJoinActCount = NumConstant.ZERO; + this.actSignCount = NumConstant.ZERO; + this.lineChart = new ArrayList<>(); + } +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/ResiCommentResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/ResiCommentResultDTO.java index c28985e054..57ae73c471 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/ResiCommentResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/ResiCommentResultDTO.java @@ -1,11 +1,14 @@ package com.epmet.resi.group.dto.comment.result; import com.alibaba.fastjson.annotation.JSONField; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.Date; +import java.util.List; /** * @Description @@ -54,4 +57,9 @@ public class ResiCommentResultDTO implements Serializable { * 评论状态 * */ private String commentStatus; + + /** + * 图片附件集合 + */ + private List imageList = new ArrayList<>(); } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupFormDTO.java index 2fc8ba7b9a..96295879f1 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupFormDTO.java @@ -1,8 +1,10 @@ package com.epmet.resi.group.dto.group.form; +import com.epmet.resi.group.enums.SearchScopeTypeEnum; import lombok.Data; - +import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.util.List; /** * @author zhaoqifeng @@ -11,7 +13,77 @@ import java.io.Serializable; */ @Data public class GroupFormDTO implements Serializable { + private static final long serialVersionUID = 5330629771935235995L; + + /** 排除某些指定id之外的组列表 */ + public interface GroupDetailsExcludeGroupIds {} + private String groupId; + private String gridId; + + /** 小组所属范围:grid网格,customer客户 */ + @NotNull(message = "搜索范围类型不能为空", groups = { GroupDetailsExcludeGroupIds.class }) + private SearchScopeTypeEnum searchScopeType; + + @NotNull(message = "搜索范围对象的ID不能为空", groups = { GroupDetailsExcludeGroupIds.class }) + private String searchScopeObjectId; + + private List excludeGroupIds; + + /** 从第几条开始取 */ + private Integer startRow = 0; + + /** 取几条数据 */ + private Integer rowCount = 10; + + @NotNull(message = "排序字段不能为空", groups = { GroupDetailsExcludeGroupIds.class }) + private SortTypeEnum sort; + + @NotNull(message = "排序方式不能为空", groups = { GroupDetailsExcludeGroupIds.class }) + private OrderTypeEnum order; + + /** + * @Description 排序类型 + * @author wxz + * @date 2021.09.07 17:00:24 + */ + public enum SortTypeEnum { + + CREATE_TIME("create_time"); + + private String sortField; + + SortTypeEnum(String sortField) { + this.sortField = sortField; + } + + public String getSortField() { + return sortField; + } + } + + /** + * @Description 排序方式 + * @author wxz + * @date 2021.09.07 17:02:05 + */ + public enum OrderTypeEnum { + + ASC("asc"), + DESC("desc"); + + private String orderType; + + OrderTypeEnum(String orderType) { + this.orderType = orderType; + } + + public String getOrderType() { + return orderType; + } + } + + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupsByMemberFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupsByMemberFormDTO.java new file mode 100644 index 0000000000..806b07629e --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupsByMemberFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.resi.group.dto.group.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * @Description 根据成员查询组列表form + * @author wxz + * @date 2021.09.08 14:12:44 +*/ +@Data +public class GroupsByMemberFormDTO { + private String gridId; + @NotNull(message = "成员用户ID不能为空") + private String userId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java index d31e01cab8..3ddbd344d2 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java @@ -47,4 +47,8 @@ public class AllGroupListResultDTO implements Serializable { */ private String groupType; + /** + * 群介绍 + */ + private String groupIntroduction = ""; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/CommentFileDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/CommentFileDTO.java new file mode 100644 index 0000000000..dfec88238a --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/CommentFileDTO.java @@ -0,0 +1,28 @@ +package com.epmet.resi.group.dto.group.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 话题、通知、活动评论附件 + */ +@NoArgsConstructor +@Data +public class CommentFileDTO implements Serializable { + + private static final long serialVersionUID = -3930520724652521552L; + private String name; + private String url; + private String type; + private String format; + private Integer size; + private Integer duration; + @JsonIgnore + private String commentId; + @JsonIgnore + private String userId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java index c7767054d4..7d08176f31 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java @@ -9,7 +9,9 @@ import lombok.NoArgsConstructor; @AllArgsConstructor public class GroupDetailResultDTO { + private String gridId; private String groupHeadPhoto; + private String groupId; private String groupName; private String groupIntroduction; private Integer editNumLimit; @@ -17,5 +19,11 @@ public class GroupDetailResultDTO { private String auditStatus; private Boolean editable; private String remark; - + /** 群组类型:branch:支部小组,ordinary:楼院小组 */ + private String groupType; + private String customerId; + /** 组长ID */ + private String leaderId; + /** 当前用户是否是群主 */ + private String groupLeaderFlag; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupSummarizeResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupSummarizeResultDTO.java index dbf681b90d..28755fffe8 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupSummarizeResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupSummarizeResultDTO.java @@ -69,6 +69,14 @@ public class GroupSummarizeResultDTO implements Serializable { * 进组审核open开启;close关闭 */ private String auditSwitch; + /** + * 小组类型(ordinary:楼院小组 branch:支部小组) + */ + private String groupType; + /** + * 小组类型名称 + */ + private String groupTypeName; private String level; public GroupSummarizeResultDTO(){ diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RankingResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RankingResultDTO.java new file mode 100644 index 0000000000..99357eb400 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RankingResultDTO.java @@ -0,0 +1,11 @@ +package com.epmet.resi.group.dto.group.result; + +import lombok.Data; + +@Data +public class RankingResultDTO { + + private Integer gridRanking; + private Integer customerRanking; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendGroupResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendGroupResultDTO.java index 72de523d2a..ff080a5864 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendGroupResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendGroupResultDTO.java @@ -48,4 +48,9 @@ public class RecommendGroupResultDTO implements Serializable { */ private String groupType; + /** + * 群介绍 + */ + private String groupIntroduction = ""; + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendedListResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendedListResultDTO.java index 47fbf7d9be..4e9834470a 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendedListResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendedListResultDTO.java @@ -37,4 +37,9 @@ public class RecommendedListResultDTO implements Serializable { * 组长名 */ private String leaderName; + + /** + * 群介绍 + */ + private String groupIntroduction = ""; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/NoticeCommentAttachmentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/NoticeCommentAttachmentDTO.java new file mode 100644 index 0000000000..6e7c7e336f --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/NoticeCommentAttachmentDTO.java @@ -0,0 +1,126 @@ +/** + * 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.epmet.resi.group.dto.notice; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 通知评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class NoticeCommentAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 通知Id + */ + private String noticeId; + + /** + * 评论Id + */ + private String noticeCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java index c543bf7222..4269e86262 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java @@ -5,6 +5,7 @@ import lombok.Data; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; +import java.util.List; /** * @Author sun @@ -21,8 +22,8 @@ public class NoticeCommentFormDTO { /** * 评论内容300 */ - @NotBlank(message = "评论内容不能为空",groups = {NoticeCommentFormDTO.UserShow.class}) - @Length(max = 20, message = "评论内容不能超过300个字符",groups = {NoticeCommentFormDTO.UserShow.class}) + //@NotBlank(message = "评论内容不能为空",groups = {NoticeCommentFormDTO.UserShow.class}) + @Length(max = 300, message = "评论内容不能超过300个字符") private String commentContent; /** @@ -30,6 +31,11 @@ public class NoticeCommentFormDTO { */ private String userId; + /** + * 图片附件集合 + */ + private List imageList; + public interface Comment{} public interface UserShow extends CustomerClientShowGroup {} } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java index 726289e144..45a9c9f694 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java @@ -1,11 +1,13 @@ package com.epmet.resi.group.dto.notice.result; -import com.alibaba.fastjson.annotation.JSONField; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.Date; +import java.util.List; /** * @Author sun @@ -42,4 +44,9 @@ public class NoticeCommentListResultDTO implements Serializable { * */ private String userId; + /** + * 图片附件集合 + */ + private List imageList = new ArrayList<>(); + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicCommentAttachmentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicCommentAttachmentDTO.java new file mode 100644 index 0000000000..acd1c4e381 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicCommentAttachmentDTO.java @@ -0,0 +1,126 @@ +/** + * 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.epmet.resi.group.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class ResiTopicCommentAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id + */ + private String topicId; + + /** + * 评论Id + */ + private String topicCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiPublishCommentFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiPublishCommentFormDTO.java index 894364fe16..179c53c500 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiPublishCommentFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiPublishCommentFormDTO.java @@ -1,9 +1,11 @@ package com.epmet.resi.group.dto.topic.form; +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.List; /** * @Description @@ -19,6 +21,11 @@ public class ResiPublishCommentFormDTO implements Serializable { @NotBlank(message = "话题Id不能为空") private String topicId; - @NotBlank(message = "评论内容不能为空") + //@NotBlank(message = "评论内容不能为空") private String commentContent; + + /** + * 图片附件集合 + */ + private List imageList; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/enums/SearchScopeTypeEnum.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/enums/SearchScopeTypeEnum.java new file mode 100644 index 0000000000..474a2662a1 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/enums/SearchScopeTypeEnum.java @@ -0,0 +1,22 @@ +package com.epmet.resi.group.enums; + +/** + * @Description 搜索范围类型枚举 + * @author wxz + * @date 2021.09.07 20:14:21 + */ +public enum SearchScopeTypeEnum { + + CUSTOMER("customer"), + GRID("grid"); + + private String scopeType; + + SearchScopeTypeEnum(String scopeType) { + this.scopeType = scopeType; + } + + public String getScopeType() { + return scopeType; + } +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java index 16e1d8b0c8..1762b35d97 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -289,4 +289,36 @@ public interface ResiGroupOpenFeignClient { @PostMapping("resi/group/topic/gettopicinfos") Result> getTopicInfos(@RequestBody List issueIds); + /** + * @description 根据组id列表批量查询组信息列表 + * + * @param groupIds + * @return + * @author wxz + * @date 2021.09.07 15:33:58 + */ + @PostMapping("/resi/group/group/list-groupinfos-by-groupids") + Result> listGroupDetailsByGroupIds(@RequestBody List groupIds); + + /** + * @description 排除指定的组id之后,按照指定顺序取指定个数的组信息 + * + * @param form + * @return + * @author wxz + * @date 2021.09.07 17:15:55 + */ + @PostMapping("/resi/group/group/list-groupinfos-exclude-groupids") + Result> listGroupDetailsExcludeGroupIds(@RequestBody GroupFormDTO form); + + /** + * @description 根据组成员查询所在的小组列表。可选条件包括:grid + * + * @param formDTO + * @return + * @author wxz + * @date 2021.09.08 13:51:05 + */ + @PostMapping("/resi/group/group/list-groups-by-member") + Result> listGroupsByMember(@RequestBody GroupsByMemberFormDTO formDTO); } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java index 94f03f3d41..8c2f5303ee 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -220,4 +220,19 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien public Result> getTopicInfos(List issueIds) { return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getTopicInfos", issueIds); } + + @Override + public Result> listGroupDetailsByGroupIds(List groupIds) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "listGroupDetailsByGroupIds", groupIds); + } + + @Override + public Result> listGroupDetailsExcludeGroupIds(GroupFormDTO form) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "listGroupDetailsExcludeGroupIds", form); + } + + @Override + public Result> listGroupsByMember(GroupsByMemberFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "listGroupsByMember", formDTO); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActCommentAttachmentController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActCommentAttachmentController.java new file mode 100644 index 0000000000..e84a321e4b --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActCommentAttachmentController.java @@ -0,0 +1,85 @@ +/** + * 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.epmet.modules.act.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.modules.act.service.ActCommentAttachmentService; +import com.epmet.resi.group.dto.act.ActCommentAttachmentDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 活动评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("actcommentattachment") +public class ActCommentAttachmentController { + + @Autowired + private ActCommentAttachmentService actCommentAttachmentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = actCommentAttachmentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActCommentAttachmentDTO data = actCommentAttachmentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ActCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + actCommentAttachmentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ActCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + actCommentAttachmentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + actCommentAttachmentService.delete(ids); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/GroupActInfoController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/GroupActInfoController.java index 4a1a973022..34fc73ec23 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/GroupActInfoController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/GroupActInfoController.java @@ -27,6 +27,7 @@ import com.epmet.resi.group.dto.act.GroupActIdDTO; import com.epmet.resi.group.dto.act.form.*; import com.epmet.resi.group.dto.act.result.ActDetailByLinkResultDTO; import com.epmet.resi.group.dto.act.result.ActDetailResultDTO; +import com.epmet.resi.group.dto.act.result.OrganizationalLifeResultDTO; import com.epmet.resi.group.dto.notice.result.NoticeReadListResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -153,4 +154,16 @@ public class GroupActInfoController { return new Result(); } + /** + * @Description 组织生活 + * @Param formDTO + * @author zxc + * @date 2021/9/3 2:57 下午 + */ + @PostMapping("organizationallife") + public Result organizationalLife(@LoginUser TokenDto tokenDto, @RequestBody OrganizationalLifeFormDTO formDTO){ + formDTO.setUserId(tokenDto.getUserId()); + return new Result().ok(groupActInfoService.organizationalLife(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActCommentAttachmentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActCommentAttachmentDao.java new file mode 100644 index 0000000000..07f076a6f5 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActCommentAttachmentDao.java @@ -0,0 +1,43 @@ +/** + * 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.epmet.modules.act.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.act.entity.ActCommentAttachmentEntity; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 活动评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface ActCommentAttachmentDao extends BaseDao { + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + List selectActComFile(@Param("groupActId") String groupActId); + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActInfoDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActInfoDao.java index 85f243e608..db9e155e6a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActInfoDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActInfoDao.java @@ -19,7 +19,14 @@ package com.epmet.modules.act.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.act.entity.GroupActInfoEntity; +import com.epmet.resi.group.dto.act.LineChartDTO; +import com.epmet.resi.group.dto.act.OrganizationalLifeLineChartDTO; +import com.epmet.resi.group.dto.act.form.OrganizationalLifeFormDTO; +import com.epmet.resi.group.dto.act.result.OrganizationalLifeResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 组织活动信息 @@ -29,5 +36,63 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface GroupActInfoDao extends BaseDao { - + + /** + * @Description 根据人查询支部小组,小组审核状态为 approved 的,小组类型为 branch 的,GROUP_LEADER_FLAG 为 leader 的,人员状态为 approved 的 + * @Param userId + * @Param leaderFlag 是否是组长标志 + * @author zxc + * @date 2021/9/3 3:48 下午 + */ + List selectBranchGroupByUserId(@Param("userId")String userId,@Param("leaderFlag")Boolean leaderFlag); + + /** + * @Description 按照yearId查询组织生活,组织活动次数、应参加活动次数、活动签到次数 + * @Param formDTO + * @Param groupIds + * @Param leaderFlag 是否是组长标志 + * @author zxc + * @date 2021/9/3 4:12 下午 + */ + OrganizationalLifeResultDTO selectOrgLife(@Param("userId")String userId, @Param("groupIds")List groupIds, + @Param("leaderFlag")Boolean leaderFlag,@Param("yearId")String yearId); + + /** + * @Description 组织生活折线图 + * @Param leaderGroupIds + * @Param memberGroupIds + * @Param yearId + * @author zxc + * @date 2021/9/6 10:24 上午 + */ + List selectLineChart(@Param("groupIds") List groupId,@Param("leaderFlag")Boolean leaderFlag, + @Param("yearId")String yearId); + + /** + * @Description 查询我创建的活动 + * @Param userId + * @Param yearId + * @author zxc + * @date 2021/9/18 9:23 上午 + */ + List selectMyCreateActTypeMonth(@Param("userId")String userId,@Param("yearId")String yearId); + + /** + * @Description 查询应参与的活动 + * @Param userId + * @Param yearId + * @author zxc + * @date 2021/9/18 9:25 上午 + */ + List selectShouldJoinActTypeMonth(@Param("userId")String userId,@Param("yearId")String yearId); + + /** + * @Description 查询活动签到次数 + * @Param userId + * @Param yearId + * @author zxc + * @date 2021/9/18 9:27 上午 + */ + List selectSignInTypeMonth(@Param("userId")String userId,@Param("yearId")String yearId); + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActCommentAttachmentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActCommentAttachmentEntity.java new file mode 100644 index 0000000000..1e290165ee --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActCommentAttachmentEntity.java @@ -0,0 +1,93 @@ +/** + * 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.epmet.modules.act.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 活动评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_comment_attachment") +public class ActCommentAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 活动Id[group_act_info.id] + */ + private String groupActId; + + /** + * 评论Id + */ + private String actCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActCommentAttachmentService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActCommentAttachmentService.java new file mode 100644 index 0000000000..c1faff4a04 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActCommentAttachmentService.java @@ -0,0 +1,103 @@ +/** + * 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.epmet.modules.act.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.act.entity.ActCommentAttachmentEntity; +import com.epmet.resi.group.dto.act.ActCommentAttachmentDTO; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; + +import java.util.List; +import java.util.Map; + +/** + * 活动评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface ActCommentAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActCommentAttachmentDTO + * @author generator + * @date 2021-09-06 + */ + ActCommentAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(ActCommentAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(ActCommentAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 查询活动评论所有人员的附件信息 + **/ + List getActComFile(String groupActId); + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/GroupActInfoService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/GroupActInfoService.java index b815bb7358..9ed4a2b015 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/GroupActInfoService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/GroupActInfoService.java @@ -24,6 +24,7 @@ import com.epmet.resi.group.dto.act.GroupActInfoDTO; import com.epmet.resi.group.dto.act.form.*; import com.epmet.resi.group.dto.act.result.ActDetailByLinkResultDTO; import com.epmet.resi.group.dto.act.result.ActDetailResultDTO; +import com.epmet.resi.group.dto.act.result.OrganizationalLifeResultDTO; import com.epmet.resi.group.dto.notice.result.NoticeReadListResultDTO; /** @@ -89,4 +90,13 @@ public interface GroupActInfoService extends BaseService { * @return */ void closeAct(CloseGroupActFormDTO formDTO); + + /** + * @Description 组织生活 + * @Param formDTO + * @author zxc + * @date 2021/9/3 2:57 下午 + */ + OrganizationalLifeResultDTO organizationalLife(OrganizationalLifeFormDTO formDTO); + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentAttachmentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentAttachmentServiceImpl.java new file mode 100644 index 0000000000..916cf5bdda --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentAttachmentServiceImpl.java @@ -0,0 +1,110 @@ +/** + * 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.epmet.modules.act.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.act.dao.ActCommentAttachmentDao; +import com.epmet.modules.act.entity.ActCommentAttachmentEntity; +import com.epmet.modules.act.service.ActCommentAttachmentService; +import com.epmet.resi.group.dto.act.ActCommentAttachmentDTO; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 活动评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class ActCommentAttachmentServiceImpl extends BaseServiceImpl implements ActCommentAttachmentService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActCommentAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActCommentAttachmentDTO.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 ActCommentAttachmentDTO get(String id) { + ActCommentAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActCommentAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActCommentAttachmentDTO dto) { + ActCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ActCommentAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActCommentAttachmentDTO dto) { + ActCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ActCommentAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + @Override + public List getActComFile(String groupActId) { + return baseDao.selectActComFile(groupActId); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentServiceImpl.java index c249c4ec28..562d1f1cd7 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentServiceImpl.java @@ -18,6 +18,7 @@ package com.epmet.modules.act.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.scan.param.TextScanParamDTO; @@ -28,23 +29,32 @@ import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.act.dao.ActCommentDao; +import com.epmet.modules.act.entity.ActCommentAttachmentEntity; import com.epmet.modules.act.entity.ActCommentEntity; +import com.epmet.modules.act.service.ActCommentAttachmentService; import com.epmet.modules.act.service.ActCommentService; import com.epmet.modules.act.service.GroupActInfoService; import com.epmet.modules.constant.GroupActConstant; +import com.epmet.modules.notice.service.NoticeCommentService; import com.epmet.resi.group.dto.act.GroupActInfoDTO; import com.epmet.resi.group.dto.act.form.CommentFormDTO; import com.epmet.resi.group.dto.act.form.CommentQueryFormDTO; import com.epmet.resi.group.dto.act.result.CommentResultDTO; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; import com.github.pagehelper.PageHelper; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** @@ -65,6 +75,10 @@ public class ActCommentServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); - if (!textSyncScanResult.success()) { - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!textSyncScanResult.getData().isAllPass()) { - throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); + if(StringUtils.isNotBlank(formDTO.getCommentContent())){ + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(formDTO.getCommentContent()); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); + } } } + //图片安全校验 + if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(formDTO.getImageList())){ + List imageList = formDTO.getImageList().stream().map(NoticeFileDTO::getUrl).collect(Collectors.toList()); + noticeCommentService.safetyCheck(new ArrayList<>(), imageList); + } + //3、插入记录 ActCommentEntity actCommentEntity = new ActCommentEntity(); actCommentEntity.setCustomerId(formDTO.getCustomerId()); @@ -103,6 +129,33 @@ public class ActCommentServiceImpl extends BaseServiceImpl AttachmentEntityList = new ArrayList<>(); + //图片 + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(formDTO.getImageList())) { + AtomicInteger sort = new AtomicInteger(); + formDTO.getImageList().forEach(img -> { + ActCommentAttachmentEntity attachment = new ActCommentAttachmentEntity(); + attachment.setCustomerId(formDTO.getCustomerId()); + attachment.setGroupActId(formDTO.getGroupActId()); + attachment.setActCommentId(actCommentEntity.getId()); + attachment.setFileName(img.getName()); + attachment.setAttachmentName(""); + attachment.setAttachmentSize(img.getSize()); + attachment.setAttachmentFormat(img.getFormat()); + attachment.setAttachmentType(img.getType()); + attachment.setAttachmentUrl(img.getUrl()); + attachment.setSort(sort.get()); + attachment.setDuration(img.getDuration()); + sort.getAndIncrement(); + AttachmentEntityList.add(attachment); + }); + } + if (AttachmentEntityList.size() > NumConstant.ZERO) { + actCommentAttachmentService.insertBatch(AttachmentEntityList); + } + } /** @@ -124,8 +177,12 @@ public class ActCommentServiceImpl extends BaseServiceImpl fileList = actCommentAttachmentService.getActComFile(formDTO.getGroupActId()); + if (!CollectionUtils.isEmpty(result.getData())) { - //3.遍历封装数据并返回 + //4.遍历封装数据并返回 list.forEach(l -> { result.getData().forEach(user -> { if (l.getCommentUserId().equals(user.getUserId())) { @@ -133,6 +190,14 @@ public class ActCommentServiceImpl extends BaseServiceImpl imageList = new ArrayList<>(); + for (CommentFileDTO f : fileList) { + if (l.getCommentId().equals(f.getCommentId()) && l.getCommentUserId().equals(f.getUserId())) { + imageList.add(f); + } + } + l.setImageList(imageList); }); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java index 48334bac4e..f44543bac0 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java @@ -35,6 +35,7 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ReadFlagConstant; +import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; @@ -58,9 +59,12 @@ import com.epmet.modules.invitation.service.InvitationRecordService; import com.epmet.modules.member.service.ResiGroupMemberService; import com.epmet.resi.group.dto.act.GroupActIdDTO; import com.epmet.resi.group.dto.act.GroupActInfoDTO; +import com.epmet.resi.group.dto.act.LineChartDTO; +import com.epmet.resi.group.dto.act.OrganizationalLifeLineChartDTO; import com.epmet.resi.group.dto.act.form.*; import com.epmet.resi.group.dto.act.result.ActDetailByLinkResultDTO; import com.epmet.resi.group.dto.act.result.ActDetailResultDTO; +import com.epmet.resi.group.dto.act.result.OrganizationalLifeResultDTO; import com.epmet.resi.group.dto.group.GroupMessageDTO; import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.invitation.InvitationRecordDTO; @@ -75,6 +79,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.time.LocalDate; import java.util.*; import java.util.stream.Collectors; @@ -262,9 +267,17 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl leaderGroupIds = baseDao.selectBranchGroupByUserId(formDTO.getUserId(),true); + List chartResult = new ArrayList<>(); + if (!CollectionUtils.isEmpty(leaderGroupIds)){ + // 按照yearId查询组织生活【我创建的活动】,组织活动次数、应参加活动次数、活动签到次数 + OrganizationalLifeResultDTO dto = baseDao.selectOrgLife(formDTO.getUserId(), leaderGroupIds,true,formDTO.getYearId()); + result.setOrganizationalActCount(dto.getOrganizationalActCount()); + result.setActSignCount(dto.getActSignCount()); + // 当此人是组长,创建了几个活动就应参加几个活动 + result.setShouldJoinActCount(dto.getOrganizationalActCount()); + List chartDTOS = baseDao.selectLineChart(leaderGroupIds, true, formDTO.getYearId()); + if (!CollectionUtils.isEmpty(chartDTOS)){ + chartResult.addAll(chartDTOS); + } + } + // 查询此人不是组长,客户下所有支部小组 + List memberGroupIds = baseDao.selectBranchGroupByUserId(formDTO.getUserId(),false); + if (!CollectionUtils.isEmpty(memberGroupIds)){ + // 按照yearId查询组织生活【我所在支部组的活动】,组织活动次数、应参加活动次数、活动签到次数 + OrganizationalLifeResultDTO dto = baseDao.selectOrgLife(formDTO.getUserId(), memberGroupIds,false, formDTO.getYearId()); + result.setActSignCount(result.getActSignCount() + dto.getActSignCount()); + // 当此人不是组长,支部小组下有几个活动,应参加活动就是几 + result.setShouldJoinActCount(result.getShouldJoinActCount() + dto.getOrganizationalActCount()); + // 此人不是组长,我组织的活动这就不加了 + + List chartDTOS = baseDao.selectLineChart(memberGroupIds, false, formDTO.getYearId()); + if (!CollectionUtils.isEmpty(chartDTOS)){ + chartResult.addAll(chartDTOS); + } + } + // 折线图组装 + List lineChart = lineChart(formDTO.getYearId()); + if (!CollectionUtils.isEmpty(chartResult)){ + Map> groupByMonth = chartResult.stream().collect(Collectors.groupingBy(OrganizationalLifeLineChartDTO::getMonth)); + groupByMonth.forEach((month,list) -> { + lineChart.forEach(l -> { + if (month.equals(l.getMonth())){ + l.setOrganizationalActCount(list.stream().collect(Collectors.summingInt(OrganizationalLifeLineChartDTO::getOrganizationalActCount))); + l.setShouldJoinActCount(list.stream().collect(Collectors.summingInt(OrganizationalLifeLineChartDTO::getShouldJoinActCount))); + l.setActSignCount(list.stream().collect(Collectors.summingInt(OrganizationalLifeLineChartDTO::getActSignCount))); + } + }); + }); + } + result.setLineChart(lineChart); + return result; + }*/ + + @Override + public OrganizationalLifeResultDTO organizationalLife(OrganizationalLifeFormDTO formDTO) { + OrganizationalLifeResultDTO result = new OrganizationalLifeResultDTO(); + if (StringUtils.isBlank(formDTO.getYearId())) { + formDTO.setYearId(String.valueOf(LocalDate.now().getYear())); + } + List myActs = baseDao.selectMyCreateActTypeMonth(formDTO.getUserId(), formDTO.getYearId()); + List joinActs = baseDao.selectShouldJoinActTypeMonth(formDTO.getUserId(), formDTO.getYearId()); + List signInActs = baseDao.selectSignInTypeMonth(formDTO.getUserId(), formDTO.getYearId()); + // 折线图组装 + List lineChart = lineChart(formDTO.getYearId()); + lineChart.forEach(l ->{ + if (!CollectionUtils.isEmpty(myActs)){ + myActs.forEach(m -> { + if (l.getMonth().equals(m.getMonth())){ + l.setOrganizationalActCount(m.getValue()); + } + }); + } + if (!CollectionUtils.isEmpty(joinActs)){ + joinActs.forEach(j -> { + if (l.getMonth().equals(j.getMonth())){ + l.setShouldJoinActCount(j.getValue()); + } + }); + } + if (!CollectionUtils.isEmpty(signInActs)){ + signInActs.forEach(s -> { + if (l.getMonth().equals(s.getMonth())){ + l.setActSignCount(s.getValue()); + } + }); + } + }); + result.setOrganizationalActCount(CollectionUtils.isEmpty(myActs) ? NumConstant.ZERO : myActs.stream().collect(Collectors.summingInt(LineChartDTO::getValue))); + result.setShouldJoinActCount(CollectionUtils.isEmpty(joinActs) ? NumConstant.ZERO : joinActs.stream().collect(Collectors.summingInt(LineChartDTO::getValue))); + result.setActSignCount(CollectionUtils.isEmpty(signInActs) ? NumConstant.ZERO : signInActs.stream().collect(Collectors.summingInt(LineChartDTO::getValue))); + result.setLineChart(lineChart); + return result; + } + + /** + * @Description 折线图构造 + * 应前端要求,日期格式由 01月,02月 改为 2021-01,2021-02 + * @author zxc + * @date 2021/9/6 10:55 上午 + */ + public List lineChart(String yearId){ + String year = yearId.substring(NumConstant.ZERO,NumConstant.FOUR); + List lineChart = new ArrayList<>(); + for (int i = NumConstant.ONE; i <= NumConstant.TWELVE; i++) { + OrganizationalLifeLineChartDTO dto = new OrganizationalLifeLineChartDTO(); + if (i < NumConstant.TEN){ + dto.setMonth(year +"-"+NumConstant.ZERO + String.valueOf(i)); + }else { + dto.setMonth(year +"-"+ String.valueOf(i)); + } + lineChart.add(dto); + } + return lineChart; + } + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java index 86cb1a6ff2..831109fc67 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java @@ -29,6 +29,7 @@ public interface UserMessageConstant { */ String INVITED_JOIN_GROUP = "您的好友-【%s】通过邀请连接,加入了【%s】"; String SCANCODE_JOIN_GROUP = "您的好友-【%s】通过扫描二维码,加入了【%s】"; + String SHARABLELINK_JOIN_GROUP = "您的好友-【%s】通过分享链接,加入了【%s】"; /** * 组成员被禁言时会收到消息:您已被禁言,禁言时间2020.03.20 12:20-2020.03.27 12:20 diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java index 5fa0d56be9..e90adf8c14 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java @@ -33,6 +33,7 @@ import com.epmet.resi.group.dto.group.result.*; import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO; import com.epmet.resi.group.dto.member.form.ResiIdentityFormDTO; import com.epmet.resi.group.dto.member.result.AchievementResultDTO; +import com.epmet.resi.group.enums.SearchScopeTypeEnum; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.PostMapping; @@ -599,4 +600,58 @@ public class ResiGroupController { public Result initAchievement(@RequestParam String customerId) { return new Result().ok(statsAchievementService.initAllGroupAchievement(customerId)); } + + /** + * @description 根据组id列表批量查询组信息列表 + * + * @param groupIds + * @return + * @author wxz + * @date 2021.09.07 15:33:58 + */ + @PostMapping("list-groupinfos-by-groupids") + public Result> listGroupDetailsByGroupIds(@RequestBody List groupIds) { + List groupDetails = resiGroupService.listGroupsByGroupIds(groupIds); + return new Result>().ok(groupDetails); + } + + /** + * @description 排除指定的组id之后,按照指定顺序取指定个数的组信息 + * + * @param form + * @return + * @author wxz + * @date 2021.09.07 17:15:55 + */ + @PostMapping("list-groupinfos-exclude-groupids") + public Result> listGroupDetailsExcludeGroupIds(@RequestBody GroupFormDTO form) { + ValidatorUtils.validateEntity(form, GroupFormDTO.GroupDetailsExcludeGroupIds.class); + Integer startRow = form.getStartRow(); + Integer rowCount = form.getRowCount(); + List excludeGroupIds = form.getExcludeGroupIds(); + GroupFormDTO.SortTypeEnum sort = form.getSort(); + GroupFormDTO.OrderTypeEnum order = form.getOrder(); + SearchScopeTypeEnum searchScopeType = form.getSearchScopeType(); + String searchScopeObjectId = form.getSearchScopeObjectId(); + + List groups = resiGroupService.listGroupDetailsExcludeGroupIds(excludeGroupIds, startRow, rowCount, searchScopeType.getScopeType(), searchScopeObjectId, sort.getSortField(), order.getOrderType()); + return new Result>().ok(groups); + } + + /** + * @description 根据组成员查询所在的小组列表。可选条件包括:grid + * + * @param formDTO + * @return + * @author wxz + * @date 2021.09.08 13:51:05 + */ + @PostMapping("list-groups-by-member") + public Result> listGroupsByMember(@RequestBody GroupsByMemberFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + String gridId = formDTO.getGridId(); + String userId = formDTO.getUserId(); + List groups = resiGroupService.listGroupsByMember(userId, gridId); + return new Result>().ok(groups); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java index 44f8312d9c..3a0b47c336 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java @@ -335,4 +335,15 @@ public interface ResiGroupDao extends BaseDao { * @return java.util.List */ List selectRecentGroupAchievements(@Param("userId") String userId, @Param("gridId") String gridId); + + /** + * @description 根据组成员查询所在组列表。如有需要,可以增加其他if条件,或者增加排序参数 + * + * @param memberUserId + * @param gridId + * @return + * @author wxz + * @date 2021.09.08 14:00:52 + */ + List listGroupsByMember(@Param("memberUserId") String memberUserId, @Param("gridId") String gridId); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java index d7761738d8..122083cceb 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java @@ -435,4 +435,41 @@ public interface ResiGroupService extends BaseService { * @return com.epmet.resi.group.dto.group.ResiGroupDTO */ ResiGroupDTO getGroupInfoAndGroupMember(String groupId); + + /** + * @description 根据id列表查询组信息 + * + * @param groupIds + * @return + * @author wxz + * @date 2021.09.07 15:27:35 + */ + List listGroupsByGroupIds(List groupIds); + + /** + * @description 排除指定的组id之后,按照指定顺序取指定个数的组信息 + * + * @param excludeGroupIds 排序的组id列表 + * @param startRow + * @param rowCount + * @param searchScopeObjectId 小组所属的范围对象id,如果是网格,那就是网格id,如果是客户那就是客户id + * @param searchScopeType 小组所属的范围,grid网格,customer客户 + * @param sortType 排序字段 + * @param orderType 排序类型 + * @return + * @author wxz + * @date 2021.09.07 17:17:09 + */ + List listGroupDetailsExcludeGroupIds(List excludeGroupIds, Integer startRow, Integer rowCount, String searchScopeType,String searchScopeObjectId, String sortType, String orderType); + + /** + * @description 根据成员查询组列表 + * + * @param memberUserId + * @param gridId + * @return + * @author wxz + * @date 2021.09.08 13:59:31 + */ + List listGroupsByMember(String memberUserId, String gridId); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 122fafce0d..ee2f844d04 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -18,11 +18,14 @@ package com.epmet.modules.group.service.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.rocketmq.messages.GroupAchievementMQMsg; import com.epmet.commons.tools.constant.*; +import com.epmet.commons.tools.enums.AchievementTypeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; @@ -38,6 +41,7 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ReadFlagConstant; +import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dto.form.*; import com.epmet.dto.result.UserInfoResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; @@ -45,7 +49,6 @@ import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.constant.UserMessageConstant; -import com.epmet.commons.tools.enums.AchievementTypeEnum; import com.epmet.modules.feign.EpmetMessageFeignClient; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.feign.GovOrgFeignClient; @@ -79,6 +82,7 @@ import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO; import com.epmet.resi.group.dto.member.result.AchievementResultDTO; import com.epmet.resi.group.dto.member.result.GroupAchievementDTO; +import com.epmet.resi.group.enums.SearchScopeTypeEnum; import com.epmet.send.SendMqMsgUtil; import com.github.pagehelper.PageHelper; import org.apache.commons.collections4.CollectionUtils; @@ -521,7 +525,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl listGroupsByGroupIds(List groupIds) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.in(ResiGroupEntity::getId, groupIds); + query.orderByDesc(ResiGroupEntity::getCreatedTime); + query.eq(ResiGroupEntity::getDelFlag, 0); + List groupEntities = baseDao.selectList(query); + List groupDtos = groupEntities.stream().map(ge -> { + ResiGroupMemberDTO leader = resiGroupMemberDao.selectLeaderMember(ge.getId()); + + GroupDetailResultDTO dto = new GroupDetailResultDTO(); + dto.setGroupId(ge.getId()); + dto.setGroupName(ge.getGroupName()); + dto.setGroupHeadPhoto(ge.getGroupHeadPhoto()); + dto.setGroupIntroduction(ge.getGroupIntroduction()); + dto.setGroupType(ge.getGroupType()); + dto.setLeaderId(leader.getCustomerUserId()); + return dto; + }).collect(Collectors.toList()); + return groupDtos; + } + + @Override + public List listGroupDetailsExcludeGroupIds(List excludeGroupIds, Integer startRow, Integer rowCount, String searchScopeType, String searchScopeObjectId, String sortType, String orderType) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + if (CollectionUtils.isNotEmpty(excludeGroupIds)) { + query.notIn(ResiGroupEntity::getId, excludeGroupIds); + } + query.last(String.format("limit %s, %s", startRow, rowCount)); + + // 只显示审核通过且可用的小组 + query.eq(ResiGroupEntity::getState, "approved"); + + SFunction sortFieldFun = null; + if (GroupFormDTO.SortTypeEnum.CREATE_TIME.getSortField().equals(sortType)) { + sortFieldFun = ResiGroupEntity::getCreatedTime; + } + + if (SearchScopeTypeEnum.GRID.getScopeType().equals(searchScopeType)) { + query.eq(ResiGroupEntity::getGridId, searchScopeObjectId); + } else if (SearchScopeTypeEnum.CUSTOMER.getScopeType().equals(searchScopeType)) { + query.eq(ResiGroupEntity::getCustomerId, searchScopeObjectId); + } + + if (GroupFormDTO.OrderTypeEnum.ASC.getOrderType().equals(orderType)) { + query.orderByAsc(sortFieldFun); + } else { + query.orderByDesc(sortFieldFun); + } + List groupList = baseDao.selectList(query); + return groupList.stream().map(ge -> { + // 查询组长id + ResiGroupMemberDTO leader = resiGroupMemberDao.selectLeaderMember(ge.getId()); + + GroupDetailResultDTO dto = new GroupDetailResultDTO(); + dto.setGroupId(ge.getId()); + dto.setGroupName(ge.getGroupName()); + dto.setGroupHeadPhoto(ge.getGroupHeadPhoto()); + dto.setGroupIntroduction(ge.getGroupIntroduction()); + dto.setGroupType(ge.getGroupType()); + dto.setGridId(ge.getGridId()); + dto.setLeaderId(leader.getCustomerUserId()); + return dto; + }).collect(Collectors.toList()); + } + + @Override + public List listGroupsByMember(String memberUserId, String gridId) { + return baseDao.listGroupsByMember(memberUserId, gridId); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/GroupInvitationService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/GroupInvitationService.java index 4c8897c5f1..8577aa2bd9 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/GroupInvitationService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/GroupInvitationService.java @@ -21,7 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.modules.invitation.entity.GroupInvitationEntity; -import com.epmet.resi.group.dto.UserRoleDTO; +import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.invitation.GroupInvitationDTO; import com.epmet.resi.group.dto.invitation.form.AccetInvitationFormDTO; import com.epmet.resi.group.dto.invitation.form.CreateGroupInvitationFormDTO; @@ -143,4 +143,11 @@ public interface GroupInvitationService extends BaseService page(Map params) { @@ -434,7 +434,11 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl + * 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.epmet.modules.notice.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.modules.notice.service.NoticeCommentAttachmentService; +import com.epmet.resi.group.dto.notice.NoticeCommentAttachmentDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 通知评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("noticecommentattachment") +public class NoticeCommentAttachmentController { + + @Autowired + private NoticeCommentAttachmentService noticeCommentAttachmentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = noticeCommentAttachmentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + NoticeCommentAttachmentDTO data = noticeCommentAttachmentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody NoticeCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + noticeCommentAttachmentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody NoticeCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + noticeCommentAttachmentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + noticeCommentAttachmentService.delete(ids); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeCommentAttachmentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeCommentAttachmentDao.java new file mode 100644 index 0000000000..2ad57a60cd --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeCommentAttachmentDao.java @@ -0,0 +1,43 @@ +/** + * 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.epmet.modules.notice.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.notice.entity.NoticeCommentAttachmentEntity; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 通知评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface NoticeCommentAttachmentDao extends BaseDao { + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + List selectNoticeComFile(@Param("noticeId") String noticeId); + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/entity/NoticeCommentAttachmentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/entity/NoticeCommentAttachmentEntity.java new file mode 100644 index 0000000000..7ab97e6634 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/entity/NoticeCommentAttachmentEntity.java @@ -0,0 +1,93 @@ +/** + * 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.epmet.modules.notice.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 通知评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("notice_comment_attachment") +public class NoticeCommentAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 通知Id + */ + private String noticeId; + + /** + * 评论Id + */ + private String noticeCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentAttachmentService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentAttachmentService.java new file mode 100644 index 0000000000..5baa7d553d --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentAttachmentService.java @@ -0,0 +1,103 @@ +/** + * 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.epmet.modules.notice.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.notice.entity.NoticeCommentAttachmentEntity; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import com.epmet.resi.group.dto.notice.NoticeCommentAttachmentDTO; + +import java.util.List; +import java.util.Map; + +/** + * 通知评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface NoticeCommentAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return NoticeCommentAttachmentDTO + * @author generator + * @date 2021-09-06 + */ + NoticeCommentAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(NoticeCommentAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(NoticeCommentAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + List getNoticeComFile(String noticeId); + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java index 0ac50c21e7..6684e61d80 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java @@ -48,4 +48,11 @@ public interface NoticeCommentService extends BaseService { * @Description 通知评论列表查询 **/ List noticeCommentList(NoticeCommentListFormDTO formDTO); + + /** + * @Author sun + * @Description 文字、图片安全校验 + **/ + void safetyCheck(List wordList, List imageList); + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentAttachmentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentAttachmentServiceImpl.java new file mode 100644 index 0000000000..10c3710894 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentAttachmentServiceImpl.java @@ -0,0 +1,110 @@ +/** + * 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.epmet.modules.notice.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.notice.dao.NoticeCommentAttachmentDao; +import com.epmet.modules.notice.entity.NoticeCommentAttachmentEntity; +import com.epmet.modules.notice.service.NoticeCommentAttachmentService; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import com.epmet.resi.group.dto.notice.NoticeCommentAttachmentDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 通知评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class NoticeCommentAttachmentServiceImpl extends BaseServiceImpl implements NoticeCommentAttachmentService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, NoticeCommentAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, NoticeCommentAttachmentDTO.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 NoticeCommentAttachmentDTO get(String id) { + NoticeCommentAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, NoticeCommentAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(NoticeCommentAttachmentDTO dto) { + NoticeCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, NoticeCommentAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(NoticeCommentAttachmentDTO dto) { + NoticeCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, NoticeCommentAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + @Override + public List getNoticeComFile(String noticeId) { + return baseDao.selectNoticeComFile(noticeId); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java index 2ab3994891..cc56eb670d 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java @@ -17,10 +17,13 @@ package com.epmet.modules.notice.service.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.scan.param.ImgScanParamDTO; +import com.epmet.commons.tools.scan.param.ImgTaskDTO; import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; @@ -30,18 +33,23 @@ import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.member.service.ResiGroupMemberService; import com.epmet.modules.notice.dao.NoticeCommentDao; +import com.epmet.modules.notice.entity.NoticeCommentAttachmentEntity; import com.epmet.modules.notice.entity.NoticeCommentEntity; import com.epmet.modules.notice.redis.NoticeCommentRedis; +import com.epmet.modules.notice.service.NoticeCommentAttachmentService; import com.epmet.modules.notice.service.NoticeCommentService; import com.epmet.modules.notice.service.NoticeService; import com.epmet.modules.utils.ModuleConstant; import com.epmet.resi.group.constant.MemberStateConstant; import com.epmet.resi.group.constant.TopicConstant; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; import com.epmet.resi.group.dto.notice.NoticeDTO; import com.epmet.resi.group.dto.notice.form.NoticeCommentFormDTO; import com.epmet.resi.group.dto.notice.form.NoticeCommentListFormDTO; +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; import com.epmet.resi.group.dto.notice.result.NoticeCommentListResultDTO; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -53,6 +61,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** @@ -70,12 +79,16 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl imageList = formDTO.getImageList().stream().map(NoticeFileDTO::getUrl).collect(Collectors.toList()); + safetyCheck(new ArrayList<>(), imageList); + } //2.判断当前用户是否被禁言、移除、非本组成员 NoticeDTO notice = noticeService.get(formDTO.getNoticeId()); @@ -139,6 +160,33 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl AttachmentEntityList = new ArrayList<>(); + //图片 + if (CollectionUtils.isNotEmpty(formDTO.getImageList())) { + AtomicInteger sort = new AtomicInteger(); + formDTO.getImageList().forEach(img -> { + NoticeCommentAttachmentEntity attachment = new NoticeCommentAttachmentEntity(); + attachment.setCustomerId(notice.getCustomerId()); + attachment.setNoticeId(formDTO.getNoticeId()); + attachment.setNoticeCommentId(entity.getId()); + attachment.setFileName(img.getName()); + attachment.setAttachmentName(""); + attachment.setAttachmentSize(img.getSize()); + attachment.setAttachmentFormat(img.getFormat()); + attachment.setAttachmentType(img.getType()); + attachment.setAttachmentUrl(img.getUrl()); + attachment.setSort(sort.get()); + attachment.setDuration(img.getDuration()); + sort.getAndIncrement(); + AttachmentEntityList.add(attachment); + }); + } + if (AttachmentEntityList.size() > NumConstant.ZERO) { + noticeCommentAttachmentService.insertBatch(AttachmentEntityList); + } + } /** @@ -165,7 +213,10 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl resultDTOList = result.getData(); - //3.封装数据并返回 + //3.查询通知评论所有人员的附件信息 + List fileList = noticeCommentAttachmentService.getNoticeComFile(formDTO.getNoticeId()); + + //4.封装数据并返回 resultList.forEach(l -> { StringBuffer name = new StringBuffer(); resultDTOList.forEach(user -> { @@ -175,9 +226,64 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl imageList = new ArrayList<>(); + for (CommentFileDTO f : fileList) { + if (l.getNoticeCommentId().equals(f.getCommentId()) && l.getUserId().equals(f.getUserId())) { + imageList.add(f); + } + } + l.setImageList(imageList); }); return resultList; } + /** + * @Author sun + * @Description 文字、图片安全校验 + **/ + public void safetyCheck(List wordList, List imageList) { + if (imageList.size() != NumConstant.ZERO) { + wordList.forEach(word -> { + //创建话题内容审核 + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(word); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + logger.error("safetyCheck textScan return failed,result:"+ JSON.toJSONString(textSyncScanResult)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + logger.warn(EpmetErrorCode.TEXT_SCAN_FAILED.getMsg().concat(String.format(TopicConstant.CREATE_TOPIC, word))); + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + }); + } + //创建话题图片审核 + if (imageList.size() != NumConstant.ZERO) { + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + imageList.forEach(url -> { + ImgTaskDTO task = new ImgTaskDTO(); + task.setDataId(UUID.randomUUID().toString().replace("-", "")); + task.setUrl(url); + imgScanParamDTO.getTasks().add(task); + }); + Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()) { + logger.error("safetyCheck imgScan return failed,result:"+ JSON.toJSONString(imgScanResult)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + if (!imgScanResult.getData().isAllPass()) { + logger.warn(EpmetErrorCode.IMG_SCAN_FAILED.getMsg()); + throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode()); + } + + } + } + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java index b21c69a4ae..afe0ce523d 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java @@ -33,6 +33,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ReadFlagConstant; +import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; @@ -58,7 +59,10 @@ import com.epmet.modules.notice.service.NoticeService; import com.epmet.resi.group.constant.TopicConstant; import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; import com.epmet.resi.group.dto.notice.NoticeDTO; -import com.epmet.resi.group.dto.notice.form.*; +import com.epmet.resi.group.dto.notice.form.AddNoticeFormDTO; +import com.epmet.resi.group.dto.notice.form.EditNoticeFormDTO; +import com.epmet.resi.group.dto.notice.form.NoticeDetailFormDTO; +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; import com.epmet.resi.group.dto.notice.result.NoticeDetailResultDTO; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.logging.Log; @@ -272,6 +276,10 @@ public class NoticeServiceImpl extends BaseServiceImpl userMessageFormDTO.setTitle(UserMessageConstant.GROUP_TITLE); userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ); userMessageFormDTO.setMessageContent(String.format(UserMessageConstant.GROUP_NOTICE_ADD, groupEntity.getGroupName(), formDTO.getTitle())); + + //21.09.10:记录消息类型和对应的业务id + userMessageFormDTO.setMessageType(UserMessageTypeConstant.GROUP_MESSAGE_PUBLISH); + userMessageFormDTO.setTargetId(messageEntity.getMessageId()); userMessageFormDTOS.add(userMessageFormDTO); } }); @@ -430,6 +438,11 @@ public class NoticeServiceImpl extends BaseServiceImpl userMessageFormDTO.setTitle(UserMessageConstant.GROUP_TITLE); userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ); userMessageFormDTO.setMessageContent(String.format(UserMessageConstant.GROUP_NOTICE_EDIT, groupEntity.getGroupName(), formDTO.getTitle())); + + //21.09.10:记录消息类型和对应的业务id + userMessageFormDTO.setTargetId(entity.getId()); + userMessageFormDTO.setMessageType(UserMessageTypeConstant.GROUP_MESSAGE_EDIT); + userMessageFormDTOS.add(userMessageFormDTO); } }); @@ -503,7 +516,7 @@ public class NoticeServiceImpl extends BaseServiceImpl * @Description 文字、图片安全校验 **/ private void safetyCheck(List wordList, List imageList) { - if (imageList.size() != NumConstant.ZERO) { + if (wordList.size() != NumConstant.ZERO) { wordList.forEach(word -> { //创建话题内容审核 TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicCommentAttachmentController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicCommentAttachmentController.java new file mode 100644 index 0000000000..9c5dd8f841 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicCommentAttachmentController.java @@ -0,0 +1,85 @@ +/** + * 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.epmet.modules.topic.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.modules.topic.service.ResiTopicCommentAttachmentService; +import com.epmet.resi.group.dto.topic.ResiTopicCommentAttachmentDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("resitopiccommentattachment") +public class ResiTopicCommentAttachmentController { + + @Autowired + private ResiTopicCommentAttachmentService resiTopicCommentAttachmentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = resiTopicCommentAttachmentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ResiTopicCommentAttachmentDTO data = resiTopicCommentAttachmentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ResiTopicCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + resiTopicCommentAttachmentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ResiTopicCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + resiTopicCommentAttachmentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + resiTopicCommentAttachmentService.delete(ids); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentAttachmentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentAttachmentDao.java new file mode 100644 index 0000000000..ab917a7ba5 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentAttachmentDao.java @@ -0,0 +1,43 @@ +/** + * 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.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.ResiTopicCommentAttachmentEntity; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface ResiTopicCommentAttachmentDao extends BaseDao { + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + List selectTopicComFile(@Param("topicId") String topicId); + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicCommentAttachmentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicCommentAttachmentEntity.java new file mode 100644 index 0000000000..d4400a14df --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicCommentAttachmentEntity.java @@ -0,0 +1,93 @@ +/** + * 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.epmet.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_topic_comment_attachment") +public class ResiTopicCommentAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id + */ + private String topicId; + + /** + * 评论Id + */ + private String topicCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicCommentAttachmentService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicCommentAttachmentService.java new file mode 100644 index 0000000000..d29f410d33 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicCommentAttachmentService.java @@ -0,0 +1,102 @@ +/** + * 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.epmet.modules.topic.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.topic.entity.ResiTopicCommentAttachmentEntity; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import com.epmet.resi.group.dto.topic.ResiTopicCommentAttachmentDTO; + +import java.util.List; +import java.util.Map; + +/** + * 话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface ResiTopicCommentAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ResiTopicCommentAttachmentDTO + * @author generator + * @date 2021-09-06 + */ + ResiTopicCommentAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(ResiTopicCommentAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(ResiTopicCommentAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 查询话题评论所有人员的附件信息 + **/ + List getTopicComFile(String topicId); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentAttachmentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentAttachmentServiceImpl.java new file mode 100644 index 0000000000..e44dd792da --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentAttachmentServiceImpl.java @@ -0,0 +1,110 @@ +/** + * 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.epmet.modules.topic.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.topic.dao.ResiTopicCommentAttachmentDao; +import com.epmet.modules.topic.entity.ResiTopicCommentAttachmentEntity; +import com.epmet.modules.topic.service.ResiTopicCommentAttachmentService; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import com.epmet.resi.group.dto.topic.ResiTopicCommentAttachmentDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class ResiTopicCommentAttachmentServiceImpl extends BaseServiceImpl implements ResiTopicCommentAttachmentService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ResiTopicCommentAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ResiTopicCommentAttachmentDTO.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 ResiTopicCommentAttachmentDTO get(String id) { + ResiTopicCommentAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ResiTopicCommentAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ResiTopicCommentAttachmentDTO dto) { + ResiTopicCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ResiTopicCommentAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ResiTopicCommentAttachmentDTO dto) { + ResiTopicCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ResiTopicCommentAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + @Override + public List getTopicComFile(String topicId) { + return baseDao.selectTopicComFile(topicId); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java index dd02ae9142..523f81dc49 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java @@ -41,22 +41,25 @@ import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.commons.tools.utils.SendMqMsgUtils; import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.UserResiInfoListFormDTO; -import com.epmet.dto.result.UserInfoResultDTO; import com.epmet.dto.result.CommonDataFilterResultDTO; +import com.epmet.dto.result.UserInfoResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.modules.comment.entity.ResiTopicCommentEntity; import com.epmet.modules.constant.ResiGroupRedisKeys; import com.epmet.modules.constant.WxmpSubscribeConstant; import com.epmet.modules.feign.EpmetUserFeignClient; +import com.epmet.modules.feign.GovOrgFeignClient; import com.epmet.modules.group.dao.ResiGroupDao; import com.epmet.modules.group.entity.ResiGroupEntity; -import com.epmet.modules.feign.GovOrgFeignClient; import com.epmet.modules.group.redis.ResiGroupRedis; import com.epmet.modules.member.dao.ResiGroupMemberDao; import com.epmet.modules.member.redis.ResiGroupMemberRedis; import com.epmet.modules.member.service.ResiGroupMemberService; +import com.epmet.modules.notice.service.NoticeCommentService; import com.epmet.modules.topic.dao.ResiTopicCommentDao; import com.epmet.modules.topic.dao.ResiTopicDao; +import com.epmet.modules.topic.entity.ResiTopicCommentAttachmentEntity; +import com.epmet.modules.topic.service.ResiTopicCommentAttachmentService; import com.epmet.modules.topic.service.ResiTopicCommentService; import com.epmet.modules.topic.service.ResiTopicService; import com.epmet.modules.utils.ModuleConstant; @@ -64,11 +67,12 @@ import com.epmet.resi.group.constant.MemberStateConstant; import com.epmet.resi.group.constant.TopicConstant; import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO; import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; -import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.group.ResiGroupInfoRedisDTO; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; import com.epmet.resi.group.dto.member.result.ResiGroupMemberInfoRedisResultDTO; +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; import com.epmet.resi.group.dto.topic.ResiTopicCommentDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.form.ResiPublishCommentFormDTO; @@ -76,6 +80,7 @@ import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import com.google.common.base.CharMatcher; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -85,6 +90,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** @@ -99,32 +105,28 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl imageList = resiCommentFormDTO.getImageList().stream().map(NoticeFileDTO::getUrl).collect(Collectors.toList()); + noticeCommentService.safetyCheck(new ArrayList<>(), imageList); + } + //1.判断当前用户是否被禁言 ResiTopicDTO topic = resiTopicService.get(resiCommentFormDTO.getTopicId()); if(null == topic){ @@ -314,6 +325,32 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl AttachmentEntityList = new ArrayList<>(); + //图片 + if (CollectionUtils.isNotEmpty(resiCommentFormDTO.getImageList())) { + AtomicInteger sort = new AtomicInteger(); + resiCommentFormDTO.getImageList().forEach(img -> { + ResiTopicCommentAttachmentEntity attachment = new ResiTopicCommentAttachmentEntity(); + attachment.setCustomerId(comment.getCustomerId()); + attachment.setTopicId(resiCommentFormDTO.getTopicId()); + attachment.setTopicCommentId(comment.getId()); + attachment.setFileName(img.getName()); + attachment.setAttachmentName(""); + attachment.setAttachmentSize(img.getSize()); + attachment.setAttachmentFormat(img.getFormat()); + attachment.setAttachmentType(img.getType()); + attachment.setAttachmentUrl(img.getUrl()); + attachment.setSort(sort.get()); + attachment.setDuration(img.getDuration()); + sort.getAndIncrement(); + AttachmentEntityList.add(attachment); + }); + } + if (AttachmentEntityList.size() > NumConstant.ZERO) { + resiTopicCommentAttachmentService.insertBatch(AttachmentEntityList); + } + //对所有关注这个话题的人发送微信订阅 resiTopicService.sendWxmpUpdateSubscribe(tokenDto,topic.getId(), WxmpSubscribeConstant.TYPE_COMMENT); return new Result(); @@ -372,6 +409,20 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl fileList = resiTopicCommentAttachmentService.getTopicComFile(commentFormDTO.getTopicId()); + //封装数据并返回 + comments.forEach(l -> { + //每一条评论的附件信息 + List imageList = new ArrayList<>(); + for (CommentFileDTO f : fileList) { + if (l.getCommentId().equals(f.getCommentId()) && l.getUserId().equals(f.getUserId())) { + imageList.add(f); + } + } + l.setImageList(imageList); + }); + } return new Result>().ok(comments); diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.25__comment_attachment_.sql b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.25__comment_attachment_.sql new file mode 100644 index 0000000000..9c60580ac9 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.25__comment_attachment_.sql @@ -0,0 +1,65 @@ +CREATE TABLE `resi_topic_comment_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `TOPIC_ID` varchar(64) NOT NULL COMMENT '话题Id', + `TOPIC_COMMENT_ID` varchar(64) NOT NULL COMMENT '评论Id', + `FILE_NAME` varchar(255) DEFAULT NULL COMMENT '文件名', + `ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名(uuid随机生成)', + `ATTACHMENT_SIZE` int(11) DEFAULT NULL COMMENT '文件大小,单位b', + `ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) DEFAULT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `DURATION` int(11) unsigned zerofill DEFAULT '00000000000' COMMENT '语音或视频时长,秒', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='话题评论附件表'; + +CREATE TABLE `act_comment_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `GROUP_ACT_ID` varchar(64) NOT NULL COMMENT '活动Id[group_act_info.id]', + `ACT_COMMENT_ID` varchar(64) NOT NULL COMMENT '评论Id', + `FILE_NAME` varchar(255) DEFAULT NULL COMMENT '文件名', + `ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名(uuid随机生成)', + `ATTACHMENT_SIZE` int(11) DEFAULT NULL COMMENT '文件大小,单位b', + `ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) DEFAULT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `DURATION` int(11) unsigned zerofill DEFAULT '00000000000' COMMENT '语音或视频时长,秒', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='活动评论附件表'; + +CREATE TABLE `notice_comment_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `NOTICE_ID` varchar(64) NOT NULL COMMENT '通知Id', + `NOTICE_COMMENT_ID` varchar(64) NOT NULL COMMENT '评论Id', + `FILE_NAME` varchar(255) DEFAULT NULL COMMENT '文件名', + `ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名(uuid随机生成)', + `ATTACHMENT_SIZE` int(11) DEFAULT NULL COMMENT '文件大小,单位b', + `ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) DEFAULT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `DURATION` int(11) unsigned zerofill DEFAULT '00000000000' COMMENT '语音或视频时长,秒', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='通知评论附件表'; \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActCommentAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActCommentAttachmentDao.xml new file mode 100644 index 0000000000..b74e6adc02 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActCommentAttachmentDao.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActInfoDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActInfoDao.xml index 70b86b20e5..dd6534f874 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActInfoDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActInfoDao.xml @@ -3,6 +3,108 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml index fd7e813840..97f45b4369 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml @@ -77,12 +77,12 @@ AND rg.CUSTOMER_ID = #{customerId} AND rg.GRID_ID =#{gridId} AND rgm.CUSTOMER_USER_ID = #{userId} - AND rgm.STATUS IN ( 'approved', 'silent' ) - AND rg.STATE in('approved','hidden','closed') + AND rgm.STATUS IN ( 'approved', 'silent' ,'under_auditting') + AND rg.STATE in('approved','hidden','closed','under_auditting') AND rg.GROUP_TYPE = #{groupType} - order by rg.LATEST_TOPIC_PUBLISH_DATE desc + order by rg.CREATED_TIME desc LIMIT #{pageNo}, #{pageSize} @@ -140,7 +140,8 @@ rg.GROUP_NAME AS groupName, rg.GROUP_TYPE AS groupType, rgs.TOTAL_MEMBERS AS totalMember, - rgs.TOTAL_PARTY_MEMBERS AS totalPartyMember + rgs.TOTAL_PARTY_MEMBERS AS totalPartyMember, + rg.GROUP_INTRODUCTION FROM resi_group rg LEFT JOIN resi_group_statistical rgs ON ( rg.id = rgs.RESI_GROUP_ID ) @@ -229,14 +230,17 @@ AND gmo.OPERATE_STATUS = 'under_auditting' ) AS totalApplyingMember, rgs.TOTAL_TOPICS, - rg.AUDIT_SWITCH + rg.AUDIT_SWITCH, + rg.group_type groupType, + gs.`name` groupTypeName FROM resi_group rg LEFT JOIN resi_group_statistical rgs ON ( rg.id = rgs.RESI_GROUP_ID ) LEFT JOIN resi_group_member rgm - ON ( rg.id = rgm.RESI_GROUP_ID - AND rgm.DEL_FLAG='0' - AND rgm.CUSTOMER_USER_ID =#{userId}) + ON ( rg.id = rgm.RESI_GROUP_ID + AND rgm.DEL_FLAG='0' + AND rgm.CUSTOMER_USER_ID =#{userId}) + LEFT JOIN resi_group_setup gs ON rg.GROUP_TYPE = gs.GROUP_TYPE AND gs.CUSTOMER_ID = 'default' WHERE rg.DEL_FLAG = '0' AND rgs.DEL_FLAG = '0' @@ -435,7 +439,8 @@ rg.GROUP_HEAD_PHOTO AS groupHeadPhoto, rg.GROUP_NAME AS groupName, rgs.TOTAL_MEMBERS AS totalMember, - rgs.TOTAL_PARTY_MEMBERS AS totalPartyMember + rgs.TOTAL_PARTY_MEMBERS AS totalPartyMember, + rg.GROUP_INTRODUCTION FROM resi_group rg LEFT JOIN resi_group_statistical rgs ON ( rg.id = rgs.RESI_GROUP_ID ) @@ -630,7 +635,8 @@ rg.group_name AS groupName, rg.group_type AS groupType, rgs.total_members AS totalMember, - rgs.total_party_members AS totalPartyMember + rgs.total_party_members AS totalPartyMember, + rg.GROUP_INTRODUCTION FROM resi_group rg LEFT JOIN resi_group_statistical rgs ON (rg.id = rgs.resi_group_id) @@ -1042,4 +1048,27 @@ ORDER BY releaseTime DESC + diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeCommentAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeCommentAttachmentDao.xml new file mode 100644 index 0000000000..d20f434692 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeCommentAttachmentDao.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentAttachmentDao.xml new file mode 100644 index 0000000000..f4616d1913 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentAttachmentDao.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java index 38497917d8..61f1c0f8f5 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java @@ -73,4 +73,9 @@ public class ResiWarmheartedSubmitFormDTO implements Serializable { */ private String messageText; + /** + * 无需前端传入,此列用来数据传值 + */ + private String applyId; + } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java index 0eb5f2f018..0f320cf9be 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java @@ -95,4 +95,14 @@ public interface ResiPartyMemberOpenFeignClient { **/ @PostMapping(value = "/resi/partymember/partymemberinfo/getPartymemberInfoByGridId", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result> getPartymemberInfoByGridId(@RequestBody List gridIdList); + + /** + * @Description 根据客户ID查询党员 + * @Param customerId + * @author zxc + * @date 2021/9/6 3:54 下午 + */ + @PostMapping(value = "/resi/partymember/partymemberinfo/getpartymemberinfobycustomerid") + Result> getPartyMemberInfoByCustomerId(@RequestParam("customerId")String customerId); + } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java index 9591f35234..953d5ca326 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java @@ -64,4 +64,9 @@ public class ResiPartyMemberOpenFeignClientFallback implements ResiPartyMemberOp public Result> getPartymemberInfoByGridId(List gridIdList) { return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "getPartymemberInfoByGridId", gridIdList); } + + @Override + public Result> getPartyMemberInfoByCustomerId(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "getPartyMemberInfoByCustomerId", customerId); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java index 5d7d081e13..98b56b8475 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java @@ -157,4 +157,15 @@ public class PartymemberInfoController { List list = partymemberInfoService.listPartymemberInfoByGridId(gridIdList); return new Result>().ok(list); } + + /** + * @Description 根据客户ID查询党员 + * @Param customerId + * @author zxc + * @date 2021/9/6 3:54 下午 + */ + @PostMapping("getpartymemberinfobycustomerid") + public Result> getPartyMemberInfoByCustomerId(@RequestParam("customerId")String customerId){ + return new Result>().ok(partymemberInfoService.getPartyMemberInfoByCustomerId(customerId)); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java index f395beac8b..c363cd42a0 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java @@ -95,4 +95,12 @@ public interface PartymemberInfoDao extends BaseDao { * @Date 2020/7/22 12:14 **/ List selectListPartymemberInfoByGridId(@Param("gridIdList") List gridIdList); + + /** + * @Description 根据客户ID查询党员 + * @Param customerId + * @author zxc + * @date 2021/9/6 3:54 下午 + */ + List selectListPartyMemberInfoByCustomerId(@Param("customerId") String customerId); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java index 4a25939dad..eed9482da3 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java @@ -170,4 +170,12 @@ public interface PartymemberInfoService extends BaseService getPartyMemberInfoByCustomerId(String customerId); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index 1610de67c6..502a520dc3 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -8,10 +8,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.constant.PartyMemberConstant; -import com.epmet.constant.PartyMemberMessageConstant; -import com.epmet.constant.ReadFlagConstant; -import com.epmet.constant.SmsTemplateConstant; +import com.epmet.constant.*; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -651,6 +648,11 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService userMessageFormDTO.setGridId(formDTO.getGridId()); userMessageFormDTO.setApp(AppClientConstant.APP_RESI); userMessageFormDTO.setTitle(PartyMemberMessageConstant.PARTY_AUTH_TITLE); + + //21.09.10:记录消息类型和对应的业务id + userMessageFormDTO.setMessageType(UserMessageTypeConstant.PARTY_CERTIFY_APPLY_RES); + userMessageFormDTO.setTargetId(formDTO.getId()); + //调用gov-org服务查询网格信息 CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO(); customerGridFormDTO.setGridId(formDTO.getGridId()); @@ -729,7 +731,12 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService msgDTO.setTitle(PartyMemberMessageConstant.PARTY_AUTH_TITLE); msgDTO.setMessageContent(message); msgDTO.setReadFlag(ReadFlagConstant.UN_READ); + + //21.09.10:记录消息类型和对应的业务id + msgDTO.setMessageType(UserMessageTypeConstant.PARTY_CERTIFY_APPLY); + msgDTO.setTargetId(formDTO.getId()); msgList.add(msgDTO); + //微信订阅 WxSubscribeMessageFormDTO subscribeDTO = new WxSubscribeMessageFormDTO(); subscribeDTO.setClientType(AppClientConstant.APP_GOV); diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java index 57e6a2922c..dfb4c42f71 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java @@ -248,4 +248,15 @@ public class PartymemberInfoServiceImpl extends BaseServiceImpl getPartyMemberInfoByCustomerId(String customerId) { + return baseDao.selectListPartyMemberInfoByCustomerId(customerId); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java index 549a5ce8af..553f20bae2 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java @@ -29,6 +29,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.PartyMemberConstant; import com.epmet.constant.ReadFlagConstant; +import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.UserRoleDTO; @@ -211,7 +212,8 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl + + + diff --git a/epmet-openapi/epmet-openapi-scan/src/main/resources/readme b/epmet-openapi/epmet-openapi-scan/src/main/resources/readme index 384fca6dfc..7957000efc 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/resources/readme +++ b/epmet-openapi/epmet-openapi-scan/src/main/resources/readme @@ -4,4 +4,19 @@ sadd epmet:openapi:scan:whitelist "客户端ip地址" sadd epmet:openapi:scan:whitelist "\"192.168.1.1\"" #del -srem 'epmet:openapi:scan:whitelist' "\"116.179.32.197\"" "\"27.219.156.47\"" \ No newline at end of file +srem 'epmet:openapi:scan:whitelist' "\"116.179.32.197\"" "\"27.219.156.47\"" + +==========现有的IP白名单列表=========== +"118.190.232.100" +"47.104.208.104" +"219.146.91.110" +"47.104.205.48" +"47.104.202.209" +123.168.101.68 +"47.105.75.189" +"115.28.104.30" +"124.128.226.254" +"114.215.146.86" + + +2021-09-13 平阴私有化部署服务器 "124.128.226.254" \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java index 04962a5396..7de2636450 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * 获取pc工作端登陆用户信息 @@ -60,4 +61,10 @@ public class StaffBasicInfoResultDTO implements Serializable { * 状态 0:停用 1:正常 */ private Integer status; + + /** + * 工作人员的所有角色key,09.08新增:工作端PC端用到了 + */ + private List roleList; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java index 0bada1c5ee..3561cb4060 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java @@ -58,4 +58,13 @@ public class UserInfoOnEnterGridResultDTO implements Serializable{ * XX街道-YYY 如果是未认证居民,这一列为空 */ private String userStreetTrueName; + + //真实姓名 + private String realName; + //工作人员添加入口Id(agencyId;deptId;gridId) + private String orgId = ""; + //人员注册时所属组织名【组织-组织,组织-部门,组织-网格】 + private String orgName = ""; + //工作人员添加入口类型(组织:agency;部门:dept;网格:gridId) + private String orgType = ""; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index d0679eb2b6..97e4bf7424 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -213,4 +213,6 @@ public interface CustomerStaffDao extends BaseDao { * @return */ List listDTOS(@Param("customerId") String customerId, @Param("realName") String realName, @Param("mobile") String mobile, @Param("userIds") List userIds); + + List selectStaffRoles(@Param("userId") String userId,@Param("customerId") String customerId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java index e861249258..0fed169769 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java @@ -65,7 +65,7 @@ public interface UserBadgeDao { * @author zxc * @date 2020/11/4 2:13 下午 */ - void insertUserBadgeCertificateRecord(UserBadgeCertificateRecordDTO userBadgeCertificateRecordDTO); + int insertUserBadgeCertificateRecord(UserBadgeCertificateRecordDTO userBadgeCertificateRecordDTO); /** * @Description 更新认证徽章记录最新 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index 7d4a258ccb..a2e6405300 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -47,7 +47,7 @@ public interface GovOrgFeignClient { * @author LiuJanJun * @date 2021/4/19 11:19 上午 */ - @PostMapping("/gov/org/grid/getbaseinfo") - Result getGridBaseInfoByGridId(CustomerGridFormDTO customerGridFormDTO); + //@PostMapping("/gov/org/grid/getbaseinfo") + //Result getGridBaseInfoByGridId(CustomerGridFormDTO customerGridFormDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java index 2fbcf49452..2366577ef6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java @@ -29,8 +29,8 @@ public class GovOrgFeignClientFallBack implements GovOrgFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridStaffs", gridIdFormDTO); } - @Override - public Result getGridBaseInfoByGridId(CustomerGridFormDTO customerGridFormDTO) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridBaseInfoByGridId", customerGridFormDTO); - } + //@Override + //public Result getGridBaseInfoByGridId(CustomerGridFormDTO customerGridFormDTO) { + // return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridBaseInfoByGridId", customerGridFormDTO); + //} } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 740b4b8d6e..989b86924d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -703,6 +703,9 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl selectStaffBasicInfo(String userId) { StaffBasicInfoResultDTO resultDTO = baseDao.selectStaffBasicInfo(userId); + if(null!=resultDTO){ + resultDTO.setRoleList(baseDao.selectStaffRoles(userId,resultDTO.getCustomerId())); + } return new Result().ok(resultDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java index e2aaae2963..0e0a8ef246 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java @@ -40,6 +40,7 @@ import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.entity.RegisterRelationEntity; import com.epmet.entity.UserCustomerEntity; import com.epmet.feign.GovOrgFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.GridVisitedService; import com.epmet.service.RegisterRelationService; import com.epmet.util.ModuleConstant; @@ -72,6 +73,9 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl gridDTOResult = govOrgFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); + Result gridDTOResult = govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); if(gridDTOResult.success() && null != gridDTOResult.getData()){ resultObj.setCurrentGridName(gridDTOResult.getData().getGridName()); + resultObj.setOrgId(resultObj.getCurrentGridId()); + resultObj.setOrgName(gridDTOResult.getData().getAgencyName()+"-"+gridDTOResult.getData().getGridName()); + resultObj.setOrgType("grid"); }else{ //查询网格名称失败 log.warn(String.format("查找网格信息失败,网格Id:【%s】",gridId)); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java index 7d6aa5e196..12255c1153 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java @@ -24,6 +24,7 @@ import com.epmet.entity.StaffPatrolDetailEntity; import com.epmet.entity.StaffPatrolRecordEntity; import com.epmet.entity.StatsStaffPatrolRecordDailyEntity; import com.epmet.feign.GovOrgFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovProjectOpenFeignClient; import com.epmet.service.StaffPatrolDetailService; import com.epmet.service.StaffPatrolRecordService; @@ -56,6 +57,9 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl gridResult = govOrgFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); + Result gridResult = govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); if (!gridResult.success() || null == gridResult.getData()) { //查询网格名称失败 log.error(String.format("查找网格信息失败,网格Id:【%s】", entity.getGrid())); @@ -141,7 +145,7 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl gridResult = govOrgFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); + Result gridResult = govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); if (!gridResult.success() || null == gridResult.getData()) { //查询网格名称失败 log.error(String.format("查找网格信息失败,网格Id:【%s】", formDTO.getGridId())); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java index bdf908849f..3f189b5426 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java @@ -334,7 +334,7 @@ public class UserAdviceServiceImpl extends BaseServiceImpl customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); - if (customerInfo.success()){ + if (customerInfo.success() && null != customerInfo.getData()) { userAdviceDTO.setCustomerName(customerInfo.getData().getCustomerName()); }else { logger.error("customerId:{},获取customerName失败",dto.getCustomerId()); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 0716978c1c..7a70e3e651 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -12,6 +12,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.BadgeConstant; import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.SmsTemplateConstant; +import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dao.*; import com.epmet.dto.ResiUserBadgeDTO; import com.epmet.dto.UserBadgeCertificateRecordDTO; @@ -53,8 +54,6 @@ public class UserBadgeServiceImpl implements UserBadgeService { @Autowired private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; @Autowired - private EpmetMessageOpenFeignClient messageFeignClient; - @Autowired private UserRoleDao userRoleDao; @Autowired private ResiUserBadgeDao resiUserBadgeDao; @@ -278,11 +277,13 @@ public class UserBadgeServiceImpl implements UserBadgeService { form.setSurname(certificationAddFormDTO.getSurname()); log.info(JSON.toJSONString(form)); userBadgeDao.insertUserBadgeCertificateRecord(form); - //TODO 站内信发送 String badgeName = badgeDao.selectBadgeName(form.getCustomerId(), form.getBadgeId()); String msg = String.format(BadgeConstant.MESSAGE_CONTENT, userBaseInfoResultDTOS.get(NumConstant.ZERO).getDistrict().concat(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRealName()), badgeName); - sendMessage(BadgeConstant.AUTH_TITLE,msg,form.getGridId(),form.getUserId(),form.getCustomerId()); + // 记录待审核id,和消息类型 + sendMessage(BadgeConstant.AUTH_TITLE,msg,form.getGridId(),form.getUserId(),form.getCustomerId(), + UserMessageTypeConstant.BADGE_AUTH_APPLY, + form.getId()); return new Result(); } @@ -443,7 +444,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { * @author zxc * @date 2020/11/19 上午9:16 */ - public void sendMessage(String title,String msg,String gridId,String userId,String customerId){ + public void sendMessage(String title,String msg,String gridId,String userId,String customerId,String messageType,String userBadgeCertificateRecordId){ //1.查询加入当前网格下的人员 customer_staff_grid CommonGridIdFormDTO commonGridIdFormDTO = new CommonGridIdFormDTO(); commonGridIdFormDTO.setGridId(gridId); @@ -474,6 +475,11 @@ public class UserBadgeServiceImpl implements UserBadgeService { msgObj.setReadFlag(ReadFlagConstant.UN_READ); msgObj.setTitle(title); msgObj.setUserId(to); + + //21.09.10:记录消息类型和对应的业务id + msgObj.setMessageType(messageType); + msgObj.setTargetId(userBadgeCertificateRecordId); + msgList.add(msgObj); //微信订阅 WxSubscribeMessageFormDTO subscribeDTO = new WxSubscribeMessageFormDTO(); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index 1ce80e7e61..0f4d76d821 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -152,6 +152,9 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl 1){ + logger.error("queryUserBaseInfoFromCache userId:{} exist more than one record",userId); + } UserBaseInfoResultDTO userBaseInfoResultDTO = userBaseInfoResultDTOS.get(0); logger.debug("getUserResiInfoDTO userId:{},result:{}", userId,JSON.toJSONString(userBaseInfoResultDTO)); return userBaseInfoResultDTO; @@ -180,25 +183,30 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl { UserBaseInfoResultDTO baseInfo = userBaseInfoRedis.getUserInfo(id); - //为了保证传过来的user数量与返回的一致,就算查出的用户信息为空也要添加进集合里 - //if(null != baseInfo && StringUtils.isNotBlank(baseInfo.getId())){ - if (StringUtils.isNotBlank(baseInfo.getStreet()) && StringUtils.isNotBlank(baseInfo.getSurname())) { - if ("1".equals(baseInfo.getGender())) { - // 男 - baseInfo.setUserShowName(baseInfo.getStreet().concat(StrConstant.HYPHEN).concat(baseInfo.getSurname().concat("先生"))); - } else if ("2".equals(baseInfo.getGender())) { - // 女 - baseInfo.setUserShowName(baseInfo.getStreet().concat(StrConstant.HYPHEN).concat(baseInfo.getSurname().concat("女士"))); + if(null!=baseInfo){ + //为了保证传过来的user数量与返回的一致,就算查出的用户信息为空也要添加进集合里 + //if(null != baseInfo && StringUtils.isNotBlank(baseInfo.getId())){ + if (StringUtils.isNotBlank(baseInfo.getStreet()) && StringUtils.isNotBlank(baseInfo.getSurname())) { + if ("1".equals(baseInfo.getGender())) { + // 男 + baseInfo.setUserShowName(baseInfo.getStreet().concat(StrConstant.HYPHEN).concat(baseInfo.getSurname().concat("先生"))); + } else if ("2".equals(baseInfo.getGender())) { + // 女 + baseInfo.setUserShowName(baseInfo.getStreet().concat(StrConstant.HYPHEN).concat(baseInfo.getSurname().concat("女士"))); + } else { + // 0 未知 + baseInfo.setUserShowName(baseInfo.getStreet().concat(StrConstant.HYPHEN).concat(baseInfo.getSurname().concat("女士/先生"))); + } } else { - // 0 未知 - baseInfo.setUserShowName(baseInfo.getStreet().concat(StrConstant.HYPHEN).concat(baseInfo.getSurname().concat("女士/先生"))); + // 社会为微信昵称 + baseInfo.setUserShowName(baseInfo.getNickname()); } - } else { - // 社会为微信昵称 - baseInfo.setUserShowName(baseInfo.getNickname()); + userBaseInfoList.add(baseInfo); + //} + }else{ + logger.error(String.format("userId【%s】,构造UserBaseInfoResultDTO为空",id)); } - userBaseInfoList.add(baseInfo); - //} + }); return userBaseInfoList; } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 9e3265747c..4448cb0566 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -416,4 +416,14 @@ ) + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index 9e00787142..c42a648c62 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -170,7 +170,10 @@ - + + + select replace(uuid(),'-','') AS ID + INSERT INTO user_badge_certificate_record ( ID, CUSTOMER_ID, @@ -197,7 +200,7 @@ ) VALUES ( - REPLACE ( UUID(), '-', '' ), + #{id}, #{customerId}, #{gridId}, #{userId},