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