FlowMainPushService.java 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. package com.idea.oa.flow2.service;
  2. import com.github.pagehelper.PageHelper;
  3. import com.github.pagehelper.PageInfo;
  4. import com.idea.oa.flow2.mapper.FlowMainPushExtendMapper;
  5. import com.idea.oa.flow2.mapper.FlowMainPushMapper;
  6. import com.idea.oa.flow2.model.FlowMainPush;
  7. import com.idea.oa.flow2.model.FlowMainPushExample;
  8. import com.idea.oa.flow2.model.out.FlowMainPushOut;
  9. import com.rockstar.common.base.BaseService;
  10. import com.rockstar.common.support.Convert;
  11. import com.rockstar.frame.model.extend.DateTrans;
  12. import com.rockstar.frame.model.extend.Tablepar;
  13. import com.rockstar.util.UUIDUtils;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.stereotype.Service;
  16. import java.util.Date;
  17. import java.util.List;
  18. @Service
  19. public class FlowMainPushService implements BaseService<FlowMainPush, FlowMainPushExample> {
  20. //文件mapper
  21. @Autowired
  22. private FlowMainPushMapper modelMapper;
  23. @Autowired
  24. private FlowMainPushExtendMapper flowMainPushExtendMapper;
  25. /**
  26. * 分页查询
  27. *
  28. * @return
  29. */
  30. public PageInfo<FlowMainPush> list(Tablepar tablepar, FlowMainPush model, DateTrans dt) {
  31. PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
  32. List<FlowMainPush> list = null;//modelMapper.selectByExample(getCondition(model,dt));
  33. PageInfo<FlowMainPush> pageInfo = new PageInfo<>(list);
  34. return pageInfo;
  35. }
  36. public Object listAll(FlowMainPush model, DateTrans dt) {
  37. List<FlowMainPush> list = null;//modelMapper.selectByExample(getCondition(model,dt));
  38. return list;
  39. }
  40. @Override
  41. public int deleteByPrimaryKey(String ids) {
  42. List<String> lista = Convert.toListStrArray(ids);
  43. FlowMainPushExample example = new FlowMainPushExample();
  44. example.createCriteria().andIdIn(lista);
  45. return modelMapper.deleteByExample(example);
  46. }
  47. @Override
  48. public FlowMainPush selectByPrimaryKey(String id) {
  49. return modelMapper.selectByPrimaryKey(id);
  50. }
  51. @Override
  52. public int updateByPrimaryKeySelective(FlowMainPush record) {
  53. return modelMapper.updateByPrimaryKeySelective(record);
  54. }
  55. @Override
  56. public int updateByExampleSelective(FlowMainPush record, FlowMainPushExample example) {
  57. return modelMapper.updateByExampleSelective(record, example);
  58. }
  59. @Override
  60. public int updateByExample(FlowMainPush record, FlowMainPushExample example) {
  61. return modelMapper.updateByExample(record, example);
  62. }
  63. @Override
  64. public List<FlowMainPush> selectByExample(FlowMainPushExample example) {
  65. return modelMapper.selectByExample(example);
  66. }
  67. @Override
  68. public long countByExample(FlowMainPushExample example) {
  69. return modelMapper.countByExample(example);
  70. }
  71. @Override
  72. public int deleteByExample(FlowMainPushExample example) {
  73. return modelMapper.deleteByExample(example);
  74. }
  75. public int insert(FlowMainPush record){
  76. record.setId(UUIDUtils.middleUUID());
  77. return insertWithoutId(record);
  78. }
  79. public int insertWithoutId(FlowMainPush record){
  80. record.setCreatedAt(new Date());
  81. return modelMapper.insert(record);
  82. }
  83. @Override
  84. public int insertSelective(FlowMainPush record) {
  85. record.setId(UUIDUtils.middleUUID());
  86. record.setCreatedAt(new Date());
  87. return modelMapper.insertSelective(record);
  88. }
  89. /**
  90. * 将推送人改成 ,2他人已完成审核本审核人进行隐藏
  91. * @param userId
  92. * @param upMainLogId
  93. * @param flowMainPushId
  94. */
  95. public void updateStatusTwoByUpMainLogId(String userId,String upMainLogId,String flowMainPushId) {
  96. flowMainPushExtendMapper.updateStatusTwoByUpMainLogId(userId,upMainLogId,flowMainPushId);
  97. }
  98. /**
  99. * 将推送人改成 ,3申请人撤回申请进行隐藏
  100. * @param userId
  101. * @param flowMainId
  102. */
  103. public void updateStatusThreeByFlowMainId(String userId, String flowMainId) {
  104. flowMainPushExtendMapper.updateStatusThreeByFlowMainId(userId, flowMainId);
  105. }
  106. public List<FlowMainPushOut> findPushInfoByFlowMainId(String flowMainid) {
  107. return flowMainPushExtendMapper.findPushInfoByFlowMainId(flowMainid);
  108. }
  109. /**
  110. * 根据主表id获取推送表信息
  111. * @param flowMainid
  112. * @return
  113. */
  114. public List<FlowMainPush> findPushByFlowMainId(String flowMainid) {
  115. return flowMainPushExtendMapper.findPushByFlowMainId(flowMainid);
  116. }
  117. }