Commit d46b8c12 authored by 高滢's avatar 高滢

检查记录

parent 1208e99e
package com.ruoyi.domain; package com.ruoyi.domain;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date;
/** /**
* *
* @TableName t_test_plan_record * @TableName t_test_plan_record
*/ */
@TableName(value ="t_test_plan_record") @TableName(value ="t_test_plan_record")
@Data @Data
public class TTestPlanRecord extends BaseEntity { public class TTestPlanRecord{
/** /**
* 主键 * 主键
*/ */
...@@ -35,6 +33,7 @@ public class TTestPlanRecord extends BaseEntity { ...@@ -35,6 +33,7 @@ public class TTestPlanRecord extends BaseEntity {
* 被检车企名称 * 被检车企名称
*/ */
@ApiModelProperty("被检车企名称") @ApiModelProperty("被检车企名称")
@TableField(exist = false)
private String inspectCarCompanyName; private String inspectCarCompanyName;
/** /**
...@@ -47,7 +46,7 @@ public class TTestPlanRecord extends BaseEntity { ...@@ -47,7 +46,7 @@ public class TTestPlanRecord extends BaseEntity {
/** /**
* 文件路径 * 文件路径
*/ */
@ApiModelProperty("车辆型号") @ApiModelProperty("文件路径")
private String fileUrl; private String fileUrl;
/** /**
...@@ -67,6 +66,7 @@ public class TTestPlanRecord extends BaseEntity { ...@@ -67,6 +66,7 @@ public class TTestPlanRecord extends BaseEntity {
* 检测机构名称 * 检测机构名称
*/ */
@ApiModelProperty("检测机构名称") @ApiModelProperty("检测机构名称")
@TableField(exist = false)
private String testOrganizationName; private String testOrganizationName;
/** /**
...@@ -91,9 +91,13 @@ public class TTestPlanRecord extends BaseEntity { ...@@ -91,9 +91,13 @@ public class TTestPlanRecord extends BaseEntity {
* 标准名称 * 标准名称
*/ */
@ApiModelProperty("标准名称") @ApiModelProperty("标准名称")
@TableField(exist = false)
private String inspectionStandardName; private String inspectionStandardName;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@TableField(fill = FieldFill.INSERT)
private Date createTime;
@TableField(exist = false) @TableField(exist = false)
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -2,9 +2,11 @@ package com.ruoyi.mapper; ...@@ -2,9 +2,11 @@ package com.ruoyi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.domain.TTestPlanRecord; import com.ruoyi.domain.TTestPlanRecord;
import com.ruoyi.web.request.TestPlanRecordGetInfoRequest; import com.ruoyi.web.request.TestPlanRecordPageRequest;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
/** /**
* @author W_YI * @author W_YI
* @description 针对表【t_test_plan_record】的数据库操作Mapper * @description 针对表【t_test_plan_record】的数据库操作Mapper
...@@ -18,6 +20,8 @@ public interface TTestPlanRecordMapper extends BaseMapper<TTestPlanRecord> { ...@@ -18,6 +20,8 @@ public interface TTestPlanRecordMapper extends BaseMapper<TTestPlanRecord> {
public TTestPlanRecord selectTestPlanRecordDetails(Long id); public TTestPlanRecord selectTestPlanRecordDetails(Long id);
public List<TTestPlanRecord> selectTestPlanRecordPage(TestPlanRecordPageRequest testPlanRecordPageRequest);
} }
......
...@@ -3,6 +3,9 @@ package com.ruoyi.service; ...@@ -3,6 +3,9 @@ package com.ruoyi.service;
import com.ruoyi.domain.TTestPlanRecord; import com.ruoyi.domain.TTestPlanRecord;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.web.request.TestPlanRecordGetInfoRequest; import com.ruoyi.web.request.TestPlanRecordGetInfoRequest;
import com.ruoyi.web.request.TestPlanRecordPageRequest;
import java.util.List;
/** /**
* @author W_YI * @author W_YI
...@@ -15,4 +18,6 @@ public interface TTestPlanRecordService extends IService<TTestPlanRecord> { ...@@ -15,4 +18,6 @@ public interface TTestPlanRecordService extends IService<TTestPlanRecord> {
public TTestPlanRecord selectTestPlanRecordDetails(Long id); public TTestPlanRecord selectTestPlanRecordDetails(Long id);
public List<TTestPlanRecord> selectTestPlanRecordPage(TestPlanRecordPageRequest testPlanRecordPageRequest);
} }
...@@ -6,10 +6,12 @@ import com.ruoyi.domain.TTestPlanRecord; ...@@ -6,10 +6,12 @@ import com.ruoyi.domain.TTestPlanRecord;
import com.ruoyi.service.TTestPlanRecordService; import com.ruoyi.service.TTestPlanRecordService;
import com.ruoyi.mapper.TTestPlanRecordMapper; import com.ruoyi.mapper.TTestPlanRecordMapper;
import com.ruoyi.web.request.TestPlanRecordGetInfoRequest; import com.ruoyi.web.request.TestPlanRecordGetInfoRequest;
import com.ruoyi.web.request.TestPlanRecordPageRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @author W_YI * @author W_YI
...@@ -27,7 +29,7 @@ public class TTestPlanRecordServiceImpl extends ServiceImpl<TTestPlanRecordMappe ...@@ -27,7 +29,7 @@ public class TTestPlanRecordServiceImpl extends ServiceImpl<TTestPlanRecordMappe
public int insertTestPlanRecord(TTestPlanRecord tTestPlanRecord){ public int insertTestPlanRecord(TTestPlanRecord tTestPlanRecord){
tTestPlanRecord.setInspectCarCompanyId(SecurityUtils.getDeptId()); tTestPlanRecord.setInspectCarCompanyId(SecurityUtils.getDeptId());
tTestPlanRecord.setCreateTime(new Date()); tTestPlanRecord.setCreateTime(new Date());
return tTestPlanRecordMapper.insertTestPlanRecord(tTestPlanRecord); return tTestPlanRecordMapper.insert(tTestPlanRecord);
} }
@Override @Override
...@@ -35,6 +37,10 @@ public class TTestPlanRecordServiceImpl extends ServiceImpl<TTestPlanRecordMappe ...@@ -35,6 +37,10 @@ public class TTestPlanRecordServiceImpl extends ServiceImpl<TTestPlanRecordMappe
return tTestPlanRecordMapper.selectTestPlanRecordDetails(id); return tTestPlanRecordMapper.selectTestPlanRecordDetails(id);
} }
@Override
public List<TTestPlanRecord> selectTestPlanRecordPage(TestPlanRecordPageRequest testPlanRecordPageRequest){
return tTestPlanRecordMapper.selectTestPlanRecordPage(testPlanRecordPageRequest);
}
} }
......
...@@ -3,6 +3,7 @@ package com.ruoyi.web; ...@@ -3,6 +3,7 @@ package com.ruoyi.web;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.domain.ReviewStandard; import com.ruoyi.domain.ReviewStandard;
import com.ruoyi.domain.TTestPlanRecord; import com.ruoyi.domain.TTestPlanRecord;
...@@ -10,6 +11,7 @@ import com.ruoyi.service.TTestPlanRecordService; ...@@ -10,6 +11,7 @@ import com.ruoyi.service.TTestPlanRecordService;
import com.ruoyi.service.impl.ReviewStandardServiceImpl; import com.ruoyi.service.impl.ReviewStandardServiceImpl;
import com.ruoyi.web.request.PlanDetailStandardRequest; import com.ruoyi.web.request.PlanDetailStandardRequest;
import com.ruoyi.web.request.TestPlanRecordGetInfoRequest; import com.ruoyi.web.request.TestPlanRecordGetInfoRequest;
import com.ruoyi.web.request.TestPlanRecordPageRequest;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.skywalking.apm.toolkit.trace.Tag; import org.apache.skywalking.apm.toolkit.trace.Tag;
...@@ -21,13 +23,15 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -21,13 +23,15 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import java.util.List; import java.util.List;
@Api(tags = "检测方案记录") @Api(tags = "检测方案记录")
@RestController @RestController
@RequestMapping("/Plan/Record") @RequestMapping("/Plan/Record")
public class TestPlanRecordController { public class TestPlanRecordController extends BaseController{
@Autowired @Autowired
private TTestPlanRecordService tTestPlanRecordService; private TTestPlanRecordService tTestPlanRecordService;
...@@ -61,4 +65,14 @@ public class TestPlanRecordController { ...@@ -61,4 +65,14 @@ public class TestPlanRecordController {
List<ReviewStandard> tree = reviewStandardService.findTree(planDetailStandardRequest.getInspectionStandardId(), planDetailStandardRequest.getType()); List<ReviewStandard> tree = reviewStandardService.findTree(planDetailStandardRequest.getInspectionStandardId(), planDetailStandardRequest.getType());
return R.ok(tree); return R.ok(tree);
} }
@ApiOperation("查询检验记录")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/page")
public TableDataInfo<TTestPlanRecord> selectTestPlanRecordPage(@Validated @RequestBody TestPlanRecordPageRequest testPlanRecordPageRequest){
startPage(testPlanRecordPageRequest);
List<TTestPlanRecord> list = tTestPlanRecordService.selectTestPlanRecordPage(testPlanRecordPageRequest);
return getDataTable(list);
}
} }
package com.ruoyi.web.request;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ruoyi.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author GaoYing
*/
@Data
@ApiModel
public class TestPlanRecordPageRequest extends PageDomain {
/**
* 主键
*/
@ApiModelProperty("主键")
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 车辆型号
*/
@ApiModelProperty("车辆型号")
private String carModel;
/**
* 被检车企ID
*/
@ApiModelProperty("被检车企ID")
private Long inspectCarCompanyId;
/**
* 文件路径
*/
@ApiModelProperty("文件路径")
private String fileUrl;
}
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
insert into t_test_plan_record insert into t_test_plan_record
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="carModel != null">car_model,</if> <if test="carModel != null">car_model,</if>
<if test="fileUrl != null">fileUrl,</if> <if test="fileUrl != null">file_url,</if>
<if test="testResult != null">test_result,</if> <if test="testResult != null">test_result,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="testOrganizationId != null">test_organization_id,</if> <if test="testOrganizationId != null">test_organization_id,</if>
...@@ -60,4 +60,12 @@ ...@@ -60,4 +60,12 @@
<include refid="selectTestPlanRecordVo"/> <include refid="selectTestPlanRecordVo"/>
where sm.id = #{id} where sm.id = #{id}
</select> </select>
<select id="selectTestPlanRecordPage" parameterType="com.ruoyi.web.request.TestPlanRecordPageRequest" resultMap="BaseResultMap">
<include refid="selectTestPlanRecordVo"/>
<where>
<if test="carModel != null and carModel != ''"> and pr.car_model like concat('%', #{carModel}, '%')</if>
<if test="inspectCarCompanyId != null and inspectCarCompanyId != ''"> and pr.inspectCarCompanyId= #{inspectCarCompanyId}</if>
</where>
</select>
</mapper> </mapper>
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