package com.ssm.manage.service.impl;

import com.github.pagehelper.PageInfo;
import com.ssm.core.service.impl.BaseServiceImpl;
import com.ssm.core.utils.BigDecimalUtils;
import com.ssm.core.utils.SnowflakeUtil;
import com.ssm.core.utils.StoreParaUtils;
import com.ssm.manage.dao.SsmRefundCashDao;
import com.ssm.manage.entity.*;
import com.ssm.manage.extendEntity.AchiCommEntity;
import com.ssm.manage.mapper.RefundCashMapper;
import com.ssm.manage.query.*;
import com.ssm.manage.response.CashListResponse;
import com.ssm.manage.response.RefundCashResponse;
import com.ssm.manage.response.ResponseCode;
import com.ssm.manage.service.*;
import com.ssm.manage.utils.Constant;
import com.ssm.manage.utils.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import tk.mybatis.mapper.entity.Example;

import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;

@Service
@Slf4j
public class SsmRefundCashServiceImpl extends BaseServiceImpl<RefundCash> implements SsmRefundCashService {
    @Autowired
    private SsmCashService ssmCashService;

    @Autowired
    private SsmRefundOrderService ssmRefundOrderService;
    @Autowired
    private SsmAccountTradeRecordService ssmAccountTradeRecordService;

    @Autowired
    private SsmUploadFilesService ssmUploadFilesService;

    @Autowired
    private SsmMemberCsService ssmMemberCsService;

    @Autowired
    private SsmProjectService ssmProjectService;

    @Autowired
    private SsmSalesmanService ssmSalesmanService;

    @Autowired
    private SsmRefundCashDao dao;

    @Override
    public SsmRefundCashDao getDao() {
        return dao;
    }

    @Override
    public List<RefundCashResponse> selectList(RefundCashReqest refundCashReqest) {
        RefundCash refundCash = new RefundCash();
        BeanUtils.copyProperties(refundCashReqest, refundCash);
        List<RefundCash> list = dao.select(refundCash);
        RefundOrderList refundOrderList = new RefundOrderList();
        refundOrderList.setRefundNum(refundCash.getRefundNum());
        refundOrderList = ssmRefundOrderService.selectOne(refundOrderList);
        String sourceDocNum = refundOrderList.getSourceDocNum();
        String substring = sourceDocNum.substring(sourceDocNum.length() - 11, sourceDocNum.length() - 3);
        StringBuilder stringBuilder = new StringBuilder(substring);
        StringBuilder insert = stringBuilder.insert(6, "-").insert(4, "-");
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        CashListRequest cashListRequest = new CashListRequest();
        List<CashList> cashLists = null;
        try {
            Date parse = simpleDateFormat.parse(insert.toString());
            cashListRequest.setCashDate(parse);
            cashListRequest.setCashNum(sourceDocNum);
            cashListRequest.setIsCancel(0);
            cashListRequest.setStoreId(list.get(0).getStoreId());
            cashLists = ssmCashService.selectList(cashListRequest);

        } catch (ParseException e) {
            throw new RuntimeException(e);
        } catch (SmsException e) {
            throw new RuntimeException(e);
        }
        List<RefundCashResponse> cashResponses = new ArrayList<>();
        for (RefundCash cash : list) {
            RefundCashResponse refundCashResponse = new RefundCashResponse();
            BeanUtils.copyProperties(cash, refundCashResponse);
            //设置业务员
            refundCashResponse = this.getStaffList(cash, refundCashResponse);
            //设置文件
            UploadFilesRequest uploadFilesRequest = new UploadFilesRequest();
            uploadFilesRequest.setDocId(refundCashReqest.getRefundOrderId());
            uploadFilesRequest.setDocNum(cash.getRefundNum());
            uploadFilesRequest.setDocType(Constant.doc_type_refund_cash);
            List<UploadFiles> filesList = ssmUploadFilesService.selectList(uploadFilesRequest);
            refundCashResponse.setFileLists(filesList);
            refundCashResponse.setType(1);
            refundCashResponse.setCashListList(cashLists);
//            refundCashResponse.setCashListList(cashLists);
            cashResponses.add(refundCashResponse);
        }
        List<Long> cashIds = new ArrayList<>();

        if(cashLists!=null && cashLists.size()>0){
            List<Long> collect = cashLists.stream().map(CashList::getId).collect(Collectors.toList());
            List<Long> refundIds = cashResponses.stream().map(RefundCashResponse::getCashId).collect(Collectors.toList());
            cashIds = collect.stream().filter(item->!refundIds.contains(item)).collect(Collectors.toList());
            }
        if(cashIds!=null && cashLists!=null && cashIds.size()>0  && cashLists.size()>0){
            for (Long cashId : cashIds) {
                for (CashList cashList : cashLists) {
                    if(cashList.getId().equals(cashId)){
                        RefundCashResponse refundCashResponse = new RefundCashResponse();
                        BeanUtils.copyProperties(cashList, refundCashResponse);
                        refundCashResponse.setId(null);
                        refundCashResponse.setRefundNum(list.get(0).getRefundNum());
                        refundCashResponse.setRefundDate(list.get(0).getRefundDate());
                        refundCashResponse.setCashRefundMoney(cashList.getTransactionPrice().multiply(BigDecimal.valueOf(cashList.getNumberTimes())));
                        refundCashResponse.setCashCompensation(BigDecimal.valueOf(0));
                        //设置业务员
                        refundCashResponse.setCashId(cashId);
                        refundCashResponse.setCashDate(list.get(0).getCashDate());
                        refundCashResponse = this.getStaffList(cashList, refundCashResponse);
                        //设置文件
                        UploadFilesRequest uploadFilesRequest = new UploadFilesRequest();
                        uploadFilesRequest.setDocId(refundCashReqest.getRefundOrderId());
                        uploadFilesRequest.setDocNum(list.get(0).getRefundNum());
                        uploadFilesRequest.setDocType(Constant.doc_type_refund_cash);
                        List<UploadFiles> filesList = ssmUploadFilesService.selectList(uploadFilesRequest);
                        refundCashResponse.setFileLists(filesList);
                        refundCashResponse.setType(0);
                        cashResponses.add(refundCashResponse);
                    }
                }
            }
        }


        return cashResponses;
    }

