Commit 17289a25 authored by tangwei's avatar tangwei

Merge branch 'developer' into develop_ccs

parents 3cd111fe 1ab64856
......@@ -4,6 +4,7 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentInformDto;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import java.util.List;
......@@ -41,7 +42,7 @@ public interface IEquipmentInformService {
Boolean acceptInform(Long sequenceNbr);
EquipmentInformDto updateEquipmentInform(EquipmentInformDto model, ReginParams userInfo);
EquipmentInformDto updateEquipmentInform(EquipmentInformDto model, ReginParams userInfo) throws BaseException;
EquipmentInformDto queryDtoBySeq(Long sequenceNbr);
......
......@@ -465,8 +465,18 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public Map<String, Object> checkExcuteTaskAuthMap(Long sequenceNbr, ReginParams userInfo) {
// 获取当前登录用户的角色
String currentLoginUserRole = userInfo.getRole().getRoleName();
String currentLoginUserRole = null;
// String currentLoginUserRole = userInfo.getRole().getRoleName();
if (userInfo.getUserModel().getOrgNames().contains(roleName[0])) {
currentLoginUserRole = roleName[0];
}else if (userInfo.getUserModel().getOrgNames().contains(roleName[1])) {
currentLoginUserRole = roleName[1];
}else if (userInfo.getUserModel().getOrgNames().contains(roleName[2])) {
currentLoginUserRole = roleName[2];
}else if (userInfo.getUserModel().getOrgNames().contains(roleName[3])) {
currentLoginUserRole = roleName[3];
}
Map<String, Object> map = new HashMap<String, Object>();
map.put("checkFlag", false);
FailureDetailsDto failureDetailsDto = this.queryBySeq(sequenceNbr);
......
package com.yeejoin.amos.boot.module.common.biz.utils;
import org.springframework.http.HttpStatus;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
public class CommonResponseUtil
{
public static ResponseModel success()
{
ResponseModel res = new ResponseModel();
res.setDevMessage("SUCCESS");
res.setStatus(HttpStatus.OK.value());
return res;
}
public static ResponseModel success(Object obj)
{
ResponseModel res = new ResponseModel();
res.setResult(obj);
res.setDevMessage("SUCCESS");
res.setStatus(HttpStatus.OK.value());
return res;
}
public static ResponseModel success(Object obj, String message)
{
ResponseModel res = new ResponseModel();
res.setResult(obj);
res.setDevMessage(message);
res.setStatus(HttpStatus.OK.value());
return res;
}
public static ResponseModel failure()
{
ResponseModel res = new ResponseModel();
res.setDevMessage("FAILURE");
res.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
return res;
}
public static ResponseModel failure(String message)
{
ResponseModel res = new ResponseModel();
res.setDevMessage("FAILURE");
res.setMessage(message);
res.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
return res;
}
public static ResponseModel failure(Object obj, String message)
{
ResponseModel res = new ResponseModel();
res.setResult(obj);
res.setDevMessage("FAILURE");
res.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
return res;
}
}
package com.yeejoin.equipmanage.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.equipmanage.common.entity.dto.MonitorEventDto;
import com.yeejoin.equipmanage.common.enums.VideoEventEnum;
import com.yeejoin.equipmanage.service.MqttEventReceiveService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -13,6 +17,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Slf4j
@Service
public class MqttEventReceiveServiceImpl implements MqttEventReceiveService {
......@@ -23,8 +28,9 @@ public class MqttEventReceiveServiceImpl implements MqttEventReceiveService {
@Override
@Transactional(rollbackFor = Exception.class)
public void handlerMqttIncrementMessage(String topic, String message) {
JSONObject json = JSONObject.parseObject(message);
try {
log.debug(message);
JSONObject json = JSON.parseObject(message);
String deviceCode = json.getString("deviceCode");
String event = json.getString("event");
JSONObject eventJson = JSONObject.parseObject(event);
......@@ -60,4 +66,9 @@ public class MqttEventReceiveServiceImpl implements MqttEventReceiveService {
e.printStackTrace();
}
}
// public static void main(String[] args) {
// MqttEventReceiveServiceImpl m = new MqttEventReceiveServiceImpl();
// m.handlerMqttIncrementMessage("", "{\"deviceCode\":\"13485741871310161013\",\"traceId\":\"-1202608724639988142\",\"event\":{\"pic\":\"upload/iot/1433672253282881537/752F8D2FCC745F218EE936C673DAB.jpg\",\"eventContent\":\"人数变化事件 \",\"eventType\":15}}");
// }
}
......@@ -176,7 +176,7 @@ public class TopographyService
}
if (!ValidationUtil.isEmpty(nodeDetailList)){
Map<String, String> createDateMap = new HashMap<>();
createDateMap.put("name", "创建时间");
createDateMap.put("name", "更新时间");
createDateMap.put("value", DateUtils.date2LongStr(new Date()));
nodeDetail.add(createDateMap);
}
......
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.InformEquipmentDto;
......@@ -95,11 +96,15 @@ public class EquipmentInformController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/submit")
@ApiOperation(httpMethod = "POST", value = "提交设备告知单", notes = "提交设备告知单")
public ResponseModel<EquipmentInformDto> submit(@RequestBody EquipmentInformDto model) {
public ResponseModel submit(@RequestBody EquipmentInformDto model) {
if (ValidationUtil.isEmpty(model.getSequenceNbr())) {
throw new BadRequest("参数校验失败.");
}
return ResponseHelper.buildResponse(equipmentInformServiceImpl.updateEquipmentInform(model,getSelectedOrgInfo()));
try {
return CommonResponseUtil.success(equipmentInformServiceImpl.updateEquipmentInform(model,getSelectedOrgInfo()));
} catch (Exception e) {
return CommonResponseUtil.failure(e.getMessage());
}
}
......
......@@ -44,6 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
......
......@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfoChange;
import com.yeejoin.amos.boot.module.tzs.flc.api.mapper.UnitInfoMapper;
import com.yeejoin.amos.boot.module.tzs.flc.api.service.IUnitInfoService;
import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
......@@ -306,7 +307,14 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
orgRoles.put(companyInfo.getSequenceNbr(),userRoleList);
agencyUserModel.setOrgRoles(orgRoles);
agencyUserModel.setOrgRoleSeqs(roleSeqsMap);
FeignClientResult<AgencyUserModel> userResult = Privilege.agencyUserClient.create(agencyUserModel);
FeignClientResult<AgencyUserModel> userResult = null;
try {
userResult = Privilege.agencyUserClient.create(agencyUserModel);
} catch (InnerInvokException e) {
// 删除已经创建的 企业信息
Privilege.companyClient.deleteCompany(companyInfo.getSequenceNbr() + "");
throw new BadRequest("注册失败");
}
if(userResult == null || userResult.getResult() == null) {
throw new BadRequest("注册失败");
......
......@@ -304,7 +304,7 @@
IF (
wlesal.confirm_type <![CDATA[<>]]> '',
'已处理',
'去确认'
'未处理'
) handleStatus,
IF (
wlesal.clean_time IS NOT NULL,
......
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