Commit 01bddefd authored by shizhilong's avatar shizhilong

Merge branch 'dev-szl', remote-tracking branch 'origin' into dev

parents 840a7088 517cc9a6
...@@ -45,6 +45,19 @@ ...@@ -45,6 +45,19 @@
<groupId>org.jeecgframework.jimureport</groupId> <groupId>org.jeecgframework.jimureport</groupId>
<artifactId>jimureport-spring-boot-starter</artifactId> <artifactId>jimureport-spring-boot-starter</artifactId>
</dependency> </dependency>
<!-- hutool -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.4.0</version>
</dependency>
<!--字符串-->
<dependency>
<groupId>com.belerweb</groupId>
<artifactId>pinyin4j</artifactId>
<version>2.5.1</version>
</dependency>
<!-- 积木报表 mongo redis 支持包 <!-- 积木报表 mongo redis 支持包
<dependency> <dependency>
<groupId>org.jeecgframework.jimureport</groupId> <groupId>org.jeecgframework.jimureport</groupId>
......
...@@ -25,11 +25,11 @@ public class CodeGenerate { ...@@ -25,11 +25,11 @@ public class CodeGenerate {
String outputDir = projectPath + "\\jeecg-module-system\\src\\main\\java\\"; String outputDir = projectPath + "\\jeecg-module-system\\src\\main\\java\\";
// 模块名 // 模块名
String moduleName = "deviceAsset"; String moduleName = "checkData.equipmentCheckData";
// 表名 // 表名
String[] tables = { String[] tables = {
"t_da_rail_management", "t_ek_track_bed_management_check",
}; };
...@@ -57,7 +57,7 @@ public class CodeGenerate { ...@@ -57,7 +57,7 @@ public class CodeGenerate {
// 设置过滤前缀 // 设置过滤前缀
.strategyConfig(builder -> { .strategyConfig(builder -> {
builder.addInclude(tables) // 设置需要生成的表名 builder.addInclude(tables) // 设置需要生成的表名
.addTablePrefix("t_sn", "t_da"); // 设置过滤表前缀 .addTablePrefix("t_sn", "t_da","t_ek"); // 设置过滤表前缀
// entity实体策略 // entity实体策略
builder.entityBuilder() builder.entityBuilder()
......
package org.jeecg.modules.checkData.equipmentCheckData.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.modules.checkData.equipmentCheckData.dto.RecordsMasterCheckDTO;
import org.jeecg.modules.checkData.equipmentCheckData.entity.RecordsMasterCheck;
import org.jeecg.modules.checkData.equipmentCheckData.entity.TrackBedManagementCheck;
import org.jeecg.modules.checkData.equipmentCheckData.service.IRecordsMasterCheckService;
import org.jeecg.modules.checkData.equipmentCheckData.service.ITrackBedManagementCheckService;
import org.jeecg.modules.checkData.equipmentCheckData.vo.RecordsMasterCheckVO;
import org.jeecg.modules.checkData.equipmentCheckData.vo.TrackBedManagementCheckVO;
import org.jeecg.modules.deviceAsset.entity.TrackBedManagement;
import org.jeecg.modules.deviceAsset.service.ITrackBedManagementService;
import org.jeecg.modules.utils.BeanCopyUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.jeecg.common.system.base.controller.JeecgController;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* 设备检查记录主表 前端控制器
* </p>
*
* @author hkl
* @since 2023-07-07
*/
@RestController
@RequestMapping("/recordsMaster/check")
@Api(tags = "设备检查记录主表控制器")
public class RecordsMasterCheckController extends JeecgController<RecordsMasterCheck, IRecordsMasterCheckService> {
@Autowired
private ITrackBedManagementService trackBedManagementService;
@Autowired
private ITrackBedManagementCheckService trackBedManagementCheckService;
/**
* 设备检查记录-分页列表查询
*
* @param pageNo
* @param pageSize
* @param dto
* @return
*/
@AutoLog(value = "设备检查记录-分页列表查询")
@ApiOperation(value = "设备检查记录-分页列表查询", notes = "设备检查记录-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<RecordsMasterCheckVO>> queryPageList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
RecordsMasterCheckDTO dto) {
Page<RecordsMasterCheckVO> pageData = new Page<>(pageNo, pageSize);
pageData = this.service.queryPageList(pageData, dto);
return Result.OK(pageData);
}
/**
* 根据区间id和线别id查询道床列表
* @param sectionId
* @param lineAliasId
* @return
*/
@AutoLog(value = "根据区间id查询道床列表")
@ApiOperation(value = "根据区间id查询道床列表", notes = "根据区间id和线别id查询道床列表")
@GetMapping(value = "/getTrackBedBySubwayIdAndLineId")
public Result<List<TrackBedManagement>> getTrackBedBySubwayIdAndLineId(@ApiParam(name = "区间id") String sectionId,
@ApiParam(name = "线别id") String lineAliasId) {
List<TrackBedManagement> listResult = trackBedManagementService.lambdaQuery()
.eq(ObjectUtil.isNotEmpty(sectionId), TrackBedManagement::getSectionId, sectionId)
.eq(ObjectUtil.isNotEmpty(lineAliasId), TrackBedManagement::getLineAliasId, lineAliasId)
.orderByAsc(TrackBedManagement::getCreateTime)
.list();
return Result.OK(listResult);
}
/**
* 根据道床使用情况记录数据表的道床id查询对应的实用情况
* @param managementId 道床id
* @return
*/
@AutoLog(value = "根据道床使用情况记录数据表的道床id和检查记录主表的id查询对应的实用情况")
@ApiOperation(value = "根据道床使用情况记录数据表的道床id和检查记录主表的id查询对应的实用情况", notes = "根据道床使用情况记录数据表的道床id和检查记录主表的id查询对应的实用情况")
@GetMapping(value = "/getTrackBedByManagementIdAndRecordId")
public Result<List<TrackBedManagementCheckVO>> getTrackBedByManagementId(@ApiParam(name = "道床id") String managementId,@ApiParam(name = "检查记录表主键id") String recordId) {
List<TrackBedManagementCheck> listResult = trackBedManagementCheckService.lambdaQuery()
.eq(ObjectUtil.isNotEmpty(managementId), TrackBedManagementCheck::getTrakBedManagementId, managementId)
.eq(ObjectUtil.isNotEmpty(recordId), TrackBedManagementCheck::getRecordsMasterCheckId, recordId)
.eq(TrackBedManagementCheck::getDelFlag,"0")
.orderByAsc(TrackBedManagementCheck::getCreateTime)
.list();
if(listResult!=null){
List<TrackBedManagementCheckVO> resultList = BeanCopyUtil.copyListProperties(listResult, TrackBedManagementCheckVO::new);
return Result.OK(resultList);
}
return Result.OK(new ArrayList<>());
}
}
package org.jeecg.modules.checkData.equipmentCheckData.controller;
import org.jeecg.modules.checkData.equipmentCheckData.entity.RecordsMasterCheck;
import org.jeecg.modules.checkData.equipmentCheckData.entity.TrackBedManagementCheck;
import org.jeecg.modules.checkData.equipmentCheckData.service.IRecordsMasterCheckService;
import org.jeecg.modules.checkData.equipmentCheckData.service.ITrackBedManagementCheckService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.jeecg.common.system.base.controller.JeecgController;
/**
* <p>
* 设备检查记录数据-道床使用情况记录数据 前端控制器
* </p>
*
* @author hkl
* @since 2023-07-07
*/
@RestController
@RequestMapping("/recordsMaster/trackBedManagementCheck")
public class TrackBedManagementCheckController extends JeecgController<TrackBedManagementCheck, ITrackBedManagementCheckService> {
}
package org.jeecg.modules.checkData.equipmentCheckData.controller;
import org.jeecg.modules.checkData.equipmentCheckData.entity.TurnoutUseCheck;
import org.jeecg.modules.checkData.equipmentCheckData.service.ITurnoutUseCheckService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.jeecg.common.system.base.controller.JeecgController;
/**
* <p>
* 检查数据-设备检查记录数据-设备检查记录数据 前端控制器
* </p>
*
* @author hkl
* @since 2023-07-07
*/
@RestController
@RequestMapping("/checkData/equipmentCheckData/turnoutUseCheck")
public class TurnoutUseCheckController extends JeecgController<TurnoutUseCheck, ITurnoutUseCheckService> {
}
package org.jeecg.modules.checkData.equipmentCheckData.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 设备检查记录主表接收类
* </p>
*
* @author hkl
* @since 2023-07-07
*/
@Data
public class RecordsMasterCheckDTO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键")
private String id;
@ApiModelProperty("创建人")
private String createBy;
@ApiModelProperty("创建日期")
private Date createTime;
@ApiModelProperty("更新人")
private String updateBy;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("检查批次编号")
private String ekCode;
@ApiModelProperty("工单编号")
private String workCode;
@ApiModelProperty("轨距水平尺编号")
private String gaugeCode;
@ApiModelProperty("检查区间id")
private String subwaySectionId;
@ApiModelProperty("检查区间名称")
private String subwaySectionName;
@ApiModelProperty("所属线路id")
private String lightRailId;
@ApiModelProperty("所属线路名称")
private String lightRailName;
@ApiModelProperty("所属线别id")
private String lineAliasId;
@ApiModelProperty("所属线别名称")
private String lineAliasName;
@ApiModelProperty("起始里程")
private BigDecimal startingMileage;
@ApiModelProperty("终点里程")
private BigDecimal endMileage;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("检查人姓名")
private String checkBy;
@ApiModelProperty("检查日期")
private Date checkTime;
@ApiModelProperty("审核人姓名")
private String verifyBy;
@ApiModelProperty("审核时间")
private Date verifyTime;
@ApiModelProperty("是否删除(0:未删除;1:已删除)")
private String delFlag;
}
package org.jeecg.modules.checkData.equipmentCheckData.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
/**
* <p>
* 设备检查记录数据-道床使用情况记录数据接收扩展类
* </p>
*
* @author hkl
* @since 2023-07-07
*/
@Data
public class TrackBedManagementCheckDTO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键")
private String id;
@ApiModelProperty("创建人")
private String createBy;
@ApiModelProperty("创建日期")
private Date createTime;
@ApiModelProperty("更新人")
private String updateBy;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("设备检查记录主表id->外键")
private String recordsMasterCheckId;
@ApiModelProperty("道床id->外键")
private String trakBedManagementId;
@ApiModelProperty("检查项目名称")
private String ekProjectName;
@ApiModelProperty("检查项目内容")
private String ekProjectContent;
@ApiModelProperty("检查合格评判标准")
private String ekPeojectTemplate;
@ApiModelProperty("现场检查项目状态(1:合格;2:良好;3:不合格)")
private String ekProjectStatus;
@ApiModelProperty("是否删除(0:未删除,1:已删除)")
private String delFlag;
}
package org.jeecg.modules.checkData.equipmentCheckData.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
* 检查数据-设备检查记录数据-设备检查记录数据
* </p>
*
* @author hkl
* @since 2023-07-07
*/
@Data
@ApiModel(value = "TurnoutUseCheck对象", description = "检查数据-设备检查记录数据-设备检查记录数据")
public class TurnoutUseCheckDTO {
private static final long serialVersionUID = 1L;
private String id;
@ApiModelProperty("创建人")
private String createBy;
@ApiModelProperty("创建日期")
private Date createTime;
@ApiModelProperty("更新人")
private String updateBy;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("检查批次号")
private String checkBatchCode;
@ApiModelProperty("工单编号")
private String workCode;
@ApiModelProperty("轨距水平尺编号")
private String gaugeLevelCode;
@ApiModelProperty("检查人姓名")
private String checkBy;
@ApiModelProperty("检查日期")
private Date checkTime;
@ApiModelProperty("道岔数量")
private Integer turnoutNum;
@ApiModelProperty("车站id")
private String trainStationId;
@ApiModelProperty("线别id")
private String lineAliasId;
@ApiModelProperty("曲线半径R(m)")
private BigDecimal curveAdius;
@ApiModelProperty("审核人姓名")
private String verifyBy;
@ApiModelProperty("审核时间")
private Date verifyTime;
@ApiModelProperty("备注")
private String remark;
}
package org.jeecg.modules.checkData.equipmentCheckData.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
* 设备检查记录主表
* </p>
*
* @author hkl
* @since 2023-07-07
*/
@Getter
@Setter
@TableName("t_ek_records_master_check")
@ApiModel(value = "RecordsMasterCheck对象", description = "设备检查记录主表")
public class RecordsMasterCheck implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键")
@TableId("id")
private String id;
@ApiModelProperty("创建人")
@TableField("create_by")
private String createBy;
@ApiModelProperty("创建日期")
@TableField("create_time")
private Date createTime;
@ApiModelProperty("更新人")
@TableField("update_by")
private String updateBy;
@ApiModelProperty("更新时间")
@TableField("update_time")
private Date updateTime;
@ApiModelProperty("检查批次编号")
@TableField("ek_code")
private String ekCode;
@ApiModelProperty("工单编号")
@TableField("work_code")
private String workCode;
@ApiModelProperty("轨距水平尺编号")
@TableField("gauge_code")
private String gaugeCode;
@ApiModelProperty("检查区间id")
@TableField("subway_section_id")
private String subwaySectionId;
@ApiModelProperty("检查区间名称")
@TableField("subway_section_name")
private String subwaySectionName;
@ApiModelProperty("所属线路id")
@TableField("light_rail_id")
private String lightRailId;
@ApiModelProperty("所属线路名称")
@TableField("light_rail_name")
private String lightRailName;
@ApiModelProperty("所属线别id")
@TableField("line_alias_id")
private String lineAliasId;
@ApiModelProperty("所属线别名称")
@TableField("line_alias_name")
private String lineAliasName;
@ApiModelProperty("起始里程")
@TableField("starting_mileage")
private BigDecimal startingMileage;
@ApiModelProperty("终点里程")
@TableField("end_mileage")
private BigDecimal endMileage;
@ApiModelProperty("备注")
@TableField("remark")
private String remark;
@ApiModelProperty("检查人姓名")
@TableField("check_by")
private String checkBy;
@ApiModelProperty("检查日期")
@TableField("check_time")
private Date checkTime;
@ApiModelProperty("审核人姓名")
@TableField("verify_by")
private String verifyBy;
@ApiModelProperty("审核时间")
@TableField("verify_time")
private Date verifyTime;
@ApiModelProperty("是否删除(0:未删除;1:已删除)")
@TableField("del_flag")
private String delFlag;
}
package org.jeecg.modules.checkData.equipmentCheckData.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
* 设备检查记录数据-道床使用情况记录数据
* </p>
*
* @author hkl
* @since 2023-07-07
*/
@Getter
@Setter
@TableName("t_ek_track_bed_management_check")
@ApiModel(value = "TrackBedManagementCheck对象", description = "设备检查记录数据-道床使用情况记录数据")
public class TrackBedManagementCheck implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键")
@TableId("id")
private String id;
@ApiModelProperty("创建人")
@TableField("create_by")
private String createBy;
@ApiModelProperty("创建日期")
@TableField("create_time")
private Date createTime;
@ApiModelProperty("更新人")
@TableField("update_by")
private String updateBy;
@ApiModelProperty("更新时间")
@TableField("update_time")
private Date updateTime;
@ApiModelProperty("设备检查记录主表id->外键")
@TableField("records_master_check_id")
private String recordsMasterCheckId;
@ApiModelProperty("道床id->外键")
@TableField("trak_bed_management_id")
private String trakBedManagementId;
@ApiModelProperty("检查项目名称")
@TableField("ek_project_name")
private String ekProjectName;
@ApiModelProperty("检查项目内容")
@TableField("ek_project_content")
private String ekProjectContent;
@ApiModelProperty("检查合格评判标准")
@TableField("ek_peoject_template")
private String ekPeojectTemplate;
@ApiModelProperty("现场检查项目状态(1:合格;2:良好;3:不合格)")
@TableField("ek_project_status")
private String ekProjectStatus;
@ApiModelProperty("现场检查项目状态名称(1:合格;2:良好;3:不合格)")
@TableField(exist = false)
private String ekProjectStatusName;
@ApiModelProperty("是否删除(0:未删除,1:已删除)")
@TableField("del_flag")
private String delFlag;
}
package org.jeecg.modules.checkData.equipmentCheckData.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
* 检查数据-设备检查记录数据-设备检查记录数据
* </p>
*
* @author hkl
* @since 2023-07-07
*/
@Getter
@Setter
@TableName("t_ek_turnout_use_check")
@ApiModel(value = "TurnoutUseCheck对象", description = "检查数据-设备检查记录数据-设备检查记录数据")
public class TurnoutUseCheck implements Serializable {
private static final long serialVersionUID = 1L;
@TableField("id")
private String id;
@ApiModelProperty("创建人")
@TableField("create_by")
private String createBy;
@ApiModelProperty("创建日期")
@TableField("create_time")
private Date createTime;
@ApiModelProperty("更新人")
@TableField("update_by")
private String updateBy;
@ApiModelProperty("更新时间")
@TableField("update_time")
private Date updateTime;
@ApiModelProperty("检查批次号")
@TableField("check_batch_code")
private String checkBatchCode;
@ApiModelProperty("工单编号")
@TableField("work_code")
private String workCode;
@ApiModelProperty("轨距水平尺编号")
@TableField("gauge_level_code")
private String gaugeLevelCode;
@ApiModelProperty("检查人姓名")
@TableField("check_by")
private String checkBy;
@ApiModelProperty("检查日期")
@TableField("check_time")
private Date checkTime;
@ApiModelProperty("道岔数量")
@TableField("turnout_num")
private Integer turnoutNum;
@ApiModelProperty("车站id")
@TableField("train_station_id")
private String trainStationId;
@ApiModelProperty("线别id")
@TableField("line_alias_id")
private String lineAliasId;
@ApiModelProperty("审核人姓名")
@TableField("verify_by")
private String verifyBy;
@ApiModelProperty("审核时间")
@TableField("verify_time")
private Date verifyTime;
@ApiModelProperty("备注")
@TableField("remark")
private String remark;
}
package org.jeecg.modules.checkData.equipmentCheckData.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.checkData.equipmentCheckData.dto.RecordsMasterCheckDTO;
import org.jeecg.modules.checkData.equipmentCheckData.entity.RecordsMasterCheck;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.checkData.equipmentCheckData.vo.RecordsMasterCheckVO;
import org.jeecg.modules.deviceAsset.dto.TrackBedManagementDTO;
import org.jeecg.modules.deviceAsset.vo.TrackBedManagementVO;
/**
* <p>
* 设备检查记录主表 Mapper 接口
* </p>
*
* @author hkl
* @since 2023-07-07
*/
public interface RecordsMasterCheckMapper extends BaseMapper<RecordsMasterCheck> {
/**
* 设备检查记录-分页列表查询
* @param pageData
* @param dto
* @return
*/
Page<RecordsMasterCheckVO> queryPageList(Page<RecordsMasterCheckVO> pageData, RecordsMasterCheckDTO dto);
}
package org.jeecg.modules.checkData.equipmentCheckData.mapper;
import org.jeecg.modules.checkData.equipmentCheckData.entity.TrackBedManagementCheck;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 设备检查记录数据-道床使用情况记录数据 Mapper 接口
* </p>
*
* @author hkl
* @since 2023-07-07
*/
public interface TrackBedManagementCheckMapper extends BaseMapper<TrackBedManagementCheck> {
}
package org.jeecg.modules.checkData.equipmentCheckData.mapper;
import org.jeecg.modules.checkData.equipmentCheckData.entity.TurnoutUseCheck;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 检查数据-设备检查记录数据-设备检查记录数据 Mapper 接口
* </p>
*
* @author hkl
* @since 2023-07-07
*/
public interface TurnoutUseCheckMapper extends BaseMapper<TurnoutUseCheck> {
}
<?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="org.jeecg.modules.checkData.equipmentCheckData.mapper.RecordsMasterCheckMapper">
<select id="queryPageList" resultType="org.jeecg.modules.checkData.equipmentCheckData.vo.RecordsMasterCheckVO">
SELECT
t1.*
FROM
t_ek_records_master_check t1
<where>
1=1
<if test="dto.ekCode != null and dto.ekCode != ''">
AND t1.ek_code like concat('%',#{dto.ekCode},'%')
</if>
<if test="dto.subwaySectionName != null and dto.subwaySectionName != ''">
AND t1.subway_section_name like concat('%',#{dto.subwaySectionName},'%')
</if>
<if test="dto.lightRailName != null and dto.lightRailName != ''">
AND t1.light_rail_name like concat('%',#{dto.lightRailName},'%')
</if>
<if test="dto.lineAliasName != null and dto.lineAliasName != ''">
AND t1.line_alias_name like concat('%',#{dto.lineAliasName},'%')
</if>
order by t1.create_time desc
</where>
</select>
</mapper>
<?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="org.jeecg.modules.checkData.equipmentCheckData.mapper.TrackBedManagementCheckMapper">
</mapper>
<?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="org.jeecg.modules.checkData.equipmentCheckData.mapper.TurnoutUseCheckMapper">
</mapper>
package org.jeecg.modules.checkData.equipmentCheckData.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.checkData.equipmentCheckData.dto.RecordsMasterCheckDTO;
import org.jeecg.modules.checkData.equipmentCheckData.entity.RecordsMasterCheck;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.checkData.equipmentCheckData.vo.RecordsMasterCheckVO;
import org.jeecg.modules.deviceAsset.dto.TrackBedManagementDTO;
import org.jeecg.modules.deviceAsset.vo.TrackBedManagementVO;
/**
* <p>
* 设备检查记录主表 服务类
* </p>
*
* @author hkl
* @since 2023-07-07
*/
public interface IRecordsMasterCheckService extends IService<RecordsMasterCheck> {
/**
* 设备检查记录-分页列表查询
* @param pageData
* @param dto
* @return
*/
Page<RecordsMasterCheckVO> queryPageList(Page<RecordsMasterCheckVO> pageData, RecordsMasterCheckDTO dto);
}
package org.jeecg.modules.checkData.equipmentCheckData.service;
import org.jeecg.modules.checkData.equipmentCheckData.entity.TrackBedManagementCheck;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 设备检查记录数据-道床使用情况记录数据 服务类
* </p>
*
* @author hkl
* @since 2023-07-07
*/
public interface ITrackBedManagementCheckService extends IService<TrackBedManagementCheck> {
}
package org.jeecg.modules.checkData.equipmentCheckData.service;
import org.jeecg.modules.checkData.equipmentCheckData.entity.TurnoutUseCheck;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 检查数据-设备检查记录数据-设备检查记录数据 服务类
* </p>
*
* @author hkl
* @since 2023-07-07
*/
public interface ITurnoutUseCheckService extends IService<TurnoutUseCheck> {
}
package org.jeecg.modules.checkData.equipmentCheckData.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.checkData.equipmentCheckData.dto.RecordsMasterCheckDTO;
import org.jeecg.modules.checkData.equipmentCheckData.entity.RecordsMasterCheck;
import org.jeecg.modules.checkData.equipmentCheckData.mapper.RecordsMasterCheckMapper;
import org.jeecg.modules.checkData.equipmentCheckData.service.IRecordsMasterCheckService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.checkData.equipmentCheckData.vo.RecordsMasterCheckVO;
import org.springframework.stereotype.Service;
/**
* <p>
* 设备检查记录主表 服务实现类
* </p>
*
* @author hkl
* @since 2023-07-07
*/
@Service
public class RecordsMasterCheckServiceImpl extends ServiceImpl<RecordsMasterCheckMapper, RecordsMasterCheck> implements IRecordsMasterCheckService {
/**
* 设备检查记录-分页列表查询
* @param pageData
* @param dto
* @return
*/
@Override
public Page<RecordsMasterCheckVO> queryPageList(Page<RecordsMasterCheckVO> pageData, RecordsMasterCheckDTO dto) {
return this.baseMapper.queryPageList(pageData,dto);
}
}
package org.jeecg.modules.checkData.equipmentCheckData.service.impl;
import org.jeecg.modules.checkData.equipmentCheckData.entity.TrackBedManagementCheck;
import org.jeecg.modules.checkData.equipmentCheckData.mapper.TrackBedManagementCheckMapper;
import org.jeecg.modules.checkData.equipmentCheckData.service.ITrackBedManagementCheckService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 设备检查记录数据-道床使用情况记录数据 服务实现类
* </p>
*
* @author hkl
* @since 2023-07-07
*/
@Service
public class TrackBedManagementCheckServiceImpl extends ServiceImpl<TrackBedManagementCheckMapper, TrackBedManagementCheck> implements ITrackBedManagementCheckService {
}
package org.jeecg.modules.checkData.equipmentCheckData.service.impl;
import org.jeecg.modules.checkData.equipmentCheckData.entity.TurnoutUseCheck;
import org.jeecg.modules.checkData.equipmentCheckData.mapper.TurnoutUseCheckMapper;
import org.jeecg.modules.checkData.equipmentCheckData.service.ITurnoutUseCheckService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 检查数据-设备检查记录数据-设备检查记录数据 服务实现类
* </p>
*
* @author hkl
* @since 2023-07-07
*/
@Service
public class TurnoutUseCheckServiceImpl extends ServiceImpl<TurnoutUseCheckMapper, TurnoutUseCheck> implements ITurnoutUseCheckService {
}
package org.jeecg.modules.checkData.equipmentCheckData.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 设备检查记录主表返回类
* </p>
*
* @author hkl
* @since 2023-07-07
*/
@Data
public class RecordsMasterCheckVO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键")
@TableId("id")
private String id;
@ApiModelProperty("创建人")
@TableField("create_by")
private String createBy;
@ApiModelProperty("创建日期")
@TableField("create_time")
private Date createTime;
@ApiModelProperty("更新人")
@TableField("update_by")
private String updateBy;
@ApiModelProperty("更新时间")
@TableField("update_time")
private Date updateTime;
@ApiModelProperty("检查批次编号")
@TableField("ek_code")
private String ekCode;
@ApiModelProperty("工单编号")
@TableField("work_code")
private String workCode;
@ApiModelProperty("轨距水平尺编号")
@TableField("gauge_code")
private String gaugeCode;
@ApiModelProperty("检查区间id")
@TableField("subway_section_id")
private String subwaySectionId;
@ApiModelProperty("检查区间名称")
@TableField("subway_section_name")
private String subwaySectionName;
@ApiModelProperty("所属线路id")
@TableField("light_rail_id")
private String lightRailId;
@ApiModelProperty("所属线路名称")
@TableField("light_rail_name")
private String lightRailName;
@ApiModelProperty("所属线别id")
@TableField("line_alias_id")
private String lineAliasId;
@ApiModelProperty("所属线别名称")
@TableField("line_alias_name")
private String lineAliasName;
@ApiModelProperty("起始里程")
@TableField("starting_mileage")
private BigDecimal startingMileage;
@ApiModelProperty("终点里程")
@TableField("end_mileage")
private BigDecimal endMileage;
@ApiModelProperty("备注")
@TableField("remark")
private String remark;
@ApiModelProperty("检查人姓名")
@TableField("check_by")
private String checkBy;
@ApiModelProperty("检查日期")
@TableField("check_time")
private Date checkTime;
@ApiModelProperty("审核人姓名")
@TableField("verify_by")
private String verifyBy;
@ApiModelProperty("审核时间")
@TableField("verify_time")
private Date verifyTime;
@ApiModelProperty("是否删除(0:未删除;1:已删除)")
@TableField("del_flag")
private String delFlag;
}
package org.jeecg.modules.checkData.equipmentCheckData.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.jeecg.modules.utils.DicMap;
import java.util.Date;
/**
* <p>
* 设备检查记录数据-道床使用情况记录数据返回扩展类
* </p>
*
* @author hkl
* @since 2023-07-07
*/
@Data
public class TrackBedManagementCheckVO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键")
@TableId("id")
private String id;
@ApiModelProperty("创建人")
@TableField("create_by")
private String createBy;
@ApiModelProperty("创建日期")
@TableField("create_time")
private Date createTime;
@ApiModelProperty("更新人")
@TableField("update_by")
private String updateBy;
@ApiModelProperty("更新时间")
@TableField("update_time")
private Date updateTime;
@ApiModelProperty("设备检查记录主表id->外键")
@TableField("records_master_check_id")
private String recordsMasterCheckId;
@ApiModelProperty("道床id->外键")
@TableField("trak_bed_management_id")
private String trakBedManagementId;
@ApiModelProperty("检查项目名称")
@TableField("ek_project_name")
private String ekProjectName;
@ApiModelProperty("检查项目内容")
@TableField("ek_project_content")
private String ekProjectContent;
@ApiModelProperty("检查合格评判标准")
@TableField("ek_peoject_template")
private String ekPeojectTemplate;
@ApiModelProperty("现场检查项目状态(1:合格;2:良好;3:不合格)")
@TableField("ek_project_status")
private String ekProjectStatus;
@ApiModelProperty("现场检查项目状态翻译(1:合格;2:良好;3:不合格)")
private String ekProjectStatusStr;
public String getApprovalStatusStr() {
return DicMap.EK_APPROVAL_STATUS_MAP.get(ekProjectStatus);
}
@ApiModelProperty("是否删除(0:未删除,1:已删除)")
@TableField("del_flag")
private String delFlag;
}
package org.jeecg.modules.checkData.equipmentCheckData.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 检查数据-设备检查记录数据-设备检查记录数据
* </p>
*
* @author hkl
* @since 2023-07-07
*/
@Data
@ApiModel(value = "TurnoutUseCheckVO对象", description = "检查数据-设备检查记录数据-设备检查记录数据")
public class TurnoutUseCheckVO {
private static final long serialVersionUID = 1L;
@TableField("id")
private String id;
@ApiModelProperty("创建人")
@TableField("create_by")
private String createBy;
@ApiModelProperty("创建日期")
@TableField("create_time")
private Date createTime;
@ApiModelProperty("更新人")
@TableField("update_by")
private String updateBy;
@ApiModelProperty("更新时间")
@TableField("update_time")
private Date updateTime;
@ApiModelProperty("检查批次号")
@TableField("check_batch_code")
private String checkBatchCode;
@ApiModelProperty("工单编号")
@TableField("work_code")
private String workCode;
@ApiModelProperty("轨距水平尺编号")
@TableField("gauge_level_code")
private String gaugeLevelCode;
@ApiModelProperty("检查人姓名")
@TableField("check_by")
private String checkBy;
@ApiModelProperty("检查日期")
@TableField("check_time")
private Date checkTime;
@ApiModelProperty("道岔数量")
@TableField("turnout_num")
private Integer turnoutNum;
@ApiModelProperty("车站id")
@TableField("train_station_id")
private String trainStationId;
@ApiModelProperty("线别id")
@TableField("line_alias_id")
private String lineAliasId;
@ApiModelProperty("曲线半径R(m)")
@TableField("curve_adius")
private BigDecimal curveAdius;
@ApiModelProperty("审核人姓名")
@TableField("verify_by")
private String verifyBy;
@ApiModelProperty("审核时间")
@TableField("verify_time")
private Date verifyTime;
@ApiModelProperty("备注")
@TableField("remark")
private String remark;
}
...@@ -33,7 +33,7 @@ import java.util.Arrays; ...@@ -33,7 +33,7 @@ import java.util.Arrays;
@RequestMapping("/deviceAsset/railManagement") @RequestMapping("/deviceAsset/railManagement")
@Api(tags = "资产管理-钢轨管理") @Api(tags = "资产管理-钢轨管理")
public class RailManagementController extends JeecgController<RailManagement, IRailManagementService> { public class RailManagementController extends JeecgController<RailManagement, IRailManagementService> {
@AutoLog(value = "资产管理-钢轨管理 -分页列表查询") @AutoLog(value = "资产管理-钢轨管理-分页列表查询")
@ApiOperation(value = "资产管理-道岔管理-分页列表查询", notes = "资产管理-道岔管理-分页列表查询") @ApiOperation(value = "资产管理-道岔管理-分页列表查询", notes = "资产管理-道岔管理-分页列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<IPage<RailManagementVO>> queryPageList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, public Result<IPage<RailManagementVO>> queryPageList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
......
package org.jeecg.modules.utils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.FatalBeanException;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Supplier;
/**
* 对象转换
*/
public class BeanCopyUtil extends BeanUtils {
/**
* 集合数据的拷贝
*
* @param sources: 数据源类
* @param target: 目标类::new(eg: UserVO::new)
* @return
*/
public static <S, T> List<T> copyListProperties(List<S> sources, Supplier<T> target) {
return copyListProperties(sources, target, null);
}
/**
* 带回调函数的集合数据的拷贝(可自定义字段拷贝规则)
*
* @param sources: 数据源类
* @param target: 目标类::new(eg: UserVO::new)
* @param callBack: 回调函数
* @return
*/
public static <S, T> List<T> copyListProperties(List<S> sources, Supplier<T> target, BeanCopyUtilCallBack<S, T> callBack) {
List list = new ArrayList<>(sources.size());
for (S source : sources) {
T t = target.get();
copyProperties(source, t);
list.add(t);
if (callBack != null) {
// 回调
callBack.callBack(source, t);
}
}
return list;
}
/**
* 带回调函数的集合数据的拷贝(可自定义字段拷贝规则),如果拷贝过程中发现有数据不符合不想拷贝可以调用以下方法
*
* @param sources: 数据源类
* @param target: 目标类::new(eg: UserVO::new)
* @param callBack: 回调函数
* @return
*/
public static <S, T> List<T> copyListPropertiesPlus(List<S> sources, Supplier<T> target, BeanCopyUtilCallBackPlus<S, T> callBack) {
List list = new ArrayList<>(sources.size());
Boolean flag = true;
for (S source : sources) {
T t = target.get();
copyProperties(source, t);
if (callBack != null) {
// 回调
flag = callBack.callBack(source, t);
}
if(flag) {
list.add(t);
}
flag = true;
}
return list;
}
/**
* 进行拷贝时属性为null的属性
* @param source 源对象
* @param target 目标对象
* @throws BeansException
*/
public static void copyPropertiesIgnoreNullProperties(Object source, Object target) throws BeansException {
Class<?> actualEditable = target.getClass();
PropertyDescriptor[] targetPds = getPropertyDescriptors(actualEditable);
for (PropertyDescriptor targetPd : targetPds) {
if (targetPd.getWriteMethod() != null) {
PropertyDescriptor sourcePd = getPropertyDescriptor(source.getClass(), targetPd.getName());
if (sourcePd != null && sourcePd.getReadMethod() != null) {
try {
Method readMethod = sourcePd.getReadMethod();
if (!Modifier.isPublic(readMethod.getDeclaringClass().getModifiers())) {
readMethod.setAccessible(true);
}
Object value = readMethod.invoke(source);
// 这里判断以下value是否为空 当然这里也能进行一些特殊要求的处理 例如绑定时格式转换等等
if (value != null) {
Method writeMethod = targetPd.getWriteMethod();
if (!Modifier.isPublic(writeMethod.getDeclaringClass().getModifiers())) {
writeMethod.setAccessible(true);
}
writeMethod.invoke(target, value);
}
} catch (Throwable ex) {
throw new FatalBeanException("Could not copy properties from source to target", ex);
}
}
}
}
}
}
package org.jeecg.modules.utils;
/**
* @author admin
*/
@FunctionalInterface
public interface BeanCopyUtilCallBack<S,T> {
/**
* 定义默认回调方法
* @param t
* @param s
*/
void callBack(S t, T s);
}
package org.jeecg.modules.utils;
/**
* @author admin
*/
@FunctionalInterface
public interface BeanCopyUtilCallBackPlus<S,T> {
/**
* 定义默认回调方法
* @param t
* @param s
*/
boolean callBack(S t, T s);
}
package org.jeecg.modules.utils;
import java.io.Serializable;
/**
* 分页
*/
public class CngcPage implements Serializable {
/**
* 页号
*/
private Long page;
/**
* 每页条数
// @JsonProperty("per_page")
*/
private Long perPage;
/**
* 排序字段
*/
private String sort;
/**
* 是否查询总数
*/
private boolean count;
/**
* 排序
*/
private String order;
public Long getPage() {
return page;
}
public void setPage(Long page) {
this.page = page;
}
public Long getPerPage() {
return perPage;
}
public void setPerPage(Long perPage) {
this.perPage = perPage;
}
public boolean isCount() {
return count;
}
public void setCount(boolean count) {
this.count = count;
}
public String getSort() {
return sort;
}
public void setSort(String sort) {
this.sort = sort;
}
public String getOrder() {
return order;
}
public void setOrder(String order) {
this.order = order;
}
}
package org.jeecg.modules.utils;
/**
* 公共编码
* @author admin
*/
public class ConstansVariable {
/**
* 状态码为0
*/
public final static String RESPONSE_CODE = "0";
/**
* 值为null
*/
public final static String RESULT_NULL = "null";
/**
* 值为2
*/
public final static int RESULT_TWO = 2;
/**
* 值为“ ”
*/
public final static String RESULT_IS_NULL = " ";
/**
* 值为8
*/
public final static int RESULT_EIGHT = 8;
/**
* 值为\t
*/
public final static String RESULT_BY = "\t";
/**
* 值为 “Bearer”
*/
public final static String BEARER = "Bearer ";
/**
* 资源根节点
*/
public final static String RESOURCE_ROOT_CODE = "0";
}
package org.jeecg.modules.utils;
import java.util.HashMap;
import java.util.Map;
/**
* @author 50519
* 数据字典服务约定俗称的,
* TODO: 后续迁移到redis
*/
public class DicMap {
/**
* 现场检查项目状态(1:合格;2:良好;3:不合格)
*/
public final static String EK_APPROVAL_STATUS = "EK_APPROVAL_STATUS";
/**
* 现场检查项目状态对应的map
*/
public final static HashMap<String,String> EK_APPROVAL_STATUS_MAP = new HashMap<String,String>(){{
put("1","合格");
put("2","良好");
put("3","不合格");
}};
/**
* 路由地址 此路由地址放在最后,最后加载
*
*/
public final static Map<String,HashMap<String,String>> ROUTE_MAP = new HashMap<String,HashMap<String,String>>(){{
put("EK_APPROVAL_STATUS", EK_APPROVAL_STATUS_MAP);
}};
}
package org.jeecg.modules.utils;
import cn.hutool.json.JSONObject;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import java.util.List;
import java.util.Map;
/**
* 封装返回
* @param <T>
*/
public class JsonResult<T> extends ResponseEntity<T> {
//TODO 下方常量为暂时性方案,后期统计完全后,归类到统一枚举或字典内
static final String CONSTANT_TRUE= "true";
static final String QR_CODE_FALSE= "验证码校验失败";
static final String LOGIN_FOBIDDEN = "错误次数太多,15分钟后再尝试登录";
static final String USER_STATUS_UNUSUAL = "用户处于禁用状态";
static final String USER_DEL_FLAG = "用户处于注销状态";
static final String CHANGE_PASSWORD = "密码复杂度不够,需要修改密码!";
public JsonResult(List data,MultiValueMap<String, String> header,String code) {
super((T)data,header,Message.num2HttpStatus(code));
}
public JsonResult(String code, T data) {
super(data, Message.num2HttpStatus(code));
}
public static <T> JsonResult<T> created(T data) {
return new JsonResult("201", data);
}
public static <T> JsonResult<T> success(T data) {
return new JsonResult("200", data);
}
public static <T> JsonResult<T> success(String msg) {
JSONObject json = new JSONObject();
json.putOpt("message", msg);
return new JsonResult("200", json);
}
public static <T> JsonResult<T> success() {
JSONObject json = new JSONObject();
return new JsonResult("200", json);
}
public static <T> JsonResult<T> accepted(T data) {
return new JsonResult("202", data);
}
public static <T> JsonResult<T> noContented() {
return new JsonResult("204",null);
}
public static <T> JsonResult<T> movedPermanently(T data) {
return new JsonResult("301", data);
}
public static <T> JsonResult<T> found(T data) {
return new JsonResult("302", data);
}
public static <T> JsonResult<T> paged(PageUtils data, Map<String, Object> params) {
String str = StringUtil.objectToString(params.get("count"));
if (null != str && CONSTANT_TRUE.equals(str)){
MultiValueMap<String, String> header = new LinkedMultiValueMap<>();
header.add("X-Total-Count", String.valueOf(data.getTotalCount()));
// 因为浏览器的安全策略获取不到header信息,此处将X-Total-Count数据暴露出来
header.add("Access-Control-Expose-Headers","X-Total-Count");
return new JsonResult(data.getList(),header,"200");
}else{
return new JsonResult("200", data.getList());
}
}
public static <T> JsonResult<T> paged(Map<String, Object> map, Map<String, Object> params) {
String str = (String) params.get("count");
if (null != str && CONSTANT_TRUE.equals(str)){
MultiValueMap<String, String> header = new LinkedMultiValueMap<>();
header.add("X-Total-Count", String.valueOf(map.get("total_count")));
// 因为浏览器的安全策略获取不到header信息,此处将X-Total-Count数据暴露出来
header.add("Access-Control-Expose-Headers","X-Total-Count");
return new JsonResult((List)map.get("list"),header,"200");
}else{
return new JsonResult("200", (List)map.get("list"));
}
}
public static <T> JsonResult<T> paged(PageUtils data, CngcPage model) {
Boolean ifCount = model.isCount();
if (null != ifCount && ifCount){
MultiValueMap<String, String> header = new LinkedMultiValueMap<>();
header.add("X-Total-Count", String.valueOf(data.getTotalCount()));
return new JsonResult(data.getList(),header,"200");
}else{
return new JsonResult("200", data.getList());
}
}
public static <T> JsonResult<T> unauthorized(String msg) {
JSONObject json = new JSONObject();
json.putOpt("message", msg);
return new JsonResult("401", json);
}
public static <T> JsonResult<T> notFounded() {
return new JsonResult("404", null);
}
public static <T> JsonResult<T> failMsg() {
return new JsonResult("422", null);
}
public static <T> JsonResult<T> failMsg(String msg) {
JSONObject json = new JSONObject();
json.putOpt("message", msg);
return new JsonResult("422", json);
}
public static <T> JsonResult<T> failMsg(String code ,String msg) {
JSONObject json = new JSONObject();
json.putOpt("message", msg);
return new JsonResult(code, json);
}
public static <T> JsonResult<T> failMsg(T data) {
return new JsonResult("422", data);
}
//2021-10-28 shiruojiang
public static <T> JsonResult<T> qrcodeFail(){
com.alibaba.fastjson.JSONObject obj = new com.alibaba.fastjson.JSONObject();
obj.put("message", QR_CODE_FALSE);
obj.put("qrcode", true);
return new JsonResult("422", obj);
}
public static <T> JsonResult<T> loginForbidden(){
com.alibaba.fastjson.JSONObject obj = new com.alibaba.fastjson.JSONObject();
obj.put("message", LOGIN_FOBIDDEN);
obj.put("qrcode", true);
return new JsonResult("422", obj);
}
public static <T> JsonResult<T> userStatusUnusual(){
com.alibaba.fastjson.JSONObject obj = new com.alibaba.fastjson.JSONObject();
obj.put("message", USER_STATUS_UNUSUAL);
return new JsonResult("422", obj);
}
public static <T> JsonResult<T> userDelFlag(){
com.alibaba.fastjson.JSONObject obj = new com.alibaba.fastjson.JSONObject();
obj.put("message", USER_DEL_FLAG);
return new JsonResult("422", obj);
}
public static <T> JsonResult<T> changePwd(){
com.alibaba.fastjson.JSONObject obj = new com.alibaba.fastjson.JSONObject();
obj.put("message", CHANGE_PASSWORD);
obj.put("changePassword",true);
return new JsonResult("422", obj);
}
}
class Message<T> {
public static HttpStatus num2HttpStatus(String code) {
HttpStatus status = HttpStatus.NOT_FOUND;
for (HttpStatus httpStatus : HttpStatus.values()) {
boolean b = Integer.parseInt(code) == httpStatus.value();
if (b) {
return httpStatus;
}
}
return status;
}
}
/**
* Copyright (c) 中国兵器 All rights reserved.
*
* norincogroup
*
* 版权所有,侵权必究!
*/
package org.jeecg.modules.utils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.io.Serializable;
import java.util.List;
/**
* 分页工具类
*
* @author Sun
*/
public class PageUtils implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 总记录数
*/
private int totalCount;
/**
* 每页记录数
*/
private int pageSize;
/**
* 总页数
*/
private int totalPage;
/**
* 当前页数
*/
private int currPage;
/**
* 列表数据
*/
private List<?> list;
/**
* 分页
* @param list 列表数据
* @param totalCount 总记录数
* @param pageSize 每页记录数
* @param currPage 当前页数
*/
public PageUtils(List<?> list, int totalCount, int pageSize, int currPage) {
this.list = list;
this.totalCount = totalCount;
this.pageSize = pageSize;
this.currPage = currPage;
this.totalPage = (int)Math.ceil((double)totalCount/pageSize);
}
/**
* 分页
*/
public PageUtils(IPage<?> page) {
this.list = page.getRecords();
this.totalCount = (int)page.getTotal();
this.pageSize = (int)page.getSize();
this.currPage = (int)page.getCurrent();
this.totalPage = (int)page.getPages();
}
public int getTotalCount() {
return totalCount;
}
public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
public int getCurrPage() {
return currPage;
}
public void setCurrPage(int currPage) {
this.currPage = currPage;
}
public List<?> getList() {
return list;
}
public void setList(List<?> list) {
this.list = list;
}
}
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