53个文件已删除
44个文件已修改
13 文件已重命名
1个文件已添加
| | |
| | | public class OwnerDto extends PageDto implements Serializable { |
| | | |
| | | // 业主本人 1002 家庭成员 |
| | | public static final String OWNER_TYPE_CD_OWNER = "1001"; //业主 |
| | | public static final String OWNER_TYPE_CD_MEMBER = "1002"; //家庭成员 |
| | | public static final String OWNER_TYPE_CD_RENTING = "1003"; //租客 |
| | | public static final String OWNER_TYPE_CD_TEMP = "1004"; //临时人员 |
| | | public static final String OWNER_TYPE_CD_OTHER = "1005"; //其他 |
| | | public static final String OWNER_TYPE_CD_OWNER = "1001"; //户主 |
| | | public static final String OWNER_TYPE_CD_MEMBER = "1002"; //户员 |
| | | |
| | | public static final String PERSON_TYPE_PERSON = "P"; // 个人 |
| | | public static final String PERSON_TYPE_COMPANY = "C"; // 公司 |
| | | |
| | | public static final String PERSON_ROLE_OWNER = "1"; // 业主 |
| | | public static final String PERSON_ROLE_RENT = "2"; // 租客 |
| | | public static final String PERSON_ROLE_MEMBER = "3"; // 家庭成员 |
| | | public static final String PERSON_ROLE_STAFF = "4"; // 员工 |
| | | public static final String PERSON_ROLE_OTHER = "99"; // 其他 |
| | | |
| | | |
| | | public static final String OWNER_FLAG_TRUE = "T";//业主标识 T是真实业主 F 是虚拟业主 |
| | |
| | | private String ownerTypeCd; |
| | | private String[] ownerTypeCds; |
| | | private String ownerTypeName; |
| | | private String personTypeName; |
| | | private String personRoleName; |
| | | |
| | | private String roomNum; |
| | | private String roomName; |
| | | private String psId; |
| | |
| | | |
| | | private String msg; |
| | | |
| | | private List<String> urls; |
| | | |
| | | private String url; |
| | | |
| | | private String roomCount; |
| | | private String memberCount; |
| | |
| | | private String memberLike; |
| | | |
| | | private String acctAmount; |
| | | |
| | | private String personType; |
| | | private String personRole; |
| | | private String concactPerson; |
| | | private String concactLink; |
| | | private String faceUrl; |
| | | |
| | | |
| | | public String getSex() { |
| | |
| | | this.address = address; |
| | | } |
| | | |
| | | public List<String> getUrls() { |
| | | return urls; |
| | | } |
| | | |
| | | public void setUrls(List<String> urls) { |
| | | this.urls = urls; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getCommunityQrCode() { |
| | | return communityQrCode; |
| | | } |
| | |
| | | public void setAcctAmount(String acctAmount) { |
| | | this.acctAmount = acctAmount; |
| | | } |
| | | |
| | | public String getPersonType() { |
| | | return personType; |
| | | } |
| | | |
| | | public void setPersonType(String personType) { |
| | | this.personType = personType; |
| | | } |
| | | |
| | | public String getPersonRole() { |
| | | return personRole; |
| | | } |
| | | |
| | | public void setPersonRole(String personRole) { |
| | | this.personRole = personRole; |
| | | } |
| | | |
| | | public String getConcactPerson() { |
| | | return concactPerson; |
| | | } |
| | | |
| | | public void setConcactPerson(String concactPerson) { |
| | | this.concactPerson = concactPerson; |
| | | } |
| | | |
| | | public String getConcactLink() { |
| | | return concactLink; |
| | | } |
| | | |
| | | public void setConcactLink(String concactLink) { |
| | | this.concactLink = concactLink; |
| | | } |
| | | |
| | | public String getFaceUrl() { |
| | | return faceUrl; |
| | | } |
| | | |
| | | public void setFaceUrl(String faceUrl) { |
| | | this.faceUrl = faceUrl; |
| | | } |
| | | |
| | | public String getPersonTypeName() { |
| | | return personTypeName; |
| | | } |
| | | |
| | | public void setPersonTypeName(String personTypeName) { |
| | | this.personTypeName = personTypeName; |
| | | } |
| | | |
| | | public String getPersonRoleName() { |
| | | return personRoleName; |
| | | } |
| | | |
| | | public void setPersonRoleName(String personRoleName) { |
| | | this.personRoleName = personRoleName; |
| | | } |
| | | } |
| | |
| | | private String bId; |
| | | private String ownerFlag; |
| | | |
| | | private String personType; |
| | | private String personRole; |
| | | private String concactPerson; |
| | | private String concactLink; |
| | | private String faceUrl; |
| | | |
| | | |
| | | public String getMemberId() { |
| | | return memberId; |
| | | } |
| | |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | |
| | | public String getPersonType() { |
| | | return personType; |
| | | } |
| | | |
| | | public void setPersonType(String personType) { |
| | | this.personType = personType; |
| | | } |
| | | |
| | | public String getPersonRole() { |
| | | return personRole; |
| | | } |
| | | |
| | | public void setPersonRole(String personRole) { |
| | | this.personRole = personRole; |
| | | } |
| | | |
| | | public String getConcactPerson() { |
| | | return concactPerson; |
| | | } |
| | | |
| | | public void setConcactPerson(String concactPerson) { |
| | | this.concactPerson = concactPerson; |
| | | } |
| | | |
| | | public String getConcactLink() { |
| | | return concactLink; |
| | | } |
| | | |
| | | public void setConcactLink(String concactLink) { |
| | | this.concactLink = concactLink; |
| | | } |
| | | |
| | | public String getFaceUrl() { |
| | | return faceUrl; |
| | | } |
| | | |
| | | public void setFaceUrl(String faceUrl) { |
| | | this.faceUrl = faceUrl; |
| | | } |
| | | } |
| | |
| | | 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,td.name ownerTypeName, |
| | | t.owner_flag,t.owner_flag ownerFlag,t.address |
| | | t.owner_flag,t.owner_flag ownerFlag,t.address,t.person_type personType,t.person_role personRole, |
| | | t.concact_person concactPerson, t.concact_link concactLink,t.face_url faceUrl,td.name ownerTypeName, |
| | | tdType.name personTypeName,tdRole.name personRoleName |
| | | <if test="roomIds != null"> |
| | | , borr.room_id roomId |
| | | </if> |
| | | from building_owner t,t_dict td |
| | | from building_owner t |
| | | left join t_dict td on td.table_name = 'building_owner' and td.`table_columns` = 'owner_type_cd' and td.status_cd = t.owner_type_cd |
| | | left join t_dict tdType on tdType.table_name = 'building_owner' and tdType.`table_columns` = 'person_type' and tdType.status_cd = t.person_type |
| | | left join t_dict tdRole on tdRole.table_name = 'building_owner' and tdRole.`table_columns` = 'person_role' and tdRole.status_cd = t.person_role |
| | | <if test="roomId != null and roomId != ''"> |
| | | ,building_owner_room_rel borr |
| | | left join building_owner_room_rel borr on borr.status_cd = '0' and t.owner_id = borr.owner_id |
| | | </if> |
| | | <if test="roomIds != null "> |
| | | ,building_owner_room_rel borr |
| | | left join building_owner_room_rel borr on t.owner_id = borr.owner_id and borr.status_cd = t.status_cd |
| | | </if> |
| | | where 1 = 1 |
| | | <if test="roomId != null and roomId != ''"> |
| | | and t.owner_id = borr.owner_id |
| | | and borr.status_cd = t.status_cd |
| | | and borr.room_id = #{roomId} |
| | | </if> |
| | | <if test="roomIds != null"> |
| | | and t.owner_id = borr.owner_id |
| | | and borr.status_cd = t.status_cd |
| | | and borr.room_id in |
| | | <foreach collection="roomIds" item="item" open="(" close=")" separator=","> |
| | | #{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="personType !=null and personType != ''"> |
| | | and t.person_type= #{personType} |
| | | </if> |
| | | <if test="personRole !=null and personRole != ''"> |
| | | and t.person_role= #{personRole} |
| | | </if> |
| | | <if test="concactPerson !=null and concactPerson != ''"> |
| | | and t.concact_person= #{concactPerson} |
| | | </if> |
| | | <if test="concactLink !=null and concactLink != ''"> |
| | | and t.concact_link= #{concactLink} |
| | | </if> |
| | | <if test="sex !=null"> |
| | | and t.sex= #{sex} |
| | | </if> |
| | |
| | | <select id="getOwnerInfoCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from building_owner t |
| | | left join t_dict td on td.table_name = 'building_owner' and td.`table_columns` = 'owner_type_cd' and td.status_cd = t.owner_type_cd |
| | | <if test="roomId != null and roomId != ''"> |
| | | ,building_owner_room_rel borr |
| | | left join building_owner_room_rel borr on borr.status_cd = '0' and t.owner_id = borr.owner_id |
| | | </if> |
| | | <if test="roomIds != null "> |
| | | ,building_owner_room_rel borr |
| | | left join building_owner_room_rel borr on t.owner_id = borr.owner_id and borr.status_cd = t.status_cd |
| | | </if> |
| | | where 1 =1 |
| | | where 1 = 1 |
| | | <if test="roomId != null and roomId != ''"> |
| | | and t.owner_id = borr.owner_id |
| | | and borr.status_cd = '0' |
| | | and borr.room_id = #{roomId} |
| | | </if> |
| | | <if test="roomIds != null"> |
| | | and t.owner_id = borr.owner_id |
| | | and borr.status_cd = '0' |
| | | and borr.room_id in |
| | | <foreach collection="roomIds" item="item" open="(" close=")" separator=","> |
| | | #{item} |
| | |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="personType !=null and personType != ''"> |
| | | and t.person_type= #{personType} |
| | | </if> |
| | | <if test="personRole !=null and personRole != ''"> |
| | | and t.person_role= #{personRole} |
| | | </if> |
| | | <if test="concactPerson !=null and concactPerson != ''"> |
| | | and t.concact_person= #{concactPerson} |
| | | </if> |
| | | <if test="concactLink !=null and concactLink != ''"> |
| | | and t.concact_link= #{concactLink} |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- 修改业主信息 add by wuxw 2018-07-03 --> |
| | |
| | | <!-- 保存业主信息信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveOwnerInfo" parameterType="Map"> |
| | | insert into building_owner(id_card, sex, link, owner_type_cd, remark, owner_id, user_id, name, state, |
| | | community_id, age, member_id, address) |
| | | community_id, age, member_id, address,person_type,person_role,concact_person,concact_link,face_url) |
| | | values (#{idCard}, #{sex}, #{link}, #{ownerTypeCd}, #{remark}, #{ownerId}, #{userId}, #{name}, #{state}, |
| | | #{communityId}, #{age}, #{memberId}, #{address}) |
| | | #{communityId}, #{age}, #{memberId}, #{address},#{personType},#{personRole},#{concactPerson},#{concactLink},#{faceUrl}) |
| | | </insert> |
| | | |
| | | <!-- 查询业主信息信息 add by wuxw 2018-07-03 --> |
| | |
| | | select t.id_card,t.id_card idCard,t.sex,t.link,t.owner_type_cd,t.owner_type_cd |
| | | ownerTypeCd,t.remark,t.status_cd,t.status_cd statusCd,t.owner_id,t.owner_id ownerId,t.user_id,t.user_id |
| | | userId,t.name,t.state,t.community_id,t.community_id communityId,t.age,t.member_id,t.member_id memberId, |
| | | t.address from building_owner t |
| | | t.address ,t.person_type personType,t.person_role personRole,t.concact_person concactPerson,td.name ownerTypeName, |
| | | t.concact_link concactLink,t.face_url faceUrl,tdType.name personTypeName,tdRole.name personRoleName |
| | | from building_owner t |
| | | left join t_dict td on td.table_name = 'building_owner' and td.`table_columns` = 'owner_type_cd' and td.status_cd = t.owner_type_cd |
| | | left join t_dict tdType on tdType.table_name = 'building_owner' and tdType.`table_columns` = 'person_type' and tdType.status_cd = t.person_type |
| | | left join t_dict tdRole on tdRole.table_name = 'building_owner' and tdRole.`table_columns` = 'person_role' and tdRole.status_cd = t.person_role |
| | | where 1 =1 |
| | | <if test="idCard !=null and idCard != ''"> |
| | | and t.id_card= #{idCard} |
| | | </if> |
| | | <if test="personType !=null and personType != ''"> |
| | | and t.person_type= #{personType} |
| | | </if> |
| | | <if test="personRole !=null and personRole != ''"> |
| | | and t.person_role= #{personRole} |
| | | </if> |
| | | <if test="concactPerson !=null and concactPerson != ''"> |
| | | and t.concact_person= #{concactPerson} |
| | | </if> |
| | | <if test="concactLink !=null and concactLink != ''"> |
| | | and t.concact_link= #{concactLink} |
| | | </if> |
| | | <if test="sex !=null and sex != ''"> |
| | | and t.sex= #{sex} |
| | |
| | | <if test="state !=null and state != ''"> |
| | | ,t.state= #{state} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | ,t.community_id= #{communityId} |
| | | </if> |
| | | |
| | | <if test="age != ''"> |
| | | ,t.age= #{age} |
| | | </if> |
| | | <if test="personType !=null and personType != ''"> |
| | | , t.person_type= #{personType} |
| | | </if> |
| | | <if test="personRole !=null and personRole != ''"> |
| | | , t.person_role= #{personRole} |
| | | </if> |
| | | <if test="concactPerson !=null and concactPerson != ''"> |
| | | , t.concact_person= #{concactPerson} |
| | | </if> |
| | | <if test="concactLink !=null and concactLink != ''"> |
| | | , t.concact_link= #{concactLink} |
| | | </if> |
| | | <if test="faceUrl !=null and faceUrl != ''"> |
| | | , t.face_url= #{faceUrl} |
| | | </if> |
| | | where 1=1 |
| | | <if test="memberId !=null and memberId != ''"> |
| | | and t.member_id= #{memberId} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | </update> |
| | | |
| | |
| | | <if test="memberId !=null and memberId != ''"> |
| | | and t.member_id= #{memberId} |
| | | </if> |
| | | <if test="personType !=null and personType != ''"> |
| | | and t.person_type= #{personType} |
| | | </if> |
| | | <if test="personRole !=null and personRole != ''"> |
| | | and t.person_role= #{personRole} |
| | | </if> |
| | | <if test="concactPerson !=null and concactPerson != ''"> |
| | | and t.concact_person= #{concactPerson} |
| | | </if> |
| | | <if test="concactLink !=null and concactLink != ''"> |
| | | and t.concact_link= #{concactLink} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="queryOwnersBindCount" parameterType="Map" resultType="Map"> |
| | | select count(DISTINCT t.member_id) count from building_owner t |
| | | select count(DISTINCT t.member_id) count |
| | | from building_owner t |
| | | left join owner_app_user oau on t.community_id = oau.community_id and t.member_id = oau.member_id and |
| | | oau.status_cd = '0' |
| | | where t.status_cd = '0' |
| | |
| | | |
| | | |
| | | @RequestMapping(value = "/saveOwner", method = RequestMethod.POST) |
| | | public int saveOwner(@RequestBody OwnerPo ownerPo); |
| | | int saveOwner(@RequestBody OwnerPo ownerPo); |
| | | |
| | | @RequestMapping(value = "/updateOwner", method = RequestMethod.POST) |
| | | public int updateOwner(@RequestBody OwnerPo ownerPo); |
| | | int updateOwner(@RequestBody OwnerPo ownerPo); |
| | | |
| | | @RequestMapping(value = "/deleteOwner", method = RequestMethod.POST) |
| | | public int deleteOwner(@RequestBody OwnerPo ownerPo); |
| | | int deleteOwner(@RequestBody OwnerPo ownerPo); |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | |
| | | */ |
| | | public static void listIsNull(List jsonArray, String message) { |
| | | |
| | | if (jsonArray != null && jsonArray.size() > 0) { |
| | | if (jsonArray != null && !jsonArray.isEmpty()) { |
| | | throw new IllegalArgumentException(message); |
| | | } |
| | | } |
| | |
| | | ) throws Exception { |
| | | |
| | | //String systemName = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.PAY_GOOD_NAME); |
| | | if(!StringUtil.isNumber(paymentOrderDto.getCycles())){ |
| | | paymentOrderDto.setCycles("1"); |
| | | } |
| | | |
| | | //todo 计算赠送积分 |
| | | GiftIntegralDto giftIntegralDto = computeGiftIntegralImpl.gift(payAmount, Integer.parseInt(paymentOrderDto.getCycles()), |
| | |
| | | import com.java110.dto.system.Business; |
| | | import com.java110.intf.store.ISmallWeChatInnerServiceSMO; |
| | | import com.java110.intf.store.ISmallWechatAttrInnerServiceSMO; |
| | | import com.java110.job.adapt.hcIot.GetToken; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private ISmallWechatAttrInnerServiceSMO smallWechatAttrInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 封装头信息 |
| | | * |
| | | * @return |
| | | */ |
| | | protected HttpHeaders getHeaders(RestTemplate outRestTemplate) { |
| | | HttpHeaders httpHeaders = new HttpHeaders(); |
| | | httpHeaders.add("access_token", GetToken.get(outRestTemplate, false)); |
| | | //httpHeaders.add("Content-Type", "application/x-www-form-urlencoded"); |
| | | return httpHeaders; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| File was renamed from service-job/src/main/java/com/java110/job/adapt/hcIotNew/IOwnerDataToIot.java |
| | |
| | | package com.java110.job.adapt.hcIotNew; |
| | | package com.java110.job.adapt.hcIot; |
| | | |
| | | import com.java110.dto.owner.OwnerDto; |
| | | |
old mode 100755
new mode 100644
| | |
| | | /* |
| | | * Copyright 2017-2020 吴学文 and java110 team. |
| | | * |
| | | * Licensed under the Apache License, Version 2.0 (the "License"); |
| | | * you may not use this file except in compliance with the License. |
| | | * You may obtain a copy of the License at |
| | | * |
| | | * http://www.apache.org/licenses/LICENSE-2.0 |
| | | * |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | */ |
| | | package com.java110.job.adapt.hcIot; |
| | | |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.util.StringUtil; |
| | | |
| | | /** |
| | | * HC 物联网常量类 |
| | | * 接口协议地址: https://gitee.com/java110/MicroCommunityThings/blob/master/back/docs/api.md |
| | | * |
| | | * @desc add by 吴学文 9:49 |
| | | */ |
| | | public class IotConstant { |
| | | |
| | | public static final String IOT_DOMAIN = "IOT"; // 物联网域 |
| | | public static final String IOT_URL = "IOT_URL"; // 物联网域 |
| | | public static final String IOT_APP_ID = "APP_ID"; // 物联网域 |
| | | public static final String IOT_APP_SECRET = "APP_SECRET"; // 物联网域 |
| | | public static final String PLUGIN_URL = "PLUGIN_URL"; |
| | | |
| | | private static final String DEFAULT_IOT_URL = "https://things.homecommunity.cn"; |
| | | |
| | | private static final String DEFAULT_APP_ID = "e86a6a373c354927bea5fd21a0bec617"; |
| | | private static final String DEFAULT_APP_SECRET = "ead9a2f67f96e2b8ed2fe38cc9709463"; |
| | | |
| | | public static final String GET_TOKEN_URL = "/extApi/auth/getAccessToken?appId=APP_ID&appSecret=APP_SECRET"; |
| | | |
| | | //添加小区 |
| | | public static final String ADD_COMMUNITY_URL = "/extApi/community/addCommunity"; |
| | | //修改小区 |
| | | public static final String UPDATE_COMMUNITY_URL = "/extApi/community/updateCommunity"; |
| | | //删除小区 |
| | | public static final String DELETE_COMMUNITY_URL = "/extApi/community/deleteCommunity"; |
| | | |
| | | //添加设备 |
| | | public static final String ADD_MACHINE_URL = "/extApi/machine/addMachine"; |
| | | //修改设备 |
| | | public static final String UPDATE_MACHINE_URL = "/extApi/machine/updateMachine"; |
| | | //删除设备 |
| | | public static final String DELETE_MACHINE_URL = "/extApi/machine/deleteMachine"; |
| | | |
| | | //添加停车场 |
| | | public static final String ADD_PARKING_AREA_URL = "/extApi/parkingArea/addParkingArea"; |
| | | //修改停车场 |
| | | public static final String UPDATE_PARKING_AREA_URL = "/extApi/parkingArea/updateParkingArea"; |
| | | //删除停车场 |
| | | public static final String DELETE_PARKING_AREA_URL = "/extApi/parkingArea/deleteParkingArea"; |
| | | |
| | | //添加停车场问候语 |
| | | public static final String ADD_PARKING_AREA_TEXT_URL = "/extApi/parkingAreaText/addParkingAreaText"; |
| | | |
| | | //添加岗亭 |
| | | public static final String ADD_PARKING_BOX_URL = "/extApi/parkingBox/addParkingBox"; |
| | | |
| | | //删除岗亭 |
| | | public static final String DELETE_PARKING_BOX_URL = "/extApi/parkingBox/deleteParkingBox"; |
| | | |
| | | //添加车辆 |
| | | public static final String ADD_OWNER_CAR_URL = "/extApi/car/addCar"; |
| | | |
| | | //添加访客 |
| | | public static final String ADD_VISIT_URL = "/extApi/car/addVisit"; |
| | | |
| | | //修改车辆 |
| | | public static final String UPDATE_OWNER_CAR_URL = "/extApi/car/updateCar"; |
| | | //删除车辆 |
| | | public static final String DELETE_OWNER_CAR_URL = "/extApi/car/deleteCar"; |
| | | |
| | | //添加车辆 |
| | | public static final String ADD_CAR_BLACK_WHITE_URL = "/extApi/car/addBlackWhite"; |
| | | |
| | | //修改车辆黑白名单 |
| | | public static final String UPDATE_CAR_BLACK_WHITE_URL = "/extApi/car/updateBlackWhite"; |
| | | |
| | | //删除车辆 |
| | | public static final String DELETE_CAR_BLACK_WHITE_URL = "/extApi/car/deleteBlackWhite"; |
| | | |
| | | //修改车牌 |
| | | public static final String UPDATE_CAR_INOUT_CAR_NUM = "/extApi/car/updateCarInoutCarNum"; |
| | | //修改车牌 |
| | | public static final String GET_MANUAL_OPEN_DOOR_LOGS = "/extApi/machine/getManualOpenDoorLogs"; |
| | | |
| | | //开门接口 |
| | | public static final String OPEN_DOOR = "/extApi/machine/openDoor"; |
| | | //开门接口 |
| | | public static final String CLOSE_DOOR = "/extApi/machine/closeDoor"; |
| | | |
| | | //手动进出场 |
| | | public static final String CUSTOM_CAR_INOUT = "/extApi/machine/customCarInOut"; |
| | | |
| | | //播放视频 |
| | | public static final String PLAY_VIDEO = "/extApi/machine/playVideo"; |
| | | |
| | | //结束视频 |
| | | public static final String BYE_VIDEO = "/extApi/machine/byeVideo"; |
| | | |
| | | //心跳视频 |
| | | public static final String HEARTBEAT_VIDEO = "/extApi/machine/heartbeatVideo"; |
| | | |
| | | //获取二维码 |
| | | public static final String GET_QRCODE = "/extApi/machine/getQRcode"; |
| | | //重启接口 |
| | | public static final String RESTART_MACHINE = "/extApi/machine/restartMachine"; |
| | | |
| | | //查询临时停车费订单 |
| | | public static final String GET_TEMP_CAR_FEE_ORDER = "/extApi/fee/getTempCarFeeOrder"; |
| | | |
| | | |
| | | //查询临时停车费订单 |
| | | public static final String NOTIFY_TEMP_CAR_FEE_ORDER = "/extApi/fee/notifyTempCarFeeOrder"; |
| | | |
| | | public static final String TEMP_CAR_AUTH = "/extApi/tempCarAuth/updateCarInoutTempAuths"; |
| | | |
| | | /** |
| | | * 查询临时车审核 |
| | | */ |
| | | public static final String GET_CAR_INOUT_TEMPAUTHS = "/extApi/tempCarAuth/getCarInoutTempAuths"; |
| | | |
| | | |
| | | //添加车辆 |
| | | public static final String ADD_TEAM_CAR_FEE_CONFIG = "/extApi/fee/addTempCarFee"; |
| | | //添加修改停车劵 |
| | | public static final String ADD_UPDATE_PARKING_COUPON_CAR = "/extApi/parkingCouponCar/addOrUpdateParkingCouponCar"; |
| | | public static final String DELETE_PARKING_COUPON_CAR = "/extApi/parkingCouponCar/deleteParkingCouponCar"; |
| | | //修改车辆 |
| | | public static final String UPDATE_TEAM_CAR_FEE_CONFIG = "/extApi/fee/updateTempCarFee"; |
| | | //删除车辆 |
| | | public static final String DELETE_TEAM_CAR_FEE_CONFIG = "/extApi/fee/deleteTempCarFee"; |
| | | |
| | | //添加考勤班次 |
| | | public static final String ADD_ATTENDANCE_CLASSES_STAFFS = "/extApi/attendance/addAttendanceClassStaffs"; |
| | | |
| | | //修改考勤班次 |
| | | public static final String UPDATE_ATTENDANCE_CLASSES_STAFFS = "/extApi/attendance/updateAttendanceClassStaffs"; |
| | | |
| | | //删除考勤班次 |
| | | public static final String DELETE_ATTENDANCE_CLASSES_STAFFS = "/extApi/attendance/deleteAttendanceClassStaff"; |
| | | |
| | | //添加考勤班次 |
| | | public static final String ADD_ATTENDANCE_CLASSES = "/extApi/attendance/addAttendanceClass"; |
| | | //修改考勤班次 |
| | | public static final String UPDATE_ATTENDANCE_CLASSES = "/extApi/attendance/updateAttendanceClass"; |
| | | //删除考勤班次 |
| | | public static final String DELETE_ATTENDANCE_CLASSES = "/extApi/attendance/deleteAttendanceClass"; |
| | | |
| | | public static final String HC_TOKEN = "HC_ACCESS_TOKEN"; |
| | | |
| | | public static final String PLUGIN_URL = "PLUGIN_URL"; |
| | | |
| | | //单位为秒 |
| | | public static final int DEFAULT_LOG_TIME = 5 * 60; |
| | | |
| | | //添加业主 |
| | | public static final String ADD_OWNER = "/extApi/user/addUser"; |
| | | public static final String EDIT_OWNER = "/extApi/user/updateUser"; |
| | | public static final String DELETE_OWNER = "/extApi/user/deleteUser"; |
| | | |
| | | |
| | | public static String getUrl(String param) { |
| | | String url = MappingCache.getValue(IOT_DOMAIN, IotConstant.IOT_URL); |
| | | |
| | | if (StringUtil.isEmpty(url)) { |
| | | return DEFAULT_IOT_URL + param; |
| | | } |
| | | |
| | | return url + param; |
| | | } |
| | | |
| | | public static String getAppId() { |
| | | String appId = MappingCache.getValue(IOT_DOMAIN, IotConstant.IOT_APP_ID); |
| | | |
| | | if (StringUtil.isEmpty(appId)) { |
| | | return DEFAULT_APP_ID; |
| | | } |
| | | |
| | | return appId; |
| | | } |
| | | |
| | | public static String getAppSecret() { |
| | | String appSecret = MappingCache.getValue(IOT_DOMAIN, IotConstant.IOT_APP_SECRET); |
| | | |
| | | if (StringUtil.isEmpty(appSecret)) { |
| | | return DEFAULT_APP_SECRET; |
| | | } |
| | | |
| | | return appSecret; |
| | | } |
| | | } |
| File was renamed from service-job/src/main/java/com/java110/job/adapt/hcIotNew/OwnerDataToIotImpl.java |
| | |
| | | package com.java110.job.adapt.hcIotNew; |
| | | package com.java110.job.adapt.hcIot; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | |
| | | import com.java110.dto.file.FileDto; |
| | | import com.java110.dto.file.FileRelDto; |
| | | import com.java110.dto.machine.MachineTranslateDto; |
| | | import com.java110.dto.machine.MachineTranslateErrorDto; |
| | | import com.java110.dto.owner.OwnerAttrDto; |
| | | import com.java110.dto.owner.OwnerCarDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | |
| | | import com.java110.dto.room.RoomDto; |
| | | import com.java110.intf.common.IFileInnerServiceSMO; |
| | | import com.java110.intf.common.IFileRelInnerServiceSMO; |
| | | import com.java110.intf.common.IMachineTranslateErrorInnerServiceSMO; |
| | | import com.java110.intf.common.IMachineTranslateInnerServiceSMO; |
| | | import com.java110.intf.community.IRoomV1InnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerAttrInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerCarInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerRoomRelV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.po.machine.MachineTranslateErrorPo; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | |
| | | private String getOwnerPhoto(OwnerDto ownerDto) { |
| | | |
| | | |
| | | FileRelDto fileRelDto = new FileRelDto(); |
| | | fileRelDto.setObjId(ownerDto.getMemberId()); |
| | | fileRelDto.setRelTypeCd("10000"); |
| | | List<FileRelDto> fileRelDtos = fileRelInnerServiceSMOImpl.queryFileRels(fileRelDto); |
| | | if (ListUtil.isNull(fileRelDtos)) { |
| | | return ""; |
| | | String faceUrl = ownerDto.getFaceUrl(); |
| | | if(StringUtil.isEmpty(faceUrl)){ |
| | | return faceUrl; |
| | | } |
| | | FileDto fileDto = new FileDto(); |
| | | fileDto.setFileId(fileRelDtos.get(0).getFileSaveName()); |
| | | fileDto.setFileSaveName(fileRelDtos.get(0).getFileSaveName()); |
| | | fileDto.setFileId(faceUrl); |
| | | fileDto.setFileSaveName(faceUrl); |
| | | fileDto.setCommunityId(ownerDto.getCommunityId()); |
| | | List<FileDto> fileDtos = fileInnerServiceSMOImpl.queryFiles(fileDto); |
| | | if (ListUtil.isNull(fileDtos)) { |
| File was renamed from service-job/src/main/java/com/java110/job/adapt/hcIotNew/SendAttendanceStaffDataToIotAdapt.java |
| | |
| | | package com.java110.job.adapt.hcIotNew; |
| | | package com.java110.job.adapt.hcIot; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.dto.attendance.AttendanceClassesStaffDto; |
| | | import com.java110.dto.community.CommunityMemberDto; |
| | | import com.java110.dto.file.FileDto; |
| | | import com.java110.dto.file.FileRelDto; |
| | | import com.java110.dto.machine.MachineTranslateDto; |
| | | import com.java110.dto.store.StoreUserDto; |
| | | import com.java110.dto.system.Business; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.common.IFileInnerServiceSMO; |
| | |
| | | import com.java110.intf.user.IAttendanceClassesStaffV1InnerServiceSMO; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.DatabusAdaptImpl; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.MappingConstant; |
| | | import com.java110.utils.util.DateUtil; |
| File was renamed from service-job/src/main/java/com/java110/job/adapt/hcIotNew/SendCarDataToIotAdapt.java |
| | |
| | | package com.java110.job.adapt.hcIotNew; |
| | | package com.java110.job.adapt.hcIot; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | |
| | | import com.java110.dto.system.Business; |
| | | import com.java110.intf.common.IMachineTranslateInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerCarInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerCarV1InnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerV1InnerServiceSMO; |
| | | import com.java110.job.adapt.DatabusAdaptImpl; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.ListUtil; |
| File was renamed from service-job/src/main/java/com/java110/job/adapt/hcIotNew/SendCommunityDataToIotAdapt.java |
| | |
| | | package com.java110.job.adapt.hcIotNew; |
| | | package com.java110.job.adapt.hcIot; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.dto.community.CommunityDto; |
| | | import com.java110.dto.community.CommunityMemberDto; |
| | | import com.java110.dto.fee.FeeDto; |
| | | import com.java110.dto.file.FileDto; |
| | | import com.java110.dto.file.FileRelDto; |
| | | import com.java110.dto.owner.OwnerCarDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.owner.OwnerRoomRelDto; |
| | | import com.java110.dto.room.RoomDto; |
| | | import com.java110.dto.store.StoreDto; |
| | | import com.java110.dto.store.StoreUserDto; |
| | | import com.java110.dto.system.Business; |
| | |
| | | import com.java110.intf.common.IFileRelInnerServiceSMO; |
| | | import com.java110.intf.community.ICommunityMemberV1InnerServiceSMO; |
| | | import com.java110.intf.community.ICommunityV1InnerServiceSMO; |
| | | import com.java110.intf.community.IParkingSpaceV1InnerServiceSMO; |
| | | import com.java110.intf.community.IRoomV1InnerServiceSMO; |
| | | import com.java110.intf.store.IStoreUserV1InnerServiceSMO; |
| | | import com.java110.intf.store.IStoreV1InnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerCarInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerCarV1InnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerRoomRelV1InnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerV1InnerServiceSMO; |
| | | import com.java110.job.adapt.DatabusAdaptImpl; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| File was renamed from service-job/src/main/java/com/java110/job/adapt/hcIotNew/SendDeleteAttendanceStaffDataToIotAdapt.java |
| | |
| | | package com.java110.job.adapt.hcIotNew; |
| | | package com.java110.job.adapt.hcIot; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.dto.attendance.AttendanceClassesStaffDto; |
| | | import com.java110.dto.community.CommunityMemberDto; |
| | | import com.java110.dto.file.FileRelDto; |
| | | import com.java110.dto.machine.MachineTranslateDto; |
| | | import com.java110.dto.system.Business; |
| | | import com.java110.dto.user.UserDto; |
| | |
| | | import com.java110.intf.user.IAttendanceClassesStaffV1InnerServiceSMO; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.DatabusAdaptImpl; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.MappingConstant; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.ImageUtils; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| File was renamed from service-job/src/main/java/com/java110/job/adapt/hcIotNew/SendDeleteCarDataToIotAdapt.java |
| | |
| | | package com.java110.job.adapt.hcIotNew; |
| | | package com.java110.job.adapt.hcIot; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.dto.machine.MachineTranslateDto; |
| | | import com.java110.dto.owner.OwnerCarDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.system.Business; |
| | | import com.java110.intf.common.IMachineTranslateInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerCarInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerV1InnerServiceSMO; |
| | | import com.java110.job.adapt.DatabusAdaptImpl; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.ListUtil; |
| File was renamed from service-job/src/main/java/com/java110/job/adapt/hcIotNew/SendDeleteOwnerDataToIotAdapt.java |
| | |
| | | package com.java110.job.adapt.hcIotNew; |
| | | package com.java110.job.adapt.hcIot; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | |
| | | import com.java110.intf.common.IMachineTranslateInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerV1InnerServiceSMO; |
| | | import com.java110.job.adapt.DatabusAdaptImpl; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.ListUtil; |
| File was renamed from service-job/src/main/java/com/java110/job/adapt/hcIotNew/SendDeleteStaffDataToIotAdapt.java |
| | |
| | | package com.java110.job.adapt.hcIotNew; |
| | | package com.java110.job.adapt.hcIot; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.dto.community.CommunityMemberDto; |
| | | import com.java110.dto.file.FileDto; |
| | | import com.java110.dto.file.FileRelDto; |
| | | import com.java110.dto.machine.MachineTranslateDto; |
| | | import com.java110.dto.store.StoreUserDto; |
| | | import com.java110.dto.system.Business; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.common.IFileInnerServiceSMO; |
| | | import com.java110.intf.common.IFileRelInnerServiceSMO; |
| | | import com.java110.intf.common.IMachineTranslateInnerServiceSMO; |
| | |
| | | import com.java110.intf.store.IStoreUserV1InnerServiceSMO; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.DatabusAdaptImpl; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.ListUtil; |
| File was renamed from service-job/src/main/java/com/java110/job/adapt/hcIotNew/SendOwnerDataToIotAdapt.java |
| | |
| | | package com.java110.job.adapt.hcIotNew; |
| | | package com.java110.job.adapt.hcIot; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.dto.owner.OwnerDto; |
| File was renamed from service-job/src/main/java/com/java110/job/adapt/hcIotNew/SendStaffDataToIotAdapt.java |
| | |
| | | package com.java110.job.adapt.hcIotNew; |
| | | package com.java110.job.adapt.hcIot; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | |
| | | import com.java110.dto.file.FileDto; |
| | | import com.java110.dto.file.FileRelDto; |
| | | import com.java110.dto.machine.MachineTranslateDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.store.StoreUserDto; |
| | | import com.java110.dto.system.Business; |
| | | import com.java110.dto.user.UserDto; |
| | |
| | | import com.java110.intf.store.IStoreUserV1InnerServiceSMO; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.DatabusAdaptImpl; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| File was renamed from service-job/src/main/java/com/java110/job/adapt/hcIotNew/http/ISendIot.java |
| | |
| | | package com.java110.job.adapt.hcIotNew.http; |
| | | package com.java110.job.adapt.hcIot.http; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.vo.ResultVo; |
| File was renamed from service-job/src/main/java/com/java110/job/adapt/hcIotNew/http/SendIotImpl.java |
| | |
| | | package com.java110.job.adapt.hcIotNew.http; |
| | | package com.java110.job.adapt.hcIot.http; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.client.RestTemplate; |
| | | import com.java110.core.factory.AuthenticationFactory; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.dto.machine.MachineTranslateErrorDto; |
| | | import com.java110.dto.system.AppRoute; |
| | | import com.java110.intf.common.IMachineTranslateErrorInnerServiceSMO; |
| | | import com.java110.job.adapt.hcIot.GetToken; |
| | | import com.java110.job.adapt.hcIot.IotConstant; |
| | | import com.java110.po.machine.MachineTranslateErrorPo; |
| | | import com.java110.utils.cache.AppRouteCache; |
| | | import com.java110.utils.cache.CommonCache; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | @Service |
| | |
| | | import com.java110.core.client.RestTemplate; |
| | | import com.java110.core.factory.AuthenticationFactory; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.job.adapt.hcIot.IotConstant; |
| | | import com.java110.utils.cache.CommonCache; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | |
| | | import com.java110.dto.fee.FeeDetailDto; |
| | | import com.java110.dto.fee.FeeDto; |
| | | import com.java110.dto.log.LogSystemErrorDto; |
| | | import com.java110.dto.meter.MeterMachineDto; |
| | | import com.java110.dto.system.Business; |
| | | import com.java110.intf.common.IMeterMachineV1InnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeConfigInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeDetailInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeInnerServiceSMO; |
| | | import com.java110.job.adapt.DatabusAdaptImpl; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.po.fee.PayFeeDetailPo; |
| | | import com.java110.po.log.LogSystemErrorPo; |
| | | import com.java110.service.smo.ISaveSystemErrorSMO; |
| | |
| | | import com.java110.intf.store.IStoreV1InnerServiceSMO; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIot.IotConstant; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | |
| | | import com.java110.intf.store.IStoreUserV1InnerServiceSMO; |
| | | import com.java110.intf.store.IStoreV1InnerServiceSMO; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.user.IOwnerInnerServiceSMO; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.vo.ResultVo; |
| | |
| | | import com.java110.intf.store.IStoreUserV1InnerServiceSMO; |
| | | import com.java110.intf.store.IStoreV1InnerServiceSMO; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | |
| | | import com.java110.dto.community.CommunityMemberDto; |
| | | import com.java110.dto.store.StoreDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.community.ICommunityInnerServiceSMO; |
| | | import com.java110.intf.community.ICommunityMemberV1InnerServiceSMO; |
| | | import com.java110.intf.community.ICommunityV1InnerServiceSMO; |
| | | import com.java110.intf.store.IStoreUserV1InnerServiceSMO; |
| | | import com.java110.intf.store.IStoreV1InnerServiceSMO; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.mall.ISendMall; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.exception.CmdException; |
| | |
| | | import com.java110.intf.store.IStoreUserV1InnerServiceSMO; |
| | | import com.java110.intf.store.IStoreV1InnerServiceSMO; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIot.IotConstant; |
| | | import com.java110.job.mall.ISendMall; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.exception.CmdException; |
| | |
| | | import com.java110.intf.store.IStoreUserV1InnerServiceSMO; |
| | | import com.java110.intf.store.IStoreV1InnerServiceSMO; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.mall.ISendMall; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.exception.CmdException; |
| | |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.vo.ResultVo; |
| | |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.room.RoomDto; |
| | | import com.java110.dto.community.CommunityDto; |
| | | import com.java110.dto.machine.MachineDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.unit.FloorAndUnitDto; |
| | | import com.java110.intf.common.IMachineInnerServiceSMO; |
| | | import com.java110.intf.community.ICommunityInnerServiceSMO; |
| | | import com.java110.intf.community.IRoomInnerServiceSMO; |
| | | import com.java110.intf.community.IUnitInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerInnerServiceSMO; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import com.java110.vo.api.machine.ApiMachineDataVo; |
| | | import com.java110.vo.api.machine.ApiMachineVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Java110Cmd(serviceCode = "owner.listOwnerMachines") |
| | |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.intf.user.IOwnerAppUserInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.ListUtil; |
| | |
| | | import com.java110.intf.store.IStoreV1InnerServiceSMO; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIot.IotConstant; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | |
| | | row.createCell(1).setCellValue(dataObj.getString("payerObjName")); |
| | | } |
| | | endDate = DateUtil.getDateFromStringB(dataObj.getString("endTime")); |
| | | //todo 如果不是一次性费用结束时间建1 |
| | | if (!StringUtil.isEmpty(dataObj.getString("feeFlag")) |
| | | && !FeeDto.FEE_FLAG_ONCE.equals(dataObj.getString("feeFlag"))) { |
| | | endDate = DateUtil.stepDay(endDate, -1); |
| | | } |
| | | |
| | | row.createCell(2).setCellValue(dataObj.getString("ownerName")); |
| | | row.createCell(3).setCellValue(dataObj.getString("feeTypeCdName")); |
| | |
| | | import com.java110.db.dao.impl.QueryServiceDAOImpl; |
| | | import com.java110.dto.machine.MachineTranslateErrorDto; |
| | | import com.java110.intf.common.IMachineTranslateErrorInnerServiceSMO; |
| | | import com.java110.job.adapt.hcIot.IotConstant; |
| | | import com.java110.po.machine.MachineTranslateErrorPo; |
| | | import com.java110.utils.cache.CommonCache; |
| | | import com.java110.utils.cache.MappingCache; |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.aliyuncs.CommonRequest; |
| | | import com.aliyuncs.CommonResponse; |
| | | import com.aliyuncs.DefaultAcsClient; |
| | | import com.aliyuncs.IAcsClient; |
| | | import com.aliyuncs.http.MethodType; |
| | | import com.aliyuncs.profile.DefaultProfile; |
| | | import com.java110.core.client.RestTemplate; |
| | | import com.java110.core.factory.CommunitySettingFactory; |
| | | import com.java110.core.factory.LogFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import com.java110.dto.mapping.Mapping; |
| | | import com.java110.dto.owner.OwnerAppUserDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.user.StaffAppAuthDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.dto.wechat.Content; |
| | | import com.java110.dto.wechat.PropertyFeeTemplateMessage; |
| | | import com.java110.intf.user.IOwnerAppUserInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerV1InnerServiceSMO; |
| | | import com.java110.intf.user.IStaffAppAuthInnerServiceSMO; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.job.msgNotify.IMsgNotify; |
| | | import com.java110.job.msgNotify.IWechatTemplate; |
| | | import com.java110.job.msgNotify.MsgNotifyFactory; |
| | | import com.java110.job.msgNotify.ali.AliMsgNotifyImpl; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.MappingConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | import com.java110.dto.system.Business; |
| | | import com.java110.intf.job.IDataBusInnerServiceSMO; |
| | | import com.java110.job.adapt.IDatabusAdapt; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.job.databus.DatabusDataQueue; |
| | | import com.java110.po.log.LogSystemErrorPo; |
| | | import com.java110.service.smo.ISaveSystemErrorSMO; |
| | | import com.java110.utils.cache.DatabusCache; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.factory.ApplicationContextFactory; |
| | | import com.java110.utils.util.ExceptionUtil; |
| | | import com.java110.vo.ResultVo; |
| | |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.job.IIotInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerAppUserV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.po.owner.OwnerAppUserPo; |
| | | import com.java110.job.adapt.hcIot.http.ISendIot; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | import com.java110.dto.mall.MallConfigDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.job.IMallInnerServiceSMO; |
| | | import com.java110.job.adapt.hcIot.IotConstant; |
| | | import com.java110.job.adapt.hcIotNew.http.ISendIot; |
| | | import com.java110.job.mall.ISendMall; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | |
| | | import com.java110.intf.community.IParkingSpaceInnerServiceSMO; |
| | | import com.java110.intf.community.IVisitInnerServiceSMO; |
| | | import com.java110.intf.user.ICarBlackWhiteV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIot.asyn.IIotSendAsyn; |
| | | import com.java110.job.quartz.TaskSystemQuartz; |
| | | import com.java110.po.car.CarBlackWhitePo; |
| | | import com.java110.po.parking.ParkingSpacePo; |
| | |
| | | @Autowired |
| | | private ICarBlackWhiteV1InnerServiceSMO carBlackWhiteV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IIotSendAsyn hcCarBlackWhiteAsynImpl; |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ReleaseCarParkingSpaceTemplate.class); |
| | | |
| | |
| | | //删除白名单车辆信息 |
| | | carBlackWhiteV1InnerServiceSMOImpl.deleteCarBlackWhite(carBlackWhitePo); |
| | | //向第三方物联网推送删除白名单信息 |
| | | JSONObject postParameters = new JSONObject(); |
| | | postParameters.put("extBwId", carBlackWhiteDtos.get(0).getBwId()); |
| | | postParameters.put("carNum", carBlackWhiteDtos.get(0).getCarNum()); |
| | | postParameters.put("extPaId", carBlackWhiteDtos.get(0).getPaId()); |
| | | postParameters.put("extCommunityId", carBlackWhiteDtos.get(0).getCommunityId()); |
| | | postParameters.put("startTime", carBlackWhiteDtos.get(0).getStartTime()); |
| | | postParameters.put("endTime", carBlackWhiteDtos.get(0).getEndTime()); |
| | | postParameters.put("blackWhite", carBlackWhiteDtos.get(0).getBlackWhite()); |
| | | hcCarBlackWhiteAsynImpl.deleteCarBlackWhite(postParameters); |
| | | // JSONObject postParameters = new JSONObject(); |
| | | // postParameters.put("extBwId", carBlackWhiteDtos.get(0).getBwId()); |
| | | // postParameters.put("carNum", carBlackWhiteDtos.get(0).getCarNum()); |
| | | // postParameters.put("extPaId", carBlackWhiteDtos.get(0).getPaId()); |
| | | // postParameters.put("extCommunityId", carBlackWhiteDtos.get(0).getCommunityId()); |
| | | // postParameters.put("startTime", carBlackWhiteDtos.get(0).getStartTime()); |
| | | // postParameters.put("endTime", carBlackWhiteDtos.get(0).getEndTime()); |
| | | // postParameters.put("blackWhite", carBlackWhiteDtos.get(0).getBlackWhite()); |
| | | // hcCarBlackWhiteAsynImpl.deleteCarBlackWhite(postParameters); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.java110.intf.community.IParkingSpaceInnerServiceSMO; |
| | | import com.java110.intf.community.IVisitInnerServiceSMO; |
| | | import com.java110.intf.user.ICarBlackWhiteV1InnerServiceSMO; |
| | | import com.java110.job.adapt.hcIot.asyn.IIotSendAsyn; |
| | | import com.java110.job.quartz.TaskSystemQuartz; |
| | | import com.java110.po.car.CarBlackWhitePo; |
| | | import com.java110.po.parking.ParkingSpacePo; |
| | |
| | | @Autowired |
| | | private ICarBlackWhiteV1InnerServiceSMO carBlackWhiteV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IIotSendAsyn hcCarBlackWhiteAsynImpl; |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ReleaseParkingSpaceTemplate.class); |
| | | |
| | |
| | | carBlackWhitePo.setStatusCd("1"); |
| | | carBlackWhiteV1InnerServiceSMOImpl.deleteCarBlackWhite(carBlackWhitePo); |
| | | //向第三方物联网推送删除白名单信息 |
| | | JSONObject postParameters = new JSONObject(); |
| | | postParameters.put("extBwId", carBlackWhiteDtos.get(0).getBwId()); |
| | | postParameters.put("carNum", carBlackWhiteDtos.get(0).getCarNum()); |
| | | postParameters.put("extPaId", carBlackWhiteDtos.get(0).getPaId()); |
| | | postParameters.put("extCommunityId", carBlackWhiteDtos.get(0).getCommunityId()); |
| | | postParameters.put("startTime", carBlackWhiteDtos.get(0).getStartTime()); |
| | | postParameters.put("endTime", carBlackWhiteDtos.get(0).getEndTime()); |
| | | postParameters.put("blackWhite", carBlackWhiteDtos.get(0).getBlackWhite()); |
| | | hcCarBlackWhiteAsynImpl.deleteCarBlackWhite(postParameters); |
| | | // JSONObject postParameters = new JSONObject(); |
| | | // postParameters.put("extBwId", carBlackWhiteDtos.get(0).getBwId()); |
| | | // postParameters.put("carNum", carBlackWhiteDtos.get(0).getCarNum()); |
| | | // postParameters.put("extPaId", carBlackWhiteDtos.get(0).getPaId()); |
| | | // postParameters.put("extCommunityId", carBlackWhiteDtos.get(0).getCommunityId()); |
| | | // postParameters.put("startTime", carBlackWhiteDtos.get(0).getStartTime()); |
| | | // postParameters.put("endTime", carBlackWhiteDtos.get(0).getEndTime()); |
| | | // postParameters.put("blackWhite", carBlackWhiteDtos.get(0).getBlackWhite()); |
| | | // hcCarBlackWhiteAsynImpl.deleteCarBlackWhite(postParameters); |
| | | } |
| | | } |
| | | } |
| | |
| | | OwnerDto ownerDto = new OwnerDto(); |
| | | ownerDto.setLink(searchDataDto.getTel()); |
| | | ownerDto.setCommunityId(searchDataDto.getCommunityId()); |
| | | ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER,OwnerDto.OWNER_TYPE_CD_RENTING}); |
| | | ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER}); |
| | | List<OwnerDto> tmpOwnerDtos = ownerV1InnerServiceSMOImpl.queryOwners(ownerDto); |
| | | if(tmpOwnerDtos == null || tmpOwnerDtos.size() < 1){ |
| | | return ; |
| | |
| | | OwnerDto ownerDto = new OwnerDto(); |
| | | ownerDto.setNameLike(searchDataDto.getSearchValue()); |
| | | ownerDto.setCommunityId(searchDataDto.getCommunityId()); |
| | | ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER,OwnerDto.OWNER_TYPE_CD_RENTING,OwnerDto.OWNER_TYPE_CD_TEMP,OwnerDto.OWNER_TYPE_CD_OTHER}); |
| | | ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER}); |
| | | List<OwnerDto> tmpOwnerDtos = ownerV1InnerServiceSMOImpl.queryOwners(ownerDto); |
| | | if(tmpOwnerDtos == null || tmpOwnerDtos.size() < 1){ |
| | | return ; |
| | |
| | | OwnerDto ownerDto = new OwnerDto(); |
| | | ownerDto.setCommunityId(communityId); |
| | | ownerDto.setIdCard(searchValue); |
| | | ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER, OwnerDto.OWNER_TYPE_CD_RENTING}); |
| | | ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER}); |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto); |
| | | Assert.listOnlyOne(ownerDtos, "未找到成员信息或者查询到多条,请换其他条件查询"); |
| | | OwnerDto owner = queryByOwnerId(communityId, ownerDtos.get(0).getOwnerId()); |
| | |
| | | OwnerDto ownerDto = new OwnerDto(); |
| | | ownerDto.setCommunityId(communityId); |
| | | ownerDto.setLink(searchValue); |
| | | ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER, OwnerDto.OWNER_TYPE_CD_RENTING}); |
| | | ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER}); |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto); |
| | | Assert.listOnlyOne(ownerDtos, "未找到成员信息或者查询到多条,请换其他条件查询"); |
| | | OwnerDto owner = queryByOwnerId(communityId, ownerDtos.get(0).getOwnerId()); |
| | |
| | | OwnerDto ownerDto = new OwnerDto(); |
| | | ownerDto.setCommunityId(communityId); |
| | | ownerDto.setName(searchValue); |
| | | ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER, OwnerDto.OWNER_TYPE_CD_RENTING}); |
| | | ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER}); |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto); |
| | | Assert.isNotNull(ownerDtos,"未找到成员信息,请换其他条件查询"); |
| | | //Assert.listOnlyOne(ownerDtos, "未找到成员信息或者查询到多条,请换其他条件查询"); |
| | |
| | | return ownerDtos; |
| | | } |
| | | List<String> ownerIds = new ArrayList<>(); |
| | | List<String> memberIds = new ArrayList<>(); |
| | | List<String> ownerTels = new ArrayList<>(); |
| | | for(OwnerDto ownerDto : ownerDtos){ |
| | | ownerIds.add(ownerDto.getOwnerId()); |
| | | ownerTels.add(ownerDto.getLink()); |
| | | memberIds.add(ownerDto.getMemberId()); |
| | | } |
| | | |
| | | |
| | |
| | | queryOwnerMemberCount(ownerIds,ownerDtos); |
| | | |
| | | // 查询 车辆数 |
| | | queryCarCount(ownerIds,ownerDtos); |
| | | queryCarCount(memberIds,ownerDtos); |
| | | |
| | | // 查询 投诉数 |
| | | queryComplaintCount(ownerTels,ownerDtos); |
| | | //queryComplaintCount(ownerTels,ownerDtos); |
| | | |
| | | // 查询 报修数 |
| | | queryRepairCount(ownerTels,ownerDtos); |
| | | //queryRepairCount(ownerTels,ownerDtos); |
| | | |
| | | // 查询业主欠费 |
| | | queryOwnerOweFee(ownerIds,ownerDtos); |
| | | |
| | | // 查询业主合同 |
| | | queryOwnerContractCount(ownerIds,ownerDtos); |
| | | //queryOwnerContractCount(ownerIds,ownerDtos); |
| | | |
| | | return ownerDtos; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询业主车辆数 |
| | | * @param ownerIds |
| | | * @param memberIds |
| | | * @param ownerDtos |
| | | */ |
| | | private void queryCarCount(List<String> ownerIds, List<OwnerDto> ownerDtos) { |
| | | private void queryCarCount(List<String> memberIds, List<OwnerDto> ownerDtos) { |
| | | |
| | | List<Map> memberCounts = ownerCarV1InnerServiceSMOImpl.queryOwnerCarCountByOwnerIds(ownerIds); |
| | | List<Map> memberCounts = ownerCarV1InnerServiceSMOImpl.queryOwnerCarCountByOwnerIds(memberIds); |
| | | |
| | | for(OwnerDto ownerDto : ownerDtos) { |
| | | for (Map count : memberCounts) { |
| | | if(ownerDto.getOwnerId().equals(count.get("ownerId"))){ |
| | | if(ownerDto.getMemberId().equals(count.get("ownerId"))){ |
| | | ownerDto.setCarCount(count.get("carCount").toString()); |
| | | } |
| | | } |
| | |
| | | List<Map> memberCounts = ownerV1InnerServiceSMOImpl.queryOwnerMembersCount(ownerIds); |
| | | |
| | | for(OwnerDto ownerDto : ownerDtos) { |
| | | if(OwnerDto.OWNER_TYPE_CD_MEMBER.equals(ownerDto.getOwnerTypeCd())){ |
| | | ownerDto.setMemberCount("0"); |
| | | continue; |
| | | } |
| | | for (Map count : memberCounts) { |
| | | if(ownerDto.getOwnerId().equals(count.get("ownerId"))){ |
| | | ownerDto.setMemberCount(count.get("memberCount").toString()); |
| | |
| | | ownerDto.setLink(ownerAppUserDto.getLink()); |
| | | ownerDto.setCommunityId(ownerAppUserDto.getCommunityId()); |
| | | ownerDto.setOwnerTypeCds(new String[]{ |
| | | OwnerDto.OWNER_TYPE_CD_MEMBER, |
| | | OwnerDto.OWNER_TYPE_CD_RENTING, |
| | | OwnerDto.OWNER_TYPE_CD_OTHER, |
| | | OwnerDto.OWNER_TYPE_CD_TEMP |
| | | OwnerDto.OWNER_TYPE_CD_MEMBER |
| | | // , |
| | | // OwnerDto.OWNER_TYPE_CD_RENTING, |
| | | // OwnerDto.OWNER_TYPE_CD_OTHER, |
| | | // OwnerDto.OWNER_TYPE_CD_TEMP |
| | | }); |
| | | List<OwnerDto> ownerDtos = ownerV1InnerServiceSMOImpl.queryOwners(ownerDto); |
| | | |
| | |
| | | OwnerDto ownerDto = new OwnerDto(); |
| | | ownerDto.setOwnerId(reqJson.getString("memberId")); |
| | | ownerDto.setCommunityId(reqJson.getString("communityId")); |
| | | ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER, OwnerDto.OWNER_TYPE_CD_RENTING}); |
| | | ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER}); |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto); |
| | | if (ownerDtos != null && ownerDtos.size() > 0) { |
| | | throw new IllegalArgumentException("请先删除业主下的成员"); |
| | |
| | | ownerDto.setMemberId(reqJson.getString("memberId")); |
| | | ownerDto.setCommunityId(reqJson.getString("communityId")); |
| | | ownerDto.setOwnerId(ownerAppUserDtos.get(0).getMemberId()); |
| | | ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER, OwnerDto.OWNER_TYPE_CD_RENTING, |
| | | OwnerDto.OWNER_TYPE_CD_TEMP, OwnerDto.OWNER_TYPE_CD_OTHER}); |
| | | ownerDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER}); |
| | | |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto); |
| | | |
| | |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | Assert.jsonObjectHaveKey(reqJson, "memberId", "请求报文中未包含ownerId"); |
| | | Assert.jsonObjectHaveKey(reqJson, "name", "请求报文中未包含name"); |
| | | // Assert.jsonObjectHaveKey(reqJson, "age", "请求报文中未包含age"); |
| | | Assert.jsonObjectHaveKey(reqJson, "link", "请求报文中未包含link"); |
| | | Assert.jsonObjectHaveKey(reqJson, "sex", "请求报文中未包含sex"); |
| | | Assert.jsonObjectHaveKey(reqJson, "ownerTypeCd", "请求报文中未包含ownerTypeCd"); |
| | | Assert.jsonObjectHaveKey(reqJson, "communityId", "请求报文中未包含communityId"); |
| | | // Assert.jsonObjectHaveKey(paramIn, "idCard", "请求报文中未包含身份证号"); |
| | | Assert.judgeAttrValue(reqJson); |
| | | //获取手机号(判断手机号是否重复) |
| | | String link = reqJson.getString("link"); |
| | | if (!StringUtil.isEmpty(link) && link.contains("*")) { |
| | | OwnerDto ownerDto = new OwnerDto(); |
| | | ownerDto.setOwnerId(reqJson.getString("ownerId")); |
| | | //业主 |
| | | ownerDto.setOwnerTypeCd("1001"); |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto); |
| | | Assert.listOnlyOne(ownerDtos, "查询业主信息错误!"); |
| | | link = ownerDtos.get(0).getLink(); |
| | | reqJson.put("link", link); |
| | | reqJson.put("link", ""); |
| | | } |
| | | //获取身份证号(判断身份证号是否重复) |
| | | String idCard = reqJson.getString("idCard"); |
| | | if (!StringUtil.isEmpty(idCard) && idCard.contains("*")) { |
| | | OwnerDto owner = new OwnerDto(); |
| | | owner.setOwnerId(reqJson.getString("ownerId")); |
| | | //业主 |
| | | owner.setOwnerTypeCd("1001"); |
| | | List<OwnerDto> owners = ownerInnerServiceSMOImpl.queryOwners(owner); |
| | | Assert.listOnlyOne(owners, "查询业主信息错误!"); |
| | | idCard = owners.get(0).getIdCard(); |
| | | reqJson.put("idCard", idCard); |
| | | reqJson.put("idCard", ""); |
| | | } |
| | | |
| | | if (reqJson.containsKey("ownerPhotoUrl")) { |
| | | String ownerPhotoUrl = reqJson.getString("ownerPhotoUrl"); |
| | | if (!StringUtil.isEmpty(ownerPhotoUrl) && ownerPhotoUrl.length() > 500) { |
| | | throw new CmdException("图片地址太长"); |
| | | } |
| | | if (!StringUtil.isEmpty(ownerPhotoUrl)) { |
| | | reqJson.put("faceUrl", ownerPhotoUrl); |
| | | } |
| | | } |
| | | |
| | | |
| | | String userValidate = MappingCache.getValue("USER_VALIDATE"); |
| | | if (!"ON".equals(userValidate)) { |
| | | return; |
| | | } |
| | | |
| | | OwnerDto curOwner = new OwnerDto(); |
| | | curOwner.setMemberId(reqJson.getString("memberId")); |
| | | |
| | | List<OwnerDto> curOwners = ownerInnerServiceSMOImpl.queryOwners(curOwner); |
| | | Assert.listOnlyOne(curOwners, "未查询到业主信息或查询到多条"); |
| | | |
| | | OwnerDto ownerDto = new OwnerDto(); |
| | | ownerDto.setLink(link); |
| | | ownerDto.setLink(curOwners.get(0).getLink()); |
| | | ownerDto.setCommunityId(reqJson.getString("communityId")); |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryAllOwners(ownerDto); |
| | | if (ownerDtos != null && ownerDtos.size() > 1) { |
| | | throw new IllegalArgumentException("手机号重复,请重新输入"); |
| | | } else if (ownerDtos != null && ownerDtos.size() == 1) { |
| | | for (OwnerDto owner : ownerDtos) { |
| | | if ((!StringUtil.isEmpty(reqJson.getString("ownerId")) && !owner.getOwnerId().equals(reqJson.getString("ownerId"))) || (!StringUtil.isEmpty(reqJson.getString("memberId")) && !owner.getMemberId().equals(reqJson.getString("memberId")))) { |
| | | if (!reqJson.getString("memberId").equals(owner.getMemberId())) { |
| | | throw new IllegalArgumentException("手机号重复,请重新输入"); |
| | | } |
| | | } |
| | | } |
| | | if (!StringUtil.isEmpty(idCard)) { |
| | | OwnerDto owner = new OwnerDto(); |
| | | owner.setIdCard(idCard); |
| | | owner.setCommunityId(reqJson.getString("communityId")); |
| | | List<OwnerDto> owners = ownerInnerServiceSMOImpl.queryAllOwners(owner); |
| | | if (owners != null && owners.size() > 1) { |
| | | throw new IllegalArgumentException("身份证号重复,请重新输入"); |
| | | } else if (owners != null && owners.size() == 1) { |
| | | for (OwnerDto ownerDto1 : owners) { |
| | | if ((!StringUtil.isEmpty(reqJson.getString("ownerId")) && !ownerDto1.getOwnerId().equals(reqJson.getString("ownerId"))) || (!StringUtil.isEmpty(reqJson.getString("memberId")) && !ownerDto1.getMemberId().equals(reqJson.getString("memberId")))) { |
| | | throw new IllegalArgumentException("身份证号重复,请重新输入"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | @Override |
| | | @Java110Transactional |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | if (!reqJson.containsKey("ownerId") || OwnerDto.OWNER_TYPE_CD_OWNER.equals(reqJson.getString("ownerTypeCd"))) { |
| | | reqJson.put("ownerId", reqJson.getString("memberId")); |
| | | } |
| | | //这里注释 因为 有国外的手机号 不是11位 |
| | | // if (link.length() != 11) { |
| | | // throw new IllegalArgumentException("手机号输入不正确!"); |
| | | // } |
| | | if (reqJson.containsKey("ownerPhoto") && !StringUtils.isEmpty(reqJson.getString("ownerPhoto"))) { |
| | | editOwnerPhoto(reqJson); |
| | | } |
| | | |
| | | |
| | | //todo 修改 业主信息 |
| | | editOwner(reqJson); |
| | | OwnerPo ownerPo = BeanConvertUtil.covertBean(reqJson, OwnerPo.class); |
| | | int flag = ownerV1InnerServiceSMOImpl.updateOwner(ownerPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("修改业主失败"); |
| | | } |
| | | |
| | | //todo 修改账户 |
| | | updateAccount(reqJson); |
| | | |
| | | JSONArray attrs = reqJson.getJSONArray("attrs"); |
| | | if (attrs == null || attrs.size() < 1) { |
| | | if (ListUtil.isNull(attrs)) { |
| | | return; |
| | | } |
| | | JSONObject attr = null; |
| | | int flag = 0; |
| | | for (int attrIndex = 0; attrIndex < attrs.size(); attrIndex++) { |
| | | attr = attrs.getJSONObject(attrIndex); |
| | | attr.put("memberId", reqJson.getString("memberId")); |
| | |
| | | updateOwnerAppUser(reqJson); |
| | | } |
| | | |
| | | public void editOwner(JSONObject paramInJson) { |
| | | OwnerDto ownerDto = new OwnerDto(); |
| | | ownerDto.setMemberId(paramInJson.getString("memberId")); |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto); |
| | | Assert.listOnlyOne(ownerDtos, "未查询到业主信息或查询到多条"); |
| | | JSONObject businessOwner = new JSONObject(); |
| | | businessOwner.putAll(BeanConvertUtil.beanCovertMap(ownerDtos.get(0))); |
| | | businessOwner.putAll(paramInJson); |
| | | if (paramInJson.containsKey("wxPhoto")) { |
| | | businessOwner.put("link", paramInJson.getString("wxPhoto")); |
| | | } |
| | | businessOwner.put("state", ownerDtos.get(0).getState()); |
| | | OwnerPo ownerPo = BeanConvertUtil.covertBean(businessOwner, OwnerPo.class); |
| | | if (StringUtil.isEmpty(ownerPo.getIdCard())) { |
| | | ownerPo.setAge(null); |
| | | } |
| | | int flag = ownerV1InnerServiceSMOImpl.updateOwner(ownerPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("修改业主失败"); |
| | | } |
| | | public void updateAccount(JSONObject paramInJson) { |
| | | |
| | | //todo 判断业主手机号和账户手机号是否相同,不相同修改账户手机号 |
| | | AccountDto accountDto = new AccountDto(); |
| | | accountDto.setObjId(ownerDtos.get(0).getMemberId()); |
| | | accountDto.setPartId(ownerDtos.get(0).getCommunityId()); |
| | | accountDto.setObjId(paramInJson.getString("memberId")); |
| | | accountDto.setPartId(paramInJson.getString("communityId")); |
| | | List<AccountDto> accountDtos = accountInnerServiceSMOImpl.queryAccounts(accountDto); |
| | | if (ListUtil.isNull(accountDtos)) { |
| | | return; |
| | |
| | | owner.setMemberId(paramInJson.getString("memberId")); |
| | | List<OwnerDto> owners = ownerInnerServiceSMOImpl.queryOwnerMembers(owner); |
| | | Assert.listOnlyOne(owners, "未查询到业主信息或查询到多条"); |
| | | /*if (accountDtos.get(0).getLink().equals(ownerDtos.get(0).getLink())) { |
| | | return; |
| | | }*/ |
| | | if (!accountDtos.get(0).getLink().equals(owners.get(0).getLink()) || !accountDtos.get(0).getAcctName().equals(owners.get(0).getName())) { |
| | | AccountPo accountPo = new AccountPo(); |
| | | accountPo.setAcctName(owners.get(0).getName()); |
| | | accountPo.setoLink(owners.get(0).getLink()); |
| | | accountPo.setAcctId(accountDtos.get(0).getAcctId()); |
| | | accountInnerServiceSMOImpl.updateAccount(accountPo); |
| | | } |
| | | /*AccountPo accountPo = new AccountPo(); |
| | | accountPo.setoLink(ownerDtos.get(0).getLink()); |
| | | accountPo.setAcctId(accountDtos.get(0).getAcctId()); |
| | | accountInnerServiceSMOImpl.updateAccount(accountPo);*/ |
| | | } |
| | | |
| | | public void editOwnerPhoto(JSONObject paramInJson) { |
| | | String _photo = paramInJson.getString("ownerPhoto"); |
| | | if (_photo.length() > 512) { |
| | | FileDto fileDto = new FileDto(); |
| | | fileDto.setFileId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_file_id)); |
| | | fileDto.setFileName(fileDto.getFileId()); |
| | | fileDto.setContext(_photo); |
| | | fileDto.setSuffix("jpeg"); |
| | | fileDto.setCommunityId(paramInJson.getString("communityId")); |
| | | _photo = fileInnerServiceSMOImpl.saveFile(fileDto); |
| | | } |
| | | FileRelDto fileRelDto = new FileRelDto(); |
| | | fileRelDto.setRelTypeCd("10000"); |
| | | fileRelDto.setObjId(paramInJson.getString("memberId")); |
| | | int flag = 0; |
| | | List<FileRelDto> fileRelDtos = fileRelInnerServiceSMOImpl.queryFileRels(fileRelDto); |
| | | if (fileRelDtos == null || fileRelDtos.size() == 0) { |
| | | JSONObject businessUnit = new JSONObject(); |
| | | businessUnit.put("fileRelId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_fileRelId)); |
| | | businessUnit.put("relTypeCd", "10000"); |
| | | businessUnit.put("saveWay", "table"); |
| | | businessUnit.put("objId", paramInJson.getString("memberId")); |
| | | businessUnit.put("fileRealName", _photo); |
| | | businessUnit.put("fileSaveName", _photo); |
| | | FileRelPo fileRelPo = BeanConvertUtil.covertBean(businessUnit, FileRelPo.class); |
| | | flag = fileRelInnerServiceSMOImpl.saveFileRel(fileRelPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("保存文件失败"); |
| | | } |
| | | return; |
| | | } |
| | | JSONObject businessUnit = new JSONObject(); |
| | | businessUnit.putAll(BeanConvertUtil.beanCovertMap(fileRelDtos.get(0))); |
| | | businessUnit.put("fileRealName", _photo); |
| | | businessUnit.put("fileSaveName", _photo); |
| | | FileRelPo fileRelPo = BeanConvertUtil.covertBean(businessUnit, FileRelPo.class); |
| | | flag = fileRelInnerServiceSMOImpl.updateFileRel(fileRelPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("保存文件失败"); |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | package com.java110.user.cmd.owner; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.doc.annotation.*; |
| | | import com.java110.dto.account.AccountDto; |
| | | import com.java110.dto.owner.OwnerAppUserDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.intf.acct.IAccountInnerServiceSMO; |
| | | import com.java110.intf.common.IFileInnerServiceSMO; |
| | | import com.java110.intf.common.IFileRelInnerServiceSMO; |
| | | import com.java110.intf.user.*; |
| | | import com.java110.po.account.AccountPo; |
| | | import com.java110.po.owner.OwnerAppUserPo; |
| | | import com.java110.po.owner.OwnerAttrPo; |
| | | import com.java110.po.owner.OwnerPo; |
| | | import com.java110.po.user.UserPo; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Java110CmdDoc(title = "修改业主", |
| | | description = "第三方系统,比如招商系统同步业主信息", |
| | | httpMethod = "post", |
| | | url = "http://{ip}:{port}/app/owner.editOwnerMember", |
| | | resource = "userDoc", |
| | | author = "吴学文", |
| | | serviceCode = "owner.editOwner", |
| | | seq = 10) |
| | | |
| | | @Java110ParamsDoc(params = { |
| | | @Java110ParamDoc(name = "communityId", length = 30, remark = "小区ID"), |
| | | @Java110ParamDoc(name = "name", length = 64, remark = "业主名称"), |
| | | @Java110ParamDoc(name = "link", length = 11, remark = "业主手机号"), |
| | | @Java110ParamDoc(name = "idCard", length = 30, remark = "业主身份证号"), |
| | | @Java110ParamDoc(name = "address", length = 512, remark = "地址"), |
| | | @Java110ParamDoc(name = "sex", length = 12, remark = "性别 男 1 女 0"), |
| | | @Java110ParamDoc(name = "ownerTypeCd", length = 12, remark = "业主类型 1001 业主 2002 家庭成员 家庭成员 需要传业主的ownerId"), |
| | | @Java110ParamDoc(name = "remark", length = 512, remark = "备注"), |
| | | @Java110ParamDoc(name = "memberId", length = 30, remark = "业主ID"), |
| | | @Java110ParamDoc(name = "ownerPhoto", length = -1, remark = "业主人脸 用于同步门禁 人脸开门"), |
| | | }) |
| | | |
| | | @Java110ResponseDoc( |
| | | params = { |
| | | @Java110ParamDoc(name = "code", type = "int", length = 11, defaultValue = "0", remark = "返回编号,0 成功 其他失败"), |
| | | @Java110ParamDoc(name = "msg", type = "String", length = 250, defaultValue = "成功", remark = "描述"), |
| | | }) |
| | | |
| | | @Java110ExampleDoc( |
| | | reqBody = "{\n" + |
| | | "\t\"name\": \"王王\",\n" + |
| | | "\t\"age\": \"\",\n" + |
| | | "\t\"link\": \"18909718888\",\n" + |
| | | "\t\"address\": \"张三\",\n" + |
| | | "\t\"sex\": \"0\",\n" + |
| | | "\t\"ownerTypeCd\": \"1001\",\n" + |
| | | "\t\"remark\": \"\",\n" + |
| | | "\t\"memberId\": 123123123,\n" + |
| | | "\t\"ownerPhoto\": \"\",\n" + |
| | | "\t\"idCard\": \"\",\n" + |
| | | "\t\"communityId\": \"2022121921870161\"\n" + |
| | | "}", |
| | | resBody = "{\"code\":0,\"msg\":\"成功\"}" |
| | | ) |
| | | @Java110Cmd(serviceCode = "owner.editOwnerMember") |
| | | public class EditOwnerMemberCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IOwnerAttrInnerServiceSMO ownerAttrInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IOwnerV1InnerServiceSMO ownerV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IOwnerAppUserInnerServiceSMO ownerAppUserInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IOwnerAppUserV1InnerServiceSMO ownerAppUserV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFileRelInnerServiceSMO fileRelInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFileInnerServiceSMO fileInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IAccountInnerServiceSMO accountInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | Assert.jsonObjectHaveKey(reqJson, "memberId", "请求报文中未包含ownerId"); |
| | | Assert.jsonObjectHaveKey(reqJson, "name", "请求报文中未包含name"); |
| | | Assert.jsonObjectHaveKey(reqJson, "link", "请求报文中未包含link"); |
| | | Assert.jsonObjectHaveKey(reqJson, "communityId", "请求报文中未包含communityId"); |
| | | Assert.judgeAttrValue(reqJson); |
| | | //获取手机号(判断手机号是否重复) |
| | | String link = reqJson.getString("link"); |
| | | if (!StringUtil.isEmpty(link) && link.contains("*")) { |
| | | reqJson.put("link", ""); |
| | | } |
| | | //获取身份证号(判断身份证号是否重复) |
| | | String idCard = reqJson.getString("idCard"); |
| | | if (!StringUtil.isEmpty(idCard) && idCard.contains("*")) { |
| | | reqJson.put("idCard", ""); |
| | | } |
| | | |
| | | if (reqJson.containsKey("ownerPhotoUrl")) { |
| | | String ownerPhotoUrl = reqJson.getString("ownerPhotoUrl"); |
| | | if (!StringUtil.isEmpty(ownerPhotoUrl) && ownerPhotoUrl.length() > 500) { |
| | | throw new CmdException("图片地址太长"); |
| | | } |
| | | if (!StringUtil.isEmpty(ownerPhotoUrl)) { |
| | | reqJson.put("faceUrl", ownerPhotoUrl); |
| | | } |
| | | } |
| | | |
| | | |
| | | String userValidate = MappingCache.getValue("USER_VALIDATE"); |
| | | if (!"ON".equals(userValidate)) { |
| | | return; |
| | | } |
| | | |
| | | OwnerDto curOwner = new OwnerDto(); |
| | | curOwner.setMemberId(reqJson.getString("memberId")); |
| | | |
| | | List<OwnerDto> curOwners = ownerInnerServiceSMOImpl.queryOwners(curOwner); |
| | | Assert.listOnlyOne(curOwners, "未查询到业主信息或查询到多条"); |
| | | |
| | | OwnerDto ownerDto = new OwnerDto(); |
| | | ownerDto.setLink(curOwners.get(0).getLink()); |
| | | ownerDto.setCommunityId(reqJson.getString("communityId")); |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryAllOwners(ownerDto); |
| | | if (ownerDtos != null && ownerDtos.size() > 1) { |
| | | throw new IllegalArgumentException("手机号重复,请重新输入"); |
| | | } else if (ownerDtos != null && ownerDtos.size() == 1) { |
| | | for (OwnerDto owner : ownerDtos) { |
| | | if (!reqJson.getString("memberId").equals(owner.getMemberId())) { |
| | | throw new IllegalArgumentException("手机号重复,请重新输入"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Java110Transactional |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | |
| | | //todo 修改 业主信息 |
| | | OwnerPo ownerPo = BeanConvertUtil.covertBean(reqJson, OwnerPo.class); |
| | | int flag = ownerV1InnerServiceSMOImpl.updateOwner(ownerPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("修改业主失败"); |
| | | } |
| | | |
| | | //todo 修改账户 |
| | | updateAccount(reqJson); |
| | | |
| | | JSONArray attrs = reqJson.getJSONArray("attrs"); |
| | | if (ListUtil.isNull(attrs)) { |
| | | return; |
| | | } |
| | | JSONObject attr = null; |
| | | for (int attrIndex = 0; attrIndex < attrs.size(); attrIndex++) { |
| | | attr = attrs.getJSONObject(attrIndex); |
| | | attr.put("memberId", reqJson.getString("memberId")); |
| | | attr.put("communityId", reqJson.getString("communityId")); |
| | | if (!attr.containsKey("attrId") || StringUtil.isEmpty(attr.getString("attrId")) || attr.getString("attrId").startsWith("-")) { |
| | | attr.put("attrId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); |
| | | OwnerAttrPo ownerAttrPo = BeanConvertUtil.covertBean(attr, OwnerAttrPo.class); |
| | | flag = ownerAttrInnerServiceSMOImpl.saveOwnerAttr(ownerAttrPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("添加业主属性失败"); |
| | | } |
| | | continue; |
| | | } |
| | | OwnerAttrPo ownerAttrPo = BeanConvertUtil.covertBean(attr, OwnerAttrPo.class); |
| | | flag = ownerAttrInnerServiceSMOImpl.updateOwnerAttrInfoInstance(ownerAttrPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("修改业主属性失败"); |
| | | } |
| | | } |
| | | //todo 如果 业主做了绑定则修改绑定的手机号 |
| | | updateOwnerAppUser(reqJson); |
| | | } |
| | | |
| | | public void updateAccount(JSONObject paramInJson) { |
| | | |
| | | //todo 判断业主手机号和账户手机号是否相同,不相同修改账户手机号 |
| | | AccountDto accountDto = new AccountDto(); |
| | | accountDto.setObjId(paramInJson.getString("memberId")); |
| | | accountDto.setPartId(paramInJson.getString("communityId")); |
| | | List<AccountDto> accountDtos = accountInnerServiceSMOImpl.queryAccounts(accountDto); |
| | | if (ListUtil.isNull(accountDtos)) { |
| | | return; |
| | | } |
| | | //查询更新后的业主信息 |
| | | OwnerDto owner = new OwnerDto(); |
| | | owner.setMemberId(paramInJson.getString("memberId")); |
| | | List<OwnerDto> owners = ownerInnerServiceSMOImpl.queryOwnerMembers(owner); |
| | | Assert.listOnlyOne(owners, "未查询到业主信息或查询到多条"); |
| | | if (!accountDtos.get(0).getLink().equals(owners.get(0).getLink()) || !accountDtos.get(0).getAcctName().equals(owners.get(0).getName())) { |
| | | AccountPo accountPo = new AccountPo(); |
| | | accountPo.setAcctName(owners.get(0).getName()); |
| | | accountPo.setoLink(owners.get(0).getLink()); |
| | | accountPo.setAcctId(accountDtos.get(0).getAcctId()); |
| | | accountInnerServiceSMOImpl.updateAccount(accountPo); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 如果 业主做了绑定则修改绑定的手机号 |
| | | * |
| | | * @param reqJson |
| | | */ |
| | | private void updateOwnerAppUser(JSONObject reqJson) { |
| | | OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto(); |
| | | ownerAppUserDto.setMemberId(reqJson.getString("memberId")); |
| | | //todo 查询app用户表 |
| | | List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto); |
| | | if (ListUtil.isNull(ownerAppUserDtos)) { |
| | | return; |
| | | } |
| | | for (OwnerAppUserDto ownerAppUser : ownerAppUserDtos) { |
| | | OwnerAppUserPo ownerAppUserPo = BeanConvertUtil.covertBean(ownerAppUser, OwnerAppUserPo.class); |
| | | ownerAppUserPo.setLink(reqJson.getString("link")); |
| | | ownerAppUserV1InnerServiceSMOImpl.updateOwnerAppUser(ownerAppUserPo); |
| | | if (StringUtil.isEmpty(ownerAppUser.getUserId())) { |
| | | continue; |
| | | } |
| | | if (ownerAppUser.getUserId().startsWith("-")) { |
| | | continue; |
| | | } |
| | | // todo 修改用户信息 |
| | | UserPo userPo = new UserPo(); |
| | | userPo.setUserId(ownerAppUserDtos.get(0).getUserId()); |
| | | userPo.setTel(reqJson.getString("link")); |
| | | userV1InnerServiceSMOImpl.updateUser(userPo); |
| | | } |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | OwnerDto ownerDto = BeanConvertUtil.covertBean(reqJson, OwnerDto.class); |
| | | ownerDto.setOwnerTypeCds(new String[]{"1002", "1003", "1004", "1005"}); |
| | | ownerDto.setOwnerTypeCd(OwnerDto.OWNER_TYPE_CD_MEMBER); |
| | | |
| | | int row = reqJson.getInteger("row"); |
| | | //查询总记录数 |
| | |
| | | ownerDtoList = new ArrayList<>(); |
| | | } |
| | | |
| | | String imgUrl = MappingCache.getValue(MappingConstant.FILE_DOMAIN, "IMG_PATH"); |
| | | |
| | | for (OwnerDto ownerdto : ownerDtoList) { |
| | | FileRelDto fileRelDto = new FileRelDto(); |
| | | fileRelDto.setObjId(ownerdto.getMemberId()); |
| | | List<FileRelDto> fileRelDtos = fileRelInnerServiceSMOImpl.queryFileRels(fileRelDto); |
| | | if (ListUtil.isNull(fileRelDtos)) { |
| | | continue; |
| | | } |
| | | ownerdto.setUrl(fileRelDtos.get(0).getFileSaveName()); |
| | | if (fileRelDtos.get(0).getFileSaveName().startsWith("http")) { |
| | | ownerdto.setUrl(fileRelDtos.get(0).getFileSaveName()); |
| | | } else { |
| | | ownerdto.setUrl(imgUrl + fileRelDtos.get(0).getFileSaveName()); |
| | | } |
| | | } |
| | | ApiOwnerVo apiOwnerVo = new ApiOwnerVo(); |
| | | apiOwnerVo.setOwners(BeanConvertUtil.covertBeanList(ownerDtoList, ApiOwnerDataVo.class)); |
| | | apiOwnerVo.setTotal(total); |
| | |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import com.java110.vo.api.ApiOwnerDataVo; |
| | | import com.java110.vo.api.ApiOwnerVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException { |
| | | String userId = context.getReqHeaders().get("user-id"); |
| | | OwnerDto ownerDto = BeanConvertUtil.covertBean(reqJson, OwnerDto.class); |
| | | ownerDto.setOwnerTypeCds(new String[]{"1002", "1003", "1004", "1005"}); |
| | | ownerDto.setOwnerTypeCd(OwnerDto.OWNER_TYPE_CD_MEMBER); |
| | | |
| | | int row = reqJson.getInteger("row"); |
| | | //查询总记录数 |
| | | int total = ownerInnerServiceSMOImpl.queryOwnersMemberCount(ownerDto); |
| | | |
| | | List<OwnerDto> ownerDtoList = null; |
| | | List<OwnerDto> ownerDtos = null; |
| | | if (total > 0) { |
| | | ownerDtoList = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto); |
| | | ownerDtos = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto); |
| | | } else { |
| | | ownerDtoList = new ArrayList<>(); |
| | | ownerDtos = new ArrayList<>(); |
| | | } |
| | | //查询是否有脱敏权限 |
| | | List<Map> privileges = null; |
| | |
| | | basePrivilegeDto.setUserId(userId); |
| | | privileges = menuInnerServiceSMOImpl.checkUserHasResource(basePrivilegeDto); |
| | | if (privileges == null || privileges.size() == 0) { |
| | | for (OwnerDto owner : ownerDtoList) { |
| | | for (OwnerDto owner : ownerDtos) { |
| | | String idCard = owner.getIdCard(); |
| | | if (!StringUtil.isEmpty(idCard)) { |
| | | idCard = idCard.substring(0, 6) + "**********" + idCard.substring(16); |
| | |
| | | } |
| | | } |
| | | } |
| | | String imgUrl = MappingCache.getValue(MappingConstant.FILE_DOMAIN, "IMG_PATH"); |
| | | |
| | | for (OwnerDto ownerdto : ownerDtoList) { |
| | | FileRelDto fileRelDto = new FileRelDto(); |
| | | fileRelDto.setObjId(ownerdto.getMemberId()); |
| | | List<FileRelDto> fileRelDtos = fileRelInnerServiceSMOImpl.queryFileRels(fileRelDto); |
| | | if (ListUtil.isNull(fileRelDtos)) { |
| | | continue; |
| | | } |
| | | ownerdto.setUrl(fileRelDtos.get(0).getFileSaveName()); |
| | | if (fileRelDtos.get(0).getFileSaveName().startsWith("http")) { |
| | | ownerdto.setUrl(fileRelDtos.get(0).getFileSaveName()); |
| | | } else { |
| | | ownerdto.setUrl(imgUrl + fileRelDtos.get(0).getFileSaveName()); |
| | | } |
| | | } |
| | | ApiOwnerVo apiOwnerVo = new ApiOwnerVo(); |
| | | apiOwnerVo.setOwners(BeanConvertUtil.covertBeanList(ownerDtoList, ApiOwnerDataVo.class)); |
| | | apiOwnerVo.setTotal(total); |
| | | apiOwnerVo.setRecords((int) Math.ceil((double) total / (double) row)); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiOwnerVo), HttpStatus.OK); |
| | | ResponseEntity<String> responseEntity = ResultVo.createResponseEntity((int) Math.ceil((double) total / (double) row), total, ownerDtos); |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.CmdContextUtils; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import com.java110.vo.api.ApiOwnerDataVo; |
| | | import com.java110.vo.api.ApiOwnerVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | Assert.jsonObjectHaveKey(reqJson, "page", "请求中未包含page信息"); |
| | | Assert.jsonObjectHaveKey(reqJson, "row", "请求中未包含row信息"); |
| | | Assert.jsonObjectHaveKey(reqJson, "communityId", "请求中未包含communityId信息"); |
| | | //Assert.jsonObjectHaveKey(reqJson, "ownerTypeCd", "请求中未包含ownerTypeCd信息"); |
| | | Assert.isInteger(reqJson.getString("page"), "不是有效数字"); |
| | | Assert.isInteger(reqJson.getString("row"), "不是有效数字"); |
| | | } |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | String userId = CmdContextUtils.getUserId(cmdDataFlowContext); |
| | | |
| | | //todo 根据房屋查询时 先用 房屋信息查询 业主ID |
| | | freshRoomId(reqJson); |
| | | |
| | | OwnerDto ownerDto = BeanConvertUtil.covertBean(reqJson, OwnerDto.class); |
| | | |
| | | //todo 根据成员查询 |
| | | queryByOwnerMember(reqJson, ownerDto); |
| | | |
| | | |
| | | if (reqJson.containsKey("name") && !StringUtil.isEmpty(reqJson.getString("name"))) { |
| | | queryByCondition(reqJson, cmdDataFlowContext); |
| | | return; |
| | | } |
| | | int row = reqJson.getInteger("row"); |
| | | ApiOwnerVo apiOwnerVo = new ApiOwnerVo(); |
| | | //查询总记录数 |
| | | int total = ownerInnerServiceSMOImpl.queryOwnersCount(ownerDto); |
| | | apiOwnerVo.setTotal(total); |
| | | List<OwnerDto> ownerDtos = new ArrayList<>(); |
| | | List<OwnerDto> ownerDtos = null; |
| | | if (total > 0) { |
| | | List<OwnerDto> ownerDtoList = ownerInnerServiceSMOImpl.queryOwners(ownerDto); |
| | | ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto); |
| | | // 查询统计数据 |
| | | ownerDtoList = queryOwnerStatisticsBMOImpl.query(ownerDtoList); |
| | | List<Map> mark = getPrivilegeOwnerList("/roomCreateFee", reqJson.getString("userId")); |
| | | for (OwnerDto tmpOwnerDto : ownerDtoList) { |
| | | //查询照片 |
| | | FileRelDto fileRelDto = new FileRelDto(); |
| | | fileRelDto.setObjId(tmpOwnerDto.getMemberId()); |
| | | fileRelDto.setRelTypeCd("10000"); //业主照片 |
| | | List<FileRelDto> fileRelDtos = fileRelInnerServiceSMOImpl.queryFileRels(fileRelDto); |
| | | if (!ListUtil.isNull(fileRelDtos)) { |
| | | List<String> urls = new ArrayList<>(); |
| | | for (FileRelDto fileRel : fileRelDtos) { |
| | | urls.add(fileRel.getFileRealName()); |
| | | } |
| | | tmpOwnerDto.setUrls(urls); |
| | | } |
| | | ownerDtos = queryOwnerStatisticsBMOImpl.query(ownerDtos); |
| | | List<Map> mark = getPrivilegeOwnerList("/roomCreateFee", userId); |
| | | for (OwnerDto tmpOwnerDto : ownerDtos) { |
| | | //对业主身份证号隐藏处理 |
| | | String idCard = tmpOwnerDto.getIdCard(); |
| | | if (mark.size() == 0 && idCard != null && !idCard.equals("") && idCard.length() > 16) { |
| | |
| | | link = link.substring(0, 3) + "****" + link.substring(7); |
| | | tmpOwnerDto.setLink(link); |
| | | } |
| | | ownerDtos.add(tmpOwnerDto); |
| | | } |
| | | apiOwnerVo.setOwners(BeanConvertUtil.covertBeanList(ownerDtos, ApiOwnerDataVo.class)); |
| | | }else{ |
| | | ownerDtos = new ArrayList<>(); |
| | | } |
| | | apiOwnerVo.setRecords((int) Math.ceil((double) total / (double) row)); |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiOwnerVo), HttpStatus.OK); |
| | | ResponseEntity<String> responseEntity = ResultVo.createResponseEntity((int) Math.ceil((double) total / (double) row), total, ownerDtos); |
| | | cmdDataFlowContext.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | /** |
| | | * 根据 成员查询 |
| | | * |
| | | * @param reqJson |
| | | * @param ownerDto |
| | | */ |
| | | private void queryByOwnerMember(JSONObject reqJson, OwnerDto ownerDto) { |
| | | |
| | | if (!reqJson.containsKey("memberName") && !reqJson.containsKey("memberLink")) { |
| | | return; |
| | | } |
| | | |
| | | String memberName = reqJson.getString("memberName"); |
| | | String memberLink = reqJson.getString("memberLink"); |
| | | |
| | | if (StringUtil.isEmpty(memberName) && StringUtil.isEmpty(memberLink)) { |
| | | return; |
| | | } |
| | | |
| | | OwnerDto tmpOwnerMemberDto = new OwnerDto(); |
| | | tmpOwnerMemberDto.setNameLike(memberName); |
| | | tmpOwnerMemberDto.setLink(memberLink); |
| | | tmpOwnerMemberDto.setOwnerTypeCds(new String[]{OwnerDto.OWNER_TYPE_CD_MEMBER, |
| | | OwnerDto.OWNER_TYPE_CD_OTHER, |
| | | OwnerDto.OWNER_TYPE_CD_TEMP, |
| | | OwnerDto.OWNER_TYPE_CD_RENTING |
| | | }); |
| | | List<OwnerDto> ownerMembers = ownerInnerServiceSMOImpl.queryOwnerMembers(tmpOwnerMemberDto); |
| | | |
| | | if (ListUtil.isNull(ownerMembers)) { |
| | | ownerDto.setOwnerId("-1"); // 写入-1 查询不到数据 |
| | | return; |
| | | } |
| | | |
| | | List<String> ownerIds = new ArrayList<>(); |
| | | for (OwnerDto tmpOwnerMember : ownerMembers) { |
| | | ownerIds.add(tmpOwnerMember.getOwnerId()); |
| | | } |
| | | |
| | | ownerDto.setOwnerIds(ownerIds.toArray(new String[ownerIds.size()])); |
| | | } |
| | | |
| | | private void freshRoomId(JSONObject reqJson) { |
| | |
| | | reqJson.put("roomId", roomDtos.get(0).getRoomId()); |
| | | } |
| | | |
| | | /** |
| | | * 根据条件查询 |
| | | * |
| | | * @param reqJson 查询信息 |
| | | * @param cmdDataFlowContext 上下文 |
| | | */ |
| | | private void queryByCondition(JSONObject reqJson, ICmdDataFlowContext cmdDataFlowContext) { |
| | | //获取当前用户id |
| | | String ownerTypeCd = reqJson.getString("ownerTypeCd"); |
| | | OwnerDto tmpOwnerDto = BeanConvertUtil.covertBean(reqJson, OwnerDto.class); |
| | | if (!StringUtil.isEmpty(ownerTypeCd) && ownerTypeCd.contains(",")) { |
| | | tmpOwnerDto.setOwnerTypeCd(""); |
| | | tmpOwnerDto.setOwnerTypeCds(ownerTypeCd.split(",")); |
| | | } |
| | | String userId = reqJson.getString("userId"); |
| | | int row = reqJson.getInteger("row"); |
| | | ApiOwnerVo apiOwnerVo = new ApiOwnerVo(); |
| | | int total = ownerInnerServiceSMOImpl.queryOwnerCountByCondition(tmpOwnerDto); |
| | | apiOwnerVo.setTotal(total); |
| | | List<OwnerDto> ownerDtos = new ArrayList<>(); |
| | | if (total > 0) { |
| | | List<OwnerDto> ownerDtoList = ownerInnerServiceSMOImpl.queryOwnersByCondition(tmpOwnerDto); |
| | | // 查询统计数据 |
| | | ownerDtoList = queryOwnerStatisticsBMOImpl.query(ownerDtoList); |
| | | |
| | | List<Map> mark = getPrivilegeOwnerList("/roomCreateFee", userId); |
| | | for (OwnerDto ownerDto : ownerDtoList) { |
| | | //对业主身份证号隐藏处理 |
| | | String idCard = ownerDto.getIdCard(); |
| | | if (mark.size() == 0 && !StringUtil.isEmpty(idCard) && idCard.length() > 16) { |
| | | idCard = idCard.substring(0, 6) + "**********" + idCard.substring(16); |
| | | ownerDto.setIdCard(idCard); |
| | | } |
| | | //对业主手机号隐藏处理 |
| | | String link = ownerDto.getLink(); |
| | | if (mark.size() == 0 && !StringUtil.isEmpty(link) && link.length() == 11) { |
| | | link = link.substring(0, 3) + "****" + link.substring(7); |
| | | ownerDto.setLink(link); |
| | | } |
| | | ownerDtos.add(ownerDto); |
| | | } |
| | | apiOwnerVo.setOwners(BeanConvertUtil.covertBeanList(ownerDtos, ApiOwnerDataVo.class)); |
| | | } |
| | | apiOwnerVo.setRecords((int) Math.ceil((double) total / (double) row)); |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiOwnerVo), HttpStatus.OK); |
| | | cmdDataFlowContext.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | /** |
| | | * 脱敏处理 |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.context.CmdContextUtils; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | |
| | | import com.java110.utils.lock.DistributedLock; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Java110ParamDoc(name = "link", length = 11, remark = "业主手机号"), |
| | | @Java110ParamDoc(name = "idCard", length = 30, remark = "业主身份证号"), |
| | | @Java110ParamDoc(name = "address", length = 512, remark = "地址"), |
| | | @Java110ParamDoc(name = "personType", length = 12, remark = "人员类型 P 个人 C 公司"), |
| | | @Java110ParamDoc(name = "personRole", length = 12, remark = "人员角色 1 业主 2 租客 3 家庭成员 4 公司员工 99 其他"), |
| | | @Java110ParamDoc(name = "sex", length = 12, remark = "性别 男 1 女 0"), |
| | | @Java110ParamDoc(name = "ownerTypeCd", length = 12, remark = "业主类型 1001 业主 2002 家庭成员 家庭成员 需要传业主的ownerId"), |
| | | @Java110ParamDoc(name = "remark", length = 512, remark = "备注"), |
| | | @Java110ParamDoc(name = "ownerId", length = 30, remark = "业主 时 填写-1 家庭成员时填写业主ID"), |
| | | @Java110ParamDoc(name = "ownerPhoto", length = -1, remark = "业主人脸 用于同步门禁 人脸开门"), |
| | |
| | | @Java110ExampleDoc( |
| | | reqBody = "{\n" + |
| | | "\t\"name\": \"王王\",\n" + |
| | | "\t\"age\": \"\",\n" + |
| | | "\t\"link\": \"18909718888\",\n" + |
| | | "\t\"address\": \"张三\",\n" + |
| | | "\t\"sex\": \"0\",\n" + |
| | |
| | | "\t\"remark\": \"\",\n" + |
| | | "\t\"ownerId\": -1,\n" + |
| | | "\t\"ownerPhoto\": \"\",\n" + |
| | | "\t\"personType\": \"P\",\n" + |
| | | "\t\"personRole\": \"1\",\n" + |
| | | "\t\"idCard\": \"\",\n" + |
| | | "\t\"communityId\": \"2022121921870161\"\n" + |
| | | "}", |
| | |
| | | ) |
| | | @Java110Cmd(serviceCode = "owner.saveOwner") |
| | | public class SaveOwnerCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl; |
| | | |
| | |
| | | @Autowired |
| | | private IGeneratorOwnerUserBMO generatorOwnerUserBMOImpl; |
| | | |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | Assert.jsonObjectHaveKey(reqJson, "name", "请求报文中未包含name"); |
| | | Assert.jsonObjectHaveKey(reqJson, "userId", "请求报文中未包含userId"); |
| | | Assert.jsonObjectHaveKey(reqJson, "age", "请求报文中未包含age"); |
| | | Assert.jsonObjectHaveKey(reqJson, "link", "请求报文中未包含link"); |
| | | Assert.jsonObjectHaveKey(reqJson, "sex", "请求报文中未包含sex"); |
| | | Assert.jsonObjectHaveKey(reqJson, "ownerTypeCd", "请求报文中未包含类型"); |
| | | Assert.jsonObjectHaveKey(reqJson, "communityId", "请求报文中未包含communityId"); |
| | | //Assert.jsonObjectHaveKey(paramIn, "idCard", "请求报文中未包含身份证号"); |
| | | if (reqJson.containsKey("roomId")) { |
| | | Assert.jsonObjectHaveKey(reqJson, "state", "请求报文中未包含state节点"); |
| | | Assert.jsonObjectHaveKey(reqJson, "storeId", "请求报文中未包含storeId节点"); |
| | | Assert.hasLength(reqJson.getString("roomId"), "roomId不能为空"); |
| | | Assert.hasLength(reqJson.getString("state"), "state不能为空"); |
| | | Assert.hasLength(reqJson.getString("storeId"), "storeId不能为空"); |
| | | } |
| | | if (reqJson.containsKey("msgCode")) { |
| | | SmsDto smsDto = new SmsDto(); |
| | | smsDto.setTel(reqJson.getString("link")); |
| | | smsDto.setCode(reqJson.getString("msgCode")); |
| | | smsDto = smsInnerServiceSMOImpl.validateCode(smsDto); |
| | | if (!smsDto.isSuccess() && "ON".equals(MappingCache.getValue(MappingConstant.SMS_DOMAIN,SendSmsFactory.SMS_SEND_SWITCH))) { |
| | | throw new IllegalArgumentException(smsDto.getMsg()); |
| | | Assert.jsonObjectHaveKey(reqJson, "personType", "请求报文中未包含personType"); |
| | | Assert.jsonObjectHaveKey(reqJson, "personRole", "请求报文中未包含personRole"); |
| | | |
| | | if (reqJson.containsKey("ownerPhotoUrl")) { |
| | | String ownerPhotoUrl = reqJson.getString("ownerPhotoUrl"); |
| | | if (!StringUtil.isEmpty(ownerPhotoUrl) && ownerPhotoUrl.length() > 500) { |
| | | throw new CmdException("图片地址太长"); |
| | | } |
| | | } |
| | | |
| | | //属性校验 |
| | | Assert.judgeAttrValue(reqJson); |
| | | |
| | | String userValidate = MappingCache.getValue("USER_VALIDATE"); |
| | | if (!"ON".equals(userValidate)) { |
| | | return; |
| | | } |
| | | //获取手机号(判断手机号是否重复) |
| | | String link = reqJson.getString("link"); |
| | | OwnerDto ownerDto = new OwnerDto(); |
| | | ownerDto.setLink(link); |
| | | ownerDto.setCommunityId(reqJson.getString("communityId")); |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryAllOwners(ownerDto); |
| | | Assert.listIsNull(ownerDtos, "手机号重复,请重新输入"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Java110Transactional |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | String userValidate = MappingCache.getValue("USER_VALIDATE"); |
| | | if ((!reqJson.containsKey("source") || !"BatchImport".equals(reqJson.getString("source"))) && "ON".equals(userValidate)) { |
| | | //获取手机号(判断手机号是否重复) |
| | | String link = reqJson.getString("link"); |
| | | OwnerDto ownerDto = new OwnerDto(); |
| | | ownerDto.setLink(link); |
| | | ownerDto.setCommunityId(reqJson.getString("communityId")); |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryAllOwners(ownerDto); |
| | | Assert.listIsNull(ownerDtos, "手机号重复,请重新输入"); |
| | | //获取身份证号(判断身份证号是否重复) |
| | | String idCard = reqJson.getString("idCard"); |
| | | if (!StringUtil.isEmpty(idCard)) { |
| | | OwnerDto owner = new OwnerDto(); |
| | | owner.setIdCard(idCard); |
| | | owner.setCommunityId(reqJson.getString("communityId")); |
| | | List<OwnerDto> owners = ownerInnerServiceSMOImpl.queryAllOwners(owner); |
| | | Assert.listIsNull(owners, "身份证号重复,请重新输入"); |
| | | } |
| | | } |
| | | //生成memberId |
| | | generateMemberId(reqJson); |
| | | |
| | | JSONObject businessOwner = new JSONObject(); |
| | | businessOwner.putAll(reqJson); |
| | | businessOwner.put("state", "2000"); |
| | | OwnerPo ownerPo = BeanConvertUtil.covertBean(businessOwner, OwnerPo.class); |
| | | if (reqJson.containsKey("age") && StringUtil.isEmpty(reqJson.getString("age"))) { |
| | | ownerPo.setAge(null); |
| | | } |
| | | String userId = CmdContextUtils.getUserId(cmdDataFlowContext); |
| | | |
| | | String memberId = GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ownerId); |
| | | |
| | | OwnerPo ownerPo = BeanConvertUtil.covertBean(reqJson, OwnerPo.class); |
| | | ownerPo.setState(OwnerDto.STATE_FINISH); |
| | | ownerPo.setMemberId(memberId); |
| | | ownerPo.setOwnerId(memberId); |
| | | ownerPo.setOwnerTypeCd(OwnerDto.OWNER_TYPE_CD_OWNER); |
| | | ownerPo.setAge("0"); |
| | | ownerPo.setUserId(userId); |
| | | |
| | | String ownerPhotoUrl = reqJson.getString("ownerPhotoUrl"); |
| | | |
| | | |
| | | ownerPo.setFaceUrl(ownerPhotoUrl); |
| | | int flag = ownerV1InnerServiceSMOImpl.saveOwner(ownerPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("保存业主失败"); |
| | | } |
| | | //有房屋信息,则直接绑定房屋和 业主的关系 |
| | | if (reqJson.containsKey("roomId")) { |
| | | JSONObject businessUnit = new JSONObject(); |
| | | businessUnit.putAll(reqJson); |
| | | businessUnit.put("relId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_relId)); |
| | | OwnerRoomRelPo ownerRoomRelPo = BeanConvertUtil.covertBean(businessUnit, OwnerRoomRelPo.class); |
| | | flag = ownerRoomRelV1InnerServiceSMOImpl.saveOwnerRoomRel(ownerRoomRelPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("保存业主房屋关系失败"); |
| | | } |
| | | } |
| | | |
| | | //保存照片 |
| | | photoSMOImpl.savePhoto(reqJson.getString("ownerPhoto"), |
| | | reqJson.getString("memberId"), |
| | | reqJson.getString("communityId"), |
| | | "10000"); |
| | | |
| | | dealOwnerAttr(reqJson, cmdDataFlowContext); |
| | | dealOwnerAttr(reqJson, memberId, cmdDataFlowContext); |
| | | |
| | | |
| | | //todo 生成登录账号 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 生成小区楼ID |
| | | * |
| | | * @param paramObj 请求入参数据 |
| | | */ |
| | | private void generateMemberId(JSONObject paramObj) { |
| | | String memberId = GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ownerId); |
| | | paramObj.put("memberId", memberId); |
| | | if (!paramObj.containsKey("ownerId") || OwnerDto.OWNER_TYPE_CD_OWNER.equals(paramObj.getString("ownerTypeCd"))) { |
| | | paramObj.put("ownerId", memberId); |
| | | } |
| | | } |
| | | |
| | | private void dealOwnerAttr(JSONObject paramObj, ICmdDataFlowContext cmdDataFlowContext) { |
| | | private void dealOwnerAttr(JSONObject paramObj, String memberId, ICmdDataFlowContext cmdDataFlowContext) { |
| | | |
| | | if (!paramObj.containsKey("attrs")) { |
| | | return; |
| | | } |
| | | |
| | | JSONArray attrs = paramObj.getJSONArray("attrs"); |
| | | if (attrs.size() < 1) { |
| | | if (ListUtil.isNull(attrs)) { |
| | | return; |
| | | } |
| | | |
| | |
| | | for (int attrIndex = 0; attrIndex < attrs.size(); attrIndex++) { |
| | | attr = attrs.getJSONObject(attrIndex); |
| | | attr.put("communityId", paramObj.getString("communityId")); |
| | | attr.put("memberId", paramObj.getString("memberId")); |
| | | attr.put("memberId", memberId); |
| | | attr.put("attrId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); |
| | | OwnerAttrPo ownerAttrPo = BeanConvertUtil.covertBean(attr, OwnerAttrPo.class); |
| | | flag = ownerAttrInnerServiceSMOImpl.saveOwnerAttr(ownerAttrPo); |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.context.CmdContextUtils; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | Assert.jsonObjectHaveKey(reqJson, "name", "请求报文中未包含name"); |
| | | Assert.jsonObjectHaveKey(reqJson, "userId", "请求报文中未包含userId"); |
| | | Assert.jsonObjectHaveKey(reqJson, "age", "请求报文中未包含age"); |
| | | Assert.jsonObjectHaveKey(reqJson, "link", "请求报文中未包含link"); |
| | | Assert.jsonObjectHaveKey(reqJson, "sex", "请求报文中未包含sex"); |
| | | Assert.jsonObjectHaveKey(reqJson, "ownerId", "请求报文中未包含业主"); |
| | | |
| | | Assert.jsonObjectHaveKey(reqJson, "communityId", "请求报文中未包含communityId"); |
| | | |
| | | if (reqJson.containsKey("ownerPhotoUrl")) { |
| | | String ownerPhotoUrl = reqJson.getString("ownerPhotoUrl"); |
| | | if (!StringUtil.isEmpty(ownerPhotoUrl) && ownerPhotoUrl.length() > 500) { |
| | | throw new CmdException("图片地址太长"); |
| | | } |
| | | } |
| | | |
| | | //todo 验证吗校验 |
| | | if (reqJson.containsKey("msgCode")) { |
| | |
| | | @Override |
| | | @Java110Transactional |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | String userId = CmdContextUtils.getUserId(context); |
| | | |
| | | //todo 生成memberId |
| | | generateMemberId(reqJson); |
| | | String memberId = GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ownerId); |
| | | reqJson.put("memberId", memberId); |
| | | |
| | | JSONObject businessOwner = new JSONObject(); |
| | | businessOwner.putAll(reqJson); |
| | | businessOwner.put("state", "2000"); |
| | | OwnerPo ownerPo = BeanConvertUtil.covertBean(businessOwner, OwnerPo.class); |
| | | if (reqJson.containsKey("age") && StringUtil.isEmpty(reqJson.getString("age"))) { |
| | | ownerPo.setAge(null); |
| | | } |
| | | OwnerPo ownerPo = BeanConvertUtil.covertBean(reqJson, OwnerPo.class); |
| | | |
| | | String ownerPhotoUrl = reqJson.getString("ownerPhotoUrl"); |
| | | ownerPo.setFaceUrl(ownerPhotoUrl); |
| | | ownerPo.setAge("0"); |
| | | ownerPo.setUserId(userId); |
| | | ownerPo.setState(OwnerDto.STATE_FINISH); |
| | | ownerPo.setPersonType(OwnerDto.PERSON_TYPE_PERSON); |
| | | ownerPo.setOwnerTypeCd(OwnerDto.OWNER_TYPE_CD_MEMBER); |
| | | int flag = ownerV1InnerServiceSMOImpl.saveOwner(ownerPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("保存业主失败"); |
| | | } |
| | | |
| | | //todo 保存照片 |
| | | photoSMOImpl.savePhoto(reqJson.getString("ownerPhoto"), |
| | | reqJson.getString("memberId"), |
| | | reqJson.getString("communityId"), |
| | | "10000"); |
| | | |
| | | //todo 保存属性 |
| | | dealOwnerAttr(reqJson, context); |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 生成小区楼ID |
| | | * |
| | | * @param paramObj 请求入参数据 |
| | | */ |
| | | private void generateMemberId(JSONObject paramObj) { |
| | | String memberId = GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ownerId); |
| | | paramObj.put("memberId", memberId); |
| | | |
| | | } |
| | | |
| | | private void dealOwnerAttr(JSONObject paramObj, ICmdDataFlowContext cmdDataFlowContext) { |
| | | |
| | |
| | | } |
| | | |
| | | Map ownerInfo = BeanConvertUtil.beanCovertMap(ownerDto); |
| | | ownerInfo.put("communityId", ownerDto.getCommunityId()); |
| | | ownerInfo.put("ownerTypeCd", OwnerTypeConstant.OWNER); |
| | | // ownerInfo.put("ownerIds", getOwnerIds(communityMemberDtos)); |
| | | //ownerInfo.put("ownerTypeCd", ownerDto.getOwnerTypeCd()); |
| | | // ownerInfo.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | |
| | | List<OwnerDto> owners = BeanConvertUtil.covertBeanList(ownerServiceDaoImpl.getOwnerInfo(ownerInfo), OwnerDto.class); |
| | | |
| | |
| | | refreshOwner(owner, users, ownerAttrDtos); |
| | | } |
| | | |
| | | updateOwnerPhone(owners); |
| | | return owners; |
| | | } |
| | | |
| | | private boolean updateOwnerPhone(List<OwnerDto> owners) { |
| | | if (owners.size() > 50) { |
| | | return true; |
| | | } |
| | | |
| | | List<String> memberIds = new ArrayList<>(); |
| | | |
| | | for (OwnerDto tmpOwnerDto : owners) { |
| | | memberIds.add(tmpOwnerDto.getMemberId()); |
| | | } |
| | | |
| | | FileRelDto fileRelDto = new FileRelDto(); |
| | | //fileRelDto.setObjId(owners.get(0).getMemberId()); |
| | | fileRelDto.setObjIds(memberIds.toArray(new String[memberIds.size()])); |
| | | List<FileRelDto> fileRelDtos = fileRelInnerServiceSMOImpl.queryFileRels(fileRelDto); |
| | | |
| | | if (fileRelDtos == null || fileRelDtos.size() < 1) { |
| | | return true; |
| | | } |
| | | |
| | | String imgUrl = MappingCache.getValue(MappingConstant.FILE_DOMAIN, "IMG_PATH"); |
| | | |
| | | for (OwnerDto tmpOwnerDto : owners) { |
| | | for (FileRelDto tmpFileRelDto : fileRelDtos) { |
| | | if (!tmpOwnerDto.getMemberId().equals(tmpFileRelDto.getObjId())) { |
| | | continue; |
| | | } |
| | | |
| | | if (tmpFileRelDto.getFileSaveName().startsWith("http")) { |
| | | tmpOwnerDto.setUrl(tmpFileRelDto.getFileSaveName()); |
| | | } else { |
| | | tmpOwnerDto.setUrl(imgUrl + tmpFileRelDto.getFileSaveName()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | List<OwnerDto> owners = BeanConvertUtil.covertBeanList(ownerServiceDaoImpl.getOwnerInfo(BeanConvertUtil.beanCovertMap(ownerDto)), OwnerDto.class); |
| | | if (owners == null || owners.size() == 0) { |
| | | if (ListUtil.isNull(owners)) { |
| | | return owners; |
| | | } |
| | | |
| | |
| | | refreshOwner(owner, users, ownerAttrDtos); |
| | | } |
| | | |
| | | updateOwnerPhone(owners); |
| | | return owners; |
| | | } |
| | | |
| | |
| | | /** |
| | | * 获取批量userId |
| | | * |
| | | * @param communityMemberDtos 小区楼信息 |
| | | * @return 批量userIds 信息 |
| | | */ |
| | | private String[] getOwnerIds(List<CommunityMemberDto> communityMemberDtos) { |
| | | List<String> ownerIds = new ArrayList<String>(); |
| | | for (CommunityMemberDto communityMemberDto : communityMemberDtos) { |
| | | ownerIds.add(communityMemberDto.getMemberId()); |
| | | } |
| | | |
| | | return ownerIds.toArray(new String[ownerIds.size()]); |
| | | } |
| | | |
| | | /** |
| | | * 获取批量userId |
| | | * |
| | | * @param owners 小区楼信息 |
| | | * @return 批量userIds 信息 |
| | | */ |
| | |
| | | public int queryOwnersCount(@RequestBody OwnerDto ownerDto) { |
| | | |
| | | Map ownerInfo = BeanConvertUtil.beanCovertMap(ownerDto); |
| | | ownerInfo.put("communityId", ownerDto.getCommunityId()); |
| | | ownerInfo.put("ownerTypeCd", OwnerTypeConstant.OWNER); |
| | | // ownerInfo.put("ownerIds", getOwnerIds(communityMemberDtos)); |
| | | //ownerInfo.put("ownerTypeCd", ownerDto.getOwnerTypeCd()); |
| | | ownerInfo.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | |
| | | return ownerServiceDaoImpl.getOwnerInfoCount(ownerInfo); |
| | | |
| | |
| | | for (OwnerDto owner : owners) { |
| | | refreshOwner(owner, users, ownerAttrDtos); |
| | | } |
| | | updateOwnerPhone(owners); |
| | | return owners; |
| | | } |
| | | |
| | |
| | | |
| | | List<OwnerDto> owners = BeanConvertUtil.covertBeanList(ownerV1ServiceDaoImpl.getOwnerInfo(BeanConvertUtil.beanCovertMap(ownerDto)), OwnerDto.class); |
| | | |
| | | //todo 查询业主头像 |
| | | getOwnerPhone(owners); |
| | | return owners; |
| | | } |
| | | |
| | |
| | | return result; |
| | | } |
| | | |
| | | private boolean getOwnerPhone(List<OwnerDto> owners) { |
| | | if (owners == null || owners.size() == 0 || owners.size() > 50) { |
| | | return true; |
| | | } |
| | | |
| | | List<String> memberIds = new ArrayList<>(); |
| | | |
| | | for (OwnerDto tmpOwnerDto : owners) { |
| | | memberIds.add(tmpOwnerDto.getMemberId()); |
| | | } |
| | | |
| | | FileRelDto fileRelDto = new FileRelDto(); |
| | | //fileRelDto.setObjId(owners.get(0).getMemberId()); |
| | | fileRelDto.setObjIds(memberIds.toArray(new String[memberIds.size()])); |
| | | List<FileRelDto> fileRelDtos = fileRelInnerServiceSMOImpl.queryFileRels(fileRelDto); |
| | | |
| | | if (fileRelDtos == null || fileRelDtos.size() < 1) { |
| | | return true; |
| | | } |
| | | |
| | | String imgUrl = MappingCache.getValue(MappingConstant.FILE_DOMAIN, "IMG_PATH"); |
| | | |
| | | for (OwnerDto tmpOwnerDto : owners) { |
| | | for (FileRelDto tmpFileRelDto : fileRelDtos) { |
| | | if (!tmpOwnerDto.getMemberId().equals(tmpFileRelDto.getObjId())) { |
| | | continue; |
| | | } |
| | | |
| | | if (tmpFileRelDto.getFileSaveName().startsWith("http")) { |
| | | tmpOwnerDto.setUrl(tmpFileRelDto.getFileSaveName()); |
| | | } else { |
| | | tmpOwnerDto.setUrl(imgUrl + tmpFileRelDto.getFileSaveName()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | } |