资源排序

This commit is contained in:
2025-06-04 14:01:31 +08:00
parent 57d784aba7
commit 05e3eb52e2
2 changed files with 39 additions and 18 deletions

View File

@ -22,6 +22,7 @@ import com.sa.zentao.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sa.zentao.utils.BeanCopyUtil;
import com.sa.zentao.utils.SendEmail;
import com.sa.zentao.utils.VxMessageUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
@ -73,7 +74,11 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
@Autowired
private IZtStoryUserspecService storyUserspecService;
@Autowired
private IZtStoryUserTaskService storyUserTaskService;
@Autowired
private VxService vxService;
@Override
@Transactional
public void addStory(ZtStoryUserDTO dto) {
@ -249,11 +254,8 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
String[] split = qo.getIds().split(",");
qo.setStoryIds(new ArrayList<>(Arrays.asList(split)));
}
long l = System.currentTimeMillis();
List<Integer> pIds = this.projectService.authProductList();
long l2 = System.currentTimeMillis();
log.info("耗时---------------------------------- {}",l2-l);
if(CollectionUtils.isEmpty(pIds)&&CollectionUtils.isEmpty(qo.getStoryIds())){
return new PageInfo<ZtStoryUserDTO>();
}
@ -263,26 +265,17 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
qo.setProductIds(pIds);
}
l = System.currentTimeMillis();
Page<ZtStoryUserDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
List<ZtStoryUserDTO> list = this.baseMapper.pageList(qo);
l2 = System.currentTimeMillis();
log.info("耗时----------------------------------2222 {}",l2-l);
if (!CollectionUtils.isEmpty(list)) {
List<String> userIds = list.stream().map(o -> o.getOpenedby()).collect(Collectors.toList());
userIds.addAll(list.stream().map(o -> o.getLasteditedby()).collect(Collectors.toList()));
l = System.currentTimeMillis();
Map<String, ZtUser> userMap = this.userService.userMapByIds(null);
l2 = System.currentTimeMillis();
log.info("耗时---------------------------------- {}",l2-l);
l = System.currentTimeMillis();
Map<Integer, List<ZtStory>> storyUserMap = getStoryUserMap(list);
l2 = System.currentTimeMillis();
log.info("耗时---------------------------------- {}",l2-l);
Map<Integer, List<ZtStoryreviewDTO>> rMap = getReviewMap(list);
for (ZtStoryUserDTO d : list) {
@ -630,8 +623,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
return released;
}
@Autowired
private IZtStoryUserTaskService storyUserTaskService;
@Override
public void changeStatus(Integer id, UserStoryEnums status) {
@ -651,10 +643,21 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
return;
}
}
if (UserStoryEnums.CFM == status) {
//需求已确认
}
if (UserStoryEnums.CPYSJ == status) {
ZtProduct ztProduct = this.productService.getById(storyUser.getProduct());
//需求已确认
this.sendDesigndoneMessage(storyUser.getId(),ztProduct.getPo());
}
if (UserStoryEnums.DQR == status) {
//提交交付物发送给创建人
this.sendSubmitMessage(storyUser.getId(),storyUser.getOpenedby());
}
if (UserStoryEnums.CFM == status&&oldStatus.equals("storyunconfirmed")) {
ZtProduct ztProduct = this.productService.getById(storyUser.getProduct());
//交付物确认
this.sendConfirmMessage(storyUser.getId(),ztProduct.getPo());
}
storyUser.setStatus(status.getCode());
storyUser.setLasteditedby(RiskUserThreadLocal.get().getName());
storyUser.setLastediteddate(new Date());
@ -727,6 +730,11 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
storyUser.setLastediteddate(new Date());
this.baseMapper.updateById(storyUser);
if(status==UserStoryEnums.CPYSJ){
//发送消息
}
actionService.addAction(ActionType.USERXQ, ActionStatus.ZTBG, id, storyUser.getProduct() + "", null, null,
RiskUserThreadLocal.get().getName(), userStoryEnums == null ? "" : userStoryEnums.getValue() + " 变更 " + status.getValue(), "");
}
@ -744,6 +752,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
storyUser.setDeliverRemark(dto.getDeliverRemark());
this.baseMapper.updateById(storyUser);
this.changeStatus(dto.getId(), UserStoryEnums.DQR);
actionService.addAction(ActionType.USERXQ, ActionStatus.MQXU, storyUser.getId(), storyUser.getProduct() + "", null, null,
RiskUserThreadLocal.get().getName(), dto.getDeliverRemark(), "");
}
@ -817,4 +826,16 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
}
}
//发送消息给微信 产品已经设计
private void sendDesigndoneMessage(Integer id,String account) {
this.vxService.sendMessageToVx(account, VxMessageUtils.storyUserMessage.designdoneMessage(id),new Date());
}
//发送消息给微信 提交交付物
private void sendSubmitMessage(Integer id,String account) {
this.vxService.sendMessageToVx(account, VxMessageUtils.storyUserMessage.submitMessage(id),new Date());
}
//确认交付物
private void sendConfirmMessage(Integer id,String account) {
this.vxService.sendMessageToVx(account, VxMessageUtils.storyUserMessage.sendConfirmMessage(id),new Date());
}
}

View File

@ -60,7 +60,7 @@
<if test=" qo.house != null and qo.house != ''">
and house = #{qo.house}
</if>
order by id desc
</select>
</mapper>