Commit 54083d2f authored by tangwei's avatar tangwei

增加接口

parent 49d421de
...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="AlertCalled对象", description="警情接警记录") @ApiModel(value="AlertCalled对象", description="警情接警记录")
public class AlertCalled extends BaseEntity { public class AlertCalled extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情状态") @ApiModelProperty(value = "警情状态")
private Boolean alertStatus; private Boolean alertStatus;
...@@ -44,12 +44,6 @@ public class AlertCalled extends BaseEntity { ...@@ -44,12 +44,6 @@ public class AlertCalled extends BaseEntity {
@ApiModelProperty(value = "报警类型code") @ApiModelProperty(value = "报警类型code")
private String alarmTypeCode; private String alarmTypeCode;
@ApiModelProperty(value = "报警方式")
private String alarmMode;
@ApiModelProperty(value = "报警方式code")
private String alarmModeCode;
@ApiModelProperty(value = "通话记录信息id") @ApiModelProperty(value = "通话记录信息id")
private Integer callRecordId; private Integer callRecordId;
...@@ -113,4 +107,8 @@ public class AlertCalled extends BaseEntity { ...@@ -113,4 +107,8 @@ public class AlertCalled extends BaseEntity {
@ApiModelProperty(value = "接警时间结束---用于列表过滤") @ApiModelProperty(value = "接警时间结束---用于列表过滤")
@TableField(exist=false) @TableField(exist=false)
private Date callTimeEnd ; private Date callTimeEnd ;
@TableField(exist=false)
@ApiModelProperty(value = "是否处警")
private Boolean isFatherAlert;
} }
...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="AlertFrom对象", description="警情表单") @ApiModel(value="AlertFrom对象", description="警情表单")
public class AlertFrom extends BaseEntity { public class AlertFrom extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情类型") @ApiModelProperty(value = "警情类型")
......
...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="AlertFromType对象", description="动态表单类型") @ApiModel(value="AlertFromType对象", description="动态表单类型")
public class AlertFromType extends BaseEntity { public class AlertFromType extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "表单类型code") @ApiModelProperty(value = "表单类型code")
......
...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="AlertFromValue对象", description="") @ApiModel(value="AlertFromValue对象", description="")
public class AlertFromValue extends BaseEntity { public class AlertFromValue extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "表单id") @ApiModelProperty(value = "表单id")
......
...@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="AlertSubmitted对象", description="警情报送记录") @ApiModel(value="AlertSubmitted对象", description="警情报送记录")
public class AlertSubmitted extends BaseEntity { public class AlertSubmitted extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情id") @ApiModelProperty(value = "警情id")
......
...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="AlertSubmittedObject对象", description="报送对象") @ApiModel(value="AlertSubmittedObject对象", description="报送对象")
public class AlertSubmittedObject extends BaseEntity { public class AlertSubmittedObject extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "报送单据id") @ApiModelProperty(value = "报送单据id")
......
...@@ -18,7 +18,7 @@ import java.util.Date; ...@@ -18,7 +18,7 @@ import java.util.Date;
@ApiModel(value = "tb_demo对象", description = "Demo示例") @ApiModel(value = "tb_demo对象", description = "Demo示例")
public class CbDemo extends BaseEntity { public class CbDemo extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "NAME") @ApiModelProperty(value = "NAME")
private String name; private String name;
......
...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="DataDictionary对象", description="数据字典") @ApiModel(value="DataDictionary对象", description="数据字典")
public class DataDictionary extends BaseEntity { public class DataDictionary extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "code") @ApiModelProperty(value = "code")
......
...@@ -29,7 +29,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -29,7 +29,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="FireExperts对象", description="") @ApiModel(value="FireExperts对象", description="")
public class FireExperts extends BaseEntity { public class FireExperts extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "姓名") @ApiModelProperty(value = "姓名")
......
...@@ -29,7 +29,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -29,7 +29,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="FireTeam对象", description="消防队伍") @ApiModel(value="FireTeam对象", description="消防队伍")
public class FireTeam extends BaseEntity { public class FireTeam extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "消防队伍图片") @ApiModelProperty(value = "消防队伍图片")
......
...@@ -29,8 +29,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -29,8 +29,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="Firefighters对象", description="消防队员") @ApiModel(value="Firefighters对象", description="消防队员")
public class Firefighters extends BaseEntity { public class Firefighters extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "系统账号") @ApiModelProperty(value = "系统账号")
private String systemAccount; private String systemAccount;
......
...@@ -29,7 +29,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -29,7 +29,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="FirefightersContacts对象", description="联系人") @ApiModel(value="FirefightersContacts对象", description="联系人")
public class FirefightersContacts extends BaseEntity { public class FirefightersContacts extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "人员id") @ApiModelProperty(value = "人员id")
......
...@@ -32,7 +32,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -32,7 +32,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="FirefightersContract对象", description="消防员合同") @ApiModel(value="FirefightersContract对象", description="消防员合同")
public class FirefightersContract extends BaseEntity { public class FirefightersContract extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "合同名称") @ApiModelProperty(value = "合同名称")
......
...@@ -29,7 +29,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -29,7 +29,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="FirefightersEducation对象", description="人员学历") @ApiModel(value="FirefightersEducation对象", description="人员学历")
public class FirefightersEducation extends BaseEntity { public class FirefightersEducation extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "人员id") @ApiModelProperty(value = "人员id")
......
...@@ -32,7 +32,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -32,7 +32,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="FirefightersJacket对象", description="消防人员配装记录") @ApiModel(value="FirefightersJacket对象", description="消防人员配装记录")
public class FirefightersJacket extends BaseEntity { public class FirefightersJacket extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "消防队员") @ApiModelProperty(value = "消防队员")
......
...@@ -29,7 +29,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -29,7 +29,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="FirefightersPost对象", description="岗位信息") @ApiModel(value="FirefightersPost对象", description="岗位信息")
public class FirefightersPost extends BaseEntity { public class FirefightersPost extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "人员id") @ApiModelProperty(value = "人员id")
......
...@@ -32,7 +32,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -32,7 +32,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="FirefightersThought对象", description="消防员思想谈话记录") @ApiModel(value="FirefightersThought对象", description="消防员思想谈话记录")
public class FirefightersThought extends BaseEntity { public class FirefightersThought extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "消防救援人员") @ApiModelProperty(value = "消防救援人员")
......
...@@ -29,7 +29,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -29,7 +29,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="FirefightersWorkexperience对象", description="工作经历") @ApiModel(value="FirefightersWorkexperience对象", description="工作经历")
public class FirefightersWorkexperience extends BaseEntity { public class FirefightersWorkexperience extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "参加工作时间") @ApiModelProperty(value = "参加工作时间")
......
...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="OrgUsr对象", description="机构/部门/人员表") @ApiModel(value="OrgUsr对象", description="机构/部门/人员表")
public class OrgUsr extends BaseEntity { public class OrgUsr extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "机构/部门名称") @ApiModelProperty(value = "机构/部门名称")
......
...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="OrgUsrAuth对象", description="") @ApiModel(value="OrgUsrAuth对象", description="")
public class OrgUsrAuth extends BaseEntity { public class OrgUsrAuth extends BaseEntity {
private static final long serialVersionUID = 1L;
private String recUserName; private String recUserName;
......
...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="PowerTransfer对象", description="力量调派") @ApiModel(value="PowerTransfer对象", description="力量调派")
public class PowerTransfer extends BaseEntity { public class PowerTransfer extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情id") @ApiModelProperty(value = "警情id")
......
...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="PowerTransferCompany对象", description="调派单位") @ApiModel(value="PowerTransferCompany对象", description="调派单位")
public class PowerTransferCompany extends BaseEntity { public class PowerTransferCompany extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "调派单据id") @ApiModelProperty(value = "调派单据id")
......
...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="PowerTransferCompanyResources对象", description="调派单位资源") @ApiModel(value="PowerTransferCompanyResources对象", description="调派单位资源")
public class PowerTransferCompanyResources extends BaseEntity { public class PowerTransferCompanyResources extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "资源类型") @ApiModelProperty(value = "资源类型")
......
...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ApiModel(value="Template对象", description="模板表") @ApiModel(value="Template对象", description="模板表")
public class Template extends BaseEntity { public class Template extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "模板类型") @ApiModelProperty(value = "模板类型")
......
package com.yeejoin.amos.boot.module.jcs.biz.controller; package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.yeejoin.amos.boot.biz.common.utils.CommonResponseUtil; import com.yeejoin.amos.boot.biz.common.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromValue; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersJacket; import com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersJacket;
...@@ -30,152 +31,194 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -30,152 +31,194 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
* 警情接警记录 * 警情接警记录
* *
* @author tb * @author tb
* @date 2021-06-17 * @date 2021-06-17
*/ */
@RestController @RestController
@Api(tags = "警情接警记录Api") @Api(tags = "警情接警记录Api")
@RequestMapping(value = "/jcs/alert-called") @RequestMapping(value = "/jcs/alert-called")
public class AlertCalledController extends BaseController { public class AlertCalledController extends BaseController {
@Autowired @Autowired
IAlertCalledService iAlertCalledService; IAlertCalledService iAlertCalledService;
@Autowired @Autowired
IAlertFromValueService iAlertFromValueService; IAlertFromValueService iAlertFromValueService;
/**
* 新增警情接警记录 /**
* @return * 新增警情接警记录
*/ *
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) * @return
@RequestMapping(value = "/save", method = RequestMethod.POST) */
@ApiOperation(httpMethod = "POST", value = "新增警情接警记录", notes = "新增警情接警记录") @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@Transactional @RequestMapping(value = "/save", method = RequestMethod.POST)
public ResponseModel saveAlertCalled(HttpServletRequest request, @RequestBody AlertCalledVo alertCalledVo){ @ApiOperation(httpMethod = "POST", value = "新增警情接警记录", notes = "新增警情接警记录")
//警情基本信息 @Transactional
AlertCalled alertCalled= alertCalledVo.getAlertCalled(); public ResponseModel saveAlertCalled(HttpServletRequest request, @RequestBody AlertCalledVo alertCalledVo) {
//判断是否归并警情 // 警情基本信息
if(alertCalled.getFatherAlert()!=null){ AlertCalled alertCalled = alertCalledVo.getAlertCalled();
//警情归并,设置当前警情状态为结束。 // 判断是否归并警情
alertCalled.setAlertStatus(true); if (alertCalled.getFatherAlert() != null) {
}else{ // 警情归并,设置当前警情状态为结束。
//警情报送 alertCalled.setAlertStatus(true);
//****************************************************待确认开发 } else {
} // 警情报送
iAlertCalledService.save(alertCalled); // ****************************************************待确认开发
//动态表单 }
List<AlertFromValue> alertFromValuelist= alertCalledVo.getAlertFromValue(); iAlertCalledService.save(alertCalled);
//填充警情主键 // 动态表单
alertFromValuelist.stream().forEach(alertFromValue->{ List<AlertFromValue> alertFromValuelist = alertCalledVo.getAlertFromValue();
alertFromValue.setAlertCalledId(alertCalled.getSequenceNbr()); // 填充警情主键
}); alertFromValuelist.stream().forEach(alertFromValue -> {
//保存动态表单数据 alertFromValue.setAlertCalledId(alertCalled.getSequenceNbr());
iAlertFromValueService.saveBatch(alertFromValuelist); });
iAlertCalledService.save(alertCalled); // 保存动态表单数据
return CommonResponseUtil.success(alertCalledVo); iAlertFromValueService.saveBatch(alertFromValuelist);
} iAlertCalledService.save(alertCalled);
return CommonResponseUtil.success(alertCalledVo);
/** }
* 根据id删除
* @param id /**
* @return * 根据id删除
*/ *
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) * @param id
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE) * @return
@ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除") */
public boolean deleteById(HttpServletRequest request, @PathVariable Long id){ @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
return iAlertCalledService.removeById(id); @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
} @ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除")
public boolean deleteById(HttpServletRequest request, @PathVariable Long id) {
return iAlertCalledService.removeById(id);
}
/** /**
* 修改警情接警记录 * 修改警情接警记录
* @return *
*/ * @return
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) */
@RequestMapping(value = "/updateById", method = RequestMethod.PUT) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "PUT", value = "修改警情接警记录", notes = "修改警情接警记录") @RequestMapping(value = "/updateById", method = RequestMethod.PUT)
public boolean updateByIdAlertCalled(HttpServletRequest request, @RequestBody AlertCalled alertCalled){ @ApiOperation(httpMethod = "PUT", value = "修改警情接警记录", notes = "修改警情接警记录")
return iAlertCalledService.updateById(alertCalled); public boolean updateByIdAlertCalled(HttpServletRequest request, @RequestBody AlertCalled alertCalled) {
} return iAlertCalledService.updateById(alertCalled);
}
/**
/** * 根据id查询
* 根据id查询 *
* @param id * @param id
* @return * @return
*/ */
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.GET) @RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询") @ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public ResponseModel selectById(HttpServletRequest request, @PathVariable Long id){ public ResponseModel selectById(HttpServletRequest request, @PathVariable Long id) {
//警情基本信息 // 警情基本信息
AlertCalled alertCalled=iAlertCalledService.getById(id); AlertCalled alertCalled = iAlertCalledService.getById(id);
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_called_id", id); queryWrapper.eq("alert_called_id", id);
//警情动态表单数据 // 警情动态表单数据
List<AlertFromValue> alertFromValue = iAlertFromValueService.list(queryWrapper); List<AlertFromValue> alertFromValue = iAlertFromValueService.list(queryWrapper);
AlertCalledVo alertCalledVo=new AlertCalledVo(alertCalled,alertFromValue); AlertCalledVo alertCalledVo = new AlertCalledVo(alertCalled, alertFromValue);
return CommonResponseUtil.success(alertCalledVo); return CommonResponseUtil.success(alertCalledVo);
} }
/**
* 列表分页查询
/** *
* 列表分页查询 * @return
* @return */
*/ @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @RequestMapping(value = "/list", method = RequestMethod.GET)
@RequestMapping(value = "/list", method = RequestMethod.GET) @ApiOperation(httpMethod = "GET", value = "列表分页查询", notes = "列表分页查询")
@ApiOperation(httpMethod = "GET", value = "列表分页查询", notes = "列表分页查询") public ResponseModel listPage(String pageNum, String pageSize, AlertCalled alertCalled) {
public ResponseModel listPage(String pageNum,String pageSize, AlertCalled alertCalled){
Page<AlertCalled> pageBean;
Page<AlertCalled> pageBean; QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>();
QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>(); Class<? extends AlertCalled> aClass = alertCalled.getClass();
Class<? extends AlertCalled> aClass = alertCalled.getClass(); alertCalledQueryWrapper.eq("is_delete", 0);
alertCalledQueryWrapper.eq("is_delete",1); alertCalledQueryWrapper.orderByDesc("call_time");
if(alertCalled.getCallTimeStart()!=null&&alertCalled.getCallTimeEnd()!=null){ if (alertCalled.getCallTimeStart() != null && alertCalled.getCallTimeEnd() != null) {
alertCalledQueryWrapper.between("call_time",alertCalled.getCallTimeStart(),alertCalled.getCallTimeEnd()); alertCalledQueryWrapper.between("call_time", alertCalled.getCallTimeStart(), alertCalled.getCallTimeEnd());
} }
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> { if(alertCalled.getIsFatherAlert()) {
try { alertCalledQueryWrapper.isNull("father_alert");
field.setAccessible(true); }
Object o = field.get(alertCalled);
if (o != null) {
Class<?> type = field.getType(); Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
String name = NameUtils.camel2Underline(field.getName()); try {
if (type.equals(Integer.class)) { field.setAccessible(true);
Integer fileValue = (Integer) field.get(alertCalled); Object o = field.get(alertCalled);
alertCalledQueryWrapper.eq(name, fileValue); if (o != null) {
} else if (type.equals(Long.class)) { Class<?> type = field.getType();
Long fileValue = (Long) field.get(alertCalled); String name = NameUtils.camel2Underline(field.getName());
alertCalledQueryWrapper.eq(name, fileValue); if (type.equals(Integer.class)) {
} else if (type.equals(String.class)) { Integer fileValue = (Integer) field.get(alertCalled);
String fileValue = (String) field.get(alertCalled); alertCalledQueryWrapper.eq(name, fileValue);
alertCalledQueryWrapper.eq(name, fileValue); } else if (type.equals(String.class)) {
} else { String fileValue = (String) field.get(alertCalled);
String fileValue = (String) field.get(alertCalled); alertCalledQueryWrapper.eq(name, fileValue);
alertCalledQueryWrapper.eq(name, fileValue); }
} }
} } catch (Exception e) {
} catch (Exception e) { e.printStackTrace();
throw new RuntimeException("系统异常"); throw new RuntimeException("系统异常");
} }
}); });
IPage<AlertCalled> page; IPage<AlertCalled> page;
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) { if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
pageBean = new Page<>(0, Long.MAX_VALUE); pageBean = new Page<>(0, Long.MAX_VALUE);
} else { } else {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize)); pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
} }
page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper); page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper);
return CommonResponseUtil.success(page); return CommonResponseUtil.success(page);
} }
}
/**
* 列表无分页查询
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getList", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "列表无分页查询", notes = "列表无分页查询")
public ResponseModel list(AlertCalled alertCalled) {
QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>();
Class<? extends AlertCalled> aClass = alertCalled.getClass();
alertCalledQueryWrapper.eq("is_delete", 0);
alertCalledQueryWrapper.orderByDesc("call_time");
if (alertCalled.getCallTimeStart() != null && alertCalled.getCallTimeEnd() != null) {
alertCalledQueryWrapper.between("call_time", alertCalled.getCallTimeStart(), alertCalled.getCallTimeEnd());
}
if(alertCalled.getIsFatherAlert()) {
alertCalledQueryWrapper.isNull("father_alert");
}
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
Object o = field.get(alertCalled);
if (o != null) {
Class<?> type = field.getType();
String name = NameUtils.camel2Underline(field.getName());
if (type.equals(Integer.class)) {
Integer fileValue = (Integer) field.get(alertCalled);
alertCalledQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) {
String fileValue = (String) field.get(alertCalled);
alertCalledQueryWrapper.eq(name, fileValue);
}
}
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常");
}
});
List<AlertCalled> list = iAlertCalledService.list(alertCalledQueryWrapper);
return CommonResponseUtil.success(list);
}
}
\ No newline at end of file
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