|
@@ -2,14 +2,30 @@ package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.dal.dao.CooperationOrganDao;
|
|
|
+import com.ym.mec.biz.dal.dto.ReplacementInstrumentActivityStatDto;
|
|
|
+import com.ym.mec.biz.dal.dto.ReplacementInstrumentActivityStatHead;
|
|
|
+import com.ym.mec.biz.dal.entity.CooperationOrgan;
|
|
|
+import com.ym.mec.biz.dal.page.ReplacementInstrumentActivityQueryInfo;
|
|
|
+import com.ym.mec.biz.dal.page.ReplacementInstrumentQueryInfo;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
+import com.ym.mec.common.page.PageInfo;
|
|
|
+import com.ym.mec.common.page.QueryInfo;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
+import com.ym.mec.util.collection.MapUtil;
|
|
|
+import org.apache.poi.ss.formula.functions.T;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import com.ym.mec.biz.dal.entity.ReplacementInstrumentActivity;
|
|
|
import com.ym.mec.biz.service.ReplacementInstrumentActivityService;
|
|
|
import com.ym.mec.biz.dal.dao.ReplacementInstrumentActivityDao;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Service
|
|
|
public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<Integer, ReplacementInstrumentActivity> implements ReplacementInstrumentActivityService {
|
|
@@ -18,6 +34,8 @@ public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<In
|
|
|
private ReplacementInstrumentActivityDao replacementInstrumentActivityDao;
|
|
|
@Autowired
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
+ @Autowired
|
|
|
+ private CooperationOrganDao cooperationOrganDao;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Integer, ReplacementInstrumentActivity> getDAO() {
|
|
@@ -48,4 +66,29 @@ public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<In
|
|
|
public ReplacementInstrumentActivity findByUserId(Integer userId) {
|
|
|
return replacementInstrumentActivityDao.findByUserId(userId);
|
|
|
}
|
|
|
-}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageInfo<ReplacementInstrumentActivityStatDto> queryReplacementsStat(ReplacementInstrumentActivityQueryInfo queryInfo) {
|
|
|
+ PageInfo<ReplacementInstrumentActivityStatDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+
|
|
|
+ int count = replacementInstrumentActivityDao.countReplacements(params);
|
|
|
+
|
|
|
+ if(queryInfo.getPage()==1){
|
|
|
+ ReplacementInstrumentActivityStatHead head = replacementInstrumentActivityDao.countReplacementsInfo(queryInfo.getCooperationOrganId());
|
|
|
+ CooperationOrgan cooperationOrgan = cooperationOrganDao.get(queryInfo.getCooperationOrganId());
|
|
|
+ head.setCooperationOrganName(cooperationOrgan.getName());
|
|
|
+ pageInfo.setStatInfo(head);
|
|
|
+ }
|
|
|
+
|
|
|
+ pageInfo.setTotal(count);
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
+ List<ReplacementInstrumentActivityStatDto> dataList = replacementInstrumentActivityDao.queryReplacements(params);
|
|
|
+ if (!CollectionUtils.isEmpty(dataList)) {
|
|
|
+
|
|
|
+ }
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
+}
|