| | |
| | | protected static final int DEFAULT_ORDER = 1; |
| | | //默认序列 |
| | | protected static final int DEFAULT_SEQ = 1; |
| | | protected static final int MAX_ROW = 50; |
| | | protected static final int MAX_ROW = 10000; |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | |
| | | import com.java110.dto.unit.FloorAndUnitDto; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.ServiceCodeAdvertConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.vo.api.advert.ApiAdvertDataVo; |
| | | import com.java110.vo.api.advert.ApiAdvertVo; |
| | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | super.validatePageInfo(reqJson); |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含小区信息"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.java110.core.smo.advert.IAdvertInnerServiceSMO; |
| | | import com.java110.core.smo.advert.IAdvertItemInnerServiceSMO; |
| | | import com.java110.core.smo.file.IFileInnerServiceSMO; |
| | | import com.java110.core.smo.file.IFileRelInnerServiceSMO; |
| | | import com.java110.dto.advert.AdvertDto; |
| | | import com.java110.dto.advert.AdvertItemDto; |
| | | import com.java110.dto.file.FileDto; |
| | | import com.java110.dto.file.FileRelDto; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | |
| | | |
| | | @Autowired |
| | | private IFileInnerServiceSMO fileInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFileRelInnerServiceSMO fileRelInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | |
| | | AppService service = event.getAppService(); |
| | | //添加单元信息 |
| | | businesses.add(updateAdvert(reqJson, context)); |
| | | /* if (hasKeyAndValue(reqJson, "photos") && reqJson.getJSONArray("photos").size() > 0) { |
| | | |
| | | AdvertItemDto advertItemDto = new AdvertItemDto(); |
| | | advertItemDto.setAdvertId(reqJson.getString("advertId")); |
| | | advertItemDto.setItemTypeCds(new String[]{"8888", "9999"}); |
| | | List<AdvertItemDto> advertItemDtos = advertItemInnerServiceSMOImpl.queryAdvertItems(advertItemDto); |
| | | |
| | | //删除照片或视频 |
| | | for (AdvertItemDto tmpAdvertItemDto : advertItemDtos) { |
| | | businesses.add(delAdvertItemPhotoOrVideo(tmpAdvertItemDto, context)); |
| | | } |
| | | |
| | | //删除文件和 广告的关系 |
| | | FileRelDto fileRelDto = new FileRelDto(); |
| | | fileRelDto.setObjId(reqJson.getString("advertId")); |
| | | fileRelDto.setRelTypeCds(new String[]{"40000","50000"}); |
| | | List<FileRelDto> fileRelDtos = fileRelInnerServiceSMOImpl.queryFileRels(fileRelDto); |
| | | for (FileRelDto tmpFileRelDto : fileRelDtos) { |
| | | businesses.add(delAdvertFileRel(tmpFileRelDto, context)); |
| | | } |
| | | |
| | | if (hasKeyAndValue(reqJson, "photos") && reqJson.getJSONArray("photos").size() > 0) { |
| | | JSONArray photos = reqJson.getJSONArray("photos"); |
| | | for (int _photoIndex = 0; _photoIndex < photos.size(); _photoIndex++) { |
| | | businesses.add(addAdvertItemPhoto(reqJson, context, photos.getString(_photoIndex))); |
| | |
| | | } else { |
| | | businesses.add(addAdvertItemVedio(reqJson, context)); |
| | | businesses.add(addAdvertFileRel(reqJson, context, "50000")); |
| | | }*/ |
| | | } |
| | | |
| | | |
| | | JSONObject paramInObj = super.restToCenterProtocol(businesses, context.getRequestCurrentHeaders()); |
| | |
| | | ResponseEntity<String> responseEntity = this.callService(context, service.getServiceCode(), paramInObj); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | /** |
| | | * 删除所有的照片或视频信息 |
| | | * |
| | | * @param advertItemDto |
| | | * @param context |
| | | * @return |
| | | */ |
| | | private JSONObject delAdvertItemPhotoOrVideo(AdvertItemDto advertItemDto, DataFlowContext context) { |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_ADVERT_ITEM); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessAdvertItem = new JSONObject(); |
| | | businessAdvertItem.put("advertItemId", advertItemDto.getAdvertItemId()); |
| | | businessAdvertItem.put("communityId", advertItemDto.getCommunityId()); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessAdvertItem", businessAdvertItem); |
| | | return business; |
| | | } |
| | | |
| | | private JSONObject addAdvertItemPhoto(JSONObject paramInJson, DataFlowContext dataFlowContext, String photo) { |
| | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_ADVERT_ITEM); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ + 1); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessAdvertItem = new JSONObject(); |
| | | businessAdvertItem.put("advertId", paramInJson.getString("advertId")); |
| | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_ADVERT_ITEM); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ + 1); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessAdvertItem = new JSONObject(); |
| | | businessAdvertItem.put("advertId", paramInJson.getString("advertId")); |
| | |
| | | return business; |
| | | } |
| | | |
| | | /** |
| | | * 删除广告文件关系 |
| | | * |
| | | * @param fileRelDto 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | private JSONObject delAdvertFileRel(FileRelDto fileRelDto, DataFlowContext dataFlowContext) { |
| | | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_FILE_REL); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ + 1); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessUnit = new JSONObject(); |
| | | businessUnit.put("fileRelId", fileRelDto.getFileRelId()); |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessFileRel", businessUnit); |
| | | return business; |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeAdvertConstant.UPDATE_ADVERT; |
| New file |
| | |
| | | package com.java110.api.listener.applicationKey; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.community.ICommunityInnerServiceSMO; |
| | | import com.java110.core.smo.floor.IFloorInnerServiceSMO; |
| | | import com.java110.core.smo.hardwareAdapation.IApplicationKeyInnerServiceSMO; |
| | | import com.java110.core.smo.hardwareAdapation.IMachineInnerServiceSMO; |
| | | import com.java110.core.smo.room.IRoomInnerServiceSMO; |
| | | import com.java110.core.smo.unit.IUnitInnerServiceSMO; |
| | | import com.java110.dto.RoomDto; |
| | | import com.java110.dto.community.CommunityDto; |
| | | import com.java110.dto.hardwareAdapation.ApplicationKeyDto; |
| | | import com.java110.dto.hardwareAdapation.MachineDto; |
| | | import com.java110.dto.unit.FloorAndUnitDto; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.ServiceCodeApplicationKeyConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 钥匙认证接口 |
| | | */ |
| | | @Java110Listener("authApplicationKeyListener") |
| | | public class AuthApplicationKeyListener extends AbstractServiceApiListener { |
| | | private static Logger logger = LoggerFactory.getLogger(AuthApplicationKeyListener.class); |
| | | |
| | | |
| | | @Autowired |
| | | private IApplicationKeyInnerServiceSMO applicationKeyInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IMachineInnerServiceSMO machineInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private ICommunityInnerServiceSMO communityInnerServiceSMOImpl; |
| | | |
| | | |
| | | @Autowired |
| | | private IFloorInnerServiceSMO floorInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IUnitInnerServiceSMO unitInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IRoomInnerServiceSMO roomInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeApplicationKeyConstant.AUTH_APPLICATIONKEYS; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | public IApplicationKeyInnerServiceSMO getApplicationKeyInnerServiceSMOImpl() { |
| | | return applicationKeyInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setApplicationKeyInnerServiceSMOImpl(IApplicationKeyInnerServiceSMO applicationKeyInnerServiceSMOImpl) { |
| | | this.applicationKeyInnerServiceSMOImpl = applicationKeyInnerServiceSMOImpl; |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区"); |
| | | Assert.hasKeyAndValue(reqJson, "machineCode", "必填,请填写设备编码"); |
| | | Assert.hasKeyAndValue(reqJson, "pwd", "必填,请填写密码"); |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | |
| | | //1.0 根据 小区ID和 设备编码查询设备ID |
| | | |
| | | MachineDto machineDto = new MachineDto(); |
| | | machineDto.setMachineCode(reqJson.getString("machineCode")); |
| | | machineDto.setCommunityId(reqJson.getString("communityId")); |
| | | List<MachineDto> machineDtos = machineInnerServiceSMOImpl.queryMachines(machineDto); |
| | | |
| | | Assert.listOnlyOne(machineDtos, "根据设备编码为找到设备Id 或找到多条"); |
| | | |
| | | ApplicationKeyDto applicationKeyDto = new ApplicationKeyDto(); |
| | | applicationKeyDto.setCommunityId(reqJson.getString("communityId")); |
| | | applicationKeyDto.setMachineId(machineDtos.get(0).getMachineId()); |
| | | applicationKeyDto.setPwd(reqJson.getString("pwd")); |
| | | |
| | | int count = applicationKeyInnerServiceSMOImpl.queryApplicationKeysCount(applicationKeyDto); |
| | | |
| | | ResponseEntity<String> responseEntity = null; |
| | | JSONObject reqParam = new JSONObject(); |
| | | reqParam.put("communityId", reqJson.getString("communityId")); |
| | | reqParam.put("machineId", machineDtos.get(0).getMachineId()); |
| | | reqParam.put("machineCode", reqJson.getString("machineCode")); |
| | | if (count > 0) { |
| | | reqParam.put("recordTypeCd", "8888"); |
| | | responseEntity = new ResponseEntity<String>("成功", HttpStatus.OK); |
| | | } else { |
| | | reqParam.put("recordTypeCd", "6666"); |
| | | responseEntity = new ResponseEntity<String>("认证失败", HttpStatus.UNAUTHORIZED); |
| | | } |
| | | context.setResponseEntity(responseEntity); |
| | | |
| | | HttpHeaders header = new HttpHeaders(); |
| | | context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D"); |
| | | JSONArray businesses = new JSONArray(); |
| | | |
| | | AppService service = event.getAppService(); |
| | | |
| | | //添加单元信息 |
| | | businesses.add(addMachineRecord(reqParam, context)); |
| | | |
| | | |
| | | JSONObject paramInObj = super.restToCenterProtocol(businesses, context.getRequestCurrentHeaders()); |
| | | |
| | | //将 rest header 信息传递到下层服务中去 |
| | | super.freshHttpHeader(header, context.getRequestCurrentHeaders()); |
| | | |
| | | responseEntity = this.callService(context, service.getServiceCode(), paramInObj); |
| | | |
| | | logger.debug("同步开门记录或访客留影" + responseEntity); |
| | | |
| | | //context.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | private JSONObject addMachineRecord(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | //paramInJson.put("fileTime", DateUtil.getFormatTimeString(new Date(), DateUtil.DATE_FORMATE_STRING_A)); |
| | | paramInJson.put("name", "匿名"); |
| | | paramInJson.put("tel", ""); |
| | | paramInJson.put("idCard", ""); |
| | | paramInJson.put("openTypeCd", "2000"); |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_MACHINE_RECORD); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessMachineRecord = new JSONObject(); |
| | | businessMachineRecord.putAll(paramInJson); |
| | | businessMachineRecord.put("machineRecordId", "-1"); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessMachineRecord", businessMachineRecord); |
| | | return business; |
| | | } |
| | | |
| | | |
| | | private void refreshMachines(List<ApplicationKeyDto> applicationKeyDtos) { |
| | | |
| | | //批量处理 小区 |
| | | refreshCommunitys(applicationKeyDtos); |
| | | |
| | | //批量处理单元信息 |
| | | refreshUnits(applicationKeyDtos); |
| | | |
| | | //批量处理 房屋信息 |
| | | refreshRooms(applicationKeyDtos); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取批量小区 |
| | | * |
| | | * @param applicationKeyDtos 设备信息 |
| | | * @return 批量userIds 信息 |
| | | */ |
| | | private void refreshCommunitys(List<ApplicationKeyDto> applicationKeyDtos) { |
| | | List<String> communityIds = new ArrayList<String>(); |
| | | List<ApplicationKeyDto> tmpApplicationKeyDtos = new ArrayList<>(); |
| | | for (ApplicationKeyDto applicationKeyDto : applicationKeyDtos) { |
| | | |
| | | if (!"2000".equals(applicationKeyDto.getLocationTypeCd()) |
| | | && !"3000".equals(applicationKeyDto.getLocationTypeCd()) |
| | | ) { |
| | | communityIds.add(applicationKeyDto.getLocationObjId()); |
| | | tmpApplicationKeyDtos.add(applicationKeyDto); |
| | | } |
| | | } |
| | | |
| | | if (communityIds.size() < 1) { |
| | | return; |
| | | } |
| | | String[] tmpCommunityIds = communityIds.toArray(new String[communityIds.size()]); |
| | | |
| | | CommunityDto communityDto = new CommunityDto(); |
| | | communityDto.setCommunityIds(tmpCommunityIds); |
| | | //根据 userId 查询用户信息 |
| | | List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto); |
| | | |
| | | for (ApplicationKeyDto applicationKeyDto : tmpApplicationKeyDtos) { |
| | | for (CommunityDto tmpCommunityDto : communityDtos) { |
| | | if (applicationKeyDto.getLocationObjId().equals(tmpCommunityDto.getCommunityId())) { |
| | | applicationKeyDto.setLocationObjName(tmpCommunityDto.getName() + " " + applicationKeyDto.getLocationTypeName()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取批量单元 |
| | | * |
| | | * @param applicationKeyDtos 设备信息 |
| | | * @return 批量userIds 信息 |
| | | */ |
| | | private void refreshUnits(List<ApplicationKeyDto> applicationKeyDtos) { |
| | | List<String> unitIds = new ArrayList<String>(); |
| | | List<ApplicationKeyDto> tmpApplicationKeyDtos = new ArrayList<>(); |
| | | for (ApplicationKeyDto applicationKeyDto : applicationKeyDtos) { |
| | | |
| | | if ("2000".equals(applicationKeyDto.getLocationTypeCd())) { |
| | | unitIds.add(applicationKeyDto.getLocationObjId()); |
| | | tmpApplicationKeyDtos.add(applicationKeyDto); |
| | | } |
| | | } |
| | | |
| | | if (unitIds.size() < 1) { |
| | | return; |
| | | } |
| | | String[] tmpUnitIds = unitIds.toArray(new String[unitIds.size()]); |
| | | |
| | | FloorAndUnitDto floorAndUnitDto = new FloorAndUnitDto(); |
| | | floorAndUnitDto.setUnitIds(tmpUnitIds); |
| | | //根据 userId 查询用户信息 |
| | | List<FloorAndUnitDto> unitDtos = unitInnerServiceSMOImpl.getFloorAndUnitInfo(floorAndUnitDto); |
| | | |
| | | for (ApplicationKeyDto applicationKeyDto : tmpApplicationKeyDtos) { |
| | | for (FloorAndUnitDto tmpUnitDto : unitDtos) { |
| | | if (applicationKeyDto.getLocationObjId().equals(tmpUnitDto.getUnitId())) { |
| | | applicationKeyDto.setLocationObjName(tmpUnitDto.getFloorNum() + "栋" + tmpUnitDto.getUnitNum() + "单元"); |
| | | BeanConvertUtil.covertBean(tmpUnitDto, applicationKeyDto); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取批量单元 |
| | | * |
| | | * @param applicationKeyDtos 设备信息 |
| | | * @return 批量userIds 信息 |
| | | */ |
| | | private void refreshRooms(List<ApplicationKeyDto> applicationKeyDtos) { |
| | | List<String> roomIds = new ArrayList<String>(); |
| | | List<ApplicationKeyDto> tmpApplicationKeyDtos = new ArrayList<>(); |
| | | for (ApplicationKeyDto applicationKeyDto : applicationKeyDtos) { |
| | | |
| | | if ("3000".equals(applicationKeyDto.getLocationTypeCd())) { |
| | | roomIds.add(applicationKeyDto.getLocationObjId()); |
| | | tmpApplicationKeyDtos.add(applicationKeyDto); |
| | | } |
| | | } |
| | | if (roomIds.size() < 1) { |
| | | return; |
| | | } |
| | | String[] tmpRoomIds = roomIds.toArray(new String[roomIds.size()]); |
| | | |
| | | RoomDto roomDto = new RoomDto(); |
| | | roomDto.setRoomIds(tmpRoomIds); |
| | | roomDto.setCommunityId(applicationKeyDtos.get(0).getCommunityId()); |
| | | //根据 userId 查询用户信息 |
| | | List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto); |
| | | |
| | | for (ApplicationKeyDto applicationKeyDto : tmpApplicationKeyDtos) { |
| | | for (RoomDto tmpRoomDto : roomDtos) { |
| | | if (applicationKeyDto.getLocationObjId().equals(tmpRoomDto.getRoomId())) { |
| | | applicationKeyDto.setLocationObjName(tmpRoomDto.getFloorNum() + "栋" + tmpRoomDto.getUnitNum() + "单元" + tmpRoomDto.getRoomNum() + "室"); |
| | | BeanConvertUtil.covertBean(tmpRoomDto, applicationKeyDto); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | public IFloorInnerServiceSMO getFloorInnerServiceSMOImpl() { |
| | | return floorInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setFloorInnerServiceSMOImpl(IFloorInnerServiceSMO floorInnerServiceSMOImpl) { |
| | | this.floorInnerServiceSMOImpl = floorInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public IUnitInnerServiceSMO getUnitInnerServiceSMOImpl() { |
| | | return unitInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setUnitInnerServiceSMOImpl(IUnitInnerServiceSMO unitInnerServiceSMOImpl) { |
| | | this.unitInnerServiceSMOImpl = unitInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public IRoomInnerServiceSMO getRoomInnerServiceSMOImpl() { |
| | | return roomInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setRoomInnerServiceSMOImpl(IRoomInnerServiceSMO roomInnerServiceSMOImpl) { |
| | | this.roomInnerServiceSMOImpl = roomInnerServiceSMOImpl; |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.utils.util.DateUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | |
| | | /** |
| | | * 保存小区侦听 |
| | |
| | | Assert.hasKeyAndValue(reqJson, "locationTypeCd", "必填,位置不能为空"); |
| | | Assert.hasKeyAndValue(reqJson, "locationObjId", "必填,未选择位置对象"); |
| | | Assert.hasKeyAndValue(reqJson, "storeId", "必填,请填写商户ID"); |
| | | Assert.hasKeyAndValue(reqJson, "typeFlag", "必填,请选择钥匙类型"); |
| | | |
| | | } |
| | | |
| | |
| | | businessApplicationKey.put("machineId", machineDtos.get(0).getMachineId()); |
| | | businessApplicationKey.put("applicationKeyId", "-1"); |
| | | businessApplicationKey.put("state", "10002"); |
| | | businessApplicationKey.put("pwd",this.getRandom()); |
| | | if("1100103".equals(paramInJson.getString("typeFlag"))){ // 临时访问密码,只设置成24小时 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.add(Calendar.HOUR, 24); |
| | | businessApplicationKey.put("endTime", DateUtil.getFormatTimeString(calendar.getTime(),DateUtil.DATE_FORMATE_STRING_A)); |
| | | } |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessApplicationKey", businessApplicationKey); |
| | | return business; |
| | | } |
| | | |
| | | /** |
| | | * 获取随机数 |
| | | * |
| | | * @return |
| | | */ |
| | | private String getRandom() { |
| | | Random random = new Random(); |
| | | String result = ""; |
| | | for (int i = 0; i < 6; i++) { |
| | | result += random.nextInt(10); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * `msg_type` varchar(12) not null comment '消息类型 10001 公告,10002 钥匙审核,10003 小区入驻审核,10004 小区添加审核', |
| | | * `title` varchar(30) NOT NULL COMMENT '消息标题', |
| | | * `url` varchar(100) NOT NULL COMMENT '消息路径', |
| | |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | Assert.hasKeyAndValue(reqJson, "endTime", "必填,请选择结束时间"); |
| | | Assert.hasKeyAndValue(reqJson, "locationTypeCd", "必填,位置不能为空"); |
| | | Assert.hasKeyAndValue(reqJson, "locationObjId", "必填,未选择位置对象"); |
| | | Assert.hasKeyAndValue(reqJson, "typeFlag", "必填,未选择钥匙类型"); |
| | | |
| | | } |
| | | |
| | |
| | | businessApplicationKey.putAll(paramInJson); |
| | | businessApplicationKey.put("machineId", machineDtos.get(0).getMachineId()); |
| | | businessApplicationKey.put("state", applicationKeyDtos.get(0).getState()); |
| | | if(!paramInJson.containsKey("pwd") || StringUtil.isEmpty(paramInJson.getString("pwd"))) { |
| | | businessApplicationKey.put("pwd", applicationKeyDtos.get(0).getPwd()); |
| | | } |
| | | if("1100103".equals(paramInJson.getString("typeFlag"))){ // 临时访问密码,只设置成24小时 |
| | | businessApplicationKey.put("endTime", applicationKeyDtos.get(0).getEndTime()); |
| | | } |
| | | businessApplicationKey.put("typeFlag", applicationKeyDtos.get(0).getTypeCd()); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessApplicationKey", businessApplicationKey); |
| | | return business; |
| | |
| | | fileRelDto.setRelTypeCd("30000"); |
| | | fileRelDto.setObjId(paramInJson.getString("applicationKeyId")); |
| | | List<FileRelDto> fileRelDtos = fileRelInnerServiceSMOImpl.queryFileRels(fileRelDto); |
| | | if(fileRelDtos == null || fileRelDtos.size() == 0){ |
| | | if (fileRelDtos == null || fileRelDtos.size() == 0) { |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FILE_REL); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ + 2); |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | public IMachineInnerServiceSMO getMachineInnerServiceSMOImpl() { |
| | | return machineInnerServiceSMOImpl; |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.core.smo.file.IFileInnerServiceSMO; |
| | | import com.java110.dto.file.FileDto; |
| | | import com.java110.utils.constant.*; |
| | | import com.java110.utils.exception.ListenerExecuteException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.AppService; |
| | |
| | | |
| | | |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 保存小区侦听 |
| | |
| | | */ |
| | | @Java110Listener("saveMachineRecordListener") |
| | | public class SaveMachineRecordListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private IFileInnerServiceSMO fileInnerServiceSMOImpl; |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | |
| | | Assert.hasKeyAndValue(reqJson, "tel", "必填,请填写用户手机号"); |
| | | Assert.hasKeyAndValue(reqJson, "idCard", "必填,请填写身份证"); |
| | | |
| | | Map<String, String> headers = event.getDataFlowContext().getRequestHeaders(); |
| | | Assert.hasKeyAndValue(headers, "communityid", "必填,请填写小区ID"); |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | Map<String, String> headers = event.getDataFlowContext().getRequestHeaders(); |
| | | String communityId = headers.get("communityid"); |
| | | |
| | | HttpHeaders header = new HttpHeaders(); |
| | | context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D"); |
| | |
| | | |
| | | //添加单元信息 |
| | | businesses.add(addMachineRecord(reqJson, context)); |
| | | |
| | | if (reqJson.containsKey("photo") && !StringUtils.isEmpty(reqJson.getString("photo"))) { |
| | | FileDto fileDto = new FileDto(); |
| | | fileDto.setFileId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_file_id)); |
| | | fileDto.setFileName(fileDto.getFileId()); |
| | | fileDto.setContext(reqJson.getString("photo")); |
| | | fileDto.setSuffix("jpeg"); |
| | | fileDto.setCommunityId(communityId); |
| | | if (fileInnerServiceSMOImpl.saveFile(fileDto) < 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "保存文件出错"); |
| | | } |
| | | reqJson.put("photoId", fileDto.getFileId()); |
| | | |
| | | businesses.add(addPhoto(reqJson, context)); |
| | | |
| | | } |
| | | |
| | | JSONObject paramInObj = super.restToCenterProtocol(businesses, context.getRequestCurrentHeaders()); |
| | | |
| | |
| | | */ |
| | | private JSONObject addMachineRecord(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | |
| | | String machineRecordId = GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_machineRecordId); |
| | | paramInJson.put("machineRecordId",machineRecordId); |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_MACHINE_RECORD); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessMachineRecord = new JSONObject(); |
| | | businessMachineRecord.putAll(paramInJson); |
| | | businessMachineRecord.put("machineRecordId", "-1"); |
| | | businessMachineRecord.put("machineRecordId", machineRecordId); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessMachineRecord", businessMachineRecord); |
| | | return business; |
| | | } |
| | | |
| | | /** |
| | | * 添加物业费用 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | private JSONObject addPhoto(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FILE_REL); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ + 2); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessUnit = new JSONObject(); |
| | | businessUnit.put("fileRelId", "-1"); |
| | | businessUnit.put("relTypeCd", "60000"); |
| | | businessUnit.put("saveWay", "table"); |
| | | businessUnit.put("objId", paramInJson.getString("machineRecordId")); |
| | | businessUnit.put("fileRealName", paramInJson.getString("photoId")); |
| | | businessUnit.put("fileSaveName", paramInJson.getString("photoId")); |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessFileRel", businessUnit); |
| | | |
| | | return business; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.java110.core.smo.hardwareAdapation.IMachineInnerServiceSMO; |
| | | import com.java110.core.smo.hardwareAdapation.IMachineTranslateInnerServiceSMO; |
| | | import com.java110.core.smo.owner.IOwnerInnerServiceSMO; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | |
| | | import com.java110.dto.community.CommunityDto; |
| | | import com.java110.dto.file.FileDto; |
| | | import com.java110.dto.file.FileRelDto; |
| | | import com.java110.dto.hardwareAdapation.ApplicationKeyDto; |
| | | import com.java110.dto.hardwareAdapation.MachineTranslateDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.cache.CommonCache; |
| | | import com.java110.utils.cache.MappingCache; |
| | |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| New file |
| | |
| | | package com.java110.api.listener.parkingSpace; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiDataFlowListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.owner.IOwnerCarInnerServiceSMO; |
| | | import com.java110.core.smo.parkingSpace.IParkingSpaceInnerServiceSMO; |
| | | |
| | | import com.java110.dto.ParkingSpaceDto; |
| | | import com.java110.dto.owner.OwnerCarDto; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.ServiceCodeConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.api.ApiParkingSpaceDataVo; |
| | | import com.java110.vo.api.ApiParkingSpaceVo; |
| | | import com.java110.vo.api.owner.ApiOwnerCarDataVo; |
| | | import com.java110.vo.api.owner.ApiOwnerCarVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName ParkingSpaceDto |
| | | * @Description 小区楼数据层侦听类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @Java110Listener("queryParkingSpaceCarsListener") |
| | | public class QueryParkingSpaceCarsListener extends AbstractServiceApiDataFlowListener { |
| | | |
| | | @Autowired |
| | | private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeConstant.SERVICE_CODE_QUERY_PARKING_SPACE_CAR; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.GET; |
| | | } |
| | | |
| | | /** |
| | | * 业务层数据处理 |
| | | * |
| | | * @param event 时间对象 |
| | | */ |
| | | @Override |
| | | public void soService(ServiceDataFlowEvent event) { |
| | | DataFlowContext dataFlowContext = event.getDataFlowContext(); |
| | | //获取请求数据 |
| | | JSONObject reqJson = dataFlowContext.getReqJson(); |
| | | validateParkingSpaceData(reqJson); |
| | | |
| | | refreshReqJson(reqJson); |
| | | |
| | | //根据车牌号去查询 车位信息 |
| | | queryParkingSpaceCar(reqJson, dataFlowContext); |
| | | return; |
| | | } |
| | | |
| | | /** |
| | | * 根据车牌号 查询 停车位 |
| | | * |
| | | * @param reqJson 请求报文 |
| | | * @param dataFlowContext 上线文对象 |
| | | */ |
| | | private void queryParkingSpaceCar(JSONObject reqJson, DataFlowContext dataFlowContext) { |
| | | |
| | | |
| | | ApiOwnerCarVo apiOwnerCarVo = new ApiOwnerCarVo(); |
| | | |
| | | int row = reqJson.getInteger("row"); |
| | | //查询总记录数 |
| | | OwnerCarDto ownerCarDto = BeanConvertUtil.covertBean(reqJson, OwnerCarDto.class); |
| | | int total = ownerCarInnerServiceSMOImpl.queryOwnerCarsCount(ownerCarDto); |
| | | apiOwnerCarVo.setTotal(total); |
| | | if (total > 0) { |
| | | List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto); |
| | | apiOwnerCarVo.setOwnerCars(BeanConvertUtil.covertBeanList(ownerCarDtos, ApiOwnerCarDataVo.class)); |
| | | } |
| | | |
| | | apiOwnerCarVo.setRecords((int) Math.ceil((double) total / (double) row)); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiOwnerCarVo), HttpStatus.OK); |
| | | dataFlowContext.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取 停车位Ids |
| | | * |
| | | * @param ownerCarDtos 业主车位 |
| | | * @return 停车位Ids |
| | | */ |
| | | private String[] getPsIds(List<OwnerCarDto> ownerCarDtos) { |
| | | List<String> psIds = new ArrayList<String>(); |
| | | for (OwnerCarDto ownerCarDto : ownerCarDtos) { |
| | | psIds.add(ownerCarDto.getPsId()); |
| | | } |
| | | |
| | | return psIds.toArray(new String[psIds.size()]); |
| | | } |
| | | |
| | | /** |
| | | * 请求数据处理 |
| | | * |
| | | * @param reqJson 请求数据对象 |
| | | */ |
| | | private void refreshReqJson(JSONObject reqJson) { |
| | | |
| | | if (!reqJson.containsKey("state")) { |
| | | return; |
| | | } |
| | | |
| | | if ("SH".equals(reqJson.getString("state"))) { |
| | | reqJson.put("states", new String[]{"S", "H"}); |
| | | reqJson.remove("state"); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 校验查询条件是否满足条件 |
| | | * |
| | | * @param reqJson 包含查询条件 |
| | | */ |
| | | private void validateParkingSpaceData(JSONObject reqJson) { |
| | | Assert.jsonObjectHaveKey(reqJson, "page", "请求中未包含page信息"); |
| | | Assert.jsonObjectHaveKey(reqJson, "row", "请求中未包含row信息"); |
| | | Assert.jsonObjectHaveKey(reqJson, "communityId", "请求中未包含communityId信息"); |
| | | Assert.isInteger(reqJson.getString("page"), "不是有效数字"); |
| | | Assert.isInteger(reqJson.getString("row"), "不是有效数字"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return super.DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | public IParkingSpaceInnerServiceSMO getParkingSpaceInnerServiceSMOImpl() { |
| | | return parkingSpaceInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setParkingSpaceInnerServiceSMOImpl(IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl) { |
| | | this.parkingSpaceInnerServiceSMOImpl = parkingSpaceInnerServiceSMOImpl; |
| | | } |
| | | |
| | | |
| | | public IOwnerCarInnerServiceSMO getOwnerCarInnerServiceSMOImpl() { |
| | | return ownerCarInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setOwnerCarInnerServiceSMOImpl(IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl) { |
| | | this.ownerCarInnerServiceSMOImpl = ownerCarInnerServiceSMOImpl; |
| | | } |
| | | } |
| | |
| | | package com.java110.community.dao; |
| | | |
| | | |
| | | import com.java110.dto.community.CommunityAttrDto; |
| | | import com.java110.dto.community.CommunityDto; |
| | | import com.java110.utils.exception.DAOException; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | int queryCommunitysCount(Map info); |
| | | |
| | | /** |
| | | * 查询小区属性 |
| | | * |
| | | * @param info |
| | | * @return |
| | | */ |
| | | int getCommunityAttrsCount(Map info); |
| | | |
| | | |
| | | } |
| | |
| | | package com.java110.community.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.dto.community.CommunityAttrDto; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.utils.util.DateUtil; |
| | |
| | | |
| | | return Integer.parseInt(businessCommunityInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | @Override |
| | | public int getCommunityAttrsCount(Map info) { |
| | | logger.debug("查询小区数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessCommunityInfos = sqlSessionTemplate.selectList("communityServiceDaoImpl.getCommunityAttrsCount", info); |
| | | if (businessCommunityInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessCommunityInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.java110.community.smo.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.dto.community.CommunityAttrDto; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.community.dao.ICommunityServiceDao; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<CommunityDto> queryCommunitys(@RequestBody CommunityDto communityDto) { |
| | | public List<CommunityAttrDto> getCommunityAttrs(@RequestBody CommunityAttrDto communityAttrDto) { |
| | | return BeanConvertUtil.covertBeanList(communityServiceDaoImpl.getCommunityAttrs(BeanConvertUtil.beanCovertMap(communityAttrDto)), CommunityAttrDto.class); |
| | | } |
| | | |
| | | @Override |
| | | public int getCommunityAttrsCount(@RequestBody CommunityAttrDto communityAttrDto) { |
| | | logger.debug("queryCommunityAttrsCount:{}", JSONObject.toJSONString(communityAttrDto)); |
| | | |
| | | return communityServiceDaoImpl.getCommunityAttrsCount(BeanConvertUtil.beanCovertMap(communityAttrDto)); |
| | | } |
| | | |
| | | @Override |
| | | public List<CommunityDto> queryCommunitys(@RequestBody CommunityDto communityDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | |
| | | businessApplicationKeyInfo.put("state", businessApplicationKeyInfo.get("state")); |
| | | businessApplicationKeyInfo.put("age", businessApplicationKeyInfo.get("age")); |
| | | businessApplicationKeyInfo.put("communityId", businessApplicationKeyInfo.get("community_id")); |
| | | businessApplicationKeyInfo.put("typeFlag", businessApplicationKeyInfo.get("type_flag")); |
| | | businessApplicationKeyInfo.put("pwd", businessApplicationKeyInfo.get("pwd")); |
| | | |
| | | businessApplicationKeyInfo.remove("bId"); |
| | | businessApplicationKeyInfo.put("statusCd", statusCd); |
| | |
| | | currentApplicationKeyInfo.put("state", currentApplicationKeyInfo.get("state")); |
| | | currentApplicationKeyInfo.put("age", currentApplicationKeyInfo.get("age")); |
| | | currentApplicationKeyInfo.put("communityId", currentApplicationKeyInfo.get("community_id")); |
| | | currentApplicationKeyInfo.put("typeFlag", currentApplicationKeyInfo.get("type_flag")); |
| | | currentApplicationKeyInfo.put("pwd", currentApplicationKeyInfo.get("pwd")); |
| | | |
| | | |
| | | |
| | |
| | | TranslateApplicationKeyToMachine applicationKeyMachine = new TranslateApplicationKeyToMachine(true); |
| | | Thread translateApplicationKeyToMachineThread = new Thread(applicationKeyMachine,"TranslateApplicationKeyToMachineThread"); |
| | | translateApplicationKeyToMachineThread.start(); |
| | | |
| | | //定时修改申请钥匙的密码 |
| | | UpdateApplicationKeyPwd updateApplicationKeyPwd = new UpdateApplicationKeyPwd(true); |
| | | Thread updateApplicationKeyPwdThread = new Thread(updateApplicationKeyPwd,"UpdateApplicationKeyPwdThread"); |
| | | updateApplicationKeyPwdThread.start(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.hardwareAdapation.thread; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.core.smo.hardwareAdapation.IApplicationKeyInnerServiceSMO; |
| | | import com.java110.core.smo.hardwareAdapation.IMachineInnerServiceSMO; |
| | | import com.java110.core.smo.order.IOrderInnerServiceSMO; |
| | | import com.java110.core.smo.room.IRoomInnerServiceSMO; |
| | | import com.java110.dto.hardwareAdapation.ApplicationKeyDto; |
| | | import com.java110.dto.hardwareAdapation.MachineDto; |
| | | import com.java110.dto.order.OrderDto; |
| | | import com.java110.hardwareAdapation.dao.IMachineTranslateServiceDao; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.factory.ApplicationContextFactory; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.http.*; |
| | | import org.springframework.web.client.HttpStatusCodeException; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 从订单中同步业主信息至设备中间表 |
| | | * add by wuxw 2019-11-14 |
| | | */ |
| | | public class UpdateApplicationKeyPwd implements Runnable { |
| | | Logger logger = LoggerFactory.getLogger(UpdateApplicationKeyPwd.class); |
| | | public static final long DEFAULT_WAIT_SECOND = 1000 * 60 * 24; // 默认30秒执行一次 |
| | | public static boolean TRANSLATE_STATE = false; |
| | | |
| | | private IApplicationKeyInnerServiceSMO applicationKeyInnerServiceSMOImpl; |
| | | |
| | | |
| | | private RestTemplate restTemplate; |
| | | |
| | | public UpdateApplicationKeyPwd(boolean state) { |
| | | TRANSLATE_STATE = state; |
| | | applicationKeyInnerServiceSMOImpl = ApplicationContextFactory.getBean("applicationKeyInnerServiceSMOImpl", IApplicationKeyInnerServiceSMO.class); |
| | | restTemplate = ApplicationContextFactory.getBean("restTemplate", RestTemplate.class); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void run() { |
| | | long waitTime = DEFAULT_WAIT_SECOND; |
| | | while (TRANSLATE_STATE) { |
| | | try { |
| | | executeTask(); |
| | | /*waitTime = StringUtil.isNumber(MappingCache.getValue("DEFAULT_WAIT_SECOND")) ? |
| | | Long.parseLong(MappingCache.getValue("DEFAULT_WAIT_SECOND")) : DEFAULT_WAIT_SECOND;*/ |
| | | Thread.sleep(waitTime); |
| | | } catch (Throwable e) { |
| | | logger.error("执行订单中同步业主信息至设备中失败", e); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 执行任务 |
| | | */ |
| | | private void executeTask() { |
| | | |
| | | //判断是不是每个月第一天 |
| | | if(!isFirstDayOfMonth(new Date())){ |
| | | return ; |
| | | } |
| | | |
| | | ApplicationKeyDto applicationKeyDto = new ApplicationKeyDto(); |
| | | applicationKeyDto.setTypeFlag("1100102"); |
| | | applicationKeyDto.setEndTime(DateUtil.getFormatTimeString(new Date(), DateUtil.DATE_FORMATE_STRING_A)); |
| | | //查询订单信息 |
| | | List<ApplicationKeyDto> applicationKeyDtos = applicationKeyInnerServiceSMOImpl.queryApplicationKeys(applicationKeyDto); |
| | | String url = ServiceConstant.SERVICE_API_URL + "/api/applicationKey.updateApplicationKey"; |
| | | for (ApplicationKeyDto tmpApplicationKeyDto : applicationKeyDtos) { |
| | | try { |
| | | logger.debug("开始处理订单" + JSONObject.toJSONString(tmpApplicationKeyDto)); |
| | | tmpApplicationKeyDto.setPwd(getRandom());//这里修改密码 |
| | | callService(JSONObject.toJSONString(tmpApplicationKeyDto), url, HttpMethod.POST); |
| | | |
| | | } catch (Exception e) { |
| | | logger.error("执行订单任务失败", e); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private ResponseEntity<String> callService(String param, String url, HttpMethod httpMethod) { |
| | | ResponseEntity<String> responseEntity = null; |
| | | HttpHeaders header = new HttpHeaders(); |
| | | header.add(CommonConstant.HTTP_APP_ID.toLowerCase(), CommonConstant.HC_HARDWARE_APP_ID); |
| | | header.add(CommonConstant.HTTP_USER_ID.toLowerCase(), CommonConstant.ORDER_DEFAULT_USER_ID); |
| | | header.add(CommonConstant.HTTP_TRANSACTION_ID.toLowerCase(), UUID.randomUUID().toString()); |
| | | header.add(CommonConstant.HTTP_REQ_TIME.toLowerCase(), DateUtil.getDefaultFormateTimeString(new Date())); |
| | | header.add(CommonConstant.HTTP_SIGN.toLowerCase(), ""); |
| | | HttpEntity<String> httpEntity = new HttpEntity<String>(param, header); |
| | | //logger.debug("请求中心服务信息,{}", httpEntity); |
| | | try { |
| | | responseEntity = restTemplate.exchange(url, httpMethod, httpEntity, String.class); |
| | | } catch (HttpStatusCodeException e) { //这里spring 框架 在4XX 或 5XX 时抛出 HttpServerErrorException 异常,需要重新封装一下 |
| | | responseEntity = new ResponseEntity<String>("请求下游系统异常," + e.getResponseBodyAsString(), e.getStatusCode()); |
| | | } catch (Exception e) { |
| | | responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); |
| | | } finally { |
| | | logger.debug("请求地址为,{} 请求中心服务信息,{},中心服务返回信息,{}", url, httpEntity, responseEntity); |
| | | return responseEntity; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取随机数 |
| | | * |
| | | * @return |
| | | */ |
| | | private String getRandom() { |
| | | Random random = new Random(); |
| | | String result = ""; |
| | | for (int i = 0; i < 6; i++) { |
| | | result += random.nextInt(10); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | public boolean isFirstDayOfMonth(Date date) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | System.out.println(calendar.get(Calendar.MONTH)); |
| | | return calendar.get(Calendar.DAY_OF_MONTH) == 1; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.front.controller.CallComponentController; |
| | | import com.java110.web.smo.assetExport.IAssetExportSMO; |
| | | import com.java110.web.smo.assetImport.IAssetImportSMO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | @Autowired |
| | | private IAssetImportSMO assetImportSMOImpl; |
| | | |
| | | @Autowired |
| | | private IAssetExportSMO assetExportSMOImpl; |
| | | |
| | | /** |
| | | * 添加应用数据 |
| | | * |
| | |
| | | return assetImportSMOImpl.importExcelData(pd,uploadFile); |
| | | } |
| | | |
| | | /** |
| | | * 资产导出 |
| | | * |
| | | * @param pd |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public ResponseEntity<Object> exitCommunityData(IPageData pd) throws Exception { |
| | | return assetExportSMOImpl.exportExcelData(pd); |
| | | } |
| | | |
| | | public IAssetImportSMO getAssetImportSMOImpl() { |
| | | return assetImportSMOImpl; |
| | | } |
| | |
| | | public void setAssetImportSMOImpl(IAssetImportSMO assetImportSMOImpl) { |
| | | this.assetImportSMOImpl = assetImportSMOImpl; |
| | | } |
| | | |
| | | public IAssetExportSMO getAssetExportSMOImpl() { |
| | | return assetExportSMOImpl; |
| | | } |
| | | |
| | | public void setAssetExportSMOImpl(IAssetExportSMO assetExportSMOImpl) { |
| | | this.assetExportSMOImpl = assetExportSMOImpl; |
| | | } |
| | | } |
| | |
| | | import com.java110.utils.constant.PrivilegeCodeConstant; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.exception.SMOException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.web.smo.advert.IListAdvertsSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | super.validatePageInfo(pd); |
| | | Assert.hasKeyAndValue(paramIn, "communityId", "未包含小区信息"); |
| | | |
| | | //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_ADVERT); |
| | | } |
| | |
| | | Assert.hasKeyAndValue(paramIn, "endTime", "必填,请选择结束时间"); |
| | | Assert.hasKeyAndValue(paramIn, "locationTypeCd", "必填,位置不能为空"); |
| | | Assert.hasKeyAndValue(paramIn, "locationObjId", "必填,未选择位置对象"); |
| | | Assert.hasKeyAndValue(paramIn, "typeFlag", "必填,未选择钥匙类型"); |
| | | |
| | | |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.LIST_APPLICATION_KEY); |
| | |
| | | Assert.hasKeyAndValue(paramIn, "endTime", "必填,请选择结束时间"); |
| | | Assert.hasKeyAndValue(paramIn, "locationTypeCd", "必填,位置不能为空"); |
| | | Assert.hasKeyAndValue(paramIn, "locationObjId", "必填,未选择位置对象"); |
| | | Assert.hasKeyAndValue(paramIn, "typeFlag", "必填,未选择钥匙类型"); |
| | | |
| | | |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.LIST_APPLICATION_KEY); |
| New file |
| | |
| | | package com.java110.web.smo.assetExport; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * @ClassName IAssetImportSMO |
| | | * @Description TODO |
| | | * @Author wuxw |
| | | * @Date 2019/9/23 23:13 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/9/23 |
| | | **/ |
| | | public interface IAssetExportSMO { |
| | | |
| | | /** |
| | | * 导入excel数据 |
| | | * @param pd 前台数据封装 |
| | | * @return ResponseEntity |
| | | */ |
| | | public ResponseEntity<Object> exportExcelData(IPageData pd) throws Exception; |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.assetExport.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.component.BaseComponentSMO; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.web.smo.assetExport.IAssetExportSMO; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * @ClassName AssetImportSmoImpl |
| | | * @Description TODO |
| | | * @Author wuxw |
| | | * @Date 2019/9/23 23:14 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/9/23 |
| | | **/ |
| | | @Service("assetExportSMOImpl") |
| | | public class AssetExportSMOImpl extends BaseComponentSMO implements IAssetExportSMO { |
| | | private final static Logger logger = LoggerFactory.getLogger(AssetExportSMOImpl.class); |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | public ResponseEntity<Object> exportExcelData(IPageData pd) throws Exception { |
| | | |
| | | ComponentValidateResult result = this.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | Assert.hasKeyAndValue(JSONObject.parseObject(pd.getReqData()), "communityId", "请求中未包含小区"); |
| | | |
| | | Workbook workbook = null; //工作簿 |
| | | //工作表 |
| | | workbook = new HSSFWorkbook(); |
| | | //获取楼信息 |
| | | getFloors(pd, result, workbook); |
| | | //获取业主信息 |
| | | getOwners(pd, result, workbook); |
| | | //获取房屋信息 |
| | | getRooms(pd, result, workbook); |
| | | //获取车位信息 |
| | | getParkingSpaces(pd, result, workbook); |
| | | |
| | | ByteArrayOutputStream os = new ByteArrayOutputStream(); |
| | | MultiValueMap headers = new HttpHeaders(); |
| | | headers.add("content-type", "application/octet-stream;charset=UTF-8"); |
| | | headers.add("Content-Disposition", "attachment;filename=" + DateUtil.getyyyyMMddhhmmssDateString() + ".xls"); |
| | | headers.add("Pargam", "no-cache"); |
| | | headers.add("Cache-Control", "no-cache"); |
| | | //headers.add("Content-Disposition", "attachment; filename=" + outParam.getString("fileName")); |
| | | headers.add("Accept-Ranges", "bytes"); |
| | | byte[] context = null; |
| | | try { |
| | | workbook.write(os); |
| | | context = os.toByteArray(); |
| | | os.close(); |
| | | workbook.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | // 保存数据 |
| | | return new ResponseEntity<Object>("导出失败", HttpStatus.INTERNAL_SERVER_ERROR); |
| | | } |
| | | // 保存数据 |
| | | return new ResponseEntity<Object>(context, headers, HttpStatus.OK); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询存在的房屋信息 |
| | | * room.queryRooms |
| | | * |
| | | * @param pd |
| | | * @param result |
| | | * @return |
| | | */ |
| | | private JSONArray getExistsParkSpace(IPageData pd, ComponentValidateResult result) { |
| | | String apiUrl = ""; |
| | | ResponseEntity<String> responseEntity = null; |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/parkingSpace.queryParkingSpaces?page=1&row=10000&communityId=" + result.getCommunityId(); |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET); |
| | | |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息 |
| | | return null; |
| | | } |
| | | |
| | | JSONObject savedParkingSpaceInfoResults = JSONObject.parseObject(responseEntity.getBody()); |
| | | |
| | | |
| | | if (!savedParkingSpaceInfoResults.containsKey("parkingSpaces") ) { |
| | | return null; |
| | | } |
| | | |
| | | |
| | | return savedParkingSpaceInfoResults.getJSONArray("parkingSpaces"); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询存在的房屋信息 |
| | | * room.queryRooms |
| | | * |
| | | * @param pd |
| | | * @param result |
| | | * @return |
| | | */ |
| | | private JSONArray getExistsRoom(IPageData pd, ComponentValidateResult result) { |
| | | String apiUrl = ""; |
| | | ResponseEntity<String> responseEntity = null; |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/room.queryRooms?page=1&row=10000&communityId=" + result.getCommunityId(); |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET); |
| | | |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息 |
| | | return null; |
| | | } |
| | | |
| | | JSONObject savedRoomInfoResults = JSONObject.parseObject(responseEntity.getBody()); |
| | | |
| | | |
| | | if (!savedRoomInfoResults.containsKey("rooms") ) { |
| | | return null; |
| | | } |
| | | |
| | | |
| | | return savedRoomInfoResults.getJSONArray("rooms"); |
| | | |
| | | } |
| | | |
| | | |
| | | private JSONArray getExistsUnit(IPageData pd, ComponentValidateResult result, String floorId) { |
| | | String apiUrl = ""; |
| | | ResponseEntity<String> responseEntity = null; |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/unit.queryUnits?communityId=" + result.getCommunityId() + "&floorId=" + floorId; |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET); |
| | | |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息 |
| | | return null; |
| | | } |
| | | |
| | | JSONArray savedFloorInfoResults = JSONArray.parseArray(responseEntity.getBody()); |
| | | |
| | | |
| | | return savedFloorInfoResults; |
| | | } |
| | | |
| | | private JSONArray getExistsFloor(IPageData pd, ComponentValidateResult result) { |
| | | String apiUrl = ""; |
| | | ResponseEntity<String> responseEntity = null; |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/floor.queryFloors?page=1&row=100&communityId=" + result.getCommunityId(); |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET); |
| | | |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息 |
| | | return null; |
| | | } |
| | | |
| | | JSONObject savedFloorInfoResult = JSONObject.parseObject(responseEntity.getBody()); |
| | | |
| | | if (!savedFloorInfoResult.containsKey("apiFloorDataVoList") ) { |
| | | return null; |
| | | } |
| | | |
| | | return savedFloorInfoResult.getJSONArray("apiFloorDataVoList"); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 查询存在的业主 |
| | | * |
| | | * @param pd |
| | | * @param result |
| | | * @return |
| | | */ |
| | | private JSONArray getExistsOwner(IPageData pd, ComponentValidateResult result) { |
| | | return getExistsOwner(pd, result, ""); |
| | | } |
| | | |
| | | /** |
| | | * 查询存在的业主 |
| | | * |
| | | * @param pd |
| | | * @param result |
| | | * @return |
| | | */ |
| | | private JSONArray getExistsOwner(IPageData pd, ComponentValidateResult result, String roomId) { |
| | | String apiUrl = ""; |
| | | ResponseEntity<String> responseEntity = null; |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/owner.queryOwners?page=1&row=10000&communityId=" + result.getCommunityId() |
| | | + "&ownerTypeCd=1001"; |
| | | if (!StringUtil.isEmpty(roomId)) { |
| | | apiUrl += ("&roomId=" + roomId); |
| | | } |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET); |
| | | |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息 |
| | | return null; |
| | | } |
| | | |
| | | JSONObject savedOwnerInfoResult = JSONObject.parseObject(responseEntity.getBody()); |
| | | |
| | | if (!savedOwnerInfoResult.containsKey("owners") ) { |
| | | return null; |
| | | } |
| | | |
| | | return savedOwnerInfoResult.getJSONArray("owners"); |
| | | |
| | | } |
| | | |
| | | private JSONArray getExistsParkingSpaceCar(IPageData pd, ComponentValidateResult result, String psId) { |
| | | String apiUrl = ""; |
| | | ResponseEntity<String> responseEntity = null; |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/parkingSpace.queryParkingSpaceCars?page=1&row=10000&communityId=" + result.getCommunityId(); |
| | | if (!StringUtil.isEmpty(psId)) { |
| | | apiUrl += ("&psId=" + psId); |
| | | } |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET); |
| | | |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息 |
| | | return null; |
| | | } |
| | | |
| | | JSONObject savedOwnerInfoResult = JSONObject.parseObject(responseEntity.getBody()); |
| | | |
| | | if (!savedOwnerInfoResult.containsKey("ownerCars") ) { |
| | | return null; |
| | | } |
| | | |
| | | return savedOwnerInfoResult.getJSONArray("ownerCars"); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取车位信息 |
| | | * |
| | | * @param workbook |
| | | */ |
| | | private void getParkingSpaces(IPageData pd, ComponentValidateResult componentValidateResult, Workbook workbook) { |
| | | Sheet sheet = workbook.createSheet("车位信息"); |
| | | Row row = sheet.createRow(0); |
| | | row.createCell(0).setCellValue("车位编码"); |
| | | row.createCell(1).setCellValue("车位类型"); |
| | | row.createCell(2).setCellValue("面积"); |
| | | row.createCell(3).setCellValue("业主编号"); |
| | | row.createCell(4).setCellValue("车牌号"); |
| | | row.createCell(5).setCellValue("车品牌"); |
| | | row.createCell(6).setCellValue("车类型"); |
| | | row.createCell(7).setCellValue("颜色"); |
| | | row.createCell(8).setCellValue("出租还是出售(H出租S出售)"); |
| | | |
| | | //查询楼栋信息 |
| | | JSONArray parkSpaces = this.getExistsParkSpace(pd, componentValidateResult); |
| | | |
| | | if(parkSpaces == null){ |
| | | return; |
| | | } |
| | | |
| | | |
| | | for (int psIndex = 0; psIndex < parkSpaces.size(); psIndex++) { |
| | | row = sheet.createRow(psIndex + 1); |
| | | row.createCell(0).setCellValue(parkSpaces.getJSONObject(psIndex).getString("num")); |
| | | row.createCell(1).setCellValue(parkSpaces.getJSONObject(psIndex).getString("typeCd")); |
| | | row.createCell(2).setCellValue(parkSpaces.getJSONObject(psIndex).getString("area")); |
| | | if (!"H".equals(parkSpaces.getJSONObject(psIndex).getString("state"))) { //已出售 时查询业主信息 |
| | | JSONArray ownerCars = this.getExistsParkingSpaceCar(pd, componentValidateResult, parkSpaces.getJSONObject(psIndex).getString("psId")); |
| | | if (ownerCars == null || ownerCars.size() == 0) { |
| | | row.createCell(3).setCellValue(""); |
| | | row.createCell(4).setCellValue(""); |
| | | row.createCell(5).setCellValue(""); |
| | | row.createCell(6).setCellValue(""); |
| | | row.createCell(7).setCellValue(""); |
| | | continue; |
| | | } |
| | | row.createCell(3).setCellValue(ownerCars.getJSONObject(0).getString("ownerId")); |
| | | row.createCell(4).setCellValue(ownerCars.getJSONObject(0).getString("carNum")); |
| | | row.createCell(5).setCellValue(ownerCars.getJSONObject(0).getString("carBrand")); |
| | | row.createCell(6).setCellValue(ownerCars.getJSONObject(0).getString("carType")); |
| | | row.createCell(7).setCellValue(ownerCars.getJSONObject(0).getString("carColor")); |
| | | } |
| | | row.createCell(8).setCellValue(parkSpaces.getJSONObject(psIndex).getString("state")); |
| | | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取 房屋信息 |
| | | * |
| | | * @param componentValidateResult |
| | | * @param workbook |
| | | */ |
| | | private void getRooms(IPageData pd, ComponentValidateResult componentValidateResult, Workbook workbook) { |
| | | Sheet sheet = workbook.createSheet("房屋信息"); |
| | | Row row = sheet.createRow(0); |
| | | row.createCell(0).setCellValue("房屋编号"); |
| | | row.createCell(1).setCellValue("楼栋编号"); |
| | | row.createCell(2).setCellValue("单元编号"); |
| | | row.createCell(3).setCellValue("房屋楼层"); |
| | | row.createCell(4).setCellValue("房屋户型"); |
| | | row.createCell(5).setCellValue("建筑面积"); |
| | | row.createCell(6).setCellValue("业主编号"); |
| | | |
| | | //查询楼栋信息 |
| | | JSONArray rooms = this.getExistsRoom(pd, componentValidateResult); |
| | | if(rooms == null){ |
| | | return; |
| | | } |
| | | for (int roomIndex = 0; roomIndex < rooms.size(); roomIndex++) { |
| | | row = sheet.createRow(roomIndex + 1); |
| | | row.createCell(0).setCellValue(rooms.getJSONObject(roomIndex).getString("roomNum")); |
| | | row.createCell(1).setCellValue(rooms.getJSONObject(roomIndex).getString("floorNum")); |
| | | row.createCell(2).setCellValue(rooms.getJSONObject(roomIndex).getString("unitNum")); |
| | | row.createCell(3).setCellValue(rooms.getJSONObject(roomIndex).getString("layer")); |
| | | row.createCell(4).setCellValue(rooms.getJSONObject(roomIndex).getString("section")); |
| | | row.createCell(5).setCellValue(rooms.getJSONObject(roomIndex).getString("builtUpArea")); |
| | | if ("2001".equals(rooms.getJSONObject(roomIndex).getString("state"))) { //已出售 时查询业主信息 |
| | | JSONArray ownerDtos = this.getExistsOwner(pd, componentValidateResult, rooms.getJSONObject(roomIndex).getString("roomId")); |
| | | if (ownerDtos == null || ownerDtos.size() == 0) { |
| | | row.createCell(6).setCellValue(""); |
| | | continue; |
| | | } |
| | | row.createCell(6).setCellValue(ownerDtos.getJSONObject(0).getString("ownerId")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取业主信息 |
| | | * |
| | | * @param workbook |
| | | */ |
| | | private void getOwners(IPageData pd, ComponentValidateResult componentValidateResult, Workbook workbook) { |
| | | Sheet sheet = workbook.createSheet("业主信息"); |
| | | Row row = sheet.createRow(0); |
| | | row.createCell(0).setCellValue("业主编号"); |
| | | row.createCell(1).setCellValue("业主名称"); |
| | | row.createCell(2).setCellValue("性别"); |
| | | row.createCell(3).setCellValue("年龄"); |
| | | row.createCell(4).setCellValue("手机号"); |
| | | |
| | | //查询楼栋信息 |
| | | JSONArray owners = this.getExistsOwner(pd, componentValidateResult); |
| | | if(owners == null){ |
| | | return; |
| | | } |
| | | for (int owenrIndex = 0; owenrIndex < owners.size(); owenrIndex++) { |
| | | row = sheet.createRow(owenrIndex + 1); |
| | | row.createCell(0).setCellValue(owners.getJSONObject(owenrIndex).getString("ownerId")); |
| | | row.createCell(1).setCellValue(owners.getJSONObject(owenrIndex).getString("name")); |
| | | row.createCell(2).setCellValue("0".equals(owners.getJSONObject(owenrIndex).getString("sex")) ? "男" : "女"); |
| | | row.createCell(3).setCellValue(owners.getJSONObject(owenrIndex).getString("age")); |
| | | row.createCell(4).setCellValue(owners.getJSONObject(owenrIndex).getString("link")); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取小区 |
| | | * |
| | | * @param workbook |
| | | */ |
| | | private void getFloors(IPageData pd, ComponentValidateResult componentValidateResult, Workbook workbook) { |
| | | Sheet sheet = workbook.createSheet("楼栋单元"); |
| | | Row row = sheet.createRow(0); |
| | | row.createCell(0).setCellValue("楼栋号"); |
| | | row.createCell(1).setCellValue("单元编号"); |
| | | row.createCell(2).setCellValue("总层数"); |
| | | row.createCell(3).setCellValue("是否有电梯"); |
| | | |
| | | //查询楼栋信息 |
| | | JSONArray floors = this.getExistsFloor(pd, componentValidateResult); |
| | | |
| | | if(floors == null){ |
| | | return; |
| | | } |
| | | for (int floorIndex = 0; floorIndex < floors.size(); floorIndex++) { |
| | | JSONArray units = this.getExistsUnit(pd, componentValidateResult, floors.getJSONObject(floorIndex).getString("floorId")); |
| | | for (int unitIndex = 0; unitIndex < units.size(); unitIndex++) { |
| | | row = sheet.createRow(floorIndex + 1); |
| | | row.createCell(0).setCellValue(floors.getJSONObject(floorIndex).getString("floorNum")); |
| | | row.createCell(1).setCellValue(units.getJSONObject(unitIndex).getString("unitNum")); |
| | | row.createCell(2).setCellValue(units.getJSONObject(unitIndex).getString("layerCount")); |
| | | row.createCell(3).setCellValue("1010".equals(units.getJSONObject(unitIndex).getString("lift")) ? "有" : "无"); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| | |
| | | |
| | | JSONObject paramIn = JSONObject.parseObject(pd.getReqData()); |
| | | if (paramIn.containsKey("ownerId") && !paramIn.getString("ownerId").startsWith("-")) { |
| | | paramIn.put("ownerTypeCd", "1002"); |
| | | //paramIn.put("ownerTypeCd", "1002"); |
| | | } else { |
| | | paramIn.put("ownerTypeCd", "1001"); |
| | | } |
| | |
| | | if (paramIn.getString("ownerId").equals(paramIn.getString("memberId"))) { |
| | | paramIn.put("ownerTypeCd", "1001"); |
| | | } else { |
| | | paramIn.put("ownerTypeCd", "1002"); |
| | | //paramIn.put("ownerTypeCd", "1002"); |
| | | } |
| | | String communityId = paramIn.getString("communityId"); |
| | | ResponseEntity responseEntity = super.getStoreInfo(pd, restTemplate); |
| | |
| | | return; |
| | | } |
| | | if (!vc.component.addAdvertValidate()) { |
| | | vc.message(vc.validate.errInfo); |
| | | |
| | | vc.toast(vc.validate.errInfo); |
| | | return; |
| | | } |
| | | if (vc.component.addAdvertInfo.viewType == '8888') { |
| | |
| | | |
| | | return; |
| | | } |
| | | vc.message(json); |
| | | vc.toast(json); |
| | | |
| | | }, |
| | | function (errInfo, error) { |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.message(errInfo); |
| | | vc.toast(errInfo); |
| | | |
| | | }); |
| | | }, |
| | |
| | | |
| | | vc.component.advertManageInfo.conditions.page = _page; |
| | | vc.component.advertManageInfo.conditions.row = _rows; |
| | | vc.component.advertManageInfo.conditions.communityId = vc.getCurrentCommunity().communityId; |
| | | var param = { |
| | | params: vc.component.advertManageInfo.conditions |
| | | }; |
| | |
| | | <div id="component" > |
| | | <img id="imgView" v-bind:src="advertVedioViewInfo.imgUrl" style="width: 100%;position:absolute;top:0;left:0;height:100%;" class="thumbnail" /> |
| | | <!--autoplay="autoplay" muted="muted"--> |
| | | <video id="videoView" src="" controls style="object-fit: fill;width: 100%;height:100%" volume="true" ></video> |
| | | <!--autoplay="autoplay" controls muted="muted"--> |
| | | <video id="videoView" src="" style="object-fit: fill;width: 100%;height:100%" volume="true" ></video> |
| | | </div> |
| | |
| | | $("#videoView").hide(); |
| | | $("#imgView").show(); |
| | | curr++; |
| | | if (curr >= vLen) { |
| | | curr = 0; //重新循环播放 |
| | | vc.component._loadAdvertVedioData(); |
| | | } |
| | | // console.log("当前图片地址:1" ); |
| | | setTimeout(function () { |
| | | if (curr >= vLen) { |
| | | curr = 0; //重新循环播放 |
| | | vc.component._loadAdvertVedioData(); |
| | | return; |
| | | } |
| | | console.log("当前图片地址:2" + vList[curr]); |
| | | vc.component.handleImgVideoUrl(_imgsAndVideos); |
| | | }, _imagePlayTime); |
| | |
| | | //$('#videoView').get(0).pause(); |
| | | console.log("当前图片地址:" + url); |
| | | curr++; |
| | | if (curr >= vLen) { |
| | | curr = 0; //重新循环播放 |
| | | vc.component._loadAdvertVedioData(); |
| | | } |
| | | |
| | | setTimeout(function () { |
| | | if (curr >= vLen) { |
| | | curr = 0; //重新循环播放 |
| | | vc.component._loadAdvertVedioData(); |
| | | return; |
| | | } |
| | | vc.component.handleImgVideoUrl(_imgsAndVideos); |
| | | }, _imagePlayTime); |
| | | |
| | |
| | | return; |
| | | } |
| | | if (!vc.component.editAdvertValidate()) { |
| | | vc.message(vc.validate.errInfo); |
| | | vc.toast(vc.validate.errInfo); |
| | | return; |
| | | } |
| | | |
| | |
| | | vc.emit('advertManage', 'listAdvert', {}); |
| | | return; |
| | | } |
| | | vc.message(json); |
| | | vc.toast(json); |
| | | }, |
| | | function (errInfo, error) { |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.message(errInfo); |
| | | vc.toast(errInfo); |
| | | }); |
| | | }, |
| | | _loadAdvertItem: function () { |
| | |
| | | //判断属性中是否有照片 |
| | | _advertItems.forEach(function (_item) { |
| | | vc.component.editAdvertInfo.viewType = _item.itemTypeCd; |
| | | |
| | | var _photos = []; |
| | | if (_item.itemTypeCd == '8888') { |
| | | vc.component.editAdvertInfo.photos.push(_item.url); |
| | | vc.emit('editAdvert', 'uploadImage', 'notifyPhotos', vc.component.editAdvertInfo.photos); |
| | | //vc.component.editAdvertInfo.photos.push(_item.url); |
| | | _photos.push(_item.url); |
| | | vc.emit('editAdvert', 'uploadImage', 'notifyPhotos', _photos); |
| | | } else { |
| | | vc.component.editAdvertInfo.vedioName = _item.url; |
| | | vc.emit('editAdvert', 'uploadVedio', 'notifyVedio', _item.url); |
| | |
| | | <div class="ibox-content"> |
| | | <div class="row"> |
| | | <div class="col-sm-5" style="text-align:center"> |
| | | <video id="photo" style="width: 100%;"></video> |
| | | <canvas id="canvas" style="display:none;"></canvas> |
| | | <video id="AddApplicationKeyPhoto" style="width: 100%;"></video> |
| | | <canvas id="AddApplicationKeyCanvas" style="display:none;"></canvas> |
| | | <div style="margin-top:20px"> |
| | | <button class="btn btn-primary" type="button" v-on:click="_takePhoto()"><span |
| | | class="glyphicon glyphicon-camera"></span> 拍照 |
| | |
| | | <option value="10001">保洁</option> |
| | | <option value="10002">保安</option> |
| | | <option value="10003">其他人员</option> |
| | | </select></div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">钥匙类型</label> |
| | | <div class="col-sm-10"> |
| | | <select class="custom-select" v-model="addApplicationKeyInfo.typeFlag"> |
| | | <option selected disabled value="">必填,请选择钥匙类型申请</option> |
| | | <option value="1100101">人脸</option> |
| | | <option value="1100102">固定密码</option> |
| | | <option value="1100103">临时密码</option> |
| | | </select></div> |
| | | </div> |
| | | <div class="form-group row"> |
| | |
| | | class="form-control addApplicationStartTime"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <div class="form-group row" v-show="addApplicationKeyInfo.typeFlag == '1100101' || addApplicationKeyInfo.typeFlag == '1100102' "> |
| | | <label class="col-sm-2 col-form-label">结束时间</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addApplicationKeyInfo.endTime" readonly type="text" |
| | |
| | | class="form-control addApplicationEndTime"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <div class="form-group row" v-if="addApplicationKeyInfo.typeFlag == '1100101'"> |
| | | <label class="col-sm-2 col-form-label">照片</label> |
| | | <div class="col-sm-10"><img width="100%" height="100%" |
| | | v-bind:src="addApplicationKeyInfo.photo" alt="申请人照片"></div> |
| | |
| | | locationTypeCd: '', |
| | | locationObjId: '', |
| | | roomName: '', |
| | | photo:'', |
| | | typeFlag:'', |
| | | photo: '', |
| | | mediaStreamTrack: null |
| | | } |
| | | }, |
| | | _initMethod: function () { |
| | | vc.component._initAddApplicationKeyDateInfo(); |
| | | vc.component._initAddApplicationKeyMedia(); |
| | | //vc.component._initAddApplicationKeyMedia(); |
| | | }, |
| | | _initEvent: function () { |
| | | vc.on('addApplicationKey', 'openAddApplicationKeyModal', function () { |
| | | $('#addApplicationKeyModel').modal('show'); |
| | | }); |
| | | vc.on('addApplicationKey', "_initAddApplicationKeyData", function () { |
| | | vc.component._initAddApplicationKeyMedia(); |
| | | }); |
| | | vc.on("addApplicationKey", "notify", function (_param) { |
| | | if (_param.hasOwnProperty("floorId")) { |
| | |
| | | vc.component.addApplicationKeyInfo.unitId = _param.unitId; |
| | | } |
| | | |
| | | if(_param.hasOwnProperty("roomId")){ |
| | | if (_param.hasOwnProperty("roomId")) { |
| | | vc.component.addApplicationKeyInfo.roomId = _param.roomId; |
| | | } |
| | | }); |
| | |
| | | locationTypeCd: '', |
| | | locationObjId: '', |
| | | roomName: '', |
| | | photo:'', |
| | | videoPlaying:false |
| | | |
| | | photo: '', |
| | | videoPlaying: false, |
| | | mediaStreamTrack: null, |
| | | typeFlag:'', |
| | | }; |
| | | }, |
| | | _closeAddApplicationKeyView: function () { |
| | | vc.emit('applicationKeyManage', 'listApplicationKey', {}); |
| | | //关闭拍照摄像头 |
| | | if (vc.component.addApplicationKeyInfo.mediaStreamTrack != null) { |
| | | vc.component.addApplicationKeyInfo.mediaStreamTrack.stop(); |
| | | } |
| | | }, |
| | | _addUserMedia:function() { |
| | | _addUserMedia: function () { |
| | | return navigator.getUserMedia = navigator.getUserMedia || |
| | | navigator.webkitGetUserMedia || |
| | | navigator.mozGetUserMedia || |
| | | navigator.msGetUserMedia || null; |
| | | }, |
| | | _initAddApplicationKeyMedia:function () { |
| | | if(vc.component._addUserMedia()){ |
| | | _initAddApplicationKeyMedia: function () { |
| | | if (vc.component._addUserMedia()) { |
| | | vc.component.addApplicationKeyInfo.videoPlaying = false; |
| | | var constraints = { |
| | | video: true, |
| | | audio: false |
| | | }; |
| | | var video = document.getElementById('photo'); |
| | | var media = navigator.getUserMedia(constraints, function (stream) { |
| | | var video = document.getElementById('AddApplicationKeyPhoto'); |
| | | var media = navigator.getUserMedia(constraints, function (stream) { |
| | | var url = window.URL || window.webkitURL; |
| | | //video.src = url ? url.createObjectURL(stream) : stream; |
| | | vc.component.addApplicationKeyInfo.mediaStreamTrack = typeof stream.stop === 'function' ? stream : stream.getTracks()[0]; |
| | | try { |
| | | video.src = url ? url.createObjectURL(stream) : stream; |
| | | } catch (error) { |
| | |
| | | console.log("ERROR"); |
| | | console.log(error); |
| | | }); |
| | | }else{ |
| | | } else { |
| | | console.log("初始化视频失败"); |
| | | } |
| | | }, |
| | | _takePhoto:function () { |
| | | _takePhoto: function () { |
| | | if (vc.component.addApplicationKeyInfo.videoPlaying) { |
| | | var canvas = document.getElementById('canvas'); |
| | | var video = document.getElementById('photo'); |
| | | var canvas = document.getElementById('AddApplicationKeyCanvas'); |
| | | var video = document.getElementById('AddApplicationKeyPhoto'); |
| | | canvas.width = video.videoWidth; |
| | | canvas.height = video.videoHeight; |
| | | canvas.getContext('2d').drawImage(video, 0, 0); |
| | |
| | | //document.getElementById('photo').setAttribute('src', data); |
| | | } |
| | | }, |
| | | _uploadPhoto:function(event){ |
| | | _uploadPhoto: function (event) { |
| | | $("#uploadApplicationKeyPhoto").trigger("click") |
| | | }, |
| | | _choosePhoto:function(event){ |
| | | _choosePhoto: function (event) { |
| | | var photoFiles = event.target.files; |
| | | if (photoFiles && photoFiles.length > 0) { |
| | | // 获取目前上传的文件 |
| | | var file = photoFiles[0];// 文件大小校验的动作 |
| | | if(file.size > 1024 * 1024 * 1) { |
| | | if (file.size > 1024 * 1024 * 1) { |
| | | vc.toast("图片大小不能超过 2MB!") |
| | | return false; |
| | | } |
| | | var reader = new FileReader(); //新建FileReader对象 |
| | | reader.readAsDataURL(file); //读取为base64 |
| | | reader.onloadend = function(e) { |
| | | reader.onloadend = function (e) { |
| | | vc.component.addApplicationKeyInfo.photo = reader.result; |
| | | } |
| | | } |
| | |
| | | <th class="text-center">钥匙申请ID</th> |
| | | <th class="text-center">姓名</th> |
| | | <th class="text-center">手机号</th> |
| | | <th class="text-center">用户类型</th> |
| | | <th class="text-center">钥匙类型</th> |
| | | <!-- <th class="text-center">性别</th> |
| | | <th class="text-center">年龄</th>--> |
| | | <th class="text-center">密码</th> |
| | | <th class="text-center">身份证号</th> |
| | | <th class="text-center">开始时间</th> |
| | | <th class="text-center">结束时间</th> |
| | |
| | | <td class="text-center">{{applicationKey.applicationKeyId}}</td> |
| | | <td class="text-center">{{applicationKey.name}}</td> |
| | | <td class="text-center">{{applicationKey.tel}}</td> |
| | | <td class="text-center">{{applicationKey.typeCd}}</td> |
| | | <td class="text-center">{{applicationKey.typeFlagName}}</td> |
| | | <!--<td class="text-center">{{applicationKey.sex}}</td> |
| | | <td class="text-center">{{applicationKey.age}}</td>--> |
| | | <td class="text-center">{{applicationKey.pwd}}</td> |
| | | <td class="text-center">{{applicationKey.idCard}}</td> |
| | | <td class="text-center">{{applicationKey.startTime}}</td> |
| | | <td class="text-center">{{applicationKey.endTime}}</td> |
| | |
| | | _openAddApplicationKeyModal: function () { |
| | | //vc.emit('addApplicationKey', 'openAddApplicationKeyModal', {}); |
| | | vc.component.applicationKeyManageInfo.showComponent = 'addApplicationKey'; |
| | | vc.emit('addApplicationKey', "_initAddApplicationKeyData", {}); |
| | | }, |
| | | _openEditApplicationKeyModel: function (_applicationKey) { |
| | | vc.emit('editApplicationKey', 'openEditApplicationKeyModal', _applicationKey); |
| | | vc.component.applicationKeyManageInfo.showComponent = 'editApplicationKey'; |
| | | |
| | | vc.emit('editApplicationKey', "_initEditApplicationKeyData", {}); |
| | | }, |
| | | _openDeleteApplicationKeyModel: function (_applicationKey) { |
| | | vc.emit('deleteApplicationKey', 'openDeleteApplicationKeyModal', _applicationKey); |
| | |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-5" style="text-align:center"> |
| | | <video id="photo" style="width: 100%;"></video> |
| | | <canvas id="canvas" style="display:none;"></canvas> |
| | | <video id="editApplicationKeyPhoto" style="width: 100%;"></video> |
| | | <canvas id="editApplicationKeyCanvas" style="display:none;"></canvas> |
| | | <div style="margin-top:20px"> |
| | | <button class="btn btn-primary" type="button" v-on:click="_takeEditPhoto()"><span |
| | | class="glyphicon glyphicon-camera"></span> 拍照 |
| | |
| | | <option value="10001">保洁</option> |
| | | <option value="10002">保安</option> |
| | | <option value="10003">其他人员</option> |
| | | </select></div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">钥匙类型</label> |
| | | <div class="col-sm-10"> |
| | | <select class="custom-select" v-model="editApplicationKeyInfo.typeFlag" readonly="true"> |
| | | <option selected disabled value="">必填,请选择钥匙类型申请</option> |
| | | <option value="1100101">人脸</option> |
| | | <option value="1100102">固定密码</option> |
| | | <option value="1100103">临时密码</option> |
| | | </select></div> |
| | | </div> |
| | | <div class="form-group row"> |
| | |
| | | class="form-control editApplicationStartTime"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <div class="form-group row" v-show="editApplicationKeyInfo.typeFlag == '1100101' || editApplicationKeyInfo.typeFlag == '1100102' "> |
| | | <label class="col-sm-2 col-form-label">结束时间</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="editApplicationKeyInfo.endTime" readonly type="text" |
| | |
| | | class="form-control editApplicationEndTime"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row" v-if="editApplicationKeyInfo.typeFlag == '1100101'"> |
| | | <label class="col-sm-2 col-form-label">照片</label> |
| | | <div class="col-sm-10"><img width="100%" height="100%" |
| | | v-bind:src="editApplicationKeyInfo.photo" alt="申请人照片"></div> |
| | | </div> |
| | | |
| | | <div class="ibox-content"> |
| | | <button class="btn btn-primary float-right" type="button" |
| | |
| | | locationTypeCd: '', |
| | | locationObjId: '', |
| | | roomName: '', |
| | | videoPlaying:false, |
| | | photo:'' |
| | | |
| | | videoPlaying: false, |
| | | photo: '', |
| | | mediaStreamTrack: null, |
| | | typeFlag:'', |
| | | } |
| | | }, |
| | | _initMethod: function () { |
| | | vc.component._initEditApplicationKeyDateInfo(); |
| | | vc.component._initEditApplicationKeyMedia(); |
| | | //vc.component._initEditApplicationKeyMedia(); |
| | | |
| | | |
| | | }, |
| | | _initEvent: function () { |
| | | vc.on('editApplicationKey', 'openEditApplicationKeyModal', function (_params) { |
| | | vc.component.refreshEditApplicationKeyInfo(); |
| | | // $('#editApplicationKeyModel').modal('show'); |
| | | // $('#editApplicationKeyModel').modal('show'); |
| | | vc.copyObject(_params, vc.component.editApplicationKeyInfo); |
| | | if (vc.component.editApplicationKeyInfo.locationTypeCd == '2000') { |
| | | vc.emit('editApplicationKey','floorSelect2','setFloor',{ |
| | | floorId:vc.component.editApplicationKeyInfo.floorId, |
| | | floorNum:vc.component.editApplicationKeyInfo.floorNum |
| | | vc.emit('editApplicationKey', 'floorSelect2', 'setFloor', { |
| | | floorId: vc.component.editApplicationKeyInfo.floorId, |
| | | floorNum: vc.component.editApplicationKeyInfo.floorNum |
| | | }); |
| | | vc.emit('editApplicationKey','unitSelect2','setUnit',{ |
| | | floorId:vc.component.editApplicationKeyInfo.floorId, |
| | | floorNum:vc.component.editApplicationKeyInfo.floorNum, |
| | | unitId:vc.component.editApplicationKeyInfo.unitId, |
| | | unitNum:vc.component.editApplicationKeyInfo.unitNum, |
| | | vc.emit('editApplicationKey', 'unitSelect2', 'setUnit', { |
| | | floorId: vc.component.editApplicationKeyInfo.floorId, |
| | | floorNum: vc.component.editApplicationKeyInfo.floorNum, |
| | | unitId: vc.component.editApplicationKeyInfo.unitId, |
| | | unitNum: vc.component.editApplicationKeyInfo.unitNum, |
| | | }); |
| | | } else if (vc.component.editApplicationKeyInfo.locationTypeCd == '3000') { |
| | | vc.emit('editApplicationKey','floorSelect2','setFloor',{ |
| | | floorId:vc.component.editApplicationKeyInfo.floorId, |
| | | floorNum:vc.component.editApplicationKeyInfo.floorNum |
| | | vc.emit('editApplicationKey', 'floorSelect2', 'setFloor', { |
| | | floorId: vc.component.editApplicationKeyInfo.floorId, |
| | | floorNum: vc.component.editApplicationKeyInfo.floorNum |
| | | }); |
| | | vc.emit('editApplicationKey','unitSelect2','setUnit',{ |
| | | floorId:vc.component.editApplicationKeyInfo.floorId, |
| | | floorNum:vc.component.editApplicationKeyInfo.floorNum, |
| | | unitId:vc.component.editApplicationKeyInfo.unitId, |
| | | unitNum:vc.component.editApplicationKeyInfo.unitNum, |
| | | vc.emit('editApplicationKey', 'unitSelect2', 'setUnit', { |
| | | floorId: vc.component.editApplicationKeyInfo.floorId, |
| | | floorNum: vc.component.editApplicationKeyInfo.floorNum, |
| | | unitId: vc.component.editApplicationKeyInfo.unitId, |
| | | unitNum: vc.component.editApplicationKeyInfo.unitNum, |
| | | }); |
| | | vc.emit('editApplicationKey','roomSelect2','setRoom',{ |
| | | floorId:vc.component.editApplicationKeyInfo.floorId, |
| | | floorNum:vc.component.editApplicationKeyInfo.floorNum, |
| | | unitId:vc.component.editApplicationKeyInfo.unitId, |
| | | unitNum:vc.component.editApplicationKeyInfo.unitNum, |
| | | roomId:vc.component.editApplicationKeyInfo.roomId, |
| | | roomNum:vc.component.editApplicationKeyInfo.roomNum, |
| | | vc.emit('editApplicationKey', 'roomSelect2', 'setRoom', { |
| | | floorId: vc.component.editApplicationKeyInfo.floorId, |
| | | floorNum: vc.component.editApplicationKeyInfo.floorNum, |
| | | unitId: vc.component.editApplicationKeyInfo.unitId, |
| | | unitNum: vc.component.editApplicationKeyInfo.unitNum, |
| | | roomId: vc.component.editApplicationKeyInfo.roomId, |
| | | roomNum: vc.component.editApplicationKeyInfo.roomNum, |
| | | }); |
| | | } |
| | | vc.component.editApplicationKeyInfo.communityId = vc.getCurrentCommunity().communityId; |
| | | |
| | | |
| | | }); |
| | | |
| | | vc.on('editApplicationKey', "_initEditApplicationKeyData", function () { |
| | | vc.component._initEditApplicationKeyMedia(); |
| | | }); |
| | | |
| | | vc.on("editApplicationKey", "notify", function (_param) { |
| | |
| | | vc.component.editApplicationKeyInfo.unitId = _param.unitId; |
| | | } |
| | | |
| | | if(_param.hasOwnProperty("roomId")){ |
| | | if (_param.hasOwnProperty("roomId")) { |
| | | vc.component.editApplicationKeyInfo.roomId = _param.roomId; |
| | | } |
| | | }); |
| | |
| | | floorNum: '', |
| | | floorName: '', |
| | | unitId: '', |
| | | unitName: '', |
| | | unitNum: '', |
| | | roomId: '', |
| | | locationTypeCd: '', |
| | | locationObjId: '', |
| | | roomName: '', |
| | | videoPlaying:false, |
| | | photo:'' |
| | | videoPlaying: false, |
| | | photo: '', |
| | | mediaStreamTrack: null, |
| | | typeFlag:'', |
| | | } |
| | | }, |
| | | _closeEditApplicationKeyView: function () { |
| | | vc.emit('applicationKeyManage', 'listApplicationKey', {}); |
| | | //关闭拍照摄像头 |
| | | if (vc.component.editApplicationKeyInfo.mediaStreamTrack != null) { |
| | | vc.component.editApplicationKeyInfo.mediaStreamTrack.stop(); |
| | | } |
| | | }, |
| | | _editUserMedia:function() { |
| | | _editUserMedia: function () { |
| | | return navigator.getUserMedia = navigator.getUserMedia || |
| | | navigator.webkitGetUserMedia || |
| | | navigator.mozGetUserMedia || |
| | | navigator.msGetUserMedia || null; |
| | | }, |
| | | _initEditApplicationKeyMedia:function () { |
| | | if(vc.component._editUserMedia()){ |
| | | _initEditApplicationKeyMedia: function () { |
| | | if (vc.component._editUserMedia()) { |
| | | vc.component.editApplicationKeyInfo.videoPlaying = false; |
| | | var constraints = { |
| | | video: true, |
| | | audio: false |
| | | }; |
| | | var video = document.getElementById('photo'); |
| | | var video = document.getElementById('editApplicationKeyPhoto'); |
| | | var media = navigator.getUserMedia(constraints, function (stream) { |
| | | var url = window.URL || window.webkitURL; |
| | | //video.src = url ? url.createObjectURL(stream) : stream; |
| | | |
| | | vc.component.editApplicationKeyInfo.mediaStreamTrack = typeof stream.stop === 'function' ? stream : stream.getTracks()[0]; |
| | | try { |
| | | video.src = url ? url.createObjectURL(stream) : stream; |
| | | } catch (error) { |
| | | video.srcObject = stream; |
| | | video.srcObject = stream; |
| | | } |
| | | video.play(); |
| | | vc.component.editApplicationKeyInfo.videoPlaying = true; |
| | |
| | | console.log("ERROR"); |
| | | console.log(error); |
| | | }); |
| | | }else{ |
| | | } else { |
| | | console.log("初始化视频失败"); |
| | | } |
| | | }, |
| | | _takeEditPhoto:function () { |
| | | _takeEditPhoto: function () { |
| | | if (vc.component.editApplicationKeyInfo.videoPlaying) { |
| | | var canvas = document.getElementById('canvas'); |
| | | var video = document.getElementById('photo'); |
| | | var canvas = document.getElementById('editApplicationKeyCanvas'); |
| | | var video = document.getElementById('editApplicationKeyPhoto'); |
| | | canvas.width = video.videoWidth; |
| | | canvas.height = video.videoHeight; |
| | | canvas.getContext('2d').drawImage(video, 0, 0); |
| | |
| | | //document.getElementById('photo').setAttribute('src', data); |
| | | } |
| | | }, |
| | | _uploadEditPhoto:function(event){ |
| | | _uploadEditPhoto: function (event) { |
| | | $("#uploadEditApplicationKeyPhoto").trigger("click") |
| | | }, |
| | | _chooseEditPhoto:function(event){ |
| | | _chooseEditPhoto: function (event) { |
| | | var photoFiles = event.target.files; |
| | | if (photoFiles && photoFiles.length > 0) { |
| | | // 获取目前上传的文件 |
| | | var file = photoFiles[0];// 文件大小校验的动作 |
| | | if(file.size > 1024 * 1024 * 1) { |
| | | if (file.size > 1024 * 1024 * 1) { |
| | | vc.toast("图片大小不能超过 2MB!") |
| | | return false; |
| | | } |
| | | var reader = new FileReader(); //新建FileReader对象 |
| | | reader.readAsDataURL(file); //读取为base64 |
| | | reader.onloadend = function(e) { |
| | | reader.onloadend = function (e) { |
| | | vc.component.editApplicationKeyInfo.photo = reader.result; |
| | | } |
| | | } |
| | |
| | | > |
| | | <thead> |
| | | <tr> |
| | | <th class="text-center">开门记录ID</th> |
| | | <th class="text-center">设备编码</th> |
| | | <th class="text-center">设备ID</th> |
| | | <th class="text-center">用户名称</th> |
| | | <th class="text-center">开门方式</th> |
| | | <th class="text-center">用户手机号</th> |
| | |
| | | </thead> |
| | | <tbody> |
| | | <tr v-for="machineRecord in machineRecordManageInfo.machineRecords"> |
| | | <td class="text-center">{{machineRecord.machineRecordId}}</td> |
| | | <td class="text-center">{{machineRecord.machineCode}}</td> |
| | | <td class="text-center">{{machineRecord.machineId}}</td> |
| | | <td class="text-center">{{machineRecord.name}}</td> |
| | | <td class="text-center">{{machineRecord.openTypeCd}}</td> |
| | | <td class="text-center">{{machineRecord.openTypeName}}</td> |
| | | <td class="text-center">{{machineRecord.tel}}</td> |
| | | <td class="text-center">{{machineRecord.idCard}}</td> |
| | | <td class="text-center"> |
| | |
| | | <div> |
| | | <div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">开门记录ID</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="machineRecordDetailInfo.machineRecordId" type="text" |
| | | placeholder="必填,请填写开门记录ID" readonly class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">设备编码</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="machineRecordDetailInfo.machineCode" type="text" |
| | |
| | | class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row" v-if="machineRecordDetailInfo.openTypeCd == '1000'"> |
| | | <label class="col-sm-2 col-form-label">人脸照片</label> |
| | | <div class="col-sm-10"> |
| | | <image width="120px" height="140px" v-bind:src="machineRecordDetailInfo.photo" @error="errorLoadImg"/> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="ibox-content"> |
| | | <button type="button" class="btn btn-warning float-right" |
| | |
| | | (function (vc, vm) { |
| | | |
| | | var _fileUrl = '/callComponent/download/getFile/fileByObjId'; |
| | | vc.extends({ |
| | | data: { |
| | | machineRecordDetailInfo: { |
| | |
| | | openTypeCd: '', |
| | | tel: '', |
| | | idCard: '', |
| | | photo:'' |
| | | } |
| | | }, |
| | | _initMethod: function () { |
| | |
| | | vc.component.refreshEditMachineRecordInfo(); |
| | | $('#editMachineRecordModel').modal('show'); |
| | | vc.copyObject(_params, vc.component.machineRecordDetailInfo); |
| | | vc.component._loadMachineRecordImage(); |
| | | vc.component.machineRecordDetailInfo.communityId = vc.getCurrentCommunity().communityId; |
| | | }); |
| | | }, |
| | |
| | | openTypeCd: '', |
| | | tel: '', |
| | | idCard: '', |
| | | photo:'', |
| | | |
| | | } |
| | | }, |
| | | errorLoadImg:function(){ |
| | | vc.component.machineRecordDetailInfo.photo="/img/noPhoto.gif"; |
| | | }, |
| | | _loadMachineRecordImage:function () { |
| | | vc.component.machineRecordDetailInfo.photo = _fileUrl+"?objId="+ |
| | | vc.component.machineRecordDetailInfo.machineRecordId +"&communityId="+vc.getCurrentCommunity().communityId+"&fileTypeCd=60000&time="+new Date(); |
| | | } |
| | | } |
| | | }); |
| | |
| | | > |
| | | <thead> |
| | | <tr> |
| | | <th class="text-center">开门记录ID</th> |
| | | <th class="text-center">设备编码</th> |
| | | <th class="text-center">设备ID</th> |
| | | <th class="text-center">被呼叫用户名称</th> |
| | | <th class="text-center">被呼叫方式</th> |
| | | <th class="text-center">被呼叫用户手机号</th> |
| | |
| | | </thead> |
| | | <tbody> |
| | | <tr v-for="machineRecord in machineVistorPhotoManageInfo.machineRecords"> |
| | | <td class="text-center">{{machineRecord.machineRecordId}}</td> |
| | | <td class="text-center">{{machineRecord.machineCode}}</td> |
| | | <td class="text-center">{{machineRecord.machineId}}</td> |
| | | <td class="text-center">{{machineRecord.name}}</td> |
| | | <td class="text-center">{{machineRecord.openTypeCd}}</td> |
| | | <td class="text-center">{{machineRecord.openTypeName}}</td> |
| | | <td class="text-center">{{machineRecord.tel}}</td> |
| | | <td class="text-center">{{machineRecord.idCard}}</td> |
| | | <td class="text-center"> |
| | |
| | | { |
| | | limit: "maxin", |
| | | param: "4,100", |
| | | errInfo: "小区名称必须在4至100字符之间" |
| | | errInfo: "标题必须在4至100字符之间" |
| | | }, |
| | | ], |
| | | 'addNoticeInfo.noticeTypeCd': [ |
| | |
| | | }, |
| | | saveNoticeInfo: function () { |
| | | if (!vc.component.addNoticeValidate()) { |
| | | vc.message(vc.validate.errInfo); |
| | | vc.toast(vc.validate.errInfo); |
| | | |
| | | return; |
| | | } |
| | |
| | | <div class="col-sm-10"><input v-model="addOwnerInfo.age" type="number" |
| | | placeholder="必填,请填写年龄" class="form-control"></div> |
| | | </div> |
| | | <div class="form-group row" v-if="addOwnerInfo.componentTitle == '成员'"> |
| | | <label class="col-sm-2 col-form-label">类型</label> |
| | | <div class="col-sm-10"> |
| | | <select class="custom-select" v-model="addOwnerInfo.ownerTypeCd"> |
| | | <option selected disabled value="">必填,请选择类型</option> |
| | | <option value="1002">家庭成员</option> |
| | | <option value="1003">租客</option> |
| | | <option value="1005">其他</option> |
| | | </select></div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">身份证</label> |
| | | <div class="col-sm-10"><input v-model="addOwnerInfo.idCard" type="number" |
| | |
| | | (function(vc){ |
| | | (function (vc) { |
| | | |
| | | vc.extends({ |
| | | propTypes: { |
| | | notifyLoadDataComponentName:vc.propTypes.string, |
| | | componentTitle:vc.propTypes.string // 组件名称 |
| | | notifyLoadDataComponentName: vc.propTypes.string, |
| | | componentTitle: vc.propTypes.string // 组件名称 |
| | | }, |
| | | data:{ |
| | | addOwnerInfo:{ |
| | | componentTitle:$props.componentTitle, |
| | | name:'', |
| | | age:'', |
| | | link:'', |
| | | sex:'', |
| | | remark:'', |
| | | ownerId:'', |
| | | ownerPhoto:'', |
| | | idCard:'', |
| | | videoPlaying:false |
| | | data: { |
| | | addOwnerInfo: { |
| | | componentTitle: $props.componentTitle, |
| | | name: '', |
| | | age: '', |
| | | link: '', |
| | | sex: '', |
| | | ownerTypeCd: '-1', |
| | | remark: '', |
| | | ownerId: '', |
| | | ownerPhoto: '', |
| | | idCard: '', |
| | | videoPlaying: false |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | _initMethod: function () { |
| | | |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('addOwner','openAddOwnerModal',function(_ownerId){ |
| | | if(_ownerId != null || _ownerId != -1){ |
| | | }, |
| | | _initEvent: function () { |
| | | vc.on('addOwner', 'openAddOwnerModal', function (_ownerId) { |
| | | if (_ownerId != null || _ownerId != -1) { |
| | | vc.component.addOwnerInfo.ownerId = _ownerId; |
| | | } |
| | | $('#addOwnerModel').modal('show'); |
| | | vc.component._initAddOwnerMedia(); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | addOwnerValidate:function(){ |
| | | methods: { |
| | | addOwnerValidate: function () { |
| | | return vc.validate.validate({ |
| | | addOwnerInfo:vc.component.addOwnerInfo |
| | | },{ |
| | | 'addOwnerInfo.name':[ |
| | | addOwnerInfo: vc.component.addOwnerInfo |
| | | }, { |
| | | 'addOwnerInfo.name': [ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"名称不能为空" |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "名称不能为空" |
| | | }, |
| | | { |
| | | limit:"maxin", |
| | | param:"2,10", |
| | | errInfo:"名称长度必须在2位至10位" |
| | | limit: "maxin", |
| | | param: "2,10", |
| | | errInfo: "名称长度必须在2位至10位" |
| | | }, |
| | | ], |
| | | 'addOwnerInfo.age':[ |
| | | 'addOwnerInfo.age': [ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"年龄不能为空" |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "年龄不能为空" |
| | | }, |
| | | { |
| | | limit:"num", |
| | | param:"", |
| | | errInfo:"年龄不是有效的数字" |
| | | limit: "num", |
| | | param: "", |
| | | errInfo: "年龄不是有效的数字" |
| | | }, |
| | | ], |
| | | 'addOwnerInfo.sex':[ |
| | | 'addOwnerInfo.sex': [ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"性别不能为空" |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "性别不能为空" |
| | | } |
| | | ], |
| | | 'addOwnerInfo.link':[ |
| | | 'addOwnerInfo.link': [ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"手机号不能为空" |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "手机号不能为空" |
| | | }, |
| | | { |
| | | limit:"phone", |
| | | param:"", |
| | | errInfo:"不是有效的手机号" |
| | | limit: "phone", |
| | | param: "", |
| | | errInfo: "不是有效的手机号" |
| | | } |
| | | ], |
| | | 'addOwnerInfo.idCard':[ |
| | | 'addOwnerInfo.idCard': [ |
| | | { |
| | | limit:"maxLength", |
| | | param:"18", |
| | | errInfo:"身份证长度不能超过200位" |
| | | limit: "maxLength", |
| | | param: "18", |
| | | errInfo: "身份证长度不能超过200位" |
| | | } |
| | | ], |
| | | 'addOwnerInfo.remark':[ |
| | | 'addOwnerInfo.ownerTypeCd': [ |
| | | { |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "人员类型不能为空" |
| | | } |
| | | ], |
| | | 'addOwnerInfo.remark': [ |
| | | |
| | | { |
| | | limit:"maxLength", |
| | | param:"200", |
| | | errInfo:"备注长度不能超过200位" |
| | | limit: "maxLength", |
| | | param: "200", |
| | | errInfo: "备注长度不能超过200位" |
| | | } |
| | | ] |
| | | |
| | | }); |
| | | }, |
| | | saveOwnerInfo:function(){ |
| | | if(!vc.component.addOwnerValidate()){ |
| | | saveOwnerInfo: function () { |
| | | if (!vc.component.addOwnerValidate()) { |
| | | vc.message(vc.validate.errInfo); |
| | | |
| | | return ; |
| | | return; |
| | | } |
| | | |
| | | vc.component.addOwnerInfo.communityId = vc.getCurrentCommunity().communityId; |
| | |
| | | 'saveOwner', |
| | | JSON.stringify(vc.component.addOwnerInfo), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | emulateJSON: true |
| | | }, |
| | | function (json, res) { |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | if (res.status == 200) { |
| | | //关闭model |
| | | $('#addOwnerModel').modal('hide'); |
| | | vc.component.clearAddOwnerInfo(); |
| | | vc.emit($props.notifyLoadDataComponentName,'listOwnerData',{}); |
| | | vc.emit($props.notifyLoadDataComponentName, 'listOwnerData', {}); |
| | | |
| | | return ; |
| | | return; |
| | | } |
| | | vc.message(json); |
| | | |
| | | }, |
| | | function(errInfo,error){ |
| | | }, |
| | | function (errInfo, error) { |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.message(errInfo); |
| | | |
| | | }); |
| | | }); |
| | | }, |
| | | clearAddOwnerInfo:function(){ |
| | | clearAddOwnerInfo: function () { |
| | | vc.component.addOwnerInfo = { |
| | | name:'', |
| | | age:'', |
| | | link:'', |
| | | sex:'', |
| | | remark:'' |
| | | }; |
| | | name: '', |
| | | age: '', |
| | | link: '', |
| | | sex: '', |
| | | remark: '' |
| | | }; |
| | | }, |
| | | _addUserMedia:function() { |
| | | _addUserMedia: function () { |
| | | return navigator.getUserMedia = navigator.getUserMedia || |
| | | navigator.webkitGetUserMedia || |
| | | navigator.mozGetUserMedia || |
| | | navigator.msGetUserMedia || null; |
| | | }, |
| | | _initAddOwnerMedia:function () { |
| | | if(vc.component._addUserMedia()){ |
| | | _initAddOwnerMedia: function () { |
| | | if (vc.component._addUserMedia()) { |
| | | vc.component.addOwnerInfo.videoPlaying = false; |
| | | var constraints = { |
| | | video: true, |
| | |
| | | console.log("ERROR"); |
| | | console.log(error); |
| | | }); |
| | | }else{ |
| | | } else { |
| | | console.log("初始化视频失败"); |
| | | } |
| | | }, |
| | | _takePhoto:function () { |
| | | _takePhoto: function () { |
| | | if (vc.component.addOwnerInfo.videoPlaying) { |
| | | var canvas = document.getElementById('canvas'); |
| | | var video = document.getElementById('ownerPhoto'); |
| | |
| | | //document.getElementById('photo').setAttribute('src', data); |
| | | } |
| | | }, |
| | | _uploadPhoto:function(event){ |
| | | _uploadPhoto: function (event) { |
| | | $("#uploadOwnerPhoto").trigger("click") |
| | | }, |
| | | _choosePhoto:function(event){ |
| | | _choosePhoto: function (event) { |
| | | var photoFiles = event.target.files; |
| | | if (photoFiles && photoFiles.length > 0) { |
| | | // 获取目前上传的文件 |
| | | var file = photoFiles[0];// 文件大小校验的动作 |
| | | if(file.size > 1024 * 1024 * 1) { |
| | | if (file.size > 1024 * 1024 * 1) { |
| | | vc.toast("图片大小不能超过 2MB!") |
| | | return false; |
| | | } |
| | | var reader = new FileReader(); //新建FileReader对象 |
| | | reader.readAsDataURL(file); //读取为base64 |
| | | reader.onloadend = function(e) { |
| | | reader.onloadend = function (e) { |
| | | vc.component.addOwnerInfo.ownerPhoto = reader.result; |
| | | } |
| | | } |
| | |
| | | <div class="col-sm-10"><input v-model="editOwnerInfo.age" type="number" |
| | | placeholder="必填,请填写年龄" class="form-control"></div> |
| | | </div> |
| | | <div class="form-group row" v-if="editOwnerInfo.componentTitle == '成员'"> |
| | | <label class="col-sm-2 col-form-label">类型</label> |
| | | <div class="col-sm-10"> |
| | | <select class="custom-select" v-model="editOwnerInfo.ownerTypeCd"> |
| | | <option selected disabled value="">必填,请选择类型</option> |
| | | <option value="1002">家庭成员</option> |
| | | <option value="1003">租客</option> |
| | | <option value="1005">其他</option> |
| | | </select></div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">身份证</label> |
| | | <div class="col-sm-10"><input v-model="editOwnerInfo.idCard" type="number" |
| | |
| | | (function(vc){ |
| | | (function (vc) { |
| | | //var _fileUrl = 'https://hc.demo.winqi.cn/callComponent/download/getFile/fileByObjId'; |
| | | var _fileUrl = '/callComponent/download/getFile/fileByObjId'; |
| | | vc.extends({ |
| | | propTypes: { |
| | | notifyLoadDataComponentName:vc.propTypes.string |
| | | notifyLoadDataComponentName: vc.propTypes.string, |
| | | componentTitle: vc.propTypes.string // 组件名称 |
| | | }, |
| | | data:{ |
| | | editOwnerInfo:{ |
| | | ownerId:'', |
| | | memberId:'', |
| | | name:'', |
| | | age:'', |
| | | link:'', |
| | | sex:'', |
| | | remark:'', |
| | | ownerPhoto:'', |
| | | idCard:'', |
| | | videoPlaying:false |
| | | data: { |
| | | editOwnerInfo: { |
| | | componentTitle: $props.componentTitle, |
| | | ownerId: '', |
| | | memberId: '', |
| | | ownerTypeCd: '', |
| | | name: '', |
| | | age: '', |
| | | link: '', |
| | | sex: '', |
| | | remark: '', |
| | | ownerPhoto: '', |
| | | idCard: '', |
| | | videoPlaying: false |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | _initMethod: function () { |
| | | |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('editOwner','openEditOwnerModal',function(_owner){ |
| | | vc.copyObject(_owner,vc.component.editOwnerInfo); |
| | | }, |
| | | _initEvent: function () { |
| | | vc.on('editOwner', 'openEditOwnerModal', function (_owner) { |
| | | vc.copyObject(_owner, vc.component.editOwnerInfo); |
| | | //根据memberId 查询 照片信息 |
| | | vc.component.editOwnerInfo.ownerPhoto = _fileUrl+"?objId="+ |
| | | vc.component.editOwnerInfo.memberId +"&communityId="+vc.getCurrentCommunity().communityId+"&fileTypeCd=10000&time="+new Date(); |
| | | vc.component.editOwnerInfo.ownerPhoto = _fileUrl + "?objId=" + |
| | | vc.component.editOwnerInfo.memberId + "&communityId=" + vc.getCurrentCommunity().communityId + "&fileTypeCd=10000&time=" + new Date(); |
| | | $('#editOwnerModel').modal('show'); |
| | | vc.component._initAddOwnerMediaForEdit(); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | editOwnerValidate:function(){ |
| | | methods: { |
| | | editOwnerValidate: function () { |
| | | return vc.validate.validate({ |
| | | editOwnerInfo:vc.component.editOwnerInfo |
| | | },{ |
| | | 'editOwnerInfo.name':[ |
| | | editOwnerInfo: vc.component.editOwnerInfo |
| | | }, { |
| | | 'editOwnerInfo.name': [ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"名称不能为空" |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "名称不能为空" |
| | | }, |
| | | { |
| | | limit:"maxin", |
| | | param:"2,10", |
| | | errInfo:"名称长度必须在2位至10位" |
| | | limit: "maxin", |
| | | param: "2,10", |
| | | errInfo: "名称长度必须在2位至10位" |
| | | }, |
| | | ], |
| | | 'editOwnerInfo.age':[ |
| | | 'editOwnerInfo.age': [ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"年龄不能为空" |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "年龄不能为空" |
| | | }, |
| | | { |
| | | limit:"num", |
| | | param:"", |
| | | errInfo:"年龄不是有效的数字" |
| | | limit: "num", |
| | | param: "", |
| | | errInfo: "年龄不是有效的数字" |
| | | }, |
| | | ], |
| | | 'editOwnerInfo.sex':[ |
| | | 'editOwnerInfo.sex': [ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"性别不能为空" |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "性别不能为空" |
| | | } |
| | | ], |
| | | 'editOwnerInfo.idCard':[ |
| | | 'editOwnerInfo.idCard': [ |
| | | { |
| | | limit:"maxLength", |
| | | param:"18", |
| | | errInfo:"身份证长度不能超过200位" |
| | | limit: "maxLength", |
| | | param: "18", |
| | | errInfo: "身份证长度不能超过200位" |
| | | } |
| | | ], |
| | | 'editOwnerInfo.link':[ |
| | | 'editOwnerInfo.link': [ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"手机号不能为空" |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "手机号不能为空" |
| | | }, |
| | | { |
| | | limit:"phone", |
| | | param:"", |
| | | errInfo:"不是有效的手机号" |
| | | limit: "phone", |
| | | param: "", |
| | | errInfo: "不是有效的手机号" |
| | | } |
| | | ], |
| | | 'editOwnerInfo.remark':[ |
| | | 'editOwnerInfo.remark': [ |
| | | |
| | | { |
| | | limit:"maxLength", |
| | | param:"200", |
| | | errInfo:"备注长度不能超过200位" |
| | | limit: "maxLength", |
| | | param: "200", |
| | | errInfo: "备注长度不能超过200位" |
| | | } |
| | | ] |
| | | |
| | | }); |
| | | }, |
| | | |
| | | editOwnerMethod:function(){ |
| | | editOwnerMethod: function () { |
| | | |
| | | if(!vc.component.editOwnerValidate()){ |
| | | if (!vc.component.editOwnerValidate()) { |
| | | vc.message(vc.validate.errInfo); |
| | | |
| | | return ; |
| | | return; |
| | | } |
| | | |
| | | vc.component.editOwnerInfo.communityId = vc.getCurrentCommunity().communityId; |
| | | |
| | | //编辑时 ownerPhoto 中内容不是照片内容,则清空 |
| | | if(vc.component.editOwnerInfo.ownerPhoto.indexOf(_fileUrl) != -1){ |
| | | if (vc.component.editOwnerInfo.ownerPhoto.indexOf(_fileUrl) != -1) { |
| | | vc.component.editOwnerInfo.ownerPhoto = ""; |
| | | } |
| | | vc.http.post( |
| | |
| | | 'changeOwner', |
| | | JSON.stringify(vc.component.editOwnerInfo), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | emulateJSON: true |
| | | }, |
| | | function (json, res) { |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | if (res.status == 200) { |
| | | //关闭model |
| | | $('#editOwnerModel').modal('hide'); |
| | | vc.component.clearEditOwnerInfo(); |
| | | vc.emit($props.notifyLoadDataComponentName,'listOwnerData',{}); |
| | | vc.emit($props.notifyLoadDataComponentName, 'listOwnerData', {}); |
| | | |
| | | return ; |
| | | return; |
| | | } |
| | | vc.message(json); |
| | | |
| | | }, |
| | | function(errInfo,error){ |
| | | }, |
| | | function (errInfo, error) { |
| | | console.log('请求失败处理'); |
| | | vc.message(errInfo); |
| | | }); |
| | | }); |
| | | }, |
| | | clearEditOwnerInfo:function(){ |
| | | clearEditOwnerInfo: function () { |
| | | vc.component.editOwnerInfo = { |
| | | ownerId:'', |
| | | memberId:'', |
| | | name:'', |
| | | age:'', |
| | | link:'', |
| | | sex:'', |
| | | remark:'', |
| | | idCard:'', |
| | | ownerPhoto:'', |
| | | videoPlaying:false |
| | | ownerId: '', |
| | | memberId: '', |
| | | name: '', |
| | | age: '', |
| | | link: '', |
| | | sex: '', |
| | | remark: '', |
| | | idCard: '', |
| | | ownerPhoto: '', |
| | | videoPlaying: false |
| | | }; |
| | | }, |
| | | _editUserMedia:function() { |
| | | _editUserMedia: function () { |
| | | return navigator.getUserMedia = navigator.getUserMedia || |
| | | navigator.webkitGetUserMedia || |
| | | navigator.mozGetUserMedia || |
| | | navigator.msGetUserMedia || null; |
| | | }, |
| | | _initAddOwnerMediaForEdit:function () { |
| | | if(vc.component._editUserMedia()){ |
| | | _initAddOwnerMediaForEdit: function () { |
| | | if (vc.component._editUserMedia()) { |
| | | vc.component.editOwnerInfo.videoPlaying = false; |
| | | var constraints = { |
| | | video: true, |
| | |
| | | console.log("ERROR"); |
| | | console.log(error); |
| | | }); |
| | | }else{ |
| | | } else { |
| | | console.log("初始化视频失败"); |
| | | } |
| | | }, |
| | | _takePhotoForEdit:function () { |
| | | _takePhotoForEdit: function () { |
| | | if (vc.component.editOwnerInfo.videoPlaying) { |
| | | var canvas = document.getElementById('canvasForEdit'); |
| | | var video = document.getElementById('ownerPhotoForEdit'); |
| | |
| | | //document.getElementById('photo').setAttribute('src', data); |
| | | } |
| | | }, |
| | | _uploadEditPhoto:function(event){ |
| | | _uploadEditPhoto: function (event) { |
| | | $("#uploadEditOwnerPhoto").trigger("click") |
| | | }, |
| | | _chooseEditPhoto:function(event){ |
| | | _chooseEditPhoto: function (event) { |
| | | var photoFiles = event.target.files; |
| | | if (photoFiles && photoFiles.length > 0) { |
| | | // 获取目前上传的文件 |
| | | var file = photoFiles[0];// 文件大小校验的动作 |
| | | if(file.size > 1024 * 1024 * 1) { |
| | | if (file.size > 1024 * 1024 * 1) { |
| | | vc.toast("图片大小不能超过 2MB!") |
| | | return false; |
| | | } |
| | | var reader = new FileReader(); //新建FileReader对象 |
| | | reader.readAsDataURL(file); //读取为base64 |
| | | reader.onloadend = function(e) { |
| | | reader.onloadend = function (e) { |
| | | vc.component.editOwnerInfo.ownerPhoto = reader.result; |
| | | } |
| | | } |
| | |
| | | <th data-hide="phone">名称</th> |
| | | <th data-hide="phone">性别</th> |
| | | <th data-hide="phone">年龄</th> |
| | | <th data-hide="phone">类型</th> |
| | | <th data-hide="phone">身份证</th> |
| | | <th data-hide="phone">联系方式</th> |
| | | <th data-hide="phone">创建员工</th> |
| | |
| | | </td> |
| | | <td> |
| | | {{owner.age}} |
| | | </td> |
| | | <td> |
| | | {{owner.ownerTypeName}} |
| | | </td> |
| | | <td> |
| | | {{owner.idCard}} |
| | |
| | | <!-- 删除员工权限 --> |
| | | <vc:create name="editOwner" |
| | | notifyLoadDataComponentName="listOwnerMember" |
| | | componentTitle="成员" |
| | | ></vc:create> |
| | | <vc:create name="deleteOwner" |
| | | notifyLoadDataComponentName="listOwnerMember" |
| | |
| | | var param = { |
| | | params:{ |
| | | ownerId:vc.component.memberInfo._currentOwnerId, |
| | | communityId:vc.getCurrentCommunity().communityId, |
| | | ownerTypeCd:'1002' |
| | | communityId:vc.getCurrentCommunity().communityId |
| | | |
| | | } |
| | | }; |
| | | //发送get请求 |
| | |
| | | <a href="#" |
| | | v-on:click="_openDeleteOwnerRoom(owner)">删除房屋</a> |
| | | </p> |
| | | <p style="margin:10px 0;"> |
| | | <!-- <p style="margin:10px 0;"> |
| | | <a href="#" |
| | | v-on:click="_openHireParkingSpace(owner)">车位出租</a> |
| | | <span>|</span> |
| | |
| | | v-on:click="_openOwnerRepair(owner)">业主报修</a> |
| | | <span>|</span> |
| | | |
| | | </p> |
| | | </p>--> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <vc:create |
| | | name="editOwner" |
| | | notifyLoadDataComponentName="listOwner" |
| | | |
| | | componentTitle="业主" |
| | | ></vc:create> |
| | | <vc:create name="deleteOwner" |
| | | notifyLoadDataComponentName="listOwner" |
| | |
| | | <div class="col-lg-12"> |
| | | <div class="ibox "> |
| | | <div class="ibox-title"> |
| | | <h5>资产导入</h5> |
| | | <h5>资产信息</h5> |
| | | <div class="ibox-tools" style="top:10px;"> |
| | | <button type="button" class="btn btn-primary btn-sm" |
| | | v-on:click="_openDownloadHcExcelTemplate()"> |
| | | <i class="glyphicon glyphicon-download-alt"></i> |
| | | 模板 |
| | | </button> |
| | | |
| | | <button type="button" class="btn btn-primary btn-sm" |
| | | v-on:click="_exitCommunityData()"> |
| | | <i class="glyphicon glyphicon-floppy-save"></i> |
| | | 资产导出 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="ibox-content"> |
| | |
| | | /** |
| | | 权限组 |
| | | **/ |
| | | (function(vc){ |
| | | 权限组 |
| | | **/ |
| | | (function (vc) { |
| | | |
| | | vc.extends({ |
| | | data:{ |
| | | assetImportInfo:{ |
| | | data: { |
| | | assetImportInfo: { |
| | | communityId: vc.getCurrentCommunity().communityId, |
| | | excelTemplate:'', |
| | | remark:"" |
| | | excelTemplate: '', |
| | | remark: "" |
| | | } |
| | | }, |
| | | |
| | | _initMethod:function(){ |
| | | _initMethod: function () { |
| | | |
| | | }, |
| | | _initEvent:function(){ |
| | | _initEvent: function () { |
| | | |
| | | }, |
| | | methods:{ |
| | | assetImportValidate:function(){ |
| | | return vc.validate.validate({ |
| | | assetImportInfo:vc.component.assetImportInfo |
| | | },{ |
| | | methods: { |
| | | assetImportValidate: function () { |
| | | return vc.validate.validate({ |
| | | assetImportInfo: vc.component.assetImportInfo |
| | | }, { |
| | | |
| | | 'assetImportInfo.excelTemplate':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"文件不能为空" |
| | | } |
| | | ], |
| | | 'assetImportInfo.communityId':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"还未入驻小区,请先入驻小区" |
| | | } |
| | | ] |
| | | }); |
| | | 'assetImportInfo.excelTemplate': [ |
| | | { |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "文件不能为空" |
| | | } |
| | | ], |
| | | 'assetImportInfo.communityId': [ |
| | | { |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "还未入驻小区,请先入驻小区" |
| | | } |
| | | ] |
| | | }); |
| | | }, |
| | | _openDownloadHcExcelTemplate:function(){ |
| | | _openDownloadHcExcelTemplate: function () { |
| | | //下载 模板 |
| | | vc.jumpToPage('/import/hc.xlsx') |
| | | }, |
| | | getExcelTemplate:function(e){ |
| | | getExcelTemplate: function (e) { |
| | | //console.log("getExcelTemplate 开始调用") |
| | | vc.component.assetImportInfo.excelTemplate = e.target.files[0]; |
| | | |
| | | |
| | | vc.component.assetImportInfo.excelTemplate = e.target.files[0]; |
| | | }, |
| | | _importData:function(){ |
| | | _importData: function () { |
| | | |
| | | if(!vc.component.assetImportValidate()){ |
| | | return ; |
| | | if (!vc.component.assetImportValidate()) { |
| | | return; |
| | | } |
| | | // 导入数据 |
| | | if (!vc.component.checkFileType(vc.component.assetImportInfo.excelTemplate.name.split('.')[1])) { |
| | | vc.message('不是有效的Excel格式'); |
| | | return ; |
| | | return; |
| | | } |
| | | if (!vc.component.checkFileSize(vc.component.assetImportInfo.excelTemplate.size)) { |
| | | vc.message('Excel文件大小不能超过2M'); |
| | | return ; |
| | | return; |
| | | } |
| | | var param = new FormData(); |
| | | param.append("uploadFile", vc.component.assetImportInfo.excelTemplate); |
| | | param.append('communityId',vc.component.assetImportInfo.communityId); |
| | | param.append('communityId', vc.component.assetImportInfo.communityId); |
| | | |
| | | |
| | | vc.http.upload( |
| | |
| | | 'importData', |
| | | param, |
| | | { |
| | | emulateJSON:true, |
| | | emulateJSON: true, |
| | | //添加请求头 |
| | | headers: { |
| | | "Content-Type": "multipart/form-data" |
| | | } |
| | | }, |
| | | function(json,res){ |
| | | }, |
| | | function (json, res) { |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | if (res.status == 200) { |
| | | //关闭model |
| | | vc.message("处理成功"); |
| | | vc.jumpToPage('/flow/ownerFlow') |
| | | return ; |
| | | return; |
| | | } |
| | | vc.message(json); |
| | | }, |
| | | function(errInfo,error){ |
| | | }, |
| | | function (errInfo, error) { |
| | | console.log('请求失败处理'); |
| | | vc.message(errInfo); |
| | | }); |
| | | }); |
| | | }, |
| | | _exitCommunityData: function () { |
| | | vc.jumpToPage('/callComponent/assetImport/exitCommunityData?communityId='+vc.getCurrentCommunity().communityId); |
| | | /*var param = { |
| | | params:{ |
| | | communityId: vc.getCurrentCommunity().communityId |
| | | } |
| | | }; |
| | | vc.http.get( |
| | | 'assetImport', |
| | | 'exitCommunityData', |
| | | param, |
| | | { |
| | | emulateJSON: true, |
| | | //添加请求头 |
| | | /!*headers: { |
| | | "Content-Type": "multipart/form-data" |
| | | }*!/ |
| | | }, |
| | | function (json, res) { |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if (res.status == 200) { |
| | | //关闭model |
| | | vc.toast("导出成功"); |
| | | return; |
| | | } |
| | | vc.message(json); |
| | | }, |
| | | function (errInfo, error) { |
| | | console.log('请求失败处理'); |
| | | vc.message(errInfo); |
| | | });*/ |
| | | }, |
| | | checkFileType: function (fileType) { |
| | | const acceptTypes = ['xls', 'xlsx']; |
| | |
| | | public class AdvertItemDto extends PageDto implements Serializable { |
| | | |
| | | private String itemTypeCd; |
| | | private String[] itemTypeCds; |
| | | private String communityId; |
| | | private String advertItemId; |
| | | private String advertId; |
| | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | |
| | | public String[] getItemTypeCds() { |
| | | return itemTypeCds; |
| | | } |
| | | |
| | | public void setItemTypeCds(String[] itemTypeCds) { |
| | | this.itemTypeCds = itemTypeCds; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.dto.community; |
| | | |
| | | import com.java110.dto.PageDto; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName 小区属性 |
| | | * @Description 小区数据层封装 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class CommunityAttrDto extends PageDto implements Serializable { |
| | | |
| | | private String attrId; |
| | | private String communityId; |
| | | private String specCd; |
| | | private String value; |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getAttrId() { |
| | | return attrId; |
| | | } |
| | | |
| | | public void setAttrId(String attrId) { |
| | | this.attrId = attrId; |
| | | } |
| | | |
| | | public String getCommunityId() { |
| | | return communityId; |
| | | } |
| | | |
| | | public void setCommunityId(String communityId) { |
| | | this.communityId = communityId; |
| | | } |
| | | |
| | | public String getSpecCd() { |
| | | return specCd; |
| | | } |
| | | |
| | | public void setSpecCd(String specCd) { |
| | | this.specCd = specCd; |
| | | } |
| | | |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| | |
| | | public class FileRelDto extends PageDto implements Serializable { |
| | | |
| | | private String relTypeCd; |
| | | private String[] relTypeCds; |
| | | private String saveWay; |
| | | private String fileRelId; |
| | | private String fileRealName; |
| | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | |
| | | public String[] getRelTypeCds() { |
| | | return relTypeCds; |
| | | } |
| | | |
| | | public void setRelTypeCds(String[] relTypeCds) { |
| | | this.relTypeCds = relTypeCds; |
| | | } |
| | | } |
| | |
| | | private String roomId; |
| | | private String roomNum; |
| | | private String bId; |
| | | private String pwd; |
| | | private String typeFlag; |
| | | private String typeFlagName; |
| | | |
| | | |
| | | private Date createTime; |
| | |
| | | public void setbId(String bId) { |
| | | this.bId = bId; |
| | | } |
| | | |
| | | public String getPwd() { |
| | | return pwd; |
| | | } |
| | | |
| | | public void setPwd(String pwd) { |
| | | this.pwd = pwd; |
| | | } |
| | | |
| | | public String getTypeFlag() { |
| | | return typeFlag; |
| | | } |
| | | |
| | | public void setTypeFlag(String typeFlag) { |
| | | this.typeFlag = typeFlag; |
| | | } |
| | | |
| | | public String getTypeFlagName() { |
| | | return typeFlagName; |
| | | } |
| | | |
| | | public void setTypeFlagName(String typeFlagName) { |
| | | this.typeFlagName = typeFlagName; |
| | | } |
| | | } |
| | |
| | | private String fileTime; |
| | | private String machineCode; |
| | | private String openTypeCd; |
| | | private String openTypeName; |
| | | private String idCard; |
| | | private String machineRecordId; |
| | | private String machineId; |
| | |
| | | public void setRecordTypeCd(String recordTypeCd) { |
| | | this.recordTypeCd = recordTypeCd; |
| | | } |
| | | |
| | | public String getOpenTypeName() { |
| | | return openTypeName; |
| | | } |
| | | |
| | | public void setOpenTypeName(String openTypeName) { |
| | | this.openTypeName = openTypeName; |
| | | } |
| | | } |
| | |
| | | private String createTime; |
| | | |
| | | private String ownerTypeCd; |
| | | private String ownerTypeName; |
| | | |
| | | private String idCard; |
| | | |
| | |
| | | public void setIdCard(String idCard) { |
| | | this.idCard = idCard; |
| | | } |
| | | |
| | | public String getOwnerTypeName() { |
| | | return ownerTypeName; |
| | | } |
| | | |
| | | public void setOwnerTypeName(String ownerTypeName) { |
| | | this.ownerTypeName = ownerTypeName; |
| | | } |
| | | } |
| | |
| | | private String roomNum; |
| | | private String state; |
| | | private String stateName; |
| | | private String pwd; |
| | | private String typeFlag; |
| | | private String typeFlagName; |
| | | |
| | | public String getApplicationKeyId() { |
| | | return applicationKeyId; |
| | |
| | | public void setStateName(String stateName) { |
| | | this.stateName = stateName; |
| | | } |
| | | |
| | | public String getPwd() { |
| | | return pwd; |
| | | } |
| | | |
| | | public void setPwd(String pwd) { |
| | | this.pwd = pwd; |
| | | } |
| | | |
| | | public String getTypeFlag() { |
| | | return typeFlag; |
| | | } |
| | | |
| | | public void setTypeFlag(String typeFlag) { |
| | | this.typeFlag = typeFlag; |
| | | } |
| | | |
| | | public String getTypeFlagName() { |
| | | return typeFlagName; |
| | | } |
| | | |
| | | public void setTypeFlagName(String typeFlagName) { |
| | | this.typeFlagName = typeFlagName; |
| | | } |
| | | } |
| | |
| | | private String machineId; |
| | | private String name; |
| | | private String openTypeCd; |
| | | private String openTypeName; |
| | | private String tel; |
| | | private String idCard; |
| | | private String recordTypeCd; |
| | |
| | | public void setRecordTypeCd(String recordTypeCd) { |
| | | this.recordTypeCd = recordTypeCd; |
| | | } |
| | | |
| | | public String getOpenTypeName() { |
| | | return openTypeName; |
| | | } |
| | | |
| | | public void setOpenTypeName(String openTypeName) { |
| | | this.openTypeName = openTypeName; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.vo.api.owner; |
| | | |
| | | import com.java110.vo.Vo; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName ApiFloorDataVo |
| | | * @Description TODO |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 11:18 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class ApiOwnerCarDataVo extends Vo { |
| | | private String carColor; |
| | | private String carBrand; |
| | | private String carType; |
| | | private String carTypeName; |
| | | private String carNum; |
| | | private String psId; |
| | | private String remark; |
| | | private String ownerId; |
| | | private String userId; |
| | | private String carId; |
| | | |
| | | |
| | | private String createTime; |
| | | |
| | | public String getCarColor() { |
| | | return carColor; |
| | | } |
| | | |
| | | public void setCarColor(String carColor) { |
| | | this.carColor = carColor; |
| | | } |
| | | |
| | | public String getCarBrand() { |
| | | return carBrand; |
| | | } |
| | | |
| | | public void setCarBrand(String carBrand) { |
| | | this.carBrand = carBrand; |
| | | } |
| | | |
| | | public String getCarType() { |
| | | return carType; |
| | | } |
| | | |
| | | public void setCarType(String carType) { |
| | | this.carType = carType; |
| | | } |
| | | |
| | | public String getCarTypeName() { |
| | | return carTypeName; |
| | | } |
| | | |
| | | public void setCarTypeName(String carTypeName) { |
| | | this.carTypeName = carTypeName; |
| | | } |
| | | |
| | | public String getCarNum() { |
| | | return carNum; |
| | | } |
| | | |
| | | public void setCarNum(String carNum) { |
| | | this.carNum = carNum; |
| | | } |
| | | |
| | | public String getPsId() { |
| | | return psId; |
| | | } |
| | | |
| | | public void setPsId(String psId) { |
| | | this.psId = psId; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public String getOwnerId() { |
| | | return ownerId; |
| | | } |
| | | |
| | | public void setOwnerId(String ownerId) { |
| | | this.ownerId = ownerId; |
| | | } |
| | | |
| | | public String getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public String getCarId() { |
| | | return carId; |
| | | } |
| | | |
| | | public void setCarId(String carId) { |
| | | this.carId = carId; |
| | | } |
| | | |
| | | public String getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(String createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.vo.api.owner; |
| | | |
| | | import com.java110.vo.MorePageVo; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * API 查询小区楼返回对象 |
| | | */ |
| | | public class ApiOwnerCarVo extends MorePageVo implements Serializable { |
| | | |
| | | |
| | | private List<ApiOwnerCarDataVo> ownerCars; |
| | | |
| | | public List<ApiOwnerCarDataVo> getOwnerCars() { |
| | | return ownerCars; |
| | | } |
| | | |
| | | public void setOwnerCars(List<ApiOwnerCarDataVo> ownerCars) { |
| | | this.ownerCars = ownerCars; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.java110.core.feign.FeignConfiguration; |
| | | import com.java110.dto.CommunityMemberDto; |
| | | import com.java110.dto.community.CommunityAttrDto; |
| | | import com.java110.dto.community.CommunityDto; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | */ |
| | | @RequestMapping(value = "/getCommunityMemberCount", method = RequestMethod.POST) |
| | | int getCommunityMemberCount(@RequestBody CommunityMemberDto communityMemberDto); |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param communityAttrDto 数据对象分享 |
| | | * @return CommunityDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/getCommunityAttrs", method = RequestMethod.POST) |
| | | List<CommunityAttrDto> getCommunityAttrs(@RequestBody CommunityAttrDto communityAttrDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param communityAttrDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/getCommunityAttrsCount", method = RequestMethod.POST) |
| | | int getCommunityAttrsCount(@RequestBody CommunityAttrDto communityAttrDto); |
| | | |
| | | } |
| | |
| | | <mapper namespace="advertItemServiceDaoImpl"> |
| | | |
| | | <!-- 保存广告项信息信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessAdvertItemInfo" parameterType="Map"> |
| | | <insert id="saveBusinessAdvertItemInfo" parameterType="Map"> |
| | | insert into business_advert_item( |
| | | operate,item_type_cd,community_id,b_id,advert_item_id,advert_id,url,seq |
| | | ) values ( |
| | |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询广告项信息信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessAdvertItemInfo" parameterType="Map" resultType="Map"> |
| | | select t.operate,t.item_type_cd,t.item_type_cd itemTypeCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.advert_item_id,t.advert_item_id advertItemId,t.advert_id,t.advert_id advertId,t.url,t.seq |
| | | from business_advert_item t |
| | | where 1 =1 |
| | | <if test="operate !=null and operate != ''"> |
| | | and t.operate= #{operate} |
| | | </if> |
| | | <if test="itemTypeCd !=null and itemTypeCd != ''"> |
| | | and t.item_type_cd= #{itemTypeCd} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="advertItemId !=null and advertItemId != ''"> |
| | | and t.advert_item_id= #{advertItemId} |
| | | </if> |
| | | <if test="advertId !=null and advertId != ''"> |
| | | and t.advert_id= #{advertId} |
| | | </if> |
| | | <if test="url !=null and url != ''"> |
| | | and t.url= #{url} |
| | | </if> |
| | | <if test="seq !=null and seq != ''"> |
| | | and t.seq= #{seq} |
| | | </if> |
| | | <!-- 查询广告项信息信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessAdvertItemInfo" parameterType="Map" resultType="Map"> |
| | | select t.operate,t.item_type_cd,t.item_type_cd itemTypeCd,t.community_id,t.community_id |
| | | communityId,t.b_id,t.b_id bId,t.advert_item_id,t.advert_item_id advertItemId,t.advert_id,t.advert_id |
| | | advertId,t.url,t.seq |
| | | from business_advert_item t |
| | | where 1 =1 |
| | | <if test="operate !=null and operate != ''"> |
| | | and t.operate= #{operate} |
| | | </if> |
| | | <if test="itemTypeCd !=null and itemTypeCd != ''"> |
| | | and t.item_type_cd= #{itemTypeCd} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="advertItemId !=null and advertItemId != ''"> |
| | | and t.advert_item_id= #{advertItemId} |
| | | </if> |
| | | <if test="advertId !=null and advertId != ''"> |
| | | and t.advert_id= #{advertId} |
| | | </if> |
| | | <if test="url !=null and url != ''"> |
| | | and t.url= #{url} |
| | | </if> |
| | | <if test="seq !=null and seq != ''"> |
| | | and t.seq= #{seq} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | </select> |
| | | |
| | | |
| | | <!-- 保存广告项信息信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveAdvertItemInfoInstance" parameterType="Map"> |
| | | insert into advert_item( |
| | | item_type_cd,status_cd,community_id,b_id,advert_item_id,advert_id,url,seq |
| | | ) select t.item_type_cd,'0',t.community_id,t.b_id,t.advert_item_id,t.advert_id,t.url,t.seq from business_advert_item t where 1=1 |
| | | and t.operate= 'ADD' |
| | | <if test="itemTypeCd !=null and itemTypeCd != ''"> |
| | | and t.item_type_cd= #{itemTypeCd} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="advertItemId !=null and advertItemId != ''"> |
| | | and t.advert_item_id= #{advertItemId} |
| | | </if> |
| | | <if test="advertId !=null and advertId != ''"> |
| | | and t.advert_id= #{advertId} |
| | | </if> |
| | | <if test="url !=null and url != ''"> |
| | | and t.url= #{url} |
| | | </if> |
| | | <if test="seq !=null and seq != ''"> |
| | | and t.seq= #{seq} |
| | | </if> |
| | | item_type_cd,status_cd,community_id,b_id,advert_item_id,advert_id,url,seq |
| | | ) select t.item_type_cd,'0',t.community_id,t.b_id,t.advert_item_id,t.advert_id,t.url,t.seq from |
| | | business_advert_item t where 1=1 |
| | | and t.operate= 'ADD' |
| | | <if test="itemTypeCd !=null and itemTypeCd != ''"> |
| | | and t.item_type_cd= #{itemTypeCd} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="advertItemId !=null and advertItemId != ''"> |
| | | and t.advert_item_id= #{advertItemId} |
| | | </if> |
| | | <if test="advertId !=null and advertId != ''"> |
| | | and t.advert_id= #{advertId} |
| | | </if> |
| | | <if test="url !=null and url != ''"> |
| | | and t.url= #{url} |
| | | </if> |
| | | <if test="seq !=null and seq != ''"> |
| | | and t.seq= #{seq} |
| | | </if> |
| | | |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <!-- 查询广告项信息信息 add by wuxw 2018-07-03 --> |
| | | <select id="getAdvertItemInfo" parameterType="Map" resultType="Map"> |
| | | select t.item_type_cd,t.item_type_cd itemTypeCd,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.advert_item_id,t.advert_item_id advertItemId,t.advert_id,t.advert_id advertId,t.url,t.seq |
| | | from advert_item t |
| | | where 1 =1 |
| | | <if test="itemTypeCd !=null and itemTypeCd != ''"> |
| | | and t.item_type_cd= #{itemTypeCd} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="advertItemId !=null and advertItemId != ''"> |
| | | and t.advert_item_id= #{advertItemId} |
| | | </if> |
| | | <if test="advertId !=null and advertId != ''"> |
| | | and t.advert_id= #{advertId} |
| | | </if> |
| | | <if test="url !=null and url != ''"> |
| | | and t.url= #{url} |
| | | </if> |
| | | <if test="seq !=null and seq != ''"> |
| | | and t.seq= #{seq} |
| | | </if> |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | select t.item_type_cd,t.item_type_cd itemTypeCd,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id |
| | | communityId,t.b_id,t.b_id bId,t.advert_item_id,t.advert_item_id advertItemId,t.advert_id,t.advert_id |
| | | advertId,t.url,t.seq |
| | | from advert_item t |
| | | where 1 =1 |
| | | <if test="itemTypeCd !=null and itemTypeCd != ''"> |
| | | and t.item_type_cd= #{itemTypeCd} |
| | | </if> |
| | | <if test="itemTypeCds !=null"> |
| | | and t.item_type_cd in |
| | | <foreach collection="itemTypeCds" open="(" close=")" |
| | | separator="," item="item"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="advertItemId !=null and advertItemId != ''"> |
| | | and t.advert_item_id= #{advertItemId} |
| | | </if> |
| | | <if test="advertId !=null and advertId != ''"> |
| | | and t.advert_id= #{advertId} |
| | | </if> |
| | | <if test="url !=null and url != ''"> |
| | | and t.url= #{url} |
| | | </if> |
| | | <if test="seq !=null and seq != ''"> |
| | | and t.seq= #{seq} |
| | | </if> |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 修改广告项信息信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateAdvertItemInfoInstance" parameterType="Map"> |
| | | update advert_item t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="itemTypeCd !=null and itemTypeCd != ''"> |
| | | , t.item_type_cd= #{itemTypeCd} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | , t.community_id= #{communityId} |
| | | </if> |
| | | <if test="advertId !=null and advertId != ''"> |
| | | , t.advert_id= #{advertId} |
| | | </if> |
| | | <if test="url !=null and url != ''"> |
| | | , t.url= #{url} |
| | | </if> |
| | | <if test="seq !=null and seq != ''"> |
| | | , t.seq= #{seq} |
| | | </if> |
| | | where 1=1 <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="advertItemId !=null and advertItemId != ''"> |
| | | and t.advert_item_id= #{advertItemId} |
| | | </if> |
| | | update advert_item t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="itemTypeCd !=null and itemTypeCd != ''"> |
| | | , t.item_type_cd= #{itemTypeCd} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | , t.community_id= #{communityId} |
| | | </if> |
| | | <if test="advertId !=null and advertId != ''"> |
| | | , t.advert_id= #{advertId} |
| | | </if> |
| | | <if test="url !=null and url != ''"> |
| | | , t.url= #{url} |
| | | </if> |
| | | <if test="seq !=null and seq != ''"> |
| | | , t.seq= #{seq} |
| | | </if> |
| | | where 1=1 |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="advertItemId !=null and advertItemId != ''"> |
| | | and t.advert_item_id= #{advertItemId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询广告项信息数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryAdvertItemsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from advert_item t |
| | | where 1 =1 |
| | | <if test="itemTypeCd !=null and itemTypeCd != ''"> |
| | | and t.item_type_cd= #{itemTypeCd} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="advertItemId !=null and advertItemId != ''"> |
| | | and t.advert_item_id= #{advertItemId} |
| | | </if> |
| | | <if test="advertId !=null and advertId != ''"> |
| | | and t.advert_id= #{advertId} |
| | | </if> |
| | | <if test="url !=null and url != ''"> |
| | | and t.url= #{url} |
| | | </if> |
| | | <if test="seq !=null and seq != ''"> |
| | | and t.seq= #{seq} |
| | | </if> |
| | | <select id="queryAdvertItemsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from advert_item t |
| | | where 1 =1 |
| | | <if test="itemTypeCd !=null and itemTypeCd != ''"> |
| | | and t.item_type_cd= #{itemTypeCd} |
| | | </if> |
| | | <if test="itemTypeCds !=null"> |
| | | and t.item_type_cd in |
| | | <foreach collection="itemTypeCds" open="(" close=")" |
| | | separator="," item="item"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="advertItemId !=null and advertItemId != ''"> |
| | | and t.advert_item_id= #{advertItemId} |
| | | </if> |
| | | <if test="advertId !=null and advertId != ''"> |
| | | and t.advert_id= #{advertId} |
| | | </if> |
| | | <if test="url !=null and url != ''"> |
| | | and t.url= #{url} |
| | | </if> |
| | | <if test="seq !=null and seq != ''"> |
| | | and t.seq= #{seq} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <if test="relTypeCd !=null and relTypeCd != ''"> |
| | | and t.rel_type_cd= #{relTypeCd} |
| | | </if> |
| | | <if test="relTypeCds !=null"> |
| | | and t.rel_type_cd in |
| | | <foreach collection="relTypeCds" open="(" close=")" |
| | | separator="," item="item"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="saveWay !=null and saveWay != ''"> |
| | | and t.save_way= #{saveWay} |
| | | </if> |
| | |
| | | <if test="relTypeCd !=null and relTypeCd != ''"> |
| | | and t.rel_type_cd= #{relTypeCd} |
| | | </if> |
| | | <if test="relTypeCds !=null"> |
| | | and t.rel_type_cd in |
| | | <foreach collection="relTypeCds" open="(" close=")" |
| | | separator="," item="item"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="saveWay !=null and saveWay != ''"> |
| | | and t.save_way= #{saveWay} |
| | | </if> |
| | |
| | | <!-- 保存钥匙申请信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessApplicationKeyInfo" parameterType="Map"> |
| | | insert into business_application_key( |
| | | application_key_id,id_card,sex,end_time,machine_id,operate,type_cd,name,tel,start_time,state,community_id,b_id,age |
| | | application_key_id,id_card,sex,end_time,machine_id,operate,type_cd,name,tel,start_time,state,community_id,b_id,age,type_flag,pwd |
| | | ) values ( |
| | | #{applicationKeyId},#{idCard},#{sex},#{endTime},#{machineId},#{operate},#{typeCd},#{name},#{tel},#{startTime},#{state},#{communityId},#{bId},#{age} |
| | | #{applicationKeyId},#{idCard},#{sex},#{endTime},#{machineId},#{operate},#{typeCd},#{name},#{tel}, |
| | | #{startTime},#{state},#{communityId},#{bId},#{age},#{typeFlag},#{pwd} |
| | | ) |
| | | </insert> |
| | | |
| | |
| | | select t.application_key_id,t.application_key_id applicationKeyId,t.id_card,t.id_card |
| | | idCard,t.sex,t.end_time,t.end_time endTime,t.machine_id,t.machine_id machineId,t.operate,t.type_cd,t.type_cd |
| | | typeCd,t.name,t.tel,t.start_time,t.start_time startTime,t.state,t.community_id,t.community_id |
| | | communityId,t.b_id,t.b_id bId,t.age |
| | | communityId,t.b_id,t.b_id bId,t.age,t.type_flag,t.pwd |
| | | from business_application_key t |
| | | where 1 =1 |
| | | <if test="applicationKeyId !=null and applicationKeyId != ''"> |
| | |
| | | <if test="age !=null and age != ''"> |
| | | and t.age= #{age} |
| | | </if> |
| | | <if test="typeFlag !=null and typeFlag != ''"> |
| | | and t.type_flag= #{typeFlag} |
| | | </if> |
| | | <if test="pwd !=null and pwd != ''"> |
| | | and t.pwd= #{pwd} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | |
| | | <!-- 保存钥匙申请信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveApplicationKeyInfoInstance" parameterType="Map"> |
| | | insert into application_key( |
| | | application_key_id,id_card,sex,status_cd,end_time,machine_id,type_cd,name,tel,start_time,state,community_id,b_id,age |
| | | application_key_id,id_card,sex,status_cd,end_time,machine_id,type_cd,name,tel,start_time,state,community_id,b_id,age,type_flag,pwd |
| | | ) select |
| | | t.application_key_id,t.id_card,t.sex,'0',t.end_time,t.machine_id,t.type_cd,t.name,t.tel,t.start_time,t.state,t.community_id,t.b_id,t.age |
| | | from business_application_key t where 1=1 |
| | | t.application_key_id,t.id_card,t.sex,'0',t.end_time,t.machine_id,t.type_cd,t.name,t.tel,t.start_time,t.state,t.community_id,t.b_id,t.age, |
| | | t.type_flag,t.pwd |
| | | from business_application_key t |
| | | where 1=1 |
| | | <if test="applicationKeyId !=null and applicationKeyId != ''"> |
| | | and t.application_key_id= #{applicationKeyId} |
| | | </if> |
| | |
| | | <if test="age !=null and age != ''"> |
| | | and t.age= #{age} |
| | | </if> |
| | | <if test="typeFlag !=null and typeFlag != ''"> |
| | | and t.type_flag= #{typeFlag} |
| | | </if> |
| | | <if test="pwd !=null and pwd != ''"> |
| | | and t.pwd= #{pwd} |
| | | </if> |
| | | |
| | | </insert> |
| | | |
| | |
| | | machineId,t.type_cd,t.type_cd typeCd,t.name,t.tel,t.start_time,t.start_time |
| | | startTime,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.age, |
| | | m.`location_type_cd` locationTypeCd,m.`location_obj_id` locationObjId, |
| | | td.name typeName,td1.name stateName |
| | | FROM application_key t,machine m,t_dict td,t_dict td1 |
| | | td.name typeName,td1.name stateName,t.type_flag,t.type_flag typeFlag,t.pwd,td2.name typeFlagName |
| | | FROM application_key t,machine m,t_dict td,t_dict td1,t_dict td2 |
| | | WHERE 1 =1 |
| | | AND t.type_cd=td.status_cd |
| | | AND td.table_name='application_key' |
| | |
| | | AND t.state = td1.status_cd |
| | | AND td1.table_name='application_key' |
| | | AND td1.table_columns='state' |
| | | AND t.type_flag = td2.status_cd |
| | | AND td2.table_name='application_key' |
| | | AND td2.table_columns='type_flag' |
| | | |
| | | AND t.machine_id = m.machine_id |
| | | AND m.status_cd = '0' |
| | |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="endTime !=null "> |
| | | and t.end_time= #{endTime} |
| | | and t.end_time > #{endTime} |
| | | </if> |
| | | <if test="machineId !=null and machineId != ''"> |
| | | and t.machine_id= #{machineId} |
| | |
| | | </if> |
| | | <if test="age !=null and age != ''"> |
| | | and t.age= #{age} |
| | | </if> |
| | | <if test="typeFlag !=null and typeFlag != ''"> |
| | | and t.type_flag= #{typeFlag} |
| | | </if> |
| | | <if test="pwd !=null and pwd != ''"> |
| | | and t.pwd= #{pwd} |
| | | </if> |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | |
| | | <if test="age !=null and age != ''"> |
| | | , t.age= #{age} |
| | | </if> |
| | | <if test="typeFlag !=null and typeFlag != ''"> |
| | | , t.type_flag= #{typeFlag} |
| | | </if> |
| | | <if test="pwd !=null and pwd != ''"> |
| | | , t.pwd= #{pwd} |
| | | </if> |
| | | where 1=1 |
| | | <if test="applicationKeyId !=null and applicationKeyId != ''"> |
| | | and t.application_key_id= #{applicationKeyId} |
| | |
| | | <!-- 查询钥匙申请数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryApplicationKeysCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | FROM application_key t,machine m,t_dict td,t_dict td1 |
| | | FROM application_key t,machine m,t_dict td,t_dict td1,t_dict td2 |
| | | WHERE 1 =1 |
| | | AND t.type_cd=td.status_cd |
| | | AND td.table_name='application_key' |
| | |
| | | AND t.state = td1.status_cd |
| | | AND td1.table_name='application_key' |
| | | AND td1.table_columns='state' |
| | | AND t.type_flag = td2.status_cd |
| | | AND td2.table_name='application_key' |
| | | AND td2.table_columns='type_flag' |
| | | and t.machine_id = m.machine_id |
| | | and m.status_cd = '0' |
| | | <if test="applicationKeyId !=null and applicationKeyId != ''"> |
| | |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="endTime !=null"> |
| | | and t.end_time= #{endTime} |
| | | and t.end_time > #{endTime} |
| | | </if> |
| | | <if test="machineId !=null and machineId != ''"> |
| | | and t.machine_id= #{machineId} |
| | |
| | | <if test="age !=null and age != ''"> |
| | | and t.age= #{age} |
| | | </if> |
| | | <if test="typeFlag !=null and typeFlag != ''"> |
| | | and t.type_flag= #{typeFlag} |
| | | </if> |
| | | <if test="pwd !=null and pwd != ''"> |
| | | and t.pwd= #{pwd} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | |
| | | select t.file_time,t.file_time fileTime,t.machine_code,t.machine_code machineCode,t.open_type_cd,t.open_type_cd |
| | | openTypeCd,t.id_card,t.id_card idCard,t.status_cd,t.status_cd statusCd,t.machine_record_id,t.machine_record_id |
| | | machineRecordId,t.machine_id,t.machine_id machineId,t.name,t.tel,t.community_id,t.community_id |
| | | communityId,t.b_id,t.b_id bId,t.file_id,t.file_id fileId,t.record_type_cd,t.record_type_cd recordTypeCd |
| | | from machine_record t |
| | | communityId,t.b_id,t.b_id bId,t.file_id,t.file_id fileId,t.record_type_cd,t.record_type_cd recordTypeCd,td1.name openTypeName |
| | | from machine_record t,t_dict td1 |
| | | where 1 =1 |
| | | and t.open_type_cd = td1.status_cd |
| | | and td1.table_name = 'machine_record' |
| | | and td1.table_columns = 'open_type_cd' |
| | | <if test="fileTime !=null and fileTime != ''"> |
| | | and t.file_time= #{fileTime} |
| | | </if> |
| | |
| | | <!-- 查询设备上报数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryMachineRecordsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from machine_record t |
| | | from machine_record t,t_dict td1 |
| | | where 1 =1 |
| | | and t.open_type_cd = td1.status_cd |
| | | and td1.table_name = 'machine_record' |
| | | and td1.table_columns = 'open_type_cd' |
| | | <if test="fileTime !=null and fileTime != ''"> |
| | | and t.file_time= #{fileTime} |
| | | </if> |
| | |
| | | t.owner_id,t.owner_id ownerId,t.b_id,t.b_id bId, |
| | | t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,t.owner_type_cd, |
| | | t.owner_type_cd ownerTypeCd,t.create_time createTime,t.community_id, |
| | | t.community_id communityId,t.id_card, t.id_card idCard,t.state |
| | | from building_owner t |
| | | t.community_id communityId,t.id_card, t.id_card idCard,t.state,td.name ownerTypeName |
| | | from building_owner t,t_dict td |
| | | <if test="roomId != null and roomId != ''"> |
| | | ,building_owner_room_rel borr |
| | | </if> |
| | |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | and td.table_name = 'building_owner' |
| | | and td.`table_columns` = 'owner_type_cd' |
| | | and td.status_cd = t.owner_type_cd |
| | | <if test="sex !=null"> |
| | | and t.sex= #{sex} |
| | | </if> |
| | |
| | | <if test="ownerTypeCd !=null and ownerTypeCd != ''"> |
| | | and t.owner_type_cd= #{ownerTypeCd} |
| | | </if> |
| | | <if test="ownerTypeCds != null"> |
| | | and t.owner_type_cd in |
| | | <foreach collection="ownerTypeCds" item="item" open="(" close=")" separator=","> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | |
| | | })(window, window.vc); |
| | | |
| | | /** |
| | | * vc.toast(""); |
| | | 时间处理工具类 |
| | | **/ |
| | | (function (vc) { |
| | |
| | | /** |
| | | * 小区管理系统web端 APP_ID |
| | | */ |
| | | public final static String HC_HARDWARE_APP_ID = "8000418004"; |
| | | /** |
| | | * 小区管理系统web端 APP_ID |
| | | */ |
| | | public final static String HC_APP_FRONT_APP_ID = "8000418004"; |
| | | |
| | | |
| | |
| | | */ |
| | | public static final String LIST_APPLICATIONKEYS = "applicationKey.listApplicationKeys"; |
| | | |
| | | /** |
| | | * 查询 钥匙申请 |
| | | */ |
| | | public static final String AUTH_APPLICATIONKEYS = "applicationKey.authApplicationKeys"; |
| | | |
| | | |
| | | /** |
| | | * 审核 钥匙申请 |
| | |
| | | */ |
| | | public static final String LIST_AREAS = "area.listAreas"; |
| | | |
| | | |
| | | //查询停车位 |
| | | public static final String SERVICE_CODE_QUERY_PARKING_SPACE_CAR = "parkingSpace.queryParkingSpaceCars"; |
| | | |
| | | |
| | | } |