package com.prolog.cs.biz.outbound.controller;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.netflix.hystrix.strategy.concurrency.HystrixRequestContext;
import com.prolog.cs.basic.common.model.print.PrintParam;
import com.prolog.cs.biz.outbound.dao.PickTaskDMapper;
import com.prolog.cs.biz.outbound.dao.PickTaskHMapper;
import com.prolog.cs.biz.outbound.dao.WaveBillDMapper;
import com.prolog.cs.biz.outbound.model.PickTaskD;
import com.prolog.cs.biz.outbound.model.PickTaskH;
import com.prolog.cs.biz.outbound.model.dto.ContainerListDTO;
import com.prolog.cs.biz.outbound.model.dto.OuterTaskDDTO;
import com.prolog.cs.biz.outbound.model.dto.PickTaskDDTO;
import com.prolog.cs.biz.outbound.model.dto.RFWholePickOrderDto;
import com.prolog.cs.biz.outbound.model.entity.PrintLog;
import com.prolog.cs.biz.outbound.model.entity.WaveBillDDO;
import com.prolog.cs.biz.outbound.model.out.ContainerBindTaskDto;
import com.prolog.cs.biz.outbound.model.vo.BulkPickBoardVo;
import com.prolog.cs.biz.outbound.model.vo.PickTaskDConfirmVO;
import com.prolog.cs.biz.outbound.model.vo.PickTaskDVo;
import com.prolog.cs.biz.outbound.model.vo.TaskCountVo;
import com.prolog.cs.biz.outbound.service.BarCodeService;
import com.prolog.cs.biz.outbound.service.PickTaskAppService;
import com.prolog.cs.biz.outbound.service.PrintLogService;
import com.prolog.cs.biz.outbound.service.impl.PickTaskAppServiceImpl;
import com.prolog.entity.vo.OperationCompleteVO;
import com.prolog.framework.authority.util.HystrixVarUtil;
import com.prolog.framework.common.message.RestMessage;
import com.prolog.framework.core.exception.ParameterException;
import com.prolog.framework.core.pojo.Page;
import com.prolog.framework.log.aop.annotation.UserLog;
import com.prolog.framework.utils.MapUtils;
import com.prolog.framework.utils.StringUtils;
import com.prolog.inte.EisHandler;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author zzz
 * @desc
 * @date 2021/4/27
 */
@Api(tags = "app-拣选任务")
@RestController
@RequestMapping("/picktaskapp")
public class PickTaskAppController {

    private static Logger log = LoggerFactory.getLogger(PickTaskAppController.class);

    @Autowired
    private PickTaskAppService pickTaskAppService;

    @Autowired
    private PickTaskAppServiceImpl pickTaskAppServiceImpl;

    @Autowired
    private BarCodeService barCodeService;

    @Resource
    private EisHandler eisHandler;

    @Autowired
    private PickTaskHMapper pickTaskHMapper;

    @Autowired
    private PickTaskDMapper pickTaskDMapper;

    @Autowired
    private WaveBillDMapper waveBillDMapper;
    @Autowired
    private PrintLogService printLogService;

    @UserLog
    @ApiOperation(value = "外复核-待索取任务订单列表")
    @GetMapping("/page-outercheck-unask")
    public RestMessage<Page<OuterTaskDDTO>> outerCheckUnAsk(String barcode,String bldgId,String warehouseId, Integer pageNum, Integer pageSize){
        Page<OuterTaskDDTO> page = pickTaskAppService.outerCheckUnAsk(barcode,bldgId,warehouseId,pageNum,pageSize);
        return RestMessage.success("操作成功", page);
    }

    @UserLog
    @ApiOperation(value = "外复核-订单所有复核任务列表")
    @GetMapping("/page-outercheck-uncheck")
    public RestMessage<Page<OuterTaskDDTO>> outerCheckUnCheck(String bldgId,String srcCode,String warehouseId, Integer pageNum, Integer pageSize){
        Page<OuterTaskDDTO> page = pickTaskAppService.outerCheckUnCheck(bldgId,srcCode,warehouseId,pageNum,pageSize);
        return RestMessage.success("操作成功", page);
    }

