java110-bean/src/main/java/com/java110/dto/data/DatabusDataDto.java
@@ -29,6 +29,9 @@ //todo 工作单通知适配器 public static final String BUSINESS_TYPE_OA_WORK_TASK = "oaWorkTaskToStaff"; // 费用公摊 public static final String BUSINESS_TYPE_SHARE_READING = "floorShareReading"; // 欠费催缴 public static final String BUSINESS_TYPE_SEND_COMMUNITY_DATA_TO_IOT = "sendCommunityDataToIot"; java110-bean/src/main/java/com/java110/dto/floorShareFee/FloorShareFeeDto.java
New file @@ -0,0 +1,111 @@ package com.java110.dto.floorShareFee; import com.java110.dto.PageDto; import java.io.Serializable; import java.util.Date; /** * @ClassName FloorDto * @Description 公摊费用数据层封装 * @Author wuxw * @Date 2019/4/24 8:52 * @Version 1.0 * add by wuxw 2019/4/24 **/ public class FloorShareFeeDto extends PageDto implements Serializable { private String amount; private String ownerName; private String fsfId; private String fsmId; private String feeName; private String remark; private String readingId; private String feeId; private String roomName; private String degrees; private Date createTime; private String statusCd = "0"; public String getAmount() { return amount; } public void setAmount(String amount) { this.amount = amount; } public String getOwnerName() { return ownerName; } public void setOwnerName(String ownerName) { this.ownerName = ownerName; } public String getFsfId() { return fsfId; } public void setFsfId(String fsfId) { this.fsfId = fsfId; } public String getFsmId() { return fsmId; } public void setFsmId(String fsmId) { this.fsmId = fsmId; } public String getFeeName() { return feeName; } public void setFeeName(String feeName) { this.feeName = feeName; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public String getReadingId() { return readingId; } public void setReadingId(String readingId) { this.readingId = readingId; } public String getFeeId() { return feeId; } public void setFeeId(String feeId) { this.feeId = feeId; } public String getRoomName() { return roomName; } public void setRoomName(String roomName) { this.roomName = roomName; } public String getDegrees() { return degrees; } public void setDegrees(String degrees) { this.degrees = degrees; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public String getStatusCd() { return statusCd; } public void setStatusCd(String statusCd) { this.statusCd = statusCd; } } java110-bean/src/main/java/com/java110/dto/floorShareMeter/FloorShareMeterDto.java
@@ -15,6 +15,9 @@ **/ public class FloorShareMeterDto extends PageDto implements Serializable { public static final String SHARE_TYPE_ROOM_AREA = "1001";//1001 按面积 2002 按户 3003 自定义公式 public static final String SHARE_TYPE_ROOM_COUNT = "2002";//1001 按面积 2002 按户 3003 自定义公式 private String floorId; private String meterNum; private String meterType; @@ -27,6 +30,11 @@ private String shareTypeName; private String floorNum; private String curReadingTime; private String configId; private String configName; private String sharePrice; private Date createTime; @@ -146,4 +154,28 @@ public void setShareTypeName(String shareTypeName) { this.shareTypeName = shareTypeName; } public String getConfigId() { return configId; } public void setConfigId(String configId) { this.configId = configId; } public String getConfigName() { return configName; } public void setConfigName(String configName) { this.configName = configName; } public String getSharePrice() { return sharePrice; } public void setSharePrice(String sharePrice) { this.sharePrice = sharePrice; } } java110-bean/src/main/java/com/java110/dto/floorShareReading/FloorShareReadingDto.java
@@ -29,6 +29,8 @@ private String auditStaffName; private String preReadingTime; private String state; private String statsMsg; private String shareMsg; private String communityId; @@ -149,4 +151,20 @@ public void setStatusCd(String statusCd) { this.statusCd = statusCd; } public String getStatsMsg() { return statsMsg; } public void setStatsMsg(String statsMsg) { this.statsMsg = statsMsg; } public String getShareMsg() { return shareMsg; } public void setShareMsg(String shareMsg) { this.shareMsg = shareMsg; } } java110-bean/src/main/java/com/java110/po/floorShareFee/FloorShareFeePo.java
New file @@ -0,0 +1,110 @@ /* * 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.po.floorShareFee; import java.io.Serializable; import java.util.Date; /** * 类表述: Po 数据模型实体对象 基本保持与数据库模型一直 用于 增加修改删除 等时的数据载体 * add by 吴学文 at 2025-03-26 16:25:43 mail: 928255095@qq.com * open source address: https://gitee.com/wuxw7/MicroCommunity * 官网:http://www.homecommunity.cn * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行 */ public class FloorShareFeePo implements Serializable { private String amount; private String ownerName; private String fsfId; private String fsmId; private String feeName; private String remark; private String statusCd = "0"; private String readingId; private String feeId; private String roomName; private String degrees; public String getAmount() { return amount; } public void setAmount(String amount) { this.amount = amount; } public String getOwnerName() { return ownerName; } public void setOwnerName(String ownerName) { this.ownerName = ownerName; } public String getFsfId() { return fsfId; } public void setFsfId(String fsfId) { this.fsfId = fsfId; } public String getFsmId() { return fsmId; } public void setFsmId(String fsmId) { this.fsmId = fsmId; } public String getFeeName() { return feeName; } public void setFeeName(String feeName) { this.feeName = feeName; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public String getStatusCd() { return statusCd; } public void setStatusCd(String statusCd) { this.statusCd = statusCd; } public String getReadingId() { return readingId; } public void setReadingId(String readingId) { this.readingId = readingId; } public String getFeeId() { return feeId; } public void setFeeId(String feeId) { this.feeId = feeId; } public String getRoomName() { return roomName; } public void setRoomName(String roomName) { this.roomName = roomName; } public String getDegrees() { return degrees; } public void setDegrees(String degrees) { this.degrees = degrees; } } java110-bean/src/main/java/com/java110/po/floorShareMeter/FloorShareMeterPo.java
@@ -17,6 +17,7 @@ import java.io.Serializable; import java.util.Date; /** * 类表述: Po 数据模型实体对象 基本保持与数据库模型一直 用于 增加修改删除 等时的数据载体 * add by 吴学文 at 2025-03-25 15:01:11 mail: 928255095@qq.com @@ -28,83 +29,131 @@ public class FloorShareMeterPo implements Serializable { private String floorId; private String meterNum; private String meterType; private String fsmId; private String formulaValue; private String statusCd = "0"; private String communityId; private String curDegree; private String shareType; private String floorNum; private String curReadingTime; public String getFloorId() { private String meterNum; private String meterType; private String fsmId; private String formulaValue; private String statusCd = "0"; private String communityId; private String curDegree; private String shareType; private String floorNum; private String curReadingTime; private String configId; private String configName; private String sharePrice; public String getFloorId() { return floorId; } public void setFloorId(String floorId) { public void setFloorId(String floorId) { this.floorId = floorId; } public String getMeterNum() { public String getMeterNum() { return meterNum; } public void setMeterNum(String meterNum) { public void setMeterNum(String meterNum) { this.meterNum = meterNum; } public String getMeterType() { public String getMeterType() { return meterType; } public void setMeterType(String meterType) { public void setMeterType(String meterType) { this.meterType = meterType; } public String getFsmId() { public String getFsmId() { return fsmId; } public void setFsmId(String fsmId) { public void setFsmId(String fsmId) { this.fsmId = fsmId; } public String getFormulaValue() { public String getFormulaValue() { return formulaValue; } public void setFormulaValue(String formulaValue) { public void setFormulaValue(String formulaValue) { this.formulaValue = formulaValue; } public String getStatusCd() { public String getStatusCd() { return statusCd; } public void setStatusCd(String statusCd) { public void setStatusCd(String statusCd) { this.statusCd = statusCd; } public String getCommunityId() { public String getCommunityId() { return communityId; } public void setCommunityId(String communityId) { public void setCommunityId(String communityId) { this.communityId = communityId; } public String getCurDegree() { public String getCurDegree() { return curDegree; } public void setCurDegree(String curDegree) { public void setCurDegree(String curDegree) { this.curDegree = curDegree; } public String getShareType() { public String getShareType() { return shareType; } public void setShareType(String shareType) { public void setShareType(String shareType) { this.shareType = shareType; } public String getFloorNum() { public String getFloorNum() { return floorNum; } public void setFloorNum(String floorNum) { public void setFloorNum(String floorNum) { this.floorNum = floorNum; } public String getCurReadingTime() { public String getCurReadingTime() { return curReadingTime; } public void setCurReadingTime(String curReadingTime) { public void setCurReadingTime(String curReadingTime) { this.curReadingTime = curReadingTime; } public String getConfigId() { return configId; } public void setConfigId(String configId) { this.configId = configId; } public String getConfigName() { return configName; } public void setConfigName(String configName) { this.configName = configName; } public String getSharePrice() { return sharePrice; } public void setSharePrice(String sharePrice) { this.sharePrice = sharePrice; } } java110-bean/src/main/java/com/java110/po/floorShareReading/FloorShareReadingPo.java
@@ -17,6 +17,7 @@ import java.io.Serializable; import java.util.Date; /** * 类表述: Po 数据模型实体对象 基本保持与数据库模型一直 用于 增加修改删除 等时的数据载体 * add by 吴学文 at 2025-03-26 09:29:54 mail: 928255095@qq.com @@ -28,97 +29,139 @@ public class FloorShareReadingPo implements Serializable { private String fsmId; private String remark; private String statusCd = "0"; private String readingId; private String title; private String curReadingTime; private String createStaffName; private String curDegrees; private String preDegrees; private String auditStaffName; private String preReadingTime; private String state; private String communityId; public String getFsmId() { private String remark; private String statusCd = "0"; private String readingId; private String title; private String curReadingTime; private String createStaffName; private String curDegrees; private String preDegrees; private String auditStaffName; private String preReadingTime; private String state; private String statsMsg; private String shareMsg; private String communityId; public String getFsmId() { return fsmId; } public void setFsmId(String fsmId) { public void setFsmId(String fsmId) { this.fsmId = fsmId; } public String getRemark() { public String getRemark() { return remark; } public void setRemark(String remark) { public void setRemark(String remark) { this.remark = remark; } public String getStatusCd() { public String getStatusCd() { return statusCd; } public void setStatusCd(String statusCd) { public void setStatusCd(String statusCd) { this.statusCd = statusCd; } public String getReadingId() { public String getReadingId() { return readingId; } public void setReadingId(String readingId) { public void setReadingId(String readingId) { this.readingId = readingId; } public String getTitle() { public String getTitle() { return title; } public void setTitle(String title) { public void setTitle(String title) { this.title = title; } public String getCurReadingTime() { public String getCurReadingTime() { return curReadingTime; } public void setCurReadingTime(String curReadingTime) { public void setCurReadingTime(String curReadingTime) { this.curReadingTime = curReadingTime; } public String getCreateStaffName() { public String getCreateStaffName() { return createStaffName; } public void setCreateStaffName(String createStaffName) { public void setCreateStaffName(String createStaffName) { this.createStaffName = createStaffName; } public String getCurDegrees() { public String getCurDegrees() { return curDegrees; } public void setCurDegrees(String curDegrees) { public void setCurDegrees(String curDegrees) { this.curDegrees = curDegrees; } public String getPreDegrees() { public String getPreDegrees() { return preDegrees; } public void setPreDegrees(String preDegrees) { public void setPreDegrees(String preDegrees) { this.preDegrees = preDegrees; } public String getAuditStaffName() { public String getAuditStaffName() { return auditStaffName; } public void setAuditStaffName(String auditStaffName) { public void setAuditStaffName(String auditStaffName) { this.auditStaffName = auditStaffName; } public String getPreReadingTime() { public String getPreReadingTime() { return preReadingTime; } public void setPreReadingTime(String preReadingTime) { public void setPreReadingTime(String preReadingTime) { this.preReadingTime = preReadingTime; } public String getState() { public String getState() { return state; } public void setState(String state) { public void setState(String state) { this.state = state; } public String getCommunityId() { public String getCommunityId() { return communityId; } public void setCommunityId(String communityId) { public void setCommunityId(String communityId) { this.communityId = communityId; } public String getStatsMsg() { return statsMsg; } public void setStatsMsg(String statsMsg) { this.statsMsg = statsMsg; } public String getShareMsg() { return shareMsg; } public void setShareMsg(String shareMsg) { this.shareMsg = shareMsg; } } java110-db/src/main/resources/mapper/fee/FloorShareFeeV1ServiceDaoImplMapper.xml
New file @@ -0,0 +1,158 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="floorShareFeeV1ServiceDaoImpl"> <!-- 保存公摊费用信息 add by wuxw 2018-07-03 --> <insert id="saveFloorShareFeeInfo" parameterType="Map"> insert into floor_share_fee( amount,owner_name,fsf_id,fsm_id,fee_name,remark,reading_id,fee_id,room_name,degrees ) values ( #{amount},#{ownerName},#{fsfId},#{fsmId},#{feeName},#{remark},#{readingId},#{feeId},#{roomName},#{degrees} ) </insert> <insert id="saveFloorShareFees" parameterType="Map"> insert into floor_share_fee( amount,owner_name,fsf_id,fsm_id,fee_name,remark,reading_id,fee_id,room_name,degrees ) values <foreach collection="floorShareFeePos" item="item" separator=","> ( #{item.amount},#{item.ownerName},#{item.fsfId},#{item.fsmId},#{item.feeName},#{item.remark},#{item.readingId},#{item.feeId},#{item.roomName},#{item.degrees} ) </foreach> </insert> <!-- 查询公摊费用信息 add by wuxw 2018-07-03 --> <select id="getFloorShareFeeInfo" parameterType="Map" resultType="Map"> select t.amount,t.owner_name ownerName,t.fsf_id fsfId,t.fsm_id fsmId,t.fee_name feeName,t.remark,t.status_cd statusCd,t.reading_id readingId,t.fee_id feeId,t.room_name roomName,t.degrees,t.create_time createTime from floor_share_fee t where 1 =1 <if test="amount !=null and amount != ''"> and t.amount= #{amount} </if> <if test="ownerName !=null and ownerName != ''"> and t.owner_name= #{ownerName} </if> <if test="fsfId !=null and fsfId != ''"> and t.fsf_id= #{fsfId} </if> <if test="fsmId !=null and fsmId != ''"> and t.fsm_id= #{fsmId} </if> <if test="feeName !=null and feeName != ''"> and t.fee_name= #{feeName} </if> <if test="remark !=null and remark != ''"> and t.remark= #{remark} </if> <if test="statusCd !=null and statusCd != ''"> and t.status_cd= #{statusCd} </if> <if test="readingId !=null and readingId != ''"> and t.reading_id= #{readingId} </if> <if test="feeId !=null and feeId != ''"> and t.fee_id= #{feeId} </if> <if test="roomName !=null and roomName != ''"> and t.room_name= #{roomName} </if> <if test="degrees !=null and degrees != ''"> and t.degrees= #{degrees} </if> order by t.create_time desc <if test="page != -1 and page != null "> limit #{page}, #{row} </if> </select> <!-- 修改公摊费用信息 add by wuxw 2018-07-03 --> <update id="updateFloorShareFeeInfo" parameterType="Map"> update floor_share_fee t set t.status_cd = #{statusCd} <if test="newBId != null and newBId != ''"> ,t.b_id = #{newBId} </if> <if test="amount !=null and amount != ''"> , t.amount= #{amount} </if> <if test="ownerName !=null and ownerName != ''"> , t.owner_name= #{ownerName} </if> <if test="fsmId !=null and fsmId != ''"> , t.fsm_id= #{fsmId} </if> <if test="feeName !=null and feeName != ''"> , t.fee_name= #{feeName} </if> <if test="remark !=null and remark != ''"> , t.remark= #{remark} </if> <if test="readingId !=null and readingId != ''"> , t.reading_id= #{readingId} </if> <if test="feeId !=null and feeId != ''"> , t.fee_id= #{feeId} </if> <if test="roomName !=null and roomName != ''"> , t.room_name= #{roomName} </if> <if test="degrees !=null and degrees != ''"> , t.degrees= #{degrees} </if> where 1=1 <if test="fsfId !=null and fsfId != ''"> and t.fsf_id= #{fsfId} </if> </update> <!-- 查询公摊费用数量 add by wuxw 2018-07-03 --> <select id="queryFloorShareFeesCount" parameterType="Map" resultType="Map"> select count(1) count from floor_share_fee t where 1 =1 <if test="amount !=null and amount != ''"> and t.amount= #{amount} </if> <if test="ownerName !=null and ownerName != ''"> and t.owner_name= #{ownerName} </if> <if test="fsfId !=null and fsfId != ''"> and t.fsf_id= #{fsfId} </if> <if test="fsmId !=null and fsmId != ''"> and t.fsm_id= #{fsmId} </if> <if test="feeName !=null and feeName != ''"> and t.fee_name= #{feeName} </if> <if test="remark !=null and remark != ''"> and t.remark= #{remark} </if> <if test="statusCd !=null and statusCd != ''"> and t.status_cd= #{statusCd} </if> <if test="readingId !=null and readingId != ''"> and t.reading_id= #{readingId} </if> <if test="feeId !=null and feeId != ''"> and t.fee_id= #{feeId} </if> <if test="roomName !=null and roomName != ''"> and t.room_name= #{roomName} </if> <if test="degrees !=null and degrees != ''"> and t.degrees= #{degrees} </if> </select> </mapper> java110-db/src/main/resources/mapper/fee/FloorShareMeterV1ServiceDaoImplMapper.xml
@@ -8,9 +8,11 @@ <!-- 保存楼栋公摊表信息 add by wuxw 2018-07-03 --> <insert id="saveFloorShareMeterInfo" parameterType="Map"> insert into floor_share_meter( floor_id,meter_num,meter_type,fsm_id,formula_value,community_id,cur_degree,share_type,floor_num,cur_reading_time floor_id,meter_num,meter_type,fsm_id,formula_value,community_id,cur_degree,share_type,floor_num,cur_reading_time, config_id,config_name,share_price ) values ( #{floorId},#{meterNum},#{meterType},#{fsmId},#{formulaValue},#{communityId},#{curDegree},#{shareType},#{floorNum},#{curReadingTime} #{floorId},#{meterNum},#{meterType},#{fsmId},#{formulaValue},#{communityId},#{curDegree},#{shareType},#{floorNum},#{curReadingTime}, #{configId},#{configName},#{sharePrice} ) </insert> @@ -20,7 +22,7 @@ select t.floor_id floorId,t.meter_num meterNum,t.meter_type meterType,t.fsm_id fsmId,t.formula_value formulaValue,t.status_cd statusCd,t.community_id communityId,t.cur_degree curDegree,t.share_type shareType,t.floor_num floorNum,t.cur_reading_time curReadingTime,t.create_time createTime,td.name meterTypeName, td1.name shareTypeName td1.name shareTypeName,t.config_id configId,t.config_name configName,t.share_price sharePrice from floor_share_meter t left join t_dict td on t.meter_type = td.status_cd and td.table_name = 'floor_share_meter' and td.table_columns = 'meter_type' left join t_dict td1 on t.share_type = td1.status_cd and td1.table_name = 'floor_share_meter' and td1.table_columns = 'share_type' @@ -92,6 +94,15 @@ <if test="curReadingTime !=null and curReadingTime != ''"> , t.cur_reading_time= #{curReadingTime} </if> <if test="configId !=null and configId != ''"> , t.config_id= #{configId} </if> <if test="configName !=null and configName != ''"> , t.config_name= #{configName} </if> <if test="sharePrice !=null and sharePrice != ''"> , t.share_price= #{sharePrice} </if> where 1=1 <if test="fsmId !=null and fsmId != ''"> and t.fsm_id= #{fsmId} java110-db/src/main/resources/mapper/fee/FloorShareReadingV1ServiceDaoImplMapper.xml
@@ -8,9 +8,11 @@ <!-- 保存楼栋抄表信息 add by wuxw 2018-07-03 --> <insert id="saveFloorShareReadingInfo" parameterType="Map"> insert into floor_share_reading( fsm_id,remark,reading_id,title,cur_reading_time,create_staff_name,cur_degrees,pre_degrees,audit_staff_name,pre_reading_time,state,community_id fsm_id,remark,reading_id,title,cur_reading_time,create_staff_name,cur_degrees, pre_degrees,audit_staff_name,pre_reading_time,state,community_id ) values ( #{fsmId},#{remark},#{readingId},#{title},#{curReadingTime},#{createStaffName},#{curDegrees},#{preDegrees},#{auditStaffName},#{preReadingTime},#{state},#{communityId} #{fsmId},#{remark},#{readingId},#{title},#{curReadingTime},#{createStaffName}, #{curDegrees},#{preDegrees},#{auditStaffName},#{preReadingTime},#{state},#{communityId} ) </insert> @@ -20,7 +22,7 @@ select t.fsm_id fsmId,t.remark,t.status_cd statusCd,t.reading_id readingId,t.title,t.cur_reading_time curReadingTime,t.create_staff_name createStaffName,t.cur_degrees curDegrees,t.pre_degrees preDegrees,t.audit_staff_name auditStaffName,t.pre_reading_time preReadingTime,t.state,t.community_id communityId,t.create_time createTime communityId,t.create_time createTime,t.state_msg stateMsg,t.share_msg shareMsg from floor_share_reading t where 1 =1 <if test="fsmId !=null and fsmId != ''"> @@ -106,14 +108,20 @@ <if test="state !=null and state != ''"> , t.state= #{state} </if> <if test="communityId !=null and communityId != ''"> , t.community_id= #{communityId} <if test="stateMsg !=null and stateMsg != ''"> , t.state_msg= #{stateMsg} </if> <if test="shareMsg !=null and shareMsg != ''"> , t.share_msg= #{shareMsg} </if> where 1=1 <if test="readingId !=null and readingId != ''"> and t.reading_id= #{readingId} </if> <if test="communityId !=null and communityId != ''"> and t.community_id= #{communityId} </if> </update> <!-- 查询楼栋抄表数量 add by wuxw 2018-07-03 --> java110-interface/src/main/java/com/java110/intf/fee/IFloorShareFeeV1InnerServiceSMO.java
New file @@ -0,0 +1,73 @@ /* * 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.intf.fee; import com.java110.config.feign.FeignConfiguration; import com.java110.dto.floorShareFee.FloorShareFeeDto; import com.java110.po.floorShareFee.FloorShareFeePo; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import java.util.List; /** * 类表述: 服务之前调用的接口类,不对外提供接口能力 只用于接口建调用 * add by 吴学文 at 2025-03-26 16:25:43 mail: 928255095@qq.com * open source address: https://gitee.com/wuxw7/MicroCommunity * 官网:http://www.homecommunity.cn * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行 */ @FeignClient(name = "fee-service", configuration = {FeignConfiguration.class}) @RequestMapping("/floorShareFeeV1Api") public interface IFloorShareFeeV1InnerServiceSMO { @RequestMapping(value = "/saveFloorShareFee", method = RequestMethod.POST) public int saveFloorShareFee(@RequestBody FloorShareFeePo floorShareFeePo); @RequestMapping(value = "/saveFloorShareFees", method = RequestMethod.POST) int saveFloorShareFees(@RequestBody List<FloorShareFeePo> floorShareFeePos); @RequestMapping(value = "/updateFloorShareFee", method = RequestMethod.POST) public int updateFloorShareFee(@RequestBody FloorShareFeePo floorShareFeePo); @RequestMapping(value = "/deleteFloorShareFee", method = RequestMethod.POST) public int deleteFloorShareFee(@RequestBody FloorShareFeePo floorShareFeePo); /** * <p>查询小区楼信息</p> * * * @param floorShareFeeDto 数据对象分享 * @return FloorShareFeeDto 对象数据 */ @RequestMapping(value = "/queryFloorShareFees", method = RequestMethod.POST) List<FloorShareFeeDto> queryFloorShareFees(@RequestBody FloorShareFeeDto floorShareFeeDto); /** * 查询<p>小区楼</p>总记录数 * * @param floorShareFeeDto 数据对象分享 * @return 小区下的小区楼记录数 */ @RequestMapping(value = "/queryFloorShareFeesCount", method = RequestMethod.POST) int queryFloorShareFeesCount(@RequestBody FloorShareFeeDto floorShareFeeDto); } service-fee/src/main/java/com/java110/fee/cmd/meter/AuditFloorShareReadingCmd.java
@@ -18,18 +18,27 @@ 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.dto.data.DatabusDataDto; import com.java110.dto.floorShareReading.FloorShareReadingDto; import com.java110.intf.fee.IFloorShareMeterV1InnerServiceSMO; import com.java110.intf.fee.IFloorShareReadingV1InnerServiceSMO; import com.java110.intf.job.IDataBusInnerServiceSMO; import com.java110.po.floorShareMeter.FloorShareMeterPo; import com.java110.po.floorShareReading.FloorShareReadingPo; 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.vo.ResultVo; import org.springframework.beans.factory.annotation.Autowired; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List; /** @@ -51,10 +60,17 @@ @Autowired private IFloorShareReadingV1InnerServiceSMO floorShareReadingV1InnerServiceSMOImpl; @Autowired private IFloorShareMeterV1InnerServiceSMO floorShareMeterV1InnerServiceSMOImpl; @Autowired private IDataBusInnerServiceSMO dataBusInnerServiceSMOImpl; @Override public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { Assert.hasKeyAndValue(reqJson, "readingId", "readingId不能为空"); Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空"); Assert.hasKeyAndValue(reqJson, "state", "审核状态不能为空"); super.validateProperty(cmdDataFlowContext); } @@ -62,13 +78,43 @@ @Java110Transactional public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { FloorShareReadingPo floorShareReadingPo = BeanConvertUtil.covertBean(reqJson, FloorShareReadingPo.class); String userId = CmdContextUtils.getUserId(cmdDataFlowContext); FloorShareReadingDto floorShareReadingDto = new FloorShareReadingDto(); floorShareReadingDto.setReadingId(reqJson.getString("readingId")); floorShareReadingDto.setCommunityId(reqJson.getString("communityId")); List<FloorShareReadingDto> floorShareReadingDtos = floorShareReadingV1InnerServiceSMOImpl.queryFloorShareReadings(floorShareReadingDto); if (ListUtil.isNull(floorShareReadingDtos)) { throw new CmdException("记录不存在"); } String state = reqJson.getString("state"); FloorShareReadingPo floorShareReadingPo = new FloorShareReadingPo(); floorShareReadingPo.setReadingId(reqJson.getString("readingId")); floorShareReadingPo.setState(state); floorShareReadingPo.setStatsMsg("审核意见:" + reqJson.getString("auditRemark")); int flag = floorShareReadingV1InnerServiceSMOImpl.updateFloorShareReading(floorShareReadingPo); if (flag < 1) { throw new CmdException("更新数据失败"); } cmdDataFlowContext.setResponseEntity(ResultVo.success()); //todo if (FloorShareReadingDto.STATE_F.equals(state)) { FloorShareMeterPo floorShareMeterPo = new FloorShareMeterPo(); floorShareMeterPo.setFsmId(floorShareReadingDtos.get(0).getFsmId()); floorShareMeterPo.setCurReadingTime(floorShareReadingDtos.get(0).getPreReadingTime()); floorShareMeterPo.setCurDegree(floorShareReadingDtos.get(0).getPreDegrees()); floorShareMeterPo.setCommunityId(floorShareReadingDtos.get(0).getCommunityId()); floorShareMeterV1InnerServiceSMOImpl.updateFloorShareMeter(floorShareMeterPo); return ; } reqJson.put("staffId",userId); dataBusInnerServiceSMOImpl.databusData(new DatabusDataDto(DatabusDataDto.BUSINESS_TYPE_SHARE_READING, reqJson)); } } service-fee/src/main/java/com/java110/fee/cmd/meter/ListFloorShareFeeCmd.java
New file @@ -0,0 +1,85 @@ /* * 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.fee.cmd.meter; import com.alibaba.fastjson.JSONObject; import com.java110.core.annotation.Java110Cmd; import com.java110.core.context.ICmdDataFlowContext; import com.java110.core.event.cmd.Cmd; import com.java110.core.event.cmd.CmdEvent; import com.java110.intf.fee.IFloorShareFeeV1InnerServiceSMO; import com.java110.utils.exception.CmdException; import com.java110.utils.util.Assert; import com.java110.utils.util.BeanConvertUtil; import com.java110.vo.ResultVo; import org.springframework.beans.factory.annotation.Autowired; import com.java110.dto.floorShareFee.FloorShareFeeDto; import java.util.List; import java.util.ArrayList; import org.springframework.http.ResponseEntity; import org.springframework.http.HttpStatus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * 类表述:查询 * 服务编码:floorShareFee.listFloorShareFee * 请求路劲:/app/floorShareFee.ListFloorShareFee * add by 吴学文 at 2025-03-26 16:25:43 mail: 928255095@qq.com * open source address: https://gitee.com/wuxw7/MicroCommunity * 官网:http://www.homecommunity.cn * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行 */ @Java110Cmd(serviceCode = "meter.listFloorShareFee") public class ListFloorShareFeeCmd extends Cmd { private static Logger logger = LoggerFactory.getLogger(ListFloorShareFeeCmd.class); @Autowired private IFloorShareFeeV1InnerServiceSMO floorShareFeeV1InnerServiceSMOImpl; @Override public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { super.validatePageInfo(reqJson); Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空"); super.validateProperty(cmdDataFlowContext); } @Override public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { FloorShareFeeDto floorShareFeeDto = BeanConvertUtil.covertBean(reqJson, FloorShareFeeDto.class); int count = floorShareFeeV1InnerServiceSMOImpl.queryFloorShareFeesCount(floorShareFeeDto); List<FloorShareFeeDto> floorShareFeeDtos = null; if (count > 0) { floorShareFeeDtos = floorShareFeeV1InnerServiceSMOImpl.queryFloorShareFees(floorShareFeeDto); } else { floorShareFeeDtos = new ArrayList<>(); } ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, floorShareFeeDtos); ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); cmdDataFlowContext.setResponseEntity(responseEntity); } } service-fee/src/main/java/com/java110/fee/cmd/meter/SaveFloorShareMeterCmd.java
@@ -22,9 +22,11 @@ import com.java110.core.event.cmd.Cmd; import com.java110.core.event.cmd.CmdEvent; import com.java110.core.factory.GenerateCodeFactory; import com.java110.dto.fee.FeeConfigDto; import com.java110.dto.floor.FloorDto; import com.java110.dto.floorShareMeter.FloorShareMeterDto; import com.java110.intf.community.IFloorInnerServiceSMO; import com.java110.intf.fee.IFeeConfigInnerServiceSMO; import com.java110.intf.fee.IFloorShareMeterV1InnerServiceSMO; import com.java110.po.floorShareMeter.FloorShareMeterPo; import com.java110.utils.exception.CmdException; @@ -61,12 +63,17 @@ @Autowired private IFloorInnerServiceSMO floorInnerServiceSMOImpl; @Autowired private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl; @Override public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { Assert.hasKeyAndValue(reqJson, "floorId", "请求报文中未包含floorId"); Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId"); Assert.hasKeyAndValue(reqJson, "meterType", "请求报文中未包含meterType"); Assert.hasKeyAndValue(reqJson, "shareType", "请求报文中未包含shareType"); Assert.hasKeyAndValue(reqJson, "configId", "请求报文中未包含费用项"); Assert.hasKeyAndValue(reqJson, "sharePrice", "请求报文中未包含公摊单价"); super.validateProperty(cmdDataFlowContext); } @@ -74,6 +81,12 @@ @Override @Java110Transactional public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { FeeConfigDto feeConfigDto = new FeeConfigDto(); feeConfigDto.setConfigId(reqJson.getString("configId")); List<FeeConfigDto> feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto); Assert.listOnlyOne(feeConfigDtos, "未包含费用项"); FloorDto floorDto = new FloorDto(); floorDto.setFloorId(reqJson.getString("floorId")); @@ -87,6 +100,7 @@ floorShareMeterPo.setCurDegree("0"); floorShareMeterPo.setCurReadingTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); floorShareMeterPo.setFloorNum(floorDtos.get(0).getFloorNum()); floorShareMeterPo.setConfigName(feeConfigDtos.get(0).getFeeName()); int flag = floorShareMeterV1InnerServiceSMOImpl.saveFloorShareMeter(floorShareMeterPo); if (flag < 1) { service-fee/src/main/java/com/java110/fee/cmd/meter/UpdateFloorShareMeterCmd.java
@@ -21,6 +21,8 @@ import com.java110.core.context.ICmdDataFlowContext; import com.java110.core.event.cmd.Cmd; import com.java110.core.event.cmd.CmdEvent; import com.java110.dto.fee.FeeConfigDto; import com.java110.intf.fee.IFeeConfigInnerServiceSMO; import com.java110.intf.fee.IFloorShareMeterV1InnerServiceSMO; import com.java110.po.floorShareMeter.FloorShareMeterPo; import com.java110.utils.exception.CmdException; @@ -30,6 +32,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List; /** @@ -51,10 +55,15 @@ @Autowired private IFloorShareMeterV1InnerServiceSMO floorShareMeterV1InnerServiceSMOImpl; @Autowired private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl; @Override public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { Assert.hasKeyAndValue(reqJson, "fsmId", "fsmId不能为空"); Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空"); Assert.hasKeyAndValue(reqJson, "configId", "请求报文中未包含费用项"); Assert.hasKeyAndValue(reqJson, "sharePrice", "请求报文中未包含公摊单价"); super.validateProperty(cmdDataFlowContext); } @@ -62,8 +71,13 @@ @Override @Java110Transactional public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { FeeConfigDto feeConfigDto = new FeeConfigDto(); feeConfigDto.setConfigId(reqJson.getString("configId")); List<FeeConfigDto> feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto); Assert.listOnlyOne(feeConfigDtos, "未包含费用项"); FloorShareMeterPo floorShareMeterPo = BeanConvertUtil.covertBean(reqJson, FloorShareMeterPo.class); floorShareMeterPo.setConfigName(feeConfigDtos.get(0).getFeeName()); int flag = floorShareMeterV1InnerServiceSMOImpl.updateFloorShareMeter(floorShareMeterPo); if (flag < 1) { service-fee/src/main/java/com/java110/fee/dao/IFloorShareFeeV1ServiceDao.java
New file @@ -0,0 +1,76 @@ /* * 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.fee.dao; import com.java110.utils.exception.DAOException; import java.util.List; import java.util.Map; /** * 类表述: * add by 吴学文 at 2025-03-26 16:25:43 mail: 928255095@qq.com * open source address: https://gitee.com/wuxw7/MicroCommunity * 官网:http://www.homecommunity.cn * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行 */ public interface IFloorShareFeeV1ServiceDao { /** * 保存 公摊费用信息 * @param info * @throws DAOException DAO异常 */ int saveFloorShareFeeInfo(Map info) throws DAOException; int saveFloorShareFees(Map info); /** * 查询公摊费用信息(instance过程) * 根据bId 查询公摊费用信息 * @param info bId 信息 * @return 公摊费用信息 * @throws DAOException DAO异常 */ List<Map> getFloorShareFeeInfo(Map info) throws DAOException; /** * 修改公摊费用信息 * @param info 修改信息 * @throws DAOException DAO异常 */ int updateFloorShareFeeInfo(Map info) throws DAOException; /** * 查询公摊费用总数 * * @param info 公摊费用信息 * @return 公摊费用数量 */ int queryFloorShareFeesCount(Map info); } service-fee/src/main/java/com/java110/fee/dao/impl/FloorShareFeeV1ServiceDaoImpl.java
New file @@ -0,0 +1,121 @@ /* * 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.fee.dao.impl; import com.alibaba.fastjson.JSONObject; import com.java110.utils.constant.ResponseConstant; import com.java110.utils.exception.DAOException; import com.java110.utils.util.DateUtil; import com.java110.core.base.dao.BaseServiceDao; import com.java110.fee.dao.IFloorShareFeeV1ServiceDao; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; /** * 类表述: * add by 吴学文 at 2025-03-26 16:25:43 mail: 928255095@qq.com * open source address: https://gitee.com/wuxw7/MicroCommunity * 官网:http://www.homecommunity.cn * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行 */ @Service("floorShareFeeV1ServiceDaoImpl") public class FloorShareFeeV1ServiceDaoImpl extends BaseServiceDao implements IFloorShareFeeV1ServiceDao { private static Logger logger = LoggerFactory.getLogger(FloorShareFeeV1ServiceDaoImpl.class); /** * 保存公摊费用信息 到 instance * @param info bId 信息 * @throws DAOException DAO异常 */ @Override public int saveFloorShareFeeInfo(Map info) throws DAOException { logger.debug("保存 saveFloorShareFeeInfo 入参 info : {}",info); int saveFlag = sqlSessionTemplate.insert("floorShareFeeV1ServiceDaoImpl.saveFloorShareFeeInfo",info); return saveFlag; } @Override public int saveFloorShareFees(Map info) { logger.debug("保存 saveFloorShareFees 入参 info : {}",info); int saveFlag = sqlSessionTemplate.insert("floorShareFeeV1ServiceDaoImpl.saveFloorShareFees",info); return saveFlag; } /** * 查询公摊费用信息(instance) * @param info bId 信息 * @return List<Map> * @throws DAOException DAO异常 */ @Override public List<Map> getFloorShareFeeInfo(Map info) throws DAOException { logger.debug("查询 getFloorShareFeeInfo 入参 info : {}",info); List<Map> infos = sqlSessionTemplate.selectList("floorShareFeeV1ServiceDaoImpl.getFloorShareFeeInfo",info); return infos; } /** * 修改公摊费用信息 * @param info 修改信息 * @throws DAOException DAO异常 */ @Override public int updateFloorShareFeeInfo(Map info) throws DAOException { logger.debug("修改 updateFloorShareFeeInfo 入参 info : {}",info); int saveFlag = sqlSessionTemplate.update("floorShareFeeV1ServiceDaoImpl.updateFloorShareFeeInfo",info); return saveFlag; } /** * 查询公摊费用数量 * @param info 公摊费用信息 * @return 公摊费用数量 */ @Override public int queryFloorShareFeesCount(Map info) { logger.debug("查询 queryFloorShareFeesCount 入参 info : {}",info); List<Map> infos = sqlSessionTemplate.selectList("floorShareFeeV1ServiceDaoImpl.queryFloorShareFeesCount", info); if (infos.size() < 1) { return 0; } return Integer.parseInt(infos.get(0).get("count").toString()); } } service-fee/src/main/java/com/java110/fee/smo/impl/FloorShareFeeV1InnerServiceSMOImpl.java
New file @@ -0,0 +1,104 @@ /* * 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.fee.smo.impl; import com.java110.fee.dao.IFloorShareFeeV1ServiceDao; import com.java110.intf.fee.IFloorShareFeeV1InnerServiceSMO; import com.java110.dto.floorShareFee.FloorShareFeeDto; import com.java110.po.fee.PayFeePo; import com.java110.po.floorShareFee.FloorShareFeePo; import com.java110.utils.util.BeanConvertUtil; import com.java110.core.base.smo.BaseServiceSMO; import com.java110.dto.user.UserDto; import com.java110.dto.PageDto; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * 类表述: 服务之前调用的接口实现类,不对外提供接口能力 只用于接口建调用 * add by 吴学文 at 2025-03-26 16:25:43 mail: 928255095@qq.com * open source address: https://gitee.com/wuxw7/MicroCommunity * 官网:http://www.homecommunity.cn * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行 */ @RestController public class FloorShareFeeV1InnerServiceSMOImpl extends BaseServiceSMO implements IFloorShareFeeV1InnerServiceSMO { @Autowired private IFloorShareFeeV1ServiceDao floorShareFeeV1ServiceDaoImpl; @Override public int saveFloorShareFee(@RequestBody FloorShareFeePo floorShareFeePo) { int saveFlag = floorShareFeeV1ServiceDaoImpl.saveFloorShareFeeInfo(BeanConvertUtil.beanCovertMap(floorShareFeePo)); return saveFlag; } @Override public int saveFloorShareFees(@RequestBody List<FloorShareFeePo> floorShareFeePos) { List<Map> fees = new ArrayList<>(); for (FloorShareFeePo payFeePo : floorShareFeePos) { fees.add(BeanConvertUtil.beanCovertMap(payFeePo)); } Map info = new HashMap(); info.put("floorShareFeePos", fees); return floorShareFeeV1ServiceDaoImpl.saveFloorShareFees(info); } @Override public int updateFloorShareFee(@RequestBody FloorShareFeePo floorShareFeePo) { int saveFlag = floorShareFeeV1ServiceDaoImpl.updateFloorShareFeeInfo(BeanConvertUtil.beanCovertMap(floorShareFeePo)); return saveFlag; } @Override public int deleteFloorShareFee(@RequestBody FloorShareFeePo floorShareFeePo) { floorShareFeePo.setStatusCd("1"); int saveFlag = floorShareFeeV1ServiceDaoImpl.updateFloorShareFeeInfo(BeanConvertUtil.beanCovertMap(floorShareFeePo)); return saveFlag; } @Override public List<FloorShareFeeDto> queryFloorShareFees(@RequestBody FloorShareFeeDto floorShareFeeDto) { //校验是否传了 分页信息 int page = floorShareFeeDto.getPage(); if (page != PageDto.DEFAULT_PAGE) { floorShareFeeDto.setPage((page - 1) * floorShareFeeDto.getRow()); } List<FloorShareFeeDto> floorShareFees = BeanConvertUtil.covertBeanList(floorShareFeeV1ServiceDaoImpl.getFloorShareFeeInfo(BeanConvertUtil.beanCovertMap(floorShareFeeDto)), FloorShareFeeDto.class); return floorShareFees; } @Override public int queryFloorShareFeesCount(@RequestBody FloorShareFeeDto floorShareFeeDto) { return floorShareFeeV1ServiceDaoImpl.queryFloorShareFeesCount(BeanConvertUtil.beanCovertMap(floorShareFeeDto)); } } service-job/src/main/java/com/java110/job/adapt/fee/FloorShareReadingAdapt.java
New file @@ -0,0 +1,375 @@ package com.java110.job.adapt.fee; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.java110.core.factory.GenerateCodeFactory; import com.java110.dto.community.CommunityDto; import com.java110.dto.fee.FeeAttrDto; import com.java110.dto.fee.FeeConfigDto; import com.java110.dto.fee.FeeDto; import com.java110.dto.floorShareMeter.FloorShareMeterDto; import com.java110.dto.floorShareReading.FloorShareReadingDto; import com.java110.dto.oweFeeCallable.OweFeeCallableDto; import com.java110.dto.owner.OwnerAppUserDto; import com.java110.dto.owner.OwnerDto; import com.java110.dto.payFee.PayFeeBatchDto; import com.java110.dto.reportFee.ReportOweFeeDto; import com.java110.dto.room.RoomDto; import com.java110.dto.system.Business; import com.java110.dto.user.UserDto; import com.java110.intf.community.ICommunityInnerServiceSMO; import com.java110.intf.community.IRoomInnerServiceSMO; import com.java110.intf.community.IRoomV1InnerServiceSMO; import com.java110.intf.fee.*; import com.java110.intf.report.IReportOweFeeInnerServiceSMO; import com.java110.intf.user.*; import com.java110.job.adapt.DatabusAdaptImpl; import com.java110.job.msgNotify.MsgNotifyFactory; import com.java110.po.fee.FeeAttrPo; import com.java110.po.fee.PayFeePo; import com.java110.po.floorShareFee.FloorShareFeePo; import com.java110.po.floorShareMeter.FloorShareMeterPo; import com.java110.po.floorShareReading.FloorShareReadingPo; import com.java110.po.importFee.ImportFeeDetailPo; import com.java110.po.importFee.ImportFeePo; import com.java110.po.oweFeeCallable.OweFeeCallablePo; import com.java110.po.payFee.PayFeeBatchPo; import com.java110.utils.cache.MappingCache; import com.java110.utils.cache.UrlCache; import com.java110.utils.constant.WechatConstant; import com.java110.utils.exception.CmdException; 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.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import java.math.BigDecimal; import java.text.ParseException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * 楼栋费用公摊databus */ @Component(value = "floorShareReadingAdapt") public class FloorShareReadingAdapt extends DatabusAdaptImpl { @Autowired private IFloorShareReadingV1InnerServiceSMO floorShareReadingV1InnerServiceSMOImpl; @Autowired private IFloorShareMeterV1InnerServiceSMO floorShareMeterV1InnerServiceSMOImpl; @Autowired private IFloorShareFeeV1InnerServiceSMO floorShareFeeV1InnerServiceSMOImpl; @Autowired private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl; @Autowired private IPayFeeBatchV1InnerServiceSMO payFeeBatchV1InnerServiceSMOImpl; @Autowired private IRoomInnerServiceSMO roomInnerServiceSMOImpl; @Autowired private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl; @Autowired private IFeeInnerServiceSMO feeInnerServiceSMOImpl; @Autowired private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl; @Autowired private IFeeAttrInnerServiceSMO feeAttrInnerServiceSMOImpl; @Autowired private ICommunityInnerServiceSMO communityInnerServiceSMOImpl; @Override public void execute(Business business, List<Business> businesses) throws ParseException { JSONObject data = business.getData(); Assert.hasKeyAndValue(data, "readingId", "未包含抄表记录"); FloorShareReadingDto floorShareReadingDto = new FloorShareReadingDto(); floorShareReadingDto.setReadingId(data.getString("readingId")); List<FloorShareReadingDto> floorShareReadingDtos = floorShareReadingV1InnerServiceSMOImpl.queryFloorShareReadings(floorShareReadingDto); Assert.listOnlyOne(floorShareReadingDtos, "未查询到抄表记录"); FloorShareMeterDto floorShareMeterDto = new FloorShareMeterDto(); floorShareMeterDto.setFsmId(floorShareReadingDtos.get(0).getFsmId()); floorShareMeterDto.setCommunityId(floorShareReadingDtos.get(0).getCommunityId()); List<FloorShareMeterDto> floorShareMeterDtos = floorShareMeterV1InnerServiceSMOImpl.queryFloorShareMeters(floorShareMeterDto); if (ListUtil.isNull(floorShareMeterDtos)) { modifyShareMsg(floorShareReadingDtos.get(0), "未包含公摊表"); return; } RoomDto roomDto = new RoomDto(); roomDto.setCommunityId(floorShareReadingDtos.get(0).getCommunityId()); roomDto.setFloorId(floorShareMeterDtos.get(0).getFloorId()); roomDto.setStates(new String[]{ RoomDto.STATE_SELL, RoomDto.STATE_DELIVERY,//已交房 RoomDto.STATE_NO_HOME,//未入住 RoomDto.STATE_RENOVATION,//已装修 RoomDto.STATE_SHOP_FIRE,//已出租 RoomDto.STATE_SHOP_SELL,//已售 RoomDto.STATE_SHOP_FREE,//空闲 RoomDto.STATE_SHOP_REPAIR//装修中 }); List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto); if (ListUtil.isNull(roomDtos)) { modifyShareMsg(floorShareReadingDtos.get(0), "楼栋下没有房屋"); return; } //房屋刷入业主信息 List<String> roomIds = new ArrayList<>(); for (RoomDto tmpRoomDto : roomDtos) { roomIds.add(tmpRoomDto.getRoomId()); } OwnerDto ownerDto = new OwnerDto(); ownerDto.setCommunityId(roomDtos.get(0).getCommunityId()); ownerDto.setRoomIds(roomIds.toArray(new String[roomIds.size()])); List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnersByRoom(ownerDto); for (RoomDto tmpRoomDto : roomDtos) { for (OwnerDto tmpOwnerDto : ownerDtos) { if (tmpRoomDto.getRoomId().equals(tmpOwnerDto.getRoomId())) { tmpRoomDto.setOwnerId(tmpOwnerDto.getOwnerId()); tmpRoomDto.setOwnerName(tmpOwnerDto.getName()); tmpRoomDto.setLink(tmpOwnerDto.getLink()); } } } FeeConfigDto feeConfigDto = new FeeConfigDto(); feeConfigDto.setConfigId(floorShareMeterDtos.get(0).getConfigId()); feeConfigDto.setCommunityId(floorShareMeterDtos.get(0).getCommunityId()); List<FeeConfigDto> feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto); if (ListUtil.isNull(feeConfigDtos)) { modifyShareMsg(floorShareReadingDtos.get(0), "费用项不存在"); return; } PayFeeBatchPo payFeeBatchPo = new PayFeeBatchPo(); payFeeBatchPo.setBatchId(GenerateCodeFactory.getGeneratorId("12")); payFeeBatchPo.setCommunityId(floorShareReadingDtos.get(0).getCommunityId()); payFeeBatchPo.setCreateUserId(data.getString("staffId")); UserDto userDto = new UserDto(); userDto.setUserId(data.getString("staffId")); List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto); Assert.listOnlyOne(userDtos, "用户不存在"); payFeeBatchPo.setCreateUserName(userDtos.get(0).getUserName()); payFeeBatchPo.setState(PayFeeBatchDto.STATE_NORMAL); payFeeBatchPo.setMsg("正常"); int flag = payFeeBatchV1InnerServiceSMOImpl.savePayFeeBatch(payFeeBatchPo); if (flag < 1) { modifyShareMsg(floorShareReadingDtos.get(0), "生成批次失败"); return; } String batchId = payFeeBatchPo.getBatchId(); sharingFeeToRoom(floorShareMeterDtos.get(0), roomDtos, feeConfigDtos.get(0), floorShareReadingDtos.get(0), batchId); } private void sharingFeeToRoom(FloorShareMeterDto floorShareMeterDto, List<RoomDto> roomDtos, FeeConfigDto feeConfigDto, FloorShareReadingDto floorShareReadingDto, String batchId) { List<PayFeePo> payFeePos = new ArrayList<>(); List<FeeAttrPo> feeAttrPos = new ArrayList<>(); List<FloorShareFeePo> floorShareFeePos = new ArrayList<>(); double roomDegree = 0.00; for (RoomDto roomDto : roomDtos) { // todo 计算房屋公摊度数 roomDegree = computeRoomDegree(roomDtos, roomDto, floorShareMeterDto, floorShareReadingDto); doSharingFeeToRoom(floorShareMeterDto, floorShareReadingDto, roomDto, roomDegree, payFeePos, feeConfigDto, feeAttrPos, floorShareFeePos); } CommunityDto communityDto = new CommunityDto(); communityDto.setCommunityId(floorShareMeterDto.getCommunityId()); List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto); Assert.listOnlyOne(communityDtos, "未找到小区信息"); for (PayFeePo payFeePo : payFeePos) { payFeePo.setBatchId(batchId); payFeePo.setIncomeObjId(communityDtos.get(0).getStoreId()); } feeInnerServiceSMOImpl.saveFee(payFeePos); feeAttrInnerServiceSMOImpl.saveFeeAttrs(feeAttrPos); floorShareFeeV1InnerServiceSMOImpl.saveFloorShareFees(floorShareFeePos); } private double computeRoomDegree(List<RoomDto> roomDtos, RoomDto curRoomDto, FloorShareMeterDto floorShareMeterDto, FloorShareReadingDto floorShareReadingDto) { BigDecimal totalDegree = new BigDecimal(floorShareReadingDto.getCurDegrees()); totalDegree = totalDegree.subtract(new BigDecimal(floorShareReadingDto.getPreDegrees())); if (FloorShareMeterDto.SHARE_TYPE_ROOM_COUNT.equals(floorShareMeterDto.getShareType())) { // 按户公摊 totalDegree = totalDegree.divide(new BigDecimal(roomDtos.size() + ""), 4, BigDecimal.ROUND_HALF_UP); return totalDegree.doubleValue(); } else if (FloorShareMeterDto.SHARE_TYPE_ROOM_AREA.equals(floorShareMeterDto.getShareType())) { //按面积公摊 BigDecimal totalRoomArea = new BigDecimal("0"); for (RoomDto roomDto : roomDtos) { totalRoomArea = totalRoomArea.add(new BigDecimal(roomDto.getBuiltUpArea())); } totalDegree = totalDegree.divide(totalRoomArea, 4, BigDecimal.ROUND_HALF_UP); totalDegree = totalDegree.multiply(new BigDecimal(curRoomDto.getBuiltUpArea())).setScale(4, BigDecimal.ROUND_HALF_UP); return totalDegree.doubleValue(); } return 0.00; } private void doSharingFeeToRoom(FloorShareMeterDto floorShareMeterDto, FloorShareReadingDto floorShareReadingDto, RoomDto roomDto, double roomDegree, List<PayFeePo> payFeePos, FeeConfigDto feeConfigDto, List<FeeAttrPo> feeAttrPos, List<FloorShareFeePo> floorShareFeePos) { // todo 收费金额 double roomAmount = new BigDecimal(roomDegree) .multiply(new BigDecimal(floorShareMeterDto.getSharePrice())) .setScale(2, BigDecimal.ROUND_HALF_UP) .doubleValue(); PayFeePo payFeePo = new PayFeePo(); payFeePo.setFeeId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_feeId)); payFeePo.setEndTime(floorShareReadingDto.getPreReadingTime()); payFeePo.setState(FeeDto.STATE_DOING); payFeePo.setCommunityId(floorShareMeterDto.getCommunityId()); payFeePo.setConfigId(feeConfigDto.getConfigId()); payFeePo.setPayerObjId(roomDto.getRoomId()); payFeePo.setPayerObjType(FeeDto.PAYER_OBJ_TYPE_ROOM); payFeePo.setUserId("-1"); payFeePo.setFeeTypeCd(feeConfigDto.getFeeTypeCd()); payFeePo.setFeeFlag(FeeDto.FEE_FLAG_ONCE); payFeePo.setAmount(roomAmount + ""); //payFeePo.setStartTime(importRoomFee.getStartTime()); payFeePo.setStartTime(floorShareReadingDto.getPreReadingTime()); payFeePos.add(payFeePo); // 导入费用名称 FeeAttrPo feeAttrPo = new FeeAttrPo(); feeAttrPo.setCommunityId(floorShareMeterDto.getCommunityId()); feeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); feeAttrPo.setSpecCd(FeeAttrDto.SPEC_CD_PAY_OBJECT_NAME); feeAttrPo.setValue(roomDto.getRoomName()); feeAttrPo.setFeeId(payFeePo.getFeeId()); feeAttrPos.add(feeAttrPo); // 公摊用量 feeAttrPo = new FeeAttrPo(); feeAttrPo.setCommunityId(floorShareMeterDto.getCommunityId()); feeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); feeAttrPo.setSpecCd(FeeAttrDto.SPEC_CD_SHARE_DEGREES); feeAttrPo.setValue(roomDegree + ""); feeAttrPo.setFeeId(payFeePo.getFeeId()); feeAttrPos.add(feeAttrPo); // 公摊总用量 BigDecimal totalDegree = new BigDecimal(floorShareReadingDto.getCurDegrees()); totalDegree = totalDegree.subtract(new BigDecimal(floorShareReadingDto.getPreDegrees())); feeAttrPo = new FeeAttrPo(); feeAttrPo.setCommunityId(floorShareMeterDto.getCommunityId()); feeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); feeAttrPo.setSpecCd(FeeAttrDto.SPEC_CD_TOTAL_DEGREES); feeAttrPo.setValue(totalDegree.doubleValue() + ""); feeAttrPo.setFeeId(payFeePo.getFeeId()); feeAttrPos.add(feeAttrPo); feeAttrPo = new FeeAttrPo(); feeAttrPo.setCommunityId(floorShareMeterDto.getCommunityId()); feeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); feeAttrPo.setSpecCd(FeeAttrDto.SPEC_CD_ONCE_FEE_DEADLINE_TIME); feeAttrPo.setValue(floorShareReadingDto.getCurReadingTime()); feeAttrPo.setFeeId(payFeePo.getFeeId()); feeAttrPos.add(feeAttrPo); String ownerName = "无"; if (!StringUtil.isEmpty(roomDto.getOwnerId())) { feeAttrPo = new FeeAttrPo(); feeAttrPo.setCommunityId(floorShareMeterDto.getCommunityId()); feeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); feeAttrPo.setSpecCd(FeeAttrDto.SPEC_CD_OWNER_ID); feeAttrPo.setValue(roomDto.getOwnerId()); feeAttrPo.setFeeId(payFeePo.getFeeId()); feeAttrPos.add(feeAttrPo); feeAttrPo = new FeeAttrPo(); feeAttrPo.setCommunityId(floorShareMeterDto.getCommunityId()); feeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); feeAttrPo.setSpecCd(FeeAttrDto.SPEC_CD_OWNER_NAME); feeAttrPo.setValue(roomDto.getOwnerName()); feeAttrPo.setFeeId(payFeePo.getFeeId()); feeAttrPos.add(feeAttrPo); ownerName = roomDto.getOwnerName(); feeAttrPo = new FeeAttrPo(); feeAttrPo.setCommunityId(floorShareMeterDto.getCommunityId()); feeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); feeAttrPo.setSpecCd(FeeAttrDto.SPEC_CD_OWNER_LINK); feeAttrPo.setValue(roomDto.getLink()); feeAttrPo.setFeeId(payFeePo.getFeeId()); feeAttrPos.add(feeAttrPo); } // 公摊公式 feeAttrPo = new FeeAttrPo(); feeAttrPo.setCommunityId(floorShareMeterDto.getCommunityId()); feeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId)); feeAttrPo.setSpecCd(FeeAttrDto.SPEC_CD_SHARE_FORMULA); feeAttrPo.setValue(floorShareMeterDto.getShareTypeName()); feeAttrPo.setFeeId(payFeePo.getFeeId()); feeAttrPos.add(feeAttrPo); FloorShareFeePo floorShareFeePo = new FloorShareFeePo(); floorShareFeePo.setAmount(roomAmount + ""); floorShareFeePo.setOwnerName(ownerName); floorShareFeePo.setFsfId(GenerateCodeFactory.getGeneratorId("11")); floorShareFeePo.setFsmId(floorShareMeterDto.getFsmId()); floorShareFeePo.setFeeName(feeConfigDto.getFeeName()); floorShareFeePo.setRemark(""); floorShareFeePo.setReadingId(floorShareReadingDto.getReadingId()); floorShareFeePo.setFeeId(payFeePo.getFeeId()); floorShareFeePo.setRoomName(roomDto.getRoomName()); floorShareFeePo.setDegrees(roomDegree + ""); floorShareFeePos.add(floorShareFeePo); } private void modifyShareMsg(FloorShareReadingDto floorShareReadingDto, String shareMsg) { FloorShareReadingPo floorShareReadingPo = new FloorShareReadingPo(); floorShareReadingPo.setReadingId(floorShareReadingDto.getReadingId()); floorShareReadingPo.setStatsMsg("公摊进度:" + shareMsg); floorShareReadingV1InnerServiceSMOImpl.updateFloorShareReading(floorShareReadingPo); } }