Search in sources :

Example 6 with Club

use of com.kendy.entity.Club in project financial by greatkendy123.

the class LMController method get_LM_club_info.

public Map<String, ClubQuota> get_LM_club_info() {
    // {俱乐部ID : 俱乐部配额信息}
    Map<String, ClubQuota> single_LM_map = new HashMap<>();
    // {联盟Index : {俱乐部ID : 俱乐部配额信息}}
    // Map<String,Map<String,List<ClubQuota>>> totalMap = new HashMap<>();
    int lmType = getCurrentLMType() - 1;
    // 遍历这三个
    Map<String, List<Record>> current_LM_Map = LMTotalList.get(lmType);
    Map<String, List<LMSumInfo>> allClubSumMap = getAllClubSumMap(current_LM_Map);
    allClubSumMap.forEach((clubId, sumList) -> {
        Club club = allClubMap.get(clubId);
        String sumZJ = getSumZJ(sumList);
        String yiJieshan = get_LM_YiJiesuan(club, lmType);
        String zhuoFei = get_LM_Zhuofei(club, lmType);
        String jieyu = NumUtil.digit0(NumUtil.getNum(sumZJ) + NumUtil.getNum(yiJieshan) + NumUtil.getNum(zhuoFei));
        List<ClubQuota> list = new ArrayList<>();
        ClubQuota quota = new ClubQuota();
        quota.setEuotaClubId(clubId);
        quota.setQuotaClubName(club.getName());
        quota.setQuotaJieyu(jieyu);
        quota.setQuotaRest(jieyu);
        single_LM_map.put(clubId, quota);
    });
    return single_LM_map;
}
Also used : HashMap(java.util.HashMap) Club(com.kendy.entity.Club) ArrayList(java.util.ArrayList) ClubQuota(com.kendy.entity.ClubQuota) List(java.util.List) ObservableList(javafx.collections.ObservableList) ArrayList(java.util.ArrayList)

Example 7 with Club

use of com.kendy.entity.Club in project financial by greatkendy123.

the class LMController method viewAllClubAction.

/**
 * 查看所有俱乐部总帐单
 *
 * @time 2017年11月22日
 * @param event
 */
