diff --git a/admin/src/main/java/com/baiye/modules/distribute/entity/CustomEntity.java b/admin/src/main/java/com/baiye/modules/distribute/entity/CustomEntity.java index 3d500a2..9f935e9 100644 --- a/admin/src/main/java/com/baiye/modules/distribute/entity/CustomEntity.java +++ b/admin/src/main/java/com/baiye/modules/distribute/entity/CustomEntity.java @@ -12,6 +12,7 @@ import lombok.Setter; import org.springframework.validation.annotation.Validated; import javax.validation.constraints.NotNull; +import java.util.Date; /** * @author Enzo @@ -75,6 +76,11 @@ public class CustomEntity extends BaseEntity { @Schema(description = "录入员姓名") private String enterName; + @Schema(description = "分发时间") + private Date distributeTime; + + + } diff --git a/admin/src/main/java/com/baiye/modules/distribute/mapper/CustomMapper.java b/admin/src/main/java/com/baiye/modules/distribute/mapper/CustomMapper.java index 194111c..9fac901 100644 --- a/admin/src/main/java/com/baiye/modules/distribute/mapper/CustomMapper.java +++ b/admin/src/main/java/com/baiye/modules/distribute/mapper/CustomMapper.java @@ -21,20 +21,23 @@ public interface CustomMapper extends ExtendMapper { LambdaAliasQueryWrapperX wrapperX = WrappersX.lambdaAliasQueryX(CustomEntity.class); wrapperX.eqIfPresent(CustomEntity::getCreateBy, qo.getCreateBy()) .likeIfPresent(CustomEntity::getCustomName, qo.getCustomName()) + .likeIfPresent(CustomEntity::getBatchNo, qo.getBatchNo()) .eqIfPresent(CustomEntity::getCustomId,qo.getCompanyId()) .eqIfPresent(CustomEntity::getType,qo.getSalesmanType()) .eqIfPresent(CustomEntity::getCustomNid, qo.getCustomNid()) - .eqIfPresent(CustomEntity::getEnrollStatus, qo.getEnrollStatus()) - .orderByDesc(CustomEntity::getCreateTime); + .eqIfPresent(CustomEntity::getEnrollStatus, qo.getEnrollStatus()); + if (StringUtils.isNotBlank(qo.getDistributeStartTime()) && StringUtils.isNotBlank(qo.getDistributeEndTime())) { + wrapperX.between(CustomEntity::getDistributeTime, qo.getDistributeStartTime(), qo.getDistributeEndTime()); + } if (StringUtils.isNotBlank(qo.getStartTime()) && StringUtils.isNotBlank(qo.getEndTime())) { wrapperX.between(CustomEntity::getCreateTime, qo.getStartTime(), qo.getEndTime()); } - this.selectByPage(page, wrapperX); + this.selectByPage(page, wrapperX, qo.getStoreId()); return new PageResult<>(page.getRecords(), page.getTotal()); } - IPage selectByPage(IPage page, @Param(Constants.WRAPPER) Wrapper wrapper); + IPage selectByPage(IPage page, @Param(Constants.WRAPPER) Wrapper wrapper, @Param("storeId") Long storeId); /** diff --git a/admin/src/main/java/com/baiye/modules/distribute/qo/CustomQo.java b/admin/src/main/java/com/baiye/modules/distribute/qo/CustomQo.java index 0048264..e532037 100644 --- a/admin/src/main/java/com/baiye/modules/distribute/qo/CustomQo.java +++ b/admin/src/main/java/com/baiye/modules/distribute/qo/CustomQo.java @@ -28,10 +28,23 @@ public class CustomQo { @Parameter(description = "结束时间") private String endTime; + @Parameter(description = "分发开始时间") + private String distributeStartTime; + + @Parameter(description = "分发结束时间") + private String distributeEndTime; + @Parameter(description = "公司id") private Long companyId; @Schema(title = "审核类型 1录入员 2初审 3复审") private Integer salesmanType; + @Schema(title = "编号") + private String batchNo; + + + @Schema(title = "门店id") + private Long storeId; + } diff --git a/admin/src/main/java/com/baiye/modules/distribute/service/impl/CustomServiceImpl.java b/admin/src/main/java/com/baiye/modules/distribute/service/impl/CustomServiceImpl.java index 0979482..24e06fa 100644 --- a/admin/src/main/java/com/baiye/modules/distribute/service/impl/CustomServiceImpl.java +++ b/admin/src/main/java/com/baiye/modules/distribute/service/impl/CustomServiceImpl.java @@ -111,7 +111,7 @@ public class CustomServiceImpl extends ExtendServiceImpl 0){ + if (ObjectUtil.isNotNull(userId) && userId > 0) { ClueDTO clueDTO = ClueDTO.builder().originName(ClueSourceEnum.STORE_DISTRIBUTION.getDescription()).nid (AESUtils.encrypt(customEntity.getCustomNid(), securityProperties.getPasswordSecretKey())).assignedBy (userId).createBy(customEntity.getCompanyId()).assignedName(store.getStoreName()).otherClue(otherClue).build(); list.add(clueDTO); } } - clueService.saveClueListByStoreInfo(list); - customEntity.setEnrollStatus(2); - return SqlHelper.retBool(baseMapper.updateById(customEntity)); + if (CollUtil.isNotEmpty(list)) { + customEntity.setEnrollStatus(2); + clueService.saveClueListByStoreInfo(list); + customEntity.setDistributeTime(DateUtil.date()); + return SqlHelper.retBool(baseMapper.updateById(customEntity)); + } } } return Boolean.FALSE; diff --git a/admin/src/main/java/com/baiye/modules/distribute/vo/CustomVO.java b/admin/src/main/java/com/baiye/modules/distribute/vo/CustomVO.java index 6929787..c7b5e55 100644 --- a/admin/src/main/java/com/baiye/modules/distribute/vo/CustomVO.java +++ b/admin/src/main/java/com/baiye/modules/distribute/vo/CustomVO.java @@ -16,6 +16,9 @@ public class CustomVO { @Schema(title = "ID") private Long customId; + @Schema(title = "门店名称") + private String storeName; + @Schema(title = "客户名称") private String customName; diff --git a/admin/src/main/resources/mapper/CustomMapper.xml b/admin/src/main/resources/mapper/CustomMapper.xml index 6611dc8..703b133 100644 --- a/admin/src/main/resources/mapper/CustomMapper.xml +++ b/admin/src/main/resources/mapper/CustomMapper.xml @@ -2,6 +2,7 @@ + s.store_name, cm.custom_id, cm.custom_name, cm.custom_nid, @@ -19,8 +20,13 @@ SELECT FROM - tb_custom cm + tb_custom cm JOIN tb_custom_store s on cm.custom_id = s. custom_id + ${ew.customSqlSegment} + + and s.store_id = #{storeId,jdbcType=BIGINT} + + order by cm.create_time desc