资源排序
This commit is contained in:
@ -22,6 +22,7 @@ import com.sa.zentao.service.*;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.sa.zentao.utils.BeanCopyUtil;
|
import com.sa.zentao.utils.BeanCopyUtil;
|
||||||
import com.sa.zentao.utils.SendEmail;
|
import com.sa.zentao.utils.SendEmail;
|
||||||
|
import com.sa.zentao.utils.VxMessageUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@ -73,7 +74,11 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IZtStoryUserspecService storyUserspecService;
|
private IZtStoryUserspecService storyUserspecService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IZtStoryUserTaskService storyUserTaskService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private VxService vxService;
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void addStory(ZtStoryUserDTO dto) {
|
public void addStory(ZtStoryUserDTO dto) {
|
||||||
@ -249,11 +254,8 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
String[] split = qo.getIds().split(",");
|
String[] split = qo.getIds().split(",");
|
||||||
qo.setStoryIds(new ArrayList<>(Arrays.asList(split)));
|
qo.setStoryIds(new ArrayList<>(Arrays.asList(split)));
|
||||||
}
|
}
|
||||||
long l = System.currentTimeMillis();
|
|
||||||
|
|
||||||
List<Integer> pIds = this.projectService.authProductList();
|
List<Integer> pIds = this.projectService.authProductList();
|
||||||
long l2 = System.currentTimeMillis();
|
|
||||||
log.info("耗时---------------------------------- {}",l2-l);
|
|
||||||
if(CollectionUtils.isEmpty(pIds)&&CollectionUtils.isEmpty(qo.getStoryIds())){
|
if(CollectionUtils.isEmpty(pIds)&&CollectionUtils.isEmpty(qo.getStoryIds())){
|
||||||
return new PageInfo<ZtStoryUserDTO>();
|
return new PageInfo<ZtStoryUserDTO>();
|
||||||
}
|
}
|
||||||
@ -263,26 +265,17 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
qo.setProductIds(pIds);
|
qo.setProductIds(pIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
l = System.currentTimeMillis();
|
|
||||||
Page<ZtStoryUserDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
Page<ZtStoryUserDTO> page = PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
|
||||||
List<ZtStoryUserDTO> list = this.baseMapper.pageList(qo);
|
List<ZtStoryUserDTO> list = this.baseMapper.pageList(qo);
|
||||||
l2 = System.currentTimeMillis();
|
|
||||||
log.info("耗时----------------------------------2222 {}",l2-l);
|
|
||||||
if (!CollectionUtils.isEmpty(list)) {
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
|
|
||||||
|
|
||||||
List<String> userIds = list.stream().map(o -> o.getOpenedby()).collect(Collectors.toList());
|
List<String> userIds = list.stream().map(o -> o.getOpenedby()).collect(Collectors.toList());
|
||||||
userIds.addAll(list.stream().map(o -> o.getLasteditedby()).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);
|
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);
|
Map<Integer, List<ZtStory>> storyUserMap = getStoryUserMap(list);
|
||||||
l2 = System.currentTimeMillis();
|
|
||||||
log.info("耗时---------------------------------- {}",l2-l);
|
|
||||||
Map<Integer, List<ZtStoryreviewDTO>> rMap = getReviewMap(list);
|
Map<Integer, List<ZtStoryreviewDTO>> rMap = getReviewMap(list);
|
||||||
for (ZtStoryUserDTO d : list) {
|
for (ZtStoryUserDTO d : list) {
|
||||||
|
|
||||||
@ -630,8 +623,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
return released;
|
return released;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IZtStoryUserTaskService storyUserTaskService;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void changeStatus(Integer id, UserStoryEnums status) {
|
public void changeStatus(Integer id, UserStoryEnums status) {
|
||||||
@ -651,10 +643,21 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
return;
|
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.setStatus(status.getCode());
|
||||||
storyUser.setLasteditedby(RiskUserThreadLocal.get().getName());
|
storyUser.setLasteditedby(RiskUserThreadLocal.get().getName());
|
||||||
storyUser.setLastediteddate(new Date());
|
storyUser.setLastediteddate(new Date());
|
||||||
@ -727,6 +730,11 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
storyUser.setLastediteddate(new Date());
|
storyUser.setLastediteddate(new Date());
|
||||||
|
|
||||||
this.baseMapper.updateById(storyUser);
|
this.baseMapper.updateById(storyUser);
|
||||||
|
|
||||||
|
if(status==UserStoryEnums.CPYSJ){
|
||||||
|
//发送消息
|
||||||
|
}
|
||||||
|
|
||||||
actionService.addAction(ActionType.USERXQ, ActionStatus.ZTBG, id, storyUser.getProduct() + "", null, null,
|
actionService.addAction(ActionType.USERXQ, ActionStatus.ZTBG, id, storyUser.getProduct() + "", null, null,
|
||||||
RiskUserThreadLocal.get().getName(), userStoryEnums == null ? "" : userStoryEnums.getValue() + " 变更 " + status.getValue(), "");
|
RiskUserThreadLocal.get().getName(), userStoryEnums == null ? "" : userStoryEnums.getValue() + " 变更 " + status.getValue(), "");
|
||||||
}
|
}
|
||||||
@ -744,6 +752,7 @@ public class ZtStoryUserServiceImpl extends ServiceImpl<ZtStoryUserMapper, ZtSto
|
|||||||
storyUser.setDeliverRemark(dto.getDeliverRemark());
|
storyUser.setDeliverRemark(dto.getDeliverRemark());
|
||||||
this.baseMapper.updateById(storyUser);
|
this.baseMapper.updateById(storyUser);
|
||||||
this.changeStatus(dto.getId(), UserStoryEnums.DQR);
|
this.changeStatus(dto.getId(), UserStoryEnums.DQR);
|
||||||
|
|
||||||
actionService.addAction(ActionType.USERXQ, ActionStatus.MQXU, storyUser.getId(), storyUser.getProduct() + "", null, null,
|
actionService.addAction(ActionType.USERXQ, ActionStatus.MQXU, storyUser.getId(), storyUser.getProduct() + "", null, null,
|
||||||
RiskUserThreadLocal.get().getName(), dto.getDeliverRemark(), "");
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
<if test=" qo.house != null and qo.house != ''">
|
<if test=" qo.house != null and qo.house != ''">
|
||||||
and house = #{qo.house}
|
and house = #{qo.house}
|
||||||
</if>
|
</if>
|
||||||
|
order by id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Reference in New Issue
Block a user