diff --git a/ad-platform-common/ad-platform-common-auth/src/main/java/com/baiye/util/HttpContextUtil.java b/ad-platform-common/ad-platform-common-auth/src/main/java/com/baiye/util/HttpContextUtil.java new file mode 100644 index 00000000..b248642f --- /dev/null +++ b/ad-platform-common/ad-platform-common-auth/src/main/java/com/baiye/util/HttpContextUtil.java @@ -0,0 +1,26 @@ +package com.baiye.util; + +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + + +/** + * http工具类 + * + * @author pangu + */ +public class HttpContextUtil { + + /** + * 获取request + * + * @return HttpServletRequest + */ + public static HttpServletRequest getHttpServletRequest() { + RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); + return (requestAttributes == null) ? null : ((ServletRequestAttributes) requestAttributes).getRequest(); + } +} diff --git a/ad-platform-common/ad-platform-common-auth/src/main/java/com/baiye/util/MobileUtil.java b/ad-platform-common/ad-platform-common-auth/src/main/java/com/baiye/util/MobileUtil.java index f97e4520..552ba48b 100644 --- a/ad-platform-common/ad-platform-common-auth/src/main/java/com/baiye/util/MobileUtil.java +++ b/ad-platform-common/ad-platform-common-auth/src/main/java/com/baiye/util/MobileUtil.java @@ -12,20 +12,20 @@ import java.util.regex.Pattern; public class MobileUtil { /** - * 中国电信号码格式验证 手机段: 133,149,153,173,177,180,181,189,199,1349,1410,1700,1701,1702 + * 中国电信号码格式验证 手机段: 133,149,153,173,177,180,181,189,199,191,193,197,1349,1410,1700,1701,1702 **/ - private static final String CHINA_TELECOM_PATTERN = "(?:^(?:\\+86)?1(?:33|49|53|7[37]|8[019]|99)\\d{8}$)|(?:^(?:\\+86)?1349\\d{7}$)|(?:^(?:\\+86)?1410\\d{7}$)|(?:^(?:\\+86)?170[0-2]\\d{7}$)"; + private static final String CHINA_TELECOM_PATTERN = "(?:^(?:\\+86)?1(?:33|49|53|7[37]|8[019]|9[1379])\\d{8}$)|(?:^(?:\\+86)?1349\\d{7}$)|(?:^(?:\\+86)?1410\\d{7}$)|(?:^(?:\\+86)?170[0-2]\\d{7}$)"; /** - * 中国联通号码格式验证 手机段:130,131,132,145,146,155,156,166,171,175,176,185,186,1704,1707,1708,1709 + * 中国联通号码格式验证 手机段:130,131,132,145,146,155,156,166,171,175,176,185,186,196,1704,1707,1708,1709 **/ - private static final String CHINA_UNICOM_PATTERN = "(?:^(?:\\+86)?1(?:3[0-2]|4[56]|5[56]|66|7[156]|8[56])\\d{8}$)|(?:^(?:\\+86)?170[47-9]\\d{7}$)"; + private static final String CHINA_UNICOM_PATTERN = "(?:^(?:\\+86)?1(?:3[0-2]|4[56]|5[56]|66|7[156]|8[56]|96)\\d{8}$)|(?:^(?:\\+86)?170[47-9]\\d{7}$)"; /** * 中国移动号码格式验证 - * 手机段:134,135,136,137,138,139,147,148,150,151,152,157,158,159,178,182,183,184,187,188,198,1440,1703,1705,1706 + * 手机段:134,135,136,137,138,139,147,148,150,151,152,157,158,159,178,182,183,184,187,188,198,195,172,148,1440,1703,1705,1706 **/ - private static final String CHINA_MOBILE_PATTERN = "(?:^(?:\\+86)?1(?:3[4-9]|4[78]|5[0-27-9]|78|8[2-478]|98)\\d{8}$)|(?:^(?:\\+86)?1440\\d{7}$)|(?:^(?:\\+86)?170[356]\\d{7}$)"; + private static final String CHINA_MOBILE_PATTERN = "(?:^(?:\\+86)?1(?:3[4-9]|4[78]|5[0-27-9]|78|8[2-478]|98|95|72|48)\\d{8}$)|(?:^(?:\\+86)?1440\\d{7}$)|(?:^(?:\\+86)?170[356]\\d{7}$)"; /** * 中国大陆手机号码校验 @@ -36,9 +36,7 @@ public class MobileUtil { */ public static boolean checkPhone(String phone) { if (StringUtils.isNotBlank(phone)) { - if (checkChinaMobile(phone) || checkChinaUnicom(phone) || checkChinaTelecom(phone)) { - return true; - } + return checkChinaMobile(phone) || checkChinaUnicom(phone) || checkChinaTelecom(phone); } return false; } @@ -53,9 +51,7 @@ public class MobileUtil { public static boolean checkChinaMobile(String phone) { if (StringUtils.isNotBlank(phone)) { Pattern regexp = Pattern.compile(CHINA_MOBILE_PATTERN); - if (regexp.matcher(phone).matches()) { - return true; - } + return regexp.matcher(phone).matches(); } return false; } @@ -70,9 +66,7 @@ public class MobileUtil { public static boolean checkChinaUnicom(String phone) { if (StringUtils.isNotBlank(phone)) { Pattern regexp = Pattern.compile(CHINA_UNICOM_PATTERN); - if (regexp.matcher(phone).matches()) { - return true; - } + return regexp.matcher(phone).matches(); } return false; } @@ -87,9 +81,7 @@ public class MobileUtil { public static boolean checkChinaTelecom(String phone) { if (StringUtils.isNotBlank(phone)) { Pattern regexp = Pattern.compile(CHINA_TELECOM_PATTERN); - if (regexp.matcher(phone).matches()) { - return true; - } + return regexp.matcher(phone).matches(); } return false; } diff --git a/ad-platform-common/ad-platform-common-core/src/main/java/com/baiye/constant/FileConstant.java b/ad-platform-common/ad-platform-common-core/src/main/java/com/baiye/constant/FileConstant.java index 6dcbfa01..72261a78 100644 --- a/ad-platform-common/ad-platform-common-core/src/main/java/com/baiye/constant/FileConstant.java +++ b/ad-platform-common/ad-platform-common-core/src/main/java/com/baiye/constant/FileConstant.java @@ -51,6 +51,16 @@ public class FileConstant { */ public static final int ONE_MILLION_NUMBER = 1000000; + /** + * BY + */ + public static final String BY = "BY"; + + /** + * MM + */ + public static final String MM = "MM"; + /** * uc */ @@ -93,4 +103,10 @@ public class FileConstant { public static final String CSV_FILE_SUB_NAME = "csv"; + /** + * 以 zip 结尾的文件 + */ + public static final String ZIP_FILE_SUB_NAME = ".zip"; + + } diff --git a/ad-platform-pojo/src/main/java/com/baiye/model/dto/ClueQueryCriteria.java b/ad-platform-pojo/src/main/java/com/baiye/model/dto/ClueQueryCriteria.java index 830f0126..57b4d22e 100644 --- a/ad-platform-pojo/src/main/java/com/baiye/model/dto/ClueQueryCriteria.java +++ b/ad-platform-pojo/src/main/java/com/baiye/model/dto/ClueQueryCriteria.java @@ -25,6 +25,7 @@ public class ClueQueryCriteria { @ApiModelProperty(value = "任务id") private Long taskId; private Set taskIds; + @ApiModelProperty(value = "所属组员id") private Long memberId; @@ -73,6 +74,4 @@ public class ClueQueryCriteria { private String nid; private Integer clueType; - - private List clueTypes; } diff --git a/ad-platform-pojo/src/main/java/com/baiye/model/entity/BaseClueMiddle.java b/ad-platform-pojo/src/main/java/com/baiye/model/entity/BaseClueMiddle.java index 00388478..12c17ddc 100644 --- a/ad-platform-pojo/src/main/java/com/baiye/model/entity/BaseClueMiddle.java +++ b/ad-platform-pojo/src/main/java/com/baiye/model/entity/BaseClueMiddle.java @@ -82,11 +82,11 @@ public class BaseClueMiddle implements Serializable { @ApiModelProperty(value = "是否移入到公海") @Column(name = "public_pool_status") - private Integer publicPoolStatus; + private Integer publicPoolStatus = 0; @ApiModelProperty(value = "成交金额") @Column(name = "turnover_amount") - private Double turnoverAmount; + private Double turnoverAmount = 0.00; @ApiModelProperty(value = "线索来源 1-表单推送 2-个人上传 3-抖音 4-投流 5-拓客 6-拓客回流 7-投流回流") @Column(name = "clue_type") diff --git a/manage/ad-platform-management/src/main/java/com/baiye/feign/SourceClueClient.java b/manage/ad-platform-management/src/main/java/com/baiye/feign/SourceClueClient.java index 07b1b68e..aa29b52f 100644 --- a/manage/ad-platform-management/src/main/java/com/baiye/feign/SourceClueClient.java +++ b/manage/ad-platform-management/src/main/java/com/baiye/feign/SourceClueClient.java @@ -7,6 +7,7 @@ import com.baiye.model.vo.ResSourceLabel; import com.baiye.modules.system.domain.Clue; import com.baiye.modules.system.service.dto.ClueMiddleTo; import com.baiye.modules.telemarkting.entity.ClueMiddle; +import com.baiye.socket.filter.FeignConfiguration; import io.swagger.annotations.ApiOperation; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.ResponseEntity; diff --git a/manage/ad-platform-management/src/main/java/com/baiye/modules/report/service/impl/QueryReportServiceImpl.java b/manage/ad-platform-management/src/main/java/com/baiye/modules/report/service/impl/QueryReportServiceImpl.java index 0141ef4a..4ad0cc52 100644 --- a/manage/ad-platform-management/src/main/java/com/baiye/modules/report/service/impl/QueryReportServiceImpl.java +++ b/manage/ad-platform-management/src/main/java/com/baiye/modules/report/service/impl/QueryReportServiceImpl.java @@ -578,7 +578,6 @@ public class QueryReportServiceImpl implements QueryReportService { int turnOnNum = 0; int validNum = 0; //查询线索的所有通话记录 (7天内,7天外的录音会被迁移,无法下载) -// List allByClueId = allCallInfoRepository.findAllByClueId(clueId); String beginOfDay = DateUtil.beginOfDay(DateUtil.offsetDay(DateUtil.date(), -7)).toString(); String endOfDay = DateUtil.date().toString(); List allByClueId = allCallInfoRepository.queryAllByTime(beginOfDay, endOfDay, clueId); diff --git a/manage/ad-platform-management/src/main/java/com/baiye/modules/security/security/TokenFilter.java b/manage/ad-platform-management/src/main/java/com/baiye/modules/security/security/TokenFilter.java index 1a10a756..bff82942 100644 --- a/manage/ad-platform-management/src/main/java/com/baiye/modules/security/security/TokenFilter.java +++ b/manage/ad-platform-management/src/main/java/com/baiye/modules/security/security/TokenFilter.java @@ -67,6 +67,7 @@ public class TokenFilter extends GenericFilterBean { throws IOException, ServletException { HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest; String token = resolveToken(httpServletRequest); + logger.info(httpServletRequest.getRequestURI()); // 对于 Token 为空的不需要去查 Redis if (CharSequenceUtil.isNotBlank(token)) { OnlineUserDto onlineUserDto = null; diff --git a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/domain/ClueTalk.java b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/domain/ClueTalk.java new file mode 100644 index 00000000..4ccde0b1 --- /dev/null +++ b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/domain/ClueTalk.java @@ -0,0 +1,32 @@ +package com.baiye.modules.system.domain; + +import com.baiye.model.entity.BaseClueMiddle; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Getter; +import lombok.Setter; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.validation.constraints.NotNull; + +/** + * @author jt + */ +@Getter +@Setter +@Entity +@Table(name = "tb_clue_talk") +@ApiModel(value = "ClueTalk") +public class ClueTalk extends BaseClueMiddle { + private static final long serialVersionUID = -2426343637629328905L; + + @Id + @ApiModelProperty(value = "线索id") + @Column(name = "clue_id") + @NotNull(message = "资源id不能为空") + private Long clueId; + +} diff --git a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/repository/ClueTalkRepository.java b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/repository/ClueTalkRepository.java new file mode 100644 index 00000000..b584cb43 --- /dev/null +++ b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/repository/ClueTalkRepository.java @@ -0,0 +1,25 @@ +package com.baiye.modules.system.repository; + +import com.baiye.modules.system.domain.ClueTalk; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +/** + * @author jt + */ +@Repository +public interface ClueTalkRepository extends JpaRepository, JpaSpecificationExecutor { + + /** + * 统计今天数量 + * @param taskId + * @param num + * @return + */ + @Query(value = "select count(1) from tb_clue_talk where" + + " to_days(create_time) = to_days(now()) and task_id = ?1 and clue_type = ?2", nativeQuery = true) + Integer countByTaskId(Long taskId, Integer num); + +} diff --git a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/repository/TaskRepository.java b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/repository/TaskRepository.java index 4c7cb885..142945e5 100644 --- a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/repository/TaskRepository.java +++ b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/repository/TaskRepository.java @@ -42,6 +42,7 @@ public interface TaskRepository extends JpaRepository, JpaSpecificat /** * 查询所有创建人创建的任务 + * * @param userId * @return */ @@ -50,6 +51,16 @@ public interface TaskRepository extends JpaRepository, JpaSpecificat /** * 任务ID查询 * @param taskIds + * @return */ Set findByIdIn(Set taskIds); + + /** + * 查询公司下的不同类型任务 + * + * @param userId + * @param isForm + * @return + */ + List findByCreateByAndIsForm(Long userId, Integer isForm); } diff --git a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/rest/LabelOrganizeController.java b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/rest/LabelOrganizeController.java index e0dafa0d..9fa8e6fa 100644 --- a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/rest/LabelOrganizeController.java +++ b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/rest/LabelOrganizeController.java @@ -31,7 +31,7 @@ public class LabelOrganizeController { @ApiOperation("新增标签组和标签") @PostMapping("/add") - public CommonResponse save(@Validated({AddGroup.class}) @RequestBody LabelOrganize labelOrganize){ + public CommonResponse save(@Validated({AddGroup.class}) @RequestBody LabelOrganize labelOrganize) { labelOrganizeService.save(labelOrganize); return CommonResponse.createBySuccess(); } @@ -52,13 +52,13 @@ public class LabelOrganizeController { @ApiOperation("查询标签组列表") @GetMapping("/query") - public ResponseEntity query(LabelOrganizeQueryCriteria labelOrganizeQueryCriteria){ + public ResponseEntity query(LabelOrganizeQueryCriteria labelOrganizeQueryCriteria) { return new ResponseEntity<>(labelOrganizeService.query(labelOrganizeQueryCriteria), HttpStatus.OK); } @ApiOperation("查询标签组列表(分页,返回数据中插入了组中标签信息)") @GetMapping("/queryAll") - public ResponseEntity queryAll(LabelOrganizeQueryCriteria labelOrganizeQueryCriteria, Pageable pageable){ - return new ResponseEntity<>(labelOrganizeService.queryAll(labelOrganizeQueryCriteria, pageable),HttpStatus.OK); + public ResponseEntity queryAll(LabelOrganizeQueryCriteria labelOrganizeQueryCriteria, Pageable pageable) { + return new ResponseEntity<>(labelOrganizeService.queryAll(labelOrganizeQueryCriteria, pageable), HttpStatus.OK); } } diff --git a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/ClueTalkService.java b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/ClueTalkService.java new file mode 100644 index 00000000..085e6596 --- /dev/null +++ b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/ClueTalkService.java @@ -0,0 +1,17 @@ +package com.baiye.modules.system.service; + +/** + * @author Enzo + * @date : 2022/12/6 + */ + +public interface ClueTalkService { + + /** + * 统计今天数量 + * @param taskId + * @param num + * @return + */ + Integer countByTaskIdAndDate(Long taskId, Integer num); +} diff --git a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/LabelOrganizeService.java b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/LabelOrganizeService.java index 4f10f818..bc456a89 100644 --- a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/LabelOrganizeService.java +++ b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/LabelOrganizeService.java @@ -13,24 +13,28 @@ public interface LabelOrganizeService { /** * 新增标签组 + * * @param labelOrganize */ void save(LabelOrganize labelOrganize); /** * 修改标签组 + * * @param labelOrganize */ void update(LabelOrganize labelOrganize); /** * 删除标签组 + * * @param ids */ void del(Set ids); /** * 查询标签组列表 + * * @param labelOrganizeQueryCriteria * @return */ @@ -38,6 +42,7 @@ public interface LabelOrganizeService { /** * 查询标签组列表(分页,返回数据中插入了组中标签信息) + * * @param labelOrganizeQueryCriteria * @param pageable * @return @@ -46,8 +51,16 @@ public interface LabelOrganizeService { /** * 标签组ID查询所有标签,并且根据标签组ID分组返回 + * * @param labelOrganizeIds * @return */ Map> organizeIdGroup(Set labelOrganizeIds); + + /** + * 创建默认标签 + * @param userId + * @return + */ + Long saveDefault(Long userId); } diff --git a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/TaskImeiService.java b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/TaskImeiService.java index 21e53d93..902f39cb 100644 --- a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/TaskImeiService.java +++ b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/TaskImeiService.java @@ -1,6 +1,5 @@ package com.baiye.modules.system.service; -import cn.hutool.core.date.DateTime; import com.baiye.modules.system.domain.TaskImei; import com.baiye.modules.system.service.dto.PlatformTransmitDTO; diff --git a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/CallDeductServiceImpl.java b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/CallDeductServiceImpl.java index a2986f59..25bd8d87 100644 --- a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/CallDeductServiceImpl.java +++ b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/CallDeductServiceImpl.java @@ -73,7 +73,7 @@ public class CallDeductServiceImpl implements CallDeductService { String year = String.valueOf(vo.getYear()); CallDeductResponseVO deductResponseVO = new CallDeductResponseVO(); String format = year.concat(StrPool.DASHED.concat(String.valueOf(vo.getMonth()))); - DateTime parse = DateUtil.parse(format, "yyyy-MM"); + DateTime parse = DateUtil.parse(format, DatePattern.NORM_MONTH_PATTERN); DateTime dateTime = DateUtil.beginOfMonth(DateUtil.offsetMonth(parse, DefaultNumberConstants.ONE_NUMBER)); @@ -90,7 +90,7 @@ public class CallDeductServiceImpl implements CallDeductService { public Map queryMonthList(CallDeductMonthQueryCriteria criteria, Pageable pageable, Long companyId) { Map map = Maps.newHashMap(); String queryTime = criteria.getQueryTime(); - DateTime parse = DateUtil.parse(queryTime, "yyyy-MM"); + DateTime parse = DateUtil.parse(queryTime, DatePattern.NORM_MONTH_PATTERN); DateTime endDate = DateUtil.offsetMonth(parse, DefaultNumberConstants.ONE_NUMBER); List deductList = callDeductRepository.queryByCompanyIdAndTime diff --git a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/ClueTalkServiceImpl.java b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/ClueTalkServiceImpl.java new file mode 100644 index 00000000..30375e84 --- /dev/null +++ b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/ClueTalkServiceImpl.java @@ -0,0 +1,25 @@ +package com.baiye.modules.system.service.impl; + +import com.baiye.modules.system.repository.ClueTalkRepository; +import com.baiye.modules.system.service.ClueTalkService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @author Enzo + * @date : 2022/10/18 + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class ClueTalkServiceImpl implements ClueTalkService { + + private final ClueTalkRepository clueTalkRepository; + + @Override + public Integer countByTaskIdAndDate(Long taskId, Integer num) { + return clueTalkRepository.countByTaskId(taskId, num); + } +} + diff --git a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/CompanyServiceImpl.java b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/CompanyServiceImpl.java index abfc7663..a25064fc 100644 --- a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/CompanyServiceImpl.java +++ b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/CompanyServiceImpl.java @@ -73,6 +73,7 @@ public class CompanyServiceImpl implements CompanyService { BeanUtil.copyProperties(companyDto, byUserId); byUserId.setApplicationTime(DateUtil.date()); byUserId.setCompanyCode(byUserId.getCompanyName().trim()); + byUserId.setSonUserNum(100); userRepository.updateStatusById(Boolean.FALSE, SecurityUtils.getCurrentUserId()); return companyMapper.toDto(companyRepository.save(byUserId)); } @@ -105,7 +106,7 @@ public class CompanyServiceImpl implements CompanyService { public CompanyDto createCompany(CompanyDto companyDto) { Company company = new Company(); BeanUtil.copyProperties(companyDto, company); - company.setSonUserNum((int) DefaultNumberConstants.ONE_HUNDRED); + company.setSonUserNum(100); return companyMapper.toDto(companyRepository.save(company)); } diff --git a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/DeptServiceImpl.java b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/DeptServiceImpl.java index ab5faf5e..66ffd81e 100644 --- a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/DeptServiceImpl.java +++ b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/DeptServiceImpl.java @@ -31,6 +31,7 @@ import com.baiye.modules.system.service.dto.DeptQueryCriteria; import com.baiye.modules.system.service.mapstruct.DeptMapper; import com.baiye.util.*; + import com.google.common.collect.Lists; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -71,10 +72,7 @@ criteria.setPidIsNull(true); } List fields = QueryHelp.getAllFields(criteria.getClass(), new ArrayList<>()); - List fieldNames = new ArrayList() {{ - add("pidIsNull"); - add("enabled"); - }}; + List fieldNames = Lists.newArrayList("pidIsNull", "pidIsNull"); for (Field field : fields) { //设置对象的访问权限,保证对private的属性的访问 field.setAccessible(true); diff --git a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/DownRecordServiceImpl.java b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/DownRecordServiceImpl.java index 86d575ed..bfdea9a6 100644 --- a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/DownRecordServiceImpl.java +++ b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/DownRecordServiceImpl.java @@ -51,8 +51,6 @@ public class DownRecordServiceImpl implements DownRecordService { private final RedisUtils redisUtils; - private final TaskService taskService; - private final DeliveryProperties deliveryProperties; private final DownRecordRepository downRecordRepository; @@ -93,7 +91,7 @@ public class DownRecordServiceImpl implements DownRecordService { String format = DateUtil.format(DateUtil.date(), DatePattern.PURE_DATE_PATTERN); Integer num = (Integer) redisUtils.get(CacheKey.DMP_MANUAL_ID.concat(format)); Integer batch = ObjectUtil.isNull(num) ? DefaultNumberConstants.ONE_NUMBER : num + DefaultNumberConstants.ONE_NUMBER; - String taskImeiName = "MM".concat(StrPool.UNDERLINE).concat(format).concat(StrPool.UNDERLINE).concat(String.valueOf(batch)); + String taskImeiName = FileConstant.MM.concat(StrPool.UNDERLINE).concat(format).concat(StrPool.UNDERLINE).concat(String.valueOf(batch)); // 发送邮件 MailUtil.sendMail(deliveryProperties.getEmailAddress(), deliveryProperties.getEmailPassword(), deliveryProperties.getToEmailAddress(), downRecord.getDownUrl(), taskImeiName); @@ -157,11 +155,11 @@ public class DownRecordServiceImpl implements DownRecordService { String file = deliveryProperties.getFileUrl().concat(StrPool.SLASH).concat(uuid); Integer num = (Integer) redisUtils.get(CacheKey.DMP_MANUAL_ID.concat(format)); Integer batch = ObjectUtil.isNull(num) ? DefaultNumberConstants.ONE_NUMBER : num + DefaultNumberConstants.ONE_NUMBER; - String taskImeiName = "MM".concat(StrPool.UNDERLINE).concat(format).concat(StrPool.UNDERLINE).concat(String.valueOf(batch)); + String taskImeiName = FileConstant.MM.concat(StrPool.UNDERLINE).concat(format).concat(StrPool.UNDERLINE).concat(String.valueOf(batch)); // 保存文件 - String csvPath = file.concat(".csv"); + String csvPath = file.concat(StrPool.DOT).concat(FileConstant.CSV_FILE_SUB_NAME); CSVFileUtil.createCsvFile(dtoArrayList, csvPath); - String zipPath = file.concat(".zip"); + String zipPath = file.concat(FileConstant.ZIP_FILE_SUB_NAME); // 设置压缩文件 CompressUtil.decryptionCompression (zipPath, csvPath, deliveryProperties.getZipPassword()); @@ -172,7 +170,7 @@ public class DownRecordServiceImpl implements DownRecordService { redisUtils.set(CacheKey.DMP_MANUAL_ID.concat(format), batch, DefaultNumberConstants.ONE_NUMBER, TimeUnit.DAYS); Long recordId = deliveryRecordService.saveDeliveryRecord(zipPath, taskImeiName, dtoArrayList.size(), null, SecurityUtils.getCurrentUserId(), DefaultNumberConstants.TWO_NUMBER); - String filePath = deliveryProperties.getDmpDownPath().concat(uuid).concat(".zip"); + String filePath = deliveryProperties.getDmpDownPath().concat(uuid).concat(FileConstant.ZIP_FILE_SUB_NAME); this.createRecord(dtoArrayList.size(), "超级管理员", taskName, zipPath, filePath, recordId, DefaultNumberConstants.TWO_NUMBER); return Boolean.TRUE; } diff --git a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/LabelOrganizeServiceImpl.java b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/LabelOrganizeServiceImpl.java index 09c5d785..a3c13ebe 100644 --- a/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/LabelOrganizeServiceImpl.java +++ b/manage/ad-platform-management/src/main/java/com/baiye/modules/system/service/impl/LabelOrganizeServiceImpl.java @@ -42,7 +42,7 @@ public class LabelOrganizeServiceImpl implements LabelOrganizeService { LabelOrganize saveLabelOrganize = labelOrganizeRepository.save(labelOrganize); Long saveLabelOrganizeId = saveLabelOrganize.getId(); List