Commit 1fb05371 authored by tangwei's avatar tangwei

修改接口

parent 7af2f1c8
...@@ -21,9 +21,9 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -21,9 +21,9 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("jc_alert_from") @TableName("jc_alert_form")
@ApiModel(value="AlertFrom对象", description="警情表单") @ApiModel(value="AlertForm对象", description="警情表单")
public class AlertFrom extends BaseEntity { public class AlertForm extends BaseEntity {
......
...@@ -21,9 +21,9 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -21,9 +21,9 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("jc_alert_from_type") @TableName("jc_alert_form_type")
@ApiModel(value="AlertFromType对象", description="动态表单类型") @ApiModel(value="AlertFormType对象", description="动态表单类型")
public class AlertFromType extends BaseEntity { public class AlertFormType extends BaseEntity {
......
...@@ -21,15 +21,15 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -21,15 +21,15 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("jc_alert_from_value") @TableName("jc_alert_form_value")
@ApiModel(value="AlertFromValue对象", description="") @ApiModel(value="AlertFormValue对象", description="")
public class AlertFromValue extends BaseEntity { public class AlertFormValue extends BaseEntity {
@ApiModelProperty(value = "表单id") @ApiModelProperty(value = "表单id")
private Long alertFromId; private Long alertFormId;
@ApiModelProperty(value = "警情id") @ApiModelProperty(value = "警情id")
private Long alertCalledId; private Long alertCalledId;
...@@ -54,13 +54,13 @@ public class AlertFromValue extends BaseEntity { ...@@ -54,13 +54,13 @@ public class AlertFromValue extends BaseEntity {
public AlertFromValue() { public AlertFormValue() {
super(); super();
} }
public AlertFromValue(Long alertFromId, String fieldName, String fieldCode) { public AlertFormValue(Long alertFormId, String fieldName, String fieldCode) {
super(); super();
this.alertFromId = alertFromId; this.alertFormId = alertFormId;
this.fieldName = fieldName; this.fieldName = fieldName;
this.fieldCode = fieldCode; this.fieldCode = fieldCode;
} }
......
package com.yeejoin.amos.boot.module.jcs.api.mapper; package com.yeejoin.amos.boot.module.jcs.api.mapper;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFrom; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertForm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
...@@ -9,6 +9,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -9,6 +9,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author tb * @author tb
* @date 2021-06-17 * @date 2021-06-17
*/ */
public interface AlertFromMapper extends BaseMapper<AlertFrom> { public interface AlertFormMapper extends BaseMapper<AlertForm> {
} }
package com.yeejoin.amos.boot.module.jcs.api.mapper; package com.yeejoin.amos.boot.module.jcs.api.mapper;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormType;
/** /**
* 动态表单类型 Mapper 接口 * 动态表单类型 Mapper 接口
...@@ -9,6 +9,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -9,6 +9,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author tb * @author tb
* @date 2021-06-17 * @date 2021-06-17
*/ */
public interface AlertFromTypeMapper extends BaseMapper<AlertFromType> { public interface AlertFormTypeMapper extends BaseMapper<AlertFormType> {
} }
package com.yeejoin.amos.boot.module.jcs.api.mapper; package com.yeejoin.amos.boot.module.jcs.api.mapper;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromValue; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
...@@ -9,6 +9,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -9,6 +9,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author tb * @author tb
* @date 2021-06-17 * @date 2021-06-17
*/ */
public interface AlertFromValueMapper extends BaseMapper<AlertFromValue> { public interface AlertFormValueMapper extends BaseMapper<AlertFormValue> {
} }
package com.yeejoin.amos.boot.module.jcs.api.service; package com.yeejoin.amos.boot.module.jcs.api.service;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFrom; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertForm;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
/** /**
...@@ -9,6 +9,6 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -9,6 +9,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
* @author tb * @author tb
* @date 2021-06-17 * @date 2021-06-17
*/ */
public interface IAlertFromService extends IService<AlertFrom> { public interface IAlertFormService extends IService<AlertForm> {
} }
package com.yeejoin.amos.boot.module.jcs.api.service; package com.yeejoin.amos.boot.module.jcs.api.service;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromType;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormType;
/** /**
* 动态表单类型 服务类 * 动态表单类型 服务类
...@@ -9,6 +9,6 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -9,6 +9,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
* @author tb * @author tb
* @date 2021-06-17 * @date 2021-06-17
*/ */
public interface IAlertFromTypeService extends IService<AlertFromType> { public interface IAlertFormTypeService extends IService<AlertFormType> {
} }
package com.yeejoin.amos.boot.module.jcs.api.service; package com.yeejoin.amos.boot.module.jcs.api.service;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromValue;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
/** /**
* 服务类 * 服务类
...@@ -9,6 +9,6 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -9,6 +9,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
* @author tb * @author tb
* @date 2021-06-17 * @date 2021-06-17
*/ */
public interface IAlertFromValueService extends IService<AlertFromValue> { public interface IAlertFormValueService extends IService<AlertFormValue> {
} }
...@@ -6,7 +6,7 @@ import java.util.List; ...@@ -6,7 +6,7 @@ import java.util.List;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromValue; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -30,11 +30,11 @@ public class AlertCalledVo{ ...@@ -30,11 +30,11 @@ public class AlertCalledVo{
private AlertCalled alertCalled; private AlertCalled alertCalled;
@ApiModelProperty(value = "动态表单值") @ApiModelProperty(value = "动态表单值")
private List<AlertFromValue> alertFromValue; private List<AlertFormValue> alertFormValue;
public AlertCalledVo(AlertCalled alertCalled, List<AlertFromValue> alertFromValue) { public AlertCalledVo(AlertCalled alertCalled, List<AlertFormValue> alertFormValue) {
this.alertCalled = alertCalled; this.alertCalled = alertCalled;
this.alertFromValue = alertFromValue; this.alertFormValue = alertFormValue;
} }
public AlertCalledVo() { public AlertCalledVo() {
......
...@@ -20,9 +20,9 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -20,9 +20,9 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@TableName("jc_alert_from_type") @TableName("jc_alert_form_type")
@ApiModel(value="AlertFromTypeVo", description="动态表单类型") @ApiModel(value="AlertFormTypeVo", description="动态表单类型")
public class AlertFromTypeVo{ public class AlertFormTypeVo{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -20,15 +20,15 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -20,15 +20,15 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@TableName("jc_alert_from_value") @TableName("jc_alert_form_value")
@ApiModel(value="AlertFromValueVo", description="") @ApiModel(value="AlertFormValueVo", description="")
public class AlertFromValueVo{ public class AlertFormValueVo{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "表单id") @ApiModelProperty(value = "表单id")
private Integer alertFromId; private Integer alertFormId;
@ApiModelProperty(value = "警情id") @ApiModelProperty(value = "警情id")
private Long alertCalledId; private Long alertCalledId;
......
...@@ -2,8 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.api.vo; ...@@ -2,8 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.api.vo;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromValue; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -21,7 +20,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; ...@@ -21,7 +20,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
* @date 2021-06-17 * @date 2021-06-17
*/ */
@Data @Data
public class AlertFromVo{ public class AlertFormVo{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -39,11 +38,12 @@ public class AlertFromVo{ ...@@ -39,11 +38,12 @@ public class AlertFromVo{
private Items data; private Items data;
@ApiModelProperty(value = "提交表单附加字段") @ApiModelProperty(value = "提交表单附加字段")
private AlertFromValue formItemDescr; private AlertFormValue formItemDescr;
public AlertFromVo() { public AlertFormVo() {
super(); super();
} }
public AlertFromVo(String key, String label, String type, Items data, AlertFromValue formItemDescr) { public AlertFormVo(String key, String label, String type, Items data, AlertFormValue formItemDescr) {
super(); super();
this.key = key; this.key = key;
this.label = label; this.label = label;
......
...@@ -10,14 +10,14 @@ import org.apache.velocity.runtime.directive.Foreach; ...@@ -10,14 +10,14 @@ import org.apache.velocity.runtime.directive.Foreach;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFrom; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertForm;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromValue; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.DataDictionary; import com.yeejoin.amos.boot.module.jcs.api.entity.DataDictionary;
import com.yeejoin.amos.boot.module.jcs.api.service.IDataDictionaryService; import com.yeejoin.amos.boot.module.jcs.api.service.IDataDictionaryService;
import com.yeejoin.amos.boot.module.jcs.api.service.IFireTeamService; import com.yeejoin.amos.boot.module.jcs.api.service.IFireTeamService;
@Component @Component
public class FromList { public class FormList {
/** /**
* 数据字典 * 数据字典
* *
...@@ -25,22 +25,22 @@ public class FromList { ...@@ -25,22 +25,22 @@ public class FromList {
@Autowired @Autowired
IDataDictionaryService iDataDictionaryService; IDataDictionaryService iDataDictionaryService;
public List<AlertFromVo> getFromlist(List<AlertFrom> list) { public List<AlertFormVo> getFormlist(List<AlertForm> list) {
List<AlertFromVo> listfrom = new ArrayList<AlertFromVo>(); List<AlertFormVo> listfrom = new ArrayList<AlertFormVo>();
// 组装数据 // 组装数据
for (AlertFrom alertFrom : list) { for (AlertForm alertFrom : list) {
if(alertFrom.getFieldType().equals("string")||alertFrom.getFieldType().equals("date")||alertFrom.getFieldType().equals("textarea")) { if(alertFrom.getFieldType().equals("string")||alertFrom.getFieldType().equals("date")||alertFrom.getFieldType().equals("textarea")) {
AlertFromVo vo = new AlertFromVo(alertFrom.getFieldCode(), alertFrom.getFieldName(), alertFrom.getFieldType(), null, AlertFormVo vo = new AlertFormVo(alertFrom.getFieldCode(), alertFrom.getFieldName(), alertFrom.getFieldType(), null,
new AlertFromValue(alertFrom.getSequenceNbr(),alertFrom.getFieldName(), alertFrom.getFieldCode())); new AlertFormValue(alertFrom.getSequenceNbr(),alertFrom.getFieldName(), alertFrom.getFieldCode()));
listfrom.add(vo); listfrom.add(vo);
}else { }else {
// 查询数据项 // 查询数据项
Map<String, Object> columnMap = new HashMap<>(); Map<String, Object> columnMap = new HashMap<>();
columnMap.put("type", alertFrom.getFieldValueCode()); columnMap.put("type", alertFrom.getFieldValueCode());
Collection<DataDictionary> listDataDictionary = iDataDictionaryService.listByMap(columnMap); Collection<DataDictionary> listDataDictionary = iDataDictionaryService.listByMap(columnMap);
AlertFromVo vo = new AlertFromVo(alertFrom.getFieldCode(), alertFrom.getFieldName(), alertFrom.getFieldType(), AlertFormVo vo = new AlertFormVo(alertFrom.getFieldCode(), alertFrom.getFieldName(), alertFrom.getFieldType(),
new Items(getdata(listDataDictionary)), new AlertFromValue(alertFrom.getSequenceNbr(),alertFrom.getFieldName(), alertFrom.getFieldCode())); new Items(getdata(listDataDictionary)), new AlertFormValue(alertFrom.getSequenceNbr(),alertFrom.getFieldName(), alertFrom.getFieldCode()));
listfrom.add(vo); listfrom.add(vo);
} }
} }
......
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.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersJacket; import com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersJacket;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFromValueService; import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormValueService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledListVo; import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledListVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo; import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -45,7 +45,7 @@ public class AlertCalledController extends BaseController { ...@@ -45,7 +45,7 @@ public class AlertCalledController extends BaseController {
@Autowired @Autowired
IAlertCalledService iAlertCalledService; IAlertCalledService iAlertCalledService;
@Autowired @Autowired
IAlertFromValueService iAlertFromValueService; IAlertFormValueService iAlertFormValueService;
/** /**
* 新增警情接警记录 * 新增警情接警记录
...@@ -69,13 +69,13 @@ public class AlertCalledController extends BaseController { ...@@ -69,13 +69,13 @@ public class AlertCalledController extends BaseController {
} }
iAlertCalledService.save(alertCalled); iAlertCalledService.save(alertCalled);
// 动态表单 // 动态表单
List<AlertFromValue> alertFromValuelist = alertCalledVo.getAlertFromValue(); List<AlertFormValue> alertFormValuelist = alertCalledVo.getAlertFormValue();
// 填充警情主键 // 填充警情主键
alertFromValuelist.stream().forEach(alertFromValue -> { alertFormValuelist.stream().forEach(alertFormValue -> {
alertFromValue.setAlertCalledId(alertCalled.getSequenceNbr()); alertFormValue.setAlertCalledId(alertCalled.getSequenceNbr());
}); });
// 保存动态表单数据 // 保存动态表单数据
iAlertFromValueService.saveBatch(alertFromValuelist); iAlertFormValueService.saveBatch(alertFormValuelist);
iAlertCalledService.save(alertCalled); iAlertCalledService.save(alertCalled);
return CommonResponseUtil.success(alertCalledVo); return CommonResponseUtil.success(alertCalledVo);
} }
...@@ -120,8 +120,8 @@ public class AlertCalledController extends BaseController { ...@@ -120,8 +120,8 @@ public class AlertCalledController extends BaseController {
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<AlertFormValue> alertFormValue = iAlertFormValueService.list(queryWrapper);
AlertCalledVo alertCalledVo = new AlertCalledVo(alertCalled, alertFromValue); AlertCalledVo alertCalledVo = new AlertCalledVo(alertCalled, alertFormValue);
return CommonResponseUtil.success(alertCalledVo); return CommonResponseUtil.success(alertCalledVo);
} }
......
...@@ -6,17 +6,17 @@ import org.apache.commons.lang3.StringUtils; ...@@ -6,17 +6,17 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFromService; import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFromVo; import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FromList; import com.yeejoin.amos.boot.module.jcs.api.vo.FormList;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFrom; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertForm;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromValue; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.biz.common.utils.CommonResponseUtil; import com.yeejoin.amos.boot.biz.common.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -34,13 +34,13 @@ import java.util.List; ...@@ -34,13 +34,13 @@ import java.util.List;
*/ */
@RestController @RestController
@Api(tags = "警情表单Api") @Api(tags = "警情表单Api")
@RequestMapping(value = "/jcs/alert-from") @RequestMapping(value = "/jcs/alert-Form")
public class AlertFromController extends BaseController { public class AlertFormController extends BaseController {
@Autowired @Autowired
IAlertFromService iAlertFromService; IAlertFormService iAlertFormService;
@Autowired @Autowired
FromList fromList; FormList FormList;
/** /**
* 新增警情表单 * 新增警情表单
* @return * @return
...@@ -48,8 +48,8 @@ public class AlertFromController extends BaseController { ...@@ -48,8 +48,8 @@ public class AlertFromController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/save", method = RequestMethod.POST) @RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增警情表单", notes = "新增警情表单") @ApiOperation(httpMethod = "POST", value = "新增警情表单", notes = "新增警情表单")
public boolean saveAlertFrom(HttpServletRequest request, @RequestBody AlertFrom alertFrom){ public boolean saveAlertForm(HttpServletRequest request, @RequestBody AlertForm alertForm){
return iAlertFromService.save(alertFrom); return iAlertFormService.save(alertForm);
} }
/** /**
...@@ -61,7 +61,7 @@ public class AlertFromController extends BaseController { ...@@ -61,7 +61,7 @@ public class AlertFromController extends BaseController {
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除") @ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除")
public boolean deleteById(HttpServletRequest request, @PathVariable Long id){ public boolean deleteById(HttpServletRequest request, @PathVariable Long id){
return iAlertFromService.removeById(id); return iAlertFormService.removeById(id);
} }
...@@ -74,8 +74,8 @@ public class AlertFromController extends BaseController { ...@@ -74,8 +74,8 @@ public class AlertFromController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/updateById", method = RequestMethod.PUT) @RequestMapping(value = "/updateById", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "修改警情表单", notes = "修改警情表单") @ApiOperation(httpMethod = "PUT", value = "修改警情表单", notes = "修改警情表单")
public boolean updateByIdAlertFrom(HttpServletRequest request, @RequestBody AlertFrom alertFrom){ public boolean updateByIdAlertForm(HttpServletRequest request, @RequestBody AlertForm alertForm){
return iAlertFromService.updateById(alertFrom); return iAlertFormService.updateById(alertForm);
} }
...@@ -88,8 +88,8 @@ public class AlertFromController extends BaseController { ...@@ -88,8 +88,8 @@ public class AlertFromController extends BaseController {
@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 AlertFrom selectById(HttpServletRequest request, @PathVariable Long id){ public AlertForm selectById(HttpServletRequest request, @PathVariable Long id){
return iAlertFromService.getById(id); return iAlertFormService.getById(id);
} }
...@@ -101,15 +101,15 @@ public class AlertFromController extends BaseController { ...@@ -101,15 +101,15 @@ public class AlertFromController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/from/{code}", method = RequestMethod.GET) @RequestMapping(value = "/Form/{code}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询") @ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public ResponseModel selectFromdItem(HttpServletRequest request, @PathVariable String code){ public ResponseModel selectFormdItem(HttpServletRequest request, @PathVariable String code){
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_type_code", code); queryWrapper.eq("alert_type_code", code);
//警情动态表单数据 //警情动态表单数据
List<AlertFrom> alertFromValue = iAlertFromService.list(queryWrapper); List<AlertForm> alertFormValue = iAlertFormService.list(queryWrapper);
List<AlertFromVo> list= fromList.getFromlist(alertFromValue); List<AlertFormVo> list= FormList.getFormlist(alertFormValue);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
...@@ -128,43 +128,43 @@ public class AlertFromController extends BaseController { ...@@ -128,43 +128,43 @@ public class AlertFromController extends BaseController {
@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 IPage<AlertFrom> listPage(String pageNum,String pageSize, AlertFrom alertFrom){ public IPage<AlertForm> listPage(String pageNum,String pageSize, AlertForm alertForm){
Page<AlertFrom> pageBean; Page<AlertForm> pageBean;
QueryWrapper<AlertFrom> alertFromQueryWrapper = new QueryWrapper<>(); QueryWrapper<AlertForm> alertFormQueryWrapper = new QueryWrapper<>();
Class<? extends AlertFrom> aClass = alertFrom.getClass(); Class<? extends AlertForm> aClass = alertForm.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> { Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try { try {
field.setAccessible(true); field.setAccessible(true);
Object o = field.get(alertFrom); Object o = field.get(alertForm);
if (o != null) { if (o != null) {
Class<?> type = field.getType(); Class<?> type = field.getType();
String name = NameUtils.camel2Underline(field.getName()); String name = NameUtils.camel2Underline(field.getName());
if (type.equals(Integer.class)) { if (type.equals(Integer.class)) {
Integer fileValue = (Integer) field.get(alertFrom); Integer fileValue = (Integer) field.get(alertForm);
alertFromQueryWrapper.eq(name, fileValue); alertFormQueryWrapper.eq(name, fileValue);
} else if (type.equals(Long.class)) { } else if (type.equals(Long.class)) {
Long fileValue = (Long) field.get(alertFrom); Long fileValue = (Long) field.get(alertForm);
alertFromQueryWrapper.eq(name, fileValue); alertFormQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) { } else if (type.equals(String.class)) {
String fileValue = (String) field.get(alertFrom); String fileValue = (String) field.get(alertForm);
alertFromQueryWrapper.eq(name, fileValue); alertFormQueryWrapper.eq(name, fileValue);
} else { } else {
String fileValue = (String) field.get(alertFrom); String fileValue = (String) field.get(alertForm);
alertFromQueryWrapper.eq(name, fileValue); alertFormQueryWrapper.eq(name, fileValue);
} }
} }
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException("系统异常"); throw new RuntimeException("系统异常");
} }
}); });
IPage<AlertFrom> page; IPage<AlertForm> 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 = iAlertFromService.page(pageBean, alertFromQueryWrapper); page = iAlertFormService.page(pageBean, alertFormQueryWrapper);
return page; return page;
} }
} }
......
...@@ -6,7 +6,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -6,7 +6,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFromTypeService; import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormTypeService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -14,7 +14,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -14,7 +14,7 @@ import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromType; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormType;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -29,11 +29,11 @@ import java.util.Arrays; ...@@ -29,11 +29,11 @@ import java.util.Arrays;
*/ */
@RestController @RestController
@Api(tags = "动态表单类型Api") @Api(tags = "动态表单类型Api")
@RequestMapping(value = "/jcs/alert-from-type") @RequestMapping(value = "/jcs/alert-Form-type")
public class AlertFromTypeController extends BaseController { public class AlertFormTypeController extends BaseController {
@Autowired @Autowired
IAlertFromTypeService iAlertFromTypeService; IAlertFormTypeService iAlertFormTypeService;
/** /**
* 新增动态表单类型 * 新增动态表单类型
...@@ -42,8 +42,8 @@ public class AlertFromTypeController extends BaseController { ...@@ -42,8 +42,8 @@ public class AlertFromTypeController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/save", method = RequestMethod.POST) @RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增动态表单类型", notes = "新增动态表单类型") @ApiOperation(httpMethod = "POST", value = "新增动态表单类型", notes = "新增动态表单类型")
public boolean saveAlertFromType(HttpServletRequest request, @RequestBody AlertFromType alertFromType){ public boolean saveAlertFormType(HttpServletRequest request, @RequestBody AlertFormType alertFormType){
return iAlertFromTypeService.save(alertFromType); return iAlertFormTypeService.save(alertFormType);
} }
/** /**
...@@ -55,7 +55,7 @@ public class AlertFromTypeController extends BaseController { ...@@ -55,7 +55,7 @@ public class AlertFromTypeController extends BaseController {
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除") @ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除")
public boolean deleteById(HttpServletRequest request, @PathVariable Long id){ public boolean deleteById(HttpServletRequest request, @PathVariable Long id){
return iAlertFromTypeService.removeById(id); return iAlertFormTypeService.removeById(id);
} }
...@@ -68,8 +68,8 @@ public class AlertFromTypeController extends BaseController { ...@@ -68,8 +68,8 @@ public class AlertFromTypeController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/updateById", method = RequestMethod.PUT) @RequestMapping(value = "/updateById", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "修改动态表单类型", notes = "修改动态表单类型") @ApiOperation(httpMethod = "PUT", value = "修改动态表单类型", notes = "修改动态表单类型")
public boolean updateByIdAlertFromType(HttpServletRequest request, @RequestBody AlertFromType alertFromType){ public boolean updateByIdAlertFormType(HttpServletRequest request, @RequestBody AlertFormType alertFormType){
return iAlertFromTypeService.updateById(alertFromType); return iAlertFormTypeService.updateById(alertFormType);
} }
...@@ -82,8 +82,8 @@ public class AlertFromTypeController extends BaseController { ...@@ -82,8 +82,8 @@ public class AlertFromTypeController extends BaseController {
@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 AlertFromType selectById(HttpServletRequest request, @PathVariable Long id){ public AlertFormType selectById(HttpServletRequest request, @PathVariable Long id){
return iAlertFromTypeService.getById(id); return iAlertFormTypeService.getById(id);
} }
...@@ -95,43 +95,43 @@ public class AlertFromTypeController extends BaseController { ...@@ -95,43 +95,43 @@ public class AlertFromTypeController extends BaseController {
@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 IPage<AlertFromType> listPage(String pageNum,String pageSize, AlertFromType alertFromType){ public IPage<AlertFormType> listPage(String pageNum,String pageSize, AlertFormType alertFormType){
Page<AlertFromType> pageBean; Page<AlertFormType> pageBean;
QueryWrapper<AlertFromType> alertFromTypeQueryWrapper = new QueryWrapper<>(); QueryWrapper<AlertFormType> alertFormTypeQueryWrapper = new QueryWrapper<>();
Class<? extends AlertFromType> aClass = alertFromType.getClass(); Class<? extends AlertFormType> aClass = alertFormType.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> { Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try { try {
field.setAccessible(true); field.setAccessible(true);
Object o = field.get(alertFromType); Object o = field.get(alertFormType);
if (o != null) { if (o != null) {
Class<?> type = field.getType(); Class<?> type = field.getType();
String name = NameUtils.camel2Underline(field.getName()); String name = NameUtils.camel2Underline(field.getName());
if (type.equals(Integer.class)) { if (type.equals(Integer.class)) {
Integer fileValue = (Integer) field.get(alertFromType); Integer fileValue = (Integer) field.get(alertFormType);
alertFromTypeQueryWrapper.eq(name, fileValue); alertFormTypeQueryWrapper.eq(name, fileValue);
} else if (type.equals(Long.class)) { } else if (type.equals(Long.class)) {
Long fileValue = (Long) field.get(alertFromType); Long fileValue = (Long) field.get(alertFormType);
alertFromTypeQueryWrapper.eq(name, fileValue); alertFormTypeQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) { } else if (type.equals(String.class)) {
String fileValue = (String) field.get(alertFromType); String fileValue = (String) field.get(alertFormType);
alertFromTypeQueryWrapper.eq(name, fileValue); alertFormTypeQueryWrapper.eq(name, fileValue);
} else { } else {
String fileValue = (String) field.get(alertFromType); String fileValue = (String) field.get(alertFormType);
alertFromTypeQueryWrapper.eq(name, fileValue); alertFormTypeQueryWrapper.eq(name, fileValue);
} }
} }
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException("系统异常"); throw new RuntimeException("系统异常");
} }
}); });
IPage<AlertFromType> page; IPage<AlertFormType> 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 = iAlertFromTypeService.page(pageBean, alertFromTypeQueryWrapper); page = iAlertFormTypeService.page(pageBean, alertFormTypeQueryWrapper);
return page; return page;
} }
} }
......
...@@ -6,7 +6,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -6,7 +6,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFromValueService; import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormValueService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -14,7 +14,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -14,7 +14,7 @@ import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromValue; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -29,11 +29,11 @@ import java.util.Arrays; ...@@ -29,11 +29,11 @@ import java.util.Arrays;
*/ */
@RestController @RestController
@Api(tags = "Api") @Api(tags = "Api")
@RequestMapping(value = "/jcs/alert-from-value") @RequestMapping(value = "/jcs/alert-Form-value")
public class AlertFromValueController extends BaseController { public class AlertFormValueController extends BaseController {
@Autowired @Autowired
IAlertFromValueService iAlertFromValueService; IAlertFormValueService iAlertFormValueService;
/** /**
* 新增 * 新增
...@@ -42,8 +42,8 @@ public class AlertFromValueController extends BaseController { ...@@ -42,8 +42,8 @@ public class AlertFromValueController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/save", method = RequestMethod.POST) @RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增") @ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public boolean saveAlertFromValue(HttpServletRequest request, @RequestBody AlertFromValue alertFromValue){ public boolean saveAlertFormValue(HttpServletRequest request, @RequestBody AlertFormValue alertFormValue){
return iAlertFromValueService.save(alertFromValue); return iAlertFormValueService.save(alertFormValue);
} }
/** /**
...@@ -55,7 +55,7 @@ public class AlertFromValueController extends BaseController { ...@@ -55,7 +55,7 @@ public class AlertFromValueController extends BaseController {
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除") @ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除")
public boolean deleteById(HttpServletRequest request, @PathVariable Long id){ public boolean deleteById(HttpServletRequest request, @PathVariable Long id){
return iAlertFromValueService.removeById(id); return iAlertFormValueService.removeById(id);
} }
...@@ -68,8 +68,8 @@ public class AlertFromValueController extends BaseController { ...@@ -68,8 +68,8 @@ public class AlertFromValueController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/updateById", method = RequestMethod.PUT) @RequestMapping(value = "/updateById", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "修改", notes = "修改") @ApiOperation(httpMethod = "PUT", value = "修改", notes = "修改")
public boolean updateByIdAlertFromValue(HttpServletRequest request, @RequestBody AlertFromValue alertFromValue){ public boolean updateByIdAlertFormValue(HttpServletRequest request, @RequestBody AlertFormValue alertFormValue){
return iAlertFromValueService.updateById(alertFromValue); return iAlertFormValueService.updateById(alertFormValue);
} }
...@@ -82,8 +82,8 @@ public class AlertFromValueController extends BaseController { ...@@ -82,8 +82,8 @@ public class AlertFromValueController extends BaseController {
@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 AlertFromValue selectById(HttpServletRequest request, @PathVariable Long id){ public AlertFormValue selectById(HttpServletRequest request, @PathVariable Long id){
return iAlertFromValueService.getById(id); return iAlertFormValueService.getById(id);
} }
...@@ -95,43 +95,43 @@ public class AlertFromValueController extends BaseController { ...@@ -95,43 +95,43 @@ public class AlertFromValueController extends BaseController {
@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 IPage<AlertFromValue> listPage(String pageNum,String pageSize, AlertFromValue alertFromValue){ public IPage<AlertFormValue> listPage(String pageNum,String pageSize, AlertFormValue alertFormValue){
Page<AlertFromValue> pageBean; Page<AlertFormValue> pageBean;
QueryWrapper<AlertFromValue> alertFromValueQueryWrapper = new QueryWrapper<>(); QueryWrapper<AlertFormValue> alertFormValueQueryWrapper = new QueryWrapper<>();
Class<? extends AlertFromValue> aClass = alertFromValue.getClass(); Class<? extends AlertFormValue> aClass = alertFormValue.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> { Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try { try {
field.setAccessible(true); field.setAccessible(true);
Object o = field.get(alertFromValue); Object o = field.get(alertFormValue);
if (o != null) { if (o != null) {
Class<?> type = field.getType(); Class<?> type = field.getType();
String name = NameUtils.camel2Underline(field.getName()); String name = NameUtils.camel2Underline(field.getName());
if (type.equals(Integer.class)) { if (type.equals(Integer.class)) {
Integer fileValue = (Integer) field.get(alertFromValue); Integer fileValue = (Integer) field.get(alertFormValue);
alertFromValueQueryWrapper.eq(name, fileValue); alertFormValueQueryWrapper.eq(name, fileValue);
} else if (type.equals(Long.class)) { } else if (type.equals(Long.class)) {
Long fileValue = (Long) field.get(alertFromValue); Long fileValue = (Long) field.get(alertFormValue);
alertFromValueQueryWrapper.eq(name, fileValue); alertFormValueQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) { } else if (type.equals(String.class)) {
String fileValue = (String) field.get(alertFromValue); String fileValue = (String) field.get(alertFormValue);
alertFromValueQueryWrapper.eq(name, fileValue); alertFormValueQueryWrapper.eq(name, fileValue);
} else { } else {
String fileValue = (String) field.get(alertFromValue); String fileValue = (String) field.get(alertFormValue);
alertFromValueQueryWrapper.eq(name, fileValue); alertFormValueQueryWrapper.eq(name, fileValue);
} }
} }
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException("系统异常"); throw new RuntimeException("系统异常");
} }
}); });
IPage<AlertFromValue> page; IPage<AlertFormValue> 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 = iAlertFromValueService.page(pageBean, alertFromValueQueryWrapper); page = iAlertFormValueService.page(pageBean, alertFormValueQueryWrapper);
return page; return page;
} }
} }
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFrom;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertFromMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFromService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertForm;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertFormMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -13,6 +15,6 @@ import org.springframework.stereotype.Service; ...@@ -13,6 +15,6 @@ import org.springframework.stereotype.Service;
* @date 2021-06-17 * @date 2021-06-17
*/ */
@Service @Service
public class AlertFromServiceImpl extends ServiceImpl<AlertFromMapper, AlertFrom> implements IAlertFromService { public class AlertFormServiceImpl extends ServiceImpl<AlertFormMapper, AlertForm> implements IAlertFormService {
} }
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromType; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormType;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertFromTypeMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertFormTypeMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFromTypeService; import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -13,6 +13,6 @@ import org.springframework.stereotype.Service; ...@@ -13,6 +13,6 @@ import org.springframework.stereotype.Service;
* @date 2021-06-17 * @date 2021-06-17
*/ */
@Service @Service
public class AlertFromTypeServiceImpl extends ServiceImpl<AlertFromTypeMapper, AlertFromType> implements IAlertFromTypeService { public class AlertFormTypeServiceImpl extends ServiceImpl<AlertFormTypeMapper, AlertFormType> implements IAlertFormTypeService {
} }
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromValue; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertFromValueMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertFormValueMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFromValueService; import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormValueService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -13,6 +13,6 @@ import org.springframework.stereotype.Service; ...@@ -13,6 +13,6 @@ import org.springframework.stereotype.Service;
* @date 2021-06-17 * @date 2021-06-17
*/ */
@Service @Service
public class AlertFromValueServiceImpl extends ServiceImpl<AlertFromValueMapper, AlertFromValue> implements IAlertFromValueService { public class AlertFormValueServiceImpl extends ServiceImpl<AlertFormValueMapper, AlertFormValue> implements IAlertFormValueService {
} }
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