已修改29个文件
已删除31个文件
已添加15个文件
| | |
| | | <artifactId>laboratory-server</artifactId> |
| | | <version>${project.parent.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | <version>5.8.12</version> |
| | | </dependency> |
| | | </dependencies> |
| | | </project> |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import java.text.ParseException; |
| | | import java.util.*; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionMaterialList; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.service.*; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | import com.yuanchu.limslaboratory.service.LinkBasicInformationService; |
| | | import com.yuanchu.limslaboratory.service.RawMaterialService; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.service.InspectionService; |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * ç³è¯·è¡¨(Inspection)表æ§å¶å± |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-17 |
| | | * @author zss |
| | | * @since 2023-08-03 13:03:36 |
| | | */ |
| | | @Api(tags = "æ£éªæ¨¡å-->æ£éªå") |
| | | @Api(tags = "è¯éªç®¡ç-->æ£éªç³è¯·") |
| | | @RestController |
| | | @RequestMapping("/inspection") |
| | | public class InspectionController { |
| | |
| | | @Autowired |
| | | private InspectionService inspectionService; |
| | | |
| | | @Autowired |
| | | private InspectionMaterialListService inspectionMaterialListService; |
| | | @Resource |
| | | RawMaterialService rawMaterialService; |
| | | |
| | | @Autowired |
| | | private InspectionProductListService inspectionProductListService; |
| | | @Resource |
| | | LinkBasicInformationService linkBasicInformationService; |
| | | |
| | | @Autowired |
| | | private MaterialService materialService; |
| | | |
| | | @ApiOperation("æ·»å æ£éªç³è¯·å") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "type", value = "æ£éªç±»å", dataTypeClass = Integer.class, required = true), |
| | | }) |
| | | @PostMapping("/addInspection") |
| | | public Result addInspection(@RequestHeader("X-Token") String token, int type) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | return Result.success(inspectionService.addInspection("" + unmarshal.get("name"), type)); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢æææ£éªåå表") |
| | | @ApiOperation(value = "æ¥è¯¢æ£éªç³è¯·åå表") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize", value = "页æ°", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "countSize", value = "æ¡æ°/页", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "state", value = "ç¶æ(为空=å
¨é¨)", dataTypeClass = Integer.class) |
| | | @ApiImplicitParam(name = "message", value = "ç³è¯·åå·/åææåç§°", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectAllInspection") |
| | | public Result selectAllInspection(int pageSize, int countSize, Integer state) { |
| | | return Result.success(inspectionService.selectAllInspection(pageSize, countSize, state)); |
| | | @GetMapping("/selectInspectsList") |
| | | public Result selectInspectsList(int pageSize, int countSize, String message) { |
| | | IPage<Map<String, Object>> inspectionPage = inspectionService.selectInspectsList(new Page<Object>(pageSize, countSize), message); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", inspectionPage.getTotal()); |
| | | map.put("row", inspectionPage.getRecords()); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢æ£éªåéé¢çæ ·åä¿¡æ¯") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "inspectionId", value = "æ¥æ£åID", dataTypeClass = String.class, required = true), |
| | | }) |
| | | @PostMapping("/selectMaterialByInsId") |
| | | public Result selectMaterialByInsId(String inspectionId) { |
| | | return Result.success(inspectionMaterialListService.selectInspectionMaterialListByInsId(inspectionId)); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢ç©æä¿¡æ¯") |
| | | @ApiOperation(value = "æ¥è¯¢æææ¥æ£") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize", value = "页æ°", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "countSize", value = "æ¡æ°/页", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selectMaterialLimit") |
| | | public Result selectMaterialLimit(int pageSize, int countSize, int type) { |
| | | return Result.success(materialService.selectMaterialLimit(pageSize, countSize, type)); |
| | | @GetMapping("/selectAll") |
| | | public Result selectAll(Integer type) { |
| | | switch (type) { |
| | | case 0 : |
| | | //åææ |
| | | return Result.success(rawMaterialService.selectRawmaAll()); |
| | | case 1 : |
| | | //å§æå |
| | | return Result.success(linkBasicInformationService.selectLinkAll()); |
| | | case 2 : |
| | | //æåæ£éª |
| | | return Result.success("请è¾å
¥æ£éªä¿¡æ¯!"); |
| | | } |
| | | return Result.fail("ç±»åé误!"); |
| | | } |
| | | |
| | | @ApiOperation("éæ©ç©æä¿¡æ¯") |
| | | |
| | | @ApiOperation(value = "éæ©åæææ¥æ£") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "materialId", value = "ç©æID", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "id", value = "åæææ¥æ£åid", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "startTime", value = "æ£éªå¼å§æ¥æ", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "endTime", value = "æ£éªç»ææ¥æ", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @PostMapping("/selectMaterialById") |
| | | public Result selectMaterialById(String materialId) { |
| | | return Result.success(materialService.selectMaterialById(materialId)); |
| | | @GetMapping("/selectRawmaById") |
| | | public Result selectRawmaById(Integer id, String startTime, String endTime) throws ParseException { |
| | | return Result.success(rawMaterialService.selectRawmaById(id,startTime,endTime)); |
| | | } |
| | | |
| | | @ApiOperation("æäº¤æ£éªåç³è¯·") |
| | | |
| | | @ApiOperation(value = "éæ©å§ææ¥æ£åæ ·å") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "inspectionId", value = "æ£éªåID", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "bid", value = "å§ææ¥æ£åid", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "did", value = "å§ææ¥æ£æ ·åid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/submitInspection") |
| | | public Result submitInspection(String inspectionId) { |
| | | inspectionService.subInspectionByInsId(inspectionId); |
| | | return Result.success(); |
| | | @GetMapping("/selectLinkByid") |
| | | public Result selectLinkByid(Integer bid, Integer did) { |
| | | return Result.success(linkBasicInformationService.selectLinkByid(bid, did)); |
| | | } |
| | | |
| | | @ApiOperation("ä½åºæ£éªåç³è¯·") |
| | | |
| | | @ApiOperation(value = "æ°å¢æ£éªå") |
| | | @PostMapping("/addInspect") |
| | | public Result addInspect(@RequestHeader("token") String token, @RequestBody InspectionVo inspectionVo) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | return Result.success(inspectionService.addInspect((Integer) unmarshal.get("id"), inspectionVo)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ ¹æ®æ£éªåidæ¥è¯¢åæææ£éªå详æ
") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "inspectionId", value = "æ£éªåID", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "id", value = "æ£éªåid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delInspection") |
| | | public Result delInspection(String inspectionId) { |
| | | inspectionService.delInspectionByInsId(inspectionId); |
| | | return Result.success(); |
| | | @GetMapping("/selectInspectsListById") |
| | | public Result selectInspectsListById(Integer id) { |
| | | return Result.success(inspectionService.selectInspectsListById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "䏿¥(æ´æ°æ£éªç¶æ)") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªåid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/updateInspectsById") |
| | | public Result updateInspectsById(Integer id) { |
| | | //妿已ç»ä¸æ¥äºä¸è½å䏿¬¡ä¸æ¥ |
| | | Inspection inspection = inspectionService.getById(id); |
| | | if (ObjectUtils.isNotEmpty(inspection.getInspectionStatus())) { |
| | | return Result.fail("å·²ç»ä¸æ¥è¿äº,ä¸è½åæ¬¡ä¸æ¥!"); |
| | | } |
| | | return Result.success(inspectionService.updateInspectsById(id)); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.PageImpl; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.service.InspectionMaterialService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * (æ ·å)æ£éªåéé¢çç©æ(InspectionMaterial)表æ§å¶å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-03 13:04:28 |
| | | */ |
| | | @Api(tags = "(æ ·å)æ£éªåéé¢çç©ææ¥å£") |
| | | @RestController |
| | | @RequestMapping("/inspectionMaterial") |
| | | public class InspectionMaterialController { |
| | | |
| | | @Autowired |
| | | private InspectionMaterialService inspectionMaterialService; |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProduct; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InsProductVo; |
| | | import com.yuanchu.limslaboratory.service.InstrumentService; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | | 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.json.JSONObject; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.PageImpl; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.service.InspectionProductService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * ç³è¯·åä¸ç©æä¸ç项ç®(InspectionProduct)表æ§å¶å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-03 13:04:54 |
| | | */ |
| | | @Api(tags = "è¯éªç®¡ç-->æ£éªç³è¯·-->æ£éªé¡¹ç®") |
| | | @RestController |
| | | @RequestMapping("/inspectionProduct") |
| | | public class InspectionProductController { |
| | | |
| | | @Autowired |
| | | private InspectionProductService inspectionProductService; |
| | | |
| | | @Resource |
| | | InstrumentService instrumentService; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢ææè®¾å¤") |
| | | @GetMapping("/selectInstrument") |
| | | public Result selectInstrument() { |
| | | return Result.success(instrumentService.selectInstrument()); |
| | | } |
| | | |
| | | @ApiOperation("éæ©è®¾å¤ä¿¡æ¯") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "设å¤ID", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selectInstrumentById") |
| | | public Result selectInstrumentById(Integer id) { |
| | | String equipmentName = instrumentService.getById(id).getEquipmentName(); |
| | | return Result.success(equipmentName); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "æ´æ°æ£éªé¡¹ç®") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "testValue", value = "æ£æµå¼", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "required", value = "æ åå¼", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "internal", value = "å
æ§å¼", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "name", value = "项ç®åç§°", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "inspectionMaterialId", value = "å
æ§å¼", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/updateInsProduct") |
| | | public Result updateInsProduct(@RequestHeader("token") String token, @RequestBody InspectionProduct inspectionProduct) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | Integer userId = (Integer) unmarshal.get("id"); |
| | | return Result.success(inspectionProductService.updateInsProduct(userId,inspectionProduct)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-28 |
| | | */ |
| | | @Api(tags = "1ãç©æè¡¨") |
| | | @Api(tags = "æ¥æ£ç®¡ç-->åæææ¥æ£") |
| | | @RestController |
| | | @RequestMapping("/raw-material") |
| | | public class RawMaterialController { |
| | |
| | | @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 = String.class), |
| | | @ApiImplicitParam(name = "condition", value = "ç¶æ", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "createTime", value = "æ¥ææ¥æ", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectAll") |
| | | public Result<?> selectRawMaterial(Integer pageSize, Integer pageNo, String materialCoding, String materialName, String condition, String createTime) { |
| | | 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)); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("row", iPage.getRecords()); |
| | |
| | | package com.yuanchu.limslaboratory.mapper; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionDto; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper æ¥å£ |
| | | * </p> |
| | | * ç³è¯·è¡¨(Inspection)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-17 |
| | | * @author zss |
| | | * @since 2023-08-03 13:03:36 |
| | | */ |
| | | public interface InspectionMapper extends BaseMapper<Inspection> { |
| | | |
| | | //æ¥è¯¢æææ£éªåå表 |
| | | List<InspectionDto> selectAllInspection(int pageSize, int countSize, Integer state); |
| | | |
| | | /** |
| | | * æ¥è¯¢æ£éªç³è¯·åå表 |
| | | * @param page |
| | | * @param message |
| | | * @return |
| | | */ |
| | | IPage<Map<String, Object>> selectInspectsList(Page<Object> page, String message); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionMaterial; |
| | | |
| | | /** |
| | | * (æ ·å)æ£éªåéé¢çç©æ(InspectionMaterial)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-03 13:04:28 |
| | | */ |
| | | public interface InspectionMaterialMapper extends BaseMapper<InspectionMaterial> { |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProduct; |
| | | |
| | | /** |
| | | * ç³è¯·åä¸ç©æä¸ç项ç®(InspectionProduct)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-03 13:04:54 |
| | | */ |
| | | public interface InspectionProductMapper extends BaseMapper<InspectionProduct> { |
| | | |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.LinkBasicInformation; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | public interface LinkBasicInformationMapper extends BaseMapper<LinkBasicInformation> { |
| | | |
| | | IPage<Map<String, Object>> getLinkBasicPage(Page<Object> page, String entrustCoding, String sampleName, String entrusted, Integer inspectionStatus); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææå§æç³è¯·åæ ·å |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> selectLinkAll(); |
| | | |
| | | /** |
| | | * 鿩姿ç³è¯·åæ ·å |
| | | * @param bid |
| | | * @param did |
| | | * @return |
| | | */ |
| | | InspectionVo selectLinkByid(Integer bid, Integer did); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.RawMaterial; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | |
| | | */ |
| | | public interface RawMaterialMapper extends BaseMapper<RawMaterial> { |
| | | |
| | | IPage<RawMaterial> selectRawMaterial(String materialCoding, String materialName, String condition, String createTime, Page<Objects> page); |
| | | IPage<RawMaterial> selectRawMaterial(String materialCoding, String materialName, Integer condition, String createTime, Page<Objects> page); |
| | | |
| | | |
| | | List<RawMaterial> selectRawmaAll(); |
| | | |
| | | InspectionVo selectRawmaById(Integer id); |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * ç³è¯·è¡¨(Inspection)表å®ä½ç±» |
| | | * |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-17 |
| | | * @author zss |
| | | * @since 2023-08-03 13:04:05 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="Inspection对象", description="") |
| | | @Builder |
| | | @TableName("inspection") |
| | | public class Inspection implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "æ¥æ£ç¼å·") |
| | | private String id; |
| | | /** |
| | | * ç³è¯·åç¼å· |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "æ¥æ£ç±»å") |
| | | /** |
| | | * ç³è¯·åç¼ç |
| | | **/ |
| | | private String code; |
| | | |
| | | /** |
| | | * æ£éªç±»å 0ï¼åææï¼1ï¼äº§åï¼2ï¼åæåï¼ |
| | | **/ |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "æ¥æ£ç¶æ 1ï¼å·²æ£éªï¼0æªæ£éª") |
| | | /** |
| | | * æ£éªç¶æï¼1ï¼åæ ¼ï¼0ï¼ä¸åæ ¼ |
| | | **/ |
| | | private Integer inspectionStatus; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦åæ ¼ 1ï¼æ¯ï¼0å¦") |
| | | private Integer qualifiedState; |
| | | |
| | | @ApiModelProperty(value = "1ï¼å¾
æäº¤ï¼2ï¼å·²æäº¤ï¼0ï¼å·²ä½åº") |
| | | /** |
| | | * ${column.comment} |
| | | **/ |
| | | private Integer state; |
| | | |
| | | /** |
| | | * ç»è®°æ¥æ |
| | | **/ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value = "å建æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * ${column.comment} |
| | | **/ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | private Integer version; |
| | | /** |
| | | * å
³è ç»è®°äººï¼ç¨æ·idï¼ |
| | | **/ |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "æ¥æ£äºº") |
| | | private String userName; |
| | | /** |
| | | * æ£éªå¼å§æ¥æ |
| | | **/ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date startTime; |
| | | |
| | | @ApiModelProperty(value = "å
³è æ£éªäººï¼ç¨æ·idï¼") |
| | | private Integer inspectUserId; |
| | | |
| | | @ApiModelProperty(value = "æ£éªå¼å§æ¥æ") |
| | | private LocalDateTime inspectStartTime; |
| | | |
| | | @ApiModelProperty(value = "æ£éªç»ææ¥æ") |
| | | private LocalDateTime inspectEndTime; |
| | | |
| | | public Inspection(Integer type, Integer inspectionStatus, Integer state, Integer version, String userName) { |
| | | this.type = type; |
| | | this.inspectionStatus = inspectionStatus; |
| | | this.state = state; |
| | | this.version = version; |
| | | this.userName = userName; |
| | | /** |
| | | * æ£éªç»ææ¥æ |
| | | **/ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date endTime; |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * (æ ·å)æ£éªåéé¢çç©æ(InspectionMaterial)表å®ä½ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-03 13:04:28 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Builder |
| | | @TableName("inspection_material") |
| | | public class InspectionMaterial implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * ç©æç¼ç |
| | | **/ |
| | | private String code; |
| | | |
| | | /** |
| | | * ç©æåç§° |
| | | **/ |
| | | private String name; |
| | | |
| | | /** |
| | | * æ¥æ£æ°é-ç©ææ°é |
| | | **/ |
| | | private Integer num; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | private String unit; |
| | | |
| | | /** |
| | | * ä¾åºå |
| | | **/ |
| | | private String supplier; |
| | | |
| | | /** |
| | | * è§æ ¼åç§°-åå·åç§° |
| | | **/ |
| | | private String specifications; |
| | | |
| | | /** |
| | | * æ¥ææ¥æ |
| | | **/ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date formTime; |
| | | |
| | | /** |
| | | * ${column.comment} |
| | | **/ |
| | | private Integer state; |
| | | |
| | | /** |
| | | * ${column.comment} |
| | | **/ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * ${column.comment} |
| | | **/ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * å
³è ç³è¯·åid |
| | | **/ |
| | | private Integer inspectionId; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * ç³è¯·åä¸ç©æä¸ç项ç®(InspectionProduct)表å®ä½ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-03 13:04:55 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Builder |
| | | @TableName("inspection_product") |
| | | public class InspectionProduct implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 项ç®id |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 项ç®åç§° |
| | | **/ |
| | | private String name; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | private String unit; |
| | | |
| | | /** |
| | | * è¦æ±å¼ |
| | | **/ |
| | | private String required; |
| | | |
| | | /** |
| | | * å
æ§å¼ |
| | | **/ |
| | | private String internal; |
| | | |
| | | /** |
| | | * æ£æµå¼ |
| | | **/ |
| | | private String testValue; |
| | | |
| | | /** |
| | | * ç»è®º 0ï¼ä¸åæ ¼ï¼1ï¼åæ ¼ |
| | | **/ |
| | | private Integer testState; |
| | | |
| | | /** |
| | | * ${column.comment} |
| | | **/ |
| | | private Integer state; |
| | | |
| | | /** |
| | | * ${column.comment} |
| | | **/ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * ${column.comment} |
| | | **/ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * å
³è æ¥æ£ç©æid |
| | | **/ |
| | | private Integer inspectionMaterialId; |
| | | |
| | | /** |
| | | * å
³è ç¨æ·id è¯éªå |
| | | **/ |
| | | private Integer userId; |
| | | |
| | | /** |
| | | * å
³è 设å¤id |
| | | **/ |
| | | private Integer instrumentId; |
| | | } |
| | | |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDateTime dateSurvey; |
| | | |
| | | @ApiModelProperty(value = "ç¶æ") |
| | | @ApiModelProperty(value = "ç¶æ0:å¾
æ£æµ;1:å·²æ£æµ") |
| | | private Integer condition; |
| | | |
| | | @TableLogic(value = "1", delval = "0") |
| | | // @TableLogic(value = "1", delval = "0") |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.vo; |
| | | |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | |
| | | @Data |
| | | public class InsProductVo implements Serializable { |
| | | |
| | | /** |
| | | * 项ç®åç§° |
| | | **/ |
| | | @JsonSerialize |
| | | private String name; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | @JsonSerialize |
| | | private String unit; |
| | | |
| | | /** |
| | | * æ åå¼ |
| | | **/ |
| | | @JsonSerialize |
| | | private String required; |
| | | |
| | | /** |
| | | * å
æ§å¼ |
| | | **/ |
| | | @JsonSerialize |
| | | private String internal; |
| | | |
| | | /** |
| | | * æ£æµå¼ |
| | | **/ |
| | | @JsonSerialize |
| | | private String testValue; |
| | | |
| | | /** |
| | | * ç»è®º 0ï¼ä¸åæ ¼ï¼1ï¼åæ ¼ |
| | | **/ |
| | | @JsonSerialize |
| | | private Integer testState; |
| | | |
| | | /** |
| | | * 设å¤åç§° |
| | | **/ |
| | | @JsonSerialize |
| | | private String instrumentName; |
| | | |
| | | /** |
| | | * å
³è ç³è¯·åid |
| | | **/ |
| | | @JsonSerialize |
| | | private Integer inspectionMaterialId; |
| | | |
| | | /** |
| | | * æ£éªå |
| | | **/ |
| | | @JsonSerialize |
| | | private String userName; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | //æ¥è¯¢æ£éªå详æ
(æ£éªåºæ¬ä¿¡æ¯ä»¥åæ£éªé¡¹ç®ä¿¡æ¯) |
| | | public class InspectDetailVo implements Serializable { |
| | | |
| | | /* æ£éªè¯¦æ
*/ |
| | | /** |
| | | * æ¥ææ¥æ |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date formTime; |
| | | |
| | | /** |
| | | * ä¾åºå |
| | | **/ |
| | | @JsonSerialize |
| | | private String supplier; |
| | | |
| | | /** |
| | | * åææç¼ç |
| | | */ |
| | | @JsonSerialize |
| | | private String code; |
| | | |
| | | /** |
| | | * åææåç§° |
| | | */ |
| | | @JsonSerialize |
| | | private String name; |
| | | |
| | | /** |
| | | * åå·è§æ ¼ |
| | | */ |
| | | @JsonSerialize |
| | | private String specifications; |
| | | |
| | | /** |
| | | * åä½ |
| | | */ |
| | | @JsonSerialize |
| | | private String unit; |
| | | |
| | | /** |
| | | * æ°é |
| | | */ |
| | | @JsonSerialize |
| | | private Integer num; |
| | | |
| | | /** |
| | | * æ£éªå¼å§æ¥æ |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date startTime; |
| | | |
| | | |
| | | /** |
| | | * æ£éªç»ææ¥æ |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date endTime; |
| | | |
| | | |
| | | /** |
| | | * æ¥æ£äººï¼å½åç¨æ·åï¼ |
| | | */ |
| | | @JsonSerialize |
| | | private String userName; |
| | | |
| | | /* æ£éªé¡¹ç® */ |
| | | @JsonSerialize |
| | | private List<InsProductVo> insProducts; |
| | | |
| | | /* æ£éªç»è®º */ |
| | | /** |
| | | * åæ ¼ç¶æ 0ï¼ä¸åæ ¼ï¼1ï¼åæ ¼ |
| | | */ |
| | | @JsonSerialize |
| | | private Integer inspectionStatus; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.vo; |
| | | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | //æ°å¢æ£éªå |
| | | @Data |
| | | public class InspectionVo implements Serializable { |
| | | |
| | | /** |
| | | *æ£éªç±»å 0ï¼åææï¼1ï¼äº§åï¼2ï¼åæåï¼ |
| | | **/ |
| | | @JsonSerialize |
| | | private Integer type; |
| | | |
| | | /** |
| | | * æ¥ææ¥æ |
| | | **/ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date formTime; |
| | | |
| | | /** |
| | | * ä¾åºå |
| | | **/ |
| | | @JsonSerialize |
| | | private String supplier; |
| | | |
| | | /** |
| | | * ç©æç¼ç |
| | | **/ |
| | | @JsonSerialize |
| | | private String mcode; |
| | | |
| | | /** |
| | | * ç©æåç§° |
| | | **/ |
| | | @JsonSerialize |
| | | private String name; |
| | | |
| | | /** |
| | | * è§æ ¼åç§°-åå·åç§° |
| | | **/ |
| | | @JsonSerialize |
| | | private String specifications; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | @JsonSerialize |
| | | private String unit; |
| | | |
| | | /** |
| | | * æ¥æ£æ°é-ç©ææ°é |
| | | **/ |
| | | @JsonSerialize |
| | | private Integer num; |
| | | |
| | | /** |
| | | * æ£éªå¼å§æ¥æ |
| | | **/ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date startTime; |
| | | |
| | | /** |
| | | * æ£éªç»ææ¥æ |
| | | **/ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date endTime; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionMaterial; |
| | | |
| | | /** |
| | | * (æ ·å)æ£éªåéé¢çç©æ(InspectionMaterial)表æå¡æ¥å£ |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-03 13:04:28 |
| | | */ |
| | | public interface InspectionMaterialService extends IService<InspectionMaterial> { |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProduct; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InsProductVo; |
| | | |
| | | /** |
| | | * ç³è¯·åä¸ç©æä¸ç项ç®(InspectionProduct)表æå¡æ¥å£ |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-03 13:04:54 |
| | | */ |
| | | public interface InspectionProductService extends IService<InspectionProduct> { |
| | | |
| | | /** |
| | | * æ´æ°æ£éªé¡¹ç® |
| | | * @param userId |
| | | * @param inspectionProduct |
| | | * @return |
| | | */ |
| | | boolean updateInsProduct(Integer userId, InspectionProduct inspectionProduct); |
| | | } |
| | | |
| | |
| | | package com.yuanchu.limslaboratory.service; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionDto; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectDetailVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡ç±» |
| | | * </p> |
| | | * ç³è¯·è¡¨(Inspection)表æå¡æ¥å£ |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-17 |
| | | * @author zss |
| | | * @since 2023-08-03 13:03:36 |
| | | */ |
| | | public interface InspectionService extends IService<Inspection> { |
| | | |
| | | /** |
| | | * æ·»å æ£éªå |
| | | * @param userName |
| | | * @param type |
| | | * @return |
| | | */ |
| | | Inspection addInspection(String userName,int type); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢æææ£éªå |
| | | * @param pageSize |
| | | * @param countSize |
| | | * @param state |
| | | *æ¥è¯¢æ£éªç³è¯·åå表 |
| | | * @param page |
| | | * @param message |
| | | * @return |
| | | */ |
| | | List<InspectionDto> selectAllInspection(int pageSize, int countSize, Integer state); |
| | | IPage<Map<String, Object>> selectInspectsList(Page<Object> page, String message); |
| | | |
| | | /** |
| | | *æ ¹æ®æ£éªåidä½åºæ£éªåç³è¯· |
| | | * @param inspectionId |
| | | * æ°å¢æ£éªç³è¯·è¡¨ |
| | | * @param id |
| | | * @param |
| | | * @return |
| | | */ |
| | | void delInspectionByInsId(String inspectionId); |
| | | Integer addInspect(Integer id, InspectionVo inspectionVo); |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®æ£éªåidæäº¤æ£éªç³è¯· |
| | | * @param inspectionId |
| | | *æ ¹æ®æ£éªåidæ¥è¯¢åæææ£éªå详æ
|
| | | * @param id |
| | | * @return |
| | | */ |
| | | void subInspectionByInsId(String inspectionId); |
| | | InspectDetailVo selectInspectsListById(Integer id); |
| | | |
| | | /** |
| | | * 䏿¥(æ´æ°æ£éªåæ£éªç»æ) |
| | | * @param id |
| | | * @return |
| | | */ |
| | | boolean updateInspectsById(Integer id); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.LinkBasicInformation; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | |
| | | String addLinkBasicInformation(LinkBasicInformation linkBasicInformation); |
| | | |
| | | IPage<Map<String, Object>> getLinkBasicPage(Page<Object> page, String entrustCoding, String sampleName, String entrusted, Integer inspectionStatus); |
| | | |
| | | /** |
| | | *æ¥è¯¢ææå§ææ£éªåæ ·å |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> selectLinkAll(); |
| | | |
| | | /** |
| | | * æ ¹æ®å§ææ£éªidåæ ·åidæ¥è¯¢å§ææ£éªåæ ·å |
| | | * @param bid |
| | | * @param did |
| | | * @return |
| | | */ |
| | | InspectionVo selectLinkByid(Integer bid, Integer did); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.RawMaterial; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | |
| | | */ |
| | | public interface RawMaterialService extends IService<RawMaterial> { |
| | | |
| | | IPage<RawMaterial> selectRawMaterial(String materialCoding, String materialName, String condition, String createTime, Page<Objects> page); |
| | | IPage<RawMaterial> selectRawMaterial(String materialCoding, String materialName, Integer condition, String createTime, Page<Objects> page); |
| | | |
| | | /** |
| | | * æ¥è¯¢åæææ£éª |
| | | * |
| | | * @return |
| | | */ |
| | | List<RawMaterial> selectRawmaAll(); |
| | | |
| | | /** |
| | | * éæ©åæææ¥æ£ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | InspectionVo selectRawmaById(Integer id, String startTime, String endTime) throws ParseException; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionMaterialMapper; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionMaterial; |
| | | import com.yuanchu.limslaboratory.service.InspectionMaterialService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * (æ ·å)æ£éªåéé¢çç©æ(InspectionMaterial)表æå¡å®ç°ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-03 13:04:28 |
| | | */ |
| | | @Service |
| | | public class InspectionMaterialServiceImpl extends ServiceImpl<InspectionMaterialMapper, InspectionMaterial> implements InspectionMaterialService { |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionProductMapper; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProduct; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InsProductVo; |
| | | import com.yuanchu.limslaboratory.service.InspectionProductService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * ç³è¯·åä¸ç©æä¸ç项ç®(InspectionProduct)表æå¡å®ç°ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-03 13:04:54 |
| | | */ |
| | | @Service |
| | | public class InspectionProductServiceImpl extends ServiceImpl<InspectionProductMapper, InspectionProduct> implements InspectionProductService { |
| | | |
| | | @Resource |
| | | InspectionProductMapper inspectionProductMapper; |
| | | |
| | | //æ´æ°æ£éªé¡¹ç® |
| | | @Override |
| | | public boolean updateInsProduct(Integer userId, InspectionProduct inspectionProduct) { |
| | | //èµå¼æ£éªåid |
| | | inspectionProduct.setUserId(userId); |
| | | //å¤ææ£æµå¼æ¯å¦æ»¡è¶³æ åå¼åå
æ§å¼çè¦æ±,妿䏿»¡è¶³åæ£éªç»è®ºä¸ºä¸åæ ¼0 |
| | | String testValue = inspectionProduct.getTestValue();//æ£éªå¼ |
| | | String required = inspectionProduct.getRequired();//æ åå¼ |
| | | String internal = inspectionProduct.getInternal();//å
æ§å¼ |
| | | inspectionProduct.setTestState(checkValues(required, internal, testValue)); |
| | | //æ ¹æ®æ£éªé¡¹ç®ååå
³èçæ£éªç©æidæ¥æ¥è¯¢æ£éªé¡¹ç®çæ°æ® |
| | | LambdaUpdateWrapper<InspectionProduct> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(InspectionProduct::getInspectionMaterialId, inspectionProduct.getInspectionMaterialId()) |
| | | .eq(InspectionProduct::getName, inspectionProduct.getName()); |
| | | inspectionProductMapper.update(inspectionProduct, updateWrapper); |
| | | return true; |
| | | } |
| | | |
| | | /*å¤ææ£æµå¼æ¯å¦æ»¡è¶³æ åå¼åå
æ§å¼çè¦æ±,妿䏿»¡è¶³åæ£éªç»è®ºä¸ºä¸åæ ¼*/ |
| | | private int checkValues(String standardValueStr, String controlValueStr, String detectionValueStr) { |
| | | boolean isStandardValueSatisfied = isValueSatisfied(standardValueStr, detectionValueStr); |
| | | boolean isControlValueSatisfied = isValueSatisfied(controlValueStr, detectionValueStr); |
| | | |
| | | if (isStandardValueSatisfied && isControlValueSatisfied) { |
| | | return 1; |
| | | } else { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | private boolean isValueSatisfied(String valueStr, String detectionValueStr) { |
| | | String substring = valueStr.substring(1, 2); |
| | | if (substring.equals("=")) { |
| | | String operator = valueStr.substring(0, 2); |
| | | Double standardValue = Double.parseDouble(valueStr.substring(2)); |
| | | Double detectionValue = Double.parseDouble(detectionValueStr); |
| | | switch (operator) { |
| | | case ">=": |
| | | return detectionValue >= standardValue; |
| | | case "<=": |
| | | return detectionValue <= standardValue; |
| | | default: |
| | | return false; |
| | | } |
| | | } else { |
| | | String operator = valueStr.substring(0, 1); |
| | | Double standardValue = Double.parseDouble(valueStr.substring(1)); |
| | | Double detectionValue = Double.parseDouble(detectionValueStr); |
| | | switch (operator) { |
| | | case ">": |
| | | return detectionValue > standardValue; |
| | | case "â¥": |
| | | return detectionValue >= standardValue; |
| | | case "â¤": |
| | | return detectionValue <= standardValue; |
| | | case "<": |
| | | return detectionValue < standardValue; |
| | | case "=": |
| | | return detectionValue.equals(standardValue); |
| | | default: |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | |
| | | import cn.hutool.core.lang.Snowflake; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionMaterialListMapper; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionProductListMapper; |
| | | import com.yuanchu.limslaboratory.mapper.PlanMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionMapper; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionMaterialList; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.yuanchu.limslaboratory.pojo.Plan; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionDto; |
| | | import com.yuanchu.limslaboratory.service.InspectionProductListService; |
| | | import com.yuanchu.limslaboratory.service.InspectionService; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.mapper.*; |
| | | import com.yuanchu.limslaboratory.pojo.*; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InsProductVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectDetailVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | import com.yuanchu.limslaboratory.service.*; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * ç³è¯·è¡¨(Inspection)表æå¡å®ç°ç±» |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-17 |
| | | * @author zss |
| | | * @since 2023-08-03 13:03:36 |
| | | */ |
| | | @Service |
| | | public class InspectionServiceImpl extends ServiceImpl<InspectionMapper, Inspection> implements InspectionService { |
| | | |
| | | @Resource |
| | | private InspectionMapper inspectionMapper; |
| | | InspectionMapper inspectionMapper; |
| | | |
| | | @Resource |
| | | private PlanMapper planMapper; |
| | | InspectionMaterialMapper inspectionMaterialMapper; |
| | | |
| | | @Resource |
| | | InspectionMaterialListMapper inspectionMaterialListMapper; |
| | | InspectionProductService inspectionProductService; |
| | | |
| | | @Resource |
| | | InspectionProductListService inspectionProductListService; |
| | | InspectionProductMapper inspectionProductMapper; |
| | | |
| | | //æ·»å æ£éªç³è¯·å |
| | | @Resource |
| | | MaterialMapper materialMapper; |
| | | |
| | | @Resource |
| | | StandardService standardService; |
| | | |
| | | @Resource |
| | | SpecificationsService specificationsService; |
| | | |
| | | @Resource |
| | | ProductMapper productMapper; |
| | | |
| | | @Resource |
| | | InstrumentService instrumentService; |
| | | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ£éªç³è¯·åå表 |
| | | * |
| | | * @param message |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Inspection addInspection(String userName, int type) { |
| | | Inspection inspection = new Inspection(type, 0, 1, 1, userName); |
| | | int judge = inspectionMapper.insert(inspection); |
| | | return judge > 0 ? inspection : null; |
| | | public IPage<Map<String, Object>> selectInspectsList(Page<Object> page, String message) { |
| | | return inspectionMapper.selectInspectsList(page, message); |
| | | } |
| | | |
| | | //æ¥è¯¢æææ£éªåå表 |
| | | /** |
| | | * æ°å¢æ£éªç³è¯·è¡¨ |
| | | * |
| | | * @param id |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<InspectionDto> selectAllInspection(int pageSize, int countSize, Integer state) { |
| | | return inspectionMapper.selectAllInspection((pageSize - 1) * countSize, pageSize * countSize, state); |
| | | public Integer addInspect(Integer id, InspectionVo inspectionVo) { |
| | | /*æ°å¢æ£éªç³è¯·è¡¨*/ |
| | | Inspection inspection = Inspection.builder() |
| | | .startTime(inspectionVo.getStartTime()) |
| | | .endTime(inspectionVo.getEndTime()) |
| | | .type(inspectionVo.getType()) |
| | | .code(new Snowflake(1, 1).nextIdStr()) |
| | | .userId(id) |
| | | .build(); |
| | | inspectionMapper.insert(inspection); |
| | | /*æ°å¢æ£éªæ ·å表*/ |
| | | InspectionMaterial inspectionMaterial = InspectionMaterial.builder() |
| | | .code(inspectionVo.getMcode()) |
| | | .name(inspectionVo.getName()) |
| | | .num(inspectionVo.getNum()) |
| | | .unit(inspectionVo.getUnit()) |
| | | .supplier(inspectionVo.getSupplier()) |
| | | .specifications(inspectionVo.getSpecifications()) |
| | | .formTime(inspectionVo.getFormTime()) |
| | | .inspectionId(inspection.getId()) |
| | | .build(); |
| | | inspectionMaterialMapper.insert(inspectionMaterial); |
| | | /*æ°å¢æ£éªé¡¹ç®è¡¨*/ |
| | | //è·åç©æid |
| | | Material material = materialMapper.selectOne(Wrappers.<Material>query() |
| | | .eq("name", inspectionVo.getName()) |
| | | .eq("code", inspectionVo.getMcode())); |
| | | //è·åè§æ ¼åç§°ååå·åç§° |
| | | String specification = inspectionVo.getSpecifications(); |
| | | String[] split = specification.split("-"); |
| | | String stName = split[0]; |
| | | String spName = split[1]; |
| | | //è·åè§æ ¼id |
| | | Standard standard = standardService.getOne(Wrappers.<Standard>query() |
| | | .eq("name", stName) |
| | | .eq("material_id", material.getId())); |
| | | //è·ååå·id |
| | | Specifications specifications = specificationsService.getOne(Wrappers.<Specifications>query() |
| | | .eq("name", spName) |
| | | .eq("standard_id", standard.getId())); |
| | | //æ ¹æ®åå·idæ¥è¯¢é¡¹ç®ä¿¡æ¯ |
| | | List<Product> productList = productMapper.selectList(Wrappers.<Product>query().eq("specifications_id", specifications.getId())); |
| | | 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(material.getId()) |
| | | .build(); |
| | | list.add(rawInsProduct); |
| | | } |
| | | //æ£éªé¡¹ç®æ¹éæ·»å |
| | | inspectionProductService.saveBatch(list); |
| | | return inspection.getId(); |
| | | } |
| | | |
| | | //ä½åºç³è¯·æ£éªå |
| | | //æ ¹æ®æ£éªåidæ¥è¯¢åæææ£éªå详æ
|
| | | @Override |
| | | public void delInspectionByInsId(String inspectionId) { |
| | | /*æ£éªåä½åº*/ |
| | | Inspection inspection = inspectionMapper.selectById(inspectionId); |
| | | inspection.setState(0); |
| | | public InspectDetailVo selectInspectsListById(Integer id) { |
| | | /*å°æ£éªååºæ¬ä¿¡æ¯æ¥è¯¢åºæ¥å¹¶å°è£
å°RawInspectVo对象ä¸*/ |
| | | Inspection inspection = inspectionMapper.selectById(id); |
| | | InspectDetailVo inspectDetailVo = new InspectDetailVo(); |
| | | //æ¥æ£äºº |
| | | User user = userMapper.selectById(inspection.getUserId()); |
| | | inspectDetailVo.setUserName(user.getName()); |
| | | //æ¥æ£å¼å§æ¶é´åç»ææ¶é´ |
| | | inspectDetailVo.setStartTime(inspection.getStartTime()); |
| | | inspectDetailVo.setEndTime(inspection.getEndTime()); |
| | | //æ£éªç»è®º |
| | | inspectDetailVo.setInspectionStatus(inspection.getInspectionStatus()); |
| | | //æ¥è¯¢æ£éªç©æ |
| | | InspectionMaterial inspectionMaterial = inspectionMaterialMapper.selectOne(Wrappers.<InspectionMaterial>query().eq("inspection_id", id)); |
| | | //æ¥ææ¥æ,ä¾åºååç§°,åææç¼ç ,åææåç§°,è§æ ¼åå·,åä½,æ°é |
| | | BeanUtils.copyProperties(inspectionMaterial, inspectDetailVo); |
| | | /*æ¥è¯¢æ£éªåéé¢çæ£éªé¡¹ç®,å¹¶å°è£
å°RawInspectVo对象ä¸*/ |
| | | LambdaQueryWrapper<InspectionProduct> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(InspectionProduct::getInspectionMaterialId, inspectionMaterial.getId()); |
| | | List<InspectionProduct> inspectionProducts = inspectionProductMapper.selectList(queryWrapper); |
| | | //è¿éæ¥å°ç设å¤id忣éªåidè¦æ¥è¯¢åç§° |
| | | List<InsProductVo> insProductVos = inspectionProducts.stream().map(insProduct -> { |
| | | //å°ä¸ä¸ªå¯¹è±¡çå¼èµå¼ç»å¦ä¸ä¸ªå¯¹è±¡ |
| | | InsProductVo insProductVo = new InsProductVo(); |
| | | BeanUtils.copyProperties(insProduct, insProductVo); |
| | | //è·å设å¤å(åææ¯å¦æåå¨) |
| | | if (insProduct.getInstrumentId() != null) { |
| | | String equipmentName = instrumentService.getById(insProduct.getInstrumentId()).getEquipmentName(); |
| | | insProductVo.setInstrumentName(equipmentName); |
| | | } |
| | | //è·åç¨æ·å(åææ¯å¦æåå¨) |
| | | if (insProduct.getUserId() != null) { |
| | | String userName = userMapper.selectById(insProduct.getUserId()).getName(); |
| | | insProductVo.setUserName(userName); |
| | | } |
| | | //项ç®å
³èç©æid |
| | | insProductVo.setInspectionMaterialId(inspectionMaterial.getId()); |
| | | return insProductVo; |
| | | }).collect(Collectors.toList()); |
| | | inspectDetailVo.setInsProducts(insProductVos); |
| | | return inspectDetailVo; |
| | | } |
| | | |
| | | //æ´æ°æ£éªåæ£éªç»æ |
| | | @Override |
| | | public boolean updateInspectsById(Integer id) { |
| | | //æ´æ°æ£éªåéé¢çæ£éªç¶æåæ£éªç»è®º |
| | | InspectDetailVo inspectDetailVo = selectInspectsListById(id); |
| | | Inspection inspection = Inspection.builder() |
| | | .id(id) |
| | | .inspectionStatus(inspectDetailVo.getInspectionStatus()) |
| | | .build(); |
| | | inspectionMapper.updateById(inspection); |
| | | /*æ£éªè®¡åä½åº*/ |
| | | UpdateWrapper<Plan> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("inspection_id", inspectionId).set("state", 0); |
| | | planMapper.update(new Plan(), updateWrapper); |
| | | /*æ£éªæ ·åä½åº(æ ¹æ®æ¥æ£åidå 餿 ·åä¿¡æ¯)*/ |
| | | UpdateWrapper<InspectionMaterialList> wrapper1 = new UpdateWrapper<>(); |
| | | wrapper1.eq("inspection_id", inspectionId).set("state", 0); |
| | | inspectionMaterialListMapper.update(new InspectionMaterialList(), wrapper1); |
| | | /*æ£éªæ ·åä¸çæ£éªé¡¹ç®ä½åº*/ |
| | | //æ¥åºæ£éªæ ·åid |
| | | LambdaQueryWrapper<InspectionMaterialList> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(InspectionMaterialList::getInspectionId,inspectionId); |
| | | List<InspectionMaterialList> inspectionMaterialLists = inspectionMaterialListMapper.selectList(queryWrapper); |
| | | for (InspectionMaterialList inspectionMaterialList : inspectionMaterialLists) { |
| | | UpdateWrapper<InspectionProductList> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq("inspection_material_list_id", inspectionMaterialList.getId()).set("state", 0); |
| | | inspectionProductListService.update(new InspectionProductList(), wrapper); |
| | | //çææ¥åå |
| | | |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | //æäº¤ç³è¯·æ£éªå |
| | | @Override |
| | | public void subInspectionByInsId(String inspectionId) { |
| | | Inspection inspection = inspectionMapper.selectById(inspectionId); |
| | | //ç¶ææ¹ä¸ºå·²æäº¤2 |
| | | inspection.setState(2); |
| | | inspectionMapper.updateById(inspection); |
| | | //计å表æ°å¢ |
| | | Plan plan = Plan.builder().inspectionId(inspectionId).state(1).userId(inspection.getInspectUserId()).createTime(new Date()).build(); |
| | | planMapper.insert(plan); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.LinkBasicInformation; |
| | | import com.yuanchu.limslaboratory.mapper.LinkBasicInformationMapper; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | import com.yuanchu.limslaboratory.service.LinkBasicInformationService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.service.LinkDetectionService; |
| | |
| | | public IPage<Map<String, Object>> getLinkBasicPage(Page<Object> page, String entrustCoding, String sampleName, String entrusted, Integer inspectionStatus) { |
| | | return linkBasicInformationMapper.getLinkBasicPage(page, entrustCoding, sampleName, entrusted, inspectionStatus); |
| | | } |
| | | |
| | | //æ¥è¯¢ææå§ææ£éªåæ ·å |
| | | @Override |
| | | public List<Map<String, Object>> selectLinkAll() { |
| | | return linkBasicInformationMapper.selectLinkAll(); |
| | | } |
| | | |
| | | //æ ¹æ®å§ææ£éªidåæ ·åidæ¥è¯¢å§ææ£éªåæ ·å |
| | | @Override |
| | | public InspectionVo selectLinkByid(Integer bid, Integer did) { |
| | | InspectionVo inspectionVo = linkBasicInformationMapper.selectLinkByid(bid, did); |
| | | inspectionVo.setType(1); |
| | | return inspectionVo; |
| | | } |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Instrument; |
| | | import com.yuanchu.limslaboratory.pojo.RawMaterial; |
| | | import com.yuanchu.limslaboratory.mapper.RawMaterialMapper; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | import com.yuanchu.limslaboratory.service.RawMaterialService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | |
| | | @Resource |
| | | private RawMaterialMapper rawMaterialMapper; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param materialCoding |
| | | * @param materialName |
| | | * @param condition |
| | | * @param createTime |
| | | * @param page |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<RawMaterial> selectRawMaterial(String materialCoding, String materialName, String condition, String createTime, Page<Objects> page) { |
| | | public IPage<RawMaterial> selectRawMaterial(String materialCoding, String materialName, Integer condition, String createTime, Page<Objects> page) { |
| | | return rawMaterialMapper.selectRawMaterial(materialCoding, materialName, condition, createTime, page); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ææåæææ¥æ£å |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<RawMaterial> selectRawmaAll() { |
| | | return rawMaterialMapper.selectRawmaAll(); |
| | | } |
| | | |
| | | /** |
| | | * éæ©åæææ¥æ£ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public InspectionVo selectRawmaById(Integer id, String startTime, String endTime) throws ParseException { |
| | | InspectionVo inspectionVo = rawMaterialMapper.selectRawmaById(id); |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); |
| | | inspectionVo.setStartTime(formatter.parse(startTime)); |
| | | inspectionVo.setEndTime(formatter.parse(endTime)); |
| | | inspectionVo.setType(0); |
| | | return inspectionVo; |
| | | } |
| | | } |
| | |
| | | <?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.InspectionMapper"> |
| | | <select id="selectAllInspection" resultType="com.yuanchu.limslaboratory.pojo.dto.InspectionDto"> |
| | | select i.id, type, inspection_status, qualified_state, i.state, i.create_time, user_name, inspect_user_id, |
| | | inspect_start_time, inspect_end_time, u.name inspectUserName |
| | | from lims_laboratory.inspection i left join lims_laboratory.user u |
| | | on i.inspect_user_id = u.id |
| | | <if test="state!=null"> |
| | | where state = #{state} |
| | | <select id="selectInspectsList" resultType="map"> |
| | | select i.id, |
| | | i.code icode, |
| | | type, |
| | | DATE_FORMAT(`form_time`,'%Y-%m-%d'), |
| | | supplier, |
| | | im.code mcode, |
| | | im.name, |
| | | specifications, |
| | | unit, |
| | | num, |
| | | DATE_FORMAT(i.`create_time`,'%Y-%m-%d'), |
| | | u.name userName, |
| | | inspection_status, |
| | | DATE_FORMAT(i.`start_time`,'%Y-%m-%d'), |
| | | DATE_FORMAT(i.`end_time`,'%Y-%m-%d') |
| | | from lims_laboratory.inspection i |
| | | join lims_laboratory.user u on i.user_id = u.id |
| | | join lims_laboratory.inspection_material im on i.id = im.inspection_id |
| | | where i.state=1 |
| | | <if test="message!=null"> |
| | | and i.code like concat('%', #{message}, '%') |
| | | or im.name like concat('%', #{message}, '%') |
| | | </if> |
| | | order by i.create_time desc |
| | | limit #{pageSize},#{countSize} |
| | | </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.InspectionMaterialMapper"> |
| | | </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.InspectionProductMapper"> |
| | | </mapper> |
| | |
| | | AND d.`inspection_status` = #{inspectionStatus} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectLinkAll" resultType="java.util.Map"> |
| | | SELECT l.`id`, l.`entrust_coding`, l.`entrusted`, d.`samples_number`, d.`sample_name`, d.`specifications_models`, |
| | | DATE_FORMAT(l.`inspection_time`,'%Y-%m-%d') inspectionTime, l.`completion_deadline`, l.`contacts`, d.`date_survey`, d.`inspection_status` |
| | | FROM lims_laboratory.link_basic_information l, lims_laboratory.link_detection d |
| | | WHERE l.`id` = d.`link_basic_id` |
| | | AND l.`state` = 1 |
| | | </select> |
| | | |
| | | <select id="selectLinkByid" resultType="com.yuanchu.limslaboratory.pojo.vo.InspectionVo"> |
| | | SELECT l.`inspection_time` formTime, |
| | | l.`entrusted` supplier, |
| | | d.`sample_number` mcode, |
| | | d.`sample_name` name, |
| | | d.`specifications_models` specifications, |
| | | d.`unit`, |
| | | d.`samples_number` num, |
| | | d.date_survey startTime, |
| | | l.completion_deadline endTime |
| | | FROM lims_laboratory.link_basic_information l, lims_laboratory.link_detection d |
| | | WHERE l.`id` = d.`link_basic_id` |
| | | AND l.`state` = 1 |
| | | <if test="bid!=null"> |
| | | and l.id=#{bid} |
| | | </if> |
| | | <if test="did!=null"> |
| | | and d.id=#{did} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | 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> |
| | | |
| | | <select id="selectRawmaById" resultType="com.yuanchu.limslaboratory.pojo.vo.InspectionVo"> |
| | | select create_time formTime, |
| | | supplier_name supplier, |
| | | material_coding mcode, |
| | | material_name name, |
| | | specifications_models specifications, |
| | | unit , |
| | | quantity num |
| | | from lims_laboratory.raw_material |
| | | where id=#{id} |
| | | </select> |
| | | </mapper> |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-20 |
| | | */ |
| | | @Mapper |
| | | public interface InstrumentMapper extends BaseMapper<Instrument> { |
| | | |
| | | IPage<Map<String, Object>> getListInstrumentInformation(Integer conditions,Boolean whetherWhether, String numberOrNameOrSpecifications, Integer classifyId, Page<Objects> page); |
| | |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "ä¿ç®¡äººï¼ç¨æ·è¡¨å
³èId", hidden = true) |
| | | @TableField(value = "") |
| | | private Integer createUserId; |
| | | |
| | | @ApiModelProperty(value = "仪å¨è®¾å¤ç¼å·", example = "JSTC-W1-00001", required = true) |
| | |
| | | * @return |
| | | */ |
| | | List<Map> selectInstrument(); |
| | | |
| | | } |
| | |
| | | //æ¥è¯¢ç©æä¿¡æ¯ |
| | | List<Map> selectMaterialLimit(int num1,int num2, int type); |
| | | |
| | | //æ ¹æ®ç©æidæ¥è¯¢ç©æä¿¡æ¯ |
| | | Map selectMaterialById(String materialId); |
| | | } |
| | |
| | | */ |
| | | public interface ProductMapper extends BaseMapper<Product> { |
| | | |
| | | List<Product> selectProductByMaterialId(String materialId); |
| | | //æ ¹æ®ç©æidæ¥è¯¢æ£éªé¡¹ç® |
| | | List<Map> selectProductByMaterialId(int materialId); |
| | | |
| | | IPage<Map<String, Object>> pageProductInformation(String productCodeOrName, Integer specificationsId, Page<Objects> page); |
| | | |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "è§æ ¼id", hidden = true) |
| | | @ApiModelProperty(value = "åå·id", hidden = true) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "è§æ ¼åç§°", example = "AB", required = true) |
| | | @ApiModelProperty(value = "产ååå·åç§°", example = "AB", required = true) |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | |
| | | @Version |
| | | private Integer version; |
| | | |
| | | @ApiModelProperty(value = "å
³èåæ®µ ç¨æ·id", hidden = true) |
| | | @ApiModelProperty(value = "å
³èåæ®µ è§æ ¼id", hidden = true) |
| | | private Integer standardId; |
| | | |
| | | } |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "æ åç¼å· yyMMdd000001(000001++)", example = "230711000001", required = true) |
| | | @ApiModelProperty(value = "è§æ ¼ç¼å· yyMMdd000001(000001++)", example = "230711000001", required = true) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "æ ååç§°", example = "å
纤", required = true) |
| | | @ApiModelProperty(value = "è§æ ¼åç§°", example = "å
纤", required = true) |
| | | private String name; |
| | | |
| | | @TableLogic(value = "1", delval = "0") |
| | |
| | | |
| | | List<Map> selectMaterialLimit(int pageSize,int countSize, int type); |
| | | |
| | | Map selectMaterialById(String materialId); |
| | | |
| | | /** |
| | | * å é¤çäºMaterialIdçæ°æ® |
| | |
| | | return materialMapper.selectMaterialLimit((pageSize - 1) * countSize,pageSize * countSize, type); |
| | | } |
| | | |
| | | //æ ¹æ®ç©æidæ¥è¯¢ç©æä¿¡æ¯ |
| | | @Override |
| | | public Map selectMaterialById(String materialId) { |
| | | return materialMapper.selectMaterialById(materialId); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Integer deleteMaterialInformation(Integer materialId) { |
| | |
| | | <mapper namespace="com.yuanchu.limslaboratory.mapper.MaterialMapper"> |
| | | |
| | | <select id="selectMaterialLimit" resultType="Map"> |
| | | select id, name |
| | | select id,code, name |
| | | from lims_laboratory.material |
| | | where state = 1 |
| | | and type = #{type} |
| | | order by create_time desc |
| | | limit #{num1},#{num2} |
| | | </select> |
| | | <select id="selectMaterialById" resultType="Map"> |
| | | select m.id, |
| | | m.num, |
| | | m.supplier, |
| | | m.name, |
| | | m.location, |
| | | m.batch, |
| | | m.reel_number reelNumber, |
| | | concat(s.name, '/', sn.name) specificationSerialNum, |
| | | s.voltage_level voltageLevel, |
| | | s.cross_section crossSection, |
| | | s.number_of_cores numberOfCores, |
| | | s.instruct |
| | | from lims_laboratory.material m, |
| | | lims_laboratory.specifications s, |
| | | lims_laboratory.serial_number sn |
| | | where m.specifications_id = s.id |
| | | and s.serial_id = sn.id |
| | | and m.id=#{materialId} |
| | | </select> |
| | | </mapper> |
| | |
| | | FROM product p |
| | | WHERE p.`father` = #{father} |
| | | </select> |
| | | <select id="selectProductByMaterialId" resultType="Map"> |
| | | select p.name,unit,required,internal |
| | | from lims_laboratory.product p, |
| | | lims_laboratory.specifications sp, |
| | | lims_laboratory.standard st |
| | | where specifications_id=sp.id |
| | | and standard=st.id |
| | | and material_id=#{materialId} |
| | | </select> |
| | | </mapper> |
| | |
| | | package com.yuanchu.limslaboratory; |
| | | |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | |
| | | System.out.println("newString === " + newString); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |