| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | | import com.yuanchu.mom.dto.CostStatisticsDto; |
| | | import com.yuanchu.mom.dto.SampleOrderDto; |
| | | import com.yuanchu.mom.dto.SampleProductDto; |
| | | import com.yuanchu.mom.dto.SampleProductDto2; |
| | | import com.yuanchu.mom.dto.*; |
| | | import com.yuanchu.mom.pojo.InsOrder; |
| | | import com.yuanchu.mom.pojo.InsOrderTemplate; |
| | | import com.yuanchu.mom.pojo.InsProduct; |
| | | import com.yuanchu.mom.pojo.InsSample; |
| | | import com.yuanchu.mom.service.InsOrderService; |
| | | import com.yuanchu.mom.service.InsOrderTemplateService; |
| | | import com.yuanchu.mom.service.InsProductService; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | |
| | | return Result.success(insOrderService.selectInsOrderParameter(page, sampleOrderDto)); |
| | | } |
| | | |
| | | //用于检验下单区别查看所有订单和只查看同一个委托单位的订单 |
| | | @ValueClassify("检验下单") |
| | | @ApiOperation(value = "查看所有检验单") |
| | | @PostMapping("/selectAllInsOrder") |
| | | public Result selectAllInsOrder(){ |
| | | @ApiOperation(value = "查询所有检验单") |
| | | @PostMapping("/selectAllInsOrderParameter") |
| | | public Result selectAllInsOrderParameter() { |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ValueClassify("检验下单") |
| | | @ApiOperation(value = "检验分配") |
| | | @PostMapping("/upInsOrder") |
| | | public Result<?> upInsOrder(Integer orderId, Integer sampleId, String appointed, Integer userId) { |
| | | return Result.success(insOrderService.upInsOrder(orderId, sampleId, appointed, userId)); |
| | | } |
| | | @ValueClassify("检验下单") |
| | | @ApiOperation(value = "添加检验下单数据") |
| | | @PostMapping("/addInsOrder") |
| | | public Result<?> addInsOrder(@RequestBody Map<String, Object> map) { |
| | | public Result<?> addInsOrder(@RequestParam String str, List<MultipartFile> files) { |
| | | Map<String, Object> map = JSON.parseObject(str, Map.class); |
| | | JSONArray jsonArray = JSON.parseArray(map.get("list")+""); |
| | | List<SampleProductDto> list = jsonArray.toJavaList(SampleProductDto.class); |
| | | InsOrder insOrder = JSON.parseObject(JSON.toJSONString(map.get("insOrder")), InsOrder.class); |
| | | List<List<Integer>> pairing = JSON.parseArray(map.get("pairing")+""); |
| | | return Result.success(insOrderService.addInsOrder(list, insOrder, pairing)); |
| | | return Result.success(insOrderService.addInsOrder(list, insOrder, pairing,files)); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询订单最长预计时间") |
| | |
| | | @ValueAuth |
| | | public Result<?> selectOrderManDay(Integer id) { |
| | | int day = insProductService.selectOrderManDay(id); |
| | | return Result.success("成功", LocalDateTime.now().plusDays(day).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); |
| | | return Result.success("成功", LocalDateTime.now().plusHours(day).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询检验下单内容详情") |
| | |
| | | public Result<?> getInsOrder(Integer orderId) { |
| | | return Result.success(insOrderService.getInsOrder(orderId)); |
| | | } |
| | | @ValueClassify("检验下单") |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "审核检验单进行状态修改") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "检验单id", dataTypeClass = Integer.class), |
| | |
| | | public Result<?> upInsOrderOfState(@RequestBody InsOrder insOrder) { |
| | | return Result.success(insOrderService.upInsOrderOfState(insOrder)); |
| | | } |
| | | |
| | | @ValueClassify("检验下单") |
| | | @ApiOperation(value = "检测中心主任审核/研发部经理审核/技术负责人审核") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "检验单id", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "state", value = "审核结果 1:通过 2:不通过", dataTypeClass = Integer.class) |
| | | }) |
| | | @PostMapping("/upInsOrderOfState2") |
| | | public Result<?> upInsOrderOfState2(@RequestBody InsOrder insOrder) { |
| | | return Result.success(insOrderService.upInsOrderOfState2(insOrder)); |
| | | } |
| | | |
| | | @ValueClassify("检验下单") |
| | | @ApiOperation(value = "添加检验单模板") |
| | | @PostMapping("/addInsOrderTemplate") |
| | |
| | | @ApiOperation(value = "查询检验单模板") |
| | | @GetMapping("/selectInsOrderTemplate") |
| | | @ValueAuth |
| | | public Result<?> selectInsOrderTemplate() { |
| | | return Result.success(insOrderTemplateService.selectInsOrderTemplate()); |
| | | public Result<?> selectInsOrderTemplate(String company) { |
| | | return Result.success(insOrderTemplateService.selectInsOrderTemplate(company)); |
| | | } |
| | | |
| | | @ApiOperation(value = "通过检验单模板id获取检验单模板内容") |
| | |
| | | CostStatisticsDto costStatisticsDto = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), CostStatisticsDto.class); |
| | | return Result.success(insOrderService.costStatistics(page, costStatisticsDto)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "费用统计获取总价") |
| | | @PostMapping("/costStatistics2") |
| | | public Result<?> costStatistics2(@RequestBody Map<String, Object> data) throws Exception { |
| | | CostStatisticsDto costStatisticsDto = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), CostStatisticsDto.class); |
| | | return Result.success(insOrderService.costStatistics2(costStatisticsDto)); |
| | | } |
| | | |
| | | @ValueClassify("统计图表") |
| | | @ApiOperation(value = "样品缺陷指数") |
| | | @PostMapping("/selectSampleDefects") |
| | |
| | | return Result.success(); |
| | | } |
| | | |
| | | //待检的撤销的查询待检项目 |
| | | @ValueAuth |
| | | @PostMapping("/selectNoProducts") |
| | | public Result<?> selectNoProducts(@RequestBody Map<String, Object> data,Integer orderId ,String ids) throws Exception { |
| | | Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class); |
| | | InsProduct insProduct = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), InsProduct.class); |
| | | return Result.success(insProductService.selectNoProducts(page, insProduct,orderId,ids)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "待检的撤销") |
| | | @PutMapping("/updateInspected") |
| | | @ValueAuth |
| | | public Result<?> updateInspected(Integer id){ |
| | | insProductService.updateInspected(id); |
| | | public Result<?> updateInspected(Integer orderId,String ids){ |
| | | insProductService.updateInspected(orderId,ids); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ValueClassify("检验下单") |
| | | @ApiOperation(value = "审核待检撤销") |
| | | @PostMapping("/checkUpdate") |
| | | public Result<?> checkUpdate(Integer orderId,Integer state){ |
| | | insProductService.checkUpdate(orderId,state); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ValueClassify("检验下单") |
| | | @ApiOperation(value = "标签打印") |
| | | @PostMapping("/labelPrinting") |
| | | public Result<?> labelPrinting(String ids) { |
| | | return Result.success(insOrderService.labelPrinting(ids)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "校验电机编号") |
| | | @PostMapping("/checkNumber") |
| | | public Result<?> checkNumber(String ids) { |
| | | return Result.success(insOrderService.checkNumber(ids)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "填写电机编号") |
| | | @PostMapping("/addNumber") |
| | | public Result<?> addNumber(@RequestBody AddNumberDto addNumberDto) { |
| | | return Result.success(insOrderService.addNumber(addNumberDto.getInsSamples())); |
| | | } |
| | | |
| | | @ValueClassify("费用统计") |
| | | @ApiOperation(value = "费用统计导出") |
| | | @PostMapping("/export") |
| | | public void export(@RequestBody Map<String, Object> data,HttpServletResponse response) throws Exception { |
| | | CostStatisticsDto costStatisticsDto = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), CostStatisticsDto.class); |
| | | insOrderService.export(costStatisticsDto,response); |
| | | } |
| | | |
| | | |
| | | } |