package com.whyc.controller;
|
|
import com.whyc.dto.Response;
|
import com.whyc.pojo.BOMFeedback;
|
import com.whyc.pojo.DefectiveProducts;
|
import com.whyc.pojo.DefectiveProductsHistory;
|
import com.whyc.service.BOMFeedbakService;
|
import com.whyc.service.DefectiveProductsService;
|
import com.whyc.util.ActionUtil;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.multipart.MultipartFile;
|
|
import javax.mail.MessagingException;
|
import java.io.IOException;
|
import java.util.List;
|
|
@RestController
|
@Api(tags = "不良品管理")
|
@RequestMapping("defective")
|
public class DefectiveProductsController {
|
|
@Autowired
|
private DefectiveProductsService service;
|
|
@ApiOperation("录入不良品信息")
|
@PostMapping("addDefective")
|
public Response addDefective(@RequestPart(required = false) List<MultipartFile> multipartFileList, @RequestParam String defectiveJson) throws IOException, MessagingException {
|
DefectiveProducts defective= ActionUtil.getGson().fromJson(defectiveJson, DefectiveProducts.class);
|
return service.addDefective(defective,multipartFileList);
|
}
|
|
@ApiOperation("处理不良品")
|
@PostMapping("updateDefective")
|
public Response updateDefective(@RequestBody DefectiveProductsHistory defectiveHis) throws IOException, MessagingException {
|
return service.updateDefective(defectiveHis);
|
}
|
}
|