|
@@ -3,6 +3,7 @@ package org.springblade.manager.feign;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
+import com.mixsmart.utils.StringUtils;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.manager.entity.WbsTreeContract;
|
|
import org.springblade.manager.entity.WbsTreeContract;
|
|
@@ -10,8 +11,11 @@ import org.springblade.manager.service.IContractInfoService;
|
|
import org.springblade.manager.service.IWbsTreeContractService;
|
|
import org.springblade.manager.service.IWbsTreeContractService;
|
|
import org.springblade.manager.vo.WbsTreeContractTreeVO;
|
|
import org.springblade.manager.vo.WbsTreeContractTreeVO;
|
|
import org.springblade.manager.vo.WbsTreeContractTreeVOS;
|
|
import org.springblade.manager.vo.WbsTreeContractTreeVOS;
|
|
|
|
+import org.springblade.system.entity.DictBiz;
|
|
|
|
+import org.springblade.system.feign.IDictBizClient;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
-import java.util.List;
|
|
|
|
|
|
+
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
@@ -21,6 +25,8 @@ public class WbsTreeContractClientImpl implements WbsTreeContractClient {
|
|
|
|
|
|
private final IWbsTreeContractService wbsTreeContractService;
|
|
private final IWbsTreeContractService wbsTreeContractService;
|
|
|
|
|
|
|
|
+ private final IDictBizClient dictBizClient;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public Boolean updateContractNodeParameter(WbsTreeContract node) {
|
|
public Boolean updateContractNodeParameter(WbsTreeContract node) {
|
|
return this.wbsTreeContractService.update(Wrappers.<WbsTreeContract>lambdaUpdate().set(WbsTreeContract::getDeptName, node.getDeptName()).eq(WbsTreeContract::getPKeyId, node.getPKeyId()));
|
|
return this.wbsTreeContractService.update(Wrappers.<WbsTreeContract>lambdaUpdate().set(WbsTreeContract::getDeptName, node.getDeptName()).eq(WbsTreeContract::getPKeyId, node.getPKeyId()));
|
|
@@ -55,4 +61,43 @@ public class WbsTreeContractClientImpl implements WbsTreeContractClient {
|
|
vos.forEach(voData -> voData.setLeaf(new Integer("6").equals(voData.getDeptCategory())));
|
|
vos.forEach(voData -> voData.setLeaf(new Integer("6").equals(voData.getDeptCategory())));
|
|
return vos;
|
|
return vos;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<WbsTreeContractTreeVOS> queryCurrentContractLogList(String contractId) {
|
|
|
|
+ List<WbsTreeContract> result = this.wbsTreeContractService.queryCurrentContractLogList(contractId);
|
|
|
|
+ if(result != null && result.size() != 0){
|
|
|
|
+ List<WbsTreeContractTreeVOS> vosResult = new ArrayList<>();
|
|
|
|
+ result.forEach(node -> {
|
|
|
|
+ //转换
|
|
|
|
+ WbsTreeContractTreeVOS vos = new WbsTreeContractTreeVOS();
|
|
|
|
+ vos.setPrimaryKeyId(String.valueOf(node.getPKeyId()));
|
|
|
|
+ vos.setTitle(StringUtils.isNotEmpty(node.getFullName()) ? node.getFullName() : node.getDeptName());
|
|
|
|
+ //最终返回集合
|
|
|
|
+ vosResult.add(vos);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ List<WbsTreeContractTreeVOS> finalResult = new ArrayList<>();
|
|
|
|
+ //排序顺序
|
|
|
|
+ List<DictBiz> dictBizList = this.dictBizClient.getList("contract_log_sort", "notRoot").getData();
|
|
|
|
+ if(dictBizList == null || dictBizList.size() == 0){
|
|
|
|
+ return vosResult;
|
|
|
|
+ }
|
|
|
|
+ //存在排序,则根据排序规则对数据进行排序
|
|
|
|
+ dictBizList.sort(Comparator.comparingInt(DictBiz::getSort));
|
|
|
|
+ dictBizList.forEach(dictBiz -> {
|
|
|
|
+ Iterator<WbsTreeContractTreeVOS> iterator = vosResult.iterator();
|
|
|
|
+ while (iterator.hasNext()){
|
|
|
|
+ WbsTreeContractTreeVOS next = iterator.next();
|
|
|
|
+ if(next.getTitle().contains(dictBiz.getDictValue())){
|
|
|
|
+ finalResult.add(next);
|
|
|
|
+ iterator.remove();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ return finalResult;
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
}
|
|
}
|