Commit 81ed7262 authored by hezhuozhi's avatar hezhuozhi

Merge remote-tracking branch 'origin/wofkflow0620' into wofkflow0620

# Conflicts: # amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/BasicGridAcceptanceServiceImpl.java # amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/UnitInfoServiceImpl.java
parents 9c87d14f 9e81e587
...@@ -88,4 +88,10 @@ public class PowerStationDto extends BaseDto { ...@@ -88,4 +88,10 @@ public class PowerStationDto extends BaseDto {
@ApiModelProperty(value = "契约锁合同id") @ApiModelProperty(value = "契约锁合同id")
private String contractLockId; private String contractLockId;
@ApiModelProperty(value = "盖章状态")
private String stampStatus;
@ApiModelProperty(value = "合同状态")
private String status;
} }
...@@ -253,4 +253,8 @@ public class HouseholdContract extends BaseEntity { ...@@ -253,4 +253,8 @@ public class HouseholdContract extends BaseEntity {
//合同填充字段值 //合同填充字段值
@TableField(exist = false) @TableField(exist = false)
List<ContractFillData> contractFillData; List<ContractFillData> contractFillData;
//查询一个农户拥有的合同是否全是已废弃
@TableField(exist = false)
private Boolean isAllDisuse;
} }
...@@ -4,38 +4,45 @@ ...@@ -4,38 +4,45 @@
<select id="selectPage" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.HouseholdContract"> <select id="selectPage" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.HouseholdContract">
select select
* *,
from hygf_household_contract (SELECT CASE WHEN SUM( CASE WHEN hhc.`status` = '已作废' THEN 1 ELSE 0 END ) = COUNT(*) THEN 'true' ELSE 'false'
LEFT JOIN hygf_peasant_household php ON php.sequence_nbr = hygf_household_contract.peasant_household_id <where> END FROM hygf_household_contract AS hhc
<if test="dto.name != null and dto.name !='' "> WHERE
and hygf_household_contract.name like concat('%',#{dto.name},'%') hhc.peasant_household_id = hygf_household_contract.peasant_household_id
</if> ) AS isAllDisuse
<if test="dto.contractNumber != null and dto.contractNumber !=''">
and hygf_household_contract.contract_number like concat('%',#{dto.contractNumber},'%') from hygf_household_contract
</if> LEFT JOIN hygf_peasant_household php ON php.sequence_nbr = hygf_household_contract.peasant_household_id
<if test="dto.initiateStatus != null and dto.initiateStatus !='' "> <where>
and hygf_household_contract.initiate_status = #{dto.initiateStatus} <if test="dto.name != null and dto.name !='' ">
</if> and hygf_household_contract.name like concat('%',#{dto.name},'%')
<if test="dto.peasantHouseholdId != null and dto.peasantHouseholdId !=''"> </if>
and hygf_household_contract.peasant_household_id = #{dto.peasantHouseholdId} <if test="dto.contractNumber != null and dto.contractNumber !=''">
</if> and hygf_household_contract.contract_number like concat('%',#{dto.contractNumber},'%')
<if test="dto.dealerId != null and dto.dealerId !=''"> </if>
and hygf_household_contract.dealer_id = #{dto.dealerId} <if test="dto.initiateStatus != null and dto.initiateStatus !='' ">
</if> and hygf_household_contract.initiate_status = #{dto.initiateStatus}
<if test="dto.surveyStatus != null and dto.surveyStatus !=''"> </if>
and hygf_household_contract.survey_status = #{dto.surveyStatus} <if test="dto.peasantHouseholdId != null and dto.peasantHouseholdId !=''">
</if> and hygf_household_contract.peasant_household_id = #{dto.peasantHouseholdId}
<if test="dto.signStatus != null and dto.signStatus !=''"> </if>
and hygf_household_contract.sign_status = #{dto.signStatus} <if test="dto.dealerId != null and dto.dealerId !=''">
</if> and hygf_household_contract.dealer_id = #{dto.dealerId}
<if test="dto.userId != null and dto.userId !=''"> </if>
and hygf_household_contract.project_user_id = #{dto.userId} <if test="dto.surveyStatus != null and dto.surveyStatus !=''">
</if> and hygf_household_contract.survey_status = #{dto.surveyStatus}
<if test="dto.partyA != null and dto.partyA !=''"> </if>
and hygf_household_contract.party_a like concat('%',#{dto.partyA},'%') <if test="dto.signStatus != null and dto.signStatus !=''">
</if> and hygf_household_contract.sign_status = #{dto.signStatus}
</where> </if>
<if test="dto.userId != null and dto.userId !=''">
and hygf_household_contract.project_user_id = #{dto.userId}
</if>
<if test="dto.partyA != null and dto.partyA !=''">
and hygf_household_contract.party_a like concat('%',#{dto.partyA},'%')
</if>
</where>
<if test="dto.orderBy == null "> <if test="dto.orderBy == null ">
ORDER BY hygf_household_contract.rec_date DESC ORDER BY hygf_household_contract.rec_date DESC
</if> </if>
......
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
hygf_peasant_household.regional_companies_name, hygf_peasant_household.regional_companies_name,
hygf_peasant_household.developer_code, hygf_peasant_household.developer_code,
hygf_peasant_household.developer_user_id, hygf_peasant_household.developer_user_id,
hygf_peasant_household.project_address_detail hygf_peasant_household.project_address_detail,
from hygf_power_station LEFT JOIN ( select peasant_household_id,initiate_status, contract_lock_id from hygf_household_contract where hygf_household_contract.status !='已作废' b.stamp_status,
b.status
from hygf_power_station LEFT JOIN ( select peasant_household_id,initiate_status, contract_lock_id,stamp_status,status from hygf_household_contract where hygf_household_contract.status !='已作废'
) b on b.peasant_household_id=hygf_power_station.peasant_household_id ) b on b.peasant_household_id=hygf_power_station.peasant_household_id
LEFT JOIN hygf_peasant_household on hygf_peasant_household.sequence_nbr=hygf_power_station.peasant_household_id LEFT JOIN hygf_peasant_household on hygf_peasant_household.sequence_nbr=hygf_power_station.peasant_household_id
where hygf_power_station.is_delete=0 where hygf_power_station.is_delete=0
......
//package com.yeejoin.amos.boot.module.hygf.biz.config; //package com.yeejoin.amos.workflow.config;
// //
//import com.baomidou.mybatisplus.core.config.GlobalConfig; //import com.baomidou.mybatisplus.core.config.GlobalConfig;
//import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; //import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
//import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; //import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
//import com.github.pagehelper.PageInterceptor;
//import com.yeejoin.amos.boot.biz.config.MetaHandler; //import com.yeejoin.amos.boot.biz.config.MetaHandler;
//import com.yeejoin.amos.boot.biz.config.MybatisSqlInjector; //import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpowerInterceptor;
//import com.zaxxer.hikari.HikariDataSource; //import com.zaxxer.hikari.HikariDataSource;
//import io.seata.rm.datasource.DataSourceProxy; //import io.seata.rm.datasource.DataSourceProxy;
//import javax.sql.DataSource;
//import org.apache.ibatis.plugin.Interceptor; //import org.apache.ibatis.plugin.Interceptor;
//import org.apache.ibatis.session.SqlSessionFactory; //import org.apache.ibatis.session.SqlSessionFactory;
//import org.mybatis.spring.SqlSessionTemplate;
//import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier; //import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; //import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
//import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.boot.jdbc.DataSourceBuilder;
//import org.springframework.context.annotation.Bean; //import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration; //import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary; //import org.springframework.context.annotation.Primary;
//import org.springframework.core.io.support.PathMatchingResourcePatternResolver; //import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
//import org.springframework.core.io.support.ResourcePatternResolver; //import org.springframework.core.io.support.ResourcePatternResolver;
//import org.springframework.jdbc.datasource.DataSourceTransactionManager;
//
//import javax.sql.DataSource;
//import java.util.Properties;
// //
///** ///**
// * 数据源代理 // * 数据源代理
...@@ -26,14 +33,17 @@ ...@@ -26,14 +33,17 @@
// */ // */
//@Configuration //@Configuration
//public class DataSourceConfiguration { //public class DataSourceConfiguration {
// @Autowired
// MetaHandler metaHandler;
// private static final String MAPPER_LOCATION = "classpath*:mapper/mysql/*.xml";
// //
// @Autowired // @Autowired
// private DataSourceProperties dsp; // private DataSourceProperties dsp;
// //
// @Bean(name = "hikariDataSource") // @Bean(name = "mysqlDataSource")
// public HikariDataSource hikariDataSource() { // @Primary
// public DataSource mysqlDataSource() {
// HikariDataSource hds = new HikariDataSource(); // HikariDataSource hds = new HikariDataSource();
// hds.setSchema(dsp.getSchema().get(0));
// hds.setUsername(dsp.getUsername()); // hds.setUsername(dsp.getUsername());
// hds.setPassword(dsp.getPassword()); // hds.setPassword(dsp.getPassword());
// hds.setJdbcUrl(dsp.getUrl()); // hds.setJdbcUrl(dsp.getUrl());
...@@ -44,30 +54,65 @@ ...@@ -44,30 +54,65 @@
// return hds; // return hds;
// } // }
// //
// @Primary // @Bean("mysqlDataSourceProxy")
// @Bean("dataSource") // public DataSourceProxy dataSourceProxy(DataSource hikariDataSource) {
// public DataSourceProxy dataSourceProxy(@Qualifier("dataSource") DataSource hikariDataSource) {
// return new DataSourceProxy(hikariDataSource); // return new DataSourceProxy(hikariDataSource);
// } // }
// //
// @Bean(name = "sqlSessionFactory") // @Bean(name = "mysqlSqlSessionFactory")
// @Autowired // @Primary
// public SqlSessionFactory sqlSessionFactoryBean(@Qualifier("dataSource") DataSource dataSourceProxy, PaginationInterceptor paginationInterceptor, MetaHandler metaHandler) throws Exception { // public SqlSessionFactory mysqlSqlSessionFactory(@Qualifier("mysqlDataSourceProxy") DataSource dataSource, GlobalConfig globalConfig) throws Exception {
// //注意这里一定要用MybatisSqlSessionFactoryBean,如果用SqlSessionFactory,配置无效
// MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean(); // MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();
// bean.setDataSource(dataSourceProxy); // bean.setDataSource(dataSource);
// ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); // bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(MAPPER_LOCATION));
// bean.setMapperLocations(resolver.getResources("classpath*:mapper/*.xml"));
// GlobalConfig globalConfig = new GlobalConfig();
// globalConfig.setSqlInjector(new MybatisSqlInjector());
// globalConfig.setMetaObjectHandler(metaHandler); // globalConfig.setMetaObjectHandler(metaHandler);
// bean.setGlobalConfig(globalConfig); // bean.setGlobalConfig(globalConfig);
// Interceptor[] plugins = {paginationInterceptor}; // //分页插件
// bean.setPlugins(plugins); // Interceptor interceptor = new PageInterceptor();
// Properties properties = new Properties();
// properties.setProperty("helperDialect", "mysql");
// properties.setProperty("offsetAsPageNum", "true");
// properties.setProperty("rowBoundsWithCount", "true");
// properties.setProperty("reasonable", "true");
// properties.setProperty("supportMethodsArguments","true");
// properties.setProperty("params","pageNum=current;pageSize=size" +
// "" +
// ";");
// interceptor.setProperties(properties);
// bean.setPlugins(new Interceptor[] {interceptor,
// userEmpowerInterceptor(),
// paginationInterceptor()
// });
// return bean.getObject(); // return bean.getObject();
// } // }
// //
// @Bean(name = "mysqlTransactionManager")
// @Primary
// public DataSourceTransactionManager mysqlTransactionManager(@Qualifier("mysqlDataSource") DataSource dataSource) {
// return new DataSourceTransactionManager(dataSource);
// }
//
// @Bean(name = "mysqlSqlSessionTemplate")
// @Primary
// public SqlSessionTemplate mysqlSqlSessionTemplate(@Qualifier("mysqlSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception {
// return new SqlSessionTemplate(sqlSessionFactory);
// }
//
// @Bean
// public PaginationInterceptor paginationInterceptor() {
// PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
// paginationInterceptor.setDialectType("mysql");
// return paginationInterceptor;
// }
//
//
// @Bean // @Bean
// public MetaHandler metaHandler() { // public UserEmpowerInterceptor userEmpowerInterceptor() {
// return new MetaHandler(); // UserEmpowerInterceptor userEmpowerInterceptor = new UserEmpowerInterceptor();
//
// return userEmpowerInterceptor;
// } // }
//
//
//} //}
...@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.hygf.api.mapper.AcceptanceRectificationOrder ...@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.hygf.api.mapper.AcceptanceRectificationOrder
import com.yeejoin.amos.boot.module.hygf.api.mapper.BasicGridAcceptanceMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.BasicGridAcceptanceMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IAcceptanceRectificationOrderService; import com.yeejoin.amos.boot.module.hygf.api.service.IAcceptanceRectificationOrderService;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.seata.spring.annotation.GlobalTransactional;
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.stereotype.Service;
...@@ -98,7 +99,7 @@ public class AcceptanceRectificationOrderServiceImpl extends BaseService<Accepta ...@@ -98,7 +99,7 @@ public class AcceptanceRectificationOrderServiceImpl extends BaseService<Accepta
* 提交整改并触发工作流 * 提交整改并触发工作流
*/ */
@Transactional @GlobalTransactional
public AcceptanceRectificationOrderDto updateAndDriveWorkflow(AcceptanceRectificationOrderDto model, String userId) { public AcceptanceRectificationOrderDto updateAndDriveWorkflow(AcceptanceRectificationOrderDto model, String userId) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
......
...@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.hygf.api.mapper.AcceptanceMapper; ...@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.hygf.api.mapper.AcceptanceMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.BasicGridAcceptanceMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.BasicGridAcceptanceMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PeasantHouseholdMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.PeasantHouseholdMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IAcceptanceService; import com.yeejoin.amos.boot.module.hygf.api.service.IAcceptanceService;
import io.seata.spring.annotation.GlobalTransactional;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -109,7 +110,7 @@ public class AcceptanceServiceImpl implements IAcceptanceService { ...@@ -109,7 +110,7 @@ public class AcceptanceServiceImpl implements IAcceptanceService {
return Optional.ofNullable(item).orElse(new AcceptanceCheckItem()); return Optional.ofNullable(item).orElse(new AcceptanceCheckItem());
} }
@Override @Override
@Transactional @GlobalTransactional
public void checkAccept( Long basicGridAcceptanceId ,String userId){ public void checkAccept( Long basicGridAcceptanceId ,String userId){
BasicGridAcceptance basicGridAcceptanc= basicGridAcceptanceMapper.selectById(basicGridAcceptanceId); BasicGridAcceptance basicGridAcceptanc= basicGridAcceptanceMapper.selectById(basicGridAcceptanceId);
basicGridAcceptanc.setAcceptanceStatus(AcceptanceStatusEnum.待投融验收.getCode()); basicGridAcceptanc.setAcceptanceStatus(AcceptanceStatusEnum.待投融验收.getCode());
......
...@@ -33,6 +33,7 @@ import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO; ...@@ -33,6 +33,7 @@ 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 io.seata.spring.annotation.GlobalTransactional;
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.stereotype.Service;
...@@ -112,7 +113,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -112,7 +113,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
return this.queryForList("", false); return this.queryForList("", false);
} }
@Transactional @GlobalTransactional
public FinancingInfoDto saveModel(FinancingInfoDto model) { public FinancingInfoDto saveModel(FinancingInfoDto model) {
List<String> ids; List<String> ids;
if (model.getPeasantHouseholdIds().contains(",")) { if (model.getPeasantHouseholdIds().contains(",")) {
...@@ -156,7 +157,6 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -156,7 +157,6 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
actWorkflowBatchDTO.setProcess(list); actWorkflowBatchDTO.setProcess(list);
List<ProcessTaskDTO> processTaskDTOS = workFlowService.startBatch(actWorkflowBatchDTO); List<ProcessTaskDTO> processTaskDTOS = workFlowService.startBatch(actWorkflowBatchDTO);
List<WorkflowResultDto> workflowResultDtos = workFlowService.buildWorkFlowInfo(processTaskDTOS); List<WorkflowResultDto> workflowResultDtos = workFlowService.buildWorkFlowInfo(processTaskDTOS);
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);
...@@ -203,6 +203,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -203,6 +203,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
@Override @Override
@GlobalTransactional
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<>();
...@@ -229,7 +230,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -229,7 +230,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
} }
@Override @Override
@Transactional @GlobalTransactional
public void execueFlow(Map<String, Object> params) { public void execueFlow(Map<String, Object> params) {
LambdaQueryWrapper<FinancingAuditing> query = new LambdaQueryWrapper<>(); LambdaQueryWrapper<FinancingAuditing> query = new LambdaQueryWrapper<>();
query.eq(FinancingAuditing::getInstanceId, params.get("instanceId").toString()); query.eq(FinancingAuditing::getInstanceId, params.get("instanceId").toString());
......
...@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient; ...@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.robot.AmosRequestContext; import com.yeejoin.amos.component.robot.AmosRequestContext;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.seata.spring.annotation.GlobalTransactional;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
...@@ -163,7 +164,10 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS ...@@ -163,7 +164,10 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
powerStation.setRecDate(new Date()); powerStation.setRecDate(new Date());
Boolean fl = this.saveOrUpdate(powerStation); //Boolean fl = this.saveOrUpdate(powerStation);
// 避免生成多份数据
Boolean fl = this.saveOrUpdate(powerStation,new LambdaQueryWrapper<PowerStation>()
.eq(PowerStation::getPeasantHouseholdId,powerStation.getPeasantHouseholdId()));
PowerStationNodeEnum powerStationNodeEnum = PowerStationNodeEnum PowerStationNodeEnum powerStationNodeEnum = PowerStationNodeEnum
.getNodeByCode(powerStation.getNextProcessNode()); .getNodeByCode(powerStation.getNextProcessNode());
...@@ -229,7 +233,7 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS ...@@ -229,7 +233,7 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
} }
@Override @Override
@Transactional @GlobalTransactional
public String powerStationExamine(long pageId, String nodeCode, String stationId, String taskId, public String powerStationExamine(long pageId, String nodeCode, String stationId, String taskId,
String planInstanceId, Map<String, Object> kv) { String planInstanceId, Map<String, Object> kv) {
String meg = ""; String meg = "";
......
...@@ -215,6 +215,7 @@ public class QiyuesuoServiceImpl { ...@@ -215,6 +215,7 @@ public class QiyuesuoServiceImpl {
List<Stamper> stampers = new ArrayList<>(); List<Stamper> stampers = new ArrayList<>();
stampers.add(stamper); stampers.add(stamper);
stampers.add(stamper2); stampers.add(stamper2);
//发起合同
SdkResponse<Object> data = this.getSdkResponse(result.getId(), stampers); SdkResponse<Object> data = this.getSdkResponse(result.getId(), stampers);
return result.getId(); return result.getId();
} }
......
...@@ -29,6 +29,7 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel; ...@@ -29,6 +29,7 @@ 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 io.seata.spring.annotation.GlobalTransactional;
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;
...@@ -161,7 +162,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit ...@@ -161,7 +162,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
} }
@Override @Override
@Transactional @GlobalTransactional
public UnitRegisterDto registerUnit(UnitRegisterDto model) { public UnitRegisterDto registerUnit(UnitRegisterDto model) {
UnitInfoDto regUnitInfo = model.getUnitInfoDto(); UnitInfoDto regUnitInfo = model.getUnitInfoDto();
...@@ -576,7 +577,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit ...@@ -576,7 +577,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
@Override @Override
@Transactional @GlobalTransactional
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.更新审核记录表
...@@ -705,6 +706,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit ...@@ -705,6 +706,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
} }
// // 2.更新审核记录表 // // 2.更新审核记录表
// UnitInfo unitInfo=null; // UnitInfo unitInfo=null;
// try{ // try{
...@@ -939,15 +941,26 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit ...@@ -939,15 +941,26 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
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());
List<RegionalCompanies> oldList = regionalCompaniesMapper.selectList(qu); List<RegionalCompanies> oldList = regionalCompaniesMapper.selectList(qu);
regionalCompaniesMapper.delete(qu); regionalCompaniesMapper.delete(qu);
List<RegionalCompanies> regionalComp = new ArrayList<>();
FeignClientResult<Collection<CompanyModel>> feignClientResult = Privilege.companyClient.querySubAgencyTree(regionalCompanies); List<String> oldDisString = oldList.stream().map((regionalCompanies) -> regionalCompanies.getRegionalCompaniesSeq().toString()).collect(Collectors.toList());
List<CompanyModel> companyModel = (List<CompanyModel>) feignClientResult.getResult(); List<String> newDisString = dis.stream().map((regionalCompaniesSeq) -> regionalCompaniesSeq.toString()).collect(Collectors.toList());
List<String> lisd = unitInfo.getRegionalCompaniesSeq();
for(String item:oldDisString){
if(!newDisString.contains(item)){
throw new BadRequest("所属区域公司只能增加, 不能删除");
}
}
List<RegionalCompanies> regionalComp= new ArrayList<>();
FeignClientResult<Collection<CompanyModel>> feignClientResult= Privilege.companyClient.querySubAgencyTree(regionalCompanies);
List<CompanyModel> companyModel = (List<CompanyModel>)feignClientResult.getResult();
List<String> lisd=unitInfo.getRegionalCompaniesSeq();
if (oldList == null) { if (oldList == null) {
......
...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient; ...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO; import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO;
import io.seata.spring.annotation.GlobalTransactional;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
......
...@@ -1128,7 +1128,8 @@ public class MonitorFanIdxController extends BaseController { ...@@ -1128,7 +1128,8 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "运维数据 ") @ApiOperation(value = "运维数据 ")
@GetMapping("/operationData") @GetMapping("/operationData")
public ResponseModel<IPage<Map<String, Object>>> operationData(@RequestParam(value = "areaCode", required = false) String areaCode) { public ResponseModel<IPage<Map<String, Object>>> operationData(@RequestParam(value = "areaCode", required = false) String areaCode,
@RequestParam(value = "stationId", required = false) String stationId) {
// List<StationCacheInfoDto> list = commonServiceImpl.getListStationCacheInfoDto(); // List<StationCacheInfoDto> list = commonServiceImpl.getListStationCacheInfoDto();
...@@ -1152,13 +1153,14 @@ public class MonitorFanIdxController extends BaseController { ...@@ -1152,13 +1153,14 @@ public class MonitorFanIdxController extends BaseController {
// result.setRecords(mapList); // result.setRecords(mapList);
// result.setCurrent(1); // result.setCurrent(1);
// result.setTotal(mapList.size()); // result.setTotal(mapList.size());
return ResponseHelper.buildResponse(monitorService.operationData(areaCode)); return ResponseHelper.buildResponse(monitorService.operationData(areaCode,stationId));
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "全国新能源接入情况 ") @ApiOperation(value = "全国新能源接入情况 ")
@GetMapping("/getAccessSituation") @GetMapping("/getAccessSituation")
public ResponseModel<Map<String, Object>> getAccessSituation(@RequestParam(value = "areaCode", required = false) String areaCode) { public ResponseModel<Map<String, Object>> getAccessSituation(@RequestParam(value = "areaCode", required = false) String areaCode,
return ResponseHelper.buildResponse(monitorService.getAccessSituation(areaCode)); @RequestParam(value = "stationId", required = false) String stationId) {
return ResponseHelper.buildResponse(monitorService.getAccessSituation(areaCode,stationId));
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
......
...@@ -15,10 +15,11 @@ import java.util.Map; ...@@ -15,10 +15,11 @@ import java.util.Map;
public interface MonitorService { public interface MonitorService {
/** /**
* @param areaCode 区域编码 * @param areaCode 区域编码
* @param stationId 场站id
* @return 全国运维数据 * @return 全国运维数据
* @Description 根据区域编码动态运维数据 * @Description 根据区域编码动态运维数据
*/ */
IPage<Map<String, Object>> operationData(String areaCode); IPage<Map<String, Object>> operationData(String areaCode,String stationId);
/** /**
* @return Map<String, Object> * @return Map<String, Object>
...@@ -122,7 +123,8 @@ public interface MonitorService { ...@@ -122,7 +123,8 @@ public interface MonitorService {
/** /**
* 获取接入情况 * 获取接入情况
* @param areaCode * @param areaCode
* @param stationId
* @return * @return
*/ */
Map<String, Object> getAccessSituation(String areaCode); Map<String, Object> getAccessSituation(String areaCode,String stationId);
} }
...@@ -31,6 +31,7 @@ import org.springframework.scheduling.annotation.Scheduled; ...@@ -31,6 +31,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import java.io.IOException; import java.io.IOException;
...@@ -60,11 +61,14 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -60,11 +61,14 @@ public class MonitorServiceImpl implements MonitorService {
private Resource overviewGF; private Resource overviewGF;
@Override @Override
public IPage<Map<String, Object>> operationData(String areaCode) { public IPage<Map<String, Object>> operationData(String areaCode,String stationId) {
List<StationCacheInfoDto> list = getListStationCacheInfoDto(); List<StationCacheInfoDto> list = getListStationCacheInfoDto();
if (null != areaCode) { if (null != areaCode) {
list = list.stream().filter(e -> e.getAreaCode().toUpperCase(Locale.ROOT).equals(areaCode.toUpperCase(Locale.ROOT))).collect(Collectors.toList()); list = list.stream().filter(e -> e.getAreaCode().toUpperCase(Locale.ROOT).equals(areaCode.toUpperCase(Locale.ROOT))).collect(Collectors.toList());
} }
if (!StringUtils.isEmpty(stationId)) {
list = list.stream().filter(e -> e.getStationId().toUpperCase(Locale.ROOT).equals(stationId.toUpperCase(Locale.ROOT))).collect(Collectors.toList());
}
List<Map<String, Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
Map<String, List<StationCacheInfoDto>> listMap = list.stream().collect(Collectors.groupingBy(StationCacheInfoDto::getStationType, Collectors.toList())); Map<String, List<StationCacheInfoDto>> listMap = list.stream().collect(Collectors.groupingBy(StationCacheInfoDto::getStationType, Collectors.toList()));
for (StationType value : StationType.values()) { for (StationType value : StationType.values()) {
...@@ -944,8 +948,8 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -944,8 +948,8 @@ public class MonitorServiceImpl implements MonitorService {
} }
@Override @Override
public Map<String, Object> getAccessSituation(String areaCode) { public Map<String, Object> getAccessSituation(String areaCode, String stationId) {
IPage<Map<String, Object>> page = operationData(areaCode); IPage<Map<String, Object>> page = operationData(areaCode,stationId);
List<Map<String, Object>> records = page.getRecords(); List<Map<String, Object>> records = page.getRecords();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
if (!CollectionUtils.isEmpty(records)) { if (!CollectionUtils.isEmpty(records)) {
......
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