修改查询条件

master
bynt 1 year ago
parent 7cedc0e1a3
commit 51111e6932

@ -12,6 +12,7 @@ import lombok.Setter;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date;
/** /**
* @author Enzo * @author Enzo
@ -75,6 +76,11 @@ public class CustomEntity extends BaseEntity {
@Schema(description = "录入员姓名") @Schema(description = "录入员姓名")
private String enterName; private String enterName;
@Schema(description = "分发时间")
private Date distributeTime;
} }

@ -21,20 +21,23 @@ public interface CustomMapper extends ExtendMapper<CustomEntity> {
LambdaAliasQueryWrapperX<CustomEntity> wrapperX = WrappersX.lambdaAliasQueryX(CustomEntity.class); LambdaAliasQueryWrapperX<CustomEntity> wrapperX = WrappersX.lambdaAliasQueryX(CustomEntity.class);
wrapperX.eqIfPresent(CustomEntity::getCreateBy, qo.getCreateBy()) wrapperX.eqIfPresent(CustomEntity::getCreateBy, qo.getCreateBy())
.likeIfPresent(CustomEntity::getCustomName, qo.getCustomName()) .likeIfPresent(CustomEntity::getCustomName, qo.getCustomName())
.likeIfPresent(CustomEntity::getBatchNo, qo.getBatchNo())
.eqIfPresent(CustomEntity::getCustomId,qo.getCompanyId()) .eqIfPresent(CustomEntity::getCustomId,qo.getCompanyId())
.eqIfPresent(CustomEntity::getType,qo.getSalesmanType()) .eqIfPresent(CustomEntity::getType,qo.getSalesmanType())
.eqIfPresent(CustomEntity::getCustomNid, qo.getCustomNid()) .eqIfPresent(CustomEntity::getCustomNid, qo.getCustomNid())
.eqIfPresent(CustomEntity::getEnrollStatus, qo.getEnrollStatus()) .eqIfPresent(CustomEntity::getEnrollStatus, qo.getEnrollStatus());
.orderByDesc(CustomEntity::getCreateTime); 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())) { if (StringUtils.isNotBlank(qo.getStartTime()) && StringUtils.isNotBlank(qo.getEndTime())) {
wrapperX.between(CustomEntity::getCreateTime, qo.getStartTime(), 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()); return new PageResult<>(page.getRecords(), page.getTotal());
} }
IPage<CustomVO> selectByPage(IPage<CustomVO> page, @Param(Constants.WRAPPER) Wrapper<CustomEntity> wrapper); IPage<CustomVO> selectByPage(IPage<CustomVO> page, @Param(Constants.WRAPPER) Wrapper<CustomEntity> wrapper, @Param("storeId") Long storeId);
/** /**

@ -28,10 +28,23 @@ public class CustomQo {
@Parameter(description = "结束时间") @Parameter(description = "结束时间")
private String endTime; private String endTime;
@Parameter(description = "分发开始时间")
private String distributeStartTime;
@Parameter(description = "分发结束时间")
private String distributeEndTime;
@Parameter(description = "公司id") @Parameter(description = "公司id")
private Long companyId; private Long companyId;
@Schema(title = "审核类型 1录入员 2初审 3复审") @Schema(title = "审核类型 1录入员 2初审 3复审")
private Integer salesmanType; private Integer salesmanType;
@Schema(title = "编号")
private String batchNo;
@Schema(title = "门店id")
private Long storeId;
} }

@ -111,7 +111,7 @@ public class CustomServiceImpl extends ExtendServiceImpl<CustomMapper, CustomEnt
for (CustomStoreEntity customStore : customStores) { for (CustomStoreEntity customStore : customStores) {
CustomStoreVO customStoreVO = new CustomStoreVO(); CustomStoreVO customStoreVO = new CustomStoreVO();
BeanUtils.copyProperties(customStore, customStoreVO); BeanUtils.copyProperties(customStore, customStoreVO);
if (map.containsKey(customStoreVO.getStoreId())){ if (map.containsKey(customStoreVO.getStoreId())) {
customStoreVO.setStoreName(map.get(customStoreVO.getStoreId()).get(0).getStoreName()); customStoreVO.setStoreName(map.get(customStoreVO.getStoreId()).get(0).getStoreName());
} }
customStoreVOList.add(customStoreVO); customStoreVOList.add(customStoreVO);
@ -148,16 +148,19 @@ public class CustomServiceImpl extends ExtendServiceImpl<CustomMapper, CustomEnt
if (CollUtil.isNotEmpty(customStores)) { if (CollUtil.isNotEmpty(customStores)) {
for (CustomStoreEntity store : customStores) { for (CustomStoreEntity store : customStores) {
Long userId = storeUserService.findUserIdByStoreId(store.getStoreId()); Long userId = storeUserService.findUserIdByStoreId(store.getStoreId());
if (ObjectUtil.isNotNull(userId) && userId > 0){ if (ObjectUtil.isNotNull(userId) && userId > 0) {
ClueDTO clueDTO = ClueDTO.builder().originName(ClueSourceEnum.STORE_DISTRIBUTION.getDescription()).nid ClueDTO clueDTO = ClueDTO.builder().originName(ClueSourceEnum.STORE_DISTRIBUTION.getDescription()).nid
(AESUtils.encrypt(customEntity.getCustomNid(), securityProperties.getPasswordSecretKey())).assignedBy (AESUtils.encrypt(customEntity.getCustomNid(), securityProperties.getPasswordSecretKey())).assignedBy
(userId).createBy(customEntity.getCompanyId()).assignedName(store.getStoreName()).otherClue(otherClue).build(); (userId).createBy(customEntity.getCompanyId()).assignedName(store.getStoreName()).otherClue(otherClue).build();
list.add(clueDTO); list.add(clueDTO);
} }
} }
clueService.saveClueListByStoreInfo(list); if (CollUtil.isNotEmpty(list)) {
customEntity.setEnrollStatus(2); customEntity.setEnrollStatus(2);
return SqlHelper.retBool(baseMapper.updateById(customEntity)); clueService.saveClueListByStoreInfo(list);
customEntity.setDistributeTime(DateUtil.date());
return SqlHelper.retBool(baseMapper.updateById(customEntity));
}
} }
} }
return Boolean.FALSE; return Boolean.FALSE;

@ -16,6 +16,9 @@ public class CustomVO {
@Schema(title = "ID") @Schema(title = "ID")
private Long customId; private Long customId;
@Schema(title = "门店名称")
private String storeName;
@Schema(title = "客户名称") @Schema(title = "客户名称")
private String customName; private String customName;

@ -2,6 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.baiye.modules.distribute.mapper.CustomMapper"> <mapper namespace="com.baiye.modules.distribute.mapper.CustomMapper">
<sql id="Base_Alias_Column_List"> <sql id="Base_Alias_Column_List">
s.store_name,
cm.custom_id, cm.custom_id,
cm.custom_name, cm.custom_name,
cm.custom_nid, cm.custom_nid,
@ -19,8 +20,13 @@
SELECT SELECT
<include refid="Base_Alias_Column_List"/> <include refid="Base_Alias_Column_List"/>
FROM FROM
tb_custom cm tb_custom cm JOIN tb_custom_store s on cm.custom_id = s. custom_id
${ew.customSqlSegment} ${ew.customSqlSegment}
<if test="storeId != null">
and s.store_id = #{storeId,jdbcType=BIGINT}
</if>
order by cm.create_time desc
</select> </select>
<select id="selectMaxBatchNoByCompanyId" resultType="java.lang.String"> <select id="selectMaxBatchNoByCompanyId" resultType="java.lang.String">

Loading…
Cancel
Save