java110-bean/src/main/java/com/java110/dto/applyRoomDiscount/ApplyRoomDiscountDto.java
@@ -41,6 +41,8 @@ private Date createTime; private String bId; private String statusCd = "0"; public String getApplyType() { @@ -218,4 +220,12 @@ public void setDiscountName(String discountName) { this.discountName = discountName; } public String getbId() { return bId; } public void setbId(String bId) { this.bId = bId; } } java110-bean/src/main/java/com/java110/dto/fee/FeeDto.java
@@ -124,6 +124,9 @@ //查询出的数量 private int count; private String carTypeCd; private String cycle; private double feeTotalPrice; public String getAmount() { return amount; @@ -589,4 +592,28 @@ public void setMwPrice(String mwPrice) { this.mwPrice = mwPrice; } public String getCarTypeCd() { return carTypeCd; } public void setCarTypeCd(String carTypeCd) { this.carTypeCd = carTypeCd; } public String getCycle() { return cycle; } public void setCycle(String cycle) { this.cycle = cycle; } public double getFeeTotalPrice() { return feeTotalPrice; } public void setFeeTotalPrice(double feeTotalPrice) { this.feeTotalPrice = feeTotalPrice; } } java110-bean/src/main/java/com/java110/dto/reportFeeMonthStatistics/ReportFeeMonthStatisticsDto.java
@@ -117,6 +117,8 @@ //状态名称 private String stateName; private String repairId; public String getReceivableAmount() { return receivableAmount; } @@ -572,4 +574,12 @@ public void setStateName(String stateName) { this.stateName = stateName; } public String getRepairId() { return repairId; } public void setRepairId(String repairId) { this.repairId = repairId; } } java110-bean/src/main/java/com/java110/po/applyRoomDiscount/ApplyRoomDiscountPo.java
@@ -26,6 +26,8 @@ //是否可用状态 private String inUse; private String bId; public String getApplyType() { return applyType; } @@ -170,4 +172,12 @@ public void setInUse(String inUse) { this.inUse = inUse; } public String getbId() { return bId; } public void setbId(String bId) { this.bId = bId; } } java110-bean/src/main/java/com/java110/vo/api/fee/ApiFeeDataVo.java
@@ -54,6 +54,8 @@ private String curReadingTime; private String mwPrice; private String carTypeCd; private List<FeeAttrDto> feeAttrs; public String getAmount() { @@ -311,4 +313,12 @@ public void setMwPrice(String mwPrice) { this.mwPrice = mwPrice; } public String getCarTypeCd() { return carTypeCd; } public void setCarTypeCd(String carTypeCd) { this.carTypeCd = carTypeCd; } } java110-core/src/main/java/com/java110/core/smo/IComputeFeeSMO.java
@@ -121,10 +121,10 @@ * * @return */ double getFeePrice(FeeDto feeDto); public Map getFeePrice(FeeDto feeDto); public double getFeePrice(FeeDto feeDto, RoomDto roomDto); public Map getFeePrice(FeeDto feeDto, RoomDto roomDto); /** * 时间差 按天折算 java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java
@@ -158,9 +158,9 @@ } String computingFormula = feeDto.getComputingFormula(); double feePrice = getFeePrice(feeDto); Map feePriceAll = getFeePrice(feeDto); feeDto.setFeePrice(feePrice); feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString())); BigDecimal price = new BigDecimal(feeDto.getFeePrice()); price = price.multiply(new BigDecimal(oweMonth)); feeDto.setFeePrice(price.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); @@ -187,8 +187,8 @@ double oweMonth = (double) targetEndDateAndOweMonth.get("oweMonth"); String computingFormula = feeDto.getComputingFormula(); double feePrice = getFeePrice(feeDto, roomDto); feeDto.setFeePrice(feePrice); Map feePriceAll = getFeePrice(feeDto, roomDto); feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString())); //double month = dayCompare(feeDto.getEndTime(), DateUtil.getCurrentDate()); BigDecimal price = new BigDecimal(feeDto.getFeePrice()); price = price.multiply(new BigDecimal(oweMonth)); @@ -215,8 +215,8 @@ double oweMonth = (double) targetEndDateAndOweMonth.get("oweMonth"); String computingFormula = feeDto.getComputingFormula(); double feePrice = getFeePrice(feeDto, roomDto); feeDto.setFeePrice(feePrice); Map feePriceAll = getFeePrice(feeDto, roomDto); feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString())); //double month = dayCompare(feeDto.getEndTime(), DateUtil.getCurrentDate()); BigDecimal price = new BigDecimal(feeDto.getFeePrice()); price = price.multiply(new BigDecimal(oweMonth)); @@ -881,13 +881,15 @@ } @Override public double getFeePrice(FeeDto feeDto) { public Map getFeePrice(FeeDto feeDto) { return getFeePrice(feeDto, null); } @Override public double getFeePrice(FeeDto feeDto, RoomDto roomDto) { BigDecimal feePrice = new BigDecimal(0.0); public Map getFeePrice(FeeDto feeDto, RoomDto roomDto) { BigDecimal feePrice = new BigDecimal("0.0"); BigDecimal feeTotalPrice = new BigDecimal(0.0); Map<String, Object> feeAmount = new HashMap<>(); if (FeeDto.PAYER_OBJ_TYPE_ROOM.equals(feeDto.getPayerObjType())) { //房屋相关 String computingFormula = feeDto.getComputingFormula(); if (roomDto == null) { @@ -906,20 +908,41 @@ BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDto.getBuiltUpArea())); BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle = new BigDecimal(feeDto.getCycle()); feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("2002".equals(computingFormula)) { // 固定费用 //feePrice = Double.parseDouble(feeDto.getAdditionalAmount()); BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("3003".equals(computingFormula)) { // 固定费用 BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice())); BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDto.getRoomArea())); BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("1101".equals(computingFormula)) { // 租金 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent())); feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("4004".equals(computingFormula)) { //动态费用 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); BigDecimal amount = new BigDecimal(feeDto.getAmount()); feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("5005".equals(computingFormula)) { //(本期度数-上期度数)*单价+附加费 if (StringUtil.isEmpty(feeDto.getCurDegrees())) { //throw new IllegalArgumentException("抄表数据异常"); @@ -932,13 +955,32 @@ feePrice = sub.multiply(squarePrice) .add(additionalAmount) .setScale(2, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = (sub.multiply(squarePrice).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } } else if ("6006".equals(computingFormula)) { feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); BigDecimal amount = new BigDecimal(feeDto.getAmount()); feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("7007".equals(computingFormula)) { //自定义公式 feePrice = computeRoomCustomizeFormula(feeDto, roomDto); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = feePrice.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("8008".equals(computingFormula)) { //手动动态费用 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); BigDecimal amount = new BigDecimal(feeDto.getAmount()); feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("9009".equals(computingFormula)) { //(本期度数-上期度数)*动态单价+附加费 if (StringUtil.isEmpty(feeDto.getCurDegrees())) { //throw new IllegalArgumentException("抄表数据异常"); @@ -951,6 +993,10 @@ feePrice = sub.multiply(squarePrice) .add(additionalAmount) .setScale(2, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = (sub.multiply(squarePrice).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } } else { throw new IllegalArgumentException("暂不支持该类公式"); @@ -976,20 +1022,41 @@ BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(parkingSpaceDtos.get(0).getArea())); BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(2, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("2002".equals(computingFormula)) { // 固定费用 //feePrice = Double.parseDouble(feeDto.getAdditionalAmount()); BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("3003".equals(computingFormula)) { // 固定费用 BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice())); BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDto.getRoomArea())); BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("1101".equals(computingFormula)) { // 租金 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent())); feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("4004".equals(computingFormula)) { feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); BigDecimal amount = new BigDecimal(feeDto.getAmount()); feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("5005".equals(computingFormula)) { if (StringUtil.isEmpty(feeDto.getCurDegrees())) { throw new IllegalArgumentException("抄表数据异常"); @@ -1002,11 +1069,24 @@ feePrice = sub.multiply(squarePrice) .add(additionalAmount) .setScale(2, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = (sub.multiply(squarePrice).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } } else if ("6006".equals(computingFormula)) { feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); BigDecimal amount = new BigDecimal(feeDto.getAmount()); feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("7007".equals(computingFormula)) { //自定义公式 feePrice = computeCarCustomizeFormula(feeDto, ownerCarDtos.get(0)); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = feePrice.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("9009".equals(computingFormula)) { //(本期度数-上期度数)*动态单价+附加费 if (StringUtil.isEmpty(feeDto.getCurDegrees())) { //throw new IllegalArgumentException("抄表数据异常"); @@ -1019,6 +1099,10 @@ feePrice = sub.multiply(squarePrice) .add(additionalAmount) .setScale(2, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = (sub.multiply(squarePrice).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } } else { throw new IllegalArgumentException("暂不支持该类公式"); @@ -1042,22 +1126,43 @@ feeDto.setBuiltUpArea(builtUpArea.doubleValue() + ""); BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("2002".equals(computingFormula)) { // 固定费用 //feePrice = Double.parseDouble(feeDto.getAdditionalAmount()); BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); // BigDecimal roomDount = new BigDecimal(contractRoomDtos.size()); // additionalAmount = additionalAmount.multiply(roomDount); feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("3003".equals(computingFormula)) { // 固定费用 BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice())); BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDto.getRoomArea())); BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount())); feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("1101".equals(computingFormula)) { // 租金 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent())); feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("4004".equals(computingFormula)) { //动态费用 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); BigDecimal amount = new BigDecimal(feeDto.getAmount()); feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("5005".equals(computingFormula)) { //(本期度数-上期度数)*单价+附加费 if (StringUtil.isEmpty(feeDto.getCurDegrees())) { //throw new IllegalArgumentException("抄表数据异常"); @@ -1070,13 +1175,31 @@ feePrice = sub.multiply(squarePrice) .add(additionalAmount) .setScale(2, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = (sub.multiply(squarePrice).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } } else if ("6006".equals(computingFormula)) { feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); BigDecimal amount = new BigDecimal(feeDto.getAmount()); feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("7007".equals(computingFormula)) { //自定义公式 feePrice = computeContractCustomizeFormula(feeDto, contractRoomDtos); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = feePrice.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("8008".equals(computingFormula)) { //手动动态费用 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); BigDecimal amount = new BigDecimal(feeDto.getAmount()); feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } else if ("9009".equals(computingFormula)) { //(本期度数-上期度数)*动态单价+附加费 if (StringUtil.isEmpty(feeDto.getCurDegrees())) { //throw new IllegalArgumentException("抄表数据异常"); @@ -1089,12 +1212,19 @@ feePrice = sub.multiply(squarePrice) .add(additionalAmount) .setScale(2, BigDecimal.ROUND_HALF_EVEN); if (!StringUtil.isEmpty(feeDto.getCycle())) { BigDecimal cycle1 = new BigDecimal(feeDto.getCycle()); feeTotalPrice = sub.multiply(squarePrice).add(additionalAmount).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN); } } } else { throw new IllegalArgumentException("暂不支持该类公式"); } } return feePrice.setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue(); feePrice.setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue(); feeAmount.put("feePrice", feePrice); feeAmount.put("feeTotalPrice", feeTotalPrice); return feeAmount; } /** java110-db/src/main/resources/mapper/center/PrivilegeDAOImplMapper.xml
@@ -3,6 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="privilegeDAOImpl"> <select id="queryUserDefaultPrivilege" parameterType="map" resultType="map"> SELECT a.`p_id` pId,a.`privilege_flag` privilegeFlag,a.`user_id` userId FROM p_privilege_user a WHERE a.`p_id` = #{pId} @@ -14,11 +15,7 @@ <!-- 保存属性信息 c_business_attrs --> <insert id="saveUserDefaultPrivilege" parameterType="Map"> <![CDATA[ INSERT INTO p_privilege_user(p_id,privilege_flag,user_id,store_id) VALUES(#{pId},'1',#{userId},#{storeId}) INSERT INTO p_privilege_user(p_id,privilege_flag,user_id,store_id) VALUES(#{pId},'1',#{userId},#{storeId}) ]]> </insert> @@ -31,7 +28,6 @@ INSERT INTO p_privilege_group(pg_id,`name`,description,store_id,domain) VALUES(#{pgId},#{name},#{description},#{storeId},#{storeTypeCd}) </insert> <update id="updatePrivilegeGroup" parameterType="Map"> UPDATE p_privilege_group a SET @@ -49,8 +45,8 @@ <if test="storeTypeCd != null and storeTypeCd != ''"> and a.domain= #{storeTypeCd} </if> </update> <!-- 删除权限组 --> <update id="deletePrivilegeGroup" parameterType="Map"> UPDATE p_privilege_group a SET a.`status_cd` = '1' @@ -62,7 +58,6 @@ <if test="storeTypeCd != null and storeTypeCd != ''"> and a.domain= #{storeTypeCd} </if> </update> <!-- 删除权限组 --> @@ -91,7 +86,6 @@ AND ppr.`status_cd` = '0' AND pp.`status_cd` = '0' AND ppr.`pg_id` = #{pgId} </select> <select id="queryPrivilegeGroup" parameterType="Map" resultType="Map"> @@ -108,13 +102,13 @@ and ppg.domain = #{storeTypeCd} </if> and ppg.status_cd = '0' </select> <insert id="addPrivilegeRel" parameterType="Map"> insert into p_privilege_rel(p_id,pg_id) values(#{pId},#{pgId}) </insert> <!-- 查询权限 --> <select id="queryPrivilege" parameterType="Map" resultType="Map"> SELECT @@ -129,6 +123,7 @@ </if> AND pp.`status_cd` = '0' </select> <!-- 查询用户权限 --> <select id="queryUserPrivilege" parameterType="Map" resultType="Map"> SELECT @@ -150,14 +145,11 @@ </if> AND ppu.`status_cd` = '0' </select> <!-- 保存属性信息 c_business_attrs --> <insert id="addUserPrivilege" parameterType="Map"> <![CDATA[ INSERT INTO p_privilege_user(p_id,privilege_flag,user_id,store_id) VALUES(#{pId},#{privilegeFlag},#{userId},#{storeId}) INSERT INTO p_privilege_user(p_id,privilege_flag,user_id,store_id) VALUES(#{pId},#{privilegeFlag},#{userId},#{storeId}) ]]> </insert> java110-db/src/main/resources/mapper/fee/ApplyRoomDiscountServiceDaoImplMapper.xml
@@ -4,7 +4,6 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="applyRoomDiscountServiceDaoImpl"> <!-- 保存房屋折扣申请信息 add by wuxw 2018-07-03 --> <insert id="saveApplyRoomDiscountInfo" parameterType="Map"> insert into apply_room_discount( @@ -14,7 +13,6 @@ #{communityId},#{discountId},#{inUse} ) </insert> <!-- 查询房屋折扣申请信息 add by wuxw 2018-07-03 --> <select id="getApplyRoomDiscountInfo" parameterType="Map" resultType="Map"> @@ -81,6 +79,9 @@ </if> <if test="inUse !=null and inUse != ''"> and t.in_use= #{inUse} </if> <if test="bId !=null and bId != ''"> and t.b_id= #{bId} </if> order by t.create_time desc <if test="page != -1 and page != null "> @@ -205,6 +206,9 @@ <if test="inUse !=null and inUse != ''"> , t.in_use= #{inUse} </if> <if test="bId !=null and bId != ''"> , t.b_id= #{bId} </if> where 1=1 <if test="ardId !=null and ardId != ''"> and t.ard_id= #{ardId} java110-db/src/main/resources/mapper/fee/PayFeeConfigDiscountServiceDaoImplMapper.xml
@@ -4,7 +4,6 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="payFeeConfigDiscountServiceDaoImpl"> <!-- 保存费用项折扣信息 add by wuxw 2018-07-03 --> <insert id="savePayFeeConfigDiscountInfo" parameterType="Map"> insert into pay_fee_config_discount( @@ -13,7 +12,6 @@ #{configDiscountId},#{configId},#{discountId},#{communityId},#{startTime},#{endTime},#{payMaxEndTime} ) </insert> <!-- 查询费用项折扣信息 add by wuxw 2018-07-03 --> <select id="getPayFeeConfigDiscountInfo" parameterType="Map" resultType="Map"> @@ -48,9 +46,7 @@ <if test="page != -1 and page != null "> limit #{page}, #{row} </if> </select> <!-- 修改费用项折扣信息 add by wuxw 2018-07-03 --> <update id="updatePayFeeConfigDiscountInfo" parameterType="Map"> @@ -71,7 +67,6 @@ <if test="configDiscountId !=null and configDiscountId != ''"> and t.config_discount_id= #{configDiscountId} </if> </update> <!-- 查询费用项折扣数量 add by wuxw 2018-07-03 --> @@ -94,8 +89,6 @@ <if test="communityId !=null and communityId != ''"> and t.community_id= #{communityId} </if> </select> </mapper> java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml
@@ -921,7 +921,7 @@ t.receivable_amount receivableAmount,t.received_amount receivedAmount,pfa.`value` importFeeName,t.prime_rate,d.name primeRate,fdr.discount_small_type discountSmallType,fdr.rule_name ruleName,pfdd.discount_price discountPrice,co.contract_code contractCode,pfo.`value` ownerName,cb.o_id oId, d2.name feeTypeCdName,pfc.fee_type_cd feeTypeCd,t.state,d3.name stateName d2.name feeTypeCdName,pfc.fee_type_cd feeTypeCd,t.state,d3.name stateName,t.fee_id feeId,pft.`value` repairId from pay_fee_detail t INNER JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' inner join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0' @@ -931,6 +931,7 @@ left join owner_car oc on pf.payer_obj_id = oc.car_id and oc.status_cd = '0' and oc.car_type_cd='1001' left join pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390002' left join pay_fee_attrs pfo on t.fee_id = pfo.fee_id and pfo.spec_cd = '390008' left join pay_fee_attrs pft on t.fee_id = pft.fee_id and pft.spec_cd = '390001' left join pay_fee_detail_discount pfdd on t.detail_id = pfdd.detail_id and pfdd.status_cd = '0' left join fee_discount fd on pfdd.discount_id = fd.discount_id and fd.status_cd = '0' left join fee_discount_rule fdr on fd.rule_id = fdr.rule_id and fdr.status_cd = '0' java110-db/src/main/resources/mapper/report/ReportOweFeeServiceDaoImplMapper.xml
@@ -30,7 +30,6 @@ <if test="updateTime !=null and updateTime != ''"> and t.update_time= #{updateTime} </if> <if test="oweId !=null and oweId != ''"> and t.owe_id= #{oweId} </if> java110-db/src/main/resources/mapper/user/OwnerCarServiceDaoImplMapper.xml
@@ -15,7 +15,6 @@ ) </insert> <!-- 查询车辆管理信息(Business) add by wuxw 2018-07-03 --> <select id="getBusinessOwnerCarInfo" parameterType="Map" resultType="Map"> select t.car_color,t.car_color carColor,t.car_brand,t.car_brand carBrand,t.car_type,t.car_type @@ -67,9 +66,7 @@ <if test="communityId !=null and communityId != ''"> and t.community_id= #{communityId} </if> </select> <!-- 保存车辆管理信息至 instance表中 add by wuxw 2018-07-03 --> <insert id="saveOwnerCarInfoInstance" parameterType="Map"> @@ -120,7 +117,6 @@ <if test="communityId !=null and communityId != ''"> and t.community_id= #{communityId} </if> </insert> @@ -136,9 +132,9 @@ from owner_car t left join t_dict t1 on t.car_type=t1.status_cd and t1.table_name='owner_car' and t1.table_columns = 'car_type' left join t_dict t2 on t.state=t2.status_cd and t2.table_name='owner_car' and t2.table_columns = 'state' left join building_owner bow on t.owner_id = bow.member_id and bow.status_cd = '0' and bow.community_id = t.community_id left join building_owner bow on t.owner_id = bow.member_id and bow.status_cd = '0' and bow.community_id = t.community_id where 1=1 <if test="statusCd !=null and statusCd != ''"> and t.status_cd = #{statusCd} </if> @@ -227,9 +223,7 @@ <if test="page != -1 and page != null "> limit #{page}, #{row} </if> </select> <!-- 修改车辆管理信息 add by wuxw 2018-07-03 --> <update id="updateOwnerCarInfoInstance" parameterType="Map"> java110-interface/src/main/java/com/java110/intf/fee/IFeeDetailInnerServiceSMO.java
@@ -33,6 +33,16 @@ List<FeeDetailDto> queryFeeDetails(@RequestBody FeeDetailDto feeDetailDto); /** * <p>查询小区楼信息</p> * * * @param feeDetailDto 数据对象分享 * @return FeeDetailDto 对象数据 */ @RequestMapping(value = "/queryBusinessFeeDetails", method = RequestMethod.POST) List<FeeDetailDto> queryBusinessFeeDetails(@RequestBody FeeDetailDto feeDetailDto); /** * 查询<p>小区楼</p>总记录数 * * @param feeDetailDto 数据对象分享 service-api/src/main/java/com/java110/api/bmo/fee/impl/FeeBMOImpl.java
@@ -170,7 +170,8 @@ int hours = 0; Date targetEndTime = null; BigDecimal cycles = null; BigDecimal feePrice = new BigDecimal(computeFeeSMOImpl.getFeePrice(feeDto)); Map feePriceAll=computeFeeSMOImpl.getFeePrice(feeDto); BigDecimal feePrice = new BigDecimal(feePriceAll.get("feePrice").toString()); if ("-101".equals(paramInJson.getString("cycles"))) { Date endTime = feeDto.getEndTime(); Calendar endCalender = Calendar.getInstance(); @@ -228,7 +229,8 @@ feeDto = feeDtos.get(0); businessFeeDetail.put("startTime", paramInJson.getString("startTime")); BigDecimal cycles = null; BigDecimal feePrice = new BigDecimal(computeFeeSMOImpl.getFeePrice(feeDto)); Map feePriceAll=computeFeeSMOImpl.getFeePrice(feeDto); BigDecimal feePrice = new BigDecimal(feePriceAll.get("feePrice").toString()); Date endTime = feeDto.getEndTime(); Calendar endCalender = Calendar.getInstance(); endCalender.setTime(endTime); @@ -405,9 +407,9 @@ double feePrice = 0.0; feePrice = computeFeeSMOImpl.getFeePrice(feeDto); Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto); BigDecimal receivableAmount = new BigDecimal(feePrice); BigDecimal receivableAmount = new BigDecimal(feePriceAll.get("feePrice").toString()); BigDecimal cycles = new BigDecimal(Double.parseDouble(paramInJson.getString("cycles"))); double tmpReceivableAmount = cycles.multiply(receivableAmount).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); double discountPrice = paramInJson.getDouble("discountPrice"); service-api/src/main/java/com/java110/api/listener/fee/ListFeeListener.java
@@ -17,6 +17,7 @@ import com.java110.utils.util.Assert; import com.java110.utils.util.BeanConvertUtil; import com.java110.utils.util.DateUtil; import com.java110.utils.util.StringUtil; import com.java110.vo.api.fee.ApiFeeDataVo; import com.java110.vo.api.fee.ApiFeeVo; import org.slf4j.Logger; @@ -92,12 +93,20 @@ int count = feeInnerServiceSMOImpl.queryFeesCount(feeDto); List<ApiFeeDataVo> fees = null; List<ApiFeeDataVo> fees = new ArrayList<>(); if (count > 0) { List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto);//查询费用项目 computeFeePrice(feeDtos);//计算费用 fees = BeanConvertUtil.covertBeanList(feeDtos, ApiFeeDataVo.class); List<ApiFeeDataVo> apiFeeDataVos = BeanConvertUtil.covertBeanList(feeDtos, ApiFeeDataVo.class); for (ApiFeeDataVo apiFeeDataVo : apiFeeDataVos) { //获取付费对象类型 String payerObjType = apiFeeDataVo.getPayerObjType(); if (!StringUtil.isEmpty(payerObjType) && payerObjType.equals("6666")) { apiFeeDataVo.setCarTypeCd("1001"); } fees.add(apiFeeDataVo); } freshFeeAttrs(fees, feeDtos); } else { fees = new ArrayList<>(); @@ -159,8 +168,8 @@ } String computingFormula = feeDto.getComputingFormula(); double feePrice = 0.00; feePrice = computeFeeSMOImpl.getFeePrice(feeDto); feeDto.setFeePrice(feePrice); Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto); feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString())); BigDecimal curFeePrice = new BigDecimal(feeDto.getFeePrice()); curFeePrice = curFeePrice.multiply(new BigDecimal(oweMonth)); feeDto.setAmountOwed(curFeePrice.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() + ""); @@ -181,8 +190,8 @@ private void computeFeePriceByRoom(FeeDto feeDto, double oweMonth) { String computingFormula = feeDto.getComputingFormula(); double feePrice = 0.00; feePrice = computeFeeSMOImpl.getFeePrice(feeDto); feeDto.setFeePrice(feePrice); Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto); feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString())); BigDecimal curFeePrice = new BigDecimal(feeDto.getFeePrice()); curFeePrice = curFeePrice.multiply(new BigDecimal(oweMonth)); feeDto.setAmountOwed(curFeePrice.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() + ""); @@ -203,8 +212,8 @@ private void computeFeePriceByContract(FeeDto feeDto, double oweMonth) { String computingFormula = feeDto.getComputingFormula(); double feePrice = 0.00; feePrice = computeFeeSMOImpl.getFeePrice(feeDto); feeDto.setFeePrice(feePrice); Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto); feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString())); BigDecimal curFeePrice = new BigDecimal(feeDto.getFeePrice()); curFeePrice = curFeePrice.multiply(new BigDecimal(oweMonth)); feeDto.setAmountOwed(curFeePrice.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() + ""); service-api/src/main/java/com/java110/api/listener/fee/PayFeeConfirmListener.java
@@ -7,28 +7,20 @@ import com.java110.core.annotation.Java110Listener; import com.java110.core.context.DataFlowContext; import com.java110.core.event.service.api.ServiceDataFlowEvent; import com.java110.core.factory.GenerateCodeFactory; import com.java110.core.smo.IComputeFeeSMO; import com.java110.dto.fee.FeeAttrDto; import com.java110.dto.fee.FeeDto; import com.java110.dto.order.BusinessDto; import com.java110.dto.repair.RepairDto; import com.java110.entity.center.AppService; import com.java110.entity.order.Orders; import com.java110.intf.fee.IFeeAttrInnerServiceSMO; import com.java110.intf.fee.IFeeInnerServiceSMO; import com.java110.intf.fee.IFeeReceiptDetailInnerServiceSMO; import com.java110.intf.fee.IFeeReceiptInnerServiceSMO; import com.java110.intf.fee.*; import com.java110.intf.order.IOrderInnerServiceSMO; import com.java110.po.feeReceipt.FeeReceiptPo; import com.java110.po.feeReceiptDetail.FeeReceiptDetailPo; import com.java110.po.owner.RepairPoolPo; import com.java110.utils.constant.BusinessTypeConstant; import com.java110.utils.constant.CommonConstant; import com.java110.utils.constant.ServiceCodeConstant; import com.java110.utils.util.Assert; import com.java110.utils.util.BeanConvertUtil; import com.java110.utils.util.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -54,12 +46,6 @@ private static Logger logger = LoggerFactory.getLogger(PayFeeConfirmListener.class); @Autowired private IFeeReceiptInnerServiceSMO feeReceiptInnerServiceSMOImpl; @Autowired private IFeeReceiptDetailInnerServiceSMO feeReceiptDetailInnerServiceSMOImpl; @Autowired private IFeeBMO feeBMOImpl; @Autowired @@ -71,8 +57,6 @@ @Autowired private IOrderInnerServiceSMO orderInnerServiceSMOImpl; @Autowired private IComputeFeeSMO computeFeeSMOImpl; @Override public String getServiceCode() { @@ -115,7 +99,6 @@ businessDto.setoId(paramObj.getString("oId")); businessDto.setBusinessTypeCd("600100040001"); List<BusinessDto> businessDtos = orderInnerServiceSMOImpl.querySameOrderBusiness(businessDto); if (businessDtos == null || businessDtos.size() < 1) { dataFlowContext.setResponseEntity(responseEntity); return; service-api/src/main/java/com/java110/api/listener/fee/PayFeeListener.java
@@ -14,9 +14,11 @@ import com.java110.dto.fee.FeeDto; import com.java110.dto.feeReceipt.FeeReceiptDetailDto; import com.java110.dto.owner.OwnerCarDto; import com.java110.dto.parking.ParkingSpaceDto; import com.java110.dto.repair.RepairDto; import com.java110.dto.repair.RepairUserDto; import com.java110.entity.center.AppService; import com.java110.intf.community.IParkingSpaceInnerServiceSMO; import com.java110.intf.community.IRepairInnerServiceSMO; import com.java110.intf.community.IRepairUserInnerServiceSMO; import com.java110.intf.community.IRoomInnerServiceSMO; @@ -79,7 +81,6 @@ @Autowired private IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl; @Autowired private IPayFeeDetailDiscountBMO payFeeDetailDiscountBMOImpl; @@ -94,6 +95,9 @@ @Autowired private IApplyRoomDiscountInnerServiceSMO applyRoomDiscountInnerServiceSMOImpl; @Autowired private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl; @Override public String getServiceCode() { @@ -148,7 +152,24 @@ OwnerCarDto ownerCarDto = new OwnerCarDto(); ownerCarDto.setCommunityId(paramObj.getString("communityId")); ownerCarDto.setCarId(paramObj.getString("carPayerObjId")); ownerCarDto.setCarTypeCd("1001"); //业主车辆 List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto); Assert.listOnlyOne(ownerCarDtos, "查询业主错误!"); //获取车位id String psId = ownerCarDtos.get(0).getPsId(); //获取车辆状态(1001 正常状态,2002 欠费状态 3003 车位释放) String carState = ownerCarDtos.get(0).getState(); if (!StringUtil.isEmpty(psId) && !StringUtil.isEmpty(carState) && carState.equals("3003")) { ParkingSpaceDto parkingSpaceDto = new ParkingSpaceDto(); parkingSpaceDto.setPsId(psId); List<ParkingSpaceDto> parkingSpaceDtos = parkingSpaceInnerServiceSMOImpl.queryParkingSpaces(parkingSpaceDto); Assert.listOnlyOne(parkingSpaceDtos, "查询车位信息错误!"); //获取车位状态(出售 S,出租 H ,空闲 F) String state = parkingSpaceDtos.get(0).getState(); if (!StringUtil.isEmpty(state) && !state.equals("F")) { throw new IllegalArgumentException("车位已被使用,不能再缴费!"); } } //车位费用续租 if (ownerCarDtos != null) { for (OwnerCarDto tmpOwnerCarDto : ownerCarDtos) { service-api/src/main/java/com/java110/api/listener/fee/PayFeePreListener.java
@@ -126,13 +126,13 @@ String appId = event.getDataFlowContext().getAppId(); if (AppDto.WECHAT_MINA_OWNER_APP_ID.equals(appId)) { //微信小程序支付 paramObj.put("primeRate", "5"); paramObj.put("primeRate", "6"); paramObj.put("remark", "线上小程序支付"); } else if (AppDto.WECHAT_OWNER_APP_ID.equals(appId)) { //微信公众号支付 paramObj.put("primeRate", "6"); paramObj.put("primeRate", "5"); paramObj.put("remark", "线上公众号支付"); } else { paramObj.put("primeRate", "5"); paramObj.put("primeRate", "6"); paramObj.put("remark", "线上小程序支付"); } @@ -213,6 +213,28 @@ dataFlowContext.getRequestCurrentHeaders().put(CommonConstant.ORDER_PROCESS, Orders.ORDER_PROCESS_ORDER_PRE_SUBMIT); ResponseEntity<String> responseEntity = feeBMOImpl.callService(dataFlowContext, service.getServiceCode(), businesses); //查询 pay_fee_detail 是否缴费 FeeDetailDto feeDetailDto = new FeeDetailDto(); feeDetailDto.setDetailId(paramObj.getString("detailId")); List<FeeDetailDto> feeDetailDtoList = iFeeDetailInnerServiceSMO.queryBusinessFeeDetails(feeDetailDto); if (feeDetailDtoList != null && feeDetailDtoList.size() == 1) { //获取bId String bId = feeDetailDtoList.get(0).getbId(); //获取优惠 List<ComputeDiscountDto> computeDiscountDtos = (List<ComputeDiscountDto>) paramObj.get("computeDiscountDtos"); if (computeDiscountDtos != null) { for (ComputeDiscountDto computeDiscountDto : computeDiscountDtos) { if (!StringUtil.isEmpty(computeDiscountDto.getArdId())) { ApplyRoomDiscountPo applyRoomDiscountPo = new ApplyRoomDiscountPo(); //将业务id更新到空置房优惠里面 applyRoomDiscountPo.setbId(bId); applyRoomDiscountPo.setArdId(computeDiscountDto.getArdId()); applyRoomDiscountInnerServiceSMOImpl.updateApplyRoomDiscount(applyRoomDiscountPo); } } } } if (responseEntity.getStatusCode() != HttpStatus.OK) { dataFlowContext.setResponseEntity(responseEntity); return; @@ -285,20 +307,6 @@ List<ComputeDiscountDto> computeDiscountDtos = (List<ComputeDiscountDto>) paramObj.get("computeDiscountDtos"); JSONObject discountBusiness = null; for (ComputeDiscountDto computeDiscountDto : computeDiscountDtos) { if (!StringUtil.isEmpty(computeDiscountDto.getArdId())) { //查询 pay_fee_detail 是否缴费 FeeDetailDto feeDetailDto = new FeeDetailDto(); feeDetailDto.setDetailId(paramObj.getString("detailId")); List<FeeDetailDto> feeDetailDtoList = iFeeDetailInnerServiceSMO.queryFeeDetails(feeDetailDto); logger.info("======使用空置房优惠信息======ardId======" + computeDiscountDto.getArdId()); if (feeDetailDtoList != null && feeDetailDtoList.size() == 1) { ApplyRoomDiscountPo applyRoomDiscountPo = new ApplyRoomDiscountPo(); //空置房优惠不可用 applyRoomDiscountPo.setInUse("1"); applyRoomDiscountPo.setArdId(computeDiscountDto.getArdId()); applyRoomDiscountInnerServiceSMOImpl.updateApplyRoomDiscount(applyRoomDiscountPo); } } if (computeDiscountDto.getDiscountPrice() <= 0) { continue; } service-api/src/main/java/com/java110/api/listener/fee/PayOweFeeListener.java
@@ -8,6 +8,7 @@ import com.java110.core.annotation.Java110Listener; import com.java110.core.context.DataFlowContext; import com.java110.core.event.service.api.ServiceDataFlowEvent; import com.java110.dto.app.AppDto; import com.java110.dto.fee.FeeAttrDto; import com.java110.dto.feeReceipt.FeeReceiptDetailDto; import com.java110.dto.repair.RepairDto; @@ -24,6 +25,7 @@ import com.java110.utils.constant.ServiceCodeConstant; import com.java110.utils.util.Assert; import com.java110.utils.util.BeanConvertUtil; import com.java110.utils.util.StringUtil; import com.java110.vo.ResultVo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -102,6 +104,7 @@ //校验数据 validate(paramIn); JSONObject paramObj = JSONObject.parseObject(paramIn); logger.info("======欠费缴费返回======:"+JSONArray.toJSONString(paramObj)); HttpHeaders header = new HttpHeaders(); dataFlowContext.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D"); JSONArray businesses = new JSONArray(); @@ -113,7 +116,15 @@ for (int feeIndex = 0; feeIndex < fees.size(); feeIndex++) { feeObj = fees.getJSONObject(feeIndex); feeObj.put("communityId", paramObj.getString("communityId")); feeObj.put("remark", paramObj.getString("remark")); String remark = paramObj.getString("remark"); String paySource = "现场收银台支付"; if (!StringUtil.isEmpty(remark)) { remark = "-" + remark; } else { remark = ""; } feeObj.put("remark", paySource + remark); getFeeReceiptDetailPo(dataFlowContext, feeObj, businesses, feeReceiptDetailPos, feeReceiptPos); } @@ -139,9 +150,9 @@ FeeReceiptDetailDto feeReceiptDetailDto = new FeeReceiptDetailDto(); feeReceiptDetailDto.setDetailIds(detailIds.toArray(new String[detailIds.size()])); feeReceiptDetailDto.setCommunityId(paramObj.getString("communityId")); try{ try { Thread.currentThread().sleep(2000); }catch(InterruptedException ie){ } catch (InterruptedException ie) { ie.printStackTrace(); } List<FeeReceiptDetailDto> feeReceiptDetailDtos = feeReceiptDetailInnerServiceSMOImpl.queryFeeReceiptDetails(feeReceiptDetailDto); @@ -151,10 +162,15 @@ } private void getFeeReceiptDetailPo(DataFlowContext dataFlowContext, JSONObject paramObj, JSONArray businesses, List<FeeReceiptDetailPo> feeReceiptDetailPos, List<FeeReceiptPo> feeReceiptPos) { if(!paramObj.containsKey("primeRate")) { if (!paramObj.containsKey("primeRate")) { paramObj.put("primeRate", "6"); } //paramObj.put("remark", "微信支付"); String appId = dataFlowContext.getAppId(); logger.info("======支付方式======:" + appId + "+======+" + paramObj.containsKey("primeRate")+"======:"+JSONArray.toJSONString(dataFlowContext)); if (AppDto.OWNER_WECHAT_PAY.equals(appId)) { //微信支付(欠费缴费无法区分小程序还是微信公众号) paramObj.put("remark", "微信支付"); } paramObj.put("state","1400"); businesses.add(feeBMOImpl.addOweFeeDetail(paramObj, dataFlowContext, feeReceiptDetailPos, feeReceiptPos)); businesses.add(feeBMOImpl.modifyOweFee(paramObj, dataFlowContext)); service-api/src/main/java/com/java110/api/listener/fee/QueryFeeDetailListener.java
@@ -12,6 +12,7 @@ import com.java110.intf.fee.IFeeDetailInnerServiceSMO; import com.java110.dto.fee.FeeDetailDto; import com.java110.core.event.service.api.ServiceDataFlowEvent; import com.java110.utils.util.StringUtil; import com.java110.vo.api.ApiFeeDetailDataVo; import com.java110.vo.api.ApiFeeDetailVo; import org.springframework.beans.factory.annotation.Autowired; @@ -56,11 +57,15 @@ //获取请求数据 JSONObject reqJson = dataFlowContext.getReqJson(); //获取开始时间 String startTime = reqJson.getString("startTime") + " 00:00:00"; if (!StringUtil.isEmpty(reqJson.getString("startTime"))) { String startTime = reqJson.getString("startTime") + " 00:00:00"; reqJson.put("startTime", startTime); } //获取结束时间 String endTime = reqJson.getString("endTime") + " 23:59:59"; reqJson.put("startTime", startTime); reqJson.put("endTime", endTime); if (!StringUtil.isEmpty(reqJson.getString("endTime"))) { String endTime = reqJson.getString("endTime") + " 23:59:59"; reqJson.put("endTime", endTime); } validateFeeConfigData(reqJson); //查询总记录数 service-api/src/main/java/com/java110/api/listener/owner/CarAddParkingSpaceListener.java
@@ -8,6 +8,7 @@ import com.java110.core.event.service.api.ServiceDataFlowEvent; import com.java110.dto.owner.OwnerCarDto; import com.java110.dto.parking.ParkingSpaceDto; import com.java110.intf.community.IParkingSpaceInnerServiceSMO; import com.java110.intf.user.IOwnerCarInnerServiceSMO; import com.java110.po.car.OwnerCarPo; import com.java110.utils.constant.BusinessTypeConstant; @@ -44,6 +45,9 @@ @Autowired private IParkingSpaceBMO parkingSpaceBMOImpl; @Autowired private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl; @Override public String getServiceCode() { return ServiceCodeConstant.SERVICE_CODE_CAR_ADD_PARKING_SPACE; @@ -74,9 +78,9 @@ List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto); Assert.listOnlyOne(ownerCarDtos, "未找到车辆信息"); String psId = ownerCarDtos.get(0).getPsId(); String state = ownerCarDtos.get(0).getState(); if (!StringUtil.isEmpty(psId) && !"-1".equals(psId)) { if (!StringUtil.isEmpty(state) && !state.equals(OwnerCarDto.STATE_FINISH)) { throw new IllegalArgumentException("已有车位无需续租"); } } @@ -85,6 +89,15 @@ protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { OwnerCarPo ownerCarPo = BeanConvertUtil.covertBean(reqJson, OwnerCarPo.class); ParkingSpaceDto parkingSpaceDto = new ParkingSpaceDto(); parkingSpaceDto.setPsId(ownerCarPo.getPsId()); List<ParkingSpaceDto> parkingSpaceDtos = parkingSpaceInnerServiceSMOImpl.queryParkingSpaces(parkingSpaceDto); Assert.listOnlyOne(parkingSpaceDtos, "查询车位信息错误!"); //获取车位状态(出售 S,出租 H ,空闲 F) String state = parkingSpaceDtos.get(0).getState(); if (!StringUtil.isEmpty(state) && !state.equals("F")) { //如果车位状态不是空闲的,就不能续租 throw new IllegalArgumentException("车位已被使用,无法继续续租!"); } ownerCarPo.setState(OwnerCarDto.STATE_NORMAL); super.update(context, ownerCarPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_OWNER_CAR); reqJson.put("carNumType", ParkingSpaceDto.STATE_HIRE); service-api/src/main/java/com/java110/api/listener/owner/DeleteCarParkingSpaceListener.java
@@ -6,7 +6,6 @@ import com.java110.core.annotation.Java110Listener; import com.java110.core.context.DataFlowContext; import com.java110.core.event.service.api.ServiceDataFlowEvent; import com.java110.dto.fee.FeeDetailDto; import com.java110.dto.fee.FeeDto; import com.java110.dto.owner.OwnerCarDto; import com.java110.dto.parking.ParkingSpaceDto; @@ -77,12 +76,13 @@ ownerCarDto.setCommunityId(reqJson.getString("communityId")); ownerCarDto.setStatusCd("0"); List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto); if(ownerCarDtos!=null && ownerCarDtos.size()>1){ if (ownerCarDtos != null && ownerCarDtos.size() > 1) { throw new IllegalArgumentException("有多个车辆绑定此车位,请先删除车辆!"); } String psId = ownerCarDtos.get(0).getPsId(); if (StringUtil.isEmpty(psId) || "-1".equals(psId)) { String state = ownerCarDtos.get(0).getState(); if (StringUtil.isEmpty(state) || state.equals(OwnerCarDto.STATE_FINISH)) { throw new IllegalArgumentException("车位已经释放无需释放"); } @@ -102,25 +102,30 @@ feeDto.setPayerObjType(FeeDto.PAYER_OBJ_TYPE_CAR); List<FeeDto> feeDtoList = feeInnerServiceSMOImpl.queryFees(feeDto); boolean oweFee = false; if (feeDtoList == null || feeDtoList.size() < 1) { oweFee = true; } for (FeeDto tmpFeeDto : feeDtoList) { if (tmpFeeDto.getEndTime().getTime() < ownerCarDto.getEndTime().getTime()) { if (tmpFeeDto.getEndTime().getTime() <= ownerCarDto.getEndTime().getTime()) { oweFee = true; break; } else { throw new IllegalArgumentException("费用未开始!"); } } if (OwnerCarDto.STATE_OWE.equals(ownerCarDto.getState())) { if (OwnerCarDto.STATE_FINISH.equals(ownerCarDto.getState())) { oweFee = false; } OwnerCarPo ownerCarPo = new OwnerCarPo(); ownerCarPo.setPsId("-1"); // ownerCarPo.setPsId("-1"); ownerCarPo.setCarId(reqJson.getString("carId")); ownerCarPo.setMemberId(reqJson.getString("memberId")); ownerCarPo.setCommunityId(reqJson.getString("communityId")); if (oweFee) { ownerCarPo.setState(OwnerCarDto.STATE_OWE); ownerCarPo.setState(OwnerCarDto.STATE_FINISH); } super.update(context, ownerCarPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_OWNER_CAR); service-api/src/main/java/com/java110/api/listener/owner/QueryOwnerCarsListener.java
@@ -1,13 +1,11 @@ package com.java110.api.listener.owner; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.java110.api.listener.AbstractServiceApiDataFlowListener; import com.java110.core.annotation.Java110Listener; import com.java110.core.context.DataFlowContext; import com.java110.core.event.service.api.ServiceDataFlowEvent; import com.java110.dto.PageDto; import com.java110.dto.RoomDto; import com.java110.dto.basePrivilege.BasePrivilegeDto; import com.java110.dto.owner.OwnerCarDto; @@ -47,7 +45,6 @@ @Autowired private IMenuInnerServiceSMO menuInnerServiceSMOImpl; @Autowired private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl; @@ -104,7 +101,6 @@ if (total > 0) { OwnerCarDto ownerCarDto = BeanConvertUtil.covertBean(reqJson, OwnerCarDto.class); ownerCarDto.setCarTypeCd("1001"); //业主车辆 ownerCarDtoList = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto); //小区20条时刷房屋和车位信息 service-api/src/main/java/com/java110/api/listener/owner/SaveOwnerCarMemberListener.java
@@ -104,10 +104,11 @@ //校验车牌号是否存在 OwnerCarDto ownerCarDto = new OwnerCarDto(); ownerCarDto.setCommunityId(reqJson.getString("communityId")); ownerCarDto.setCarTypeCd("1001"); //业主车辆 ownerCarDto.setCarId(reqJson.getString("carId")); ownerCarDto.setStatusCd("0"); List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto); if(ownerCarDtos.isEmpty() || ownerCarDtos.size()==0){ if (ownerCarDtos.isEmpty() || ownerCarDtos.size() == 0) { throw new IllegalArgumentException("主车辆不存在"); } service-api/src/main/java/com/java110/api/listener/ownerRepair/RepairDispatchListener.java
@@ -123,7 +123,9 @@ List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); //收费结束 if (FeeDto.STATE_FINISH.equals(feeDtos.get(0).getState())) { throw new IllegalArgumentException("收费结束,不能退单"); ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_BUSINESS_VERIFICATION, "收费结束,不能退单!"); context.setResponseEntity(responseEntity); return; } PayFeePo payFeePo = new PayFeePo(); @@ -155,7 +157,11 @@ repairUserDto.setState(RepairUserDto.STATE_DOING); repairUserDto.setStaffId(userId); List<RepairUserDto> repairUserDtos = repairUserInnerServiceSMOImpl.queryRepairUsers(repairUserDto); Assert.listOnlyOne(repairUserDtos, "当前用户没有需要处理订单"); if (repairUserDtos != null && repairUserDtos.size() != 1) { ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_BUSINESS_VERIFICATION, "当前用户没有需要处理订单!"); context.setResponseEntity(responseEntity); return; } String ruId = repairUserDtos.get(0).getRuId(); RepairUserPo repairUserPo = new RepairUserPo(); repairUserPo.setRuId(repairUserDtos.get(0).getRuId()); @@ -235,7 +241,11 @@ repairUserDto.setState(RepairUserDto.STATE_DOING); repairUserDto.setStaffId(userId); List<RepairUserDto> repairUserDtos = repairUserInnerServiceSMOImpl.queryRepairUsers(repairUserDto); Assert.listOnlyOne(repairUserDtos, "当前用户没有需要处理订单"); if (repairUserDtos != null && repairUserDtos.size() != 1) { ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_BUSINESS_VERIFICATION, "当前用户没有需要处理订单!"); context.setResponseEntity(responseEntity); return; } //插入派单者的信息 RepairUserPo repairUserPo = new RepairUserPo(); repairUserPo.setRuId(repairUserDtos.get(0).getRuId()); service-fee/src/main/java/com/java110/fee/api/FeeApi.java
@@ -12,6 +12,7 @@ import com.java110.utils.exception.InitConfigDataException; import com.java110.utils.exception.InitDataFlowContextException; import com.java110.utils.util.Assert; import com.java110.utils.util.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -180,17 +181,18 @@ feeDto.setCommunityId(communityId); return queryOweFeeImpl.query(feeDto); } /** * 查询欠费费用 * * @param roomId 房屋ID * @param roomId 房屋ID * @param communityId 小区ID * @return * @path /app/feeApi/listAllRoomOweFees */ @RequestMapping(value = "/listAllRoomOweFees", method = RequestMethod.GET) public ResponseEntity<String> listAllRoomOweFees( @RequestParam(value = "roomId",required = false) String roomId, @RequestParam(value = "roomId", required = false) String roomId, @RequestParam(value = "communityId") String communityId) { FeeDto feeDto = new FeeDto(); feeDto.setPayerObjId(roomId); @@ -204,16 +206,21 @@ * * @param feeId 费用ID * @param communityId 小区ID * @param cycle 周期 * @return * @path /app/feeApi/listFeeObj */ @RequestMapping(value = "/listFeeObj", method = RequestMethod.GET) public ResponseEntity<String> listFeeObj( @RequestParam(value = "feeId") String feeId, @RequestParam(value = "cycle", required = false) String cycle, @RequestParam(value = "communityId") String communityId) { FeeDto feeDto = new FeeDto(); feeDto.setFeeId(feeId); feeDto.setCommunityId(communityId); if (!StringUtil.isEmpty(cycle)) { feeDto.setCycle(cycle); } return queryOweFeeImpl.listFeeObj(feeDto); } @@ -293,6 +300,7 @@ * 车辆费用导入 * /feeApi/importCarFees * path /app/feeApi/importCarFees * * @param reqString * @return */ @@ -312,6 +320,7 @@ * 合同费用导入 * /feeApi/importContractFees * path /app/feeApi/importContractFees * * @param reqString * @return */ service-fee/src/main/java/com/java110/fee/api/PayFeeConfigDiscountApi.java
@@ -14,15 +14,16 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping(value = "/payFeeConfigDiscount") public class PayFeeConfigDiscountApi { @Autowired private ISavePayFeeConfigDiscountBMO savePayFeeConfigDiscountBMOImpl; @Autowired private IUpdatePayFeeConfigDiscountBMO updatePayFeeConfigDiscountBMOImpl; @Autowired private IDeletePayFeeConfigDiscountBMO deletePayFeeConfigDiscountBMOImpl; service-fee/src/main/java/com/java110/fee/bmo/impl/PayOweFeeImpl.java
@@ -38,6 +38,7 @@ import java.text.ParseException; import java.util.Date; import java.util.List; import java.util.Map; /** * 欠费缴费实现类 @@ -230,7 +231,8 @@ feeDto = feeDtos.get(0); paramInJson.put("feeInfo", feeDto); payFeeDetailPo.setStartTime(DateUtil.getFormatTimeString(feeDto.getEndTime(), DateUtil.DATE_FORMATE_STRING_A)); BigDecimal feePrice = new BigDecimal(computeFeeSMOImpl.getFeePrice(feeDto)); Map feePriceAll=computeFeeSMOImpl.getFeePrice(feeDto); BigDecimal feePrice = new BigDecimal(feePriceAll.get("feePrice").toString()); BigDecimal receivedAmount = new BigDecimal(Double.parseDouble(paramInJson.getString("feePrice"))); BigDecimal cycles = receivedAmount.divide(feePrice, 2, BigDecimal.ROUND_HALF_EVEN); service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java
@@ -119,8 +119,14 @@ if (feeDtos == null || feeDtos.size() < 1) { return ResultVo.success(); } String cycel = null; if (!StringUtil.isEmpty(feeDto.getCycle())) { cycel = feeDto.getCycle(); } feeDto = feeDtos.get(0); if (!StringUtil.isEmpty(cycel)) { feeDto.setCycle(cycel); } if (FeeDto.PAYER_OBJ_TYPE_ROOM.equals(feeDto.getPayerObjType())) { //房屋相关 RoomDto roomDto = new RoomDto(); @@ -153,8 +159,9 @@ feeDto.setPayerObjName(ownerCarDto.getCarNum() + "(" + parkingSpaceDto.getAreaNum() + "停车场" + parkingSpaceDto.getNum() + "车位)"); feeDto.setBuiltUpArea(parkingSpaceDto.getArea()); } double feePrice = computeFeeSMOImpl.getFeePrice(feeDto); feeDto.setFeePrice(feePrice); Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto); feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString())); feeDto.setFeeTotalPrice(Double.parseDouble(feePriceAll.get("feeTotalPrice").toString())); //应收款取值 String val = MappingCache.getValue(DOMAIN_COMMON, TOTAL_FEE_PRICE); feeDto.setVal(val); service-fee/src/main/java/com/java110/fee/bmo/payFeeConfigDiscount/impl/SavePayFeeConfigDiscountBMOImpl.java
@@ -2,6 +2,7 @@ import com.java110.core.annotation.Java110Transactional; import com.java110.core.factory.GenerateCodeFactory; import com.java110.dto.payFeeConfigDiscount.PayFeeConfigDiscountDto; import com.java110.fee.bmo.payFeeConfigDiscount.ISavePayFeeConfigDiscountBMO; import com.java110.intf.fee.IPayFeeConfigDiscountInnerServiceSMO; import com.java110.po.payFeeConfigDiscount.PayFeeConfigDiscountPo; @@ -25,6 +26,14 @@ @Java110Transactional public ResponseEntity<String> save(PayFeeConfigDiscountPo payFeeConfigDiscountPo) { PayFeeConfigDiscountDto payFeeConfigDiscountDto = new PayFeeConfigDiscountDto(); payFeeConfigDiscountDto.setConfigId(payFeeConfigDiscountPo.getConfigId()); payFeeConfigDiscountDto.setDiscountId(payFeeConfigDiscountPo.getDiscountId()); int i = payFeeConfigDiscountInnerServiceSMOImpl.queryPayFeeConfigDiscountsCount(payFeeConfigDiscountDto); if (i > 0) { return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败,不能添加相同的折扣!"); } payFeeConfigDiscountPo.setConfigDiscountId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_configDiscountId)); int flag = payFeeConfigDiscountInnerServiceSMOImpl.savePayFeeConfigDiscount(payFeeConfigDiscountPo); service-fee/src/main/java/com/java110/fee/discount/impl/DiscountFeeRule.java
@@ -27,6 +27,7 @@ import java.math.BigDecimal; import java.util.List; import java.util.Map; /** * 优惠打折 规则 @@ -90,9 +91,9 @@ feeDto.setFeeId(feeDiscountDto.getFeeId()); List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); double price = computeFeeSMOImpl.getFeePrice(feeDtos.get(0)); Map feePriceAll=computeFeeSMOImpl.getFeePrice(feeDtos.get(0)); BigDecimal priceDec = new BigDecimal(price); BigDecimal priceDec = new BigDecimal(feePriceAll.get("feePrice").toString()); BigDecimal cycleDec = new BigDecimal(feeDiscountDto.getCycles()); service-fee/src/main/java/com/java110/fee/discount/impl/DiscountWithoutArrearsRule.java
@@ -13,6 +13,7 @@ import java.math.BigDecimal; import java.util.Date; import java.util.List; import java.util.Map; /** * 打折无欠费规则 @@ -95,7 +96,7 @@ //天数不大于1天时按1天来算 day = (date.getTime() - endTime.getTime()) / (1000 * 60 * 60 * 24) + 1; } if (day >= arrearsDay) { if (day > arrearsDay) { ComputeDiscountDto computeDiscountDto = new ComputeDiscountDto(); computeDiscountDto.setDiscountId(feeDiscountDto.getDiscountId()); computeDiscountDto.setDiscountType(FeeDiscountDto.DISCOUNT_TYPE_D); @@ -106,8 +107,8 @@ computeDiscountDto.setFeeDiscountSpecs(feeDiscountSpecDtos); return computeDiscountDto; } double price = computeFeeSMOImpl.getFeePrice(feeDtos.get(0)); BigDecimal priceDec = new BigDecimal(price); Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDtos.get(0)); BigDecimal priceDec = new BigDecimal(feePriceAll.get("feePrice").toString()); BigDecimal cycleDec = new BigDecimal(feeDiscountDto.getCycles()); double discountPrice = priceDec.multiply(cycleDec).multiply(new BigDecimal(1.0 - rate)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); service-fee/src/main/java/com/java110/fee/discount/impl/LateFeeByDayRule.java
@@ -29,6 +29,7 @@ import java.math.BigDecimal; import java.util.Date; import java.util.List; import java.util.Map; /** * @desc add by 吴学文 12:43 @@ -96,9 +97,9 @@ return computeDiscountDto; } double price = computeFeeSMOImpl.getFeePrice(feeDtos.get(0)); Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDtos.get(0)); BigDecimal priceDec = new BigDecimal(price); BigDecimal priceDec = new BigDecimal(feePriceAll.get("feePrice").toString()); BigDecimal dayDec = new BigDecimal(day); service-fee/src/main/java/com/java110/fee/discount/impl/LateFeeByMonthRule.java
@@ -29,6 +29,7 @@ import java.math.BigDecimal; import java.util.Date; import java.util.List; import java.util.Map; /** * @desc add by 吴学文 12:43 @@ -84,9 +85,9 @@ //查询费用 Double month = computeFeeSMOImpl.dayCompare(endTime, curTime); double price = computeFeeSMOImpl.getFeePrice(feeDtos.get(0)); Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDtos.get(0)); BigDecimal priceDec = new BigDecimal(price); BigDecimal priceDec = new BigDecimal(feePriceAll.get("feePrice").toString()); BigDecimal monthDec = new BigDecimal(month); service-fee/src/main/java/com/java110/fee/discount/impl/VacantHousingDiscountImpl.java
@@ -12,6 +12,7 @@ import java.math.BigDecimal; import java.util.List; import java.util.Map; /** * 空置房打折规则 @@ -78,9 +79,9 @@ feeDto.setFeeId(feeDiscountDto.getFeeId()); List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); double price = computeFeeSMOImpl.getFeePrice(feeDtos.get(0)); Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDtos.get(0)); BigDecimal priceDec = new BigDecimal(price); BigDecimal priceDec = new BigDecimal(feePriceAll.get("feePrice").toString()); //BigDecimal cycleDec = new BigDecimal(month); //2021-03-05 根据缴费 时长来算 不应该按 至少缴费来算 service-fee/src/main/java/com/java110/fee/listener/detail/SaveFeeDetailInfoListener.java
@@ -2,6 +2,9 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.java110.dto.applyRoomDiscount.ApplyRoomDiscountDto; import com.java110.intf.fee.IApplyRoomDiscountInnerServiceSMO; import com.java110.po.applyRoomDiscount.ApplyRoomDiscountPo; import com.java110.po.fee.PayFeeDetailPo; import com.java110.utils.constant.BusinessTypeConstant; import com.java110.utils.constant.StatusConstant; @@ -26,12 +29,15 @@ */ @Java110Listener("saveFeeDetailInfoListener") @Transactional public class SaveFeeDetailInfoListener extends AbstractFeeDetailBusinessServiceDataFlowListener{ public class SaveFeeDetailInfoListener extends AbstractFeeDetailBusinessServiceDataFlowListener { private static Logger logger = LoggerFactory.getLogger(SaveFeeDetailInfoListener.class); @Autowired private IFeeDetailServiceDao feeDetailServiceDaoImpl; @Autowired private IApplyRoomDiscountInnerServiceSMO applyRoomDiscountInnerServiceSMOImpl; @Override public int getOrder() { @@ -45,29 +51,30 @@ /** * 保存费用明细信息 business 表中 * * @param dataFlowContext 数据对象 * @param business 当前业务对象 * @param business 当前业务对象 */ @Override protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { JSONObject data = business.getDatas(); Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理"); //处理 businessFeeDetail 节点 if(data.containsKey(PayFeeDetailPo.class.getSimpleName())){ if (data.containsKey(PayFeeDetailPo.class.getSimpleName())) { Object bObj = data.get(PayFeeDetailPo.class.getSimpleName()); JSONArray businessFeeDetails = null; if(bObj instanceof JSONObject){ if (bObj instanceof JSONObject) { businessFeeDetails = new JSONArray(); businessFeeDetails.add(bObj); }else { businessFeeDetails = (JSONArray)bObj; } else { businessFeeDetails = (JSONArray) bObj; } //JSONObject businessFeeDetail = data.getJSONObject("businessFeeDetail"); for (int bFeeDetailIndex = 0; bFeeDetailIndex < businessFeeDetails.size();bFeeDetailIndex++) { for (int bFeeDetailIndex = 0; bFeeDetailIndex < businessFeeDetails.size(); bFeeDetailIndex++) { JSONObject businessFeeDetail = businessFeeDetails.getJSONObject(bFeeDetailIndex); doBusinessFeeDetail(business, businessFeeDetail); if(bObj instanceof JSONObject) { if (bObj instanceof JSONObject) { dataFlowContext.addParamOut("detailId", businessFeeDetail.getString("detailId")); } } @@ -76,23 +83,35 @@ /** * business 数据转移到 instance * * @param dataFlowContext 数据对象 * @param business 当前业务对象 * @param business 当前业务对象 */ @Override protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) { JSONObject data = business.getDatas(); Map info = new HashMap(); info.put("bId",business.getbId()); info.put("operate",StatusConstant.OPERATE_ADD); info.put("bId", business.getbId()); info.put("operate", StatusConstant.OPERATE_ADD); //费用明细信息 List<Map> businessFeeDetailInfo = feeDetailServiceDaoImpl.getBusinessFeeDetailInfo(info); if( businessFeeDetailInfo != null && businessFeeDetailInfo.size() >0) { if (businessFeeDetailInfo != null && businessFeeDetailInfo.size() > 0) { reFreshShareColumn(info, businessFeeDetailInfo.get(0)); feeDetailServiceDaoImpl.saveFeeDetailInfoInstance(info); if(businessFeeDetailInfo.size() == 1) { //更新优惠申请 ApplyRoomDiscountDto applyRoomDiscountDto = new ApplyRoomDiscountDto(); applyRoomDiscountDto.setbId(business.getbId()); List<ApplyRoomDiscountDto> applyRoomDiscountDtos = applyRoomDiscountInnerServiceSMOImpl.queryApplyRoomDiscounts(applyRoomDiscountDto); if (applyRoomDiscountDtos != null && applyRoomDiscountDtos.size() == 1) { ApplyRoomDiscountPo applyRoomDiscountPo = new ApplyRoomDiscountPo(); applyRoomDiscountPo.setArdId(applyRoomDiscountDtos.get(0).getArdId()); applyRoomDiscountPo.setInUse("1"); applyRoomDiscountInnerServiceSMOImpl.updateApplyRoomDiscount(applyRoomDiscountPo); } if (businessFeeDetailInfo.size() == 1) { dataFlowContext.addParamOut("detailId", businessFeeDetailInfo.get(0).get("detail_id")); } } @@ -117,49 +136,51 @@ info.put("communityId", businessInfo.get("community_id")); } /** * 撤单 * * @param dataFlowContext 数据对象 * @param business 当前业务对象 * @param business 当前业务对象 */ @Override protected void doRecover(DataFlowContext dataFlowContext, Business business) { String bId = business.getbId(); //Assert.hasLength(bId,"请求报文中没有包含 bId"); Map info = new HashMap(); info.put("bId",bId); info.put("statusCd",StatusConstant.STATUS_CD_VALID); info.put("bId", bId); info.put("statusCd", StatusConstant.STATUS_CD_VALID); Map paramIn = new HashMap(); paramIn.put("bId",bId); paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID); paramIn.put("bId", bId); paramIn.put("statusCd", StatusConstant.STATUS_CD_INVALID); //费用明细信息 List<Map> feeDetailInfo = feeDetailServiceDaoImpl.getFeeDetailInfo(info); if(feeDetailInfo != null && feeDetailInfo.size() > 0){ if (feeDetailInfo != null && feeDetailInfo.size() > 0) { reFreshShareColumn(paramIn, feeDetailInfo.get(0)); feeDetailServiceDaoImpl.updateFeeDetailInfoInstance(paramIn); } } /** * 处理 businessFeeDetail 节点 * @param business 总的数据节点 * * @param business 总的数据节点 * @param businessFeeDetail 费用明细节点 */ private void doBusinessFeeDetail(Business business,JSONObject businessFeeDetail){ private void doBusinessFeeDetail(Business business, JSONObject businessFeeDetail) { Assert.jsonObjectHaveKey(businessFeeDetail,"detailId","businessFeeDetail 节点下没有包含 detailId 节点"); Assert.jsonObjectHaveKey(businessFeeDetail, "detailId", "businessFeeDetail 节点下没有包含 detailId 节点"); if(businessFeeDetail.getString("detailId").startsWith("-")){ if (businessFeeDetail.getString("detailId").startsWith("-")) { //刷新缓存 //flushFeeDetailId(business.getDatas()); businessFeeDetail.put("detailId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_detailId)); businessFeeDetail.put("detailId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_detailId)); } businessFeeDetail.put("bId",business.getbId()); businessFeeDetail.put("bId", business.getbId()); businessFeeDetail.put("operate", StatusConstant.OPERATE_ADD); //保存费用明细信息 feeDetailServiceDaoImpl.saveBusinessFeeDetailInfo(businessFeeDetail); service-fee/src/main/java/com/java110/fee/smo/impl/FeeDetailInnerServiceSMOImpl.java
@@ -50,6 +50,23 @@ return feeDetails; } @Override public List<FeeDetailDto> queryBusinessFeeDetails(@RequestBody FeeDetailDto feeDetailDto) { //校验是否传了 分页信息 int page = feeDetailDto.getPage(); if (page != PageDto.DEFAULT_PAGE) { feeDetailDto.setPage((page - 1) * feeDetailDto.getRow()); } List<FeeDetailDto> feeDetails = BeanConvertUtil.covertBeanList(feeDetailServiceDaoImpl.getBusinessFeeDetailInfo(BeanConvertUtil.beanCovertMap(feeDetailDto)), FeeDetailDto.class); refreshFeeDetail(feeDetails); return feeDetails; } private void refreshFeeDetail(List<FeeDetailDto> feeDetails) { if(feeDetails == null || feeDetails.size() < 1){ return ; service-front/src/main/java/com/java110/front/smo/impl/FrontFeeServiceSMOImpl.java
@@ -27,7 +27,6 @@ private static Logger logger = LoggerFactory.getLogger(FrontFeeServiceSMOImpl.class); @Autowired private RestTemplate restTemplate; @@ -73,8 +72,6 @@ responseEntity = new ResponseEntity<String>("[]", HttpStatus.OK); } return responseEntity; } @@ -118,8 +115,6 @@ responseEntity = new ResponseEntity<String>("{}", HttpStatus.OK); } return responseEntity; } @@ -151,8 +146,6 @@ responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), ServiceConstant.SERVICE_API_URL + "/api/fee.payFee", HttpMethod.POST); return responseEntity; } service-front/src/main/java/com/java110/front/smo/payment/adapt/wechatPay/WechatPayAdapt.java
@@ -128,11 +128,11 @@ } resultMap.put("code", "0"); resultMap.put("msg", "下单成功"); logger.info("【小程序支付】统一下单成功,返回参数:" + resultMap); logger.info("【小程序支付】统一下单成功,返回参数:" + resultMap + "===notifyUrl===" + notifyUrl); } else { resultMap.put("code", resMap.get("return_code")); resultMap.put("msg", resMap.get("return_msg")); logger.info("【小程序支付】统一下单失败,失败原因:" + resMap.get("return_msg")); logger.info("【小程序支付】统一下单失败,失败原因:" + resMap.get("return_msg") + "===code===" + resMap.get("return_code") + "===notifyUrl===" + notifyUrl); } return resultMap; } service-front/src/main/java/com/java110/front/smo/payment/impl/ToNotifySMOImpl.java
@@ -1,38 +1,22 @@ package com.java110.front.smo.payment.impl; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.java110.core.factory.WechatFactory; import com.java110.dto.smallWeChat.SmallWeChatDto; import com.java110.front.properties.WechatAuthProperties; import com.java110.front.smo.AppAbstractComponentSMO; import com.java110.front.smo.payment.IToNotifySMO; import com.java110.front.smo.payment.adapt.IPayNotifyAdapt; import com.java110.utils.cache.MappingCache; import com.java110.utils.constant.CommonConstant; import com.java110.utils.constant.ServiceCodeConstant; import com.java110.utils.constant.ServiceConstant; import com.java110.utils.constant.WechatConstant; import com.java110.utils.factory.ApplicationContextFactory; import com.java110.utils.util.BeanConvertUtil; import com.java110.utils.util.DateUtil; import com.java110.utils.util.PayUtil; import com.java110.utils.util.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.*; import org.springframework.stereotype.Service; import org.springframework.web.client.HttpStatusCodeException; import org.springframework.web.client.RestTemplate; import javax.servlet.http.HttpServletRequest; import java.util.*; @Service("toNotifySMOImpl") public class ToNotifySMOImpl implements IToNotifySMO { private static final Logger logger = LoggerFactory.getLogger(AppAbstractComponentSMO.class); private static final String DEFAULT_PAY_NOTIFY_ADAPT = "wechatPayNotifyAdapt";// 默认微信通用支付 @@ -47,7 +31,7 @@ payNotifyAdapt = StringUtil.isEmpty(payNotifyAdapt) ? DEFAULT_PAY_NOTIFY_ADAPT : payNotifyAdapt; //支付适配器 IPayNotifyAdapt tPayNotifyAdapt = ApplicationContextFactory.getBean(payNotifyAdapt, IPayNotifyAdapt.class); String resXml = tPayNotifyAdapt.confirmPayFee(param,wId); String resXml = tPayNotifyAdapt.confirmPayFee(param, wId); logger.info("【小程序支付回调响应】 响应内容:\n" + resXml); return new ResponseEntity<String>(resXml, HttpStatus.OK); } service-job/src/main/java/com/java110/job/adapt/applyRoomDiscount/MachineAdoptApplyRoomDiscountAdapt.java
@@ -160,7 +160,7 @@ logger.info("推送微信模板,获取accessToken失败:{}", accessToken); return; } // 根据特定权限查询 有该权限的 员工 // 根据特定权限查询 有该权限的员工 BasePrivilegeDto basePrivilegeDto = new BasePrivilegeDto(); basePrivilegeDto.setResource("/wechatHousingApproval"); List<UserDto> userDtos = privilegeInnerServiceSMO.queryPrivilegeUsers(basePrivilegeDto); service-job/src/main/java/com/java110/job/adapt/fee/DeleteFeeRefreshReportAdapt.java
File was deleted service-job/src/main/java/com/java110/job/adapt/fee/ReturnPayFeeAdapt.java
New file @@ -0,0 +1,208 @@ package com.java110.job.adapt.fee; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.java110.core.factory.WechatFactory; import com.java110.dto.basePrivilege.BasePrivilegeDto; import com.java110.dto.community.CommunityDto; import com.java110.dto.fee.FeeDto; import com.java110.dto.owner.OwnerCarDto; import com.java110.dto.owner.OwnerDto; import com.java110.dto.owner.OwnerRoomRelDto; import com.java110.dto.smallWeChat.SmallWeChatDto; import com.java110.dto.smallWechatAttr.SmallWechatAttrDto; import com.java110.dto.staffAppAuth.StaffAppAuthDto; import com.java110.dto.user.UserDto; import com.java110.entity.order.Business; import com.java110.entity.wechat.Content; import com.java110.entity.wechat.Data; import com.java110.entity.wechat.PropertyFeeTemplateMessage; import com.java110.intf.community.ICommunityInnerServiceSMO; import com.java110.intf.fee.IFeeInnerServiceSMO; import com.java110.intf.order.IPrivilegeInnerServiceSMO; import com.java110.intf.store.ISmallWeChatInnerServiceSMO; import com.java110.intf.store.ISmallWechatAttrInnerServiceSMO; import com.java110.intf.user.IOwnerCarInnerServiceSMO; import com.java110.intf.user.IOwnerInnerServiceSMO; import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO; import com.java110.intf.user.IStaffAppAuthInnerServiceSMO; import com.java110.job.adapt.DatabusAdaptImpl; import com.java110.utils.cache.MappingCache; import com.java110.utils.util.Assert; import com.java110.utils.util.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; import java.util.List; /** * 退费申请通知适配器 * * @author fqz * @Date 2021-08-19 10:12 */ @Component(value = "returnPayFeeAdapt") public class ReturnPayFeeAdapt extends DatabusAdaptImpl { @Autowired private IFeeInnerServiceSMO feeInnerServiceSMOImpl; @Autowired private IOwnerRoomRelInnerServiceSMO ownerRoomRelInnerServiceSMOImpl; @Autowired private IOwnerCarInnerServiceSMO ownerCarInnerServiceSMOImpl; @Autowired private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl; @Autowired private ICommunityInnerServiceSMO communityInnerServiceSMO; @Autowired private ISmallWechatAttrInnerServiceSMO smallWechatAttrInnerServiceSMOImpl; @Autowired private ISmallWeChatInnerServiceSMO smallWeChatInnerServiceSMOImpl; @Autowired private IPrivilegeInnerServiceSMO privilegeInnerServiceSMO; @Autowired private IStaffAppAuthInnerServiceSMO staffAppAuthInnerServiceSMO; @Autowired private RestTemplate outRestTemplate; private static Logger logger = LoggerFactory.getLogger(ReturnPayFeeAdapt.class); //模板信息推送地址 private static String sendMsgUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="; @Override public void execute(Business business, List<Business> businesses) { JSONObject data = business.getData(); JSONArray jsonArray = data.getJSONArray("ReturnPayFeePo"); JSONObject param = jsonArray.getJSONObject(0); //查询小区信息 CommunityDto communityDto = new CommunityDto(); communityDto.setCommunityId(param.getString("communityId")); List<CommunityDto> communityDtos = communityInnerServiceSMO.queryCommunitys(communityDto); Assert.listOnlyOne(communityDtos, "查询小区错误!"); //获取费用详情id String detailId = param.getString("detailId"); //获取费用id String feeId = param.getString("feeId"); FeeDto feeDto = new FeeDto(); feeDto.setFeeId(feeId); //根据费用id查询费用 List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); Assert.listOnlyOne(feeDtos, "查询费用错误!"); //获取付费对象id String payerObjId = feeDtos.get(0).getPayerObjId(); String ownerId = ""; //获取付费对象类型 String payerObjType = feeDtos.get(0).getPayerObjType(); if (!StringUtil.isEmpty(payerObjType) && payerObjType.equals("3333")) { //房屋 OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto(); ownerRoomRelDto.setRoomId(payerObjId); List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto); Assert.listOnlyOne(ownerRoomRelDtos, "查询业主房屋关系错误!"); //获取业主id ownerId = ownerRoomRelDtos.get(0).getOwnerId(); } else if (!StringUtil.isEmpty(payerObjType) && payerObjType.equals("6666")) { OwnerCarDto ownerCarDto = new OwnerCarDto(); ownerCarDto.setCarId(payerObjId); ownerCarDto.setCarTypeCd("1001"); //业主车辆 List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto); Assert.listOnlyOne(ownerCarDtos, "查询业主车辆错误!"); ownerId = ownerCarDtos.get(0).getOwnerId(); } //根据业主id查询业主 OwnerDto ownerDto = new OwnerDto(); ownerDto.setOwnerId(ownerId); List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto); Assert.listOnlyOne(ownerDtos, "查询业主信息错误!"); //获取业主姓名 String name = ownerDtos.get(0).getName(); JSONObject paramIn = new JSONObject(); paramIn.put("detailId", detailId); paramIn.put("ownerId", ownerId); paramIn.put("name", name); publishMsg(paramIn, communityDtos.get(0)); } /** * 退费申请给审批员工推送信息 * * @param paramIn * @param communityDto */ private void publishMsg(JSONObject paramIn, CommunityDto communityDto) { //查询公众号配置 SmallWeChatDto smallWeChatDto = new SmallWeChatDto(); smallWeChatDto.setWeChatType("1100"); smallWeChatDto.setObjType(SmallWeChatDto.OBJ_TYPE_COMMUNITY); smallWeChatDto.setObjId(communityDto.getCommunityId()); List<SmallWeChatDto> smallWeChatDtos = smallWeChatInnerServiceSMOImpl.querySmallWeChats(smallWeChatDto); if (smallWeChatDto == null || smallWeChatDtos.size() <= 0) { logger.info("未配置微信公众号信息,定时任务执行结束"); return; } SmallWeChatDto weChatDto = smallWeChatDtos.get(0); SmallWechatAttrDto smallWechatAttrDto = new SmallWechatAttrDto(); smallWechatAttrDto.setCommunityId(communityDto.getCommunityId()); smallWechatAttrDto.setWechatId(weChatDto.getWeChatId()); smallWechatAttrDto.setSpecCd(SmallWechatAttrDto.SPEC_CD_WECHAT_PROCESS_TEMPLATE); List<SmallWechatAttrDto> smallWechatAttrDtos = smallWechatAttrInnerServiceSMOImpl.querySmallWechatAttrs(smallWechatAttrDto); if (smallWechatAttrDtos == null || smallWechatAttrDtos.size() <= 0) { logger.info("未配置微信公众号消息模板"); return; } String templateId = smallWechatAttrDtos.get(0).getValue(); String accessToken = WechatFactory.getAccessToken(weChatDto.getAppId(), weChatDto.getAppSecret()); if (StringUtil.isEmpty(accessToken)) { logger.info("推送微信模板,获取accessToken失败:{}", accessToken); return; } // 根据特定权限查询 有该权限的 员工 BasePrivilegeDto basePrivilegeDto = new BasePrivilegeDto(); basePrivilegeDto.setResource("/admin.html#/pages/property/returnPayFeeManage"); List<UserDto> userDtos = privilegeInnerServiceSMO.queryPrivilegeUsers(basePrivilegeDto); String url = sendMsgUrl + accessToken; for (UserDto userDto : userDtos) { //根据 userId 查询到openId StaffAppAuthDto staffAppAuthDto = new StaffAppAuthDto(); staffAppAuthDto.setStaffId(userDto.getUserId()); staffAppAuthDto.setAppType("WECHAT"); List<StaffAppAuthDto> staffAppAuthDtos = staffAppAuthInnerServiceSMO.queryStaffAppAuths(staffAppAuthDto); if (staffAppAuthDtos != null && staffAppAuthDtos.size() > 0) { String openId = staffAppAuthDtos.get(0).getOpenId(); Data data = new Data(); PropertyFeeTemplateMessage templateMessage = new PropertyFeeTemplateMessage(); templateMessage.setTemplate_id(templateId); templateMessage.setTouser(openId); data.setFirst(new Content("您有新的退费申请,申请信息如下:")); data.setKeyword1(new Content(paramIn.getString("detailId"))); data.setKeyword2(new Content("退费申请")); data.setKeyword3(new Content(paramIn.getString("name"))); data.setKeyword4(new Content(paramIn.getString("name") + "提交的退费申请需审批")); data.setKeyword5(new Content("申请退费")); data.setRemark(new Content("请及时处理!")); templateMessage.setData(data); //获取员工公众号地址 String wechatUrl = MappingCache.getValue("STAFF_WECHAT_URL"); templateMessage.setUrl(wechatUrl); logger.info("发送模板消息内容:{}", JSON.toJSONString(templateMessage)); ResponseEntity<String> responseEntity = outRestTemplate.postForEntity(url, JSON.toJSONString(templateMessage), String.class); logger.info("微信模板返回内容:{}", responseEntity); } } } } service-job/src/main/java/com/java110/job/adapt/payment/notice/MachinePaymentNoticeAdapt.java
@@ -192,6 +192,8 @@ String feeTypeCd = feeDtos.get(0).getFeeTypeCd(); //获取付费对象类型 String payerObjType = feeDtos.get(0).getPayerObjType(); //获取状态 String state = payFeeDetailPo.getState(); //车牌号 String carNum = ""; //停车场 @@ -220,15 +222,17 @@ paramIn.put("carNum", carNum); paramIn.put("num", num); paramIn.put("spaceNum", spaceNum); paramIn.put("state", state); //给业主推送消息 sendMessage(paramIn, communityDtos.get(0), payFeeDetailPo); if (feeTypeCd.equals("888800010012")) { if (!StringUtil.isEmpty(state) && !state.equals("1300") && feeTypeCd.equals("888800010012")) { //给处理报修完结单的维修师傅推送消息 sendMsg(paramIn, communityDtos.get(0), payFeeDetailPo); } //给员工推送消息 publishMsg(paramIn, communityDtos.get(0), payFeeDetailPo); if (!StringUtil.isEmpty(state) && !state.equals("1300")) { //给员工推送消息 publishMsg(paramIn, communityDtos.get(0), payFeeDetailPo); } } /** @@ -480,7 +484,11 @@ PropertyFeeTemplateMessage templateMessage = new PropertyFeeTemplateMessage(); templateMessage.setTemplate_id(templateId); templateMessage.setTouser(openId); data.setFirst(new Content("本次缴费已到账")); if (!StringUtil.isEmpty(paramIn.getString("state")) && paramIn.getString("state").equals("1300")) { data.setFirst(new Content("本次退费已到账")); } else { data.setFirst(new Content("本次缴费已到账")); } if (payerObjType.equals("3333")) { //房屋 data.setKeyword1(new Content(paramIn.getString("payFeeRoom"))); data.setKeyword2(new Content(paramIn.getString("feeTypeCdName"))); @@ -489,7 +497,14 @@ data.setKeyword2(new Content(paramIn.getString("feeTypeCdName") + "-" + paramIn.getString("carNum"))); } data.setKeyword3(new Content(paramIn.getString("payFeeTime"))); data.setKeyword4(new Content(paramIn.getString("receivedAmount") + "元")); if (!StringUtil.isEmpty(paramIn.getString("state")) && paramIn.getString("state").equals("1300")) { //获取退费金额 double receivedAmount = Double.parseDouble(paramIn.getString("receivedAmount")); double money = receivedAmount * (-1.00); data.setKeyword4(new Content("退费" + money + "元")); } else { data.setKeyword4(new Content(paramIn.getString("receivedAmount") + "元")); } data.setRemark(new Content("感谢您的使用,如有疑问请联系相关物业人员")); templateMessage.setData(data); //获取业主公众号地址 service-job/src/main/java/com/java110/job/adapt/payment/receipt/PayFeeReceiptAdapt.java
File was deleted service-job/src/main/java/com/java110/job/task/fee/GenerateBillProTemplate.java
@@ -243,8 +243,8 @@ if (oweMonth <= 0.0) { return; } double tmpFeePrice = computeFeeSMOImpl.getFeePrice(feeDto); feeDto.setFeePrice(tmpFeePrice); Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto); feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString())); if (feeDto.getFeePrice() <= 0) { return;//这个没有欠费可算 } service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java
@@ -5,13 +5,20 @@ import com.java110.dto.RoomDto; import com.java110.dto.fee.FeeConfigDto; import com.java110.dto.fee.FeeDto; import com.java110.dto.owner.OwnerDto; import com.java110.dto.owner.OwnerRoomRelDto; import com.java110.dto.repair.RepairDto; import com.java110.dto.repair.RepairUserDto; import com.java110.dto.report.ReportDeposit; import com.java110.dto.reportFeeMonthStatistics.ReportFeeMonthStatisticsDto; import com.java110.dto.reportFeeMonthStatistics.ReportFeeMonthStatisticsTotalDto; import com.java110.intf.community.IRepairInnerServiceSMO; import com.java110.intf.fee.IFeeConfigInnerServiceSMO; import com.java110.intf.report.IReportFeeMonthStatisticsInnerServiceSMO; import com.java110.intf.user.IOwnerInnerServiceSMO; import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO; import com.java110.report.bmo.reportFeeMonthStatistics.IGetReportFeeMonthStatisticsBMO; import com.java110.utils.util.Assert; import com.java110.utils.util.BeanConvertUtil; import com.java110.utils.util.DateUtil; import com.java110.utils.util.StringUtil; @@ -40,6 +47,15 @@ @Autowired private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl; @Autowired private IRepairInnerServiceSMO repairInnerServiceSMOImpl; @Autowired private IOwnerRoomRelInnerServiceSMO ownerRoomRelInnerServiceSMOImpl; @Autowired private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl; /** * @param reportFeeMonthStatisticsDto @@ -366,6 +382,25 @@ } //费用项目 reportFeeMonthStatistics.setFeeConfigDtos(feeConfigDtos); if (!StringUtil.isEmpty(reportFeeMonthStatistics.getRepairId())) { RepairDto repairDto = new RepairDto(); repairDto.setRepairId(reportFeeMonthStatistics.getRepairId()); //查询报修单 List<RepairDto> repairDtos = repairInnerServiceSMOImpl.queryRepairs(repairDto); Assert.listOnlyOne(repairDtos, "查询报修单错误!"); if (!StringUtil.isEmpty(repairDtos.get(0).getRepairObjType()) && repairDtos.get(0).getRepairObjType().equals("004")) { OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto(); ownerRoomRelDto.setRoomId(repairDtos.get(0).getRepairObjId()); List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto); Assert.listOnlyOne(ownerRoomRelDtos, "查询业主房屋关系表错误!"); OwnerDto ownerDto = new OwnerDto(); ownerDto.setOwnerId(ownerRoomRelDtos.get(0).getOwnerId()); ownerDto.setOwnerTypeCd("1001"); //业主本人 List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto); Assert.listOnlyOne(ownerDtos, "查询业主信息错误!"); reportFeeMonthStatistics.setOwnerName(ownerDtos.get(0).getName()); } } reportList.add(reportFeeMonthStatistics); } //应收总金额(小计) service-report/src/main/java/com/java110/report/bmo/reportOweFee/impl/GetReportOweFeeBMOImpl.java
@@ -1,6 +1,5 @@ package com.java110.report.bmo.reportOweFee.impl; import com.java110.dto.PageDto; import com.java110.dto.reportOweFee.ReportOweFeeDto; import com.java110.dto.reportOweFee.ReportOweFeeItemDto; import com.java110.intf.report.IReportOweFeeInnerServiceSMO; @@ -32,31 +31,18 @@ */ public ResponseEntity<String> get(ReportOweFeeDto reportOweFeeDto) { reportOweFeeDto.setHasOweFee("Y"); int count = reportOweFeeInnerServiceSMOImpl.queryReportOweFeesCount(reportOweFeeDto); List<ReportOweFeeDto> reportOweFeeDtos = new ArrayList<>(); List<ReportOweFeeDto> reportOweFeeDtos = null; if (count > 0) { reportOweFeeDto.setPage(PageDto.DEFAULT_PAGE); List<ReportOweFeeDto> reportOweFees = reportOweFeeInnerServiceSMOImpl.queryReportOweFees(reportOweFeeDto); refreshReportOwe(reportOweFees, reportOweFeeDto.getConfigIds()); for (ReportOweFeeDto reportOweFee : reportOweFees) { //获取欠费总金额 String amountOwed = reportOweFee.getAmountOwed(); if (!StringUtil.isEmpty(amountOwed)) { double amountOwedMoney = Double.parseDouble(amountOwed); if (amountOwedMoney > 0.0) { reportOweFeeDtos.add(reportOweFee); } else { continue; } } } reportOweFeeDtos = reportOweFeeInnerServiceSMOImpl.queryReportOweFees(reportOweFeeDto); refreshReportOwe(reportOweFeeDtos, reportOweFeeDto.getConfigIds()); } else { reportOweFeeDtos = new ArrayList<>(); } ResultVo resultVo = new ResultVo((int) Math.ceil((double) reportOweFeeDtos.size() / (double) reportOweFeeDto.getRow()), reportOweFeeDtos.size(), reportOweFeeDtos); ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reportOweFeeDto.getRow()), count, reportOweFeeDtos); ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);