Merge remote-tracking branch 'origin/master'
# Conflicts:
# inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/InspectionMaterialListController.java
# inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionMaterialListServiceImpl.java
# standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/MaterialMapper.java
# standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/ProductMapper.java
# standard-server/src/main/java/com/yuanchu/limslaboratory/service/MaterialService.java
# standard-server/src/main/java/com/yuanchu/limslaboratory/service/ProductService.java
# standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/MaterialServiceImpl.java
# standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ProductServiceImpl.java
# standard-server/src/main/resources/mapper/ProductMapper.xml
# user-server/src/main/java/com/yuanchu/limslaboratory/service/UserService.java
| | |
| | | return Result.success(inspectionService.selectAllInspection(pageSize, countSize, state)); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢æ£éªåéé¢çç©æä¿¡æ¯") |
| | | @ApiOperation("æ¥è¯¢æ£éªåéé¢çæ ·åä¿¡æ¯") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "inspectionId", value = "æ¥æ£åID", dataTypeClass = String.class, required = true), |
| | | }) |
| | |
| | | }) |
| | | @PostMapping("/submitInspection") |
| | | public Result submitInspection(String inspectionId) { |
| | | return Result.success(inspectionService.subInspectionByInsId(inspectionId)); |
| | | inspectionService.subInspectionByInsId(inspectionId); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("ä½åºæ£éªåç³è¯·") |
| | |
| | | }) |
| | | @PostMapping("/delInspection") |
| | | public Result delInspection(String inspectionId) { |
| | | return Result.success(inspectionService.delInspectionByInsId(inspectionId)); |
| | | inspectionService.delInspectionByInsId(inspectionId); |
| | | return Result.success(); |
| | | } |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.mapper.InspectionMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionMaterialList; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionMaterialListDto; |
| | | import com.yuanchu.limslaboratory.service.InspectionMaterialListService; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | InspectionMaterialListService inspectionMaterialListService; |
| | | |
| | | @Resource |
| | | InspectionMapper inspectionMapper; |
| | | |
| | | @ApiOperation("æ·»å æ£éªåä¸çæ£éªæ ·å") |
| | | @PostMapping("/addInspectionMaterialList") |
| | | public Result addInspectionMaterialList(@RequestHeader("X-Token") String token, @RequestBody InspectionMaterialList inspectionMaterialList) throws Exception { |
| | | inspectionMaterialList.setState(1); |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | return Result.success(inspectionMaterialListService.addInspectionMaterialList(inspectionMaterialList, "" + unmarshal.get("id"))); |
| | | //妿æ£éªåå·²ä½åº,ç¶æä¸º0,åæ æ³æ·»å æ ·å |
| | | Inspection inspection = inspectionMapper.selectById(inspectionMaterialList.getInspectionId()); |
| | | if (inspection.getState()==0) { |
| | | return Result.fail("æ£éªåå·²ä½åºæ æ³æ·»å æ£éªæ ·å"); |
| | | } |
| | | else { |
| | | inspectionMaterialList.setState(1); |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | inspectionMaterialListService.addInspectionMaterialList(inspectionMaterialList, "" + unmarshal.get("id")); |
| | | return Result.success(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("å 餿 ·å") |
| | |
| | | }) |
| | | @PostMapping("/delInspectionMaterialList") |
| | | public Result delInspectionMaterialList(int inspectionMaterialListId) { |
| | | return Result.success(inspectionMaterialListService.delInspectionMaterialListByInsId(inspectionMaterialListId)); |
| | | inspectionMaterialListService.delInspectionMaterialListByInsId(inspectionMaterialListId); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®Idæ¥è¯¢æ ·åä¿¡æ¯") |
| | | @ApiOperation("æ ¹æ®æ ·åIdæ¥è¯¢æ ·åä¿¡æ¯") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "inspectionId", value = "æ ·åID", dataTypeClass = String.class, required = true), |
| | | }) |
| | |
| | | @ApiImplicitParam(name = "inspectionMaterialListId", value = "æ ·åID", dataTypeClass = Integer.class, required = true), |
| | | }) |
| | | @PutMapping("/updateInspectionMaterialList/{inspectionMaterialListId}") |
| | | public Result updateInspectionMaterialList(@PathVariable Integer inspectionMaterialListId, @RequestBody InspectionMaterialList inspectionMaterialList) { |
| | | return Result.success(inspectionMaterialListService.updateInspectionMaterialList(inspectionMaterialListId, inspectionMaterialList)); |
| | | public Result updateInspectionMaterialList(@PathVariable Integer inspectionMaterialListId, @RequestBody InspectionMaterialListDto inspectionMaterialListDto) { |
| | | inspectionMaterialListService.updateInspectionMaterialList(inspectionMaterialListId, inspectionMaterialListDto); |
| | | return Result.success(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.User; |
| | | import com.yuanchu.limslaboratory.pojo.Instrument; |
| | | import com.yuanchu.limslaboratory.service.InspectionProductListService; |
| | | import com.yuanchu.limslaboratory.service.InstrumentService; |
| | | import com.yuanchu.limslaboratory.service.UserService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-17 |
| | | */ |
| | | @Api(tags = "æ£éªæ¨¡å-->åé
计å-->æ£éªé¡¹ç®") |
| | | @Api(tags = "æ£éªæ¨¡å-->æ£éªæ ·å-->æ£éªé¡¹ç®") |
| | | @RestController |
| | | @RequestMapping("/inspection-product-list") |
| | | public class InspectionProductListController { |
| | | |
| | | @Resource |
| | | UserService userService; |
| | | |
| | | @Resource |
| | | InstrumentService instrumentService; |
| | | |
| | | @Resource |
| | | InspectionProductListService inspectionProductListService; |
| | | |
| | | @ApiOperation("æ¥è¯¢è¯éªåä¿¡æ¯") |
| | | @GetMapping("/selectUser") |
| | |
| | | public Result selectUserById(Integer id) { |
| | | return Result.success(userService.selectByUserId(id)); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢è®¾å¤ä¿¡æ¯") |
| | | @GetMapping("/selectInstrument") |
| | | public Result selectInstrument() { |
| | | return Result.success(instrumentService.selectInstrument()); |
| | | } |
| | | |
| | | @ApiOperation("éæ©è®¾å¤ä¿¡æ¯") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "设å¤ID", dataTypeClass = Integer.class, required = true), |
| | | }) |
| | | @PostMapping("/selectInstrumentById") |
| | | public Result selectInstrumentById(Integer id) { |
| | | Instrument instrument = instrumentService.getById(id); |
| | | return Result.success(instrument.getEquipmentName()); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®æ£éªè®¡åæ ·åidæ¥è¯¢æ£éªé¡¹ç®") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ ·åid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selectProductById/{id}") |
| | | public Result selectProductById(@PathVariable Integer id) { |
| | | return Result.success(inspectionProductListService.selectProductById(id)); |
| | | } |
| | | |
| | | } |
| | |
| | | return Result.success("ä¿®æ¹æå!"); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * å°å¾
æäº¤ççæ£éªé¡¹ç®çæ£æµè®°å½çç¶æè½¬ä¸ºå¾
å®¡æ ¸ |
| | | * @param id |
| | |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.yuanchu.limslaboratory.pojo.Instrument; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionProductListDto; |
| | | import com.yuanchu.limslaboratory.service.PlanService; |
| | | import com.yuanchu.limslaboratory.service.ProductService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | @Resource |
| | | private PlanService planService; |
| | | |
| | | @Resource |
| | | ProductService productService; |
| | | |
| | | @ApiOperation("æ¥è¯¢æææ£éªè®¡ååé
") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize", value = "页æ°", dataTypeClass = Integer.class, required = true), |
| | |
| | | return Result.success(planService.selectAllPlan(pageSize, countSize, state)); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢æ£éªè®¡åéé¢çæ£éªé¡¹ç®") |
| | | @ApiOperation("æ ¹æ®é¡¹ç®åæ¥è¯¢ææè¯éªæ¹æ³") |
| | | @GetMapping("/selectInstrumentByProname") |
| | | public Result selectInstrumentByProname(String name) { |
| | | return Result.success(productService.selectInstrumentByProname(name)); |
| | | } |
| | | |
| | | @ApiOperation("éæ©è¯éªæ¹æ³") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ ·åid", dataTypeClass = Integer.class, required = true) |
| | | @ApiImplicitParam(name = "id", value = "项ç®id", dataTypeClass = Integer.class, required = true), |
| | | }) |
| | | @GetMapping("/selectProductById/{id}") |
| | | public Result selectProductById(@PathVariable Integer id) { |
| | | return Result.success(planService.selectProductById(id)); |
| | | @PostMapping("/selectProMethodById") |
| | | public Result selectProMethodById(Integer id) { |
| | | Product product = productService.getById(id); |
| | | return Result.success(product.getMethod()); |
| | | } |
| | | |
| | | @ApiOperation("åé
æ£éªè®¡åä¸åé
项ç®") |
| | | @PostMapping("/upPlan") |
| | | public Result upPlan(@RequestBody InspectionProductList inspectionProductList) { |
| | | planService.upPlan(inspectionProductList); |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªæ ·åID", dataTypeClass = Integer.class, required = true), |
| | | }) |
| | | @PutMapping("/upPlan/{id}") |
| | | public Result upPlan(@PathVariable Integer id ,@RequestBody InspectionProductListDto inspectionProductListDto) { |
| | | planService.upPlan(id,inspectionProductListDto); |
| | | return Result.success(); |
| | | } |
| | | |
| | |
| | | }) |
| | | @PutMapping("/delPlan/{id}") |
| | | public Result delPlan(@PathVariable Integer id) { |
| | | return Result.success(planService.delPlan(id)); |
| | | planService.delPlan(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢æåæ£éª") |
| | |
| | | */ |
| | | public interface InspectionMaterialListMapper extends BaseMapper<InspectionMaterialList> { |
| | | |
| | | //æ¥è¯¢æ£éªåéé¢çç©æä¿¡æ¯ |
| | | //æ¥è¯¢æ£éªåéé¢çæ ·åä¿¡æ¯ |
| | | List<InspectionMaterialList> selectInspectionMaterialListByInsId(String insId); |
| | | |
| | | } |
| | |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionProductListDto; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionProductListVo; |
| | | import com.yuanchu.limslaboratory.service.InspectionProductListService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | |
| | | */ |
| | | public interface InspectionProductListMapper extends BaseMapper<InspectionProductList> { |
| | | |
| | | //æ·»å æ£éªé¡¹ç® |
| | | int addInspectionProductList(List<InspectionProductList> list); |
| | | |
| | | //æ ¹æ®æ ·åidæ¥è¯¢æ£éªé¡¹ç® |
| | | List<InspectionProductList> selectByMaterId(Integer id); |
| | | //æ ¹æ®æ ·åidæ¥è¯¢æ£éªè®¡åæ ·åéé¢çæ£éªé¡¹ç® |
| | | List<InspectionProductListVo> selectByMaterId(Integer id); |
| | | } |
| | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Plan; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.dto.PlanDto; |
| | | import com.yuanchu.limslaboratory.pojo.vo.FinPlanVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.PlanVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper æ¥å£ |
| | | * Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | |
| | | public interface PlanMapper extends BaseMapper<Plan> { |
| | | |
| | | //æ¥è¯¢æææ£éªè®¡ååé
|
| | | Map selectAllPlan(int pageSize, int countSize, Integer state); |
| | | List<PlanVo> selectAllPlan(int pageSize, int countSize, Integer state); |
| | | |
| | | //æ¥è¯¢æåæ£éª |
| | | List<PlanDto> selectInspection(int pageSize, int countSize, Integer state); |
| | | List<FinPlanVo> selectInspection(int pageSize, int countSize, Integer state); |
| | | } |
| | |
| | | |
| | | private Integer version; |
| | | |
| | | @ApiModelProperty(value = "å
³è æ¥æ£id") |
| | | @ApiModelProperty(value = "å
³è æ¥æ£ç©æid") |
| | | private int inspectionMaterialListId; |
| | | |
| | | @ApiModelProperty(value = "å
³è ç¨æ·id è¯éªå") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "å
³è 设å¤id") |
| | | private Integer instrument_id; |
| | | private Integer instrumentId; |
| | | } |
| | |
| | | @ApiModelProperty(value = "å
³è ç¨æ·id(è´è´£äººid)") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "å
³è 设å¤id") |
| | | private Integer deviceId; |
| | | |
| | | } |
| | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class InspectionDto extends Inspection implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | //(ä¿®æ¹)(æ¥è¯¢)æ£æµè®°å½ |
| | | @Data |
| | | public class InspectionRecordsDto implements Serializable { |
| | | |
| | | //æ£æµé¡¹ç® |
| | | |
| | | @ApiModelProperty(value = "æ£æµé¡¹ç®") |
| | | @JsonSerialize |
| | | private String name; |
| | | |
| | | //è¯éªå |
| | | @ApiModelProperty(value = "è¯éªå") |
| | | @JsonSerialize |
| | | private String userName; |
| | | |
| | | //è¯éªå¼å§æ¥æ |
| | | @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; |
| | | |
| | | //è¯éªæ¹æ³ |
| | | @ApiModelProperty(value = "è¯éªæ¹æ³") |
| | | @JsonSerialize |
| | | private String method; |
| | | |
| | | //è¯éªè¦æ± |
| | | @ApiModelProperty(value = "è¯éªè¦æ±") |
| | | @JsonSerialize |
| | | private String ask; |
| | | |
| | | //æ ·åç¼å· |
| | | @ApiModelProperty(value = "æ ·åç¼å·") |
| | | @JsonSerialize |
| | | private int mid; |
| | | |
| | | //æ ·ååç§° |
| | | @ApiModelProperty(value = "æ ·ååç§°") |
| | | @JsonSerialize |
| | | private String materialName; |
| | | |
| | | //è§æ ¼åå· |
| | | @ApiModelProperty(value = "è§æ ¼åå·") |
| | | @JsonSerialize |
| | | private String specificationsSerialNumber; |
| | | |
| | | //æ ·åæ°é |
| | | @ApiModelProperty(value = "æ ·åæ°é") |
| | | @JsonSerialize |
| | | private Integer materialNum; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionMaterialList; |
| | | import com.yuanchu.limslaboratory.pojo.Plan; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionMaterialListDto; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | InspectionMaterialList addInspectionMaterialList(InspectionMaterialList inspectionMaterialList,String userId); |
| | | void addInspectionMaterialList(InspectionMaterialList inspectionMaterialList,String userId); |
| | | |
| | | /** |
| | | * æ ¹æ®æ£éªæ ·åidå 餿 ·åä¿¡æ¯ |
| | | * @param inspectionMaterialListId |
| | | * @return |
| | | */ |
| | | boolean delInspectionMaterialListByInsId(int inspectionMaterialListId); |
| | | void delInspectionMaterialListByInsId(int inspectionMaterialListId); |
| | | |
| | | /** |
| | | *æ ¹æ®æ ·åidä¿®æ¹æ ·åä¿¡æ¯ |
| | | * @param inspectionMaterialListId |
| | | * @param inspectionMaterialList |
| | | * @param inspectionMaterialListDto |
| | | * @return |
| | | */ |
| | | boolean updateInspectionMaterialList( Integer inspectionMaterialListId,InspectionMaterialList inspectionMaterialList); |
| | | void updateInspectionMaterialList(Integer inspectionMaterialListId, InspectionMaterialListDto inspectionMaterialListDto); |
| | | } |
| | |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionProductListDto; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionProductListVo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®æ£éªæ ·åidå 餿 ·åéçæ£éªé¡¹ç® |
| | | * @param inspectionMaterialListId |
| | | * æ ¹æ®æ ·åidæ¥è¯¢æ£éªè®¡åæ ·åéé¢çæ£éªé¡¹ç® |
| | | * @param id |
| | | * @return |
| | | */ |
| | | int delInspectionProductList(int inspectionMaterialListId); |
| | | List<InspectionProductListVo> selectProductById(Integer id); |
| | | |
| | | } |
| | |
| | | * @param inspectionId |
| | | * @return |
| | | */ |
| | | boolean delInspectionByInsId(String inspectionId); |
| | | void delInspectionByInsId(String inspectionId); |
| | | |
| | | /** |
| | | * æ ¹æ®æ£éªåidæäº¤æ£éªç³è¯· |
| | | * @param inspectionId |
| | | * @return |
| | | */ |
| | | boolean subInspectionByInsId(String inspectionId); |
| | | void subInspectionByInsId(String inspectionId); |
| | | |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.service; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.yuanchu.limslaboratory.pojo.Plan; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.dto.PlanDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionProductListDto; |
| | | import com.yuanchu.limslaboratory.pojo.vo.FinPlanVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.PlanVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @param state |
| | | * @return |
| | | */ |
| | | Map selectAllPlan(int pageSize, int countSize, Integer state); |
| | | List<PlanVo> selectAllPlan(int pageSize, int countSize, Integer state); |
| | | |
| | | /** |
| | | * æ ¹æ®è®¡åidä½åºæ£éªè®¡å |
| | | * @param id |
| | | * @return |
| | | */ |
| | | boolean delPlan(Integer id); |
| | | void delPlan(Integer id); |
| | | |
| | | /** |
| | | * æ ¹æ®æ ·åidæ¥è¯¢æ£éªè®¡åé颿£éªé¡¹ç® |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<InspectionProductList> selectProductById(Integer id); |
| | | |
| | | |
| | | /** |
| | | * ç»æ£éªè®¡åä¸çæ£éªé¡¹ç®åé
è¯éªå,设å¤,以忥æ |
| | | * @param inspectionProductList |
| | | * @param inspectionProductListDto |
| | | */ |
| | | void upPlan(InspectionProductList inspectionProductList); |
| | | void upPlan(Integer id ,InspectionProductListDto inspectionProductListDto); |
| | | |
| | | /** |
| | | * æ¥è¯¢æåæ£éª |
| | |
| | | * @param state |
| | | * @return |
| | | */ |
| | | List<PlanDto> selectInspection(int pageSize, int countSize, Integer state); |
| | | List<FinPlanVo> selectInspection(int pageSize, int countSize, Integer state); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionMaterialListMapper; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionProductListMapper; |
| | | import com.yuanchu.limslaboratory.mapper.PlanMapper; |
| | | import com.yuanchu.limslaboratory.mapper.ProductMapper; |
| | | import com.yuanchu.limslaboratory.mapper.*; |
| | | import com.yuanchu.limslaboratory.pojo.*; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionMaterialListDto; |
| | | import com.yuanchu.limslaboratory.service.InspectionMaterialListService; |
| | | import com.yuanchu.limslaboratory.service.InspectionProductListService; |
| | | import com.yuanchu.limslaboratory.service.PlanService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | |
| | | @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) { |
| | | int judge = inspectionMaterialListMapper.insert(inspectionMaterialList); |
| | | List<Product> list = productMapper.selectProductByMaterialId(inspectionMaterialList.getMaterialId()); |
| | | List<InspectionProductList> list1 = new ArrayList<>(); |
| | | list.forEach(a-> { |
| | | InspectionProductList inspectionProductList = new InspectionProductList(); |
| | | inspectionProductList.setName(a.getName()) |
| | | .setUnit(a.getUnit()) |
| | | .setRequired(a.getRequired()) |
| | | .setInternal(a.getInternal()) |
| | | .setState(1) |
| | | .setInspectionMaterialListId(inspectionMaterialList.getId()) |
| | | .setUserId(Integer.parseInt(userId)); |
| | | list1.add(inspectionProductList); |
| | | }); |
| | | //æ·»å æ£éªé¡¹ç® |
| | | int judge2 = inspectionProductListMapper.addInspectionProductList(list1); |
| | | return judge>0&&judge2>0?inspectionMaterialList:null; |
| | | public void addInspectionMaterialList(InspectionMaterialList inspectionMaterialList, String userId) { |
| | | inspectionMaterialListMapper.insert(inspectionMaterialList); |
| | | List<Product> list = productMapper.selectProductByMaterialId(inspectionMaterialList.getMaterialId()); |
| | | List<InspectionProductList> list1 = new ArrayList<>(); |
| | | list.forEach(a -> { |
| | | InspectionProductList inspectionProductList = new InspectionProductList(); |
| | | inspectionProductList.setName(a.getName()) |
| | | .setUnit(a.getUnit()) |
| | | .setRequired(a.getRequired()) |
| | | .setInternal(a.getInternal()) |
| | | .setState(1) |
| | | .setInspectionMaterialListId(inspectionMaterialList.getId()) |
| | | .setUserId(Integer.parseInt(userId)); |
| | | list1.add(inspectionProductList); |
| | | }); |
| | | //æ·»å æ£éªé¡¹ç® |
| | | inspectionProductListService.saveBatch(list1); |
| | | } |
| | | |
| | | //æ ¹æ®æ ·åidå 餿£éªæ ·å |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean delInspectionMaterialListByInsId(int inspectionMaterialListId) { |
| | | public void delInspectionMaterialListByInsId(int inspectionMaterialListId) { |
| | | //å 餿£éªæ ·å |
| | | InspectionMaterialList list = new InspectionMaterialList(); |
| | | list.setState(0); |
| | | list.setId(inspectionMaterialListId); |
| | | int judge1 = inspectionMaterialListMapper.updateById(list); |
| | | inspectionMaterialListMapper.updateById(list); |
| | | //æ ¹æ®æ ·åidå 餿£éªæ ·åä¸çæ£éªé¡¹ç® |
| | | int judge2 = inspectionProductListService.delInspectionProductList(inspectionMaterialListId); |
| | | return judge1>0&&judge2>0; |
| | | UpdateWrapper<InspectionProductList> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq("inspection_material_list_id", inspectionMaterialListId).set("state", 0); |
| | | inspectionProductListService.update(new InspectionProductList(), wrapper); |
| | | } |
| | | |
| | | //æ ¹æ®æ ·åidä¿®æ¹æ ·åä¿¡æ¯ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean updateInspectionMaterialList( Integer inspectionMaterialListId,InspectionMaterialList inspectionMaterialList) { |
| | | public void updateInspectionMaterialList(Integer inspectionMaterialListId, InspectionMaterialListDto inspectionMaterialListDto) { |
| | | InspectionMaterialList inspectionMaterialList = new InspectionMaterialList(); |
| | | BeanUtils.copyProperties(inspectionMaterialListDto,inspectionMaterialList); |
| | | LambdaUpdateWrapper<InspectionMaterialList> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(InspectionMaterialList::getId,inspectionMaterialListId); |
| | | int judge = inspectionMaterialListMapper.update(inspectionMaterialList, updateWrapper); |
| | | return judge>0; |
| | | updateWrapper.eq(InspectionMaterialList::getId, inspectionMaterialListId); |
| | | inspectionMaterialListMapper.update(inspectionMaterialList, updateWrapper); |
| | | } |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionProductListMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionProductListDto; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionProductListVo; |
| | | import com.yuanchu.limslaboratory.service.InspectionProductListService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | |
| | | |
| | | //æ ¹æ®æ£éªæ ·åidå 餿 ·åéçæ£éªé¡¹ç® |
| | | //æ ¹æ®æ ·åidæ¥è¯¢æ£éªè®¡åæ ·åéé¢çæ£éªé¡¹ç® |
| | | @Override |
| | | public int delInspectionProductList(int inspectionMaterialListId) { |
| | | UpdateWrapper<InspectionProductList> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq("inspectionMaterialListId", inspectionMaterialListId).set("state", 0); |
| | | return inspectionProductListMapper.update(new InspectionProductList(),wrapper); |
| | | public List<InspectionProductListVo> selectProductById(Integer id) { |
| | | return inspectionProductListMapper.selectByMaterId(id); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | 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.core.conditions.update.UpdateWrapper; |
| | | 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.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | |
| | | @Resource |
| | | InspectionMaterialListMapper inspectionMaterialListMapper; |
| | | |
| | | @Resource |
| | | InspectionProductListService inspectionProductListService; |
| | | |
| | | //æ·»å æ£éªç³è¯·å |
| | | @Override |
| | | public Inspection addInspection(String userName,int type) { |
| | | Inspection inspection = new Inspection(type, 0,1,1, userName); |
| | | 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; |
| | | return judge > 0 ? inspection : null; |
| | | } |
| | | |
| | | //æ¥è¯¢æææ£éªåå表 |
| | | @Override |
| | | public List<InspectionDto> selectAllInspection(int pageSize, int countSize, Integer state) { |
| | | return inspectionMapper.selectAllInspection((pageSize - 1) * countSize,pageSize * countSize, state); |
| | | return inspectionMapper.selectAllInspection((pageSize - 1) * countSize, pageSize * countSize, state); |
| | | } |
| | | |
| | | //ä½åºç³è¯·æ£éªå |
| | | @Override |
| | | public boolean delInspectionByInsId(String inspectionId) { |
| | | //æ£éªåä½åº |
| | | public void delInspectionByInsId(String inspectionId) { |
| | | /*æ£éªåä½åº*/ |
| | | 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); |
| | | return judge1>0&&judge2>0; |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | //æäº¤ç³è¯·æ£éªå |
| | | @Override |
| | | public boolean subInspectionByInsId(String inspectionId) { |
| | | public void subInspectionByInsId(String inspectionId) { |
| | | Inspection inspection = inspectionMapper.selectById(inspectionId); |
| | | //ç¶ææ¹ä¸ºå·²æäº¤2 |
| | | inspection.setState(2); |
| | | int judge = inspectionMapper.updateById(inspection); |
| | | inspectionMapper.updateById(inspection); |
| | | //计å表æ°å¢ |
| | | Plan plan = Plan.builder().inspectionId(inspectionId).state(1).build(); |
| | | Plan plan = Plan.builder().inspectionId(inspectionId).state(1).userId(inspection.getInspectUserId()).createTime(new Date()).build(); |
| | | planMapper.insert(plan); |
| | | return judge>0; |
| | | } |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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 com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.yuanchu.limslaboratory.pojo.Plan; |
| | | import com.yuanchu.limslaboratory.mapper.PlanMapper; |
| | | import com.yuanchu.limslaboratory.pojo.dto.PlanDto; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.yuanchu.limslaboratory.mapper.*; |
| | | import com.yuanchu.limslaboratory.pojo.*; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionProductListDto; |
| | | import com.yuanchu.limslaboratory.pojo.vo.FinPlanVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.PlanVo; |
| | | import com.yuanchu.limslaboratory.service.InspectionProductListService; |
| | | import com.yuanchu.limslaboratory.service.PlanService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | 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.Map; |
| | | |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Resource |
| | | InspectionProductListMapper inspectionProductListMapper; |
| | | |
| | | @Resource |
| | | InspectionMaterialListMapper inspectionMaterialListMapper; |
| | | |
| | | @Resource |
| | | InspectionProductListService inspectionProductListService; |
| | | |
| | | //æ¥è¯¢æææ£éªè®¡ååé
|
| | | @Override |
| | | public Map selectAllPlan(int pageSize, int countSize, Integer state) { |
| | | public List<PlanVo> selectAllPlan(int pageSize, int countSize, Integer state) { |
| | | if (state == null) { |
| | | state = 2; |
| | | } |
| | |
| | | |
| | | //ä½åºæ£éªè®¡å |
| | | @Override |
| | | public boolean delPlan(Integer id) { |
| | | public void delPlan(Integer id) { |
| | | Plan plan = planMapper.selectById(id); |
| | | |
| | | /*æ£éªè®¡åä½åº*/ |
| | | //ç¶ææ¹ä¸ºä½åº0 |
| | | plan.setState(0); |
| | | int judge = planMapper.updateById(plan); |
| | | return judge > 0; |
| | | planMapper.updateById(plan); |
| | | |
| | | /*æ£éªæ ·åä½åº(æ ¹æ®æ¥æ£åidå 餿 ·åä¿¡æ¯)*/ |
| | | UpdateWrapper<InspectionMaterialList> wrapper1 = new UpdateWrapper<>(); |
| | | wrapper1.eq("inspection_id", plan.getInspectionId()).set("state", 0); |
| | | inspectionMaterialListMapper.update(new InspectionMaterialList(), wrapper1); |
| | | |
| | | /*æ£éªæ ·åä¸çæ£éªé¡¹ç®ä½åº*/ |
| | | //æ¥åºæ£éªæ ·åid |
| | | LambdaQueryWrapper<InspectionMaterialList> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(InspectionMaterialList::getInspectionId, plan.getInspectionId()); |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | //æ ¹æ®æ ·åidæ¥è¯¢æ£éªè®¡åéé¢çæ£éªé¡¹ç® |
| | | //ä¿®æ¹(åé
)æ£éªè®¡åéåé
计åçä¿¡æ¯ |
| | | @Override |
| | | public List<InspectionProductList> selectProductById(Integer id) { |
| | | return inspectionProductListMapper.selectByMaterId(id); |
| | | } |
| | | public void upPlan(Integer id, InspectionProductListDto inspectionProductListDto) { |
| | | /*æ´æ°è®¡å表ä¸çç¶æ(3:å·²åé
),æ´æ°æ¶é´*/ |
| | | //æ¥è¯¢æ¥æ£åid |
| | | InspectionMaterialList inspectionMaterialList = inspectionMaterialListMapper.selectById(id); |
| | | LambdaQueryWrapper<Plan> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Plan::getInspectionId, inspectionMaterialList.getInspectionId()); |
| | | Plan plan = planMapper.selectOne(queryWrapper); |
| | | plan.setState(3).setUpdateTime(new Date()); |
| | | //æ ¹æ®æ¥æ£åidè¿è¡æ´æ°è®¡å表 |
| | | LambdaUpdateWrapper<Plan> updateWrapper1 = new LambdaUpdateWrapper<>(); |
| | | updateWrapper1.eq(Plan::getInspectionId, plan.getInspectionId()); |
| | | planMapper.update(plan, updateWrapper1); |
| | | |
| | | //ä¿®æ¹æ£éªè®¡åéåé
计åçä¿¡æ¯ |
| | | @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); |
| | | /*æ´æ°æ£éªé¡¹ç®è¡¨ä¸çé¡¹ç®æ£éªå¼å§æ¥æ,é¡¹ç®æ£éªç»ææ¥æ,项ç®è¯éªå,è¯éªè¦æ±,æ´æ°æ¶é´,设å¤id*/ |
| | | InspectionProductList inspectionProductList = new InspectionProductList(); |
| | | BeanUtils.copyProperties(inspectionProductListDto, inspectionProductList); |
| | | inspectionProductList.setInspectionMaterialListId(id); |
| | | //æ ¹æ®æ¥æ£æ ·åidå项ç®åç§°è¿è¡æ´æ°æ£éªé¡¹ç®è¡¨ |
| | | LambdaUpdateWrapper<InspectionProductList> updateWrapper2 = new LambdaUpdateWrapper<>(); |
| | | updateWrapper2.eq(InspectionProductList::getInspectionMaterialListId, inspectionProductList.getInspectionMaterialListId()) |
| | | .eq(InspectionProductList::getName, inspectionProductList.getName()); |
| | | inspectionProductListMapper.update(inspectionProductList, updateWrapper2); |
| | | } |
| | | |
| | | //æ¥è¯¢æåæ£éª |
| | | @Override |
| | | public List<PlanDto> selectInspection(int pageSize, int countSize, Integer state) { |
| | | public List<FinPlanVo> selectInspection(int pageSize, int countSize, Integer state) { |
| | | return planMapper.selectInspection((pageSize - 1) * countSize, pageSize * countSize, state); |
| | | } |
| | | } |
| | |
| | | <?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.InspectionProductListMapper"> |
| | | <insert id="addInspectionProductList"> |
| | | INSERT INTO inspection_product_list (name, method, ask, unit, required, internal, create_time, |
| | | update_time,inspection_material_list_id, user_id) VALUES |
| | | <foreach collection="list" separator="," item="i"> |
| | | (#{i.name}, #{i.method}, #{i.ask}, #{i.unit}, #{i.required}, #{i.internal}, #{i.createTime}, |
| | | #{i.updateTime}, #{i.inspectionMaterialListId}, |
| | | #{i.userId}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <select id="selectByMaterId" resultType="com.yuanchu.limslaboratory.pojo.InspectionProductList"> |
| | | select id, |
| | | name, |
| | | <select id="selectByMaterId" resultType="com.yuanchu.limslaboratory.pojo.vo.InspectionProductListVo"> |
| | | select inspection_material_list_id, |
| | | inspect_start_time inspectStartTime, |
| | | inspect_end_time inspectEndTime, |
| | | ipl.name, |
| | | method, |
| | | ask, |
| | | unit, |
| | |
| | | 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} |
| | | uname userName, |
| | | equipment_name instrumentName |
| | | from (select inspection_material_list_id, |
| | | pl.name name, |
| | | user.name uname, |
| | | method, |
| | | ask, |
| | | unit, |
| | | required, |
| | | internal, |
| | | start_time, |
| | | end_time, |
| | | equipment_name |
| | | from lims_laboratory.inspection_product_list pl |
| | | left join lims_laboratory.user on pl.user_id = user.id |
| | | left join lims_laboratory.instrument on pl.instrument_id = instrument.id) ipl |
| | | , lims_laboratory.inspection_material_list iml |
| | | , lims_laboratory.inspection i |
| | | where iml.id = ipl.inspection_material_list_id |
| | | and iml.id = ipl.inspection_material_list_id |
| | | and i.id = iml.inspection_id |
| | | and ipl.inspection_material_list_id = #{id} |
| | | </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="Map"> |
| | | select p.id,results,p.state,p.create_time,p.inspection_id,user_id,results,type,user_name |
| | | from lims_laboratory.plan p left join lims_laboratory.inspection i |
| | | on i.id=p.inspection_id |
| | | <select id="selectAllPlan" resultType="com.yuanchu.limslaboratory.pojo.vo.PlanVo"> |
| | | select mid , |
| | | p.inspection_id , |
| | | state , |
| | | create_time , |
| | | name , |
| | | material_name , |
| | | specifications_serial_number , |
| | | material_id , |
| | | material_supplier , |
| | | start_time , |
| | | end_time , |
| | | results , |
| | | material_location , |
| | | method , |
| | | material_batch , |
| | | material_reel_number , |
| | | material_num |
| | | from (select plan.user_id, plan.state, plan.create_time, plan.results, plan.inspection_id, name |
| | | from lims_laboratory.plan |
| | | join lims_laboratory.user u on plan.user_id = u.id) p |
| | | left join (select iml.id mid, |
| | | iml.specifications_serial_number, |
| | | iml.material_id, |
| | | iml.material_supplier, |
| | | ipl.start_time, |
| | | ipl.end_time, |
| | | iml.material_location, |
| | | iml.material_name, |
| | | ipl.method, |
| | | iml.material_batch, |
| | | iml.material_reel_number, |
| | | iml.material_num, |
| | | iml.inspection_id |
| | | from lims_laboratory.inspection_material_list iml |
| | | left join lims_laboratory.inspection_product_list ipl on iml.id = ipl.inspection_material_list_id) il |
| | | on p.inspection_id = il.inspection_id |
| | | <if test="state!=null"> |
| | | where p.state = #{state} |
| | | where state = #{state} |
| | | </if> |
| | | order by p.create_time desc |
| | | limit #{pageSize},#{countSize} |
| | | </select> |
| | | |
| | | <select id="selectInspection" resultType="com.yuanchu.limslaboratory.pojo.dto.PlanDto"> |
| | | <select id="selectInspection" resultType="com.yuanchu.limslaboratory.pojo.vo.FinPlanVo"> |
| | | 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 |
| | | 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> |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Instrument; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | |
| | | * @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); |
| | | |
| | | //æ¥è¯¢ææè®¾å¤ä¿¡æ¯ |
| | | List<Map> selectInstrument(); |
| | | |
| | | } |
| | |
| | | import com.yuanchu.limslaboratory.pojo.Instrument; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | |
| | | Instrument getIdInstrumentInformation(Integer instrumentId); |
| | | |
| | | Integer updateEquipmentPointInformation(Instrument instrument); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææè®¾å¤ä¿¡æ¯ |
| | | * @return |
| | | */ |
| | | List<Map> selectInstrument(); |
| | | } |
| | |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | //æ¥è¯¢ææè®¾å¤ä¿¡æ¯ |
| | | @Override |
| | | public List<Map> selectInstrument() { |
| | | return instrumentMapper.selectInstrument(); |
| | | } |
| | | } |
| | |
| | | </if> |
| | | AND i.`user_id` = u.`id` |
| | | </select> |
| | | <select id="selectInstrument" resultType="Map"> |
| | | select id,equipment_name from lims_laboratory.instrument |
| | | </select> |
| | | </mapper> |
| | |
| | | public interface MaterialMapper extends BaseMapper<Material> { |
| | | |
| | | //æ¥è¯¢ç©æä¿¡æ¯ |
| | | List<Material> selectMaterialLimit(int num1,int num2, int type); |
| | | List<Map> selectMaterialLimit(int num1,int num2, int type); |
| | | |
| | | //æ ¹æ®ç©æidæ¥è¯¢ç©æä¿¡æ¯ |
| | | Map selectMaterialById(String materialId); |
| | |
| | | IPage<Map<String, Object>> pageProductInformation(String productCodeOrName, Integer specificationsId, Page<Objects> page); |
| | | |
| | | Map<String, Object> selectOneChildren(Object father); |
| | | |
| | | Map<String, Object> getProductInformation(Integer productId); |
| | | |
| | | //éè¿é¡¹ç®åæ¥è¯¢é¡¹ç®çè¯éªæ¹æ³ |
| | | List<Map> selectInstrumentByProname(String name); |
| | | } |
| | |
| | | IPage<Map<String, Object>> pageProductInformation(String productCodeOrName, Integer specificationsId, Page<Objects> page); |
| | | |
| | | List<Map<String, Object>> pageFatherNameProductInformation(String fatherName); |
| | | |
| | | /** |
| | | * éè¿é¡¹ç®åæ¥è¯¢é¡¹ç®çè¯éªæ¹æ³ |
| | | * @param name |
| | | * @return |
| | | */ |
| | | List<Map> selectInstrumentByProname(String name); |
| | | } |
| | |
| | | |
| | | //æ¥è¯¢ç©æä¿¡æ¯ |
| | | @Override |
| | | public List<Material> selectMaterialLimit(int pageSize, int countSize, int type) { |
| | | public List<Map> selectMaterialLimit(int pageSize, int countSize, int type) { |
| | | return materialMapper.selectMaterialLimit((pageSize - 1) * countSize,pageSize * countSize, type); |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | |
| | | wrapper.select(Product::getId, Product::getName, Product::getUnit, Product::getRequired, Product::getInternal); |
| | | return productMapper.selectMaps(wrapper); |
| | | } |
| | | |
| | | //éè¿é¡¹ç®åæ¥è¯¢é¡¹ç®çè¯éªæ¹æ³ |
| | | @Override |
| | | public List<Map> selectInstrumentByProname(String name) { |
| | | return productMapper.selectInstrumentByProname(name); |
| | | } |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yuanchu.limslaboratory.mapper.MaterialMapper"> |
| | | |
| | | <select id="selectMaterialLimit" resultType="com.yuanchu.limslaboratory.pojo.Material"> |
| | | <select id="selectMaterialLimit" resultType="Map"> |
| | | select id, name |
| | | from material |
| | | from lims_laboratory.material |
| | | where state = 1 |
| | | and type = #{type} |
| | | order by create_time desc |
| | | limit #{num1},#{num2} |
| | | </select> |
| | | <select id="selectMaterialById" resultType="java.util.Map"> |
| | | <select id="selectMaterialById" resultType="Map"> |
| | | select m.id, |
| | | m.num, |
| | | m.supplier, |
| | |
| | | s.cross_section crossSection, |
| | | s.number_of_cores numberOfCores, |
| | | s.instruct |
| | | from material m, |
| | | specifications s, |
| | | serial_number sn |
| | | 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> |
| | |
| | | |
| | | IPage<PagePersonnelVo> getNewPersonnelPage(String name, Page page); |
| | | |
| | | List<User> selectUser(); |
| | | List<Map> selectUser(); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<User> selectUser() { |
| | | public List<Map> selectUser() { |
| | | return userMapper.selectUser(); |
| | | } |
| | | |
| | |
| | | </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 |
| | | <select id="selectUser" resultType="Map"> |
| | | select id, name |
| | | from lims_laboratory.user |
| | | </select> |
| | | </mapper> |