Merge remote-tracking branch 'origin/master'
# Conflicts:
# standard-server/src/main/java/com/yuanchu/limslaboratory/controller/MaterialController.java
# standard-server/src/main/java/com/yuanchu/limslaboratory/controller/ProductController.java
# standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SerialNumberController.java
# standard-server/src/main/java/com/yuanchu/limslaboratory/controller/StandardsController.java
# standard-server/src/main/java/com/yuanchu/limslaboratory/service/MaterialService.java
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-17 |
| | | */ |
| | | @Api(tags = "æ£éªæ¨¡å") |
| | | @Api(tags = "æ£éªæ¨¡å-->æ£éªå") |
| | | @RestController |
| | | @RequestMapping("/inspection") |
| | | public class InspectionController { |
| | |
| | | }) |
| | | @PostMapping("/addInspection") |
| | | public Result addInspection(@RequestHeader("X-Token") String token, int type) throws Exception { |
| | | System.out.println(token); |
| | | System.out.println(type); |
| | | Object object = RedisUtil.get(token); |
| | | System.out.println(object); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | return Result.success(inspectionService.addInspection("" + unmarshal.get("name"), type)); |
| | | } |
| | |
| | | return Result.success(materialService.selectMaterialById(materialId)); |
| | | } |
| | | |
| | | @ApiOperation("æäº¤ç³è¯·") |
| | | @ApiOperation("æäº¤æ£éªåç³è¯·") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "inspectionId", value = "æ£éªåID", dataTypeClass = String.class, required = true), |
| | | }) |
| | |
| | | return Result.success(inspectionService.subInspectionByInsId(inspectionId)); |
| | | } |
| | | |
| | | @ApiOperation("ä½åºç³è¯·") |
| | | @ApiOperation("ä½åºæ£éªåç³è¯·") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "inspectionId", value = "æ£éªåID", dataTypeClass = String.class, required = true), |
| | | }) |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionMaterialList; |
| | | import com.yuanchu.limslaboratory.pojo.Material; |
| | | import com.yuanchu.limslaboratory.service.InspectionMaterialListService; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-17 |
| | | */ |
| | | @Api(tags = "æ£éªæ¨¡å") |
| | | @Api(tags = "æ£éªæ¨¡å-->æ£éªå-->æ ·åç¸å
³") |
| | | @RestController |
| | | @RequestMapping("/inspectionMaterialList") |
| | | public class InspectionMaterialListController { |
| | |
| | | @Autowired |
| | | InspectionMaterialListService inspectionMaterialListService; |
| | | |
| | | @ApiOperation("æ·»å æ ·å") |
| | | @ApiOperation("æ·»å æ£éªåä¸çæ£éªæ ·å") |
| | | @PostMapping("/addInspectionMaterialList") |
| | | public Result addInspectionMaterialList(@RequestHeader("X-Token") String token, @RequestBody InspectionMaterialList inspectionMaterialList) throws Exception { |
| | | inspectionMaterialList.setState(1); |
| | |
| | | return Result.success(inspectionMaterialListService.getById(inspectionMaterialListId)); |
| | | } |
| | | |
| | | @ApiOperation("ä¿®æ¹æ ·åä¿¡æ¯") |
| | | @ApiOperation("æ ¹æ®æ ·åidä¿®æ¹æ ·åä¿¡æ¯") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "inspectionMaterialListId", value = "æ ·åID", dataTypeClass = Integer.class, required = true), |
| | | }) |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.User; |
| | | import com.yuanchu.limslaboratory.service.UserService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-17 |
| | | */ |
| | | @Api(tags = "æ£éªæ¨¡å-->åé
计å-->æ£éªé¡¹ç®") |
| | | @RestController |
| | | @RequestMapping("/inspection-product-list") |
| | | public class InspectionProductListController { |
| | | |
| | | @Resource |
| | | UserService userService; |
| | | |
| | | @ApiOperation("æ¥è¯¢è¯éªåä¿¡æ¯") |
| | | @GetMapping("/selectUser") |
| | | public Result selectUser() { |
| | | return Result.success(userService.selectUser()); |
| | | } |
| | | |
| | | @ApiOperation("éæ©è¯éªåä¿¡æ¯") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "ç¨æ·ID", dataTypeClass = Integer.class, required = true), |
| | | }) |
| | | @PostMapping("/selectUserById") |
| | | public Result selectUserById(Integer id) { |
| | | return Result.success(userService.selectByUserId(id)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionRecordsDto; |
| | | 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 lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.limslaboratory.service.InspectionRecordsService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * æ£æµè®°å½(InspectionRecords)表æ§å¶å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-07-24 14:05:11 |
| | | */ |
| | | @Api(tags = "æ£éªæ¨¡å-->æ£æµè®°å½") |
| | | @RestController |
| | | @RequestMapping("/inspectionRecords") |
| | | @Slf4j |
| | | public class InspectionRecordsController { |
| | | |
| | | @Autowired |
| | | private InspectionRecordsService inspectionRecordsService; |
| | | |
| | | |
| | | @ApiOperation("æ ¹æ®æ ·åç项ç®id以åç¶æ(å¾
æäº¤)æ¥è¯¢æ£æµè®°å½") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "productId", value = "æ ·åä¸ç项ç®ID", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "submitState", value = "ç¶æ(为空=å¾
æäº¤)", dataTypeClass = Integer.class) |
| | | }) |
| | | @GetMapping("/selectByProductId/{productId}") |
| | | public Result selectByProductId(@PathVariable Integer productId, Integer submitState) { |
| | | return Result.success(inspectionRecordsService.selectByProductId(productId,submitState)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®æ ·åç项ç®id以åç¶æ(å¾
æäº¤)ä¿®æ¹æ£æµè®°å½") |
| | | @PutMapping("/upByProductId") |
| | | public Result upByProductId(@RequestBody InspectionRecordsDto inspectionRecordsDto) { |
| | | inspectionRecordsService.upByProductId(inspectionRecordsDto); |
| | | return Result.success("ä¿®æ¹æå!"); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * å°å¾
æäº¤ççæ£éªé¡¹ç®çæ£æµè®°å½çç¶æè½¬ä¸ºå¾
å®¡æ ¸ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("ä¿åå¹¶æäº¤æ£éªæ¥å") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªè®°å½ID", dataTypeClass = Integer.class, required = true), |
| | | }) |
| | | @PostMapping("/submitRecords/{id}") |
| | | public Result submitRecords(@PathVariable Integer id) { |
| | | inspectionRecordsService.submitRecords(id); |
| | | return Result.success("æäº¤æå!"); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Plan; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.yuanchu.limslaboratory.service.PlanService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-17 |
| | | */ |
| | | @Api(tags = "æ£éªæ¨¡å") |
| | | @Api(tags = "æ£éªæ¨¡å-->æ£éªè®¡å") |
| | | @RestController |
| | | @RequestMapping("/plan") |
| | | public class PlanController { |
| | |
| | | @Resource |
| | | private PlanService planService; |
| | | |
| | | @ApiOperation("æ¥è¯¢æææ£éªè®¡å表") |
| | | @ApiOperation("æ¥è¯¢æææ£éªè®¡ååé
") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize", value = "页æ°", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "countSize", value = "æ¡æ°/页", dataTypeClass = Integer.class, required = true), |
| | |
| | | return Result.success(planService.selectAllPlan(pageSize, countSize, state)); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢æ£éªè®¡åéé¢çåé
ä¿¡æ¯") |
| | | @ApiOperation("æ¥è¯¢æ£éªè®¡åéé¢çæ£éªé¡¹ç®") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ ·åç¼å·", dataTypeClass = Integer.class, required = true) |
| | | @ApiImplicitParam(name = "id", value = "æ ·åid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PutMapping("/selectPlanById/{id}") |
| | | public Result selectPlanById(@PathVariable Integer id) { |
| | | return Result.success(planService.selectById(id)); |
| | | @GetMapping("/selectProductById/{id}") |
| | | public Result selectProductById(@PathVariable Integer id) { |
| | | return Result.success(planService.selectProductById(id)); |
| | | } |
| | | |
| | | @ApiOperation("åé
æ£éªè®¡åä¸åé
项ç®") |
| | | @PostMapping("/upPlan") |
| | | public Result upPlan(@RequestBody InspectionProductList inspectionProductList) { |
| | | planService.upPlan(inspectionProductList); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("ä½åºæ£éªè®¡å") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªè®¡åID", dataTypeClass = Integer.class, required = true), |
| | | }) |
| | | @PostMapping("/delPlan") |
| | | public Result delPlan(Integer id) { |
| | | @PutMapping("/delPlan/{id}") |
| | | public Result delPlan(@PathVariable Integer id) { |
| | | return Result.success(planService.delPlan(id)); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢æåæ£éª") |
| | | @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) |
| | | }) |
| | | @GetMapping("/selectInspection") |
| | | public Result selectInspection(int pageSize, int countSize, Integer state) { |
| | | return Result.success(planService.selectInspection(pageSize,countSize,state)); |
| | | } |
| | | } |
| | |
| | | */ |
| | | public interface InspectionMapper extends BaseMapper<Inspection> { |
| | | |
| | | //æ¥è¯¢æææ£éªåå表 |
| | | List<InspectionDto> selectAllInspection(int pageSize, int countSize, Integer state); |
| | | |
| | | int selectInspectToCount(Integer state); |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface InspectionMaterialListMapper extends BaseMapper<InspectionMaterialList> { |
| | | |
| | | //æ¥è¯¢æ£éªåéé¢çç©æä¿¡æ¯ |
| | | List<InspectionMaterialList> selectInspectionMaterialListByInsId(String insId); |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface InspectionProductListMapper extends BaseMapper<InspectionProductList> { |
| | | |
| | | //æ·»å æ£éªé¡¹ç® |
| | | int addInspectionProductList(List<InspectionProductList> list); |
| | | |
| | | //æ ¹æ®æ ·åidæ¥è¯¢æ£éªé¡¹ç® |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionRecords; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionRecordsDto; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * æ£æµè®°å½(InspectionRecords)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-07-24 14:05:11 |
| | | */ |
| | | public interface InspectionRecordsMapper extends BaseMapper<InspectionRecords> { |
| | | |
| | | //æ ¹æ®æ ·åç¼å·id以åç¶æ(å¾
æäº¤)æ¥è¯¢æ£æµè®°å½ |
| | | InspectionRecordsDto selectByProductId(Integer productId,Integer submitState); |
| | | } |
| | | |
| | |
| | | import com.yuanchu.limslaboratory.pojo.dto.PlanDto; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface PlanMapper extends BaseMapper<Plan> { |
| | | |
| | | List<PlanDto> selectAllPlan(int pageSize, int countSize, Integer state); |
| | | //æ¥è¯¢æææ£éªè®¡ååé
|
| | | Map selectAllPlan(int pageSize, int countSize, Integer state); |
| | | |
| | | //æ¥è¯¢æåæ£éª |
| | | List<PlanDto> selectInspection(int pageSize, int countSize, Integer state); |
| | | } |
| | |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ApiModelProperty(value = "id", hidden = true) |
| | | private Integer id; |
| | | private int id; |
| | | |
| | | @ApiModelProperty(value = "materialId") |
| | | private String materialId; |
| | |
| | | private String internal; |
| | | |
| | | @ApiModelProperty(value = "å¼å§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "ç»ææ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime endTime; |
| | | |
| | | @TableLogic(value = "1", delval = "0") |
| | |
| | | @ApiModelProperty(value = "å
³è ç¨æ·id(è´è´£äººid)") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "å
³è 设å¤id") |
| | | private Integer deviceId; |
| | | |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.pojo.dto; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel(value="InspectionDtoæ£éªå对象", description="") |
| | | public class InspectionDto extends Inspection implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | public class InspectionRecordsDto implements Serializable { |
| | | |
| | | //æ£æµé¡¹ç® |
| | | @JsonSerialize |
| | | private String name; |
| | | |
| | | //è¯éªå |
| | | @JsonSerialize |
| | | private String userName; |
| | | |
| | | //è¯éªå¼å§æ¥æ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime startTime; |
| | | |
| | | //è¯éªç»ææ¥æ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime endTime; |
| | | |
| | | //è¯éªæ¹æ³ |
| | | @JsonSerialize |
| | | private String method; |
| | | |
| | | //è¯éªè¦æ± |
| | | @JsonSerialize |
| | | private String ask; |
| | | |
| | | //æ ·åç¼å· |
| | | @JsonSerialize |
| | | private int mid; |
| | | |
| | | //æ ·ååç§° |
| | | @JsonSerialize |
| | | private String materialName; |
| | | |
| | | //è§æ ¼åå· |
| | | @JsonSerialize |
| | | private String specificationsSerialNumber; |
| | | |
| | | //æ ·åæ°é |
| | | @JsonSerialize |
| | | private Integer materialNum; |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.pojo.dto; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.yuanchu.limslaboratory.pojo.Plan; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | public class PlanDto extends Plan implements Serializable { |
| | | public class PlanDto implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | @ApiModelProperty(value = "计åç¼å·") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "æ¥æ£ç±»å") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "æ¥æ£äºº") |
| | | @ApiModelProperty(value = "æ ·åç¼å·") |
| | | @JsonSerialize |
| | | private int mid; |
| | | |
| | | @ApiModelProperty(value = "å
³è æ¥æ£id(ç³è¯·åç¼å·)") |
| | | @JsonSerialize |
| | | private String inspectionId; |
| | | |
| | | @ApiModelProperty(value = "1ï¼å¾
认é¢ï¼2ï¼å¾
åé
ï¼3ï¼å·²åé
ï¼4ï¼è¶
æå¾
åé
ï¼5ï¼å·²å®æï¼0ï¼å·²ä½åº") |
| | | @JsonSerialize |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value = "ç»è®°æ¥æ", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | |
| | | @ApiModelProperty(value = "è¯éªè´è´£äºº") |
| | | @JsonSerialize |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value = "å
³è æ£éªäºº") |
| | | @JsonSerialize |
| | | private String inspectUserName; |
| | | |
| | | } |
| | |
| | | * @since 2023-07-17 |
| | | */ |
| | | public interface InspectionMaterialListService extends IService<InspectionMaterialList> { |
| | | |
| | | /** |
| | | * æ¥è¯¢æ£éªåéé¢çç©æä¿¡æ¯ |
| | | * @param insId |
| | | * @return |
| | | */ |
| | | List<InspectionMaterialList> selectInspectionMaterialListByInsId(String insId); |
| | | |
| | | /** |
| | | * æ·»å æ£éªåä¸çæ£éªæ ·å |
| | | * @param inspectionMaterialList |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | InspectionMaterialList addInspectionMaterialList(InspectionMaterialList inspectionMaterialList,String userId); |
| | | |
| | | /** |
| | | * æ ¹æ®æ£éªæ ·åidå 餿 ·åä¿¡æ¯ |
| | | * @param inspectionMaterialListId |
| | | * @return |
| | | */ |
| | | boolean delInspectionMaterialListByInsId(int inspectionMaterialListId); |
| | | |
| | | /** |
| | | *æ ¹æ®æ ·åidä¿®æ¹æ ·åä¿¡æ¯ |
| | | * @param inspectionMaterialListId |
| | | * @param inspectionMaterialList |
| | | * @return |
| | | */ |
| | | boolean updateInspectionMaterialList( Integer inspectionMaterialListId,InspectionMaterialList inspectionMaterialList); |
| | | } |
| | |
| | | */ |
| | | public interface InspectionProductListService extends IService<InspectionProductList> { |
| | | |
| | | int addInspectionProductList(List<InspectionProductList> list); |
| | | |
| | | /** |
| | | * æ ¹æ®æ£éªæ ·åidå 餿 ·åéçæ£éªé¡¹ç® |
| | | * @param inspectionMaterialListId |
| | | * @return |
| | | */ |
| | | int delInspectionProductList(int inspectionMaterialListId); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionRecords; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionRecordsDto; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æ£æµè®°å½(InspectionRecords)表æå¡æ¥å£ |
| | | * |
| | | * @author zss |
| | | * @since 2023-07-24 14:05:12 |
| | | */ |
| | | public interface InspectionRecordsService extends IService<InspectionRecords> { |
| | | |
| | | /** |
| | | * æ ¹æ®æ ·åç¼å·id以åç¶æ(å¾
æäº¤)æ¥è¯¢æ£æµè®°å½ |
| | | * @param productId |
| | | * @return |
| | | */ |
| | | InspectionRecordsDto selectByProductId(Integer productId, Integer submitState); |
| | | |
| | | /** |
| | | * æ ¹æ®æ ·åç¼å·id以åç¶æ(å¾
æäº¤)ä¿®æ¹æ£æµè®°å½ |
| | | * @param inspectionRecordsDto |
| | | */ |
| | | void upByProductId(InspectionRecordsDto inspectionRecordsDto); |
| | | |
| | | /** |
| | | * æ ¹æ®æ£éªè®°å½idä¿®æ¹æäº¤ç¶æ |
| | | * @param id |
| | | */ |
| | | void submitRecords(Integer id); |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | */ |
| | | public interface InspectionService extends IService<Inspection> { |
| | | |
| | | /** |
| | | * æ·»å æ£éªå |
| | | * @param userName |
| | | * @param type |
| | | * @return |
| | | */ |
| | | Inspection addInspection(String userName,int type); |
| | | |
| | | Map selectAllInspection(int pageSize, int countSize, Integer state); |
| | | /** |
| | | * å页æ¥è¯¢æææ£éªå |
| | | * @param pageSize |
| | | * @param countSize |
| | | * @param state |
| | | * @return |
| | | */ |
| | | List<InspectionDto> selectAllInspection(int pageSize, int countSize, Integer state); |
| | | |
| | | /** |
| | | *æ ¹æ®æ£éªåidä½åºæ£éªåç³è¯· |
| | | * @param inspectionId |
| | | * @return |
| | | */ |
| | | boolean delInspectionByInsId(String inspectionId); |
| | | |
| | | /** |
| | | * æ ¹æ®æ£éªåidæäº¤æ£éªç³è¯· |
| | | * @param inspectionId |
| | | * @return |
| | | */ |
| | | boolean subInspectionByInsId(String inspectionId); |
| | | |
| | | } |
| | |
| | | import com.yuanchu.limslaboratory.pojo.Plan; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.dto.PlanDto; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface PlanService extends IService<Plan> { |
| | | |
| | | List<PlanDto> selectAllPlan(int pageSize, int countSize, Integer state); |
| | | /** |
| | | * å页æ¥è¯¢æææ£éªè®¡å |
| | | * @param pageSize |
| | | * @param countSize |
| | | * @param state |
| | | * @return |
| | | */ |
| | | Map selectAllPlan(int pageSize, int countSize, Integer state); |
| | | |
| | | /** |
| | | * æ ¹æ®è®¡åidä½åºæ£éªè®¡å |
| | | * @param id |
| | | * @return |
| | | */ |
| | | boolean delPlan(Integer id); |
| | | |
| | | List<InspectionProductList> selectById(Integer id); |
| | | /** |
| | | * æ ¹æ®æ ·åidæ¥è¯¢æ£éªè®¡åé颿£éªé¡¹ç® |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<InspectionProductList> selectProductById(Integer id); |
| | | |
| | | /** |
| | | * ç»æ£éªè®¡åä¸çæ£éªé¡¹ç®åé
è¯éªå,设å¤,以忥æ |
| | | * @param inspectionProductList |
| | | */ |
| | | void upPlan(InspectionProductList inspectionProductList); |
| | | |
| | | /** |
| | | * æ¥è¯¢æåæ£éª |
| | | * @param pageSize |
| | | * @param countSize |
| | | * @param state |
| | | * @return |
| | | */ |
| | | List<PlanDto> selectInspection(int pageSize, int countSize, Integer state); |
| | | } |
| | |
| | | ProductMapper productMapper; |
| | | |
| | | @Resource |
| | | InspectionProductListService inspectionProductListService; |
| | | |
| | | @Resource |
| | | InspectionProductListMapper inspectionProductListMapper; |
| | | |
| | | //æ¥è¯¢æ£éªåéé¢çç©æä¿¡æ¯ |
| | | @Override |
| | | public List<InspectionMaterialList> selectInspectionMaterialListByInsId(String insId) { |
| | | return inspectionMaterialListMapper.selectInspectionMaterialListByInsId(insId); |
| | | } |
| | | |
| | | //æ·»å æ£éªåä¸çæ£éªæ ·å |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public InspectionMaterialList addInspectionMaterialList(InspectionMaterialList inspectionMaterialList,String userId) { |
| | |
| | | .setUserId(Integer.parseInt(userId)); |
| | | list1.add(inspectionProductList); |
| | | }); |
| | | //æ·»å æ£éªé¡¹ç® |
| | | int judge2 = inspectionProductListMapper.addInspectionProductList(list1); |
| | | return judge>0&&judge2>0?inspectionMaterialList:null; |
| | | } |
| | |
| | | list.setState(0); |
| | | list.setId(inspectionMaterialListId); |
| | | int judge1 = inspectionMaterialListMapper.updateById(list); |
| | | //å 餿 ·åæ£éªé¡¹ç® |
| | | UpdateWrapper<InspectionProductList> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq("inspection_material_list_id", inspectionMaterialListId).set("state", 0); |
| | | int judge2 = inspectionProductListMapper.update(new InspectionProductList(), wrapper); |
| | | //æ ¹æ®æ ·åidå 餿£éªæ ·åä¸çæ£éªé¡¹ç® |
| | | int judge2 = inspectionProductListService.delInspectionProductList(inspectionMaterialListId); |
| | | return judge1>0&&judge2>0; |
| | | } |
| | | |
| | | //ä¿®æ¹æ ·åä¿¡æ¯ |
| | | //æ ¹æ®æ ·åidä¿®æ¹æ ·åä¿¡æ¯ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean updateInspectionMaterialList( Integer inspectionMaterialListId,InspectionMaterialList inspectionMaterialList) { |
| | | LambdaUpdateWrapper<InspectionMaterialList> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | //æ ¹æ®æ ·åidæ¥è¯¢ |
| | | updateWrapper.eq(InspectionMaterialList::getId,inspectionMaterialListId); |
| | | int judge = inspectionMaterialListMapper.update(inspectionMaterialList, updateWrapper); |
| | | return judge>0; |
| | |
| | | @Resource |
| | | InspectionProductListMapper inspectionProductListMapper; |
| | | |
| | | @Override |
| | | public int addInspectionProductList(List<InspectionProductList> list) { |
| | | return inspectionProductListMapper.addInspectionProductList(list); |
| | | } |
| | | |
| | | |
| | | //æ ¹æ®æ£éªæ ·åidå 餿 ·åéçæ£éªé¡¹ç® |
| | | @Override |
| | | public int delInspectionProductList(int inspectionMaterialListId) { |
| | | UpdateWrapper<InspectionProductList> wrapper = new UpdateWrapper<>(); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionRecordsMapper; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionRecords; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionRecordsDto; |
| | | import com.yuanchu.limslaboratory.service.InspectionRecordsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.sql.Wrapper; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æ£æµè®°å½(InspectionRecords)表æå¡å®ç°ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-07-24 14:05:12 |
| | | */ |
| | | @Service("inspectionRecordsService") |
| | | public class InspectionRecordsServiceImpl extends ServiceImpl<InspectionRecordsMapper, InspectionRecords> implements InspectionRecordsService { |
| | | |
| | | @Resource |
| | | InspectionRecordsMapper inspectionRecordsMapper; |
| | | |
| | | //æ ¹æ®æ ·åç¼å·id以åç¶æ(å¾
æäº¤)æ¥è¯¢æ£æµè®°å½ |
| | | @Override |
| | | public InspectionRecordsDto selectByProductId(Integer productId, Integer submitState) { |
| | | //ç¶æä¸ºç©ºçæ¶åé»è®¤ä¸ºå¾
æäº¤ |
| | | if (submitState==null){ |
| | | submitState=0; |
| | | } |
| | | return inspectionRecordsMapper.selectByProductId(productId,submitState); |
| | | } |
| | | |
| | | //æ ¹æ®æ ·åç¼å·id以åç¶æ(å¾
æäº¤)ä¿®æ¹æ£æµè®°å½ |
| | | @Override |
| | | public void upByProductId(InspectionRecordsDto inspectionRecordsDto) { |
| | | //??? |
| | | } |
| | | |
| | | //æ ¹æ®æ£éªè®°å½idä¿®æ¹æäº¤ç¶æ |
| | | @Override |
| | | public void submitRecords(Integer id) { |
| | | //æ´æ°æ£éªè®°å½è¡¨ |
| | | InspectionRecords inspectionRecords = inspectionRecordsMapper.selectById(id); |
| | | inspectionRecords.setSubmitState(1); |
| | | inspectionRecords.setUpdateTime(LocalDateTime.now()); |
| | | inspectionRecordsMapper.updateById(inspectionRecords); |
| | | //æ°å¢ä¸ä¸ªæ£éªæ¥å |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import com.yuanchu.limslaboratory.service.InspectionService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Resource |
| | | private InspectionMapper inspectionMapper; |
| | | |
| | | @Resource |
| | | private PlanMapper planMapper; |
| | | |
| | | @Resource |
| | | InspectionMaterialListMapper inspectionMaterialListMapper; |
| | | |
| | | //æ·»å æ£éªç³è¯·å |
| | | @Override |
| | | public Inspection addInspection(String userName,int type) { |
| | | Inspection inspection = new Inspection(type, 0,1,1, userName); |
| | | System.out.println(inspection); |
| | | int judge = inspectionMapper.insert(inspection); |
| | | System.out.println(judge); |
| | | return judge>0?inspection:null; |
| | | } |
| | | |
| | | //æ¥è¯¢æææ£éªåå表 |
| | | @Override |
| | | public Map selectAllInspection(int pageSize, int countSize, Integer state) { |
| | | Map map = new HashMap(); |
| | | map.put("data",inspectionMapper.selectAllInspection((pageSize - 1) * countSize,pageSize * countSize, state)); |
| | | map.put("count", inspectionMapper.selectInspectToCount(state)); |
| | | return map; |
| | | public List<InspectionDto> selectAllInspection(int pageSize, int countSize, Integer state) { |
| | | return inspectionMapper.selectAllInspection((pageSize - 1) * countSize,pageSize * countSize, state); |
| | | } |
| | | |
| | | //ä½åºç³è¯·æ£éªå |
| | |
| | | Inspection inspection = inspectionMapper.selectById(inspectionId); |
| | | inspection.setState(0); |
| | | int judge1 = inspectionMapper.updateById(inspection); |
| | | //æ£éªæ ·åä½åº |
| | | //æ£éªæ ·åä½åº(æ ¹æ®æ¥æ£åidå 餿 ·åä¿¡æ¯) |
| | | UpdateWrapper<InspectionMaterialList> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq("inspection_id", inspectionId).set("state", 0); |
| | | int judge2 = inspectionMaterialListMapper.update(new InspectionMaterialList(),wrapper); |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionMaterialListMapper; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionProductListMapper; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionMaterialList; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | |
| | | PlanMapper planMapper; |
| | | |
| | | @Resource |
| | | InspectionMaterialListMapper inspectionMaterialListMapper; |
| | | |
| | | @Resource |
| | | InspectionProductListMapper inspectionProductListMapper; |
| | | |
| | | //æ¥è¯¢æææ£éªè®¡å |
| | | //æ¥è¯¢æææ£éªè®¡ååé
|
| | | @Override |
| | | public List<PlanDto> selectAllPlan(int pageSize, int countSize, Integer state) { |
| | | return planMapper.selectAllPlan((pageSize - 1) * countSize,pageSize * countSize, state); |
| | | public Map selectAllPlan(int pageSize, int countSize, Integer state) { |
| | | if (state == null) { |
| | | state = 2; |
| | | } |
| | | return planMapper.selectAllPlan((pageSize - 1) * countSize, pageSize * countSize, state); |
| | | } |
| | | |
| | | //ä½åºæ£éªè®¡å |
| | |
| | | //ç¶ææ¹ä¸ºä½åº0 |
| | | plan.setState(0); |
| | | int judge = planMapper.updateById(plan); |
| | | return judge>0; |
| | | return judge > 0; |
| | | } |
| | | |
| | | //æ¥è¯¢æ£éªè®¡åéé¢çåé
ä¿¡æ¯ |
| | | //æ ¹æ®æ ·åidæ¥è¯¢æ£éªè®¡åéé¢çæ£éªé¡¹ç® |
| | | @Override |
| | | public List<InspectionProductList> selectById(Integer id) { |
| | | return inspectionProductListMapper.selectByMaterId(id); |
| | | public List<InspectionProductList> selectProductById(Integer id) { |
| | | return inspectionProductListMapper.selectByMaterId(id); |
| | | } |
| | | |
| | | //ä¿®æ¹æ£éªè®¡åéåé
计åçä¿¡æ¯ |
| | | @Override |
| | | public void upPlan(InspectionProductList inspectionProductList) { |
| | | LambdaUpdateWrapper<InspectionProductList> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(InspectionProductList::getInspectionMaterialListId, inspectionProductList.getInspectionMaterialListId()) |
| | | .eq(InspectionProductList::getMethod, inspectionProductList.getMethod()); |
| | | inspectionProductListMapper.update(inspectionProductList, updateWrapper); |
| | | } |
| | | |
| | | //æ¥è¯¢æåæ£éª |
| | | @Override |
| | | public List<PlanDto> selectInspection(int pageSize, int countSize, Integer state) { |
| | | return planMapper.selectInspection((pageSize - 1) * countSize, pageSize * countSize, state); |
| | | } |
| | | } |
| | |
| | | <!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.create_time, user_name, inspect_start_time, inspect_end_time, u.name inspectUserName |
| | | from inspection i left join user u |
| | | 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} |
| | |
| | | order by i.create_time desc |
| | | limit #{pageSize},#{countSize} |
| | | </select> |
| | | <select id="selectInspectToCount" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from inspection i left join user u |
| | | on i.inspect_user_id = u.id |
| | | <if test="state!=null"> |
| | | where state = #{state} |
| | | </if> |
| | | </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.InspectionMaterialListMapper"> |
| | | <select id="selectInspectionMaterialListByInsId" resultType="InspectionMaterialList"> |
| | | <select id="selectInspectionMaterialListByInsId" resultType="com.yuanchu.limslaboratory.pojo.InspectionMaterialList"> |
| | | select id, |
| | | material_id, |
| | | material_num, |
| | |
| | | specifications_number_of_cores, |
| | | specifications_instruct, |
| | | notes |
| | | from inspection_material_list |
| | | from lims_laboratory.inspection_material_list |
| | | where state = 1 |
| | | and inspection_id = #{insId} |
| | | </select> |
| | |
| | | </insert> |
| | | |
| | | <select id="selectByMaterId" resultType="com.yuanchu.limslaboratory.pojo.InspectionProductList"> |
| | | select name,method,ask,unit,required,internal, start_time, end_time, user_id, instrument_id |
| | | select id, |
| | | name, |
| | | method, |
| | | ask, |
| | | unit, |
| | | required, |
| | | internal, |
| | | start_time, |
| | | end_time, |
| | | state, |
| | | create_time, |
| | | update_time, |
| | | version, |
| | | inspection_material_list_id, |
| | | user_id, |
| | | instrument_id |
| | | from lims_laboratory.inspection_product_list |
| | | where inspection_material_list_id = #{id} |
| | | </select> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.InspectionRecordsMapper"> |
| | | <select id="selectByProductId" resultType="com.yuanchu.limslaboratory.pojo.dto.InspectionRecordsDto"> |
| | | select yp.name, |
| | | yp.username, |
| | | ir.create_time, |
| | | ir.update_time, |
| | | ir.method, |
| | | yp.ask, |
| | | yp.mid, |
| | | yp.material_name, |
| | | yp.specifications_serial_number, |
| | | yp.material_num |
| | | from lims_laboratory.inspection_records ir |
| | | left join (select ipl.id id, |
| | | ipl.name, |
| | | u.name username, |
| | | ipl.ask, |
| | | iml.id mid, |
| | | iml.material_name, |
| | | iml.specifications_serial_number, |
| | | iml.material_num |
| | | from lims_laboratory.inspection_product_list ipl |
| | | left join lims_laboratory.inspection_material_list iml on ipl.inspection_material_list_id = iml.id left join |
| | | lims_laboratory.user u on ipl.user_id = u.id) yp |
| | | on ir.inspection_product_list_id = yp.id |
| | | <where> |
| | | <if test="productId != null"> |
| | | AND inspection_product_list_id = #{productId} |
| | | </if> |
| | | AND submit_state = #{submitState} |
| | | </where> |
| | | </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.PlanMapper"> |
| | | <select id="selectAllPlan" resultType="com.yuanchu.limslaboratory.pojo.dto.PlanDto"> |
| | | <select id="selectAllPlan" resultType="Map"> |
| | | select p.id,results,p.state,p.create_time,p.inspection_id,user_id,results,type,user_name |
| | | from lims_laboratory.plan p right join lims_laboratory.inspection i |
| | | from lims_laboratory.plan p left join lims_laboratory.inspection i |
| | | on i.id=p.inspection_id |
| | | <if test="state!=null"> |
| | | where p.state = #{state} |
| | |
| | | order by p.create_time desc |
| | | limit #{pageSize},#{countSize} |
| | | </select> |
| | | |
| | | <select id="selectInspection" resultType="com.yuanchu.limslaboratory.pojo.dto.PlanDto"> |
| | | select i.mid , p.inspection_id , p.state, p.create_time, p.name userName, i.name inspectUserName |
| | | from (select inspection_id, state, plan.create_time, name |
| | | from lims_laboratory.plan |
| | | left join lims_laboratory.user on plan.user_id = user.id) p |
| | | left join (select inspection.id, name, iml.id mid |
| | | from lims_laboratory.inspection |
| | | left join lims_laboratory.user on user.id = inspection.inspect_user_id |
| | | left join lims_laboratory.inspection_material_list iml on inspection.id = iml.inspection_id) i |
| | | on p.inspection_id = i.id |
| | | <if test="state!=null"> |
| | | where p.state = #{state} |
| | | </if> |
| | | order by p.create_time desc |
| | | limit #{pageSize},#{countSize} |
| | | </select> |
| | | </mapper> |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Instrument; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateInstrumentDto; |
| | | import com.yuanchu.limslaboratory.service.InstrumentService; |
| | | import com.yuanchu.limslaboratory.service.UserService; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-20 |
| | | */ |
| | | @Api(tags = "å®éªå®¤-->设å¤å°è´¦-->2ãä»ªå¨æ¨¡å") |
| | | @RestController |
| | | @RequestMapping("/instrument") |
| | | public class InstrumentController { |
| | | |
| | | @Autowired |
| | | private InstrumentService instrumentService; |
| | | |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | @ApiOperation("æ·»å 仪å¨è®¾å¤") |
| | | @PostMapping("/add") |
| | | public Result<?> addInstrumentInformation(@RequestBody Instrument instrument) { |
| | | Integer isInsertSuccess = instrumentService.addInstrumentInformation(instrument); |
| | | if (isInsertSuccess == 1){ |
| | | return Result.success("æ·»å ã" + instrument.getEquipmentName() + "ãæå!"); |
| | | } |
| | | return Result.fail("仪å¨è®¾å¤ç¼å·éå¤ï¼æ·»å ã" + instrument.getEquipmentName() + "ã失败! "); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®åç±»Idï¼å页å表å±ç¤º") |
| | | @GetMapping("/list") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "classifyId", value = "åç±»Id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "pageNo", value = "èµ·å§é¡µ", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯ä¸é¡µæ°é", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "conditions", value = "æ¥è¯¢ç¶æ:é»è®¤å
¨é¨", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "whetherWhether", value = "æ¯å¦å·²è¿æ", dataTypeClass = Boolean.class), |
| | | @ApiImplicitParam(name = "numberOrNameOrSpecifications", value = "ç¼å·/设å¤åç§°/è§æ ¼åå·", dataTypeClass = String.class) |
| | | }) |
| | | public Result<?> getListInstrumentInformation(Integer pageNo, |
| | | Integer pageSize, |
| | | Integer conditions, |
| | | Integer classifyId, |
| | | Boolean whetherWhether, |
| | | String numberOrNameOrSpecifications) { |
| | | IPage<Map<String, Object>> pageList = instrumentService.getListInstrumentInformation(conditions, whetherWhether, numberOrNameOrSpecifications, |
| | | classifyId, new Page<Objects>(pageNo, pageSize)); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("row", pageList.getRecords()); |
| | | map.put("total", pageList.getTotal()); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation("å é¤ä»ªå¨æ°æ®") |
| | | @DeleteMapping("/delete") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "instrumentId", value = "仪å¨Id", dataTypeClass = String.class, required = true) |
| | | }) |
| | | public Result<?> deleteInstrumentInformation(String instrumentId) { |
| | | Boolean isDeleteSuccess = instrumentService.deleteInstrumentInformation(instrumentId); |
| | | if (isDeleteSuccess){ |
| | | return Result.success("å é¤ä»ªå¨æåï¼"); |
| | | } |
| | | return Result.fail("å é¤ä»ªå¨å¤±è´¥ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("æ·»å ä»ªå¨æ¶ä¿ç®¡äººä¸ææ¡æ°æ®") |
| | | @GetMapping("/get_user") |
| | | public Result<?> getMapUserInformation() { |
| | | return Result.success(userService.getUserNameAndId()); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®ä»ªå¨Idè·åä¿¡æ¯ç¨äºç¼è¾") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "InstrumentId", value = "åç±»Id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/get_instrument") |
| | | public Result<?> getIdInstrumentInformation(Integer InstrumentId) { |
| | | Instrument idInstrumentInformation = instrumentService.getIdInstrumentInformation(InstrumentId); |
| | | return Result.success(idInstrumentInformation); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®ä»ªå¨Idæ´æ°æ°æ®") |
| | | @PutMapping("/update") |
| | | public Result<?> updateEquipmentPointInformation(@RequestBody UpdateInstrumentDto updateInstrumentDto) throws Exception { |
| | | Instrument instrument = JackSonUtil.unmarshal(JackSonUtil.marshal(updateInstrumentDto), Instrument.class); |
| | | Integer isUpdateSuccess = instrumentService.updateEquipmentPointInformation(instrument); |
| | | if (isUpdateSuccess == 1){ |
| | | return Result.success("æ´æ°ã" + instrument.getEquipmentName() + "ãæå!"); |
| | | } |
| | | return Result.fail("仪å¨è®¾å¤ç¼å·éå¤ï¼æ´æ°ã" + instrument.getEquipmentName() + "ã失败! "); |
| | | } |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.EquipmentPoint; |
| | | import com.yuanchu.limslaboratory.pojo.MetricalInformation; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateEquipmentPointDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateMetricalInformationDto; |
| | | import com.yuanchu.limslaboratory.service.MetricalInformationService; |
| | | import com.yuanchu.limslaboratory.service.UserService; |
| | | 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.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-20 |
| | | */ |
| | | @Api(tags = "å®éªå®¤-->设å¤å°è´¦-->4ã计éä¿¡æ¯") |
| | | @RestController |
| | | @RequestMapping("/metrical-information") |
| | | public class MetricalInformationController { |
| | | |
| | | @Autowired |
| | | private MetricalInformationService metricalInformationService; |
| | | |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | @ApiOperation("æ·»å 计éä¿¡æ¯") |
| | | @PostMapping("/add") |
| | | public Result<?> addMetricalInformation(MetricalInformation metricalInformation, |
| | | @RequestPart(value = "file", required = false) MultipartFile file) { |
| | | Integer isInsertSuccess = metricalInformationService.addEquipmentPointInformation(metricalInformation, file); |
| | | if (isInsertSuccess == 1){ |
| | | return Result.success("æ·»å ã"+ metricalInformation.getMeasurementUnit() +"ãæåï¼"); |
| | | } |
| | | return Result.fail("æ·»å ã"+ metricalInformation.getMeasurementUnit() +"ã失败ï¼è®¾å¤ç ç¹ç¼ç éå¤ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢ææè®¡éä¿¡æ¯æ°æ®") |
| | | @GetMapping("/list") |
| | | public Result<?> getListMetricalInformation() { |
| | | List<Map<String, Object>> list = metricalInformationService.getListEquipmentPointInformation(); |
| | | return Result.success(list); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®è®¡éä¿¡æ¯Idå 餿°æ®") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "metricalInformationId", value = "计éä¿¡æ¯Id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @DeleteMapping("/delete") |
| | | public Result<?> deleteMetricalInformation(Integer metricalInformationId) { |
| | | Integer isDeleteSuccess = metricalInformationService.deleteMetricalInformation(metricalInformationId); |
| | | if (isDeleteSuccess == 1){ |
| | | return Result.success("å 餿åï¼"); |
| | | } |
| | | return Result.fail("å é¤å¤±è´¥ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®è®¡éä¿¡æ¯Idæ´æ°æ°æ®") |
| | | @PutMapping("/update") |
| | | public Result<?> updateMetricalInformation(UpdateMetricalInformationDto updateMetricalInformationDto, |
| | | @RequestPart(value = "file", required = false) MultipartFile file) throws Exception { |
| | | MetricalInformation metricalInformation = JackSonUtil.unmarshal(JackSonUtil.marshal(updateMetricalInformationDto), MetricalInformation.class); |
| | | Integer isUpdateSuccess = metricalInformationService.updateMetricalInformation(metricalInformation, file); |
| | | if (isUpdateSuccess == 1){ |
| | | return Result.success("æ´æ°æåï¼"); |
| | | } |
| | | return Result.fail("æ´æ°å¤±è´¥ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("æ·»å 计éä¿¡æ¯æ¶è´è´£äººä¸ææ¡æ°æ®") |
| | | @GetMapping("/get_user") |
| | | public Result<?> getMapUserInformation() { |
| | | return Result.success(userService.getUserNameAndId()); |
| | | } |
| | | } |
| | |
| | | * @since 2023-07-17 |
| | | */ |
| | | public interface MaterialMapper extends BaseMapper<Material> { |
| | | |
| | | //æ¥è¯¢ç©æä¿¡æ¯ |
| | | List<Material> selectMaterialLimit(int num1,int num2); |
| | | |
| | | //æ ¹æ®ç©æidæ¥è¯¢ç©æä¿¡æ¯ |
| | | Map selectMaterialById(String materialId); |
| | | } |
| | |
| | | @Resource |
| | | MaterialMapper materialMapper; |
| | | |
| | | //æ¥è¯¢ç©æä¿¡æ¯ |
| | | @Override |
| | | public List<Material> selectMaterialLimit(int pageSize, int countSize) { |
| | | return materialMapper.selectMaterialLimit((pageSize - 1) * countSize,pageSize * countSize); |
| | | } |
| | | |
| | | //æ ¹æ®ç©æidæ¥è¯¢ç©æä¿¡æ¯ |
| | | @Override |
| | | public Map selectMaterialById(String materialId) { |
| | | return materialMapper.selectMaterialById(materialId); |
| | |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | |
| | | Map<String, String> selectUserByUserId(int userId); |
| | | |
| | | IPage<PagePersonnelVo> getNewPersonnelPage(String name, Page page); |
| | | |
| | | List<User> selectUser(); |
| | | } |
| | |
| | | import com.yuanchu.limslaboratory.vo.NewPersonnelVo; |
| | | import com.yuanchu.limslaboratory.vo.PagePersonnelVo; |
| | | import com.yuanchu.limslaboratory.vo.UpdatePersonnelVo; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | String selectByUserId(Integer userId); |
| | | |
| | | /** |
| | | * è·åææç¨æ·çåç§°ä¸Id |
| | | * æ¥è¯¢ææç¨æ·ä¿¡æ¯ |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getUserNameAndId(); |
| | | List<User> selectUser(); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getUserNameAndId() { |
| | | LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.select(User::getId, User::getName); |
| | | return userMapper.selectMaps(wrapper); |
| | | public List<User> selectUser() { |
| | | return userMapper.selectUser(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | <?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.UserMapper"> |
| | | |
| | | <select id="selectUserByUserId" parameterType="int" resultType="Map"> |
| | | SELECT u.account account,u.name uname,u.phone,u.email,u.info,e.byname e_byname,e.`name` e_name,e.link_name e_link_name,e.link_phone e_phone |
| | | FROM enterprise e,`user` u |
| | | SELECT u.account account, |
| | | u.name uname, |
| | | u.phone, |
| | | u.email, |
| | | u.info, |
| | | e.byname e_byname, |
| | | e.`name` e_name, |
| | | e.link_name e_link_name, |
| | | e.link_phone e_phone |
| | | FROM enterprise e, |
| | | `user` u |
| | | WHERE e.`id` = u.`enterprise_id` |
| | | AND u.id = #{userId} |
| | | AND u.id = #{userId} |
| | | </select> |
| | | |
| | | <resultMap id="PagePersonnelVoMap" type="com.yuanchu.limslaboratory.vo.PagePersonnelVo"> |
| | |
| | | </resultMap> |
| | | <select id="getNewPersonnelPage" resultMap="PagePersonnelVoMap"> |
| | | SELECT u.`id`, u.`name` username, r.`name` roleName, u.`create_time`, IFNULL(u.`age`, '---') age, |
| | | IFNULL(u.`phone`, '---') phone, IFNULL(u.`email`, '---') email, u.`job_state` |
| | | IFNULL(u.`phone`, '---') phone, IFNULL(u.`email`, '---') email, u.`job_state` |
| | | FROM `user` u, role r |
| | | WHERE u.`role_id` = r.`id` |
| | | <if test="name != null"> |
| | | AND u.name = #{name} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectUser" resultType="com.yuanchu.limslaboratory.pojo.User"> |
| | | select id, |
| | | account, |
| | | password, |
| | | name, |
| | | phone, |
| | | email, |
| | | age, |
| | | job_state, |
| | | info, |
| | | create_time, |
| | | update_time, |
| | | version, |
| | | role_id, |
| | | enterprise_id |
| | | from lims_laboratory.user |
| | | </select> |
| | | </mapper> |