Commit 1fb05371 authored by tangwei's avatar tangwei

修改接口

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