Commit cb4bac6a authored by yangyang's avatar yangyang

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

parents 29a24476 179026ec
...@@ -10,8 +10,8 @@ hygf_household_contract.`status`='双方已签署' ...@@ -10,8 +10,8 @@ hygf_household_contract.`status`='双方已签署'
and hygf_peasant_household.developer_id=#{developerId} and hygf_peasant_household.developer_id=#{developerId}
and hygf_peasant_household.regional_companies_seq=#{regionalCompaniesSeq} and hygf_peasant_household.regional_companies_seq=#{regionalCompaniesSeq}
and hygf_peasant_household.survey_or_not=3 and hygf_peasant_household.sequence_nbr not in and hygf_peasant_household.survey_or_not=3 and hygf_peasant_household.sequence_nbr not in
(select hygf_document_station.station_id from hygf_preparation_money LEFT JOIN hygf_document_station (select hygf_document_station.station_id from hygf_preparation_money RIGHT JOIN hygf_document_station
on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nbr where hygf_preparation_money.delivery_state !='已作废' on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nbr where hygf_preparation_money.order_status ='待发货'
<if test="ids!=null and ids !=''"> <if test="ids!=null and ids !=''">
and hygf_document_station.preparation_money_id !=#{ids} and hygf_document_station.preparation_money_id !=#{ids}
</if> </if>
......
...@@ -73,7 +73,7 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan ...@@ -73,7 +73,7 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
and hygf_peasant_household.owners_name like concat ('%',#{ownersName},'%') and hygf_peasant_household.owners_name like concat ('%',#{ownersName},'%')
</if> </if>
<if test=" preparationMoneyState == 1 "> <if test=" preparationMoneyState == 1 ">
and hygf_peasant_household.preparation_money_state not in ('待发货','待补货','暂存发货') and preparation_money_state is not and preparation_money_state != '' and hygf_peasant_household.preparation_money_state not in ('待发货','待补货','暂存发货') and preparation_money_state is not null and preparation_money_state != ''
</if> </if>
......
...@@ -15,6 +15,7 @@ import com.qiyuesuo.sdk.v2.response.MiniappTicketResult; ...@@ -15,6 +15,7 @@ import com.qiyuesuo.sdk.v2.response.MiniappTicketResult;
import com.qiyuesuo.sdk.v2.response.SdkResponse; import com.qiyuesuo.sdk.v2.response.SdkResponse;
import com.qiyuesuo.sdk.v2.utils.Algorithm; import com.qiyuesuo.sdk.v2.utils.Algorithm;
import com.qiyuesuo.sdk.v2.utils.Base64Utils; import com.qiyuesuo.sdk.v2.utils.Base64Utils;
import com.qiyuesuo.sdk.v2.utils.CollectionUtils;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.hygf.api.Enum.ArrivalStateeEnum; import com.yeejoin.amos.boot.module.hygf.api.Enum.ArrivalStateeEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.HouseholdContractEnum; import com.yeejoin.amos.boot.module.hygf.api.Enum.HouseholdContractEnum;
...@@ -109,8 +110,10 @@ public class QiyuesuoController extends BaseController { ...@@ -109,8 +110,10 @@ public class QiyuesuoController extends BaseController {
@PathVariable(value = "sequenceNbr") Long sequenceNbr) { @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
QueryWrapper<SealDictionary> queryWrapper = new QueryWrapper(); QueryWrapper<SealDictionary> queryWrapper = new QueryWrapper();
queryWrapper.eq("amos_company_seq", sequenceNbr); queryWrapper.eq("amos_company_seq", sequenceNbr);
SealDictionary sealDictionary = sealDictionaryMapper.selectOne(queryWrapper); List<SealDictionary> sealDictionaryList = sealDictionaryMapper.selectList(queryWrapper);
request.setUser(new User(sealDictionary.getSealedPhone(), "MOBILE")); if(CollectionUtils.isNotEmpty(sealDictionaryList)){
request.setUser(new User(sealDictionaryList.get(0).getSealedPhone(), "MOBILE"));
}
SdkResponse<MiniappTicketResult> result = qiyuesuoService.getContractSdkResponse(request); SdkResponse<MiniappTicketResult> result = qiyuesuoService.getContractSdkResponse(request);
return ResponseHelper.buildResponse(result.getResult()); return ResponseHelper.buildResponse(result.getResult());
} }
......
...@@ -54,11 +54,12 @@ public class WorkOrderController extends BaseController { ...@@ -54,11 +54,12 @@ public class WorkOrderController extends BaseController {
* 新增施工派工工单 * 新增施工派工工单
* *
* @return * @return
* @throws Exception
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增施工派工工单", notes = "新增施工派工工单") @ApiOperation(httpMethod = "POST", value = "新增施工派工工单", notes = "新增施工派工工单")
public ResponseModel<WorkOrder> save(@RequestBody WorkOrder model) { public ResponseModel<WorkOrder> save(@RequestBody WorkOrder model) throws Exception {
UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId()); UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId());
model = workOrderServiceImpl.saveWorkOrder(model,userUnitInformationDto); model = workOrderServiceImpl.saveWorkOrder(model,userUnitInformationDto);
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
......
...@@ -598,6 +598,8 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -598,6 +598,8 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
hygfPreparationMoneyAuditingService.createWithModel(hygfPreparationMoneyAuditingDto); hygfPreparationMoneyAuditingService.createWithModel(hygfPreparationMoneyAuditingDto);
//提交时 赋值发货时间及订单状态 //提交时 赋值发货时间及订单状态
model.setDeliveryTime(new Date()); model.setDeliveryTime(new Date());
model.setDeliveryState(DeliveryStateeEnum.已发货.getName());
model.setArrivalState(ArrivalStateeEnum.待收货.getName());
model.setOrderStatus(DeliveryStateeEnum.待确认.getName()); model.setOrderStatus(DeliveryStateeEnum.待确认.getName());
} else { } else {
up.set(PeasantHousehold::getConstructionState, DeliveryStateeEnum.暂存发货.getCode()); up.set(PeasantHousehold::getConstructionState, DeliveryStateeEnum.暂存发货.getCode());
...@@ -611,6 +613,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -611,6 +613,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
List<DocumentStation> listDocumentStation = new ArrayList<>(); List<DocumentStation> listDocumentStation = new ArrayList<>();
for (DocumentStation documentStation : ids) { for (DocumentStation documentStation : ids) {
documentStation.setPreparationMoneyId(model.getSequenceNbr()); documentStation.setPreparationMoneyId(model.getSequenceNbr());
documentStation.setSequenceNbr(null);
listDocumentStation.add(documentStation); listDocumentStation.add(documentStation);
} }
documentStationService.saveBatch(listDocumentStation); documentStationService.saveBatch(listDocumentStation);
...@@ -696,6 +699,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -696,6 +699,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
List<DocumentStation> listDocumentStation = new ArrayList<>(); List<DocumentStation> listDocumentStation = new ArrayList<>();
for (DocumentStation documentStation : ids) { for (DocumentStation documentStation : ids) {
documentStation.setPreparationMoneyId(model.getSequenceNbr()); documentStation.setPreparationMoneyId(model.getSequenceNbr());
documentStation.setSequenceNbr(null);
listDocumentStation.add(documentStation); listDocumentStation.add(documentStation);
} }
documentStationService.saveBatch(listDocumentStation); documentStationService.saveBatch(listDocumentStation);
...@@ -905,7 +909,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -905,7 +909,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
preparationMoneyMapper.updateById(model); preparationMoneyMapper.updateById(model);
//执行工作流并保存记录 //执行工作流并保存记录
this.wofkflowExcute(instanceId, kv.getOrDefault("approvalStatus", "").toString(),kv.getOrDefault("comment","").toString()); this.wofkflowExcute(instanceId, kv.getOrDefault("approvalStatus", "").toString(),kv.getOrDefault("approvalStatus","").toString());
} }
...@@ -1003,7 +1007,8 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -1003,7 +1007,8 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
}else { }else {
preparationMoney.setOrderStatus(DeliveryStateeEnum.待确认.getName()); preparationMoney.setOrderStatus(DeliveryStateeEnum.待确认.getName());
} }
this.wofkflowExcute(kv.get("instanceId").toString(), kv.get("approvalStatus").toString(),kv.getOrDefault("comment","").toString()); preparationMoneyMapper.updateById(preparationMoney);
this.wofkflowExcute(kv.get("instanceId").toString(), kv.get("approvalStatus").toString(),kv.getOrDefault("approveInfo","").toString());
} }
public PreparationMoney submitOrder(PreparationMoney model, String instanceId, String isSubmit){ public PreparationMoney submitOrder(PreparationMoney model, String instanceId, String isSubmit){
...@@ -1015,8 +1020,9 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -1015,8 +1020,9 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
model.setOrderStatus(DeliveryStateeEnum.待确认.getCode()); model.setOrderStatus(DeliveryStateeEnum.待确认.getCode());
preparationMoneyMapper.updateById(model); preparationMoneyMapper.updateById(model);
LambdaUpdateWrapper<PeasantHousehold> up = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<PeasantHousehold> up = new LambdaUpdateWrapper<>();
up.set(PeasantHousehold::getPreparationMoneyState, ArrivalStateeEnum.待收货.getName()); up.set(PeasantHousehold::getPreparationMoneyState, DeliveryStateeEnum.待补货.getName());
up.set(PeasantHousehold::getConstructionState, ArrivalStateeEnum.待收货.getName()); up.set(PeasantHousehold::getConstructionState, DeliveryStateeEnum.待补货.getName());
peasantHouseholdMapper.update(null,up);
this.wofkflowExcute(instanceId,isSubmit,""); this.wofkflowExcute(instanceId,isSubmit,"");
} }
......
...@@ -25,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -25,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 施工派工工单服务实现类 * 施工派工工单服务实现类
...@@ -110,7 +111,24 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -110,7 +111,24 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
} }
@Transactional @Transactional
public WorkOrder saveWorkOrder(WorkOrder model, UserUnitInformationDto userUnitInformationDto) { public WorkOrder saveWorkOrder(WorkOrder model, UserUnitInformationDto userUnitInformationDto) throws Exception {
// 校验电站已被选
List<PeasantHousehold> peasantHouseholdId = model.getPeasantHouseholdId();
List<PeasantHousehold> workorderPeasant = new ArrayList<>();
for (PeasantHousehold peasantHouse : peasantHouseholdId) {
int count = workOrderPowerStationServiceImpl.count(new LambdaQueryWrapper<WorkOrderPowerStation>()
.eq(WorkOrderPowerStation::getPeasantHouseholdId, peasantHouse.getSequenceNbr()));
if (count > 0) {
PeasantHousehold peasantHouseOne = peasantHouseholdMapper.selectById(peasantHouse.getSequenceNbr());
workorderPeasant.add(peasantHouseOne);
}
}
if (!workorderPeasant.isEmpty()) {
String names = workorderPeasant.stream().map(i -> i.getOwnersName()).collect(Collectors.joining(","));
throw new Exception("电站" + names + ",已被工单关联");
}
// 保存派工单 // 保存派工单
RegionalCompanies regionalCompanies = regionalCompaniesMapper.selectRegionName(model.getRegionCompanyId()); RegionalCompanies regionalCompanies = regionalCompaniesMapper.selectRegionName(model.getRegionCompanyId());
String code = NumberUtil.getCode(CodeEnum.派工单.getCode(), regionalCompanies.getCompanyCode(), String code = NumberUtil.getCode(CodeEnum.派工单.getCode(), regionalCompanies.getCompanyCode(),
...@@ -126,9 +144,8 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -126,9 +144,8 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
model.setAmosDealerOrgCode(userUnitInformationDto.getAmosDealerOrgCode()); model.setAmosDealerOrgCode(userUnitInformationDto.getAmosDealerOrgCode());
workOrderMapper.insert(model); workOrderMapper.insert(model);
// 保存派工单 电站信息
List<PeasantHousehold> peasantHouseholdId = model.getPeasantHouseholdId();
// 保存派工单 电站信息
List<ConstructionRecords> constructionRecordlist = new ArrayList<>(); List<ConstructionRecords> constructionRecordlist = new ArrayList<>();
List<WorkOrderPowerStation> li = new ArrayList<>(); List<WorkOrderPowerStation> li = new ArrayList<>();
for (PeasantHousehold peasantHousehold : peasantHouseholdId) { for (PeasantHousehold peasantHousehold : peasantHouseholdId) {
...@@ -254,8 +271,8 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -254,8 +271,8 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
@Transactional @Transactional
public PowerStationConstructionData addOrUpdate(PowerStationConstructionData powerStationConstructionData) { public PowerStationConstructionData addOrUpdate(PowerStationConstructionData powerStationConstructionData) {
//如果不是提交进行单独保存 // 如果不是提交进行单独保存
if(powerStationConstructionData.isCommitFlow()){ if (powerStationConstructionData.isCommitFlow()) {
// if(powerStationConstructionData.getSequenceNbr()!=null){ // if(powerStationConstructionData.getSequenceNbr()!=null){
// 修改施工电站状态 // 修改施工电站状态
LambdaUpdateWrapper<WorkOrderPowerStation> up = new LambdaUpdateWrapper(); LambdaUpdateWrapper<WorkOrderPowerStation> up = new LambdaUpdateWrapper();
...@@ -295,29 +312,35 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -295,29 +312,35 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
workOrderMapper.update(null, upq); workOrderMapper.update(null, upq);
} }
// 新增施工信息
// 防止重复添加
LambdaUpdateWrapper<PowerStationConstructionData> psc = new LambdaUpdateWrapper();
psc.eq(PowerStationConstructionData::getWorkOrderPowerStationId,
powerStationConstructionData.getWorkOrderPowerStationId());
psc.eq(PowerStationConstructionData::getWorkOrderId, powerStationConstructionData.getWorkOrderId());
powerStationConstructionDataService.saveOrUpdate(powerStationConstructionData, psc);
// powerStationConstructionDataService.saveOrUpdate(powerStationConstructionData);
// 增加操作日志 // 增加操作日志
if (powerStationConstructionData.getSequenceNbr() != null) { if (powerStationConstructionData.getSequenceNbr() != null) {
ConstructionRecords da = new ConstructionRecords(powerStationConstructionData.getRecUserName(), "编辑施工资料", ConstructionRecords da = new ConstructionRecords(powerStationConstructionData.getRecUserName(), "编辑施工资料",
new Date(), "", powerStationConstructionData.getWorkOrderId(), new Date(), "", powerStationConstructionData.getWorkOrderId(),
powerStationConstructionData.getWorkOrderPowerStationId(), null, ""); powerStationConstructionData.getWorkOrderPowerStationId(), null, "");
constructionRecordsServiceImpl.save(da); LambdaUpdateWrapper<ConstructionRecords> pcr = new LambdaUpdateWrapper<>();
pcr.eq(ConstructionRecords::getWorkOrderId, powerStationConstructionData.getWorkOrderId());
constructionRecordsServiceImpl.saveOrUpdate(da,pcr);
} else { } else {
ConstructionRecords da = new ConstructionRecords(powerStationConstructionData.getRecUserName(), "新增施工资料", ConstructionRecords da = new ConstructionRecords(powerStationConstructionData.getRecUserName(), "新增施工资料",
new Date(), "", powerStationConstructionData.getWorkOrderId(), new Date(), "", powerStationConstructionData.getWorkOrderId(),
powerStationConstructionData.getWorkOrderPowerStationId(), null, ""); powerStationConstructionData.getWorkOrderPowerStationId(), null, "");
constructionRecordsServiceImpl.save(da); LambdaUpdateWrapper<ConstructionRecords> pcr = new LambdaUpdateWrapper<>();
pcr.eq(ConstructionRecords::getWorkOrderId, powerStationConstructionData.getWorkOrderId());
constructionRecordsServiceImpl.saveOrUpdate(da,pcr);
} }
// 新增施工信息
// 防止重复添加
LambdaUpdateWrapper<PowerStationConstructionData> psc = new LambdaUpdateWrapper<>();
// psc.eq(PowerStationConstructionData::getWorkOrderPowerStationId,
// powerStationConstructionData.getWorkOrderPowerStationId());
psc.eq(PowerStationConstructionData::getWorkOrderId, powerStationConstructionData.getWorkOrderId());
powerStationConstructionDataService.saveOrUpdate(powerStationConstructionData, psc);
// powerStationConstructionDataService.saveOrUpdate(powerStationConstructionData);
// }else{ // }else{
// //修改施工电站状态 // //修改施工电站状态
...@@ -843,7 +866,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -843,7 +866,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
// 防止重复提交 // 防止重复提交
LambdaQueryWrapper<PowerStationEngineeringInfo> pse = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PowerStationEngineeringInfo> pse = new LambdaQueryWrapper<>();
pse.eq(PowerStationEngineeringInfo::getWorkOrderId, powerStationEngineeringInfo.getWorkOrderId()); pse.eq(PowerStationEngineeringInfo::getWorkOrderId, powerStationEngineeringInfo.getWorkOrderId());
//pse.eq(PowerStationEngineeringInfo::getWorkOrderPowerStationId,powerStationEngineeringInfo.getWorkOrderPowerStationId()); // pse.eq(PowerStationEngineeringInfo::getWorkOrderPowerStationId,powerStationEngineeringInfo.getWorkOrderPowerStationId());
// powerStationEngineeringInfoService.saveOrUpdate(powerStationEngineeringInfo); // powerStationEngineeringInfoService.saveOrUpdate(powerStationEngineeringInfo);
powerStationEngineeringInfoService.saveOrUpdate(powerStationEngineeringInfo, pse); powerStationEngineeringInfoService.saveOrUpdate(powerStationEngineeringInfo, pse);
// 增加操作日志 // 增加操作日志
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
SELECT SELECT
COUNT(*) as count COUNT(*) as count
FROM FROM
amos_mcb.mcb_warning_warning_info log mcb_warning_warning_info log
LEFT JOIN amos_mcb.mcb_warning_base_source_attribution source ON source.CODE = log.SOURCE_ATTRIBUTION LEFT JOIN mcb_warning_base_source_attribution source1 ON source1.CODE = log.SOURCE_ATTRIBUTION
<where> <where>
date(log.CREATE_DATE) = CURRENT_DATE date(log.CREATE_DATE) = CURRENT_DATE
and WARNING_SOURCE_TYPE_CODE in (SELECT code FROM amos_mcb.mcb_data_dictionary WHERE remark = 'OVERVIEW' ) and WARNING_SOURCE_TYPE_CODE in (SELECT code FROM mcb_data_dictionary WHERE remark = 'OVERVIEW' )
<if test="projectOrgCodes != null and projectOrgCodes.size() > 0"> <if test="projectOrgCodes != null and projectOrgCodes.size() > 0">
AND SOURCE_ATTRIBUTION IN AND SOURCE_ATTRIBUTION IN
<foreach collection="projectOrgCodes" item="item" open="(" separator="," close=")"> <foreach collection="projectOrgCodes" item="item" open="(" separator="," close=")">
...@@ -91,9 +91,9 @@ ...@@ -91,9 +91,9 @@
IFNULL( count( log.SEQUENCE_NBR ), 0 ) AS seriesData, IFNULL( count( log.SEQUENCE_NBR ), 0 ) AS seriesData,
date( log.CREATE_DATE ) AS axisData date( log.CREATE_DATE ) AS axisData
FROM FROM
amos_mcb.mcb_warning_warning_info log mcb_warning_warning_info log
WHERE WHERE
log.WARNING_SOURCE_TYPE_CODE IN ( SELECT CODE FROM amos_mcb.mcb_data_dictionary WHERE remark = 'OVERVIEW' ) log.WARNING_SOURCE_TYPE_CODE IN ( SELECT CODE FROM mcb_data_dictionary WHERE remark = 'OVERVIEW' )
AND date( log.CREATE_DATE ) >= CURDATE( ) - INTERVAL 7 DAY AND date( log.CREATE_DATE ) >= CURDATE( ) - INTERVAL 7 DAY
<if test="projectOrgCodes != null and projectOrgCodes.size() > 0"> <if test="projectOrgCodes != null and projectOrgCodes.size() > 0">
AND log.SOURCE_ATTRIBUTION IN AND log.SOURCE_ATTRIBUTION IN
...@@ -108,23 +108,23 @@ ...@@ -108,23 +108,23 @@
<select id="queryWarningList" resultType="java.util.Map"> <select id="queryWarningList" resultType="java.util.Map">
SELECT SELECT
log.SEQUENCE_NBR, log.SEQUENCE_NBR,
DATE_FORMAT(log.CREATE_DATE, '%Y-%m-%d %H:%i:%s') AS CREATE_DATE, log.CREATE_DATE AS CREATE_DATE,
DATE_FORMAT(log.REC_DATE, '%Y-%m-%d %H:%i:%s') AS REC_DATE, log.REC_DATE AS REC_DATE,
log.EVENT_LEVEL_DESC, log.EVENT_LEVEL_DESC,
log.EVENT_LEVEL, log.EVENT_LEVEL,
log.SOURCE_ATTRIBUTION_DESC, log.SOURCE_ATTRIBUTION_DESC,
log.SOURCE_ATTRIBUTION, log.SOURCE_ATTRIBUTION,
log.CONTENT, log.CONTENT,
LEVEL.COLOR, warnLevel.COLOR,
source.PROVINCE, source1.PROVINCE,
log.WARNING_SOURCE_TYPE, log.WARNING_SOURCE_TYPE,
log.OBJECT_NAME, log.OBJECT_NAME,
log.PROCESSING_STATUS, log.PROCESSING_STATUS,
log.PROCESSING_STATUS_DESC log.PROCESSING_STATUS_DESC
FROM FROM
amos_mcb.mcb_warning_warning_info log mcb_warning_warning_info log
LEFT JOIN amos_mcb.mcb_warning_base_warning_level LEVEL ON log.EVENT_LEVEL = LEVEL.CODE and LEVEL.SEQUENCE_NBR in (1, 2, 3) LEFT JOIN mcb_warning_base_warning_level warnLevel ON log.EVENT_LEVEL = warnLevel.CODE and warnLevel.SEQUENCE_NBR in (1, 2, 3)
LEFT JOIN amos_mcb.mcb_warning_base_source_attribution source ON source.CODE = log.SOURCE_ATTRIBUTION LEFT JOIN mcb_warning_base_source_attribution source1 ON source1.CODE = log.SOURCE_ATTRIBUTION
<where> <where>
<if test="projectOrgCodes != null and projectOrgCodes.size() > 0"> <if test="projectOrgCodes != null and projectOrgCodes.size() > 0">
AND log.SOURCE_ATTRIBUTION IN AND log.SOURCE_ATTRIBUTION IN
...@@ -165,11 +165,11 @@ ...@@ -165,11 +165,11 @@
<select id="queryWarningCount" resultType="java.lang.Long"> <select id="queryWarningCount" resultType="java.lang.Long">
SELECT SELECT
count(*) COUNT(1)
FROM FROM
amos_mcb.mcb_warning_warning_info log mcb_warning_warning_info log
LEFT JOIN amos_mcb.mcb_warning_base_warning_level LEVEL ON log.EVENT_LEVEL = LEVEL.CODE and LEVEL.SEQUENCE_NBR in (1, 2, 3) LEFT JOIN mcb_warning_base_warning_level warnLevel ON log.EVENT_LEVEL = warnLevel.CODE and warnLevel.SEQUENCE_NBR in (1, 2, 3)
LEFT JOIN amos_mcb.mcb_warning_base_source_attribution source ON source.CODE = log.SOURCE_ATTRIBUTION LEFT JOIN mcb_warning_base_source_attribution source1 ON source1.CODE = log.SOURCE_ATTRIBUTION
<where> <where>
<if test="projectOrgCodes != null and projectOrgCodes.size() > 0"> <if test="projectOrgCodes != null and projectOrgCodes.size() > 0">
AND log.SOURCE_ATTRIBUTION IN AND log.SOURCE_ATTRIBUTION IN
...@@ -270,18 +270,18 @@ ...@@ -270,18 +270,18 @@
question.SOURCE_ATTRIBUTION, question.SOURCE_ATTRIBUTION,
question.CONTENT, question.CONTENT,
question.LEVEL_DESC, question.LEVEL_DESC,
source.PROVINCE source1.PROVINCE
FROM FROM
(SELECT (SELECT
QUESTION_NUM QUESTION_NUM
FROM FROM
amos_mcb.mcb_warning_warning_info mcb_warning_warning_info
WHERE WHERE
mcb_warning_warning_info.PROCESSING_STATUS = 2 mcb_warning_warning_info.PROCESSING_STATUS = 2
AND QUESTION_NUM IS NOT NULL AND QUESTION_NUM IS NOT NULL
AND mcb_warning_warning_info.WARNING_SOURCE_TYPE_CODE IN ( SELECT CODE FROM amos_mcb.mcb_data_dictionary WHERE remark = 'OVERVIEW' ) AND mcb_warning_warning_info.WARNING_SOURCE_TYPE_CODE IN ( SELECT CODE FROM mcb_data_dictionary WHERE remark = 'OVERVIEW' )
) warnNum LEFT join amos_mcb.mcb_warning_question_info question on question.NUM = warnNum.QUESTION_NUM ) warnNum LEFT join mcb_warning_question_info question on question.NUM = warnNum.QUESTION_NUM
LEFT JOIN amos_mcb.mcb_warning_base_source_attribution source ON source.CODE = question.SOURCE_ATTRIBUTION LEFT JOIN mcb_warning_base_source_attribution source1 ON source1.CODE = question.SOURCE_ATTRIBUTION
<where> <where>
question.COMPLETION_STATUS != 1 question.COMPLETION_STATUS != 1
<if test="projectOrgCodes != null and projectOrgCodes.size() > 0"> <if test="projectOrgCodes != null and projectOrgCodes.size() > 0">
...@@ -324,7 +324,7 @@ ...@@ -324,7 +324,7 @@
<if test="completionStatus != null and completionStatus != 0"> <if test="completionStatus != null and completionStatus != 0">
AND question.COMPLETION_STATUS = #{completionStatus} AND question.COMPLETION_STATUS = #{completionStatus}
</if> </if>
LEFT JOIN mcb_warning_base_source_attribution source ON source.CODE = question.SOURCE_ATTRIBUTION LEFT JOIN mcb_warning_base_source_attribution source1 ON source1.CODE = question.SOURCE_ATTRIBUTION
<where> <where>
<if test="projectOrgCodes != null and projectOrgCodes.size() > 0"> <if test="projectOrgCodes != null and projectOrgCodes.size() > 0">
AND question.SOURCE_ATTRIBUTION IN AND question.SOURCE_ATTRIBUTION IN
...@@ -351,9 +351,9 @@ ...@@ -351,9 +351,9 @@
SUM(IFNULL(RPN, 0)) AS totalRPN, SUM(IFNULL(RPN, 0)) AS totalRPN,
COUNT(SEQUENCE_NBR) AS todayAlarm COUNT(SEQUENCE_NBR) AS todayAlarm
FROM FROM
amos_mcb.mcb_warning_warning_info mcb_warning_warning_info
WHERE WHERE
date(CREATE_DATE) = CURRENT_DATE and mcb_warning_warning_info.WARNING_SOURCE_TYPE_CODE in (select code FROM amos_mcb.mcb_data_dictionary WHERE remark = 'OVERVIEW') date(CREATE_DATE) = CURRENT_DATE and mcb_warning_warning_info.WARNING_SOURCE_TYPE_CODE in (select code FROM mcb_data_dictionary WHERE remark = 'OVERVIEW')
GROUP BY GROUP BY
SOURCE_ATTRIBUTION SOURCE_ATTRIBUTION
) )
...@@ -370,11 +370,11 @@ ...@@ -370,11 +370,11 @@
COALESCE(sq.totalRPN / NULLIF(COUNT(b.SOURCE_ATTRIBUTION), 0), 0) AS rpn, COALESCE(sq.totalRPN / NULLIF(COUNT(b.SOURCE_ATTRIBUTION), 0), 0) AS rpn,
IFNULL(sq.todayAlarm,0) as todayAlarm IFNULL(sq.todayAlarm,0) as todayAlarm
FROM FROM
amos_mcb.mcb_warning_base_source_attribution a mcb_warning_base_source_attribution a
LEFT JOIN LEFT JOIN
SubQuery sq ON a.CODE = sq.SOURCE_ATTRIBUTION SubQuery sq ON a.CODE = sq.SOURCE_ATTRIBUTION
LEFT JOIN LEFT JOIN
amos_mcb.mcb_warning_warning_info b ON a.CODE = b.SOURCE_ATTRIBUTION AND date(b.CREATE_DATE) = CURRENT_DATE mcb_warning_warning_info b ON a.CODE = b.SOURCE_ATTRIBUTION AND date(b.CREATE_DATE) = CURRENT_DATE
<where> <where>
<if test="sourceAttribution != null and sourceAttribution != ''"> <if test="sourceAttribution != null and sourceAttribution != ''">
a.CODE LIKE CONCAT(#{sourceAttribution}, '%') a.CODE LIKE CONCAT(#{sourceAttribution}, '%')
...@@ -390,7 +390,7 @@ ...@@ -390,7 +390,7 @@
SELECT SELECT
count( 1 ) AS yearNum count( 1 ) AS yearNum
FROM FROM
amos_mcb.mcb_warning_warning_info mcb_warning_warning_info
Left join mcb_warning_base_source_attribution mwbsa on mwbsa.CODE = mcb_warning_warning_info.SOURCE_ATTRIBUTION Left join mcb_warning_base_source_attribution mwbsa on mwbsa.CODE = mcb_warning_warning_info.SOURCE_ATTRIBUTION
WHERE WHERE
YEAR(CREATE_DATE) = YEAR(CURDATE()) YEAR(CREATE_DATE) = YEAR(CURDATE())
...@@ -400,14 +400,14 @@ ...@@ -400,14 +400,14 @@
<if test="sourceAttribution != null and sourceAttribution != '' "> <if test="sourceAttribution != null and sourceAttribution != '' ">
and mwbsa.CODE LIKE CONCAT (#{sourceAttribution},'%') and mwbsa.CODE LIKE CONCAT (#{sourceAttribution},'%')
</if> </if>
and mcb_warning_warning_info.WARNING_SOURCE_TYPE_CODE in (select code FROM amos_mcb.mcb_data_dictionary WHERE remark = 'OVERVIEW') and mcb_warning_warning_info.WARNING_SOURCE_TYPE_CODE in (select code FROM mcb_data_dictionary WHERE remark = 'OVERVIEW')
</select> </select>
<select id="getMonthTotal" resultType="integer"> <select id="getMonthTotal" resultType="integer">
SELECT SELECT
count( 1 ) AS monNum count( 1 ) AS monNum
FROM FROM
amos_mcb.mcb_warning_warning_info mcb_warning_warning_info
Left join mcb_warning_base_source_attribution mwbsa on mwbsa.CODE = mcb_warning_warning_info.SOURCE_ATTRIBUTION Left join mcb_warning_base_source_attribution mwbsa on mwbsa.CODE = mcb_warning_warning_info.SOURCE_ATTRIBUTION
WHERE WHERE
MONTH(CREATE_DATE) = MONTH(CURDATE()) MONTH(CREATE_DATE) = MONTH(CURDATE())
...@@ -417,14 +417,14 @@ ...@@ -417,14 +417,14 @@
<if test="sourceAttribution != null and sourceAttribution != '' "> <if test="sourceAttribution != null and sourceAttribution != '' ">
and mwbsa.CODE LIKE CONCAT (#{sourceAttribution},'%') and mwbsa.CODE LIKE CONCAT (#{sourceAttribution},'%')
</if> </if>
and mcb_warning_warning_info.WARNING_SOURCE_TYPE_CODE in (select code FROM amos_mcb.mcb_data_dictionary WHERE remark = 'OVERVIEW') and mcb_warning_warning_info.WARNING_SOURCE_TYPE_CODE in (select code FROM mcb_data_dictionary WHERE remark = 'OVERVIEW')
</select> </select>
<select id="getDayTotal" resultType="integer"> <select id="getDayTotal" resultType="integer">
SELECT SELECT
count( 1 ) AS dayNUM , count( 1 ) AS dayNUM ,
mwbsa.PROVINCE mwbsa.PROVINCE
FROM FROM
amos_mcb.mcb_warning_warning_info mcb_warning_warning_info
Left join mcb_warning_base_source_attribution mwbsa on mwbsa.CODE = mcb_warning_warning_info.SOURCE_ATTRIBUTION Left join mcb_warning_base_source_attribution mwbsa on mwbsa.CODE = mcb_warning_warning_info.SOURCE_ATTRIBUTION
WHERE WHERE
DATE_FORMAT(CREATE_DATE,'%Y-%m-%d') = CURDATE() DATE_FORMAT(CREATE_DATE,'%Y-%m-%d') = CURDATE()
...@@ -434,6 +434,6 @@ ...@@ -434,6 +434,6 @@
<if test="sourceAttribution != null and sourceAttribution != '' "> <if test="sourceAttribution != null and sourceAttribution != '' ">
and mwbsa.CODE LIKE CONCAT (#{sourceAttribution},'%') and mwbsa.CODE LIKE CONCAT (#{sourceAttribution},'%')
</if> </if>
and mcb_warning_warning_info.WARNING_SOURCE_TYPE_CODE in (select code FROM amos_mcb.mcb_data_dictionary WHERE remark = 'OVERVIEW') and mcb_warning_warning_info.WARNING_SOURCE_TYPE_CODE in (select code FROM mcb_data_dictionary WHERE remark = 'OVERVIEW')
</select> </select>
</mapper> </mapper>
...@@ -34,11 +34,11 @@ spring.db3.datasource.password=taosdata ...@@ -34,11 +34,11 @@ spring.db3.datasource.password=taosdata
spring.db3.datasource.driver-class-name: com.taosdata.jdbc.rs.RestfulDriver spring.db3.datasource.driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
## eureka properties: ## eureka properties:
eureka.instance.hostname=10.20.1.160 eureka.instance.hostname=47.92.234.253
eureka.client.serviceUrl.defaultZone=http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/ eureka.client.serviceUrl.defaultZone=http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/
## redis properties: ## redis properties:
spring.redis.database=1 spring.redis.database=1
spring.redis.host=10.20.1.210 spring.redis.host=47.92.234.253
spring.redis.port=6379 spring.redis.port=6379
spring.redis.password=yeejoin@2020 spring.redis.password=yeejoin@2020
...@@ -74,10 +74,10 @@ lettuce.timeout=10000 ...@@ -74,10 +74,10 @@ lettuce.timeout=10000
emqx.clean-session=true 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://172.16.10.220:1883 emqx.broker=tcp://47.92.234.253:1883
emqx.user-name=admin emqx.user-name=admin
emqx.password=public emqx.password=public
mqtt.scene.host=mqtt://172.16.10.220:8083/mqtt mqtt.scene.host=mqtt://47.92.234.253:18083/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
......
...@@ -90,3 +90,8 @@ spring.elasticsearch.rest.read-timeout=30000 ...@@ -90,3 +90,8 @@ spring.elasticsearch.rest.read-timeout=30000
#elasticsearch.username= elastic #elasticsearch.username= elastic
#elasticsearch.password= 123456 #elasticsearch.password= 123456
amos.system.user.user-name=cz
amos.system.user.password=a1234567
amos.system.user.product=AMOS_STUDIO_WEB
amos.system.user.app-key=AMOS_STUDIO
\ No newline at end of file
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