Selaa lähdekoodia

1、参数设置」父子级新增【编辑】按钮。新增直接删除父级功能,且需二次弹窗确认。
2.项目信息填写时:
a.“建设期各比例”填写方式改为比例(13:45:56),回显也同理;
b.除了交通量保留整数以外,其余金额、比例数据均保留两位小数;
c.现金流入、现金流出、经营成本新增统计字段“合计”;

LHB 2 kuukautta sitten
vanhempi
commit
6ec26bbfed

+ 21 - 0
src/main/java/org/springblade/modules/investment/config/CustomDecimalSerialize.java

@@ -0,0 +1,21 @@
+package org.springblade.modules.investment.config;
+
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.SerializerProvider;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+
+public class CustomDecimalSerialize extends JsonSerializer<BigDecimal> {
+
+    @Override
+    public void serialize(BigDecimal value, JsonGenerator gen, SerializerProvider serializers)
+            throws IOException, JsonProcessingException {
+        if (value != null) {
+            value = value.setScale(2, BigDecimal.ROUND_HALF_UP);
+            gen.writeString(value.toString());
+        }
+    }
+}

+ 3 - 0
src/main/java/org/springblade/modules/investment/mapper/IbaProjectFundMapper.java

@@ -1,5 +1,7 @@
 package org.springblade.modules.investment.mapper;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import org.apache.ibatis.annotations.Param;
 import org.springblade.modules.investment.pojo.entity.IbaProjectFund;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
@@ -13,6 +15,7 @@ import java.util.List;
 */
 public interface IbaProjectFundMapper extends BaseMapper<IbaProjectFund> {
 
+    List<IbaProjectFund> selectMyList(@Param("projectId") Long projectId);
 }
 
 

+ 29 - 0
src/main/java/org/springblade/modules/investment/mapper/IbaProjectFundMapper.xml

@@ -35,4 +35,33 @@
         operate_capital_outflow,operate_operation_outflow,operate_other_outflow,operation_taxes_outflow,other_outflow,
         is_deleted,create_time,create_user,update_time,update_user
     </sql>
+    <select id="selectMyList" resultType="org.springblade.modules.investment.pojo.entity.IbaProjectFund">
+        select <include refid="Base_Column_List"/>,
+            (
+                toll_inflow +
+                other_inflow
+            ) inflowTotal,
+            (
+                construct_invest_outflow +
+                construct_proportion_outflow +
+                borrow_principal_outflow +
+                borrow_interest_outflow +
+                operate_maintain_outflow +
+                operate_overhaul_outflow +
+                operate_capital_outflow +
+                operate_operation_outflow +
+                operate_other_outflow +
+                operation_taxes_outflow +
+                other_outflow
+            ) as outflowTotal,
+            (
+                operate_maintain_outflow+
+                operate_overhaul_outflow+
+                operate_capital_outflow+
+                operate_operation_outflow+
+                operate_other_outflow
+            ) as costTotal
+
+            from iba_project_fund where project_id = #{projectId}
+    </select>
 </mapper>

+ 87 - 35
src/main/java/org/springblade/modules/investment/pojo/entity/IbaProjectFund.java

@@ -1,19 +1,27 @@
 package org.springblade.modules.investment.pojo.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.math.BigDecimal;
 import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import lombok.Data;
+import org.springblade.modules.investment.config.CustomDecimalSerialize;
 
 /**
  * 项目资金信息
+ *
  * @TableName iba_project_fund
  */
