| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionMaterialList; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.service.*; |
| | |
| | | }) |
| | | @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("提交申请") |
| | | @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)); |
| | | } |
| | | |
| | | @ApiOperation("作废申请") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "inspectionId", value = "检验单ID", dataTypeClass = String.class, required = true), |
| | | }) |
| | | @PostMapping("/delInspection") |
| | | public Result delInspection(String inspectionId) { |
| | | return Result.success(inspectionService.delInspectionByInsId(inspectionId)); |
| | | } |
| | | } |
| | |
| | | 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.*; |
| | |
| | | return Result.success(inspectionMaterialListService.delInspectionMaterialListByInsId(inspectionMaterialListId)); |
| | | } |
| | | |
| | | @ApiOperation("根据Id查询样品信息") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "inspectionMaterialListId", value = "样品ID", dataTypeClass = Integer.class, required = true), |
| | | }) |
| | | @PostMapping("/selectInspectionMaterialListById") |
| | | public Result selectInspectionMaterialListById(int inspectionMaterialListId) throws Exception { |
| | | return Result.success(inspectionMaterialListService.getById(inspectionMaterialListId)); |
| | | } |
| | | |
| | | @ApiOperation("修改样品信息") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "inspectionMaterialListId", value = "样品ID", dataTypeClass = Integer.class, required = true), |
| | | }) |
| | | @PutMapping("/updateInspectionMaterialList/{inspectionMaterialListId}") |
| | | public Result updateInspectionMaterialList(@PathVariable Integer inspectionMaterialListId, @RequestBody InspectionMaterialList inspectionMaterialList) throws Exception { |
| | | return Result.success(inspectionMaterialListService.updateInspectionMaterialList(inspectionMaterialListId,inspectionMaterialList)); |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "关联 用户id 试验员") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "关联 设备id ") |
| | | private Integer instrument_id; |
| | | |
| | | |
| | | } |
| | |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "检验结果") |
| | | private String results; |
| | | private Integer results; |
| | | |
| | | @ApiModelProperty(value = "试验说明") |
| | | private String thing; |
| | |
| | | |
| | | boolean delInspectionMaterialListByInsId(int inspectionMaterialListId); |
| | | |
| | | boolean updateInspectionMaterialList( Integer inspectionMaterialListId,InspectionMaterialList inspectionMaterialList); |
| | | } |
| | |
| | | Inspection addInspection(String userName,int type); |
| | | |
| | | List<InspectionDto> selectAllInspection(int pageSize, int countSize, Integer state); |
| | | |
| | | boolean delInspectionByInsId(String inspectionId); |
| | | |
| | | boolean subInspectionByInsId(String inspectionId); |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | 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.pojo.InspectionMaterialList; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.yuanchu.limslaboratory.pojo.Plan; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.pojo.*; |
| | | import com.yuanchu.limslaboratory.service.InspectionMaterialListService; |
| | | import com.yuanchu.limslaboratory.service.InspectionProductListService; |
| | | import com.yuanchu.limslaboratory.service.PlanService; |
| | |
| | | int judge2 = inspectionProductListMapper.update(new InspectionProductList(), wrapper); |
| | | return judge1>0&&judge2>0; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean updateInspectionMaterialList( Integer inspectionMaterialListId,InspectionMaterialList inspectionMaterialList) { |
| | | LambdaUpdateWrapper<InspectionMaterialList> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(InspectionMaterialList::getId,inspectionMaterialListId); |
| | | int judge = inspectionMaterialListMapper.update(inspectionMaterialList, updateWrapper); |
| | | return judge>0; |
| | | } |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | 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.dto.InspectionDto; |
| | | 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.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @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; |
| | | } |
| | | |
| | |
| | | public List<InspectionDto> selectAllInspection(int pageSize, int countSize, Integer state) { |
| | | return inspectionMapper.selectAllInspection((pageSize - 1) * countSize,pageSize * countSize, state); |
| | | } |
| | | |
| | | @Override |
| | | public boolean delInspectionByInsId(String inspectionId) { |
| | | Inspection inspection = new Inspection(); |
| | | inspection.setState(0); |
| | | inspection.setId(inspectionId); |
| | | int judge = inspectionMapper.updateById(inspection); |
| | | return judge>0; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public boolean subInspectionByInsId(String inspectionId) { |
| | | Inspection inspection = new Inspection(); |
| | | inspection.setState(2); |
| | | inspection.setId(inspectionId); |
| | | inspection.setInspectStartTime(LocalDateTime.now()); |
| | | int judge = inspectionMapper.updateById(inspection); |
| | | return judge>0; |
| | | } |
| | | } |
| | |
| | | # redis访问密码(默认为空) |
| | | password: null |
| | | # redis连接超时时间(单位毫秒) |
| | | timeout: 5000 |
| | | timeout: 5 |
| | | # redis连接池配置 |
| | | pool: |
| | | # 最大可用连接数(默认为8,负数表示无限) |