    public RefundCashResponse getStaffList(RefundCash cashList, RefundCashResponse refundCashResponse){
        List<StaffRequest> largeList = new ArrayList<>();
        if (null != cashList.getServiceLargeOneStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getLargeOneNumber());
            staffRequest.setId(cashList.getServiceLargeOneStaffId());
            staffRequest.setStaffName(cashList.getServiceLargeOneStaffName());
            staffRequest.setIdentityCard(cashList.getServiceLargeOneIdentityCard());
            staffRequest.setRatio(cashList.getServiceLargeOneRatio());
            largeList.add(staffRequest);
        }
        if (null != cashList.getServiceLargeTwoStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getLargeTwoNumber());
            staffRequest.setId(cashList.getServiceLargeTwoStaffId());
            staffRequest.setStaffName(cashList.getServiceLargeTwoStaffName());
            staffRequest.setIdentityCard(cashList.getServiceLargeTwoIdentityCard());
            staffRequest.setRatio(cashList.getServiceLargeTwoRatio());
            largeList.add(staffRequest);
        }
        if (null != cashList.getServiceLargeThreeStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getLargeThreeNumber());
            staffRequest.setId(cashList.getServiceLargeThreeStaffId());
            staffRequest.setStaffName(cashList.getServiceLargeThreeStaffName());
            staffRequest.setIdentityCard(cashList.getServiceLargeThreeIdentityCard());
            staffRequest.setRatio(cashList.getServiceLargeThreeRatio());
            largeList.add(staffRequest);
        }
        List<StaffRequest> zhonggongList = new ArrayList<>();
        if (null != cashList.getServiceZhonggongOneStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getZhonggongOneNumber());
            staffRequest.setId(cashList.getServiceZhonggongOneStaffId());
            staffRequest.setStaffName(cashList.getServiceZhonggongOneStaffName());
            staffRequest.setIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
            staffRequest.setRatio(cashList.getServiceZhonggongOneRatio());
            zhonggongList.add(staffRequest);
        }
        if (null != cashList.getServiceZhonggongTwoStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getZhonggongTwoNumber());
            staffRequest.setId(cashList.getServiceZhonggongTwoStaffId());
            staffRequest.setStaffName(cashList.getServiceZhonggongTwoStaffName());
            staffRequest.setIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
            staffRequest.setRatio(cashList.getServiceZhonggongTwoRatio());
            zhonggongList.add(staffRequest);
        }
        if (null != cashList.getServiceZhonggongThreeStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getZhonggongThreeNumber());
            staffRequest.setId(cashList.getServiceZhonggongThreeStaffId());
            staffRequest.setStaffName(cashList.getServiceZhonggongThreeStaffName());
            staffRequest.setIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
            staffRequest.setRatio(cashList.getServiceZhonggongThreeRatio());
            zhonggongList.add(staffRequest);
        }
        List<StaffRequest> technicianList = new ArrayList<>();
        if (null != cashList.getServiceTechnicianOneStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getTechnicianOneNumber());
            staffRequest.setId(cashList.getServiceTechnicianOneStaffId());
            staffRequest.setStaffName(cashList.getServiceTechnicianOneStaffName());
            staffRequest.setIdentityCard(cashList.getServiceTechnicianOneIdentityCard());
            staffRequest.setRatio(cashList.getServiceTechnicianOneRatio());
            technicianList.add(staffRequest);
        }
        if (null != cashList.getServiceTechnicianTwoStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getTechnicianTwoNumber());
            staffRequest.setId(cashList.getServiceTechnicianTwoStaffId());
            staffRequest.setStaffName(cashList.getServiceTechnicianTwoStaffName());
            staffRequest.setIdentityCard(cashList.getServiceTechnicianTwoIdentityCard());
            staffRequest.setRatio(cashList.getServiceTechnicianTwoRatio());
            technicianList.add(staffRequest);
        }
        if (null != cashList.getServiceTechnicianThreeStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getTechnicianThreeNumber());
            staffRequest.setId(cashList.getServiceTechnicianThreeStaffId());
            staffRequest.setStaffName(cashList.getServiceTechnicianThreeStaffName());
            staffRequest.setIdentityCard(cashList.getServiceTechnicianThreeIdentityCard());
            staffRequest.setRatio(cashList.getServiceTechnicianThreeRatio());
            technicianList.add(staffRequest);
        }
        List<StaffRequest> smallList = new ArrayList<>();
        if (null != cashList.getServiceSmallOneStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getSmallOneNumber());
            staffRequest.setId(cashList.getServiceSmallOneStaffId());
            staffRequest.setStaffName(cashList.getServiceSmallOneStaffName());
            staffRequest.setIdentityCard(cashList.getServiceSmallOneIdentityCard());
            staffRequest.setRatio(cashList.getServiceSmallOneRatio());
            smallList.add(staffRequest);
        }
        if (null != cashList.getServiceSmallTwoStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getSmallTwoNumber());
            staffRequest.setId(cashList.getServiceSmallTwoStaffId());
            staffRequest.setStaffName(cashList.getServiceSmallTwoStaffName());
            staffRequest.setIdentityCard(cashList.getServiceSmallTwoIdentityCard());
            staffRequest.setRatio(cashList.getServiceSmallTwoRatio());
            smallList.add(staffRequest);
        }
        if (null != cashList.getServiceSmallThreeStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getSmallThreeNumber());
            staffRequest.setId(cashList.getServiceSmallThreeStaffId());
            staffRequest.setStaffName(cashList.getServiceSmallThreeStaffName());
            staffRequest.setIdentityCard(cashList.getServiceSmallThreeIdentityCard());
            staffRequest.setRatio(cashList.getServiceSmallThreeRatio());
            smallList.add(staffRequest);
        }
        refundCashResponse.setLargeList(largeList);
        refundCashResponse.setZhonggongList(zhonggongList);
        refundCashResponse.setTechnicianList(technicianList);
        refundCashResponse.setSmallList(smallList);
        return refundCashResponse;
    }

    public RefundCashResponse getStaffList(CashList cashList, RefundCashResponse refundCashResponse){
        List<StaffRequest> largeList = new ArrayList<>();
        if (null != cashList.getServiceLargeOneStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getLargeOneNumber());
            staffRequest.setId(cashList.getServiceLargeOneStaffId());
            staffRequest.setStaffName(cashList.getServiceLargeOneStaffName());
            staffRequest.setIdentityCard(cashList.getServiceLargeOneIdentityCard());
            staffRequest.setRatio(cashList.getServiceLargeOneRatio());
            largeList.add(staffRequest);
        }
        if (null != cashList.getServiceLargeTwoStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getLargeTwoNumber());
            staffRequest.setId(cashList.getServiceLargeTwoStaffId());
            staffRequest.setStaffName(cashList.getServiceLargeTwoStaffName());
            staffRequest.setIdentityCard(cashList.getServiceLargeTwoIdentityCard());
            staffRequest.setRatio(cashList.getServiceLargeTwoRatio());
            largeList.add(staffRequest);
        }
        if (null != cashList.getServiceLargeThreeStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getLargeThreeNumber());
            staffRequest.setId(cashList.getServiceLargeThreeStaffId());
            staffRequest.setStaffName(cashList.getServiceLargeThreeStaffName());
            staffRequest.setIdentityCard(cashList.getServiceLargeThreeIdentityCard());
            staffRequest.setRatio(cashList.getServiceLargeThreeRatio());
            largeList.add(staffRequest);
        }
        List<StaffRequest> zhonggongList = new ArrayList<>();
        if (null != cashList.getServiceZhonggongOneStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getZhonggongOneNumber());
            staffRequest.setId(cashList.getServiceZhonggongOneStaffId());
            staffRequest.setStaffName(cashList.getServiceZhonggongOneStaffName());
            staffRequest.setIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
            staffRequest.setRatio(cashList.getServiceZhonggongOneRatio());
            zhonggongList.add(staffRequest);
        }
        if (null != cashList.getServiceZhonggongTwoStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getZhonggongTwoNumber());
            staffRequest.setId(cashList.getServiceZhonggongTwoStaffId());
            staffRequest.setStaffName(cashList.getServiceZhonggongTwoStaffName());
            staffRequest.setIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
            staffRequest.setRatio(cashList.getServiceZhonggongTwoRatio());
            zhonggongList.add(staffRequest);
        }
        if (null != cashList.getServiceZhonggongThreeStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getZhonggongThreeNumber());
            staffRequest.setId(cashList.getServiceZhonggongThreeStaffId());
            staffRequest.setStaffName(cashList.getServiceZhonggongThreeStaffName());
            staffRequest.setIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
            staffRequest.setRatio(cashList.getServiceZhonggongThreeRatio());
            zhonggongList.add(staffRequest);
        }
        List<StaffRequest> technicianList = new ArrayList<>();
        if (null != cashList.getServiceTechnicianOneStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getTechnicianOneNumber());
            staffRequest.setId(cashList.getServiceTechnicianOneStaffId());
            staffRequest.setStaffName(cashList.getServiceTechnicianOneStaffName());
            staffRequest.setIdentityCard(cashList.getServiceTechnicianOneIdentityCard());
            staffRequest.setRatio(cashList.getServiceTechnicianOneRatio());
            technicianList.add(staffRequest);
        }
        if (null != cashList.getServiceTechnicianTwoStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getTechnicianTwoNumber());
            staffRequest.setId(cashList.getServiceTechnicianTwoStaffId());
            staffRequest.setStaffName(cashList.getServiceTechnicianTwoStaffName());
            staffRequest.setIdentityCard(cashList.getServiceTechnicianTwoIdentityCard());
            staffRequest.setRatio(cashList.getServiceTechnicianTwoRatio());
            technicianList.add(staffRequest);
        }
        if (null != cashList.getServiceTechnicianThreeStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getTechnicianThreeNumber());
            staffRequest.setId(cashList.getServiceTechnicianThreeStaffId());
            staffRequest.setStaffName(cashList.getServiceTechnicianThreeStaffName());
            staffRequest.setIdentityCard(cashList.getServiceTechnicianThreeIdentityCard());
            staffRequest.setRatio(cashList.getServiceTechnicianThreeRatio());
            technicianList.add(staffRequest);
        }
        List<StaffRequest> smallList = new ArrayList<>();
        if (null != cashList.getServiceSmallOneStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getSmallOneNumber());
            staffRequest.setId(cashList.getServiceSmallOneStaffId());
            staffRequest.setStaffName(cashList.getServiceSmallOneStaffName());
            staffRequest.setIdentityCard(cashList.getServiceSmallOneIdentityCard());
            staffRequest.setRatio(cashList.getServiceSmallOneRatio());
            smallList.add(staffRequest);
        }
        if (null != cashList.getServiceSmallTwoStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getSmallTwoNumber());
            staffRequest.setId(cashList.getServiceSmallTwoStaffId());
            staffRequest.setStaffName(cashList.getServiceSmallTwoStaffName());
            staffRequest.setIdentityCard(cashList.getServiceSmallTwoIdentityCard());
            staffRequest.setRatio(cashList.getServiceSmallTwoRatio());
            smallList.add(staffRequest);
        }
        if (null != cashList.getServiceSmallThreeStaffId()){
            StaffRequest staffRequest = new StaffRequest();
            staffRequest.setBrandNumber(cashList.getSmallThreeNumber());
            staffRequest.setId(cashList.getServiceSmallThreeStaffId());
            staffRequest.setStaffName(cashList.getServiceSmallThreeStaffName());
            staffRequest.setIdentityCard(cashList.getServiceSmallThreeIdentityCard());
            staffRequest.setRatio(cashList.getServiceSmallThreeRatio());
            smallList.add(staffRequest);
        }
        refundCashResponse.setLargeList(largeList);
        refundCashResponse.setZhonggongList(zhonggongList);
        refundCashResponse.setTechnicianList(technicianList);
        refundCashResponse.setSmallList(smallList);
        return refundCashResponse;
    }

    @Override
    public int addRefundCash(List<RefundCashReqest> list, RefundOrderList refundOrderList) throws SmsException {
        int i = 0;
        for (RefundCashReqest refundCashReqest : list) {
            //校验收银退款与收银单支付金额大小
            if (BigDecimalUtils.compareTo(refundCashReqest.getCashRefundMoney(),refundCashReqest.getTransactionPrice()) == 1){
                throw new SmsException(ResponseCode.PRICE_COMPARE_MORE_THAN,"退款金额比成交金额");
            }
            RefundCash refundCash = new RefundCash();
            //参数赋值
            BeanUtils.copyProperties(refundCashReqest, refundCash);
            refundCash.setRefundNum(refundOrderList.getRefundNum());
            refundCash.setRefundDate(refundOrderList.getRefundDate());
            refundCash.setId(new SnowflakeUtil(new Random().nextInt(1023)).nextId());
            //设置业务人员
            this.setStaffValue(refundCashReqest.getLargeList(), refundCashReqest.getZhonggongList(), refundCashReqest.getTechnicianList(), refundCashReqest.getSmallList(), refundCash);
            //计算业绩
            this.setAchiComm(refundCash, refundCashReqest);

            try {
                i = dao.saveNotNull(refundCash);
                Salesman salesman = new Salesman();
                salesman.setOrderId(String.valueOf(refundCashReqest.getCashId()));
                salesman.setOrderType(0);
                List<Salesman> salesmens = ssmSalesmanService.selectList(salesman);
                for (Salesman salesmen : salesmens) {
                    Random r = new Random(3);
                    int i1 = r.nextInt();
                    salesmen.setId(salesmen.getId()+i1);
                    salesmen.setOrderId(String.valueOf(refundCash.getCashId()));
                    salesmen.setOrderNum(refundCash.getRefundNum());
                    salesmen.setOrderType(6);
                    salesmen.setState(1);
                    salesmen.setOrderDate(new Date());
                    salesmen.setMoney(BigDecimalUtils.subtract(BigDecimal.valueOf(0.00),refundCashReqest.getCashRefundMoney()));
                }
                ssmSalesmanService.addBatch(salesmens);
            } catch (Exception e) {
                log.error("SsmRefundCashServiceImpl.addRefundCash:", e);
                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                throw new SmsException(ResponseCode.UNKNOWN_SYSTEM_EXCEPTION);
            }
        }
        return i;
    }

    @Override
    public int addRefundCashSalem(List<RefundCashReqest> list, RefundOrderList refundOrderList, BaseStore baseStore1) throws SmsException {
        int i = 0;
        for (RefundCashReqest refundCashReqest : list) {
            //校验收银退款与收银单支付金额大小
            if (BigDecimalUtils.compareTo(refundCashReqest.getCashRefundMoney(),refundCashReqest.getTransactionPrice()) == 1){
                throw new SmsException(ResponseCode.PRICE_COMPARE_MORE_THAN,"退款金额比成交金额");
            }
            RefundCash refundCash = new RefundCash();
            //参数赋值
            BeanUtils.copyProperties(refundCashReqest, refundCash);
            refundCash.setRefundNum(refundOrderList.getRefundNum());
            refundCash.setRefundDate(refundOrderList.getRefundDate());
            refundCash.setId(new SnowflakeUtil(new Random().nextInt(1023)).nextId());
            refundCash.setStoreId(refundOrderList.getStoreId());

            List<StaffRequest> largeList = refundCashReqest.getLargeList();
            List<StaffRequest> zhonggongList = refundCashReqest.getZhonggongList();
            List<StaffRequest> technicianList = refundCashReqest.getTechnicianList();
            List<StaffRequest> smallList = refundCashReqest.getSmallList();
            BigDecimal reduce = largeList.stream().map(aa -> aa.getRatio()).reduce(BigDecimal.ZERO, BigDecimal::add);
            if(null != reduce && reduce.compareTo(BigDecimal.valueOf(100))!=0 && reduce.compareTo(BigDecimal.valueOf(0))!=0){
                throw new SmsException(ResponseCode.MSG,"美容师业绩占比和不等于100");
            }
            BigDecimal reduce1 = zhonggongList.stream().map(aa -> aa.getRatio()).reduce(BigDecimal.ZERO, BigDecimal::add);
            if(null != reduce1 && reduce1.compareTo(BigDecimal.valueOf(100))!=0 && reduce1.compareTo(BigDecimal.valueOf(0))!=0){
                throw new SmsException(ResponseCode.MSG,"美发师业绩占比和不等于100");
            }
            BigDecimal reduce2 = technicianList.stream().map(aa -> aa.getRatio()).reduce(BigDecimal.ZERO, BigDecimal::add);
            if(null != reduce2 && reduce2.compareTo(BigDecimal.valueOf(100))!=0 && reduce2.compareTo(BigDecimal.valueOf(0))!=0){
                throw new SmsException(ResponseCode.MSG,"技师业绩占比和不等于100");
            }
            BigDecimal reduce3 = smallList.stream().map(aa -> aa.getRatio()).reduce(BigDecimal.ZERO, BigDecimal::add);
            if(null != reduce3 && reduce3.compareTo(BigDecimal.valueOf(100))!=0 && reduce3.compareTo(BigDecimal.valueOf(0))!=0){
                throw new SmsException(ResponseCode.MSG,"助理业绩占比和不等于100");
            }

            //设置业务人员
            this.setStaffValue(largeList, zhonggongList, technicianList, smallList, refundCash);
            //计算业绩
            this.setAchiComm(refundCash, refundCashReqest);



            try {
                i = dao.saveNotNull(refundCash);
                List<Salesman> salesmens = refundCashReqest.getSalesmens();
                BigDecimal reduce5 = salesmens.stream().filter(salesman1 -> salesman1.getStaffType()==0).map(aa -> aa.getRatio()).reduce(BigDecimal.ZERO, BigDecimal::add);
                BigDecimal reduce6 = salesmens.stream().filter(salesman1 -> salesman1.getStaffType()==1).map(aa -> aa.getRatio()).reduce(BigDecimal.ZERO, BigDecimal::add);
                if(null != reduce5 && reduce5.compareTo(BigDecimal.valueOf(100))!=0 && reduce5.compareTo(BigDecimal.valueOf(0))!=0){
                    throw new SmsException(ResponseCode.MSG,"高管业绩占比和不等于100");
                }
                if(null != reduce6 && reduce6.compareTo(BigDecimal.valueOf(100))!=0 && reduce6.compareTo(BigDecimal.valueOf(0))!=0){
                    throw new SmsException(ResponseCode.MSG,"管理员业绩占比和不等于100");
                }
                for (Salesman salesmen : salesmens) {
                    Random r = new Random(3);
                    int i1 = r.nextInt();
                    salesmen.setId(salesmen.getId()+i1);
                    salesmen.setOrderId(String.valueOf(refundCash.getId()));
                    salesmen.setOrderNum(refundCash.getRefundNum());
                    salesmen.setOrderType(6);
                    salesmen.setState(1);
                    salesmen.setOrderDate(new Date());
                    salesmen.setOperatorBy(refundOrderList.getInputBy());
                    salesmen.setMoney(BigDecimalUtils.subtract(BigDecimal.valueOf(0.00),refundCashReqest.getCashRefundMoney()));
                    salesmen.setStoreNum(baseStore1.getStoreNum());
                    salesmen.setStoreName(baseStore1.getStoreName());
                    salesmen.setStoreIdOrder(baseStore1.getId());
                }
                ssmSalesmanService.addBatch(salesmens);
            } catch (Exception e) {
                log.error("SsmRefundCashServiceImpl.addRefundCash:", e);
                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                throw new SmsException(ResponseCode.UNKNOWN_SYSTEM_EXCEPTION);
            }
        }
        return i;
    }


    @Override
    @Transactional
    public int updateRefundCash(List<RefundCashReqest> list, RefundOrderList refundOrderList) throws SmsException {
        int i = 0;
        //先将原消费退明细记录进行删除
        RefundCash cash = new RefundCash();
        cash.setRefundNum(refundOrderList.getRefundNum());
        int j = dao.delete(cash);
        if (j > 0) {
            for (RefundCashReqest refundCashReqest : list) {
                //校验收银退款与收银单支付金额大小
                if (BigDecimalUtils.compareTo(refundCashReqest.getCashRefundMoney(), refundCashReqest.getTransactionPrice()) == 1) {
                    throw new SmsException(ResponseCode.PRICE_COMPARE_MORE_THAN, "退款金额比成交金额");
                }
                RefundCash refundCash = new RefundCash();
                //参数赋值
                BeanUtils.copyProperties(refundCashReqest, refundCash);
                refundCash.setId(new SnowflakeUtil(new Random().nextInt(1023)).nextId());
                refundCash.setRefundNum(refundOrderList.getRefundNum());
                refundCash.setRefundDate(refundOrderList.getRefundDate());
                if (null == refundCash.getId()) {
                    refundCash.setId(new SnowflakeUtil(new Random().nextInt(1023)).nextId());
                }

                List<StaffRequest> largeList = refundCashReqest.getLargeList();
                BigDecimal reduce = largeList.stream().map(aa -> aa.getRatio()).reduce(BigDecimal.ZERO, BigDecimal::add);
                if(null != reduce && reduce.compareTo(BigDecimal.valueOf(100))!=0 && reduce.compareTo(BigDecimal.valueOf(0))!=0){
                    throw new SmsException(ResponseCode.MSG,"美容师业绩占比和不等于100");
                }
                List<StaffRequest> zhonggongList = refundCashReqest.getZhonggongList();
                BigDecimal reduce1 = zhonggongList.stream().map(aa -> aa.getRatio()).reduce(BigDecimal.ZERO, BigDecimal::add);
                if(null != reduce1 && reduce1.compareTo(BigDecimal.valueOf(100))!=0 && reduce1.compareTo(BigDecimal.valueOf(0))!=0){
                    throw new SmsException(ResponseCode.MSG,"美发师业绩占比和不等于100");
                }
                List<StaffRequest> technicianList = refundCashReqest.getTechnicianList();
                BigDecimal reduce2 = technicianList.stream().map(aa -> aa.getRatio()).reduce(BigDecimal.ZERO, BigDecimal::add);
                if(null != reduce2 && reduce2.compareTo(BigDecimal.valueOf(100))!=0 && reduce2.compareTo(BigDecimal.valueOf(0))!=0){
                    throw new SmsException(ResponseCode.MSG,"技师业绩占比和不等于100");
                }
                List<StaffRequest> smallList = refundCashReqest.getSmallList();
                BigDecimal reduce3 = smallList.stream().map(aa -> aa.getRatio()).reduce(BigDecimal.ZERO, BigDecimal::add);
                if(null != reduce3 && reduce3.compareTo(BigDecimal.valueOf(100))!=0 && reduce3.compareTo(BigDecimal.valueOf(0))!=0){
                    throw new SmsException(ResponseCode.MSG,"助理业绩占比和不等于100");
                }
                //设置业务人员
                this.setStaffValue(refundCashReqest.getLargeList(), refundCashReqest.getZhonggongList(), refundCashReqest.getTechnicianList(), refundCashReqest.getSmallList(), refundCash);
                //计算业绩
                this.setAchiComm(refundCash, refundCashReqest);

                try {
                    i = dao.saveNotNull(refundCash);

                } catch (Exception e) {
                    log.error("SsmRefundCashServiceImpl.updateRefundCash:", e);
                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                    throw new SmsException(ResponseCode.UNKNOWN_SYSTEM_EXCEPTION);
                }
            }
        }else {
            log.error("SsmRefundCashServiceImpl.updateRefundCash:","原消费退明细记录删除失败");
            throw new SmsException(ResponseCode.UNKNOWN_SYSTEM_EXCEPTION);
        }
        return i;
    }
    public AccountTradeRecord setAccountTradeRecord(RefundOrderList refundOrderList){
        AccountTradeRecord accountTradeRecord = new AccountTradeRecord();
        accountTradeRecord.setId(new SnowflakeUtil(new Random().nextInt(1023)).nextId());
        accountTradeRecord.setStoreId(refundOrderList.getStoreId());
        accountTradeRecord.setStoreName(refundOrderList.getStoreName());
        accountTradeRecord.setMemberId(refundOrderList.getMemberId());
        accountTradeRecord.setMemberName(refundOrderList.getMemberName());
        accountTradeRecord.setMemberIdentity(refundOrderList.getMemberIdentityCard());
        accountTradeRecord.setMemberPhone(refundOrderList.getMobilePhone());
//        accountTradeRecord.setAccountId(refundOrderList.getRefundAccount());
        accountTradeRecord.setAccountName(refundOrderList.getMemberName());
        if (refundOrderList.getState() == 3){//审核
            //金额记录为退款金额
            accountTradeRecord.setAccountSpendMoney(refundOrderList.getRecRefundMoney());
//            //赠送卡花费金额保持为原账户赠送金额
//            accountTradeRecord.setAccountGiftSpendMoney(refundRecharge.getCardGiftMoney());
            accountTradeRecord.setAccountType(Constant.account_type_refund_recharge_audit);
            accountTradeRecord.setInputDate(refundOrderList.getAuditDate());
            accountTradeRecord.setOrderStatu(0);
            accountTradeRecord.setInputBy(refundOrderList.getAuditBy());
        }else if (refundOrderList.getState() == 4){//反审核
            //金额记录为退款金额
            accountTradeRecord.setAccountInMoney(refundOrderList.getRecRefundMoney());
//            //赠送卡花费金额
//            accountTradeRecord.setAccountGiftSpendMoney(refundRecharge.getCardGiftMoney());
            accountTradeRecord.setAccountType(Constant.account_type_refund_recharge_unaudit);
            accountTradeRecord.setInputDate(new Date());
            accountTradeRecord.setOrderStatu(2);
            accountTradeRecord.setInputBy(refundOrderList.getAuditBy());
        }
        accountTradeRecord.setDocId(refundOrderList.getId());
        accountTradeRecord.setDocNum(refundOrderList.getRefundNum());
        accountTradeRecord.setDocType(Constant.doc_type_refund_recharge);
//        accountTradeRecord.setTradeId(refundRecharge.getRechargeTypeId());
        accountTradeRecord.setTradeName("消费退款");
        accountTradeRecord.setTradeMoney(refundOrderList.getRecRefundMoney());
//        accountTradeRecord.setAccountRestMoney(rechargeAccount.getCardRestMoney());
//        accountTradeRecord.setAccountConsumeMoney(rechargeAccount.getCardConsumeMoney());
//        accountTradeRecord.setAccountGiftRestMoney(rechargeAccount.getCardGiftMoney());
//        accountTradeRecord.setAccountGiftConsumeMoney(rechargeAccount.getGiftConsumeMoney());
//        accountTradeRecord.setPrice(refundRecharge.getRecRefundMoney());
//        accountTradeRecord.setCardMoney(refundOrderList.getRefundMoney());
//        accountTradeRecord.setCashMoney(BigDecimal.valueOf(0));
        return accountTradeRecord;
    }



    @Override
    @Transactional
    public int audit(RefundOrderList refundOrderList) throws SmsException {
        int i = 0;
        //查询消费退单据
        RefundCash cash = new RefundCash();
        cash.setStoreId(refundOrderList.getStoreId());
        cash.setRefundNum(refundOrderList.getRefundNum());
        List<RefundCash> refundCashList = dao.select(cash);
        //查询消费退可以退的消费单最长天数
        StoreParament storeParament = StoreParaUtils.getStorePara(refundOrderList.getStoreId(), Constant.refund_day);
        if (!"0".equals(storeParament.getParamentValue())) {

            for (RefundCash refundCash : refundCashList) {
                int days = (int) DateUtils.getDayDiff(refundCash.getCashDate(), new Date());
                if (Integer.parseInt(storeParament.getParamentValue()) < days){
                    throw new SmsException(ResponseCode.REFUND_NOT_PERMISSION,"超过允许退款的最长天数");
                }
                //消费退款单对应收银单作废
                i = ssmCashService.cancelRowOnly(refundCash, refundOrderList);
                //插入账户交易记录
//                AccountTradeRecord accountTradeRecord = this.setAccountTradeRecord(refundOrderList);
//                i = ssmAccountTradeRecordService.addRecord(accountTradeRecord);
                //设置业务员
                List<AchiCommEntity> entities = this.getAchiCommList(refundCash);
                //将收银退款单据信息添加到评价表
                MemberCsRequest memberCsRequest = new MemberCsRequest();
                BeanUtils.copyProperties(refundCash, memberCsRequest);
                memberCsRequest.setDocId(refundOrderList.getId());
                memberCsRequest.setDocNum(refundOrderList.getRefundNum());
                memberCsRequest.setDocType(Constant.doc_type_refund_cash);
                memberCsRequest.setDocDate(refundOrderList.getRefundDate());
                memberCsRequest.setTradeId(refundCash.getProjectId());
                memberCsRequest.setTradeName(refundCash.getProjectName());
                memberCsRequest.setTradeMoney(refundCash.getTransactionPrice());
                StringBuffer staffIds = new StringBuffer();
                StringBuffer staffNames = new StringBuffer();
                if (entities.size() > 0) {
                    for (AchiCommEntity achiCommEntity : entities) {
                        staffIds = staffIds.append(achiCommEntity.getSaleStaffId());
                        staffNames = staffNames.append(achiCommEntity.getSaleStaffName());
                    }
                }
                ssmMemberCsService.addMemberCs(memberCsRequest);
            }
        }
        return i;
    }


    @Override
    @Transactional
    public int unAudit(RefundOrderList refundOrderList) throws SmsException {
        int i = 0;
        //查询消费退单据
        RefundCash cash = new RefundCash();
        cash.setStoreId(refundOrderList.getStoreId());
        cash.setRefundNum(refundOrderList.getRefundNum());
        List<RefundCash> refundCashList = dao.select(cash);
        for (RefundCash refundCash : refundCashList) {
            //消费退款单对应收银单恢复
            i = ssmCashService.restoreRowOnly(refundCash, refundOrderList);
        }
        //将评价单进行删除操作
        MemberCs memberCs = new MemberCs();
        memberCs.setDocId(refundOrderList.getId());
        ssmMemberCsService.delete(memberCs);
        return i;
    }


    @Override
    public List<RefundCashResponse> selectList(Long storeId, String date) {
//        Example example = new Example(RefundCash.class);
//        Example.Criteria criteria = example.createCriteria();
//        criteria.andLike("refundDate",date + "%");
//        criteria.andEqualTo("storeId", storeId);
        RefundOrderResquest refundOrderResquest = new RefundOrderResquest();
        refundOrderResquest.setStoreId(storeId);
        refundOrderResquest.setDateStr(date);
        refundOrderResquest.setState(3);
        List<RefundCash> list = dao.selectList(refundOrderResquest);
        List<RefundCashResponse> cashResponses = new ArrayList<>();
        for (RefundCash cash : list) {
            RefundCashResponse refundCashResponse = new RefundCashResponse();
            BeanUtils.copyProperties(cash, refundCashResponse);
            //设置业务人员列表
            List<AchiCommEntity> entities = this.getAchiCommList(cash);
            refundCashResponse.setEntities(entities);

            cashResponses.add(refundCashResponse);
        }
        return cashResponses;
    }

    @Override
    public List<CashListResponse> selectLists(Long storeId,String dateStr, Date date) {
//        Example example = new Example(RefundCash.class);
//        Example.Criteria criteria = example.createCriteria();
//        criteria.andLike("refundDate",date + "%");
//        criteria.andEqualTo("storeId", storeId);
        List<CashListResponse> listResponses = new ArrayList<>();
        RefundOrderResquest refundOrderResquest = new RefundOrderResquest();
        refundOrderResquest.setStoreId(storeId);
        refundOrderResquest.setDateStr(dateStr);
        refundOrderResquest.setState(3);
        List<RefundCash> list = dao.selectList(refundOrderResquest);
        List<RefundCashResponse> cashResponses = new ArrayList<>();
        for (RefundCash cash : list) {
            cash.setRefundDate(cash.getAuditDate());
            CashListRequest cashList = new CashListRequest();
            cashList.setStoreId(cash.getStoreId());
            cashList.setId(cash.getCashId());
            cashList.setCashDate(cash.getCashDate());
            List<CashList> cashLists = new ArrayList<>();
            try {
                cashLists = ssmCashService.selectList(cashList);
            } catch (SmsException e) {
                e.printStackTrace();
            } catch (ParseException e) {
                e.printStackTrace();
            }

            for (CashList cashList1 : cashLists) {
                setCashList(cash, cashList1);
                CashListResponse cashListResponse = new CashListResponse();
                BeanUtils.copyProperties(cashList1, cashListResponse);
                List<AchiCommEntity> entities = this.getAchiCommLists(cashList1);
                //设置业务人员列表
                //设置业务人员列表
                if(null == cashList1.getCourseAccountId()){ //是散客收银
                    entities = this.getAchiCommLists(cashList1);
                    for (AchiCommEntity entity : entities) {
                        entity.setOrderType("");
                    }
                }else{ //卡包收银
                    entities = this.getAchiCommListsCard(cashList1);
                    for (AchiCommEntity entity : entities) {
                        entity.setMoney(cashList1.getCashAmount());
                    }
                }

                for (AchiCommEntity entity : entities) {
                    entity.setDocId(cash.getId());
                    entity.setDocType(Constant.doc_type_refund_cash);
                    entity.setCardComm(BigDecimal.valueOf(0).subtract(entity.getCardComm()));
                    entity.setCashComm(BigDecimal.valueOf(0).subtract(entity.getCashComm()));
                    entity.setCashAchi(BigDecimal.valueOf(0).subtract(entity.getCashAchi()));
                    entity.setCardAchi(BigDecimal.valueOf(0).subtract(entity.getCardAchi()));
                    entity.setTotalCommission(BigDecimal.valueOf(0).subtract(entity.getTotalCommission()));
                    entity.setTotalPerformance(BigDecimal.valueOf(0).subtract(entity.getTotalPerformance()));

                    BaseProject baseProject = new BaseProject();
                    baseProject.setId(cashList1.getProjectId());
                    BaseProject baseProject1 = ssmProjectService.selectOne(baseProject);
                    entity.setProjectId(baseProject1.getProjectNum());
                    entity.setDocDate(cash.getAuditDate());
                }
                cashListResponse.setEntities(entities);
                listResponses.add(cashListResponse);
            }
        }
        return listResponses;
    }

    private void setCashList(RefundCash cash, CashList cashList1) {
        cashList1.setServiceLargeOneStaffId(cash.getServiceLargeOneStaffId());
        cashList1.setServiceLargeOneStaffName(cash.getServiceLargeOneStaffName());
        cashList1.setServiceLargeOneIdentityCard(cash.getServiceLargeOneIdentityCard());
        cashList1.setServiceLargeOneRatio(cash.getServiceLargeOneRatio());
        cashList1.setLargeOneNumber(cash.getLargeOneNumber());
        cashList1.setServiceLargeTwoStaffId(cash.getServiceLargeTwoStaffId());
        cashList1.setServiceLargeTwoStaffName(cash.getServiceLargeTwoStaffName());
        cashList1.setServiceLargeTwoIdentityCard(cash.getServiceLargeTwoIdentityCard());
        cashList1.setServiceLargeTwoRatio(cash.getServiceLargeTwoRatio());
        cashList1.setLargeTwoNumber(cash.getLargeTwoNumber());
        cashList1.setServiceLargeThreeStaffId(cash.getServiceLargeThreeStaffId());
        cashList1.setServiceLargeThreeStaffName(cash.getServiceLargeThreeStaffName());
        cashList1.setServiceLargeThreeIdentityCard(cash.getServiceLargeThreeIdentityCard());
        cashList1.setServiceLargeThreeRatio(cash.getServiceLargeThreeRatio());
        cashList1.setLargeThreeNumber(cash.getLargeThreeNumber());


        cashList1.setServiceZhonggongOneStaffId(cash.getServiceZhonggongOneStaffId());
        cashList1.setServiceZhonggongOneStaffName(cash.getServiceZhonggongOneStaffName());
        cashList1.setServiceZhonggongOneIdentityCard(cash.getServiceZhonggongOneIdentityCard());
        cashList1.setServiceZhonggongOneRatio(cash.getServiceZhonggongOneRatio());
        cashList1.setZhonggongOneNumber(cash.getZhonggongOneNumber());
        cashList1.setServiceZhonggongTwoStaffId(cash.getServiceZhonggongTwoStaffId());
        cashList1.setServiceZhonggongTwoStaffName(cash.getServiceZhonggongTwoStaffName());
        cashList1.setServiceZhonggongTwoIdentityCard(cash.getServiceZhonggongTwoIdentityCard());
        cashList1.setServiceZhonggongTwoRatio(cash.getServiceZhonggongTwoRatio());
        cashList1.setZhonggongTwoNumber(cash.getZhonggongTwoNumber());
        cashList1.setServiceZhonggongThreeStaffId(cash.getServiceZhonggongThreeStaffId());
        cashList1.setServiceZhonggongThreeStaffName(cash.getServiceZhonggongThreeStaffName());
        cashList1.setServiceZhonggongThreeIdentityCard(cash.getServiceZhonggongThreeIdentityCard());
        cashList1.setServiceZhonggongThreeRatio(cash.getServiceZhonggongThreeRatio());
        cashList1.setZhonggongThreeNumber(cash.getZhonggongThreeNumber());

        cashList1.setServiceTechnicianOneStaffId(cash.getServiceTechnicianOneStaffId());
        cashList1.setServiceTechnicianOneStaffName(cash.getServiceTechnicianOneStaffName());
        cashList1.setServiceTechnicianOneIdentityCard(cash.getServiceTechnicianOneIdentityCard());
        cashList1.setServiceTechnicianOneRatio(cash.getServiceTechnicianOneRatio());
        cashList1.setTechnicianOneNumber(cash.getTechnicianOneNumber());
        cashList1.setServiceTechnicianTwoStaffId(cash.getServiceTechnicianTwoStaffId());
        cashList1.setServiceTechnicianTwoStaffName(cash.getServiceTechnicianTwoStaffName());
        cashList1.setServiceTechnicianTwoIdentityCard(cash.getServiceTechnicianTwoIdentityCard());
        cashList1.setServiceTechnicianTwoRatio(cash.getServiceTechnicianTwoRatio());
        cashList1.setTechnicianTwoNumber(cash.getTechnicianTwoNumber());
        cashList1.setServiceTechnicianThreeStaffId(cash.getServiceTechnicianThreeStaffId());
        cashList1.setServiceTechnicianThreeStaffName(cash.getServiceTechnicianThreeStaffName());
        cashList1.setServiceTechnicianThreeIdentityCard(cash.getServiceTechnicianThreeIdentityCard());
        cashList1.setServiceTechnicianThreeRatio(cash.getServiceTechnicianThreeRatio());
        cashList1.setTechnicianThreeNumber(cash.getTechnicianThreeNumber());

        cashList1.setServiceSmallOneStaffId(cash.getServiceSmallOneStaffId());
        cashList1.setServiceSmallOneStaffName(cash.getServiceSmallOneStaffName());
        cashList1.setServiceSmallOneIdentityCard(cash.getServiceSmallOneIdentityCard());
        cashList1.setServiceSmallOneRatio(cash.getServiceSmallOneRatio());
        cashList1.setSmallOneNumber(cash.getSmallOneNumber());
        cashList1.setServiceSmallTwoStaffId(cash.getServiceSmallTwoStaffId());
        cashList1.setServiceSmallTwoStaffName(cash.getServiceSmallTwoStaffName());
        cashList1.setServiceSmallTwoIdentityCard(cash.getServiceSmallTwoIdentityCard());
        cashList1.setServiceSmallTwoRatio(cash.getServiceSmallTwoRatio());
        cashList1.setSmallTwoNumber(cash.getSmallTwoNumber());
        cashList1.setServiceSmallThreeStaffId(cash.getServiceSmallThreeStaffId());
        cashList1.setServiceSmallThreeStaffName(cash.getServiceSmallThreeStaffName());
        cashList1.setServiceSmallThreeIdentityCard(cash.getServiceSmallThreeIdentityCard());
        cashList1.setServiceSmallThreeRatio(cash.getServiceSmallThreeRatio());
        cashList1.setSmallThreeNumber(cash.getSmallThreeNumber());

        //业绩提成标准
        cashList1.setAchievementLarge(cash.getAchievementLarge());
        cashList1.setAchievementZhonggong(cash.getAchievementZhonggong());
        cashList1.setAchievementTechnician(cash.getAchievementTechnician());
        cashList1.setAchievementSmall(cash.getAchievementSmall());
        cashList1.setCommissionLarge(cash.getCommissionLarge());
        cashList1.setCommissionZhonggong(cash.getCommissionZhonggong());
        cashList1.setCommissionTechnician(cash.getCommissionTechnician());
        cashList1.setCommissionSmall(cash.getCommissionSmall());
        cashList1.setCardAchievementLarge(cash.getCardAchievementLarge());
        cashList1.setCardAchievementZhonggong(cash.getCardAchievementZhonggong());
        cashList1.setCardAchievementTechnician(cash.getCardAchievementTechnician());
        cashList1.setCardAchievementSmall(cash.getCardAchievementSmall());
        cashList1.setCardCommissionLarge(cash.getCardCommissionLarge());
        cashList1.setCardCommissionZhonggong(cash.getCardCommissionZhonggong());
        cashList1.setCardCommissionTechnician(cash.getCardCommissionTechnician());
        cashList1.setCardCommissionSmall(cash.getCardCommissionSmall());
    }

    @Override
    public List<RefundCash> selectListsByStartTimeAndEndTime(Long storeId, String dateStr, Date startTime,Date endTime) {
        List<CashListResponse> listResponses = new ArrayList<>();
        RefundOrderResquest refundOrderResquest = new RefundOrderResquest();
        refundOrderResquest.setStoreId(storeId);
        refundOrderResquest.setStartTime(startTime);
        refundOrderResquest.setEndTime(endTime);
        refundOrderResquest.setState(3);
        List<RefundCash> list = dao.selectList(refundOrderResquest);
        return list;
    }

    @Override
    public List<CashListResponse> selectListsDept(Long storeId,String dateStr, Date date) {
//        Example example = new Example(RefundCash.class);
//        Example.Criteria criteria = example.createCriteria();
//        criteria.andLike("refundDate",date + "%");
//        criteria.andEqualTo("storeId", storeId);
        List<CashListResponse> listResponses = new ArrayList<>();
        RefundOrderResquest refundOrderResquest = new RefundOrderResquest();
        refundOrderResquest.setStoreId(storeId);
        refundOrderResquest.setDateStr(dateStr);
        refundOrderResquest.setState(3);
        List<RefundCash> list = dao.selectList(refundOrderResquest);
        List<RefundCashResponse> cashResponses = new ArrayList<>();
        for (RefundCash cash : list) {

            CashListRequest cashList = new CashListRequest();
            cashList.setStoreId(cash.getStoreId());
            cashList.setId(cash.getCashId());
            cashList.setCashDate(cash.getCashDate());
            List<CashList> cashLists = new ArrayList<>();
            try {
                cashLists = ssmCashService.selectList(cashList);
            } catch (SmsException e) {
                e.printStackTrace();
            } catch (ParseException e) {
                e.printStackTrace();
            }

            for (CashList cashList1 : cashLists) {
                cashList1.setServiceLargeOneStaffId(cash.getServiceLargeOneStaffId());
                cashList1.setServiceLargeOneStaffName(cash.getServiceLargeOneStaffName());
                cashList1.setServiceLargeOneIdentityCard(cash.getServiceLargeOneIdentityCard());
                cashList1.setServiceLargeOneRatio(cash.getServiceLargeOneRatio());
                cashList1.setLargeOneNumber(cash.getLargeOneNumber());
                cashList1.setServiceLargeTwoStaffId(cash.getServiceLargeTwoStaffId());
                cashList1.setServiceLargeTwoStaffName(cash.getServiceLargeTwoStaffName());
                cashList1.setServiceLargeTwoIdentityCard(cash.getServiceLargeTwoIdentityCard());
                cashList1.setServiceLargeTwoRatio(cash.getServiceLargeTwoRatio());
                cashList1.setLargeTwoNumber(cash.getLargeTwoNumber());
                cashList1.setServiceLargeThreeStaffId(cash.getServiceLargeThreeStaffId());
                cashList1.setServiceLargeThreeStaffName(cash.getServiceLargeThreeStaffName());
                cashList1.setServiceLargeThreeIdentityCard(cash.getServiceLargeThreeIdentityCard());
                cashList1.setServiceLargeThreeRatio(cash.getServiceLargeThreeRatio());
                cashList1.setLargeThreeNumber(cash.getLargeThreeNumber());


                cashList1.setServiceZhonggongOneStaffId(cash.getServiceZhonggongOneStaffId());
                cashList1.setServiceZhonggongOneStaffName(cash.getServiceZhonggongOneStaffName());
                cashList1.setServiceZhonggongOneIdentityCard(cash.getServiceZhonggongOneIdentityCard());
                cashList1.setServiceZhonggongOneRatio(cash.getServiceZhonggongOneRatio());
                cashList1.setZhonggongOneNumber(cash.getZhonggongOneNumber());
                cashList1.setServiceZhonggongTwoStaffId(cash.getServiceZhonggongTwoStaffId());
                cashList1.setServiceZhonggongTwoStaffName(cash.getServiceZhonggongTwoStaffName());
                cashList1.setServiceZhonggongTwoIdentityCard(cash.getServiceZhonggongTwoIdentityCard());
                cashList1.setServiceZhonggongTwoRatio(cash.getServiceZhonggongTwoRatio());
                cashList1.setZhonggongTwoNumber(cash.getZhonggongTwoNumber());
                cashList1.setServiceZhonggongThreeStaffId(cash.getServiceZhonggongThreeStaffId());
                cashList1.setServiceZhonggongThreeStaffName(cash.getServiceZhonggongThreeStaffName());
                cashList1.setServiceZhonggongThreeIdentityCard(cash.getServiceZhonggongThreeIdentityCard());
                cashList1.setServiceZhonggongThreeRatio(cash.getServiceZhonggongThreeRatio());
                cashList1.setZhonggongThreeNumber(cash.getZhonggongThreeNumber());

                cashList1.setServiceTechnicianOneStaffId(cash.getServiceTechnicianOneStaffId());
                cashList1.setServiceTechnicianOneStaffName(cash.getServiceTechnicianOneStaffName());
                cashList1.setServiceTechnicianOneIdentityCard(cash.getServiceTechnicianOneIdentityCard());
                cashList1.setServiceTechnicianOneRatio(cash.getServiceTechnicianOneRatio());
                cashList1.setTechnicianOneNumber(cash.getTechnicianOneNumber());
                cashList1.setServiceTechnicianTwoStaffId(cash.getServiceTechnicianTwoStaffId());
                cashList1.setServiceTechnicianTwoStaffName(cash.getServiceTechnicianTwoStaffName());
                cashList1.setServiceTechnicianTwoIdentityCard(cash.getServiceTechnicianTwoIdentityCard());
                cashList1.setServiceTechnicianTwoRatio(cash.getServiceTechnicianTwoRatio());
                cashList1.setTechnicianTwoNumber(cash.getTechnicianTwoNumber());
                cashList1.setServiceTechnicianThreeStaffId(cash.getServiceTechnicianThreeStaffId());
                cashList1.setServiceTechnicianThreeStaffName(cash.getServiceTechnicianThreeStaffName());
                cashList1.setServiceTechnicianThreeIdentityCard(cash.getServiceTechnicianThreeIdentityCard());
                cashList1.setServiceTechnicianThreeRatio(cash.getServiceTechnicianThreeRatio());
                cashList1.setTechnicianThreeNumber(cash.getTechnicianThreeNumber());

                cashList1.setServiceSmallOneStaffId(cash.getServiceSmallOneStaffId());
                cashList1.setServiceSmallOneStaffName(cash.getServiceSmallOneStaffName());
                cashList1.setServiceSmallOneIdentityCard(cash.getServiceSmallOneIdentityCard());
                cashList1.setServiceSmallOneRatio(cash.getServiceSmallOneRatio());
                cashList1.setSmallOneNumber(cash.getSmallOneNumber());
                cashList1.setServiceSmallTwoStaffId(cash.getServiceSmallTwoStaffId());
                cashList1.setServiceSmallTwoStaffName(cash.getServiceSmallTwoStaffName());
                cashList1.setServiceSmallTwoIdentityCard(cash.getServiceSmallTwoIdentityCard());
                cashList1.setServiceSmallTwoRatio(cash.getServiceSmallTwoRatio());
                cashList1.setSmallTwoNumber(cash.getSmallTwoNumber());
                cashList1.setServiceSmallThreeStaffId(cash.getServiceSmallThreeStaffId());
                cashList1.setServiceSmallThreeStaffName(cash.getServiceSmallThreeStaffName());
                cashList1.setServiceSmallThreeIdentityCard(cash.getServiceSmallThreeIdentityCard());
                cashList1.setServiceSmallThreeRatio(cash.getServiceSmallThreeRatio());
                cashList1.setSmallThreeNumber(cash.getSmallThreeNumber());

                cashList1.setAchievementLarge(cash.getAchievementLarge());
                cashList1.setAchievementZhonggong(cash.getAchievementZhonggong());
                cashList1.setAchievementTechnician(cash.getAchievementTechnician());
                cashList1.setAchievementSmall(cash.getAchievementSmall());
                cashList1.setCommissionLarge(cash.getCommissionLarge());
                cashList1.setCommissionZhonggong(cash.getCommissionZhonggong());
                cashList1.setCommissionTechnician(cash.getCommissionTechnician());
                cashList1.setCommissionSmall(cash.getCommissionSmall());
                cashList1.setCardAchievementLarge(cash.getCardAchievementLarge());
                cashList1.setCardAchievementZhonggong(cash.getCardAchievementZhonggong());
                cashList1.setCardAchievementTechnician(cash.getCardAchievementTechnician());
                cashList1.setCardAchievementSmall(cash.getCardAchievementSmall());
                cashList1.setCardCommissionLarge(cash.getCardCommissionLarge());
                cashList1.setCardCommissionZhonggong(cash.getCardCommissionZhonggong());
                cashList1.setCardCommissionTechnician(cash.getCardCommissionTechnician());
                cashList1.setCardCommissionSmall(cash.getCardCommissionSmall());
                CashListResponse cashListResponse = new CashListResponse();
                BeanUtils.copyProperties(cashList1, cashListResponse);
                List<AchiCommEntity> entities = this.getAchiCommLists(cashList1);
                //设置业务人员列表
                //设置业务人员列表
                if(null == cashList1.getCourseAccountId()){ //是散客收银
                    entities = this.getAchiCommLists(cashList1);
                    for (AchiCommEntity entity : entities) {
                        entity.setOrderType("");
                    }
                }else{ //卡包收银
                    entities = this.getAchiCommListsCard(cashList1);
                    for (AchiCommEntity entity : entities) {
                        entity.setMoney(cashList1.getCashAmount());
                    }
                }

                for (AchiCommEntity entity : entities) {
                    entity.setDocId(cash.getId());
                    entity.setDocType(Constant.doc_type_refund_cash);

                    BaseProject baseProject = new BaseProject();
                    baseProject.setId(cashList1.getProjectId());
                    BaseProject baseProject1 = ssmProjectService.selectOne(baseProject);
                    entity.setProjectId(baseProject1.getProjectNum());
                }
                cashListResponse.setEntities(entities);
                listResponses.add(cashListResponse);
            }
        }
        return listResponses;
    }

    @Override
    public List<RefundCash> selectListschia(Long storeId,Date dateStr, Date date) {
        RefundOrderResquest refundOrderResquest = new RefundOrderResquest();
        refundOrderResquest.setStoreId(storeId);
        refundOrderResquest.setStartTime(dateStr);
        refundOrderResquest.setEndTime(date);
        List<RefundCash> list = dao.selectListschia(refundOrderResquest);

        return list;
    }

    //升级后修改的新业绩提成算法
    public List<AchiCommEntity> getAchiCommLists(CashList cashList){
        List<AchiCommEntity> entities = new ArrayList<>();
        BigDecimal hundredBD = com.ssm.manage.utils.BigDecimalUtils.bigDecimal("100");
        //减掉固定金额业绩的单据总金额
//        BigDecimal totalMeony = cashList.getCashAmount();
        BigDecimal totalMeony = cashList.getCollectionCashAmount().add(cashList.getCollectionRechargeAmount());
        BigDecimal GDtotalMeony = cashList.getCollectionCashAmount().add(cashList.getCollectionRechargeAmount());
        //减掉固定金额业绩的单据现付金额
        BigDecimal achievementMeony = cashList.getCollectionCashAmount();
        //减掉固定金额业绩的单据卡付金额
        BigDecimal cardMeony = cashList.getCollectionRechargeAmount();
//        BigDecimal bigDecimal = BigDecimal.valueOf(Double.valueOf(cashList.getCollectionAmount()));
//        BigDecimal cardMeony =bigDecimal.subtract(cashList.getCollectionCashAmount());

        //存在卡付，也存在现付
        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1){
            //判断大工是否存在
            if(null != cashList.getServiceLargeOneStaffId() || null != cashList.getServiceLargeTwoStaffId() || null != cashList.getServiceLargeThreeStaffId()){
                //判断卡付和现付是否同时存在
                if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1 &&cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                    HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementLarge(), cashList.getAchievementLarge());
                    achievementMeony= BigDecimalUtils.subtract(achievementMeony,fixedAmount.get("cash"));
                    cardMeony= BigDecimalUtils.subtract(cardMeony,fixedAmount.get("card"));

                    totalMeony= BigDecimalUtils.subtract(totalMeony,fixedAmount.get("total"));
                }else{
                    //判断现付业绩是否为固定金额
                    if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                        achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementLarge());


                        totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementLarge());
                    }
                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                        cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementLarge());
                        totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementLarge());
                    }
                }

            }

            //判断中工是否存在
            if(null != cashList.getServiceZhonggongOneStaffId() || null != cashList.getServiceZhonggongTwoStaffId() || null != cashList.getServiceZhonggongThreeStaffId()){
                //判断卡付和现付是否同时存在
                if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1 &&cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                    HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementZhonggong(), cashList.getAchievementZhonggong());
                    achievementMeony = BigDecimalUtils.subtract(achievementMeony, fixedAmount.get("cash"));
                    cardMeony = BigDecimalUtils.subtract(cardMeony, fixedAmount.get("card"));

                    totalMeony = BigDecimalUtils.subtract(totalMeony, fixedAmount.get("total"));
                }else{
                    if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                        achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementZhonggong());
                        totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementZhonggong());
                    }
                    if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                        cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementZhonggong());
                        totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementZhonggong());
                    }
                }
            }

            //判断小工（技师）是否存在
            if(null != cashList.getServiceTechnicianOneStaffId() || null != cashList.getServiceTechnicianTwoStaffId() || null != cashList.getServiceTechnicianThreeStaffId()){
                if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1 && cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                    HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementTechnician(), cashList.getAchievementTechnician());
                    achievementMeony = BigDecimalUtils.subtract(achievementMeony, fixedAmount.get("cash"));
                    cardMeony = BigDecimalUtils.subtract(cardMeony, fixedAmount.get("card"));

                    totalMeony = BigDecimalUtils.subtract(totalMeony, fixedAmount.get("total"));
                }else{
                    if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                        achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementTechnician());
                        totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementTechnician());
                    }
                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                        cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementTechnician());
                        totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementTechnician());
                    }
                }
            }

            //判断助理是否存在
            if(null != cashList.getServiceSmallOneStaffId() || null != cashList.getServiceSmallTwoStaffId() || null != cashList.getServiceSmallThreeStaffId()){
                if( cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1 && cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                    HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementSmall(), cashList.getAchievementSmall());
                    achievementMeony = BigDecimalUtils.subtract(achievementMeony, fixedAmount.get("cash"));
                    cardMeony = BigDecimalUtils.subtract(cardMeony, fixedAmount.get("card"));

                    totalMeony = BigDecimalUtils.subtract(totalMeony, fixedAmount.get("total"));
                }else{
                    if(cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                        achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementSmall());
                        totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementSmall());
                    }
                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                        cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementSmall());
                        totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementSmall());
                    }
                }


            }

            //大工1编码
            if (null != cashList.getServiceLargeOneStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));

                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
                achiCommEntity.setSaleAchievementAmount(cashList.getAchievementLarge());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(
                        BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));

                //判断现付业绩是否为固定金额
                if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementLarge(), cashList.getAchievementLarge());
                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                    }else{
                        achiCommEntity.setCashAchi(cashList.getAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                    }


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                        }

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                    }

                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                        }

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                            }

                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                        }

                    }else{
                        //卡付业绩比例计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony,cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                        }
                    }
                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                        }
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                    }
                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                        }
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                        }
                    }else{
                        //卡付业绩比例计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                        }
                    }
                }

                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);
