369 lines
18 KiB
Plaintext
369 lines
18 KiB
Plaintext
|
|
package com.nationalelectric.greenH5;
|
||
|
|
import java.io.IOException;
|
||
|
|
import java.text.SimpleDateFormat;
|
||
|
|
import java.util.Arrays;
|
||
|
|
import java.util.Date;
|
||
|
|
import java.util.HashMap;
|
||
|
|
import java.util.List;
|
||
|
|
import java.util.Map;
|
||
|
|
import java.util.concurrent.ExecutorService;
|
||
|
|
import java.util.concurrent.Executors;
|
||
|
|
|
||
|
|
import javax.annotation.Resource;
|
||
|
|
import javax.servlet.http.HttpServletRequest;
|
||
|
|
|
||
|
|
import org.apache.tomcat.jni.Thread;
|
||
|
|
import org.codehaus.jackson.map.ObjectMapper;
|
||
|
|
import org.codehaus.jackson.type.TypeReference;
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||
|
|
import org.springframework.stereotype.Controller;
|
||
|
|
import org.springframework.transaction.annotation.Transactional;
|
||
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
||
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||
|
|
|
||
|
|
import com.nationalelectirc.Constant.ApplyRoleConstant;
|
||
|
|
import com.nationalelectirc.Constant.Constant;
|
||
|
|
import com.nationalelectirc.utils.PushMessageUtil;
|
||
|
|
import com.nationalelectirc.utils.RestResult;
|
||
|
|
import com.nationalelectric.greenH5.DTO.GreenMealTicketApplyDTO;
|
||
|
|
import com.nationalelectric.greenH5.bizc.IGreenApplyListBizc;
|
||
|
|
import com.nationalelectric.greenH5.bizc.IGreenOperateLogBizc;
|
||
|
|
import com.nationalelectric.greenH5.bizc.IGreenTempParkInfoBizc;
|
||
|
|
import com.nationalelectric.greenH5.po.GreenApplyList;
|
||
|
|
import com.nationalelectric.greenH5.po.GreenTempParkInfo;
|
||
|
|
import com.nationalelectric.greenH5.po.GreenUserInfo;
|
||
|
|
import com.nationalelectric.greenH5.po.GreenUserRoleRel;
|
||
|
|
import com.nationalelectric.greenH5.po.GreenVisitorRetinueInfo;
|
||
|
|
import com.nationalelectric.greenH5.utils.AesEncryptUtil;
|
||
|
|
import com.nationalelectric.greenH5.utils.DateTime;
|
||
|
|
import com.nationalelectric.greenH5.utils.DateUtil;
|
||
|
|
import com.sgcc.uap.persistence.IHibernateDao;
|
||
|
|
import com.sgcc.uap.service.validator.ServiceValidatorBaseException;
|
||
|
|
import com.sgcc.uap.service.validator.ServiceValidatorUtil;
|
||
|
|
|
||
|
|
@Controller
|
||
|
|
@RequestMapping("/greenParkThirdInfo")
|
||
|
|
public class GreenParkThirdController extends GreenBaseController{
|
||
|
|
/**
|
||
|
|
* 临时停车service
|
||
|
|
*/
|
||
|
|
@Resource
|
||
|
|
private IGreenTempParkInfoBizc greentempparkinfoBizc;
|
||
|
|
/**
|
||
|
|
* 我的申请service
|
||
|
|
*/
|
||
|
|
@Resource
|
||
|
|
private IGreenApplyListBizc greenApplyListBizc;
|
||
|
|
/**
|
||
|
|
* 字典表controller
|
||
|
|
*/
|
||
|
|
@Resource
|
||
|
|
private GreenDictionaryInfoController greenDictionaryInfoController;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 用户controller
|
||
|
|
*/
|
||
|
|
@Resource
|
||
|
|
private GreenUserInfoController greenUserInfoController;
|
||
|
|
/**
|
||
|
|
* HibernateDao逻辑构件
|
||
|
|
*/
|
||
|
|
@Autowired
|
||
|
|
IHibernateDao hibernateDao;
|
||
|
|
@Resource
|
||
|
|
private IGreenOperateLogBizc greenOperateLogBizc;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 保存临时停车申请信息
|
||
|
|
*
|
||
|
|
* @param greenTempParkInfo
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
@Transactional(rollbackFor = Exception.class)
|
||
|
|
@RequestMapping(value = "/saveTempParkInfo", method = RequestMethod.POST)
|
||
|
|
public @ResponseBody RestResult saveTempParkInfo(@RequestBody Object requestBody) {
|
||
|
|
GreenTempParkInfo greenTempParkInfo = new ObjectMapper().convertValue(requestBody, new TypeReference<GreenTempParkInfo>() {});
|
||
|
|
try {
|
||
|
|
|
||
|
|
List<Map<String, String>> isShow = greenDictionaryInfoController.getDictionaryInfo("appIconSwitch","appParkingSwitch");
|
||
|
|
String showFlag = isShow.get(0).get("data_value")+"";;
|
||
|
|
// int falg = 1;
|
||
|
|
if(showFlag .equals("0")) {
|
||
|
|
List<Map<String, Object>> dictionaryInfo = greenDictionaryInfoController.getDictionaryInfo("tempParkMessger");
|
||
|
|
String tempPark=dictionaryInfo.get(0).get("data_value").toString();
|
||
|
|
return new RestResult(Constant.FAILED, tempPark);
|
||
|
|
}
|
||
|
|
String queryTempParkInfoSql = "SELECT count(appl.first_status) total FROM green_temp_park_info AS tpi, green_apply_list appl "
|
||
|
|
+ " WHERE 1 = 1 "
|
||
|
|
+ " AND appl.is_deleted = 'N' AND appl.apply_type='04' and appl.detail_id = tpi.id AND (appl.first_status = 0 or appl.first_status = 1)"
|
||
|
|
+ "AND tpi.is_deleted = 'N' AND number_plate = ? AND date_format(?, '%Y-%m') = date_format(tpi.start_time, '%Y-%m') AND tpi.stay_area =? "
|
||
|
|
+ " UNION ALL "
|
||
|
|
+ "SELECT count(appl.first_status) total FROM green_temp_park_info AS tpi, green_apply_list appl "
|
||
|
|
+ " WHERE 1 = 1 "
|
||
|
|
+ " AND appl.is_deleted = 'N' AND appl.apply_type='04' and appl.detail_id = tpi.id AND appl.first_status = 1 and appl.second_status = '7' "
|
||
|
|
+ "AND tpi.is_deleted = 'N' AND number_plate = ? AND date_format(?, '%Y-%m') = date_format(tpi.start_time, '%Y-%m') AND tpi.stay_area =? ";
|
||
|
|
String userId = greenTempParkInfo.getUserId();
|
||
|
|
GreenUserInfo info = getUserInfo(userId);
|
||
|
|
if(info==null){
|
||
|
|
return new RestResult(Constant.FAILED, "非法用户");
|
||
|
|
}
|
||
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||
|
|
String nowDate = sdf.format(new Date());
|
||
|
|
//校验
|
||
|
|
ServiceValidatorUtil.validatorJavaBean(greenTempParkInfo);
|
||
|
|
|
||
|
|
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd");
|
||
|
|
Date startd = sdf2.parse(greenTempParkInfo.getStartTime());
|
||
|
|
Date endd = sdf2.parse(greenTempParkInfo.getEndTime());
|
||
|
|
|
||
|
|
if(!startd.after(new Date())) {
|
||
|
|
return new RestResult(Constant.FAILED, "无法提交当日停车申请,请您选择其他日期!");
|
||
|
|
}
|
||
|
|
|
||
|
|
if(!endd.after(new Date())) {
|
||
|
|
return new RestResult(Constant.FAILED, "无法提交当日停车申请,请您选择其他日期!");
|
||
|
|
}
|
||
|
|
if(!sdf2.format(startd).equals(sdf2.format(endd))){
|
||
|
|
return new RestResult(Constant.FAILED, "开始时间和结束时间需在同一天。");
|
||
|
|
}
|
||
|
|
//判断开始时间是否小于当前时间
|
||
|
|
if((greenTempParkInfo.getStartTime()).compareTo(nowDate)<0){
|
||
|
|
return new RestResult(Constant.FAILED, "开始时间不能小于当前时间,请重新输入!");
|
||
|
|
}
|
||
|
|
//判断结束时间是否小于当前时间
|
||
|
|
if((greenTempParkInfo.getEndTime()).compareTo(nowDate)<0){
|
||
|
|
return new RestResult(Constant.FAILED, "结束时间不能小于当前时间,请重新输入!");
|
||
|
|
}
|
||
|
|
//判断开始时间是否大于结束时间
|
||
|
|
if((greenTempParkInfo.getEndTime()).compareTo(greenTempParkInfo.getStartTime())<0){
|
||
|
|
return new RestResult(Constant.FAILED, "开始时间不能大于结束时间,请重新输入!");
|
||
|
|
}
|
||
|
|
|
||
|
|
List<HashMap<String, Object>> queryList = hibernateDao.queryForListWithSql(queryTempParkInfoSql, new Object[]{
|
||
|
|
greenTempParkInfo.getNumberPlate(),greenTempParkInfo.getEndTime(),greenTempParkInfo.getStayArea()
|
||
|
|
,greenTempParkInfo.getNumberPlate(),greenTempParkInfo.getEndTime(),greenTempParkInfo.getStayArea()
|
||
|
|
});
|
||
|
|
|
||
|
|
List<Map<String, Object>> dictionaryInfo = greenDictionaryInfoController.getDictionaryInfo("temporaryParkingNum");
|
||
|
|
|
||
|
|
int num = Integer.valueOf(dictionaryInfo.get(0).get("data_value")+"");
|
||
|
|
// List<Map<String, Object>> dictionaryInfo2 = greenDictionaryInfoController.getDictionaryInfo("temporaryParkingTos");
|
||
|
|
// if(Integer.valueOf(queryList.get(1).get("total")+"")>num-1){
|
||
|
|
// return new RestResult(Constant.FAILED, "该车辆本月临时停车预约次数已达上限,请联系后勤总务处。");
|
||
|
|
// }
|
||
|
|
// if(Integer.valueOf(queryList.get(0).get("total")+"")>num-1){
|
||
|
|
// return new RestResult(Constant.FAILED, "该车辆本月临时停车预约申请正在审批中,请稍后再试。");
|
||
|
|
// }
|
||
|
|
/*List<Map<String, Object>> dictionaryInfo2 = greenDictionaryInfoController.getDictionaryInfo("temporaryParkingTip1");
|
||
|
|
List<Map<String, Object>> dictionaryInfo3 = greenDictionaryInfoController.getDictionaryInfo("temporaryParkingTip2");
|
||
|
|
if(Integer.valueOf(queryList.get(1).get("total")+"")>num-1){
|
||
|
|
return new RestResult(Constant.FAILED,dictionaryInfo2.get(0).get("data_value")+"");
|
||
|
|
}
|
||
|
|
if(Integer.valueOf(queryList.get(0).get("total")+"")>num-1){
|
||
|
|
return new RestResult(Constant.FAILED, dictionaryInfo3.get(0).get("data_value")+"");
|
||
|
|
} */
|
||
|
|
// 申请时间
|
||
|
|
greenTempParkInfo.setApplyTime(new SimpleDateFormat(DateUtil.Y_M_DH_MI_S).format(new Date()));
|
||
|
|
// 创建者
|
||
|
|
greenTempParkInfo.setCreator(greenTempParkInfo.getUserId().toString());
|
||
|
|
// 修改者
|
||
|
|
greenTempParkInfo.setModifier(greenTempParkInfo.getUserId().toString());
|
||
|
|
// 创建时间
|
||
|
|
greenTempParkInfo.setGmtCreated(new Date());
|
||
|
|
// 修改时间
|
||
|
|
greenTempParkInfo.setGmtModified(new Date());
|
||
|
|
// 删除标记
|
||
|
|
greenTempParkInfo.setIsDeleted("N");
|
||
|
|
// 添加临时停车信息到访客信息表
|
||
|
|
greentempparkinfoBizc.add(greenTempParkInfo);
|
||
|
|
|
||
|
|
// 添加临时停车信息到申请信息list表
|
||
|
|
GreenApplyList list = new GreenApplyList();
|
||
|
|
// 申请人id
|
||
|
|
list.setUserId(greenTempParkInfo.getUserId());
|
||
|
|
// 申请事项详情ID
|
||
|
|
list.setDetailId(greenTempParkInfo.getId());
|
||
|
|
// 申请类型
|
||
|
|
list.setApplyType("04");
|
||
|
|
// 申请类型名称
|
||
|
|
list.setApplyTypeName("临时停车");
|
||
|
|
// 申请详情1(车牌号)
|
||
|
|
list.setApplyInfo1(greenTempParkInfo.getNumberPlate());
|
||
|
|
// 申请详情2(停车周期)
|
||
|
|
list.setApplyInfo2(DateTime.dateToStr(DateTime.strToDateLong4(greenTempParkInfo.getStartTime()),"MM-dd HH:mm") +
|
||
|
|
"~" + DateTime.dateToStr( DateTime.strToDateLong4(greenTempParkInfo.getEndTime()),"MM-dd HH:mm"));
|
||
|
|
//下面试1,2,3级审批
|
||
|
|
|
||
|
|
// 一级审批部门
|
||
|
|
list.setFirstApproval(ApplyRoleConstant.TEMP_PARK_CZ);
|
||
|
|
// 一级审批状态(默认待审批)
|
||
|
|
// list.setFirstStatus(Constant.APPROVAL_DOING);
|
||
|
|
|
||
|
|
// 二级审批部门
|
||
|
|
list.setSecondApproval(ApplyRoleConstant.TEMP_PARK_APPROVE);
|
||
|
|
// 二级审批状态(默认待授权)
|
||
|
|
// list.setSecondStatus(Constant.APPROVAL_DOING);
|
||
|
|
//三级审批
|
||
|
|
list.setThirdApproval(ApplyRoleConstant.TEMP_PARK_AUTHORIZE);
|
||
|
|
//三级审批状态(默认待授权)
|
||
|
|
// list.setThirdStatus(Constant.AUTHORIZE_DOING);
|
||
|
|
//下面注释是1和2级审批的
|
||
|
|
/*// 二级审批部门
|
||
|
|
list.setFirstApproval(ApplyRoleConstant.TEMP_PARK_APPROVE);
|
||
|
|
// 二级审批状态(默认待授权)
|
||
|
|
list.setFirstStatus(Constant.APPROVAL_DOING);
|
||
|
|
//三级审批
|
||
|
|
list.setSecondApproval(ApplyRoleConstant.TEMP_PARK_AUTHORIZE);
|
||
|
|
//三级审批状态(默认待授权)
|
||
|
|
list.setSecondStatus(Constant.AUTHORIZE_DOING);*/
|
||
|
|
|
||
|
|
// 申请时间
|
||
|
|
list.setApplyTime(greenTempParkInfo.getApplyTime());
|
||
|
|
// 创建者
|
||
|
|
list.setCreator(greenTempParkInfo.getUserId().toString());
|
||
|
|
// 修改者
|
||
|
|
list.setModifier(greenTempParkInfo.getUserId().toString());
|
||
|
|
// 创建时间
|
||
|
|
list.setGmtCreated(new Date());
|
||
|
|
// 修改时间
|
||
|
|
list.setGmtModified(new Date());
|
||
|
|
// 删除标识
|
||
|
|
list.setIsDeleted("N");
|
||
|
|
//领导审批id
|
||
|
|
list.setLeadId(greenTempParkInfo.getApplyUserid());
|
||
|
|
// 添加申请到申请list表
|
||
|
|
greenApplyListBizc.add(list);
|
||
|
|
|
||
|
|
/*// 根据角色名称查询临时停车申请审批的用户
|
||
|
|
String parkAppSql = "SELECT ui.login_name as longName FROM green_role role , green_user_role_rel roler LEFT JOIN green_user_info ui ON roler.user_id = ui.id where role.role_code = 'temp_park_approve' AND role.id = roler.role_id and roler.is_deleted='N' and ui.is_deleted='N'";
|
||
|
|
|
||
|
|
List<Map<String,Object>> parkAppList = hibernateDao.queryForListWithSql(parkAppSql.toString());
|
||
|
|
// 推送消息给临时停车申请审批用户
|
||
|
|
final ExecutorService taskExecutorService = Executors.newFixedThreadPool(2);
|
||
|
|
|
||
|
|
for (int i = 0; i < parkAppList.size(); i++) {
|
||
|
|
final String msgname = "审批通知";
|
||
|
|
final String tm = "您有一个【临时停车申请】待审批";
|
||
|
|
|
||
|
|
final String userName = parkAppList.get(i).get("longName").toString();
|
||
|
|
taskExecutorService.execute(new Runnable() {
|
||
|
|
|
||
|
|
public void run() {
|
||
|
|
|
||
|
|
try {
|
||
|
|
PushMessageUtil.getInstance().pushMessage(msgname, tm, userName,hibernateDao);
|
||
|
|
} catch (IOException e) {
|
||
|
|
// TODO Auto-generated catch block
|
||
|
|
e.printStackTrace();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
}*/
|
||
|
|
System.out.println("123===parckSave=:"+greenTempParkInfo.getLoginName());
|
||
|
|
String msgname = "审批通知";
|
||
|
|
String tm = "您有一个【临时停车申请】待审批";
|
||
|
|
String userName = greenTempParkInfo.getLoginName();
|
||
|
|
// 推送消息给申请人
|
||
|
|
PushMessageUtil.getInstance().pushMessage(msgname, tm, userName,hibernateDao);
|
||
|
|
|
||
|
|
//greenOperateLogBizc.addLog(Constant.TEMP_PARK, Constant.APPLY, Constant.OPERATE_SUCCESS, "提交临时停车申请", Constant.LOG_OPERATE, greenTempParkInfo.getUserId());
|
||
|
|
return new RestResult(Constant.SUCCESS, "申请成功");
|
||
|
|
} catch (ServiceValidatorBaseException e) {
|
||
|
|
// greenOperateLogBizc.addLog(Constant.TEMP_PARK, Constant.APPLY, Constant.OPERATE_FAIL, "提交临时停车申请", Constant.LOG_ERROR, greenTempParkInfo.getUserId());
|
||
|
|
//设置手动回滚
|
||
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||
|
|
e.printStackTrace();
|
||
|
|
return new RestResult(Constant.FAILED,e.getMessage());
|
||
|
|
} catch (Exception e) {
|
||
|
|
// greenOperateLogBizc.addLog(Constant.TEMP_PARK, Constant.APPLY, Constant.OPERATE_FAIL, "提交临时停车申请", Constant.LOG_ERROR, greenTempParkInfo.getUserId());
|
||
|
|
//设置手动回滚
|
||
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||
|
|
e.printStackTrace();
|
||
|
|
return new RestResult(Constant.FAILED, "申请失败");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 根据id查询临时停车预约详情
|
||
|
|
*
|
||
|
|
* @param id
|
||
|
|
* @param applyType
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
@SuppressWarnings("unchecked")
|
||
|
|
public List<Object> getTempParkInfo(String id, String applyType,String userId) {
|
||
|
|
// 根据用户id查询该用户具有的权限
|
||
|
|
List<Map<String, Object>> queryRoleList = greenUserInfoController.queryRoleById(userId);
|
||
|
|
if (queryRoleList.size() <= 0) {
|
||
|
|
|
||
|
|
}
|
||
|
|
String userRoleStr = "";
|
||
|
|
String[] userRoleArr = null;
|
||
|
|
if(queryRoleList.get(0).get("userRole") != null && !"".equals(queryRoleList.get(0).get("userRole"))){
|
||
|
|
// 切割查询的权限
|
||
|
|
userRoleArr = queryRoleList.get(0).get("userRole").toString().split(",");
|
||
|
|
for (String value : userRoleArr) {
|
||
|
|
userRoleStr = userRoleStr + "'" + value + "',";
|
||
|
|
}
|
||
|
|
userRoleStr = "(" + userRoleStr.substring(0, userRoleStr.length() - 1) + ")";
|
||
|
|
}else{
|
||
|
|
userRoleArr =new String[]{"1"};
|
||
|
|
userRoleStr = "(1)";
|
||
|
|
}
|
||
|
|
//临时停车三级审批详情
|
||
|
|
String applyInfoByIdSql = " SELECT ui.real_name realName,dp.name departmentName,tpi.*,al.detail_id,al.apply_type,al.apply_type_name,al.first_approval,al.first_status,al.second_approval,al.second_status,third_approval, al.third_status,al.first_approve_time,al.second_approve_time,al.third_approve_time,gd.name AS stay_area_name,"
|
||
|
|
|
||
|
|
+ " CASE first_status WHEN '0' THEN '待审批' WHEN '1' THEN '已同意' WHEN '2' THEN '已拒绝' WHEN '3' THEN '已取消' END AS first_status_value,"
|
||
|
|
+ " CASE second_status WHEN '0' THEN '待审批' WHEN '1' THEN '已同意' WHEN '2' THEN '已拒绝' WHEN '3' THEN '已取消' END AS second_status_value,"
|
||
|
|
+ " CASE third_status WHEN '6' THEN '待授权' WHEN '7' THEN '已授权' END AS third_status_value,";
|
||
|
|
if(Arrays.asList(userRoleArr).contains(ApplyRoleConstant.TEMP_PARK_CZ)){
|
||
|
|
applyInfoByIdSql += "al.first_status as allStatus ";
|
||
|
|
|
||
|
|
}else if(Arrays.asList(userRoleArr).contains(ApplyRoleConstant.TEMP_PARK_CZ) && Arrays.asList(userRoleArr).contains(ApplyRoleConstant.TEMP_PARK_APPROVE)){
|
||
|
|
applyInfoByIdSql += "IF(al.first_status = '1',al.second_status,al.first_status) as allStatus";
|
||
|
|
}else{
|
||
|
|
applyInfoByIdSql += "IF(al.first_status = '1',if(al.second_status='1',al.third_status,al.second_status),al.first_status) as allStatus";
|
||
|
|
}
|
||
|
|
applyInfoByIdSql += " FROM GREEN_TEMP_PARK_INFO tpi INNER JOIN GREEN_APPLY_LIST al ON tpi.id = al.detail_id"
|
||
|
|
+ " INNER JOIN GREEN_DEPARTMENT gd ON tpi.stay_area = gd.id "
|
||
|
|
+ " LEFT JOIN green_user_info ui ON tpi.user_id = ui.id "
|
||
|
|
+ " LEFT JOIN green_department dp ON ui.department_id = dp.id "
|
||
|
|
+ " WHERE tpi.id = ? AND al.apply_type = ?";
|
||
|
|
|
||
|
|
/*//临时停车二级审批详情
|
||
|
|
String applyInfoByIdSql = " SELECT ui.real_name realName,dp.name departmentName,tpi.*,al.detail_id,al.apply_type,al.apply_type_name,al.first_approval,al.first_status,al.second_approval,al.second_status,third_approval, al.third_status,al.first_approve_time,al.second_approve_time,al.third_approve_time,gd.name AS stay_area_name,"
|
||
|
|
+ " CASE first_status WHEN '0' THEN '待审批' WHEN '1' THEN '已同意' WHEN '2' THEN '已拒绝' WHEN '3' THEN '已取消' END AS first_status_value,"
|
||
|
|
+ " CASE second_status WHEN '6' THEN '待授权' WHEN '7' THEN '已授权' END AS second_status_value"
|
||
|
|
+ " FROM GREEN_TEMP_PARK_INFO tpi INNER JOIN GREEN_APPLY_LIST al ON tpi.id = al.detail_id"
|
||
|
|
+ " INNER JOIN GREEN_DEPARTMENT gd ON tpi.stay_area = gd.id "
|
||
|
|
+ " LEFT JOIN green_user_info ui ON tpi.user_id = ui.id "
|
||
|
|
+ " LEFT JOIN green_department dp ON ui.department_id = dp.id "
|
||
|
|
+ " WHERE tpi.id = ? AND al.apply_type = ?";*/
|
||
|
|
|
||
|
|
return hibernateDao.queryForListWithSql(applyInfoByIdSql, new Object[] { id, applyType });
|
||
|
|
}
|
||
|
|
@SuppressWarnings({ "unchecked", "unused" })
|
||
|
|
@RequestMapping(value = "/getPlateNumList", method = RequestMethod.POST)
|
||
|
|
public RestResult getPlateNumberList(@RequestBody Object requestBody,HttpServletRequest request){
|
||
|
|
|
||
|
|
GreenTempParkInfo greenTempParkInfo = new ObjectMapper().convertValue(requestBody, new TypeReference<GreenTempParkInfo>() {});
|
||
|
|
|
||
|
|
List<Map<String, Object>> dictionaryInfo = greenDictionaryInfoController.getDictionaryInfo("getPlateNum");
|
||
|
|
int getVisitNum = Integer.valueOf(dictionaryInfo.get(0).get("data_value")+"");
|
||
|
|
|
||
|
|
String visitorSql = "select al.apply_info_1 numberPlate from green_apply_list al where al.is_deleted = 'N' AND al.apply_type = '04' and user_id = ? "
|
||
|
|
+ " GROUP BY al.apply_info_1 ORDER BY count(apply_info_1) DESC LIMIT 0,"+getVisitNum;
|
||
|
|
List<HashMap<String, String>> list = hibernateDao.queryForListWithSql(visitorSql,new Object[]{greenTempParkInfo.getUserId()});
|
||
|
|
|
||
|
|
return new RestResult(Constant.SUCCESS, list);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|