//package com.ruoyi.basic.controller;
|
//
|
//import com.alibaba.fastjson.JSON;
|
//import com.alibaba.fastjson.JSONArray;
|
//import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
//import io.swagger.annotations.Api;
|
//import io.swagger.annotations.ApiImplicitParam;
|
//import io.swagger.annotations.ApiImplicitParams;
|
//import io.swagger.annotations.ApiOperation;
|
//import lombok.AllArgsConstructor;
|
//import org.springframework.scheduling.annotation.Scheduled;
|
//import org.springframework.web.bind.annotation.*;
|
//
|
//import javax.servlet.http.HttpServletResponse;
|
//import java.time.LocalDateTime;
|
//import java.time.format.DateTimeFormatter;
|
//import java.util.List;
|
//import java.util.Map;
|
//import java.util.Objects;
|
//
|
//@RestController
|
//@AllArgsConstructor
|
//@RequestMapping("/insOrder")
|
//@Api(tags="检验单模块")
|
//public class InsOrderController {
|
//
|
// private InsOrderService insOrderService;
|
//
|
// private InsSampleService insSampleService;
|
//
|
// private InsProductService insProductService;
|
//
|
// private IfsInventoryQuantityMapper ifsInventoryQuantityMapper;
|
//
|
// private InsOrderTemplateService insOrderTemplateService;
|
//
|
// //获取检验下单数据
|
// @ApiOperation(value = "查询单位检验单")
|
// @PostMapping("/selectInsOrderParameter")
|
// public Result selectInsOrderParameter(@RequestBody Map<String, Object> data) throws Exception {
|
// Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
|
// SampleOrderDto sampleOrderDto = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), SampleOrderDto.class);
|
// return Result.success(insOrderService.selectInsOrderParameter(page, sampleOrderDto));
|
// }
|
//
|
// //用于检验下单区别查看所有订单和只查看同一个委托单位的订单
|
// @ApiOperation(value = "查询所有检验单")
|
// @PostMapping("/selectAllInsOrderParameter")
|
// public Result selectAllInsOrderParameter() {
|
// return Result.success();
|
// }
|
//
|
//
|
// @ApiOperation(value = "检验分配")
|
// @PostMapping("/upInsOrder")
|
// public Result<?> upInsOrder(Integer orderId, Integer sampleId, String appointed, Integer userId,String sonLaboratory) {
|
// return Result.success(insOrderService.upInsOrder(orderId, sampleId, appointed, userId,sonLaboratory));
|
// }
|
//
|
// @ApiOperation(value = "添加检验下单数据")
|
// @PostMapping("/addInsOrder")
|
// public Result<?> addInsOrder(String str) {
|
// 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));
|
// }
|
//
|
// @ApiOperation(value = "查询订单最长预计时间")
|
// @PostMapping("/selectOrderManDay")
|
// public Result<?> selectOrderManDay(Integer id) {
|
// int day = insProductService.selectOrderManDay(id);
|
// return Result.success("成功", LocalDateTime.now().plusHours(day).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
// }
|
//
|
// @ApiOperation(value = "查询检验下单内容详情")
|
// @PostMapping("/getInsOrder")
|
// public Result<?> getInsOrder(Integer orderId) {
|
// return Result.success(insOrderService.getInsOrder(orderId));
|
// }
|
// @ValueClassify("检验下单")
|
// @ApiOperation(value = "审核检验单进行状态修改")
|
// @ApiImplicitParams({
|
// @ApiImplicitParam(name = "id", value = "检验单id", dataTypeClass = Integer.class),
|
// @ApiImplicitParam(name = "state", value = "审核结果 1:通过 2:不通过", dataTypeClass = Integer.class)
|
// })
|
//
|
// @PostMapping("/upInsOrderOfState")
|
// public Result<?> upInsOrderOfState(@RequestBody InsOrder insOrder) {
|
// return Result.success(insOrderService.upInsOrderOfState(insOrder));
|
// }
|
//
|
// @ApiOperation(value = "添加检验单模板")
|
// @PostMapping("/addInsOrderTemplate")
|
// public Result<?> addInsOrderTemplate(@RequestBody InsOrderTemplate insOrderTemplate) {
|
// return Result.success(insOrderTemplateService.addInsOrderTemplate(insOrderTemplate));
|
// }
|
//
|
// @ApiOperation(value = "查询检验单模板")
|
// @GetMapping("/selectInsOrderTemplate")
|
// public Result<?> selectInsOrderTemplate(String company) {
|
// return Result.success(insOrderTemplateService.selectInsOrderTemplate(company));
|
// }
|
//
|
// @ApiOperation(value = "通过检验单模板id获取检验单模板内容")
|
// @PostMapping("/selectInsOrderTemplateById")
|
// public Result<?> selectInsOrderTemplateById(Integer id) {
|
// return Result.success("成功", insOrderTemplateService.selectInsOrderTemplateById(id));
|
// }
|
//
|
// @ApiOperation(value = "删除检验单模板")
|
// @PostMapping("/delInsOrderTemplate")
|
// public Result<?> delInsOrderTemplate(Integer id) {
|
// return Result.success(insOrderTemplateService.delInsOrderTemplate(id));
|
// }
|
//
|
// @ApiOperation(value = "通过检验单查询检验数据(数据查看)")
|
// @PostMapping("/selectSampleAndProductByOrderId")
|
// public Result<?> selectSampleAndProductByOrderId(@RequestBody Map<String, Object> data) throws Exception {
|
// Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
|
// SampleProductDto2 sampleProductDto = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), SampleProductDto2.class);
|
// return Result.success(insOrderService.selectSampleAndProductByOrderId(page, sampleProductDto));
|
// }
|
//
|
// @ApiOperation(value = "费用统计")
|
// @PostMapping("/costStatistics")
|
// public Result<?> costStatistics(@RequestBody Map<String, Object> data) throws Exception {
|
// Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
|
// CostStatisticsDto costStatisticsDto = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), CostStatisticsDto.class);
|
// return Result.success(insOrderService.costStatistics(page, costStatisticsDto));
|
// }
|
//
|
// @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));
|
// }
|
//
|
//
|
// @ApiOperation(value = "样品缺陷指数")
|
// @PostMapping("/selectSampleDefects")
|
// public Result selectSampleDefects(Integer size, Integer current, String inspectionItems, String orderNumber) {
|
// return Result.success(insOrderService.selectSampleDefects(new Page<>(current, size),inspectionItems, orderNumber));
|
// }
|
//
|
//
|
// @ApiOperation(value = "撤销")
|
// @PutMapping("/updateStatus")
|
// public Result<?> updateStatus(Integer id) {
|
// insOrderService.updateStatus(id);
|
// return Result.success();
|
// }
|
//
|
// //待检的撤销的查询待检项目
|
// @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")
|
// public Result<?> updateInspected(Integer orderId, String ids,
|
// @RequestParam(value = "typeSource",required = false) Integer typeSource,
|
// @RequestParam(value = "ifsInventoryId",required = false) Integer ifsInventoryId){
|
// if(Objects.nonNull(typeSource) && typeSource == 1){
|
// ifsInventoryQuantityMapper.update(null,new LambdaUpdateWrapper<IfsInventoryQuantity>()
|
// .set(IfsInventoryQuantity::getState,0)
|
// .eq(IfsInventoryQuantity::getId,ifsInventoryId));
|
// insOrderService.update(null,new LambdaUpdateWrapper<InsOrder>().set(InsOrder::getState,-1).eq(InsOrder::getId,orderId)); // 撤销
|
// }
|
// insProductService.updateInspected(orderId,ids);
|
// return Result.success();
|
// }
|
//
|
// @ApiOperation(value = "审核待检撤销")
|
// @PostMapping("/checkUpdate")
|
// public Result<?> checkUpdate(Integer orderId,Integer state){
|
// insProductService.checkUpdate(orderId,state);
|
// return Result.success();
|
// }
|
//
|
// @ApiOperation(value = "标签打印")
|
// @PostMapping("/labelPrinting")
|
// public Result<?> labelPrinting(String ids) {
|
// return Result.success(insOrderService.labelPrinting(ids));
|
// }
|
//
|
//
|
// @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);
|
// }
|
//
|
//
|
// @ApiOperation(value = "获取ifs订单")
|
// @PostMapping("/getIfsOrder")
|
// public Result<?> getIfsOrder() {
|
// insOrderService.getIfsOrder();
|
// return Result.success();
|
// }
|
//
|
// @Scheduled(fixedDelay = 1200000)
|
// public void getIfsOrderTiming() {
|
// insOrderService.getIfsOrder();
|
// }
|
//
|
//
|
// @ApiOperation(value = "修改订单单号")
|
// @PostMapping("/updateEntrustCode")
|
// public Result<?> updateEntrustCode(@RequestBody InsOrder insOrder) {
|
// insOrderService.updateEntrustCode(insOrder);
|
// return Result.success();
|
// }
|
//
|
// @ApiOperation("查询不合格复测信息")
|
// @GetMapping("/getRetestResult")
|
// public Result<?> getRetestResult(Integer insProductId) {
|
// return Result.success(insOrderService.getRetestResult(insProductId));
|
// }
|
//
|
//
|
//
|
// @ApiOperation(value = "铜单丝下单")
|
// @PostMapping("/addRawCopperOrder")
|
// public Result<?> addRawCopperOrder(String str) {
|
// Map<String, Object> map = JSON.parseObject(str, Map.class);
|
// JSONArray jsonArray = JSON.parseArray(map.get("list")+"");
|
// List<SampleProductDto> list = jsonArray.toJavaList(SampleProductDto.class);
|
// CopperInsOrderDto CopperInsOrder = JSON.parseObject(JSON.toJSONString(map.get("insOrder")), CopperInsOrderDto.class);
|
// return Result.success(insOrderService.addRawCopperOrder(list, CopperInsOrder));
|
// }
|
//
|
//
|
// @ApiOperation(value = "修改委托编号")
|
// @PostMapping("/updateOrderEntrustCode")
|
// public Result<?> updateOrderEntrustCode(@RequestBody InsOrder insOrder) {
|
// insOrderService.updateOrderEntrustCode(insOrder);
|
// return Result.success();
|
// }
|
//
|
// @ApiOperation(value = "修改检验下单内容")
|
// @PostMapping("/updateInsOrder")
|
// public Result<?> updateInsOrder(@RequestBody InsOrderUpdateDto insOrderUpdateDto) {
|
// return Result.success(insOrderService.updateInsOrder(insOrderUpdateDto));
|
// }
|
//
|
// @ApiOperation(value = "删除退回订单")
|
// @GetMapping("/delInsOrder")
|
// public Result<?> delInsOrder(Integer insOrderId) {
|
// // 查询订单
|
// InsOrder order = insOrderService.getById(insOrderId);
|
// if (!order.getState().equals(2)) {
|
// throw new ErrorException("只有退回订单才能删除");
|
// }
|
//
|
// return Result.success(insOrderService.removeById(insOrderId));
|
// }
|
//
|
// @ApiOperation(value = "成品标签打印")
|
// @PostMapping("/labelOrderPrinting")
|
// public Result<List<InsOrderPrintingVo>> labelOrderPrinting(@RequestBody Map<String, Object> param) {
|
// List<Integer> ids = (List<Integer>) param.get("ids");
|
// return Result.success(insOrderService.labelOrderPrinting(ids));
|
// }
|
//
|
// @ApiOperation(value = "根据订单id查询样品")
|
// @GetMapping("/getSampleByOrderId")
|
// public Result<List<InsSample>> getSampleByOrderId(Integer insOrderId) {
|
// return Result.success(insSampleService.list(Wrappers.<InsSample>lambdaQuery()
|
// .eq(InsSample::getInsOrderId, insOrderId)));
|
// }
|
//
|
// @ApiOperation(value = "根据样品id查询检验项树")
|
// @GetMapping("/getProductTreeBySampleId")
|
// public Result<List<StandardProductList>> getProductTreeBySampleId(Integer insSampleId) {
|
// return Result.success(insOrderService.getProductTreeBySampleId(insSampleId));
|
// }
|
//
|
//
|
// @ApiOperation(value = "添加遗漏的检验项")
|
// @PostMapping("/addOmitOrderProduct")
|
// public Result addOmitOrderProduct(@RequestBody OmitOrderProductDto omitOrderProductDto) {
|
// return Result.success(insOrderService.addOmitOrderProduct(omitOrderProductDto));
|
// }
|
//
|
// @ApiOperation(value = "成品检验单全部信息导出")
|
// @PostMapping("/rawAllInsOrderExport")
|
// public void rawAllInsOrderExport(@RequestBody SampleOrderDto sampleOrderDto, HttpServletResponse response){
|
// insOrderService.rawAllInsOrderExport(sampleOrderDto,response);
|
// }
|
//
|
//}
|