| | |
| | | import org.json.JSONException; |
| | | import org.json.JSONObject; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @ApiOperation(value = "新增原材料检验单") |
| | | @PostMapping("/addRawInspects") |
| | | public Result addRawInspects(@RequestHeader("token") String token, @RequestBody RawInspectVo rawInspectVo) throws Exception { |
| | | 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<>(); |
| | |
| | | return Result.success(rawInspectService.updateRawInspectsById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "原材料检验单id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delRawInsById") |
| | | public Result delRawInsById(Integer id) { |
| | | rawInspectService.delRawInsById(id); |
| | | return Result.success("删除" + id + "成功!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "原材料检验单id", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @PostMapping("/delAllRawIns") |
| | | public Result delAllRawIns(String ids) { |
| | | rawInspectService.delAllRawIns(ids); |
| | | return Result.success("批量删除成功!"); |
| | | } |
| | | } |