调整
This commit is contained in:
parent
c6f82c55f8
commit
0f05f8e7b0
@ -0,0 +1,109 @@
|
||||
package com.zhgd.xmgl.modules.quality.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.xmgl.modules.quality.entity.QualityInspectType;
|
||||
import com.zhgd.xmgl.modules.quality.service.IQualityInspectTypeService;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 质量检查类型
|
||||
* @author: pengj
|
||||
* @date: 2024-09-04
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/qualityInspectType")
|
||||
@Slf4j
|
||||
@Api(tags = "质量检查类型管理")
|
||||
public class QualityInspectTypeController {
|
||||
@Autowired
|
||||
private IQualityInspectTypeService qualityInspectTypeService;
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "列表查询检查类型表信息", notes = "列表查询检查类型表信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "sn", value = "公司sn", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/list")
|
||||
public Result<List<QualityInspectType>> queryPageList(@RequestBody Map<String, Object> map) {
|
||||
Result<List<QualityInspectType>> result = new Result<List<QualityInspectType>>();
|
||||
QueryWrapper<QualityInspectType> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(QualityInspectType::getSn, MapUtils.getString(map, "sn"));
|
||||
List<QualityInspectType> pageList = qualityInspectTypeService.list(queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param inspectType
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加检查类型表信息", notes = "添加检查类型表信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<QualityInspectType> add(@RequestBody QualityInspectType inspectType) {
|
||||
qualityInspectTypeService.saveInspectType(inspectType);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param inspectType
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "编辑检查类型表信息", notes = "编辑检查类型表信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<QualityInspectType> edit(@RequestBody QualityInspectType inspectType) {
|
||||
qualityInspectTypeService.editInspectType(inspectType);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除检查类型表信息", notes = "删除检查类型表信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "检查类型表ID", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<QualityInspectType> delete(@RequestBody Map<String, Object> map) {
|
||||
Result<QualityInspectType> result = new Result<QualityInspectType>();
|
||||
QualityInspectType inspectType = qualityInspectTypeService.getById(MapUtils.getString(map, "id"));
|
||||
if (inspectType == null) {
|
||||
result.error500(MessageUtil.get("notFindErr"));
|
||||
} else {
|
||||
boolean ok = qualityInspectTypeService.removeById(MapUtils.getString(map, "id"));
|
||||
if (ok) {
|
||||
result.successMsg(MessageUtil.get("deleteSucess"));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package com.zhgd.xmgl.modules.quality.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* @Description: 质量检查类型
|
||||
* @author: pengj
|
||||
* @date: 2024-09-04
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("quality_inspect_type")
|
||||
@ApiModel(value = "QualityInspectType实体类", description = "QualityInspectType")
|
||||
public class QualityInspectType implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 检查类型表
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "检查类型表")
|
||||
private Long id;
|
||||
/**
|
||||
* 检查类型名称
|
||||
*/
|
||||
@Excel(name = "检查类型名称", width = 15)
|
||||
@ApiModelProperty(value = "检查类型名称")
|
||||
private String inspectTypeName;
|
||||
/**
|
||||
* 企业SN
|
||||
*/
|
||||
@Excel(name = "企业SN", width = 15)
|
||||
@ApiModelProperty(value = "企业SN")
|
||||
private String sn;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Excel(name = "描述", width = 15)
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String description;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name = "创建时间", width = 15)
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private String createTime;
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.zhgd.xmgl.modules.quality.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.zhgd.xmgl.modules.quality.entity.QualityInspectType;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 质量检查类型
|
||||
* @author: pengj
|
||||
* @date: 2024-09-04
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface QualityInspectTypeMapper extends BaseMapper<QualityInspectType> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhgd.xmgl.modules.quality.mapper.QualityInspectTypeMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,25 @@
|
||||
package com.zhgd.xmgl.modules.quality.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.quality.entity.QualityInspectType;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 质量检查类型
|
||||
* @author: pengj
|
||||
* @date: 2024-09-04
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface IQualityInspectTypeService extends IService<QualityInspectType> {
|
||||
|
||||
/**
|
||||
* 添加检查类型表信息
|
||||
* @param inspectType
|
||||
*/
|
||||
void saveInspectType(QualityInspectType inspectType);
|
||||
|
||||
/**
|
||||
* 编辑检查类型表信息
|
||||
* @param inspectType
|
||||
*/
|
||||
void editInspectType(QualityInspectType inspectType);
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package com.zhgd.xmgl.modules.quality.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.quality.entity.QualityInspectType;
|
||||
import com.zhgd.xmgl.modules.quality.mapper.QualityInspectTypeMapper;
|
||||
import com.zhgd.xmgl.modules.quality.service.IQualityInspectTypeService;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Description: 质量检查类型
|
||||
* @author: pengj
|
||||
* @date: 2024-09-04
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class QualityInspectTypeServiceImpl extends ServiceImpl<QualityInspectTypeMapper, QualityInspectType> implements IQualityInspectTypeService {
|
||||
@Autowired
|
||||
private QualityInspectTypeMapper qualityInspectTypeMapper;
|
||||
|
||||
@Override
|
||||
public void saveInspectType(QualityInspectType inspectType) {
|
||||
QueryWrapper<QualityInspectType> queryWrapper=new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(QualityInspectType::getSn,inspectType.getSn())
|
||||
.eq(QualityInspectType::getInspectTypeName,inspectType.getInspectTypeName());
|
||||
int count=qualityInspectTypeMapper.selectCount(queryWrapper);
|
||||
if(count>0){
|
||||
throw new OpenAlertException(MessageUtil.get("nameExistErr"));
|
||||
}
|
||||
qualityInspectTypeMapper.insert(inspectType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editInspectType(QualityInspectType inspectType) {
|
||||
QueryWrapper<QualityInspectType> queryWrapper=new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(QualityInspectType::getSn,inspectType.getSn())
|
||||
.eq(QualityInspectType::getInspectTypeName,inspectType.getInspectTypeName())
|
||||
.ne(QualityInspectType::getId,inspectType.getId());
|
||||
int count=qualityInspectTypeMapper.selectCount(queryWrapper);
|
||||
if(count>0){
|
||||
throw new OpenAlertException(MessageUtil.get("nameExistErr"));
|
||||
}
|
||||
qualityInspectTypeMapper.updateById(inspectType);
|
||||
}
|
||||
}
|
||||
@ -60,6 +60,18 @@ public class SafetyHatDataController {
|
||||
return Result.success(safetyHatDataService.queryPageList(paramMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "智能安全帽实时数据管理", operType = "查询", operDesc = "列表查询智能安全帽-实时数据信息")
|
||||
@ApiOperation(value = "列表查询智能安全帽-实时数据信息", notes = "列表查询智能安全帽-实时数据信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/allList")
|
||||
public Result<List<SafetyHatData>> allList(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(safetyHatDataService.allList(paramMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhgd.xmgl.modules.safetyhat.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -27,7 +28,7 @@ public interface SafetyHatDataMapper extends BaseMapper<SafetyHatData> {
|
||||
* @param queryWrapper
|
||||
* @return
|
||||
*/
|
||||
IPage<SafetyHatData> queryList(Page<SafetyHatData> page, @Param(Constants.WRAPPER) QueryWrapper<SafetyHatData> queryWrapper);
|
||||
IPage<SafetyHatData> queryList(Page<SafetyHatData> page, @Param(Constants.WRAPPER) Wrapper<SafetyHatData> queryWrapper);
|
||||
|
||||
/**
|
||||
* 列表查询智能安全帽-实时数据信息
|
||||
|
||||
@ -25,6 +25,8 @@ public interface ISafetyHatDataService extends IService<SafetyHatData> {
|
||||
*/
|
||||
IPage<SafetyHatData> queryPageList(HashMap<String, Object> paramMap);
|
||||
|
||||
List<SafetyHatData> allList(HashMap<String, Object> paramMap);
|
||||
|
||||
/**
|
||||
* 列表查询智能安全帽-实时数据信息
|
||||
*
|
||||
|
||||
@ -71,6 +71,13 @@ public class SafetyHatDataServiceImpl extends ServiceImpl<SafetyHatDataMapper, S
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SafetyHatData> allList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<SafetyHatData> queryWrapper = getQueryWrapper(paramMap);
|
||||
IPage<SafetyHatData> pageList = baseMapper.queryList(new Page<>(-1, -1), queryWrapper);
|
||||
return pageList.getRecords();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SafetyHatData> queryList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<SafetyHatData> queryWrapper = getQueryWrapper(paramMap);
|
||||
|
||||
@ -402,6 +402,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
.antMatchers("/xmgl/workerExam/**").permitAll()
|
||||
.antMatchers("/exam/safetyManual/**").permitAll()
|
||||
.antMatchers("/exam/regulation/**").permitAll()
|
||||
.antMatchers("/xmgl/safetyHatData/getNewestList1").permitAll()
|
||||
.antMatchers("/xmgl/safetyHatData/allList").permitAll()
|
||||
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
|
||||
.anyRequest().authenticated() // 剩下所有的验证都需要验证.
|
||||
.and()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user