package com.awspaas.user.apps.donenow_ctt.controller;

import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.server.bind.annotation.Controller;
import com.actionsoft.bpms.server.bind.annotation.Mapping;
import com.awspaas.user.apps.donenow_ctt.service.contractCommissionService;
import org.apache.commons.lang3.StringUtils;

/**
 * 合同拥挤，付款
 */
@Controller
public class contractCommissionController {

    /**
     * 生成合同佣金
     * @param uc
     * @param commissionIds
     * @return
     */
    @Mapping(value = "com.awspaas.user.apps.donenow_ctt.generateCommissions")
    public ResponseObject generateCommissions(UserContext uc, String commissionIds, String contractId) {

        if (StringUtils.isBlank(commissionIds) && StringUtils.isBlank(contractId))
            return ResponseObject.newErrResponse("请选择合同佣金");

        return contractCommissionService.getInstance().generateCommissions(uc, commissionIds, contractId);

    }


}
