Commit 31133260 authored by hkl's avatar hkl

feat:1.一键派工,一键失格维修按钮修复

parent e76bb9ee
package org.jeecg.config;
import org.jeecg.modules.base.mapper.CustomizedSqlInjector;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @Description : TODO
* @Author : 黄康林
* @Date : 2023-10-11 15:13:10
* @Version : 1.0
**/
@Configuration
public class CustomMybatisPlusConfig {
@Bean
public CustomizedSqlInjector customizedSqlInjector() {
return new CustomizedSqlInjector();
}
}
package org.jeecg.config.mybatis;
package org.jeecg.config.mybatisPlus;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.binding.MapperMethod.ParamMap;
......
package org.jeecg.config.mybatis;
package org.jeecg.config.mybatisPlus;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
......
package org.jeecg.config.mybatis.aspect;
package org.jeecg.config.mybatisPlus.aspect;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
......@@ -8,7 +8,7 @@ import org.aspectj.lang.reflect.MethodSignature;
import org.jeecg.common.aspect.annotation.DynamicTable;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.config.mybatis.ThreadLocalDataHelper;
import org.jeecg.config.mybatisPlus.ThreadLocalDataHelper;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
......
package org.jeecg.config.mybatis.interceptor;
package org.jeecg.config.mybatisPlus.interceptor;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import lombok.extern.slf4j.Slf4j;
......
package org.jeecg.modules.base.mapper;
import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import org.jeecg.modules.base.mapper.InsertBatchMethod;
import org.jeecg.modules.base.mapper.UpdateBatchMethod;
import java.util.List;
/**
* @Description : 自定义方法SQL注入器
* @Author : 黄康林
* @Date : 2023-10-11 15:13:17
* @Version : 1.0
**/
public class CustomizedSqlInjector extends DefaultSqlInjector {
/**
* 如果只需增加方法,保留mybatis plus自带方法,
* 可以先获取super.getMethodList(),再添加add
*/
@Override
public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
methodList.add(new InsertBatchMethod());
methodList.add(new UpdateBatchMethod());
return methodList;
}
}
package org.jeecg.modules.base.mapper;
import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import org.apache.ibatis.executor.keygen.NoKeyGenerator;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.SqlSource;
/**
* @Description : TODO
* @Author : 黄康林
* @Date : 2023-10-11 15:10:26
* @Version : 1.0
**/
public class InsertBatchMethod extends AbstractMethod {
/**
* insert into user(id, name, age) values (1, "a", 17), (2, "b", 18);
<script>
insert into user(id, name, age) values
<foreach collection="list" item="item" index="index" open="(" separator="),(" close=")">
#{item.id}, #{item.name}, #{item.age}
</foreach>
</script>
*/
@Override
public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
final String sql = "<script>insert into %s %s values %s</script>";
final String fieldSql = prepareFieldSql(tableInfo);
final String valueSql = prepareValuesSql(tableInfo);
final String sqlResult = String.format(sql, tableInfo.getTableName(), fieldSql, valueSql);
SqlSource sqlSource = languageDriver.createSqlSource(configuration, sqlResult, modelClass);
// 第三个参数必须和RootMapper的自定义方法名一致
return this.addInsertMappedStatement(mapperClass, modelClass, "insertBatch", sqlSource, new NoKeyGenerator(), null, null);
}
private String prepareFieldSql(TableInfo tableInfo) {
StringBuilder fieldSql = new StringBuilder();
fieldSql.append(tableInfo.getKeyColumn()).append(",");
tableInfo.getFieldList().forEach(x -> {
fieldSql.append(x.getColumn()).append(",");
});
fieldSql.delete(fieldSql.length() - 1, fieldSql.length());
fieldSql.insert(0, "(");
fieldSql.append(")");
return fieldSql.toString();
}
private String prepareValuesSql(TableInfo tableInfo) {
final StringBuilder valueSql = new StringBuilder();
valueSql.append("<foreach collection=\"list\" item=\"item\" index=\"index\" open=\"(\" separator=\"),(\" close=\")\">");
valueSql.append("#{item.").append(tableInfo.getKeyProperty()).append("},");
tableInfo.getFieldList().forEach(x -> valueSql.append("#{item.").append(x.getProperty()).append("},"));
valueSql.delete(valueSql.length() - 1, valueSql.length());
valueSql.append("</foreach>");
return valueSql.toString();
}
}
package org.jeecg.modules.base.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.Collection;
import java.util.List;
import org.apache.ibatis.annotations.Param;
/**
* @Description : TODO
* @Author : 黄康林
* @Date : 2023-10-11 15:13:26
* @Version : 1.0
**/
public interface RootMapper<T> extends BaseMapper<T> {
/**
* 自定义批量插入
* 如果要自动填充,@Param(xx) xx参数名必须是 list/collection/array 3个的其中之一
*/
int insertBatch(@Param("list") List<T> list);
/**
* 自定义批量更新,条件为主键
* 如果要自动填充,@Param(xx) xx参数名必须是 list/collection/array 3个的其中之一
*/
int updateBatch(@Param("list") List<T> list);
}
package org.jeecg.modules.base.mapper;
import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.SqlSource;
/**
* @Description : 批量更新方法实现,条件为主键,选择性更新
* @Author : 黄康林
* @Date : 2023-10-11 15:10:05
* @Version : 1.0
**/
public class UpdateBatchMethod extends AbstractMethod {
/**
* update user set name = "a", age = 17 where id = 1;
* update user set name = "b", age = 18 where id = 2;
<script>
<foreach collection="list" item="item" separator=";">
update user
<set>
<if test="item.name != null and item.name != ''">
name = #{item.name,jdbcType=VARCHAR},
</if>
<if test="item.age != null">
age = #{item.age,jdbcType=INTEGER},
</if>
</set>
where id = #{item.id,jdbcType=INTEGER}
</foreach>
</script>
*/
@Override
public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
String sql = "<script>\n<foreach collection=\"list\" item=\"item\" separator=\";\">\nupdate %s %s where %s=#{%s} %s\n</foreach>\n</script>";
String additional = tableInfo.isWithVersion() ? tableInfo.getVersionFieldInfo().getVersionOli("item", "item.") : "" + tableInfo.getLogicDeleteSql(true, true);
String setSql = sqlSet(tableInfo.isWithLogicDelete(), false, tableInfo, false, "item", "item.");
String sqlResult = String.format(sql, tableInfo.getTableName(), setSql, tableInfo.getKeyColumn(), "item." + tableInfo.getKeyProperty(), additional);
SqlSource sqlSource = languageDriver.createSqlSource(configuration, sqlResult, modelClass);
// 第三个参数必须和RootMapper的自定义方法名一致
return this.addUpdateMappedStatement(mapperClass, modelClass, "updateBatch", sqlSource);
}
}
......@@ -56,12 +56,6 @@
<artifactId>pinyin4j</artifactId>
<version>2.5.1</version>
</dependency>
<!-- 积木报表 mongo redis 支持包
<dependency>
<groupId>org.jeecgframework.jimureport</groupId>
<artifactId>jimureport-nosql-starter</artifactId>
</dependency>-->
</dependencies>
<profiles>
......@@ -71,7 +65,6 @@
<properties>
<package.environment>dev</package.environment>
</properties>
</profile>
<!-- 黄康林本地配置-->
......
......@@ -13,6 +13,7 @@ import org.jeecg.modules.dynamicStaticAnalysis.mapper.AnalysisAlgorithmMapper;
import org.jeecg.modules.dynamicStaticAnalysis.service.*;
import org.jeecg.modules.dynamicStaticAnalysis.util.StrUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
......@@ -81,10 +82,8 @@ public class AnalysisAlgorithm {
@Resource
private IMovementAdditiveInfoUnitDeviceMapService movementAdditiveInfoUnitDeviceMapService;
public AnalysisAlgorithm() {
}
@Transactional
public void analysis(String analysisBatchId) {
Map<String, Map<String, Object>> unitDeviceTable = new LinkedHashMap<>();
......@@ -375,7 +374,6 @@ public class AnalysisAlgorithm {
}
}
}
analysisBatchUnitDeviceTqiScoreService.saveBatch(tqiScoreList);
analysisBatchUnitDeviceService.saveBatch(analysisBatchUnitDevices);
......@@ -566,7 +564,7 @@ public class AnalysisAlgorithm {
zontalSpeedTransfinite.setEkType(4);
zontalSpeedTransfinite.setEkItemId(additiveInfo.getId());
zontalSpeedTransfinite.setMeasurePointValue(additiveInfo.getVerticalSpeed().toString());
zontalSpeedTransfinite.setDiseaseMileage(additiveInfo.getPointMileage());
addInstrumentTransfiniteList.add(zontalSpeedTransfinite);
}
......@@ -595,6 +593,7 @@ public class AnalysisAlgorithm {
verticalSpeedTransfinite.setEkType(4);
verticalSpeedTransfinite.setEkItemId(additiveInfo.getId());
verticalSpeedTransfinite.setMeasurePointValue(additiveInfo.getVerticalSpeed().toString());
verticalSpeedTransfinite.setDiseaseMileage(additiveInfo.getPointMileage());
addInstrumentTransfiniteList.add(verticalSpeedTransfinite);
}
......@@ -758,7 +757,7 @@ public class AnalysisAlgorithm {
// 说明超限
if (startMileage.compareTo(movementOverReport.getMileage()) <= 0 && endMileage.compareTo(movementOverReport.getMileage()) > 0) {
// 轨检车超限等级
AnalysisBatchUnitDeviceTransfinite transfinite = this.createRailVehicleCheckTransfinite(dispatchingList, movementOverReport);
AnalysisBatchUnitDeviceTransfinite transfinite = this.railVehicleCheckTransfinite(dispatchingList, movementOverReport);
if (ObjectUtil.isNotEmpty(transfinite)) {
railVehicleTransfiniteList.add(transfinite);
}
......@@ -1151,7 +1150,7 @@ public class AnalysisAlgorithm {
* @param movementOverReport
* @return
*/
private AnalysisBatchUnitDeviceTransfinite createRailVehicleCheckTransfinite(JSONArray dispatchingList, MovementOverReport movementOverReport) {
private AnalysisBatchUnitDeviceTransfinite railVehicleCheckTransfinite(JSONArray dispatchingList, MovementOverReport movementOverReport) {
boolean isDisplay = false;
int isWork = 1;
......@@ -1190,6 +1189,7 @@ public class AnalysisAlgorithm {
transfinite.setEkItemId(movementOverReport.getId());
transfinite.setMeasurePointValue(movementOverReport.getPeakValue());
transfinite.setIsWork(isWork);
transfinite.setDiseaseMileage(movementOverReport.getMileage());
transfinite.setTransfiniteGradeName(reasonLabel);
......@@ -1232,7 +1232,6 @@ public class AnalysisAlgorithm {
for (Map<String, Object> unitDevice : unitDeviceList) {
BigDecimal centerMileage = Convert.toBigDecimal(unitDevice.get("centerMileage"));
// System.out.println("单元设备code:" + unitDevice.get("unitCode") + "单元中心里程:" + centerMileage);
// 2.1 循环遍历检查项目比较【开始-结束】来映射关联关系
for (RailInspectionEquipmentItem checkItem : checkItemList) {
BigDecimal checkItemStartingMileage = checkItem.getCourseStartingMileage();
......@@ -1565,6 +1564,9 @@ public class AnalysisAlgorithm {
}
}
// 轨仪器的病害里程:这个格子的(起点里程 + 终点里程)/2
BigDecimal diseaseMileage = movementCourseInfo.getCurrentStartMileage().add(movementCourseInfo.getCurrentEndEndMileage()).divide(new BigDecimal("2"), 3, BigDecimal.ROUND_HALF_UP);
// 超限
if (isTransfinite) {
......@@ -1579,6 +1581,7 @@ public class AnalysisAlgorithm {
record.setEkItemId(movementCourseInfo.getRailInspectionEquipmentItemId());
record.setMeasurePointValue(measurePointValue);
record.setIsWork(isWork);
record.setDiseaseMileage(diseaseMileage);
return record;
} else {
return null;
......@@ -1694,7 +1697,6 @@ public class AnalysisAlgorithm {
movementCheckDataUnitDeviceMapService.lambdaUpdate().eq(MovementCheckDataUnitDeviceMap::getCheckId, checkDataMap.getEkId()).remove();
movementCheckDataUnitDeviceMapService.saveBatch(movementCheckDataUnitDeviceMaps);
}
}
/**
......@@ -2095,6 +2097,10 @@ public class AnalysisAlgorithm {
}
}
// 人工的病害里程:这个格子的(起点里程 + 终点里程)/2
BigDecimal diseaseMileage = movementCourseInfo.getCurrentStartMileage().add(movementCourseInfo.getCurrentEndEndMileage()).divide(new BigDecimal("2"), 3, BigDecimal.ROUND_HALF_UP);
// 超限
if (isTransfinite) {
AnalysisBatchUnitDeviceTransfinite record = new AnalysisBatchUnitDeviceTransfinite();
......@@ -2108,6 +2114,7 @@ public class AnalysisAlgorithm {
record.setEkItemId(movementCourseInfo.getMovementCourseId());
record.setMeasurePointValue(measurePointValue);
record.setIsWork(isWork);
record.setDiseaseMileage(diseaseMileage);
return record;
} else {
return null;
......
......@@ -35,7 +35,7 @@ public class AnalysisBatchUnitDeviceDTO {
@ApiModelProperty("设备单元结束里程")
private BigDecimal unitEndMileage;
@ApiModelProperty("是否超限")
@ApiModelProperty("是否超限 0-不超限 1-超限")
private Integer isTransfinite;
@ApiModelProperty("单元编号")
......@@ -44,15 +44,12 @@ public class AnalysisBatchUnitDeviceDTO {
@ApiModelProperty("设备编号")
private String unitDeviceCode;
@ApiModelProperty("派工状态")
@ApiModelProperty("派工状态 0-未派工 1-已派工")
private Integer workStatus;
@ApiModelProperty("得分平级")
@ApiModelProperty("得分平级 0-无 1-优良 2-合格 3-失格")
private List<String> gradeJudgeList;
@ApiModelProperty("派工状态 0-未派工 1-已派工")
private List<Integer> isWordList;
@ApiModelProperty("设备单元类型1-钢轨 2-曲线 3-竖曲线 4-道岔")
private List<Integer> unitTypeList;
}
......@@ -5,6 +5,7 @@ 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;
......@@ -112,6 +113,10 @@ public class AnalysisBatchUnitDeviceTransfinite implements Serializable {
@TableField("is_work")
private Integer isWork;
@ApiModelProperty("病害里程")
@TableField("disease_mileage")
private BigDecimal diseaseMileage;
@ApiModelProperty("备注")
@TableField("remark")
private String remark;
......
package org.jeecg.modules.dynamicStaticAnalysis.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.base.mapper.RootMapper;
import org.jeecg.modules.dynamicStaticAnalysis.dto.AnalysisBatchUnitDeviceDTO;
import org.jeecg.modules.dynamicStaticAnalysis.entity.AnalysisBatchUnitDevice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -22,7 +24,9 @@ import java.util.List;
*/
public interface AnalysisBatchUnitDeviceMapper extends BaseMapper<AnalysisBatchUnitDevice> {
Page<AnalysisBatchUnitDeviceVO> listRecord(Page<AnalysisBatchUnitDeviceVO> pageData, AnalysisBatchUnitDeviceDTO dto);
Page<AnalysisBatchUnitDeviceVO> pageRecord(Page<AnalysisBatchUnitDeviceVO> pageData, @Param("dto") AnalysisBatchUnitDeviceDTO dto);
List<AnalysisBatchUnitDeviceVO> listRecord(@Param("dto") AnalysisBatchUnitDeviceDTO dto);
List<StaticCheckVO> getUnitDeviceStaticData(String id);
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.dynamicStaticAnalysis.mapper.AnalysisBatchUnitDeviceMapper">
<select id="listRecord" resultType="org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchUnitDeviceVO">
<select id="pageRecord" resultType="org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchUnitDeviceVO">
SELECT * FROM
(
SELECT
......@@ -35,12 +35,6 @@
) analysis
WHERE
1 =1
<if test="dto.isWordList!=null and dto.isWordList.size()>0">
AND analysis.is_work in
<foreach collection="dto.isWordList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="dto.unitTypeList!=null and dto.unitTypeList.size()>0">
AND analysis.unit_type in
<foreach collection="dto.unitTypeList" index="index" item="item" open="(" separator="," close=")">
......@@ -53,9 +47,8 @@
#{item}
</foreach>
</if>
<if test="dto.isTransfinite != null">
AND analysis.is_transfinite > 0
AND analysis.is_transfinite = #{dto.isTransfinite}
</if>
<if test="dto.unitStartingMileage != null">
AND analysis.unit_starting_mileage >= #{dto.unitStartingMileage }
......@@ -220,4 +213,72 @@
ORDER BY t3.ek_code ASC
</select>
<select id="listRecord" resultType="org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchUnitDeviceVO">
SELECT * FROM
(
SELECT
t1.id,
t1.create_by,
t1.create_time,
t1.update_by,
t1.update_time,
t1.analysis_batch_code,
t1.analysis_batch_id,
t1.unit_id,
t1.unit_code,
t1.unit_device_code,
t1.unit_type,
t1.unit_type_name,
t1.unit_start_mileage unit_starting_mileage,
t1.unit_center_mileage,
t1.unit_end_mileage,
t1.unit_score,
t1.unit_score_level,
t1.unit_score_level_str,
t1.remark,
( SELECT IF(COUNT( 1 )>0,1,0) FROM t_dsa_analysis_batch_unit_device_transfinite WHERE analysis_batch_unit_device_id = t1.id AND is_work = 1 ) AS is_work,
( SELECT IF(COUNT( 1 )>0,1,0) FROM t_dsa_analysis_batch_unit_device_transfinite WHERE analysis_batch_unit_device_id = t1.id ) AS is_transfinite,
( SELECT IF(COUNT( 1 )>0,1,0) FROM t_mw_work_batch_detail WHERE analysis_batch_unit_device_id = t1.id LIMIT 1 ) AS work_status
FROM
t_dsa_analysis_batch_unit_device t1
WHERE
t1.analysis_batch_id = #{dto.analysisBatchId}
) analysis
WHERE
1 =1
<if test="dto.unitTypeList!=null and dto.unitTypeList.size()>0">
AND analysis.unit_type in
<foreach collection="dto.unitTypeList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="dto.gradeJudgeList!=null and dto.gradeJudgeList.size()>0">
AND analysis.unit_score_level in
<foreach collection="dto.gradeJudgeList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="dto.isTransfinite != null">
AND analysis.is_transfinite = #{dto.isTransfinite}
</if>
<if test="dto.unitStartingMileage != null">
AND analysis.unit_starting_mileage >= #{dto.unitStartingMileage }
</if>
<if test="dto.unitEndMileage != null">
AND analysis.unit_end_mileage <![CDATA[ <= ]]> #{dto.unitEndMileage}
</if>
<if test="dto.unitCode != null and dto.unitCode != ''">
AND analysis.unit_code like concat('%',#{dto.unitCode},'%')
</if>
<if test="dto.unitDeviceCode != null and dto.unitDeviceCode != ''">
AND analysis.unit_device_code like concat('%',#{dto.unitDeviceCode},'%')
</if>
<if test="dto.unitDeviceCode != null and dto.unitDeviceCode != ''">
AND analysis.unit_device_code like concat('%',#{dto.unitDeviceCode},'%')
</if>
<if test="dto.workStatus != null ">
AND analysis.work_status = #{dto.workStatus}
</if>
order by unit_starting_mileage
</select>
</mapper>
......@@ -23,6 +23,7 @@
t1.allow_value,
t1.measure_point_value,
t1.is_work,
t1.disease_mileage,
t1.remark
FROM
t_dsa_analysis_batch_unit_device_transfinite t1
......@@ -49,6 +50,7 @@
t1.allow_value,
t1.measure_point_value,
t1.is_work,
t1.disease_mileage,
t1.remark
FROM
t_dsa_analysis_batch_unit_device_transfinite t1
......
......@@ -8,7 +8,6 @@ import org.jeecg.modules.dynamicStaticAnalysis.mapper.AnalysisBatchUnitDeviceMap
import org.jeecg.modules.dynamicStaticAnalysis.mapper.AnalysisBatchUnitDeviceTransfiniteMapper;
import org.jeecg.modules.dynamicStaticAnalysis.service.IAnalysisBatchUnitDeviceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchQueryVO;
import org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchUnitDeviceTransfiniteVO;
import org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchUnitDeviceVO;
import org.jeecg.modules.unitDevice.vo.RailAddInstrumentCheckVO;
......@@ -40,7 +39,7 @@ public class AnalysisBatchUnitDeviceServiceImpl extends ServiceImpl<AnalysisBatc
@Override
public Page<AnalysisBatchUnitDeviceVO> listRecord(Page<AnalysisBatchUnitDeviceVO> pageData, AnalysisBatchUnitDeviceDTO dto) {
Page<AnalysisBatchUnitDeviceVO> page = this.baseMapper.listRecord(pageData, dto);
Page<AnalysisBatchUnitDeviceVO> page = this.baseMapper.pageRecord(pageData, dto);
if (ObjectUtil.isNotEmpty(page.getRecords())) {
List<String> analysisBatchUnitDeviceIds = page.getRecords().stream().map(AnalysisBatchUnitDeviceVO::getId).collect(Collectors.toList());
......
......@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
......@@ -45,6 +46,9 @@ public class AnalysisBatchUnitDeviceTransfiniteVO {
@ApiModelProperty("是否派工 0-否 1-是")
private Integer isWork;
@ApiModelProperty("病害里程")
private BigDecimal diseaseMileage;
@ApiModelProperty("备注")
private String remark;
}
......@@ -114,7 +114,11 @@ public class WorkBatchController extends JeecgController<WorkBatch, IWorkBatchSe
@ApiOperation(value = "维修作业管理-作业计划批次管理-通过id删除", notes = "维修作业管理-作业计划批次管理-通过id删除")
@GetMapping(value = "/deleteRecord")
public Result<String> deleteRecord(@RequestParam(name = "id", required = true) String id) {
this.service.deleteRecord(id);
return Result.OK("删除成功!");
}
......
......@@ -6,6 +6,7 @@ import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* <p>
......@@ -62,8 +63,33 @@ public class AnalysisBatchSaveDTO {
@ApiModelProperty("分析批次id")
private String analysisBatchId;
@ApiModelProperty("查询条件")
private Form form;
@Data
public static class form {
public static class Form {
@ApiModelProperty("设备单元起始里程")
private BigDecimal unitStartingMileage;
@ApiModelProperty("设备单元结束里程")
private BigDecimal unitEndMileage;
@ApiModelProperty("是否超限")
private Integer isTransfinite;
@ApiModelProperty("单元编号")
private String unitCode;
@ApiModelProperty("设备编号")
private String unitDeviceCode;
@ApiModelProperty("派工状态 0-未派工 1-已派工")
private Integer workStatus;
@ApiModelProperty("得分平级")
private List<String> gradeJudgeList;
@ApiModelProperty("设备单元类型1-钢轨 2-曲线 3-竖曲线 4-道岔")
private List<Integer> unitTypeList;
}
}
......@@ -15,7 +15,7 @@ import java.math.BigDecimal;
* @since 2023-08-09
*/
@Data
@ApiModel(value = "TransfiniteDTO对象", description = "维修作业管理-超限")
@ApiModel(value = "DispatchDTO对象", description = "维修作业管理-超限")
public class DispatchDTO {
@ApiModelProperty("分析批次单元设备id")
......@@ -37,7 +37,7 @@ public class DispatchDTO {
private String unitDeviceCode;
@ApiModelProperty("设备单元起始里程")
private BigDecimal unitStartMileage;
private BigDecimal unitStartingMileage;
@ApiModelProperty("设备单元中心里程")
private BigDecimal unitCenterMileage;
......
......@@ -109,10 +109,6 @@ public class WorkBatchDetail implements Serializable {
@TableField("work_status")
private Integer workStatus;
@ApiModelProperty("病害里程")
@TableField("disease_mileage")
private BigDecimal diseaseMileage;
@ApiModelProperty("整改备注")
@TableField("reform_remark")
private String reformRemark;
......
package org.jeecg.modules.maintenanceWork.mapper;
import org.jeecg.modules.base.mapper.RootMapper;
import org.jeecg.modules.maintenanceWork.entity.WorkBatchDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.maintenanceWork.vo.WorkBatchDetailVO;
......@@ -16,9 +17,10 @@ import java.util.List;
* @author hkl
* @since 2023-08-09
*/
public interface WorkBatchDetailMapper extends BaseMapper<WorkBatchDetail> {
public interface WorkBatchDetailMapper extends RootMapper<WorkBatchDetail> {
List<WorkBatchDetailVO> queryListByWorkBatchId(String workBatchId);
List<CaseReportWorkBatchDetailVO> caseReportWorkBatchDetail(CaseReportWorkBatchDetailDTO dto);
List<WorkBatchDetailVO> queryListByWorkBatchIds(List<String> workBatchIds);
}
......@@ -22,4 +22,29 @@
FROM t_mw_work_batch_detail t1
WHERE t1.work_batch_id = #{workBatchId}
</select>
<select id="queryListByWorkBatchIds" resultType="org.jeecg.modules.maintenanceWork.vo.WorkBatchDetailVO">
SELECT t1.id,
t1.work_batch_id,
t1.work_batch_code,
t1.analysis_batch_unit_device_id,
t1.unit_id,
t1.unit_code,
t1.unit_type,
t1.unit_type_name,
t1.unit_device_code,
t1.unit_start_mileage,
t1.unit_center_mileage,
t1.unit_end_mileage,
t1.unit_score_level,
t1.unit_score_level_str,
t1.unit_score,
t1.remark
FROM t_mw_work_batch_detail t1
WHERE t1.work_batch_id in
<if test="workBatchIds !=null and workBatchIds.size()>0">
<foreach collection="workBatchIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>
......@@ -57,6 +57,8 @@ public class WorkBatchDetailVO {
@ApiModelProperty("设备单元起始里程")
private BigDecimal unitStartMileage;
@ApiModelProperty("分析批次单元设备id")
private String analysisBatchUnitDeviceId;
@ApiModelProperty("设备单元中心里程")
private BigDecimal unitCenterMileage;
......@@ -73,7 +75,6 @@ public class WorkBatchDetailVO {
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("超限")
private List<AnalysisBatchUnitDeviceTransfiniteVO> transfiniteList = new ArrayList<>();
@ApiModelProperty("超限list")
private List<AnalysisBatchUnitDeviceTransfiniteVO> transfiniteList;
}
package org.jeecg.modules.system.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -22,7 +21,7 @@ import org.jeecg.common.util.DateUtils;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.TokenUtils;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.config.mybatisPlus.MybatisPlusSaasConfig;
import org.jeecg.modules.message.enums.RangeDateEnum;
import org.jeecg.modules.message.websocket.WebSocket;
import org.jeecg.modules.system.entity.SysAnnouncement;
......
......@@ -17,7 +17,7 @@ import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.ImportExcelUtil;
import org.jeecg.common.util.SqlInjectionUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.config.mybatisPlus.MybatisPlusSaasConfig;
import org.jeecg.modules.system.entity.SysCategory;
import org.jeecg.modules.system.model.TreeSelectModel;
import org.jeecg.modules.system.service.ISysCategoryService;
......
......@@ -3,9 +3,6 @@ package org.jeecg.modules.system.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
import com.baomidou.dynamic.datasource.creator.DruidDataSourceCreator;
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -13,8 +10,6 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.config.TenantContext;
......@@ -24,7 +19,7 @@ import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.dynamic.db.DataSourceCachePool;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.common.util.security.JdbcSecurityUtil;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.config.mybatisPlus.MybatisPlusSaasConfig;
import org.jeecg.modules.system.entity.SysDataSource;
import org.jeecg.modules.system.service.ISysDataSourceService;
import org.jeecg.modules.system.util.SecurityUtil;
......@@ -34,7 +29,6 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
import java.util.Arrays;
import java.util.List;
......
......@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.config.TenantContext;
import org.jeecg.common.constant.CacheConstant;
......@@ -17,7 +16,7 @@ import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.ImportExcelUtil;
import org.jeecg.common.util.YouBianCodeUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.config.mybatisPlus.MybatisPlusSaasConfig;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.model.DepartIdModel;
......
......@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.config.TenantContext;
import org.jeecg.common.constant.CacheConstant;
......@@ -19,7 +18,7 @@ import org.jeecg.common.system.vo.DictModel;
import org.jeecg.common.system.vo.DictQuery;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.*;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.config.mybatisPlus.MybatisPlusSaasConfig;
import org.jeecg.modules.system.entity.SysDict;
import org.jeecg.modules.system.entity.SysDictItem;
import org.jeecg.modules.system.model.SysDictTree;
......
......@@ -17,7 +17,7 @@ import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.ImportExcelUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.config.mybatisPlus.MybatisPlusSaasConfig;
import org.jeecg.modules.system.entity.SysPosition;
import org.jeecg.modules.system.service.ISysPositionService;
import org.jeecg.modules.system.service.ISysUserService;
......@@ -41,7 +41,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Description: 职务表
......
package org.jeecg.modules.system.controller;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
......@@ -13,23 +11,19 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.config.TenantContext;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.config.mybatisPlus.MybatisPlusSaasConfig;
import org.jeecg.modules.system.entity.*;
import org.jeecg.modules.system.model.TreeModel;
import org.jeecg.modules.system.service.*;
import org.jeecg.modules.system.vo.SysUserRoleCountVo;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......
......@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.PermissionData;
import org.jeecg.common.config.TenantContext;
......@@ -19,7 +18,7 @@ import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.PasswordUtil;
import org.jeecg.common.util.TokenUtils;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.config.mybatisPlus.MybatisPlusSaasConfig;
import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.modules.system.entity.*;
import org.jeecg.modules.system.service.ISysTenantPackService;
......
......@@ -17,14 +17,13 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.PermissionData;
import org.jeecg.common.config.TenantContext;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.constant.SymbolConstant;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.config.mybatisPlus.MybatisPlusSaasConfig;
import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.util.JwtUtil;
......
......@@ -19,7 +19,7 @@ import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.FillRuleUtil;
import org.jeecg.common.util.YouBianCodeUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.config.mybatisPlus.MybatisPlusSaasConfig;
import org.jeecg.modules.system.entity.*;
import org.jeecg.modules.system.mapper.*;
import org.jeecg.modules.system.model.DepartIdModel;
......@@ -27,7 +27,6 @@ import org.jeecg.modules.system.model.SysDepartTreeModel;
import org.jeecg.modules.system.service.ISysDepartService;
import org.jeecg.modules.system.util.FindsDepartsChildrenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......
......@@ -13,14 +13,12 @@ import org.jeecg.common.constant.DataBaseConstant;
import org.jeecg.common.constant.SymbolConstant;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.common.system.util.ResourceUtil;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.common.system.vo.DictModelMany;
import org.jeecg.common.system.vo.DictQuery;
import org.jeecg.common.util.SqlInjectionUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.modules.system.entity.SysDict;
import org.jeecg.modules.system.entity.SysDictItem;
import org.jeecg.modules.system.mapper.SysDictItemMapper;
......
......@@ -8,10 +8,9 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.config.TenantContext;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.constant.SymbolConstant;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.config.mybatisPlus.MybatisPlusSaasConfig;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.entity.SysUserDepart;
......
......@@ -29,7 +29,7 @@ import org.jeecg.common.util.FillRuleUtil;
import org.jeecg.common.util.PasswordUtil;
import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.config.mybatisPlus.MybatisPlusSaasConfig;
import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.modules.system.entity.*;
import org.jeecg.modules.system.mapper.*;
......
......@@ -69,9 +69,9 @@
<!-- 日志输出级别 -->
<root level="INFO">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
<appender-ref ref="HTML" />
<appender-ref ref="FILE_HTML" />
<!-- <appender-ref ref="FILE" />-->
<!-- <appender-ref ref="HTML" />-->
<!-- <appender-ref ref="FILE_HTML" />-->
</root>
</configuration>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment