¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.ProjectNum; |
| | | import com.yuanchu.limslaboratory.service.HomeService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * é¦é¡µ |
| | | * @author zss |
| | | * @since 2023-08-03 13:03:36 |
| | | */ |
| | | @Api(tags = "é¦é¡µ") |
| | | @RestController |
| | | @RequestMapping("/home") |
| | | public class HomeController { |
| | | |
| | | @Resource |
| | | HomeService homeService; |
| | | |
| | | @ApiOperation("è®¡ç®æ£éªä¸æªæ£éªçååä¸é¡¹ç®çæ°éæ¥å£") |
| | | @GetMapping("/checkProjectNum") |
| | | public Result checkProjectNum() { |
| | | ProjectNum projectNum=homeService.checkProjectNum(); |
| | | return Result.success(projectNum); |
| | | } |
| | | } |
| | |
| | | import java.util.*; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.yuanchu.limslaboratory.mapper.UserMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.pojo.Report; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | |
| | | @Resource |
| | | LinkBasicInformationService linkBasicInformationService; |
| | | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢æ£éªç³è¯·åå表") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize", value = "页æ°", dataTypeClass = Integer.class, required = true), |
| | |
| | | case 0: |
| | | //åææ |
| | | return Result.success(rawMaterialService.selectRawmaAll()); |
| | | case 1: |
| | | case 2: |
| | | //å§æå |
| | | return Result.success(linkBasicInformationService.selectLinkAll()); |
| | | case 2: |
| | | case 1: |
| | | //æåæ£éª |
| | | return Result.success("请è¾å
¥æ£éªä¿¡æ¯!"); |
| | | } |
| | |
| | | return Result.success(inspectionService.selectInspectsListById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "éæ©æ£éªé¡¹ç®ç责任人") |
| | | @GetMapping("/selectUser") |
| | | public Result selectUser() { |
| | | return Result.success(userMapper.selectUser()); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¿åæ£éªé¡¹ç®è´£ä»»äºº") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªå项ç®id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "userProId", value = "责任人id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseUseProId") |
| | | public Result chooseUseProId(Integer id,Integer userProId) { |
| | | return Result.success(inspectionService.chooseUseProId(id,userProId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä½åºæ£éªå") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªåid", dataTypeClass = Integer.class, required = true) |
| | |
| | | @ApiOperation("åé
") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªé¡¹ç®id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "userId", value = "æ£éªäººid", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "userId", value = "æ§è¡äººid", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "instrumentId", value = "设å¤id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/distribution") |
| | |
| | | * @return |
| | | */ |
| | | IPage<Map<String, Object>> selectInspectsList(Page<Object> page, String message); |
| | | |
| | | //计ç®å·²æ£éªæ£éªåæ°é |
| | | Integer seleCountIns(); |
| | | |
| | | //è®¡ç®æªæ£éªçæ°é |
| | | Integer seleCountUnIns(); |
| | | } |
| | | |
| | |
| | | |
| | | //æ ¹æ®æ£éªæ ·åidä½åºæ£éªé¡¹ç® |
| | | void updat(Integer id); |
| | | |
| | | //计ç®å·²æ£éªé¡¹ç®æ°é |
| | | Integer seleCountInspro(); |
| | | |
| | | //è®¡ç®æªæ£éªé¡¹ç®æ°é |
| | | Integer seleCountUnInspro(); |
| | | } |
| | | |
| | |
| | | @ApiModelProperty(value = "å页å¤å°æ¡", example = "10", required = true) |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "æ ·åç¼å·", example = "1680929494813868034", required = true) |
| | | @ApiModelProperty(value = "æ ·åç¼å·", example = "1680929494813868034") |
| | | private String materialCode; |
| | | |
| | | @ApiModelProperty(value = "æ ·ååç§°", example = "çµçº¿çµç¼", required = true) |
| | | @ApiModelProperty(value = "æ ·ååç§°", example = "çµçº¿çµç¼") |
| | | private String materialName; |
| | | |
| | | @ApiModelProperty(value = "ç³è¯·åå·", example = "XG-UGYUGH", required = true) |
| | | @ApiModelProperty(value = "ç³è¯·åå·", example = "XG-UGYUGH") |
| | | private String inspectionCode; |
| | | } |
| | |
| | | private Integer inspectionMaterialId; |
| | | |
| | | /** |
| | | * å
³è ç¨æ·id è¯éªå |
| | | * å
³è ç¨æ·id æ§è¡äºº |
| | | **/ |
| | | private Integer userId; |
| | | |
| | |
| | | * å
³è 设å¤id |
| | | **/ |
| | | private Integer instrumentId; |
| | | |
| | | /** |
| | | * å
³è ç¨æ·id 责任人 |
| | | **/ |
| | | private Integer userProId; |
| | | } |
| | | |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private Integer id; |
| | | |
| | | /** |
| | | * æ ·åç¼å· |
| | | */ |
| | |
| | | */ |
| | | private String specifications; |
| | | |
| | | /** |
| | | * ç»è®º0:ä¸åæ ¼ ; 1:åæ ¼ |
| | | */ |
| | | private Integer result; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ProjectNum { |
| | | |
| | | private int insNum; //å·²æ£éªçæ£éªåæ°é |
| | | private int insUnNum; //æªæ£éªçæ£éªåæ°é |
| | | private int insproNum; //å·²æ£éªçæ£éªé¡¹ç®æ°é |
| | | private int insproUnNum; //æªæ£éªçæ£éªé¡¹ç®æ°é |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.ProjectNum; |
| | | |
| | | public interface HomeService { |
| | | |
| | | /** |
| | | * è®¡ç®æ£éªä¸æªæ£éªçååä¸é¡¹ç®çæ°éæ¥å£ |
| | | * @return |
| | | */ |
| | | ProjectNum checkProjectNum(); |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | String delInspect(Integer id); |
| | | |
| | | /** |
| | | * ä¿åæ£éªé¡¹ç®è´£ä»»äºº |
| | | * @param id |
| | | * @param userProId |
| | | * @return |
| | | */ |
| | | String chooseUseProId(Integer id, Integer userProId); |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * 䏿¥ |
| | | * @param code |
| | | * @param id |
| | | * @return |
| | | */ |
| | | String reported(Integer id); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionMapper; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionProductMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.pojo.ProjectNum; |
| | | import com.yuanchu.limslaboratory.service.HomeService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | |
| | | @Service |
| | | public class HomeServiceImpl implements HomeService { |
| | | |
| | | @Resource |
| | | InspectionMapper inspectionMapper; |
| | | |
| | | @Resource |
| | | InspectionProductMapper inspectionProductMapper; |
| | | |
| | | |
| | | //è®¡ç®æ£éªä¸æªæ£éªçååä¸é¡¹ç®çæ°éæ¥å£ |
| | | @Override |
| | | public ProjectNum checkProjectNum() { |
| | | ProjectNum projectNum = new ProjectNum(); |
| | | //å·²æ£éªçæ£éªåæ°é |
| | | projectNum.setInsNum(inspectionMapper.seleCountIns()); |
| | | //æªæ£éªçæ£éªåæ°é |
| | | projectNum.setInsUnNum(inspectionMapper.seleCountUnIns()); |
| | | //å·²æ£éªçæ£éªé¡¹ç®æ°é |
| | | projectNum.setInsproNum(inspectionProductMapper.seleCountInspro()); |
| | | //æªæ£éªçæ£éªé¡¹ç®æ°é |
| | | projectNum.setInsproUnNum(inspectionProductMapper.seleCountUnInspro()); |
| | | return projectNum; |
| | | } |
| | | } |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | return "ä½åºæå!"; |
| | | } |
| | | |
| | | //ä¿åæ£éªé¡¹ç®è´£ä»»äºº |
| | | @Override |
| | | public String chooseUseProId(Integer id, Integer userProId) { |
| | | InspectionProduct inspectionProduct = new InspectionProduct(); |
| | | inspectionProduct.setId(id); |
| | | inspectionProduct.setUserProId(userProId); |
| | | inspectionProductMapper.updateById(inspectionProduct); |
| | | return "ä¿åæå!"; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | public String distribution(Integer id, Integer userId, Integer instrumentId) { |
| | | InspectionProduct inspectionProduct = new InspectionProduct(); |
| | | inspectionProduct.setId(id); |
| | | //æ§è¡äºº |
| | | inspectionProduct.setUserId(userId); |
| | | inspectionProduct.setInstrumentId(instrumentId); |
| | | inspectionProductMapper.updateById(inspectionProduct); |
| | |
| | | and i.code like concat('%', #{message}, '%') |
| | | or im.name like concat('%', #{message}, '%') |
| | | </if> |
| | | </select> |
| | | |
| | | <!--è®¡ç®æ£éªçæ£éªåæ°é--> |
| | | <select id="seleCountIns" resultType="java.lang.Integer"> |
| | | select count(id) |
| | | from lims_laboratory.inspection |
| | | where state = 1 |
| | | and inspection_status in (0, 1) |
| | | </select> |
| | | |
| | | <!--è®¡ç®æªæ£éªçæ£éªåæ°é--> |
| | | <select id="seleCountUnIns" resultType="java.lang.Integer"> |
| | | select count(id) |
| | | from lims_laboratory.inspection |
| | | where state = 1 |
| | | and inspection_status is null |
| | | </select> |
| | | </mapper> |
| | |
| | | set state=0 |
| | | where inspection_material_id=#{id} |
| | | </update> |
| | | |
| | | <!--计ç®å·²æ£éªé¡¹ç®æ°é--> |
| | | <select id="seleCountInspro" resultType="java.lang.Integer"> |
| | | select count(id) |
| | | from lims_laboratory.inspection_product |
| | | where state = 1 |
| | | and test_state in (0, 1) |
| | | </select> |
| | | |
| | | <!--è®¡ç®æªæ£éªé¡¹ç®æ°é--> |
| | | <select id="seleCountUnInspro" resultType="java.lang.Integer"> |
| | | select count(id) |
| | | from lims_laboratory.inspection_product |
| | | where state = 1 |
| | | and test_state is null |
| | | </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="com.yuanchu.limslaboratory.mapper.NonConformingFeedbackMapper"> |
| | | |
| | | <select id="selectNonConformingFeedback" resultType="nonConformingFeedback" parameterType="com.yuanchu.limslaboratory.pojo.Dto.NonConformingFeedbackDto"> |
| | | SELECT |
| | | <select id="selectNonConformingFeedback" resultType="nonConformingFeedback" |
| | | parameterType="com.yuanchu.limslaboratory.pojo.Dto.NonConformingFeedbackDto"> |
| | | SELECT im.id, |
| | | im.`code` materialCode, |
| | | im.`name` materialName, |
| | | i.`code` inspectionCode, |
| | | i.create_time createTime, |
| | | u.`name` testManager, |
| | | im.specifications specifications |
| | | im.specifications specifications, |
| | | inspection_status result |
| | | FROM |
| | | inspection i, |
| | | inspection_material im, |
| | | `user` u |
| | | lims_laboratory.inspection i, |
| | | lims_laboratory.inspection_material im, |
| | | lims_laboratory.`user` u |
| | | WHERE |
| | | 1 = 1 |
| | | AND i.id = im.inspection_id |
| | | i.id = im.inspection_id |
| | | AND i.user_id = u.id |
| | | <if test="nonConformingFeedbackDto.materialCode!=null and nonConformingFeedbackDto.materialCode!=''"> |
| | | and im.`code` like concat("%",#{nonConformingFeedbackDto.materialCode},"%") |
| | | and im.`code` like concat('%',#{nonConformingFeedbackDto.materialCode},'%') |
| | | </if> |
| | | <if test="nonConformingFeedbackDto.materialName!=null and nonConformingFeedbackDto.materialName!=''"> |
| | | and im.`name` like concat("%",#{nonConformingFeedbackDto.materialName},"%") |
| | | and im.`name` like concat('%',#{nonConformingFeedbackDto.materialName},'%') |
| | | </if> |
| | | <if test="nonConformingFeedbackDto.inspectionCode!=null and nonConformingFeedbackDto.inspectionCode!=''"> |
| | | and im.specifications like concat("%",#{nonConformingFeedbackDto.inspectionCode},"%") |
| | | and im.specifications like concat('%',#{nonConformingFeedbackDto.inspectionCode},'%') |
| | | </if> |
| | | and i.state=1 |
| | | and im.state=1 |
| | | and i.inspection_status =0 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <resultMap id="selectAllPlanMap" type="map"> |
| | | <id property="code" column="code"/> |
| | | <result property="id" column="id"/> |
| | | <result property="samplename" column="samplename"/> |
| | | <result property="inspectionStatus" column="inspectionStatus"/> |
| | | <result property="startTime" column="startTime"/> |
| | | <result property="endTime" column="endTime"/> |
| | | <collection property="father" resultMap="selectAllPlanMapTowMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="selectAllPlanMapTowMap" type="map"> |
| | | <id property="samplename" column="samplename"/> |
| | | <collection property="chldren" resultMap="selectAllPlanMapTowsMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="selectAllPlanMapTowsMap" type="map"> |
| | |
| | | // å级æ |
| | | List<Map<String, Object>> FourTree(String specificationsName); |
| | | |
| | | //éæ©æ ·ååç§° |
| | | List<String> selectmater(); |
| | | |
| | | |
| | | |
| | | |
| | |
| | | //æ·»å æ å-->鿩项ç®åç» |
| | | List<String> selectfather(); |
| | | |
| | | |
| | | |
| | | |
| | | //æ¥è¯¢é¡¹ç®æ¨¡çæ ¹æ®æ ·åå |
| | | List<Map<String, Object>> seleMode(String name); |
| | | |
| | | //éæ©æ ·ååç§° |
| | | List<String> selectmater(); |
| | | } |
| | | |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Integer addMaterialInformation(AddMaterialDto addMaterialDto) { |
| | | Material material = materialMapper.selectOne(Wrappers.<Material>query().eq("name", addMaterialDto.getMaterialName())); |
| | | material.setType(addMaterialDto.getType()); |
| | | int isInsertSuccess = materialMapper.updateById(material); |
| | | Material material = new Material() |
| | | .setCode("BZ" + IdWorker.getIdStr()) |
| | | .setName(addMaterialDto.getMaterialName()) |
| | | .setType(addMaterialDto.getType()); |
| | | int isInsertSuccess = materialMapper.insert(material); |
| | | if (isInsertSuccess > 0) { |
| | | Standard standard = new Standard() |
| | | .setMaterialId(material.getId()) |
| | |
| | | //æ·»å ææ -->éæ©æ ·ååç§° |
| | | @Override |
| | | public List<String> selectmater() { |
| | | return materialMapper.selectmater(); |
| | | return productModelMapper.selectmater(); |
| | | } |
| | | |
| | | |
| | |
| | | @Resource |
| | | ProductModelMapper productModelMapper; |
| | | |
| | | @Resource |
| | | MaterialMapper materialMapper; |
| | | |
| | | //éæ©æ ·å |
| | | @Override |
| | | public List<String> selectmater() { |
| | | return materialMapper.selectmater(); |
| | | return productModelMapper.selectmater(); |
| | | } |
| | | |
| | | //æ·»å æ å-->鿩项ç®åç» |
| | |
| | | BeanUtils.copyProperties(productModelDto, productModel); |
| | | productModelMapper.insert(productModel); |
| | | } |
| | | //æ·»å ç©æäº§ååº |
| | | Material material = new Material(); |
| | | material.setName(productModelDto.getMaterial()).setCode(MyUtil.getTimeSixNumberCode("CP", "CP")); |
| | | materialMapper.insert(material); |
| | | } |
| | | |
| | | //æ¥è¯¢æ 忍¡çå表 |
| | |
| | | p.`specifications_id` |
| | | WHERE m.`state` = 1 |
| | | </select> |
| | | <!--æ·»å æ åéæ©æ ·ååç§°--> |
| | | <select id="selectmater" resultType="java.lang.String"> |
| | | select name |
| | | from lims_laboratory.material |
| | | where state = 1 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | from lims_laboratory.product_model |
| | | where state = 1 |
| | | and material =#{name} |
| | | </select> |
| | | |
| | | <!--æ·»å æ åéæ©æ ·ååç§°--> |
| | | <select id="selectmater" resultType="java.lang.String"> |
| | | select material |
| | | from lims_laboratory.product_model |
| | | where state = 1 |
| | | </select> |
| | | </mapper> |
| | |
| | | <select id="selectUser" resultType="Map"> |
| | | select id, name |
| | | from lims_laboratory.user |
| | | where job_state!=0 |
| | | </select> |
| | | </mapper> |