WoNiu 4 лет назад
Родитель
Сommit
5a3349504d

+ 3 - 2
src/main/java/com/galaxis/manatee/dao/ChuanyunProjectCostDao.java

@@ -24,8 +24,9 @@ public interface ChuanyunProjectCostDao extends GalaxisRepository<ChuanyunProjec
             "SUM(chuanyun_member_cost.person_days) AS person_days," +
             "chuanyun_member_cost.project_type," +
             "chuanyun_member_cost.status," +
-            "chuanyun_member_cost.project_id " +
-            "FROM chuanyun_member_cost " +
+            "chuanyun_member_cost.project_id, " +
+            "chuanyun_member_cost.cost AS amount" +
+            " FROM chuanyun_member_cost " +
             "GROUP BY chuanyun_member_cost.project_id,"+
             "chuanyun_member_cost.status",
             nativeQuery = true)

+ 1 - 1
src/main/java/com/galaxis/manatee/dao/ChuanyunReimbursementAmountDao.java

@@ -9,6 +9,6 @@ import org.springframework.stereotype.Repository;
 @Repository
 public interface ChuanyunReimbursementAmountDao extends GalaxisRepository<ChuanyunReimbursementAmountDO,String> {
 
-    @Query(value="SELECT SUM(amount),object_id  FROM chuanyun_reimbursement WHERE chuanyun_reimbursement.group_project_id = ?",nativeQuery = true)
+    @Query(value="SELECT SUM(chuanyun_reimbursement.amount) AS total_amount,chuanyun_reimbursement.object_id  FROM chuanyun_reimbursement WHERE chuanyun_reimbursement.group_project_id = ?",nativeQuery = true)
     ChuanyunReimbursementAmountDO getAmount(String projectId);
 }

+ 2 - 0
src/main/java/com/galaxis/manatee/entity/chuanyun/data/object/ChuanyunProjectCostDO.java

@@ -42,4 +42,6 @@ public class ChuanyunProjectCostDO {
     private BigDecimal cost;
 
     private BigDecimal personDays;
+
+    private BigDecimal amount;
 }

+ 8 - 4
src/main/java/com/galaxis/manatee/entity/chuanyun/data/object/ChuanyunReimbursementAmountDO.java

@@ -2,7 +2,9 @@ package com.galaxis.manatee.entity.chuanyun.data.object;
 
 
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.hibernate.annotations.GenericGenerator;
 
@@ -14,12 +16,14 @@ import java.math.BigDecimal;
 @Slf4j
 @Data
 @Entity
+@NoArgsConstructor
+@AllArgsConstructor
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class ChuanyunReimbursementAmountDO {
     @Id
-    @GeneratedValue(generator = "idGeneratorChuanyunMemberCost")
-    @GenericGenerator(name ="idGeneratorChuanyunMemberCost" ,strategy="com.galaxis.capsule.util.GalaxisIdGenerator")
-    private Long objectId;
+//    @GeneratedValue(generator = "idGeneratorChuanyunReimbursementAmount")
+//    @GenericGenerator(name ="idGeneratorChuanyunReimbursementAmount" ,strategy="com.galaxis.capsule.util.GalaxisIdGenerator")
+    private String objectId;
 
-    private BigDecimal amount;
+    private BigDecimal totalAmount;
 }

Разница между файлами не показана из-за своего большого размера
+ 17 - 105
src/main/java/com/galaxis/manatee/task/ChuanyunProjectScheduledTask.java