| | |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.service.*; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.*; |
| | |
| | | * @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(inspectionService.selectAllInspection(pageSize, countSize, state)); |
| | | } |
| | | |
| | | @ApiOperation("查询检验单里面的物料信息") |
| | | @ApiOperation("查询检验单里面的样品信息") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "inspectionId", value = "报检单ID", dataTypeClass = String.class, required = true), |
| | | }) |
| | |
| | | @ApiOperation("查询物料信息") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize", value = "页数", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "countSize", value = "条数/页", dataTypeClass = Integer.class, required = true) |
| | | @ApiImplicitParam(name = "countSize", value = "条数/页", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "type", value = "类型", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selectMaterialLimit") |
| | | public Result selectMaterialLimit(int pageSize, int countSize) { |
| | | return Result.success(materialService.selectMaterialLimit(pageSize, countSize)); |
| | | public Result selectMaterialLimit(int pageSize, int countSize, int type) { |
| | | return Result.success(materialService.selectMaterialLimit(pageSize, countSize, type)); |
| | | } |
| | | |
| | | @ApiOperation("选择物料信息") |
| | |
| | | return Result.success(materialService.selectMaterialById(materialId)); |
| | | } |
| | | |
| | | @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("作废申请") |
| | | @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)); |
| | | inspectionService.delInspectionByInsId(inspectionId); |
| | | return Result.success(); |
| | | } |
| | | } |