package com.prolog.cs.biz.inbound.flow;

import com.prolog.function.annotation.Flow;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;


@Service
public class RcvAddWithRelatedFlow {

    @PostConstruct
    public void initFunctions() {

    }

    @Flow(name = "入库收货级联新增", category = "root/收货/级联新增", index = 1, description = "功能点:"
            + "\n1. 打印日志,校验头部数据"
            + "\n2. 保存头部数据以及拓展数据"
            + "\n3. 校验收货明细数据"
            + "\n4. 初始化收货明细数据"
            + "\n5. 保存收货明细数据以及相关拓展,并向下流转任务数据"
            + "\n6. 容器占用"
            + "\n7. 自动单据处理"
            + "\n8. 校验收货单是否超收"
            + "\n9. 校验整单拒收并回传")
    public void addWithRelated() {
        printLog();
        vaildateRcvData();
        addHead();
        vaildateRcvLines();
        initRcvlines();
        addDetails();
        pushNextTask();
        containerOccupy();
        autoProcess();
        vaildateRcvOverChange();
        allRejectCallBack();
        return;
    }

    @Flow(name = "打印日志", category = "root/收货/级联新增", index = 2, description = "")
    public void printLog() {
    }

    @Flow(name = "校验收货数据", category = "root/收货/级联新增", index = 2, description = "功能点:"
            + "\n1. 校验基础必填字段"
            + "\n2. 根据货主设置校验货主,供应商,客户,仓库的证照效期,经营范围等等"
            + "\n3. 根据货主设置校验当前货主是否有当前单据业务类型处理的权限,比如代管,待检"
            + "\n4. 校验此入库订单的时效性"
            + "\n4. 校验此次收货明细中是否含有双人收货的商品(pass 移入到明细校验中)")
    public void vaildateRcvData() {
    }

    @Flow(name = "新增头表及其相关拓展", category = "root/收货/级联新增", index = 3, description = "新增前构建基础默认字段")
    public void addHead() {
    }

    @Flow(name = "校验收货明细数据", category = "root/收货/级联新增", index = 4, description = "功能点:"
            + "\n0. 校验明细基础必填字段"
            + "\n1. 不同单据类型的额外校验处理"
            + "\n2. 根据货主设置校验是否可拆中包装"
            + "\n3. 根据货主设置校验是否需要双人收货"
            + "\n4. 根据货主设置校验是否校验经营范围(货主,仓库)"
            + "\n5. 根据货主设置或业务参数设置校验收货所选容器"
            + "\n6. 根据货主设置校验商品证照,商品体积,商品大类,商品停售召回,批号效期"
            + "\n7. 受托生产企业必填校验"
            + "\n8. 校验行数据相对于原ans明细是否超收"
            + "\n9. 散件必须绑容器")
    public void vaildateRcvLines() {
    }

    @Flow(name = "初始化收货明细数据", category = "root/收货/级联新增", index = 5, description = "功能点:"
            + "\n1. 初始化批次信息数据"
            + "\n2. 处理收货行批次数据(生成,不变,更新)"
            + "\n3. 商品批号过了效期的处理")
    public void initRcvlines() {
    }

    @Flow(name = "新增收货明细", category = "root/收货/级联新增", index = 6, description = "功能点:"
            + "\n1. 加入系统级字段"
            + "\n2. 持久化数据库(sql控制并发超收)"
            + "\n3. 保存收货明细相关拓展"
            + "\n4. 保存收货明细相关图片数据")
    public void addDetails() {
    }

    @Flow(name = "往下推送收货明细数据生成对应任务", category = "root/收货/级联新增", index = 7, description = "功能点:"
            + "\n1. 根据单据类型,以及业务参数以及收货结论选择性是生成验收,上架,复检,拒收的任务"
            + "\n2. 若是待处理的生成复检任务,根据业务参数是否进行代管的处理")
    public void pushNextTask() {
    }

    @Flow(name = "容器占用", category = "root/收货/级联新增", index = 8, description = "")
    public void containerOccupy() {
    }

    @Flow(name = "自动单据的处理", category = "root/收货/级联新增", index = 8, description = "")
    public void autoProcess() {
    }

    @Flow(name = "校验收货单是否超收", category = "root/收货/级联新增", index = 9, description = "")
    public void vaildateRcvOverChange() {
    }

    @Flow(name = "整单拒收回传", category = "root/收货/级联新增", index = 9, description = "")
    public void allRejectCallBack() {
    }
}