java110
2023-05-30 a13573d5ef8d16f4bc2535a3c89c2891e6f5b56c
service-report/src/main/java/com/java110/report/cmd/reportFeeMonthStatistics/QueryReportFeeDetailRoomCmd.java
@@ -19,6 +19,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 +39,6 @@
    @Autowired
    private IBaseDataStatistics baseDataStatisticsImpl;
    @Autowired
    private IReportFeeMonthStatisticsInnerServiceSMO reportFeeMonthStatisticsInnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
@@ -115,15 +114,22 @@
            return datas;
        }
        BigDecimal oweFee = new BigDecimal(0.00);
        BigDecimal receivedFee = new BigDecimal(0.00);
        for(int dataIndex = 0; dataIndex < datas.size();dataIndex ++){
            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 = oweFee.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;