//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(
//                    BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //大工2编码
            if (null != cashList.getServiceLargeTwoStaffId()){

                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
                //判断现付业绩是否为固定金额
                //判断现付业绩是否为固定金额
                if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementLarge(), cashList.getAchievementLarge());
                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                    }else{
                        achiCommEntity.setCashAchi(cashList.getAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                    }


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                        }

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                    }

                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                        }

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                            }

                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                        }

                    }else{
                        //卡付业绩比例计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                        }
                    }
                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                        }
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                    }
                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                        }
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                        }
                    }else{
                        //卡付业绩比例计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                        }
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);

//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //大工3编码
            if (null != cashList.getServiceLargeThreeStaffId()){

                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
                //判断现付业绩是否为固定金额
                //判断现付业绩是否为固定金额
                if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementLarge(), cashList.getAchievementLarge());
                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                    }else{
                        achiCommEntity.setCashAchi(cashList.getAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                    }


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                        }

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                    }

                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                        }

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                            }

                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                        }

                    }else{
                        //卡付业绩比例计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                        }
                    }
                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                        }
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                    }
                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                        }
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                        }
                    }else{
                        //卡付业绩比例计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                        }
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);


//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //中工1编码
            if (null != cashList.getServiceZhonggongOneStaffId()){


                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(
                        BigDecimalUtils.add(
                                BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),
                                        BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
                                BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),
                                        BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
                //判断现付业绩是否为固定金额
                if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementZhonggong(), cashList.getAchievementZhonggong());
                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                    }else{
                        achiCommEntity.setCashAchi(cashList.getAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                    }


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                        }

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                    }

                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                        }

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                            }

                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                        }

                    }else{
                        //卡付业绩比例计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                        }
                    }
                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                        }
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                    }
                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                        }
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                        }
                    }else{
                        //卡付业绩百分比计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                        }
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);

