use of com.kendy.entity.Huishui in project financial by greatkendy123.
the class AddController method addHuishuiOKAction.
/**
* 增加团队回水
*/
public void addHuishuiOKAction(ActionEvent event) {
Huishui hs = new Huishui();
hs.setTeamId(teamIdField.getText());
hs.setTeamName(teamNameField.getText());
hs.setGudong(gudong2Field.getText());
hs.setBeizhu(beizhu2Field.getText());
String _insuranceRate = insuranceRate.getText();
if (StringUtil.isBlank(_insuranceRate)) {
_insuranceRate = "0";
} else {
_insuranceRate = NumUtil.digit4(_insuranceRate);
}
hs.setInsuranceRate(_insuranceRate);
String _huishui = huishui.getText();
if (StringUtil.isBlank(_huishui)) {
_huishui = "0";
} else {
_huishui = NumUtil.digit4(_huishui);
}
hs.setHuishuiRate(_huishui);
hs.setZjManaged("是");
if (!StringUtil.isBlank(hs.getTeamId()) && !StringUtil.isBlank(hs.getHuishuiRate())) {
DataConstans.huishuiMap.put(hs.getTeamId(), hs);
// 入库
DBUtil.addTeamHS(hs);
log.info("已经添加该团队回水:" + hs.toString());
ShowUtil.show("已经添加该团队回水", 2);
// add 2017-10-23
// 添加回水后往实时上码表添加团ID按钮
ShangmaService.initShangmaButton();
// 添加回水后往代理查询中添加新团 队ID
TeamProxyService.addNewTeamId(hs.getTeamId());
// 积分查询添加新团队ID jfTeamIDCombox 小胖有反馈时再添加吧
JifenService.addNewTeamId(hs.getTeamId());
}
// 获取到新增回水窗口的实例
Stage huishuiStage = DataConstans.framesNameMap.get(Constants.ADD_TEAM_HUISHUI_FRAME);
DataConstans.framesNameMap.remove(Constants.ADD_TEAM_HUISHUI_FRAME);
huishuiStage.close();
}
use of com.kendy.entity.Huishui in project financial by greatkendy123.
the class MyController method updateTeamHsBaoxianRateAction.
/**
* 修改团队保险比例
*
* @time 2018年2月8日
* @param event
*/
public void updateTeamHsBaoxianRateAction(ActionEvent event) {
InputDialog inputDlg = new InputDialog("修改团队保险比例", "待修改的团队ID:", "团队新保险比例:");
Optional<Pair<String, String>> result = inputDlg.getResult();
result.ifPresent(teamId_and_hsRate -> {
// 获取到原始的有效的团队ID及团队回水率
String teamID = teamId_and_hsRate.getKey();
String teamHsRate = teamId_and_hsRate.getValue();
if (StringUtil.isBlank(teamID) || StringUtil.isBlank(teamHsRate)) {
ShowUtil.show("修改失败!原因:团队ID或团队回水不能为空!!");
return;
}
teamID = teamID.trim().toUpperCase();
teamHsRate = teamHsRate.trim();
// 判断是否有此团队
Huishui hs = DataConstans.huishuiMap.get(teamID);
if (hs == null) {
ShowUtil.show("修改失败!原因:不存在此团队ID,请检查!");
return;
}
if (!teamHsRate.endsWith("%")) {
ShowUtil.show("修改失败!原因:团队保险必须中有百分号!");
return;
}
// 开始修改
// 1修改数据库
Double _hsRate = NumUtil.getNumByPercent(teamHsRate);
int size = (_hsRate + "").length();
if (size > 6) {
_hsRate = NumUtil.getNum(NumUtil.digit4(_hsRate.toString()));
}
if (!DBUtil.updateTeamHsBaoxianRate(teamID, _hsRate + "")) {
return;
}
// 2修改缓存
// 地址引用,会修改值
hs.setInsuranceRate(NumUtil.getNumByPercent(teamHsRate) + "");
ShowUtil.show("修改成功!", 2);
});
}
use of com.kendy.entity.Huishui in project financial by greatkendy123.
the class MyController method updateTeamHsGudongAction.
/**
* 修改团队股东
*
* @param event
*/
public void updateTeamHsGudongAction(ActionEvent event) {
InputDialog inputDlg = new InputDialog("修改团队股东", "待修改的团队ID:", "团队新股东:");
Optional<Pair<String, String>> result = inputDlg.getResult();
result.ifPresent(teamId_and_teamGD -> {
// 获取到原始的有效的团队ID及团队回水率
String teamID = teamId_and_teamGD.getKey();
String teamGD = teamId_and_teamGD.getValue();
if (StringUtil.isBlank(teamID) || StringUtil.isBlank(teamGD)) {
ShowUtil.show("修改失败!原因:团队ID或团队股东不能为空!!");
return;
}
teamID = teamID.trim().toUpperCase();
teamGD = teamGD.trim();
// 判断是否有此团队
Huishui hs = DataConstans.huishuiMap.get(teamID);
if (hs == null) {
ShowUtil.show("修改失败!原因:不存在此团队ID,请检查!");
return;
}
// 1修改数据库
if (!DBUtil.updateTeamHsGudong(teamID, teamGD)) {
ShowUtil.show("修改失败");
return;
}
// 2修改缓存
// 地址引用,会修改值
hs.setGudong(teamGD);
ShowUtil.show("修改成功!", 2);
});
}
use of com.kendy.entity.Huishui in project financial by greatkendy123.
the class MyController method importHuishuiExcelAction.
/**
* 导入回水比例文件
*/
public void importHuishuiExcelAction(ActionEvent even) {
String huishuiFilePath = huishuiDir.getText();
if (!StringUtil.isBlank(huishuiFilePath)) {
// 将人员名单文件缓存起来
Wrap wrap = ExcelReaderUtil.readHuishuiRecord(new File(huishuiFilePath));
if (wrap.resultSuccess) {
DataConstans.huishuiMap.putAll((Map<String, Huishui>) wrap.obj);
DBUtil.insertTeamHS((Map<String, Huishui>) wrap.obj);
ShowUtil.show("导入回水比例成功", 2);
// importHuishuiBtn.setDisable(true);//导入后不再导了
// 代理查询初始化团队ID
TeamProxyService.initTeamSelectAndZjManage(teamIDCombox);
// 积分查询初始化团队ID
JifenService.init_Jifen_TeamIdCombox();
// 上码系统中的团队ID按钮
ShangmaService.initShangmaButton();
} else {
ShowUtil.show("导入回水比例失败", 2);
}
}
}
use of com.kendy.entity.Huishui in project financial by greatkendy123.
the class DBUtil method getAllTeamHS.
/**
* 获取所有的团队回水
* @return
*/
public static List<Huishui> getAllTeamHS() {
List<Huishui> result = new ArrayList<Huishui>();
try {
con = DBConnection.getConnection();
String sql = "select * from teamhs";
ps = con.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
Huishui hs;
while (rs.next()) {
hs = new Huishui();
hs.setTeamId(rs.getString(1));
hs.setTeamName(rs.getString(2));
hs.setHuishuiRate(rs.getString(3));
hs.setInsuranceRate(rs.getString(4));
hs.setGudong(rs.getString(5));
hs.setZjManaged(rs.getString(6));
hs.setBeizhu(rs.getString(7));
hs.setProxyHSRate(rs.getString(8));
hs.setProxyHBRate(rs.getString(9));
hs.setProxyFWF(rs.getString(10));
hs.setShowInsure(rs.getString(11));
hs.setTeamYajin(rs.getString(12));
hs.setTeamEdu(rs.getString(13));
hs.setTeamAvailabel(rs.getString(14));
result.add(hs);
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
close(con, ps);
}
return result;
}
Aggregations