2024-04-25 资质凭证bug和印章管理将实验室id改为实验室名称
| | |
| | | @ApiOperation(value = "查询资质明细列表") |
| | | @PostMapping("/getCertificationDetail") |
| | | public Result getCertificationDetail(@RequestBody Map<String, Object> data) throws Exception { |
| | | System.out.println(data); |
| | | Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class); |
| | | Certification certification = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), Certification.class); |
| | | return Result.success(certificationService.getCertificationDetail(page, certification)); |
| | |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @ApiOperation(value="查询印章列表") |
| | | @PostMapping("/selectSeal") |
| | | public Result selectSeal(@RequestBody Map<String, Object> data) throws Exception { |
| | | System.out.println(data); |
| | | Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class); |
| | | Seal seal = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), Seal.class); |
| | | return Result.success(sealService.selectSeal(page,seal)); |
| | | |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.Certification; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface CertificationMapper extends BaseMapper<Certification> { |
| | | |
| | | //查询资质明细列表 |
| | | IPage<Certification> getCertificationDetail(Page page, QueryWrapper<Certification> ew); |
| | | IPage<Certification> getCertificationDetail(Page page, @Param("ew") QueryWrapper<Certification> ew); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.Certification; |
| | | |
| | | import com.yuanchu.mom.pojo.Laboratory; |
| | | import com.yuanchu.mom.pojo.Seal; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface SealMapper extends BaseMapper<Seal> { |
| | | IPage<Seal>selectSeal(Page page, QueryWrapper<Seal> ew); |
| | |
| | | @ValueTableShow(6) |
| | | @ApiModelProperty(value = "首次颁发时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime firstTime; |
| | | |
| | | private LocalDateTime firstIssuanceDate; |
| | | @ValueTableShow(7) |
| | | @ApiModelProperty(value = "最近颁发时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime recentlyTime; |
| | | private LocalDateTime latestIssuanceDate; |
| | | |
| | | |
| | | |
| | | @ValueTableShow(8) |
| | | @ApiModelProperty(value = "到期颁发时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime expireTime; |
| | | |
| | | |
| | | @ApiModelProperty(value = "颁布日期") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime dateOfIssuance; |
| | | |
| | | @ApiModelProperty(value = "创建人") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ValueTableShow(9) |
| | | |
| | | @ApiModelProperty(value = "更新人") |
| | | private String createUserName; |
| | | |
| | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ValueTableShow(7) |
| | | @ApiModelProperty(value = "最近颁发时间") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ValueTableShow(11) |
| | | @ApiModelProperty(value = "状态") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty(value = "资质图片地址") |
| | | private String imageUrl; |
| | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | @ValueTableShow(1) |
| | | |
| | | |
| | | @ApiModelProperty(value = "实验室id") |
| | | private Integer labId; |
| | | |
| | | @TableField(exist=false) |
| | | @ValueTableShow(2) |
| | | @ApiModelProperty(value = "实验室名称") |
| | | private String laboratoryName; |
| | | @ValueTableShow(3) |
| | | @ApiModelProperty(value = "印章图片") |
| | | private String address; |
| | | |
| | | @ValueTableShow(3) |
| | | @ValueTableShow(4) |
| | | @ApiModelProperty(value = "印章类型") |
| | | private String type; |
| | | @ApiModelProperty(value = "创建人id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ValueTableShow(5) |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | List<Device> selectDeviceByCategory(String inspectionItem, String inspectionItemSubclass); |
| | | |
| | | Device selectDeviceByCode(String code); |
| | | |
| | | } |
| | | |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.common.PrintChina; |
| | | import com.yuanchu.mom.mapper.LaboratoryMapper; |
| | | import com.yuanchu.mom.mapper.SealMapper; |
| | | import com.yuanchu.mom.pojo.Certification; |
| | | import com.yuanchu.mom.pojo.Laboratory; |
| | | import com.yuanchu.mom.pojo.Seal; |
| | | import com.yuanchu.mom.service.SealService; |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("head", PrintChina.printChina(Seal.class)); |
| | | map.put("body", sealMapper.selectSeal(page, QueryWrappers.queryWrappers(seal))); |
| | | |
| | | return map; |
| | | } |
| | | @Override |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.yuanchu.mom.mapper.CertificationMapper"> |
| | | <select id="getCertificationDetail" resultType="com.yuanchu.mom.pojo.Certification"> |
| | | select * from |
| | | (select c.id, |
| | | c.name, |
| | | c.code, |
| | | organization, |
| | | explanation, |
| | | first_time, |
| | | recently_time, |
| | | expire_time, |
| | | u1.name create_user_name, |
| | | c.create_time, |
| | | case when now() > expire_time then 0 |
| | | else 1 end as state, |
| | | image_url, |
| | | file_url |
| | | from certification c |
| | | left join user u1 on c.create_user = u1.id |
| | | order by c.id desc) a |
| | | select b.* |
| | | from ( select a.`name`, a.`code`,a.organization,a.explanation,a.first_issuance_date,a.latest_issuance_date,c.expire_time FROM |
| | | (SELECT id,name,MIN(date_of_issuance) AS first_issuance_date, |
| | | MAX(date_of_issuance) AS latest_issuance_date, |
| | | c.`code`,c.organization,c.explanation |
| | | FROM |
| | | certification c |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | group by name |
| | | GROUP BY |
| | | name) a left join certification c on a.id=c.id |
| | | ) b |
| | | </select> |
| | | </mapper> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yuanchu.mom.mapper.SealMapper"> |
| | | <select id="selectSeal" resultType="com.yuanchu.mom.pojo.Seal"> |
| | | select * from seal |
| | | select l.id,s.lab_id,l.laboratory_name ,s.address, s.type as type,s.create_time |
| | | from seal s LEFT JOIN laboratory l on s.lab_id=l.id |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | |
| | | </select> |
| | | <select id="selectLaboratory" resultType="com.yuanchu.mom.pojo.Laboratory"> |
| | | SELECT * |
| | | from laboratory |
| | | WHERE id =#{labId} |
| | | WHERE id = #{labId} |
| | | </select> |
| | | </mapper> |
| | |
| | | @PostMapping("/selectSampleDefects") |
| | | public Result selectSampleDefects(Integer size, Integer current, String inspectionItems, String orderNumber) { |
| | | return Result.success(insOrderService.selectSampleDefects(new Page<>(current, size),inspectionItems, orderNumber)); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | Long aLong = insOrderMapper.getCount(inspectionItems, orderNumber); |
| | | map.put("total", aLong); |
| | | return map; |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | </resultMap> |
| | | |
| | | <resultMap id="SampleDefectsChildrenMap" type="com.yuanchu.mom.vo.SampleDefectsChildrenVo"> |
| | | <result column="entrust_code" property="entrust_code" /> |
| | | <result column="inspection_item" property="inspection_item" /> |
| | | <result column="entrust_code" property="entrust_code"/> |
| | | <result column="inspection_item" property="inspection_item"/> |
| | | <result column="name" property="name"/> |
| | | <result column="create_time" property="create_time" /> |
| | | <result column="create_time" property="create_time"/> |
| | | </resultMap> |
| | | <select id="selectInsOrderParameter" resultType="com.yuanchu.mom.pojo.InsOrder"> |
| | | select * |
| | |
| | | <select id="selectSampleAndProductByOrderId" resultType="com.yuanchu.mom.dto.SampleProductDto2"> |
| | | select * |
| | | from ( |
| | | select |
| | | i.id,isa.sample_code,isa.sample,isa.model,ip.state,ip.unit,ip.inspection_item,ip.inspection_item_subclass, |
| | | select i.id,isa.sample_code,isa.sample,isa.model,isa.ins_state,ip.state,ip.unit,ip.inspection_item,ip.inspection_item_subclass, |
| | | ip.son_laboratory,ip.inspection_item_type,ip.inspection_value_type,ip.ask,ip.`last_value`,ip.ins_result,ipr.equip_value |
| | | from ins_sample isa |
| | |
| | | ins_order i |
| | | LEFT JOIN ins_sample isa ON isa.ins_order_id = i.id |
| | | LEFT JOIN `user` u ON u.id = i.user_id |
| | | LEFT JOIN (select SUM(b.price) price, sum(b.man_hour) cost,b.ins_sample_id,GROUP_CONCAT(b.inspection_item SEPARATOR ',') |
| | | LEFT JOIN (select SUM(b.price) price, sum(b.man_hour) cost,b.ins_sample_id,GROUP_CONCAT(b.inspection_item |
| | | SEPARATOR ',') |
| | | inspection_item from (select * from ins_product where state = 1 GROUP BY ins_sample_id,man_hour_group) b GROUP |
| | | BY b.ins_sample_id) c ON c.ins_sample_id = isa.id |
| | | ) a |
| | |
| | | </if> |
| | | </select> |
| | | <select id="selectDeviceList" resultType="java.util.Map"> |
| | | select device_name,specification_model,factory_no,date_format(latest_traceability, '%Y-%m-%d') latest_traceability from device |
| | | select device_name,specification_model,factory_no,date_format(latest_traceability, '%Y-%m-%d') |
| | | latest_traceability from device |
| | | where device_name in |
| | | <foreach collection="names" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | |
| | | left JOIN ins_sample sam on io.id=sam.ins_order_id |
| | | LEFT JOIN ins_product ip on ip.ins_sample_id=sam.id |
| | | LEFT JOIN |
| | | (SELECT create_time,create_user,ins_product_id FROM (select * FROM ins_product_user ORDER BY ins_product_user.create_time DESC) a GROUP BY a.ins_product_id) b |
| | | (SELECT create_time,create_user,ins_product_id FROM |
| | | (select * FROM ins_product_user ORDER BY ins_product_user.create_time DESC) a |
| | | GROUP BY a.ins_product_id) b |
| | | on b.ins_product_id=ip.id |
| | | left JOIN `user` u on u.id=b.create_user |
| | | left JOIN `user` u on u.id=b.create_user |
| | | WHERE (ip.ins_result=0 OR ip.state=0) |
| | | <if test="inspectionItems != null and inspectionItems != ''"> |
| | | and inspection_item like concat('%', #{inspectionItems}, '%') |
| | |
| | | left JOIN ins_sample sam on io.id=sam.ins_order_id |
| | | LEFT JOIN ins_product ip on ip.ins_sample_id=sam.id |
| | | LEFT JOIN |
| | | (SELECT create_time,create_user,ins_product_id FROM (select * FROM ins_product_user ORDER BY ins_product_user.create_time DESC) a GROUP BY a.ins_product_id) b |
| | | (SELECT create_time,create_user,ins_product_id FROM (select * FROM ins_product_user ORDER BY |
| | | ins_product_user.create_time DESC) a GROUP BY a.ins_product_id) b |
| | | on b.ins_product_id=ip.id |
| | | left JOIN `user` u on u.id=b.create_user |
| | | where (ip.ins_result=0 OR ip.state=0) |
| | | left JOIN `user` u on u.id=b.create_user |
| | | where (ip.ins_result=0 OR ip.state=0) |
| | | <if test="inspectionItems != null and inspectionItems != ''"> |
| | | and inspection_item like concat('%', #{inspectionItems}, '%') |
| | | and inspection_item like concat('%', #{inspectionItems}, '%') |
| | | </if> |
| | | <if test="orderNumber != null and orderNumber != ''"> |
| | | and io.entrust_code like concat('%', #{orderNumber}, '%') |
| | | </if> |
| | | ) temp |
| | | ) temp |
| | | </select> |
| | | </mapper> |