Commit 9e46aa4e authored by zhangsen's avatar zhangsen

Merge branch 'develop_dl_plan6' into develop_dl_plan6_temp

parents cceaa879 ab35117a
...@@ -9,4 +9,21 @@ ...@@ -9,4 +9,21 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>amos-boot-module-ccs-api</artifactId> <artifactId>amos-boot-module-ccs-api</artifactId>
<dependencies>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-component-emq</artifactId>
<version>1.1.20</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project> </project>
\ No newline at end of file
...@@ -129,7 +129,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> { ...@@ -129,7 +129,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
* @param instanceIds * @param instanceIds
* @return * @return
*/ */
List<Map<String, Object>> getPositionStaffDutyForSpecifyDate(String dutyDate,String groupCode,String[] instanceIds,String duty); List<Map<String, Object>> getPositionStaffDutyForSpecifyDate(String dutyDate,String groupCode,String[] instanceIds,String duty, String fieldCode);
/** /**
......
...@@ -130,5 +130,5 @@ public interface IDutyCommonService { ...@@ -130,5 +130,5 @@ public interface IDutyCommonService {
*/ */
public void insertPersonShift(Long instanceId, List<DutyPersonShiftDto> dutyShiftList); public void insertPersonShift(Long instanceId, List<DutyPersonShiftDto> dutyShiftList);
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType); public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode);
} }
...@@ -343,12 +343,24 @@ FROM ...@@ -343,12 +343,24 @@ FROM
cd.FIELD_VALUE cd.FIELD_VALUE
END END
) AS 'userName', ) AS 'userName',
MAX( <choose>
CASE <when test="fieldCode != null and fieldCode != ''">
WHEN cd.FIELD_CODE = 'postTypeName' THEN MAX(
CASE
WHEN cd.FIELD_CODE = #{fieldCode} THEN
cd.FIELD_VALUE cd.FIELD_VALUE
END END
) AS 'postTypeName', ) AS 'postTypeName',
</when>
<otherwise>
MAX(
CASE
WHEN cd.FIELD_CODE = 'postTypeName' THEN
cd.FIELD_VALUE
END
) AS 'postTypeName',
</otherwise>
</choose>
cd.instance_id cd.instance_id
FROM FROM
cb_dynamic_form_instance cd cb_dynamic_form_instance cd
......
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
LEFT JOIN cb_dynamic_form_column f ON f.sequence_nbr = v.form_column_id LEFT JOIN cb_dynamic_form_column f ON f.sequence_nbr = v.form_column_id
where u.parent_id = #{parentId} where u.parent_id = #{parentId}
AND u.biz_org_type = #{bizOrgType} AND u.biz_org_type = #{bizOrgType}
AND U.is_delete = 0 AND u.is_delete = 0
GROUP BY GROUP BY
u.sequence_nbr , u.sequence_nbr ,
u.biz_org_name , u.biz_org_name ,
......
...@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil; ...@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto; import com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireEquipmentSignalLog; import com.yeejoin.amos.boot.module.ccs.api.entity.FireEquipmentSignalLog;
...@@ -17,12 +18,15 @@ import com.yeejoin.amos.boot.module.ccs.api.vo.RawDataVO; ...@@ -17,12 +18,15 @@ import com.yeejoin.amos.boot.module.ccs.api.vo.RawDataVO;
import com.yeejoin.amos.boot.module.ccs.api.vo.ReceiveDataVO; import com.yeejoin.amos.boot.module.ccs.api.vo.ReceiveDataVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -43,6 +47,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -43,6 +47,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Autowired @Autowired
private FireEquipmentSignalLogMapper fireEquipmentSignalLogMapper; private FireEquipmentSignalLogMapper fireEquipmentSignalLogMapper;
@Autowired
protected EmqKeeper emqKeeper;
public static final String EMERGENCY_ALARM_DATA_REFRESH = "emergency/alarm/data/refresh";
//TODO 逻辑待补充 //TODO 逻辑待补充
@Override @Override
...@@ -92,6 +100,15 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -92,6 +100,15 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
fireEquipmentSignalLog.setLng(oneByCode.getLng()); fireEquipmentSignalLog.setLng(oneByCode.getLng());
fireEquipmentSignalLog.setLat(oneByCode.getLat()); fireEquipmentSignalLog.setLat(oneByCode.getLat());
fireEquipmentSignalLogMapper.insert(fireEquipmentSignalLog); fireEquipmentSignalLogMapper.insert(fireEquipmentSignalLog);
// 发送mqtt消息--刷新应急指挥屏数据
HashMap<String, String> refresh = new HashMap<>();
refresh.put("uuId", String.valueOf(System.currentTimeMillis()));
try {
emqKeeper.getMqttClient().publish(EMERGENCY_ALARM_DATA_REFRESH, JSON.toJSONString(refresh).getBytes(), 0, false);
} catch (MqttException e) {
e.printStackTrace();
}
} }
} else if (ObjectUtil.isNotEmpty(receiveData) && StrUtil.isNotEmpty(receiveData.getActive()) && } else if (ObjectUtil.isNotEmpty(receiveData) && StrUtil.isNotEmpty(receiveData.getActive()) &&
"update".equals(receiveData.getActive()) && ObjectUtil.isNotEmpty(receiveData.getRawData()) && StrUtil.isNotEmpty(receiveData.getRawData().getEquipmentSpecificCode())) { "update".equals(receiveData.getActive()) && ObjectUtil.isNotEmpty(receiveData.getRawData()) && StrUtil.isNotEmpty(receiveData.getRawData().getEquipmentSpecificCode())) {
...@@ -102,6 +119,15 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -102,6 +119,15 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
updateWrapper.lambda().eq(FireEquipmentSignalLog::getFireEquipmentMrid, rawData.getEquipmentSpecificCode()) updateWrapper.lambda().eq(FireEquipmentSignalLog::getFireEquipmentMrid, rawData.getEquipmentSpecificCode())
.eq(FireEquipmentSignalLog::getFireEquipmentIndexKey, rawData.getEquipmentIndexKey()); .eq(FireEquipmentSignalLog::getFireEquipmentIndexKey, rawData.getEquipmentIndexKey());
fireEquipmentSignalLogServiceImpl.update(fireEquipmentSignalLog, updateWrapper); fireEquipmentSignalLogServiceImpl.update(fireEquipmentSignalLog, updateWrapper);
// 发送mqtt消息--刷新应急指挥屏数据
HashMap<String, String> refresh = new HashMap<>();
refresh.put("uuId", String.valueOf(System.currentTimeMillis()));
try {
emqKeeper.getMqttClient().publish(EMERGENCY_ALARM_DATA_REFRESH, JSON.toJSONString(refresh).getBytes(), 0, false);
} catch (MqttException e) {
e.printStackTrace();
}
} }
log.info(String.format("收到mqtt(警情)消息并处理完成:%s", message)); log.info(String.format("收到mqtt(警情)消息并处理完成:%s", message));
} }
......
...@@ -176,8 +176,9 @@ public class DutyCarController extends BaseController { ...@@ -176,8 +176,9 @@ public class DutyCarController extends BaseController {
@GetMapping("/person/{dutyDay}/list") @GetMapping("/person/{dutyDay}/list")
public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay, public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId, @ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){ @ApiParam(value = "岗位") @RequestParam(required = false) String postType,
return ResponseHelper.buildResponse(iDutyCarService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType)); @ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode){
return ResponseHelper.buildResponse(iDutyCarService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType, fieldCode));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("查询指定車輛值班人信息列表") @ApiOperation("查询指定車輛值班人信息列表")
......
...@@ -169,8 +169,9 @@ public class DutyFireFightingController extends BaseController{ ...@@ -169,8 +169,9 @@ public class DutyFireFightingController extends BaseController{
@GetMapping("/person/{dutyDay}/list") @GetMapping("/person/{dutyDay}/list")
public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay, public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId, @ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){ @ApiParam(value = "岗位") @RequestParam(required = false) String postType,
return ResponseHelper.buildResponse(iDutyFireFightingService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType)); @ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode){
return ResponseHelper.buildResponse(iDutyFireFightingService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType, fieldCode));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -161,7 +161,8 @@ public class DutyFirstAidController extends BaseController{ ...@@ -161,7 +161,8 @@ public class DutyFirstAidController extends BaseController{
@GetMapping("/person/{dutyDay}/list") @GetMapping("/person/{dutyDay}/list")
public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay, public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId, @ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){ @ApiParam(value = "岗位") @RequestParam(required = false) String postType,
return ResponseHelper.buildResponse(iDutyFirstAidService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType)); @ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode){
return ResponseHelper.buildResponse(iDutyFirstAidService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType, fieldCode));
} }
} }
package com.yeejoin.amos.boot.module.common.biz.controller; package com.yeejoin.amos.boot.module.common.biz.controller;
import java.text.ParseException; import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.Map; import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import javax.servlet.http.HttpServletResponse; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.*;
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.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -23,15 +16,10 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest; ...@@ -23,15 +16,10 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.metadata.IPage; import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import java.text.ParseException;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import java.util.List;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto; import java.util.Map;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
/** /**
...@@ -187,8 +175,9 @@ public class DutyPersonController extends BaseController { ...@@ -187,8 +175,9 @@ public class DutyPersonController extends BaseController {
@GetMapping("/new-person/{dutyDay}/list") @GetMapping("/new-person/{dutyDay}/list")
public ResponseModel newListDutyPerson(@ApiParam(value = "值班日期", required = true) @PathVariable String dutyDay, public ResponseModel newListDutyPerson(@ApiParam(value = "值班日期", required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId, @ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType) { @ApiParam(value = "岗位") @RequestParam(required = false) String postType,
return ResponseHelper.buildResponse(iDutyPersonService.getSchedulingDutyForSpecifyDate(dutyDay, shiftId, postType)); @ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode) {
return ResponseHelper.buildResponse(iDutyPersonService.getSchedulingDutyForSpecifyDate(dutyDay, shiftId, postType, fieldCode));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("查询当前值班人信息列表") @ApiOperation("查询当前值班人信息列表")
......
package com.yeejoin.amos.boot.module.common.biz.enums;
public enum DynamicGroupCode {
JCS_PERSON("机场人员", "246");
private String name;
private String code;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
DynamicGroupCode(String name, String code) {
this.name = name;
this.code = code;
}
}
...@@ -142,7 +142,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -142,7 +142,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
return result; return result;
} }
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) { public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay, List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "carId", "carName", "teamName","result.carId"); this.getGroupCode(), "carId", "carName", "teamName","result.carId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) { if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
...@@ -181,7 +181,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -181,7 +181,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
// } // }
// 获取当前装备ID下的排版数据 // 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay, List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
this.getGroupCode(), instanceIds,null); this.getGroupCode(), instanceIds,null, fieldCode);
/*if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) { /*if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) {
continue; continue;
}*/ }*/
...@@ -246,7 +246,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -246,7 +246,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
if (StringUtils.isNotBlank(instanceId)) { if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(","); String[] instanceIds = instanceId.split(",");
specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay, specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
this.getGroupCode(), instanceIds,null); this.getGroupCode(), instanceIds,null, null);
} }
return specifyDateList; return specifyDateList;
} }
......
...@@ -11,6 +11,8 @@ import java.util.stream.Stream; ...@@ -11,6 +11,8 @@ import java.util.stream.Stream;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.boot.module.common.biz.enums.DynamicGroupCode;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -509,6 +511,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -509,6 +511,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
Long instanceId = null; Long instanceId = null;
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>() List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>()
.eq(DynamicFormColumn::getGroupCode, this.getGroupCode())); .eq(DynamicFormColumn::getGroupCode, this.getGroupCode()));
Map<String, Object> dataMap = buildDataMap(d, userId);
// 1.组装动态表单数据 // 1.组装动态表单数据
if (!instances.isEmpty()) { if (!instances.isEmpty()) {
// 0.定位instanceId,准备进行更新操作 // 0.定位instanceId,准备进行更新操作
...@@ -521,7 +524,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -521,7 +524,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(instancesInDb, "fieldCode", Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(instancesInDb, "fieldCode",
DynamicFormInstance.class); DynamicFormInstance.class);
// 3.待更新数据组装,待批量入库 // 3.待更新数据组装,待批量入库
this.updateFormValue(formInstanceList, d, instanceId, columns, instanceMap); this.updateFormValue(formInstanceList, dataMap, instanceId, columns, instanceMap);
} else { } else {
// 0.新数据,生成id // 0.新数据,生成id
instanceId = sequence.nextId(); instanceId = sequence.nextId();
...@@ -529,14 +532,14 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -529,14 +532,14 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
// 1.组装数据 // 1.组装数据
List<DynamicFormInstance> newInstances = columns.stream().map(column -> { List<DynamicFormInstance> newInstances = columns.stream().map(column -> {
DynamicFormInstance instance = new DynamicFormInstance(); DynamicFormInstance instance = new DynamicFormInstance();
buildFormInstanceData(finalInstanceId1, d, column, instance); buildFormInstanceData(finalInstanceId1, dataMap, column, instance);
return instance; return instance;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
// 2.待更新数据组装,待批量入库 // 2.待更新数据组装,待批量入库
formInstanceList.addAll(newInstances); formInstanceList.addAll(newInstances);
} }
// 2.组装值班数据 // 2.组装值班数据
List<DutyPersonShiftDto> shiftDtos = (List<DutyPersonShiftDto>) d.get("dutyShift"); List<DutyPersonShiftDto> shiftDtos = (List<DutyPersonShiftDto>) dataMap.get("dutyShift");
Long finalInstanceId = instanceId; Long finalInstanceId = instanceId;
// 按照业务唯一索引查询主键 // 按照业务唯一索引查询主键
List<DutyPersonShift> dutyPersonShiftsDb = dutyPersonShiftService List<DutyPersonShift> dutyPersonShiftsDb = dutyPersonShiftService
...@@ -580,6 +583,20 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -580,6 +583,20 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
} }
} }
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, DynamicGroupCode.JCS_PERSON.getCode()));
if (!CollectionUtils.isEmpty(instances)) {
d.put("personType", instances.get(0).getFieldValue());
}
}
return d;
}
private void buildFormInstanceData(Long instanceId, Map<String, Object> map, DynamicFormColumn column, private void buildFormInstanceData(Long instanceId, Map<String, Object> map, DynamicFormColumn column,
DynamicFormInstance formInstance) { DynamicFormInstance formInstance) {
fillFormInstanceData(instanceId, map, column, formInstance, sequence.nextId()); fillFormInstanceData(instanceId, map, column, formInstance, sequence.nextId());
...@@ -815,7 +832,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -815,7 +832,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
} }
@Override @Override
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) { public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return null; return null;
} }
......
...@@ -55,7 +55,7 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement ...@@ -55,7 +55,7 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
insertPersonShift(instanceId, dto.getDutyShift()); insertPersonShift(instanceId, dto.getDutyShift());
return dto; return dto;
} }
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) { public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay, List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "fireFightingId", "fireFighting", "teamName","result.fireFightingId"); this.getGroupCode(), "fireFightingId", "fireFighting", "teamName","result.fireFightingId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) { if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
...@@ -90,7 +90,7 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement ...@@ -90,7 +90,7 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
// } // }
// 获取当前装备ID下的排版数据 // 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay, List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
this.getGroupCode(), instanceIds,null); this.getGroupCode(), instanceIds,null, fieldCode);
if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) { if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) {
continue; continue;
} }
......
...@@ -7,7 +7,6 @@ import java.util.List; ...@@ -7,7 +7,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.velocity.runtime.directive.Break;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
...@@ -58,7 +57,7 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID ...@@ -58,7 +57,7 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
} }
@Override @Override
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) { public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay, List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "firstAidId", "firstAid", "teamName", "result.firstAidId"); this.getGroupCode(), "firstAidId", "firstAid", "teamName", "result.firstAidId");
if (equipmentList == null || equipmentList.size() < 1 || equipmentList.get(0) == null) { if (equipmentList == null || equipmentList.size() < 1 || equipmentList.get(0) == null) {
...@@ -94,7 +93,7 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID ...@@ -94,7 +93,7 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
// 获取当前装备ID下的排版数据 // 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper
.getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds, .getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds,
null); null, fieldCode);
if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) { if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) {
continue; continue;
} }
......
...@@ -304,7 +304,7 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType ...@@ -304,7 +304,7 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
} }
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) { public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getNewEquipmentForSpecifyDate(dutyDay, List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getNewEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "deptId", "deptName", "result.deptId"); this.getGroupCode(), "deptId", "deptName", "result.deptId");
if (equipmentList == null || equipmentList.size() < 1 || equipmentList.get(0) == null) { if (equipmentList == null || equipmentList.size() < 1 || equipmentList.get(0) == null) {
...@@ -330,7 +330,7 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType ...@@ -330,7 +330,7 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
// 获取当前装备ID下的排版数据 // 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper
.getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds, .getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds,
null); null, fieldCode);
if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) { if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) {
continue; continue;
} }
......
...@@ -4,8 +4,11 @@ import java.text.ParseException; ...@@ -4,8 +4,11 @@ import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -87,4 +90,20 @@ public class AnalysisReportLogController extends AbstractBaseController { ...@@ -87,4 +90,20 @@ public class AnalysisReportLogController extends AbstractBaseController {
return reportResponse; return reportResponse;
} }
@GetMapping(value = "/iotReportPage")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "分页查询", notes = "分页查询")
public IPage<AnalysisReportLogDto> iotReportPage(Page page, @RequestParam Integer reportType,
@ApiParam(value = "开始日期", required = false) @RequestParam(required = false) @DateTimeFormat(pattern="yyyy-MM-dd")Date startDate,
@ApiParam(value = "结束日期", required = false) @RequestParam(required = false) @DateTimeFormat(pattern="yyyy-MM-dd")Date endDate,
@ApiParam(value = "换流站编码", required = false) @RequestParam(required = false) String stationCode) {
AnalysisReportLogDto dto = new AnalysisReportLogDto();
dto.setStartDate(startDate);
dto.setEndDate(endDate);
dto.setReportType(reportType);
dto.setStationCode(stationCode);
return iAnalysisReportLogService.iotReportPage(page, dto);
}
} }
...@@ -30,4 +30,6 @@ public interface AnalysisReportLogMapper extends BaseMapper<AnalysisReportLog> { ...@@ -30,4 +30,6 @@ public interface AnalysisReportLogMapper extends BaseMapper<AnalysisReportLog> {
List<Map<String, Object>> getDefect(@Param("analysisReportLog")AnalysisReportLogDto analysisReportLog); List<Map<String, Object>> getDefect(@Param("analysisReportLog")AnalysisReportLogDto analysisReportLog);
Map<String, Object> getRootOrgUsr(); Map<String, Object> getRootOrgUsr();
IPage<AnalysisReportLogDto> iotReportPage(Page page, @Param("analysisReportLog")AnalysisReportLogDto analysisReportLog);
} }
...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.service; ...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto;
import com.yeejoin.equipmanage.common.entity.AnalysisReportLog; import com.yeejoin.equipmanage.common.entity.AnalysisReportLog;
import com.yeejoin.equipmanage.common.enums.AnalysisReportEnum; import com.yeejoin.equipmanage.common.enums.AnalysisReportEnum;
...@@ -35,4 +36,13 @@ public interface IAnalysisReportLogService extends IService<AnalysisReportLog> { ...@@ -35,4 +36,13 @@ public interface IAnalysisReportLogService extends IService<AnalysisReportLog> {
* @param endDate 结束日期 * @param endDate 结束日期
*/ */
void generateMonthReport(AnalysisReportEnum monthReport, Date beginDate, Date endDate) throws ParseException; void generateMonthReport(AnalysisReportEnum monthReport, Date beginDate, Date endDate) throws ParseException;
/**
* 消防物联报表列表分页查询
* @param page
* @param dto
* @return
*/
IPage<AnalysisReportLogDto> iotReportPage (Page page, AnalysisReportLogDto dto);
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto;
import com.yeejoin.equipmanage.common.entity.AnalysisReportLog; import com.yeejoin.equipmanage.common.entity.AnalysisReportLog;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity; import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity;
import com.yeejoin.equipmanage.common.entity.publics.BaseEntity; import com.yeejoin.equipmanage.common.entity.publics.BaseEntity;
...@@ -39,6 +40,8 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM ...@@ -39,6 +40,8 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM
@Autowired @Autowired
AnalysisReportSummaryMapper analysisReportSummaryMapper; AnalysisReportSummaryMapper analysisReportSummaryMapper;
@Autowired
AnalysisReportLogMapper analysisReportLogMapper;
@Override @Override
public IPage<AnalysisReportLog> listPage(Page page, AnalysisReportLog analysisReportLog) { public IPage<AnalysisReportLog> listPage(Page page, AnalysisReportLog analysisReportLog) {
...@@ -127,4 +130,9 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM ...@@ -127,4 +130,9 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM
} }
return desc.toString(); return desc.toString();
} }
@Override
public IPage<AnalysisReportLogDto> iotReportPage(Page page, AnalysisReportLogDto dto) {
return analysisReportLogMapper.iotReportPage(page, dto);
}
} }
...@@ -534,7 +534,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements ...@@ -534,7 +534,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
date="上传成功:"+(equipmentDetailDownloadVOS.size()-(split!=null?split.length:0))+"条---上传失败:"+(split!=null?split.length:0)+"条(失败编号:"+errBufferName+"详情:"+erryy+")"; date="上传成功:"+(equipmentDetailDownloadVOS.size()-(split!=null?split.length:0))+"条---上传失败:"+(split!=null?split.length:0)+"条(失败编号:"+errBufferName+"详情:"+erryy+")";
}else{ }else{
date="上传成功:"+(equipmentDetailDownloadVOS.size())+"条---上传失败:"+"0条(失败编号:"+errBufferName+"详情:"+erryy+")"; date="上传成功:"+(equipmentDetailDownloadVOS.size())+"条";
} }
log.error(date); log.error(date);
......
...@@ -306,7 +306,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -306,7 +306,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
} }
// 获取当前装备ID下的排版数据 // 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay, List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
"dutyCar", instanceIds, dutyDetail.get("name").toString()); "dutyCar", instanceIds, dutyDetail.get("name").toString(), null);
if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) { if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) {
continue; continue;
} }
......
...@@ -98,4 +98,35 @@ ...@@ -98,4 +98,35 @@
</where> </where>
LIMIT 1 LIMIT 1
</select> </select>
<select id="iotReportPage" resultType="com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto">
SELECT
*,
cb_org_usr.biz_org_code AS stationCode,
'消防物联报表' AS reportName,
cb_org_usr.biz_org_name AS stationName,
(CASE wl_analysis_report_log.report_type
WHEN 0 THEN '日报表'
WHEN 1 THEN '周报表'
ELSE '月报表'
END) reportTypeName
FROM
wl_analysis_report_log,cb_org_usr
<where>
cb_org_usr.biz_org_type = 'COMPANY' AND cb_org_usr.is_delete = 0 AND LENGTH(cb_org_usr.biz_org_code)>12
<if test="analysisReportLog.reportType != null">
AND wl_analysis_report_log.report_type = #{analysisReportLog.reportType}
</if>
<if test="analysisReportLog.startDate != null">
AND DATE_FORMAT(wl_analysis_report_log.start_date, '%Y-%m-%d') &gt;= DATE_FORMAT(#{analysisReportLog.startDate}, '%Y-%m-%d')
</if>
<if test="analysisReportLog.endDate != null">
AND DATE_FORMAT(wl_analysis_report_log.end_date, '%Y-%m-%d') &lt;= DATE_FORMAT(#{analysisReportLog.endDate}, '%Y-%m-%d')
</if>
<if test="analysisReportLog.stationCode != null">
AND cb_org_usr.biz_org_code like concat(#{analysisReportLog.stationCode},'%')
</if>
</where>
ORDER BY
report_date_desc DESC
</select>
</mapper> </mapper>
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.tdc.api.dto.CheckModelDto; import com.yeejoin.amos.boot.module.tdc.api.dto.CheckModelDto;
import com.yeejoin.amos.boot.module.tdc.api.entity.CheckModel; import com.yeejoin.amos.boot.module.tdc.api.entity.CheckModel;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
...@@ -34,13 +35,13 @@ public interface CheckModelService extends IService<CheckModel> { ...@@ -34,13 +35,13 @@ public interface CheckModelService extends IService<CheckModel> {
* 校验机构下全部模型 * 校验机构下全部模型
* @param amosOrgCode 机构code * @param amosOrgCode 机构code
*/ */
void checkAllMode(String amosOrgCode); void checkAllMode(String amosOrgCode, AgencyUserModel userInfo);
/** /**
* 校验单个模型 * 校验单个模型
* @param modelId 模型id * @param modelId 模型id
*/ */
void checkSingleMode(String modelId); void checkSingleMode(String modelId, AgencyUserModel userInfo);
/** /**
* 根据机构code和模型名称查询模型对象 * 根据机构code和模型名称查询模型对象
......
...@@ -48,4 +48,11 @@ public interface CheckResultService extends IService<CheckResult> { ...@@ -48,4 +48,11 @@ public interface CheckResultService extends IService<CheckResult> {
*/ */
Integer selectItemCount(String batchNo); Integer selectItemCount(String batchNo);
/**
* 查询不合格项
* @param batchNo 批次号
* @return 属性个数
*/
Integer selectItemNo(String batchNo,Long modelId);
} }
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
select `*`,'●' as circle from tdc_model select `*`,'●' as circle from tdc_model
<where> <where>
<if test = "amosOrgCode != null and amosOrgCode != ''"> <if test = "amosOrgCode != null and amosOrgCode != ''">
and amosOrgCode=#{amosOrgCode} and amos_org_code=#{amosOrgCode}
</if> </if>
</where> </where>
</select> </select>
......
...@@ -73,6 +73,7 @@ public class CheckModelAction { ...@@ -73,6 +73,7 @@ public class CheckModelAction {
String batchNo = String.valueOf(propertyValues.get("batch_no")); String batchNo = String.valueOf(propertyValues.get("batch_no"));
Integer checkType = Integer.valueOf(String.valueOf(propertyValues.get("checkType"))); Integer checkType = Integer.valueOf(String.valueOf(propertyValues.get("checkType")));
String orgCode = String.valueOf(propertyValues.get("org_code")); String orgCode = String.valueOf(propertyValues.get("org_code"));
String checkPeopleName = String.valueOf(propertyValues.get("checkPeopleName"));
String itemName = idxProjectModel.getItemName(); String itemName = idxProjectModel.getItemName();
// 获取模型 // 获取模型
...@@ -105,12 +106,12 @@ public class CheckModelAction { ...@@ -105,12 +106,12 @@ public class CheckModelAction {
if (ObjectUtils.isNotEmpty(checkType)) { if (ObjectUtils.isNotEmpty(checkType)) {
if (checkType == 1) { if (checkType == 1) {
// 2.2 单独模型校验,根据批次号查询已经入库的属性 // 2.2 单独模型校验,根据批次号查询已经入库的属性
sendWebMessage(batchNo, checkModel.getCheckItemAmount()); sendWebMessage(batchNo, checkModel.getCheckItemAmount(), orgCode, checkPeopleName, checkType, itemName);
} else if (checkType == 0) { } else if (checkType == 0) {
// 2.1 全站校验 // 2.1 全站校验
List<CheckModel> checkModels = checkModelService.selectByOrgCode(orgCode); List<CheckModel> checkModels = checkModelService.selectByOrgCode(orgCode);
int sum = checkModels.stream().mapToInt(CheckModel::getCheckItemAmount).sum(); int sum = checkModels.stream().mapToInt(CheckModel::getCheckItemAmount).sum();
sendWebMessage(batchNo, sum); sendWebMessage(batchNo, sum, orgCode, checkPeopleName, checkType, itemName);
} }
} }
// else { // else {
...@@ -124,7 +125,7 @@ public class CheckModelAction { ...@@ -124,7 +125,7 @@ public class CheckModelAction {
// } // }
} }
private void sendWebMessage(String batchNo, Integer itemSize) { private void sendWebMessage(String batchNo, Integer itemSize, String orgCode, String checkPeopleName, Integer checkType, String itemName) {
Integer itemCount = checkResultService.selectItemCount(batchNo); Integer itemCount = checkResultService.selectItemCount(batchNo);
if (itemCount.equals(itemSize)) { if (itemCount.equals(itemSize)) {
// 所有属性已全部入库,给前端发送消息 // 所有属性已全部入库,给前端发送消息
...@@ -139,8 +140,29 @@ public class CheckModelAction { ...@@ -139,8 +140,29 @@ public class CheckModelAction {
e.printStackTrace(); e.printStackTrace();
} }
// 全站校验生成报告 if (checkType == 0) {
// 全站校验生成报告
checkResultService.saveSql(orgCode, checkPeopleName);
List<CheckModel> checkModels = checkModelService.selectByOrgCode(orgCode);
checkModels.forEach(checkModel -> {
saveCheckModel(checkModel, batchNo);
});
} else {
// 更改校验结果
CheckModel checkModel = checkModelService.selectCheckModelByNameCode(itemName, orgCode);
saveCheckModel(checkModel, batchNo);
}
}
}
private void saveCheckModel (CheckModel checkModel, String batchNo) {
Integer integer = checkResultService.selectItemNo(batchNo, checkModel.getSequenceNbr());
if (0 == integer) {
checkModel.setCheckStatus(1);
} else {
checkModel.setCheckStatus(2);
} }
checkModel.setCheckDate(new Date());
checkModelService.updateById(checkModel);
} }
} }
package com.yeejoin.amos.boot.module.tdc.biz.controller; package com.yeejoin.amos.boot.module.tdc.biz.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.tdc.api.dto.CheckModelDto; import com.yeejoin.amos.boot.module.tdc.api.dto.CheckModelDto;
import com.yeejoin.amos.boot.module.tdc.api.entity.CheckModel; import com.yeejoin.amos.boot.module.tdc.api.entity.CheckModel;
import com.yeejoin.amos.boot.module.tdc.api.service.CheckModelService; import com.yeejoin.amos.boot.module.tdc.api.service.CheckModelService;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -21,7 +23,7 @@ import java.util.List; ...@@ -21,7 +23,7 @@ import java.util.List;
@RestController @RestController
@Api(tags = "校验模型api") @Api(tags = "校验模型api")
@RequestMapping(value = "/model") @RequestMapping(value = "/model")
public class CheckModelController { public class CheckModelController extends BaseController {
@Autowired @Autowired
CheckModelService checkModelService; CheckModelService checkModelService;
...@@ -55,7 +57,8 @@ public class CheckModelController { ...@@ -55,7 +57,8 @@ public class CheckModelController {
@GetMapping(value = "/CheckAllModel/{amosOrgCode}") @GetMapping(value = "/CheckAllModel/{amosOrgCode}")
@ApiOperation(httpMethod = "GET",value = "点击全站校验", notes = "根据机构code校验模型") @ApiOperation(httpMethod = "GET",value = "点击全站校验", notes = "根据机构code校验模型")
public void CheckAllModel(@PathVariable(value = "amosOrgCode") String amosOrgCode) { public void CheckAllModel(@PathVariable(value = "amosOrgCode") String amosOrgCode) {
checkModelService.checkAllMode(amosOrgCode); AgencyUserModel userInfo = getUserInfo();
checkModelService.checkAllMode(amosOrgCode, userInfo);
} }
/** /**
...@@ -65,6 +68,7 @@ public class CheckModelController { ...@@ -65,6 +68,7 @@ public class CheckModelController {
@GetMapping(value = "/checkSingleMode/{modelId}") @GetMapping(value = "/checkSingleMode/{modelId}")
@ApiOperation(httpMethod = "GET",value = "点击单独模型校验", notes = "根据modelId校验模型") @ApiOperation(httpMethod = "GET",value = "点击单独模型校验", notes = "根据modelId校验模型")
public void checkSingleMode(@PathVariable(value = "modelId") String modelId) { public void checkSingleMode(@PathVariable(value = "modelId") String modelId) {
checkModelService.checkSingleMode(modelId); AgencyUserModel userInfo = getUserInfo();
checkModelService.checkSingleMode(modelId, userInfo);
} }
} }
...@@ -20,6 +20,7 @@ import com.yeejoin.amos.boot.module.tdc.api.vo.SubjectTreeVo; ...@@ -20,6 +20,7 @@ import com.yeejoin.amos.boot.module.tdc.api.vo.SubjectTreeVo;
import com.yeejoin.amos.boot.module.tdc.api.vo.TableColumnsVo; import com.yeejoin.amos.boot.module.tdc.api.vo.TableColumnsVo;
import com.yeejoin.amos.boot.module.tdc.biz.action.model.IdxProjectModel; import com.yeejoin.amos.boot.module.tdc.biz.action.model.IdxProjectModel;
import com.yeejoin.amos.component.rule.RuleTrigger; import com.yeejoin.amos.component.rule.RuleTrigger;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -70,35 +71,39 @@ public class CheckModelImpl extends ServiceImpl<CheckModelMapper, CheckModel> im ...@@ -70,35 +71,39 @@ public class CheckModelImpl extends ServiceImpl<CheckModelMapper, CheckModel> im
public CheckModel selectOneByDate(String amosOrgCode) { public CheckModel selectOneByDate(String amosOrgCode) {
LambdaQueryWrapper<CheckModel> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CheckModel> wrapper = new LambdaQueryWrapper<>();
wrapper wrapper
.eq(CheckModel::getAmosOrgCode, amosOrgCode)
.isNotNull(CheckModel::getCheckDate) .isNotNull(CheckModel::getCheckDate)
.orderByDesc(CheckModel::getCheckDate) .orderByDesc(CheckModel::getCheckDate)
.last("limit 1"); .last("limit 1");
if(!ValidationUtil.isEmpty(amosOrgCode)){
wrapper.eq(CheckModel::getAmosOrgCode, amosOrgCode);
}
return baseMapper.selectOne(wrapper); return baseMapper.selectOne(wrapper);
} }
@Override @Override
public void checkAllMode(String amosOrgCode) { public void checkAllMode(String amosOrgCode, AgencyUserModel userInfo) {
String userName = userInfo.getUserName();
LambdaQueryWrapper<CheckModel> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CheckModel> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CheckModel::getAmosOrgCode, amosOrgCode); wrapper.eq(CheckModel::getAmosOrgCode, amosOrgCode);
List<CheckModel> checkModels = this.baseMapper.selectList(wrapper); List<CheckModel> checkModels = this.baseMapper.selectList(wrapper);
String batchNo = UUID.randomUUID().toString(); String batchNo = UUID.randomUUID().toString();
if (!CollectionUtils.isEmpty(checkModels)) { if (!CollectionUtils.isEmpty(checkModels)) {
checkModels.forEach(checkModel -> { checkModels.forEach(checkModel -> {
checkModelRule(checkModel, 0, batchNo, amosOrgCode); checkModelRule(checkModel, 0, batchNo, amosOrgCode, userName);
}); });
} }
} }
@Override @Override
public void checkSingleMode(String modelId) { public void checkSingleMode(String modelId, AgencyUserModel userInfo) {
String userName = userInfo.getUserName();
LambdaQueryWrapper<CheckModel> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CheckModel> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CheckModel::getSequenceNbr, modelId); wrapper.eq(CheckModel::getSequenceNbr, modelId);
CheckModel checkModel = this.baseMapper.selectOne(wrapper); CheckModel checkModel = this.baseMapper.selectOne(wrapper);
if (!ObjectUtils.isEmpty(checkModel)) { if (!ObjectUtils.isEmpty(checkModel)) {
// 调用规则校验模型 // 调用规则校验模型
String batchNo = UUID.randomUUID().toString(); String batchNo = UUID.randomUUID().toString();
checkModelRule(checkModel, 1, batchNo, checkModel.getAmosOrgCode()); checkModelRule(checkModel, 1, batchNo, checkModel.getAmosOrgCode(), userName);
} }
} }
...@@ -110,7 +115,7 @@ public class CheckModelImpl extends ServiceImpl<CheckModelMapper, CheckModel> im ...@@ -110,7 +115,7 @@ public class CheckModelImpl extends ServiceImpl<CheckModelMapper, CheckModel> im
return this.baseMapper.selectOne(wrapper); return this.baseMapper.selectOne(wrapper);
} }
private void checkModelRule(CheckModel checkModel, int checkType, String batchNo, String amosOrgCode) { private void checkModelRule(CheckModel checkModel, int checkType, String batchNo, String amosOrgCode, String userName) {
IdxProjectModel idxProjectModel = new IdxProjectModel(); IdxProjectModel idxProjectModel = new IdxProjectModel();
// 查询表最新一条数据 // 查询表最新一条数据
String idxTableName = checkModel.getIdxTableName(); String idxTableName = checkModel.getIdxTableName();
...@@ -121,6 +126,7 @@ public class CheckModelImpl extends ServiceImpl<CheckModelMapper, CheckModel> im ...@@ -121,6 +126,7 @@ public class CheckModelImpl extends ServiceImpl<CheckModelMapper, CheckModel> im
} }
map.put("batch_no", batchNo); map.put("batch_no", batchNo);
map.put("checkType", checkType); map.put("checkType", checkType);
map.put("checkPeopleName", userName);
// 查询表所有字段 // 查询表所有字段
ResponseModel<JSONObject> model = idxFeignService.queryByTableId(checkModel.getTableId()); ResponseModel<JSONObject> model = idxFeignService.queryByTableId(checkModel.getTableId());
......
...@@ -28,7 +28,7 @@ public class CheckReportImpl extends ServiceImpl<CheckReportMapper, CheckReport> ...@@ -28,7 +28,7 @@ public class CheckReportImpl extends ServiceImpl<CheckReportMapper, CheckReport>
return this.page(page); return this.page(page);
}else{ }else{
LambdaQueryWrapper<CheckReport> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CheckReport> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CheckReport::getAmosOrgCode, amosOrgCode); wrapper.likeRight(CheckReport::getAmosOrgCode, amosOrgCode);
return this.page(page,wrapper); return this.page(page,wrapper);
} }
......
...@@ -165,6 +165,15 @@ public class CheckResultImpl extends ServiceImpl<CheckResultMapper, CheckResult> ...@@ -165,6 +165,15 @@ public class CheckResultImpl extends ServiceImpl<CheckResultMapper, CheckResult>
return this.baseMapper.selectCount(wrapper); return this.baseMapper.selectCount(wrapper);
} }
@Override
public Integer selectItemNo(String batchNo, Long modelId) {
LambdaQueryWrapper<CheckResult> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CheckResult::getBatchNo, batchNo);
wrapper.eq(CheckResult::getModelId, modelId);
wrapper.eq(CheckResult::getCheckItemResult, 1);
return this.baseMapper.selectCount(wrapper);
}
/** /**
* 获取报告数据 * 获取报告数据
......
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