| | |
| | | import com.yuanchu.mom.utils.Jwt; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | * @author zss |
| | | * @since 2023-08-07 10:04:01 |
| | | */ |
| | | @Api(tags = "QMS管理-->不合格品管理") |
| | | @RestController |
| | | @RequestMapping("/inspectUnaccepted") |
| | | public class InspectUnacceptedController { |
| | |
| | | @Autowired |
| | | private OpinionService opinionService; |
| | | |
| | | @ApiOperation(value = "查询成品不合格品检验单列表", tags = "QMS管理-->不合格品管理") |
| | | @ApiOperation(value = "不合格品管理列表", tags = "QMS管理-->不合格品管理") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize",value = "页数",dataTypeClass = Integer.class,required = true), |
| | | @ApiImplicitParam(name = "countSize",value = "条数/页",dataTypeClass = Integer.class,required = true), |
| | | @ApiImplicitParam(name = "formTime",value = "来料日期",dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "dealState",value = "处理状态(为空=全部)",dataTypeClass = Integer.class) |
| | | @ApiImplicitParam(name = "dealState",value = "处理状态(为空=全部)",dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "productCategories",value = "产品大类",dataTypeClass = Integer.class), |
| | | }) |
| | | @GetMapping("/selectUnRawInspectsList") |
| | | public Result<?> selectUnRawInspectsList(int pageSize, int countSize, String formTime, Integer dealState){ |
| | | IPage<Map<String, Object>> inspectionPage = inspectUnacceptedService.selectUnRawInspectsList(new Page<Object>(pageSize, countSize), formTime,dealState); |
| | | public Result<?> selectUnRawInspectsList(int pageSize, int countSize, String formTime, Integer dealState, Integer productCategories){ |
| | | IPage<Map<String, Object>> inspectionPage = inspectUnacceptedService.selectUnRawInspectsList(new Page<Object>(pageSize, countSize), formTime,dealState, productCategories); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", inspectionPage.getTotal()); |
| | | map.put("row", inspectionPage.getRecords()); |
| | |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation(value = "评审", tags = "QMS管理-->原材料不合格品") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "rawId",value = "原材料Id",dataTypeClass = Integer.class,required = true), |
| | | @ApiImplicitParam(name = "passOrNo",value = "是否通过:0:不通过;1:通过",dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @PostMapping("/evaluatePassOrNo") |
| | | public Result<?> rawEvaluate(Integer rawId, Integer passOrNo){ |
| | | Integer integer = inspectUnacceptedService.rawEvaluate(rawId, passOrNo); |
| | | if (integer >= 1) { |
| | | return Result.success("评审成功!"); |
| | | } |
| | | return Result.fail("评审失败!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "不合格品分页列表", tags = "QMS管理-->不合格品处置") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize",value = "页数",dataTypeClass = Integer.class,required = true), |
| | |
| | | |
| | | @ApiOperation(value = "编辑意见-->确定按钮", tags = "QMS管理-->不合格品处置") |
| | | @PostMapping("/addOpinion") |
| | | public Result<?> updateOpinion(@RequestHeader("token") String token, @Validated @RequestBody List<Opinion> opinion) throws Exception { |
| | | MyUtil.PrintLog(opinion.toString()); |
| | | |
| | | public Result<?> updateOpinion(@RequestHeader("token") String token, @RequestBody Map<String, Object> opinion) throws Exception { |
| | | List<?> opinion1 = JackSonUtil.unmarshal(JackSonUtil.marshal(opinion.get("opinion")), List.class); |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | String id = data.get("id").replaceAll("\"", ""); |
| | | opinionService.updateOpinion(id, opinion); |
| | | opinionService.updateOpinion(id, opinion1); |
| | | return Result.success("添加成功!"); |
| | | } |
| | | |