|
@@ -1,7 +1,11 @@
|
|
|
package com.ruoyi.warehouseBusiness.service.impl;
|
|
|
|
|
|
|
|
|
+import com.ruoyi.basicData.domain.TCorps;
|
|
|
+import com.ruoyi.basicData.mapper.TCorpsMapper;
|
|
|
+import com.ruoyi.basicData.mapper.TWarehouseMapper;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.core.domain.entity.TWarehouse;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.warehouseBusiness.domain.TEnclosure;
|
|
|
import com.ruoyi.warehouseBusiness.mapper.TEnclosureMapper;
|
|
@@ -9,7 +13,10 @@ import com.ruoyi.warehouseBusiness.service.ITEnclosureService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 附件Service业务层处理
|
|
@@ -22,6 +29,12 @@ public class TEnclosureServiceImpl implements ITEnclosureService {
|
|
|
@Autowired
|
|
|
private TEnclosureMapper tEnclosureMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TCorpsMapper tCorpsMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TWarehouseMapper tWarehouseMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 查询附件
|
|
|
*
|
|
@@ -101,4 +114,46 @@ public class TEnclosureServiceImpl implements ITEnclosureService {
|
|
|
return AjaxResult.success(tEnclosureMapper.selectTEnclosureByPId(fPid));
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<Map<String, Object>> expirationReminder() {
|
|
|
+ List<Map<String, Object>> mapList = new ArrayList<>();
|
|
|
+ List<TEnclosure> tEnclosureList = tEnclosureMapper.expirationReminder();
|
|
|
+ if (!tEnclosureList.isEmpty()) {
|
|
|
+ StringBuilder ids = new StringBuilder();
|
|
|
+ for (TEnclosure item : tEnclosureList) {
|
|
|
+ ids.append(item.getfPid()).append(",");
|
|
|
+ }
|
|
|
+ List<TCorps> tCorpsList = tCorpsMapper.selectTCorpsListByIds(ids.toString());
|
|
|
+ List<TWarehouse> tWarehouseList = tWarehouseMapper.selectTWarehouseListByIds(ids.toString());
|
|
|
+ for (TEnclosure item : tEnclosureList) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ if ("合同".equals(item.getfType())){
|
|
|
+ if (!tCorpsList.isEmpty()){
|
|
|
+ TCorps corps = tCorpsList.stream().filter(e-> e.getfId().equals(item.getfPid())).findFirst().orElse(null);
|
|
|
+ if (corps != null){
|
|
|
+ map.put("name",corps.getfCname());
|
|
|
+ map.put("type","客户合同");
|
|
|
+ map.put("startDate",item.getEffectiveDateStare());
|
|
|
+ map.put("endDate",item.getEffectiveDateEnd());
|
|
|
+ mapList.add(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if ("协议".equals(item.getfType())){
|
|
|
+ if (!tWarehouseList.isEmpty()){
|
|
|
+ TWarehouse warehouse = tWarehouseList.stream().filter(e-> e.getfId().equals(item.getfPid())).findFirst().orElse(null);
|
|
|
+ if (warehouse != null){
|
|
|
+ map.put("name",warehouse.getfCname());
|
|
|
+ map.put("type","仓库协议");
|
|
|
+ map.put("startDate",item.getEffectiveDateStare());
|
|
|
+ map.put("endDate",item.getEffectiveDateEnd());
|
|
|
+ mapList.add(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return mapList;
|
|
|
+ }
|
|
|
+
|
|
|
}
|