Преглед на файлове

完善账单详情页功能

ljh преди 2 години
родител
ревизия
011a600b6c

+ 4 - 0
core/src/main/java/com/mooctest/crowd/domain/domainobject/BookTest.java

@@ -10,6 +10,10 @@ import java.util.Date;
 public class BookTest {
     private long id;
     private long uid;
+    private String uname;
+    private String subname;
+    private String number;
+    private String code;
     private long rmid;
     private String cptcode;
     private String cttcode;

+ 11 - 0
core/src/main/java/com/mooctest/crowd/domain/model/BookTestPO.java

@@ -22,6 +22,9 @@ public class BookTestPO {
     @Column(name = "b_u_id")
     private long uid;
 
+    @Column(name = "b_u_name")
+    private String uname;
+
     @Column(name = "b_rm_id")
     private long rmid;
 
@@ -34,6 +37,14 @@ public class BookTestPO {
     @Column(name = "b_state")
     private int state;
 
+    @Column(name="b_number")
+    private String number;
+
+    @Column(name="b_subname")
+    private String subname;
+
+    @Column(name = "b_bc_code")
+    private  String code;
     //新增字段
     @Column(name = "effective_workload_amount")
     private BigDecimal effectiveWorkloadAmount;

+ 6 - 0
core/src/main/java/com/mooctest/crowd/domain/repository/BookTestRepo.java

@@ -320,4 +320,10 @@ public class BookTestRepo {
         BookTestPO bookTest = bookTestDao.save(book);
         return bookTest;
     }
+    public List<BankCardPO> getbankcard(long uid){
+        //根据id找银行卡号
+        List<BankCardPO> bankCardPOList  = bankCardDao.findByUserIdAndIsDeleted(uid,0);
+        return bankCardPOList;
+
+    }
 }

+ 8 - 0
site/src/main/java/com/mooctest/crowd/site/data/vo/BookTestVO.java

@@ -21,8 +21,12 @@ import java.util.List;
 public class BookTestVO implements Serializable {
     private long id;
     private long uid;
+    private String uname;
     private String cptcode;
     private String cttcode;
+    private String subname;
+    private String number;
+    private String code;
     private BigDecimal totalAmount= new BigDecimal(0.0);
     private int state;
     private String stateName;
@@ -70,11 +74,15 @@ public class BookTestVO implements Serializable {
     public BookTestVO(BookTest bookTest) {
         id = bookTest.getId();
         uid = bookTest.getUid();
+        uname = bookTest.getUname();
         cptcode = bookTest.getCptcode();
         cptname = bookTest.getCptname();
         cttcode = bookTest.getCttcode();
         cttname = bookTest.getCttname();
         state = bookTest.getState();
+        subname = bookTest.getSubname();
+        number = bookTest.getNumber();
+        code = bookTest.getCode();
         formatStateName(state);
         acceptTime = formatTime(bookTest.getAcceptTime());
         submitTime = formatTime(bookTest.getSubmitTime());

+ 61 - 55
site/src/main/java/com/mooctest/crowd/site/service/impl/BookTestServiceImpl.java

@@ -2,10 +2,7 @@ package com.mooctest.crowd.site.service.impl;
 
 import com.mooctest.crowd.domain.dao.BookTestDao;
 import com.mooctest.crowd.domain.domainobject.*;
-import com.mooctest.crowd.domain.model.BalancePO;
-import com.mooctest.crowd.domain.model.BookTestPO;
-import com.mooctest.crowd.domain.model.ResourcePO;
-import com.mooctest.crowd.domain.model.ResourceTypePO;
+import com.mooctest.crowd.domain.model.*;
 import com.mooctest.crowd.domain.repository.BookTestRepo;
 import com.mooctest.crowd.domain.repository.CrowdTestProjectRepo;
 import com.mooctest.crowd.domain.util.Converter;
@@ -90,58 +87,67 @@ public class  BookTestServiceImpl implements BookTestService {
         if (testerAmounts.size() > 0) {
             for (TaskAmountVO.TesterAmountVO testerAmount : testerAmounts) {
                 BookTestPO book = new BookTestPO();
-                book.setUid(testerAmount.getTesterId());
-                //根据项目编号查询发包机构ID
-                String cptcode = taskAmountVO.getProjectCode();
-                if (cptcode != null && cptcode.length() > 0) {
-                    CrowdTestProject project = projectRepo.getByProjectCode(cptcode);
-                    if(project != null)
-                    book.setRmid(project.getRegionalManagerId());
+                List<BankCardPO> bankCardPOList = bookTestRepo.getbankcard(testerAmount.getTesterId());
+                if (bankCardPOList != null && bankCardPOList.size() > 0) {
+                    for (BankCardPO bankCardPO : bankCardPOList) {
+                        book.setUid(testerAmount.getTesterId());
+                        book.setNumber(bankCardPO.getNumber());
+                        book.setCode(bankCardPO.getCode());
+                        book.setSubname(bankCardPO.getSubName());
+                        //根据项目编号查询发包机构ID
+                        String cptcode = taskAmountVO.getProjectCode();
+                        if (cptcode != null && cptcode.length() > 0) {
+                            CrowdTestProject project = projectRepo.getByProjectCode(cptcode);
+                            if (project != null)
+                                book.setRmid(project.getRegionalManagerId());
+                        }
+                        book.setUname(testerAmount.getTesterRealName());
+                        book.setCttcode(taskAmountVO.getTaskCode());
+                        book.setCptcode(taskAmountVO.getProjectCode());
+                        book.setEffectiveWorkloadAmount(testerAmount.getEffectiveWorkloadAmount());
+                        book.setDefectExciationAmount(testerAmount.getDefectExciationAmount());
+                        book.setExtraRewardAmount(testerAmount.getExtraRewardAmount());
+                        book.setState(0);
+                        BigDecimal effectiveWorkloadAmount = testerAmount.getEffectiveWorkloadAmount();
+                        BigDecimal defectExciationAmount = testerAmount.getDefectExciationAmount();
+                        BigDecimal extraRewardAmount = testerAmount.getExtraRewardAmount();
+                        BigDecimal totalAmount = effectiveWorkloadAmount.add(defectExciationAmount).add(extraRewardAmount);
+                        book.setTotalAmount(totalAmount);
+                        //缺陷数量
+                        book.setNotTopHighDefectCount(testerAmount.getNotTopHighDefectCount());
+                        book.setNotTopLowDefectCount(testerAmount.getNotTopLowDefectCount());
+                        book.setNotTopMidDefectCount(testerAmount.getNotTopMidDefectCount());
+                        book.setNotTopVeryHighDefectCount(testerAmount.getNotTopVeryHighDefectCount());
+                        book.setNotTopVeryLowDefectCount(testerAmount.getNotTopVeryLowDefectCount());
+                        book.setOnlyOneHighDefectCount(testerAmount.getOnlyOneHighDefectCount());
+                        book.setOnlyOneLowDefectCount(testerAmount.getOnlyOneLowDefectCount());
+                        book.setOnlyOneMidDefectCount(testerAmount.getOnlyOneMidDefectCount());
+                        book.setOnlyOneVeryHighDefectCount(testerAmount.getOnlyOneVeryHighDefectCount());
+                        book.setOnlyOneVeryLowDefectCount(testerAmount.getOnlyOneVeryLowDefectCount());
+                        book.setTopHighDefectCount(testerAmount.getTopHighDefectCount());
+                        book.setTopLowDefectCount(testerAmount.getTopLowDefectCount());
+                        book.setTopMidDefectCount(testerAmount.getTopMidDefectCount());
+                        book.setTopVeryHighDefectCount(testerAmount.getTopVeryHighDefectCount());
+                        book.setTopVeryLowDefectCount(testerAmount.getTopVeryLowDefectCount());
+                        //缺陷得分
+                        book.setNotTopHighDefectScore(testerAmount.getNotTopHighDefectScore());
+                        book.setNotTopLowDefectScore(testerAmount.getNotTopLowDefectScore());
+                        book.setNotTopMidDefectScore(testerAmount.getNotTopMidDefectScore());
+                        book.setNotTopVeryHighDefectScore(testerAmount.getNotTopVeryHighDefectScore());
+                        book.setNotTopVeryLowDefectScore(testerAmount.getNotTopVeryLowDefectScore());
+                        book.setOnlyOneHighDefectScore(testerAmount.getOnlyOneHighDefectScore());
+                        book.setOnlyOneLowDefectScore(testerAmount.getOnlyOneLowDefectScore());
+                        book.setOnlyOneMidDefectScore(testerAmount.getOnlyOneMidDefectScore());
+                        book.setOnlyOneVeryHighDefectScore(testerAmount.getOnlyOneVeryHighDefectScore());
+                        book.setOnlyOneVeryLowDefectScore(testerAmount.getOnlyOneVeryLowDefectScore());
+                        book.setTopHighDefectScore(testerAmount.getTopHighDefectScore());
+                        book.setTopLowDefectScore(testerAmount.getTopLowDefectScore());
+                        book.setTopMidDefectScore(testerAmount.getTopMidDefectScore());
+                        book.setTopVeryHighDefectScore(testerAmount.getTopVeryHighDefectScore());
+                        book.setTopVeryLowDefectScore(testerAmount.getTopVeryLowDefectScore());
+                        bookTestRepo.saveBookTest(book);
+                    }
                 }
-                book.setCttcode(taskAmountVO.getTaskCode());
-                book.setCptcode(taskAmountVO.getProjectCode());
-                book.setEffectiveWorkloadAmount(testerAmount.getEffectiveWorkloadAmount());
-                book.setDefectExciationAmount(testerAmount.getDefectExciationAmount());
-                book.setExtraRewardAmount(testerAmount.getExtraRewardAmount());
-                book.setState(0);
-                BigDecimal effectiveWorkloadAmount = testerAmount.getEffectiveWorkloadAmount();
-                BigDecimal defectExciationAmount = testerAmount.getDefectExciationAmount();
-                BigDecimal extraRewardAmount = testerAmount.getExtraRewardAmount();
-                BigDecimal totalAmount = effectiveWorkloadAmount.add(defectExciationAmount).add(extraRewardAmount);
-                book.setTotalAmount(totalAmount);
-                //缺陷数量
-                book.setNotTopHighDefectCount(testerAmount.getNotTopHighDefectCount());
-                book.setNotTopLowDefectCount(testerAmount.getNotTopLowDefectCount());
-                book.setNotTopMidDefectCount(testerAmount.getNotTopMidDefectCount());
-                book.setNotTopVeryHighDefectCount(testerAmount.getNotTopVeryHighDefectCount());
-                book.setNotTopVeryLowDefectCount(testerAmount.getNotTopVeryLowDefectCount());
-                book.setOnlyOneHighDefectCount(testerAmount.getOnlyOneHighDefectCount());
-                book.setOnlyOneLowDefectCount(testerAmount.getOnlyOneLowDefectCount());
-                book.setOnlyOneMidDefectCount(testerAmount.getOnlyOneMidDefectCount());
-                book.setOnlyOneVeryHighDefectCount(testerAmount.getOnlyOneVeryHighDefectCount());
-                book.setOnlyOneVeryLowDefectCount(testerAmount.getOnlyOneVeryLowDefectCount());
-                book.setTopHighDefectCount(testerAmount.getTopHighDefectCount());
-                book.setTopLowDefectCount(testerAmount.getTopLowDefectCount());
-                book.setTopMidDefectCount(testerAmount.getTopMidDefectCount());
-                book.setTopVeryHighDefectCount(testerAmount.getTopVeryHighDefectCount());
-                book.setTopVeryLowDefectCount(testerAmount.getTopVeryLowDefectCount());
-                //缺陷得分
-                book.setNotTopHighDefectScore(testerAmount.getNotTopHighDefectScore());
-                book.setNotTopLowDefectScore(testerAmount.getNotTopLowDefectScore());
-                book.setNotTopMidDefectScore(testerAmount.getNotTopMidDefectScore());
-                book.setNotTopVeryHighDefectScore(testerAmount.getNotTopVeryHighDefectScore());
-                book.setNotTopVeryLowDefectScore(testerAmount.getNotTopVeryLowDefectScore());
-                book.setOnlyOneHighDefectScore(testerAmount.getOnlyOneHighDefectScore());
-                book.setOnlyOneLowDefectScore(testerAmount.getOnlyOneLowDefectScore());
-                book.setOnlyOneMidDefectScore(testerAmount.getOnlyOneMidDefectScore());
-                book.setOnlyOneVeryHighDefectScore(testerAmount.getOnlyOneVeryHighDefectScore());
-                book.setOnlyOneVeryLowDefectScore(testerAmount.getOnlyOneVeryLowDefectScore());
-                book.setTopHighDefectScore(testerAmount.getTopHighDefectScore());
-                book.setTopLowDefectScore(testerAmount.getTopLowDefectScore());
-                book.setTopMidDefectScore(testerAmount.getTopMidDefectScore());
-                book.setTopVeryHighDefectScore(testerAmount.getTopVeryHighDefectScore());
-                book.setTopVeryLowDefectScore(testerAmount.getTopVeryLowDefectScore());
-                bookTestRepo.saveBookTest(book);
             }
         }