修改代码bug增加业务逻辑

master
bynt 10 months ago
parent 722a09b369
commit d681195c43

@ -46,7 +46,7 @@ public class PushLinkController {
}
@GetMapping("/update")
@PostMapping("/update")
@Operation(summary = "修改链接", description = "修改链接")
public R<Object> update(@Validated({UpdateGroup.class}) @RequestBody PushLinkDTO pushLinkDTO) {
return pushLinkService.update(pushLinkDTO) ? R.ok() : R.failed(BaseResultCode.UPDATE_DATABASE_ERROR, "修改失败");

@ -23,7 +23,7 @@ public class PushLinkDTO {
private String appKey;
@Schema(title = "业务方、公司 用户ID")
private Long userId;
private Long companyId;
@Schema(title = "渠道标识")
private List<String> channelIdentifyingList;
@ -37,4 +37,8 @@ public class PushLinkDTO {
@Schema(title = "状态(1-启用接收,0-拒绝接收)")
private Integer status;
@Schema(title = "创建人")
private Long createBy;
}

@ -1,27 +1,24 @@
package com.baiye.modules.distribute.dto;
import com.baiye.validation.group.CreateGroup;
import com.baiye.validation.group.UpdateGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
public class ReadFileDTO {
@Schema(title = "记录ID")
@NotNull(message = "记录ID不能为空", groups = { CreateGroup.class })
private Long recordId;
@Schema(title = "渠道名称")
@NotBlank(message = "渠道名称不能为空", groups = { CreateGroup.class })
@NotBlank(message = "渠道名称不能为空", groups = {CreateGroup.class})
private String channelName;
@Schema(title = "分发人用户ID集合")
@NotEmpty(message = "用户不能为空", groups = { CreateGroup.class })
@NotEmpty(message = "用户不能为空", groups = {CreateGroup.class})
private List<Long> distributorsUserIdList;
}

@ -62,6 +62,7 @@ public interface ClueMapper extends ExtendMapper<ClueEntity> {
.eqIfPresent(ClueEntity::getCreateBy, qo.getCreateBy())
.likeIfPresent(ClueEntity::getClueLabelName, qo.getClueLabelName())
.eqIfPresent(ClueEntity::getAssignedBy, qo.getAssignedBy())
.eqIfPresent(ClueEntity::getCompanyId, qo.getCompanyId())
.orderByDesc(ClueEntity::getCreateTime);
if (StringUtils.isNotBlank(qo.getStartTime()) && StringUtils.isNotBlank(qo.getEndTime())) {

@ -43,6 +43,7 @@ public interface CustomMapper extends ExtendMapper<CustomEntity> {
* @return LambdaQueryWrapperX
*/
default Wrapper<CustomEntity> buildQueryWrapper(CustomQo qo) {
LambdaAliasQueryWrapperX<CustomEntity> wrapperX = WrappersX.lambdaAliasQueryX(CustomEntity.class);
wrapperX.eqIfPresent(CustomEntity::getCreateBy, qo.getCreateBy())
.likeIfPresent(CustomEntity::getRemark, qo.getRemark())
@ -65,14 +66,12 @@ public interface CustomMapper extends ExtendMapper<CustomEntity> {
}
default List<CustomEntity> queryList(CustomQo customQo){
Wrapper<CustomEntity> wrapperX = buildQueryWrapper(customQo);
return this.selectList(wrapperX);
}
List<HomePageDTO> selectByCompanyIdAndTime(@Param("qo") HomePageQo homePageQo);
List<Integer> addCount(@Param("date") String date, @Param("companyId") Long companyId);

@ -19,6 +19,9 @@ public class ClueQo {
@Parameter(description = "结束时间")
private String endTime;
@Parameter(description = "结束时间")
private Long companyId;
@Parameter(description = "创建人")
private Long createBy;

@ -207,7 +207,7 @@ public class ClueServiceImpl extends ExtendServiceImpl<ClueMapper, ClueEntity> i
@Override
public List<ClueVO> queryList(ClueQo qo) {
qo.setCreateBy(SecurityUtils.getCurrentUserId());
qo.setCompanyId(SecurityUtils.getCurrentUserId());
// 扩展数据
if (qo.getNid() != null) {
qo.setNid(AESUtils.encrypt(qo.getNid(), securityProperties.getPasswordSecretKey()));

@ -90,15 +90,13 @@ public class PushLinkServiceImpl extends ExtendServiceImpl<PushLinkMapper, PushL
@Transactional(rollbackFor = Exception.class)
public boolean update(PushLinkDTO pushLinkDTO) {
PushLinkEntity pushLinkEntity = PushLinkConverter.INSTANCE.dtoToPo(pushLinkDTO);
/*if (CollUtil.isNotEmpty(pushLinkDTO.getChannelIdentifyingList())) {
pushLinkEntity.setChannelIdentifying(JSONUtil.toJsonStr(pushLinkDTO.getChannelIdentifyingList()));
}*/
// 修改飞鱼状态
if (ObjectUtil.isNotNull(pushLinkDTO.getChannelType())
&& pushLinkDTO.getChannelType() == DefaultNumberConstants.ONE_NUMBER) {
OceanEngineToken byUserId = oceanEngineService.findByUserId(pushLinkDTO.getUserId());
OceanEngineToken byUserId = oceanEngineService.findByUserId(pushLinkDTO.getCreateBy());
if (ObjectUtil.isNotNull(byUserId) && !byUserId.getStatus().equals(pushLinkDTO.getStatus())){
oceanEngineService.updateAuthorizationStatusByUserId(byUserId.getId(), pushLinkDTO.getUserId(), pushLinkDTO.getStatus());
oceanEngineService.updateAuthorizationStatusByUserId(byUserId.getId(), pushLinkDTO.getCreateBy(), pushLinkDTO.getStatus());
}
}
return SqlHelper.retBool(baseMapper.updateById(pushLinkEntity));

@ -4,12 +4,10 @@ import cn.hutool.core.codec.Base64;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.baiye.constant.DefaultNumberConstants;
import com.baiye.enums.ClueSourceEnum;
import com.baiye.modules.distribute.dto.CallbackCustomDTO;
import com.baiye.modules.distribute.dto.ClueDTO;
import com.baiye.modules.distribute.dto.CreateCustomDTO;
import com.baiye.modules.distribute.dto.PushClueDTO;
import com.baiye.modules.distribute.entity.PushLinkEntity;
import com.baiye.modules.distribute.service.ClueService;
@ -34,9 +32,7 @@ import org.ballcat.security.properties.SecurityProperties;
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;

@ -1,5 +1,6 @@
package com.baiye.modules.distribute.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.baiye.modules.distribute.entity.ClueStageEntity;
import com.baiye.modules.distribute.entity.LabelOrganizeEntity;
import io.swagger.v3.oas.annotations.media.Schema;
@ -11,6 +12,7 @@ import java.util.List;
@Data
public class ClueVO {
@ExcelIgnore
@Schema(title = "线索ID")
private String clueId;
@ -26,6 +28,7 @@ public class ClueVO {
@Schema(title = "线索备注")
private String remark;
@ExcelIgnore
@Schema(title = "记录ID")
private Long clueRecordId;
@ -44,9 +47,11 @@ public class ClueVO {
@Schema(title = "创建时间")
private LocalDateTime createTime;
@ExcelIgnore
@Schema(title = "分配人用户名")
private String assignedName;
@ExcelIgnore
@Schema(title = "资源线索ID")
private Long clueStageId;
@ -56,12 +61,15 @@ public class ClueVO {
@Schema(title = "资源标签集合")
private List<String> clueLabelList;
@ExcelIgnore
@Schema(title = "资源线索ID")
private Boolean isNewClue;
@ExcelIgnore
@Schema(title = "标签组-标签信息")
List<LabelOrganizeEntity> organizeEntities;
@ExcelIgnore
@Schema(title = "阶段信息")
List<ClueStageEntity> clueStageEntities;

Loading…
Cancel
Save