//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(
//                    BigDecimalUtils.add(
//                        BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),
//                            BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                            BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),
//                            BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //中工2编码
            if (null != cashList.getServiceZhonggongTwoStaffId()){

                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));

                //判断现付业绩是否为固定金额
                if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementZhonggong(), cashList.getAchievementZhonggong());
                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                    }else{
                        achiCommEntity.setCashAchi(cashList.getAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                    }


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                        }

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                    }

                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                        }

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                            }

                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                        }

                    }else{
                        //卡付业绩比例计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                        }
                    }
                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                        }
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                    }
                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                        }
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                        }
                    }else{
                        //卡付业绩百分比计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                        }
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);

//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //中工3编码
            if (null != cashList.getServiceZhonggongThreeStaffId()){


                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));

                //判断现付业绩是否为固定金额
                if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementZhonggong(), cashList.getAchievementZhonggong());
                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                    }else{
                        achiCommEntity.setCashAchi(cashList.getAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                    }


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                        }

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                    }

                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                        }

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                            }

                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                        }

                    }else{
                        //卡付业绩比例计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                        }
                    }
                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                        }
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                    }
                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                        }
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                        }
                    }else{
                        //卡付业绩百分比计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                        }
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);



//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //技师1编码
            if (null != cashList.getServiceTechnicianOneStaffId()){

                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getTechnicianOneNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianOneStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianOneStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianOneIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianOneRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));

                //判断现付业绩是否为固定金额
                if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementTechnician(), cashList.getAchievementTechnician());
                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                    }else{
                        achiCommEntity.setCashAchi(cashList.getAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                    }


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                        }

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                    }

                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                        }

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                            }

                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                        }

                    }else{
                        //卡付业绩比例计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                        }
                    }
                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                        }
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                    }
                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                        }
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                        }
                    }else{
                        //卡付业绩百分比计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                        }
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

                entities.add(achiCommEntity);
            }
            //技师2编码
            if (null != cashList.getServiceTechnicianTwoStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getTechnicianTwoNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianTwoStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianTwoStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianTwoIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianTwoRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));

                //判断现付业绩是否为固定金额
                if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementTechnician(), cashList.getAchievementTechnician());
                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                    }else{
                        achiCommEntity.setCashAchi(cashList.getAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                    }


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                        }

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                    }

                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                        }

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                            }

                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                        }

                    }else{
                        //卡付业绩比例计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                        }
                    }
                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                        }
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                    }
                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                        }
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                        }
                    }else{
                        //卡付业绩百分比计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                        }
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
            //技师3编码
            if (null != cashList.getServiceTechnicianThreeStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getTechnicianThreeNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianThreeStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianThreeStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianThreeIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianThreeRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));


                //判断现付业绩是否为固定金额
                if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementTechnician(), cashList.getAchievementTechnician());
                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                    }else{
                        achiCommEntity.setCashAchi(cashList.getAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                    }


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                        }

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                    }

                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                        }

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                            }

                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                        }

                    }else{
                        //卡付业绩比例计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                        }
                    }
                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                        }
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                    }
                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                        }
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                        }
                    }else{
                        //卡付业绩百分比计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                        }
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
            //助理1编码
            if (null != cashList.getServiceSmallOneStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getSmallOneNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceSmallOneStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceSmallOneStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallOneIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceSmallOneRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));

                //判断现付业绩是否为固定金额
                if(cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementSmall(), cashList.getAchievementSmall());
                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                    }else{
                        achiCommEntity.setCashAchi(cashList.getAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                    }


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                        }

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                    }

                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                        }

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                            }

                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                        }

                    }else{
                        //卡付业绩比例计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                        }
                    }
                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                        }
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                    }
                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                        }
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                        }
                    }else{
                        //卡付业绩百分比计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                        }
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
            //助理2编码
            if (null != cashList.getServiceSmallTwoStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));

                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getSmallTwoNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceSmallTwoStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceSmallTwoStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallTwoIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceSmallTwoRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));

                //判断现付业绩是否为固定金额
                if(cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementSmall(), cashList.getAchievementSmall());
                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                    }else{
                        achiCommEntity.setCashAchi(cashList.getAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                    }


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                        }

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                    }

                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                        }

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                            }

                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                        }

                    }else{
                        //卡付业绩比例计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                        }
                    }
                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                        }
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                    }
                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                        }
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                        }
                    }else{
                        //卡付业绩百分比计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                        }
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
            //助理3编码
            if (null != cashList.getServiceSmallThreeStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));

                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getSmallThreeNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceSmallThreeStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceSmallThreeStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallThreeIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceSmallThreeRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));


                //判断现付业绩是否为固定金额
                if(cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementSmall(), cashList.getAchievementSmall());
                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                    }else{
                        achiCommEntity.setCashAchi(cashList.getAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                    }


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                        }

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                    }

                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                        }

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                            }

                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                        }

                    }else{
                        //卡付业绩比例计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));

                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                        }
                    }
                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                        }
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                    }
                    //判断卡付业绩是否为固定金额
                    if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //卡付业绩按固定金额计算
                        //计算卡付业绩
                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                        }else{
                            achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                        }
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                        }
                    }else{
                        //卡付业绩百分比计算
                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                        //计算卡付提成
                        //判断卡付提成是否为固定金额
                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                            //提成按固定金额算
                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                            }else{
                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                            }
                        }else{
                            //提成按百分百
                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                        }
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
        }else if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1){//只有卡付
            //判断大工是否存在
            if(null != cashList.getServiceLargeOneStaffId() || null != cashList.getServiceLargeTwoStaffId() || null != cashList.getServiceLargeThreeStaffId()){
                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementLarge());
                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementLarge());
                }
            }

            //判断中工是否存在
            if(null != cashList.getServiceZhonggongOneStaffId() || null != cashList.getServiceZhonggongTwoStaffId() || null != cashList.getServiceZhonggongThreeStaffId()){
                if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementZhonggong());
                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementZhonggong());
                }
            }

            //判断小工（技师）是否存在
            if(null != cashList.getServiceTechnicianOneStaffId() || null != cashList.getServiceTechnicianTwoStaffId() || null != cashList.getServiceTechnicianThreeStaffId()){
                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementTechnician());
                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementTechnician());
                }
            }

            //判断助理是否存在
            if(null != cashList.getServiceSmallOneStaffId() || null != cashList.getServiceSmallTwoStaffId() || null != cashList.getServiceSmallThreeStaffId()){
                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementSmall());
                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementSmall());
                }
            }

            //大工1编码
            if (null != cashList.getServiceLargeOneStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
                achiCommEntity.setSaleAchievementAmount(cashList.getAchievementLarge());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(
                        BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));

                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));

                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                    }
                }

                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);
//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(
//                    BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //大工2编码
            if (null != cashList.getServiceLargeTwoStaffId()){

                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));

                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);

//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //大工3编码
            if (null != cashList.getServiceLargeThreeStaffId()){

                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);


//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //中工1编码
            if (null != cashList.getServiceZhonggongOneStaffId()){


                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(
                        BigDecimalUtils.add(
                                BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),
                                        BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
                                BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),
                                        BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));

                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);

//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(
//                    BigDecimalUtils.add(
//                        BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),
//                            BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                            BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),
//                            BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //中工2编码
            if (null != cashList.getServiceZhonggongTwoStaffId()){

                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));

                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);

//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //中工3编码
            if (null != cashList.getServiceZhonggongThreeStaffId()){


                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));

                //判断现付业绩是否为固定金额
                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));

                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);



//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //技师1编码
            if (null != cashList.getServiceTechnicianOneStaffId()){

                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getTechnicianOneNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianOneStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianOneStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianOneIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianOneRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));

                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

                entities.add(achiCommEntity);
            }
            //技师2编码
            if (null != cashList.getServiceTechnicianTwoStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getTechnicianTwoNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianTwoStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianTwoStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianTwoIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianTwoRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));

                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));

                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
            //技师3编码
            if (null != cashList.getServiceTechnicianThreeStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getTechnicianThreeNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianThreeStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianThreeStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianThreeIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianThreeRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));


                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));

                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
            //助理1编码
            if (null != cashList.getServiceSmallOneStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getSmallOneNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceSmallOneStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceSmallOneStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallOneIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceSmallOneRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));

                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));

                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
            //助理2编码
            if (null != cashList.getServiceSmallTwoStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getSmallTwoNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceSmallTwoStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceSmallTwoStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallTwoIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceSmallTwoRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));

                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));

                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
            //助理3编码
            if (null != cashList.getServiceSmallThreeStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getSmallThreeNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceSmallThreeStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceSmallThreeStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallThreeIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceSmallThreeRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));


                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));

                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
        }else if(cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1) {//只有现付
            //判断大工是否存在
            if(null != cashList.getServiceLargeOneStaffId() || null != cashList.getServiceLargeTwoStaffId() || null != cashList.getServiceLargeThreeStaffId()){
                //判断现付业绩是否为固定金额
                if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                    achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementLarge());
                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementLarge());
                }
            }

            //判断中工是否存在
            if(null != cashList.getServiceZhonggongOneStaffId() || null != cashList.getServiceZhonggongTwoStaffId() || null != cashList.getServiceZhonggongThreeStaffId()){
                if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                    achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementZhonggong());
                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementZhonggong());
                }
            }

            //判断小工（技师）是否存在
            if(null != cashList.getServiceTechnicianOneStaffId() || null != cashList.getServiceTechnicianTwoStaffId() || null != cashList.getServiceTechnicianThreeStaffId()){
                if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                    achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementTechnician());
                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementTechnician());
                }
            }

            //判断助理是否存在
            if(null != cashList.getServiceSmallOneStaffId() || null != cashList.getServiceSmallTwoStaffId() || null != cashList.getServiceSmallThreeStaffId()){
                if(cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                    achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementSmall());
                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementSmall());
                }
            }

            //大工1编码
            if (null != cashList.getServiceLargeOneStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
                achiCommEntity.setSaleAchievementAmount(cashList.getAchievementLarge());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(
                        BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));

                //判断现付业绩是否为固定金额
                if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    achiCommEntity.setCashAchi(cashList.getAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                    }
                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                    }
                }

                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);
