|
|
|
@ -19,12 +19,19 @@ public class EnterpriseCalendarServiceImpl extends Service implements Enterprise
|
|
|
|
|
BaseBean bs = new BaseBean();
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> initCalendar(Map<String, Object> params) {
|
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
String yearStr = Util.null2String(params.get("year"));
|
|
|
|
|
String calendarId = Util.null2String(params.get("calendarId"));
|
|
|
|
|
if ("".equals(yearStr) || "".equals(calendarId)) {
|
|
|
|
|
result.put("status", "false");
|
|
|
|
|
result.put("message", "年份和日历必填!");
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
int year = Integer.parseInt(yearStr);
|
|
|
|
|
//查询所属机构
|
|
|
|
|
String sql = "select * from uf_jcl_kq_rlmc where id = " + calendarId;
|
|
|
|
|
Map<String,Object> data = DbTools.getSqlToMap(sql);
|
|
|
|
|
if (data.size() > 0) {
|
|
|
|
|
//所属机构
|
|
|
|
|
String org = Util.null2String(data.get("szjg"));
|
|
|
|
|
//单双休设置相关信息
|
|
|
|
@ -104,8 +111,18 @@ public class EnterpriseCalendarServiceImpl extends Service implements Enterprise
|
|
|
|
|
bs.writeLog("入库开始---");
|
|
|
|
|
boolean insertSign = CommonUtil.insertBatch(dateInfoList, tableName);
|
|
|
|
|
bs.writeLog("insertSign : " + insertSign);
|
|
|
|
|
result.put("status", String.valueOf(insertSign));
|
|
|
|
|
result.put("message", insertSign ? "初始化成功" : "初始化失败, 插入新数据未成功");
|
|
|
|
|
} else {
|
|
|
|
|
result.put("status", "false");
|
|
|
|
|
result.put("message", "初始化失败, 未生成新数据");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
result.put("status", "false");
|
|
|
|
|
result.put("message", "初始化失败, 日历信息不存在");
|
|
|
|
|
}
|
|
|
|
|
return new HashMap<>();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private boolean checkFirstWeekRest(int year, String calendarId, boolean doubleRestSign) {
|
|
|
|
|