| | |
| | | @Resource |
| | | Jwt jwt; |
| | | |
| | | @ApiOperation(value = "新增原材料检验单-->根据原材料编码得到ifs中的报检数据") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "code", value = "原材料编码", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @PostMapping("/chooseIFS") |
| | | public Result chooseIFS(String code){ |
| | | return Result.success(rawInspectService.chooseIFS(code)); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增原材料检验单") |
| | | @PostMapping("/addRawInspects") |
| | | public Result addRawInspects(@RequestHeader("token") String token,@Validated @RequestBody RawInspectVo rawInspectVo) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | return Result.success(rawInspectService.addRawInspects(data.get("id").replaceAll("\"", ""), rawInspectVo)); |
| | | return Result.success("提交成功!",rawInspectService.addRawInspects(data.get("id").replaceAll("\"", ""), rawInspectVo)); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询原材料检验单列表") |
| | |
| | | @ApiImplicitParam(name = "insState", value = "检测状态(为空=全部)", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "name", value = "原材料名称", dataTypeClass = String.class) |
| | | }) |
| | | @PostMapping("/selectRawInspectsList") |
| | | @GetMapping("/selectRawInspectsList") |
| | | public Result selectRawInspectsList(Integer pageSize, Integer countSize, String formTime, String code, Integer insState, String name) { |
| | | IPage<Map<String, Object>> page = rawInspectService.selectRawInspectsList(new Page<Object>(pageSize, countSize), formTime, code, insState, name); |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | |
| | | @ApiOperation(value = "上报(更新检验状态)") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "检验单id", dataTypeClass = Integer.class, required = true) |
| | | @ApiImplicitParam(name = "id", value = "检验单id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "number", value = "不合格数量", dataTypeClass = Integer.class) |
| | | }) |
| | | @PostMapping("/updateRawInspectsById/{id}") |
| | | public Result updateRawInspectsById(@PathVariable Integer id) { |
| | | public Result updateRawInspectsById(@PathVariable Integer id,Integer number) { |
| | | //如果已经上报了不能再一次上报 |
| | | RawInspect rawInspect = rawInspectService.getById(id); |
| | | if (rawInspect.getInsState() == 1) { |
| | | return Result.fail("已经上报过了,不能再次上报!"); |
| | | } |
| | | return Result.success(rawInspectService.updateRawInspectsById(id)); |
| | | return Result.success(rawInspectService.updateRawInspectsById(id,number)); |
| | | } |
| | | |
| | | } |