Commit 4be7e743 authored by maoying's avatar maoying

Merge branch 'developer' of 172.16.10.76:moa/amos-boot-biz into developer

parents b7b78cb6 7580d5d3
......@@ -24,4 +24,6 @@ public interface UnitInfoMapper extends BaseMapper<UnitInfo> {
@Param("address") String address,
@Param("orgName") String orgName,
@Param("organizationCode") String organizationCode);
List<UnitInfo> getUnitWithoutQrcode();
}
......@@ -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);
......
......@@ -40,4 +40,6 @@ public interface IUnitInfoService {
List<UnitInfoDto> getAllUnit();
List<UnitInfoDto> getUseUnit(String unitType, String address, String orgName, String organizationCode);
Boolean addQRcode();
}
......@@ -51,4 +51,21 @@
</select>
<select id="getUnitWithoutQrcode" resultType="com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo">
SELECT
a.*
FROM
tz_flc_unit_info a
LEFT JOIN cb_source_file f on f.source_id = a.sequence_nbr and f.file_category = 'qrCode'
WHERE
a.is_delete = 0
AND (
a.unit_status = '1'
OR a.is_change = 1)
and f.sequence_nbr is null
</select>
</mapper>
......@@ -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;
}
}
......@@ -125,7 +125,7 @@ public class EquipmentIndexImpl extends ServiceImpl<EquipmentIndexMapper, Equipm
equipmentSpecificIndex.setEquipmentSpecificId(y.getId());
equipmentSpecificIndex.setEquipmentIndexId(equipmentIndex.getId());
equipmentSpecificIndex.setEquipmentIndexKey(equipmentIndex.getPerfQuotaDefinitionId());
equipmentSpecificIndex.setEquipmentSpecificIndexName(equipmentIndex.getPerfQuotaName());
equipmentSpecificIndex.setEquipmentIndexName(equipmentIndex.getPerfQuotaName());
equipmentSpecificIndex.setEquipmentSpecialName(y.getName());
equipmentSpecificIndexList.add(equipmentSpecificIndex);
});
......
......@@ -1598,8 +1598,29 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
if (!ObjectUtils.isEmpty(equipmentSpecific)) {
QueryWrapper<VideoEquipmentSpecific> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("equipment_specific_id", equipmentSpecificId);
if (0 == videoIdList.size()) {
videoEquipmentSpecificService.remove(queryWrapper);
return Boolean.TRUE;
}
List<VideoEquipmentSpecific> list = videoEquipmentSpecificService.getBaseMapper().selectList(queryWrapper);
if (0 < list.size()) {
boolean remove = videoEquipmentSpecificService.remove(queryWrapper);
if (remove) {
this.bingEquipmentRelationshipToVideo(videoIdList, equipmentSpecificId);
}
} else {
this.bingEquipmentRelationshipToVideo(videoIdList, equipmentSpecificId);
}
return Boolean.FALSE;
} else {
throw new RuntimeException("未获取到此设备!");
}
} else {
throw new RuntimeException("设备ID为空!");
}
}
private Boolean bingEquipmentRelationshipToVideo(List<Long> videoIdList, Long equipmentSpecificId) {
List<VideoEquipmentSpecific> videoSpecificList = new ArrayList<>();
videoIdList.parallelStream().forEach(x -> {
VideoEquipmentSpecific videoEquipmentSpecific = new VideoEquipmentSpecific();
......@@ -1609,14 +1630,6 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
});
videoEquipmentSpecificService.saveBatch(videoSpecificList);
return Boolean.TRUE;
} else {
throw new RuntimeException("设备摄像头绑定关系中此设备不存在!");
}
} else {
throw new RuntimeException("未获取到此设备!");
}
} else {
throw new RuntimeException("设备ID为空!");
}
}
}
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,14 +28,16 @@ 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);
String eventContent = eventJson.getString("eventContent");
String eventType = eventJson.getString("eventType");
String eventType = String.valueOf(eventJson.get("eventType")).toString();
String eventPic = eventJson.getString("pic");
List<String> eventPicList = new ArrayList<String>();
......@@ -59,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);
}
......
......@@ -592,7 +592,23 @@ public class AlertCalledController extends BaseController {
updateWrapper.set(AlertCalled::getForzenResult, alertCalledDto.getForzenResult());
updateWrapper.set(AlertCalled::getAlertStatus, true);
updateWrapper.eq(AlertCalled::getSequenceNbr, alertCalledDto.getSequenceNbr());
return ResponseHelper.buildResponse(iAlertCalledService.update(updateWrapper));
Boolean flag = iAlertCalledService.update(updateWrapper);
if(flag) {
AlertCalledDto alertCalledVo = iAlertCalledService.queryBySeq(alertCalledDto.getSequenceNbr());
try {
redisUtils.del(RedisKey.TZS_ALERTCALLED_ID+alertCalledVo.getSequenceNbr());
} catch (Exception e) {
e.printStackTrace();
logger.error("删除redis失败:" + e.getMessage());
}
try {
eSAlertCalledService.updateEsAlertCalled(alertCalledVo);
} catch (Exception e) {
e.printStackTrace();
logger.error("更新es失败:" + e.getMessage());
}
}
return ResponseHelper.buildResponse(flag);
}
/**
......@@ -612,7 +628,23 @@ public class AlertCalledController extends BaseController {
updateWrapper.set(AlertCalled::getFinalReason, alertCalledDto.getFinalReason());
updateWrapper.set(AlertCalled::getAlertStatus, true);
updateWrapper.eq(AlertCalled::getSequenceNbr, alertCalledDto.getSequenceNbr());
return ResponseHelper.buildResponse(iAlertCalledService.update(updateWrapper));
Boolean flag = iAlertCalledService.update(updateWrapper);
if(flag) {
AlertCalledDto alertCalledVo = iAlertCalledService.queryBySeq(alertCalledDto.getSequenceNbr());
try {
redisUtils.del(RedisKey.TZS_ALERTCALLED_ID+alertCalledVo.getSequenceNbr());
} catch (Exception e) {
e.printStackTrace();
logger.error("删除redis失败:" + e.getMessage());
}
try {
eSAlertCalledService.updateEsAlertCalled(alertCalledVo);
} catch (Exception e) {
e.printStackTrace();
logger.error("更新es失败:" + e.getMessage());
}
}
return ResponseHelper.buildResponse(flag);
}
/**
......
package com.yeejoin.amos.boot.module.tzs.flc.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
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.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;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentInformDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentInform;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo;
import com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.EquipmentInformServiceImpl;
import feign.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestParam;
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.tzs.flc.biz.service.impl.EquipmentInformServiceImpl;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
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 javax.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentInformDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import java.util.List;
/**
* 设备告知单
......@@ -95,11 +94,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());
}
}
......
package com.yeejoin.amos.boot.module.tzs.flc.biz.controller;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -10,9 +9,10 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.tzs.api.enums.TzsCommonParam;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzsAuthServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentInformDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoApproveDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo;
......@@ -157,7 +157,8 @@ public class UnitInfoController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "判断组织机构是否存在", notes = "判断组织机构是否存在")
public ResponseModel<Boolean> hasExistUnit( @PathVariable(value = "organizationCode") String organizationCode) {
Boolean flag = false;
UnitInfo temp = unitInfoServiceImpl.getOne(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getIsDelete,false).eq(UnitInfo::getOrganizationCode,organizationCode));
UnitInfo temp = unitInfoServiceImpl.getOne(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getIsDelete,false).eq(UnitInfo::getOrganizationCode,organizationCode).eq(UnitInfo::getUnitStatus,"1").
or().eq(UnitInfo::getIsChange,true).eq(UnitInfo::getOrganizationCode,organizationCode));
if(temp != null) {
flag = true;
}
......@@ -174,7 +175,7 @@ public class UnitInfoController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "判断组织机构是否存在-更新", notes = "判断组织机构是否存在-更新")
public ResponseModel<Boolean> hasExistUnitWithId( @PathVariable(value = "unitId") Long unitId,@PathVariable(value = "organizationCode") String organizationCode) {
Boolean flag = false;
UnitInfo temp = unitInfoServiceImpl.getOne(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getIsDelete,false).eq(UnitInfo::getOrganizationCode,organizationCode).ne(UnitInfo::getSequenceNbr,unitId));
UnitInfo temp = unitInfoServiceImpl.getOne(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getIsDelete,false).eq(UnitInfo::getOrganizationCode,organizationCode).ne(UnitInfo::getSequenceNbr,unitId).eq(UnitInfo::getUnitStatus,"1").or().eq(UnitInfo::getIsChange,true));
if(temp != null) {
flag = true;
}
......@@ -386,7 +387,6 @@ public class UnitInfoController extends BaseController {
}
/**
* 审批企业注册
*
......@@ -395,12 +395,16 @@ public class UnitInfoController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/approve")
@ApiOperation(httpMethod = "POST", value = "审批企业注册", notes = "审批企业注册")
public ResponseModel<UnitInfoDto> approve(@RequestBody UnitInfoApproveDto approveDto) {
public ResponseModel approve(@RequestBody UnitInfoApproveDto approveDto) {
if (ValidationUtil.isEmpty(approveDto.getUnitId()) || ValidationUtil.isEmpty(approveDto.getApproveStatus())) {
throw new BadRequest("参数校验失败.");
}
try {
UnitInfoDto model = unitInfoServiceImpl.approve(approveDto);
return ResponseHelper.buildResponse(model);
return CommonResponseUtil.success(model);
} catch (Exception e) {
return CommonResponseUtil.failure(e.getMessage());
}
}
......@@ -431,10 +435,6 @@ public class UnitInfoController extends BaseController {
return ResponseHelper.buildResponse(result);
}
/**
* 变更企业表
*
......@@ -444,9 +444,12 @@ public class UnitInfoController extends BaseController {
@PostMapping(value = "/change")
@ApiOperation(httpMethod = "POST", value = "变更企业表", notes = "变更企业表")
public ResponseModel<UnitInfoDto> change(@RequestBody UnitInfoDto model) {
try {
model = unitInfoServiceImpl.changeUnInfo(model);
return ResponseHelper.buildResponse(model);
return CommonResponseUtil.success(model);
} catch (Exception e) {
return CommonResponseUtil.failure(e.getMessage());
}
}
/**
......@@ -532,6 +535,59 @@ public class UnitInfoController extends BaseController {
return ResponseHelper.buildResponse(unitInfoVoIPage);
}
/**
* 判断用户号码是否存在
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/hasExistPhone/{phone}")
@ApiOperation(httpMethod = "GET", value = "判断用户号码是否存在", notes = "判断用户号码是否存在")
public ResponseModel hasExistPhone( @PathVariable(value = "phone") String phone) {
try {
return CommonResponseUtil.success(Privilege.agencyUserClient.checkLoginId(phone).getResult());
} catch (Exception e) {
return CommonResponseUtil.failure("该手机号已经注册");
}
}
/**
* 手动生成已通过企业的二维码
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/addQRcode")
@ApiOperation(httpMethod = "GET", value = "手动生成已通过企业的二维码", notes = "手动生成已通过企业的二维码")
public ResponseModel<Boolean> addQRcode() {
Boolean flag = unitInfoServiceImpl.addQRcode();
return ResponseHelper.buildResponse(flag);
}
/**
* 根据当前登录人获取企业信息--编辑
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUserUnitEdit")
@ApiOperation(httpMethod = "GET",value = "根据当前登录人获取企业信息--编辑", notes = "根据当前登录人获取企业信息--编辑")
public ResponseModel<UnitInfoDto> getUserUnitEdit() {
AgencyUserModel user = Privilege.agencyUserClient.getme().getResult();
List<CompanyModel> companys = user.getCompanys();
UnitInfoDto result = new UnitInfoDto();
for(CompanyModel c : companys) {
OrgUsr temp = iOrgUsrService.getOne(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getIsDelete,false).eq(OrgUsr::getAmosOrgId,c.getSequenceNbr()));
if(temp != null) {
// 企业信息查看判断是否变更 如果变更信息则返回变更中信息
result = unitInfoServiceImpl.getDtoByOrgId(temp.getSequenceNbr());
return ResponseHelper.buildResponse(result);
}
}
return ResponseHelper.buildResponse(result);
}
}
......@@ -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;
......@@ -141,6 +142,15 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
}
Integer approveStatus = approveDto.getApproveStatus(); // 0通过 1驳回
Boolean changeFlag = false;
UnitInfo temp = this.getOne(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getIsDelete,false).eq(UnitInfo::getOrganizationCode,sourceUnit.getOrganizationCode()).eq(UnitInfo::getUnitStatus,"1").ne(UnitInfo::getSequenceNbr,sourceUnit.getSequenceNbr()).
or().eq(UnitInfo::getIsChange,true).eq(UnitInfo::getOrganizationCode,sourceUnit.getOrganizationCode()).ne(UnitInfo::getSequenceNbr,approveDto.getSequenceNbr()));
if(temp != null) {
throw new BadRequest("单位组织编码已存在请确认");
}
if(changeUnit != null) {
changeFlag = true;
approveDto.setUnitId(changeUnit.getSequenceNbr());
......@@ -306,7 +316,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("注册失败");
......@@ -558,6 +575,16 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
}
@Override
public Boolean addQRcode() {
// 获取所有已经通过的且没有二维码的企业信息
List<UnitInfo> list = baseMapper.getUnitWithoutQrcode();
list.stream().forEach(t -> {
this.saveUnitInfoQrCode(t);
});
return true;
}
@Override
public List<UnitInfoDto> getAllUnit() {
return baseMapper.getAllUnit();
}
......
......@@ -4757,10 +4757,11 @@ FROM
(
(
SELECT
`a`.`value` AS `yhxfscyw`,
ifnull(sum(`a`.`value`), 0) AS `yhxfscyw`,
ifnull(
(
CASE
WHEN (`a`.`value` IS NULL) THEN
WHEN (`a`.`value` = NULL) THEN
0
WHEN (
(`a`.`value` <> '')
......@@ -4772,12 +4773,14 @@ FROM
),
2
)
WHEN (`b`.`height` IS NULL) THEN
WHEN (`b`.`height` = NULL) THEN
0
END
),
0
) AS `yhxfscyl`,
`b`.`waterStorage` AS `yhxfsccs`,
`b`.`height` AS `yhxfscg`
ifnull(`b`.`waterStorage`, 0) AS `yhxfsccs`,
ifnull(`b`.`height`, 0) AS `yhxfscg`
FROM
(
(
......@@ -4794,7 +4797,7 @@ FROM
`si`.`equipment_index_key` = 'FHS_FirePoolDevice_WaterLevel'
)
AND (
`s`.`code` = '1HXFSCCJZZ100000' --1号消防水池装置code
`s`.`code` = '1HXFSCCJZZ100000'
)
AND (
`si`.`equipment_specific_id` = `s`.`id`
......@@ -4841,7 +4844,7 @@ FROM
(
(`i`.`field_name` = 'code')
AND (
`i`.`field_value` = 'SC105035' --1号消防水池(建筑或者房间类型)code
`i`.`field_value` = 'SC106268'
)
)
LIMIT 1
......@@ -4851,12 +4854,13 @@ FROM
) `b`
)
) `yh`
JOIN (
LEFT JOIN (
SELECT
`a`.`value` AS `ehxfscyw`,
ifnull(sum(`a`.`value`), 0) AS `ehxfscyw`,
ifnull(
(
CASE
WHEN (`a`.`value` IS NULL) THEN
WHEN (`a`.`value` = NULL) THEN
0
WHEN (
(`a`.`value` <> '')
......@@ -4868,12 +4872,14 @@ FROM
),
2
)
WHEN (`b`.`height` IS NULL) THEN
WHEN (`b`.`height` = NULL) THEN
0
END
),
0
) AS `ehxfscyl`,
`b`.`waterStorage` AS `ehxfsccs`,
`b`.`height` AS `ehxfscg`
ifnull(`b`.`waterStorage`, 0) AS `ehxfsccs`,
ifnull(`b`.`height`, 0) AS `ehxfscg`
FROM
(
(
......@@ -4890,7 +4896,7 @@ FROM
`si`.`equipment_index_key` = 'FHS_FirePoolDevice_WaterLevel'
)
AND (
`s`.`code` = '1HXFSCCJZZ100001' --2号消防水池装置code
`s`.`code` = '1HXFSCCJZZ100000'
)
AND (
`si`.`equipment_specific_id` = `s`.`id`
......@@ -4937,7 +4943,7 @@ FROM
(
(`i`.`field_name` = 'code')
AND (
`i`.`field_value` = 'SC103119' --2号消防水池(建筑或者房间类型)code
`i`.`field_value` = 'SC106268'
)
)
LIMIT 1
......@@ -4946,8 +4952,8 @@ FROM
)
) `b`
)
) `eh`
);
) `eh` ON ((1 = 1))
);
-- 泡沫灭火3小
DROP VIEW IF EXISTS `v_fire_equip_ffs_num`;
CREATE ALGORITHM = UNDEFINED DEFINER = `root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_ffs_num` AS
......@@ -5040,10 +5046,10 @@ SELECT
(d.jygdqdpqd + d.jyddqdpqd + d.jegdqdpqd + d.jeddqdpqd) AS qdpqd,
(d.jygdqdpgz + d.jyddqdpgz + d.jegdqdpgz + d.jeddqdpgz) AS qdpgz,
(d.jygdqdppb + d.jyddqdppb + d.jegdqdppb + d.jeddqdppb) AS qdppb,
(d.jedddlq + d.jedddlq + d.jedddlq + d.jedddlq) AS dlqzs,
(d.jedddlqdl + d.jedddlqdl + d.jedddlqdl + d.jedddlqdl) AS dlqqd,
(d.jedddlqgz + d.jedddlqgz + d.jedddlqgz + d.jedddlqgz) AS dlqgz,
(d.jedddlqpb + d.jedddlqpb + d.jedddlqpb + d.jedddlqpb) AS dlqpb,
(d.jygddlq + d.jydddlq + d.jegddlq + d.jedddlq) AS dlqzs,
(d.jygddlqdl + d.jydddlqdl + d.jegddlqdl + d.jedddlqdl) AS dlqqd,
(d.jygddlqgz + d.jydddlqgz + d.jegddlqgz + d.jedddlqgz) AS dlqgz,
(d.jygddlqpb + d.jydddlqpb + d.jegddlqpb + d.jedddlqpb) AS dlqpb,
ABS (d.jygddlq - d.jygddlqdl + d.jydddlq - d.jydddlqdl + d.jegddlq - d.jegddlqdl + d.jedddlq - d.jedddlqdl) AS dlqjt
FROM
(
......
......@@ -18,7 +18,7 @@
)
select
a1.*,
DATE_FORMAT(NOW(),'%Y-%m')
DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 day),'%Y-%m')
from
(SELECT
system_id,
......
......@@ -189,7 +189,7 @@
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
wlesal.build_id AS buildId,
wles.warehouse_structure_id AS buildId,
we.img AS imgUrl,
CASE
wlesal.equipment_specific_index_value
......@@ -199,7 +199,7 @@
AS fireEquipmentPointValue,
wlesal.type AS type,
wlesal.create_date AS createDate,
CONCAT_WS(' ',ware.full_name,wsd.description) AS warehouseStructureName,
CONCAT_WS(' ',ware.full_name,wsd.description,wled.area) AS warehouseStructureName,
(select
group_concat(fet.`name`)
from f_equipment_fire_equipment as fefe
......@@ -304,7 +304,7 @@
IF (
wlesal.confirm_type <![CDATA[<>]]> '',
'已处理',
'去确认'
'未处理'
) handleStatus,
IF (
wlesal.clean_time IS NOT NULL,
......
......@@ -353,7 +353,8 @@
category.NAME AS categoryName,
category.CODE AS categoryCode,
equipment_detail.area AS address,
CONCAT(area.prevName,'-',structure.NAME) AS acre,
<!-- CONCAT(area.prevName,'-',structure.NAME) AS acre,-->
spec.position AS acre,
we.inspection_spec as inspectionSpecId,
0 as orderNo
FROM
......@@ -390,7 +391,7 @@
</if>
<if test="equipCode != '' and equipCode != null">and spec.code like concat("%", #{equipCode}, "%")</if>
<if test="equipName != '' and equipName != null">
and equipment_detail.name like CONCAT("%", #{equipName},'%')
and spec.name like CONCAT("%", #{equipName},'%')
</if>
</select>
......
eureka.client.serviceUrl.defaultZone=http://172.16.10.72:10001/eureka/
eureka.client.serviceUrl.defaultZone=http://172.16.11.20:10001/eureka/
eureka.client.registry-fetch-interval-seconds=5
eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
......@@ -17,9 +17,9 @@ ribbon.MaxAutoRetriesNextServer = 2
ribbon.MaxAutoRetries = 1
#DB properties:
spring.datasource.url = jdbc:mysql://172.16.6.60:3306/safety-business-3.0.1?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username= root
spring.datasource.password= root_123
spring.datasource.url = jdbc:mysql://172.16.3.20:3307/autosys_business_v3.0.1.3?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.driver-class-name = com.mysql.jdbc.Driver
spring.datasource.hikari.maxLifetime = 1765000
spring.datasource.hikari.maximum-pool-size = 10
......@@ -33,10 +33,10 @@ security.productApp=STUDIO_APP_MOBILE
security.appKey=studio_normalapp_3168830
#redis 配置
spring.redis.database=0
spring.redis.host=172.16.10.85
spring.redis.database=1
spring.redis.host=172.16.11.20
spring.redis.port=6379
spring.redis.password=amos2019Redis
spring.redis.password=1234560
spring.redis.jedis.pool.max-active=200
spring.redis.jedis.pool.max-wait=-1
spring.redis.jedis.pool.max-idle=10
......
......@@ -47,19 +47,19 @@ tzs.cti.secretkey=7bd29115-99ee-4f7d-1fb1-7c4719d5f43a
tzs.cti.url=http://36.46.151.113:8000
tzs.wechat.url=https://api.weixin.qq.com
tzs.wechat.appid=wx79aca5bb1cb4af92
tzs.wechat.secret=f3a12323ba731d282c3d4698c27c3e97
tzs.wechat.appid=wx8918c1aaad956617
tzs.wechat.secret=337c3d8f3e749140d4f9aedc8311033b
##wechatToken
tzs.wechat.token=yeejoin_2021
##wechatTicketUrl
tzs.wechat.ticketurl=https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=
tzs.wechat.tempId.kr=bxchKYhYW7aHbGKM2pVyR_yY2-bG4sRMNU3ZRQbMKYM
tzs.wechat.tempId.kr=rjW8x9rRitIpa21Jekyx2nzBzpJy7tycssCXSN4YhWw
tzs.wechat.url.kr=tzs.yeeamos.com/persondetail.html
tzs.wechat.tempId.wx=rags-expfNSBB-h2WenuBI2c6pCEndH4uwTtOqlHqDM
tzs.wechat.tempId.wx=ofBIZS8Bup9s0zKbrGa8BfhVhS18H_hyC_OYXuBN6hI
tzs.wechat.url.wx=tzs.yeeamos.com/repairPersondetail.html
tzs.wechat.tempId.ts=rags-expfNSBB-h2WenuBI2c6pCEndH4uwTtOqlHqDM
tzs.wechat.tempId.ts=Kr7lcV8g4g_lgyW_RpwnNgw_HDxxRuVx759EoFWrIfU
tzs.wechat.url.ts=tzs.yeeamos.com/taskComplaintDetail.html
mqtt.topic.task.newtask=tzs-task-newtask
......
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