//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(
//                    BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //大工2编码
            if (null != cashList.getServiceLargeTwoStaffId()){

                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
                //判断现付业绩是否为固定金额
                //判断现付业绩是否为固定金额
                if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    achiCommEntity.setCashAchi(cashList.getAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                    }


                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);

//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //大工3编码
            if (null != cashList.getServiceLargeThreeStaffId()){

                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
                //判断现付业绩是否为固定金额
                //判断现付业绩是否为固定金额
                if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    achiCommEntity.setCashAchi(cashList.getAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                    }
                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);


//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //中工1编码
            if (null != cashList.getServiceZhonggongOneStaffId()){


                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(
                        BigDecimalUtils.add(
                                BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),
                                        BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
                                BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),
                                        BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
                //判断现付业绩是否为固定金额
                if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    achiCommEntity.setCashAchi(cashList.getAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                    }


                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                    }

                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);

//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(
//                    BigDecimalUtils.add(
//                        BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),
//                            BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                            BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),
//                            BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //中工2编码
            if (null != cashList.getServiceZhonggongTwoStaffId()){

                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));

                //判断现付业绩是否为固定金额
                if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    achiCommEntity.setCashAchi(cashList.getAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                    }

                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);

//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //中工3编码
            if (null != cashList.getServiceZhonggongThreeStaffId()){


                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));

                //判断现付业绩是否为固定金额
                if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    achiCommEntity.setCashAchi(cashList.getAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                    }


                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                    }

                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);



//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //技师1编码
            if (null != cashList.getServiceTechnicianOneStaffId()){

                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getTechnicianOneNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianOneStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianOneStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianOneIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianOneRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));

                //判断现付业绩是否为固定金额
                if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    achiCommEntity.setCashAchi(cashList.getAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                    }


                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                    }

                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

                entities.add(achiCommEntity);
            }
            //技师2编码
            if (null != cashList.getServiceTechnicianTwoStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getTechnicianTwoNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianTwoStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianTwoStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianTwoIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianTwoRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));

                //判断现付业绩是否为固定金额
                if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    achiCommEntity.setCashAchi(cashList.getAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                    }


                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                    }

                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
            //技师3编码
            if (null != cashList.getServiceTechnicianThreeStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getTechnicianThreeNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianThreeStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianThreeStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianThreeIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianThreeRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));


                //判断现付业绩是否为固定金额
                if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    achiCommEntity.setCashAchi(cashList.getAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                    }


                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                    }

                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
            //助理1编码
            if (null != cashList.getServiceSmallOneStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getSmallOneNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceSmallOneStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceSmallOneStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallOneIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceSmallOneRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));

                //判断现付业绩是否为固定金额
                if(cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    achiCommEntity.setCashAchi(cashList.getAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                    }


                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
            //助理2编码
            if (null != cashList.getServiceSmallTwoStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getSmallTwoNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceSmallTwoStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceSmallTwoStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallTwoIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceSmallTwoRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));

                //判断现付业绩是否为固定金额
                if(cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    achiCommEntity.setCashAchi(cashList.getAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                    }

                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
            //助理3编码
            if (null != cashList.getServiceSmallThreeStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(GDtotalMeony);
//                achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getSmallThreeNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceSmallThreeStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceSmallThreeStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallThreeIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceSmallThreeRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));


                //判断现付业绩是否为固定金额
                if(cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
                    //计算现付业绩
                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
                    achiCommEntity.setCashAchi(cashList.getAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));


                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));

                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                    }


                }else{ //计算百分百
                    //计算现付业绩
                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));

                    //计算现付提成
                    //判断现付提成是否为百分百还是固定金额
                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
                        //判断是否存在卡付和现付并且卡付提出也是固定金额
                        achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                    }else{//百分百
                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                    }

                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
        }



        return entities;
    }

    //升级后修改的新疗程消费业绩提成算法
    public List<AchiCommEntity> getAchiCommListsCard(CashList cashList){
        List<AchiCommEntity> entities = new ArrayList<>();
        BigDecimal hundredBD = com.ssm.manage.utils.BigDecimalUtils.bigDecimal("100");
        //减掉固定金额业绩的单据总金额
        BigDecimal totalMeony = cashList.getAmount();
        //减掉固定金额业绩的单据卡付金额
        BigDecimal bigDecimal = BigDecimal.valueOf(Double.valueOf(cashList.getCollectionAmount()));
        BigDecimal cardMeony =totalMeony;
//        BigDecimal cardMeony =bigDecimal.subtract(cashList.getCollectionCashAmount());

        //存在卡付，也存在现付
        if(cashList.getCashAmount().compareTo(BigDecimal.valueOf(0)) == 1){//只有卡付
            //判断大工是否存在
            if(null != cashList.getServiceLargeOneStaffId() || null != cashList.getServiceLargeTwoStaffId() || null != cashList.getServiceLargeThreeStaffId()){
                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementLarge());
                }
            }

            //判断中工是否存在
            if(null != cashList.getServiceZhonggongOneStaffId() || null != cashList.getServiceZhonggongTwoStaffId() || null != cashList.getServiceZhonggongThreeStaffId()){
                if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementZhonggong());
                }
            }

            //判断小工（技师）是否存在
            if(null != cashList.getServiceTechnicianOneStaffId() || null != cashList.getServiceTechnicianTwoStaffId() || null != cashList.getServiceTechnicianThreeStaffId()){
                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementTechnician());
                }
            }

            //判断助理是否存在
            if(null != cashList.getServiceSmallOneStaffId() || null != cashList.getServiceSmallTwoStaffId() || null != cashList.getServiceSmallThreeStaffId()){
                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementSmall());
                }
            }

            //大工1编码
            if (null != cashList.getServiceLargeOneStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(cashList.getAmount());
                //achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setOrderType("card");
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
                achiCommEntity.setSaleAchievementAmount(cashList.getAchievementLarge());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(
                        BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));

                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));

                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
                    }
                }

                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);
//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(
//                    BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //大工2编码
            if (null != cashList.getServiceLargeTwoStaffId()){

                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(cashList.getAmount());
                //achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setOrderType("card");
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);

//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //大工3编码
            if (null != cashList.getServiceLargeThreeStaffId()){

                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(cashList.getAmount());
                //achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setOrderType("card");
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);


//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //中工1编码
            if (null != cashList.getServiceZhonggongOneStaffId()){


                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(cashList.getAmount());
                //achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setOrderType("card");
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(
                        BigDecimalUtils.add(
                                BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),
                                        BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
                                BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),
                                        BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));

                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);

//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(
//                    BigDecimalUtils.add(
//                        BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),
//                            BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                            BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),
//                            BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //中工2编码
            if (null != cashList.getServiceZhonggongTwoStaffId()){

                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(cashList.getAmount());
                //  achiCommEntity.setMoney(cashList.getAmount());
                //achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setOrderType("card");
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));

                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);

//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //中工3编码
            if (null != cashList.getServiceZhonggongThreeStaffId()){


                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(cashList.getAmount());
                //achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setOrderType("card");
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));

                //判断现付业绩是否为固定金额
                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));

                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
                entities.add(achiCommEntity);



//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getCashNum());
//            achiCommEntity.setDocType(Constant.doc_type_store_cash);
//            achiCommEntity.setDocDate(cashList.getCashDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            entities.add(achiCommEntity);
            }
            //技师1编码
            if (null != cashList.getServiceTechnicianOneStaffId()){

                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(cashList.getAmount());
                //achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setOrderType("card");
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getTechnicianOneNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianOneStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianOneStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianOneIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianOneRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));

                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

                entities.add(achiCommEntity);
            }
            //技师2编码
            if (null != cashList.getServiceTechnicianTwoStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(cashList.getAmount());
                //achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setOrderType("card");
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getTechnicianTwoNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianTwoStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianTwoStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianTwoIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianTwoRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));

                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));

                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
            //技师3编码
            if (null != cashList.getServiceTechnicianThreeStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(cashList.getAmount());
                //achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setOrderType("card");
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getTechnicianThreeNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianThreeStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianThreeStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianThreeIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianThreeRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));


                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));

                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
            //助理1编码
            if (null != cashList.getServiceSmallOneStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(cashList.getAmount());
                //achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setOrderType("card");
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getSmallOneNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceSmallOneStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceSmallOneStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallOneIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceSmallOneRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));

                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));

                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
            //助理2编码
            if (null != cashList.getServiceSmallTwoStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(cashList.getAmount());
                //achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setOrderType("card");
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getSmallTwoNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceSmallTwoStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceSmallTwoStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallTwoIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceSmallTwoRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));

                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));

                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
            //助理3编码
            if (null != cashList.getServiceSmallThreeStaffId()){
                AchiCommEntity achiCommEntity = new AchiCommEntity();
                achiCommEntity.setMoney(cashList.getAmount());
                //achiCommEntity.setMoney(cashList.getCashAmount());
                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
                achiCommEntity.setMemberName(cashList.getMemberName());
                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
                achiCommEntity.setDocNum(cashList.getCashNum());
                achiCommEntity.setDocType(Constant.doc_type_store_cash);
                achiCommEntity.setOrderType("card");
                achiCommEntity.setDocDate(cashList.getCashDate());
                achiCommEntity.setTradeName(cashList.getProjectName());
                achiCommEntity.setBrandNumber(cashList.getSmallThreeNumber());
                achiCommEntity.setSaleStaffId(cashList.getServiceSmallThreeStaffId());
                achiCommEntity.setSaleStaffName(cashList.getServiceSmallThreeStaffName());
                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallThreeIdentityCard());
                achiCommEntity.setSaleRatio(cashList.getServiceSmallThreeRatio());
                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));
                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));


                //判断卡付业绩是否为固定金额
                if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                    //卡付业绩按固定金额计算
                    //计算卡付业绩
                    achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));

                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                    }

                }else{
                    //卡付业绩比例计算
                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));

                    //计算卡付提成
                    //判断卡付提成是否为固定金额
                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
                        //提成按固定金额算
                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                    }else{
                        //提成按百分百
                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                    }
                }
                if(null == achiCommEntity.getCashAchi()){
                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardAchi() ){
                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCashComm()){
                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
                }
                if(null == achiCommEntity.getCardComm()){
                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
                }
                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
                entities.add(achiCommEntity);
            }
        }



        return entities;
    }
