| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | |
| | | |
| | | //获取检验下单数据 |
| | | @ValueClassify("检验下单") |
| | | @ApiOperation(value = "查询检验下单数据") |
| | | @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)); |
| | | } |
| | | |
| | | @ValueClassify("检验下单") |
| | | @ApiOperation(value = "查看所有检验单") |
| | | @PostMapping("/selectAllInsOrder") |
| | | public Result selectAllInsOrder(){ |
| | | 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)); |
| | | public Result<?> upInsOrder(Integer orderId, Integer sampleId, String appointed, Integer userId,String sonLaboratory) { |
| | | return Result.success(insOrderService.upInsOrder(orderId, sampleId, appointed, userId,sonLaboratory)); |
| | | } |
| | | @ValueClassify("检验下单") |
| | | @ApiOperation(value = "添加检验下单数据") |
| | | @PostMapping("/addInsOrder") |
| | | public Result<?> addInsOrder(@RequestBody Map<String, Object> map) { |
| | | 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); |
| | | return Result.success(insOrderService.addInsOrder(list, insOrder)); |
| | | List<List<Integer>> pairing = JSON.parseArray(map.get("pairing")+""); |
| | | return Result.success(insOrderService.addInsOrder(list, insOrder, pairing)); |
| | | } |
| | | |
| | | @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 = "查询检验下单内容详情") |
| | |
| | | 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") |
| | |
| | | } |
| | | |
| | | @ValueClassify("检验下单") |
| | | @ApiOperation(value = "更新状态") |
| | | @ApiOperation(value = "撤销") |
| | | @PutMapping("/updateStatus") |
| | | public Result<?> updateStatus(Integer id) { |
| | | insOrderService.updateStatus(id); |
| | | return Result.success(); |
| | | } |
| | | @ValueClassify("检验下单") |
| | | @ApiOperation("将待检验的的撤销更改") |
| | | |
| | | @PutMapping("/updateInspected") |
| | | @ValueAuth |
| | | public Result<?> updateInspected(Integer id){ |
| | | insProductService.updateInspected(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ValueClassify("检验下单") |
| | | @ApiOperation(value = "标签打印") |
| | | @PostMapping("/labelPrinting") |
| | | public Result<?> labelPrinting(String ids) { |
| | | return Result.success(insOrderService.labelPrinting(ids)); |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | } |