Commit 5eeeda50 authored by maoying's avatar maoying

Merge branch 'developer' into temp

parents bce42985 f351caa0
......@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
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.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentIndexDto;
......@@ -77,11 +78,15 @@ public class EquipmentController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增装备信息表", notes = "新增装备信息表")
public ResponseModel<EquipmentDto> save(@RequestBody EquipmentDto model) {
model = equipmentServiceImpl.createEquipment(model);
return ResponseHelper.buildResponse(model);
}
public ResponseModel save(@RequestBody EquipmentDto model) {
try {
model = equipmentServiceImpl.createEquipment(model);
return CommonResponseUtil.success(model);
} catch (Exception e) {
return CommonResponseUtil.failure("该手机号已经注册");
}
}
/**
* 根据sequenceNbr查询
......
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.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;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto;
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;
/**
* 设备告知单
......
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("参数校验失败.");
}
UnitInfoDto model = unitInfoServiceImpl.approve(approveDto);
return ResponseHelper.buildResponse(model);
try {
UnitInfoDto model = unitInfoServiceImpl.approve(approveDto);
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) {
model = unitInfoServiceImpl.changeUnInfo(model);
return ResponseHelper.buildResponse(model);
try {
model = unitInfoServiceImpl.changeUnInfo(model);
return CommonResponseUtil.success(model);
} catch (Exception e) {
return CommonResponseUtil.failure(e.getMessage());
}
}
/**
......@@ -532,7 +535,6 @@ public class UnitInfoController extends BaseController {
return ResponseHelper.buildResponse(unitInfoVoIPage);
}
/**
* 判断用户号码是否存在
*
......@@ -541,9 +543,12 @@ public class UnitInfoController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/hasExistPhone/{phone}")
@ApiOperation(httpMethod = "GET", value = "判断用户号码是否存在", notes = "判断用户号码是否存在")
public ResponseModel<Boolean> hasExistPhone( @PathVariable(value = "phone") String phone) {
Boolean flag = Privilege.agencyUserClient.checkLoginId(phone).getResult();
return ResponseHelper.buildResponse(flag);
public ResponseModel hasExistPhone( @PathVariable(value = "phone") String phone) {
try {
return CommonResponseUtil.success(Privilege.agencyUserClient.checkLoginId(phone).getResult());
} catch (Exception e) {
return CommonResponseUtil.failure("该手机号已经注册");
}
}
......@@ -562,4 +567,27 @@ public class UnitInfoController extends BaseController {
/**
* 根据当前登录人获取企业信息--编辑
* @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);
}
}
......@@ -142,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());
......
......@@ -4757,27 +4757,30 @@ FROM
(
(
SELECT
`a`.`value` AS `yhxfscyw`,
(
CASE
WHEN (`a`.`value` IS NULL) THEN
0
WHEN (
(`a`.`value` <> '')
AND (`b`.`height` <> '')
) THEN
round(
(
(`a`.`value` / `b`.`height`) * 100
),
2
)
WHEN (`b`.`height` IS NULL) THEN
0
END
ifnull(sum(`a`.`value`), 0) AS `yhxfscyw`,
ifnull(
(
CASE
WHEN (`a`.`value` = NULL) THEN
0
WHEN (
(`a`.`value` <> '')
AND (`b`.`height` <> '')
) THEN
round(
(
(`a`.`value` / `b`.`height`) * 100
),
2
)
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,29 +4854,32 @@ FROM
) `b`
)
) `yh`
JOIN (
LEFT JOIN (
SELECT
`a`.`value` AS `ehxfscyw`,
(
CASE
WHEN (`a`.`value` IS NULL) THEN
0
WHEN (
(`a`.`value` <> '')
AND (`b`.`height` <> '')
) THEN
round(
(
(`a`.`value` / `b`.`height`) * 100
),
2
)
WHEN (`b`.`height` IS NULL) THEN
0
END
ifnull(sum(`a`.`value`), 0) AS `ehxfscyw`,
ifnull(
(
CASE
WHEN (`a`.`value` = NULL) THEN
0
WHEN (
(`a`.`value` <> '')
AND (`b`.`height` <> '')
) THEN
round(
(
(`a`.`value` / `b`.`height`) * 100
),
2
)
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,
......
......@@ -19,15 +19,7 @@
ala.equipment_specific_index_name,
ala.type as equipment_specific_index_key,
concat(ala.equipment_specific_name,ala.equipment_specific_index_name) as alarmContent,
(
SELECT
ws.full_name
FROM
wl_warehouse_structure ws,wl_stock_detail sd
WHERE
ws.id = sd.warehouse_structure_id
and sd.equipment_specific_id = ala.equipment_specific_id
) AS alarmPlace,
ala.location AS alarmPlace,
ala.create_date as create_date,
ala.location as location,
if(spe.code is null,ala.equipment_specific_name,concat(ala.equipment_specific_name,'(',spe.code,')')) as equipmentName,
......
......@@ -145,14 +145,15 @@
</select>
<select id="listFmeaByFmeaId" resultType="com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint">
select
id,
fmea_id as fmeaId,
equipment_point_id as equipmentPointId,
state
from
f_fmea_equipment_point
where
SELECT
fep.id,
fep.fmea_id AS fmeaId,
fep.equipment_point_id AS equipmentPointId,
fep.state
FROM
f_fmea_equipment_point fep
RIGHT JOIN wl_equipment_specific_index esi ON esi.id = fep.equipment_point_id
WHERE
fmea_id = #{fmeaId}
</select>
......
......@@ -113,14 +113,15 @@
</select>
<select id="listFmeaByFmeaId" resultType="com.yeejoin.amos.fas.dao.entity.FmeaPointInputitem">
select
id,
fmea_id as fmeaId,
point_inputitem_id as pointInputitemId,
state
from
f_fmea_point_inputitem
where
SELECT
fpi.id,
fpi.fmea_id AS fmeaId,
fpi.point_inputitem_id AS pointInputitemId,
fpi.state
FROM
f_fmea_point_inputitem fpi
RIGHT JOIN p_point_inputitem ppi ON ppi.id = fpi.point_inputitem_id
WHERE
fmea_id = #{fmeaId}
</select>
......
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