//    //升级后修改的新业绩提成算法
//    public List<AchiCommEntity> getAchiCommLists(CashList cashList){
//        List<AchiCommEntity> entities = new ArrayList<>();
//        BigDecimal hundredBD = com.ssm.manage.utils.BigDecimalUtils.bigDecimal("100");
//        //减掉固定金额业绩的单据总金额
//        BigDecimal totalMeony = cashList.getCashAmount();
//        //减掉固定金额业绩的单据现付金额
//        BigDecimal achievementMeony = cashList.getCollectionCashAmount();
//        //减掉固定金额业绩的单据卡付金额
////        BigDecimal cardMeony = cashList.getCollectionRechargeAmount();
//        BigDecimal bigDecimal = BigDecimal.valueOf(Double.valueOf(cashList.getCollectionAmount()));
//        BigDecimal cardMeony =bigDecimal.subtract(cashList.getCollectionCashAmount());
//
//        //存在卡付，也存在现付
//        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1){
//            //判断大工是否存在
//            if(null != cashList.getServiceLargeOneStaffId() || null != cashList.getServiceLargeTwoStaffId() || null != cashList.getServiceLargeThreeStaffId()){
//                //判断卡付和现付是否同时存在
//                if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1 &&cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                    HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementLarge(), cashList.getAchievementLarge());
//                    achievementMeony= BigDecimalUtils.subtract(achievementMeony,fixedAmount.get("cash"));
//                    cardMeony= BigDecimalUtils.subtract(cardMeony,fixedAmount.get("card"));
//
//                    totalMeony= BigDecimalUtils.subtract(totalMeony,fixedAmount.get("total"));
//                }else{
//                    //判断现付业绩是否为固定金额
//                    if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                        achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementLarge());
//
//
//                        totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementLarge());
//                    }
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                        cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementLarge());
//                        totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementLarge());
//                    }
//                }
//
//            }
//
//            //判断中工是否存在
//            if(null != cashList.getServiceZhonggongOneStaffId() || null != cashList.getServiceZhonggongTwoStaffId() || null != cashList.getServiceZhonggongThreeStaffId()){
//                //判断卡付和现付是否同时存在
//                if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1 &&cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                    HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementZhonggong(), cashList.getAchievementZhonggong());
//                    achievementMeony = BigDecimalUtils.subtract(achievementMeony, fixedAmount.get("cash"));
//                    cardMeony = BigDecimalUtils.subtract(cardMeony, fixedAmount.get("card"));
//
//                    totalMeony = BigDecimalUtils.subtract(totalMeony, fixedAmount.get("total"));
//                }else{
//                    if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                        achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementZhonggong());
//                        totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementZhonggong());
//                    }
//                    if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                        cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementZhonggong());
//                        totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementZhonggong());
//                    }
//                }
//            }
//
//            //判断小工（技师）是否存在
//            if(null != cashList.getServiceTechnicianOneStaffId() || null != cashList.getServiceTechnicianTwoStaffId() || null != cashList.getServiceTechnicianThreeStaffId()){
//                if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1 && cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                    HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementTechnician(), cashList.getAchievementTechnician());
//                    achievementMeony = BigDecimalUtils.subtract(achievementMeony, fixedAmount.get("cash"));
//                    cardMeony = BigDecimalUtils.subtract(cardMeony, fixedAmount.get("card"));
//
//                    totalMeony = BigDecimalUtils.subtract(totalMeony, fixedAmount.get("total"));
//                }else{
//                    if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                        achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementTechnician());
//                        totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementTechnician());
//                    }
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                        cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementTechnician());
//                        totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementTechnician());
//                    }
//                }
//            }
//
//            //判断助理是否存在
//            if(null != cashList.getServiceSmallOneStaffId() || null != cashList.getServiceSmallTwoStaffId() || null != cashList.getServiceSmallThreeStaffId()){
//                if( cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1 && cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                    HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementSmall(), cashList.getAchievementSmall());
//                    achievementMeony = BigDecimalUtils.subtract(achievementMeony, fixedAmount.get("cash"));
//                    cardMeony = BigDecimalUtils.subtract(cardMeony, fixedAmount.get("card"));
//
//                    totalMeony = BigDecimalUtils.subtract(totalMeony, fixedAmount.get("total"));
//                }else{
//                    if(cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                        achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementSmall());
//                        totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementSmall());
//                    }
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                        cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementSmall());
//                        totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementSmall());
//                    }
//                }
//
//
//            }
//
//            //大工1编码
//            if (null != cashList.getServiceLargeOneStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
//                achiCommEntity.setSaleAchievementAmount(cashList.getAchievementLarge());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(
//                        BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementLarge(), cashList.getAchievementLarge());
//                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                    }else{
//                        achiCommEntity.setCashAchi(cashList.getAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                    }
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                        }
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                    }
//
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                        }
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                            }
//
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                        }
//
//                    }else{
//                        //卡付业绩比例计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony,cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                        }
//                    }
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                        }
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                    }
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                        }
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                        }
//                    }else{
//                        //卡付业绩比例计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                        }
//                    }
//                }
//
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(
////                    BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //大工2编码
//            if (null != cashList.getServiceLargeTwoStaffId()){
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//                //判断现付业绩是否为固定金额
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementLarge(), cashList.getAchievementLarge());
//                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                    }else{
//                        achiCommEntity.setCashAchi(cashList.getAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                    }
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                        }
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                    }
//
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                        }
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                            }
//
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                        }
//
//                    }else{
//                        //卡付业绩比例计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                        }
//                    }
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                        }
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                    }
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                        }
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                        }
//                    }else{
//                        //卡付业绩比例计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                        }
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //大工3编码
//            if (null != cashList.getServiceLargeThreeStaffId()){
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//                //判断现付业绩是否为固定金额
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementLarge(), cashList.getAchievementLarge());
//                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                    }else{
//                        achiCommEntity.setCashAchi(cashList.getAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                    }
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                        }
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                    }
//
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                        }
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                            }
//
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                        }
//
//                    }else{
//                        //卡付业绩比例计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                        }
//                    }
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                        }
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                    }
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                        }
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                        }
//                    }else{
//                        //卡付业绩比例计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionLarge(), cashList.getCommissionLarge());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                        }
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //中工1编码
//            if (null != cashList.getServiceZhonggongOneStaffId()){
//
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(
//                        BigDecimalUtils.add(
//                                BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),
//                                        BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                                BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),
//                                        BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementZhonggong(), cashList.getAchievementZhonggong());
//                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                    }else{
//                        achiCommEntity.setCashAchi(cashList.getAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                    }
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                        }
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                    }
//
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                        }
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                            }
//
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                        }
//
//                    }else{
//                        //卡付业绩比例计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                        }
//                    }
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                        }
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                    }
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                        }
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                        }
//                    }else{
//                        //卡付业绩百分比计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                        }
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(
////                    BigDecimalUtils.add(
////                        BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),
////                            BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
////                            BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),
////                            BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //中工2编码
//            if (null != cashList.getServiceZhonggongTwoStaffId()){
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementZhonggong(), cashList.getAchievementZhonggong());
//                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                    }else{
//                        achiCommEntity.setCashAchi(cashList.getAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                    }
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                        }
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                    }
//
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                        }
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                            }
//
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                        }
//
//                    }else{
//                        //卡付业绩比例计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                        }
//                    }
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                        }
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                    }
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                        }
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                        }
//                    }else{
//                        //卡付业绩百分比计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                        }
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //中工3编码
//            if (null != cashList.getServiceZhonggongThreeStaffId()){
//
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementZhonggong(), cashList.getAchievementZhonggong());
//                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                    }else{
//                        achiCommEntity.setCashAchi(cashList.getAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                    }
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                        }
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                    }
//
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                        }
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                            }
//
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                        }
//
//                    }else{
//                        //卡付业绩比例计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                        }
//                    }
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                        }
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                    }
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                        }
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                        }
//                    }else{
//                        //卡付业绩百分比计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionZhonggong(), cashList.getCommissionZhonggong());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                        }
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
//
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //技师1编码
//            if (null != cashList.getServiceTechnicianOneStaffId()){
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getTechnicianOneNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianOneStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianOneStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianOneIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianOneRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementTechnician(), cashList.getAchievementTechnician());
//                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                    }else{
//                        achiCommEntity.setCashAchi(cashList.getAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                    }
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                        }
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                    }
//
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                        }
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                            }
//
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                        }
//
//                    }else{
//                        //卡付业绩比例计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                        }
//                    }
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                        }
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                    }
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                        }
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                        }
//                    }else{
//                        //卡付业绩百分比计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                        }
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
//                entities.add(achiCommEntity);
//            }
//            //技师2编码
//            if (null != cashList.getServiceTechnicianTwoStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getTechnicianTwoNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianTwoStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianTwoStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianTwoIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianTwoRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementTechnician(), cashList.getAchievementTechnician());
//                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                    }else{
//                        achiCommEntity.setCashAchi(cashList.getAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                    }
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                        }
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                    }
//
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                        }
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                            }
//
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                        }
//
//                    }else{
//                        //卡付业绩比例计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                        }
//                    }
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                        }
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                    }
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                        }
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                        }
//                    }else{
//                        //卡付业绩百分比计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                        }
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//            //技师3编码
//            if (null != cashList.getServiceTechnicianThreeStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getTechnicianThreeNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianThreeStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianThreeStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianThreeIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianThreeRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));
//
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementTechnician(), cashList.getAchievementTechnician());
//                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                    }else{
//                        achiCommEntity.setCashAchi(cashList.getAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                    }
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                        }
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                    }
//
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                        }
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                            }
//
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                        }
//
//                    }else{
//                        //卡付业绩比例计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                        }
//                    }
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                        }
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                    }
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                        }
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                        }
//                    }else{
//                        //卡付业绩百分比计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionTechnician(), cashList.getCommissionTechnician());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                        }
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//            //助理1编码
//            if (null != cashList.getServiceSmallOneStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getSmallOneNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceSmallOneStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceSmallOneStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallOneIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceSmallOneRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementSmall(), cashList.getAchievementSmall());
//                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                    }else{
//                        achiCommEntity.setCashAchi(cashList.getAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                    }
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                        }
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                    }
//
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                        }
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                            }
//
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                        }
//
//                    }else{
//                        //卡付业绩比例计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                        }
//                    }
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                        }
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                    }
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                        }
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                        }
//                    }else{
//                        //卡付业绩百分比计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                        }
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//            //助理2编码
//            if (null != cashList.getServiceSmallTwoStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getSmallTwoNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceSmallTwoStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceSmallTwoStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallTwoIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceSmallTwoRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementSmall(), cashList.getAchievementSmall());
//                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                    }else{
//                        achiCommEntity.setCashAchi(cashList.getAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                    }
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                        }
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                    }
//
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                        }
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                            }
//
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                        }
//
//                    }else{
//                        //卡付业绩比例计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                        }
//                    }
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                        }
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                    }
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                        }
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                        }
//                    }else{
//                        //卡付业绩百分比计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                        }
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//            //助理3编码
//            if (null != cashList.getServiceSmallThreeStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getSmallThreeNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceSmallThreeStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceSmallThreeStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallThreeIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceSmallThreeRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));
//
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardAchievementSmall(), cashList.getAchievementSmall());
//                        achiCommEntity.setCashAchi(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                    }else{
//                        achiCommEntity.setCashAchi(cashList.getAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                    }
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                        }
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                    }
//
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                        }
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                            }
//
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                        }
//
//                    }else{
//                        //卡付业绩比例计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                        }
//                    }
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                            achiCommEntity.setCashComm(fixedAmount.get("cash").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                        }
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                    }
//                    //判断卡付业绩是否为固定金额
//                    if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //卡付业绩按固定金额计算
//                        //计算卡付业绩
//                        if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                            HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                            achiCommEntity.setCardAchi(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                        }else{
//                            achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                        }
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                        }
//                    }else{
//                        //卡付业绩百分比计算
//                        achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                        //计算卡付提成
//                        //判断卡付提成是否为固定金额
//                        if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                            //提成按固定金额算
//                            if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 &&cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cardMeony, cashList.getCollectionCashAmount(), cashList.getCardCommissionSmall(), cashList.getCommissionSmall());
//                                achiCommEntity.setCardComm(fixedAmount.get("card").multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                            }else{
//                                achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                            }
//                        }else{
//                            //提成按百分百
//                            achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                        }
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//        }else if(cardMeony.compareTo(BigDecimal.valueOf(0)) == 1){//只有卡付
//            //判断大工是否存在
//            if(null != cashList.getServiceLargeOneStaffId() || null != cashList.getServiceLargeTwoStaffId() || null != cashList.getServiceLargeThreeStaffId()){
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementLarge());
//                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementLarge());
//                }
//            }
//
//            //判断中工是否存在
//            if(null != cashList.getServiceZhonggongOneStaffId() || null != cashList.getServiceZhonggongTwoStaffId() || null != cashList.getServiceZhonggongThreeStaffId()){
//                if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementZhonggong());
//                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementZhonggong());
//                }
//            }
//
//            //判断小工（技师）是否存在
//            if(null != cashList.getServiceTechnicianOneStaffId() || null != cashList.getServiceTechnicianTwoStaffId() || null != cashList.getServiceTechnicianThreeStaffId()){
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementTechnician());
//                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementTechnician());
//                }
//            }
//
//            //判断助理是否存在
//            if(null != cashList.getServiceSmallOneStaffId() || null != cashList.getServiceSmallTwoStaffId() || null != cashList.getServiceSmallThreeStaffId()){
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementSmall());
//                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementSmall());
//                }
//            }
//
//            //大工1编码
//            if (null != cashList.getServiceLargeOneStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
//                achiCommEntity.setSaleAchievementAmount(cashList.getAchievementLarge());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(
//                        BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                    }
//                }
//
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(
////                    BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //大工2编码
//            if (null != cashList.getServiceLargeTwoStaffId()){
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //大工3编码
//            if (null != cashList.getServiceLargeThreeStaffId()){
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //中工1编码
//            if (null != cashList.getServiceZhonggongOneStaffId()){
//
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(
//                        BigDecimalUtils.add(
//                                BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),
//                                        BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                                BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),
//                                        BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(
////                    BigDecimalUtils.add(
////                        BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),
////                            BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
////                            BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),
////                            BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //中工2编码
//            if (null != cashList.getServiceZhonggongTwoStaffId()){
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //中工3编码
//            if (null != cashList.getServiceZhonggongThreeStaffId()){
//
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//
//                //判断现付业绩是否为固定金额
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
//
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //技师1编码
//            if (null != cashList.getServiceTechnicianOneStaffId()){
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getTechnicianOneNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianOneStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianOneStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianOneIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianOneRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));
//
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
//                entities.add(achiCommEntity);
//            }
//            //技师2编码
//            if (null != cashList.getServiceTechnicianTwoStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getTechnicianTwoNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianTwoStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianTwoStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianTwoIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianTwoRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));
//
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//            //技师3编码
//            if (null != cashList.getServiceTechnicianThreeStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getTechnicianThreeNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianThreeStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianThreeStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianThreeIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianThreeRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));
//
//
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//            //助理1编码
//            if (null != cashList.getServiceSmallOneStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getSmallOneNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceSmallOneStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceSmallOneStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallOneIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceSmallOneRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));
//
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//            //助理2编码
//            if (null != cashList.getServiceSmallTwoStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getSmallTwoNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceSmallTwoStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceSmallTwoStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallTwoIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceSmallTwoRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));
//
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//            //助理3编码
//            if (null != cashList.getServiceSmallThreeStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getSmallThreeNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceSmallThreeStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceSmallThreeStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallThreeIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceSmallThreeRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));
//
//
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//        }else if(cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1) {//只有现付
//            //判断大工是否存在
//            if(null != cashList.getServiceLargeOneStaffId() || null != cashList.getServiceLargeTwoStaffId() || null != cashList.getServiceLargeThreeStaffId()){
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementLarge());
//                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementLarge());
//                }
//            }
//
//            //判断中工是否存在
//            if(null != cashList.getServiceZhonggongOneStaffId() || null != cashList.getServiceZhonggongTwoStaffId() || null != cashList.getServiceZhonggongThreeStaffId()){
//                if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementZhonggong());
//                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementZhonggong());
//                }
//            }
//
//            //判断小工（技师）是否存在
//            if(null != cashList.getServiceTechnicianOneStaffId() || null != cashList.getServiceTechnicianTwoStaffId() || null != cashList.getServiceTechnicianThreeStaffId()){
//                if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementTechnician());
//                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementTechnician());
//                }
//            }
//
//            //判断助理是否存在
//            if(null != cashList.getServiceSmallOneStaffId() || null != cashList.getServiceSmallTwoStaffId() || null != cashList.getServiceSmallThreeStaffId()){
//                if(cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementSmall());
//                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementSmall());
//                }
//            }
//
//            //大工1编码
//            if (null != cashList.getServiceLargeOneStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
//                achiCommEntity.setSaleAchievementAmount(cashList.getAchievementLarge());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(
//                        BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    achiCommEntity.setCashAchi(cashList.getAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                    }
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                    }
//                }
//
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(
////                    BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //大工2编码
//            if (null != cashList.getServiceLargeTwoStaffId()){
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//                //判断现付业绩是否为固定金额
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    achiCommEntity.setCashAchi(cashList.getAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                    }
//
//
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //大工3编码
//            if (null != cashList.getServiceLargeThreeStaffId()){
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//                //判断现付业绩是否为固定金额
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    achiCommEntity.setCashAchi(cashList.getAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                    }
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionLarge()),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //中工1编码
//            if (null != cashList.getServiceZhonggongOneStaffId()){
//
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(
//                        BigDecimalUtils.add(
//                                BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),
//                                        BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                                BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),
//                                        BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    achiCommEntity.setCashAchi(cashList.getAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                    }
//
//
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                    }
//
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(
////                    BigDecimalUtils.add(
////                        BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),
////                            BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
////                            BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),
////                            BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //中工2编码
//            if (null != cashList.getServiceZhonggongTwoStaffId()){
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    achiCommEntity.setCashAchi(cashList.getAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                    }
//
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //中工3编码
//            if (null != cashList.getServiceZhonggongThreeStaffId()){
//
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    achiCommEntity.setCashAchi(cashList.getAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                    }
//
//
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionZhonggong()),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                    }
//
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
//
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //技师1编码
//            if (null != cashList.getServiceTechnicianOneStaffId()){
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getTechnicianOneNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianOneStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianOneStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianOneIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianOneRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    achiCommEntity.setCashAchi(cashList.getAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                    }
//
//
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                    }
//
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
//                entities.add(achiCommEntity);
//            }
//            //技师2编码
//            if (null != cashList.getServiceTechnicianTwoStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getTechnicianTwoNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianTwoStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianTwoStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianTwoIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianTwoRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    achiCommEntity.setCashAchi(cashList.getAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                    }
//
//
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                    }
//
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//            //技师3编码
//            if (null != cashList.getServiceTechnicianThreeStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getTechnicianThreeNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianThreeStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianThreeStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianThreeIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianThreeRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));
//
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    achiCommEntity.setCashAchi(cashList.getAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                    }
//
//
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionTechnician()),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                    }
//
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//            //助理1编码
//            if (null != cashList.getServiceSmallOneStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getSmallOneNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceSmallOneStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceSmallOneStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallOneIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceSmallOneRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    achiCommEntity.setCashAchi(cashList.getAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                    }
//
//
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//            //助理2编码
//            if (null != cashList.getServiceSmallTwoStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getSmallTwoNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceSmallTwoStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceSmallTwoStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallTwoIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceSmallTwoRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    achiCommEntity.setCashAchi(cashList.getAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                    }
//
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//            //助理3编码
//            if (null != cashList.getServiceSmallThreeStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getSmallThreeNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceSmallThreeStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceSmallThreeStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallThreeIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceSmallThreeRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));
//
//
//                //判断现付业绩是否为固定金额
//                if(cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){ //=计算固定金额
//                    //计算现付业绩
//                    //判断是否存在卡付和现付并且卡付业绩也是固定金额
//                    achiCommEntity.setCashAchi(cashList.getAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                    }
//
//
//                }else{ //计算百分百
//                    //计算现付业绩
//                    achiCommEntity.setCashAchi(BigDecimalUtils.multiply(achievementMeony,cashList.getAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//
//                    //计算现付提成
//                    //判断现付提成是否为百分百还是固定金额
//                    if(cashList.getCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1) {//a大于b//业绩提成比例> 1=固定金额
//                        //判断是否存在卡付和现付并且卡付提出也是固定金额
//                        achiCommEntity.setCashComm(cashList.getCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                    }else{//百分百
//                        achiCommEntity.setCashComm(BigDecimalUtils.multiply(BigDecimalUtils.multiply(achiCommEntity.getCashAchi(),cashList.getCommissionSmall()),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                    }
//
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//        }
//
//
//
//        return entities;
//    }
//
//    //升级后修改的新疗程消费业绩提成算法
//    public List<AchiCommEntity> getAchiCommListsCard(CashList cashList){
//        List<AchiCommEntity> entities = new ArrayList<>();
//        BigDecimal hundredBD = com.ssm.manage.utils.BigDecimalUtils.bigDecimal("100");
//        //减掉固定金额业绩的单据总金额
//        BigDecimal totalMeony = cashList.getCashAmount();
//        //减掉固定金额业绩的单据卡付金额
//        BigDecimal bigDecimal = BigDecimal.valueOf(Double.valueOf(cashList.getCollectionAmount()));
//        //BigDecimal cardMeony =bigDecimal.subtract(cashList.getCollectionCashAmount());
//        BigDecimal cardMeony =totalMeony;
//
//        //存在卡付，也存在现付
//        if(cashList.getCashAmount().compareTo(BigDecimal.valueOf(0)) == 1){//只有卡付
//            //判断大工是否存在
//            if(null != cashList.getServiceLargeOneStaffId() || null != cashList.getServiceLargeTwoStaffId() || null != cashList.getServiceLargeThreeStaffId()){
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementLarge());
//                }
//            }
//
//            //判断中工是否存在
//            if(null != cashList.getServiceZhonggongOneStaffId() || null != cashList.getServiceZhonggongTwoStaffId() || null != cashList.getServiceZhonggongThreeStaffId()){
//                if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementZhonggong());
//                }
//            }
//
//            //判断小工（技师）是否存在
//            if(null != cashList.getServiceTechnicianOneStaffId() || null != cashList.getServiceTechnicianTwoStaffId() || null != cashList.getServiceTechnicianThreeStaffId()){
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementTechnician());
//                }
//            }
//
//            //判断助理是否存在
//            if(null != cashList.getServiceSmallOneStaffId() || null != cashList.getServiceSmallTwoStaffId() || null != cashList.getServiceSmallThreeStaffId()){
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementSmall());
//                }
//            }
//
//            //大工1编码
//            if (null != cashList.getServiceLargeOneStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setOrderType("card");
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
//                achiCommEntity.setSaleAchievementAmount(cashList.getAchievementLarge());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(
//                        BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//                    }
//                }
//
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(
////                    BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //大工2编码
//            if (null != cashList.getServiceLargeTwoStaffId()){
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setOrderType("card");
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //大工3编码
//            if (null != cashList.getServiceLargeThreeStaffId()){
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setOrderType("card");
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionLarge().multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionLarge()).multiply(BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //中工1编码
//            if (null != cashList.getServiceZhonggongOneStaffId()){
//
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setOrderType("card");
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(
//                        BigDecimalUtils.add(
//                                BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),
//                                        BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                                BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),
//                                        BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(
////                    BigDecimalUtils.add(
////                        BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),
////                            BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
////                            BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),
////                            BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //中工2编码
//            if (null != cashList.getServiceZhonggongTwoStaffId()){
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setOrderType("card");
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //中工3编码
//            if (null != cashList.getServiceZhonggongThreeStaffId()){
//
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setOrderType("card");
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//
//                //判断现付业绩是否为固定金额
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionZhonggong().multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionZhonggong()).multiply(BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//                entities.add(achiCommEntity);
//
//
//
////            AchiCommEntity achiCommEntity = new AchiCommEntity();
////            achiCommEntity.setDocNum(cashList.getCashNum());
////            achiCommEntity.setDocType(Constant.doc_type_store_cash);
////            achiCommEntity.setDocDate(cashList.getCashDate());
////            achiCommEntity.setTradeName(cashList.getProjectName());
////            achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
////            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
////            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
////            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
////            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
////            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
////            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
////                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
////            entities.add(achiCommEntity);
//            }
//            //技师1编码
//            if (null != cashList.getServiceTechnicianOneStaffId()){
//
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setOrderType("card");
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getTechnicianOneNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianOneStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianOneStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianOneIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianOneRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));
//
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
//                entities.add(achiCommEntity);
//            }
//            //技师2编码
//            if (null != cashList.getServiceTechnicianTwoStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setOrderType("card");
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getTechnicianTwoNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianTwoStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianTwoStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianTwoIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianTwoRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));
//
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//            //技师3编码
//            if (null != cashList.getServiceTechnicianThreeStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setOrderType("card");
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getTechnicianThreeNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianThreeStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianThreeStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianThreeIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceTechnicianThreeRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));
//
//
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionTechnician().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionTechnician().multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionTechnician()).multiply(BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//            //助理1编码
//            if (null != cashList.getServiceSmallOneStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setOrderType("card");
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getSmallOneNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceSmallOneStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceSmallOneStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallOneIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceSmallOneRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));
//
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//            //助理2编码
//            if (null != cashList.getServiceSmallTwoStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setOrderType("card");
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getSmallTwoNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceSmallTwoStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceSmallTwoStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallTwoIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceSmallTwoRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));
//
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//            //助理3编码
//            if (null != cashList.getServiceSmallThreeStaffId()){
//                AchiCommEntity achiCommEntity = new AchiCommEntity();
//                achiCommEntity.setMoney(cashList.getCashAmount());
//                achiCommEntity.setMemberNum(String.valueOf(cashList.getMemberId()));
//                achiCommEntity.setMemberName(cashList.getMemberName());
//                achiCommEntity.setProjectId(String.valueOf(cashList.getProjectId()));
//                achiCommEntity.setDocNum(cashList.getCashNum());
//                achiCommEntity.setDocType(Constant.doc_type_store_cash);
//                achiCommEntity.setOrderType("card");
//                achiCommEntity.setDocDate(cashList.getCashDate());
//                achiCommEntity.setTradeName(cashList.getProjectName());
//                achiCommEntity.setBrandNumber(cashList.getSmallThreeNumber());
//                achiCommEntity.setSaleStaffId(cashList.getServiceSmallThreeStaffId());
//                achiCommEntity.setSaleStaffName(cashList.getServiceSmallThreeStaffName());
//                achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallThreeIdentityCard());
//                achiCommEntity.setSaleRatio(cashList.getServiceSmallThreeRatio());
//                achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));
//                achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
//                        BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));
//
//
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                    //卡付业绩按固定金额计算
//                    //计算卡付业绩
//                    achiCommEntity.setCardAchi(cashList.getCardAchievementSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                    }
//
//                }else{
//                    //卡付业绩比例计算
//                    achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cardMeony,cashList.getCardAchievementSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//
//                    //计算卡付提成
//                    //判断卡付提成是否为固定金额
//                    if(cashList.getCardCommissionSmall().compareTo(BigDecimal.valueOf(1)) == 1){
//                        //提成按固定金额算
//                        achiCommEntity.setCardComm(cashList.getCardCommissionSmall().multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                    }else{
//                        //提成按百分百
//                        achiCommEntity.setCardComm(BigDecimalUtils.multiply(achiCommEntity.getCardAchi(),cashList.getCardCommissionSmall()).multiply(BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                    }
//                }
//                if(null == achiCommEntity.getCashAchi()){
//                    achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardAchi() ){
//                    achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCashComm()){
//                    achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//                }
//                if(null == achiCommEntity.getCardComm()){
//                    achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//                }
//                achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//                achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
////            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
////            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
////            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
////            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//                entities.add(achiCommEntity);
//            }
//        }
//
//
//
//        return entities;
//    }

    @Override
    public List<RefundCashResponse> selectLists(Long storeId, String startDate, String endDate){
//        Example example = new Example(RefundCash.class);
//        Example.Criteria criteria = example.createCriteria();
//        criteria.andLike("refundDate",date + "%");
//        criteria.andEqualTo("storeId", storeId);
        RefundOrderResquest refundOrderResquest = new RefundOrderResquest();
        refundOrderResquest.setStoreId(storeId);
        try {
            refundOrderResquest.setStartTime(DateUtils.YMDParse(startDate));
            refundOrderResquest.setEndTime(DateUtils.YMDParse(endDate));
        } catch (ParseException e) {
            e.printStackTrace();
        }
        refundOrderResquest.setState(3);
        List<RefundCash> list = dao.selectLists(refundOrderResquest);
        List<RefundCashResponse> cashResponses = new ArrayList<>();
        for (RefundCash cash : list) {
            RefundCashResponse refundCashResponse = new RefundCashResponse();
            BeanUtils.copyProperties(cash, refundCashResponse);
            //设置业务人员列表
            List<AchiCommEntity> entities = this.getAchiCommList(cash);
            refundCashResponse.setEntities(entities);

            cashResponses.add(refundCashResponse);
        }
        return cashResponses;
    }
    @Autowired
    private RefundCashMapper mapper;

    @Override
    public List<RefundCash> selectListNew(RefundCashReqest refundCashReqest) {

        return mapper.selectNew(refundCashReqest);
    }

    @Override
    public List<RefundCash> selectFKJByRefundCashGifMoney(StoreDailyRequest storeDailyRequest) {
        return mapper.selectFKJByRefundCashGifMoney(storeDailyRequest);
    }

    private HashMap<String, BigDecimal> getFixedAmount(BigDecimal CardAmount,BigDecimal CashAmount,BigDecimal Cardyj,BigDecimal Cashyj ){

        HashMap<String, BigDecimal> map = new HashMap<>();
        //卡付业绩
        BigDecimal multiply = BigDecimalUtils.multiply(CardAmount.divide(CardAmount.add(CashAmount)), Cardyj);
        //现付业绩
        BigDecimal multiplys = BigDecimalUtils.multiply(CashAmount.divide(CardAmount.add(CashAmount)), Cashyj);

        //总的业绩
        BigDecimal add = multiply.add(multiplys);
        map.put("card",multiply);
        map.put("cash",multiplys);
        map.put("total",add);
        return map;

    };


    /*
     * 设置业务员
     * */
    public RefundCash setStaffValue(List<StaffRequest> largeList, List<StaffRequest> zhonggongList, List<StaffRequest> technicianList, List<StaffRequest> smallList, RefundCash cashList){
        //大工
        if (null != largeList && largeList.size() > 0){
            for (int i = 0; i < largeList.size(); i++) {
                StaffRequest staffRequest = largeList.get(i);
                if (i == 0){
                    cashList.setServiceLargeOneStaffId(staffRequest.getId());
                    cashList.setServiceLargeOneStaffName(staffRequest.getStaffName());
                    cashList.setServiceLargeOneIdentityCard(staffRequest.getIdentityCard());
                    cashList.setServiceLargeOneRatio(staffRequest.getRatio());
                    cashList.setLargeOneNumber(staffRequest.getBrandNumber());
                }else if (i == 1){
                    cashList.setServiceLargeTwoStaffId(staffRequest.getId());
                    cashList.setServiceLargeTwoStaffName(staffRequest.getStaffName());
                    cashList.setServiceLargeTwoIdentityCard(staffRequest.getIdentityCard());
                    cashList.setServiceLargeTwoRatio(staffRequest.getRatio());
                    cashList.setLargeTwoNumber(staffRequest.getBrandNumber());
                }else if (i == 2){
                    cashList.setServiceLargeThreeStaffId(staffRequest.getId());
                    cashList.setServiceLargeThreeStaffName(staffRequest.getStaffName());
                    cashList.setServiceLargeThreeIdentityCard(staffRequest.getIdentityCard());
                    cashList.setServiceLargeThreeRatio(staffRequest.getRatio());
                    cashList.setLargeThreeNumber(staffRequest.getBrandNumber());
                }
            }
        }
        //中工
        if (null != zhonggongList&& zhonggongList.size() > 0){
            for (int i = 0; i < zhonggongList.size(); i++) {
                StaffRequest staffRequest = zhonggongList.get(i);
                if (i == 0){
                    cashList.setServiceZhonggongOneStaffId(staffRequest.getId());
                    cashList.setServiceZhonggongOneStaffName(staffRequest.getStaffName());
                    cashList.setServiceZhonggongOneIdentityCard(staffRequest.getIdentityCard());
                    cashList.setServiceZhonggongOneRatio(staffRequest.getRatio());
                    cashList.setZhonggongOneNumber(staffRequest.getBrandNumber());
                }else if (i == 1){
                    cashList.setServiceZhonggongTwoStaffId(staffRequest.getId());
                    cashList.setServiceZhonggongTwoStaffName(staffRequest.getStaffName());
                    cashList.setServiceZhonggongTwoIdentityCard(staffRequest.getIdentityCard());
                    cashList.setServiceZhonggongTwoRatio(staffRequest.getRatio());
                    cashList.setZhonggongTwoNumber(staffRequest.getBrandNumber());
                }else if (i == 2){
                    cashList.setServiceZhonggongThreeStaffId(staffRequest.getId());
                    cashList.setServiceZhonggongThreeStaffName(staffRequest.getStaffName());
                    cashList.setServiceZhonggongThreeIdentityCard(staffRequest.getIdentityCard());
                    cashList.setServiceZhonggongThreeRatio(staffRequest.getRatio());
                    cashList.setZhonggongThreeNumber(staffRequest.getBrandNumber());
                }
            }
        }
        //技师
        if (null != technicianList&& technicianList.size() > 0){
            for (int i = 0; i < technicianList.size(); i++) {
                StaffRequest staffRequest = technicianList.get(i);
                if (i == 0){
                    cashList.setServiceTechnicianOneStaffId(staffRequest.getId());
                    cashList.setServiceTechnicianOneStaffName(staffRequest.getStaffName());
                    cashList.setServiceTechnicianOneIdentityCard(staffRequest.getIdentityCard());
                    cashList.setServiceTechnicianOneRatio(staffRequest.getRatio());
                    cashList.setTechnicianOneNumber(staffRequest.getBrandNumber());
                }else if (i == 1){
                    cashList.setServiceTechnicianTwoStaffId(staffRequest.getId());
                    cashList.setServiceTechnicianTwoStaffName(staffRequest.getStaffName());
                    cashList.setServiceTechnicianTwoIdentityCard(staffRequest.getIdentityCard());
                    cashList.setServiceTechnicianTwoRatio(staffRequest.getRatio());
                    cashList.setTechnicianTwoNumber(staffRequest.getBrandNumber());
                }else if (i == 2){
                    cashList.setServiceTechnicianThreeStaffId(staffRequest.getId());
                    cashList.setServiceTechnicianThreeStaffName(staffRequest.getStaffName());
                    cashList.setServiceTechnicianThreeIdentityCard(staffRequest.getIdentityCard());
                    cashList.setServiceTechnicianThreeRatio(staffRequest.getRatio());
                    cashList.setTechnicianThreeNumber(staffRequest.getBrandNumber());
                }
            }
        }

        //小工
        if (null != smallList&& smallList.size() > 0){
            for (int i = 0; i < smallList.size(); i++) {
                StaffRequest staffRequest = smallList.get(i);
                if (i == 0){
                    cashList.setServiceSmallOneStaffId(staffRequest.getId());
                    cashList.setServiceSmallOneStaffName(staffRequest.getStaffName());
                    cashList.setServiceSmallOneIdentityCard(staffRequest.getIdentityCard());
                    cashList.setServiceSmallOneRatio(staffRequest.getRatio());
                    cashList.setSmallOneNumber(staffRequest.getBrandNumber());
                }else if (i == 1){
                    cashList.setServiceSmallTwoStaffId(staffRequest.getId());
                    cashList.setServiceSmallTwoStaffName(staffRequest.getStaffName());
                    cashList.setServiceSmallTwoIdentityCard(staffRequest.getIdentityCard());
                    cashList.setServiceSmallTwoRatio(staffRequest.getRatio());
                    cashList.setSmallTwoNumber(staffRequest.getBrandNumber());
                }else if (i == 2){
                    cashList.setServiceSmallThreeStaffId(staffRequest.getId());
                    cashList.setServiceSmallThreeStaffName(staffRequest.getStaffName());
                    cashList.setServiceSmallThreeIdentityCard(staffRequest.getIdentityCard());
                    cashList.setServiceSmallThreeRatio(staffRequest.getRatio());
                    cashList.setSmallThreeNumber(staffRequest.getBrandNumber());
                }
            }
        }
        return cashList;
    }

    public RefundCash setAchiComm(RefundCash refundCash, RefundCashReqest refundCashReqest) {
        //业绩标准
        BigDecimal largeRatio = refundCash.getAchievementLarge();
        BigDecimal zhonggongRatio = refundCash.getAchievementZhonggong();
        BigDecimal technicianRatio = refundCash.getAchievementTechnician();
        BigDecimal smallRatio = refundCash.getAchievementSmall();
        //提成标准
        BigDecimal largeCommRatio = refundCash.getCommissionLarge();
        BigDecimal zhonggongCommRatio = refundCash.getCommissionZhonggong();
        BigDecimal technicianCommRatio = refundCash.getCommissionTechnician();
        BigDecimal smallCommRatio = refundCash.getCommissionSmall();

        BigDecimal oneBd = BigDecimalUtils.bigDecimal("1");
        if (null != refundCashReqest.getLargeList() && refundCashReqest.getLargeList().size() > 0) {
            //业绩
            if (BigDecimalUtils.compareTo(largeRatio, oneBd) != 1) {
                refundCash.setLargeAchievementAmount(BigDecimalUtils.multiply(BigDecimalUtils.add(refundCash.getCashRefundMoney(), refundCash.getCashCompensation()), largeRatio));
            } else {
                refundCash.setLargeAchievementAmount(largeRatio);
            }
            //提成
            if (BigDecimalUtils.compareTo(largeCommRatio, oneBd) != 1){
                refundCash.setLargeCommissionAmount(BigDecimalUtils.multiply(BigDecimalUtils.multiply(BigDecimalUtils.add(refundCash.getCashRefundMoney(), refundCash.getCashCompensation()),largeRatio),largeCommRatio));
            }else {
                refundCash.setLargeCommissionAmount(largeCommRatio);
            }
        }

        if (null != refundCashReqest.getZhonggongList() && refundCashReqest.getZhonggongList().size() > 0) {
            //业绩
            if (BigDecimalUtils.compareTo(zhonggongRatio, oneBd) != 1) {
                refundCash.setZhonggongAchievementAmount(BigDecimalUtils.multiply(BigDecimalUtils.add(refundCash.getCashRefundMoney(), refundCash.getCashCompensation()), zhonggongRatio));
            } else {
                refundCash.setZhonggongAchievementAmount(zhonggongRatio);
            }
            //提成
            if (BigDecimalUtils.compareTo(zhonggongCommRatio, oneBd) != 1){
                refundCash.setZhonggongCommissionAmount(BigDecimalUtils.multiply(BigDecimalUtils.multiply(BigDecimalUtils.add(refundCash.getCashRefundMoney(), refundCash.getCashCompensation()),zhonggongRatio),zhonggongCommRatio));
            }else {
                refundCash.setZhonggongCommissionAmount(zhonggongCommRatio);
            }
        }

        if (null != refundCashReqest.getTechnicianList() && refundCashReqest.getTechnicianList().size() > 0) {
            //业绩
            if (BigDecimalUtils.compareTo(technicianRatio, oneBd) != 1) {
                refundCash.setTechnicianAchievementAmount(BigDecimalUtils.multiply(BigDecimalUtils.add(refundCash.getCashRefundMoney(), refundCash.getCashCompensation()), technicianRatio));
            } else {
                refundCash.setTechnicianAchievementAmount(technicianRatio);
            }
            //提成
            if (BigDecimalUtils.compareTo(technicianCommRatio, oneBd) != 1){
                refundCash.setTechnicianCommissionAmount(BigDecimalUtils.multiply(BigDecimalUtils.multiply(BigDecimalUtils.add(refundCash.getCashRefundMoney(), refundCash.getCashCompensation()),technicianRatio),technicianCommRatio));
            }else {
                refundCash.setTechnicianCommissionAmount(technicianCommRatio);
            }
        }

        if (null != refundCashReqest.getSmallList() && refundCashReqest.getSmallList().size() > 0) {
            //业绩
            if (BigDecimalUtils.compareTo(smallRatio, oneBd) != 1) {
                refundCash.setSmallAchievementAmount(BigDecimalUtils.multiply(BigDecimalUtils.add(refundCash.getCashRefundMoney(), refundCash.getCashCompensation()), smallRatio));
            } else {
                refundCash.setSmallAchievementAmount(smallRatio);
            }
            //提成
            if (BigDecimalUtils.compareTo(smallCommRatio, oneBd) != 1) {
                refundCash.setSmallCommissionAmount(BigDecimalUtils.multiply(BigDecimalUtils.multiply(BigDecimalUtils.add(refundCash.getCashRefundMoney(), refundCash.getCashCompensation()), smallRatio),smallCommRatio));
            } else {
                refundCash.setSmallCommissionAmount(smallCommRatio);
            }
        }

        return refundCash;
    }

    public List<AchiCommEntity> getAchiCommList(RefundCash cashList){
        List<AchiCommEntity> entities = new ArrayList<>();
        BigDecimal hundredBD = com.ssm.manage.utils.BigDecimalUtils.bigDecimal("100");
        if (null != cashList.getServiceLargeOneStaffId()){
            AchiCommEntity achiCommEntity = new AchiCommEntity();
            achiCommEntity.setDocNum(cashList.getRefundNum());
            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
            achiCommEntity.setDocDate(cashList.getRefundDate());
            achiCommEntity.setTradeName(cashList.getProjectName());
            achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
            achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
            achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
            achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
            if(null == achiCommEntity.getCashAchi()){
                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardAchi() ){
                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCashComm()){
                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardComm()){
                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
            }
            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

            entities.add(achiCommEntity);
        }
        if (null != cashList.getServiceLargeTwoStaffId()){
            AchiCommEntity achiCommEntity = new AchiCommEntity();
            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
            achiCommEntity.setDocDate(cashList.getRefundDate());
            achiCommEntity.setTradeName(cashList.getProjectName());
            achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
            achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
            achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
            achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
            if(null == achiCommEntity.getCashAchi()){
                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardAchi() ){
                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCashComm()){
                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardComm()){
                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
            }
            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

            entities.add(achiCommEntity);
        }
        if (null != cashList.getServiceLargeThreeStaffId()){
            AchiCommEntity achiCommEntity = new AchiCommEntity();
            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
            achiCommEntity.setDocDate(cashList.getRefundDate());
            achiCommEntity.setTradeName(cashList.getProjectName());
            achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
            achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
            achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
            achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
            if(null == achiCommEntity.getCashAchi()){
                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardAchi() ){
                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCashComm()){
                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardComm()){
                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
            }
            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

            entities.add(achiCommEntity);
        }

        if (null != cashList.getServiceZhonggongOneStaffId()){
            AchiCommEntity achiCommEntity = new AchiCommEntity();
            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
            achiCommEntity.setDocDate(cashList.getRefundDate());
            achiCommEntity.setTradeName(cashList.getProjectName());
            achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
            if(null == achiCommEntity.getCashAchi()){
                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardAchi() ){
                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCashComm()){
                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardComm()){
                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
            }
            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

            entities.add(achiCommEntity);
        }
        if (null != cashList.getServiceZhonggongTwoStaffId()){
            AchiCommEntity achiCommEntity = new AchiCommEntity();
            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
            achiCommEntity.setDocDate(cashList.getRefundDate());
            achiCommEntity.setTradeName(cashList.getProjectName());
            achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
            if(null == achiCommEntity.getCashAchi()){
                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardAchi() ){
                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCashComm()){
                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardComm()){
                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
            }
            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

            entities.add(achiCommEntity);
        }
        if (null != cashList.getServiceZhonggongThreeStaffId()){
            AchiCommEntity achiCommEntity = new AchiCommEntity();
            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
            achiCommEntity.setDocDate(cashList.getRefundDate());
            achiCommEntity.setTradeName(cashList.getProjectName());
            achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
            if(null == achiCommEntity.getCashAchi()){
                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardAchi() ){
                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCashComm()){
                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardComm()){
                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
            }
            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

            entities.add(achiCommEntity);
        }
        if (null != cashList.getServiceTechnicianOneStaffId()){
            AchiCommEntity achiCommEntity = new AchiCommEntity();
            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
            achiCommEntity.setDocDate(cashList.getRefundDate());
            achiCommEntity.setTradeName(cashList.getProjectName());
            achiCommEntity.setBrandNumber(cashList.getTechnicianOneNumber());
            achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianOneStaffId());
            achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianOneStaffName());
            achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianOneIdentityCard());
            achiCommEntity.setSaleRatio(cashList.getServiceTechnicianOneRatio());
            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));
            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));
            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
            if(null == achiCommEntity.getCashAchi()){
                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardAchi() ){
                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCashComm()){
                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardComm()){
                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
            }
            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

            entities.add(achiCommEntity);
        }
        if (null != cashList.getServiceTechnicianTwoStaffId()){
            AchiCommEntity achiCommEntity = new AchiCommEntity();
            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
            achiCommEntity.setDocDate(cashList.getRefundDate());
            achiCommEntity.setTradeName(cashList.getProjectName());
            achiCommEntity.setBrandNumber(cashList.getTechnicianTwoNumber());
            achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianTwoStaffId());
            achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianTwoStaffName());
            achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianTwoIdentityCard());
            achiCommEntity.setSaleRatio(cashList.getServiceTechnicianTwoRatio());
            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));
            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));
            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
            if(null == achiCommEntity.getCashAchi()){
                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardAchi() ){
                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCashComm()){
                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardComm()){
                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
            }
            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

            entities.add(achiCommEntity);
        }
        if (null != cashList.getServiceTechnicianThreeStaffId()){
            AchiCommEntity achiCommEntity = new AchiCommEntity();
            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
            achiCommEntity.setDocDate(cashList.getRefundDate());
            achiCommEntity.setTradeName(cashList.getProjectName());
            achiCommEntity.setBrandNumber(cashList.getTechnicianThreeNumber());
            achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianThreeStaffId());
            achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianThreeStaffName());
            achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianThreeIdentityCard());
            achiCommEntity.setSaleRatio(cashList.getServiceTechnicianThreeRatio());
            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));
            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));
            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
            if(null == achiCommEntity.getCashAchi()){
                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardAchi() ){
                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCashComm()){
                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardComm()){
                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
            }
            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

            entities.add(achiCommEntity);
        }
        if (null != cashList.getServiceSmallOneStaffId()){
            AchiCommEntity achiCommEntity = new AchiCommEntity();
            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
            achiCommEntity.setDocDate(cashList.getRefundDate());
            achiCommEntity.setTradeName(cashList.getProjectName());
            achiCommEntity.setBrandNumber(cashList.getSmallOneNumber());
            achiCommEntity.setSaleStaffId(cashList.getServiceSmallOneStaffId());
            achiCommEntity.setSaleStaffName(cashList.getServiceSmallOneStaffName());
            achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallOneIdentityCard());
            achiCommEntity.setSaleRatio(cashList.getServiceSmallOneRatio());
            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));
            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));
            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
            if(null == achiCommEntity.getCashAchi()){
                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardAchi() ){
                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCashComm()){
                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardComm()){
                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
            }
            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

            entities.add(achiCommEntity);
        }
        if (null != cashList.getServiceSmallTwoStaffId()){
            AchiCommEntity achiCommEntity = new AchiCommEntity();
            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
            achiCommEntity.setDocDate(cashList.getRefundDate());
            achiCommEntity.setTradeName(cashList.getProjectName());
            achiCommEntity.setBrandNumber(cashList.getSmallTwoNumber());
            achiCommEntity.setSaleStaffId(cashList.getServiceSmallTwoStaffId());
            achiCommEntity.setSaleStaffName(cashList.getServiceSmallTwoStaffName());
            achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallTwoIdentityCard());
            achiCommEntity.setSaleRatio(cashList.getServiceSmallTwoRatio());
            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));
            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));
            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
            if(null == achiCommEntity.getCashAchi()){
                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardAchi() ){
                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCashComm()){
                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardComm()){
                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
            }
            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

            entities.add(achiCommEntity);
        }
        if (null != cashList.getServiceSmallThreeStaffId()){
            AchiCommEntity achiCommEntity = new AchiCommEntity();
            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
            achiCommEntity.setDocDate(cashList.getRefundDate());
            achiCommEntity.setTradeName(cashList.getProjectName());
            achiCommEntity.setBrandNumber(cashList.getSmallThreeNumber());
            achiCommEntity.setSaleStaffId(cashList.getServiceSmallThreeStaffId());
            achiCommEntity.setSaleStaffName(cashList.getServiceSmallThreeStaffName());
            achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallThreeIdentityCard());
            achiCommEntity.setSaleRatio(cashList.getServiceSmallThreeRatio());
            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));
            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
                    BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));
            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
            if(null == achiCommEntity.getCashAchi()){
                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardAchi() ){
                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCashComm()){
                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
            }
            if(null == achiCommEntity.getCardComm()){
                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
            }
            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));

            entities.add(achiCommEntity);
        }
        return entities;
    }

