Merge remote-tracking branch 'origin/master'
# Conflicts:
# framework/src/main/java/com/yuanchu/limslaboratory/utils/HttpUtils.java
| | |
| | | public Result chooseVer(String name, String mcode, String specifications) { |
| | | return Result.success(inspectionService.chooseVer(name, mcode, specifications)); |
| | | } |
| | | @ApiOperation(value = "æ°å¢æ£éªå-->éæ©æ£éªé¡¹ç®çæ¬-->æ¥çè¯¥çæ¬ä¸æä»¬è¦åç项ç®è¦æ±") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "name", value = "产ååç§°", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "mcode", value = "产åç¼å·", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "specifications", value = "è§æ ¼åå·", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "version", value = "çæ¬(é»è®¤ææ°çæ¬)", dataTypeClass = Integer.class,required = true ), |
| | | @ApiImplicitParam(name = "experiment", value = "è¯éªé¡¹ç®(å§æä¸å±)", dataTypeClass = String.class ) |
| | | }) |
| | | @GetMapping("/lookProByVer") |
| | | public Result lookProByVer(String name, String mcode, String specifications,Integer version,String experiment) { |
| | | return Result.success(inspectionService.lookProByVer(name, mcode, specifications,version,experiment)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "æ°å¢æ£éªå") |
| | |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯ä¸é¡µæ°é", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "materialCoding", value = "ææç¼ç ", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "materialName", value = "ææåç§°", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "condition", value = "ç¶æ", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "type", value = "ç¶æ", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "createTime", value = "æ¥ææ¥æ", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectAll") |
| | | public Result<?> selectRawMaterial(Integer pageSize, Integer pageNo, String materialCoding, String materialName, Integer condition, String createTime) { |
| | | IPage<RawMaterial> iPage = rawMaterialService.selectRawMaterial(materialCoding, materialName, condition, createTime, new Page<Objects>(pageNo, pageSize)); |
| | | public Result<?> selectRawMaterial(Integer pageSize, Integer pageNo, String materialCoding, String materialName, Integer type, String createTime) { |
| | | IPage<RawMaterial> iPage = rawMaterialService.selectRawMaterial(materialCoding, materialName, type, createTime, new Page<Objects>(pageNo, pageSize)); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("row", iPage.getRecords()); |
| | | map.put("total", iPage.getTotal()); |
| | |
| | | */ |
| | | public interface RawMaterialMapper extends BaseMapper<RawMaterial> { |
| | | |
| | | IPage<RawMaterial> selectRawMaterial(String materialCoding, String materialName, Integer condition, String createTime, Page<Objects> page); |
| | | IPage<RawMaterial> selectRawMaterial(String materialCoding, String materialName, Integer type, String createTime, Page<Objects> page); |
| | | |
| | | |
| | | List<RawMaterial> selectRawmaAll(); |
| | | List<Map<String, Object>> selectRawmaAll(); |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="RawMaterial对象", description="") |
| | | @ApiModel(value = "RawMaterial对象", description = "") |
| | | public class RawMaterial implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | |
| | | @ApiModelProperty(value = "æ¥æ£æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDateTime inspectionDate; |
| | | private Date inspectionDate; |
| | | |
| | | @ApiModelProperty(value = "æ£éªäºº") |
| | | private String surveyor; |
| | | |
| | | @ApiModelProperty(value = "æ£éªæ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDateTime dateSurvey; |
| | | private Date dateSurvey; |
| | | |
| | | @ApiModelProperty(value = "ç¶æ0:å¾
æ£æµ;1:å·²æ£æµ") |
| | | private Integer condition; |
| | | private Integer type; |
| | | |
| | | // @TableLogic(value = "1", delval = "0") |
| | | // @TableLogic(value = "1", delval = "0") |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | @ApiModelProperty(value = "ä¹è§é", hidden = true) |
| | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | //æ°å¢æ£éªå |
| | | @Data |
| | | public class InspectionVo implements Serializable { |
| | | |
| | | //妿æ¯åææåidæ¯éæ©åæææ¥æ£åºä¸çid;妿æ¯å§æåidæ¯éæ©å§ææ¥æ£åºä¸å§ææ ·åçid |
| | | @JsonSerialize |
| | | private Integer id; |
| | | |
| | | /** |
| | | *æ£éªç±»å 0ï¼åææï¼1ï¼äº§åï¼2ï¼åæåï¼ |
| | | * æ£éªç±»å 0ï¼åææï¼1ï¼äº§åï¼2ï¼åæåï¼ |
| | | **/ |
| | | @JsonSerialize |
| | | @NotNull(message = "æ£éªç±»åä¸è½ä¸ºç©º") |
| | |
| | | **/ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @NotBlank(message = "æ¥ææ¥æä¸è½ä¸ºç©º") |
| | | @NotNull(message = "æ¥ææ¥æä¸è½ä¸ºç©º") |
| | | private Date formTime; |
| | | |
| | | /** |
| | |
| | | **/ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @NotBlank(message = "æ£éªå¼å§æ¶é´ä¸è½ä¸ºç©º") |
| | | @NotNull(message = "æ£éªå¼å§æ¶é´ä¸è½ä¸ºç©º") |
| | | private Date startTime; |
| | | |
| | | /** |
| | |
| | | **/ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @NotBlank(message = "æ£éªç»ææ¶é´ä¸è½ä¸ºç©º") |
| | | @NotNull(message = "æ£éªç»ææ¶é´ä¸è½ä¸ºç©º") |
| | | private Date endTime; |
| | | |
| | | //è¯éªé¡¹ç® |
| | | @NotBlank(message = "è¯éªé¡¹ç®ä¸è½ä¸ºç©º") |
| | | //è¯éªé¡¹ç®(å§æä¸å±) |
| | | @JsonSerialize |
| | | private String experiment; |
| | | |
| | | //çæ¬(å§æä¸å±) |
| | | @JsonSerialize |
| | | @NotNull(message = "æ£éªé¡¹ç®çæ¬ä¸è½ä¸ºç©º") |
| | | private Integer version; |
| | | } |
| | |
| | | IPage<Map<String, Object>> selectInspectsList(Page<Object> page, String message); |
| | | |
| | | /** |
| | | * æ°å¢æ£éªå-->éæ©æ£éªé¡¹ç®çæ¬ |
| | | * @param name |
| | | * @param mcode |
| | | * @param specifications |
| | | * @return |
| | | */ |
| | | List<Integer> chooseVer(String name, String mcode, String specifications); |
| | | |
| | | /** |
| | | * æ°å¢æ£éªå-->éæ©æ£éªé¡¹ç®çæ¬-->æ¥çè¯¥çæ¬ä¸æä»¬è¦åç项ç®è¦æ± |
| | | * @param name |
| | | * @param mcode |
| | | * @param specifications |
| | | * @param version |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> lookProByVer(String name, String mcode, String specifications, Integer version,String experiment); |
| | | |
| | | /** |
| | | * æ°å¢æ£éªç³è¯·è¡¨ |
| | | * @param id |
| | | * @param |
| | |
| | | */ |
| | | String chooseUseProId(Integer id, Integer userProId); |
| | | |
| | | /** |
| | | * æ°å¢æ£éªå-->éæ©æ£éªé¡¹ç®çæ¬ |
| | | * @param name |
| | | * @param mcode |
| | | * @param specifications |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> chooseVer(String name, String mcode, String specifications); |
| | | |
| | | } |
| | | |
| | |
| | | */ |
| | | public interface RawMaterialService extends IService<RawMaterial> { |
| | | |
| | | IPage<RawMaterial> selectRawMaterial(String materialCoding, String materialName, Integer condition, String createTime, Page<Objects> page); |
| | | IPage<RawMaterial> selectRawMaterial(String materialCoding, String materialName, Integer type, String createTime, Page<Objects> page); |
| | | |
| | | /** |
| | | * æ¥è¯¢åæææ£éª |
| | | * |
| | | * @return |
| | | */ |
| | | List<RawMaterial> selectRawmaAll(); |
| | | List<Map<String, Object>> selectRawmaAll(); |
| | | |
| | | |
| | | } |
| | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | @Resource |
| | | RawMaterialMapper rawMaterialMapper; |
| | | |
| | | @Resource |
| | | LinkDetectionMapper linkDetectionMapper; |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢æ£éªç³è¯·åå表 |
| | |
| | | return inspectionMapper.selectInspectsList(page, message); |
| | | } |
| | | |
| | | //æ°å¢æ£éªå-->éæ©æ£éªé¡¹ç®çæ¬ |
| | | @Override |
| | | public List<Integer> chooseVer(String name, String mcode, String specifications) { |
| | | Integer specificationId = getSpecificationId(name, mcode, specifications); |
| | | return productMapper.chooseVersion(specificationId); |
| | | } |
| | | |
| | | //æ°å¢æ£éªå-->éæ©æ£éªé¡¹ç®çæ¬-->æ¥çè¯¥çæ¬ä¸æä»¬è¦åç项ç®è¦æ± |
| | | @Override |
| | | public List<Map<String, Object>> lookProByVer(String name, String mcode, String specifications, Integer version, String experiment) { |
| | | Integer specificationId = getSpecificationId(name, mcode, specifications); |
| | | /*妿è¯éªé¡¹ç®ä¸ºç©ºåæ¯æåæ£éªæè
åæææ£éªåæ¯å±ç¤ºè¯¥çæ¬çææé¡¹ç®æ£éªè¦æ±åæ°*/ |
| | | if (ObjectUtils.isEmpty(experiment)) { |
| | | return productMapper.pageProductInformation(specificationId, version); |
| | | } |
| | | /*妿ä¸ä¸ºç©ºåæ¯å§ææ£éª,åªå±ç¤ºæä»¬è¦æ£éªç项ç®è¦æ±åæ°*/ |
| | | //è·åè¯éªé¡¹ç®ä¿¡æ¯(ç»æ,导线å¤å¾) |
| | | List<String> experiments = Arrays.stream(experiment.split(",")).collect(Collectors.toList()); |
| | | //æ ¹æ®åå·idå项ç®ä¿¡æ¯æ¥è¯¢é¡¹ç®ä¿¡æ¯ |
| | | List<Map<String, Object>> products = new ArrayList<>(); |
| | | for (String exper : experiments) { |
| | | List<Map<String, Object>> list = productMapper.selFath(specificationId, exper, version); |
| | | if (ObjectUtils.isEmpty(list)) { |
| | | Map<String, Object> project = productMapper.selNam(specificationId, exper, version); |
| | | products.add(project); |
| | | } |
| | | products.addAll(list); |
| | | } |
| | | return products; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æ£éªç³è¯·è¡¨ |
| | | * |
| | | * @param id |
| | | * @param id ç¨æ·id |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | .userId(id) |
| | | .build(); |
| | | inspectionMapper.insert(inspection); |
| | | /*妿æ¯åæææ£éª,æ°å¢ä¹åè¦æ´æ¹åæææ¥æ£çç¶æåæ£éªäºº,æ£éªæ¥æ*/ |
| | | if (inspectionVo.getType()==0) { |
| | | RawMaterial rawMaterial = new RawMaterial(); |
| | | rawMaterial.setId(inspectionVo.getId()); |
| | | rawMaterial.setType(1); |
| | | rawMaterial.setSurveyor(userMapper.selectById(id).getName()); |
| | | rawMaterialMapper.updateById(rawMaterial); |
| | | } |
| | | /*妿æ¯å§ææ£éª,æ°å¢ä¹åè¦æ´æ¹å§ææ¥æ£çç¶æ*/ |
| | | else if (inspectionVo.getType()==2){ |
| | | LinkDetection linkDetection = new LinkDetection(); |
| | | linkDetection.setId(inspectionVo.getId()); |
| | | linkDetection.setInspectionStatus(2); |
| | | linkDetectionMapper.updateById(linkDetection); |
| | | } |
| | | /*æ°å¢æ£éªæ ·å表*/ |
| | | InspectionMaterial inspectionMaterial = InspectionMaterial.builder() |
| | | .code(inspectionVo.getMcode()) |
| | |
| | | /*æ°å¢æ£éªé¡¹ç®è¡¨*/ |
| | | //æ ¹æ®æ ·ååç§°ç¼å·ä»¥ååå·è§æ ¼è·ååå·id |
| | | Integer specificationId = getSpecificationId(inspectionVo.getName(), inspectionVo.getMcode(), inspectionVo.getSpecifications()); |
| | | //妿è¯éªé¡¹ç®å段ä¸ä¸ºç©º |
| | | //妿è¯éªé¡¹ç®å段ä¸ä¸ºç©ºåæè¯¥å段ç项ç®è¿è¡å¹é
|
| | | if (ObjectUtils.isNotEmpty(inspectionVo.getExperiment())) { |
| | | //è·åè¯éªé¡¹ç®ä¿¡æ¯(ç»æ,导线å¤å¾) |
| | | List<String> experiments = Arrays.stream(inspectionVo.getExperiment().split(",")).collect(Collectors.toList()); |
| | |
| | | for (String experiment : experiments) { |
| | | List<Product> productList1 = productMapper.selectList(Wrappers.<Product>query() |
| | | .eq("specifications_id", specificationId) |
| | | .eq("father", experiment)); |
| | | .eq("father", experiment) |
| | | .eq("version", inspectionVo.getVersion())); |
| | | if (ObjectUtils.isEmpty(productList1)) { |
| | | Product product = productMapper.selectOne(Wrappers.<Product>query() |
| | | .eq("specifications_id", specificationId) |
| | | .isNull("father") |
| | | .eq("name", experiment)); |
| | | .eq("name", experiment) |
| | | .eq("version", inspectionVo.getVersion())); |
| | | products.add(product); |
| | | } else products.addAll(productList1); |
| | | } |
| | | |
| | | //å°æ¥è¯¢ç项ç®ä¿¡æ¯æå»ºææ£éªé¡¹ç® |
| | | ArrayList<InspectionProduct> list = new ArrayList<>(); |
| | | for (Product product : products) { |
| | |
| | | .build(); |
| | | list.add(rawInsProduct); |
| | | } |
| | | |
| | | //æ£éªé¡¹ç®æ¹éæ·»å |
| | | inspectionProductService.saveBatch(list); |
| | | return inspection.getId(); |
| | | } |
| | | //todo:æªå® |
| | | return null; |
| | | //妿è¯éªé¡¹ç®ä¸ºç©ºåæç
§åå·id卿 ååºéé¢å
¨é¨å¹é
|
| | | List<Product> productList = productMapper.selectList(Wrappers.<Product>query().eq("specifications_id", specificationId)); |
| | | //å°æ¥è¯¢ç项ç®ä¿¡æ¯æå»ºææ£éªé¡¹ç® |
| | | ArrayList<InspectionProduct> list = new ArrayList<>(); |
| | | for (Product product : productList) { |
| | | InspectionProduct rawInsProduct = InspectionProduct.builder() |
| | | .name(product.getName()) |
| | | .unit(product.getUnit()) |
| | | .required(product.getRequired()) |
| | | .internal(product.getInternal()) |
| | | .inspectionMaterialId(inspectionMaterial.getId()) |
| | | .build(); |
| | | list.add(rawInsProduct); |
| | | } |
| | | //æ£éªé¡¹ç®æ¹éæ·»å |
| | | inspectionProductService.saveBatch(list); |
| | | return inspection.getId(); |
| | | } |
| | | |
| | | //æ ¹æ®æ£éªåidæ¥è¯¢åæææ£éªå详æ
|
| | |
| | | inspectionProductMapper.updateById(inspectionProduct); |
| | | return "ä¿åæå!"; |
| | | } |
| | | |
| | | |
| | | //æ°å¢æ£éªå-->éæ©æ£éªé¡¹ç®çæ¬ |
| | | @Override |
| | | public List<Map<String, Object>> chooseVer(String name, String mcode, String specifications) { |
| | | Integer specificationId = getSpecificationId(name, mcode, specifications); |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /*æ ¹æ®æ ·ååç§°,æ ·åç¼å·,åå·è§æ ¼è·ååå·id*/ |
| | | private Integer getSpecificationId(String name, String mcode, String specification) { |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yuanchu.limslaboratory.mapper.*; |
| | | import com.yuanchu.limslaboratory.pojo.*; |
| | | import com.yuanchu.limslaboratory.service.PlanService; |
| | |
| | | |
| | | @Resource |
| | | InspectionMapper inspectionMapper; |
| | | |
| | | @Resource |
| | | InspectionMaterialMapper inspectionMaterialMapper; |
| | | |
| | | @Resource |
| | | LinkDetectionMapper linkDetectionMapper; |
| | | |
| | | //æ¥è¯¢æ£éªè®¡å |
| | | @Override |
| | |
| | | Inspection inspection = new Inspection(); |
| | | inspection.setId(id); |
| | | inspection.setInspectionStatus(0); |
| | | //æ´æ°æ£éªå |
| | | inspectionMapper.updateById(inspection); |
| | | } else if (count == results.size()) { |
| | | Inspection inspection = new Inspection(); |
| | |
| | | report.setStatus(0); |
| | | report.setConclusion(conclusion); |
| | | report.setInspectionId(id); |
| | | //æ°å¢æ£éªæ¥å |
| | | reportMapper.insert(report); |
| | | return "䏿¥æå!"; |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<RawMaterial> selectRawMaterial(String materialCoding, String materialName, Integer condition, String createTime, Page<Objects> page) { |
| | | return rawMaterialMapper.selectRawMaterial(materialCoding, materialName, condition, createTime, page); |
| | | public IPage<RawMaterial> selectRawMaterial(String materialCoding, String materialName, Integer type, String createTime, Page<Objects> page) { |
| | | return rawMaterialMapper.selectRawMaterial(materialCoding, materialName, type, createTime, page); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<RawMaterial> selectRawmaAll() { |
| | | public List<Map<String, Object>> selectRawmaAll() { |
| | | return rawMaterialMapper.selectRawmaAll(); |
| | | } |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="selectLinkAll" resultType="java.util.Map"> |
| | | SELECT DATE_FORMAT(l.`inspection_time`, '%Y-%m-%d') formTime, |
| | | SELECT d.id , |
| | | DATE_FORMAT(l.`inspection_time`, '%Y-%m-%d') formTime, |
| | | l.`entrusted` supplier, |
| | | d.`sample_number` mcode, |
| | | d.`sample_name` name, |
| | |
| | | lims_laboratory.link_detection d |
| | | WHERE l.`id` = d.`link_basic_id` |
| | | AND l.`state` = 1 |
| | | and inspection_status = 1 |
| | | </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.RawMaterialMapper"> |
| | | |
| | | <select id="selectRawMaterial" resultType="com.yuanchu.limslaboratory.pojo.RawMaterial"> |
| | | SELECT * |
| | | FROM raw_material r |
| | |
| | | <if test="materialName != null and materialName != ''"> |
| | | AND r.`material_name` LIKE CONCAT('%',#{materialName},'%') |
| | | </if> |
| | | <if test="condition != null and condition != ''"> |
| | | AND r.`condition` = #{condition} |
| | | <if test="type != null and type != ''"> |
| | | AND r.`type` = #{type} |
| | | </if> |
| | | <if test="createTime != null and createTime != ''"> |
| | | AND DATE_FORMAT(r.`create_time`,'%Y-%m-%d') = #{createTime} |
| | | </if> |
| | | </select> |
| | | <select id="selectRawmaAll" resultType="com.yuanchu.limslaboratory.pojo.RawMaterial"> |
| | | select * from lims_laboratory.raw_material where state=1 |
| | | <select id="selectRawmaAll" resultType="java.util.Map"> |
| | | select id, |
| | | supplier_name supplier, |
| | | material_coding mcode, |
| | | material_name name, |
| | | specifications_models specifications, |
| | | unit, |
| | | quantity num, |
| | | DATE_FORMAT(inspection_date, '%Y-%m-%d') startTime, |
| | | DATE_FORMAT(date_survey, '%Y-%m-%d') endTime, |
| | | DATE_FORMAT(create_time, '%Y-%m-%d') formTime |
| | | from lims_laboratory.raw_material |
| | | where state = 1 |
| | | and type = 0 |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ å项ç®ID", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "required", value = "æ åå¼", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "internal", value = "å
æ§å¼", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "internal", value = "å
æ§å¼", dataTypeClass = String.class, required = true) |
| | | |
| | | }) |
| | |
| | | |
| | | //æ¥è¯¢è¯¥åå·ä¸çææè¯éªé¡¹ç®(ç¶ç±») |
| | | List<Map<String,Object>> chooseProject(Integer modelId); |
| | | |
| | | //æ ¹æ®é¡¹ç®ç¶ç±»,åå·id,çæ¬æ¥è¯¢äºçº§è¯¦æ
|
| | | List<Map<String, Object>> selFath(Integer specificationId, String exper, Integer version); |
| | | |
| | | //æ ¹æ®é¡¹ç®ç¶ç±»ä¸ºç©º,项ç®å,åå·id,çæ¬æ¥è¯¢ |
| | | Map<String, Object> selNam(Integer specificationId, String exper, Integer version); |
| | | } |
| | |
| | | public Integer addVersion(Integer specificationsId) { |
| | | List<Product> productList = productMapper.selectList(Wrappers.<Product>query().eq("specifications_id", specificationsId)); |
| | | for (Product product : productList) { |
| | | product.setId(null); |
| | | product.setVersion(product.getVersion()+1); |
| | | product.setSpecifications_id(specificationsId); |
| | | } |
| | | saveBatch(productList); |
| | | return productList.get(0).getVersion(); |
| | |
| | | from lims_laboratory.product |
| | | where state = 1 |
| | | and specifications_id = #{specificationsId} |
| | | ORDER BY product.`create_time` DESC |
| | | and version = #{version} |
| | | ORDER BY product.`create_time` DESC |
| | | </select> |
| | | |
| | | <select id="deleteList"> |
| | |
| | | where state = 1 |
| | | and specifications_id = #{modelId} |
| | | </select> |
| | | |
| | | <!--æ ¹æ®é¡¹ç®ç¶ç±»,åå·id,çæ¬æ¥è¯¢äºçº§è¯¦æ
--> |
| | | <select id="selFath" resultMap="pageProductInformationMap"> |
| | | select id, |
| | | name, |
| | | father, |
| | | unit, |
| | | required, |
| | | internal, |
| | | version |
| | | from lims_laboratory.product |
| | | where state = 1 |
| | | and specifications_id = #{specificationId} |
| | | and version = #{version} |
| | | and father = #{exper} |
| | | </select> |
| | | |
| | | <!--æ ¹æ®é¡¹ç®ç¶ç±»ä¸ºç©º,项ç®å,åå·id,çæ¬æ¥è¯¢--> |
| | | <select id="selNam" resultType="java.util.Map"> |
| | | select id, |
| | | name, |
| | | unit, |
| | | required, |
| | | internal, |
| | | version |
| | | from lims_laboratory.product |
| | | where state = 1 |
| | | and specifications_id = #{specificationId} |
| | | and version = #{version} |
| | | and name = #{exper} |
| | | and father is null |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.clients.UserLoginUtils; |
| | | import com.yuanchu.limslaboratory.pojo.User; |
| | | import com.yuanchu.limslaboratory.service.RoleManagerService; |
| | | import com.yuanchu.limslaboratory.service.UserService; |
| | | import com.yuanchu.limslaboratory.shiro.realm.ShiroRealm; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | @Autowired |
| | | private RoleManagerService roleManagerService; |
| | | |
| | | @ApiOperation("ç¨æ·ç»å½") |
| | | @ApiImplicitParams(value = { |
| | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("æ°å¢ç¨æ·è·åè§è²æéä¿¡æ¯") |
| | | @GetMapping("/list") |
| | | public Result<?> getUserListRole(){ |
| | | List<Map<String,Object>> data = roleManagerService.getUserListRole(); |
| | | return Result.success(data); |
| | | } |
| | | |
| | | @ApiOperation("ç»å½-->è·åç¨æ·ä¿¡æ¯") |
| | | @GetMapping("/info") |
| | | public Result<?> getUserInfo(@RequestHeader("X-Token") String token){ |
| | |
| | | int deleteRoleMenuByRoleId(Long id); |
| | | |
| | | RoleAndMenuDto selectAllRoleAndMenuByRoleId(Long roleId); |
| | | |
| | | List<Map<String, Object>> getUserListRole(); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private String account; |
| | | |
| | | @ApiModelProperty(value = "0ï¼æ æéï¼1ï¼ææé", example = "1", required = true) |
| | | private Integer roleId; |
| | | private Long roleId; |
| | | |
| | | @ApiModelProperty(value = "å¹´é¾", example = "23") |
| | | private Integer age; |
| | |
| | | private String account; |
| | | |
| | | @ApiModelProperty(value = "0ï¼æ æéï¼1ï¼ææé", example = "1", required = true) |
| | | private Long role_id; |
| | | private Long roleId; |
| | | |
| | | @ApiModelProperty(value = "å
³è ä¼ä¸id") |
| | | private Integer enterpriseId; |
| | | |
| | | @ApiModelProperty(value = "å¹´é¾", example = "23") |
| | | private Integer age; |
| | |
| | | @ApiModelProperty(value = "é®ç®±", example = "12345678@qq.com") |
| | | private String email; |
| | | |
| | | @ApiModelProperty(value = "ç»ç»æ¶æId", example = "2") |
| | | private Integer organizationId; |
| | | |
| | | @ApiModelProperty(value = "å¨èç¶æ æ£å¸¸>=1,离è<=0", example = "0") |
| | | private Integer jobState; |
| | | |
| | |
| | | boolean updateRoleMenu(UpdateRoleMenuDto dto); |
| | | |
| | | RoleAndMenuDto getRoleAndMenuByRole(Long roleId); |
| | | |
| | | List<Map<String, Object>> getUserListRole(); |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateRoleMenuDto; |
| | | import com.yuanchu.limslaboratory.service.RoleManagerService; |
| | | import com.yuanchu.limslaboratory.utils.JsonUtil; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | return roleManageMapper.selectAllRoleAndMenuByRoleId(roleId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getUserListRole() { |
| | | return roleManageMapper.getUserListRole(); |
| | | } |
| | | |
| | | |
| | | private List<Menu> getEnumChildren(Menu root, List<Menu> all) { |
| | | return all.stream() |
| | |
| | | |
| | | @Override |
| | | public Integer updateNewPersonnel(UpdatePersonnelVo updatePersonnelVo) { |
| | | User user = new User() |
| | | .setName(updatePersonnelVo.getName()) |
| | | .setAccount(updatePersonnelVo.getAccount()) |
| | | .setAge(String.valueOf(updatePersonnelVo.getAge())) |
| | | .setPhone(updatePersonnelVo.getPhone()) |
| | | .setEmail(updatePersonnelVo.getEmail()) |
| | | .setRoleId(updatePersonnelVo.getRole_id()) |
| | | .setPassword(updatePersonnelVo.getPassword()) |
| | | .setJobState(updatePersonnelVo.getJobState()); |
| | | LambdaUpdateWrapper<User> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(User::getId, updatePersonnelVo.getId()); |
| | | return userMapper.update(user, updateWrapper); |
| | | try { |
| | | MyUtil.PrintLog(updatePersonnelVo.toString()); |
| | | User unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(updatePersonnelVo), User.class); |
| | | |
| | | LambdaUpdateWrapper<User> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(User::getId, updatePersonnelVo.getId()); |
| | | return userMapper.update(unmarshal, updateWrapper); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> getNewPersonnelPage(String name, Page page, Integer status) { |
| | | MyUtil.PrintLog(name + status + "============="); |
| | | return userMapper.getNewPersonnelPage(name, page, status); |
| | | } |
| | | |
| | |
| | | and r.id=#{roleId} |
| | | </select> |
| | | |
| | | <select id="getUserListRole" resultType="map"> |
| | | SELECT CONCAT(r.`id`, '') id, r.`name` |
| | | FROM role r |
| | | </select> |
| | | <resultMap id="roleAndMenuById" type="com.yuanchu.limslaboratory.pojo.dto.RoleAndMenuDto"> |
| | | <result property="roleName" column="roleName"/> |
| | | <result property="createTime" column="createTime"/> |
| | |
| | | <result property="parentId" column="parentId"/> |
| | | </collection> |
| | | </resultMap> |
| | | </mapper> |
| | | </mapper> |