|
@@ -1,6 +1,7 @@
|
|
|
package com.happy.action;
|
|
package com.happy.action;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.happy.Model.Holiday;
|
|
|
import com.happy.Until.GetHttpParam;
|
|
import com.happy.Until.GetHttpParam;
|
|
|
import com.happy.Until.ResUtil;
|
|
import com.happy.Until.ResUtil;
|
|
|
import com.happy.common.controller.BaseController;
|
|
import com.happy.common.controller.BaseController;
|
|
@@ -13,6 +14,8 @@ import org.apache.struts2.ServletActionContext;
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
+import static com.happy.Until.HolidayUtil.getYearHoliday;
|
|
|
|
|
+
|
|
|
public class HouseNumberStatusAction extends BaseController implements ModelDriven<HouseNumberStatusDto> {
|
|
public class HouseNumberStatusAction extends BaseController implements ModelDriven<HouseNumberStatusDto> {
|
|
|
private final HouseNumberStatusDto houseNumberStatusDto = new HouseNumberStatusDto();
|
|
private final HouseNumberStatusDto houseNumberStatusDto = new HouseNumberStatusDto();
|
|
|
|
|
|
|
@@ -23,6 +26,66 @@ public class HouseNumberStatusAction extends BaseController implements ModelDriv
|
|
|
|
|
|
|
|
@Resource(name = "HouseNumberStatusService")
|
|
@Resource(name = "HouseNumberStatusService")
|
|
|
private HouseNumberStatusService houseNumberStatusService;
|
|
private HouseNumberStatusService houseNumberStatusService;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据年份获取节假日数据
|
|
|
|
|
+ */
|
|
|
|
|
+ public String queryHoliday(){
|
|
|
|
|
+ String year = houseNumberStatusDto.getYear();
|
|
|
|
|
+
|
|
|
|
|
+ if(year.length() > 4){
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), new JSONObject() {{
|
|
|
|
|
+ put("message", "请输入年份");
|
|
|
|
|
+ put("code", 500);
|
|
|
|
|
+ }}.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(year == null){
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), new JSONObject() {{
|
|
|
|
|
+ put("message", "请传入参数");
|
|
|
|
|
+ put("code", 500);
|
|
|
|
|
+ }}.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ List<Holiday> days = getYearHoliday("2023");
|
|
|
|
|
+
|
|
|
|
|
+ if(days == null){
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), new JSONObject() {{
|
|
|
|
|
+ put("message", "第三方接口调用失败");
|
|
|
|
|
+ put("code", 500);
|
|
|
|
|
+ }}.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(days.size() <= 0){
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), new JSONObject() {{
|
|
|
|
|
+ put("message", "第三方接口调用失败");
|
|
|
|
|
+ put("code", 500);
|
|
|
|
|
+ }}.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ houseNumberStatusService.deleteHolidayByYear(year);
|
|
|
|
|
+
|
|
|
|
|
+ int lenegth = houseNumberStatusService.saveHolidayBatch(days);
|
|
|
|
|
+ if(lenegth <= 0){
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), new JSONObject() {{
|
|
|
|
|
+ put("message", "节假日数据存储失败");
|
|
|
|
|
+ put("code", 500);
|
|
|
|
|
+ }}.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), new JSONObject() {{
|
|
|
|
|
+ put("message", "节假日数据存储成功");
|
|
|
|
|
+ put("code", 200);
|
|
|
|
|
+ }}.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 表格数据 房态管理-房态管理
|
|
* 表格数据 房态管理-房态管理
|
|
|
*/
|
|
*/
|