//    public List<AchiCommEntity> getAchiCommLists(RefundCash cashList){
//        List<AchiCommEntity> entities = new ArrayList<>();
//        BigDecimal hundredBD = com.ssm.manage.utils.BigDecimalUtils.bigDecimal("100");
//        //总退款金额
//        BigDecimal Total = cashList.getCashRefundMoney();
//
//        //判断大工是否存在
//        if(null != cashList.getServiceLargeOneStaffId() || null != cashList.getServiceLargeTwoStaffId() || null != cashList.getServiceLargeThreeStaffId()){
//            if(cashList.getAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){
//                Total=Total.subtract(cashList.getAchievementLarge());
//            }
//            if(cashList.getCardAchievementLarge().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                Total=Total.subtract(cashList.getCardAchievementLarge());
//            }
//        }
//
//        //判断中工是否存在
//        if(null != cashList.getServiceZhonggongOneStaffId() || null != cashList.getServiceZhonggongTwoStaffId() || null != cashList.getServiceZhonggongThreeStaffId()){
//            //判断卡付和现付是否同时存在
//            if(cashList.getCollectionRechargeAmount().compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1 &&cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1) {
//                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cashList.getCollectionRechargeAmount(), cashList.getCollectionCashAmount(), cashList.getCardAchievementZhonggong(), cashList.getAchievementZhonggong());
//                achievementMeony = BigDecimalUtils.subtract(achievementMeony, fixedAmount.get("cash"));
//                cardMeony = BigDecimalUtils.subtract(cardMeony, fixedAmount.get("card"));
//
//                totalMeony = BigDecimalUtils.subtract(totalMeony, fixedAmount.get("total"));
//            }else{
//                if(cashList.getAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementZhonggong());
//                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementZhonggong());
//                }
//                if(cashList.getCardAchievementZhonggong().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementZhonggong());
//                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementZhonggong());
//                }
//            }
//        }
//
//        //判断小工（技师）是否存在
//        if(null != cashList.getServiceTechnicianOneStaffId() || null != cashList.getServiceTechnicianTwoStaffId() || null != cashList.getServiceTechnicianThreeStaffId()){
//            if(cashList.getCollectionRechargeAmount().compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1 && cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1) {
//                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cashList.getCollectionRechargeAmount(), cashList.getCollectionCashAmount(), cashList.getCardAchievementTechnician(), cashList.getAchievementTechnician());
//                achievementMeony = BigDecimalUtils.subtract(achievementMeony, fixedAmount.get("cash"));
//                cardMeony = BigDecimalUtils.subtract(cardMeony, fixedAmount.get("card"));
//
//                totalMeony = BigDecimalUtils.subtract(totalMeony, fixedAmount.get("total"));
//            }else{
//                if(cashList.getAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementTechnician());
//                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementTechnician());
//                }
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementTechnician().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementTechnician());
//                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementTechnician());
//                }
//            }
//        }
//
//        //判断助理是否存在
//        if(null != cashList.getServiceSmallOneStaffId() || null != cashList.getServiceSmallTwoStaffId() || null != cashList.getServiceSmallThreeStaffId()){
//            if(cashList.getCollectionRechargeAmount().compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getCollectionCashAmount().compareTo(BigDecimal.valueOf(0)) == 1 && cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1 && cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1) {
//                HashMap<String, BigDecimal> fixedAmount = this.getFixedAmount(cashList.getCollectionRechargeAmount(), cashList.getCollectionCashAmount(), cashList.getCardAchievementSmall(), cashList.getAchievementSmall());
//                achievementMeony = BigDecimalUtils.subtract(achievementMeony, fixedAmount.get("cash"));
//                cardMeony = BigDecimalUtils.subtract(cardMeony, fixedAmount.get("card"));
//
//                totalMeony = BigDecimalUtils.subtract(totalMeony, fixedAmount.get("total"));
//            }else{
//                if(cashList.getAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    achievementMeony= BigDecimalUtils.subtract(achievementMeony,cashList.getAchievementSmall());
//                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getAchievementSmall());
//                }
//                //判断卡付业绩是否为固定金额
//                if(cashList.getCardAchievementSmall().compareTo(BigDecimal.valueOf(1)) == 1){//a大于b//业绩提成比例> 1=固定金额
//                    cardMeony= BigDecimalUtils.subtract(cardMeony,cashList.getCardAchievementSmall());
//                    totalMeony= BigDecimalUtils.subtract(totalMeony,cashList.getCardAchievementSmall());
//                }
//            }
//
//
//        }
//
//        if (null != cashList.getServiceLargeOneStaffId()){
//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocNum(cashList.getRefundNum());
//            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
//            achiCommEntity.setDocDate(cashList.getRefundDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getLargeOneNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceLargeOneStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceLargeOneStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeOneIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceLargeOneRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeOneRatio(),hundredBD)));
//            if(null == achiCommEntity.getCashAchi()){
//                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardAchi() ){
//                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCashComm()){
//                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardComm()){
//                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//            }
//            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
//            entities.add(achiCommEntity);
//        }
//        if (null != cashList.getServiceLargeTwoStaffId()){
//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
//            achiCommEntity.setDocDate(cashList.getRefundDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getLargeTwoNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceLargeTwoStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceLargeTwoStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeTwoIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceLargeTwoRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeTwoRatio(),hundredBD)));
//            if(null == achiCommEntity.getCashAchi()){
//                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardAchi() ){
//                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCashComm()){
//                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardComm()){
//                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//            }
//            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
//            entities.add(achiCommEntity);
//        }
//        if (null != cashList.getServiceLargeThreeStaffId()){
//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
//            achiCommEntity.setDocDate(cashList.getRefundDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getLargeThreeNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceLargeThreeStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceLargeThreeStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceLargeThreeIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceLargeThreeRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardLargeAchievementAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardLargeCommissionAmount(),BigDecimalUtils.div(cashList.getServiceLargeThreeRatio(),hundredBD)));
//            if(null == achiCommEntity.getCashAchi()){
//                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardAchi() ){
//                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCashComm()){
//                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardComm()){
//                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//            }
//            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
//            entities.add(achiCommEntity);
//        }
//
//        if (null != cashList.getServiceZhonggongOneStaffId()){
//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
//            achiCommEntity.setDocDate(cashList.getRefundDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getZhonggongOneNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongOneStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongOneStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongOneIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongOneRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongOneRatio(),hundredBD)));
//            if(null == achiCommEntity.getCashAchi()){
//                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardAchi() ){
//                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCashComm()){
//                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardComm()){
//                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//            }
//            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
//            entities.add(achiCommEntity);
//        }
//        if (null != cashList.getServiceZhonggongTwoStaffId()){
//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
//            achiCommEntity.setDocDate(cashList.getRefundDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getZhonggongTwoNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongTwoStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongTwoStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongTwoIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongTwoRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongTwoRatio(),hundredBD)));
//            if(null == achiCommEntity.getCashAchi()){
//                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardAchi() ){
//                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCashComm()){
//                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardComm()){
//                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//            }
//            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
//            entities.add(achiCommEntity);
//        }
//        if (null != cashList.getServiceZhonggongThreeStaffId()){
//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
//            achiCommEntity.setDocDate(cashList.getRefundDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getZhonggongThreeNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceZhonggongThreeStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceZhonggongThreeStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceZhonggongThreeIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceZhonggongThreeRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getZhonggongAchievementAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getZhonggongCommissionAmount(),BigDecimalUtils.div(cashList.getServiceZhonggongThreeRatio(),hundredBD)));
//            if(null == achiCommEntity.getCashAchi()){
//                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardAchi() ){
//                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCashComm()){
//                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardComm()){
//                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//            }
//            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
//            entities.add(achiCommEntity);
//        }
//        if (null != cashList.getServiceTechnicianOneStaffId()){
//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
//            achiCommEntity.setDocDate(cashList.getRefundDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getTechnicianOneNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianOneStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianOneStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianOneIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceTechnicianOneRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianOneRatio(),hundredBD)));
//            if(null == achiCommEntity.getCashAchi()){
//                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardAchi() ){
//                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCashComm()){
//                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardComm()){
//                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//            }
//            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
//            entities.add(achiCommEntity);
//        }
//        if (null != cashList.getServiceTechnicianTwoStaffId()){
//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
//            achiCommEntity.setDocDate(cashList.getRefundDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getTechnicianTwoNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianTwoStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianTwoStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianTwoIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceTechnicianTwoRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianTwoRatio(),hundredBD)));
//            if(null == achiCommEntity.getCashAchi()){
//                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardAchi() ){
//                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCashComm()){
//                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardComm()){
//                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//            }
//            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
//            entities.add(achiCommEntity);
//        }
//        if (null != cashList.getServiceTechnicianThreeStaffId()){
//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
//            achiCommEntity.setDocDate(cashList.getRefundDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getTechnicianThreeNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceTechnicianThreeStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceTechnicianThreeStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceTechnicianThreeIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceTechnicianThreeRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardTechnicianAchievementAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardTechnicianCommissionAmount(),BigDecimalUtils.div(cashList.getServiceTechnicianThreeRatio(),hundredBD)));
//            if(null == achiCommEntity.getCashAchi()){
//                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardAchi() ){
//                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCashComm()){
//                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardComm()){
//                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//            }
//            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
//            entities.add(achiCommEntity);
//        }
//        if (null != cashList.getServiceSmallOneStaffId()){
//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
//            achiCommEntity.setDocDate(cashList.getRefundDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getSmallOneNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceSmallOneStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceSmallOneStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallOneIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceSmallOneRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallOneRatio(),hundredBD)));
//            if(null == achiCommEntity.getCashAchi()){
//                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardAchi() ){
//                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCashComm()){
//                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardComm()){
//                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//            }
//            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
//            entities.add(achiCommEntity);
//        }
//        if (null != cashList.getServiceSmallTwoStaffId()){
//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
//            achiCommEntity.setDocDate(cashList.getRefundDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getSmallTwoNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceSmallTwoStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceSmallTwoStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallTwoIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceSmallTwoRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallTwoRatio(),hundredBD)));
//            if(null == achiCommEntity.getCashAchi()){
//                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardAchi() ){
//                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCashComm()){
//                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardComm()){
//                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//            }
//            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
//            entities.add(achiCommEntity);
//        }
//        if (null != cashList.getServiceSmallThreeStaffId()){
//            AchiCommEntity achiCommEntity = new AchiCommEntity();
//            achiCommEntity.setDocType(Constant.doc_type_refund_cash);
//            achiCommEntity.setDocDate(cashList.getRefundDate());
//            achiCommEntity.setTradeName(cashList.getProjectName());
//            achiCommEntity.setBrandNumber(cashList.getSmallThreeNumber());
//            achiCommEntity.setSaleStaffId(cashList.getServiceSmallThreeStaffId());
//            achiCommEntity.setSaleStaffName(cashList.getServiceSmallThreeStaffName());
//            achiCommEntity.setSaleIdentityCard(cashList.getServiceSmallThreeIdentityCard());
//            achiCommEntity.setSaleRatio(cashList.getServiceSmallThreeRatio());
//            achiCommEntity.setSaleAchievementAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));
//            achiCommEntity.setSaleCommissionAmount(BigDecimalUtils.add(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)),
//                    BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD))));
//            achiCommEntity.setCashAchi(BigDecimalUtils.multiply(cashList.getSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//            achiCommEntity.setCashComm(BigDecimalUtils.multiply(cashList.getSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//            achiCommEntity.setCardAchi(BigDecimalUtils.multiply(cashList.getCardSmallAchievementAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//            achiCommEntity.setCardComm(BigDecimalUtils.multiply(cashList.getCardSmallCommissionAmount(),BigDecimalUtils.div(cashList.getServiceSmallThreeRatio(),hundredBD)));
//            if(null == achiCommEntity.getCashAchi()){
//                achiCommEntity.setCashAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardAchi() ){
//                achiCommEntity.setCardAchi(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCashComm()){
//                achiCommEntity.setCashComm(BigDecimal.valueOf(0));
//            }
//            if(null == achiCommEntity.getCardComm()){
//                achiCommEntity.setCardComm(BigDecimal.valueOf(0));
//            }
//            achiCommEntity.setTotalPerformance(BigDecimalUtils.add(achiCommEntity.getCashAchi(),achiCommEntity.getCardAchi()));
//            achiCommEntity.setTotalCommission(BigDecimalUtils.add(achiCommEntity.getCashComm(),achiCommEntity.getCardComm()));
//
//            entities.add(achiCommEntity);
//        }
//        return entities;
//    }
}
