Commit 9c87d14f authored by hezhuozhi's avatar hezhuozhi

26854 【智信户用(管理端)】迁移工作台相关代码

parent 161531ed
......@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
......@@ -16,7 +15,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.DateUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.*;
......@@ -28,6 +26,8 @@ public class BasicGridAcceptanceServiceImpl
extends BaseService<BasicGridAcceptanceDto, BasicGridAcceptance, BasicGridAcceptanceMapper>
implements IBasicGridAcceptanceService {
private final String OK = "0";
private final String PASS = "5";
@Autowired
BasicGridAcceptanceMapper basicGridAcceptanceMapper;
@Autowired
......@@ -44,15 +44,11 @@ public class BasicGridAcceptanceServiceImpl
RegionalCompaniesMapper regionalCompaniesMapper;
@Autowired
WorkOrderMapper workOrderMapper;
@Autowired
PeasantHouseholdMapper peasantHouseholdMapper;
@Autowired
private CommonServiceImpl commonService;
private final String OK = "0";
private final String PASS = "5";
public Page<BasicGridAcceptanceDto> selectPage(Long regionCompanyId, Long amosDealerId, int current, int size,
String projectAddress, String powerStationCode, String ownersName, String gridStatus,
String gridConnectionTime, String formType) throws Exception {
......@@ -297,6 +293,26 @@ public class BasicGridAcceptanceServiceImpl
}
basicGridAcceptanceMapper.updateById(workBasicGridAcceptance);
//更新待办
// commonService.updateTaskModelNew(buildBWYSUpdateTaskModel(basicGridAcceptanc,dto));
}
private Map<String, Object> buildBWYSUpdateTaskModel(BasicGridAcceptance basicGridAcceptance, AcceptanceCheckItem acceptanceCheckItem) {
Map<String, Object> map = new HashMap<>();
if (OK.equals(acceptanceCheckItem.getApprovalStatus())) {
map.put("flowStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
map.put("flowStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
map.put("taskStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
map.put("taskStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
} else {
map.put("flowStatus", FlowStatusEnum.TO_BE_PROCESSED.getCode());
map.put("flowStatusLabel", FlowStatusEnum.TO_BE_PROCESSED.getName());
map.put("taskStatus", FlowStatusEnum.TO_BE_PROCESSED.getCode());
map.put("taskStatusLabel", FlowStatusEnum.TO_BE_PROCESSED.getName());
}
map.put("model", acceptanceCheckItem);
map.put("relationId", basicGridAcceptance.getInstanceId());
return map;
}
}
......@@ -217,6 +217,8 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
financingInfo.setFinancingCompaniesName(null);
this.updateById(financingInfo);
}
//停止流程
// commonService.rollbackTask();
}
@Override
......@@ -313,8 +315,27 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
financingRectificationOrder.setResponsibleUserPhone(params.getOrDefault("responsibleUserPhone", "").toString());
financingRectificationOrderService.save(financingRectificationOrder);
}
//更新待办
// commonService.updateTaskModelNew(buildDZTRZUpdateTaskParams(params,financingAuditing));
}
private Map<String, Object> buildDZTRZUpdateTaskParams(Map<String, Object> params, FinancingAuditing financingAuditing) {
Map<String, Object> map = new HashMap<>();
if ("0".equals(params.get("approvalStatus"))) {
map.put("flowStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
map.put("flowStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
map.put("taskStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
map.put("taskStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
} else {
map.put("flowStatus", FlowStatusEnum.TO_BE_PROCESSED.getCode());
map.put("flowStatusLabel", FlowStatusEnum.TO_BE_PROCESSED.getName());
map.put("taskStatus", FlowStatusEnum.TO_BE_PROCESSED.getCode());
map.put("taskStatusLabel", FlowStatusEnum.TO_BE_PROCESSED.getName());
}
map.put("model", financingAuditing);
map.put("relationId", financingAuditing.getInstanceId());
return map;
}
public List<Map<String, Object>> selectOrgList() {
......
......@@ -677,7 +677,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
dealerReviewService.saveDealerReview(dealerReview, false, true, unitInfo.getName(), approvalStatue);
this.saveOrUpdate(unitInfo);
//更新待办
// commonService.updateTaskModelNew(buildJXSSHUpdateTaskModel(basicGridAcceptance, unitInfo, kv));
} catch (Exception e) {
......@@ -704,7 +705,6 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
}
// // 2.更新审核记录表
// UnitInfo unitInfo=null;
// try{
......@@ -815,6 +815,24 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
return code;
}
private Map<String, Object> buildJXSSHUpdateTaskModel(BasicGridAcceptance basicGridAcceptance, UnitInfo unitInfo, Map<String, Object> params) {
Map<String, Object> map = new HashMap<>();
if ("0".equals(params.get("approvalStatus"))) {
map.put("flowStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
map.put("flowStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
map.put("taskStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
map.put("taskStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
} else {
map.put("flowStatus", FlowStatusEnum.TO_BE_PROCESSED.getCode());
map.put("flowStatusLabel", FlowStatusEnum.TO_BE_PROCESSED.getName());
map.put("taskStatus", FlowStatusEnum.TO_BE_PROCESSED.getCode());
map.put("taskStatusLabel", FlowStatusEnum.TO_BE_PROCESSED.getName());
}
map.put("model", unitInfo);
map.put("relationId", basicGridAcceptance.getInstanceId());
return map;
}
@Override
public IPage<CompanyDto> getCompanyDto(CompanyDto dto) {
//列表数据组装
......@@ -922,30 +940,30 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
//区域公司
LambdaQueryWrapper<RegionalCompanies> qu=new LambdaQueryWrapper<>();
qu.eq(RegionalCompanies::getUnitId,unitInfo.getAmosCompanySeq());
LambdaQueryWrapper<RegionalCompanies> qu = new LambdaQueryWrapper<>();
qu.eq(RegionalCompanies::getUnitId, unitInfo.getAmosCompanySeq());
List<RegionalCompanies> oldList = regionalCompaniesMapper.selectList(qu);
regionalCompaniesMapper.delete(qu);
List<RegionalCompanies> regionalComp= new ArrayList<>();
FeignClientResult<Collection<CompanyModel>> feignClientResult= Privilege.companyClient.querySubAgencyTree(regionalCompanies);
List<CompanyModel> companyModel = (List<CompanyModel>)feignClientResult.getResult();
List<String> lisd=unitInfo.getRegionalCompaniesSeq();
List<RegionalCompanies> regionalComp = new ArrayList<>();
FeignClientResult<Collection<CompanyModel>> feignClientResult = Privilege.companyClient.querySubAgencyTree(regionalCompanies);
List<CompanyModel> companyModel = (List<CompanyModel>) feignClientResult.getResult();
List<String> lisd = unitInfo.getRegionalCompaniesSeq();
if(oldList==null) {
if (oldList == null) {
oldList = new ArrayList<>();
}
if(companyModel!=null&&!companyModel.isEmpty()&&lisd!=null&&!lisd.isEmpty()){
if (companyModel != null && !companyModel.isEmpty() && lisd != null && !lisd.isEmpty()) {
for (Object aLong : lisd) {
RegionalCompanies oldRe = oldList.stream().filter(s -> Objects.equals(s.getRegionalCompaniesSeq().toString(), aLong.toString())).findFirst().orElse(null);
if(oldRe!= null) {
if (oldRe != null) {
lisk.add(oldRe.getRegionalCompaniesCode());
regionalComp.add(oldRe);
}else {
} else {
for (CompanyModel compan : companyModel) {
if(compan.getSequenceNbr().longValue()==Long.valueOf(aLong.toString()).longValue()){
RegionalCompanies re= new RegionalCompanies(Long.valueOf(aLong.toString()), compan.getCompanyName(), compan.getOrgCode(), unitInfo.getAmosCompanySeq(),unitInfo.getSequenceNbr());
if (compan.getSequenceNbr().longValue() == Long.valueOf(aLong.toString()).longValue()) {
RegionalCompanies re = new RegionalCompanies(Long.valueOf(aLong.toString()), compan.getCompanyName(), compan.getOrgCode(), unitInfo.getAmosCompanySeq(), unitInfo.getSequenceNbr());
lisk.add(compan.getOrgCode());
regionalComp.add(re);
continue;
......@@ -958,24 +976,20 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
}
regionalCompaniesService.saveBatch(regionalComp);
//修改管理员权限
//管理员绑定角色权限
LambdaQueryWrapper<StdUserEmpower> uo=new LambdaQueryWrapper();
uo.eq(StdUserEmpower::getAmosUserId,unitInfo.getAdminUserId());
StdUserEmpower stdUserEmpower= userEmpowerMapper.selectOne(uo);
LambdaQueryWrapper<StdUserEmpower> uo = new LambdaQueryWrapper();
uo.eq(StdUserEmpower::getAmosUserId, unitInfo.getAdminUserId());
StdUserEmpower stdUserEmpower = userEmpowerMapper.selectOne(uo);
if(stdUserEmpower!=null){
if (stdUserEmpower != null) {
stdUserEmpower.setAmosUserId(unitInfo.getAdminUserId());
stdUserEmpower.setAmosOrgCode(lisk);
userEmpowerMapper.updateById(stdUserEmpower);
}else{
stdUserEmpower=new StdUserEmpower();
} else {
stdUserEmpower = new StdUserEmpower();
stdUserEmpower.setAmosUserId(unitInfo.getAdminUserId());
stdUserEmpower.setAmosOrgCode(lisk);
stdUserEmpower.setPermissionType("HYGF");
......@@ -983,7 +997,6 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
}
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment