Commit d0cdb74e authored by KeYong's avatar KeYong

Merge branch 'develop_dl_plan6' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6

parents 0938c468 101d3358
......@@ -10,8 +10,12 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.biz.enums.DataDictionaryTypeEnum;
import com.yeejoin.amos.boot.module.common.biz.enums.DynamicGroupCodeEnum;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -74,7 +78,7 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
}
Map<String, Object> map = Bean.BeantoMap(dutyPersonDto);
buildDataMap(map, userId);
if (!instances.isEmpty()) {
// 0.定位instanceId,准备进行更新操作
instanceId = instances.get(0).getInstanceId(); // 已经有了走更新方法
......@@ -132,7 +136,27 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
}
private Map<String, Object> buildDataMap(Map<String, Object> d, String userId) {
// 表单存在人员类型,获取用户ID,查询人员类型赋值
if (!ObjectUtils.isEmpty(userId)) {
List<DynamicFormInstance> instances = dynamicFormInstanceService
.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "peopleType")
.eq(DynamicFormInstance::getInstanceId, userId)
.eq(DynamicFormInstance::getGroupCode, DynamicGroupCodeEnum.JCS_PERSON.getCode()));
if (!CollectionUtils.isEmpty(instances)) {
String fieldValue = instances.get(0).getFieldValue();
List<DataDictionary> dictionaryList = dataDictionaryService.getByType(DataDictionaryTypeEnum.PERSON_TYPE.getCode());
if (StringUtils.isNotBlank(fieldValue) && !CollectionUtils.isEmpty(dictionaryList)) {
Map<String, List<DataDictionary>> map = dictionaryList.stream().collect(Collectors.groupingBy(DataDictionary::getCode));
List<DataDictionary> list = map.get(fieldValue);
if (!CollectionUtils.isEmpty(list)) {
d.put("personType", list.get(0).getName());
}
}
}
}
return d;
}
@Override
public DutyPersonDto update(Long instanceId, DutyPersonDto dutyPersonDto) {
String groupCode = this.getGroupCode();
......@@ -144,6 +168,7 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
//页面数据转Map
Map<String, Object> map = Bean.BeantoMap(dutyPersonDto);
buildDataMap(map, dutyPersonDto.getUserId());
//4.已列为主 填充动态表单数据
List<DynamicFormInstance> entrys = new ArrayList<>();
for (DynamicFormColumn column : columns) {
......
......@@ -2995,7 +2995,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
peopleInfoDto.getFirefighters().setSequenceNbr(orgUsrDto.getSequenceNbr().toString());
}
if (peopleInfoDto.getFirefighters() != null && "2".equals(peopleInfoDto.getFirefighters().getPeopleType())) {
if (peopleInfoDto.getFirefighters() != null && "1601".equals(peopleInfoDto.getFirefighters().getPeopleType())) {
// 3.同步保存cb_firefighters消防人员基础信息
saveFirefighters(peopleInfoDto);
} else {
......@@ -3220,7 +3220,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
peopleBasicInfoDto.setCompanyName(orgUsr.getParentName());
}
if ("2".equals(peopleBasicInfoDto.getPeopleType())) {
if ("1601".equals(peopleBasicInfoDto.getPeopleType())) {
QueryWrapper<Firefighters> firefightersQueryWrapper = new QueryWrapper<>();
Firefighters firefighters = iFirefightersService.getOne(firefightersQueryWrapper.eq("org_usr_id", id).eq("is_delete", 0));
if (!ObjectUtils.isEmpty(firefighters)) {
......@@ -3253,7 +3253,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Transactional(rollbackFor = Exception.class)
public String deletePeopleById(Long id, String type, AgencyUserModel user) {
if ("2".equals(type)) {
if ("1601".equals(type)) {
QueryWrapper<Firefighters> firefightersQueryWrapper = new QueryWrapper<>();
Firefighters firefighters = iFirefightersService.getOne(firefightersQueryWrapper.eq("org_usr_id", id).eq("is_delete", 0));
Long firefightersSequenceNbr = firefighters.getSequenceNbr();
......@@ -3315,7 +3315,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
deleteFirefightersPost(String.valueOf(id));
// 3.根据type是否删除消防人员
if ("2".equals(type)) {
if ("1601".equals(type)) {
deleteFirefighters(id);
}
......
......@@ -26,6 +26,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -323,7 +324,9 @@ public class CarController extends AbstractBaseController {
//用来解绑车辆
jcsFeign.getUserCar(car.getId(),car.getTeamId());
if (!ObjectUtils.isEmpty(car.getTeamId())){
jcsFeign.getUserCar(car.getId(),car.getTeamId());
}
Car car1 = iCarService.updateOneById(car);
CarController controllerProxy = SpringUtils.getBean(CarController.class);
controllerProxy.refreshAllCount();
......
......@@ -182,10 +182,10 @@ public class EquipmentAlarmController extends AbstractBaseController {
*
* @return
*/
@RequestMapping(value = "/listPage", method = RequestMethod.GET)
@RequestMapping(value = "/allList", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "列表分页查询", produces = "application/json;charset=UTF-8", notes = "列表分页查询")
public ResponseModel list(@RequestParam(value = "beginDate", required = false) String beginDate,
public ResponseModel allList(@RequestParam(value = "beginDate", required = false) String beginDate,
@RequestParam(value = "endDate", required = false) String endDate,
@RequestParam(value = "warehouseStructureName", required = false) String warehouseStructureName,
@RequestParam(value = "equipCode", required = false) String equipCode,
......@@ -268,7 +268,7 @@ public class EquipmentAlarmController extends AbstractBaseController {
request13.setValue("");
}
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
Page<Map<String, Object>> list = iEquipmentSpecificAlarmService.pageList(param);
List<Map<String, Object>> list = iEquipmentSpecificAlarmService.allList(param);
return CommonResponseUtil.success(list);
}
......
......@@ -2,7 +2,9 @@ package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.MarqueeData;
import com.yeejoin.equipmanage.common.utils.CommonPageInfoParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
......@@ -12,6 +14,6 @@ import java.util.Map;
public interface MarqueeDataMapper extends BaseMapper<MarqueeData> {
List<Map<String, Object>> selectAll();
List<Map<String, Object>> selectAll(@Param("param") CommonPageInfoParam param);
}
......@@ -96,7 +96,7 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif
List<Map<String, Object>> alarmTrend(String bizOrgCode);
Page<Map<String, Object>> pageList(CommonPageInfoParam param);
List<Map<String, Object>> allList(CommonPageInfoParam param);
int updateReadStatus(String messageId);
}
......@@ -749,17 +749,14 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
}
@Override
public Page<Map<String, Object>> pageList(CommonPageInfoParam param) {
Page result = new Page<>(param.getPageNumber(), param.getPageSize());
public List<Map<String, Object>> allList(CommonPageInfoParam param) {
if (AlarmTypeEnum.GZGJ.getCode().equals(param.getAlarmType())) {
param.setAlarmType("");
param.setIsFireAlarm("false");
}
Page<Map<String, Object>> resultPage = this.baseMapper.page(result, param);
if (resultPage.getTotal() > 0) {
for (Map<String, Object> x : resultPage.getRecords()) {
// LocalDateTime createDate = (LocalDateTime) x.get("createDate");
// x.put("createDate", Date.from(createDate.atZone(ZoneId.systemDefault()).toInstant()));
List<Map<String, Object>> list = marqueeDataMapper.selectAll(param);
if (list.size() > 0) {
for (Map<String, Object> x : list) {
if (ObjectUtils.isEmpty(x.get("handleType"))) {
x.put("handleType", null);
} else {
......@@ -770,14 +767,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
x.put("equipmentSpecificIndexName", x.get("fireEquipmentSpecificIndexName"));
}
}
List<Map<String, Object>> list = marqueeDataMapper.selectAll();
List<Map<String, Object>> resList = new ArrayList();
for (Map<String, Object> stringObjectMap : list) {
resList.add(stringObjectMap);
}
resList.sort((t1, t2) -> t2.get("createDate").toString().compareTo(t1.get("createDate").toString()));
resultPage.setRecords(resList);
return resultPage;
return list;
}
@Override
......
......@@ -1838,12 +1838,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
Date now = new Date();
String scrapTime = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN).format(calendar.getTime());
long time1 = calendar.getTimeInMillis();
calendar.setTime(now);
long time2 = calendar.getTimeInMillis();
long between_days=(time2-time1)/(10003600*24);
int day = Integer.parseInt(String.valueOf(between_days));
int day = DateUtils.dateBetween(now,calendar.getTime());
if(day < Integer.parseInt(equipmentScrapDay) && day > -1) {
syncSystemctlMsg(e, scrapTime, day);
}
......
......@@ -437,7 +437,7 @@ public class FirefightersController extends BaseController {
@ApiOperation(httpMethod = "PUT", value = "获取人员详情", notes = "获取人员详情")
public ResponseModel<PeopleInfoDto> updatePeopleById(@RequestBody PeopleInfoDto firefighters, @PathVariable Long id) {
try {
if ("2".equals(firefighters.getFirefighters().getPeopleType())){
if ("1601".equals(firefighters.getFirefighters().getPeopleType())){
PeopleBasicInfoDto peopleBasicInfoDto = firefighters.getFirefighters();
Firefighters firefighter = new Firefighters();
BeanUtils.copyProperties(peopleBasicInfoDto, firefighter);
......
......@@ -4888,7 +4888,7 @@
LEFT JOIN wl_form_instance fi ON fi.instance_id = es.id
WHERE
ed.`code` LIKE '92011000%'
AND es.iot_code IS NOT NULL
<!-- AND es.iot_code IS NOT NULL-->
AND es.biz_org_code like concat(#{bizOrgCode}, '%')
GROUP BY
es.id
......
......@@ -3,21 +3,100 @@
<mapper namespace="com.yeejoin.equipmanage.mapper.MarqueeDataMapper">
<select id="selectAll" resultType="java.util.Map">
select
id messageId,
type equipmentSpecificIndexName,
position,
name equipmentSpecificName,
date_format(
create_date,
'%Y-%m-%d %H:%i:%s'
) createDate,
message_type messageType,
is_read isRead,
equipment_specific_id id
from
wl_marquee_data
where
is_read = '0'
SELECT
wlesal.id,
wlesal.org_code,
wlesal.equipment_specific_id AS fireEquipmentId,
wles.equipment_detail_id AS equipDetailId,
wles.CODE AS fireEquipmentCode,
wles.system_id AS systemId,
IF
(
wles.CODE IS NULL,
wlesal.equipment_specific_name,
concat( wlesal.equipment_specific_name, '(', wles.CODE, ')' )) AS fireEquipmentName,
concat( wlesal.equipment_specific_name, wlesal.equipment_specific_index_name ) AS alamContent,
IF
( wlesal.confirm_type IS NULL, '未处理', '已处理' ) handleStatus,
IF
( wlesal.clean_time IS NOT NULL, '已消除', '未消除' ) cleanStatus,
confirm_type AS handleType,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
wles.warehouse_structure_id AS buildId,
we.img AS imgUrl,
CASE
wlesal.equipment_specific_index_value
WHEN 'true' THEN
'是'
WHEN 'false' THEN
'否' ELSE wlesal.equipment_specific_index_value
END AS fireEquipmentPointValue,
wlesal.type AS typeCode,
( SELECT type_name FROM wl_signal_classify sc WHERE sc.type_code = wlesal.type LIMIT 1 ) AS type,
date_format( wlesal.create_date, '%Y-%m-%d %H:%i:%s' ) createDate,
CONCAT_WS( ' ', wles.position, wled.area ) AS warehouseStructureName,
/*告警列表拼接详细地址*/
(
SELECT
group_concat( fet.`name` )
FROM
f_equipment_fire_equipment AS fefe
LEFT JOIN f_equipment AS fet ON fet.id = fefe.equipment_id
WHERE
fefe.fire_equipment_id = wlesal.equipment_specific_id
) AS equipmentName,
wlesal.equipment_specific_name AS equipmentSpecificName,
wles.position,
null messageId,
null messageType,
null isRead
FROM wl_equipment_specific_alarm_log wlesal
LEFT JOIN wl_equipment_specific wles ON wlesal.equipment_specific_id = wles.id
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
LEFT JOIN wl_equipment we ON wled.equipment_id = we.id
<where>
<if test="param.cleanStatus != null and param.cleanStatus != '' and param.cleanStatus == 2">
wlesal.clean_time IS NULL
</if>
<if test="param.bizOrgCode != null and param.bizOrgCode != ''">AND
wles.biz_org_code like concat (#{param.bizOrgCode},'%')
</if>
</where>
UNION ALL
SELECT
equipment_specific_id id,
NULL org_code,
null fireEquipmentId,
NULL equipDetailId,
NULL fireEquipmentCode,
null systemId,
NULL fireEquipmentName,
NULL alamContent,
NULL handleStatus,
NULL cleanStatus,
NULL handleType,
NULL fireEquipmentIndexId,
NULL fireEquipmentSpecificIndexKey,
type fireEquipmentSpecificIndexName,
NULL buildId,
NULL imgUrl,
NULL fireEquipmentPointValue,
NULL typeCode,
NULL type,
date_format( create_date, '%Y-%m-%d %H:%i:%s' ) createDate,
NULL warehouseStructureName,
NULL equipmentName,
NAME equipmentSpecificName,
position,
id messageId,
message_type messageType,
is_read isRead
FROM
wl_marquee_data
WHERE
is_read = '0'
ORDER BY createDate DESC
</select>
</mapper>
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