Commit c9c2b19c authored by chenzhao's avatar chenzhao

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register
parents 1a16af6c 81f3b88c
package com.yeejoin.amos.boot.module.jyjc.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import lombok.Data;
......@@ -137,4 +138,21 @@ public class JyjcInspectionResult extends BaseEntity {
@TableField("biz_type")
private String bizType;
/**
* 设备类别
*/
@TableField("equ_category")
private String equCategory;
/**
* 检验检测类型编码
*/
@TableField("inspection_type")
private String inspectionType;
/**
* 检验检测类型名称(冗余)
*/
@TableField("inspection_type_name")
private String inspectionTypeName;
}
package com.yeejoin.amos.boot.module.jyjc.api.enums;
public enum ResultStatusEnum {
NO_RESULT("未出","1"),
YES_RESULT("已出","2");
private String name;
private String code;
public String getName() {
return name;
}
ResultStatusEnum(String name, String code) {
this.name = name;
this.code = code;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
package com.yeejoin.amos.boot.module.jyjc.api.mapper;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResult;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel;
import org.apache.ibatis.annotations.Param;
/**
* 业务开通申请表 Mapper 接口
......@@ -11,4 +14,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface JyjcInspectionResultMapper extends BaseMapper<JyjcInspectionResult> {
Page<JyjcInspectionResultModel> selectJyjcInspectionResultpPage(@Param("page") Page<JyjcInspectionResultModel> page, @Param("jyjcInspectionResultModel") JyjcInspectionResultModel jyjcInspectionResultModel);
}
......@@ -2,9 +2,9 @@ package com.yeejoin.amos.boot.module.jyjc.api.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import java.util.Date;
......@@ -16,10 +16,10 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="JyjcInspectionResultModel", description="业务开通申请表")
@ApiModel(value = "JyjcInspectionResultModel", description = "业务开通申请表")
public class JyjcInspectionResultModel extends BaseModel {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "检验检测单位编码")
......@@ -34,9 +34,12 @@ public class JyjcInspectionResultModel extends BaseModel {
@ApiModelProperty(value = "设备唯一标识")
private String equipUnicode;
@ApiModelProperty(value = "检验结果状态(已出、未出)")
@ApiModelProperty(value = "检验结果状态(已出2、未出1)")
private String resultStatus;
@ApiModelProperty(value = "检验结果状态名称(已出2、未出1)(冗余)")
private String resultStatusName;
@ApiModelProperty(value = "核准证号/许可证号")
private String licenseNumber;
......@@ -79,4 +82,46 @@ public class JyjcInspectionResultModel extends BaseModel {
@ApiModelProperty(value = "业务类型(与菜单对应拆表使用)")
private String bizType;
@ApiModelProperty(value = "设备类别")
private String equCategory;
@ApiModelProperty(value = "检验检测类型编码")
private String inspectionType;
@ApiModelProperty(value = "检验检测类型名称(冗余)")
private String inspectionTypeName;
@ApiModelProperty(value = "设备种类")
private String equList;
@ApiModelProperty(value = "监管码")
private String supervisoryCode;
@ApiModelProperty(value = "使用登记证编号")
private String useOrgCode;
@ApiModelProperty(value = "单位内部编号")
private String useInnerCode;
@ApiModelProperty(value = "注册代码")
private String equCode;
/**
* 设备使用地点 = 设备使用地点省(province_name)+设备使用地点市(city_name)+
* 设备使用地点区(county_name)+设备使用地点街道(street_name)+设备使用地点详细(address)
*/
@ApiModelProperty(value = "设备使用地点")
private String equAddress;
@ApiModelProperty(value = "使用单位")
private String useUnitName;
@ApiModelProperty(value = "使用单位统一信用代码")
private String useUnitCreditCode;
@ApiModelProperty(value = "检验结果技术参数")
private JyjcInspectionResultParamModel resultParamModel;
@ApiModelProperty(value = "检验结果附件")
private JyjcInspectionResultAttachmentModel resultAttachmentModel;
}
package com.yeejoin.amos.boot.module.jyjc.api.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultAttachment;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
......@@ -13,7 +11,7 @@ import java.util.List;
* @author system_generator
* @date 2023-12-14
*/
public interface IJyjcInspectionResultAttachmentService {
public interface IJyjcInspectionResultAttachmentService extends IService<JyjcInspectionResultAttachment> {
/**
* 根据结果表主键获取附件列表
......
package com.yeejoin.amos.boot.module.jyjc.api.service;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultParam;
import java.util.List;
/**
* 检验结果技术参数表接口类
*
* @author system_generator
* @date 2023-12-14
*/
public interface IJyjcInspectionResultParamService {}
public interface IJyjcInspectionResultParamService {
/**
* 根据
* @param sequenceNbr
* @return
*/
List<JyjcInspectionResultParam> getParamByResultSeq(Long sequenceNbr);
}
......@@ -2,4 +2,24 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionResultMapper">
<select id="selectJyjcInspectionResultpPage"
resultType="com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel">
SELECT sequence_nbr, inspection_unit_code, application_no, application_unit_code, equip_unicode, result_status,
license_number, result_no, inspector, inner_person_code, inspection_conclusion, inspection_date,
next_inspection_date, inspection_start_date, inspection_end_date, inspection_result_summary, non_conformance,
rectification, remark, rec_user_id, rec_date, biz_type
FROM tz_jyjc_inspection_result
<where>
<if test="jyjcInspectionResultModel.applicationNo != '' and jyjcInspectionResultModel.applicationNo != null">
and application_no like concat('%',#{jyjcInspectionResultModel.applicationNo},'%')
</if>
<if test="jyjcInspectionResultModel.inspectionUnitCode != '' and jyjcInspectionResultModel.inspectionUnitCode != null">
and inspection_unit_code = #{jyjcInspectionResultModel.inspectionUnitCode}
</if>
<if test="jyjcInspectionResultModel.applicationUnitCode != '' and jyjcInspectionResultModel.applicationUnitCode != null">
and application_unit_code = #{jyjcInspectionResultModel.applicationUnitCode}
</if>
</where>
</select>
</mapper>
package com.yeejoin.amos.boot.module.jyjc.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionResultServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
/**
*
......@@ -86,23 +84,6 @@ public class JyjcInspectionResultController extends BaseController {
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.queryDetailBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
public ResponseModel<Page<JyjcInspectionResultModel>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<JyjcInspectionResultModel> page = new Page<JyjcInspectionResultModel>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.queryForJyjcInspectionResultPage(page));
}
/**
* 列表全部数据查询
......@@ -115,4 +96,56 @@ public class JyjcInspectionResultController extends BaseController {
public ResponseModel<List<JyjcInspectionResultModel>> selectForList() {
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.queryForJyjcInspectionResultList());
}
/**
* 列表页面(报检单位)
*
* @param current 当前页
* @param size 当前页大小
* @param model 查询参数
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/applicationUnitPage")
@ApiOperation(httpMethod = "GET", value = "列表页面(报检单位)", notes = "列表页面(报检单位)")
public ResponseModel<Page<JyjcInspectionResultModel>> applicationUnitQueryForPage(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, JyjcInspectionResultModel model) {
Page<JyjcInspectionResultModel> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.queryForJyjcInspectionResultPage(page, model, false));
}
/**
* 列表页面(检验检测单位)
*
* @param current 当前页
* @param size 当前页大小
* @param model 查询参数
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/inspectionUnitPage")
@ApiOperation(httpMethod = "GET", value = "列表页面(检验检测单位)", notes = "列表页面(检验检测单位)")
public ResponseModel<Page<JyjcInspectionResultModel>> inspectionUnitQueryForPage(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, JyjcInspectionResultModel model) {
Page<JyjcInspectionResultModel> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.queryForJyjcInspectionResultPage(page, model, true));
}
/**
* 检验结果-上传结果和编辑结果
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/updateResult")
@ApiOperation(httpMethod = "PUT", value = "检验结果-上传结果和编辑结果", notes = "检验结果-上传结果和编辑结果")
public ResponseModel<JyjcInspectionResultModel> updateJyjcInspectionResult(@RequestBody JyjcInspectionResultModel model) {
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.updateJyjcInspectionResult(model));
}
}
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultParam;
import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionResultParamMapper;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamService;
......@@ -30,4 +31,11 @@ public class JyjcInspectionResultParamServiceImpl extends BaseService<JyjcInspec
public List<JyjcInspectionResultParamModel> queryForJyjcInspectionResultParamList() {
return this.queryForList("" , false);
}
@Override
public List<JyjcInspectionResultParam> getParamByResultSeq(Long sequenceNbr) {
LambdaQueryWrapper<JyjcInspectionResultParam> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(JyjcInspectionResultParam::getResultSeq, sequenceNbr);
return this.baseMapper.selectList(wrapper);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResult;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultAttachment;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultParam;
import com.yeejoin.amos.boot.module.jyjc.api.enums.ResultStatusEnum;
import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionResultMapper;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultAttachmentService;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamService;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultService;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.HashMap;
import java.util.List;
......@@ -28,24 +35,62 @@ import java.util.stream.Collectors;
* @date 2023-12-14
*/
@Service
public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionResultModel,JyjcInspectionResult,JyjcInspectionResultMapper> implements IJyjcInspectionResultService {
public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionResultModel, JyjcInspectionResult, JyjcInspectionResultMapper> implements IJyjcInspectionResultService {
@Autowired
private IJyjcInspectionResultAttachmentService jyjcInspectionResultAttachmentService;
private IJyjcInspectionResultAttachmentService iJyjcInspectionResultAttachmentService;
@Autowired
private IJyjcInspectionResultParamService iJyjcInspectionResultParamService;
@Autowired
JyjcInspectionResultMapper resultMapper;
@Autowired
JyjcInspectionResultParamServiceImpl resultParamService;
@Autowired
JyjcInspectionResultAttachmentServiceImpl attachmentService;
@Autowired
private RedisUtils redisUtils;
/**
* 分页查询
* 检验检测单位分页查询
*/
public Page<JyjcInspectionResultModel> queryForJyjcInspectionResultPage(Page<JyjcInspectionResultModel> page) {
return this.queryForPage(page, null, false);
public Page<JyjcInspectionResultModel> queryForJyjcInspectionResultPage(Page<JyjcInspectionResultModel> page, JyjcInspectionResultModel model, boolean type) {
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(),
RequestContext.getToken())).toString(), ReginParams.class);
if (type) {
//检验检测单位分页查询
model.setInspectionUnitCode(reginParams.getCompany().getCompanyCode());
} else {
//报检单位分页查询
model.setApplicationUnitCode(reginParams.getCompany().getCompanyCode());
}
Page<JyjcInspectionResultModel> resultPage = resultMapper.selectJyjcInspectionResultpPage(page, model);
resultPage.getRecords().stream().forEach(v -> {
if (ResultStatusEnum.NO_RESULT.getCode().equals(v.getResultStatus()))
v.setResultStatusName(ResultStatusEnum.NO_RESULT.getName());
if (ResultStatusEnum.YES_RESULT.getCode().equals(v.getResultStatus()))
v.setResultStatusName(ResultStatusEnum.YES_RESULT.getName());
});
return resultPage;
}
public JyjcInspectionResultModel updateJyjcInspectionResult(JyjcInspectionResultModel model) {
updateWithModel(model);
if (ObjectUtil.isNotEmpty(model.getResultAttachmentModel()))
attachmentService.createWithModel(model.getResultAttachmentModel());
if (ObjectUtil.isNotEmpty(model.getResultParamModel()))
resultParamService.createWithModel(model.getResultParamModel());
return model;
}
/**
* 列表查询 示例
*/
public List<JyjcInspectionResultModel> queryForJyjcInspectionResultList() {
return this.queryForList("" , false);
public List<JyjcInspectionResultModel> queryForJyjcInspectionResultList() {
return this.queryForList("", false);
}
@Override
......@@ -58,11 +103,23 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
map = BeanUtil.beanToMap(jyjcInspectionResultModel);
// 获取附件
List<JyjcInspectionResultAttachment> attachmentList = jyjcInspectionResultAttachmentService.getObjByResultSeq(sequenceNbr);
List<JyjcInspectionResultAttachment> attachmentList = iJyjcInspectionResultAttachmentService.getObjByResultSeq(sequenceNbr);
if (!CollectionUtils.isEmpty(attachmentList)) {
Map<String, Object> attachmentMap = attachmentList.stream().collect(Collectors.toMap(JyjcInspectionResultAttachment::getAttachmentType, JyjcInspectionResultAttachment::getAttachmentUrl));
map.putAll(attachmentMap);
}
// 获取技术参数
List<JyjcInspectionResultParam> paramList = iJyjcInspectionResultParamService.getParamByResultSeq(sequenceNbr);
Map<String, Object> mapParam = new HashMap<>();
if (!CollectionUtils.isEmpty(paramList)) {
paramList.forEach(param -> {
if (!ObjectUtils.isEmpty(param.getParamJson())) {
mapParam.putAll(JSON.parseObject(param.getParamJson()));
}
});
map.put("paramJson", mapParam);
}
}
return map;
}
......
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