-@TableName(value ="iba_project_fund")
+@TableName(value = "iba_project_fund")
 @Data
 public class IbaProjectFund {
     /**
-     * 
+     *
      */
     @TableId
     private Long id;
@@ -31,67 +39,88 @@ public class IbaProjectFund {
     /**
      * 流入-通行费
      */
-    private Double tollInflow;
+    @JsonSerialize(using = CustomDecimalSerialize.class)
+    private BigDecimal tollInflow;
 
     /**
      * 流入-其他
      */
-    private Double otherInflow;
+    @JsonSerialize(using = CustomDecimalSerialize.class)
+    private BigDecimal otherInflow;
 
     /**
      * 流出-建设期总投资额
      */
-    private Double constructInvestOutflow;
+    @JsonSerialize(using = CustomDecimalSerialize.class)
+    private BigDecimal constructInvestOutflow;
 
     /**
      * 流出-建设期各年份投入比例
      */
-    private Double constructProportionOutflow;
+    private String constructProportionOutflow;
 
     /**
      * 流出-借贷本金偿还
      */
-    private Double borrowPrincipalOutflow;
+
+    @JsonSerialize(using = CustomDecimalSerialize.class)
+    private BigDecimal borrowPrincipalOutflow;
 
     /**
      * 流出-借贷利息偿还
      */
-    private Double borrowInterestOutflow;
+
+    @JsonSerialize(using = CustomDecimalSerialize.class)
+    private BigDecimal borrowInterestOutflow;
 
     /**
      * 流出-经营成本-养护、小修费
      */
-    private Double operateMaintainOutflow;
+
+    @JsonSerialize(using = CustomDecimalSerialize.class)
+    private BigDecimal operateMaintainOutflow;
 
     /**
      * 流出-经营成本-大修费
      */
-    private Double operateOverhaulOutflow;
+
+    @JsonSerialize(using = CustomDecimalSerialize.class)
+    private BigDecimal operateOverhaulOutflow;
 
     /**
      * 流出-经营成本-资本性支出
      */
-    private Double operateCapitalOutflow;
+
+    @JsonSerialize(using = CustomDecimalSerialize.class)
+    private BigDecimal operateCapitalOutflow;
 
     /**
      * 流出-经营成本-运营管理费
      */
-    private Double operateOperationOutflow;
+
+    @JsonSerialize(using = CustomDecimalSerialize.class)
+    private BigDecimal operateOperationOutflow;
 
     /**
      * 流出-经营成本-其他费用
      */
-    private Double operateOtherOutflow;
+
+    @JsonSerialize(using = CustomDecimalSerialize.class)
+    private BigDecimal operateOtherOutflow;
 
     /**
      * 流出-运营期税金
      */
-    private Double operationTaxesOutflow;
+
+    @JsonSerialize(using = CustomDecimalSerialize.class)
+    private BigDecimal operationTaxesOutflow;
 
     /**
      * 流出-其他费用
      */
-    private Double otherOutflow;
+
+    @JsonSerialize(using = CustomDecimalSerialize.class)
+    private BigDecimal otherOutflow;
 
     /**
      * 是否删除(0-未删除,1-删除)
@@ -118,6 +147,29 @@ public class IbaProjectFund {
      */
     private String updateUser;
 
+
+    /**
+     * 流入统计
+     */
+    @TableField(exist = false)
+    @JsonSerialize(using = CustomDecimalSerialize.class)
+    private BigDecimal inflowTotal;
+
+    /**
+     * 流出统计
+     */
+    @TableField(exist = false)
+    @JsonSerialize(using = CustomDecimalSerialize.class)
+    private BigDecimal outflowTotal;
+
+    /**
+     * 成本统计
+     */
+    @TableField(exist = false)
+    @JsonSerialize(using = CustomDecimalSerialize.class)
+    private BigDecimal costTotal;
+
+
     @Override
     public boolean equals(Object that) {
         if (this == that) {
@@ -131,26 +183,26 @@ public class IbaProjectFund {
         }
         IbaProjectFund other = (IbaProjectFund) that;
         return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
-            && (this.getProjectId() == null ? other.getProjectId() == null : this.getProjectId().equals(other.getProjectId()))
-            && (this.getYear() == null ? other.getYear() == null : this.getYear().equals(other.getYear()))
-            && (this.getTollInflow() == null ? other.getTollInflow() == null : this.getTollInflow().equals(other.getTollInflow()))
-            && (this.getOtherInflow() == null ? other.getOtherInflow() == null : this.getOtherInflow().equals(other.getOtherInflow()))
-            && (this.getConstructInvestOutflow() == null ? other.getConstructInvestOutflow() == null : this.getConstructInvestOutflow().equals(other.getConstructInvestOutflow()))
-            && (this.getConstructProportionOutflow() == null ? other.getConstructProportionOutflow() == null : this.getConstructProportionOutflow().equals(other.getConstructProportionOutflow()))
-            && (this.getBorrowPrincipalOutflow() == null ? other.getBorrowPrincipalOutflow() == null : this.getBorrowPrincipalOutflow().equals(other.getBorrowPrincipalOutflow()))
-            && (this.getBorrowInterestOutflow() == null ? other.getBorrowInterestOutflow() == null : this.getBorrowInterestOutflow().equals(other.getBorrowInterestOutflow()))
-            && (this.getOperateMaintainOutflow() == null ? other.getOperateMaintainOutflow() == null : this.getOperateMaintainOutflow().equals(other.getOperateMaintainOutflow()))
-            && (this.getOperateOverhaulOutflow() == null ? other.getOperateOverhaulOutflow() == null : this.getOperateOverhaulOutflow().equals(other.getOperateOverhaulOutflow()))
-            && (this.getOperateCapitalOutflow() == null ? other.getOperateCapitalOutflow() == null : this.getOperateCapitalOutflow().equals(other.getOperateCapitalOutflow()))
-            && (this.getOperateOperationOutflow() == null ? other.getOperateOperationOutflow() == null : this.getOperateOperationOutflow().equals(other.getOperateOperationOutflow()))
-            && (this.getOperateOtherOutflow() == null ? other.getOperateOtherOutflow() == null : this.getOperateOtherOutflow().equals(other.getOperateOtherOutflow()))
-            && (this.getOperationTaxesOutflow() == null ? other.getOperationTaxesOutflow() == null : this.getOperationTaxesOutflow().equals(other.getOperationTaxesOutflow()))
-            && (this.getOtherOutflow() == null ? other.getOtherOutflow() == null : this.getOtherOutflow().equals(other.getOtherOutflow()))
-            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
-            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
-            && (this.getCreateUser() == null ? other.getCreateUser() == null : this.getCreateUser().equals(other.getCreateUser()))
-            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
-            && (this.getUpdateUser() == null ? other.getUpdateUser() == null : this.getUpdateUser().equals(other.getUpdateUser()));
+                && (this.getProjectId() == null ? other.getProjectId() == null : this.getProjectId().equals(other.getProjectId()))
+                && (this.getYear() == null ? other.getYear() == null : this.getYear().equals(other.getYear()))
+                && (this.getTollInflow() == null ? other.getTollInflow() == null : this.getTollInflow().equals(other.getTollInflow()))
+                && (this.getOtherInflow() == null ? other.getOtherInflow() == null : this.getOtherInflow().equals(other.getOtherInflow()))
+                && (this.getConstructInvestOutflow() == null ? other.getConstructInvestOutflow() == null : this.getConstructInvestOutflow().equals(other.getConstructInvestOutflow()))
+                && (this.getConstructProportionOutflow() == null ? other.getConstructProportionOutflow() == null : this.getConstructProportionOutflow().equals(other.getConstructProportionOutflow()))
+                && (this.getBorrowPrincipalOutflow() == null ? other.getBorrowPrincipalOutflow() == null : this.getBorrowPrincipalOutflow().equals(other.getBorrowPrincipalOutflow()))
+                && (this.getBorrowInterestOutflow() == null ? other.getBorrowInterestOutflow() == null : this.getBorrowInterestOutflow().equals(other.getBorrowInterestOutflow()))
+                && (this.getOperateMaintainOutflow() == null ? other.getOperateMaintainOutflow() == null : this.getOperateMaintainOutflow().equals(other.getOperateMaintainOutflow()))
+                && (this.getOperateOverhaulOutflow() == null ? other.getOperateOverhaulOutflow() == null : this.getOperateOverhaulOutflow().equals(other.getOperateOverhaulOutflow()))
+                && (this.getOperateCapitalOutflow() == null ? other.getOperateCapitalOutflow() == null : this.getOperateCapitalOutflow().equals(other.getOperateCapitalOutflow()))
+                && (this.getOperateOperationOutflow() == null ? other.getOperateOperationOutflow() == null : this.getOperateOperationOutflow().equals(other.getOperateOperationOutflow()))
+                && (this.getOperateOtherOutflow() == null ? other.getOperateOtherOutflow() == null : this.getOperateOtherOutflow().equals(other.getOperateOtherOutflow()))
+                && (this.getOperationTaxesOutflow() == null ? other.getOperationTaxesOutflow() == null : this.getOperationTaxesOutflow().equals(other.getOperationTaxesOutflow()))
+                && (this.getOtherOutflow() == null ? other.getOtherOutflow() == null : this.getOtherOutflow().equals(other.getOtherOutflow()))
+                && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
+                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
+                && (this.getCreateUser() == null ? other.getCreateUser() == null : this.getCreateUser().equals(other.getCreateUser()))
+                && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
+                && (this.getUpdateUser() == null ? other.getUpdateUser() == null : this.getUpdateUser().equals(other.getUpdateUser()));
     }
 
     @Override

+ 1 - 1
src/main/java/org/springblade/modules/investment/service/impl/IbaProjectServiceImpl.java

@@ -56,7 +56,7 @@ public class IbaProjectServiceImpl extends ServiceImpl<IbaProjectMapper, IbaProj
     public IbaProject queryById(Long id) {
         IbaProject ibaProject = baseMapper.selectById(id);
         if (ibaProject != null) {
-            List<IbaProjectFund> ibaProjectFunds = projectFundMapper.selectList(new QueryWrapper<IbaProjectFund>().lambda().eq(IbaProjectFund::getProjectId, id));
+            List<IbaProjectFund> ibaProjectFunds = projectFundMapper.selectMyList(id);
             //资金信息
             ibaProject.setFunds(ibaProjectFunds);
 

+ 10 - 5
src/main/java/org/springblade/modules/system/service/impl/DictBizServiceImpl.java

@@ -119,12 +119,17 @@ public class DictBizServiceImpl extends ServiceImpl<DictBizMapper, DictBiz> impl
 	}
 
 	@Override
+	@Transactional
 	public boolean removeDict(String ids) {
-		Long cnt = baseMapper.selectCount(Wrappers.<DictBiz>query().lambda().in(DictBiz::getParentId, Func.toLongList(ids)));
-		if (cnt > 0L) {
-			throw new ServiceException("请先删除子节点!");
-		}
-		return removeByIds(Func.toLongList(ids));
+//		Long cnt = baseMapper.selectCount(Wrappers.<DictBiz>query().lambda().in(DictBiz::getParentId, Func.toLongList(ids)));
+//		if (cnt > 0L) {
+//			throw new ServiceException("请先删除子节点!");
+//		}
+		//删除当前节点
+		baseMapper.delete(Wrappers.<DictBiz>lambdaQuery().in(DictBiz::getId,  Func.toLongList(ids)));
+		//和子节点
+		baseMapper.delete(Wrappers.<DictBiz>lambdaQuery().in(DictBiz::getParentId,  Func.toLongList(ids)));
+		return true;
 	}
 
 	@Override