    @UserLog
    @ApiOperation(value = "外复核-确认")
    @ApiImplicitParam(name = "params", required = true, value = "{\"barcode\":\"条码\",\"pcs\":\"件数\",\"warehouseId\":\"仓id\"}")
    @PostMapping("/outercheck-confirm")
    public RestMessage<Boolean> outerCheckConfirm(@RequestBody Map<String ,Object> params){
        String barcode = (String) params.get("barcode");
        Integer pcs = (Integer)params.get("pcs");
        String warehouseId = (String) params.get("warehouseId");
        String type = (String)params.get("type");
        if(type.equals("0")){
            barCodeService.outerCheckRed(params);
        }
        return RestMessage.success("操作成功", pickTaskAppService.outerCheckConfirm(barcode,pcs,null,warehouseId));
    }

    @UserLog
    @ApiOperation(value = "查询待索取任务数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pickTaskType", value = "拣货类型（0:整件 1:零货 2:功能库房 3:整单）", required = true, dataType = "String"),
            @ApiImplicitParam(name = "warehouseId", value = "仓id", required = true, dataType = "String"),
            @ApiImplicitParam(name = "type", value = "0:拣货任务 1:补货任务", required = false, dataType = "String")
    })
    @GetMapping("/picktask-count")
    public RestMessage<Long> getPickTaskCount(String bldgId,String warehouseId,Integer pickTaskType,String operatorCode,Integer type){
        return RestMessage.success("操作成功", pickTaskAppService.getPickTaskCount(bldgId,warehouseId,pickTaskType,operatorCode,type));
    }

    @UserLog
    @ApiOperation(value = "RF零货拣货-查询区域对应任务数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "warehouseId", value = "仓id", required = true, dataType = "String"),
            @ApiImplicitParam(name = "bldgId", value = "建筑物id", required = true, dataType = "String")
    })
    @GetMapping("/queryAreaTaskList")
    public RestMessage<Map<String, Object>> queryAreaTaskList(String bldgId, String warehouseId) {
        return RestMessage.success("操作成功", pickTaskAppService.queryAreaTaskList(bldgId,warehouseId));
    }

    @UserLog
    @ApiOperation(value = "索取")
    @ApiImplicitParam(name = "params", required = true, value = "{\"pickTaskType\":\"拣货类型（0:整件 1:零货 2:功能库房 3:整单）\",\"warehouseId\":\"仓id\",\"bldgId\":\"建筑物id\"}")
    @PostMapping("/ask-pickorder")
    public RestMessage<?> askPickorder(@RequestBody Map<String,Object> params){
        Integer pickTaskType = (Integer)params.get("pickTaskType");
        String warehouseId = (String) params.get("warehouseId");
        String bldgId = (String)params.get("bldgId");
        // 周转箱数
        String pickBoxNum = (String)params.get("pickBoxNum");
        if (StrUtil.isEmpty(pickBoxNum)){
            pickBoxNum = "0";
        }
        return RestMessage.success("操作成功", pickTaskAppService.createByOperatorCode(bldgId,warehouseId,pickTaskType, Integer.valueOf(pickBoxNum)));
    }

    @UserLog
    @ApiOperation(value = "零货-拣货任务看板")
    @ApiImplicitParam(name = "params", required = true, value = "{'warehouseId':'仓id'}")
    @PostMapping("/bulkPickBoard")
    public RestMessage<BulkPickBoardVo> bulkPickBoard(@RequestBody Map<String,String> params){
        String warehouseId = params.get("warehouseId");
        String bldgId = (String)params.get("bldgId");
        return RestMessage.success("操作成功", pickTaskAppService.bulkPickBoard(bldgId, warehouseId));
    }

    @UserLog
    @ApiOperation(value = "零货/功能库房/整单-绑定容器")
    @ApiImplicitParam(name = "params", required = true, value = "{'pickOrderId':'拣选单id','containerCode':'容器号','warehouseId':'仓id'}")
    @PostMapping("/bind-container")
    public RestMessage<?> bindContainer(@RequestBody Map<String,String> params){
        String pickOrderId = params.get("pickOrderId");
        String containerCode = params.get("containerCode");
        String warehouseId = params.get("warehouseId");
        return RestMessage.success("操作成功", pickTaskAppService.bindContainer(pickOrderId,containerCode,warehouseId));
    }

    @UserLog
    @ApiOperation(value = "零货-查询任务列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pickOrderId", value = "任务包号", required = true, dataType = "String"),
            @ApiImplicitParam(name = "warehouseId", value = "仓id", required = true, dataType = "String"),
            @ApiImplicitParam(name = "bldgId", value = "建筑物id", required = true, dataType = "String"),
            @ApiImplicitParam(name = "pageNum", value = "当前页码", required = true, dataType = "int"),
            @ApiImplicitParam(name = "pageSize", value = "每页数量", required = true, dataType = "int")
    })
    @GetMapping("/page-bulkPicktaskd")
    public RestMessage<Page<PickTaskDVo>> getBulkPickTaskDList(String bldgId, String pickOrderId, String warehouseId, Integer pageNum, Integer pageSize){
        return RestMessage.success("操作成功", pickTaskAppService.getBulkPickTaskDList(bldgId,warehouseId,pickOrderId,pageNum,pageSize));
    }

    @UserLog
    @ApiOperation(value = "零货-拣货确认")
    @PostMapping("/picktask-bulkConfirm")
    public RestMessage<Boolean> pickTaskBulkConfirm(@RequestBody PickTaskDVo pickTaskDVo){
        return RestMessage.success("操作成功", pickTaskAppService.pickTaskBulkConfirm(pickTaskDVo));
    }

    @UserLog
    @ApiOperation(value = "零货/功能库房/整单-查询任务列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pickOrderId", value = "任务包号", required = true, dataType = "String"),
            @ApiImplicitParam(name = "warehouseId", value = "仓id", required = true, dataType = "String"),
            @ApiImplicitParam(name = "bldgId", value = "建筑物id", required = true, dataType = "String"),
            @ApiImplicitParam(name = "pageNum", value = "当前页码", required = true, dataType = "int"),
            @ApiImplicitParam(name = "pageSize", value = "每页数量", required = true, dataType = "int")
    })
    @GetMapping("/page-picktaskd")
    public RestMessage<Page<PickTaskDDTO>> getPickTaskDList(
            String bldgId,
            String pickOrderId,
            String warehouseId,
            Integer pageNum,
            Integer pageSize
    ){
        return RestMessage.success("操作成功",
                pickTaskAppService.getPickTaskDList(
                        bldgId,
                        warehouseId,
                        pickOrderId,
                        pageNum,
                        pageSize
                )
        );
    }

    @UserLog
    @ApiOperation(value = "RF拣货确认-查询任务列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "containerCode", value = "任务包号", required = true, dataType = "String"),
            @ApiImplicitParam(name = "warehouseId", value = "仓id", required = true, dataType = "String"),
            @ApiImplicitParam(name = "bldgId", value = "建筑物id", required = true, dataType = "String"),
            @ApiImplicitParam(name = "pageNum", value = "当前页码", required = true, dataType = "int"),
            @ApiImplicitParam(name = "pageSize", value = "每页数量", required = true, dataType = "int")
    })
    @GetMapping("/page/confirmTaskList")
    public RestMessage<Page<PickTaskDDTO>> getConfirmTaskList(
            String bldgId,
            String containerCode,
            String warehouseId,
            Integer pageNum,
            Integer pageSize
    ){
        return RestMessage.success("操作成功",
                pickTaskAppService.getConfirmTaskList(
                        bldgId,
                        warehouseId,
                        containerCode,
                        pageNum,
                        pageSize
                )
        );
    }

    @UserLog
    @ApiOperation(value = "RF拣货确认-确认")
    @PostMapping("/picktask-RFConfirm")
    public RestMessage<Map<String, Object>> RFConfirm(@RequestBody PickTaskDConfirmVO vo){
        return RestMessage.success("操作成功", pickTaskAppService.pickTaskHConfirm(vo.getPickOrderId(),vo.getPickTaskDId(),vo.getPickTaskId(), vo.getPickQty(),vo.getRedReason(),vo.getRedType()));
    }


    @UserLog
    @ApiOperation(value = "整件-查询任务列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pickOrderId", value = "任务包号", required = false, dataType = "String"),
            @ApiImplicitParam(name = "warehouseId", value = "仓id", required = true, dataType = "String"),
            @ApiImplicitParam(name = "bldgId", value = "建筑物id", required = true, dataType = "String"),
            @ApiImplicitParam(name = "pageNum", value = "当前页码", required = true, dataType = "int"),
            @ApiImplicitParam(name = "pageSize", value = "每页数量", required = true, dataType = "int")
    })
    @GetMapping("/page-picktaskh")
    public RestMessage<Map<String, Object>> getTaskHListByPickOrder(
            String bldgId,
            String pickOrderId,
            String warehouseId,
            Integer pageNum,
            Integer pageSize
    ){
        return RestMessage.success("操作成功", pickTaskAppService.getTaskHListByPickOrder(bldgId,warehouseId,pickOrderId,pageNum,pageSize));
    }

    @UserLog
    @ApiOperation(value = "零货/功能库房/整单-查询任务容器列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pickOrderId", value = "任务包号", required = true, dataType = "String"),
            @ApiImplicitParam(name = "warehouseId", value = "仓id", required = true, dataType = "String"),
            @ApiImplicitParam(name = "itemId", value = "商品id", required = true, dataType = "String"),
            @ApiImplicitParam(name = "locatorCode", value = "库位编码", required = true, dataType = "String"),
            @ApiImplicitParam(name = "manufacturerLotNum", value = "批号", required = true, dataType = "String")
    })
    @GetMapping("/list-container")
    public RestMessage<List<ContainerListDTO>> getContainerList(String pickOrderId,String warehouseId,String itemId,String locatorCode,String manufacturerLotNum){
        return RestMessage.success("操作成功", pickTaskAppService.getContainerList(warehouseId,pickOrderId,itemId,locatorCode,manufacturerLotNum));
    }

    @UserLog
    @ApiOperation(value = "零货/功能库房/整单-拣货确认")
    @PostMapping("/picktask-confirm")
    public RestMessage<Map<String, Object>> pickTaskConfirm(@RequestBody List<ContainerListDTO> list){
        Map<String, Object> map = pickTaskAppService.pickTaskConfirm(list);
        Object flag = map.get("flag");
//        Object data = map.get("printData");
//        if(data != null){
//            List<PrintParam> printData = (List<PrintParam>) data;
//            pickTaskAppService.print(printData);
//        }
        return RestMessage.success("操作成功", map);
    }

    @UserLog
    @ApiOperation(value = "整件-拣货确认")
    @PostMapping("/picktaskh-confirm")
    public RestMessage<?> pickTaskHConfirm(@RequestBody PickTaskDConfirmVO vo){
        Map<String, Object> map = pickTaskAppService.pickTaskHConfirm(vo.getPickOrderId(), vo.getPickTaskDId(), vo.getPickTaskId(), vo.getPickQty(), vo.getRedReason(), vo.getRedType());
        Object data = map.get("printData");
        if(data != null){
            ServletRequestAttributes reqa = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();
            new Thread(()-> {
                RequestContextHolder.setRequestAttributes(reqa, false);
                ServletRequestAttributes servletRequestAttributes =
                        (ServletRequestAttributes)RequestContextHolder.currentRequestAttributes();
                String userkey = servletRequestAttributes.getRequest().getHeader("UserKey");

                if (!HystrixRequestContext.isCurrentThreadInitialized()) {
                    HystrixRequestContext.initializeContext();
                }
                HystrixVarUtil.setUserKey(userkey);
                try {
                    List<PrintParam> printData = (List<PrintParam>) data;
                    RestMessage<?> restMessage = pickTaskAppService.print(printData);
                    //保存打印日志
                    List<PrintLog> printLogs = new ArrayList<>();
                    for (PrintParam printDatum : printData) {
                        PrintLog printLog = new PrintLog();
                        printLog.setPrintCode("faceOrder");
                        printLog.setBillno(map.get("billNo").toString());
                        printLog.setAttrStr3(printDatum.getParams().get("waybillCode").toString());
                        if(restMessage.isSuccess()){
                            printLog.setStatus("200");
                        }else {
                            printLog.setStatus("0");
                        }
                        printLogs.add(printLog);
                    }
                    printLogService.saveBatch(printLogs);
                }catch (Exception e) {
                    log.error("打印面单/标签失败：{}", e.getMessage());
                }finally {
                    RequestContextHolder.resetRequestAttributes();
                }
            }).start();
        }
        Object sendEis = map.get("sendEis");
        if(sendEis != null && "1".equals(sendEis.toString())){
            //调用作业完成确认回告
            List<OperationCompleteVO> operationCompleteVOS = pickTaskAppServiceImpl.pkgWorkCompeletToEisParams(vo.getPickOrderId(),(String)map.get("containerCode"));
            log.info("整件拣货作业确认推送EIS入参：{}", JSON.toJSONString(operationCompleteVOS));
            eisHandler.operationComplete(operationCompleteVOS);
        }
        return RestMessage.success("操作成功", map);
    }


    @UserLog
    @ApiOperation(value = "EIS扫码，四向库下架")
    @GetMapping("/containerOffShelf")
    public RestMessage<ContainerBindTaskDto> containerOffShelf(@RequestParam("containerNo") String containerNo){
        return RestMessage.success("操作成功", pickTaskAppService.containerOffShelf(containerNo));
    }

    @ApiOperation(value = "EIS回告->请求滑道号")
    @PostMapping("/getSlideway")
    public RestMessage<Map<String, String>> getSlideway(@RequestBody Map<String, String> param){
        return RestMessage.success("操作成功", pickTaskAppService.getSlideway(param.get("containerNo")));
    }

    @UserLog
    @ApiOperation(value = "RF整件拣货-索取")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "containerCode", value = "托盘号", required = true, dataType = "String"),
            @ApiImplicitParam(name = "warehouseId", value = "仓id", required = true, dataType = "String"),
            @ApiImplicitParam(name = "bldgId", value = "建筑物id", required = true, dataType = "String")
    })
    @GetMapping("/createPickOrder/whole")
    public RestMessage<Map<String, Object>> createWholePickOrder(String containerCode, String warehouseId, String bldgId){
        return RestMessage.success("操作成功", pickTaskAppService.createWholePickOrder(containerCode,warehouseId,bldgId));
    }


    @UserLog
    @ApiOperation(value = "RF整件拣货-获取用户未完成任务")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "warehouseId", value = "仓id", required = true, dataType = "String"),
            @ApiImplicitParam(name = "bldgId", value = "建筑物id", required = true, dataType = "String")
    })
    @GetMapping("/getUserUnCompleteOrder/whole")
    public RestMessage<Map<String, Object>> getUserUnCompleteOrder(String warehouseId, String bldgId){
        return RestMessage.success("操作成功", pickTaskAppService.getUserUnCompleteOrder(warehouseId,bldgId));
    }

    @UserLog
    @ApiOperation(value = "RF整件拣货-查询区域对应任务数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "warehouseId", value = "仓id", required = true, dataType = "String"),
            @ApiImplicitParam(name = "bldgId", value = "建筑物id", required = true, dataType = "String")
    })
    @GetMapping("/whole/queryAreaTaskList")
    public RestMessage<List<TaskCountVo>> queryWholeAreaTaskList(String bldgId, String warehouseId) {
        return RestMessage.success("操作成功", pickTaskAppService.queryWholeAreaTaskList(bldgId,warehouseId));
    }

    @UserLog
    @ApiOperation(value = "索取")
    @ApiImplicitParam(name = "params", required = true, value = "{\"pickTaskType\":\"拣货类型（0:整件 1:零货 2:功能库房 3:整单）\",\"warehouseId\":\"仓id\",\"bldgId\":\"建筑物id\"}")
    @PostMapping("/v2/ask-pickorder")
    public RestMessage<?> askPickorder2(@RequestBody Map<String,Object> params){
        return RestMessage.success("操作成功", pickTaskAppService.createByOperatorCode2(params));
    }

    @UserLog
    @ApiOperation(value = "获取推送EIS入参")
    @PostMapping("/pkgWorkCompeletToEisParams")
    public RestMessage<?> pkgWorkCompeletToEisParams(@RequestBody Map<String,Object> params){
        return RestMessage.success("操作成功", pickTaskAppServiceImpl.pkgWorkCompeletToEisParams(params.get("pickOrderId").toString(),params.get("containerNo").toString()));
    }

    @UserLog
    @ApiOperation(value = "零货获取面单")
    @PostMapping("/getLHFaceOrder")
    public RestMessage<?> getLHFaceOrder(@RequestBody Map<String,Object> params){
        return RestMessage.success("操作成功", pickTaskAppService.getLHFaceOrder(params));
    }

    @UserLog
    @ApiOperation(value = "功能库房-获取面单")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "billId", value = "订单号", required = true, dataType = "String"),
            @ApiImplicitParam(name = "barcodeNum", value = "面单/标签数量", required = true, dataType = "Integer")
    })
    @GetMapping("/gnkfGenerateBarcodes")
    public RestMessage gnkfGenerateBarcodes(String billId,Integer barcodeNum){
        Map<String, Object> map = pickTaskAppService.gnkfGenerateBarcodes(billId,barcodeNum);
        Object data = map.get("printData");
        if(data != null){
            ServletRequestAttributes reqa = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();
            new Thread(()-> {
                RequestContextHolder.setRequestAttributes(reqa, false);
                ServletRequestAttributes servletRequestAttributes =
                        (ServletRequestAttributes)RequestContextHolder.currentRequestAttributes();
                String userkey = servletRequestAttributes.getRequest().getHeader("UserKey");

                if (!HystrixRequestContext.isCurrentThreadInitialized()) {
                    HystrixRequestContext.initializeContext();
                }
                HystrixVarUtil.setUserKey(userkey);
                try {
                    List<PrintParam> printData = (List<PrintParam>) data;
                    RestMessage<?> restMessage = pickTaskAppService.print(printData);
                    //保存打印日志
                    printLogService.save(map.get("billNo").toString(),"faceOrder",restMessage.isSuccess());
                }catch (Exception e) {
                    log.error("打印面单/标签失败：{}", e.getMessage());
                }finally {
                    RequestContextHolder.resetRequestAttributes();
                }
            }).start();
        }
        return RestMessage.success("操作成功", null);
    }

    @UserLog
    @ApiOperation(value = "零货获取面单")
    @PostMapping("/test-getfaceorder")
    public RestMessage<?> getfaceorder(@RequestBody Map<String,Object> params){
        String pickTaskDId = (String) params.get("pickTaskDId");
        String pickTaskId = (String) params.get("pickTaskId");
        String waveBillDDId = (String) params.get("waveBillDDId");
        PickTaskH h = pickTaskHMapper.findById(pickTaskId, PickTaskH.class);
        WaveBillDDO waveBillDDO = waveBillDMapper.findById(waveBillDDId, WaveBillDDO.class);
        List<PrintParam> printData = pickTaskAppServiceImpl.getPrintData(h, pickTaskDId, new BigDecimal(10), CollUtil.toList(waveBillDDO));
        return RestMessage.success("操作成功", printData);
    }

    @UserLog
    @ApiOperation(value = "保存面单")
    @PostMapping("/saveFaceOrder")
    public RestMessage<?> saveFaceOrder(@RequestBody Map<String,Object> map){
        log.info("保存面单入参：{}",JSON.toJSONString(map));
        return RestMessage.success("操作成功", pickTaskAppService.saveFaceOrder(map));
    }
}
