java110
2023-06-29 b173d31976fc4731b7c247d4038de92134eba317
service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeDetailRoomCmd.java
@@ -6,10 +6,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.RoomDto;
import com.java110.dto.room.RoomDto;
import com.java110.dto.report.QueryStatisticsDto;
import com.java110.intf.community.IRoomV1InnerServiceSMO;
import com.java110.intf.report.IReportFeeMonthStatisticsInnerServiceSMO;
import com.java110.report.statistics.IBaseDataStatistics;
import com.java110.report.statistics.IFeeStatistics;
import com.java110.utils.exception.CmdException;
@@ -19,6 +17,7 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import java.math.BigDecimal;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
@@ -38,8 +37,6 @@
    @Autowired
    private IBaseDataStatistics baseDataStatisticsImpl;
    @Autowired
    private IReportFeeMonthStatisticsInnerServiceSMO reportFeeMonthStatisticsInnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
@@ -115,15 +112,24 @@
            return datas;
        }
        BigDecimal oweFee = null;
        BigDecimal receivedFee = null;
        for(int dataIndex = 0; dataIndex < datas.size();dataIndex ++){
            oweFee = new BigDecimal(0.00);
            receivedFee = new BigDecimal(0.00);
            data = datas.getJSONObject(dataIndex);
            for(Map info : infos){
                if(!data.get("roomId").toString().equals(info.get("objId"))){
                    continue;
                }
                oweFee = oweFee.add(new BigDecimal(info.get("oweFee").toString()));
                receivedFee = receivedFee.add(new BigDecimal(info.get("receivedFee").toString()));
                data.put("oweFee"+info.get("feeTypeCd").toString(),info.get("oweFee"));
                data.put("receivedFee"+info.get("feeTypeCd").toString(),info.get("receivedFee"));
            }
            data.put("oweFee",oweFee.doubleValue());
            data.put("receivedFee",receivedFee.doubleValue());
        }
        return datas;