public void viewAllClubAction(ActionEvent event) {
    // 无数据就返回
    int size = allClubMap.size();
    if (allClubMap == null || allClubMap.size() == 0) {
        ShowUtil.show("无数据可以导出");
        return;
    }
    Map<String, List<Record>> current_LM_Map = LMTotalList.get(getCurrentLMType() - 1);
    if (MapUtil.isNullOrEmpty(current_LM_Map)) {
        ShowUtil.show("该联盟无数据可以导出");
        return;
    }
    // 组装当前要展示的联盟的相应俱乐部
    Map<String, Club> lmClubMap = getLMClub(current_LM_Map);
    // 设置合计桌费(这个没多大影响)
    setNewSumOfZF();
    // 隐藏单个所有信息
    showAllView();
    // 点击所有俱乐部总帐按钮后的单个聪明数据统计 {俱乐部ID  : 表内容}
    Map<String, List<LMSumInfo>> allClubSumMap = getAllClubSumMap(current_LM_Map);
    FlowPane flow = new FlowPane();
    flow.setId(FLOW_PANE_ID);
    flow.setMinWidth(668);
    flow.setBorder(new Border(new BorderStroke(Color.BLUE, BorderStrokeStyle.SOLID, null, new BorderWidths(3))));
    flow.setVgap(20);
    flow.setHgap(20);
    flow.setPadding(new Insets(10, 10, 10, 30));
    // int size = allClubMap.size();
    // if(allClubMap == null || allClubMap.size() ==0) {
    // ShowUtil.show("无数据可以导出");
    // return;
    // }
    // 表示第一列的宽度
    final int talbeWidth = 300;
    // 表示第一列的宽度
    final int With1 = 80;
    // 表示第二列的宽度
    final int With2 = 70;
    final int With3 = 70;
    final int With4 = 60;
    final int height = 115;
    final String style = "-fx-alignment: CENTER;";
    final String clubNameStyle = "-fx-background-color: #FFFFE0;";
    // for(Map.Entry<String, Club> entry : allClubMap.entrySet()) {
    for (Map.Entry<String, Club> entry : lmClubMap.entrySet()) {
        Club club = entry.getValue();
        String clubId = entry.getKey();
        TableView table = new TableView();
        table.setPrefHeight(height);
        table.setPrefWidth(talbeWidth);
        // 设置列
        TableColumn col1 = new TableColumn(club.getName());
        col1.setPrefWidth(With1);
        col1.setStyle(style);
        col1.setSortable(false);
        col1.setCellValueFactory(new PropertyValueFactory<LMSumInfo, String>("lmSumName"));
        TableColumn col2 = new TableColumn("总战绩");
        col2.setSortable(false);
        col2.setStyle(style);
        col2.setPrefWidth(With2);
        col2.setCellValueFactory(new PropertyValueFactory<LMSumInfo, String>("lmSumZJ"));
        // 红色注释
        col2.setCellFactory(MyController.getColorCellFactory(new LMSumInfo()));
        TableColumn col3 = new TableColumn("总保险");
        col3.setSortable(false);
        col3.setStyle(style);
        col3.setPrefWidth(With3);
        col3.setCellValueFactory(new PropertyValueFactory<LMSumInfo, String>("lmSumInsure"));
        // 红色注释
        col3.setCellFactory(MyController.getColorCellFactory(new LMSumInfo()));
        TableColumn col4 = new TableColumn("总人数");
        col4.setSortable(false);
        col4.setStyle(style);
        col4.setPrefWidth(With4);
        col4.setCellValueFactory(new PropertyValueFactory<LMSumInfo, String>("lmSumPersonCount"));
        table.getColumns().addAll(col1, col2, col3, col4);
        // 设置数据
        setDynamicTableData(table, clubId, allClubSumMap);
        flow.getChildren().add(table);
    }
    ;
    bigAnchorPane.getChildren().add(0, flow);
}
Also used : LMSumInfo(com.kendy.entity.LMSumInfo) Insets(javafx.geometry.Insets) TableColumn(javafx.scene.control.TableColumn) Club(com.kendy.entity.Club) BorderWidths(javafx.scene.layout.BorderWidths) FlowPane(javafx.scene.layout.FlowPane) BorderStroke(javafx.scene.layout.BorderStroke) List(java.util.List) ObservableList(javafx.collections.ObservableList) ArrayList(java.util.ArrayList) Border(javafx.scene.layout.Border) Map(java.util.Map) HashMap(java.util.HashMap) TableView(javafx.scene.control.TableView)

Example 8 with Club

use of com.kendy.entity.Club in project financial by greatkendy123.

the class LMController method getSelectedClub.

/**
 * 获取已选择的俱乐部信息(Club Bean)
 *
 * @time 2017年11月26日
 * @return Club
 */
public Club getSelectedClub() {
    Club club = new Club();
    String selectedItemString = getSelectedItemString();
    if (StringUtil.isBlank(selectedItemString)) {
        return club;
    }
    String[] newValArr = selectedItemString.trim().split("==");
    String newClubName = newValArr[0];
    String newClubId = newValArr[1];
    String newClubEdu = newValArr[2];
    if (!StringUtil.isBlank(newClubName))
        club = allClubMap.get(newClubId);
    return club;
}
Also used : Club(com.kendy.entity.Club)

Example 9 with Club

use of com.kendy.entity.Club in project financial by greatkendy123.

the class LMController method refreshClubListView.

/**
 * 刷新俱乐部列表视图
 *
 * @time 2017年12月14日
 * @param index 1:联盟1(依此类推)
 * index 取 [1,2,3]
 */
