| | |
| | | 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.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | } |
| | | } |
| | | |
| | | @PostMapping("componentRelatedSubmit") |
| | | @ApiOperation(value="散装件-产品审批提交") |
| | | public Response componentProductSubmit(@RequestBody WorksheetMainDTO mainDTO){ |
| | | @PostMapping("materialRelatedSubmit") |
| | | @ApiOperation(value="物料-产品审批提交") |
| | | public Response materialProductSubmit(@RequestBody WorksheetMainDTO mainDTO){ |
| | | DocUser user = ActionUtil.getUser(); |
| | | boolean res = service.componentProductSubmit(mainDTO,user); |
| | | boolean res = service.MaterialProductSubmit(mainDTO,user); |
| | | if(res) { |
| | | return new Response().set(1,true, "提交完成"); |
| | | }else{ |
| | |
| | | } |
| | | } |
| | | |
| | | @PostMapping("componentSubmit") |
| | | @ApiOperation(value="散装件审批提交") |
| | | public Response componentSubmit(@RequestBody WorksheetMain main){ |
| | | @PostMapping("materialSubmit") |
| | | @ApiOperation(value="物料审批提交") |
| | | public Response materialSubmit(@RequestBody WorksheetMain main){ |
| | | Response<Object> response = new Response<>(); |
| | | DocUser user = ActionUtil.getUser(); |
| | | Response res = service.componentSubmit(main,user); |
| | | Response res = service.materialSubmit(main,user); |
| | | if(res.getCode()==1) { |
| | | response.set(1,true, "提交完成"); |
| | | }else if(res.getCode()==3){ |
| | |
| | | }else{ |
| | | //重复提交 |
| | | Object existCAList = res.getData(); |
| | | Object existComponentList = res.getData2(); |
| | | Object existMaterialList = res.getData2(); |
| | | response.setCode(1); |
| | | response.setData(false); |
| | | response.setData2(existCAList); |
| | | response.setData3(existComponentList); |
| | | response.setData3(existMaterialList); |
| | | if(res.getCode()==21){ |
| | | response.setMsg("重复提交:现有散装件及正在进行审批的散装件中,存在当前提交上传的散装件"); |
| | | response.setMsg("重复提交:现有物料及正在进行审批的物料中,存在当前提交上传的散装件"); |
| | | }else if(res.getCode()==22){ |
| | | response.setMsg("重复提交:正在进行审批的散装件中,存在当前提交上传的散装件"); |
| | | response.setMsg("重复提交:正在进行审批的物料中,存在当前提交上传的物料"); |
| | | }else{ |
| | | response.setMsg("重复提交:现有散装件中,存在当前提交上传的散装件"); |
| | | response.setMsg("重复提交:现有物料中,存在当前提交上传的物料"); |
| | | } |
| | | } |
| | | return response; |
| | |
| | | |
| | | @PostMapping("productSoftwareSubmit") |
| | | @ApiOperation(value="产品软件审批提交") |
| | | public Response productSoftwareSubmit(@RequestBody WorksheetMainDTO2 mainDTO) throws IOException { |
| | | public Response productSoftwareSubmit(@RequestParam MultipartFile multipartFile,@RequestParam String mainDTOString) throws IOException { |
| | | DocUser user = ActionUtil.getUser(); |
| | | return service.productSoftwareSubmit(mainDTO,user); |
| | | WorksheetMainDTO2 mainDTO = ActionUtil.getGson().fromJson(mainDTOString, WorksheetMainDTO2.class); |
| | | return service.productSoftwareSubmit(multipartFile,mainDTO,user); |
| | | } |
| | | |
| | | @GetMapping("statusStatistic") |