| | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.dto.RoomDto; |
| | | 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.feeFormula.FeeFormulaDto; |
| | | import com.java110.fee.bmo.importFee.IFeeSharingBMO; |
| | | import com.java110.intf.fee.IImportFeeDetailInnerServiceSMO; |
| | | import com.java110.intf.community.ICommunityInnerServiceSMO; |
| | | import com.java110.intf.community.IRoomInnerServiceSMO; |
| | | import com.java110.intf.fee.*; |
| | | import com.java110.intf.fee.IFeeAttrInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeConfigInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeFormulaInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeInnerServiceSMO; |
| | | import com.java110.intf.fee.IImportFeeDetailInnerServiceSMO; |
| | | import com.java110.intf.fee.IImportFeeInnerServiceSMO; |
| | | import com.java110.po.fee.FeeAttrPo; |
| | | import com.java110.po.fee.PayFeeConfigPo; |
| | | import com.java110.po.fee.PayFeePo; |
| | |
| | | @Autowired |
| | | private IImportFeeDetailInnerServiceSMO importFeeDetailInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private ICommunityInnerServiceSMO communityInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | |
| | | public ResponseEntity<String> share(JSONObject reqJson) { |
| | | |
| | | |
| | | CommunityDto communityDto = new CommunityDto(); |
| | | communityDto.setCommunityId(reqJson.getString("communityId")); |
| | | List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto); |
| | | |
| | | Assert.listOnlyOne(communityDtos, "未找到小区信息"); |
| | | |
| | | String scope = reqJson.getString("scope"); |
| | | RoomDto roomDto = new RoomDto(); |
| | | if(reqJson.containsKey("roomState") && reqJson.getString("roomState").split(",").length > 0){ |
| | | if (reqJson.containsKey("roomState") && reqJson.getString("roomState").split(",").length > 0) { |
| | | String[] states = reqJson.getString("roomState").split(","); |
| | | roomDto.setStates(states); |
| | | }else{ |
| | | } else { |
| | | roomDto.setState(RoomDto.STATE_SELL); // 已经入住 |
| | | } |
| | | List<RoomDto> roomDtos = null; |
| | |
| | | String formulaValue = deakFormula(feeFormulaDtos.get(0)); |
| | | |
| | | //公摊费用到房屋 |
| | | sharingFeeToRoom(formulaValue, Double.parseDouble(feeFormulaDtos.get(0).getPrice()), roomDtos, reqJson, feeConfigDto); |
| | | sharingFeeToRoom(formulaValue, Double.parseDouble(feeFormulaDtos.get(0).getPrice()), roomDtos, reqJson, feeConfigDto, communityDtos.get(0)); |
| | | |
| | | |
| | | return ResultVo.success(); |
| | |
| | | * @param roomDtos |
| | | */ |
| | | private void sharingFeeToRoom(String formulaValue, double price, List<RoomDto> roomDtos, |
| | | JSONObject reqJson, FeeConfigDto feeConfigDto) { |
| | | JSONObject reqJson, FeeConfigDto feeConfigDto, CommunityDto communityDto) { |
| | | |
| | | |
| | | List<PayFeePo> payFeePos = new ArrayList<>(); |
| | |
| | | Map<String, Integer> floorRooms = new HashMap(); |
| | | Map<String, Integer> unitRooms = new HashMap(); |
| | | for (RoomDto roomDto : roomDtos) { |
| | | doSharingFeeToRoom(formulaValue, price, roomDto, reqJson, payFeePos, feeConfigDto, feeAttrPos, importFeeId, importFeeDetailPos, floorRooms, unitRooms); |
| | | doSharingFeeToRoom(formulaValue, price, roomDto, reqJson, payFeePos, feeConfigDto, feeAttrPos, |
| | | importFeeId, importFeeDetailPos, floorRooms, unitRooms, communityDto); |
| | | } |
| | | |
| | | feeInnerServiceSMOImpl.saveFee(payFeePos); |
| | |
| | | List<FeeAttrPo> feeAttrPos, String importFeeId, |
| | | List<ImportFeeDetailPo> importFeeDetailPos, |
| | | Map<String, Integer> floorRooms, |
| | | Map<String, Integer> unitRooms) { |
| | | Map<String, Integer> unitRooms, |
| | | CommunityDto communityDto) { |
| | | |
| | | if (!floorRooms.containsKey(roomDto.getFloorId())) { |
| | | RoomDto tmpRoomDto = new RoomDto(); |
| | |
| | | long floorRoomCount = floorRooms.get(roomDto.getFloorId()); |
| | | long unitRoomCount = unitRooms.get(roomDto.getUnitId()); |
| | | |
| | | |
| | | String orgFormulaValue = formulaValue; |
| | | formulaValue = formulaValue.replace("T", reqJson.getString("totalDegrees")) |
| | | .replace("F", roomDto.getFloorArea()) |
| | |
| | | .replace("R", roomDto.getBuiltUpArea()) |
| | | .replace("X", roomDto.getFeeCoefficient()) |
| | | .replace("L", floorRoomCount + "") |
| | | .replace("D", unitRoomCount + ""); |
| | | .replace("D", unitRoomCount + "") |
| | | .replace("C", communityDto.getCommunityArea()); |
| | | |
| | | |
| | | ScriptEngineManager manager = new ScriptEngineManager(); |