public static void refreshClubListView(int index) {
    // 这里更新俱乐部列表(静态访问)
    _clubListView.setItems(null);
    ObservableList<String> obList = FXCollections.observableArrayList();
    if (!LMTotalList.isEmpty()) {
        LMTotalList.get(index - 1).keySet().forEach(clubId -> {
            Club club = allClubMap.get(clubId);
            // obList.add(club.getName()+"=="+club.getClubId()+"=="+club.getEdu());
            obList.add(club.getName() + "==" + club.getClubId() + "==" + get_LM_edu(club, index));
        });
    }
    _clubListView.setItems(obList);
    // 默认选择第一个
    if (_clubListView.getItems() != null) {
        _clubListView.getSelectionModel().select(0);
    }
}
Also used : Club(com.kendy.entity.Club)

Example 10 with Club

use of com.kendy.entity.Club in project financial by greatkendy123.

the class QuotaController method addClubBankAction.

/**
 * 添加一个俱乐部银行卡记录
 *
 * @time 2017年12月19日
 * @param event
 */
public void addClubBankAction(ActionEvent event) {
    List<String> list = Arrays.asList("俱乐部ID", "移动类型", "姓名", "手机", "银行类型", "银行信息");
    InputDialog dlg = new InputDialog();
    dlg.InputMultyDialog("新增", list);
    Optional<Map<String, String>> resultMapOpt = dlg.getMultyResult();
    System.out.println(resultMapOpt.toString());
    if (resultMapOpt.isPresent()) {
        Map<String, String> map = resultMapOpt.get();
        String clubID = StringUtil.nvl(map.get(list.get(0)), "");
        String mobileType = StringUtil.nvl(map.get(list.get(1)), "");
        String personName = StringUtil.nvl(map.get(list.get(2)), "");
        String phoneNumber = StringUtil.nvl(map.get(list.get(3)), "");
        String bankType = StringUtil.nvl(map.get(list.get(4)), "");
        String bankAccountInfo = StringUtil.nvl(map.get(list.get(5)), "");
        if (StringUtil.isAnyBlank(clubID)) {
            ShowUtil.show("俱乐部ID不能为空!");
            return;
        }
        // 判断是否有该ID信息
        Club club = allClubMap.get(clubID);
        if (club == null) {
            ShowUtil.show("不存在此俱乐部ID:" + clubID);
            return;
        }
        // 入库操作
        ClubBankModel bank = new ClubBankModel();
        bank.setClubId(clubID);
        bank.setMobilePayType(mobileType);
        bank.setClubName(club.getName());
        bank.setBankType(bankType);
        bank.setPersonName(personName);
        bank.setPhoneNumber(phoneNumber);
        bank.setBankAccountInfo(bankAccountInfo);
        boolean isAdd2DB = DBUtil.addOrUpdateClubBank(bank);
        // 往银行信息表添加一条记录
        addClubBank2Table(bank);
        // 更新缓存
        allClubBankModels.put(clubID, bank);
        ShowUtil.show("添加成功", 2);
    }
}
Also used : InputDialog(com.kendy.util.InputDialog) Club(com.kendy.entity.Club) ClubBankModel(com.kendy.entity.ClubBankModel) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map)

Aggregations

Club (com.kendy.entity.Club)19 ArrayList (java.util.ArrayList)8 HashMap (java.util.HashMap)7 List (java.util.List)7 ObservableList (javafx.collections.ObservableList)7 InputDialog (com.kendy.util.InputDialog)5 LMSumInfo (com.kendy.entity.LMSumInfo)4 Map (java.util.Map)4 ClubQuota (com.kendy.entity.ClubQuota)3 LinkedHashMap (java.util.LinkedHashMap)3 ClubBankModel (com.kendy.entity.ClubBankModel)2 LMDetailInfo (com.kendy.entity.LMDetailInfo)2 Record (com.kendy.entity.Record)2 SimpleDateFormat (java.text.SimpleDateFormat)2 Date (java.util.Date)2 DataConstans (application.DataConstans)1 MyController (application.MyController)1 PropertiesUtil (application.PropertiesUtil)1 DBUtil (com.kendy.db.DBUtil)1 ClubBankInfo (com.kendy.entity.ClubBankInfo)1