package com.idea.oa.flow2.service; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.idea.oa.flow2.mapper.FlowMainPushExtendMapper; import com.idea.oa.flow2.mapper.FlowMainPushMapper; import com.idea.oa.flow2.model.FlowMainPush; import com.idea.oa.flow2.model.FlowMainPushExample; import com.idea.oa.flow2.model.out.FlowMainPushOut; import com.rockstar.common.base.BaseService; import com.rockstar.common.support.Convert; import com.rockstar.frame.model.extend.DateTrans; import com.rockstar.frame.model.extend.Tablepar; import com.rockstar.util.UUIDUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Date; import java.util.List; @Service public class FlowMainPushService implements BaseService { //文件mapper @Autowired private FlowMainPushMapper modelMapper; @Autowired private FlowMainPushExtendMapper flowMainPushExtendMapper; /** * 分页查询 * * @return */ public PageInfo list(Tablepar tablepar, FlowMainPush model, DateTrans dt) { PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize()); List list = null;//modelMapper.selectByExample(getCondition(model,dt)); PageInfo pageInfo = new PageInfo<>(list); return pageInfo; } public Object listAll(FlowMainPush model, DateTrans dt) { List list = null;//modelMapper.selectByExample(getCondition(model,dt)); return list; } @Override public int deleteByPrimaryKey(String ids) { List lista = Convert.toListStrArray(ids); FlowMainPushExample example = new FlowMainPushExample(); example.createCriteria().andIdIn(lista); return modelMapper.deleteByExample(example); } @Override public FlowMainPush selectByPrimaryKey(String id) { return modelMapper.selectByPrimaryKey(id); } @Override public int updateByPrimaryKeySelective(FlowMainPush record) { return modelMapper.updateByPrimaryKeySelective(record); } @Override public int updateByExampleSelective(FlowMainPush record, FlowMainPushExample example) { return modelMapper.updateByExampleSelective(record, example); } @Override public int updateByExample(FlowMainPush record, FlowMainPushExample example) { return modelMapper.updateByExample(record, example); } @Override public List selectByExample(FlowMainPushExample example) { return modelMapper.selectByExample(example); } @Override public long countByExample(FlowMainPushExample example) { return modelMapper.countByExample(example); } @Override public int deleteByExample(FlowMainPushExample example) { return modelMapper.deleteByExample(example); } public int insert(FlowMainPush record){ record.setId(UUIDUtils.middleUUID()); return insertWithoutId(record); } public int insertWithoutId(FlowMainPush record){ record.setCreatedAt(new Date()); return modelMapper.insert(record); } @Override public int insertSelective(FlowMainPush record) { record.setId(UUIDUtils.middleUUID()); record.setCreatedAt(new Date()); return modelMapper.insertSelective(record); } /** * 将推送人改成 ,2他人已完成审核本审核人进行隐藏 * @param userId * @param upMainLogId * @param flowMainPushId */ public void updateStatusTwoByUpMainLogId(String userId,String upMainLogId,String flowMainPushId) { flowMainPushExtendMapper.updateStatusTwoByUpMainLogId(userId,upMainLogId,flowMainPushId); } /** * 将推送人改成 ,3申请人撤回申请进行隐藏 * @param userId * @param flowMainId */ public void updateStatusThreeByFlowMainId(String userId, String flowMainId) { flowMainPushExtendMapper.updateStatusThreeByFlowMainId(userId, flowMainId); } public List findPushInfoByFlowMainId(String flowMainid) { return flowMainPushExtendMapper.findPushInfoByFlowMainId(flowMainid); } /** * 根据主表id获取推送表信息 * @param flowMainid * @return */ public List findPushByFlowMainId(String flowMainid) { return flowMainPushExtendMapper.findPushByFlowMainId(flowMainid); } }