| | |
| | | package com.ruoyi.inspect.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 com.ruoyi.basic.dto.InventoryDetailDTO; |
| | | import com.ruoyi.basic.mapper.IfsInventoryQuantityMapper; |
| | | import com.ruoyi.basic.pojo.IfsInventoryQuantity; |
| | | import com.ruoyi.basic.pojo.StandardProductList; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.utils.JackSonUtil; |
| | | import com.ruoyi.framework.exception.ErrorException; |
| | | import com.ruoyi.inspect.dto.*; |
| | | import com.ruoyi.inspect.pojo.InsOrder; |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/insOrder") |
| | | @Api(tags="检验单模块") |
| | | @Api(tags = "检验单模块") |
| | | public class InsOrderController { |
| | | |
| | | private InsOrderService insOrderService; |
| | |
| | | |
| | | @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)); |
| | | 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 = "添加检验下单数据") |
| | |
| | | |
| | | @ApiOperation(value = "通过检验单查询检验数据(数据查看)") |
| | | @GetMapping("/selectSampleAndProductByOrderId") |
| | | public Result<?> selectSampleAndProductByOrderId(Page page, SampleProductDto2 sampleProductDto){ |
| | | public Result<?> selectSampleAndProductByOrderId(Page page, SampleProductDto2 sampleProductDto) { |
| | | return Result.success(insOrderService.selectSampleAndProductByOrderId(page, sampleProductDto)); |
| | | } |
| | | |
| | |
| | | |
| | | //待检的撤销的查询待检项目 |
| | | @GetMapping("/selectNoProducts") |
| | | public Result<?> selectNoProducts(Page page, InsProduct insProduct,Integer orderId ,String ids){ |
| | | return Result.success(insProductService.selectNoProducts(page, insProduct,orderId,ids)); |
| | | public Result<?> selectNoProducts(Page page, InsProduct insProduct, Integer orderId, String ids) { |
| | | return Result.success(insProductService.selectNoProducts(page, insProduct, orderId, ids)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "待检的撤销") |
| | | @PostMapping("/updateInspected") |
| | | public Result<?> updateInspected(@RequestBody Map<String, Object> param){ |
| | | public Result<?> updateInspected(@RequestBody Map<String, Object> param) { |
| | | Integer orderId = (Integer) param.get("orderId"); |
| | | String ids = (String) param.get("ids"); |
| | | Integer typeSource = (Integer) param.get("typeSource"); |
| | | Integer ifsInventoryId = (Integer) param.get("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)); // 撤销 |
| | | Long ifsInventoryId = Long.parseLong(param.get("ifsInventoryId").toString()); |
| | | 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); |
| | | insProductService.updateInspected(orderId, ids); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "审核待检撤销") |
| | | @PostMapping("/checkUpdate") |
| | | public Result<?> checkUpdate(@RequestBody Map<String, Object> param){ |
| | | public Result<?> checkUpdate(@RequestBody Map<String, Object> param) { |
| | | Integer orderId = (Integer) param.get("orderId"); |
| | | Integer state = (Integer) param.get("state"); |
| | | insProductService.checkUpdate(orderId,state); |
| | | insProductService.checkUpdate(orderId, state); |
| | | return Result.success(); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "获取ifs订单") |
| | | @GetMapping("/getIfsOrder") |
| | | public Result<?> getIfsOrder() { |
| | | insOrderService.getIfsOrder(); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("LOCATION_NO", "1302;WG-04-001"); |
| | | map.put("STATE_DB", "To be Inspected"); |
| | | insOrderService.getIfsOrder(map, false); |
| | | return Result.success(); |
| | | } |
| | | |
| | |
| | | return Result.success(insOrderService.labelOrderPrinting(ids)); |
| | | } |
| | | |
| | | @ApiOperation(value = "外购下单成品标签打印") |
| | | @PostMapping("/labelOutsideOrderPrinting") |
| | | public Result<List<InventoryDetailDTO>> labelOutsideOrderPrinting(@RequestBody Map<String, Object> param) { |
| | | List<Integer> ids = (List<Integer>) param.get("ids"); |
| | | return Result.success(insOrderService.labelOutsideOrderPrinting(ids)); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据订单id查询样品") |
| | | @GetMapping("/getSampleByOrderId") |
| | | public Result<List<InsSample>> getSampleByOrderId(Integer insOrderId) { |
| | |
| | | |
| | | @ApiOperation(value = "成品检验单全部信息导出") |
| | | @GetMapping("/rawAllInsOrderExport") |
| | | public void rawAllInsOrderExport(SampleOrderDto sampleOrderDto, HttpServletResponse response){ |
| | | insOrderService.rawAllInsOrderExport(sampleOrderDto,response); |
| | | public void rawAllInsOrderExport(SampleOrderDto sampleOrderDto, HttpServletResponse response) { |
| | | insOrderService.rawAllInsOrderExport(sampleOrderDto, response); |
| | | } |
| | | |
| | | |
| | |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询当前时间是否没有该检测项的抽样计划") |
| | | @PostMapping("/judgeNotSpotCheckOrder") |
| | | public Result<?> judgeNotSpotCheckOrder(@RequestBody InsPlaceOrderDto insPlaceOrderDto) { |
| | | return insOrderService.judgeNotSpotCheckOrder(insPlaceOrderDto.getSampleList(), insPlaceOrderDto.getInsOrder()); |
| | | } |
| | | |
| | | } |