Commit e02ce526 authored by hezhuozhi's avatar hezhuozhi

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

parent c86819b6
...@@ -10,43 +10,10 @@ public enum BusinessTypeEnum { ...@@ -10,43 +10,10 @@ public enum BusinessTypeEnum {
/** /**
* 业务类型枚举 * 业务类型枚举
*/ */
JG_EQUIPMENT_HANDOVER("101", "设备移交"), HYGF_JXS_SH("JXS_SH", "经销商审核"),
HYGF_DZ_SH("hygf_10001", "电站审核"),
JG_INSTALLATION_NOTIFICATION("102", "安装告知"), HYGF_BWYS("hygf_bwys", "并网验收"),
HYGF_DZTRRZ("StationFinancing", "电站投融资流程");
JG_MODIFICATION_NOTIFICATION("103", "改造告知"),
JG_MAINTENANCE_NOTIFICATION("104", "维修告知"),
JG_ADVICE_REMOVAL("105", "移装告知"),
JG_MAINTENANCE_RECORD("106", "维保备案"),
JG_USAGE_REGISTRATION("107", "使用登记"),
JG_NAME_CHANGE_REGISTRATION("108", "更名变更登记"),
JG_COMPANY_CHANGE_REGISTRATION("109", "单位变更登记"),
JG_CHANGE_REGISTRATION("110", "移装变更登记"),
JG_RENOVATION_REGISTRATION("111", "改造变更登记"),
JG_EQUIPMENT_START("112-1", "设备启用"),
JG_EQUIPMENT_STOP("112-2", "设备停用"),
JG_EQUIPMENT_MOVE("113-1", "移装注销"),
JG_EQUIPMENT_CANCEL("113-2", "报废注销"),
JY_OPENING_APPLICATION("114", "业务开通"),
JY_INSPECTION_APPLICATION_JD("115", "监督检验"),
JY_INSPECTION_APPLICATION_DS("116", "定(首)检验"),
JY_INSPECTION_APPLICATION_CHECK("117", "电梯检测"),
JG_VEHICLE_GAS_APPLICATION("118", "车用气瓶登记");
private final String code; private final String code;
private final String name; private final String name;
......
package com.yeejoin.amos.boot.module.hygf.api.Enum;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <pre>
* 任务状态枚举
* </pre>
* @author my
*
*/
public enum TaskStatusEnum {
UNDERWAY("处理中",0),
FINISHED("已完成",1),
CANCEL("已取消",2),
OVERTIME("已超时",3);
/**
* 名称
*/
private String name;
/**
* 值
*/
private int value;
private TaskStatusEnum(String name, int value) {
this.name = name;
this.value = value;
}
public static String getName(int value) {
for (TaskStatusEnum c : TaskStatusEnum.values()) {
if (c.getValue() == value) {
return c.name;
}
}
return null;
}
public static int getValue(String name) {
for (TaskStatusEnum c : TaskStatusEnum.values()) {
if (c.getName().equals(name)) {
return c.value;
}
}
return -1;
}
public static TaskStatusEnum getEnum(int value) {
for (TaskStatusEnum c : TaskStatusEnum.values()) {
if (c.getValue() == value) {
return c;
}
}
return null;
}
public static TaskStatusEnum getEnum(String name) {
for (TaskStatusEnum c : TaskStatusEnum.values()) {
if (c.getName().equals(name)) {
return c;
}
}
return null;
}
public static List<Map<String,String>> getEnumList() {
List<Map<String,String>> nameList = new ArrayList<>();
for (TaskStatusEnum c: TaskStatusEnum.values()) {
Map<String, String> map = new HashMap<String, String>();
map.put("name", c.getName());
map.put("value", c.getValue() +"");
nameList.add(map);
}
return nameList;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
}
...@@ -47,6 +47,8 @@ public class BasicGridAcceptanceServiceImpl ...@@ -47,6 +47,8 @@ public class BasicGridAcceptanceServiceImpl
@Autowired @Autowired
PeasantHouseholdMapper peasantHouseholdMapper; PeasantHouseholdMapper peasantHouseholdMapper;
@Autowired
private CommonServiceImpl commonService;
private final String OK = "0"; private final String OK = "0";
private final String PASS = "5"; private final String PASS = "5";
...@@ -127,9 +129,42 @@ public class BasicGridAcceptanceServiceImpl ...@@ -127,9 +129,42 @@ public class BasicGridAcceptanceServiceImpl
onGridMapper.insert(grid); onGridMapper.insert(grid);
} }
basicGridAcceptanceMapper.updateById(basicGridAcceptance); basicGridAcceptanceMapper.updateById(basicGridAcceptance);
//发起待办
commonService.buildTaskModel(buildBWYSTaskModel(grid, basicGridAcceptance));
return grid; return grid;
} }
private List<TaskModelDto> buildBWYSTaskModel(HygfOnGrid grid, BasicGridAcceptance basicGridAcceptance) {
List<TaskModelDto> taskModelDtoList = new ArrayList<>();
TaskModelDto taskModelDto = new TaskModelDto();
taskModelDto.setFlowCode(basicGridAcceptance.getNextTaskId());
taskModelDto.setFlowCreateDate(new Date());
taskModelDto.setFlowStatus(FlowStatusEnum.TO_BE_PROCESSED.getCode());
taskModelDto.setFlowStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName());
taskModelDto.setPageType(null);
taskModelDto.setExecuteUserIds(basicGridAcceptance.getNextExecuteUserIds());
taskModelDto.setModel(grid);
taskModelDto.setRelationId(basicGridAcceptance.getInstanceId());
taskModelDto.setRoutePath(null);
taskModelDto.setStartUserId(basicGridAcceptance.getRecUserId());
taskModelDto.setStartUser(basicGridAcceptance.getRecUserName());
taskModelDto.setStartDate(basicGridAcceptance.getRecDate());
taskModelDto.setStartUserCompanyName(null);
taskModelDto.setTaskName(basicGridAcceptance.getNextNodeName());
taskModelDto.setTaskCode(String.valueOf(basicGridAcceptance.getWorkOrderId()));
taskModelDto.setTaskType(BusinessTypeEnum.HYGF_BWYS.getCode());
taskModelDto.setTaskTypeLabel(BusinessTypeEnum.HYGF_BWYS.getName());
taskModelDto.setTaskStatus(TaskStatusEnum.UNDERWAY.getValue());
taskModelDto.setTaskStatusLabel(TaskStatusEnum.UNDERWAY.getName());
// taskModelDto.setTaskDesc();
// taskModelDto.setTaskContent();
taskModelDto.setNextExecuteUser(basicGridAcceptance.getNextExecutorIds());
taskModelDtoList.add(taskModelDto);
return taskModelDtoList;
}
public HygfOnGrid modifyEntity(HygfOnGrid grid) { public HygfOnGrid modifyEntity(HygfOnGrid grid) {
onGridMapper.updateById(grid); onGridMapper.updateById(grid);
return grid; return grid;
......
...@@ -104,11 +104,6 @@ public class CommonServiceImpl { ...@@ -104,11 +104,6 @@ public class CommonServiceImpl {
model.setRoutePath(map.get("url").toString() + urlParams); model.setRoutePath(map.get("url").toString() + urlParams);
break; break;
} }
// 维保需特殊获取页面 状态不等于监管单位审核的页面均取对应编辑页面
else if (map.get("type").equals(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getCode()) && obj.getTaskType().equals(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getCode()) && !obj.getFlowStatus().toString().equals("16723") && map.get("pageType").equals("edit")) {
model.setRoutePath(map.get("url").toString().replace("{roleIds}", obj.getNextExecuteUser()) + urlParams + "&nextExecuteUserIds=" + model.getExecuteUserIds());
break;
}
// 其他逻辑均按详情页面获取 // 其他逻辑均按详情页面获取
else if (map.get("type").equals(obj.getTaskType()) && map.get("pageType").equals(null == obj.getPageType() ? "look" : obj.getPageType())) { else if (map.get("type").equals(obj.getTaskType()) && map.get("pageType").equals(null == obj.getPageType() ? "look" : obj.getPageType())) {
model.setRoutePath(map.get("url").toString().replace("{roleIds}", obj.getNextExecuteUser()) + urlParams + "&nextExecuteUserIds=" + model.getExecuteUserIds()); model.setRoutePath(map.get("url").toString().replace("{roleIds}", obj.getNextExecuteUser()) + urlParams + "&nextExecuteUserIds=" + model.getExecuteUserIds());
...@@ -313,10 +308,7 @@ public class CommonServiceImpl { ...@@ -313,10 +308,7 @@ public class CommonServiceImpl {
} }
for (Map map : urlList) { for (Map map : urlList) {
if (map.get("type").equals(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getCode()) && obj.getString("taskType").equals(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getCode()) && map.get("pageType").equals("edit")) { if (map.get("type").equals(obj.get("taskType")) && map.get("pageType").equals(obj.getOrDefault("pageType", "edit"))) {
lastTaskModel.setRoutePath(map.get("url").toString().replace("{roleIds}", obj.getString("nextExecuteUser")) + urlParams);
break;
} else if (map.get("type").equals(obj.get("taskType")) && map.get("pageType").equals(obj.getOrDefault("pageType", "edit"))) {
lastTaskModel.setRoutePath(map.get("url").toString().replace("{roleIds}", obj.get("nextExecuteUser").toString()) + urlParams); lastTaskModel.setRoutePath(map.get("url").toString().replace("{roleIds}", obj.get("nextExecuteUser").toString()) + urlParams);
break; break;
} }
...@@ -334,10 +326,7 @@ public class CommonServiceImpl { ...@@ -334,10 +326,7 @@ public class CommonServiceImpl {
model.setFlowStatusLabel(obj.get("flowStatusLabel").toString()); model.setFlowStatusLabel(obj.get("flowStatusLabel").toString());
} }
for (Map map : urlList) { for (Map map : urlList) {
if (map.get("type").equals(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getCode()) && obj.getString("taskType").equals(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getCode()) && map.get("pageType").equals("edit")) { if (map.get("type").equals(obj.get("taskType")) && map.get("pageType").equals("edit")) {
model.setRoutePath(map.get("url").toString().replace("{roleIds}", obj.getString("nextExecuteUser")) + urlParams);
break;
} else if (map.get("type").equals(obj.get("taskType")) && map.get("pageType").equals("edit")) {
model.setRoutePath(map.get("url").toString().replace("{roleIds}", obj.get("nextExecuteUser").toString()) + urlParams); model.setRoutePath(map.get("url").toString().replace("{roleIds}", obj.get("nextExecuteUser").toString()) + urlParams);
break; break;
} }
......
package com.yeejoin.amos.boot.module.hygf.biz.service.impl; package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.map.MapUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
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;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.hygf.api.Enum.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.FinancingAuditEnum; import com.yeejoin.amos.boot.module.hygf.api.Enum.FinancingAuditEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.FlowStatusEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.TaskStatusEnum;
import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits; import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits;
import com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridAcceptanceDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingAuditingDto; import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingAuditingDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.TaskModelDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.WorkflowResultDto; import com.yeejoin.amos.boot.module.hygf.api.dto.WorkflowResultDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.*; import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingAuditing;
import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingInfo;
import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingRectificationOrder;
import com.yeejoin.amos.boot.module.hygf.api.entity.StdUserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.mapper.FinancingInfoMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.FinancingInfoMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IFinancingInfoService; import com.yeejoin.amos.boot.module.hygf.api.service.IFinancingInfoService;
import com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.FinancingRectificationOrderServiceImpl;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO; import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO; import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO; import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO;
import com.yeejoin.amos.feign.workflow.model.TaskResultDTO; import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.*; import java.util.*;
...@@ -46,7 +49,10 @@ import java.util.*; ...@@ -46,7 +49,10 @@ import java.util.*;
* @date 2024-04-01 * @date 2024-04-01
*/ */
@Service @Service
public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,FinancingInfo,FinancingInfoMapper> implements IFinancingInfoService { public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, FinancingInfo, FinancingInfoMapper> implements IFinancingInfoService {
private static String PROCESSKEY = "StationFinancing";
@Autowired
RedisUtils redisUtils;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -61,23 +67,20 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan ...@@ -61,23 +67,20 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
@Autowired @Autowired
private FinancingRectificationOrderServiceImpl financingRectificationOrderService; private FinancingRectificationOrderServiceImpl financingRectificationOrderService;
@Autowired @Autowired
RedisUtils redisUtils; private CommonServiceImpl commonService;
private static String PROCESSKEY="StationFinancing";
@UserLimits @UserLimits
public Page<Map<String, Object>> queryForFinancingInfoPage(Page<Map<String, Object>> page,String type,String status,String regionalCompaniesCode ,String ownersName) { public Page<Map<String, Object>> queryForFinancingInfoPage(Page<Map<String, Object>> page, String type, String status, String regionalCompaniesCode, String ownersName) {
StdUserEmpower orgCode =(StdUserEmpower) redisUtils.get("Emp_"+ RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())); StdUserEmpower orgCode = (StdUserEmpower) redisUtils.get("Emp_" + RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()));
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
List<String> amosOrgCodes = orgCode.getAmosOrgCode(); List<String> amosOrgCodes = orgCode.getAmosOrgCode();
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("ownersName",ownersName); params.put("ownersName", ownersName);
params.put("status",status); params.put("status", status);
params.put("regionalCompaniesCode",regionalCompaniesCode); params.put("regionalCompaniesCode", regionalCompaniesCode);
params.put("type",type); params.put("type", type);
// 1 投融人员 2.融资 3经销商管理员 // 1 投融人员 2.融资 3经销商管理员
switch (type){ switch (type) {
case "1": case "1":
break; break;
case "2": case "2":
...@@ -85,15 +88,15 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan ...@@ -85,15 +88,15 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
params.put("financingCompaniesSeq", String.valueOf(sequenceNbr)); params.put("financingCompaniesSeq", String.valueOf(sequenceNbr));
break; break;
default: default:
amosOrgCodes=Arrays.asList(orgCode.getAdminRegionalCompaniesCode().split(",")); amosOrgCodes = Arrays.asList(orgCode.getAdminRegionalCompaniesCode().split(","));
} }
PageHelper.startPage((int)page.getCurrent(),(int)page.getSize()); PageHelper.startPage((int) page.getCurrent(), (int) page.getSize());
List<Map<String, Object>> list = financingInfoMapper.getStationFinancingInfoList(params,amosOrgCodes); List<Map<String, Object>> list = financingInfoMapper.getStationFinancingInfoList(params, amosOrgCodes);
list.forEach(e->{ list.forEach(e -> {
if (null != e.get("instanceId") && e.get("instanceId").toString().contains(",")){ if (null != e.get("instanceId") && e.get("instanceId").toString().contains(",")) {
String[] instanceIds = e.get("instanceId").toString().split(","); String[] instanceIds = e.get("instanceId").toString().split(",");
e.put("instanceId",instanceIds[0]); e.put("instanceId", instanceIds[0]);
e.put("nodeRouting",instanceIds[1]); e.put("nodeRouting", instanceIds[1]);
} }
}); });
PageInfo<Map<String, Object>> infos = new PageInfo<>(list); PageInfo<Map<String, Object>> infos = new PageInfo<>(list);
...@@ -106,33 +109,33 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan ...@@ -106,33 +109,33 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
* 列表查询 示例 * 列表查询 示例
*/ */
public List<FinancingInfoDto> queryForFinancingInfoList() { public List<FinancingInfoDto> queryForFinancingInfoList() {
return this.queryForList("" , false); return this.queryForList("", false);
} }
@Transactional @Transactional
public FinancingInfoDto saveModel(FinancingInfoDto model) { public FinancingInfoDto saveModel(FinancingInfoDto model) {
List<String> ids ; List<String> ids;
if (model.getPeasantHouseholdIds().contains(",")) { if (model.getPeasantHouseholdIds().contains(",")) {
ids= Arrays.asList(model.getPeasantHouseholdIds().split(",")); ids = Arrays.asList(model.getPeasantHouseholdIds().split(","));
}else { } else {
ids= Arrays.asList(new String[]{model.getPeasantHouseholdIds()}); ids = Arrays.asList(new String[]{model.getPeasantHouseholdIds()});
} }
Map<String, Object> orgInfo = this.getBaseMapper().selectRZOrgInfo(model.getFinancingCompaniesSeq()); Map<String, Object> orgInfo = this.getBaseMapper().selectRZOrgInfo(model.getFinancingCompaniesSeq());
model.setFinancingCompaniesCode(orgInfo.getOrDefault("ORG_CODE","").toString()); model.setFinancingCompaniesCode(orgInfo.getOrDefault("ORG_CODE", "").toString());
model.setFinancingCompaniesName(orgInfo.getOrDefault("COMPANY_NAME","").toString()); model.setFinancingCompaniesName(orgInfo.getOrDefault("COMPANY_NAME", "").toString());
ids.stream().forEach(e->{ ids.stream().forEach(e -> {
LambdaQueryWrapper<FinancingInfo> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<FinancingInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(FinancingInfo::getPeasantHouseholdId,Long.valueOf(e)); queryWrapper.eq(FinancingInfo::getPeasantHouseholdId, Long.valueOf(e));
FinancingInfo financingInfos = this.getBaseMapper().selectOne(queryWrapper); FinancingInfo financingInfos = this.getBaseMapper().selectOne(queryWrapper);
if (ObjectUtils.isEmpty(financingInfos)){ if (ObjectUtils.isEmpty(financingInfos)) {
model.setStatus(FinancingAuditEnum.待融资审核.getName()); model.setStatus(FinancingAuditEnum.待融资审核.getName());
model.setPeasantHouseholdId(Long.valueOf(e)); model.setPeasantHouseholdId(Long.valueOf(e));
FinancingInfoDto financingInfoDto = new FinancingInfoDto(); FinancingInfoDto financingInfoDto = new FinancingInfoDto();
BeanUtils.copyProperties(model,financingInfoDto); BeanUtils.copyProperties(model, financingInfoDto);
financingInfoDto.setSequenceNbr(null); financingInfoDto.setSequenceNbr(null);
this.createWithModel(financingInfoDto); this.createWithModel(financingInfoDto);
}else { } else {
financingInfos.setStatus(FinancingAuditEnum.待融资审核.getName()); financingInfos.setStatus(FinancingAuditEnum.待融资审核.getName());
this.updateById(financingInfos); this.updateById(financingInfos);
} }
...@@ -142,11 +145,12 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan ...@@ -142,11 +145,12 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
List<ActWorkflowStartDTO> list = new ArrayList<>(); List<ActWorkflowStartDTO> list = new ArrayList<>();
ActWorkflowStartDTO dto = new ActWorkflowStartDTO(); ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey(PROCESSKEY); dto.setProcessDefinitionKey(PROCESSKEY);
dto.setBusinessKey(String.valueOf(new Date().getTime())); Date date = new Date();
dto.setBusinessKey(String.valueOf(date.getTime()));
dto.setCompleteFirstTask(true); dto.setCompleteFirstTask(true);
//工作流程图第一步执行后存在互斥网关 isFlag为表达式 默认为1执行到融资审核 //工作流程图第一步执行后存在互斥网关 isFlag为表达式 默认为1执行到融资审核
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("isFlag","0"); map.put("isFlag", "0");
dto.setVariables(map); dto.setVariables(map);
list.add(dto); list.add(dto);
actWorkflowBatchDTO.setProcess(list); actWorkflowBatchDTO.setProcess(list);
...@@ -155,26 +159,57 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan ...@@ -155,26 +159,57 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
WorkflowResultDto workflowResultDto = workflowResultDtos.get(0); WorkflowResultDto workflowResultDto = workflowResultDtos.get(0);
FinancingAuditingDto financingAuditingDto = new FinancingAuditingDto(); FinancingAuditingDto financingAuditingDto = new FinancingAuditingDto();
BeanUtils.copyProperties(workflowResultDto,financingAuditingDto); BeanUtils.copyProperties(workflowResultDto, financingAuditingDto);
financingAuditingDto.setPeasantHouseholdId(Long.valueOf(e)); financingAuditingDto.setPeasantHouseholdId(Long.valueOf(e));
financingAuditingDto.setPromoter(RequestContext.getExeUserId()); financingAuditingDto.setPromoter(RequestContext.getExeUserId());
financingAuditingService.createWithModel(financingAuditingDto); financingAuditingService.createWithModel(financingAuditingDto);
//发起待办
commonService.buildTaskModel(buildDZTRZTaskModel(model, workflowResultDto, date));
}); });
return model; return model;
} }
private List<TaskModelDto> buildDZTRZTaskModel(FinancingInfoDto model, WorkflowResultDto workflowResultDto, Date startDate) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
List<TaskModelDto> taskModelDtoList = new ArrayList<>();
TaskModelDto taskModelDto = new TaskModelDto();
taskModelDto.setFlowCode(workflowResultDto.getNextTaskId());
taskModelDto.setFlowCreateDate(new Date());
taskModelDto.setFlowStatus(FlowStatusEnum.TO_BE_PROCESSED.getCode());
taskModelDto.setFlowStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName());
taskModelDto.setPageType(null);
taskModelDto.setExecuteUserIds(workflowResultDto.getNextExecuteUserIds());
taskModelDto.setModel(model);
taskModelDto.setRelationId(workflowResultDto.getInstanceId());
taskModelDto.setRoutePath(null);
taskModelDto.setStartUserId(reginParams.getUserModel().getUserId());
taskModelDto.setStartUser(reginParams.getUserModel().getUserName());
taskModelDto.setStartDate(startDate);
taskModelDto.setStartUserCompanyName(null);
taskModelDto.setTaskName(workflowResultDto.getNextNodeName());
taskModelDto.setTaskCode(workflowResultDto.getNextNodeCode());
taskModelDto.setTaskType(BusinessTypeEnum.HYGF_DZTRRZ.getCode());
taskModelDto.setTaskTypeLabel(BusinessTypeEnum.HYGF_DZTRRZ.getName());
taskModelDto.setTaskStatus(TaskStatusEnum.UNDERWAY.getValue());
taskModelDto.setTaskStatusLabel(TaskStatusEnum.UNDERWAY.getName());
// taskModelDto.setTaskDesc();
// taskModelDto.setTaskContent();
taskModelDto.setNextExecuteUser(workflowResultDto.getNextExecutorIds());
taskModelDtoList.add(taskModelDto);
return taskModelDtoList;
}
@Override @Override
public void rollback(String processId, String peasantHouseholdId) { public void rollback(String processId, String peasantHouseholdId) {
workFlowService.stopProcess(processId); workFlowService.stopProcess(processId);
LambdaQueryWrapper<FinancingInfo> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<FinancingInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(FinancingInfo::getPeasantHouseholdId,peasantHouseholdId); queryWrapper.eq(FinancingInfo::getPeasantHouseholdId, peasantHouseholdId);
List<FinancingInfo> financingInfos = this.getBaseMapper().selectList(queryWrapper); List<FinancingInfo> financingInfos = this.getBaseMapper().selectList(queryWrapper);
if (!CollectionUtils.isEmpty(financingInfos)){ if (!CollectionUtils.isEmpty(financingInfos)) {
FinancingInfo financingInfo = financingInfos.get(0); FinancingInfo financingInfo = financingInfos.get(0);
financingInfo.setStatus("待推送"); financingInfo.setStatus("待推送");
financingInfo.setFinancingCompaniesCode(null); financingInfo.setFinancingCompaniesCode(null);
...@@ -211,8 +246,8 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan ...@@ -211,8 +246,8 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
if (params.containsKey("isFlag")) { if (params.containsKey("isFlag")) {
task.setResultCode("isFlag"); task.setResultCode("isFlag");
map.put("isFlag", params.get("isFlag")); map.put("isFlag", params.get("isFlag"));
if(params.get("isFlag").equals("1")){ if (params.get("isFlag").equals("1")) {
params.put("comments","退回整改"); params.put("comments", "退回整改");
} }
} else { } else {
task.setResultCode("approvalStatus"); task.setResultCode("approvalStatus");
...@@ -240,7 +275,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan ...@@ -240,7 +275,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
LambdaQueryWrapper<FinancingInfo> info = new LambdaQueryWrapper<>(); LambdaQueryWrapper<FinancingInfo> info = new LambdaQueryWrapper<>();
info.eq(FinancingInfo::getPeasantHouseholdId, financingAuditing.getPeasantHouseholdId()); info.eq(FinancingInfo::getPeasantHouseholdId, financingAuditing.getPeasantHouseholdId());
FinancingInfo financingInfo = this.getBaseMapper().selectOne(info); FinancingInfo financingInfo = this.getBaseMapper().selectOne(info);
if (params.containsKey("financingCompaniesSeq")){ if (params.containsKey("financingCompaniesSeq")) {
financingInfo.setFinancingCompaniesSeq(Long.valueOf(params.get("financingCompaniesSeq").toString())); financingInfo.setFinancingCompaniesSeq(Long.valueOf(params.get("financingCompaniesSeq").toString()));
} }
//标识对于整改待推送状态 //标识对于整改待推送状态
...@@ -282,7 +317,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan ...@@ -282,7 +317,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
} }
public List<Map<String,Object>> selectOrgList() { public List<Map<String, Object>> selectOrgList() {
return this.getBaseMapper().selectOrgList(); return this.getBaseMapper().selectOrgList();
} }
......
...@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl; ...@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
...@@ -38,8 +37,6 @@ import org.typroject.tyboot.core.rdbms.service.BaseService; ...@@ -38,8 +37,6 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* 勘察信息服务实现类 * 勘察信息服务实现类
...@@ -49,33 +46,31 @@ import java.util.stream.Stream; ...@@ -49,33 +46,31 @@ import java.util.stream.Stream;
*/ */
@Service @Service
@Slf4j @Slf4j
public class SurveyInformationServiceImpl extends BaseService<SurveyInformationDto,SurveyInformation,SurveyInformationMapper> implements ISurveyInformationService { public class SurveyInformationServiceImpl extends BaseService<SurveyInformationDto, SurveyInformation, SurveyInformationMapper> implements ISurveyInformationService {
private static final String regionRedis = "app_region_redis";
private static final String OPERATION_TYPE_SUBMIT = "submit";
private static final String OPERATION_TYPE_APPLY = "apply";
private static final String IDX_REQUEST_STATE = "200";
@Autowired
protected EmqKeeper emqKeeper;
@Autowired @Autowired
SurveyDetailsServiceImpl surveyDetailsService; SurveyDetailsServiceImpl surveyDetailsService;
@Autowired @Autowired
InformationServiceImpl informationService; InformationServiceImpl informationService;
@Autowired @Autowired
ExtendedInformationServiceImpl extendedInformationService; ExtendedInformationServiceImpl extendedInformationService;
@Autowired @Autowired
CommercialServiceImpl commercialService; CommercialServiceImpl commercialService;
@Autowired @Autowired
PeasantHouseholdServiceImpl peasantHouseholdServiceImpl; PeasantHouseholdServiceImpl peasantHouseholdServiceImpl;
@Autowired @Autowired
DesignInformationServiceImpl designInformationService; DesignInformationServiceImpl designInformationService;
@Autowired @Autowired
WorkflowFeignClient workflowFeignClient; WorkflowFeignClient workflowFeignClient;
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired @Autowired
IdxFeginService idxFeginService; IdxFeginService idxFeginService;
@Autowired @Autowired
...@@ -86,22 +81,10 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -86,22 +81,10 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
ToDoTasksMapper toDoTasksMapper; ToDoTasksMapper toDoTasksMapper;
@Autowired @Autowired
UserMessageMapper userMessageMapper; UserMessageMapper userMessageMapper;
@Value("${power.station.examine.pageId}")
private long pageId;
@Autowired
protected EmqKeeper emqKeeper;
@Value("${power.station.examine.planId}")
private String planId;
private static final String regionRedis="app_region_redis";
private static final String OPERATION_TYPE_SUBMIT="submit";
private static final String OPERATION_TYPE_APPLY="apply";
private static final String IDX_REQUEST_STATE="200";
@Autowired @Autowired
PersonnelBusinessMapper personnelBusinessMapper; PersonnelBusinessMapper personnelBusinessMapper;
@Autowired @Autowired
PeasantHouseholdMapper peasantHouseholdMapper; PeasantHouseholdMapper peasantHouseholdMapper;
@Autowired @Autowired
WorkOrderMapper workOrderMapper; WorkOrderMapper workOrderMapper;
@Autowired @Autowired
...@@ -112,7 +95,6 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -112,7 +95,6 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
ConstructionRecordsMapper constructionRecordsMapper; ConstructionRecordsMapper constructionRecordsMapper;
@Autowired @Autowired
BasicGridAcceptanceMapper basicGridAcceptanceMapper; BasicGridAcceptanceMapper basicGridAcceptanceMapper;
@Autowired @Autowired
SurveyInformationMapper surveyInformationMapper; SurveyInformationMapper surveyInformationMapper;
@Autowired @Autowired
...@@ -123,9 +105,14 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -123,9 +105,14 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
WorkOrderPowerStationMapper workOrderPowerStationMapper; WorkOrderPowerStationMapper workOrderPowerStationMapper;
@Autowired @Autowired
AmosRequestContext requestContext; AmosRequestContext requestContext;
@Autowired @Autowired
WorkflowImpl workflow; WorkflowImpl workflow;
@Value("${power.station.examine.pageId}")
private long pageId;
@Value("${power.station.examine.planId}")
private String planId;
@Autowired
private CommonServiceImpl commonService;
/** /**
* 分页查询 * 分页查询
...@@ -138,11 +125,11 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -138,11 +125,11 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
* 列表查询 示例 * 列表查询 示例
*/ */
public List<SurveyInformationDto> queryForSurveyInformationList() { public List<SurveyInformationDto> queryForSurveyInformationList() {
return this.queryForList("" , false); return this.queryForList("", false);
} }
@Transactional @Transactional
public SurveyInfoAllDto saveSurveyInfo(SurveyInfoAllDto surveyInfoAllDto,String operationType) { public SurveyInfoAllDto saveSurveyInfo(SurveyInfoAllDto surveyInfoAllDto, String operationType) {
try { try {
...@@ -153,7 +140,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -153,7 +140,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
//更新勘察基本信息 //更新勘察基本信息
SurveyInformation surveyInformation = BeanDtoUtils.convert(surveyInfoAllDto.getSurveyInformation(), SurveyInformation.class); SurveyInformation surveyInformation = BeanDtoUtils.convert(surveyInfoAllDto.getSurveyInformation(), SurveyInformation.class);
surveyInformation.setReview(0); surveyInformation.setReview(0);
if(OPERATION_TYPE_APPLY.equals(operationType) && null == surveyInformation.getCreatorTime()){ if (OPERATION_TYPE_APPLY.equals(operationType) && null == surveyInformation.getCreatorTime()) {
surveyInformation.setCreatorTime(new Date()); surveyInformation.setCreatorTime(new Date());
} }
this.saveOrUpdate(surveyInformation); this.saveOrUpdate(surveyInformation);
...@@ -191,11 +178,11 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -191,11 +178,11 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
//更新资料归档信息 //更新资料归档信息
Information information = BeanDtoUtils.convert(surveyInfoAllDto.getInformation(), Information.class); Information information = BeanDtoUtils.convert(surveyInfoAllDto.getInformation(), Information.class);
information.setHouseProve(null == commercial ?null :(CollectionUtil.isNotEmpty(commercial.getRealEstateLegal())? commercial.getRealEstateLegal():null)); information.setHouseProve(null == commercial ? null : (CollectionUtil.isNotEmpty(commercial.getRealEstateLegal()) ? commercial.getRealEstateLegal() : null));
information.setCardFile( null == commercial ?null:(CollectionUtil.isNotEmpty(commercial.getIdCardCredit())? commercial.getIdCardCredit():null)); information.setCardFile(null == commercial ? null : (CollectionUtil.isNotEmpty(commercial.getIdCardCredit()) ? commercial.getIdCardCredit() : null));
information.setCardFile(commercial.getAgentLegal()); information.setCardFile(commercial.getAgentLegal());
information.setArchivesNumber(this.getNo(CodeEnum.档案.getCode(),peasantHousehold.getRegionalCompaniesSeq())); information.setArchivesNumber(this.getNo(CodeEnum.档案.getCode(), peasantHousehold.getRegionalCompaniesSeq()));
information.setFileNumber(this.getNo(CodeEnum.文件.getCode(),peasantHousehold.getRegionalCompaniesSeq())); information.setFileNumber(this.getNo(CodeEnum.文件.getCode(), peasantHousehold.getRegionalCompaniesSeq()));
information.setSurveyInformationId(surveyInformation.getSequenceNbr()); information.setSurveyInformationId(surveyInformation.getSequenceNbr());
informationService.saveOrUpdate(information); informationService.saveOrUpdate(information);
...@@ -231,33 +218,32 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -231,33 +218,32 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
} }
peasantHousehold.setPermanentAddressName(permanentAddressName.substring(0, permanentAddressName.length() - 1)); peasantHousehold.setPermanentAddressName(permanentAddressName.substring(0, permanentAddressName.length() - 1));
if(OPERATION_TYPE_SUBMIT.equals(operationType)){ if (OPERATION_TYPE_SUBMIT.equals(operationType)) {
// peasantHousehold.setSurveyOrNot(1); // peasantHousehold.setSurveyOrNot(1);
}else if(OPERATION_TYPE_APPLY.equals(operationType)){ } else if (OPERATION_TYPE_APPLY.equals(operationType)) {
// 提交审核 // 提交审核
submitExamine(peasantHousehold); submitExamine(peasantHousehold);
LambdaQueryWrapper<ToDoTasks> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ToDoTasks> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ToDoTasks::getType, TaskTypeStationEnum.电站勘察.getCode()); wrapper.eq(ToDoTasks::getType, TaskTypeStationEnum.电站勘察.getCode());
wrapper.eq(ToDoTasks::getState, "待办"); wrapper.eq(ToDoTasks::getState, "待办");
wrapper.eq(ToDoTasks::getBusinessId, peasantHousehold.getSequenceNbr()); wrapper.eq(ToDoTasks::getBusinessId, peasantHousehold.getSequenceNbr());
ToDoTasks doTasks= toDoTasksMapper.selectOne(wrapper); ToDoTasks doTasks = toDoTasksMapper.selectOne(wrapper);
if(doTasks!=null){ if (doTasks != null) {
doTasks.setState("已办"); doTasks.setState("已办");
doTasks.setCompleteTime(new Date()); doTasks.setCompleteTime(new Date());
toDoTasksMapper.updateById(doTasks); toDoTasksMapper.updateById(doTasks);
emqKeeper.getMqttClient().publish("TASK_MESSAGE" ,JSON.toJSONString(doTasks).getBytes(), 2 ,false); emqKeeper.getMqttClient().publish("TASK_MESSAGE", JSON.toJSONString(doTasks).getBytes(), 2, false);
UserMessage userMessage= new UserMessage( doTasks.getType(), doTasks.getBusinessId(), doTasks.getAmosUserId(), new Date(), doTasks.getTaskName()+"已完成", doTasks.getAmosOrgCode()); UserMessage userMessage = new UserMessage(doTasks.getType(), doTasks.getBusinessId(), doTasks.getAmosUserId(), new Date(), doTasks.getTaskName() + "已完成", doTasks.getAmosOrgCode());
userMessageMapper.insert(userMessage); userMessageMapper.insert(userMessage);
emqKeeper.getMqttClient().publish("MY_MESSAGE" ,JSON.toJSONString(userMessage).getBytes(), 2 ,false); emqKeeper.getMqttClient().publish("MY_MESSAGE", JSON.toJSONString(userMessage).getBytes(), 2, false);
} }
} }
peasantHouseholdServiceImpl.saveOrUpdate(peasantHousehold); peasantHouseholdServiceImpl.saveOrUpdate(peasantHousehold);
} catch (Exception e) {
}catch (Exception e){
e.printStackTrace(); e.printStackTrace();
throw new BadRequest("系统异常"); throw new BadRequest("系统异常");
} }
...@@ -265,23 +251,21 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -265,23 +251,21 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
return surveyInfoAllDto; return surveyInfoAllDto;
} }
public String getNo(String type,Long sequenceNbr) { public String getNo(String type, Long sequenceNbr) {
RegionalCompanies da= regionalCompaniesMapper.selectRegionName(sequenceNbr); RegionalCompanies da = regionalCompaniesMapper.selectRegionName(sequenceNbr);
if(da.getCompanyCode()==null||da.getCompanyCode().isEmpty()){ if (da.getCompanyCode() == null || da.getCompanyCode().isEmpty()) {
throw new BadRequest("区域公司编号为空, 请设置编号"); throw new BadRequest("区域公司编号为空, 请设置编号");
} }
if(da.getRegionalAddress()==null||da.getRegionalAddress().isEmpty()){ if (da.getRegionalAddress() == null || da.getRegionalAddress().isEmpty()) {
throw new BadRequest("区域公司省市区为空, 请设置省市区"); throw new BadRequest("区域公司省市区为空, 请设置省市区");
} }
String code= NumberUtil.getCode(type,da.getCompanyCode(),da.getRegionalAddress()); String code = NumberUtil.getCode(type, da.getCompanyCode(), da.getRegionalAddress());
return code; return code;
} }
private void submitExamine(PeasantHousehold peasantHousehold) { private void submitExamine(PeasantHousehold peasantHousehold) {
PowerStation powerStation = powerStationService.getObjByNhId(String.valueOf(peasantHousehold.getSequenceNbr()), PowerStationProcessStateEnum.作废.getCode()); PowerStation powerStation = powerStationService.getObjByNhId(String.valueOf(peasantHousehold.getSequenceNbr()), PowerStationProcessStateEnum.作废.getCode());
String taskId = null; String taskId = null;
...@@ -292,7 +276,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -292,7 +276,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
try { try {
BasicGridAcceptance basicGridAcceptance=new BasicGridAcceptance(); BasicGridAcceptance basicGridAcceptance = new BasicGridAcceptance();
if (ObjectUtils.isNotEmpty(powerStation)) { if (ObjectUtils.isNotEmpty(powerStation)) {
// 工作流执行一步 // 工作流执行一步
// taskId = powerStation.getTaskId(); // taskId = powerStation.getTaskId();
...@@ -311,11 +295,11 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -311,11 +295,11 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
processDto.setBusinessKey(String.valueOf(peasantHousehold.getSequenceNbr())); processDto.setBusinessKey(String.valueOf(peasantHousehold.getSequenceNbr()));
processDto.setProcessDefinitionKey("hygf_10001"); processDto.setProcessDefinitionKey("hygf_10001");
StartProcessDto startProcessDto = new StartProcessDto(); StartProcessDto startProcessDto = new StartProcessDto();
List<ProcessDto> process=new ArrayList<>(); List<ProcessDto> process = new ArrayList<>();
process.add(processDto); process.add(processDto);
startProcessDto.setProcess(process); startProcessDto.setProcess(process);
workflow.startProcess(basicGridAcceptance, startProcessDto,requestContext.getUserId()); workflow.startProcess(basicGridAcceptance, startProcessDto, requestContext.getUserId());
powerStation=new PowerStation(); powerStation = new PowerStation();
} }
peasantHousehold.setSurveyOrNot(2); peasantHousehold.setSurveyOrNot(2);
peasantHousehold.setReview(1); peasantHousehold.setReview(1);
...@@ -338,24 +322,24 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -338,24 +322,24 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
powerStation.setNextExecuteUserIds(basicGridAcceptance.getNextExecuteUserIds()); powerStation.setNextExecuteUserIds(basicGridAcceptance.getNextExecuteUserIds());
powerStation.setNextNodeName(basicGridAcceptance.getNextNodeName()); powerStation.setNextNodeName(basicGridAcceptance.getNextNodeName());
powerStationService.savePowerStation(powerStation, true,powerStation.getOwnersName(),""); powerStationService.savePowerStation(powerStation, true, powerStation.getOwnersName(), "");
// //
peasantHousehold.setConstructionState(ArrivalStateeEnum.勘察中.getCode()); peasantHousehold.setConstructionState(ArrivalStateeEnum.勘察中.getCode());
LambdaUpdateWrapper<PeasantHousehold> up =new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<PeasantHousehold> up = new LambdaUpdateWrapper<>();
up.set(PeasantHousehold::getConstructionState, ArrivalStateeEnum.勘察中.getCode()); up.set(PeasantHousehold::getConstructionState, ArrivalStateeEnum.勘察中.getCode());
long idsk= peasantHousehold.getSequenceNbr(); long idsk = peasantHousehold.getSequenceNbr();
up.eq(PeasantHousehold::getSequenceNbr,idsk); up.eq(PeasantHousehold::getSequenceNbr, idsk);
peasantHouseholdMapper.update(null,up); peasantHouseholdMapper.update(null, up);
//发起待办
commonService.buildTaskModel(buildDZSHTaskModel(peasantHousehold, basicGridAcceptance));
} catch (Exception e) {
} catch (Exception e){
e.printStackTrace(); e.printStackTrace();
throw new BaseException("获取工作流节点失败!","400","获取工作流节点失败!"); throw new BaseException("获取工作流节点失败!", "400", "获取工作流节点失败!");
} }
// PowerStation powerStation = powerStationService.getObjByNhId(String.valueOf(peasantHousehold.getSequenceNbr()), PowerStationProcessStateEnum.作废.getCode()); // PowerStation powerStation = powerStationService.getObjByNhId(String.valueOf(peasantHousehold.getSequenceNbr()), PowerStationProcessStateEnum.作废.getCode());
// //
// String taskId = null; // String taskId = null;
...@@ -404,16 +388,45 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -404,16 +388,45 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
// } // }
} }
public SurveyInfoAllDto querySurveyInfo(String surveyInformationId,String peasantHouseholdId,String processInstanceId,AgencyUserModel userInfo) { private List<TaskModelDto> buildDZSHTaskModel(PeasantHousehold peasantHousehold, BasicGridAcceptance basicGridAcceptance) {
List<TaskModelDto> taskModelDtoList = new ArrayList<>();
TaskModelDto taskModelDto = new TaskModelDto();
taskModelDto.setFlowCode(basicGridAcceptance.getNextTaskId());
taskModelDto.setFlowCreateDate(new Date());
taskModelDto.setFlowStatus(FlowStatusEnum.TO_BE_PROCESSED.getCode());
taskModelDto.setFlowStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName());
taskModelDto.setPageType(null);
taskModelDto.setExecuteUserIds(basicGridAcceptance.getNextExecuteUserIds());
taskModelDto.setModel(peasantHousehold);
taskModelDto.setRelationId(basicGridAcceptance.getInstanceId());
taskModelDto.setRoutePath(null);
taskModelDto.setStartUserId(basicGridAcceptance.getRecUserId());
taskModelDto.setStartUser(basicGridAcceptance.getRecUserName());
taskModelDto.setStartDate(basicGridAcceptance.getRecDate());
taskModelDto.setStartUserCompanyName(peasantHousehold.getRegionalCompaniesName());
taskModelDto.setTaskName(basicGridAcceptance.getNextNodeName());
taskModelDto.setTaskCode(String.valueOf(basicGridAcceptance.getWorkOrderId()));
taskModelDto.setTaskType(BusinessTypeEnum.HYGF_DZ_SH.getCode());
taskModelDto.setTaskTypeLabel(BusinessTypeEnum.HYGF_DZ_SH.getName());
taskModelDto.setTaskStatus(TaskStatusEnum.UNDERWAY.getValue());
taskModelDto.setTaskStatusLabel(TaskStatusEnum.UNDERWAY.getName());
// taskModelDto.setTaskDesc();
// taskModelDto.setTaskContent();
taskModelDto.setNextExecuteUser(basicGridAcceptance.getNextExecutorIds());
taskModelDtoList.add(taskModelDto);
return taskModelDtoList;
}
public SurveyInfoAllDto querySurveyInfo(String surveyInformationId, String peasantHouseholdId, String processInstanceId, AgencyUserModel userInfo) {
SurveyInfoAllDto surveyInfoAllDto = new SurveyInfoAllDto(); SurveyInfoAllDto surveyInfoAllDto = new SurveyInfoAllDto();
PeasantHousehold peasantHousehold = new PeasantHousehold(); PeasantHousehold peasantHousehold = new PeasantHousehold();
if(!StringUtils.isEmpty(peasantHouseholdId)){ if (!StringUtils.isEmpty(peasantHouseholdId)) {
LambdaQueryWrapper<PeasantHousehold> peasantHouseholdWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PeasantHousehold> peasantHouseholdWrapper = new LambdaQueryWrapper<>();
peasantHouseholdWrapper.eq(PeasantHousehold::getSequenceNbr, peasantHouseholdId); peasantHouseholdWrapper.eq(PeasantHousehold::getSequenceNbr, peasantHouseholdId);
peasantHousehold = peasantHouseholdServiceImpl.getBaseMapper().selectOne(peasantHouseholdWrapper); peasantHousehold = peasantHouseholdServiceImpl.getBaseMapper().selectOne(peasantHouseholdWrapper);
surveyInformationId = String.valueOf(peasantHousehold.getSurveyInformationId()); surveyInformationId = String.valueOf(peasantHousehold.getSurveyInformationId());
}else { } else {
QueryWrapper<PeasantHousehold> peasantHouseholdQueryWrapper = new QueryWrapper<>(); QueryWrapper<PeasantHousehold> peasantHouseholdQueryWrapper = new QueryWrapper<>();
peasantHouseholdQueryWrapper.eq("survey_information_id", surveyInformationId); peasantHouseholdQueryWrapper.eq("survey_information_id", surveyInformationId);
peasantHousehold = peasantHouseholdServiceImpl.getBaseMapper().selectOne(peasantHouseholdQueryWrapper); peasantHousehold = peasantHouseholdServiceImpl.getBaseMapper().selectOne(peasantHouseholdQueryWrapper);
...@@ -427,13 +440,13 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -427,13 +440,13 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
//获取用户所在经销商单位 //获取用户所在经销商单位
UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto(peasantHousehold.getDeveloperUserId()); UserUnitInformationDto userUnitInformationDto = personnelBusinessMapper.getUserUnitInformationDto(peasantHousehold.getDeveloperUserId());
BeanUtils.copyProperties(peasantHousehold, surveyInfoAllDto.getSurveyInformation()); BeanUtils.copyProperties(peasantHousehold, surveyInfoAllDto.getSurveyInformation());
surveyInfoAllDto.getSurveyInformation().setDeveloperName(userUnitInformationDto.getAmosDealerName()); surveyInfoAllDto.getSurveyInformation().setDeveloperName(userUnitInformationDto.getAmosDealerName());
surveyInfoAllDto.getSurveyInformation().setDeveloperCode(userUnitInformationDto.getAmosDealerOrgCode()); surveyInfoAllDto.getSurveyInformation().setDeveloperCode(userUnitInformationDto.getAmosDealerOrgCode());
surveyInfoAllDto.getSurveyInformation().setDeveloperId(userUnitInformationDto.getAmosDealerId()); surveyInfoAllDto.getSurveyInformation().setDeveloperId(userUnitInformationDto.getAmosDealerId());
if(surveyInfoAllDto.getSurveyInformation().getSalesmanId()==null){ if (surveyInfoAllDto.getSurveyInformation().getSalesmanId() == null) {
surveyInfoAllDto.getSurveyInformation().setSalesmanId(peasantHousehold.getDeveloperUserId()); surveyInfoAllDto.getSurveyInformation().setSalesmanId(peasantHousehold.getDeveloperUserId());
surveyInfoAllDto.getSurveyInformation().setSalesman(peasantHousehold.getDeveloper()); surveyInfoAllDto.getSurveyInformation().setSalesman(peasantHousehold.getDeveloper());
surveyInfoAllDto.getSurveyInformation().setCreator(peasantHousehold.getDeveloper()); surveyInfoAllDto.getSurveyInformation().setCreator(peasantHousehold.getDeveloper());
...@@ -442,11 +455,11 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -442,11 +455,11 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
if (!StringUtils.isEmpty(peasantHousehold.getProjectAddressName())) { if (!StringUtils.isEmpty(peasantHousehold.getProjectAddressName())) {
surveyInfoAllDto.getSurveyInformation().setProjectAddressText(Arrays.asList(peasantHousehold.getProjectAddressName().split("/"))); surveyInfoAllDto.getSurveyInformation().setProjectAddressText(Arrays.asList(peasantHousehold.getProjectAddressName().split("/")));
} }
if(!StringUtils.isEmpty(peasantHousehold.getPermanentAddressName())){ if (!StringUtils.isEmpty(peasantHousehold.getPermanentAddressName())) {
surveyInfoAllDto.getSurveyInformation().setPermanentAddressText(Arrays.asList(peasantHousehold.getPermanentAddressName().split("/"))); surveyInfoAllDto.getSurveyInformation().setPermanentAddressText(Arrays.asList(peasantHousehold.getPermanentAddressName().split("/")));
} }
if(peasantHousehold.getPermanentAddress() ==null){ if (peasantHousehold.getPermanentAddress() == null) {
surveyInfoAllDto.getSurveyInformation().setPermanentAddress(peasantHousehold.getProjectAddress()); surveyInfoAllDto.getSurveyInformation().setPermanentAddress(peasantHousehold.getProjectAddress());
surveyInfoAllDto.getSurveyInformation().setIsPermanent("1"); surveyInfoAllDto.getSurveyInformation().setIsPermanent("1");
} }
...@@ -460,9 +473,9 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -460,9 +473,9 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
surveyDetailsQueryWrapper.eq("survey_information_id", surveyInformationId); surveyDetailsQueryWrapper.eq("survey_information_id", surveyInformationId);
SurveyDetails surveyDetails = surveyDetailsService.getBaseMapper().selectOne(surveyDetailsQueryWrapper); SurveyDetails surveyDetails = surveyDetailsService.getBaseMapper().selectOne(surveyDetailsQueryWrapper);
if(surveyDetails == null){ if (surveyDetails == null) {
surveyInfoAllDto.setSurveyDetails(new SurveyDetailsDto()); surveyInfoAllDto.setSurveyDetails(new SurveyDetailsDto());
}else { } else {
surveyInfoAllDto.setSurveyDetails(BeanDtoUtils.convert(surveyDetails, SurveyDetailsDto.class)); surveyInfoAllDto.setSurveyDetails(BeanDtoUtils.convert(surveyDetails, SurveyDetailsDto.class));
} }
...@@ -473,15 +486,15 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -473,15 +486,15 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
QueryWrapper<Commercial> commercialQueryWrapper = new QueryWrapper<>(); QueryWrapper<Commercial> commercialQueryWrapper = new QueryWrapper<>();
commercialQueryWrapper.eq("survey_information_id", surveyInformationId); commercialQueryWrapper.eq("survey_information_id", surveyInformationId);
Commercial commercial = commercialService.getBaseMapper().selectOne(commercialQueryWrapper); Commercial commercial = commercialService.getBaseMapper().selectOne(commercialQueryWrapper);
if(commercial==null){ if (commercial == null) {
commercial=new Commercial(); commercial = new Commercial();
} }
if(information == null){ if (information == null) {
surveyInfoAllDto.setInformation(new InformationDto()); surveyInfoAllDto.setInformation(new InformationDto());
}else { } else {
information.setHouseProve(null == commercial ?new ArrayList<>() :(CollectionUtil.isNotEmpty(commercial.getRealEstateLegal())? commercial.getRealEstateLegal():new ArrayList<>())); information.setHouseProve(null == commercial ? new ArrayList<>() : (CollectionUtil.isNotEmpty(commercial.getRealEstateLegal()) ? commercial.getRealEstateLegal() : new ArrayList<>()));
information.setCardFile( null == commercial ?new ArrayList<>() :(CollectionUtil.isNotEmpty(commercial.getIdCardCredit())? commercial.getIdCardCredit():new ArrayList<>())); information.setCardFile(null == commercial ? new ArrayList<>() : (CollectionUtil.isNotEmpty(commercial.getIdCardCredit()) ? commercial.getIdCardCredit() : new ArrayList<>()));
surveyInfoAllDto.setInformation(BeanDtoUtils.convert(information, InformationDto.class)); surveyInfoAllDto.setInformation(BeanDtoUtils.convert(information, InformationDto.class));
} }
...@@ -494,34 +507,34 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -494,34 +507,34 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
commercial.setLegalContactTelephone(peasantHousehold.getTelephone()); commercial.setLegalContactTelephone(peasantHousehold.getTelephone());
List<Object> list = new ArrayList<>(); List<Object> list = new ArrayList<>();
if (null != surveyDetails){ if (null != surveyDetails) {
if (CollectionUtil.isNotEmpty(surveyDetails.getSurroundingHouseSurvey())){ if (CollectionUtil.isNotEmpty(surveyDetails.getSurroundingHouseSurvey())) {
list.addAll(surveyDetails.getSurroundingHouseSurvey()); list.addAll(surveyDetails.getSurroundingHouseSurvey());
} }
if (CollectionUtil.isNotEmpty(surveyDetails.getOverallHousingSurvey())){ if (CollectionUtil.isNotEmpty(surveyDetails.getOverallHousingSurvey())) {
list.addAll(surveyDetails.getOverallHousingSurvey()); list.addAll(surveyDetails.getOverallHousingSurvey());
} }
if (CollectionUtil.isNotEmpty(surveyDetails.getPanoramaSurvey())){ if (CollectionUtil.isNotEmpty(surveyDetails.getPanoramaSurvey())) {
list.addAll(surveyDetails.getPanoramaSurvey()); list.addAll(surveyDetails.getPanoramaSurvey());
} }
if (CollectionUtil.isNotEmpty(surveyDetails.getPlanSketchSurvey())){ if (CollectionUtil.isNotEmpty(surveyDetails.getPlanSketchSurvey())) {
list.addAll(surveyDetails.getPlanSketchSurvey()); list.addAll(surveyDetails.getPlanSketchSurvey());
} }
if (CollectionUtil.isNotEmpty(surveyDetails.getAzimuthSurvey())){ if (CollectionUtil.isNotEmpty(surveyDetails.getAzimuthSurvey())) {
list.addAll(surveyDetails.getAzimuthSurvey()); list.addAll(surveyDetails.getAzimuthSurvey());
} }
} }
commercial.setSurveyPhotosWeb(list); commercial.setSurveyPhotosWeb(list);
if(information == null){ if (information == null) {
CommercialDto commercialDto = BeanDtoUtils.convert(commercial, CommercialDto.class); CommercialDto commercialDto = BeanDtoUtils.convert(commercial, CommercialDto.class);
commercialDto.setType("zrr"); commercialDto.setType("zrr");
commercialDto.setLegalType("zjdnhw"); commercialDto.setLegalType("zjdnhw");
surveyInfoAllDto.setCommercial(commercialDto); surveyInfoAllDto.setCommercial(commercialDto);
}else { } else {
surveyInfoAllDto.setCommercial(BeanDtoUtils.convert(commercial, CommercialDto.class)); surveyInfoAllDto.setCommercial(BeanDtoUtils.convert(commercial, CommercialDto.class));
if(commercial !=null && !StringUtils.isEmpty(commercial.getProjectAddressName())){ if (commercial != null && !StringUtils.isEmpty(commercial.getProjectAddressName())) {
surveyInfoAllDto.getCommercial().setProjectAddressText(Arrays.asList(commercial.getProjectAddressName().split("/"))); surveyInfoAllDto.getCommercial().setProjectAddressText(Arrays.asList(commercial.getProjectAddressName().split("/")));
} }
} }
...@@ -529,48 +542,48 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -529,48 +542,48 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
QueryWrapper<ExtendedInformation> extendedInformationQueryWrapper = new QueryWrapper<>(); QueryWrapper<ExtendedInformation> extendedInformationQueryWrapper = new QueryWrapper<>();
extendedInformationQueryWrapper.eq("survey_information_id", surveyInformationId); extendedInformationQueryWrapper.eq("survey_information_id", surveyInformationId);
ExtendedInformation extendedInformation = extendedInformationService.getBaseMapper().selectOne(extendedInformationQueryWrapper); ExtendedInformation extendedInformation = extendedInformationService.getBaseMapper().selectOne(extendedInformationQueryWrapper);
if(information == null){ if (information == null) {
surveyInfoAllDto.setExtendedInformation(new ExtendedInformationDto()); surveyInfoAllDto.setExtendedInformation(new ExtendedInformationDto());
}else { } else {
surveyInfoAllDto.setExtendedInformation(BeanDtoUtils.convert(extendedInformation, ExtendedInformationDto.class)); surveyInfoAllDto.setExtendedInformation(BeanDtoUtils.convert(extendedInformation, ExtendedInformationDto.class));
} }
QueryWrapper<DesignInformation> designInformationQueryWrapper = new QueryWrapper<>(); QueryWrapper<DesignInformation> designInformationQueryWrapper = new QueryWrapper<>();
designInformationQueryWrapper.eq("peasant_household_id", peasantHousehold.getSequenceNbr()); designInformationQueryWrapper.eq("peasant_household_id", peasantHousehold.getSequenceNbr());
DesignInformation designInformation = designInformationService.getBaseMapper().selectOne(designInformationQueryWrapper); DesignInformation designInformation = designInformationService.getBaseMapper().selectOne(designInformationQueryWrapper);
if(designInformation == null){ if (designInformation == null) {
surveyInfoAllDto.setDesignInformation(new DesignInformationDto()); surveyInfoAllDto.setDesignInformation(new DesignInformationDto());
}else { } else {
surveyInfoAllDto.setDesignInformation(BeanDtoUtils.convert(designInformation, DesignInformationDto.class)); surveyInfoAllDto.setDesignInformation(BeanDtoUtils.convert(designInformation, DesignInformationDto.class));
} }
LambdaQueryWrapper<WorkOrderPowerStation> up1=new LambdaQueryWrapper(); LambdaQueryWrapper<WorkOrderPowerStation> up1 = new LambdaQueryWrapper();
up1.eq(WorkOrderPowerStation::getPeasantHouseholdId,peasantHouseholdId); up1.eq(WorkOrderPowerStation::getPeasantHouseholdId, peasantHouseholdId);
WorkOrderPowerStation workOrderPowerStation= workOrderPowerStationMapper.selectOne(up1); WorkOrderPowerStation workOrderPowerStation = workOrderPowerStationMapper.selectOne(up1);
if(workOrderPowerStation!=null){ if (workOrderPowerStation != null) {
Long workOrderId=workOrderPowerStation.getWorkOrderId(); Long workOrderId = workOrderPowerStation.getWorkOrderId();
Long workOrderPowerStationId=workOrderPowerStation.getSequenceNbr(); Long workOrderPowerStationId = workOrderPowerStation.getSequenceNbr();
//派工单信息 //派工单信息
LambdaQueryWrapper<WorkOrder> upl=new LambdaQueryWrapper(); LambdaQueryWrapper<WorkOrder> upl = new LambdaQueryWrapper();
upl.eq(WorkOrder::getSequenceNbr,workOrderId); upl.eq(WorkOrder::getSequenceNbr, workOrderId);
WorkOrder workOrder= workOrderMapper.selectOne(upl); WorkOrder workOrder = workOrderMapper.selectOne(upl);
//施工信息 //施工信息
LambdaQueryWrapper<PowerStationConstructionData> up2=new LambdaQueryWrapper(); LambdaQueryWrapper<PowerStationConstructionData> up2 = new LambdaQueryWrapper();
up2.eq(PowerStationConstructionData::getWorkOrderId,workOrderId); up2.eq(PowerStationConstructionData::getWorkOrderId, workOrderId);
up2.eq(PowerStationConstructionData::getWorkOrderPowerStationId,workOrderPowerStationId); up2.eq(PowerStationConstructionData::getWorkOrderPowerStationId, workOrderPowerStationId);
PowerStationConstructionData powerStationConstructionData=powerStationConstructionDataMapper.selectOne(up2); PowerStationConstructionData powerStationConstructionData = powerStationConstructionDataMapper.selectOne(up2);
//工程信息 //工程信息
LambdaQueryWrapper<PowerStationEngineeringInfo> up3=new LambdaQueryWrapper(); LambdaQueryWrapper<PowerStationEngineeringInfo> up3 = new LambdaQueryWrapper();
up3.eq(PowerStationEngineeringInfo::getWorkOrderId,workOrderId); up3.eq(PowerStationEngineeringInfo::getWorkOrderId, workOrderId);
up3.eq(PowerStationEngineeringInfo::getWorkOrderPowerStationId,workOrderPowerStationId); up3.eq(PowerStationEngineeringInfo::getWorkOrderPowerStationId, workOrderPowerStationId);
PowerStationEngineeringInfo powerStationEngineeringInfo=powerStationEngineeringInfoMapper.selectOne(up3); PowerStationEngineeringInfo powerStationEngineeringInfo = powerStationEngineeringInfoMapper.selectOne(up3);
if(powerStationConstructionData!=null){ if (powerStationConstructionData != null) {
powerStationEngineeringInfo=powerStationEngineeringInfo!=null?powerStationEngineeringInfo:new PowerStationEngineeringInfo(); powerStationEngineeringInfo = powerStationEngineeringInfo != null ? powerStationEngineeringInfo : new PowerStationEngineeringInfo();
powerStationEngineeringInfo.setConstructionComponentInfo(powerStationConstructionData.getConstructionComponentInfo()); powerStationEngineeringInfo.setConstructionComponentInfo(powerStationConstructionData.getConstructionComponentInfo());
powerStationEngineeringInfo.setConstructionInverterInfo(powerStationConstructionData.getConstructionInverterInfo()); powerStationEngineeringInfo.setConstructionInverterInfo(powerStationConstructionData.getConstructionInverterInfo());
powerStationEngineeringInfo.setConstructionCollectorBoxInfo(powerStationConstructionData.getConstructionCollectorBoxInfo()); powerStationEngineeringInfo.setConstructionCollectorBoxInfo(powerStationConstructionData.getConstructionCollectorBoxInfo());
...@@ -581,15 +594,15 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -581,15 +594,15 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
powerStationEngineeringInfo.setConstructionRegionManagerPhone(workOrder.getConstructionRegionManagerPhone()); powerStationEngineeringInfo.setConstructionRegionManagerPhone(workOrder.getConstructionRegionManagerPhone());
} }
//并网信息 //并网信息
LambdaQueryWrapper<HygfOnGrid> up4=new LambdaQueryWrapper(); LambdaQueryWrapper<HygfOnGrid> up4 = new LambdaQueryWrapper();
up4.eq(HygfOnGrid::getWorkOrderId,workOrderId); up4.eq(HygfOnGrid::getWorkOrderId, workOrderId);
up4.eq(HygfOnGrid::getWorkOrderPowerStationId,workOrderPowerStationId); up4.eq(HygfOnGrid::getWorkOrderPowerStationId, workOrderPowerStationId);
HygfOnGrid hygfOnGrid=hygfOnGridMapper.selectOne(up4); HygfOnGrid hygfOnGrid = hygfOnGridMapper.selectOne(up4);
surveyInfoAllDto.setHygfOnGrid(hygfOnGrid!=null?hygfOnGrid:new HygfOnGrid()); surveyInfoAllDto.setHygfOnGrid(hygfOnGrid != null ? hygfOnGrid : new HygfOnGrid());
surveyInfoAllDto.setPowerStationConstructionData(powerStationConstructionData!=null?powerStationConstructionData:new PowerStationConstructionData()); surveyInfoAllDto.setPowerStationConstructionData(powerStationConstructionData != null ? powerStationConstructionData : new PowerStationConstructionData());
surveyInfoAllDto.setPowerStationEngineeringInfo(powerStationEngineeringInfo!=null?powerStationEngineeringInfo:new PowerStationEngineeringInfo()); surveyInfoAllDto.setPowerStationEngineeringInfo(powerStationEngineeringInfo != null ? powerStationEngineeringInfo : new PowerStationEngineeringInfo());
surveyInfoAllDto.setWorkOrder(workOrder!=null?workOrder:new WorkOrder()); surveyInfoAllDto.setWorkOrder(workOrder != null ? workOrder : new WorkOrder());
}else{ } else {
surveyInfoAllDto.setHygfOnGrid(new HygfOnGrid()); surveyInfoAllDto.setHygfOnGrid(new HygfOnGrid());
surveyInfoAllDto.setPowerStationConstructionData(new PowerStationConstructionData()); surveyInfoAllDto.setPowerStationConstructionData(new PowerStationConstructionData());
surveyInfoAllDto.setPowerStationEngineeringInfo(new PowerStationEngineeringInfo()); surveyInfoAllDto.setPowerStationEngineeringInfo(new PowerStationEngineeringInfo());
...@@ -597,34 +610,33 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -597,34 +610,33 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
} }
if (!StringUtils.isEmpty(processInstanceId)) {
if(!StringUtils.isEmpty(processInstanceId)){
try { try {
Map<String, Object> flowLoggerMap = workflowFeignClient.getFlowLogger(processInstanceId).getResult(); Map<String, Object> flowLoggerMap = workflowFeignClient.getFlowLogger(processInstanceId).getResult();
List<LinkedHashMap> flowLogger = (List<LinkedHashMap>) flowLoggerMap.get("flowLogger"); List<LinkedHashMap> flowLogger = (List<LinkedHashMap>) flowLoggerMap.get("flowLogger");
if (flowLogger.size() > 0 ){ if (flowLogger.size() > 0) {
Collections.reverse(flowLogger); Collections.reverse(flowLogger);
} }
List<LinkedHashMap> flowLoggernew =new ArrayList<>(); List<LinkedHashMap> flowLoggernew = new ArrayList<>();
for (LinkedHashMap linkedHashMap : flowLogger) { for (LinkedHashMap linkedHashMap : flowLogger) {
if(linkedHashMap.get("operateDate")!=null&&!linkedHashMap.get("operateDate").toString().isEmpty()){ if (linkedHashMap.get("operateDate") != null && !linkedHashMap.get("operateDate").toString().isEmpty()) {
LinkedHashMap linke=new LinkedHashMap(); LinkedHashMap linke = new LinkedHashMap();
linke.put("approvalStatue",linkedHashMap.get("approvalStatue").toString()); linke.put("approvalStatue", linkedHashMap.get("approvalStatue").toString());
//审核意见 //审核意见
List<LinkedHashMap> approvalSuggestion = (List<LinkedHashMap>)linkedHashMap.get("approvalSuggestion"); List<LinkedHashMap> approvalSuggestion = (List<LinkedHashMap>) linkedHashMap.get("approvalSuggestion");
if(approvalSuggestion!=null&&!approvalSuggestion.isEmpty()){ if (approvalSuggestion != null && !approvalSuggestion.isEmpty()) {
linke.put("approvalSuggestion",approvalSuggestion.get(0).get("message")); linke.put("approvalSuggestion", approvalSuggestion.get(0).get("message"));
} }
linke.put("taskName",linkedHashMap.get("taskName").toString()); linke.put("taskName", linkedHashMap.get("taskName").toString());
linke.put("operator",linkedHashMap.get("operator").toString()); linke.put("operator", linkedHashMap.get("operator").toString());
linke.put("operateDate",linkedHashMap.get("operateDate").toString()); linke.put("operateDate", linkedHashMap.get("operateDate").toString());
flowLoggernew.add(linke); flowLoggernew.add(linke);
} }
} }
LoggerDto loggerDto =new LoggerDto(); LoggerDto loggerDto = new LoggerDto();
loggerDto.setLogger(flowLoggernew); loggerDto.setLogger(flowLoggernew);
surveyInfoAllDto.setOrderTracking(loggerDto); surveyInfoAllDto.setOrderTracking(loggerDto);
} catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
...@@ -632,20 +644,20 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -632,20 +644,20 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
} }
public JSONArray getRegionName(){ public JSONArray getRegionName() {
JSONArray jsonArray = new JSONArray(); JSONArray jsonArray = new JSONArray();
if (redisUtils.hasKey(regionRedis)) { if (redisUtils.hasKey(regionRedis)) {
jsonArray= JSONArray.parseArray(redisUtils.get(regionRedis).toString()); jsonArray = JSONArray.parseArray(redisUtils.get(regionRedis).toString());
}else { } else {
Collection<RegionModel> regionChild = new ArrayList<>(); Collection<RegionModel> regionChild = new ArrayList<>();
RegionModel regionModel1 = new RegionModel(); RegionModel regionModel1 = new RegionModel();
regionChild.add(regionModel1); regionChild.add(regionModel1);
FeignClientResult<Collection<RegionModel>> collectionFeignClientResult = Systemctl.regionClient.queryForTreeParent(610000L); FeignClientResult<Collection<RegionModel>> collectionFeignClientResult = Systemctl.regionClient.queryForTreeParent(610000L);
Collection<RegionModel> result = collectionFeignClientResult.getResult(); Collection<RegionModel> result = collectionFeignClientResult.getResult();
for (RegionModel regionModel : result) { for (RegionModel regionModel : result) {
if(regionModel.getChildren()!=null&&!regionModel.getChildren().isEmpty()){ if (regionModel.getChildren() != null && !regionModel.getChildren().isEmpty()) {
for (RegionModel child : regionModel.getChildren()) { for (RegionModel child : regionModel.getChildren()) {
if(child.getChildren()!=null&&!child.getChildren().isEmpty()){ if (child.getChildren() != null && !child.getChildren().isEmpty()) {
for (RegionModel childChild : child.getChildren()) { for (RegionModel childChild : child.getChildren()) {
jsonArray.add(childChild); jsonArray.add(childChild);
} }
...@@ -660,7 +672,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -660,7 +672,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
jsonArray.add(regionModel); jsonArray.add(regionModel);
} }
redisUtils.set(regionRedis,jsonArray); redisUtils.set(regionRedis, jsonArray);
} }
return jsonArray; return jsonArray;
} }
......
package com.yeejoin.amos.boot.module.hygf.biz.service.impl; package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -10,7 +8,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -10,7 +8,10 @@ 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;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.hygf.api.Enum.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.DealerReviewEnum; import com.yeejoin.amos.boot.module.hygf.api.Enum.DealerReviewEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.FlowStatusEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.TaskStatusEnum;
import com.yeejoin.amos.boot.module.hygf.api.dto.*; import com.yeejoin.amos.boot.module.hygf.api.dto.*;
import com.yeejoin.amos.boot.module.hygf.api.entity.*; import com.yeejoin.amos.boot.module.hygf.api.entity.*;
import com.yeejoin.amos.boot.module.hygf.api.fegin.IdxFeginService; import com.yeejoin.amos.boot.module.hygf.api.fegin.IdxFeginService;
...@@ -28,7 +29,6 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel; ...@@ -28,7 +29,6 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel; import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import com.yeejoin.amos.feign.systemctl.model.SmsRecordModel;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -53,22 +53,21 @@ import java.util.stream.Stream; ...@@ -53,22 +53,21 @@ import java.util.stream.Stream;
* @date 2023-07-07 * @date 2023-07-07
*/ */
@Service @Service
public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitInfoMapper> implements IUnitInfoService { public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, UnitInfoMapper> implements IUnitInfoService {
private static final String regionRedis = "app_region_redis";
private static final String OPERATION_TYPE_SUBMIT = "submit";
private static final String OPERATION_TYPE_APPLY = "apply";
private static final String IDX_REQUEST_STATE = "200";
private static final String VERIFY_RESULT_YES = "0";
private static final String VERIFY_RESULT_NO = "1";
private static final String SMSTEMPCODENO = "SMS_HYGF_0003";
private static final String SMSTEMPCODEYES = "SMS_HYGF_0004";
String COMPANY_TREE_REDIS_KEY = "REGULATOR_UNIT_TREE"; String COMPANY_TREE_REDIS_KEY = "REGULATOR_UNIT_TREE";
@Value("${regulator.unit.code}")
private String code;
@Value("${dealer.appcode}")
private String appCodes;
@Autowired @Autowired
RedisUtils redisUtil; RedisUtils redisUtil;
@Autowired @Autowired
PrivilegeFeginService privilegeFeginService; PrivilegeFeginService privilegeFeginService;
@Autowired @Autowired
CommerceInfoServiceImpl commerceInfoService; CommerceInfoServiceImpl commerceInfoService;
@Autowired @Autowired
...@@ -85,55 +84,55 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -85,55 +84,55 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
PublicAgencyUserMapper publicAgencyUserMapper; PublicAgencyUserMapper publicAgencyUserMapper;
@Autowired @Autowired
IDealerReviewService dealerReviewService; IDealerReviewService dealerReviewService;
@Value("${hygf.user.group.id}")
private long userGroupId;
@Value("${regionalCompanies.company.seq}")
private Long regionalCompanies;
@Autowired @Autowired
IdxFeginService idxFeginService; IdxFeginService idxFeginService;
private static final String regionRedis="app_region_redis";
private static final String OPERATION_TYPE_SUBMIT="submit";
private static final String OPERATION_TYPE_APPLY="apply";
private static final String IDX_REQUEST_STATE="200";
private static final String VERIFY_RESULT_YES="0";
private static final String VERIFY_RESULT_NO="1";
@Autowired @Autowired
DealerReviewMapper dealerReviewMapper; DealerReviewMapper dealerReviewMapper;
@Value("${power.station.examine.pageId}")
private long pageId;
@Autowired @Autowired
AmosRequestContext requestContext; AmosRequestContext requestContext;
@Autowired
PersonnelBusinessMapper personnelBusinessMapper;
@Autowired
WorkflowImpl workflow;
@Autowired
UserEmpowerMapper userEmpowerMapper;
@Value("${regulator.unit.code}")
private String code;
@Value("${dealer.appcode}")
private String appCodes;
@Value("${hygf.user.group.id}")
private long userGroupId;
@Value("${regionalCompanies.company.seq}")
private Long regionalCompanies;
@Value("${power.station.examine.pageId}")
private long pageId;
@Value("${unitInfo.station.examine.planId}") @Value("${unitInfo.station.examine.planId}")
private String planId; private String planId;
@Value("${amos.system.user.product}") @Value("${amos.system.user.product}")
private String AMOS_STUDIO_WEB; private String AMOS_STUDIO_WEB;
@Value("${amos.system.user.app-key}") @Value("${amos.system.user.app-key}")
private String AMOS_STUDIO; private String AMOS_STUDIO;
@Value("${hygf.sms.tempCodeJXS}") @Value("${hygf.sms.tempCodeJXS}")
private String smsTempCode; private String smsTempCode;
@Value("${dealer.managementUnitId}") @Value("${dealer.managementUnitId}")
private String managementUnitId; private String managementUnitId;
@Value("${dealer.roleId}") @Value("${dealer.roleId}")
private String roleId; private String roleId;
@Autowired @Autowired
PersonnelBusinessMapper personnelBusinessMapper; private CommonServiceImpl commonService;
@Autowired
WorkflowImpl workflow;
@Autowired
UserEmpowerMapper userEmpowerMapper;
private static final String SMSTEMPCODENO="SMS_HYGF_0003"; private static List<LinkedHashMap> findNodesByCondition(List<LinkedHashMap> nodes, String conditionName,
String condition, String childName) {
return nodes.stream()
.flatMap(node -> Stream.concat(
node.get(conditionName).equals(condition) ? Stream.of(node) : Stream.empty(),
node.get(childName) != null ? findNodesByCondition((List<LinkedHashMap>) node.get(childName),
conditionName, condition, condition).stream() :
Stream.empty()
))
.collect(Collectors.toList());
}
private static final String SMSTEMPCODEYES="SMS_HYGF_0004";
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -145,7 +144,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -145,7 +144,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
* 列表查询 示例 * 列表查询 示例
*/ */
public List<UnitInfoDto> queryForUnitInfoList() { public List<UnitInfoDto> queryForUnitInfoList() {
return this.queryForList("" , false); return this.queryForList("", false);
} }
@Override @Override
...@@ -179,7 +178,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -179,7 +178,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
commerceInfo.setUnitSeq(regUnitInfo.getSequenceNbr()); commerceInfo.setUnitSeq(regUnitInfo.getSequenceNbr());
commerceInfo = commerceInfoService.createWithModel(commerceInfo); commerceInfo = commerceInfoService.createWithModel(commerceInfo);
List<RegionalCompanies> regionalCompanies= regUnitInfo.getRegionalCompanies(); List<RegionalCompanies> regionalCompanies = regUnitInfo.getRegionalCompanies();
for (RegionalCompanies regionalCompany : regionalCompanies) { for (RegionalCompanies regionalCompany : regionalCompanies) {
regionalCompany.setUnitId(regUnitInfo.getAmosCompanySeq()); regionalCompany.setUnitId(regUnitInfo.getAmosCompanySeq());
regionalCompany.setUnitInfoId(regUnitInfo.getSequenceNbr()); regionalCompany.setUnitInfoId(regUnitInfo.getSequenceNbr());
...@@ -231,20 +230,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -231,20 +230,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
return model; return model;
} }
private static List<LinkedHashMap> findNodesByCondition(List<LinkedHashMap> nodes, String conditionName,
String condition, String childName) {
return nodes.stream()
.flatMap(node -> Stream.concat(
node.get(conditionName).equals(condition) ? Stream.of(node) : Stream.empty(),
node.get(childName) != null ? findNodesByCondition((List<LinkedHashMap>) node.get(childName),
conditionName, condition, condition).stream() :
Stream.empty()
))
.collect(Collectors.toList());
}
private List<LinkedHashMap> creatTree() { private List<LinkedHashMap> creatTree() {
FeignClientResult tree = privilegeFeginService.tree(RequestContext.getToken(),RequestContext.getAppKey(),RequestContext.getProduct()); FeignClientResult tree = privilegeFeginService.tree(RequestContext.getToken(), RequestContext.getAppKey(), RequestContext.getProduct());
List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult(); List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult();
List<LinkedHashMap> treeData = deleteRegulatorTreeData(result); List<LinkedHashMap> treeData = deleteRegulatorTreeData(result);
List<LinkedHashMap> supervisionTree = treeData.stream().filter(e -> code.equals(e.get("orgCode"))).collect(Collectors.toList()); List<LinkedHashMap> supervisionTree = treeData.stream().filter(e -> code.equals(e.get("orgCode"))).collect(Collectors.toList());
...@@ -320,8 +307,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -320,8 +307,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
companyInfo.setLandlinePhone(regUnitInfo.getHeadPhone()); companyInfo.setLandlinePhone(regUnitInfo.getHeadPhone());
FeignClientResult<CompanyModel> companyResult = Privilege.companyClient.create(companyInfo); FeignClientResult<CompanyModel> companyResult = Privilege.companyClient.create(companyInfo);
if (companyResult == null || companyResult.getStatus()!=200) { if (companyResult == null || companyResult.getStatus() != 200) {
throw new BadRequest("单位注册失败!"+companyResult.getDevMessage()); throw new BadRequest("单位注册失败!" + companyResult.getDevMessage());
} }
String adminUserName = regUnitInfo.getAdminUserName(); String adminUserName = regUnitInfo.getAdminUserName();
...@@ -357,8 +344,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -357,8 +344,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
agencyUserModel.setOrgRoleSeqs(roleSeqMap); agencyUserModel.setOrgRoleSeqs(roleSeqMap);
userResult = Privilege.agencyUserClient.create(agencyUserModel); userResult = Privilege.agencyUserClient.create(agencyUserModel);
if (userResult == null || userResult.getStatus()!=200) { if (userResult == null || userResult.getStatus() != 200) {
throw new BadRequest("单位注册失败!"+userResult.getDevMessage()); throw new BadRequest("单位注册失败!" + userResult.getDevMessage());
} }
regUnitInfo.setAdminUserId(userResult.getResult().getUserId()); regUnitInfo.setAdminUserId(userResult.getResult().getUserId());
regUnitInfo.setAmosCompanySeq(companyInfo.getSequenceNbr()); regUnitInfo.setAmosCompanySeq(companyInfo.getSequenceNbr());
...@@ -403,8 +390,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -403,8 +390,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
companyInfo.setLandlinePhone(regUnitInfo.getHeadPhone()); companyInfo.setLandlinePhone(regUnitInfo.getHeadPhone());
FeignClientResult<CompanyModel> companyResult = Privilege.companyClient.create(companyInfo); FeignClientResult<CompanyModel> companyResult = Privilege.companyClient.create(companyInfo);
if (companyResult == null || companyResult.getStatus()!=200) { if (companyResult == null || companyResult.getStatus() != 200) {
throw new BadRequest("单位注册失败!"+companyResult.getDevMessage()); throw new BadRequest("单位注册失败!" + companyResult.getDevMessage());
} }
String adminUserName = regUnitInfo.getAdminUserName(); String adminUserName = regUnitInfo.getAdminUserName();
...@@ -440,8 +427,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -440,8 +427,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
agencyUserModel.setOrgRoleSeqs(roleSeqMap); agencyUserModel.setOrgRoleSeqs(roleSeqMap);
userResult = Privilege.agencyUserClient.create(agencyUserModel); userResult = Privilege.agencyUserClient.create(agencyUserModel);
if (userResult == null || userResult.getStatus()!=200) { if (userResult == null || userResult.getStatus() != 200) {
throw new BadRequest("单位注册失败!"+userResult.getDevMessage()); throw new BadRequest("单位注册失败!" + userResult.getDevMessage());
} }
regUnitInfo.setAdminUserId(userResult.getResult().getUserId()); regUnitInfo.setAdminUserId(userResult.getResult().getUserId());
regUnitInfo.setAmosCompanySeq(companyInfo.getSequenceNbr()); regUnitInfo.setAmosCompanySeq(companyInfo.getSequenceNbr());
...@@ -465,18 +452,17 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -465,18 +452,17 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
} }
public UnitInfoDto createWithModelnew(UnitInfoDto regUnitInfo){ public UnitInfoDto createWithModelnew(UnitInfoDto regUnitInfo) {
regUnitInfo.setBlacklist(1); regUnitInfo.setBlacklist(1);
regUnitInfo.setAuditStatus(1); regUnitInfo.setAuditStatus(1);
regUnitInfo.setManagementUnit("经销商事业部"); regUnitInfo.setManagementUnit("经销商事业部");
regUnitInfo= this.createWithModel(regUnitInfo); regUnitInfo = this.createWithModel(regUnitInfo);
this.submitExamine(regUnitInfo); this.submitExamine(regUnitInfo);
return regUnitInfo; return regUnitInfo;
} }
private void submitExamine( UnitInfoDto regUnitInfo) { private void submitExamine(UnitInfoDto regUnitInfo) {
String taskId = null; String taskId = null;
...@@ -493,11 +479,11 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -493,11 +479,11 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
processDto.setBusinessKey(String.valueOf(regUnitInfo.getSequenceNbr())); processDto.setBusinessKey(String.valueOf(regUnitInfo.getSequenceNbr()));
processDto.setProcessDefinitionKey("JXS_SH"); processDto.setProcessDefinitionKey("JXS_SH");
StartProcessDto startProcessDto = new StartProcessDto(); StartProcessDto startProcessDto = new StartProcessDto();
List<ProcessDto> process=new ArrayList<>(); List<ProcessDto> process = new ArrayList<>();
process.add(processDto); process.add(processDto);
startProcessDto.setProcess(process); startProcessDto.setProcess(process);
BasicGridAcceptance basicGridAcceptance=new BasicGridAcceptance(); BasicGridAcceptance basicGridAcceptance = new BasicGridAcceptance();
workflow.startProcessnew(AMOS_STUDIO, AMOS_STUDIO_WEB,requestContext.getToken(),basicGridAcceptance, startProcessDto,requestContext.getUserId()); workflow.startProcessnew(AMOS_STUDIO, AMOS_STUDIO_WEB, requestContext.getToken(), basicGridAcceptance, startProcessDto, requestContext.getUserId());
// 插入记录表 // 插入记录表
dealerReview.setPlanInstanceId(planId); dealerReview.setPlanInstanceId(planId);
dealerReview.setUnitInfoId(regUnitInfo.getSequenceNbr()); dealerReview.setUnitInfoId(regUnitInfo.getSequenceNbr());
...@@ -506,15 +492,15 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -506,15 +492,15 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
dealerReview.setFlowTaskId(basicGridAcceptance.getNextTaskId()); dealerReview.setFlowTaskId(basicGridAcceptance.getNextTaskId());
dealerReview.setNodeRole(basicGridAcceptance.getNextExecutorIds()); dealerReview.setNodeRole(basicGridAcceptance.getNextExecutorIds());
dealerReview.setNextProcessNode(DealerReviewEnum.经销商管理员审核.getCode()); dealerReview.setNextProcessNode(DealerReviewEnum.经销商管理员审核.getCode());
dealerReviewService.saveDealerReview(dealerReview,true,false,regUnitInfo.getName(),"任务明细:经销商已上传信息"); dealerReviewService.saveDealerReview(dealerReview, true, false, regUnitInfo.getName(), "任务明细:经销商已上传信息");
} catch (Exception e){ //发起待办
throw new BaseException("获取工作流节点失败!","400","获取工作流节点失败!"); commonService.buildTaskModel(buildJXSSHTaskModel(regUnitInfo, basicGridAcceptance));
} catch (Exception e) {
throw new BaseException("获取工作流节点失败!", "400", "获取工作流节点失败!");
} }
// //
// String taskId = null; // String taskId = null;
// Map<String, Object> objectMap = new HashMap<>(1); // Map<String, Object> objectMap = new HashMap<>(1);
...@@ -553,6 +539,40 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -553,6 +539,40 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
// } // }
} }
/**
*
* @param regUnitInfo
* @param basicGridAcceptance
*/
private List<TaskModelDto> buildJXSSHTaskModel(UnitInfoDto regUnitInfo, BasicGridAcceptance basicGridAcceptance) {
List<TaskModelDto> taskModelDtoList = new ArrayList<>();
TaskModelDto taskModelDto = new TaskModelDto();
taskModelDto.setFlowCode(basicGridAcceptance.getNextTaskId());
taskModelDto.setFlowCreateDate(new Date());
taskModelDto.setFlowStatus(FlowStatusEnum.TO_BE_PROCESSED.getCode());
taskModelDto.setFlowStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName());
taskModelDto.setPageType(null);
taskModelDto.setExecuteUserIds(basicGridAcceptance.getNextExecuteUserIds());
taskModelDto.setModel(regUnitInfo);
taskModelDto.setRelationId(basicGridAcceptance.getInstanceId());
taskModelDto.setRoutePath(null);
taskModelDto.setStartUserId(basicGridAcceptance.getRecUserId());
taskModelDto.setStartUser(basicGridAcceptance.getRecUserName());
taskModelDto.setStartDate(basicGridAcceptance.getRecDate());
taskModelDto.setStartUserCompanyName(regUnitInfo.getRegionalCompaniesName());
taskModelDto.setTaskName(basicGridAcceptance.getNextNodeName());
taskModelDto.setTaskCode(String.valueOf(basicGridAcceptance.getWorkOrderId()));
taskModelDto.setTaskType(BusinessTypeEnum.HYGF_JXS_SH.getCode());
taskModelDto.setTaskTypeLabel(BusinessTypeEnum.HYGF_JXS_SH.getName());
taskModelDto.setTaskStatus(TaskStatusEnum.UNDERWAY.getValue());
taskModelDto.setTaskStatusLabel(TaskStatusEnum.UNDERWAY.getName());
// taskModelDto.setTaskDesc();
// taskModelDto.setTaskContent();
taskModelDto.setNextExecuteUser(basicGridAcceptance.getNextExecutorIds());
taskModelDtoList.add(taskModelDto);
return taskModelDtoList;
}
@Override @Override
...@@ -560,12 +580,12 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -560,12 +580,12 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
public String powerStationExamine(long pageId, String nodeCode, String stationId, String taskId, String planInstanceId, Map<String, Object> kv) { public String powerStationExamine(long pageId, String nodeCode, String stationId, String taskId, String planInstanceId, Map<String, Object> kv) {
// 2.更新审核记录表 // 2.更新审核记录表
UnitInfo unitInfo=null; UnitInfo unitInfo = null;
try{ try {
DealerReview dealerReview= dealerReviewMapper.selectOne(new QueryWrapper<DealerReview>().eq("unit_info_id", stationId)); DealerReview dealerReview = dealerReviewMapper.selectOne(new QueryWrapper<DealerReview>().eq("unit_info_id", stationId));
unitInfo= this.getById(stationId); unitInfo = this.getById(stationId);
DealerReviewEnum nodeByCode = DealerReviewEnum.getNodeByCode(nodeCode); DealerReviewEnum nodeByCode = DealerReviewEnum.getNodeByCode(nodeCode);
String approvalStatue=""; String approvalStatue = "";
if (DealerReviewEnum.经销商管理员审核.getCode().equals(nodeCode)) { if (DealerReviewEnum.经销商管理员审核.getCode().equals(nodeCode)) {
String result = String.valueOf(kv.get("approvalStatus")); String result = String.valueOf(kv.get("approvalStatus"));
if (VERIFY_RESULT_NO.equals(result)) { if (VERIFY_RESULT_NO.equals(result)) {
...@@ -574,41 +594,41 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -574,41 +594,41 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
//发送断线 //发送断线
Boolean flag = true; Boolean flag = true;
HashMap<String, String> params = new HashMap<>(3); HashMap<String, String> params = new HashMap<>(3);
String meg= String.valueOf(kv.get("approveInfo")); String meg = String.valueOf(kv.get("approveInfo"));
params.put("code","不通过"); params.put("code", "不通过");
params.put("mobile",unitInfo.getAdminPhone()); params.put("mobile", unitInfo.getAdminPhone());
params.put("smsCode", SMSTEMPCODENO); params.put("smsCode", SMSTEMPCODENO);
approvalStatue="任务明细:"+DealerReviewEnum.经销商管理员审核.getName()+"审核不通过"; approvalStatue = "任务明细:" + DealerReviewEnum.经销商管理员审核.getName() + "审核不通过";
// FeignClientResult<SmsRecordModel> date= Systemctl.smsClient.sendCommonSms(params); // FeignClientResult<SmsRecordModel> date= Systemctl.smsClient.sendCommonSms(params);
// System.out.println("短信通知============================"+JSON.toJSONString(date)); // System.out.println("短信通知============================"+JSON.toJSONString(date));
}else{ } else {
// 1. 更新经销商状态 // 1. 更新经销商状态
unitInfo.setAuditStatus(2); unitInfo.setAuditStatus(2);
unitInfo.setBlacklist(0); unitInfo.setBlacklist(0);
this.createCompanyAndUsernew(unitInfo); this.createCompanyAndUsernew(unitInfo);
PublicAgencyUser publicAgencyUser=new PublicAgencyUser(); PublicAgencyUser publicAgencyUser = new PublicAgencyUser();
publicAgencyUser.setAmosUserId(unitInfo.getAdminUserId()); publicAgencyUser.setAmosUserId(unitInfo.getAdminUserId());
publicAgencyUser.setAmosUserName(unitInfo.getAdminLoginName()); publicAgencyUser.setAmosUserName(unitInfo.getAdminLoginName());
publicAgencyUser.setRealName(unitInfo.getAdminLoginName()); publicAgencyUser.setRealName(unitInfo.getAdminLoginName());
publicAgencyUser.setRole("["+unitInfo.getRoleId()+"]"); publicAgencyUser.setRole("[" + unitInfo.getRoleId() + "]");
publicAgencyUser.setEmergencyTelephone(unitInfo.getAdminPhone()); publicAgencyUser.setEmergencyTelephone(unitInfo.getAdminPhone());
publicAgencyUser.setLockStatus("UNLOCK"); publicAgencyUser.setLockStatus("UNLOCK");
publicAgencyUserMapper.insert(publicAgencyUser); publicAgencyUserMapper.insert(publicAgencyUser);
List<String> lis=new ArrayList<>(); List<String> lis = new ArrayList<>();
// lis.add(unitInfo.getAmosCompanyCode()); // lis.add(unitInfo.getAmosCompanyCode());
LambdaQueryWrapper<RegionalCompanies> queryWrapper = new LambdaQueryWrapper<RegionalCompanies>(); LambdaQueryWrapper<RegionalCompanies> queryWrapper = new LambdaQueryWrapper<RegionalCompanies>();
queryWrapper.eq(RegionalCompanies::getUnitInfoId, unitInfo.getSequenceNbr()); queryWrapper.eq(RegionalCompanies::getUnitInfoId, unitInfo.getSequenceNbr());
List<RegionalCompanies> list= regionalCompaniesMapper.selectList(queryWrapper); List<RegionalCompanies> list = regionalCompaniesMapper.selectList(queryWrapper);
for (RegionalCompanies companies : list) { for (RegionalCompanies companies : list) {
companies.setUnitId(unitInfo.getAmosCompanySeq()); companies.setUnitId(unitInfo.getAmosCompanySeq());
lis.add(companies.getRegionalCompaniesCode()); lis.add(companies.getRegionalCompaniesCode());
} }
regionalCompaniesService.saveOrUpdateBatch(list); regionalCompaniesService.saveOrUpdateBatch(list);
PersonnelBusiness re=new PersonnelBusiness(); PersonnelBusiness re = new PersonnelBusiness();
re.setAmosDealerId(unitInfo.getAmosCompanySeq()); re.setAmosDealerId(unitInfo.getAmosCompanySeq());
re.setAmosUnitId(unitInfo.getAmosCompanySeq()); re.setAmosUnitId(unitInfo.getAmosCompanySeq());
re.setAmosUnitName(unitInfo.getName()); re.setAmosUnitName(unitInfo.getName());
...@@ -618,14 +638,14 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -618,14 +638,14 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
personnelBusinessMapper.insert(re); personnelBusinessMapper.insert(re);
//管理员绑定角色权限 //管理员绑定角色权限
StdUserEmpower stdUserEmpower=new StdUserEmpower(); StdUserEmpower stdUserEmpower = new StdUserEmpower();
stdUserEmpower.setAmosUserId(unitInfo.getAdminUserId()); stdUserEmpower.setAmosUserId(unitInfo.getAdminUserId());
stdUserEmpower.setAmosOrgCode(lis); stdUserEmpower.setAmosOrgCode(lis);
stdUserEmpower.setPermissionType("HYGF"); stdUserEmpower.setPermissionType("HYGF");
userEmpowerMapper.insert(stdUserEmpower); userEmpowerMapper.insert(stdUserEmpower);
// Privilege.agencyUserClient.unlockUsers(unitInfo.getAdminUserId()); // Privilege.agencyUserClient.unlockUsers(unitInfo.getAdminUserId());
approvalStatue="任务明细:"+DealerReviewEnum.经销商管理员审核.getName()+"审核通过"; approvalStatue = "任务明细:" + DealerReviewEnum.经销商管理员审核.getName() + "审核通过";
// HashMap<String, String> params = new HashMap<>(3); // HashMap<String, String> params = new HashMap<>(3);
// params.put("code","通过"); // params.put("code","通过");
// params.put("mobile",unitInfo.getAdminPhone()); // params.put("mobile",unitInfo.getAdminPhone());
...@@ -640,28 +660,26 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -640,28 +660,26 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
// 3. 工作流执行 // 3. 工作流执行
//执行工作流 //执行工作流
BasicGridAcceptance basicGridAcceptance=new BasicGridAcceptance(); BasicGridAcceptance basicGridAcceptance = new BasicGridAcceptance();
StandardDto standardDto = new StandardDto(); StandardDto standardDto = new StandardDto();
standardDto.setComment(kv.get("approvalInfo")!=null?String.valueOf(kv.get("approvalInfo")):""); standardDto.setComment(kv.get("approvalInfo") != null ? String.valueOf(kv.get("approvalInfo")) : "");
standardDto.setResult(String.valueOf(kv.get("approvalStatus"))); standardDto.setResult(String.valueOf(kv.get("approvalStatus")));
standardDto.setTaskId(dealerReview.getFlowTaskId()); standardDto.setTaskId(dealerReview.getFlowTaskId());
VariableDto variable = new VariableDto(); VariableDto variable = new VariableDto();
variable.setApprovalStatus(String.valueOf(kv.get("approvalStatus"))); variable.setApprovalStatus(String.valueOf(kv.get("approvalStatus")));
variable.setComment(kv.get("approvalInfo")!=null?String.valueOf(kv.get("approvalInfo")):""); variable.setComment(kv.get("approvalInfo") != null ? String.valueOf(kv.get("approvalInfo")) : "");
variable.setOperationTime(String.valueOf(kv.get("approveDate"))); variable.setOperationTime(String.valueOf(kv.get("approveDate")));
variable.setOperator(String.valueOf(kv.get("approveName"))); variable.setOperator(String.valueOf(kv.get("approveName")));
standardDto.setVariable(variable); standardDto.setVariable(variable);
BasicGridAcceptance workBasicGridAcceptance = workflow.standard(basicGridAcceptance, standardDto, requestContext.getUserId()); BasicGridAcceptance workBasicGridAcceptance = workflow.standard(basicGridAcceptance, standardDto, requestContext.getUserId());
dealerReview.setFlowTaskId(basicGridAcceptance.getNextTaskId()); dealerReview.setFlowTaskId(basicGridAcceptance.getNextTaskId());
dealerReviewService.saveDealerReview(dealerReview,false,true,unitInfo.getName(),approvalStatue); dealerReviewService.saveDealerReview(dealerReview, false, true, unitInfo.getName(), approvalStatue);
this.saveOrUpdate(unitInfo); this.saveOrUpdate(unitInfo);
} catch (Exception e) {
}catch (Exception e){
if (!ObjectUtils.isEmpty(unitInfo.getAmosCompanySeq())) { if (!ObjectUtils.isEmpty(unitInfo.getAmosCompanySeq())) {
FeignClientResult<CompanyModel> feignClientResult = Privilege.companyClient FeignClientResult<CompanyModel> feignClientResult = Privilege.companyClient
...@@ -682,13 +700,11 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -682,13 +700,11 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
e.printStackTrace(); e.printStackTrace();
throw new BaseException("获取工作流节点失败!","400","获取工作流节点失败!"); throw new BaseException("获取工作流节点失败!", "400", "获取工作流节点失败!");
} }
// // 2.更新审核记录表 // // 2.更新审核记录表
// UnitInfo unitInfo=null; // UnitInfo unitInfo=null;
// try{ // try{
...@@ -802,7 +818,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -802,7 +818,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
@Override @Override
public IPage<CompanyDto> getCompanyDto(CompanyDto dto) { public IPage<CompanyDto> getCompanyDto(CompanyDto dto) {
//列表数据组装 //列表数据组装
IPage<CompanyDto> pag = unitInfoMapper.getCompanyDto( dto); IPage<CompanyDto> pag = unitInfoMapper.getCompanyDto(dto);
// List<CompanyDto> pag = unitInfoMapper.getCompanyDto( (page.getCurrent()-1)*page.getSize(),page.getSize(),dto); // List<CompanyDto> pag = unitInfoMapper.getCompanyDto( (page.getCurrent()-1)*page.getSize(),page.getSize(),dto);
//// Map<String,Integer> count = unitInfoMapper.getCompanyDtoCount(dto); //// Map<String,Integer> count = unitInfoMapper.getCompanyDtoCount(dto);
//// page.setTotal(count.get("num")); //// page.setTotal(count.get("num"));
...@@ -811,53 +827,50 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -811,53 +827,50 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
} }
//单位详情 //单位详情
public UnitDataDto getUnitDataDto(Long id){ public UnitDataDto getUnitDataDto(Long id) {
LambdaQueryWrapper<UnitInfo> queryWrapper = new LambdaQueryWrapper<UnitInfo>(); LambdaQueryWrapper<UnitInfo> queryWrapper = new LambdaQueryWrapper<UnitInfo>();
queryWrapper.eq(UnitInfo::getAmosCompanySeq, id); queryWrapper.eq(UnitInfo::getAmosCompanySeq, id);
UnitInfo unitInfo= unitInfoMapper.selectOne(queryWrapper); UnitInfo unitInfo = unitInfoMapper.selectOne(queryWrapper);
LambdaQueryWrapper<CommerceInfo> queryWrapper1 = new LambdaQueryWrapper<CommerceInfo>(); LambdaQueryWrapper<CommerceInfo> queryWrapper1 = new LambdaQueryWrapper<CommerceInfo>();
queryWrapper1.eq(CommerceInfo::getUnitSeq, unitInfo.getSequenceNbr()); queryWrapper1.eq(CommerceInfo::getUnitSeq, unitInfo.getSequenceNbr());
CommerceInfo commerceInfo= commerceInfoMapper.selectOne(queryWrapper1); CommerceInfo commerceInfo = commerceInfoMapper.selectOne(queryWrapper1);
//单位管理 //单位管理
UnitInformation unitInformation=new UnitInformation(); UnitInformation unitInformation = new UnitInformation();
//工商信息 //工商信息
CommerceDto commerceDto=new CommerceDto(); CommerceDto commerceDto = new CommerceDto();
//管理员账号 //管理员账号
Account cccount=new Account(); Account cccount = new Account();
BeanUtils.copyProperties(unitInfo,unitInformation); BeanUtils.copyProperties(unitInfo, unitInformation);
unitInformation.setHeadCardPhotoBack(unitInformation.getHeadCardPhotoBack()); unitInformation.setHeadCardPhotoBack(unitInformation.getHeadCardPhotoBack());
unitInformation.setHeadCardPhotoFront(unitInformation.getHeadCardPhotoFront()); unitInformation.setHeadCardPhotoFront(unitInformation.getHeadCardPhotoFront());
unitInformation.setRegisterPcdCode((unitInformation.getRegisterPcdCode()!=null&&!"".equals(unitInformation.getRegisterPcdCode()))?unitInformation.getRegisterPcdCode():null); unitInformation.setRegisterPcdCode((unitInformation.getRegisterPcdCode() != null && !"".equals(unitInformation.getRegisterPcdCode())) ? unitInformation.getRegisterPcdCode() : null);
unitInformation.setWorkPcdCode((unitInformation.getWorkPcdCode()!=null&&!"".equals(unitInformation.getWorkPcdCode()))?unitInformation.getWorkPcdCode():null); unitInformation.setWorkPcdCode((unitInformation.getWorkPcdCode() != null && !"".equals(unitInformation.getWorkPcdCode())) ? unitInformation.getWorkPcdCode() : null);
BeanUtils.copyProperties(commerceInfo,commerceDto); BeanUtils.copyProperties(commerceInfo, commerceDto);
commerceDto.setBusinessLicensePhoto(commerceDto.getBusinessLicensePhoto()); commerceDto.setBusinessLicensePhoto(commerceDto.getBusinessLicensePhoto());
commerceDto.setLegalPersonCardPhotoBack(commerceDto.getLegalPersonCardPhotoBack()); commerceDto.setLegalPersonCardPhotoBack(commerceDto.getLegalPersonCardPhotoBack());
commerceDto.setLegalPersonCardPhotoFront(commerceDto.getLegalPersonCardPhotoFront()); commerceDto.setLegalPersonCardPhotoFront(commerceDto.getLegalPersonCardPhotoFront());
BeanUtils.copyProperties(unitInfo,cccount); BeanUtils.copyProperties(unitInfo, cccount);
UnitDataDto unitDataDt = new UnitDataDto(unitInformation,commerceDto,cccount); UnitDataDto unitDataDt = new UnitDataDto(unitInformation, commerceDto, cccount);
return unitDataDt; return unitDataDt;
} }
@Transactional @Transactional
public Boolean updateUnitDataDto(UnitDataDto unitDataDto){ public Boolean updateUnitDataDto(UnitDataDto unitDataDto) {
//验证二维码 //验证二维码
UnitInfo unitInfo=new UnitInfo(); UnitInfo unitInfo = new UnitInfo();
unitInfo= unitInfoMapper.selectById(unitDataDto.getUnitInformation().getSequenceNbr()); unitInfo = unitInfoMapper.selectById(unitDataDto.getUnitInformation().getSequenceNbr());
List<String> lisk=new ArrayList<>(); List<String> lisk = new ArrayList<>();
UnitInformation unitInformation= unitDataDto.getUnitInformation(); UnitInformation unitInformation = unitDataDto.getUnitInformation();
JSONArray regionName = getRegionName(); JSONArray regionName = getRegionName();
List<RegionModel> list = JSONArray.parseArray(regionName.toJSONString(), RegionModel.class); List<RegionModel> list = JSONArray.parseArray(regionName.toJSONString(), RegionModel.class);
List<Integer> regist= unitInformation.getRegisterPcdCodeList(); List<Integer> regist = unitInformation.getRegisterPcdCodeList();
List<Integer> workP= unitInformation.getWorkPcdCodeList(); List<Integer> workP = unitInformation.getWorkPcdCodeList();
//注册地址 //注册地址
if(regist!=null&&!regist.isEmpty()){ if (regist != null && !regist.isEmpty()) {
StringBuilder codenameRegi=new StringBuilder(); StringBuilder codenameRegi = new StringBuilder();
for (int i = 0, len = regist.size(); i < len; i++) { for (int i = 0, len = regist.size(); i < len; i++) {
for (RegionModel regionModel : list) { for (RegionModel regionModel : list) {
if (regionModel.getRegionCode().intValue() == regist.get(i).intValue()) { if (regionModel.getRegionCode().intValue() == regist.get(i).intValue()) {
...@@ -868,12 +881,13 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -868,12 +881,13 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
} }
} }
} }
unitInformation.setRegisterPcd(codenameRegi!=null&&!"".equals(codenameRegi.toString())?codenameRegi.toString():null); unitInformation.setRegisterPcd(codenameRegi != null && !"".equals(codenameRegi.toString()) ? codenameRegi.toString() : null);
} }
//办公地址 //办公地址
if(workP!=null&&!workP.isEmpty()){ if (workP != null && !workP.isEmpty()) {
StringBuilder codenamework= new StringBuilder();; StringBuilder codenamework = new StringBuilder();
;
for (int i = 0, len = workP.size(); i < len; i++) { for (int i = 0, len = workP.size(); i < len; i++) {
for (RegionModel regionModel : list) { for (RegionModel regionModel : list) {
if (regionModel.getRegionCode().intValue() == workP.get(i).intValue()) { if (regionModel.getRegionCode().intValue() == workP.get(i).intValue()) {
...@@ -884,41 +898,41 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -884,41 +898,41 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
} }
} }
} }
unitInformation.setWorkPcd(codenamework!=null&&!"".equals(codenamework.toString())?codenamework.toString():null); unitInformation.setWorkPcd(codenamework != null && !"".equals(codenamework.toString()) ? codenamework.toString() : null);
} }
unitInformation.setHeadCardPhotoBackUrl(unitInformation.getHeadCardPhotoBackUrl()); unitInformation.setHeadCardPhotoBackUrl(unitInformation.getHeadCardPhotoBackUrl());
unitInformation.setHeadCardPhotoFrontUrl(unitInformation.getHeadCardPhotoFrontUrl()); unitInformation.setHeadCardPhotoFrontUrl(unitInformation.getHeadCardPhotoFrontUrl());
unitInformation.setRegisterPcdCodeList(unitInformation.getRegisterPcdCodeList()); unitInformation.setRegisterPcdCodeList(unitInformation.getRegisterPcdCodeList());
unitInformation.setWorkPcdCodeList(unitInformation.getWorkPcdCodeList()); unitInformation.setWorkPcdCodeList(unitInformation.getWorkPcdCodeList());
List<Long> dis= unitInformation.getRegionalCompaniesSeq(); List<Long> dis = unitInformation.getRegionalCompaniesSeq();
List<String> disST= dis.stream().map(x->x+"").collect(Collectors.toList()); List<String> disST = dis.stream().map(x -> x + "").collect(Collectors.toList());
BeanUtils.copyProperties(unitInformation,unitInfo); BeanUtils.copyProperties(unitInformation, unitInfo);
CommerceInfo commerceInfo=new CommerceInfo(); CommerceInfo commerceInfo = new CommerceInfo();
commerceInfo= commerceInfoMapper.selectById(unitDataDto.getCommerceDto().getSequenceNbr()); commerceInfo = commerceInfoMapper.selectById(unitDataDto.getCommerceDto().getSequenceNbr());
CommerceDto commerceDto= unitDataDto.getCommerceDto(); CommerceDto commerceDto = unitDataDto.getCommerceDto();
commerceDto.setBusinessLicensePhotoUrl(commerceDto.getBusinessLicensePhotoUrl()); commerceDto.setBusinessLicensePhotoUrl(commerceDto.getBusinessLicensePhotoUrl());
commerceDto.setLegalPersonCardPhotoBackUrl(commerceDto.getLegalPersonCardPhotoBackUrl()); commerceDto.setLegalPersonCardPhotoBackUrl(commerceDto.getLegalPersonCardPhotoBackUrl());
commerceDto.setLegalPersonCardPhotoFrontUrl(commerceDto.getLegalPersonCardPhotoFrontUrl()); commerceDto.setLegalPersonCardPhotoFrontUrl(commerceDto.getLegalPersonCardPhotoFrontUrl());
BeanUtils.copyProperties(commerceDto,commerceInfo); BeanUtils.copyProperties(commerceDto, commerceInfo);
unitInfo.setRegionalCompaniesSeq(disST); unitInfo.setRegionalCompaniesSeq(disST);
unitInfoMapper.updateById(unitInfo); unitInfoMapper.updateById(unitInfo);
commerceInfoMapper.updateById(commerceInfo); commerceInfoMapper.updateById(commerceInfo);
//区域公司 //区域公司
LambdaQueryWrapper<RegionalCompanies> qu=new LambdaQueryWrapper<>(); LambdaQueryWrapper<RegionalCompanies> qu = new LambdaQueryWrapper<>();
qu.eq(RegionalCompanies::getUnitId,unitInfo.getAmosCompanySeq()); qu.eq(RegionalCompanies::getUnitId, unitInfo.getAmosCompanySeq());
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(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) {
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());
...@@ -933,16 +947,16 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -933,16 +947,16 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
//修改管理员权限 //修改管理员权限
//管理员绑定角色权限 //管理员绑定角色权限
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");
...@@ -954,22 +968,20 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -954,22 +968,20 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
} }
public JSONArray getRegionName() {
public JSONArray getRegionName(){
JSONArray jsonArray = new JSONArray(); JSONArray jsonArray = new JSONArray();
if (redisUtil.hasKey(regionRedis)) { if (redisUtil.hasKey(regionRedis)) {
jsonArray= JSONArray.parseArray(redisUtil.get(regionRedis).toString()); jsonArray = JSONArray.parseArray(redisUtil.get(regionRedis).toString());
}else { } else {
Collection<RegionModel> regionChild = new ArrayList<>(); Collection<RegionModel> regionChild = new ArrayList<>();
RegionModel regionModel1 = new RegionModel(); RegionModel regionModel1 = new RegionModel();
regionChild.add(regionModel1); regionChild.add(regionModel1);
FeignClientResult<Collection<RegionModel>> collectionFeignClientResult = Systemctl.regionClient.queryForTreeParent(610000L); FeignClientResult<Collection<RegionModel>> collectionFeignClientResult = Systemctl.regionClient.queryForTreeParent(610000L);
Collection<RegionModel> result = collectionFeignClientResult.getResult(); Collection<RegionModel> result = collectionFeignClientResult.getResult();
for (RegionModel regionModel : result) { for (RegionModel regionModel : result) {
if(null != regionModel && null != regionModel.getChildren()) { if (null != regionModel && null != regionModel.getChildren()) {
for (RegionModel child : regionModel.getChildren()) { for (RegionModel child : regionModel.getChildren()) {
if(null != child && null != child.getChildren()) { if (null != child && null != child.getChildren()) {
for (RegionModel childChild : child.getChildren()) { for (RegionModel childChild : child.getChildren()) {
jsonArray.add(childChild); jsonArray.add(childChild);
} }
...@@ -982,23 +994,22 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -982,23 +994,22 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
} }
} }
redisUtil.set(regionRedis,jsonArray); redisUtil.set(regionRedis, jsonArray);
} }
return jsonArray; return jsonArray;
} }
public Page<PeasantHousehold> getPeasantHouseholdData(Long unitInfoId,
public Page<PeasantHousehold> getPeasantHouseholdData( Long unitInfoId,
Long regionalCompaniesSeq, Long regionalCompaniesSeq,
int pageNum, int pageNum,
int pageSize, int pageSize,
String peasantHouseholdNo, String peasantHouseholdNo,
String ownersName, String ownersName,
String ids){ String ids) {
UnitInfo unitInfo=unitInfoMapper.selectById(unitInfoId); UnitInfo unitInfo = unitInfoMapper.selectById(unitInfoId);
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
List<PeasantHousehold> list=peasantHouseholdMapper.selectPeasantHouseholdList(unitInfo.getAmosCompanySeq(),regionalCompaniesSeq,peasantHouseholdNo,ownersName,ids); List<PeasantHousehold> list = peasantHouseholdMapper.selectPeasantHouseholdList(unitInfo.getAmosCompanySeq(), regionalCompaniesSeq, peasantHouseholdNo, ownersName, ids);
PageInfo<PeasantHousehold> page = new PageInfo(list); PageInfo<PeasantHousehold> page = new PageInfo(list);
Page<PeasantHousehold> pagenew = new Page<PeasantHousehold>(); Page<PeasantHousehold> pagenew = new Page<PeasantHousehold>();
pagenew.setCurrent(pageNum); pagenew.setCurrent(pageNum);
...@@ -1007,15 +1018,16 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -1007,15 +1018,16 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
pagenew.setRecords(page.getList()); pagenew.setRecords(page.getList());
return pagenew; return pagenew;
} }
public Page<PeasantHousehold> selectPeasantHouseholdListsg( Long unitInfoId,
public Page<PeasantHousehold> selectPeasantHouseholdListsg(Long unitInfoId,
Long regionalCompaniesSeq, Long regionalCompaniesSeq,
int pageNum, int pageNum,
int pageSize, int pageSize,
String peasantHouseholdNo, String peasantHouseholdNo,
String ownersName, String ownersName,
String ids){ String ids) {
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
List<PeasantHousehold> list=peasantHouseholdMapper.selectPeasantHouseholdListsg(unitInfoId,regionalCompaniesSeq,peasantHouseholdNo,ownersName,ids); List<PeasantHousehold> list = peasantHouseholdMapper.selectPeasantHouseholdListsg(unitInfoId, regionalCompaniesSeq, peasantHouseholdNo, ownersName, ids);
PageInfo<PeasantHousehold> page = new PageInfo(list); PageInfo<PeasantHousehold> page = new PageInfo(list);
Page<PeasantHousehold> pagenew = new Page<PeasantHousehold>(); Page<PeasantHousehold> pagenew = new Page<PeasantHousehold>();
pagenew.setCurrent(pageNum); pagenew.setCurrent(pageNum);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.11.RELEASE</version> <version>2.3.11.RELEASE</version>
<relativePath /> <relativePath/>
</parent> </parent>
<properties> <properties>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<springcloud.version>Hoxton.SR8</springcloud.version> <springcloud.version>Hoxton.SR8</springcloud.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<tyboot-version>1.1.25-SNAPSHOT</tyboot-version> <tyboot-version>1.1.25-SNAPSHOT</tyboot-version>
<!-- <amos.version>1.7.10-SNAPSHOT</amos.version>--> <!-- <amos.version>1.7.10-SNAPSHOT</amos.version>-->
<amos.version>1.10.8</amos.version> <amos.version>1.10.8</amos.version>
<itext.version>7.1.1</itext.version> <itext.version>7.1.1</itext.version>
<elasticsearch.version>7.15.2</elasticsearch.version> <elasticsearch.version>7.15.2</elasticsearch.version>
...@@ -212,6 +212,11 @@ ...@@ -212,6 +212,11 @@
<artifactId>amos-feign-privilege</artifactId> <artifactId>amos-feign-privilege</artifactId>
<version>${amos.version}</version> <version>${amos.version}</version>
</dependency> </dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
</dependencies> </dependencies>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
......
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