| | |
| | | import com.yuanchu.limslaboratory.enums.InterfaceType; |
| | | import com.yuanchu.limslaboratory.enums.MenuEnums; |
| | | import com.yuanchu.limslaboratory.pojo.LinkBasicInformation; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | import com.yuanchu.limslaboratory.service.InspectionService; |
| | | import com.yuanchu.limslaboratory.service.LinkBasicInformationService; |
| | | 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.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | @Autowired |
| | | private LinkBasicInformationService linkBasicInformationService; |
| | | |
| | | |
| | | @Resource |
| | | private InspectionService inspectionService; |
| | | |
| | | @ApiOperation("链接-->获取链接") |
| | | @GetMapping("/link") |
| | |
| | | return Result.success("删除成功!"); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("选择版本") |
| | | @GetMapping("/chooseVer") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "name", value = "产品名称", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "mcode", value = "产品编号", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "specifications", value = "规格型号", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @AuthHandler(type = InterfaceType.SELECT,menuId = MenuEnums.commissionInspection,isAdd = true) |
| | | public Result<?> chooseVer(String name, String mcode, String specifications) { |
| | | return Result.success(inspectionService.chooseVer(name, mcode, specifications)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "查看该版本下我们要做的项目要求") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "name", value = "产品名称", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "mcode", value = "产品编号", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "specifications", value = "规格型号", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "version", value = "版本(默认最新版本)", dataTypeClass = Integer.class,required = true ), |
| | | @ApiImplicitParam(name = "id", value = "委托信息id", dataTypeClass = Integer.class,required = true ) |
| | | }) |
| | | @GetMapping("/lookProByVer") |
| | | @AuthHandler(type = InterfaceType.SELECT,menuId = MenuEnums.commissionInspection,isAdd = true) |
| | | public Result lookProByVer(String name, String mcode, String specifications,Integer version,Integer id) { |
| | | return Result.success(linkBasicInformationService.lookProByVer(name,mcode, specifications,version,id)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "委托品生成报检单") |
| | | @PostMapping("/addInspect") |
| | | @AuthHandler(type = InterfaceType.ADD,menuId = MenuEnums.commissionInspection,isAdd = true) |
| | | public Result addInspect(@RequestHeader("X-Token") String token, @Validated @RequestBody InspectionVo inspectionVo) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | return Result.success(inspectionService.addInspect((Integer) unmarshal.get("id"), inspectionVo)); |
| | | } |
| | | |
| | | } |