Commit 972320ea authored by hezhuozhi's avatar hezhuozhi

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

parents 7d6a0f21 3395a9b2
...@@ -103,12 +103,12 @@ public class MyBatisPlusCodeGenerator { ...@@ -103,12 +103,12 @@ public class MyBatisPlusCodeGenerator {
gc.setActiveRecord(false); gc.setActiveRecord(false);
// 数据源配置 // 数据源配置
DataSourceConfig dsc = new DataSourceConfig(); DataSourceConfig dsc = new DataSourceConfig();
dsc.setUrl("jdbc:mysql://47.92.234.253:3306/amos_project?serverTimezone=GMT%2B8"); dsc.setUrl("jdbc:mysql://47.92.234.253:13306/amos_project?serverTimezone=GMT%2B8");
// dsc.setSchemaName("public"); // dsc.setSchemaName("public");
// dsc.setDriverName("com.mysql.jdbc.Driver"); // dsc.setDriverName("com.mysql.jdbc.Driver");
dsc.setDriverName("com.mysql.cj.jdbc.Driver"); dsc.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUsername("root"); dsc.setUsername("root");
dsc.setPassword("Yeejoin@2020"); dsc.setPassword("Yeejoin_1234");
dsc.setTypeConvert(new ITypeConvert() { dsc.setTypeConvert(new ITypeConvert() {
@Override @Override
...@@ -130,7 +130,7 @@ public class MyBatisPlusCodeGenerator { ...@@ -130,7 +130,7 @@ public class MyBatisPlusCodeGenerator {
// 包配置 // 包配置
final PackageConfig pc = new PackageConfig(); final PackageConfig pc = new PackageConfig();
// 填写对应模块 // 填写对应模块
pc.setModuleName(projectShortName); pc.setModuleName(projectShortName1);
// 实体路径 // 实体路径
pc.setParent("com.yeejoin.amos.boot.module"); pc.setParent("com.yeejoin.amos.boot.module");
pc.setEntity("api.entity"); pc.setEntity("api.entity");
...@@ -294,7 +294,7 @@ public class MyBatisPlusCodeGenerator { ...@@ -294,7 +294,7 @@ public class MyBatisPlusCodeGenerator {
strategy.setTablePrefix(); strategy.setTablePrefix();
//去除表名前缀 //去除表名前缀
strategy.setTablePrefix("tz_" + projectShortName1 + "_", "t_", "tb_", "sys_", "other_", "rpm_", "s_", "tcb_", strategy.setTablePrefix("tz_" + projectShortName1 + "_", "t_", "tb_", "sys_", "other_", "rpm_", "s_", "tcb_",
"cb_", "tz_", "jc_", "jcb_", "flc_"); "cb_", "tz_", "jc_", "jcb_", "flc_","hygf_");
// 设置父级Controller // 设置父级Controller
strategy.setSuperControllerClass("com.yeejoin.amos.boot.biz.common.controller.BaseController"); strategy.setSuperControllerClass("com.yeejoin.amos.boot.biz.common.controller.BaseController");
autoGenerator.setStrategy(strategy); autoGenerator.setStrategy(strategy);
......
...@@ -28,6 +28,7 @@ public enum ArrivalStateeEnum { ...@@ -28,6 +28,7 @@ public enum ArrivalStateeEnum {
施工中("施工中", "施工中"), 施工中("施工中", "施工中"),
施工完成 ("施工完成", "施工完成"), 施工完成 ("施工完成", "施工完成"),
并网中("并网中", "并网中"), 并网中("并网中", "并网中"),
验收中("验收中", "验收中"),
并网完成("并网完成", "并网完成"), 并网完成("并网完成", "并网完成"),
线上验收("线上验收", "线上验收"), 线上验收("线上验收", "线上验收"),
线下验收("线下验收", "线下验收"), 线下验收("线下验收", "线下验收"),
......
package com.yeejoin.amos.boot.module.hygf.api.Enum;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum BusinessWorkflowKey {
经销商管理员审核("经销商管理员审核","Activity_0r2x1es,Activity_0ojajec"),
完工登记("完工登记","Activity_1spujef"),
施工完成提交("施工完成提交","Activity_0bs6t4g"),
并网登记("并网登记","Activity_0bs6t4g"),
验收提交("验收提交","Activity_0bs6t4g"),
完工自审("完工自审","Activity_16r1828"),
片区运营审核("片区运营审核","Activity_1bldcno,Activity_05nlkey,Activity_0edftmv"),
设计审核("设计审核","Activity_095if3p,Activity_0k4o46e"),
工程审核("工程审核","Activity_1yftt2k,Activity_0k4o46e"),
投融审核("投融审核","Activity_1rjn5s1"),
法务审核("法务审核","Activity_1rjn5s1"),
资产审核("资产审核","Activity_0rbc0gc");
private String name;
private String code;
}
...@@ -14,12 +14,21 @@ public enum GridStatusEnum { ...@@ -14,12 +14,21 @@ public enum GridStatusEnum {
DDJ("待登记", "1"), DDJ("待登记", "1"),
JXSGLYDSH("经销商管理员待审核", "2"),
DSH("待审核", "2"),
YWC("已完成", "3"), YWC("已完成", "3"),
WTG("未通过", "4"),
SJDSH("设计待审核", "5"),
ROLESDSH("设计待审核/工程待审核", "6"),
PQYYDSH("片区运营待审核", "7"),
GCDSH("工程待审核", "8"),
ZGDSH("整改待审核", "9"),
DZG("待整改", "10"),
YSROLESDSH("投融待审核/法务待审核", "11"),
TRDSH("投融待审核", "12"),
ZCDSH("资产待审核", "13"),
FWDSH("法务待审核", "14"),
DTJYS("待提交验收", "15");
WTG("未通过", "4");
/** /**
* 名称,描述 * 名称,描述
......
...@@ -8,7 +8,9 @@ import lombok.Getter; ...@@ -8,7 +8,9 @@ import lombok.Getter;
public enum RectificationOrderEnum { public enum RectificationOrderEnum {
施工("ProcessEngineering", "area,design,engineering"); 施工("ProcessEngineering", "area,design,engineering"),
并网("GridConnected", "bw-area,bw-design,bw-engineering"),
验收("AcceptanceCheck", "ys-area,ys-tourong,ys-fawu,ys-zichan");
/** /**
* 名称,描述 * 名称,描述
......
package com.yeejoin.amos.boot.module.hygf.api.Enum;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum RectificationRoleEnum {
片区运营角色("area,bw-area,ys-area"), 设计角色("design,bw-design"), 工程角色("engineering,bw-engineering"), 投融角色("ys-tourong"),
法务角色("ys-fawu"),资产角色("ys-zichan");
/**
* 名称,描述
*/
private String name;
public static RectificationRoleEnum getNodeByName(String name) {
RectificationRoleEnum dealerReviewEnum = null;
for (RectificationRoleEnum type : RectificationRoleEnum.values()) {
if (type.getName().contains(name)) {
dealerReviewEnum = type;
break;
}
}
return dealerReviewEnum;
}
}
...@@ -56,6 +56,8 @@ public class GlobalExceptionHandler { ...@@ -56,6 +56,8 @@ public class GlobalExceptionHandler {
String stackTrace = sw.toString(); String stackTrace = sw.toString();
response.setDevMessage(stackTrace); response.setDevMessage(stackTrace);
response.setMessage(stackTrace); response.setMessage(stackTrace);
System.err.println(e.getMessage());
log.debug("Exception stack trace (debug mode): {}", stackTrace);
} else { } else {
response.setDevMessage(e.getMessage()); response.setDevMessage(e.getMessage());
response.setMessage(e.getMessage()); response.setMessage(e.getMessage());
......
package com.yeejoin.amos.boot.module.hygf.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 并网审核表
*
* @author system_generator
* @date 2024-08-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AcceptanceCheckAuditingDto", description="并网审核表")
public class AcceptanceCheckAuditingDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "工作流实例ID")
private String instanceId;
@ApiModelProperty(value = "下一个节点角色权限id")
private String nextExecutorIds;
@ApiModelProperty(value = "任务发起人id")
private String promoter;
@ApiModelProperty(value = "流程下一节点id")
private String nextTaskId;
@ApiModelProperty(value = "下一节点可执行人逗号分割")
private String nextExecuteUserIds;
@ApiModelProperty(value = "工作流发起人id")
private String createUserId;
@ApiModelProperty(value = "下个节点名称")
private String nextNodeName;
@ApiModelProperty(value = "下个节点key")
private String nextNodeKey;
@ApiModelProperty(value = "状态")
private String status;
@ApiModelProperty(value = "验收id")
private Long peasantHouseholdId;
@ApiModelProperty(value = " 待执行节点小程序路由")
private String nodeRouting;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 并网验收节点
*
* @author system_generator
* @date 2024-08-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AcceptanceCheckDto", description="并网验收节点")
public class AcceptanceCheckDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "施工单id")
private Long workOrderId;
@ApiModelProperty(value = "施工电站id")
private Long workOrderPowerStationId;
@ApiModelProperty(value = "农户id")
private Long peasantHouseholdId;
@ApiModelProperty(value = "验收状态")
private String acceptanceCheckStatus;
@ApiModelProperty(value = "节点标识")
private String basicGridNode;
@ApiModelProperty(value = "片区审核")
private String powerStationAreaStatus;
@ApiModelProperty(value = "法务审核")
private String powerStationLegalStatus;
@ApiModelProperty(value = "投融审核")
private String powerStationFinancingStatus;
@ApiModelProperty(value = "资产审核")
private String powerStationAssetsStatus;
@ApiModelProperty(value = "实例id")
private String instanceId;
private String acceptanceTime;
//电站编号
private String peasantHouseholdNo;
//户主姓名
private String ownersName;
///项目地址
private String projectAddressName;
//并网日期
private Date gridConnectionTime;
private String regionalCompaniesName;
private String serviceAgent;
//并网登记id
private Long fonGridId;
private String isAudit;
private String rectificationStatus;
// 电站安装规模
private String scale;
}
...@@ -76,4 +76,5 @@ public class BasicGridAcceptanceDto extends BaseDto { ...@@ -76,4 +76,5 @@ public class BasicGridAcceptanceDto extends BaseDto {
// 电站安装规模(kW) // 电站安装规模(kW)
private String scale; private String scale;
} }
package com.yeejoin.amos.boot.module.hygf.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 并网审核表
*
* @author system_generator
* @date 2024-08-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="BasicGridAuditingDto", description="并网审核表")
public class BasicGridAuditingDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "工作流实例ID")
private String instanceId;
@ApiModelProperty(value = "下一个节点角色权限id")
private String nextExecutorIds;
@ApiModelProperty(value = "任务发起人id")
private String promoter;
@ApiModelProperty(value = "流程下一节点id")
private String nextTaskId;
@ApiModelProperty(value = "下一节点可执行人逗号分割")
private String nextExecuteUserIds;
@ApiModelProperty(value = "工作流发起人id")
private String createUserId;
@ApiModelProperty(value = "下个节点名称")
private String nextNodeName;
@ApiModelProperty(value = "下个节点key")
private String nextNodeKey;
@ApiModelProperty(value = "状态")
private String status;
@ApiModelProperty(value = "并网id")
private Long peasantHouseholdId;
@ApiModelProperty(value = " 待执行节点小程序路由")
private String nodeRouting;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 并网验收节点
*
* @author system_generator
* @date 2024-08-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="BasicGridRecordDto", description="并网验收节点")
public class BasicGridRecordDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "施工单id")
private Long workOrderId;
@ApiModelProperty(value = "施工电站id")
private Long workOrderPowerStationId;
@ApiModelProperty(value = "农户id")
private Long peasantHouseholdId;
@ApiModelProperty(value = "并网状态")
private String gridStatus;
@ApiModelProperty(value = "节点标识")
private String basicGridNode;
@ApiModelProperty(value = "片区审核")
private String powerStationAreaStatus;
@ApiModelProperty(value = "设计审核")
private String powerStationDesignStatus;
@ApiModelProperty(value = "工程审核")
private String powerStationEngineeringStatus;
@ApiModelProperty(value = "实例id")
private String instanceId;
@ApiModelProperty(value = "当前存在的整改单类型")
private String rectificationStatus;
//电站编号
private String peasantHouseholdNo;
//户主姓名
private String ownersName;
///项目地址
private String projectAddressName;
//并网日期
private Date gridConnectionTime;
private String regionalCompaniesName;
private String serviceAgent;
//并网登记id
private Long fonGridId;
private String isAudit;
private Date gridTime;
// 电站安装规模(kW)
private String scale;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 并网操作日志
*
* @author system_generator
* @date 2024-09-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="ConstructionAcceptanceRecordsDto", description="并网操作日志")
public class ConstructionAcceptanceRecordsDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "操作人")
private String operator;
@ApiModelProperty(value = "操作内容")
private String operationContent;
@ApiModelProperty(value = "操作时间")
private Date operationTime;
@ApiModelProperty(value = "操作结果")
private String operationResults;
@ApiModelProperty(value = "施工单id")
private Long acceptanceId;
@ApiModelProperty(value = "施工电站")
private Long workOrderPowerStationId;
@ApiModelProperty(value = "农户id")
private Long peasantHouseholdId;
@ApiModelProperty(value = "备注")
private String notes;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 并网操作日志
*
* @author system_generator
* @date 2024-09-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="ConstructionGirdRecordsDto", description="并网操作日志")
public class ConstructionGirdRecordsDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "操作人")
private String operator;
@ApiModelProperty(value = "操作内容")
private String operationContent;
@ApiModelProperty(value = "操作时间")
private Date operationTime;
@ApiModelProperty(value = "操作结果")
private String operationResults;
@ApiModelProperty(value = "施工单id")
private Long gridId;
@ApiModelProperty(value = "施工电站")
private Long workOrderPowerStationId;
@ApiModelProperty(value = "农户id")
private Long peasantHouseholdId;
@ApiModelProperty(value = "备注")
private String notes;
}
...@@ -5,7 +5,11 @@ import lombok.Data; ...@@ -5,7 +5,11 @@ import lombok.Data;
@Data @Data
public class PeasantHouseholdPageDto extends Page<PeasantHouseholdPageDto> { public class PeasantHouseholdPageDto extends Page<PeasantHouseholdPageDto> {
private String nhUserId; /**
*
*/
private static final long serialVersionUID = 1L;
private String nhUserId;
private String peasantHouseholdNo; private String peasantHouseholdNo;
private String regionalCompaniesName; private String regionalCompaniesName;
private String developerName; private String developerName;
......
...@@ -14,11 +14,17 @@ public class PowerStationEngineeringInfoAllDto { ...@@ -14,11 +14,17 @@ public class PowerStationEngineeringInfoAllDto {
//并网验收审核记录 //并网验收审核记录
LoggerDto loggerDto; LoggerDto loggerDto;
//验收审核记录
LoggerDto loggerYsDto;
//自审信息 //自审信息
ConstructionRecords constructionRecords; ConstructionRecords constructionRecords;
ConstructionGirdRecords constructionGirdRecords;
ConstructionAcceptanceRecords acceptanceRecords;
// 基本信息 // 基本信息
SurveyInformationDto surveyInformation; SurveyInformationDto surveyInformation;
...@@ -58,6 +64,13 @@ public class PowerStationEngineeringInfoAllDto { ...@@ -58,6 +64,13 @@ public class PowerStationEngineeringInfoAllDto {
//派工单信息 //派工单信息
WorkOrder workOrder; WorkOrder workOrder;
//验收信息
AcceptanceCheck acceptanceCheck;
//保存标识 0 保存 1保存并提交 //保存标识 0 保存 1保存并提交
Integer commitFlag; Integer commitFlag;
//流程类型 0 并网 1是验收
Integer flowType;
} }
...@@ -47,6 +47,9 @@ public class SurveyInfoAllDto { ...@@ -47,6 +47,9 @@ public class SurveyInfoAllDto {
//自审信息 //自审信息
ConstructionRecords constructionRecords; ConstructionRecords constructionRecords;
//验收信息
AcceptanceCheck acceptanceCheck;
} }
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;
/**
* 并网验收节点
*
* @author system_generator
* @date 2024-08-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("hygf_acceptance_check")
public class AcceptanceCheck extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 施工单id
*/
@TableField("work_order_id")
private Long workOrderId;
/**
* 施工电站id
*/
@TableField("work_order_power_station_id")
private Long workOrderPowerStationId;
/**
* 农户id
*/
@TableField("peasant_household_id")
private Long peasantHouseholdId;
/**
* 验收状态
*/
@TableField("acceptance_check_status")
private String acceptanceCheckStatus;
/**
* 节点标识
*/
@TableField("basic_grid_node")
private String basicGridNode;
/**
* 片区审核
*/
@TableField("power_station_area_status")
private String powerStationAreaStatus;
/**
* 法务审核
*/
@TableField("power_station_legal_status")
private String powerStationLegalStatus;
/**
* 投融审核
*/
@TableField("power_station_financing_status")
private String powerStationFinancingStatus;
/**
* 资产审核
*/
@TableField("power_station_assets_status")
private String powerStationAssetsStatus;
/**
* 实例id
*/
@TableField("instance_Id")
private String instanceId;
/**
* 整改单状态
*/
@TableField("rectification_status")
private String rectificationStatus;
/**
* 验收时间
*/
@TableField("acceptance_time")
private String acceptanceTime;
/**
* 片区整改单
*/
@TableField(exist = false)
private List<HygfRectificationOrder> areaOrders;
/**
* 投融整改单
*/
@TableField(exist = false)
private List<HygfRectificationOrder> financeOrders;
/**
* 法务整改单
*/
@TableField(exist = false)
private List<HygfRectificationOrder> legalOrders;
/**
* 资产整改单
*/
@TableField(exist = false)
private List<HygfRectificationOrder> propertyOrders;
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 并网审核表
*
* @author system_generator
* @date 2024-08-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("hygf_acceptance_check_auditing")
public class AcceptanceCheckAuditing extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 工作流实例ID
*/
@TableField("instance_id")
private String instanceId;
/**
* 下一个节点角色权限id
*/
@TableField("next_executor_ids")
private String nextExecutorIds;
/**
* 任务发起人id
*/
@TableField("promoter")
private String promoter;
/**
* 流程下一节点id
*/
@TableField("next_task_id")
private String nextTaskId;
/**
* 下一节点可执行人逗号分割
*/
@TableField("next_execute_user_ids")
private String nextExecuteUserIds;
/**
* 工作流发起人id
*/
@TableField("create_user_id")
private String createUserId;
/**
* 下个节点名称
*/
@TableField("next_node_name")
private String nextNodeName;
/**
* 下个节点key
*/
@TableField("next_node_key")
private String nextNodeKey;
/**
* 状态
*/
@TableField("status")
private String status;
/**
* 验收id
*/
@TableField("peasant_household_id")
private Long peasantHouseholdId;
/**
* 待执行节点小程序路由
*/
@TableField("node_routing")
private String nodeRouting;
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 并网审核表
*
* @author system_generator
* @date 2024-08-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("hygf_basic_grid_auditing")
public class BasicGridAuditing extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 工作流实例ID
*/
@TableField("instance_id")
private String instanceId;
/**
* 下一个节点角色权限id
*/
@TableField("next_executor_ids")
private String nextExecutorIds;
/**
* 任务发起人id
*/
@TableField("promoter")
private String promoter;
/**
* 流程下一节点id
*/
@TableField("next_task_id")
private String nextTaskId;
/**
* 下一节点可执行人逗号分割
*/
@TableField("next_execute_user_ids")
private String nextExecuteUserIds;
/**
* 工作流发起人id
*/
@TableField("create_user_id")
private String createUserId;
/**
* 下个节点名称
*/
@TableField("next_node_name")
private String nextNodeName;
/**
* 下个节点key
*/
@TableField("next_node_key")
private String nextNodeKey;
/**
* 状态
*/
@TableField("status")
private String status;
/**
* 并网id
*/
@TableField("peasant_household_id")
private Long peasantHouseholdId;
/**
* 待执行节点小程序路由
*/
@TableField("node_routing")
private String nodeRouting;
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 并网验收节点
*
* @author system_generator
* @date 2024-08-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("hygf_basic_grid_record")
public class BasicGridRecord extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 施工单id
*/
@TableField("work_order_id")
private Long workOrderId;
/**
* 施工电站id
*/
@TableField("work_order_power_station_id")
private Long workOrderPowerStationId;
/**
* 农户id
*/
@TableField("peasant_household_id")
private Long peasantHouseholdId;
/**
* 并网状态
*/
@TableField("grid_status")
private String gridStatus;
/**
* 节点标识
*/
@TableField("basic_grid_node")
private String basicGridNode;
/**
* 片区审核
*/
@TableField("power_station_area_status")
private String powerStationAreaStatus;
/**
* 设计审核
*/
@TableField("power_station_design_status")
private String powerStationDesignStatus;
/**
* 工程审核
*/
@TableField("power_station_engineering_status")
private String powerStationEngineeringStatus;
/**
* 实例id
*/
@TableField("instance_Id")
private String instanceId;
/**
* 整改单状态
*/
@TableField("rectification_status")
private String rectificationStatus;
/**
* 验收时间
*/
@TableField("grid_time")
private Date gridTime;
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;
/**
* 并网操作日志
*
* @author system_generator
* @date 2024-09-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("hygf_construction_acceptance_records")
public class ConstructionAcceptanceRecords extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 操作人
*/
@TableField("operator")
private String operator;
/**
* 操作内容
*/
@TableField("operation_content")
private String operationContent;
/**
* 操作时间
*/
@TableField("operation_time")
private Date operationTime;
/**
* 操作结果
*/
@TableField("operation_results")
private String operationResults;
/**
* 施工单id
*/
@TableField("acceptance_id")
private Long acceptanceId;
/**
* 施工电站
*/
@TableField("work_order_power_station_id")
private Long workOrderPowerStationId;
/**
* 农户id
*/
@TableField("peasant_household_id")
private Long peasantHouseholdId;
/**
* 备注
*/
@TableField("notes")
private String notes;
@TableField(exist = false)
List<ConstructionAcceptanceRecords> constructionRecordsList;
public ConstructionAcceptanceRecords() {
}
public ConstructionAcceptanceRecords(String operator, String operationContent, Date operationTime, String operationResults, Long acceptanceId, Long workOrderPowerStationId, Long peasantHouseholdId, String notes) {
this.operator = operator;
this.operationContent = operationContent;
this.operationTime = operationTime;
this.operationResults = operationResults;
this.acceptanceId = acceptanceId;
this.workOrderPowerStationId = workOrderPowerStationId;
this.peasantHouseholdId = peasantHouseholdId;
this.notes = notes;
}
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;
/**
* 并网操作日志
*
* @author system_generator
* @date 2024-09-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("hygf_construction_gird_records")
public class ConstructionGirdRecords extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 操作人
*/
@TableField("operator")
private String operator;
/**
* 操作内容
*/
@TableField("operation_content")
private String operationContent;
/**
* 操作时间
*/
@TableField("operation_time")
private Date operationTime;
/**
* 操作结果
*/
@TableField("operation_results")
private String operationResults;
/**
* 施工单id
*/
@TableField("grid_id")
private Long gridId;
/**
* 施工电站
*/
@TableField("work_order_power_station_id")
private Long workOrderPowerStationId;
/**
* 农户id
*/
@TableField("peasant_household_id")
private Long peasantHouseholdId;
/**
* 备注
*/
@TableField("notes")
private String notes;
public ConstructionGirdRecords(String operator, String operationContent, Date operationTime, String operationResults, Long gridId, Long workOrderPowerStationId, Long peasantHouseholdId, String notes) {
this.operator = operator;
this.operationContent = operationContent;
this.operationTime = operationTime;
this.operationResults = operationResults;
this.gridId = gridId;
this.workOrderPowerStationId = workOrderPowerStationId;
this.peasantHouseholdId = peasantHouseholdId;
this.notes = notes;
}
public ConstructionGirdRecords() {
}
@TableField(exist = false)
List<ConstructionGirdRecords> constructionRecordsList;
}
...@@ -149,4 +149,21 @@ public class HygfOnGrid extends BaseEntity { ...@@ -149,4 +149,21 @@ public class HygfOnGrid extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private String type; private String type;
/**
* 片区整改单
*/
@TableField(exist = false)
private List<HygfRectificationOrder> areaOrders;
/**
* 工程整改单
*/
@TableField(exist = false)
private List<HygfRectificationOrder> engineeringOrders;
/**
* 设计整改单
*/
@TableField(exist = false)
private List<HygfRectificationOrder> designOrders;
} }
...@@ -97,7 +97,12 @@ public class HygfRectificationOrder extends BaseEntity { ...@@ -97,7 +97,12 @@ public class HygfRectificationOrder extends BaseEntity {
*/ */
@TableField("rectification_source") @TableField("rectification_source")
private String rectificationSource; private String rectificationSource;
/**
* 整改来源
*/
@TableField(exist = false)
private String rectificationSourceName;
/** /**
* 整改历史意见 * 整改历史意见
......
package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.AcceptanceCheckAuditing;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 并网审核表 Mapper 接口
*
* @author system_generator
* @date 2024-08-21
*/
public interface AcceptanceCheckAuditingMapper extends BaseMapper<AcceptanceCheckAuditing> {
}
package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.AcceptanceCheckDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.AcceptanceCheck;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 并网验收节点 Mapper 接口
*
* @author system_generator
* @date 2024-08-21
*/
public interface AcceptanceCheckMapper extends BaseMapper<AcceptanceCheck> {
@UserEmpower(field ={"hph.regional_companies_code"} ,dealerField={"hph.developer_code","hph.regional_companies_code","hph.developer_user_id"},fieldConditions ={"in","in","in"} ,relationship="and")
List<AcceptanceCheckDto> selectPageList(@Param("map")Map<String, Object> map);
}
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.api.mapper; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower; import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridAcceptanceDto; import com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridAcceptanceDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridRecordDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.BasicGridAcceptance; import com.yeejoin.amos.boot.module.hygf.api.entity.BasicGridAcceptance;
import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold; import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -21,5 +22,5 @@ public interface BasicGridAcceptanceMapper extends BaseMapper<BasicGridAcceptanc ...@@ -21,5 +22,5 @@ public interface BasicGridAcceptanceMapper extends BaseMapper<BasicGridAcceptanc
PeasantHousehold getStationInfoById(@Param("id") Long id); PeasantHousehold getStationInfoById(@Param("id") Long id);
@UserEmpower(field ={"hph.regional_companies_code"} ,dealerField={"hph.developer_code","hph.regional_companies_code","hph.developer_user_id"},fieldConditions ={"in","in","in"} ,relationship="and") @UserEmpower(field ={"hph.regional_companies_code"} ,dealerField={"hph.developer_code","hph.regional_companies_code","hph.developer_user_id"},fieldConditions ={"in","in","in"} ,relationship="and")
List<BasicGridAcceptanceDto> selectPageList(@Param("map") Map<String, Object> map); List<BasicGridRecordDto> selectPageList(@Param("map") Map<String, Object> map);
} }
package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.BasicGridAuditing;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 并网审核表 Mapper 接口
*
* @author system_generator
* @date 2024-08-21
*/
public interface BasicGridAuditingMapper extends BaseMapper<BasicGridAuditing> {
}
package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.BasicGridRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 并网验收节点 Mapper 接口
*
* @author system_generator
* @date 2024-08-21
*/
public interface BasicGridRecordMapper extends BaseMapper<BasicGridRecord> {
}
package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.ConstructionAcceptanceRecords;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 并网操作日志 Mapper 接口
*
* @author system_generator
* @date 2024-09-02
*/
public interface ConstructionAcceptanceRecordsMapper extends BaseMapper<ConstructionAcceptanceRecords> {
}
package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.ConstructionGirdRecords;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 并网操作日志 Mapper 接口
*
* @author system_generator
* @date 2024-09-02
*/
public interface ConstructionGirdRecordsMapper extends BaseMapper<ConstructionGirdRecords> {
}
package com.yeejoin.amos.boot.module.hygf.api.service;
/**
* 并网审核表接口类
*
* @author system_generator
* @date 2024-08-21
*/
public interface IAcceptanceCheckAuditingService {
}
package com.yeejoin.amos.boot.module.hygf.api.service;
/**
* 并网验收节点接口类
*
* @author system_generator
* @date 2024-08-21
*/
public interface IAcceptanceCheckService {
}
package com.yeejoin.amos.boot.module.hygf.api.service;
/**
* 并网审核表接口类
*
* @author system_generator
* @date 2024-08-21
*/
public interface IBasicGridAuditingService {
}
package com.yeejoin.amos.boot.module.hygf.api.service;
/**
* 并网验收节点接口类
*
* @author system_generator
* @date 2024-08-21
*/
public interface IBasicGridRecordService {
}
package com.yeejoin.amos.boot.module.hygf.api.service;
/**
* 并网操作日志接口类
*
* @author system_generator
* @date 2024-09-02
*/
public interface IConstructionAcceptanceRecordsService {
}
package com.yeejoin.amos.boot.module.hygf.api.service;
/**
* 并网操作日志接口类
*
* @author system_generator
* @date 2024-09-02
*/
public interface IConstructionGirdRecordsService {
}
...@@ -47,6 +47,15 @@ public class CommonResponseNewUtil ...@@ -47,6 +47,15 @@ public class CommonResponseNewUtil
return res; return res;
} }
public static ResponseModel failureMessage(String message)
{
ResponseModel res = new ResponseModel();
res.setDevMessage(message);
res.setMessage(message);
res.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
return res;
}
public static ResponseModel failure(Object obj, String message) public static ResponseModel failure(Object obj, String message)
{ {
ResponseModel res = new ResponseModel(); ResponseModel res = new ResponseModel();
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.AcceptanceCheckAuditingMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.AcceptanceCheckMapper">
<select id="selectPageList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.AcceptanceCheckDto">
SELECT
hogaa.sequence_nbr fonGridId,
hbga.sequence_nbr sequenceNbr,
hbga.work_order_id workOrderId,
hbga.work_order_power_station_id workOrderPowerStationId,
hbga.peasant_household_id peasantHouseholdId,
hbga.basic_grid_node basicGridNode,
hbga.acceptance_time acceptanceTime,
hbga.power_station_area_status powerStationAreaStatus,
hbga.power_station_financing_status powerStationFinancingStatus,
hbga.power_station_assets_status powerStationAssetsStatus,
hbga.rectification_status rectificationStatus,
hbga.power_station_legal_status powerStationLegalStatus,
hbga.instance_id instanceId,
hph.developer_name as serviceAgent,
hph.regional_companies_name AS regionalCompaniesName,
hph.owners_name AS ownersName,
hph.peasant_household_no peasantHouseholdNo,
hph.project_address_name projectAddressName,
DATE_FORMAT(hogaa.grid_connection_time, '%Y-%m-%d %H:%i:%S') AS gridConnectionTime,
CASE WHEN hbga.acceptance_check_status = '15' THEN '待提交验收'
WHEN hbga.acceptance_check_status = '2' THEN '经销商管理员待审核'
WHEN hbga.acceptance_check_status = '3' THEN '已完成'
WHEN hbga.acceptance_check_status = '4' THEN '未通过'
WHEN hbga.acceptance_check_status = '7' THEN '片区运营待审核'
WHEN hbga.acceptance_check_status = '9' THEN '整改待审核'
WHEN hbga.acceptance_check_status = '11' THEN '投融待审核/法务待审核'
WHEN hbga.acceptance_check_status = '12' THEN '投融待审核'
WHEN hbga.acceptance_check_status = '13' THEN '资产待审核'
WHEN hbga.acceptance_check_status = '14' THEN '法务待审核'
ELSE '待整改' END AS acceptanceCheckStatus
FROM
hygf_acceptance_check hbga
LEFT JOIN hygf_peasant_household hph ON hph.sequence_nbr = hbga.peasant_household_id
LEFT JOIN hygf_on_grid_and_acceptance hogaa ON hogaa.work_order_power_station_id = hbga.work_order_power_station_id
LEFT JOIN hygf_work_order ON hygf_work_order.sequence_nbr = hbga.work_order_id
<where>
hbga.is_delete = 0
<if test="map.amosDealerId!=null and map.amosDealerId!=''">
and hygf_work_order.amos_dealer_id = #{map.amosDealerId}
</if>
<if test="map.regionCompanyId!=null and map.regionCompanyId!=''">
and hygf_work_order.region_company_id =#{map.regionCompanyId}
</if>
<if test="map.powerStationCode!=null and map.powerStationCode!=''">
and hph.peasant_household_no like concat('%',#{map.powerStationCode},'%')
</if>
<if test="map.formType != null and map.formType!=''">
AND hbga.acceptance_check_status IN ('2', '3', '4')
</if>
<if test="map.projectAddress != null and map.projectAddress!=''">
AND hph.project_address_name LIKE concat(concat('%', #{map.projectAddress}), '%')
</if>
<if test="map.type != null">
and ( (hbga.basic_grid_node is not null AND hbga.basic_grid_node != 'jxsAdmin')
or hbga.basic_grid_node = 'all'
or hbga.power_station_area_status is not null
or hbga.power_station_financing_status is not null
or hbga.power_station_assets_status is not null
or hbga.power_station_legal_status is not null
)
</if>
<if test="map.ownersName != null and map.ownersName !=''">
AND hph.owners_name LIKE concat(concat('%', #{map.ownersName}), '%')
</if>
<if test="map.acceptanceCheckStatus != null and map.acceptanceCheckStatus !=''">
AND hbga.acceptance_check_status = #{map.acceptanceCheckStatus}
</if>
<if test="map.acceptanceTime != null">
AND DATE_FORMAT(hogaa.acceptance_time, '%Y-%m-%d') = #{map.acceptanceTime}
</if>
</where>
ORDER BY hbga.sequence_nbr desc
</select>
</mapper>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
hogaa.peasant_household_id = #{id} hogaa.peasant_household_id = #{id}
</select> </select>
<select id="selectPageList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridAcceptanceDto"> <select id="selectPageList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridRecordDto">
SELECT SELECT
hogaa.sequence_nbr fonGridId, hogaa.sequence_nbr fonGridId,
...@@ -20,10 +20,13 @@ ...@@ -20,10 +20,13 @@
hbga.work_order_id workOrderId, hbga.work_order_id workOrderId,
hbga.work_order_power_station_id workOrderPowerStationId, hbga.work_order_power_station_id workOrderPowerStationId,
hbga.peasant_household_id peasantHouseholdId, hbga.peasant_household_id peasantHouseholdId,
hbga.acceptance_rec_date acceptanceRecDate, hbga.basic_grid_node basicGridNode,
hbga.grid_time gridTime,
hbga.power_station_area_status powerStationAreaStatus,
hbga.power_station_design_status powerStationDesignStatus,
hbga.rectification_status rectificationStatus,
hbga.power_station_engineering_status powerStationEngineeringStatus,
hbga.instance_id instanceId, hbga.instance_id instanceId,
hbga.next_executor_ids nextExecutorIds,
hbga.next_node_key nextNodeKey,
hph.developer_name as serviceAgent, hph.developer_name as serviceAgent,
hph.regional_companies_name AS regionalCompaniesName, hph.regional_companies_name AS regionalCompaniesName,
hph.owners_name AS ownersName, hph.owners_name AS ownersName,
...@@ -31,11 +34,17 @@ ...@@ -31,11 +34,17 @@
hph.project_address_name projectAddressName, hph.project_address_name projectAddressName,
DATE_FORMAT(hogaa.grid_connection_time, '%Y-%m-%d %H:%i:%S') AS gridConnectionTime, DATE_FORMAT(hogaa.grid_connection_time, '%Y-%m-%d %H:%i:%S') AS gridConnectionTime,
CASE WHEN hbga.grid_status = '1' THEN '待登记' CASE WHEN hbga.grid_status = '1' THEN '待登记'
WHEN hbga.grid_status = '2' THEN '待审核' WHEN hbga.grid_status = '2' THEN '经销商管理员待审核'
WHEN hbga.grid_status = '3' THEN '已完成' WHEN hbga.grid_status = '3' THEN '已完成'
ELSE '未通过' END AS gridStatus WHEN hbga.grid_status = '4' THEN '未通过'
WHEN hbga.grid_status = '5' THEN '设计待审核'
WHEN hbga.grid_status = '6' THEN '设计待审核/工程待审核'
WHEN hbga.grid_status = '7' THEN '片区运营待审核'
WHEN hbga.grid_status = '8' THEN '工程待审核'
WHEN hbga.grid_status = '9' THEN '整改待审核'
ELSE '待整改' END AS gridStatus
FROM FROM
hygf_basic_grid_acceptance hbga hygf_basic_grid_record hbga
LEFT JOIN hygf_peasant_household hph ON hph.sequence_nbr = hbga.peasant_household_id LEFT JOIN hygf_peasant_household hph ON hph.sequence_nbr = hbga.peasant_household_id
LEFT JOIN hygf_on_grid_and_acceptance hogaa ON hogaa.work_order_power_station_id = hbga.work_order_power_station_id LEFT JOIN hygf_on_grid_and_acceptance hogaa ON hogaa.work_order_power_station_id = hbga.work_order_power_station_id
LEFT JOIN hygf_work_order ON hygf_work_order.sequence_nbr = hbga.work_order_id LEFT JOIN hygf_work_order ON hygf_work_order.sequence_nbr = hbga.work_order_id
...@@ -48,14 +57,20 @@ ...@@ -48,14 +57,20 @@
<if test="map.regionCompanyId!=null and map.regionCompanyId!=''"> <if test="map.regionCompanyId!=null and map.regionCompanyId!=''">
and hygf_work_order.region_company_id =#{map.regionCompanyId} and hygf_work_order.region_company_id =#{map.regionCompanyId}
</if> </if>
<if test="map.powerStationCode!=null and map.powerStationCode!=''">
and hph.peasant_household_no like concat('%',#{map.powerStationCode},'%')
</if>
<if test="map.formType != null and map.formType!=''"> <if test="map.formType != null and map.formType!=''">
AND hbga.grid_status IN ('2', '3', '4') AND hbga.grid_status IN ('2', '3', '4')
</if> </if>
<if test="map.projectAddress != null and map.projectAddress!=''"> <if test="map.projectAddress != null and map.projectAddress!=''">
AND hph.project_address_name LIKE concat(concat('%', #{map.projectAddress}), '%') AND hph.project_address_name LIKE concat(concat('%', #{map.projectAddress}), '%')
</if> </if>
<if test="map.powerStationCode != null and map.powerStationCode !=''"> <if test="map.type != null">
AND hph.peasant_household_no LIKE concat(concat('%', #{map.powerStationCode}), '%') AND ( (hbga.basic_grid_node IS NOT NULL AND hbga.basic_grid_node != 'jxsAdmin' )
OR hbga.power_station_area_status IS NOT NULL
OR hbga.power_station_design_status IS NOT NULL
OR hbga.power_station_engineering_status IS NOT NULL )
</if> </if>
<if test="map.ownersName != null and map.ownersName !=''"> <if test="map.ownersName != null and map.ownersName !=''">
AND hph.owners_name LIKE concat(concat('%', #{map.ownersName}), '%') AND hph.owners_name LIKE concat(concat('%', #{map.ownersName}), '%')
...@@ -64,13 +79,9 @@ ...@@ -64,13 +79,9 @@
AND hbga.grid_status = #{map.gridStatus} AND hbga.grid_status = #{map.gridStatus}
</if> </if>
<if test="map.gridConnectionTime != null"> <if test="map.gridConnectionTime != null">
AND DATE_FORMAT(hogaa.grid_connection_time, '%Y-%m-%d') = #{map.gridConnectionTime} AND DATE_FORMAT(hogaa.grid_time, '%Y-%m-%d') = #{map.gridConnectionTime}
</if> </if>
</where> </where>
ORDER BY ORDER BY hbga.sequence_nbr desc
FIELD(hbga.grid_status, '1', '2', '4', '3'),
hogaa.grid_connection_time desc, hbga.sequence_nbr desc
</select> </select>
</mapper> </mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.BasicGridAuditingMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.BasicGridRecordMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.ConstructionAcceptanceRecordsMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.ConstructionGirdRecordsMapper">
</mapper>
...@@ -67,13 +67,13 @@ ...@@ -67,13 +67,13 @@
hygf_work_order_power_station.power_station_engineering_status powerStationEngineeringStatus, hygf_work_order_power_station.power_station_engineering_status powerStationEngineeringStatus,
(select hygf_rectification_order.rectification_history from hygf_rectification_order (select hygf_rectification_order.rectification_history from hygf_rectification_order
where hygf_rectification_order.peasant_househole_id = hygf_work_order_power_station.peasant_household_id where hygf_rectification_order.peasant_househole_id = hygf_work_order_power_station.peasant_household_id
and hygf_rectification_order.rectification_status = '待整改' and hygf_rectification_order.rectification_source = hygf_work_order_power_station.work_order_power_station_node ) as auditIdea, and hygf_rectification_order.rectification_status = '待整改' and hygf_rectification_order.rectification_source = hygf_work_order_power_station.work_order_power_station_node and hygf_rectification_order.rectification_source in ('area','engineering','design') ) as auditIdea,
(select hygf_rectification_order.sequence_nbr from hygf_rectification_order (select hygf_rectification_order.sequence_nbr from hygf_rectification_order
where hygf_rectification_order.peasant_househole_id = hygf_work_order_power_station.peasant_household_id where hygf_rectification_order.peasant_househole_id = hygf_work_order_power_station.peasant_household_id
and hygf_rectification_order.rectification_status = '已作废' and hygf_rectification_order.rectification_source = hygf_work_order_power_station.work_order_power_station_node order by rec_date desc limit 1) as rollbackOrderId, and hygf_rectification_order.rectification_status = '已作废' and hygf_rectification_order.rectification_source = hygf_work_order_power_station.work_order_power_station_node and hygf_rectification_order.rectification_source in ('area','engineering','design')order by rec_date desc limit 1) as rollbackOrderId,
(select hygf_rectification_order.sequence_nbr from hygf_rectification_order (select hygf_rectification_order.sequence_nbr from hygf_rectification_order
where hygf_rectification_order.peasant_househole_id = hygf_work_order_power_station.peasant_household_id where hygf_rectification_order.peasant_househole_id = hygf_work_order_power_station.peasant_household_id
and hygf_rectification_order.rectification_status in ('待整改','待提交','整改中','整改待审核','待审核')) as rectificationNum and hygf_rectification_order.rectification_status in ('待整改','待提交','整改中','整改待审核','待审核') and hygf_rectification_order.rectification_source in ('area','engineering','design')) as rectificationNum
from hygf_work_order_power_station LEFT join hygf_work_order from hygf_work_order_power_station LEFT join hygf_work_order
on hygf_work_order.sequence_nbr=hygf_work_order_power_station.work_order_id on hygf_work_order.sequence_nbr=hygf_work_order_power_station.work_order_id
LEFT JOIN hygf_peasant_household on hygf_peasant_household.sequence_nbr=hygf_work_order_power_station.peasant_household_id LEFT JOIN hygf_peasant_household on hygf_peasant_household.sequence_nbr=hygf_work_order_power_station.peasant_household_id
......
...@@ -26,11 +26,6 @@ ...@@ -26,11 +26,6 @@
<!-- <version>${amos-biz-boot.version}</version>--> <!-- <version>${amos-biz-boot.version}</version>-->
<!-- </dependency>--> <!-- </dependency>-->
<dependency> <dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.typroject</groupId> <groupId>org.typroject</groupId>
<artifactId>tyboot-component-emq</artifactId> <artifactId>tyboot-component-emq</artifactId>
<version>1.1.20</version> <version>1.1.20</version>
......
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.AcceptanceCheckAuditingServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.AcceptanceCheckAuditingDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 并网审核表
*
* @author system_generator
* @date 2024-08-21
*/
@RestController
@Api(tags = "并网审核表Api")
@RequestMapping(value = "/acceptance-check-auditing")
public class AcceptanceCheckAuditingController extends BaseController {
@Autowired
AcceptanceCheckAuditingServiceImpl acceptanceCheckAuditingServiceImpl;
/**
* 新增并网审核表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增并网审核表", notes = "新增并网审核表")
public ResponseModel<AcceptanceCheckAuditingDto> save(@RequestBody AcceptanceCheckAuditingDto model) {
model = acceptanceCheckAuditingServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新并网审核表", notes = "根据sequenceNbr更新并网审核表")
public ResponseModel<AcceptanceCheckAuditingDto> updateBySequenceNbrAcceptanceCheckAuditing(@RequestBody AcceptanceCheckAuditingDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(acceptanceCheckAuditingServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除并网审核表", notes = "根据sequenceNbr删除并网审核表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(acceptanceCheckAuditingServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个并网审核表", notes = "根据sequenceNbr查询单个并网审核表")
public ResponseModel<AcceptanceCheckAuditingDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(acceptanceCheckAuditingServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "并网审核表分页查询", notes = "并网审核表分页查询")
public ResponseModel<Page<AcceptanceCheckAuditingDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<AcceptanceCheckAuditingDto> page = new Page<AcceptanceCheckAuditingDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(acceptanceCheckAuditingServiceImpl.queryForAcceptanceCheckAuditingPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "并网审核表列表全部数据查询", notes = "并网审核表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<AcceptanceCheckAuditingDto>> selectForList() {
return ResponseHelper.buildResponse(acceptanceCheckAuditingServiceImpl.queryForAcceptanceCheckAuditingList());
}
}
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits;
import com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridRecordDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.AcceptanceCheck;
import com.yeejoin.amos.boot.module.hygf.api.entity.HygfRectificationOrder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.AcceptanceCheckServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.AcceptanceCheckDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 并网验收节点
*
* @author system_generator
* @date 2024-08-21
*/
@RestController
@Api(tags = "并网验收节点Api")
@RequestMapping(value = "/acceptance-check")
public class AcceptanceCheckController extends BaseController {
@Autowired
AcceptanceCheckServiceImpl acceptanceCheckServiceImpl;
@Value("${admin.tourong.roleId}")
Long tourongId;
@Value("${admin.fawu.roleId}")
Long fawuId;
@Value("${admin.area.roleId}")
Long areaId;
@Value("${admin.zichan.roleId}")
Long zichanId;
@Value("${admin.delerKaId.roleId}")
Long kaifaId;
@Value("${admin.delerAdmin.roleId}")
Long delerAdminId;
/**
* 新增并网验收节点
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save/commit")
@ApiOperation(httpMethod = "POST", value = "新增并网验收节点", notes = "新增并网验收节点")
public ResponseModel<AcceptanceCheck> save(@RequestBody Map<String,Object> model) {
String realName = getSelectedOrgInfo().getUserModel().getRealName();
model.put("realName",realName);
return ResponseHelper.buildResponse(acceptanceCheckServiceImpl.saveAndCommit(model));
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新并网验收节点", notes = "根据sequenceNbr更新并网验收节点")
public ResponseModel<AcceptanceCheckDto> updateBySequenceNbrAcceptanceCheck(@RequestBody AcceptanceCheckDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(acceptanceCheckServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除并网验收节点", notes = "根据sequenceNbr删除并网验收节点")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(acceptanceCheckServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个并网验收节点", notes = "根据sequenceNbr查询单个并网验收节点")
public ResponseModel<AcceptanceCheckDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(acceptanceCheckServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "并网验收节点列表全部数据查询", notes = "并网验收节点列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<AcceptanceCheckDto>> selectForList() {
return ResponseHelper.buildResponse(acceptanceCheckServiceImpl.queryForAcceptanceCheckList());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "验收-经销商管理", notes = "验收经销商管理")
@PostMapping(value = "/completeAdminAudit")
@Transactional
public ResponseModel completeAdminAudit( @RequestBody Map<String,String> kv) {
acceptanceCheckServiceImpl.completeAdminAudit(kv);
return ResponseHelper.buildResponse(null);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "验收管理审核", notes = "验收管理审核")
@PostMapping(value = "/completeAudit")
@Transactional
public ResponseModel completeAudit( @RequestBody Map<String,String> kv) {
return acceptanceCheckServiceImpl.completeAudit(kv);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "整改单下发", notes = "整改单下发")
@PostMapping(value = "/addRectification")
@Transactional
public ResponseModel addRectification( @RequestBody HygfRectificationOrder hygfReplenishment) {
return acceptanceCheckServiceImpl.addRectification(hygfReplenishment);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "整改单添加信息", notes = "整改单添加信息")
@PostMapping(value = "/nextTaskExcute")
@Transactional
public ResponseModel nextTaskExcute( @RequestBody HygfRectificationOrder hygfReplenishment) {
return acceptanceCheckServiceImpl.nextTaskExcute(hygfReplenishment);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "整改单审核", notes = "整改单审核")
@PostMapping(value = "/nextTaskAduit")
@Transactional
public ResponseModel nextTaskAduit( @RequestBody HygfRectificationOrder hygfReplenishment) {
return acceptanceCheckServiceImpl.nextTaskAduit(hygfReplenishment);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "PUT",value = "整改单作废", notes = "整改单作废")
@PutMapping(value = "/rollback")
@Transactional
public ResponseModel rollback( @RequestParam(value = "sequenceNbr") Long sequenceNbr) {
return acceptanceCheckServiceImpl.rollback(sequenceNbr);
}
/**
* 经销商端列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
@UserLimits
public ResponseModel<Page<AcceptanceCheckDto>> queryForPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(required = false,value = "projectAddress") String projectAddress,
@RequestParam(required = false,value = "powerStationCode") String powerStationCode,
@RequestParam(required = false,value = "ownersName") String ownersName,
@RequestParam(required = false,value = "acceptanceCheckStatus") String acceptanceCheckStatus,
@RequestParam(required = false,value = "type") String type,
@RequestParam(required = false,value = "acceptanceTime") String acceptanceTime) throws Exception {
//当前登录人所属场站
// UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId());
ReginParams reginParams = getSelectedOrgInfo();
List<String> basicGridNodes = new ArrayList<>();
List<Long> roleIds = new ArrayList<>();
for (Long aLong : reginParams.getUserModel().getOrgRoleSeqs().keySet()) {
List<Long> longs = reginParams.getUserModel().getOrgRoleSeqs().get(aLong);
roleIds.addAll(longs);
if (longs.contains(areaId)) {
basicGridNodes.add("ys-area");
}
if (longs.contains(tourongId)) {
basicGridNodes.add("ys-tourong");
}
if (longs.contains(fawuId)) {
basicGridNodes.add("ys-fawu");
}
if (longs.contains(zichanId)) {
basicGridNodes.add("ys-zichan");
}
if (longs.contains(delerAdminId)) {
basicGridNodes.add("ys-tourong");
basicGridNodes.add("ys-area");
basicGridNodes.add("ys-fawu");
basicGridNodes.add("ys-zichan");
}
}
Page<AcceptanceCheckDto> page = acceptanceCheckServiceImpl.selectPage(null,null,current, size, projectAddress, powerStationCode, ownersName, acceptanceCheckStatus, acceptanceTime, "",basicGridNodes,type);
//根据角色及当前节点判断是否有操作权限
if (basicGridNodes != null){
for (AcceptanceCheckDto e : page.getRecords()) {
for (String g : basicGridNodes) {
if (null != e.getBasicGridNode() && e.getBasicGridNode().contains(g) && (roleIds.contains(areaId) ||roleIds.contains(fawuId) || roleIds.contains(zichanId)|| roleIds.contains(tourongId))){
e.setIsAudit("0");
break;
}if (null != e.getBasicGridNode()&&e.getBasicGridNode().equals("jxsAdmin") && roleIds.contains(delerAdminId)){
e.setIsAudit("0");
break;
}
else {
e.setIsAudit("1");
}
}
}
}
return ResponseHelper.buildResponse(page);
}
}
package com.yeejoin.amos.boot.module.hygf.biz.controller; package com.yeejoin.amos.boot.module.hygf.biz.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
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.BasicGridAcceptanceDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridRecordDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.UserUnitInformationDto; import com.yeejoin.amos.boot.module.hygf.api.dto.UserUnitInformationDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.AcceptanceCheckItem; import com.yeejoin.amos.boot.module.hygf.api.entity.AcceptanceCheckItem;
import com.yeejoin.amos.boot.module.hygf.api.entity.HygfOnGrid; import com.yeejoin.amos.boot.module.hygf.api.entity.HygfOnGrid;
import com.yeejoin.amos.boot.module.hygf.api.entity.HygfRectificationOrder;
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.HygfOnGridMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.HygfOnGridMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PersonnelBusinessMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.PersonnelBusinessMapper;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.BasicGridAcceptanceServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.BasicGridAcceptanceServiceImpl;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.WorkflowImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.WorkflowImpl;
import com.yeejoin.amos.component.robot.BadRequest;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Collections; import java.util.*;
import java.util.List;
/** /**
* *
...@@ -46,6 +54,15 @@ public class BasicGridAcceptanceController extends BaseController { ...@@ -46,6 +54,15 @@ public class BasicGridAcceptanceController extends BaseController {
@Autowired @Autowired
WorkflowImpl workflow; WorkflowImpl workflow;
@Value("${admin.engineering.roleId}")
Long engineeringId;
@Value("${admin.area.roleId}")
Long areaId;
@Value("${admin.design.roleId}")
Long designId;
@Value("${admin.delerAdmin.roleId}")
Long delerAdminId;
/** /**
* 新增保存 * 新增保存
* *
...@@ -67,8 +84,10 @@ public class BasicGridAcceptanceController extends BaseController { ...@@ -67,8 +84,10 @@ public class BasicGridAcceptanceController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save/commit") @PostMapping(value = "/save/commit")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增") @ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
@Transactional
public ResponseModel saveAndCommit(@RequestBody HygfOnGrid dto) { public ResponseModel saveAndCommit(@RequestBody HygfOnGrid dto) {
return ResponseHelper.buildResponse(basicGridAcceptanceServiceImpl.saveAndCommit(dto,getUserId()));
return ResponseHelper.buildResponse(basicGridAcceptanceServiceImpl.saveAndCommit(dto,getSelectedOrgInfo().getUserModel().getRealName()));
} }
/** /**
...@@ -123,16 +142,53 @@ public class BasicGridAcceptanceController extends BaseController { ...@@ -123,16 +142,53 @@ public class BasicGridAcceptanceController extends BaseController {
@GetMapping(value = "/page") @GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询") @ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
@UserLimits @UserLimits
public ResponseModel<Page<BasicGridAcceptanceDto>> queryForPage(@RequestParam(value = "current") int current, public ResponseModel<Page<BasicGridRecordDto>> queryForPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, @RequestParam(value = "size") int size,
@RequestParam(required = false,value = "projectAddress") String projectAddress, @RequestParam(required = false,value = "projectAddress") String projectAddress,
@RequestParam(required = false,value = "powerStationCode") String powerStationCode, @RequestParam(required = false,value = "powerStationCode") String powerStationCode,
@RequestParam(required = false,value = "ownersName") String ownersName, @RequestParam(required = false,value = "ownersName") String ownersName,
@RequestParam(required = false,value = "gridStatus") String gridStatus, @RequestParam(required = false,value = "gridStatus") String gridStatus,
@RequestParam(required = false,value = "type") String type,
@RequestParam(required = false,value = "gridConnectionTime") String gridConnectionTime) throws Exception { @RequestParam(required = false,value = "gridConnectionTime") String gridConnectionTime) throws Exception {
//当前登录人所属场站 //当前登录人所属场站
// UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId()); // UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId());
Page<BasicGridAcceptanceDto> page = basicGridAcceptanceServiceImpl.selectPage(null,null,current, size, projectAddress, powerStationCode, ownersName, gridStatus, gridConnectionTime, "");
ReginParams reginParams = getSelectedOrgInfo();
List<String> basicGridNodes = new ArrayList<>();
List<Long> roleIds = new ArrayList<>();
for (Long aLong : reginParams.getUserModel().getOrgRoleSeqs().keySet()) {
List<Long> longs = reginParams.getUserModel().getOrgRoleSeqs().get(aLong);
roleIds.addAll(longs);
if (longs.contains(areaId)) {
basicGridNodes.add("bw-area");
}
if (longs.contains(engineeringId)) {
basicGridNodes.add("bw-engineering");
}
if (longs.contains(designId)) {
basicGridNodes.add("bw-design");
}
if (longs.contains(delerAdminId)) {
basicGridNodes.add("bw-design");
basicGridNodes.add("bw-engineering");
basicGridNodes.add("bw-area");
}
}
Page<BasicGridRecordDto> page = basicGridAcceptanceServiceImpl.selectPage(null,null,current, size, projectAddress, powerStationCode, ownersName, gridStatus, gridConnectionTime, "",basicGridNodes,type);
//根据角色及当前节点判断是否有操作权限
if (basicGridNodes != null){
for (BasicGridRecordDto e : page.getRecords()) {
for (String g : basicGridNodes) {
if (null != e.getBasicGridNode() && e.getBasicGridNode().contains(g) && (roleIds.contains(areaId) ||roleIds.contains(designId) || roleIds.contains(engineeringId))){
e.setIsAudit("0");
break;
}
else {
e.setIsAudit("1");
}
}
}
}
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
...@@ -147,7 +203,7 @@ public class BasicGridAcceptanceController extends BaseController { ...@@ -147,7 +203,7 @@ public class BasicGridAcceptanceController extends BaseController {
@GetMapping(value = "/check/page") @GetMapping(value = "/check/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询") @ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
@UserLimits @UserLimits
public ResponseModel<Page<BasicGridAcceptanceDto>> queryForCheckPage(@RequestParam(value = "current") int current, public ResponseModel<Page<BasicGridRecordDto>> queryForCheckPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, @RequestParam(value = "size") int size,
@RequestParam(required = false,value = "projectAddress") String projectAddress, @RequestParam(required = false,value = "projectAddress") String projectAddress,
@RequestParam(required = false,value = "powerStationCode") String powerStationCode, @RequestParam(required = false,value = "powerStationCode") String powerStationCode,
...@@ -156,7 +212,7 @@ public class BasicGridAcceptanceController extends BaseController { ...@@ -156,7 +212,7 @@ public class BasicGridAcceptanceController extends BaseController {
@RequestParam(required = false,value = "gridConnectionTime") String gridConnectionTime) throws Exception { @RequestParam(required = false,value = "gridConnectionTime") String gridConnectionTime) throws Exception {
//当前登录人所属场站 //当前登录人所属场站
Page<BasicGridAcceptanceDto> page = basicGridAcceptanceServiceImpl.selectPage(null,null,current, size, projectAddress, powerStationCode, ownersName, gridStatus, gridConnectionTime, "check"); Page<BasicGridRecordDto> page = basicGridAcceptanceServiceImpl.selectPage(null,null,current, size, projectAddress, powerStationCode, ownersName, gridStatus, gridConnectionTime, "check",null,null);
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
...@@ -190,6 +246,82 @@ public class BasicGridAcceptanceController extends BaseController { ...@@ -190,6 +246,82 @@ public class BasicGridAcceptanceController extends BaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "完工自审-经销商管理", notes = "完工自审经销商管理")
@PostMapping(value = "/completeAdminAudit")
@Transactional
public ResponseModel completeAdminAudit( @RequestBody Map<String,String> kv) {
basicGridAcceptanceServiceImpl.completeAdminAudit(kv);
return ResponseHelper.buildResponse(null);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "完工自审管理审核", notes = "完工自审管理审核")
@PostMapping(value = "/completeAudit")
@Transactional
public ResponseModel completeAudit( @RequestBody Map<String,String> kv) {
return basicGridAcceptanceServiceImpl.completeAudit(kv);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "整改单下发", notes = "整改单下发")
@PostMapping(value = "/addRectification")
@Transactional
public ResponseModel addRectification( @RequestBody HygfRectificationOrder hygfReplenishment) {
return basicGridAcceptanceServiceImpl.addRectification(hygfReplenishment);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "整改单添加信息", notes = "整改单添加信息")
@PostMapping(value = "/nextTaskExcute")
@Transactional
public ResponseModel nextTaskExcute( @RequestBody HygfRectificationOrder hygfReplenishment) {
return basicGridAcceptanceServiceImpl.nextTaskExcute(hygfReplenishment);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "整改单审核", notes = "整改单审核")
@PostMapping(value = "/nextTaskAduit")
@Transactional
public ResponseModel nextTaskAduit( @RequestBody HygfRectificationOrder hygfReplenishment) {
return basicGridAcceptanceServiceImpl.nextTaskAduit(hygfReplenishment);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "PUT",value = "整改单作废", notes = "整改单作废")
@PutMapping(value = "/rollback")
@Transactional
public ResponseModel rollback( @RequestParam(value = "sequenceNbr") Long sequenceNbr) {
return basicGridAcceptanceServiceImpl.rollback(sequenceNbr);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/test1")
@ApiOperation(httpMethod = "POST", value = "执行工作流", notes = "执行工作流")
public ResponseModel test() {
basicGridAcceptanceServiceImpl.testKAIQI();
return ResponseHelper.buildResponse(null);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/test2")
@ApiOperation(httpMethod = "POST", value = "执行工作流", notes = "执行工作流")
public ResponseModel test(String approvalStatus,String comment) {
basicGridAcceptanceServiceImpl.zhixing(approvalStatus,comment);
return ResponseHelper.buildResponse(null);
}
} }
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.BasicGridAuditingServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridAuditingDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 并网审核表
*
* @author system_generator
* @date 2024-08-21
*/
@RestController
@Api(tags = "并网审核表Api")
@RequestMapping(value = "/basic-grid-auditing")
public class BasicGridAuditingController extends BaseController {
@Autowired
BasicGridAuditingServiceImpl basicGridAuditingServiceImpl;
/**
* 新增并网审核表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增并网审核表", notes = "新增并网审核表")
public ResponseModel<BasicGridAuditingDto> save(@RequestBody BasicGridAuditingDto model) {
model = basicGridAuditingServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新并网审核表", notes = "根据sequenceNbr更新并网审核表")
public ResponseModel<BasicGridAuditingDto> updateBySequenceNbrBasicGridAuditing(@RequestBody BasicGridAuditingDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(basicGridAuditingServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除并网审核表", notes = "根据sequenceNbr删除并网审核表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(basicGridAuditingServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个并网审核表", notes = "根据sequenceNbr查询单个并网审核表")
public ResponseModel<BasicGridAuditingDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(basicGridAuditingServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "并网审核表分页查询", notes = "并网审核表分页查询")
public ResponseModel<Page<BasicGridAuditingDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<BasicGridAuditingDto> page = new Page<BasicGridAuditingDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(basicGridAuditingServiceImpl.queryForBasicGridAuditingPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "并网审核表列表全部数据查询", notes = "并网审核表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<BasicGridAuditingDto>> selectForList() {
return ResponseHelper.buildResponse(basicGridAuditingServiceImpl.queryForBasicGridAuditingList());
}
}
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.BasicGridRecordServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridRecordDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 并网验收节点
*
* @author system_generator
* @date 2024-08-21
*/
@RestController
@Api(tags = "并网验收节点Api")
@RequestMapping(value = "/basic-grid-record")
public class BasicGridRecordController extends BaseController {
@Autowired
BasicGridRecordServiceImpl basicGridRecordServiceImpl;
/**
* 新增并网验收节点
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增并网验收节点", notes = "新增并网验收节点")
public ResponseModel<BasicGridRecordDto> save(@RequestBody BasicGridRecordDto model) {
model = basicGridRecordServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新并网验收节点", notes = "根据sequenceNbr更新并网验收节点")
public ResponseModel<BasicGridRecordDto> updateBySequenceNbrBasicGridRecord(@RequestBody BasicGridRecordDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(basicGridRecordServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除并网验收节点", notes = "根据sequenceNbr删除并网验收节点")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(basicGridRecordServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个并网验收节点", notes = "根据sequenceNbr查询单个并网验收节点")
public ResponseModel<BasicGridRecordDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(basicGridRecordServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "并网验收节点分页查询", notes = "并网验收节点分页查询")
public ResponseModel<Page<BasicGridRecordDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<BasicGridRecordDto> page = new Page<BasicGridRecordDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(basicGridRecordServiceImpl.queryForBasicGridRecordPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "并网验收节点列表全部数据查询", notes = "并网验收节点列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<BasicGridRecordDto>> selectForList() {
return ResponseHelper.buildResponse(basicGridRecordServiceImpl.queryForBasicGridRecordList());
}
}
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.ConstructionAcceptanceRecordsServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.ConstructionAcceptanceRecordsDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 并网操作日志
*
* @author system_generator
* @date 2024-09-02
*/
@RestController
@Api(tags = "并网操作日志Api")
@RequestMapping(value = "/construction-acceptance-records")
public class ConstructionAcceptanceRecordsController extends BaseController {
@Autowired
ConstructionAcceptanceRecordsServiceImpl constructionAcceptanceRecordsServiceImpl;
/**
* 新增并网操作日志
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增并网操作日志", notes = "新增并网操作日志")
public ResponseModel<ConstructionAcceptanceRecordsDto> save(@RequestBody ConstructionAcceptanceRecordsDto model) {
model = constructionAcceptanceRecordsServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新并网操作日志", notes = "根据sequenceNbr更新并网操作日志")
public ResponseModel<ConstructionAcceptanceRecordsDto> updateBySequenceNbrConstructionAcceptanceRecords(@RequestBody ConstructionAcceptanceRecordsDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(constructionAcceptanceRecordsServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除并网操作日志", notes = "根据sequenceNbr删除并网操作日志")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(constructionAcceptanceRecordsServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个并网操作日志", notes = "根据sequenceNbr查询单个并网操作日志")
public ResponseModel<ConstructionAcceptanceRecordsDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(constructionAcceptanceRecordsServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "并网操作日志分页查询", notes = "并网操作日志分页查询")
public ResponseModel<Page<ConstructionAcceptanceRecordsDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<ConstructionAcceptanceRecordsDto> page = new Page<ConstructionAcceptanceRecordsDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(constructionAcceptanceRecordsServiceImpl.queryForConstructionAcceptanceRecordsPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "并网操作日志列表全部数据查询", notes = "并网操作日志列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<ConstructionAcceptanceRecordsDto>> selectForList() {
return ResponseHelper.buildResponse(constructionAcceptanceRecordsServiceImpl.queryForConstructionAcceptanceRecordsList());
}
}
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.ConstructionGirdRecordsServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.ConstructionGirdRecordsDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 并网操作日志
*
* @author system_generator
* @date 2024-09-02
*/
@RestController
@Api(tags = "并网操作日志Api")
@RequestMapping(value = "/construction-gird-records")
public class ConstructionGirdRecordsController extends BaseController {
@Autowired
ConstructionGirdRecordsServiceImpl constructionGirdRecordsServiceImpl;
/**
* 新增并网操作日志
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增并网操作日志", notes = "新增并网操作日志")
public ResponseModel<ConstructionGirdRecordsDto> save(@RequestBody ConstructionGirdRecordsDto model) {
model = constructionGirdRecordsServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新并网操作日志", notes = "根据sequenceNbr更新并网操作日志")
public ResponseModel<ConstructionGirdRecordsDto> updateBySequenceNbrConstructionGirdRecords(@RequestBody ConstructionGirdRecordsDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(constructionGirdRecordsServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除并网操作日志", notes = "根据sequenceNbr删除并网操作日志")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(constructionGirdRecordsServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个并网操作日志", notes = "根据sequenceNbr查询单个并网操作日志")
public ResponseModel<ConstructionGirdRecordsDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(constructionGirdRecordsServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "并网操作日志分页查询", notes = "并网操作日志分页查询")
public ResponseModel<Page<ConstructionGirdRecordsDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<ConstructionGirdRecordsDto> page = new Page<ConstructionGirdRecordsDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(constructionGirdRecordsServiceImpl.queryForConstructionGirdRecordsPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "并网操作日志列表全部数据查询", notes = "并网操作日志列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<ConstructionGirdRecordsDto>> selectForList() {
return ResponseHelper.buildResponse(constructionGirdRecordsServiceImpl.queryForConstructionGirdRecordsList());
}
}
...@@ -20,6 +20,7 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel; ...@@ -20,6 +20,7 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -283,21 +284,25 @@ public class HouseholdContractController extends BaseController { ...@@ -283,21 +284,25 @@ public class HouseholdContractController extends BaseController {
wrapper.eq(ToDoTasks::getType, TaskTypeStationEnum.合同填报.getCode()); wrapper.eq(ToDoTasks::getType, TaskTypeStationEnum.合同填报.getCode());
wrapper.eq(ToDoTasks::getState, "待办"); wrapper.eq(ToDoTasks::getState, "待办");
wrapper.eq(ToDoTasks::getBusinessId, householdContrac.getSequenceNbr()); wrapper.eq(ToDoTasks::getBusinessId, householdContrac.getSequenceNbr());
ToDoTasks doTasks= toDoTasksMapper.selectOne(wrapper); List<ToDoTasks> doTasks= toDoTasksMapper.selectList(wrapper);
if(doTasks!=null){ if(doTasks!=null){
doTasks.setState("作废"); doTasks.forEach(e->{
doTasks.setIsDelete(true); try {
toDoTasksMapper.updateById(doTasks); e.setState("作废");
emqKeeper.getMqttClient().publish("TASK_MESSAGE" ,JSON.toJSONString(doTasks).getBytes(), 2 ,false); e.setIsDelete(true);
toDoTasksMapper.updateById(e);
UserMessage userMessage= new UserMessage( doTasks.getType(), doTasks.getBusinessId(), doTasks.getAmosUserId(), new Date(), doTasks.getTaskName()+"已作废", doTasks.getAmosOrgCode()); emqKeeper.getMqttClient().publish("TASK_MESSAGE" ,JSON.toJSONString(e).getBytes(), 2 ,false);
userMessageMapper.insert(userMessage); UserMessage userMessage= new UserMessage( e.getType(), e.getBusinessId(), e.getAmosUserId(), new Date(), e.getTaskName()+"已作废", e.getAmosOrgCode());
emqKeeper.getMqttClient().publish("MY_MESSAGE" , JSON.toJSONString(userMessage).getBytes(), 2 ,false); userMessageMapper.insert(userMessage);
emqKeeper.getMqttClient().publish("MY_MESSAGE" , JSON.toJSONString(userMessage).getBytes(), 2 ,false);
} catch (MqttException mqttException) {
mqttException.printStackTrace();
}
});
} }
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
throw new BadRequest("系统异常"); throw new BadRequest(e.getMessage());
} }
return householdContractServiceImpl.updateById(householdContrac); return householdContractServiceImpl.updateById(householdContrac);
......
package com.yeejoin.amos.boot.module.hygf.biz.controller; package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.hygf.api.Enum.RectificationOrderEnum; import com.yeejoin.amos.boot.module.hygf.api.Enum.RectificationOrderEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.RectificationRoleEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.WorkOrderEnum;
import com.yeejoin.amos.boot.module.hygf.api.entity.HygfRectificationOrder; import com.yeejoin.amos.boot.module.hygf.api.entity.HygfRectificationOrder;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -46,6 +50,16 @@ public class HygfRectificationOrderController extends BaseController { ...@@ -46,6 +50,16 @@ public class HygfRectificationOrderController extends BaseController {
Long designId; Long designId;
@Value("${admin.deveEngineering.roleId}") @Value("${admin.deveEngineering.roleId}")
Long deveEngineeringId; Long deveEngineeringId;
@Value("${admin.delerAdmin.roleId}")
Long delerAdminId;
@Value("${admin.delerKaId.roleId}")
Long delerKfId;
@Value("${admin.tourong.roleId}")
Long tourongId;
@Value("${admin.fawu.roleId}")
Long fawuId;
@Value("${admin.zichan.roleId}")
Long zichanId;
/** /**
* 新增审核单 * 新增审核单
* *
...@@ -55,8 +69,8 @@ public class HygfRectificationOrderController extends BaseController { ...@@ -55,8 +69,8 @@ public class HygfRectificationOrderController extends BaseController {
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增审核单", notes = "新增审核单") @ApiOperation(httpMethod = "POST", value = "新增审核单", notes = "新增审核单")
public ResponseModel<HygfRectificationOrderDto> save(@RequestBody HygfRectificationOrderDto model) { public ResponseModel<HygfRectificationOrderDto> save(@RequestBody HygfRectificationOrderDto model) {
model = hygfRectificationOrderServiceImpl.createWithModel(model); model = hygfRectificationOrderServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
} }
/** /**
...@@ -69,8 +83,8 @@ public class HygfRectificationOrderController extends BaseController { ...@@ -69,8 +83,8 @@ public class HygfRectificationOrderController extends BaseController {
@PutMapping(value = "/{sequenceNbr}") @PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新审核单", notes = "根据sequenceNbr更新审核单") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新审核单", notes = "根据sequenceNbr更新审核单")
public ResponseModel<HygfRectificationOrderDto> updateBySequenceNbrHygfRectificationOrder(@RequestBody HygfRectificationOrderDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<HygfRectificationOrderDto> updateBySequenceNbrHygfRectificationOrder(@RequestBody HygfRectificationOrderDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr); model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(hygfRectificationOrderServiceImpl.updateWithModel(model)); return ResponseHelper.buildResponse(hygfRectificationOrderServiceImpl.updateWithModel(model));
} }
/** /**
...@@ -96,8 +110,10 @@ public class HygfRectificationOrderController extends BaseController { ...@@ -96,8 +110,10 @@ public class HygfRectificationOrderController extends BaseController {
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个审核单", notes = "根据sequenceNbr查询单个审核单") @ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个审核单", notes = "根据sequenceNbr查询单个审核单")
public ResponseModel<HygfRectificationOrder> selectOne(@PathVariable Long sequenceNbr) { public ResponseModel<HygfRectificationOrder> selectOne(@PathVariable Long sequenceNbr) {
HygfRectificationOrder hygfRectificationOrder = hygfRectificationOrderServiceImpl.getBaseMapper().selectById(sequenceNbr);
return ResponseHelper.buildResponse(hygfRectificationOrderServiceImpl.getBaseMapper().selectById(sequenceNbr)); RectificationRoleEnum enums = RectificationRoleEnum.getNodeByName(hygfRectificationOrder.getRectificationSource());
hygfRectificationOrder.setRectificationSourceName(enums!=null?enums.name():null);
return ResponseHelper.buildResponse(hygfRectificationOrder);
} }
/** /**
...@@ -115,6 +131,7 @@ public class HygfRectificationOrderController extends BaseController { ...@@ -115,6 +131,7 @@ public class HygfRectificationOrderController extends BaseController {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
List<String> workOrderPowerStationNodes = new ArrayList<>(); List<String> workOrderPowerStationNodes = new ArrayList<>();
List<String> status = new ArrayList<>();
// workOrderPowerStationNodes.add(rectificationSource); // workOrderPowerStationNodes.add(rectificationSource);
for (Long aLong : reginParams.getUserModel().getOrgRoleSeqs().keySet()) { for (Long aLong : reginParams.getUserModel().getOrgRoleSeqs().keySet()) {
List<Long> longs = reginParams.getUserModel().getOrgRoleSeqs().get(aLong); List<Long> longs = reginParams.getUserModel().getOrgRoleSeqs().get(aLong);
...@@ -127,27 +144,219 @@ public class HygfRectificationOrderController extends BaseController { ...@@ -127,27 +144,219 @@ public class HygfRectificationOrderController extends BaseController {
if (longs.contains(designId) ) { if (longs.contains(designId) ) {
workOrderPowerStationNodes.add("design"); workOrderPowerStationNodes.add("design");
} }
if (longs.contains(delerAdminId) ) {
workOrderPowerStationNodes.add("design");
workOrderPowerStationNodes.add("engineering");
workOrderPowerStationNodes.add("area");
}
}
Page<HygfRectificationOrder> page = hygfRectificationOrderServiceImpl.queryForHygfRectificationOrderPage(current, size, workOrderPowerStationNodes, peasantHouseholeId,status);
for (Long aLong : reginParams.getUserModel().getOrgRoleSeqs().keySet()) {
List<Long> longs = reginParams.getUserModel().getOrgRoleSeqs().get(aLong);
page.getRecords().forEach(e->{
if(e.getRectificationIdea() != null && e.getRectificationIdea().size() > 0) {
List<String> types = new ArrayList<>();
e.getRectificationIdea().forEach(t -> {
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(t));
if(jsonObject.getString("type") != null) {
types.add(jsonObject.getString("type"));
}
});
e.setRectificationType(String.join(",", types));
}
if (longs.contains(areaId) && e.getRectificationSource().equals("area")){
e.setIsAudit("0");
}else if (longs.contains(engineeringId) && e.getRectificationSource().equals("engineering")){
e.setIsAudit("0");
}else if (longs.contains(designId) && e.getRectificationSource().equals("design")){
e.setIsAudit("0");
}else if (longs.contains(deveEngineeringId)&& (e.getRectificationStatus().equals("待审核") || e.getRectificationStatus().equals("整改中"))){
e.setIsAudit("0");
}else {
e.setIsAudit("1");
}
});
} }
Page<HygfRectificationOrder> page = hygfRectificationOrderServiceImpl.queryForHygfRectificationOrderPage(current, size, workOrderPowerStationNodes, peasantHouseholeId); return ResponseHelper.buildResponse(page);
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/bwpage")
@ApiOperation(httpMethod = "GET",value = "审核单分页查询 并网", notes = "审核单分页查询 并网")
public ResponseModel<Page<HygfRectificationOrder>> queryForPageBybw(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, @RequestParam(value = "rectificationSource",required = false) String rectificationSource, @RequestParam(value = "peasantHouseholeId") String peasantHouseholeId) {
ReginParams reginParams = getSelectedOrgInfo();
List<String> workOrderPowerStationNodes = new ArrayList<>();
List<String> status = new ArrayList<>();
// workOrderPowerStationNodes.add(rectificationSource);
for (Long aLong : reginParams.getUserModel().getOrgRoleSeqs().keySet()) { for (Long aLong : reginParams.getUserModel().getOrgRoleSeqs().keySet()) {
List<Long> longs = reginParams.getUserModel().getOrgRoleSeqs().get(aLong); List<Long> longs = reginParams.getUserModel().getOrgRoleSeqs().get(aLong);
page.getRecords().forEach(e->{ if (longs.contains(areaId) ) {
if (longs.contains(areaId) && e.getRectificationSource().equals("area")){ workOrderPowerStationNodes.add("bw-area");
e.setIsAudit("0"); }
}else if (longs.contains(engineeringId) && e.getRectificationSource().equals("engineering")){ if (longs.contains(engineeringId) ) {
e.setIsAudit("0"); workOrderPowerStationNodes.add("bw-engineering");
}else if (longs.contains(designId) && e.getRectificationSource().equals("design")){ }
e.setIsAudit("0"); if (longs.contains(designId) ) {
}else if (longs.contains(engineeringId)){ workOrderPowerStationNodes.add("bw-design");
e.setIsAudit("0"); }
}else { if (longs.contains(delerAdminId) ) {
e.setIsAudit("1"); workOrderPowerStationNodes.add("bw-design");
} workOrderPowerStationNodes.add("bw-engineering");
}); workOrderPowerStationNodes.add("bw-area");
status.add(WorkOrderEnum.待整改.name());
status.add(WorkOrderEnum.整改中.name());
status.add(WorkOrderEnum.待审核.name());
status.add(WorkOrderEnum.已完成.name());
}if (longs.contains(delerKfId) ) {
workOrderPowerStationNodes.add("bw-design");
workOrderPowerStationNodes.add("bw-engineering");
workOrderPowerStationNodes.add("bw-area");
status.add(WorkOrderEnum.待整改.name());
status.add(WorkOrderEnum.整改中.name());
status.add(WorkOrderEnum.待审核.name());
status.add(WorkOrderEnum.已完成.name());
}
}
Page<HygfRectificationOrder> page = hygfRectificationOrderServiceImpl.queryForHygfRectificationOrderPage(current, size, workOrderPowerStationNodes, peasantHouseholeId,status);
for (Long aLong : reginParams.getUserModel().getOrgRoleSeqs().keySet()) {
List<Long> longs = reginParams.getUserModel().getOrgRoleSeqs().get(aLong);
page.getRecords().forEach(e->{
if(e.getRectificationIdea() != null && e.getRectificationIdea().size() > 0) {
List<String> types = new ArrayList<>();
e.getRectificationIdea().forEach(t -> {
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(t));
if(jsonObject.getString("type") != null) {
types.add(jsonObject.getString("type"));
}
});
e.setRectificationType(String.join(",", types));
}
if (longs.contains(areaId) && e.getRectificationSource().equals("bw-area") &&rectificationSource.contains(e.getRectificationSource())){
e.setIsAudit("0");
}else if (longs.contains(engineeringId) && e.getRectificationSource().equals("bw-engineering")&& rectificationSource.contains(e.getRectificationSource())){
e.setIsAudit("0");
}else if (longs.contains(designId) && e.getRectificationSource().equals("bw-design")&& rectificationSource.contains(e.getRectificationSource())){
e.setIsAudit("0");
}else if (longs.contains(delerKfId)&& (e.getRectificationStatus().equals("待整改") || e.getRectificationStatus().equals("整改中"))){
e.setIsAudit("0");
}else {
e.setIsAudit("1");
}
});
}
return ResponseHelper.buildResponse(page);
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/yspage")
@ApiOperation(httpMethod = "GET",value = "审核单分页查询 验收", notes = "审核单分页查询 验收")
public ResponseModel<Page<HygfRectificationOrder>> queryForPageByYs(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, @RequestParam(value = "rectificationSource",required = false) String rectificationSource, @RequestParam(value = "peasantHouseholeId") String peasantHouseholeId) {
ReginParams reginParams = getSelectedOrgInfo();
List<String> workOrderPowerStationNodes = new ArrayList<>();
List<String> status = new ArrayList<>();
// workOrderPowerStationNodes.add(rectificationSource);
for (Long aLong : reginParams.getUserModel().getOrgRoleSeqs().keySet()) {
List<Long> longs = reginParams.getUserModel().getOrgRoleSeqs().get(aLong);
if (longs.contains(areaId) ) {
workOrderPowerStationNodes.add("ys-area");
}
if (longs.contains(tourongId) ) {
workOrderPowerStationNodes.add("ys-tourong");
}
if (longs.contains(fawuId) ) {
workOrderPowerStationNodes.add("ys-fawu");
}
if (longs.contains(zichanId) ) {
workOrderPowerStationNodes.add("ys-zichan");
}
if (longs.contains(delerAdminId) ) {
workOrderPowerStationNodes.add("ys-zichan");
workOrderPowerStationNodes.add("ys-tourong");
workOrderPowerStationNodes.add("ys-fawu");
workOrderPowerStationNodes.add("ys-area");
status.add(WorkOrderEnum.待整改.name());
status.add(WorkOrderEnum.整改中.name());
status.add(WorkOrderEnum.待审核.name());
status.add(WorkOrderEnum.已完成.name());
}if (longs.contains(deveEngineeringId) ) {
workOrderPowerStationNodes.add("ys-zichan");
workOrderPowerStationNodes.add("ys-tourong");
workOrderPowerStationNodes.add("ys-fawu");
workOrderPowerStationNodes.add("ys-area");
status.add(WorkOrderEnum.待整改.name());
status.add(WorkOrderEnum.整改中.name());
status.add(WorkOrderEnum.待审核.name());
status.add(WorkOrderEnum.已完成.name());
}
// if (longs.contains(delergcId) ) {
// workOrderPowerStationNodes.add("ys-design");
// workOrderPowerStationNodes.add("ys-engineering");
// workOrderPowerStationNodes.add("ys-area");
// }
}
Page<HygfRectificationOrder> page = hygfRectificationOrderServiceImpl.queryForHygfRectificationOrderPage(current, size, workOrderPowerStationNodes, peasantHouseholeId,status);
for (Long aLong : reginParams.getUserModel().getOrgRoleSeqs().keySet()) {
List<Long> longs = reginParams.getUserModel().getOrgRoleSeqs().get(aLong);
page.getRecords().forEach(e->{
if(e.getRectificationIdea() != null && e.getRectificationIdea().size() > 0) {
List<String> types = new ArrayList<>();
e.getRectificationIdea().forEach(t -> {
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(t));
if(jsonObject.getString("type") != null) {
types.add(jsonObject.getString("type"));
}
});
e.setRectificationType(String.join(",", types));
}
if (longs.contains(areaId) && e.getRectificationSource().equals("ys-area") && rectificationSource.contains(e.getRectificationSource()) ){
e.setIsAudit("0");
}else if (longs.contains(tourongId) && e.getRectificationSource().equals("ys-tourong")&& rectificationSource.contains(e.getRectificationSource())){
e.setIsAudit("0");
}else if (longs.contains(fawuId) && e.getRectificationSource().equals("ys-fawu")&& rectificationSource.contains(e.getRectificationSource())){
e.setIsAudit("0");
}else if (longs.contains(zichanId) && e.getRectificationSource().equals("ys-zichan")&& rectificationSource.contains(e.getRectificationSource())){
e.setIsAudit("0");
}else if (longs.contains(deveEngineeringId) && (e.getRectificationStatus().equals("待审核") || e.getRectificationStatus().equals("整改中"))){
e.setIsAudit("0");
}else {
e.setIsAudit("1");
}
});
} }
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
/** /**
......
...@@ -57,6 +57,8 @@ public class WorkOrderController extends BaseController { ...@@ -57,6 +57,8 @@ public class WorkOrderController extends BaseController {
Long areaId; Long areaId;
@Value("${admin.design.roleId}") @Value("${admin.design.roleId}")
Long designId; Long designId;
@Value("${admin.delerAdmin.roleId}")
Long delerAdminId;
/** /**
* 新增施工派工工单 * 新增施工派工工单
* *
...@@ -187,15 +189,18 @@ public class WorkOrderController extends BaseController { ...@@ -187,15 +189,18 @@ public class WorkOrderController extends BaseController {
public ResponseModel<Page<WorkOrderPage>> queryForwgpage(@RequestBody WorkOrderPage workOrder public ResponseModel<Page<WorkOrderPage>> queryForwgpage(@RequestBody WorkOrderPage workOrder
) { ) {
//当前登录人所属场站 //当前登录人所属场站
// UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId()); // UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId());
// //
// workOrder.setRegionCompanyId(userUnitInformationDto.getRegionalCompaniesSeq()); // workOrder.setRegionCompanyId(userUnitInformationDto.getRegionalCompaniesSeq());
// workOrder.setAmosDealerId(userUnitInformationDto.getAmosDealerId()); // workOrder.setAmosDealerId(userUnitInformationDto.getAmosDealerId());
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
List<String> workOrderPowerStationNodes = new ArrayList<>(); List<String> workOrderPowerStationNodes = new ArrayList<>();
List<Long> roleIds = new ArrayList<>();
for (Long aLong : reginParams.getUserModel().getOrgRoleSeqs().keySet()) { for (Long aLong : reginParams.getUserModel().getOrgRoleSeqs().keySet()) {
List<Long> longs = reginParams.getUserModel().getOrgRoleSeqs().get(aLong); List<Long> longs = reginParams.getUserModel().getOrgRoleSeqs().get(aLong);
if (longs.contains(areaId)) { if (longs.contains(areaId)) {
workOrderPowerStationNodes.add("area"); workOrderPowerStationNodes.add("area");
} }
...@@ -205,6 +210,12 @@ public class WorkOrderController extends BaseController { ...@@ -205,6 +210,12 @@ public class WorkOrderController extends BaseController {
if (longs.contains(designId)) { if (longs.contains(designId)) {
workOrderPowerStationNodes.add("design"); workOrderPowerStationNodes.add("design");
} }
if (longs.contains(delerAdminId)) {
workOrderPowerStationNodes.add("design");
workOrderPowerStationNodes.add("engineering");
workOrderPowerStationNodes.add("area");
}
roleIds.addAll(longs);
} }
if (workOrder.getType().equals("3") && workOrderPowerStationNodes != null){ if (workOrder.getType().equals("3") && workOrderPowerStationNodes != null){
workOrder.setWorkOrderPowerStationNodes(workOrderPowerStationNodes); workOrder.setWorkOrderPowerStationNodes(workOrderPowerStationNodes);
...@@ -212,23 +223,22 @@ public class WorkOrderController extends BaseController { ...@@ -212,23 +223,22 @@ public class WorkOrderController extends BaseController {
Page<WorkOrderPage> workOrderPagePage = workOrderServiceImpl.queryForwgpage(workOrder.getCurrent(), workOrder.getSize(), workOrder); Page<WorkOrderPage> workOrderPagePage = workOrderServiceImpl.queryForwgpage(workOrder.getCurrent(), workOrder.getSize(), workOrder);
if (workOrder.getType().equals("3") && workOrderPowerStationNodes != null){ if (workOrder.getType().equals("3") && workOrderPowerStationNodes != null){
workOrderPagePage.getRecords().forEach(e->{ workOrderPagePage.getRecords().forEach(e->{
if (workOrderPowerStationNodes.contains(e.getWorkOrderPowerStationNode()) && (roleIds.contains(areaId) ||roleIds.contains(designId) || roleIds.contains(engineeringId)) ){
e.setIsAudit("0");
}
else {
e.setIsAudit("1");
}
if(e.getPeasantHouseholdNo() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPeasantHouseholdNo()));
}
if (workOrderPowerStationNodes.contains(e.getWorkOrderPowerStationNode())){
e.setIsAudit("0");
}else {
e.setIsAudit("1");
}
}); });
} }
workOrderPagePage.getRecords().forEach(e->{
if(e.getPeasantHouseholdNo() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPeasantHouseholdNo()));
}
});
return ResponseHelper.buildResponse(workOrderPagePage); return ResponseHelper.buildResponse(workOrderPagePage);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping (value = "/wgpageList") @PostMapping (value = "/wgpageList")
@ApiOperation(httpMethod = "GET",value = "无分页查询", notes = "无分页查询") @ApiOperation(httpMethod = "GET",value = "无分页查询", notes = "无分页查询")
...@@ -241,6 +251,16 @@ public class WorkOrderController extends BaseController { ...@@ -241,6 +251,16 @@ public class WorkOrderController extends BaseController {
workOrder.setRegionCompanyId(userUnitInformationDto.getRegionalCompaniesSeq()); workOrder.setRegionCompanyId(userUnitInformationDto.getRegionalCompaniesSeq());
workOrder.setAmosDealerId(userUnitInformationDto.getAmosDealerId()); workOrder.setAmosDealerId(userUnitInformationDto.getAmosDealerId());
List<WorkOrderPage> list=workOrderMapper.queryForwgpage(workOrder); List<WorkOrderPage> list=workOrderMapper.queryForwgpage(workOrder);
if(list != null && list.size() > 0) {
list.forEach(e -> {
if(e.getPeasantHouseholdNo() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPeasantHouseholdNo()));
}
});
}
return ResponseHelper.buildResponse(list); return ResponseHelper.buildResponse(list);
} }
...@@ -327,7 +347,9 @@ public class WorkOrderController extends BaseController { ...@@ -327,7 +347,9 @@ public class WorkOrderController extends BaseController {
@ApiOperation(httpMethod = "POST",value = "更新详情信息", notes = "更新详情信息") @ApiOperation(httpMethod = "POST",value = "更新详情信息", notes = "更新详情信息")
@PostMapping(value = "/updateDetail") @PostMapping(value = "/updateDetail")
public ResponseModel updateDetail(@RequestBody PowerStationEngineeringInfoAllDto powerStationEngineeringInfoAllDto) { public ResponseModel updateDetail(@RequestBody PowerStationEngineeringInfoAllDto powerStationEngineeringInfoAllDto) {
workOrderServiceImpl.updateDetail(powerStationEngineeringInfoAllDto,getUserId()); String realName = getSelectedOrgInfo().getUserModel().getRealName();
workOrderServiceImpl.updateDetail(powerStationEngineeringInfoAllDto,realName);
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
...@@ -356,8 +378,8 @@ public class WorkOrderController extends BaseController { ...@@ -356,8 +378,8 @@ public class WorkOrderController extends BaseController {
@PostMapping(value = "/addRectification") @PostMapping(value = "/addRectification")
public ResponseModel addRectification( @RequestBody HygfRectificationOrder hygfReplenishment) { public ResponseModel addRectification( @RequestBody HygfRectificationOrder hygfReplenishment) {
workOrderServiceImpl.addRectification(hygfReplenishment);
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse( workOrderServiceImpl.addRectification(hygfReplenishment));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.yeejoin.amos.boot.module.hygf.api.entity.AcceptanceCheckAuditing;
import com.yeejoin.amos.boot.module.hygf.api.mapper.AcceptanceCheckAuditingMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IAcceptanceCheckAuditingService;
import com.yeejoin.amos.boot.module.hygf.api.dto.AcceptanceCheckAuditingDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 并网审核表服务实现类
*
* @author system_generator
* @date 2024-08-21
*/
@Service
public class AcceptanceCheckAuditingServiceImpl extends BaseService<AcceptanceCheckAuditingDto,AcceptanceCheckAuditing,AcceptanceCheckAuditingMapper> implements IAcceptanceCheckAuditingService {
/**
* 分页查询
*/
public Page<AcceptanceCheckAuditingDto> queryForAcceptanceCheckAuditingPage(Page<AcceptanceCheckAuditingDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<AcceptanceCheckAuditingDto> queryForAcceptanceCheckAuditingList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.hygf.api.Enum.ArrivalStateeEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.BusinessWorkflowKey;
import com.yeejoin.amos.boot.module.hygf.api.Enum.GridStatusEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.WorkOrderEnum;
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.mapper.AcceptanceCheckMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.HouseholdContractMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PeasantHouseholdMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IAcceptanceCheckService;
import com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseNewUtil;
import com.yeejoin.amos.component.robot.BadRequest;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO;
import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*;
import java.util.stream.Collectors;
/**
* 并网验收节点服务实现类
*
* @author system_generator
* @date 2024-08-21
*/
@Service
public class AcceptanceCheckServiceImpl extends BaseService<AcceptanceCheckDto,AcceptanceCheck,AcceptanceCheckMapper> implements IAcceptanceCheckService {
@Autowired
AcceptanceCheckAuditingServiceImpl acceptanceCheckAuditingService;
@Autowired
private WorkFlowService workFlowService;
@Autowired
RectificationOrderAuditingServiceImpl rectificationOrderAuditingService;
@Autowired
HygfRectificationOrderServiceImpl rectificationOrderService;
@Autowired
AcceptanceCheckMapper acceptanceCheckMapper;
@Autowired
PeasantHouseholdMapper peasantHouseholdMapper;
@Autowired
HouseholdContractMapper householdContractMapper;
@Autowired
ConstructionAcceptanceRecordsServiceImpl acceptanceRecordsService;
public Page<AcceptanceCheckDto> selectPage(Long regionCompanyId, Long amosDealerId, int current, int size,
String projectAddress, String powerStationCode, String ownersName, String acceptanceCheckStatus,
String gridConnectionTime, String formType, List<String> basicGridNodes, String type) throws Exception {
PageHelper.startPage(current, size);
Map<String, Object> map = new HashMap<>();
Date date = null;
// if (StringUtils.isNotEmpty(gridConnectionTime)) {
// date = DateUtil.formatStringToDate(gridConnectionTime, "yyyy-MM-dd HH:mm:ss");
// }
map.put("projectAddress", projectAddress);
map.put("powerStationCode", powerStationCode);
map.put("ownersName", ownersName);
map.put("acceptanceCheckStatus", acceptanceCheckStatus);
map.put("gridConnectionTime", gridConnectionTime);
map.put("formType", formType);
map.put("regionCompanyId", regionCompanyId);
map.put("amosDealerId", amosDealerId);
map.put("basicGridNodes",basicGridNodes);
map.put("type",type);
List<AcceptanceCheckDto> list = acceptanceCheckMapper.selectPageList(map);
if(list != null && list.size() > 0) {
list.forEach(e -> {
if(e.getPeasantHouseholdNo() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPeasantHouseholdNo()));
}
});
}
PageInfo<AcceptanceCheckDto> page = new PageInfo(list);
Page<AcceptanceCheckDto> pageNew = new Page<>();
pageNew.setCurrent(current);
pageNew.setTotal(page.getTotal());
pageNew.setSize(size);
pageNew.setRecords(page.getList());
return pageNew;
}
/**
* 分页查询
*/
public Page<AcceptanceCheckDto> queryForAcceptanceCheckPage(Page<AcceptanceCheckDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<AcceptanceCheckDto> queryForAcceptanceCheckList() {
return this.queryForList("" , false);
}
public AcceptanceCheck saveAndCommit( Map<String,Object> model) {
AcceptanceCheck basicGridRecord = this.getBaseMapper().selectById(model.get("sequenceNbr").toString());
LambdaUpdateWrapper<AcceptanceCheck> update = new LambdaUpdateWrapper<>();
update.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.JXSGLYDSH.getCode());
update.set(AcceptanceCheck::getBasicGridNode,"jxsAdmin");
if (model.get("type") != null && "1".equals(model.get("type").toString())) {
// 执行工作流
this.wofkflowExcute(basicGridRecord.getInstanceId(),"0","重新验收",BusinessWorkflowKey.验收提交.getCode());
update.set(AcceptanceCheck::getPowerStationAreaStatus,null);
update.set(AcceptanceCheck::getPowerStationLegalStatus,null);
update.set(AcceptanceCheck::getPowerStationFinancingStatus,null);
update.set(AcceptanceCheck::getPowerStationAssetsStatus,null);
} else {
//开启工作流 并执行一步
ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO();
List<ActWorkflowStartDTO> params = new ArrayList<>();
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey("AcceptanceCheck");
dto.setBusinessKey(String.valueOf(new Date().getTime()));
dto.setCompleteFirstTask(true);
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", "0");
dto.setVariables(map);
params.add(dto);
actWorkflowBatchDTO.setProcess(params);
List<ProcessTaskDTO> processTaskDTOS = workFlowService.startBatch(actWorkflowBatchDTO);
List<WorkflowResultDto> workflowResultDtos = workFlowService.buildWorkFlowInfo(processTaskDTOS);
WorkflowResultDto workflowResultDto = workflowResultDtos.get(0);
AcceptanceCheckAuditingDto basicGridAuditingDto = new AcceptanceCheckAuditingDto();
BeanUtils.copyProperties(workflowResultDto, basicGridAuditingDto);
basicGridAuditingDto.setPeasantHouseholdId(basicGridRecord.getPeasantHouseholdId());
basicGridAuditingDto.setPromoter(RequestContext.getExeUserId());
acceptanceCheckAuditingService.createWithModel(basicGridAuditingDto);
update.set(AcceptanceCheck::getInstanceId,basicGridAuditingDto.getInstanceId());
// 线上验收
LambdaUpdateWrapper<PeasantHousehold> up = new LambdaUpdateWrapper<>();
up.set(PeasantHousehold::getConstructionState, ArrivalStateeEnum.验收中.getCode());
long idsk = basicGridRecord.getPeasantHouseholdId();
up.eq(PeasantHousehold::getSequenceNbr, idsk);
peasantHouseholdMapper.update(null, up);
}
//防止重复提交
// if (grid.getSequenceNbr() != null) {
// onGridMapper.updateById(grid);
// } else {
// onGridMapper.insert(grid);
// }
// LambdaQueryWrapper<HygfOnGrid> hog = new LambdaQueryWrapper<>();
// hog.eq(HygfOnGrid::getPeasantHouseholdId, grid.getPeasantHouseholdId());
// hygfOnGridServiceImpl.saveOrUpdate(grid,hog);
update.eq(BaseEntity::getSequenceNbr,basicGridRecord.getSequenceNbr());
this.update(null,update);
//发起待办
// commonService.buildTaskModel(buildBWYSTaskModel(grid, basicGridAcceptance));
ConstructionAcceptanceRecords da = new ConstructionAcceptanceRecords(model.get("realName").toString(), "提交验收审核",
new Date(), "", basicGridRecord.getSequenceNbr(), basicGridRecord.getWorkOrderPowerStationId(),
basicGridRecord.getPeasantHouseholdId(), "");
acceptanceRecordsService.save(da);
return basicGridRecord;
}
// 工作流执行一步
public void wofkflowExcute(String instanceId, String approvalStatus,String comment,String taskKey) {
LambdaQueryWrapper<AcceptanceCheckAuditing> query = new LambdaQueryWrapper<>();
query.eq(AcceptanceCheckAuditing::getInstanceId, instanceId);
query.orderByDesc(BaseEntity::getRecDate);
query.last("limit 1");
AcceptanceCheckAuditing basicGridAuditing = acceptanceCheckAuditingService.getBaseMapper().selectOne(query);
if (!taskKey.contains(basicGridAuditing.getNextNodeKey())){
throw new BadRequest("无可执行任务");
}
//组装信息
TaskResultDTO task = new TaskResultDTO();
task.setTaskId(basicGridAuditing.getNextTaskId());
HashMap<String, Object> map = new HashMap<>();
AcceptanceCheckAuditingDto basicGridAuditingDto = new AcceptanceCheckAuditingDto();
task.setResultCode("approvalStatus");
map.put("approvalStatus", approvalStatus);
task.setComment(comment == null?"":comment);
task.setVariable(map);
//执行流程
ProcessTaskDTO processTaskDTO = workFlowService.complete(basicGridAuditing.getNextTaskId(), task);
List<WorkflowResultDto> workflowResultDtos = workFlowService.buildWorkFlowInfo(CollectionUtil.newArrayList(processTaskDTO));
WorkflowResultDto workflowResultDto = workflowResultDtos.get(0);
BeanUtils.copyProperties(workflowResultDto, basicGridAuditingDto);
basicGridAuditingDto.setPeasantHouseholdId(basicGridAuditing.getPeasantHouseholdId());
basicGridAuditingDto.setPromoter(basicGridAuditing.getPromoter());
basicGridAuditingDto.setStatus(approvalStatus);
if (null == basicGridAuditingDto.getInstanceId()) {
basicGridAuditingDto.setInstanceId(basicGridAuditing.getInstanceId());
}
acceptanceCheckAuditingService.createWithModel(basicGridAuditingDto);
}
public void completeAdminAudit(Map<String,String> kv) {
String instanceId = kv.get("instanceId");
String sequenceNbr = kv.get("sequenceNbr");
String comment = kv.get("comment");
String approvalStatus = kv.get("approvalStatus");
AcceptanceCheck basicGridRecord = this.getBaseMapper().selectById(sequenceNbr);
//执行工作流
this.wofkflowExcute(instanceId, approvalStatus , comment, BusinessWorkflowKey.经销商管理员审核.getCode());
//修改并网数据状态
basicGridRecord.setAcceptanceCheckStatus(approvalStatus.equals("0")?GridStatusEnum.PQYYDSH.getCode():GridStatusEnum.WTG.getCode());
basicGridRecord.setBasicGridNode(approvalStatus.equals("0")?"ys-area":null);
this.updateById(basicGridRecord);
ConstructionAcceptanceRecords da = new ConstructionAcceptanceRecords();
da.setOperationTime(new Date());
da.setOperationContent("验收管理-经销商管理员审核-"+(approvalStatus.equals("0")?"通过":"驳回"));
da.setOperator(kv.get("operator"));
da.setOperationResults(approvalStatus.equals("0")?"通过":"驳回");
da.setAcceptanceId(basicGridRecord.getSequenceNbr());
da.setWorkOrderPowerStationId(basicGridRecord.getWorkOrderPowerStationId());
da.setPeasantHouseholdId(basicGridRecord.getPeasantHouseholdId());
da.setNotes(kv.get("comment"));
acceptanceRecordsService.save(da);
}
public ResponseModel completeAudit(Map<String,String> kv) {
String instanceId = kv.get("instanceId");
String sequenceNbr = kv.get("sequenceNbr");
String comment = kv.get("comment");
String status = kv.get("status");
String approvalStatus = kv.get("approvalStatus");
AcceptanceCheck basicGridRecord = this.getBaseMapper().selectById(sequenceNbr);
LambdaUpdateWrapper<AcceptanceCheck> up = new LambdaUpdateWrapper<>();
ConstructionAcceptanceRecords da = new ConstructionAcceptanceRecords();
switch (status){
case "ys-area":
up.set(AcceptanceCheck::getPowerStationAreaStatus,approvalStatus.equals("0")?"通过":"驳回");
da.setOperationContent("验收审核-片区运营审核-" + (approvalStatus.equals("0")?"通过":"驳回"));
if (approvalStatus.equals("0")){
up.set(AcceptanceCheck::getBasicGridNode,"ys-fawu,ys-tourong");
Boolean flag = true;
LambdaQueryWrapper<HygfRectificationOrder> query = new LambdaQueryWrapper<>();
query.eq(HygfRectificationOrder::getPeasantHouseholeId,basicGridRecord.getPeasantHouseholdId());
query.in(HygfRectificationOrder::getRectificationStatus,Arrays.asList("待整改","待审核"));
query.in(HygfRectificationOrder::getRectificationSource,Arrays.asList("ys-fawu","ys-tourong","ys-zichan"));
List<HygfRectificationOrder> hygfRectificationOrders = rectificationOrderService.getBaseMapper().selectList(query);
for (HygfRectificationOrder hygfRectificationOrder : hygfRectificationOrders) {
if (hygfRectificationOrder.getRectificationStatus().equals("待审核")){
up.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.ZGDSH.getCode());
flag = false;
break;
}
}
if (CollectionUtil.isNotEmpty(hygfRectificationOrders) && flag){
up.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.DZG.getCode());
}else {
up.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.YSROLESDSH.getCode());
}
}
this.wofkflowExcute(instanceId, approvalStatus , comment ,BusinessWorkflowKey.片区运营审核.getCode() );
break;
case "ys-fawu":
up.set(AcceptanceCheck::getPowerStationLegalStatus,approvalStatus.equals("0")?"通过":"驳回");
da.setOperationContent("验收审核-法务审核-" + (approvalStatus.equals("0")?"通过":"驳回"));
if (basicGridRecord.getPowerStationFinancingStatus() != null && basicGridRecord.getPowerStationFinancingStatus().equals("通过")&&approvalStatus.equals("0") ){
up.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.ZCDSH.getCode());
this.wofkflowExcute(instanceId, approvalStatus , comment,BusinessWorkflowKey.法务审核.getCode() );
up.set(AcceptanceCheck::getBasicGridNode,"ys-zichan");
}else if( null == basicGridRecord.getPowerStationFinancingStatus() && approvalStatus.equals("0") && ( Objects.isNull(basicGridRecord.getRectificationStatus())||(!basicGridRecord.getRectificationStatus().contains("ys-tourong")) ) ) {
up.set(AcceptanceCheck::getBasicGridNode,"ys-tourong");
up.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.TRDSH.getCode());
}else if( null == basicGridRecord.getPowerStationFinancingStatus() && approvalStatus.equals("0") && basicGridRecord.getRectificationStatus() .contains("ys-tourong") ) {
up.set(AcceptanceCheck::getBasicGridNode,"ys-tourong");
LambdaQueryWrapper<HygfRectificationOrder> query2 = new LambdaQueryWrapper<>();
query2.eq(HygfRectificationOrder::getPeasantHouseholeId,basicGridRecord.getPeasantHouseholdId());
query2.in(HygfRectificationOrder::getRectificationStatus,Arrays.asList("待整改","待审核","待提交"));
query2.eq(HygfRectificationOrder::getRectificationSource,"ys-tourong");
HygfRectificationOrder hygfRectificationOrder = rectificationOrderService.getBaseMapper().selectOne(query2);
if (hygfRectificationOrder.getRectificationStatus().equals("待提交")){
up.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.TRDSH.getCode());
}else if (hygfRectificationOrder.getRectificationStatus().equals("待整改")){
up.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.DZG.getCode());
}else {
up.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.ZGDSH.getCode());
}
}
else if (null != basicGridRecord.getPowerStationFinancingStatus() && basicGridRecord.getPowerStationFinancingStatus().equals("驳回")){
return CommonResponseNewUtil.failureMessage("该流程已被投融人员审核驳回,请刷新列表");
}else {
this.wofkflowExcute(instanceId, approvalStatus , comment,BusinessWorkflowKey.法务审核.getCode() );
}
break;
case "ys-tourong":
up.set(AcceptanceCheck::getPowerStationFinancingStatus,approvalStatus.equals("0")?"通过":"驳回");
da.setOperationContent("验收审核-投融审核-" + (approvalStatus.equals("0")?"通过":"驳回"));
if (basicGridRecord.getPowerStationLegalStatus() != null && basicGridRecord.getPowerStationLegalStatus().equals("通过")&&approvalStatus.equals("0") ){
up.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.ZCDSH.getCode());
this.wofkflowExcute(instanceId, approvalStatus , comment ,BusinessWorkflowKey.投融审核.getCode());
up.set(AcceptanceCheck::getBasicGridNode,"ys-zichan");
}else if( null == basicGridRecord.getPowerStationLegalStatus() && approvalStatus.equals("0") && ( Objects.isNull(basicGridRecord.getRectificationStatus())||(!basicGridRecord.getRectificationStatus().contains("ys-fawu")) )) {
up.set(AcceptanceCheck::getBasicGridNode,"ys-fawu");
up.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.FWDSH.getCode());
}else if( null == basicGridRecord.getPowerStationLegalStatus() &&approvalStatus.equals("0") && !Objects.isNull(basicGridRecord.getRectificationStatus()) && basicGridRecord.getRectificationStatus().contains("ys-fawu") ) {
up.set(AcceptanceCheck::getBasicGridNode,"ys-fawu");
LambdaQueryWrapper<HygfRectificationOrder> query1 = new LambdaQueryWrapper<>();
query1.eq(HygfRectificationOrder::getPeasantHouseholeId,basicGridRecord.getPeasantHouseholdId());
query1.in(HygfRectificationOrder::getRectificationStatus,Arrays.asList("待整改","待审核","待提交"));
query1.eq(HygfRectificationOrder::getRectificationSource,"ys-fawu");
HygfRectificationOrder hygfRectificationOrder = rectificationOrderService.getBaseMapper().selectOne(query1);
if (hygfRectificationOrder.getRectificationStatus().equals("待提交")){
up.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.FWDSH.getCode());
}else if (hygfRectificationOrder.getRectificationStatus().equals("待整改")){
up.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.DZG.getCode());
}else {
up.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.ZGDSH.getCode());
}
} else if (null != basicGridRecord.getPowerStationLegalStatus() && basicGridRecord.getPowerStationLegalStatus().equals("驳回")){
return CommonResponseNewUtil.failureMessage("该流程已被法务人员审核驳回,请刷新列表");
}else {
this.wofkflowExcute(instanceId, approvalStatus , comment ,BusinessWorkflowKey.投融审核.getCode() );
}
break;
default:
da.setOperationContent("验收审核-资产审核-" + (approvalStatus.equals("0")?"通过":"驳回"));
up.set(AcceptanceCheck::getPowerStationAssetsStatus,approvalStatus.equals("0")?"通过":"驳回");
if (approvalStatus.equals("0")){
up.set(AcceptanceCheck::getBasicGridNode,"all");
up.set(AcceptanceCheck::getAcceptanceTime,new Date());
up.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.YWC.getCode());
//验收完成后需对投融数据进行处理。
}
this.wofkflowExcute(instanceId, approvalStatus , comment ,BusinessWorkflowKey.资产审核.getCode() );
// 线上验收
LambdaUpdateWrapper<PeasantHousehold> up1 = new LambdaUpdateWrapper<>();
up1.set(PeasantHousehold::getConstructionState, ArrivalStateeEnum.验收完成.getCode());
long idsk = basicGridRecord.getPeasantHouseholdId();
up1.eq(PeasantHousehold::getSequenceNbr, idsk);
peasantHouseholdMapper.update(null, up1);
}
if (approvalStatus.equals("1") ){
up.eq(BaseEntity::getSequenceNbr,sequenceNbr);
up.set(AcceptanceCheck::getBasicGridNode,null);
up.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.WTG.getCode());
}
//修改验收数据状态
if (StringUtils.isNotEmpty(sequenceNbr)){
up.eq(BaseEntity::getSequenceNbr,sequenceNbr);
this.getBaseMapper().update(null,up);
}
da.setOperationTime(new Date());
da.setOperator(kv.get("operator"));
da.setOperationResults(approvalStatus.equals("0")?"通过":"驳回");
da.setAcceptanceId(basicGridRecord.getSequenceNbr());
da.setWorkOrderPowerStationId(basicGridRecord.getWorkOrderPowerStationId());
da.setPeasantHouseholdId(basicGridRecord.getPeasantHouseholdId());
da.setNotes(kv.get("comment"));
acceptanceRecordsService.save(da);
return CommonResponseNewUtil.success();
}
public ResponseModel addRectification(HygfRectificationOrder hygfRectificationOrder) {
if (Objects.isNull( hygfRectificationOrder.getRectificationSource()) ){
return CommonResponseNewUtil.failureMessage("多角色用户发起整改单,发起人角色不可为空");
}
if (hygfRectificationOrder.getAddorSubmit().equals("0") && Objects.isNull(hygfRectificationOrder.getRectificationIdea())){
return CommonResponseNewUtil.failureMessage("整改类型及整改项不可为空");
}
if (hygfRectificationOrder.getAddorSubmit().equals("0") && !Objects.isNull(hygfRectificationOrder.getRectificationIdea())){
List<Object> rectificationIdea = hygfRectificationOrder.getRectificationIdea();
for (Object item : rectificationIdea) {
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(item));
Collection<Object> values = jsonObject.values();
if (values.size() < 2){
return CommonResponseNewUtil.failureMessage("整改类型及整改项不可为空");
}
if (jsonObject.containsKey("type")){
if (null == jsonObject.get("type")){
return CommonResponseNewUtil.failureMessage("整改类型及整改项不可为空");
}
}
if (jsonObject.containsKey("items")){
JSONArray item1 = jsonObject.getJSONArray("items");
for (Object o : item1) {
if (!JSON.parseObject(JSON.toJSONString(o)).containsKey("value")){
return CommonResponseNewUtil.failureMessage("整改类型及整改项不可为空");
}
}
}
}
}
if (hygfRectificationOrder.getSequenceNbr() != null ){
LambdaQueryWrapper<HygfRectificationOrder> wr= new LambdaQueryWrapper<>();
wr.eq(HygfRectificationOrder::getPeasantHouseholeId,hygfRectificationOrder.getPeasantHouseholeId());
wr.notIn(HygfRectificationOrder::getRectificationStatus,Arrays.asList("已作废","已完成"));
wr.eq(HygfRectificationOrder::getRectificationSource,hygfRectificationOrder.getRectificationSource());
wr.ne(BaseEntity::getSequenceNbr,hygfRectificationOrder.getSequenceNbr());
List<HygfRectificationOrder> list = rectificationOrderService.getBaseMapper().selectList(wr);
if (CollectionUtil.isNotEmpty(list)){
return CommonResponseNewUtil.failureMessage("当前农户存在其他进行中的整改单,不可重新发起");
}
}
//查询当前并网数据
LambdaQueryWrapper<AcceptanceCheck> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(AcceptanceCheck::getPeasantHouseholdId,hygfRectificationOrder.getPeasantHouseholeId());
AcceptanceCheck basicGridRecord = this.getBaseMapper().selectOne(wrapper);
if (!Objects.isNull(basicGridRecord)&&!basicGridRecord.getBasicGridNode().contains(hygfRectificationOrder.getRectificationSource())){
return CommonResponseNewUtil.failureMessage("当前流程发生变化,暂时无法操作,请刷新再试");
}
String addorSubmit = hygfRectificationOrder.getAddorSubmit();;
LambdaUpdateWrapper<AcceptanceCheck> qu = new LambdaUpdateWrapper();
qu.eq(AcceptanceCheck::getPeasantHouseholdId, hygfRectificationOrder.getPeasantHouseholeId());
if (!Objects.isNull(basicGridRecord) && null != basicGridRecord.getRectificationStatus() && !basicGridRecord.getRectificationStatus().contains(hygfRectificationOrder.getRectificationSource())){
qu.set(AcceptanceCheck::getRectificationStatus,basicGridRecord.getRectificationStatus()+","+hygfRectificationOrder.getRectificationSource());
this.update(null,qu);
}else if (!Objects.isNull(basicGridRecord) && null == basicGridRecord.getRectificationStatus() ) {
qu.set(AcceptanceCheck::getRectificationStatus,hygfRectificationOrder.getRectificationSource());
this.update(null,qu);
}
//修改状态
if (addorSubmit.equals("0")){
int num = 0;
//如果历史有未完成的整改单则片区审核完成的时候改变主流程状态为整改单的状态
LambdaQueryWrapper<HygfRectificationOrder> query = new LambdaQueryWrapper<>();
query.eq(HygfRectificationOrder::getPeasantHouseholeId,basicGridRecord.getPeasantHouseholdId());
query.in(HygfRectificationOrder::getRectificationStatus,Arrays.asList("待整改","待提交","待审核"));
query.in(HygfRectificationOrder::getRectificationSource,Arrays.asList("ys-tourong","ys-fawu"));
List<HygfRectificationOrder> hygfRectificationOrders = rectificationOrderService.getBaseMapper().selectList(query);
for (HygfRectificationOrder hygfRectificationOrderO : hygfRectificationOrders) {
if (hygfRectificationOrderO.getRectificationStatus().equals("待审核")){
qu.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.ZGDSH.getCode());
break;
}
}
if ( num == 0){
qu.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.DZG.getCode());
}
this.update(null,qu);
}
rectificationOrderAuditingService.addRectification(hygfRectificationOrder);
return CommonResponseNewUtil.success();
}
public ResponseModel nextTaskExcute(HygfRectificationOrder hygfRectificationOrder) {
//查询当前并网数据
LambdaQueryWrapper<AcceptanceCheck> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(AcceptanceCheck::getPeasantHouseholdId,hygfRectificationOrder.getPeasantHouseholeId());
AcceptanceCheck basicGridRecord = this.getBaseMapper().selectOne(wrapper);
if (!basicGridRecord.getBasicGridNode().contains(hygfRectificationOrder.getRectificationSource())){
hygfRectificationOrder.setRectificationStatus(WorkOrderEnum.整改中.getCode());
rectificationOrderAuditingService.addRectification(hygfRectificationOrder);
return CommonResponseNewUtil.failureMessage("当前流程发生变化,暂时无法操作,请刷新再试");
}
if (hygfRectificationOrder.getAddorSubmit().equals("0") ) {
LambdaUpdateWrapper<AcceptanceCheck> up = new LambdaUpdateWrapper<>();
up.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.ZGDSH.getCode());
up.eq(AcceptanceCheck::getPeasantHouseholdId,hygfRectificationOrder.getPeasantHouseholeId());
this.update(null,up);
hygfRectificationOrder.setRectificationStatus(WorkOrderEnum.待审核.getCode());
}else {
hygfRectificationOrder.setRectificationStatus(WorkOrderEnum.整改中.getCode());
}
rectificationOrderAuditingService.nextTaskExcute(hygfRectificationOrder);
return CommonResponseNewUtil.success();
}
public ResponseModel nextTaskAduit(HygfRectificationOrder hygfRectificationOrder) {
String auditResult = hygfRectificationOrder.getAuditResult();
//查询当前并网数据
LambdaQueryWrapper<AcceptanceCheck> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(AcceptanceCheck::getPeasantHouseholdId,hygfRectificationOrder.getPeasantHouseholeId());
AcceptanceCheck basicGridRecord = this.getBaseMapper().selectOne(wrapper);
if (!basicGridRecord.getBasicGridNode().contains(hygfRectificationOrder.getRectificationSource())){
return CommonResponseNewUtil.failureMessage("当前流程发生变化,暂时无法操作,请刷新再试");
}
//修改整改单状态
hygfRectificationOrder.setRectificationStatus(auditResult.equals("通过")?WorkOrderEnum.已完成.getCode():WorkOrderEnum.待整改.getCode());
rectificationOrderAuditingService.nextTaskAduit(hygfRectificationOrder);
//查询是否还有其它类型待整改的整改单存在 若存在后置节点为当前并网状态
LambdaQueryWrapper<HygfRectificationOrder> wr= new LambdaQueryWrapper<>();
wr.eq(HygfRectificationOrder::getPeasantHouseholeId,hygfRectificationOrder.getPeasantHouseholeId());
wr.notIn(HygfRectificationOrder::getRectificationStatus,Arrays.asList("待提交","已作废","已完成"));
wr.ne(BaseEntity::getSequenceNbr,hygfRectificationOrder.getSequenceNbr());
List<HygfRectificationOrder> list = rectificationOrderService.getBaseMapper().selectList(wr);
//修改并网状态
//片区不存在并行 无需复杂判断 工程与设计并行 需要做额外逻辑判断
if (auditResult.equals("通过")){
if (hygfRectificationOrder.getRectificationSource().equals("ys-area")){
LambdaUpdateWrapper<AcceptanceCheck> qu = new LambdaUpdateWrapper();
qu.eq(AcceptanceCheck::getPeasantHouseholdId, hygfRectificationOrder.getPeasantHouseholeId());
qu.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.PQYYDSH.getCode());
qu.set(AcceptanceCheck::getRectificationStatus,null);
this.update(null,qu);
}else if (hygfRectificationOrder.getRectificationSource().equals("ys-fawu") || hygfRectificationOrder.getRectificationSource().equals("ys-tourong")) {
LambdaUpdateWrapper<AcceptanceCheck> qu = new LambdaUpdateWrapper();
qu.eq(AcceptanceCheck::getPeasantHouseholdId, hygfRectificationOrder.getPeasantHouseholeId());
List<String> status = new ArrayList<>(Arrays.asList(basicGridRecord.getRectificationStatus().split(",")));
status.remove(hygfRectificationOrder.getRectificationSource());
if(status.size()<1){
qu.set(AcceptanceCheck::getRectificationStatus,null);
}else {
qu.set(AcceptanceCheck::getRectificationStatus,String.join(",",status));
}
if (CollectionUtil.isEmpty(list)) {
//若两者状态都为空 说明均为审核 若某一审核状态为空 则审核状态修改为为空审核节点
if (Objects.isNull(basicGridRecord.getPowerStationLegalStatus() )
&& Objects.isNull(basicGridRecord.getPowerStationFinancingStatus())){
qu.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.YSROLESDSH.getCode());
}else if (Objects.isNull(basicGridRecord.getPowerStationLegalStatus() ) ){
qu.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.FWDSH.getCode());
}else {
qu.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.TRDSH.getCode());
}
}else {
List<String> collect = list.stream().map(HygfRectificationOrder::getRectificationStatus).collect(Collectors.toList());
qu.set(AcceptanceCheck::getAcceptanceCheckStatus,collect.contains(WorkOrderEnum.待审核.getCode())?GridStatusEnum.ZGDSH.getCode():GridStatusEnum.DZG.getCode());
}
this.update(null,qu);
}else {
LambdaUpdateWrapper<AcceptanceCheck> qu = new LambdaUpdateWrapper();
qu.eq(AcceptanceCheck::getPeasantHouseholdId, hygfRectificationOrder.getPeasantHouseholeId());
qu.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.ZCDSH.getCode());
qu.set(AcceptanceCheck::getRectificationStatus,null);
this.update(null,qu);
}
}else {
//驳回的时候 也需根据 工程或者设计 整改单状态修改并网状态
LambdaUpdateWrapper<AcceptanceCheck> qu = new LambdaUpdateWrapper<AcceptanceCheck>();
qu.eq(AcceptanceCheck::getPeasantHouseholdId, hygfRectificationOrder.getPeasantHouseholeId());
if (!CollectionUtil.isEmpty(list)) {
List<String> collect = list.stream().map(HygfRectificationOrder::getRectificationStatus).collect(Collectors.toList());
qu.set(AcceptanceCheck::getAcceptanceCheckStatus,collect.contains(WorkOrderEnum.待审核.getCode())?GridStatusEnum.ZGDSH.getCode():GridStatusEnum.DZG.getCode());
}else {
qu.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.DZG.getCode());
}
this.update(null,qu);
}
return CommonResponseNewUtil.success();
}
public ResponseModel rollback(Long sequenceNbr) {
HygfRectificationOrder hygfRectificationOrder = rectificationOrderService.getBaseMapper().selectById(sequenceNbr);
//查询当前并网数据
LambdaQueryWrapper<AcceptanceCheck> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(AcceptanceCheck::getPeasantHouseholdId,hygfRectificationOrder.getPeasantHouseholeId());
AcceptanceCheck basicGridRecord = this.getBaseMapper().selectOne(wrapper);
if (!basicGridRecord.getBasicGridNode().contains(hygfRectificationOrder.getRectificationSource())){
return CommonResponseNewUtil.failureMessage("当前流程发生变化,暂时无法操作,请刷新再试");
}
LambdaUpdateWrapper<AcceptanceCheck> qu = new LambdaUpdateWrapper();
qu.eq(AcceptanceCheck::getPeasantHouseholdId, hygfRectificationOrder.getPeasantHouseholeId());
if (hygfRectificationOrder.getRectificationStatus().equals(WorkOrderEnum.待提交.getCode()) ||
hygfRectificationOrder.getRectificationStatus().equals(WorkOrderEnum.待整改.getCode())){
rectificationOrderAuditingService.rollback(sequenceNbr);
List<String> status = new ArrayList<>(Arrays.asList(basicGridRecord.getRectificationStatus().split(",")));
status.remove(hygfRectificationOrder.getRectificationSource());
if(status.size()<1){
qu.set(AcceptanceCheck::getRectificationStatus,null);
}else {
qu.set(AcceptanceCheck::getRectificationStatus, String.join(",", status));
this.getBaseMapper().update(null, qu);
}
}else {
return CommonResponseNewUtil.failureMessage("仅单据状态为待提交或待整改时方可作废");
}
if (hygfRectificationOrder.getRectificationSource().equals("ys-area")){
qu.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.PQYYDSH.getCode());
} else if (hygfRectificationOrder.getRectificationSource().equals("ys-fawu") || hygfRectificationOrder.getRectificationSource().equals("ys-tourong")){
//查询是否还有其它类型待整改的整改单存在 若存在后置节点为当前并网状态
LambdaQueryWrapper<HygfRectificationOrder> wr= new LambdaQueryWrapper<>();
wr.eq(HygfRectificationOrder::getPeasantHouseholeId,hygfRectificationOrder.getPeasantHouseholeId());
wr.notIn(HygfRectificationOrder::getRectificationStatus,Arrays.asList("待提交","已作废","已完成"));
wr.ne(BaseEntity::getSequenceNbr,hygfRectificationOrder.getSequenceNbr());
List<HygfRectificationOrder> list = rectificationOrderService.getBaseMapper().selectList(wr);
if (CollectionUtil.isEmpty(list)) {
//若两者状态都为空 说明均为审核 若某一审核状态为空 则审核状态修改为为空审核节点
if (Objects.isNull(basicGridRecord.getPowerStationLegalStatus() )
&& Objects.isNull(basicGridRecord.getPowerStationFinancingStatus())){
qu.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.YSROLESDSH.getCode());
}else if (Objects.isNull(basicGridRecord.getPowerStationLegalStatus() ) ){
qu.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.FWDSH.getCode());
}else {
qu.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.TRDSH.getCode());
}
}else {
List<String> collect = list.stream().map(HygfRectificationOrder::getRectificationStatus).collect(Collectors.toList());
qu.set(AcceptanceCheck::getAcceptanceCheckStatus,collect.contains(WorkOrderEnum.待审核.getCode())?GridStatusEnum.ZGDSH.getCode():GridStatusEnum.DZG.getCode());
}
}else {
qu.set(AcceptanceCheck::getAcceptanceCheckStatus,GridStatusEnum.ZCDSH.getCode());
}
this.update(null,qu);
return CommonResponseNewUtil.success();
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.hygf.biz.service.impl; package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
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.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.hygf.api.Enum.*; import com.yeejoin.amos.boot.module.hygf.api.Enum.*;
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.mapper.*; import com.yeejoin.amos.boot.module.hygf.api.mapper.*;
import com.yeejoin.amos.boot.module.hygf.api.service.IBasicGridAcceptanceService; import com.yeejoin.amos.boot.module.hygf.api.service.IBasicGridAcceptanceService;
import com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseNewUtil;
import com.yeejoin.amos.boot.module.hygf.api.util.NumberUtil; import com.yeejoin.amos.boot.module.hygf.api.util.NumberUtil;
import com.yeejoin.amos.boot.module.hygf.api.util.RedisLockUtil; import com.yeejoin.amos.boot.module.hygf.api.util.RedisLockUtil;
import com.yeejoin.amos.component.robot.BadRequest; import com.yeejoin.amos.component.robot.BadRequest;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO;
import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
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;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.DateUtil; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@Slf4j @Slf4j
@Service @Service
...@@ -36,6 +51,8 @@ public class BasicGridAcceptanceServiceImpl ...@@ -36,6 +51,8 @@ public class BasicGridAcceptanceServiceImpl
@Autowired @Autowired
HygfOnGridMapper onGridMapper; HygfOnGridMapper onGridMapper;
@Autowired @Autowired
private WorkFlowService workFlowService;
@Autowired
HygfOnGridServiceImpl hygfOnGridServiceImpl; HygfOnGridServiceImpl hygfOnGridServiceImpl;
@Autowired @Autowired
PersonnelBusinessMapper personnelBusinessMapper; PersonnelBusinessMapper personnelBusinessMapper;
...@@ -57,13 +74,25 @@ public class BasicGridAcceptanceServiceImpl ...@@ -57,13 +74,25 @@ public class BasicGridAcceptanceServiceImpl
HouseholdContractMapper householdContractMapper; HouseholdContractMapper householdContractMapper;
@Autowired @Autowired
private CommonServiceImpl commonService; private CommonServiceImpl commonService;
@Autowired
RectificationOrderAuditingServiceImpl rectificationOrderAuditingService;
@Autowired
HygfRectificationOrderServiceImpl rectificationOrderService;
@Autowired
BasicGridAuditingServiceImpl basicGridAuditingService;
@Autowired
BasicGridRecordServiceImpl basicGridRecordService;
@Autowired
AcceptanceCheckServiceImpl acceptanceCheckService;
@Autowired
ConstructionGirdRecordsServiceImpl constructionGirdRecords;
private final String OK = "0"; private final String OK = "0";
private final String PASS = "5"; private final String PASS = "5";
public Page<BasicGridAcceptanceDto> selectPage(Long regionCompanyId, Long amosDealerId, int current, int size, public Page<BasicGridRecordDto> selectPage(Long regionCompanyId, Long amosDealerId, int current, int size,
String projectAddress, String powerStationCode, String ownersName, String gridStatus, String projectAddress, String powerStationCode, String ownersName, String gridStatus,
String gridConnectionTime, String formType) throws Exception { String gridConnectionTime, String formType,List<String> basicGridNodes,String type) throws Exception {
PageHelper.startPage(current, size); PageHelper.startPage(current, size);
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
Date date = null; Date date = null;
...@@ -78,9 +107,11 @@ public class BasicGridAcceptanceServiceImpl ...@@ -78,9 +107,11 @@ public class BasicGridAcceptanceServiceImpl
map.put("formType", formType); map.put("formType", formType);
map.put("regionCompanyId", regionCompanyId); map.put("regionCompanyId", regionCompanyId);
map.put("amosDealerId", amosDealerId); map.put("amosDealerId", amosDealerId);
List<BasicGridAcceptanceDto> list = basicGridAcceptanceMapper.selectPageList(map); map.put("basicGridNodes",basicGridNodes);
PageInfo<BasicGridAcceptanceDto> page = new PageInfo(list); map.put("type",type);
Page<BasicGridAcceptanceDto> pageNew = new Page<>(); List<BasicGridRecordDto> list = basicGridAcceptanceMapper.selectPageList(map);
PageInfo<BasicGridRecordDto> page = new PageInfo(list);
Page<BasicGridRecordDto> pageNew = new Page<>();
pageNew.setCurrent(current); pageNew.setCurrent(current);
pageNew.setTotal(page.getTotal()); pageNew.setTotal(page.getTotal());
pageNew.setSize(size); pageNew.setSize(size);
...@@ -104,40 +135,114 @@ public class BasicGridAcceptanceServiceImpl ...@@ -104,40 +135,114 @@ public class BasicGridAcceptanceServiceImpl
return grid; return grid;
} }
@Transactional public void testKAIQI(){
public synchronized HygfOnGrid saveAndCommit(HygfOnGrid grid, String userId) { //开启工作流 并执行一步
ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO();
List<ActWorkflowStartDTO> params = new ArrayList<>();
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey("BINGWANGTEST");
dto.setBusinessKey(String.valueOf(new Date().getTime()));
dto.setCompleteFirstTask(true);
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", "0");
dto.setVariables(map);
params.add(dto);
actWorkflowBatchDTO.setProcess(params);
List<ProcessTaskDTO> processTaskDTOS = workFlowService.startBatch(actWorkflowBatchDTO);
List<WorkflowResultDto> workflowResultDtos = workFlowService.buildWorkFlowInfos(processTaskDTOS);
workflowResultDtos.forEach(e->{
BasicGridAuditingDto basicGridAuditingDto = new BasicGridAuditingDto();
BeanUtils.copyProperties(e, basicGridAuditingDto);
basicGridAuditingDto.setPeasantHouseholdId(20248001107L);
basicGridAuditingDto.setPromoter(RequestContext.getExeUserId());
basicGridAuditingService.createWithModel(basicGridAuditingDto);
});
}
public void zhixing(String approvalStatus,String comment){
LambdaQueryWrapper<BasicGridAuditing> query = new LambdaQueryWrapper<>();
query.eq(BasicGridAuditing::getPeasantHouseholdId, 20248001107L);
query.eq(BasicGridAuditing::getNextNodeKey,"gongchengshenhe");
query.orderByDesc(BaseEntity::getRecDate);
query.last("limit 1");
BasicGridAuditing basicGridAuditing = basicGridAuditingService.getBaseMapper().selectOne(query);
//组装信息
TaskResultDTO task = new TaskResultDTO();
task.setTaskId(basicGridAuditing.getNextTaskId());
HashMap<String, Object> map = new HashMap<>();
BasicGridAuditingDto basicGridAuditingDto = new BasicGridAuditingDto();
task.setResultCode("approvalStatus");
map.put("approvalStatus", approvalStatus);
task.setComment(comment == null?"":comment);
task.setVariable(map);
//执行流程
ProcessTaskDTO processTaskDTO = workFlowService.complete(basicGridAuditing.getNextTaskId(), task);
List<WorkflowResultDto> workflowResultDtos = workFlowService.buildWorkFlowInfo(CollectionUtil.newArrayList(processTaskDTO));
WorkflowResultDto workflowResultDto = workflowResultDtos.get(0);
BeanUtils.copyProperties(workflowResultDto, basicGridAuditingDto);
basicGridAuditingDto.setPeasantHouseholdId(basicGridAuditing.getPeasantHouseholdId());
basicGridAuditingDto.setPromoter(basicGridAuditing.getPromoter());
basicGridAuditingDto.setStatus(approvalStatus);
if (null == basicGridAuditingDto.getInstanceId()) {
basicGridAuditingDto.setInstanceId(basicGridAuditing.getInstanceId());
}
basicGridAuditingService.createWithModel(basicGridAuditingDto);
}
BasicGridAcceptance basicGridAcceptance = basicGridAcceptanceMapper
.selectOne(new LambdaQueryWrapper<BasicGridAcceptance>()
.eq(BasicGridAcceptance::getWorkOrderPowerStationId, grid.getWorkOrderPowerStationId()));
basicGridAcceptance.setGridStatus(GridStatusEnum.DSH.getCode());
public synchronized HygfOnGrid saveAndCommit(HygfOnGrid grid, String realName) {
BasicGridRecord basicGridRecord = basicGridRecordService.getBaseMapper()
.selectOne(new LambdaQueryWrapper<BasicGridRecord>()
.eq(BasicGridRecord::getWorkOrderPowerStationId, grid.getWorkOrderPowerStationId()));
LambdaUpdateWrapper<BasicGridRecord> update = new LambdaUpdateWrapper<>();
update.set(BasicGridRecord::getGridStatus,GridStatusEnum.JXSGLYDSH.getCode());
update.set(BasicGridRecord::getBasicGridNode,"jxsAdmin");
if (grid.getType() != null && "1".equals(grid.getType())) { if (grid.getType() != null && "1".equals(grid.getType())) {
// 执行工作流 // 执行工作流
StandardDto standardDto = new StandardDto(); this.wofkflowExcute(basicGridRecord.getInstanceId(),"0","重新登记",BusinessWorkflowKey.并网登记.getCode());
standardDto.setTaskId(basicGridAcceptance.getNextTaskId()); update.set(BasicGridRecord::getPowerStationAreaStatus,null);
workflow.standard(basicGridAcceptance, standardDto, userId); update.set(BasicGridRecord::getPowerStationDesignStatus,null);
update.set(BasicGridRecord::getPowerStationEngineeringStatus,null);
} else { } else {
// 调用工作流执行第一个节点 //开启工作流 并执行一步
ProcessDto processDto = new ProcessDto(); ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO();
processDto.setProcessDefinitionKey("hygf_bwys"); List<ActWorkflowStartDTO> params = new ArrayList<>();
processDto.setBusinessKey(String.valueOf(basicGridAcceptance.getSequenceNbr())); ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
StartProcessDto startProcessDto = new StartProcessDto(); dto.setProcessDefinitionKey("GridConnected");
List<ProcessDto> process = new ArrayList<>(); dto.setBusinessKey(String.valueOf(new Date().getTime()));
process.add(processDto); dto.setCompleteFirstTask(true);
startProcessDto.setProcess(process); HashMap<String, Object> map = new HashMap<>();
workflow.startProcess(basicGridAcceptance, startProcessDto, userId); map.put("approvalStatus", "0");
dto.setVariables(map);
params.add(dto);
actWorkflowBatchDTO.setProcess(params);
List<ProcessTaskDTO> processTaskDTOS = workFlowService.startBatch(actWorkflowBatchDTO);
List<WorkflowResultDto> workflowResultDtos = workFlowService.buildWorkFlowInfo(processTaskDTOS);
WorkflowResultDto workflowResultDto = workflowResultDtos.get(0);
BasicGridAuditingDto basicGridAuditingDto = new BasicGridAuditingDto();
BeanUtils.copyProperties(workflowResultDto, basicGridAuditingDto);
basicGridAuditingDto.setPeasantHouseholdId(grid.getPeasantHouseholdId());
basicGridAuditingDto.setPromoter(RequestContext.getExeUserId());
basicGridAuditingService.createWithModel(basicGridAuditingDto);
update.set(BasicGridRecord::getInstanceId,basicGridAuditingDto.getInstanceId());
// 线上验收 // 线上验收
LambdaUpdateWrapper<PeasantHousehold> up = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<PeasantHousehold> up = new LambdaUpdateWrapper<>();
up.set(PeasantHousehold::getConstructionState, ArrivalStateeEnum.并网中.getCode()); up.set(PeasantHousehold::getConstructionState, ArrivalStateeEnum.并网中.getCode());
long idsk = basicGridAcceptance.getPeasantHouseholdId(); long idsk = basicGridRecord.getPeasantHouseholdId();
up.eq(PeasantHousehold::getSequenceNbr, idsk); up.eq(PeasantHousehold::getSequenceNbr, idsk);
peasantHouseholdMapper.update(null, up); peasantHouseholdMapper.update(null, up);
} }
//防止重复提交 //防止重复提交
// if (grid.getSequenceNbr() != null) { // if (grid.getSequenceNbr() != null) {
// onGridMapper.updateById(grid); // onGridMapper.updateById(grid);
...@@ -147,9 +252,15 @@ public class BasicGridAcceptanceServiceImpl ...@@ -147,9 +252,15 @@ public class BasicGridAcceptanceServiceImpl
LambdaQueryWrapper<HygfOnGrid> hog = new LambdaQueryWrapper<>(); LambdaQueryWrapper<HygfOnGrid> hog = new LambdaQueryWrapper<>();
hog.eq(HygfOnGrid::getPeasantHouseholdId, grid.getPeasantHouseholdId()); hog.eq(HygfOnGrid::getPeasantHouseholdId, grid.getPeasantHouseholdId());
hygfOnGridServiceImpl.saveOrUpdate(grid,hog); hygfOnGridServiceImpl.saveOrUpdate(grid,hog);
basicGridAcceptanceMapper.updateById(basicGridAcceptance);
update.eq(BaseEntity::getSequenceNbr,basicGridRecord.getSequenceNbr());
basicGridRecordService.update(null,update);
ConstructionGirdRecords da = new ConstructionGirdRecords(realName, "提交并网资料",
new Date(), "", basicGridRecord.getSequenceNbr(), basicGridRecord.getWorkOrderPowerStationId(),
basicGridRecord.getPeasantHouseholdId(), "");
constructionGirdRecords.save(da);
//发起待办 //发起待办
// commonService.buildTaskModel(buildBWYSTaskModel(grid, basicGridAcceptance)); // commonService.buildTaskModel(buildBWYSTaskModel(grid, basicGridAcceptance));
return grid; return grid;
...@@ -344,4 +455,478 @@ public class BasicGridAcceptanceServiceImpl ...@@ -344,4 +455,478 @@ public class BasicGridAcceptanceServiceImpl
} }
} }
// 工作流执行一步
public void wofkflowExcute(String instanceId, String approvalStatus,String comment,String taskKey) {
LambdaQueryWrapper<BasicGridAuditing> query = new LambdaQueryWrapper<>();
query.eq(BasicGridAuditing::getInstanceId, instanceId);
query.orderByDesc(BaseEntity::getRecDate);
query.last("limit 1");
BasicGridAuditing basicGridAuditing = basicGridAuditingService.getBaseMapper().selectOne(query);
if (!taskKey.contains(basicGridAuditing.getNextNodeKey())){
throw new BadRequest("无可执行任务");
}
//组装信息
TaskResultDTO task = new TaskResultDTO();
task.setTaskId(basicGridAuditing.getNextTaskId());
HashMap<String, Object> map = new HashMap<>();
BasicGridAuditingDto basicGridAuditingDto = new BasicGridAuditingDto();
task.setResultCode("approvalStatus");
map.put("approvalStatus", approvalStatus);
task.setComment(comment == null?"":comment);
task.setVariable(map);
//执行流程
ProcessTaskDTO processTaskDTO = workFlowService.complete(basicGridAuditing.getNextTaskId(), task);
List<WorkflowResultDto> workflowResultDtos = workFlowService.buildWorkFlowInfo(CollectionUtil.newArrayList(processTaskDTO));
WorkflowResultDto workflowResultDto = workflowResultDtos.get(0);
BeanUtils.copyProperties(workflowResultDto, basicGridAuditingDto);
basicGridAuditingDto.setPeasantHouseholdId(basicGridAuditing.getPeasantHouseholdId());
basicGridAuditingDto.setPromoter(basicGridAuditing.getPromoter());
basicGridAuditingDto.setStatus(approvalStatus);
if (null == basicGridAuditingDto.getInstanceId()) {
basicGridAuditingDto.setInstanceId(basicGridAuditing.getInstanceId());
}
basicGridAuditingService.createWithModel(basicGridAuditingDto);
}
public void completeAdminAudit(Map<String,String> kv) {
String instanceId = kv.get("instanceId");
String sequenceNbr = kv.get("sequenceNbr");
String comment = kv.get("comment");
String approvalStatus = kv.get("approvalStatus");
BasicGridRecord basicGridRecord = basicGridRecordService.getBaseMapper().selectById(sequenceNbr);
//执行工作流
this.wofkflowExcute(instanceId, approvalStatus , comment,BusinessWorkflowKey.经销商管理员审核.getCode());
//修改并网数据状态
basicGridRecord.setGridStatus(approvalStatus.equals("0")?GridStatusEnum.PQYYDSH.getCode():GridStatusEnum.WTG.getCode());
basicGridRecord.setBasicGridNode(approvalStatus.equals("0")?"bw-area":null);
basicGridRecordService.updateById(basicGridRecord);
// 增加操作日志
ConstructionGirdRecords da = new ConstructionGirdRecords();
da.setOperationTime(new Date());
da.setOperationContent("并网管理-经销商管理员审核-"+(approvalStatus.equals("0")?"通过":"驳回"));
da.setOperator(kv.get("operator"));
da.setOperationResults(approvalStatus.equals("0")?"通过":"驳回");
da.setGridId(basicGridRecord.getSequenceNbr());
da.setWorkOrderPowerStationId(basicGridRecord.getWorkOrderPowerStationId());
da.setPeasantHouseholdId(basicGridRecord.getPeasantHouseholdId());
da.setNotes(kv.get("comment"));
constructionGirdRecords.save(da);
}
public ResponseModel completeAudit(Map<String,String> kv) {
String instanceId = kv.get("instanceId");
String sequenceNbr = kv.get("sequenceNbr");
String comment = kv.get("comment");
String status = kv.get("status");
String approvalStatus = kv.get("approvalStatus");
BasicGridRecord basicGridRecord = basicGridRecordService.getBaseMapper().selectById(sequenceNbr);
ConstructionGirdRecords da = new ConstructionGirdRecords();
LambdaUpdateWrapper<BasicGridRecord> up = new LambdaUpdateWrapper<>();
switch (status){
case "bw-area":
up.set(BasicGridRecord::getPowerStationAreaStatus,approvalStatus.equals("0")?"通过":"驳回");
if (approvalStatus.equals("0")){
up.set(BasicGridRecord::getBasicGridNode,"bw-design,bw-engineering");
up.set(BasicGridRecord::getGridStatus,GridStatusEnum.ROLESDSH.getCode());
int num = 0;
//如果历史有未完成的整改单则片区审核完成的时候改变主流程状态为整改单的状态
LambdaQueryWrapper<HygfRectificationOrder> query = new LambdaQueryWrapper<>();
query.eq(HygfRectificationOrder::getPeasantHouseholeId,basicGridRecord.getPeasantHouseholdId());
query.in(HygfRectificationOrder::getRectificationStatus,Arrays.asList("待整改","待审核"));
query.in(HygfRectificationOrder::getRectificationSource,Arrays.asList("bw-design","bw-engineering"));
List<HygfRectificationOrder> hygfRectificationOrders = rectificationOrderService.getBaseMapper().selectList(query);
for (HygfRectificationOrder hygfRectificationOrder : hygfRectificationOrders) {
if (hygfRectificationOrder.getRectificationStatus().equals("待审核")){
up.set(BasicGridRecord::getGridStatus,GridStatusEnum.ZGDSH.getCode());
num = 1;
break;
}
}
if (CollUtil.isNotEmpty(hygfRectificationOrders) && num == 0){
up.set(BasicGridRecord::getGridStatus,GridStatusEnum.DZG.getCode());
}
}
da.setOperationContent("并网验收-片区运营审核-" + (approvalStatus.equals("0")?"通过":"驳回"));
this.wofkflowExcute(instanceId, approvalStatus , comment ,BusinessWorkflowKey.片区运营审核.getCode() );
break;
case "bw-design":
up.set(BasicGridRecord::getPowerStationDesignStatus,approvalStatus.equals("0")?"通过":"驳回");
da.setOperationContent("并网验收-设计审核-" + (approvalStatus.equals("0")?"通过":"驳回"));
if (basicGridRecord.getPowerStationEngineeringStatus() != null && basicGridRecord.getPowerStationEngineeringStatus().equals("通过")&&approvalStatus.equals("0") ){
up.set(BasicGridRecord::getGridStatus,GridStatusEnum.YWC.getCode());
this.wofkflowExcute(instanceId, approvalStatus , comment ,BusinessWorkflowKey.设计审核.getCode() );
up.set(BasicGridRecord::getBasicGridNode,"all");
up.set(BasicGridRecord::getGridTime,new Date());
LambdaUpdateWrapper<PeasantHousehold> wrapper = new LambdaUpdateWrapper<>();
wrapper.set(PeasantHousehold::getConstructionState,ArrivalStateeEnum.并网完成.getCode());
wrapper.eq(BaseEntity::getSequenceNbr,basicGridRecord.getPeasantHouseholdId());
peasantHouseholdMapper.update(null,wrapper);
AcceptanceCheck acceptanceCheck = new AcceptanceCheck();
BeanUtils.copyProperties(basicGridRecord,acceptanceCheck);
acceptanceCheck.setSequenceNbr(null);
acceptanceCheck.setRectificationStatus(null);
acceptanceCheck.setBasicGridNode(null);
acceptanceCheck.setInstanceId(null);
acceptanceCheck.setPowerStationAreaStatus(null);
acceptanceCheck.setAcceptanceCheckStatus(GridStatusEnum.DTJYS.getCode());
acceptanceCheckService.saveOrUpdate(acceptanceCheck);
}else if( null == basicGridRecord.getPowerStationEngineeringStatus() && approvalStatus.equals("0") && ( Objects.isNull(basicGridRecord.getRectificationStatus())||(!basicGridRecord.getRectificationStatus().contains("bw-engineering")) ) ) {
up.set(BasicGridRecord::getBasicGridNode,"bw-engineering");
up.set(BasicGridRecord::getGridStatus,GridStatusEnum.GCDSH.getCode());
}else if( null == basicGridRecord.getPowerStationEngineeringStatus() && approvalStatus.equals("0") && basicGridRecord.getRectificationStatus().contains("bw-engineering") ) {
up.set(BasicGridRecord::getBasicGridNode,"bw-engineering");
LambdaQueryWrapper<HygfRectificationOrder> query2 = new LambdaQueryWrapper<>();
query2.eq(HygfRectificationOrder::getPeasantHouseholeId,basicGridRecord.getPeasantHouseholdId());
query2.in(HygfRectificationOrder::getRectificationStatus,Arrays.asList("待整改","待审核","待提交"));
query2.eq(HygfRectificationOrder::getRectificationSource,"bw-engineering");
HygfRectificationOrder hygfRectificationOrder = rectificationOrderService.getBaseMapper().selectOne(query2);
if (hygfRectificationOrder.getRectificationStatus().equals("待提交")){
up.set(BasicGridRecord::getGridStatus,GridStatusEnum.SJDSH.getCode());
}else if (hygfRectificationOrder.getRectificationStatus().equals("待整改")){
up.set(BasicGridRecord::getGridStatus,GridStatusEnum.DZG.getCode());
}else {
up.set(BasicGridRecord::getGridStatus,GridStatusEnum.ZGDSH.getCode());
}
}
else if (null != basicGridRecord.getPowerStationEngineeringStatus() && basicGridRecord.getPowerStationEngineeringStatus().equals("驳回")){
return CommonResponseNewUtil.failureMessage("该流程已被工程人员审核驳回,请刷新列表");
}else {
this.wofkflowExcute(instanceId, approvalStatus , comment,BusinessWorkflowKey.设计审核.getCode() );
}
break;
default:
up.set(BasicGridRecord::getPowerStationEngineeringStatus,approvalStatus.equals("0")?"通过":"驳回");
da.setOperationContent("并网验收-工程审核-" + (approvalStatus.equals("0")?"通过":"驳回"));
if (basicGridRecord.getPowerStationDesignStatus() != null && basicGridRecord.getPowerStationDesignStatus().equals("通过")&&approvalStatus.equals("0") ){
up.set(BasicGridRecord::getGridStatus,GridStatusEnum.YWC.getCode());
this.wofkflowExcute(instanceId, approvalStatus , comment ,BusinessWorkflowKey.工程审核.getCode() );
up.set(BasicGridRecord::getBasicGridNode,"all");
up.set(BasicGridRecord::getGridTime,new Date());
LambdaUpdateWrapper<PeasantHousehold> wrapper = new LambdaUpdateWrapper<>();
wrapper.set(PeasantHousehold::getConstructionState,ArrivalStateeEnum.并网完成.getCode());
wrapper.eq(BaseEntity::getSequenceNbr,basicGridRecord.getPeasantHouseholdId());
peasantHouseholdMapper.update(null,wrapper);
AcceptanceCheck acceptanceCheck = new AcceptanceCheck();
BeanUtils.copyProperties(basicGridRecord,acceptanceCheck);
acceptanceCheck.setSequenceNbr(null);
acceptanceCheck.setRectificationStatus(null);
acceptanceCheck.setBasicGridNode(null);
acceptanceCheck.setPowerStationAreaStatus(null);
acceptanceCheck.setInstanceId(null);
acceptanceCheck.setAcceptanceCheckStatus(GridStatusEnum.DTJYS.getCode());
acceptanceCheckService.saveOrUpdate(acceptanceCheck);
}else if( null == basicGridRecord.getPowerStationDesignStatus() && approvalStatus.equals("0") && ( Objects.isNull(basicGridRecord.getRectificationStatus())||(!basicGridRecord.getRectificationStatus().contains("bw-design")) )) {
up.set(BasicGridRecord::getBasicGridNode,"bw-design");
up.set(BasicGridRecord::getGridStatus,GridStatusEnum.SJDSH.getCode());
}else if( null == basicGridRecord.getPowerStationDesignStatus() &&approvalStatus.equals("0") && !Objects.isNull(basicGridRecord.getRectificationStatus()) && basicGridRecord.getRectificationStatus().contains("bw-design") ) {
up.set(BasicGridRecord::getBasicGridNode,"bw-design");
LambdaQueryWrapper<HygfRectificationOrder> query1 = new LambdaQueryWrapper<>();
query1.eq(HygfRectificationOrder::getPeasantHouseholeId,basicGridRecord.getPeasantHouseholdId());
query1.in(HygfRectificationOrder::getRectificationStatus,Arrays.asList("待整改","待审核","待提交"));
query1.eq(HygfRectificationOrder::getRectificationSource,"bw-design");
HygfRectificationOrder hygfRectificationOrder = rectificationOrderService.getBaseMapper().selectOne(query1);
if (hygfRectificationOrder.getRectificationStatus().equals("待提交")){
up.set(BasicGridRecord::getGridStatus,GridStatusEnum.SJDSH.getCode());
}else if (hygfRectificationOrder.getRectificationStatus().equals("待整改")){
up.set(BasicGridRecord::getGridStatus,GridStatusEnum.DZG.getCode());
}else {
up.set(BasicGridRecord::getGridStatus,GridStatusEnum.ZGDSH.getCode());
}
} else if (null != basicGridRecord.getPowerStationDesignStatus() && basicGridRecord.getPowerStationDesignStatus().equals("驳回")){
return CommonResponseNewUtil.failureMessage("该流程已被设计人员审核驳回,请刷新列表");
}else {
this.wofkflowExcute(instanceId, approvalStatus , comment ,BusinessWorkflowKey.工程审核.getCode() );
}
break;
}
if (approvalStatus.equals("1") ){
up.eq(BaseEntity::getSequenceNbr,sequenceNbr);
up.set(BasicGridRecord::getBasicGridNode,null);
up.set(BasicGridRecord::getGridStatus,GridStatusEnum.WTG.getCode());
}
//修改并网数据状态
if (StringUtils.isNotEmpty(sequenceNbr)){
up.eq(BaseEntity::getSequenceNbr,sequenceNbr);
basicGridRecordService.getBaseMapper().update(null,up);
}
da.setOperationTime(new Date());
da.setOperator(kv.get("operator"));
da.setOperationResults(approvalStatus.equals("0")?"通过":"驳回");
da.setGridId(basicGridRecord.getSequenceNbr());
da.setWorkOrderPowerStationId(basicGridRecord.getWorkOrderPowerStationId());
da.setPeasantHouseholdId(basicGridRecord.getPeasantHouseholdId());
da.setNotes(kv.get("comment"));
constructionGirdRecords.save(da);
return CommonResponseNewUtil.success();
}
public ResponseModel addRectification(HygfRectificationOrder hygfRectificationOrder) {
if (Objects.isNull( hygfRectificationOrder.getRectificationSource()) ){
return CommonResponseNewUtil.failureMessage("多角色用户发起整改单,发起人角色不可为空");
}
if (hygfRectificationOrder.getAddorSubmit().equals("0") && Objects.isNull(hygfRectificationOrder.getRectificationIdea())){
return CommonResponseNewUtil.failureMessage("整改类型及整改项不可为空");
}
if (hygfRectificationOrder.getAddorSubmit().equals("0") && !Objects.isNull(hygfRectificationOrder.getRectificationIdea())){
List<Object> rectificationIdea = hygfRectificationOrder.getRectificationIdea();
for (Object item : rectificationIdea) {
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(item));
Collection<Object> values = jsonObject.values();
if (values.size() < 2){
return CommonResponseNewUtil.failureMessage("整改类型及整改项不可为空");
}
if (jsonObject.containsKey("type")){
if (null == jsonObject.get("type")){
return CommonResponseNewUtil.failureMessage("整改类型及整改项不可为空");
}
}
if (jsonObject.containsKey("items")){
JSONArray item1 = jsonObject.getJSONArray("items");
for (Object o : item1) {
if (!JSON.parseObject(JSON.toJSONString(o)).containsKey("value")){
return CommonResponseNewUtil.failureMessage("整改类型及整改项不可为空");
}
}
}
}
}
if (hygfRectificationOrder.getSequenceNbr() != null ){
LambdaQueryWrapper<HygfRectificationOrder> wr= new LambdaQueryWrapper<>();
wr.eq(HygfRectificationOrder::getPeasantHouseholeId,hygfRectificationOrder.getPeasantHouseholeId());
wr.notIn(HygfRectificationOrder::getRectificationStatus,Arrays.asList("已作废","已完成"));
wr.eq(HygfRectificationOrder::getRectificationSource,hygfRectificationOrder.getRectificationSource());
wr.ne(BaseEntity::getSequenceNbr,hygfRectificationOrder.getSequenceNbr());
List<HygfRectificationOrder> list = rectificationOrderService.getBaseMapper().selectList(wr);
if (CollectionUtil.isNotEmpty(list)){
return CommonResponseNewUtil.failureMessage("当前农户存在其他进行中的整改单,不可重新发起");
}
}
//查询当前并网数据
LambdaQueryWrapper<BasicGridRecord> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BasicGridRecord::getPeasantHouseholdId,hygfRectificationOrder.getPeasantHouseholeId());
BasicGridRecord basicGridRecord = basicGridRecordService.getBaseMapper().selectOne(wrapper);
if (!Objects.isNull(basicGridRecord)&&!basicGridRecord.getBasicGridNode().contains(hygfRectificationOrder.getRectificationSource())){
return CommonResponseNewUtil.failureMessage("当前流程发生变化,暂时无法操作,请刷新再试");
}
String addorSubmit = hygfRectificationOrder.getAddorSubmit();
LambdaUpdateWrapper<BasicGridRecord> qu = new LambdaUpdateWrapper();
qu.eq(BasicGridRecord::getPeasantHouseholdId, hygfRectificationOrder.getPeasantHouseholeId());
if (!Objects.isNull(basicGridRecord) && null != basicGridRecord.getRectificationStatus() && !basicGridRecord.getRectificationStatus().contains(hygfRectificationOrder.getRectificationSource())){
qu.set(BasicGridRecord::getRectificationStatus,basicGridRecord.getRectificationStatus()+","+hygfRectificationOrder.getRectificationSource());
basicGridRecordService.update(null,qu);
}else if (!Objects.isNull(basicGridRecord) && null == basicGridRecord.getRectificationStatus() ) {
qu.set(BasicGridRecord::getRectificationStatus,hygfRectificationOrder.getRectificationSource());
basicGridRecordService.update(null,qu);
}
//修改状态
if (addorSubmit.equals("0")){
//如果历史有未完成的整改单则片区审核完成的时候改变主流程状态为整改单的状态
int num = 0;
LambdaQueryWrapper<HygfRectificationOrder> query = new LambdaQueryWrapper<>();
query.eq(HygfRectificationOrder::getPeasantHouseholeId,basicGridRecord.getPeasantHouseholdId());
query.in(HygfRectificationOrder::getRectificationStatus,Arrays.asList("待整改","待提交","待审核"));
query.in(HygfRectificationOrder::getRectificationSource,Arrays.asList("bw-design","bw-engineering"));
List<HygfRectificationOrder> hygfRectificationOrders = rectificationOrderService.getBaseMapper().selectList(query);
for (HygfRectificationOrder hygfRectificationOrderO : hygfRectificationOrders) {
if (hygfRectificationOrderO.getRectificationStatus().equals("待审核")){
qu.set(BasicGridRecord::getGridStatus,GridStatusEnum.ZGDSH.getCode());
num = 1;
break;
}
}
if (num == 0){
qu.set(BasicGridRecord::getGridStatus,GridStatusEnum.DZG.getCode());
}
basicGridRecordService.update(null,qu);
}
rectificationOrderAuditingService.addRectification(hygfRectificationOrder);
return CommonResponseNewUtil.success();
}
public ResponseModel nextTaskExcute(HygfRectificationOrder hygfRectificationOrder) {
//查询当前并网数据
LambdaQueryWrapper<BasicGridRecord> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BasicGridRecord::getPeasantHouseholdId,hygfRectificationOrder.getPeasantHouseholeId());
BasicGridRecord basicGridRecord = basicGridRecordService.getBaseMapper().selectOne(wrapper);
if (!basicGridRecord.getBasicGridNode().contains(hygfRectificationOrder.getRectificationSource())){
hygfRectificationOrder.setRectificationStatus(WorkOrderEnum.整改中.getCode());
rectificationOrderAuditingService.addRectification(hygfRectificationOrder);
return CommonResponseNewUtil.failureMessage("当前流程发生变化,暂时无法操作,请刷新再试");
}
if (hygfRectificationOrder.getAddorSubmit().equals("0") ) {
LambdaUpdateWrapper<BasicGridRecord> up = new LambdaUpdateWrapper<>();
up.set(BasicGridRecord::getGridStatus,GridStatusEnum.ZGDSH.getCode());
up.eq(BasicGridRecord::getPeasantHouseholdId,hygfRectificationOrder.getPeasantHouseholeId());
basicGridRecordService.update(null,up);
hygfRectificationOrder.setRectificationStatus(WorkOrderEnum.待审核.getCode());
}else {
hygfRectificationOrder.setRectificationStatus(WorkOrderEnum.整改中.getCode());
}
rectificationOrderAuditingService.nextTaskExcute(hygfRectificationOrder);
return CommonResponseNewUtil.success();
}
public ResponseModel nextTaskAduit(HygfRectificationOrder hygfRectificationOrder) {
String auditResult = hygfRectificationOrder.getAuditResult();
//查询当前并网数据
LambdaQueryWrapper<BasicGridRecord> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BasicGridRecord::getPeasantHouseholdId,hygfRectificationOrder.getPeasantHouseholeId());
BasicGridRecord basicGridRecord = basicGridRecordService.getBaseMapper().selectOne(wrapper);
if (!basicGridRecord.getBasicGridNode().contains(hygfRectificationOrder.getRectificationSource())){
return CommonResponseNewUtil.failureMessage("当前流程发生变化,暂时无法操作,请刷新再试");
}
//修改整改单状态
hygfRectificationOrder.setRectificationStatus(auditResult.equals("通过")?WorkOrderEnum.已完成.getCode():WorkOrderEnum.待整改.getCode());
rectificationOrderAuditingService.nextTaskAduit(hygfRectificationOrder);
//查询是否还有其它类型待整改的整改单存在 若存在后置节点为当前并网状态
LambdaQueryWrapper<HygfRectificationOrder> wr= new LambdaQueryWrapper<>();
wr.eq(HygfRectificationOrder::getPeasantHouseholeId,hygfRectificationOrder.getPeasantHouseholeId());
wr.notIn(HygfRectificationOrder::getRectificationStatus,Arrays.asList("待提交","已作废","已完成"));
wr.ne(BaseEntity::getSequenceNbr,hygfRectificationOrder.getSequenceNbr());
List<HygfRectificationOrder> list = rectificationOrderService.getBaseMapper().selectList(wr);
//修改并网状态
//片区不存在并行 无需复杂判断 工程与设计并行 需要做额外逻辑判断
if (auditResult.equals("通过")){
if (hygfRectificationOrder.getRectificationSource().equals("bw-area")){
LambdaUpdateWrapper<BasicGridRecord> qu = new LambdaUpdateWrapper();
qu.eq(BasicGridRecord::getPeasantHouseholdId, hygfRectificationOrder.getPeasantHouseholeId());
qu.set(BasicGridRecord::getGridStatus,GridStatusEnum.PQYYDSH.getCode());
qu.set(BasicGridRecord::getRectificationStatus,null);
basicGridRecordService.update(null,qu);
}else {
LambdaUpdateWrapper<BasicGridRecord> qu = new LambdaUpdateWrapper();
qu.eq(BasicGridRecord::getPeasantHouseholdId, hygfRectificationOrder.getPeasantHouseholeId());
List<String> status = new ArrayList<>(Arrays.asList(basicGridRecord.getRectificationStatus().split(",")));
status.remove(hygfRectificationOrder.getRectificationSource());
if(status.size()<1){
qu.set(BasicGridRecord::getRectificationStatus,null);
}else {
qu.set(BasicGridRecord::getRectificationStatus,String.join(",",status));
}
if (CollectionUtil.isEmpty(list)) {
//若两者状态都为空 说明均为审核 若某一审核状态为空 则审核状态修改为为空审核节点
if (Objects.isNull(basicGridRecord.getPowerStationDesignStatus() )
&& Objects.isNull(basicGridRecord.getPowerStationEngineeringStatus())){
qu.set(BasicGridRecord::getGridStatus,GridStatusEnum.ROLESDSH.getCode());
}else if (Objects.isNull(basicGridRecord.getPowerStationDesignStatus() ) ){
qu.set(BasicGridRecord::getGridStatus,GridStatusEnum.SJDSH.getCode());
}else {
qu.set(BasicGridRecord::getGridStatus,GridStatusEnum.GCDSH.getCode());
}
}else {
List<String> collect = list.stream().map(HygfRectificationOrder::getRectificationStatus).collect(Collectors.toList());
qu.set(BasicGridRecord::getGridStatus,collect.contains(WorkOrderEnum.待审核.getCode())?GridStatusEnum.ZGDSH.getCode():GridStatusEnum.DZG.getCode());
}
basicGridRecordService.update(null,qu);
}
}else {
//驳回的时候 也需根据 工程或者设计 整改单状态修改并网状态
LambdaUpdateWrapper<BasicGridRecord> qu = new LambdaUpdateWrapper();
qu.eq(BasicGridRecord::getPeasantHouseholdId, hygfRectificationOrder.getPeasantHouseholeId());
if (!CollectionUtil.isEmpty(list)) {
List<String> collect = list.stream().map(HygfRectificationOrder::getRectificationStatus).collect(Collectors.toList());
qu.set(BasicGridRecord::getGridStatus,collect.contains(WorkOrderEnum.待审核.getCode())?GridStatusEnum.ZGDSH.getCode():GridStatusEnum.DZG.getCode());
}else {
qu.set(BasicGridRecord::getGridStatus,GridStatusEnum.DZG.getCode());
}
basicGridRecordService.update(null,qu);
}
return CommonResponseNewUtil.success();
}
public ResponseModel rollback(Long sequenceNbr) {
HygfRectificationOrder hygfRectificationOrder = rectificationOrderService.getBaseMapper().selectById(sequenceNbr);
//查询当前并网数据
LambdaQueryWrapper<BasicGridRecord> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BasicGridRecord::getPeasantHouseholdId,hygfRectificationOrder.getPeasantHouseholeId());
BasicGridRecord basicGridRecord = basicGridRecordService.getBaseMapper().selectOne(wrapper);
if (!basicGridRecord.getBasicGridNode().contains(hygfRectificationOrder.getRectificationSource())){
return CommonResponseNewUtil.failureMessage("当前流程发生变化,暂时无法操作,请刷新再试");
}
LambdaUpdateWrapper<BasicGridRecord> qu = new LambdaUpdateWrapper();
qu.eq(BasicGridRecord::getPeasantHouseholdId, hygfRectificationOrder.getPeasantHouseholeId());
if (hygfRectificationOrder.getRectificationStatus().equals(WorkOrderEnum.待提交.getCode()) ||
hygfRectificationOrder.getRectificationStatus().equals(WorkOrderEnum.待整改.getCode())){
rectificationOrderAuditingService.rollback(sequenceNbr);
List<String> status = new ArrayList<>(Arrays.asList(basicGridRecord.getRectificationStatus().split(",")));
status.remove(hygfRectificationOrder.getRectificationSource());
if(status.size()<1){
qu.set(BasicGridRecord::getRectificationStatus,null);
}else {
qu.set(BasicGridRecord::getRectificationStatus, String.join(",", status));
basicGridRecordService.getBaseMapper().update(null, qu);
}
}else {
return CommonResponseNewUtil.failureMessage("仅单据状态为待提交或待整改时方可作废");
}
if (hygfRectificationOrder.getRectificationSource().equals("bw-area")){
qu.set(BasicGridRecord::getGridStatus,GridStatusEnum.PQYYDSH.getCode());
}else {
//查询是否还有其它类型待整改的整改单存在 若存在后置节点为当前并网状态
LambdaQueryWrapper<HygfRectificationOrder> wr= new LambdaQueryWrapper<>();
wr.eq(HygfRectificationOrder::getPeasantHouseholeId,hygfRectificationOrder.getPeasantHouseholeId());
wr.notIn(HygfRectificationOrder::getRectificationStatus,Arrays.asList("待提交","已作废","已完成"));
wr.ne(BaseEntity::getSequenceNbr,hygfRectificationOrder.getSequenceNbr());
List<HygfRectificationOrder> list = rectificationOrderService.getBaseMapper().selectList(wr);
if (CollectionUtil.isEmpty(list)) {
//若两者状态都为空 说明均为审核 若某一审核状态为空 则审核状态修改为为空审核节点
if (Objects.isNull(basicGridRecord.getPowerStationDesignStatus() )
&& Objects.isNull(basicGridRecord.getPowerStationEngineeringStatus())){
qu.set(BasicGridRecord::getGridStatus,GridStatusEnum.ROLESDSH.getCode());
}else if (Objects.isNull(basicGridRecord.getPowerStationDesignStatus() ) ){
qu.set(BasicGridRecord::getGridStatus,GridStatusEnum.SJDSH.getCode());
}else {
qu.set(BasicGridRecord::getGridStatus,GridStatusEnum.GCDSH.getCode());
}
}else {
List<String> collect = list.stream().map(HygfRectificationOrder::getRectificationStatus).collect(Collectors.toList());
qu.set(BasicGridRecord::getGridStatus,collect.contains(WorkOrderEnum.待审核.getCode())?GridStatusEnum.ZGDSH.getCode():GridStatusEnum.DZG.getCode());
}
}
basicGridRecordService.update(null,qu);
return CommonResponseNewUtil.success();
}
} }
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.yeejoin.amos.boot.module.hygf.api.entity.BasicGridAuditing;
import com.yeejoin.amos.boot.module.hygf.api.mapper.BasicGridAuditingMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IBasicGridAuditingService;
import com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridAuditingDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 并网审核表服务实现类
*
* @author system_generator
* @date 2024-08-21
*/
@Service
public class BasicGridAuditingServiceImpl extends BaseService<BasicGridAuditingDto,BasicGridAuditing,BasicGridAuditingMapper> implements IBasicGridAuditingService {
/**
* 分页查询
*/
public Page<BasicGridAuditingDto> queryForBasicGridAuditingPage(Page<BasicGridAuditingDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<BasicGridAuditingDto> queryForBasicGridAuditingList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.yeejoin.amos.boot.module.hygf.api.entity.BasicGridRecord;
import com.yeejoin.amos.boot.module.hygf.api.mapper.BasicGridRecordMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IBasicGridRecordService;
import com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridRecordDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 并网验收节点服务实现类
*
* @author system_generator
* @date 2024-08-21
*/
@Service
public class BasicGridRecordServiceImpl extends BaseService<BasicGridRecordDto,BasicGridRecord,BasicGridRecordMapper> implements IBasicGridRecordService {
/**
* 分页查询
*/
public Page<BasicGridRecordDto> queryForBasicGridRecordPage(Page<BasicGridRecordDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<BasicGridRecordDto> queryForBasicGridRecordList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.yeejoin.amos.boot.module.hygf.api.entity.ConstructionAcceptanceRecords;
import com.yeejoin.amos.boot.module.hygf.api.mapper.ConstructionAcceptanceRecordsMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IConstructionAcceptanceRecordsService;
import com.yeejoin.amos.boot.module.hygf.api.dto.ConstructionAcceptanceRecordsDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 并网操作日志服务实现类
*
* @author system_generator
* @date 2024-09-02
*/
@Service
public class ConstructionAcceptanceRecordsServiceImpl extends BaseService<ConstructionAcceptanceRecordsDto,ConstructionAcceptanceRecords,ConstructionAcceptanceRecordsMapper> implements IConstructionAcceptanceRecordsService {
/**
* 分页查询
*/
public Page<ConstructionAcceptanceRecordsDto> queryForConstructionAcceptanceRecordsPage(Page<ConstructionAcceptanceRecordsDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<ConstructionAcceptanceRecordsDto> queryForConstructionAcceptanceRecordsList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.yeejoin.amos.boot.module.hygf.api.entity.ConstructionGirdRecords;
import com.yeejoin.amos.boot.module.hygf.api.mapper.ConstructionGirdRecordsMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IConstructionGirdRecordsService;
import com.yeejoin.amos.boot.module.hygf.api.dto.ConstructionGirdRecordsDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 并网操作日志服务实现类
*
* @author system_generator
* @date 2024-09-02
*/
@Service
public class ConstructionGirdRecordsServiceImpl extends BaseService<ConstructionGirdRecordsDto,ConstructionGirdRecords,ConstructionGirdRecordsMapper> implements IConstructionGirdRecordsService {
/**
* 分页查询
*/
public Page<ConstructionGirdRecordsDto> queryForConstructionGirdRecordsPage(Page<ConstructionGirdRecordsDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<ConstructionGirdRecordsDto> queryForConstructionGirdRecordsList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
...@@ -29,6 +29,7 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.FinancingInfo; ...@@ -29,6 +29,7 @@ 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.FinancingRectificationOrder;
import com.yeejoin.amos.boot.module.hygf.api.entity.StdUserEmpower; 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.mapper.HouseholdContractMapper;
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.util.RedisLockUtil; import com.yeejoin.amos.boot.module.hygf.api.util.RedisLockUtil;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO; import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
...@@ -71,6 +72,8 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -71,6 +72,8 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
@Autowired @Autowired
private FinancingRectificationOrderServiceImpl financingRectificationOrderService; private FinancingRectificationOrderServiceImpl financingRectificationOrderService;
@Autowired @Autowired
private HouseholdContractMapper householdContractMapper;
@Autowired
private CommonServiceImpl commonService; private CommonServiceImpl commonService;
@Resource(type = RedisLockUtil.class) @Resource(type = RedisLockUtil.class)
...@@ -100,6 +103,8 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -100,6 +103,8 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
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 -> {
e.put("scale", householdContractMapper.getHygfCommercialScale((String) e.get("peasantHouseholdNo")));
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]);
......
...@@ -137,7 +137,7 @@ public class HouseholdContractServiceImpl extends BaseService<HouseholdContractD ...@@ -137,7 +137,7 @@ public class HouseholdContractServiceImpl extends BaseService<HouseholdContractD
if (da.getRegionalAddress() == null || da.getRegionalAddress().isEmpty()) { if (da.getRegionalAddress() == null || da.getRegionalAddress().isEmpty()) {
throw new BadRequest("区域公司省市区为空, 请设置省市区"); throw new BadRequest("区域公司省市区为空, 请设置省市区");
} }
String code = NumberUtil.getCode(CodeEnum.勘察.getCode(), da.getCompanyCode(), da.getRegionalAddress()); String code = NumberUtil.getCode(CodeEnum.合同.getCode(), da.getCompanyCode(), da.getRegionalAddress());
return code; return code;
} }
......
...@@ -295,7 +295,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -295,7 +295,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
Map<String, String> data = JSONObject.parseObject(decode, Map.class); Map<String, String> data = JSONObject.parseObject(decode, Map.class);
log.debug("解密后参数:{}", data);// 进行自己的处理,此处默认处理成功,返回通知方成功,return_code=0 log.debug("解密后参数:{}", data);// 进行自己的处理,此处默认处理成功,返回通知方成功,return_code=0
// 其中certNo、custName、newPayAcc字段进行了base64编码,可以调用示例代码中的base64Decode进行解码 // 其中certNo、custName、newPayAcc字段进行了base64编码,可以调用示例代码中的base64Decode进行解码
String custName = base64Decode(data.get("custName")); //String custName = base64Decode(data.get("custName"));
String certNo = base64Decode(data.get("certNo")); String certNo = base64Decode(data.get("certNo"));
String newPayAcc = base64Decode(data.get("newPayAcc")); String newPayAcc = base64Decode(data.get("newPayAcc"));
String outUserId = data.get("outUserId"); String outUserId = data.get("outUserId");
...@@ -309,13 +309,6 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -309,13 +309,6 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
if (hygfIcbcRecord == null) { if (hygfIcbcRecord == null) {
hygfIcbcRecord = new HygfIcbcRecord(); hygfIcbcRecord = new HygfIcbcRecord();
} }
hygfIcbcRecord.setCustName(custName);
hygfIcbcRecord.setIdCard(certNo);
hygfIcbcRequest.setPhase("组装");
hygfIcbcRequest.setException(data.get("custName") + " -> " + custName);
hygfIcbcRequestMapper.updateById(hygfIcbcRequest);
PeasantHousehold peasantHousehold = peasantHouseholdService.lambdaQuery() PeasantHousehold peasantHousehold = peasantHouseholdService.lambdaQuery()
.select(PeasantHousehold::getTelephone).eq(PeasantHousehold::getAmosUserId, outUserId) .select(PeasantHousehold::getTelephone).eq(PeasantHousehold::getAmosUserId, outUserId)
.last("limit 1").one(); .last("limit 1").one();
...@@ -324,6 +317,12 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -324,6 +317,12 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
hygfIcbcRecord.setProjectId(projectId); hygfIcbcRecord.setProjectId(projectId);
hygfIcbcRecord.setOpenAccountStatus(openAccoutSucceedFlag); hygfIcbcRecord.setOpenAccountStatus(openAccoutSucceedFlag);
hygfIcbcRecord.setSignEntrsutPrtlStatus(signEntrsutPrtlSucceedFlag); hygfIcbcRecord.setSignEntrsutPrtlStatus(signEntrsutPrtlSucceedFlag);
hygfIcbcRecord.setCustName(peasantHousehold.getOwnersName());
hygfIcbcRecord.setIdCard(certNo);
hygfIcbcRequest.setPhase("组装");
hygfIcbcRequest.setException(data.get("custName") + " -> " + peasantHousehold.getOwnersName());
hygfIcbcRequestMapper.updateById(hygfIcbcRequest);
if (hygfIcbcWalletInfo != null) { if (hygfIcbcWalletInfo != null) {
hygfIcbcRecord.setCustName(hygfIcbcWalletInfo.getCustName()); hygfIcbcRecord.setCustName(hygfIcbcWalletInfo.getCustName());
hygfIcbcRecord.setIdCard(hygfIcbcWalletInfo.getCertNo()); hygfIcbcRecord.setIdCard(hygfIcbcWalletInfo.getCertNo());
...@@ -476,11 +475,11 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -476,11 +475,11 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
hygfIcbcRecordDTO.setProtocolStatusName( hygfIcbcRecordDTO.setProtocolStatusName(
IcbcEnum.ProtocolStatus.getNameByCode(hygfIcbcRecordDTO.getProtocolStatus(), "")); IcbcEnum.ProtocolStatus.getNameByCode(hygfIcbcRecordDTO.getProtocolStatus(), ""));
List<PeasantHousehold> peasantHouseholdList = PeasantHouseholdMap.get(hygfIcbcRecordDTO.getAmosUserId()); List<PeasantHousehold> peasantHouseholdList = PeasantHouseholdMap.get(hygfIcbcRecordDTO.getAmosUserId());
if (IcbcEnum.OpenAccountState.FAIL.getCode().equals(hygfIcbcRecordDTO.getOpenAccountStatus())) { // if (IcbcEnum.OpenAccountState.FAIL.getCode().equals(hygfIcbcRecordDTO.getOpenAccountStatus())) {
hygfIcbcRecordDTO.setCustName(peasantHouseholds.get(0).getOwnersName()); // hygfIcbcRecordDTO.setCustName(peasantHouseholds.get(0).getOwnersName());
hygfIcbcRecordDTO.setIdCard(peasantHouseholds.get(0).getIdCard()); // hygfIcbcRecordDTO.setIdCard(peasantHouseholds.get(0).getIdCard());
hygfIcbcRecordDTO.setPhone(peasantHouseholds.get(0).getTelephone()); // hygfIcbcRecordDTO.setPhone(peasantHouseholds.get(0).getTelephone());
} // }
if (!CollectionUtils.isEmpty(peasantHouseholdList)) { if (!CollectionUtils.isEmpty(peasantHouseholdList)) {
// 根据区域经销商名称去重 // 根据区域经销商名称去重
List<HygfIcbcRecordDTO.IcbcPeasantHousehold> icbcPeasantHouseholds = Bean.toModels(peasantHouseholdList, List<HygfIcbcRecordDTO.IcbcPeasantHousehold> icbcPeasantHouseholds = Bean.toModels(peasantHouseholdList,
......
...@@ -33,7 +33,7 @@ public class HygfRectificationOrderServiceImpl extends BaseService<HygfRectifica ...@@ -33,7 +33,7 @@ public class HygfRectificationOrderServiceImpl extends BaseService<HygfRectifica
/** /**
* 分页查询 * 分页查询
*/ */
public Page<HygfRectificationOrder> queryForHygfRectificationOrderPage(int current, int size, List<String> rectificationSource, String peasantHouseholeId) { public Page<HygfRectificationOrder> queryForHygfRectificationOrderPage(int current, int size, List<String> rectificationSource, String peasantHouseholeId,List<String> status) {
// PageHelper.startPage(current, size); // PageHelper.startPage(current, size);
// List<HygfRectificationOrder> list = this.getBaseMapper().selectOrderPage(rectificationSource,peasantHouseholeId); // List<HygfRectificationOrder> list = this.getBaseMapper().selectOrderPage(rectificationSource,peasantHouseholeId);
// PageInfo<HygfRectificationOrder> infos = new PageInfo<>(list); // PageInfo<HygfRectificationOrder> infos = new PageInfo<>(list);
...@@ -48,6 +48,9 @@ public class HygfRectificationOrderServiceImpl extends BaseService<HygfRectifica ...@@ -48,6 +48,9 @@ public class HygfRectificationOrderServiceImpl extends BaseService<HygfRectifica
if (rectificationSource != null && !rectificationSource.isEmpty()) { if (rectificationSource != null && !rectificationSource.isEmpty()) {
wrapper.in(HygfRectificationOrder::getRectificationSource, rectificationSource); wrapper.in(HygfRectificationOrder::getRectificationSource, rectificationSource);
} }
if (status != null && !status.isEmpty()) {
wrapper.in(HygfRectificationOrder::getRectificationStatus, status);
}
// 创建 Page 对象并设置分页参数 // 创建 Page 对象并设置分页参数
Page<HygfRectificationOrder> page = new Page<>(current, size); Page<HygfRectificationOrder> page = new Page<>(current, size);
......
...@@ -133,7 +133,12 @@ public class SurveyInformationServiceImpl ...@@ -133,7 +133,12 @@ public class SurveyInformationServiceImpl
private RedisLockUtil redisLockUtil; private RedisLockUtil redisLockUtil;
@Autowired @Autowired
WorkflowImpl workflow; WorkflowImpl workflow;
@Autowired
HygfRectificationOrderServiceImpl rectificationOrderService;
private static final String PROCESSKEY = "ProcessEngineering";
@Autowired
AcceptanceCheckMapper acceptanceCheckMapper;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -629,9 +634,21 @@ public class SurveyInformationServiceImpl ...@@ -629,9 +634,21 @@ public class SurveyInformationServiceImpl
up2.eq(PowerStationConstructionData::getWorkOrderPowerStationId, workOrderPowerStationId); up2.eq(PowerStationConstructionData::getWorkOrderPowerStationId, workOrderPowerStationId);
PowerStationConstructionData powerStationConstructionData = powerStationConstructionDataMapper PowerStationConstructionData powerStationConstructionData = powerStationConstructionDataMapper
.selectOne(up2); .selectOne(up2);
//增加整改单数据
List<HygfRectificationOrder> hygfRectificationOrders = rectificationOrderService.selectForListBySource(String.valueOf(peasantHousehold.getSequenceNbr()), PROCESSKEY);
if (CollectionUtil.isNotEmpty(hygfRectificationOrders)){
List<HygfRectificationOrder> areaOrders = hygfRectificationOrders.stream().filter(e -> e.getRectificationSource().equals("area")).collect(Collectors.toList());
List<HygfRectificationOrder> engineeringOrders = hygfRectificationOrders.stream().filter(e -> e.getRectificationSource().equals("engineering")).collect(Collectors.toList());
List<HygfRectificationOrder> designOrders = hygfRectificationOrders.stream().filter(e -> e.getRectificationSource().equals("design")).collect(Collectors.toList());
powerStationConstructionData.setAreaOrders(areaOrders.size()>0?areaOrders:null);
powerStationConstructionData.setEngineeringOrders(engineeringOrders.size()>0?engineeringOrders:null);
powerStationConstructionData.setDesignOrders(designOrders.size()>0?designOrders:null);
}
// 工程信息 // 工程信息
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);
...@@ -658,6 +675,18 @@ public class SurveyInformationServiceImpl ...@@ -658,6 +675,18 @@ public class SurveyInformationServiceImpl
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);
//增加整改单数据
List<HygfRectificationOrder> hygfRectificationOrderList= rectificationOrderService.selectForListBySource(String.valueOf(peasantHousehold.getSequenceNbr()), RectificationOrderEnum.并网.getName());
if (CollectionUtil.isNotEmpty(hygfRectificationOrderList)){
List<HygfRectificationOrder> areaOrders = hygfRectificationOrderList.stream().filter(e -> e.getRectificationSource().equals("bw-area")).collect(Collectors.toList());
List<HygfRectificationOrder> engineeringOrders = hygfRectificationOrderList.stream().filter(e -> e.getRectificationSource().equals("bw-engineering")).collect(Collectors.toList());
List<HygfRectificationOrder> designOrders = hygfRectificationOrderList.stream().filter(e -> e.getRectificationSource().equals("bw-design")).collect(Collectors.toList());
hygfOnGrid.setAreaOrders(areaOrders.size()>0?areaOrders:null);
hygfOnGrid.setEngineeringOrders(engineeringOrders.size()>0?engineeringOrders:null);
hygfOnGrid.setDesignOrders(designOrders.size()>0?designOrders:null);
}
surveyInfoAllDto.setHygfOnGrid(hygfOnGrid != null ? hygfOnGrid : new HygfOnGrid()); surveyInfoAllDto.setHygfOnGrid(hygfOnGrid != null ? hygfOnGrid : new HygfOnGrid());
surveyInfoAllDto surveyInfoAllDto
.setPowerStationConstructionData(powerStationConstructionData != null ? powerStationConstructionData .setPowerStationConstructionData(powerStationConstructionData != null ? powerStationConstructionData
...@@ -666,12 +695,32 @@ public class SurveyInformationServiceImpl ...@@ -666,12 +695,32 @@ public class SurveyInformationServiceImpl
.setPowerStationEngineeringInfo(powerStationEngineeringInfo != null ? powerStationEngineeringInfo .setPowerStationEngineeringInfo(powerStationEngineeringInfo != null ? powerStationEngineeringInfo
: new 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());
surveyInfoAllDto.setWorkOrder(new WorkOrder()); surveyInfoAllDto.setWorkOrder(new WorkOrder());
} }
//验收信息
LambdaQueryWrapper<AcceptanceCheck> quv1 = new LambdaQueryWrapper<AcceptanceCheck>();
quv1.eq(AcceptanceCheck::getPeasantHouseholdId, peasantHouseholdId);
AcceptanceCheck acceptanceCheck = acceptanceCheckMapper.selectOne(quv1);
//增加整改单数据
List<HygfRectificationOrder> hygfRectificationOrderListYs= rectificationOrderService.selectForListBySource(String.valueOf(peasantHousehold.getSequenceNbr()), RectificationOrderEnum.验收.getName());
if (CollectionUtil.isNotEmpty(hygfRectificationOrderListYs)){
List<HygfRectificationOrder> areaOrders = hygfRectificationOrderListYs.stream().filter(e -> e.getRectificationSource().equals("ys-area")).collect(Collectors.toList());
List<HygfRectificationOrder> financeOrders = hygfRectificationOrderListYs.stream().filter(e -> e.getRectificationSource().equals("ys-tourong")).collect(Collectors.toList());
List<HygfRectificationOrder> legalOrders = hygfRectificationOrderListYs.stream().filter(e -> e.getRectificationSource().equals("ys-fawu")).collect(Collectors.toList());
List<HygfRectificationOrder> propertyOrders = hygfRectificationOrderListYs.stream().filter(e -> e.getRectificationSource().equals("ys-zichan")).collect(Collectors.toList());
acceptanceCheck.setAreaOrders(areaOrders.size()>0?areaOrders:null);
acceptanceCheck.setFinanceOrders(financeOrders.size()>0?financeOrders:null);
acceptanceCheck.setLegalOrders(legalOrders.size()>0?legalOrders:null);
acceptanceCheck.setPropertyOrders(propertyOrders.size()>0?propertyOrders:null);
}
surveyInfoAllDto.setAcceptanceCheck(acceptanceCheck);
if (!StringUtils.isEmpty(processInstanceId)) { if (!StringUtils.isEmpty(processInstanceId)) {
try { try {
...@@ -705,6 +754,8 @@ public class SurveyInformationServiceImpl ...@@ -705,6 +754,8 @@ public class SurveyInformationServiceImpl
e.printStackTrace(); e.printStackTrace();
} }
} }
return surveyInfoAllDto; return surveyInfoAllDto;
} }
......
...@@ -78,6 +78,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -78,6 +78,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
@Autowired @Autowired
PeasantHouseholdMapper peasantHouseholdMapper; PeasantHouseholdMapper peasantHouseholdMapper;
@Autowired @Autowired
HouseholdContractMapper householdContractMapper;
@Autowired
CommerceInfoMapper commerceInfoMapper; CommerceInfoMapper commerceInfoMapper;
@Autowired @Autowired
RegionalCompaniesMapper regionalCompaniesMapper; RegionalCompaniesMapper regionalCompaniesMapper;
...@@ -1079,6 +1081,15 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -1079,6 +1081,15 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
String ids){ String ids){
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
List<PeasantHousehold> list=peasantHouseholdMapper.selectPeasantHouseholdListsg(unitInfoCode,regionalCompaniesSeq,peasantHouseholdNo,ownersName,ids); List<PeasantHousehold> list=peasantHouseholdMapper.selectPeasantHouseholdListsg(unitInfoCode,regionalCompaniesSeq,peasantHouseholdNo,ownersName,ids);
if(list != null && list.size() > 0) {
list.forEach(e -> {
if(e.getPeasantHouseholdNo() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPeasantHouseholdNo()));
}
});
}
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);
......
...@@ -112,4 +112,34 @@ public class WorkFlowService { ...@@ -112,4 +112,34 @@ public class WorkFlowService {
}); });
return workflowResultDtoList; return workflowResultDtoList;
} }
public List<WorkflowResultDto> buildWorkFlowInfos(List<ProcessTaskDTO> processTaskDTOS) {
List<WorkflowResultDto> workflowResultDtoList = new ArrayList<>();
processTaskDTOS.forEach(item -> {
if (null != item.getProcessInstance()){
}
// workflowResultDto.setNextExecutorIds(String.join(",", item.getCandidateGroups()));
if (!CollectionUtils.isEmpty(item.getNextTask())) {
item.getNextTask().forEach(actTaskDTO->{
WorkflowResultDto workflowResultDto = new WorkflowResultDto();
workflowResultDto.setInstanceId(actTaskDTO.getProcessInstanceId());
workflowResultDto.setTaskName(actTaskDTO.getName());
workflowResultDto.setNextTaskId(actTaskDTO.getId());
workflowResultDto.setNextNodeKey(actTaskDTO.getKey()); // 工作流字段还未添加
workflowResultDto.setNextNodeName(actTaskDTO.getName());
List<String> nextGroups = item.getNextCandidateGroups().get(actTaskDTO.getId());
String join = String.join(",", nextGroups);
workflowResultDto.setNextExecutorIds(join);
List<String> nextUserIds = item.getNextTaskExecutor().get(actTaskDTO.getId()).stream().map(AgencyUserModel::getUserId).collect(Collectors.toList());
String nextUserIdsString = String.join(",", nextUserIds);
workflowResultDto.setNextExecuteUserIds(nextUserIdsString);
workflowResultDtoList.add(workflowResultDto);
});
}
});
return workflowResultDtoList;
}
} }
package com.yeejoin.amos.boot.module.hygf.biz.service.impl; 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.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
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;
...@@ -9,16 +12,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -9,16 +12,14 @@ 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.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.hygf.api.Enum.ArrivalStateeEnum; import com.yeejoin.amos.boot.module.hygf.api.Enum.*;
import com.yeejoin.amos.boot.module.hygf.api.Enum.CodeEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.DeliveryStateeEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.WorkOrderEnum;
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.mapper.*; import com.yeejoin.amos.boot.module.hygf.api.mapper.*;
import com.yeejoin.amos.boot.module.hygf.api.service.IHygfWorkOrderStationAuditingService; import com.yeejoin.amos.boot.module.hygf.api.service.IHygfWorkOrderStationAuditingService;
import com.yeejoin.amos.boot.module.hygf.api.service.IWorkOrderService; import com.yeejoin.amos.boot.module.hygf.api.service.IWorkOrderService;
import com.yeejoin.amos.boot.module.hygf.api.util.BeanDtoUtils; import com.yeejoin.amos.boot.module.hygf.api.util.BeanDtoUtils;
import com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseNewUtil;
import com.yeejoin.amos.boot.module.hygf.api.util.NumberUtil; import com.yeejoin.amos.boot.module.hygf.api.util.NumberUtil;
import com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient; import com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO; import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
...@@ -34,6 +35,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -34,6 +35,7 @@ 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.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -108,14 +110,24 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -108,14 +110,24 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
@Autowired @Autowired
ConstructionRecordsMapper constructionRecordsMapper; ConstructionRecordsMapper constructionRecordsMapper;
@Autowired @Autowired
BasicGridAcceptanceMapper basicGridAcceptanceMapper; ConstructionGirdRecordsMapper constructionGirdRecordsMapper;
@Autowired
ConstructionAcceptanceRecordsMapper constructionAcceptanceRecordsMapper;
@Autowired
BasicGridRecordMapper basicGridRecordMapper;
@Autowired
AcceptanceCheckMapper acceptanceCheckMapper;
@Autowired @Autowired
BasicGridAcceptanceServiceImpl basicGridAcceptanceService; BasicGridRecordServiceImpl basicGridRecordService;
@Autowired @Autowired
WorkflowFeignClient workflowFeignClient; WorkflowFeignClient workflowFeignClient;
@Autowired @Autowired
PeasantHouseholdMapper peasantHouseholdMapper; PeasantHouseholdMapper peasantHouseholdMapper;
@Autowired
BasicGridAcceptanceServiceImpl basicGridAcceptanceService;
@Autowired
AcceptanceCheckServiceImpl acceptanceCheckService;
private static final String PROCESSKEY = "ProcessEngineering"; private static final String PROCESSKEY = "ProcessEngineering";
...@@ -365,7 +377,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -365,7 +377,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
hygfWorkOrderStationAuditingDto.setPromoter(RequestContext.getExeUserId()); hygfWorkOrderStationAuditingDto.setPromoter(RequestContext.getExeUserId());
hygfWorkOrderStationAuditingService.createWithModel(hygfWorkOrderStationAuditingDto); hygfWorkOrderStationAuditingService.createWithModel(hygfWorkOrderStationAuditingDto);
}else { }else {
this.wofkflowExcute(workOrderStationAuditing.getInstanceId(),"0","通过"); this.wofkflowExcute(workOrderStationAuditing.getInstanceId(),"0","通过",BusinessWorkflowKey.施工完成提交.getCode());
} }
...@@ -467,13 +479,15 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -467,13 +479,15 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
} }
// 工作流执行一步 // 工作流执行一步
public void wofkflowExcute(String instanceId, String approvalStatus,String comment) { public void wofkflowExcute(String instanceId, String approvalStatus,String comment,String taskKey) {
LambdaQueryWrapper<HygfWorkOrderStationAuditing> query = new LambdaQueryWrapper<>(); LambdaQueryWrapper<HygfWorkOrderStationAuditing> query = new LambdaQueryWrapper<>();
query.eq(HygfWorkOrderStationAuditing::getInstanceId, instanceId); query.eq(HygfWorkOrderStationAuditing::getInstanceId, instanceId);
query.orderByDesc(BaseEntity::getRecDate); query.orderByDesc(BaseEntity::getRecDate);
query.last("limit 1"); query.last("limit 1");
HygfWorkOrderStationAuditing hygfWorkOrderStationAuditing = hygfWorkOrderStationAuditingService.getBaseMapper().selectOne(query); HygfWorkOrderStationAuditing hygfWorkOrderStationAuditing = hygfWorkOrderStationAuditingService.getBaseMapper().selectOne(query);
if (!taskKey.contains(hygfWorkOrderStationAuditing.getNextNodeKey())){
throw new BadRequest("无可执行任务");
}
//组装信息 //组装信息
TaskResultDTO task = new TaskResultDTO(); TaskResultDTO task = new TaskResultDTO();
...@@ -513,6 +527,17 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -513,6 +527,17 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
public Page<WorkOrderPage> queryForwgpage(int pageNum, int pageSize, WorkOrderPage workOrder) { public Page<WorkOrderPage> queryForwgpage(int pageNum, int pageSize, WorkOrderPage workOrder) {
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
List<WorkOrderPage> list = workOrderMapper.queryForwgpage(workOrder); List<WorkOrderPage> list = workOrderMapper.queryForwgpage(workOrder);
if(list != null && list.size() > 0) {
list.forEach(e -> {
if(e.getPeasantHouseholdNo() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPeasantHouseholdNo()));
}
});
}
PageInfo<WorkOrderPage> page = new PageInfo(list); PageInfo<WorkOrderPage> page = new PageInfo(list);
Page<WorkOrderPage> pagenew = new Page<WorkOrderPage>(); Page<WorkOrderPage> pagenew = new Page<WorkOrderPage>();
pagenew.setCurrent(pageNum); pagenew.setCurrent(pageNum);
...@@ -856,17 +881,29 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -856,17 +881,29 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
.setConstructionRegionManagerPhone(workOrder.getConstructionRegionManagerPhone()); .setConstructionRegionManagerPhone(workOrder.getConstructionRegionManagerPhone());
} }
// 并网信息 // 并网信息
LambdaQueryWrapper<HygfOnGrid> up4 = new LambdaQueryWrapper(); LambdaQueryWrapper<HygfOnGrid> up4 = new LambdaQueryWrapper<HygfOnGrid>();
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);
//增加整改单数据
List<HygfRectificationOrder> hygfRectificationOrderList= rectificationOrderService.selectForListBySource(String.valueOf(peasantHousehold.getSequenceNbr()), RectificationOrderEnum.并网.getName());
if (CollectionUtil.isNotEmpty(hygfRectificationOrderList)){
List<HygfRectificationOrder> areaOrders = hygfRectificationOrderList.stream().filter(e -> e.getRectificationSource().equals("bw-area")).collect(Collectors.toList());
List<HygfRectificationOrder> engineeringOrders = hygfRectificationOrderList.stream().filter(e -> e.getRectificationSource().equals("bw-engineering")).collect(Collectors.toList());
List<HygfRectificationOrder> designOrders = hygfRectificationOrderList.stream().filter(e -> e.getRectificationSource().equals("bw-design")).collect(Collectors.toList());
hygfOnGrid.setAreaOrders(areaOrders.size()>0?areaOrders:null);
hygfOnGrid.setEngineeringOrders(engineeringOrders.size()>0?engineeringOrders:null);
hygfOnGrid.setDesignOrders(designOrders.size()>0?designOrders:null);
}
surveyInfoAllDto.setHygfOnGrid(hygfOnGrid != null ? hygfOnGrid : new HygfOnGrid()); surveyInfoAllDto.setHygfOnGrid(hygfOnGrid != null ? hygfOnGrid : new HygfOnGrid());
surveyInfoAllDto.setPowerStationConstructionData(powerStationConstructionData); surveyInfoAllDto.setPowerStationConstructionData(powerStationConstructionData);
surveyInfoAllDto.setPowerStationEngineeringInfo(powerStationEngineeringInfo); surveyInfoAllDto.setPowerStationEngineeringInfo(powerStationEngineeringInfo);
surveyInfoAllDto.setWorkOrder(workOrder); surveyInfoAllDto.setWorkOrder(workOrder);
// 施工自审 // 施工自审操作记录
LambdaQueryWrapper<ConstructionRecords> up5 = new LambdaQueryWrapper(); LambdaQueryWrapper<ConstructionRecords> up5 = new LambdaQueryWrapper<ConstructionRecords>();
up5.eq(ConstructionRecords::getWorkOrderId, workOrderId); up5.eq(ConstructionRecords::getWorkOrderId, workOrderId);
up5.eq(ConstructionRecords::getWorkOrderPowerStationId, workOrderPowerStationId); up5.eq(ConstructionRecords::getWorkOrderPowerStationId, workOrderPowerStationId);
up5.orderByAsc(ConstructionRecords::getRecDate); up5.orderByAsc(ConstructionRecords::getRecDate);
...@@ -875,9 +912,19 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -875,9 +912,19 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
data.setConstructionRecordsList(li); data.setConstructionRecordsList(li);
surveyInfoAllDto.setConstructionRecords(data); surveyInfoAllDto.setConstructionRecords(data);
LambdaQueryWrapper<BasicGridAcceptance> quv = new LambdaQueryWrapper(); LambdaQueryWrapper<BasicGridRecord> quv = new LambdaQueryWrapper<BasicGridRecord>();
quv.eq(BasicGridAcceptance::getPeasantHouseholdId, peasantHouseholdId); quv.eq(BasicGridRecord::getPeasantHouseholdId, peasantHouseholdId);
BasicGridAcceptance basicGridAcceptance = basicGridAcceptanceMapper.selectOne(quv); BasicGridRecord basicGridAcceptance = basicGridRecordMapper.selectOne(quv);
if (Objects.nonNull(basicGridAcceptance)){
LambdaQueryWrapper<ConstructionGirdRecords> up8 = new LambdaQueryWrapper<ConstructionGirdRecords>();
up8.eq(ConstructionGirdRecords::getGridId, basicGridAcceptance.getSequenceNbr());
up8.eq(ConstructionGirdRecords::getWorkOrderPowerStationId, workOrderPowerStationId);
up8.orderByAsc(ConstructionGirdRecords::getRecDate);
List<ConstructionGirdRecords> li2 = constructionGirdRecordsMapper.selectList(up8);
ConstructionGirdRecords constructionGirdRecords = new ConstructionGirdRecords();
constructionGirdRecords.setConstructionRecordsList(li2);
surveyInfoAllDto.setConstructionGirdRecords(constructionGirdRecords);
}
// 审核意见 // 审核意见
if (Objects.nonNull(basicGridAcceptance) && !StringUtils.isEmpty(basicGridAcceptance.getInstanceId())) { if (Objects.nonNull(basicGridAcceptance) && !StringUtils.isEmpty(basicGridAcceptance.getInstanceId())) {
...@@ -914,6 +961,67 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -914,6 +961,67 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
} }
} }
LambdaQueryWrapper<AcceptanceCheck> quv1 = new LambdaQueryWrapper();
quv1.eq(AcceptanceCheck::getPeasantHouseholdId, peasantHouseholdId);
AcceptanceCheck acceptanceCheck = acceptanceCheckMapper.selectOne(quv1);
//增加整改单数据
List<HygfRectificationOrder> hygfRectificationOrderListYs= rectificationOrderService.selectForListBySource(String.valueOf(peasantHousehold.getSequenceNbr()), RectificationOrderEnum.验收.getName());
if (CollectionUtil.isNotEmpty(hygfRectificationOrderListYs)){
List<HygfRectificationOrder> areaOrders = hygfRectificationOrderListYs.stream().filter(e -> e.getRectificationSource().equals("ys-area")).collect(Collectors.toList());
List<HygfRectificationOrder> financeOrders = hygfRectificationOrderListYs.stream().filter(e -> e.getRectificationSource().equals("ys-tourong")).collect(Collectors.toList());
List<HygfRectificationOrder> legalOrders = hygfRectificationOrderListYs.stream().filter(e -> e.getRectificationSource().equals("ys-fawu")).collect(Collectors.toList());
List<HygfRectificationOrder> propertyOrders = hygfRectificationOrderListYs.stream().filter(e -> e.getRectificationSource().equals("ys-zichan")).collect(Collectors.toList());
acceptanceCheck.setAreaOrders(areaOrders.size()>0?areaOrders:null);
acceptanceCheck.setFinanceOrders(financeOrders.size()>0?financeOrders:null);
acceptanceCheck.setLegalOrders(legalOrders.size()>0?legalOrders:null);
acceptanceCheck.setPropertyOrders(propertyOrders.size()>0?propertyOrders:null);
}
if (Objects.nonNull(acceptanceCheck)){
LambdaQueryWrapper<ConstructionAcceptanceRecords> up7 = new LambdaQueryWrapper<ConstructionAcceptanceRecords>();
up7.eq(ConstructionAcceptanceRecords::getAcceptanceId, acceptanceCheck.getSequenceNbr());
up7.eq(ConstructionAcceptanceRecords::getWorkOrderPowerStationId, workOrderPowerStationId);
up7.orderByAsc(ConstructionAcceptanceRecords::getRecDate);
List<ConstructionAcceptanceRecords> li1 = constructionAcceptanceRecordsMapper.selectList(up7);
ConstructionAcceptanceRecords constructionAcceptanceRecords = new ConstructionAcceptanceRecords();
constructionAcceptanceRecords.setConstructionRecordsList(li1);
surveyInfoAllDto.setAcceptanceRecords(constructionAcceptanceRecords);
}
surveyInfoAllDto.setAcceptanceCheck(acceptanceCheck);
// 审核意见
if (Objects.nonNull(acceptanceCheck) && !StringUtils.isEmpty(acceptanceCheck.getInstanceId())) {
try {
Map<String, Object> flowLogMap = workflowFeignClient
.getFlowLogger(acceptanceCheck.getInstanceId()).getResult();
List<LinkedHashMap> flowLogger1 = (List<LinkedHashMap>) flowLogMap.get("flowLogger");
if (flowLogger1.size() > 0) {
Collections.reverse(flowLogger1);
}
List<LinkedHashMap> flowLoggernew1 = new ArrayList<>();
for (LinkedHashMap linkedHashMap : flowLogger1) {
if (linkedHashMap.get("operateDate") != null
&& !linkedHashMap.get("operateDate").toString().isEmpty()) {
LinkedHashMap linke = new LinkedHashMap();
linke.put("approvalStatue", linkedHashMap.get("approvalStatue").toString());
// 审核意见
List<LinkedHashMap> approvalSuggestion = (List<LinkedHashMap>) linkedHashMap
.get("approvalSuggestion");
if (approvalSuggestion != null && !approvalSuggestion.isEmpty()) {
linke.put("approvalSuggestion", approvalSuggestion.get(0).get("message"));
}
linke.put("taskName", linkedHashMap.get("taskName").toString());
linke.put("operator", linkedHashMap.get("operator").toString());
linke.put("operateDate", linkedHashMap.get("operateDate").toString());
flowLoggernew1.add(linke);
}
}
LoggerDto loggerDto1 = new LoggerDto();
loggerDto1.setLogger(flowLoggernew1);
surveyInfoAllDto.setLoggerYsDto(loggerDto1);
} catch (Exception e) {
e.printStackTrace();
}
}
return surveyInfoAllDto; return surveyInfoAllDto;
// LambdaQueryWrapper<PeasantHousehold> peasantHouseholdWrapper = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<PeasantHousehold> peasantHouseholdWrapper = new LambdaQueryWrapper<>();
// peasantHouseholdWrapper.eq(PeasantHousehold::getSequenceNbr, peasantHouseholdId); // peasantHouseholdWrapper.eq(PeasantHousehold::getSequenceNbr, peasantHouseholdId);
...@@ -996,7 +1104,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -996,7 +1104,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
HygfWorkOrderStationAuditing workOrderStationAuditing = hygfWorkOrderStationAuditingService.getBaseMapper().selectOne(audit); HygfWorkOrderStationAuditing workOrderStationAuditing = hygfWorkOrderStationAuditingService.getBaseMapper().selectOne(audit);
//兼容历史数据 //兼容历史数据
if(!Objects.isNull(workOrderStationAuditing )){ if(!Objects.isNull(workOrderStationAuditing )){
this.wofkflowExcute(workOrderStationAuditing.getInstanceId(), "0", "通过"); this.wofkflowExcute(workOrderStationAuditing.getInstanceId(), "0", "通过",BusinessWorkflowKey.完工登记.getCode());
} }
...@@ -1142,7 +1250,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -1142,7 +1250,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
if(!Objects.isNull(workOrderStationAuditing)){ if(!Objects.isNull(workOrderStationAuditing)){
this.wofkflowExcute(workOrderStationAuditing.getInstanceId(), this.wofkflowExcute(workOrderStationAuditing.getInstanceId(),
constructionRecords.getOperationResults().equals("通过")?"0":"1", constructionRecords.getOperationResults().equals("通过")?"0":"1",
constructionRecords.getOperationResults()); constructionRecords.getOperationResults(),BusinessWorkflowKey.完工自审.getCode());
} }
...@@ -1165,7 +1273,8 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -1165,7 +1273,8 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
audit.eq(HygfWorkOrderStationAuditing::getWorkOrderPowerStationId, powerStationId); audit.eq(HygfWorkOrderStationAuditing::getWorkOrderPowerStationId, powerStationId);
audit.last("limit 1"); audit.last("limit 1");
HygfWorkOrderStationAuditing workOrderStationAuditing = hygfWorkOrderStationAuditingService.getBaseMapper().selectOne(audit); HygfWorkOrderStationAuditing workOrderStationAuditing = hygfWorkOrderStationAuditingService.getBaseMapper().selectOne(audit);
this.wofkflowExcute(workOrderStationAuditing.getInstanceId(), approvalStatus , comment );
String taskKey = "";
LambdaQueryWrapper<WorkOrderPowerStation> qu = new LambdaQueryWrapper(); LambdaQueryWrapper<WorkOrderPowerStation> qu = new LambdaQueryWrapper();
qu.eq(WorkOrderPowerStation::getSequenceNbr, powerStationId); qu.eq(WorkOrderPowerStation::getSequenceNbr, powerStationId);
...@@ -1177,20 +1286,24 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -1177,20 +1286,24 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
constructionRecords.setOperationContent("施工验收-片区运营审核-" +workOrderPowerStation.getPowerStationAreaStatus()); constructionRecords.setOperationContent("施工验收-片区运营审核-" +workOrderPowerStation.getPowerStationAreaStatus());
workOrderPowerStation.setWorkOrderPowerStationNode(WorkOrderEnum.工程待审核.getCode()); workOrderPowerStation.setWorkOrderPowerStationNode(WorkOrderEnum.工程待审核.getCode());
workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.待审核.getName()); workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.待审核.getName());
taskKey = BusinessWorkflowKey.片区运营审核.getCode();
break; break;
case "design": case "design":
workOrderPowerStation.setPowerStationDesignStatus(approvalStatus.equals("0")?"通过":"驳回"); workOrderPowerStation.setPowerStationDesignStatus(approvalStatus.equals("0")?"通过":"驳回");
constructionRecords.setOperationContent("施工验收-设计审核-" + workOrderPowerStation.getPowerStationDesignStatus()); constructionRecords.setOperationContent("施工验收-设计审核-" + workOrderPowerStation.getPowerStationDesignStatus());
workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.已完工.getCode()); workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.已完工.getCode());
workOrderPowerStation.setWorkOrderPowerStationNode(WorkOrderEnum.全部节点.getCode()); workOrderPowerStation.setWorkOrderPowerStationNode(WorkOrderEnum.全部节点.getCode());
taskKey = BusinessWorkflowKey.设计审核.getCode();
break; break;
default: default:
workOrderPowerStation.setPowerStationEngineeringStatus(approvalStatus.equals("0")?"通过":"驳回"); workOrderPowerStation.setPowerStationEngineeringStatus(approvalStatus.equals("0")?"通过":"驳回");
constructionRecords.setOperationContent("施工验收-工程审核-" + workOrderPowerStation.getPowerStationEngineeringStatus()); constructionRecords.setOperationContent("施工验收-工程审核-" + workOrderPowerStation.getPowerStationEngineeringStatus());
workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.待审核.getName()); workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.待审核.getName());
workOrderPowerStation.setWorkOrderPowerStationNode(WorkOrderEnum.设计待审核.getCode()); workOrderPowerStation.setWorkOrderPowerStationNode(WorkOrderEnum.设计待审核.getCode());
taskKey = BusinessWorkflowKey.工程审核.getCode();
break; break;
} }
this.wofkflowExcute(workOrderStationAuditing.getInstanceId(), approvalStatus , comment ,taskKey );
//若驳回则修改施工场站状态为未通过 上述switch作通过状态的统一处理 且节点恢复为null //若驳回则修改施工场站状态为未通过 上述switch作通过状态的统一处理 且节点恢复为null
if (approvalStatus.equals("1")){ if (approvalStatus.equals("1")){
workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.未通过.getCode()); workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.未通过.getCode());
...@@ -1229,7 +1342,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -1229,7 +1342,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
upq1.set(PowerStationEngineeringInfo::getCompletionDate, new Date()); upq1.set(PowerStationEngineeringInfo::getCompletionDate, new Date());
powerStationEngineeringInfoMapper.update(null, upq1); powerStationEngineeringInfoMapper.update(null, upq1);
BasicGridAcceptance dat = new BasicGridAcceptance(); BasicGridRecord dat = new BasicGridRecord();
dat.setWorkOrderId(workOrderPowerStation.getWorkOrderId()); dat.setWorkOrderId(workOrderPowerStation.getWorkOrderId());
dat.setWorkOrderPowerStationId(workOrderPowerStation.getSequenceNbr()); dat.setWorkOrderPowerStationId(workOrderPowerStation.getSequenceNbr());
dat.setPeasantHouseholdId(workOrderPowerStation.getPeasantHouseholdId()); dat.setPeasantHouseholdId(workOrderPowerStation.getPeasantHouseholdId());
...@@ -1243,7 +1356,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -1243,7 +1356,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
// if (b == null) { // if (b == null) {
// basicGridAcceptanceMapper.insert(dat); // basicGridAcceptanceMapper.insert(dat);
// } // }
basicGridAcceptanceService.saveOrUpdate(dat,new LambdaQueryWrapper<BasicGridAcceptance>().eq(BasicGridAcceptance::getPeasantHouseholdId,workOrderPowerStation.getPeasantHouseholdId())); basicGridRecordService.saveOrUpdate(dat,new LambdaQueryWrapper<BasicGridRecord>().eq(BasicGridRecord::getPeasantHouseholdId,workOrderPowerStation.getPeasantHouseholdId()));
// 修改派工单状态 // 修改派工单状态
LambdaQueryWrapper<WorkOrderPowerStation> qu1 = new LambdaQueryWrapper(); LambdaQueryWrapper<WorkOrderPowerStation> qu1 = new LambdaQueryWrapper();
qu1.eq(WorkOrderPowerStation::getWorkOrderId, workOrderPowerStation.getWorkOrderId()); qu1.eq(WorkOrderPowerStation::getWorkOrderId, workOrderPowerStation.getWorkOrderId());
...@@ -1278,9 +1391,36 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -1278,9 +1391,36 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
public void addRectification(HygfRectificationOrder hygfRectificationOrder) { public ResponseModel addRectification(HygfRectificationOrder hygfRectificationOrder) {
rectificationOrderAuditingService.addRectification(hygfRectificationOrder); rectificationOrderAuditingService.addRectification(hygfRectificationOrder);
String addorSubmit = hygfRectificationOrder.getAddorSubmit(); String addorSubmit = hygfRectificationOrder.getAddorSubmit();
if (hygfRectificationOrder.getAddorSubmit().equals("0") && Objects.isNull(hygfRectificationOrder.getRectificationIdea())){
return CommonResponseNewUtil.failureMessage("整改类型及整改项不可为空");
}
if (hygfRectificationOrder.getAddorSubmit().equals("0") && !Objects.isNull(hygfRectificationOrder.getRectificationIdea())){
List<Object> rectificationIdea = hygfRectificationOrder.getRectificationIdea();
for (Object item : rectificationIdea) {
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(item));
Collection<Object> values = jsonObject.values();
if (values.size() < 2){
return CommonResponseNewUtil.failureMessage("整改类型及整改项不可为空");
}
if (jsonObject.containsKey("type")){
if (null == jsonObject.get("type")){
return CommonResponseNewUtil.failureMessage("整改类型及整改项不可为空");
}
}
if (jsonObject.containsKey("items")){
JSONArray item1 = jsonObject.getJSONArray("items");
for (Object o : item1) {
if (!JSON.parseObject(JSON.toJSONString(o)).containsKey("value")){
return CommonResponseNewUtil.failureMessage("整改类型及整改项不可为空");
}
}
}
}
}
//修改电站状态 //修改电站状态
if (addorSubmit.equals("0")){ if (addorSubmit.equals("0")){
LambdaUpdateWrapper<WorkOrderPowerStation> qu = new LambdaUpdateWrapper(); LambdaUpdateWrapper<WorkOrderPowerStation> qu = new LambdaUpdateWrapper();
...@@ -1289,7 +1429,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -1289,7 +1429,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
workOrderPowerStationMapper.update(null,qu); workOrderPowerStationMapper.update(null,qu);
} }
return CommonResponseNewUtil.success();
} }
...@@ -1344,17 +1484,34 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -1344,17 +1484,34 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void updateDetail(PowerStationEngineeringInfoAllDto powerStationEngineeringInfoAllDto,String userId) { public void updateDetail(PowerStationEngineeringInfoAllDto powerStationEngineeringInfoAllDto,String realName) {
//更新工程
PowerStationEngineeringInfo powerStationEngineeringInfo = powerStationEngineeringInfoAllDto.getPowerStationEngineeringInfo();
if(Objects.nonNull(powerStationEngineeringInfo)){
powerStationEngineeringInfoMapper.updateById(powerStationEngineeringInfo);
}
//更新施工信息 //更新施工信息
PowerStationConstructionData powerStationConstructionData = powerStationEngineeringInfoAllDto.getPowerStationConstructionData(); PowerStationConstructionData powerStationConstructionData = powerStationEngineeringInfoAllDto.getPowerStationConstructionData();
if(Objects.nonNull(powerStationConstructionData)){ if(Objects.nonNull(powerStationConstructionData)){
powerStationConstructionDataMapper.updateById(powerStationConstructionData); powerStationConstructionDataMapper.updateById(powerStationConstructionData);
} }
//更新工程
PowerStationEngineeringInfo powerStationEngineeringInfo = powerStationEngineeringInfoAllDto.getPowerStationEngineeringInfo();
if(Objects.nonNull(powerStationEngineeringInfo)){
powerStationEngineeringInfoMapper.updateById(powerStationEngineeringInfo);
//更新施工组件信息
LambdaUpdateWrapper<PowerStationConstructionData> powerStationConstructionDataWrapper = new LambdaUpdateWrapper<>();
powerStationConstructionDataWrapper.set(PowerStationConstructionData::getConstructionComponentInfo, JSONArray.toJSONString(powerStationEngineeringInfo.getConstructionComponentInfo()));
powerStationConstructionDataWrapper.set(PowerStationConstructionData::getConstructionInverterInfo,JSONArray.toJSONString(powerStationEngineeringInfo.getConstructionInverterInfo()));
powerStationConstructionDataWrapper.set(PowerStationConstructionData::getConstructionCollectorBoxInfo,JSONArray.toJSONString(powerStationEngineeringInfo.getConstructionCollectorBoxInfo()));
powerStationConstructionDataWrapper.set(PowerStationConstructionData::getConstructionGridBoxInfo,JSONArray.toJSONString(powerStationEngineeringInfo.getConstructionGridBoxInfo()));
powerStationConstructionDataWrapper.eq(PowerStationConstructionData::getWorkOrderId, powerStationEngineeringInfo.getWorkOrderId());
powerStationConstructionDataWrapper.eq(PowerStationConstructionData::getWorkOrderPowerStationId, powerStationEngineeringInfo.getWorkOrderPowerStationId());
powerStationConstructionDataMapper.update(null,powerStationConstructionDataWrapper);
//更新工程负责人
LambdaUpdateWrapper<WorkOrder> upl = new LambdaUpdateWrapper();
upl.set(WorkOrder::getProjectRegionManager, powerStationEngineeringInfo.getProjectRegionManager());
upl.set(WorkOrder::getProjectRegionManagerPhone, powerStationEngineeringInfo.getProjectRegionManagerPhone());
upl.set(WorkOrder::getConstructionRegionManager, powerStationEngineeringInfo.getConstructionRegionManager());
upl.set(WorkOrder::getConstructionRegionManagerPhone, powerStationEngineeringInfo.getConstructionRegionManagerPhone());
upl.eq(WorkOrder::getSequenceNbr, powerStationEngineeringInfo.getWorkOrderId());
workOrderMapper.update(null,upl);
}
//更新并网信息 //更新并网信息
HygfOnGrid hygfOnGrid = powerStationEngineeringInfoAllDto.getHygfOnGrid(); HygfOnGrid hygfOnGrid = powerStationEngineeringInfoAllDto.getHygfOnGrid();
if(Objects.nonNull(hygfOnGrid)){ if(Objects.nonNull(hygfOnGrid)){
...@@ -1370,10 +1527,31 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -1370,10 +1527,31 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
if(Objects.nonNull(commercial)){ if(Objects.nonNull(commercial)){
commercialService.updateWithModel(commercial); commercialService.updateWithModel(commercial);
} }
if(Objects.isNull(powerStationEngineeringInfoAllDto.getCommitFlag())){
throw new BadRequest("保存标识为空");
}
if(Objects.isNull(powerStationEngineeringInfoAllDto.getFlowType())){
throw new BadRequest("流程标识为空");
}
//提交 //提交
if(powerStationEngineeringInfoAllDto.getCommitFlag() == 1 && Objects.nonNull(hygfOnGrid)){ if(powerStationEngineeringInfoAllDto.getCommitFlag() == 1){
hygfOnGrid.setType("1"); //提交并网
basicGridAcceptanceService.saveAndCommit(hygfOnGrid,userId); if(Objects.nonNull(hygfOnGrid) && powerStationEngineeringInfoAllDto.getFlowType() == 0) {
hygfOnGrid.setType("1");
basicGridAcceptanceService.saveAndCommit(hygfOnGrid,realName);
}
//提交验收
AcceptanceCheck acceptanceCheck = powerStationEngineeringInfoAllDto.getAcceptanceCheck();
if(powerStationEngineeringInfoAllDto.getFlowType() == 1 && Objects.nonNull(acceptanceCheck)) {
Map<String,Object> model =new HashMap<>();
model.put("type","1");
model.put("sequenceNbr",acceptanceCheck.getSequenceNbr());
model.put("realName",realName);
acceptanceCheckService.saveAndCommit(model);
}
} }
} }
} }
\ No newline at end of file
...@@ -2,9 +2,9 @@ exception.debug=true ...@@ -2,9 +2,9 @@ exception.debug=true
## DB properties: ## DB properties:
spring.datasource.dynamic.primary= mysql-service spring.datasource.dynamic.primary= mysql-service
spring.datasource.mysql-service.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.mysql-service.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.mysql-service.jdbc-url=jdbc:mysql://47.92.234.253:3306/amos_project?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8 spring.datasource.mysql-service.jdbc-url=jdbc:mysql://47.92.234.253:13306/amos_project?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.mysql-service.username=root spring.datasource.mysql-service.username=root
spring.datasource.mysql-service.password=Yeejoin@2020 spring.datasource.mysql-service.password=Yeejoin_1234
spring.datasource.mysql-service.type=com.zaxxer.hikari.HikariDataSource spring.datasource.mysql-service.type=com.zaxxer.hikari.HikariDataSource
#最小连接 #最小连接
spring.datasource.mysql-service.minimum-idle: 5 spring.datasource.mysql-service.minimum-idle: 5
...@@ -93,7 +93,7 @@ emqx.clean-session=true ...@@ -93,7 +93,7 @@ emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]} emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://47.92.234.253:1883 emqx.broker=tcp://47.92.234.253:1883
emqx.user-name=admin emqx.user-name=admin
emqx.password=public emqx.password=Yeejoin@1234
emqx.max-inflight=1000 emqx.max-inflight=1000
......
...@@ -249,6 +249,7 @@ spring.elasticsearch.rest.password=123456 ...@@ -249,6 +249,7 @@ spring.elasticsearch.rest.password=123456
spring.elasticsearch.rest.read-timeout=30000 spring.elasticsearch.rest.read-timeout=30000
## 聚富通工行 测试环境配置 ## 聚富通工行 测试环境配置
## 聚富通工行 测试环境配置
hygf.icbc.callbackUrl=https://yth.yunqingtech.com/hygf/icbc/notify hygf.icbc.callbackUrl=https://yth.yunqingtech.com/hygf/icbc/notify
hygf.icbc.appId=11000000000000009254 hygf.icbc.appId=11000000000000009254
hygf.icbc.corpNo=10000000000000088011 hygf.icbc.corpNo=10000000000000088011
...@@ -261,6 +262,7 @@ hygf.icbc.apigwPublicKey=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwFgHD4kzEVPdOj03 ...@@ -261,6 +262,7 @@ hygf.icbc.apigwPublicKey=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwFgHD4kzEVPdOj03
hygf.icbc.outVendorId=071301 hygf.icbc.outVendorId=071301
hygf.icbc.projectId=PJ14001401B000160171 hygf.icbc.projectId=PJ14001401B000160171
## 聚富通工行 生产环境配置 ## 聚富通工行 生产环境配置
#hygf.icbc.appId=11000000000000028870 #hygf.icbc.appId=11000000000000028870
#hygf.icbc.corpNo=020240710000001169 #hygf.icbc.corpNo=020240710000001169
......
spring.application.name=AMOS-HYGF-YY spring.application.name=AMOS-HYGF-CZ
server.servlet.context-path=/hygf server.servlet.context-path=/hygf
server.port=33330 server.port=33330
server.uri-encoding=UTF-8 server.uri-encoding=UTF-8
spring.profiles.active=kingbase8 spring.profiles.active=dev
spring.jackson.time-zone=GMT+8 spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
logging.config=classpath:logback-${spring.profiles.active}.xml logging.config=classpath:logback-${spring.profiles.active}.xml
...@@ -31,7 +31,7 @@ spring.liquibase.enabled=true ...@@ -31,7 +31,7 @@ spring.liquibase.enabled=true
## eureka properties: ## eureka properties:
eureka.instance.prefer-ip-address=true eureka.instance.prefer-ip-address=true
eureka.instance.ip-address=172.26.190.244 eureka.instance.ip-address=172.16.3.6
eureka.client.registry-fetch-interval-seconds=5 eureka.client.registry-fetch-interval-seconds=5
eureka.instance.health-check-url-path=/actuator/health eureka.instance.health-check-url-path=/actuator/health
eureka.instance.lease-expiration-duration-in-seconds=10 eureka.instance.lease-expiration-duration-in-seconds=10
...@@ -75,10 +75,15 @@ dealer.amosDealerId=1767820997374775298 ...@@ -75,10 +75,15 @@ dealer.amosDealerId=1767820997374775298
admin.engineering.roleId=1702512052154687489 admin.engineering.roleId=1702512052154687489
admin.area.roleId=1822904567478620161 admin.area.roleId=1822904567478620161
admin.design.roleId=1702511991735738370 admin.design.roleId=1702511991735738370
admin.tourong.roleId=1702511733832179714
admin.fawu.roleId=1702511782167339010
admin.zichan.roleId=1827897297053159426
admin.deveEngineering.roleId=1702550832882413570 admin.deveEngineering.roleId=1702550832882413570
admin.delerAdmin.roleId=1702512164058718210
admin.delerKaId.roleId=1702551022574006274
exception.debug=true
feign.okhttp.enabled= true feign.okhttp.enabled= true
workflow.feign.name=AMOS-API-WORKFLOW workflow.feign.name=AMOS-API-WORKFLOW-CZ
...@@ -65,14 +65,14 @@ emqx.clean-session=true ...@@ -65,14 +65,14 @@ emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]} emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://10.20.1.210:2883 emqx.broker=tcp://10.20.1.210:2883
emqx.user-name=admin emqx.user-name=admin
emqx.password=public emqx.password=Yeejoin@2020
mqtt.scene.host=mqtt://10.20.1.210:8083/mqtt mqtt.scene.host=mqtt://10.20.1.210:8083/mqtt
mqtt.client.product.id=mqtt mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt mqtt.topic=topic_mqtt
spring.mqtt.completionTimeout=3000 spring.mqtt.completionTimeout=3000
emqx.max-inflight=1000 emqx.max-inflight=1000
emqx.client-user-name=admin emqx.client-user-name=admin
emqx.client-password=public emqx.client-password=Yeejoin@2020
## influxDB ## influxDB
#spring.influx.url= http://172.16.3.155:18186 #spring.influx.url= http://172.16.3.155:18186
......
...@@ -70,7 +70,7 @@ emqx.client-user-name= ...@@ -70,7 +70,7 @@ emqx.client-user-name=
emqx.client-password= emqx.client-password=
emqx.broker=tcp://10.20.1.210:2883 emqx.broker=tcp://10.20.1.210:2883
emqx.user-name=admin emqx.user-name=admin
emqx.password=public emqx.password=Yeejoin@2020
mqtt.scene.host=mqtt://10.20.1.210:8083/mqtt mqtt.scene.host=mqtt://10.20.1.210:8083/mqtt
mqtt.client.product.id=mqtt mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt mqtt.topic=topic_mqtt
......
...@@ -35,6 +35,11 @@ ...@@ -35,6 +35,11 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId> <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency> </dependency>
......
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