123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- package com.idea.oa.apply.service;
- import com.github.pagehelper.PageHelper;
- import com.github.pagehelper.PageInfo;
- import com.idea.oa.apply.mapper.ApplyExtendMapper;
- import com.idea.oa.apply.mapper.ApplyPaymentExtendMapper;
- import com.idea.oa.apply.mapper.ApplyPaymentMapper;
- import com.idea.oa.apply.model.ApplyPayment;
- import com.idea.oa.apply.model.ApplyPaymentExample;
- import com.idea.oa.apply.model.inout.ApplyPaymentIn;
- import com.idea.oa.outsource.model.OutOrderPay;
- import com.rockstar.common.base.BaseService;
- import com.rockstar.common.support.Convert;
- import com.rockstar.frame.model.FrameData;
- import com.rockstar.frame.model.extend.DateTrans;
- import com.rockstar.frame.model.extend.Tablepar;
- import com.rockstar.frame.service.FrameDataService;
- import com.rockstar.util.UUIDUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import java.util.*;
- @Service
- public class ApplyPaymentService implements BaseService<ApplyPayment, ApplyPaymentExample> {
- //文件mapper
- @Autowired
- private ApplyPaymentMapper modelMapper;
- @Autowired
- private ApplyPaymentExtendMapper applyPaymentExtendMapper;
- @Autowired
- private ApplyExtendMapper applyExtendMapper;
- /**
- * 分页查询
- *
- * @return
- */
- public PageInfo<ApplyPayment> list(Tablepar tablepar, ApplyPayment model, DateTrans dt) {
- PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
- List<ApplyPayment> list = null;//modelMapper.selectByExample(getCondition(model,dt));
- PageInfo<ApplyPayment> pageInfo = new PageInfo<>(list);
- return pageInfo;
- }
- public Object listAll(ApplyPayment model, DateTrans dt) {
- List<ApplyPayment> list = null;//modelMapper.selectByExample(getCondition(model,dt));
- return list;
- }
- @Override
- public int deleteByPrimaryKey(String ids) {
- List<String> lista = Convert.toListStrArray(ids);
- ApplyPaymentExample example = new ApplyPaymentExample();
- example.createCriteria().andIdIn(lista);
- return modelMapper.deleteByExample(example);
- }
- @Override
- public ApplyPayment selectByPrimaryKey(String id) {
- return modelMapper.selectByPrimaryKey(id);
- }
- @Override
- public int updateByPrimaryKeySelective(ApplyPayment record) {
- return modelMapper.updateByPrimaryKeySelective(record);
- }
- @Override
- public int updateByExampleSelective(ApplyPayment record, ApplyPaymentExample example) {
- return modelMapper.updateByExampleSelective(record, example);
- }
- @Override
- public int updateByExample(ApplyPayment record, ApplyPaymentExample example) {
- return modelMapper.updateByExample(record, example);
- }
- @Override
- public List<ApplyPayment> selectByExample(ApplyPaymentExample example) {
- return modelMapper.selectByExample(example);
- }
- @Override
- public long countByExample(ApplyPaymentExample example) {
- return modelMapper.countByExample(example);
- }
- @Override
- public int deleteByExample(ApplyPaymentExample example) {
- return modelMapper.deleteByExample(example);
- }
- public int insert(ApplyPayment record) {
- record.setId(UUIDUtils.middleUUID());
- return insertWithoutId(record);
- }
- public int insertWithoutId(ApplyPayment record) {
- return modelMapper.insert(record);
- }
- @Override
- public int insertSelective(ApplyPayment record) {
- record.setId(UUIDUtils.middleUUID());
- record.setCreatedAt(new Date());
- return modelMapper.insertSelective(record);
- }
- public ApplyPaymentIn getInfoByFlowMainPushId(String flowMainPushId) {
- return applyPaymentExtendMapper.getInfoByFlowMainPushId(flowMainPushId);
- }
- public ApplyPaymentIn getInfoByFlowMainId(String flowMainId) {
- return applyPaymentExtendMapper.getInfoByFlowMainId(flowMainId);
- }
- public Double getTotalMoneyByProId(String proId) {
- return applyPaymentExtendMapper.getTotalMoneyByProId(proId);
- }
- public Double getTotalPayMoneyByProId(String proId) {
- return applyPaymentExtendMapper.getTotalPayMoneyByProId(proId);
- }
- public Double getTotalPayMoneyByOrderNo(String orderNo) {
- return applyPaymentExtendMapper.getTotalPayMoneyByOrderNo(orderNo);
- }
- public OutOrderPay getApplyPaymentByFlowMainId(String flowMainId) {
- return applyPaymentExtendMapper.getApplyPaymentByFlowMainId(flowMainId);
- }
- @Autowired
- private FrameDataService frameDataService;
- public PageInfo<Map> findApplyPaymentListByInfo(Tablepar tablepar, String name, String startTime, String endTime) {
- PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
- List<Map> list = applyExtendMapper.findApplyPaymentListByInfo(name, startTime, endTime);
- for (Map map : list) {
- if (map.get("file_data_ids") != null) {
- List<Map<String, String>> fileList = new ArrayList<>();
- Map<String, String> stringStringHashMap=null;
- String[] file_data_ids = map.get("file_data_ids").toString().split(",");
- for (String file_data_id : file_data_ids) {
- stringStringHashMap = new HashMap<>();
- FrameData frameData = frameDataService.selectByPrimaryKey(file_data_id);
- stringStringHashMap.put("id",file_data_id);
- stringStringHashMap.put("fileName",frameData!=null?frameData.getFileName():null);
- fileList.add(stringStringHashMap);
- }
- map.put("file_data_ids",fileList);
- }
- }
- PageInfo<Map> pageInfo = new PageInfo<>(list);
- return pageInfo;
- }
- public List<Map> findAllApplyPaymentListByInfo(String name, String startTime, String endTime) {
- List<Map> list = applyExtendMapper.findApplyPaymentListByInfo(name, startTime, endTime);
- for (Map map : list) {
- if (map.get("file_data_ids") != null) {
- List<Map<String, String>> fileList = new ArrayList<>();
- Map<String, String> stringStringHashMap=null;
- String[] file_data_ids = map.get("file_data_ids").toString().split(",");
- for (String file_data_id : file_data_ids) {
- stringStringHashMap = new HashMap<>();
- FrameData frameData = frameDataService.selectByPrimaryKey(file_data_id);
- stringStringHashMap.put("id",file_data_id);
- stringStringHashMap.put("fileName",frameData!=null?frameData.getFileName():null);
- fileList.add(stringStringHashMap);
- }
- map.put("file_data_ids",fileList);
- }
- }
- return list;
- }
- }
|