Commit ffd031bc authored by 李成龙's avatar 李成龙

删除无用Vo

parent 953ccdff
package com.yeejoin.amos.boot.biz.common.dto;
import java.io.Serializable;
import java.util.Date;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 基础DTO
* @author kinky
......@@ -30,10 +30,7 @@ public class BaseDto implements Serializable{
@ApiModelProperty(value = "更新人")
protected String recUserId;
/**
* 是否删除
*/
@ExcelIgnore
@TableField(value = "is_delete")
@ApiModelProperty(value = "是否删除")
private Boolean isDelete;
}
......@@ -96,5 +96,13 @@ public class AlertCalledDto extends BaseDto{
@ApiModelProperty(value = "发送人名称")
private String recUserName;
@ApiModelProperty(value = "接警时间开始---用于列表过滤")
private Date callTimeStart ;
@ApiModelProperty(value = "接警时间结束---用于列表过滤")
private Date callTimeEnd ;
@ApiModelProperty(value = "响应级别字典code 为了过滤用(只有航空器故障有)")
private String responseLevelCode;
}
package com.yeejoin.amos.boot.module.jcs.api.vo;
package com.yeejoin.amos.boot.module.jcs.api.dto;
import com.yeejoin.amos.boot.module.jcs.api.dto.FormValue;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
......@@ -12,19 +15,21 @@ import java.util.List;
* 动态表单值
* */
@Data
public class AlertCalledFormVo {
@ApiModelProperty(value = "警情基本信息")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AlertCalledFormDto", description=" 动态表单值")
public class AlertCalledFormDto extends BaseDto{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情基本信息")
private AlertCalled alertCalled;
@ApiModelProperty(value = "动态表单值")
private List<FormValue> dynamicFormAlert;
public AlertCalledFormVo(AlertCalled alertCalled, List<FormValue> formValue) {
public AlertCalledFormDto(AlertCalled alertCalled, List<FormValue> formValue) {
this.alertCalled = alertCalled;
this.dynamicFormAlert = formValue;
}
public AlertCalledFormVo() {
}
}
package com.yeejoin.amos.boot.module.jcs.api.vo;
package com.yeejoin.amos.boot.module.jcs.api.dto;
import java.util.List;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import lombok.EqualsAndHashCode;
/**
* 保存警情接警记录
*
* @author tb
* @date 2021-06-17
*/
* 警情接警记录对象集合
* @author system
*
*/
@Data
public class AlertCalledVo{
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AlertCalledObjsDto", description="警情接警记录对象集合")
public class AlertCalledObjsDto extends BaseDto{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情基本信息")
@ApiModelProperty(value = "警情基本信息")
private AlertCalled alertCalled;
@ApiModelProperty(value = "动态表单值")
private List<AlertFormValue> alertFormValue;
public AlertCalledVo(AlertCalled alertCalled, List<AlertFormValue> alertFormValue) {
this.alertCalled = alertCalled;
this.alertFormValue = alertFormValue;
}
public AlertCalledVo() {
}
}
......@@ -14,7 +14,7 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AlertFromDto", description="警情表单")
public class AlertFromDto extends BaseDto{
public class AlertFormDto extends BaseDto{
private static final long serialVersionUID = 1L;
......
......@@ -14,7 +14,7 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AlertFromTypeDto", description="动态表单类型")
public class AlertFromTypeDto extends BaseDto {
public class AlertFormTypeDto extends BaseDto {
private static final long serialVersionUID = 1L;
......
......@@ -7,14 +7,14 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
*
*表单实例值
* @author tb
* @date 2021-06-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AlertFromValueDto", description="")
public class AlertFromValueDto extends BaseDto {
@ApiModel(value="AlertFromValueDto", description="表单实例值")
public class AlertFormValueDto extends BaseDto {
private static final long serialVersionUID = 1L;
......@@ -41,8 +41,10 @@ public class AlertFromValueDto extends BaseDto {
@ApiModelProperty(value = "操作人名称")
private String recUserName;
@ApiModelProperty(value = "是否一行显示")
private Boolean block;
private Boolean isDelete;
@ApiModelProperty(value = "表单类型")
private String fieldType;
}
package com.yeejoin.amos.boot.module.jcs.api.dto;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
......@@ -15,8 +14,9 @@ import lombok.EqualsAndHashCode;
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class ESAlertCalledRequestDto extends AlertCalledVo
public class ESAlertCalledRequestDto extends AlertCalledObjsDto
{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情状态")
private String[] alertStatus;
}
package com.yeejoin.amos.boot.module.jcs.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormValueDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo;
import java.util.List;
......@@ -14,6 +14,6 @@ import java.util.List;
*/
public interface AlertFormValueMapper extends BaseMapper<AlertFormValue> {
public List<AlertFormValueVo> selectListByCalledId(Long id);
public List<AlertFormValueDto> selectListByCalledId(Long id);
}
package com.yeejoin.amos.boot.module.jcs.api.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 警情接警记录
*
* @author tb
* @date 2021-06-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("jc_alert_called")
@ApiModel(value="AlertCalled对象", description="警情接警记录")
public class AlertCalledListVo extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情状态")
private Boolean alertStatus;
@ApiModelProperty(value = "系统/人工")
private String type;
@ApiModelProperty(value = "警情阶段")
private String alertStage;
@ApiModelProperty(value = "报警类型")
private String alarmType;
@ApiModelProperty(value = "响应级别字典code 为了过滤用(只有航空器故障有)")
private String responseLevelCode;
@ApiModelProperty(value = "报警类型code")
private String alarmTypeCode;
@ApiModelProperty(value = "报警方式")
private String alarmMode;
@ApiModelProperty(value = "报警方式code")
private String alarmModeCode;
@ApiModelProperty(value = "通话记录信息id")
private Integer callRecordId;
@ApiModelProperty(value = "父警情id")
private Long fatherAlert;
@ApiModelProperty(value = "联系人姓名")
private String contactUser;
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
@ApiModelProperty(value = "接警时间")
private Date callTime;
@ApiModelProperty(value = "接警时长")
private Double callTimeNum;
@ApiModelProperty(value = "警情来源")
private String alertSource;
@ApiModelProperty(value = "警情来源code")
private String alertSourceCode;
@ApiModelProperty(value = "警情类型")
private String alertType;
@ApiModelProperty(value = "警情类型code")
private String alertTypeCode;
@ApiModelProperty(value = "事发单位")
private String unitInvolved;
@ApiModelProperty(value = "被困人数")
private Integer trappedNum;
@ApiModelProperty(value = "伤亡人数")
private Integer casualtiesNum;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "救援方格")
private String rescueGrid;
@ApiModelProperty(value = "坐标x")
private String coordinateX;
@ApiModelProperty(value = "坐标y")
private String coordinateY;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "发送人名称")
private String recUserName;
@ApiModelProperty(value = "接警时间开始---用于列表过滤")
private Date callTimeStart ;
@ApiModelProperty(value = "接警时间结束---用于列表过滤")
private Date callTimeEnd ;
}
package com.yeejoin.amos.boot.module.jcs.api.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
*
*
* @author tb
* @date 2021-06-17
*/
@Data
@Accessors(chain = true)
@TableName("jc_alert_form_value")
@ApiModel(value="AlertFormValueVo", description="")
public class AlertFormValueVo{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "表单id")
private Integer alertFormId;
@ApiModelProperty(value = "警情id")
private Long alertCalledId;
@ApiModelProperty(value = "警情类型")
private String alertTypeCode;
@ApiModelProperty(value = "字段名称")
private String fieldName;
@ApiModelProperty(value = "英文名称")
private String fieldCode;
@ApiModelProperty(value = "字段值")
private String fieldValue;
@ApiModelProperty(value = "字段值字典code")
private String fieldValueCode;
@ApiModelProperty(value = "操作人名称")
private String recUserName;
@ApiModelProperty(value = "是否一行显示")
private Boolean block;
@ApiModelProperty(value = "表单类型")
private String fieldType;
}
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
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.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.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 com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -10,36 +37,19 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledRequestDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.FormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledFormVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ESAlertCalledService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
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 java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* 警情接警记录
......@@ -71,21 +81,21 @@ public class AlertCalledController extends BaseController {
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增警情接警记录", notes = "新增警情接警记录")
@Transactional
public ResponseModel<AlertCalled> saveAlertCalled(@RequestBody AlertCalledVo alertCalledVo) throws Exception{
public ResponseModel<AlertCalled> saveAlertCalled(@RequestBody AlertCalledObjsDto alertCalledObjsDto) throws Exception{
if (ValidationUtil.isEmpty(alertCalledVo)
|| ValidationUtil.isEmpty(alertCalledVo.getAlertCalled()))
if (ValidationUtil.isEmpty(alertCalledObjsDto)
|| ValidationUtil.isEmpty(alertCalledObjsDto.getAlertCalled()))
throw new BadRequest("参数校验失败.");
ReginParams reginParams =
JSONObject.parseObject(null != redisUtils.get(buildKey(getToken())) ?
redisUtils.get(buildKey(getToken())).toString() : null, ReginParams.class);
//获取当前登录人公司
String name= reginParams.getCompany().getCompanyName();
AlertCalled alertCalled = alertCalledVo.getAlertCalled();
AlertCalled alertCalled = alertCalledObjsDto.getAlertCalled();
alertCalled.setCompanyName(name);
alertCalledVo.setAlertCalled(alertCalled);
alertCalledVo =iAlertCalledService.createAlertCalled(alertCalledVo);
return ResponseHelper.buildResponse(alertCalledVo.getAlertCalled());
alertCalledObjsDto.setAlertCalled(alertCalled);
alertCalledObjsDto =iAlertCalledService.createAlertCalled(alertCalledObjsDto);
return ResponseHelper.buildResponse(alertCalledObjsDto.getAlertCalled());
}
/**
......@@ -141,7 +151,7 @@ public class AlertCalledController extends BaseController {
formValue.add(value);
}
}
AlertCalledFormVo alertCalledFormVo = new AlertCalledFormVo(alertCalled, formValue);
AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalled, formValue);
redisUtils.set(RedisKey.ALERTCALLED_ID+id,JSON.toJSON(alertCalledFormVo),time);
return ResponseHelper.buildResponse(alertCalledFormVo);
......
......@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -12,14 +14,12 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertCalledMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo;
import javax.annotation.Resource;
/**
* 警情接警记录 服务实现类
......@@ -53,10 +53,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
* @return
*/
@Transactional
public AlertCalledVo createAlertCalled(AlertCalledVo alertCalledVo) {
public AlertCalledObjsDto createAlertCalled(AlertCalledObjsDto alertCalledObjsDto) {
try {
// 警情基本信息
AlertCalled alertCalled = alertCalledVo.getAlertCalled();
AlertCalled alertCalled = alertCalledObjsDto.getAlertCalled();
alertCalled.setCallTime(new Date());
if(AlertStageEnums.RG.getValue().equals(alertCalled.getAlertSourceCode())||
AlertStageEnums.RG.getValue().equals(alertCalled.getAlertSourceCode())){
......@@ -74,7 +74,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
alertCalled.setAlarmTypeCode(AlertStageEnums.JQGB.getCode());
this.save(alertCalled);
// 动态表单
List<AlertFormValue> alertFormValuelist = alertCalledVo.getAlertFormValue();
List<AlertFormValue> alertFormValuelist = alertCalledObjsDto.getAlertFormValue();
// 填充警情主键
alertFormValuelist.stream().forEach(alertFormValue -> {
alertFormValue.setAlertCalledId(alertCalled.getSequenceNbr());
......@@ -93,7 +93,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
this.save(alertCalled);
// 动态表单
List<AlertFormValue> alertFormValuelist = alertCalledVo.getAlertFormValue();
List<AlertFormValue> alertFormValuelist = alertCalledObjsDto.getAlertFormValue();
// 填充警情主键
alertFormValuelist.stream().forEach(alertFormValue -> {
alertFormValue.setAlertCalledId(alertCalled.getSequenceNbr());
......@@ -101,10 +101,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
});
// 保存动态表单数据
iAlertFormValueService.saveBatch(alertFormValuelist);
alertCalledVo.setAlertCalled(alertCalled);
alertCalledVo.setAlertFormValue(alertFormValuelist);
alertCalledObjsDto.setAlertCalled(alertCalled);
alertCalledObjsDto.setAlertFormValue(alertFormValuelist);
//调用规则
ruleAlertCalledService.fireAlertCalledRule(alertCalledVo);
ruleAlertCalledService.fireAlertCalledRule(alertCalledObjsDto);
}
......@@ -113,7 +113,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
*/
eSAlertCalledService.saveAlertCalledToES(alertCalled);
return alertCalledVo;
return alertCalledObjsDto;
} catch (Exception e) {
throw new RuntimeException("报送失败,系统异常!");
}
......
......@@ -2,7 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormInitDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertListvalue;
import com.yeejoin.amos.boot.module.jcs.api.dto.Items;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertForm;
......@@ -29,7 +29,7 @@ import java.util.stream.Collectors;
* @date 2021-06-17
*/
@Service
public class AlertFormServiceImpl extends BaseService<AlertFromDto,AlertForm,AlertFormMapper> implements IAlertFormService{
public class AlertFormServiceImpl extends BaseService<AlertFormDto,AlertForm,AlertFormMapper> implements IAlertFormService{
@Autowired
DataDictionaryServiceImpl iDataDictionaryService;
......@@ -95,7 +95,7 @@ public class AlertFormServiceImpl extends BaseService<AlertFromDto,AlertForm,Ale
return this.queryListByTypeCode(typeCode).stream().map(c -> c.getFieldCode()).collect(Collectors.toList());
}
public List<AlertFromDto> queryListByTypeCode(String alertTypeCode) {
public List<AlertFormDto> queryListByTypeCode(String alertTypeCode) {
return this.queryForList(null, false, alertTypeCode);
}
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromTypeDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormTypeDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormType;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertFormTypeMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormTypeService;
......@@ -15,6 +15,6 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
* @date 2021-06-17
*/
@Service
public class AlertFormTypeServiceImpl extends BaseService<AlertFromTypeDto, AlertFormType,AlertFormTypeMapper> implements IAlertFormTypeService {
public class AlertFormTypeServiceImpl extends BaseService<AlertFormTypeDto, AlertFormType,AlertFormTypeMapper> implements IAlertFormTypeService {
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromValueDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertFormValueMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormValueService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormValueDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertFormValueMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormValueService;
/**
* 服务实现类
*
......@@ -19,16 +18,16 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
* @date 2021-06-17
*/
@Service
public class AlertFormValueServiceImpl extends BaseService<AlertFromValueDto,AlertFormValue,AlertFormValueMapper> implements IAlertFormValueService {
public class AlertFormValueServiceImpl extends BaseService<AlertFormValueDto,AlertFormValue,AlertFormValueMapper> implements IAlertFormValueService {
@Autowired
private AlertFormValueMapper alertFormValueMapper;
public List<AlertFromValueDto> queryByCalledId(Long alertCalledId) {
public List<AlertFormValueDto> queryByCalledId(Long alertCalledId) {
return this.queryForList(null, false, alertCalledId);
}
public List<AlertFormValueVo> listByCalledId(Long id) {
public List<AlertFormValueDto> listByCalledId(Long id) {
return alertFormValueMapper.selectListByCalledId(id);
}
......
......@@ -28,6 +28,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.FormValue;
......@@ -46,7 +47,6 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.SubmissionMethodEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertSubmittedMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedObjectService;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertSubmittedExtVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertSubmittedSMSVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.PowerTransferCompanyVo;
......@@ -138,7 +138,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Long alertSubmittedId = saveAlertSubmitted(alertSubmittedDto, userName);
// 组装规则入参
AlertCalled alertCalled = alertCalledService.getById(alertSubmittedDto.getAlertCalledId());
AlertCalledVo alertCalledVo = new AlertCalledVo();
AlertCalledObjsDto alertCalledVo = new AlertCalledObjsDto();
alertCalledVo.setAlertCalled(alertCalled);
List<AlertFormValue> alertFormValue = new ArrayList<>();
AlertFormValue formValue = new AlertFormValue();
......
......@@ -24,8 +24,8 @@ 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.constants.CommonConstant;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromValueDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormValueDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.FormValue;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgDepartmentDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgDepartmentFormDto;
......@@ -40,7 +40,6 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.jcs.api.enums.OrgPersonEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IOrgUsrService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
......@@ -315,9 +314,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override
public List<FormValue> getFormValue(Long id) throws Exception {
// 动态表单数据
List<AlertFormValueVo> list = alertFormValueServiceImpl.listByCalledId(id);
List<AlertFormValueDto> list = alertFormValueServiceImpl.listByCalledId(id);
List<FormValue> formValue = new ArrayList<>();
for (AlertFormValueVo alertFormValue : list) {
for (AlertFormValueDto alertFormValue : list) {
if (alertFormValue.getFieldValueCode() == null) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), alertFormValue.getFieldType(),
alertFormValue.getFieldValue(), alertFormValue.getBlock());
......@@ -333,9 +332,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
public List<FormValue> getFormValueDetail(Long id) throws Exception {
// 动态表单数据
List<AlertFormValueVo> list = alertFormValueServiceImpl.listByCalledId(id);
List<AlertFormValueDto> list = alertFormValueServiceImpl.listByCalledId(id);
List<FormValue> formValue = new ArrayList<>();
for (AlertFormValueVo alertFormValue : list) {
for (AlertFormValueDto alertFormValue : list) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), alertFormValue.getFieldType(),
alertFormValue.getFieldValue(), alertFormValue.getBlock());
formValue.add(value);
......@@ -413,10 +412,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
alertFromValuelist.stream().forEach(alertFromValue -> {
alertFromValue.setAlertCalledId(orgUsr.getSequenceNbr());
});
List<AlertFromValueDto> formList = alertFormValueServiceImpl.queryByCalledId(orgUsr.getSequenceNbr());
List<AlertFormValueDto> formList = alertFormValueServiceImpl.queryByCalledId(orgUsr.getSequenceNbr());
if (formList != null && formList.size() > 0) {
for (AlertFormValue dis : alertFromValuelist) {
for (AlertFromValueDto src : formList) {
for (AlertFormValueDto src : formList) {
if (dis.getAlertFormId() == src.getAlertFormId()) {
dis.setSequenceNbr(src.getSequenceNbr());
dis.setRecDate(new Date());
......@@ -432,7 +431,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// 保存动态表单数据
alertFormValueServiceImpl.updateBatchById(alertFromValuelist);
List<AlertFromDto> form = alertFormServiceImpl.queryListByTypeCode(formList.get(0).getAlertTypeCode());
List<AlertFormDto> form = alertFormServiceImpl.queryListByTypeCode(formList.get(0).getAlertTypeCode());
if (form.size() != alertFromValuelist.size()) {
......@@ -440,7 +439,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
for (AlertFormValue dis : alertFromValuelist) {
boolean exist = false;
for (AlertFromValueDto src : formList) {
for (AlertFormValueDto src : formList) {
if (dis.getAlertFormId() == src.getSequenceNbr()) {
exist = true;
break;
......@@ -470,7 +469,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
queryWrapper.eq("alert_type_code",OrgPersonEnum.人员.getCode());
List<AlertForm> alertForms = alertFormServiceImpl.list(queryWrapper);
// 动态表单数据
List<AlertFormValueVo> list = alertFormValueServiceImpl.listByCalledId(id);
List<AlertFormValueDto> list = alertFormValueServiceImpl.listByCalledId(id);
Map<String, Object> result = new HashMap<>();
result = Bean.BeantoMap(orgUsr);
result.put("parenName",getById(orgUsr.getParentId()).getBizOrgName());
......@@ -478,7 +477,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
for (AlertForm alertForm : alertForms) {
result.put(alertForm.getFieldCode(), null);
}
for (AlertFormValueVo alertFormValue : list) {
for (AlertFormValueDto alertFormValue : list) {
result.replace(alertFormValue.getFieldCode(), alertFormValue.getFieldValue());
}
return result;
......
......@@ -4,14 +4,13 @@ import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo;
import com.yeejoin.amos.component.rule.RuleTrigger;
/**
......@@ -39,7 +38,7 @@ public class RuleAlertCalledService {
* @return
* @throws Exception
*/
public Boolean fireAlertCalledRule(AlertCalledVo alertCalledVo) throws Exception
public Boolean fireAlertCalledRule(AlertCalledObjsDto alertCalledVo) throws Exception
{
AlertCalled alertCalled = alertCalledVo.getAlertCalled();
if (ValidationUtil.isEmpty(alertCalled))
......
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