Commit 968c2a7d authored by tangwei's avatar tangwei

解决冲突

parents 3c912d3b e74cf60d
package com.yeejoin.amos.boot.module.hygf.api.Enum;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 节点信息
* @author DELL
*/
@Getter
@AllArgsConstructor
public enum PowerStationNodeEnum {
经销商审核("经销商审核", "0"),
设计审核("设计审核", "1"),
投融审核("投融审核", "2"),
法务审核("法务审核", "3"),
设计上传图纸("设计上传图纸", "4"),
经销商上传图纸("经销商上传图纸", "5"),
文件审核("文件审核", "6");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
public static PowerStationNodeEnum getNodeByCode(String code) {
PowerStationNodeEnum powerStationNodeEnum = null;
for(PowerStationNodeEnum type: PowerStationNodeEnum.values()) {
if (type.getCode().equals(code)) {
powerStationNodeEnum = type;
break;
}
}
return powerStationNodeEnum;
}
}
package com.yeejoin.amos.boot.module.hygf.api.Enum;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 电站审核状态
* @author DELL
*/
@Getter
@AllArgsConstructor
public enum PowerStationProcessStateEnum {
进行中("进行中", "0", "progress"),
通过("通过", "1", "yes"),
不通过("不通过", "2", "no"),
完成("完成", "3", "complete"),
作废("作废", "4", "reject");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
/**
* 编码
*/
private String describe;
public static PowerStationProcessStateEnum getStateByResult(String code) {
PowerStationProcessStateEnum powerStationProcessStateEnum = null;
for(PowerStationProcessStateEnum type: PowerStationProcessStateEnum.values()) {
if (type.getDescribe().equals(code)) {
powerStationProcessStateEnum = type;
break;
}
}
return powerStationProcessStateEnum;
}
}
......@@ -109,4 +109,10 @@ public class PowerStation extends BaseEntity {
@TableField("node_role")
private String nodeRole;
/**
* 当前流程节点
*/
@TableField("next_process_node")
private String nextProcessNode;
}
package com.yeejoin.amos.boot.module.hygf.api.fegin;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.feign.FeignConfiguration;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Map;
......@@ -27,4 +25,10 @@ public interface IdxFeginService {
@RequestParam(value = "tableName", required = false) String tableName,
@RequestBody Map<String, Object> kv) throws Exception;
/**
*通用表单提交 数据填报
*/
@RequestMapping(value = "/report/form/getRecordData/{id}", method = RequestMethod.GET)
FeignClientResult<JSONObject> getRecord(@PathVariable("id") String id);
}
......@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.hygf.api.service;
import com.yeejoin.amos.boot.module.hygf.api.entity.PowerStation;
import java.util.Map;
/**
* 接口类
*
......@@ -18,4 +20,24 @@ public interface IPowerStationService {
*/
boolean savePowerStation(PowerStation powerStation);
/**
* 根据农户id和流程状态获取实例
* @param id 农户id
* @param state 流程状态
* @return 电站实例
*/
PowerStation getObjByNhId(String id, String state);
/**
* 电站审核接口
* @param pageId 表单id
* @param nodeCode 执行节点code
* @param stationId 电站审核记录id
* @param taskId 任务id
* @param planInstanceId 实例id
* @param kv 表单数据
* @return idx表id
*/
String powerStationExamine(long pageId, String nodeCode, String stationId, String taskId, String planInstanceId, Map<String, Object> kv);
}
......@@ -9,6 +9,8 @@ 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 java.util.Map;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -113,4 +115,21 @@ public class PowerStationController extends BaseController {
public ResponseModel<List<PowerStationDto>> selectForList() {
return ResponseHelper.buildResponse(powerStationServiceImpl.queryForPowerStationList());
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST",value = "电站审核", notes = "电站审核")
@PostMapping(value = "/powerStationExamine")
public ResponseModel<String> powerStationExamine(@RequestParam(value = "pageId") long pageId,
@RequestParam(value = "nodeCode") String nodeCode,
@RequestParam(value = "stationId") String stationId,
@RequestParam(value = "taskId") String taskId,
@RequestParam(value = "planInstanceId") String planInstanceId,
@RequestBody Map<String, Object> kv) {
return ResponseHelper.buildResponse(powerStationServiceImpl.powerStationExamine(pageId, nodeCode, stationId, taskId, planInstanceId, kv));
}
}
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationNodeEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationProcessStateEnum;
import com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.PowerStation;
import com.yeejoin.amos.boot.module.hygf.api.fegin.IdxFeginService;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PowerStationMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IPowerStationService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
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;
import java.util.Map;
/**
* 服务实现类
......@@ -16,7 +24,20 @@ import java.util.List;
* @date 2023-07-15
*/
@Service
@Slf4j
public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerStation, PowerStationMapper> implements IPowerStationService {
@Autowired
IdxFeginService idxFeginService;
@Autowired
IPowerStationService powerStationService;
private static final String IDX_REQUEST_STATE="200";
private static final String VERIFY_RESULT_YES="yes";
private static final String VERIFY_RESULT_NO="no";
/**
* 分页查询
*/
......@@ -34,6 +55,65 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
@Override
public boolean savePowerStation(PowerStation powerStation) {
return this.save(powerStation);
return this.saveOrUpdate(powerStation);
}
@Override
public PowerStation getObjByNhId(String id, String state) {
LambdaQueryWrapper<PowerStation> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PowerStation::getProcessStatus, state);
wrapper.eq(PowerStation::getPeasantHouseholdId, id);
return this.baseMapper.selectOne(wrapper);
}
@Override
public String powerStationExamine(long pageId, String nodeCode, String stationId, String taskId, String planInstanceId, Map<String, Object> kv) {
// 1. 业务相关数据落表
PowerStation powerStation = this.baseMapper.selectById(stationId);
PowerStationNodeEnum nodeByCode = PowerStationNodeEnum.getNodeByCode(nodeCode);
if (PowerStationNodeEnum.设计上传图纸.getCode().equals(nodeCode)) {
} else if (PowerStationNodeEnum.经销商上传图纸.getCode().equals(nodeCode)) {
} else {
String result = String.valueOf(kv.get("VERIFY_RESULT"));
if (VERIFY_RESULT_NO.equals(result)) {
powerStation.setProcessStatus(PowerStationProcessStateEnum.不通过.getName());
}
PowerStationProcessStateEnum resultObj = PowerStationProcessStateEnum.getStateByResult(result);
switch (nodeByCode) {
case 设计审核:
powerStation.setTechnologyStatus(resultObj.getName());
break;
case 投融审核:
powerStation.setDesignStatus(resultObj.getName());
break;
case 法务审核:
powerStation.setBusinessStatus(resultObj.getName());
break;
case 文件审核:
if (VERIFY_RESULT_YES.equals(result)) {
powerStation.setProcessStatus(PowerStationProcessStateEnum.完成.getName());
}
break;
default:
break;
}
}
// 2. 更新流程状态
String code = null;
try{
// 3. 工作流执行
FeignClientResult<String> submit = idxFeginService.submit(pageId, taskId, planInstanceId, null, null, null, kv);
if (IDX_REQUEST_STATE.equals(String.valueOf(submit.getStatus()))) {
code = submit.getResult();
log.info("流程执行成功:{}", code);
powerStationService.savePowerStation(powerStation);
}
}catch (Exception e){
log.error("工作流执行失败:{}", e.getMessage());
}
return code;
}
}
\ No newline at end of file
......@@ -2,9 +2,11 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
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.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationProcessStateEnum;
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.fegin.IdxFeginService;
......@@ -20,9 +22,11 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -67,6 +71,12 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
@Autowired
IPowerStationService powerStationService;
@Value("${power.station.examine.pageId}")
private long pageId;
@Value("${power.station.examine.planId}")
private String planId;
private static final String regionRedis="app_region_redis";
private static final String OPERATION_TYPE_SUBMIT="submit";
private static final String OPERATION_TYPE_APPLY="apply";
......@@ -167,30 +177,55 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
if(OPERATION_TYPE_SUBMIT.equals(operationType)){
peasantHousehold.setSurveyOrNot(1);
}else if(OPERATION_TYPE_APPLY.equals(operationType)){
Map<String, Object> objectMap = new HashMap<>();
// 提交审核
submitExamine(peasantHousehold);
}
peasantHouseholdServiceImpl.saveOrUpdate(peasantHousehold);
return surveyInfoAllDto;
}
private void submitExamine(PeasantHousehold peasantHousehold) {
PowerStation powerStation = powerStationService.getObjByNhId(String.valueOf(peasantHousehold.getSequenceNbr()), PowerStationProcessStateEnum.进行中.getCode());
String taskId = null;
Map<String, Object> objectMap = new HashMap<>();
if (ObjectUtils.isNotEmpty(powerStation)) {
// 工作流执行一步
taskId = powerStation.getTaskId();
objectMap.put("approveStatus", "yes");
} else {
// 第一步启动工作流
objectMap.put("approveStatus", "yes");
// 保存并审核
try {
FeignClientResult<String> submit = idxFeginService.submit(1679778420550037506L, null, "c4ed1873-0dc6-4518-a7a9-dbc588ef35e5", null, null, null, objectMap);
if (IDX_REQUEST_STATE.equals(String.valueOf(submit.getStatus()))) {
String code = submit.getResult();
peasantHousehold.setSurveyOrNot(2);
peasantHousehold.setReview(1);
// 插入记录表
PowerStation powerStationDto = new PowerStation();
powerStationDto.setPowerStationCode(peasantHousehold.getPeasantHouseholdNo());
powerStationDto.setOwnersName(peasantHousehold.getOwnersName());
powerStationDto.setProjectAddress(peasantHousehold.getProjectAddressName());
powerStationDto.setProcessStatus("进行中");
powerStationService.savePowerStation(powerStationDto);
log.info("启动流程成功:{}", code);
powerStation = new PowerStation();
}
// 保存并审核
try {
FeignClientResult<String> submit = idxFeginService.submit(pageId, taskId, planId, null, null, null, objectMap);
if (IDX_REQUEST_STATE.equals(String.valueOf(submit.getStatus()))) {
peasantHousehold.setSurveyOrNot(2);
peasantHousehold.setReview(1);
String code = submit.getResult();
// 插入记录表
powerStation.setPowerStationCode(peasantHousehold.getPeasantHouseholdNo());
powerStation.setOwnersName(peasantHousehold.getOwnersName());
powerStation.setProjectAddress(peasantHousehold.getProjectAddressName());
powerStation.setPeasantHouseholdId(String.valueOf(peasantHousehold.getSequenceNbr()));
powerStation.setProcessStatus(PowerStationProcessStateEnum.进行中.getCode());
log.info("流程执行成功:{}", code);
// 获取流程信息
FeignClientResult<JSONObject> record = idxFeginService.getRecord(code);
if (IDX_REQUEST_STATE.equals(String.valueOf(record.getStatus()))) {
JSONObject resultObj = record.getResult();
String taskIdNew = String.valueOf(resultObj.get("taskId"));
String processInstanceId = String.valueOf(resultObj.get("processInstanceId"));
powerStation.setTaskId(taskIdNew);
powerStation.setProcessInstanceId(processInstanceId);
}
} catch (Exception e){
e.getMessage();
powerStationService.savePowerStation(powerStation);
}
} catch (Exception e){
e.getMessage();
}
peasantHouseholdServiceImpl.saveOrUpdate(peasantHousehold);
return surveyInfoAllDto;
}
public SurveyInfoAllDto querySurveyInfo(String surveyInformationId,AgencyUserModel userInfo) {
......
......@@ -101,4 +101,9 @@ sms.huawei.templateId=6aaeb4bf916d4db0a1942c598912519e
# 签名通道号
sms.huawei.sender=1069368924410006092
# 签名名称
sms.huawei.signature=华为云短信测试
\ No newline at end of file
sms.huawei.signature=华为云短信测试
# 电站审核pageId
power.station.examine.pageId=1679778420550037506
# 电站审核计划id
power.station.examine.planId=c4ed1873-0dc6-4518-a7a9-dbc588ef35e5
\ No newline at end of file
......@@ -47,6 +47,6 @@ public class MonitorFanIndicator extends BaseEntity {
private String equipmentNumber; //设备编号
@TableField("data_type")
private String dataType; //设备编号
@TableField("picture_name")
private String pictureName; //图片名称用于动态展示图片
}
......@@ -41,4 +41,7 @@ public interface MonitorFanIndicatorMapper extends BaseMapper<MonitorFanIndicato
List<Map<String, String>> getMajorBoosterStationInfo(@Param("gatewayId") String gatewayId,
@Param("sortType") String sortType,
@Param("size") Integer size);
Map<String, String> getMajorBoosterStationInfoBySort(@Param("gatewayId") String gatewayId,
@Param("sort") String sort);
}
......@@ -129,4 +129,22 @@
ORDER BY major_sort ${sortType}
limit #{size}
</select>
<select id="getMajorBoosterStationInfoBySort" resultType="java.util.Map">
select
`sequence_nbr` as id,
`gateway_id` as gatewayId,
`booster_name` as text,
booster_name as boosterName,
`booster_code` as boosterCode,
`sort` as value
from booster_station_info
where
sort = #{sort}
AND gateway_id = #{gatewayId}
limit 1
</select>
</mapper>
......@@ -177,6 +177,7 @@ public class DemoController extends BaseController {
maps2.put("equipmentNumber", "");
maps2.put("frontModule", "");
maps2.put("systemType", "");
maps2.put("pictureName", monitorFanIndicator.getPictureName());
// 升压站的字段显示名称
maps2.put("displayName", monitorFanIndicator.getEquipmentNumber());
if (!ObjectUtils.isEmpty(monitorFanIndicator.getFrontModule())) {
......
......@@ -26,9 +26,9 @@ public class IndicatorsDto {
private String distinct;
private String time;
private String displayName;
private String pictureName;
private String title;
public String getTime() {
String[] ts= time.replace(":00Z","").split("T");
......
......@@ -102,3 +102,5 @@ myqueue=amos.privilege.v1.JXIOP.AQSC_FDGL.userBusiness
# ?????????
fan.statuts.stattuspath=upload/jxiop/device_status
pictureUrl=
[
{
"code": "iot",
"emqTopic": "emq.iot.created",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "patrol",
"emqTopic": "emq.patrol.created",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "sign",
"emqTopic": "emq.sign.created",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "bussSign",
"emqTopic": "emq.bussSign.created",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "user",
"emqTopic": "emq.user.created",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "xf",
"emqTopic": "emq.xf.created",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "risk",
"emqTopic": "emq.risk.created",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "patrol",
"emqTopic": "emq.patrol.created",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "equipQrcode",
"emqTopic": "emq.mcb.zxj",
"akkaTopic": "JKXT2BP-XFYY-Topic"
},
{
"code": "mcbsubmit",
"emqTopic": "risk.submit",
"akkaTopic": "JKXT2BP-XFZX-Topic"
},
{
"code": "question",
"emqTopic": "warning.issue.question.zd",
"akkaTopic": "JKXT2BP-XFZX-Topic"
},
{
"code": "syncExecute",
"emqTopic": "sync.execute",
"akkaTopic": "JKXT2BP-XFZX-Topic"
},
{
"code": "ccsLoginInfo",
"emqTopic": "ccs-user-login-info",
"akkaTopic": "JKXT2BP-XFZX-Topic"
}
]
\ No newline at end of file
......@@ -90,6 +90,11 @@
<artifactId>kingbase8</artifactId>
<version>8.6.0</version>
</dependency>
<dependency>
<groupId>org.messaginghub</groupId>
<artifactId>pooled-jms</artifactId>
<version>1.0.5</version>
</dependency>
</dependencies>
</project>
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