jsk 通知下一位

This commit is contained in:
skjia 2025-04-29 12:53:03 +08:00
parent 99c4879ab0
commit b03e0726b2
1 changed files with 50 additions and 0 deletions

View File

@ -315,6 +315,56 @@ public class GreenWashCarController extends GreenBaseController {
return new RestResult(Constant.FAILED, "查询失败");
}
}
/**
* 提醒下一位
*
* @param greenHaircutRemainDTO
* @return
*/
@RequestMapping(value = "/remindForWashCar", method = RequestMethod.POST)
public @ResponseBody RestResult remindForWashCar(@RequestBody GreenWashCarInfo info) {
try {
String sql = "SELECT ID,USER_ID,USER_NAME,APPLY_DATE,APPLY_TIME,APPLY_TIME_ID,"
+ "DEPT_ID,DEPT_NAME,CONCAT_USER_NAME,CONCAT_PHONE,to_char(CREATE_TIME,'yyyy-mm-dd hh24:mi:ss') AS \"CREATE_TIME\","
+ "UPD_USER,to_char(UPD_TIME,'yyyy-mm-dd hh24:mi:ss') AS \"UPD_TIME\",DEL_FLAG,APPLY_PLACE,LICENSEPLATE,"
+ "STARTREMIND,ENDREMIND,MOVE_CAR,INT_STATUS,IS_PUSH "
+ " from green_wash_car_info where SUBSTR(APPLY_TIME,1,5)>to_char(SYSDATE,'hh24:mi') and APPLY_DATE ='"+info.getApplyDate()+"' order by APPLY_TIME asc";
List<Map<String, Object>> list = hibernateDao.queryForListWithSql(sql);
System.out.println( sql);
System.out.println( list.size());
System.out.println( list.get(0).get("ID"));
if(list==null||list.size()==0||list.get(0).get("ID")==null){
return new RestResult(Constant.FAILED, "今日已无预约洗车用户!");
}
String userId = (String) list.get(0).get("USER_ID");
String startTime=info.getApplyDate()+" "+(String) list.get(0).get("APPLY_TIME");
String title="";
String text = "";
String url = "";
//aliasManageController.pushToSingle(userId, title, text, url);
//GreenUserInfo userInfo = getUserInfo(userId);
if("科技楼".equals(list.get(0).get("APPLY_PLACE").toString())){
String driverSql = "select id,wxopenid,ISC_ID from green_user_info where id ='"+userId+"' ";
List<Map<String, Object>> driverList = hibernateDao.queryForListWithSql(driverSql);
title = "洗车预约";
text = "您好,您预约的洗车即将开始("+startTime+"),请安排好您的时间。";
url = "/pages/washcar/washCarAccept?applyPlace=科技楼";
aliasManageController.pushToSingleBatch(driverList, title, text, url);
}else{
title="洗车预约";
text = "您好,您预约的洗车即将开始("+startTime+"),请安排好您的时间。";
url = "/pages/washcar/washCarReservation?currentTabIndex=1";
aliasManageController.pushToSingle(userId, title, text, url);
}
// 返回结果
return new RestResult(Constant.SUCCESS, "已通知下一位");
} catch (Exception e) {
e.printStackTrace();
return new RestResult(Constant.FAILED, "查询失败");
}
}
/**
* 提醒
*