| | |
| | | |
| | | import com.yuanchu.mom.pojo.RawInspect; |
| | | import com.yuanchu.mom.service.*; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.*; |
| | |
| | | @ApiImplicitParam(name = "formTime", value = "来料日期", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "createTime", value = "报检日期", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "insState", value = "检测状态: 全部默认2", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "judgeState", value = "合格状态: 全部默认2", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "judgeState", value = "合格状态: 全部默认2", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/selectRawInspectsList") |
| | | public Result selectRawInspectsList(Integer pageSize, Integer countSize, String formTime, String createTime, Integer insState, Integer judgeState) { |
| | |
| | | |
| | | @ApiOperation(value = "新增检验单") |
| | | @PostMapping("/addRawInspects") |
| | | public Result addRawInspects(@RequestHeader("token") String token, @RequestBody RawInspect rawInspect) throws JSONException { |
| | | Map<String, String> map = jwt.readJWT(token); |
| | | String data = map.get("data"); |
| | | JSONObject jsonObject = new JSONObject(data); |
| | | String userName = jsonObject.getString("name"); |
| | | return Result.success(rawInspectService.addRawInspects(userName, rawInspect)); |
| | | public Result addRawInspects(@RequestHeader("token") String token, @RequestBody RawInspect rawInspect) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | return Result.success(rawInspectService.addRawInspects(data.get("name").replaceAll("\"", ""), rawInspect)); |
| | | } |
| | | |
| | | } |