| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.Opinion; |
| | | import com.yuanchu.mom.service.OpinionService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import com.yuanchu.mom.utils.RedisUtil; |
| | | 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; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.mom.service.InspectUnacceptedService; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private InspectUnacceptedService inspectUnacceptedService; |
| | | |
| | | @Autowired |
| | | private Jwt jwt; |
| | | |
| | | @Autowired |
| | | private OpinionService opinionService; |
| | | |
| | | @ApiOperation(value = "查询成品不合格品检验单列表", tags = "QMS管理-->不合格品管理") |
| | | @ApiImplicitParams(value = { |
| | |
| | | @ApiImplicitParam(name = "countSize",value = "条数/页",dataTypeClass = Integer.class,required = true), |
| | | @ApiImplicitParam(name = "specificationModel",value = "规格型号",dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "productName",value = "产品名称",dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "productCategories",value = "产品大类",dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "productCategories",value = "产品大类",dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "state",value = "状态",dataTypeClass = Integer.class) |
| | | }) |
| | | @GetMapping("/selectDisposal") |
| | | public Result<?> selectDisposal(int pageSize, |
| | | int countSize, |
| | | String specificationModel, |
| | | String productName, |
| | | String productCategories, |
| | | Integer state){ |
| | | int countSize, |
| | | String specificationModel, |
| | | String productName, |
| | | Integer productCategories, |
| | | Integer state){ |
| | | IPage<Map<String, Object>> inspectionPage = inspectUnacceptedService.selectDisposal( |
| | | new Page<Object>(pageSize, countSize), |
| | | specificationModel, |
| | |
| | | map.put("row", inspectionPage.getRecords()); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑意见-->确定按钮", tags = "QMS管理-->不合格品处置") |
| | | @PostMapping("/addOpinion") |
| | | public Result<?> updateOpinion(@RequestHeader("token") String token, @Validated @RequestBody List<Opinion> opinion) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | String id = data.get("id").replaceAll("\"", ""); |
| | | opinionService.updateOpinion(id, opinion); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "查看编辑意见", tags = "QMS管理-->不合格品处置") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "rawUnacceptedId",value = "不合格品处置Id",dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @GetMapping("/viewEditorial") |
| | | public Result<?> viewEditorialComments(Integer rawUnacceptedId) { |
| | | return Result.success(opinionService.viewEditorialComments(rawUnacceptedId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "失焦更新现像描述", tags = "QMS管理-->不合格品处置") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "rawUnacceptedId",value = "不合格品处置Id",dataTypeClass = Integer.class,required = true), |
| | | @ApiImplicitParam(name = "tell",value = "现象描述",dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @GetMapping("/descriptionUpdate") |
| | | public Result<?> descriptionUpdate(Integer rawUnacceptedId, String tell) { |
| | | return Result.success(inspectUnacceptedService.descriptionUpdate(rawUnacceptedId, tell)); |
| | | } |
| | | |
| | | @ApiOperation(value = "点击编辑意见触发查询", tags = "QMS管理-->不合格品处置") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "rawUnacceptedId",value = "不合格品处置Id",dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @PostMapping("/clickEditing") |
| | | public Result<?> clickEditingTriggerQuery(Integer rawUnacceptedId) { |
| | | return Result.success(opinionService.clickEditingTriggerQuery(rawUnacceptedId)); |
| | | } |
| | | } |
| | | |