zss
2023-09-25 d1ea726be5628c46fb6be700a0197002d55d39f1
inspect-server/src/main/java/com/yuanchu/mom/controller/FinishedInspectController.java
@@ -39,14 +39,6 @@
    @Autowired
    private FinishedInspectService finishedInspectService;
    @Autowired
    private UserService userService;
    @Autowired
    private SpecificationsService specificationsService;
    @Autowired
    private MaterialService materialService;
    @Autowired
    Jwt jwt;
@@ -70,17 +62,18 @@
    @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("/updateFinishInspectsById")
    public Result updateFinishInspectsById(@RequestHeader("token") String token, Integer id) throws Exception {
    public Result updateFinishInspectsById(@RequestHeader("token") String token, Integer id,Integer number) throws Exception {
        //如果已经上报了不能再一次上报
        FinishedInspect finishedInspect = finishedInspectService.getById(id);
        if (ObjectUtils.isNotEmpty(finishedInspect.getResult())) {
            return Result.fail("已经上报过了,不能再次上报!");
        }
        Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class);
        return Result.success(finishedInspectService.updateFinishInspectsById(data.get("name").replaceAll("\"", ""), id));
        return Result.success(finishedInspectService.updateFinishInspectsById(data.get("name").replaceAll("\"", ""), id,number));
    }
    @ApiOperation(value = "根据检验单id查询成品检验单详情")
@@ -94,14 +87,14 @@
    @ApiOperation(value = "分页查询成品检验单列表")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "pageNo", value = "条数/页", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "countSize", value = "条数/页", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "pageSize", value = "页数", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "result", value = "检验结果(为空=全部)", dataTypeClass = Integer.class),
            @ApiImplicitParam(name = "material", value = "产品名称", dataTypeClass = String.class)
    })
    @GetMapping("/list_page")
    public Result<?> list_page(Integer pageNo, Integer pageSize, Integer result, String material) {
        IPage<Map<String, Object>> page = finishedInspectService.selectFinishedInspectPage(new Page<Object>(pageNo, pageSize), result, material);
    public Result<?> list_page(Integer pageSize, Integer countSize, Integer result, String material) {
        IPage<Map<String, Object>> page = finishedInspectService.selectFinishedInspectPage(new Page<Object>(pageSize, countSize), result, material);
        Map<String, Object> map = new HashMap<>();
        map.put("total", page.getTotal());
        map.put("row", page.getRecords());