| | |
| | | import com.yuanchu.limslaboratory.pojo.Material; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.pojo.RawMaterial; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | import com.yuanchu.limslaboratory.service.*; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | @AuthHandler(type = InterfaceType.SELECT,menuId = MenuEnums.reportForInspection,isAdd = true) |
| | | public Result<?> getMaterielName(){ |
| | | LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.select(Material::getId, Material::getName, Material::getCode); |
| | | wrapper.select(Material::getId, Material::getName, Material::getCode) |
| | | .eq(Material::getType,0).eq(Material::getState,1); |
| | | List<Map<String, Object>> maps = materialService.listMaps(wrapper); |
| | | return Result.success(maps); |
| | | } |
| | |
| | | return Result.success(inspectionService.lookProByVer(name, mcode, specifications,version,null)); |
| | | } |
| | | |
| | | @ApiOperation(value = "原材料生成报检单") |
| | | @PostMapping("/addInspect") |
| | | @AuthHandler(type = InterfaceType.ADD,menuId = MenuEnums.reportForInspection,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)); |
| | | } |
| | | |
| | | } |