|
@@ -6,15 +6,17 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.springblade.business.entity.ArchiveFile;
|
|
|
import org.springblade.business.feign.ArchiveFileClient;
|
|
|
import org.springblade.business.mapper.ArchiveFileMapper;
|
|
|
import org.springblade.business.service.IArchiveFileService;
|
|
|
import org.springblade.business.vo.ArchiveFileVO;
|
|
|
+import org.springblade.manager.entity.ContractInfo;
|
|
|
+import org.springblade.manager.feign.ContractClient;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
|
@RestController
|
|
@@ -25,6 +27,9 @@ public class ArchiveFileClientImpl implements ArchiveFileClient {
|
|
|
|
|
|
private final ArchiveFileMapper fileMapper;
|
|
|
|
|
|
+ private ContractClient contractClient;
|
|
|
+
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public void saveArchiveFile(ArchiveFileVO vo) {
|
|
@@ -102,4 +107,58 @@ public class ArchiveFileClientImpl implements ArchiveFileClient {
|
|
|
public List<ArchiveFile> getListByProjectId(Long projectId) {
|
|
|
return fileMapper.getListByProjectId(projectId);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Map<String,Object>> getAllArchiveFileByContractType(Long projectId) {
|
|
|
+ List<ArchiveFileVO> list = fileMapper.getAllArchiveFileByContractType(projectId);
|
|
|
+ List<ContractInfo> infos = contractClient.queryContractListByIds(Arrays.asList(projectId));
|
|
|
+ int key1=0,key2=0,key3=0;
|
|
|
+ //判断案卷属于1施工,2监理,还是3业主
|
|
|
+ for (ArchiveFileVO l : list) {
|
|
|
+ String type = l.getContractType();
|
|
|
+ if (StringUtils.isBlank(type)){
|
|
|
+ //业主
|
|
|
+ key3++;
|
|
|
+ }else if ("S".equals(type)){
|
|
|
+ //监理
|
|
|
+ key2++;
|
|
|
+ }else if ("C".equals(type)){
|
|
|
+ //施工
|
|
|
+ key1++;
|
|
|
+ }else if (type.length() > 10){
|
|
|
+ for (ContractInfo info : infos) {
|
|
|
+ if (type.equals(info.getId()+"")){
|
|
|
+ Integer t = info.getContractType();
|
|
|
+ if (t == 1){
|
|
|
+ key1++;
|
|
|
+ }else if(t==2){
|
|
|
+ key2++;
|
|
|
+ }else {
|
|
|
+ key3++;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ System.out.println(type);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<Map<String,Object>> mapList = new ArrayList<>();
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ map.put("title","施工");
|
|
|
+ map.put("key1",0);
|
|
|
+ map.put("key2",key1);
|
|
|
+ Map<String,Object> map2 = new HashMap<>();
|
|
|
+ map2.put("title","监理");
|
|
|
+ map2.put("key1",0);
|
|
|
+ map2.put("key2",key2);
|
|
|
+ Map<String,Object> map3 = new HashMap<>();
|
|
|
+ map3.put("title","业主");
|
|
|
+ map3.put("key1",0);
|
|
|
+ map3.put("key2",key3);
|
|
|
+ mapList.add(map);
|
|
|
+ mapList.add(map2);
|
|
|
+ mapList.add(map3);
|
|
|
+ return mapList;
|
|
|
+ }
|
|
|
}
|