Просмотр исходного кода

Merge branch 'feature-V2.0' of ssh://git.mooctest.com:1022/crowd-2019/crowd-test-service-backend into feature-V2.0

guo00guo 5 лет назад
Родитель
Сommit
f02836f648
17 измененных файлов с 101 добавлено и 36 удалено
  1. 1 0
      core/src/main/java/com/mooctest/crowd/domain/dao/UserDao.java
  2. 1 0
      core/src/main/java/com/mooctest/crowd/domain/domainobject/EnterpriseAuthentication.java
  3. 19 14
      core/src/main/java/com/mooctest/crowd/domain/model/EnterpriseAuthenticationPO.java
  4. 6 2
      core/src/main/java/com/mooctest/crowd/domain/model/PersonalAuthenticationPO.java
  5. 14 1
      core/src/main/java/com/mooctest/crowd/domain/repository/UserRepo.java
  6. 0 1
      site/src/main/java/com/mooctest/crowd/site/command/ApplyAgencyAuthCommand.java
  7. 7 4
      site/src/main/java/com/mooctest/crowd/site/command/ApplyEnterpriseAuthCommand.java
  8. 5 0
      site/src/main/java/com/mooctest/crowd/site/controller/PersonalDataController.java
  9. 1 1
      site/src/main/java/com/mooctest/crowd/site/data/dto/MyCrowdDTO.java
  10. 0 1
      site/src/main/java/com/mooctest/crowd/site/data/dto/QualificationDTO.java
  11. 1 0
      site/src/main/java/com/mooctest/crowd/site/mediator/ViewMediator.java
  12. 27 1
      site/src/main/java/com/mooctest/crowd/site/mediator/impl/WebMediatorImpl.java
  13. 2 0
      site/src/main/java/com/mooctest/crowd/site/service/PersonalDataService.java
  14. 1 0
      site/src/main/java/com/mooctest/crowd/site/service/impl/CrowdProjectServiceImpl.java
  15. 5 0
      site/src/main/java/com/mooctest/crowd/site/service/impl/PersonalDataServiceImpl.java
  16. 11 11
      site/src/main/java/com/mooctest/crowd/site/service/impl/ThemeSchedulerServiceImpl.java
  17. 0 0
      site/src/main/java/com/mooctest/crowd/site/service/impl/UserServiceImpl.java

+ 1 - 0
core/src/main/java/com/mooctest/crowd/domain/dao/UserDao.java

@@ -6,6 +6,7 @@ import org.springframework.data.repository.CrudRepository;
 import org.springframework.data.repository.PagingAndSortingRepository;
 
 import javax.transaction.Transactional;
+import java.util.List;
 import java.util.Optional;
 
 @Transactional

+ 1 - 0
core/src/main/java/com/mooctest/crowd/domain/domainobject/EnterpriseAuthentication.java

@@ -13,6 +13,7 @@ import java.sql.Timestamp;
  */
 @Data
 public class EnterpriseAuthentication {
+    private  String isDaOrEa;//是研发机构还是评测机构
     private Long id;
     private Long userId;
     private String IDCardNum;//身份证号码

+ 19 - 14
core/src/main/java/com/mooctest/crowd/domain/model/EnterpriseAuthenticationPO.java

@@ -11,49 +11,54 @@ import java.sql.Timestamp;
  */
 @Data
 @Entity
-@Table(name = "enterprise_authentication")
+@Table(name = "develop_authentication")
 public class EnterpriseAuthenticationPO {
 
     @Id
-    @Column(name = "EA_ID")
+    @Column(name = "DA_ID")
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     private Long id;
 
-    @Column(name = "EA_USER_ID")
+    @Column(name = "DA_USER_ID")
     private Long userId;
 
-    @Column(name = "EA_ENTERPRISE_NAME")
+    @Column(name = "DA_NAME")
     private String enterpriseName;
 
-    @Column(name = "EA_LEGAL_PERSON_NAME")
+    @Column(name = "DA_LEGAL_PERSON_NAME")
     private String legalPersonName;
 
-    @Column(name = "EA_BUSINESS_LICENSE_PHOTO")
+    @Column(name = "DA_BUSINESS_LICENSE_PHOTO")
     private String businessLicensePhoto;
 
-    @Column(name = "EA_UNIFIED_SOCIAL_CREDIT_CODE")
+    @Column(name = "DA_UNIFIED_SOCIAL_CREDIT_CODE")
     private String unifiedSocialCreditCode;
 
-    @Column(name = "EA_BANK_ACCOUNT")
+    @Column(name = "DA_BANK_ACCOUNT")
     private String bankAccount;
 
-    @Column(name = "EA_ADDRESS")
+    @Column(name = "DA_ADDRESS")
     private String address;
 
-    @Column(name = "EA_IS_DELETED")
+    @Column(name = "DA_IS_DELETED")
     private int isDeleted;
 
-    @Column(name = "EA_IS_AUTHENTICATION")
+    @Column(name = "DA_IS_AUTHENTICATION")
     private int isAuthentication;
 
-    @Column(name = "EA_NOT_PASS_EXPLAIN")
+    @Column(name = "DA_NOT_PASS_EXPLAIN")
     private String explain;
 
-    @Column(name = "EA_CHECK_TIME")
+    @Column(name = "DA_CHECK_TIME")
     private Timestamp checkTime;
 
-    @Column(name = "EA_APPLY_TIME")
+    @Column(name = "DA_APPLY_TIME")
     private Timestamp applyTime;
 
 
+    @Column(name = "DA_ID_CARD_BACK_PHOTO")
+    private String IDCardBackPhoto;
+    @Column(name = "DA_ID_CARD_POS_PHOTO")
+    private String IDcardPositivePhoto;
+
 }

+ 6 - 2
core/src/main/java/com/mooctest/crowd/domain/model/PersonalAuthenticationPO.java

@@ -53,16 +53,20 @@ public class PersonalAuthenticationPO {
     private Timestamp checkTime;
 
     @Column(name = "PA_ID_CARD_POS_PHOTO")
-    private String  idCardPositivePhoto;//身份证正面照片
+    private String  IDCardPositivePhoto;//身份证正面照片
 
 
     @Column(name = "PA_ID_CARD_BACK_PHOTO")
-    private String  idCardBackPhoto;//身份证正面照片
+    private String  IDCardBackPhoto;//身份证正面照片
 
 
     @Column(name = "PA_EXPIRE_TIME")
     private Timestamp  IDCardDeadTime;
 
 
+    @Column(name = "PA_Sex")
+    private  String  sex;
+
+
 
 }

+ 14 - 1
core/src/main/java/com/mooctest/crowd/domain/repository/UserRepo.java

@@ -12,6 +12,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import javax.security.auth.login.Configuration;
 import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.List;
@@ -24,6 +25,8 @@ import java.util.Optional;
 
 @Component
 public class UserRepo implements IUserRepo {
+    @Autowired
+    private  EvaluationAgencyDao agencyDao;
 
     @Autowired
     private UserDao userDao;
@@ -262,13 +265,23 @@ public class UserRepo implements IUserRepo {
 
         /*实名认证保存个人信息*/
         if(user.getPersonalAuthentication() != null){
-            personalAuthenticationDao.save(Converter.convert(PersonalAuthenticationPO.class, user.getPersonalAuthentication()));
+            System.out.println("认证消息为==========="+user.getPersonalAuthentication());
+            PersonalAuthenticationPO authenticationPO = Converter.convert(PersonalAuthenticationPO.class, user.getPersonalAuthentication());
+            System.out.println("认证消息为PO==========="+authenticationPO);
+            personalAuthenticationDao.save(authenticationPO);
         }
 
         /*企业认证保存企业信息*/
         if(user.getEnterpriseAuthentication() != null){
+            if(user.getEnterpriseAuthentication().getIsDaOrEa().equals("研发机构")){
             enterpriseAuthenticationDao.save(Converter.convert(EnterpriseAuthenticationPO.class, user.getEnterpriseAuthentication()));
         }
+            else if(user.getEnterpriseAuthentication().getIsDaOrEa().equals("评测机构")){
+                agencyDao.save(Converter.convert(EvaluationAgencyPO.class,user.getEnterpriseAuthentication()));
+            }
+
+
+            }
 
         return getByID(userPO.getId());
     }

+ 0 - 1
site/src/main/java/com/mooctest/crowd/site/command/ApplyAgencyAuthCommand.java

@@ -5,7 +5,6 @@ import com.mooctest.crowd.domain.domainobject.EvaluationAgencyAbility;
 import com.mooctest.crowd.domain.factory.UserFactory;
 import lombok.Data;
 import org.springframework.beans.BeanUtils;
-
 import javax.validation.constraints.NotNull;
 import java.util.List;
 import java.util.stream.Collectors;

+ 7 - 4
site/src/main/java/com/mooctest/crowd/site/command/ApplyEnterpriseAuthCommand.java

@@ -2,6 +2,7 @@ package com.mooctest.crowd.site.command;
 
 import com.mooctest.crowd.domain.domainobject.EnterpriseAuthentication;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 import org.springframework.beans.BeanUtils;
 
 import javax.validation.constraints.NotNull;
@@ -15,6 +16,8 @@ import java.sql.Timestamp;
 @Data
 public class ApplyEnterpriseAuthCommand {
 
+    @NotNull(message = "请选择认证研发机构或者评测机构")
+    private  String   isDaOrEa;
     @NotNull(message = "企业法人姓名不可为空")
     private String legalPersonName;
     @NotNull(message = "请上传营业执照")
@@ -24,12 +27,12 @@ public class ApplyEnterpriseAuthCommand {
     @NotNull(message = "地址不可为空")
     private String address;
     @NotNull(message = "请选择性别")
-    private String sex;//2.0新加性别
-//    @NotNull(message = "请上传身份证正面照")
+    private String sex;
+    @NotNull(message = "请上传身份证正面照")
     private String IDCardPositivePhoto;//身份证正面照
-//    @NotNull(message = "请上传身份证反面照")
+    @NotNull(message = "请上传身份证反面照")
     private String IDCardBackPhoto;//身份证反面照
-//    @NotNull(message = "请正确填写身份证过期时间")
+    @NotNull(message = "请正确填写身份证过期时间")
     private Timestamp IDCardDeadTime;
 
 

+ 5 - 0
site/src/main/java/com/mooctest/crowd/site/controller/PersonalDataController.java

@@ -38,6 +38,11 @@ public class PersonalDataController {
         return  personalDataService.addQualification(userId,qualificationVO);
     }
 
+    @RequestMapping(value = "/displayone/{id:\\d+}", method = RequestMethod.GET)
+    public QualificationDTO displayOneQualification(@PathVariable("id") long id){
+        return  personalDataService.getOne(id);
+    }
+
     @RequestMapping(value = "/updatequalification/{id:\\d+}/{userId:\\d+}", method = RequestMethod.PUT)
     public QualificationDTO updateQualification(@PathVariable("id") long id, @PathVariable("userId") long userId,@RequestBody QualificationVO qualificationVO){
         return  personalDataService.updateQualification(id,userId,qualificationVO);

+ 1 - 1
site/src/main/java/com/mooctest/crowd/site/data/dto/MyCrowdDTO.java

@@ -20,8 +20,8 @@ public class MyCrowdDTO implements Serializable {
     private List<CrowdProjectVO> myProjects;
     private List<CrowdProjectVO> handlingProjects;
     private List<CrowdProjectVO> acceptableProjects;
+    private List<CrowdProjectVO> finishedProjects;
     private Long myProjectNoticeCount;
     private Long processProjectNoticeCount;
     private Long acceptableProjectNoticeCount;
-
 }

+ 0 - 1
site/src/main/java/com/mooctest/crowd/site/data/dto/QualificationDTO.java

@@ -9,5 +9,4 @@ import java.util.List;
 public class QualificationDTO {
     private QualificationVO qualificationVO;
     private List<QualificationVO> qualificationVOList;
-
 }

+ 1 - 0
site/src/main/java/com/mooctest/crowd/site/mediator/ViewMediator.java

@@ -98,4 +98,5 @@ public interface ViewMediator {
 
     List<ResourceVO>  getSearchResource(String name);
 
+    QualificationDTO getOne(long id);
 }

+ 27 - 1
site/src/main/java/com/mooctest/crowd/site/mediator/impl/WebMediatorImpl.java

@@ -1041,7 +1041,18 @@ public class WebMediatorImpl implements ViewMediator {
             BankCardVO bankCardVO = new BankCardVO();
             bankCardVO.setId(bankCardPO.getId());
             bankCardVO.setUser(bankCardPO.getUser());
-            bankCardVO.setNumber(bankCardPO.getNumber());
+            int length=bankCardPO.getNumber().length();
+            int afterLength = 4;
+            String replaceSymbol = "*";
+            StringBuffer sb = new StringBuffer();
+            for (int i = 0; i < length; i++) {
+                if (i >= (length - afterLength)) {
+                            sb.append(bankCardPO.getNumber().charAt(i));
+                } else {
+                            sb.append(replaceSymbol);
+                        }
+                bankCardVO.setNumber(sb.toString());
+            }
             Optional<BankLogoPO> bankLogo = bankLogoDao.findByCode(bankCardPO.getCode());
             bankCardVO.setLogoUrl(bankLogo.get().getLogoUrl());
             bankCardVO.setName(bankLogo.get().getName());
@@ -1163,6 +1174,21 @@ public class WebMediatorImpl implements ViewMediator {
         return results;
     }
 
+    @Override
+    public QualificationDTO getOne(long id) {
+        QualificationDTO qualificationDTO = new QualificationDTO();
+        Optional<QualificationPO> qualificationPO = qualificationDao.findById(id);
+        QualificationVO qualificationVO = new QualificationVO();
+        qualificationVO.setId(qualificationPO.get().getId());
+        qualificationVO.setName(qualificationPO.get().getName());
+        qualificationVO.setNumber(qualificationPO.get().getNumber());
+        qualificationVO.setLicensingAuthority(qualificationPO.get().getLicensingAuthority());
+        qualificationVO.setTime(qualificationPO.get().getTime());
+        qualificationVO.setIsPublic(qualificationPO.get().getIsPublic());
+        qualificationDTO.setQualificationVO(qualificationVO);
+        return qualificationDTO;
+}
+
     private ProjectOperationControl initProjectPermission(CrowdTestProject project, User user) {
         ProjectOperationControl operationControl = new ProjectOperationControl();
         if (user == null)

+ 2 - 0
site/src/main/java/com/mooctest/crowd/site/service/PersonalDataService.java

@@ -27,4 +27,6 @@ public interface PersonalDataService {
     BankCardDTO addBankCard(long userId,BankCardVO bankCardVO) throws JSONException;
 
     BankCardDTO deleteBankCard(long id,long userId);
+
+    QualificationDTO getOne(long id);
 }

+ 1 - 0
site/src/main/java/com/mooctest/crowd/site/service/impl/CrowdProjectServiceImpl.java

@@ -362,6 +362,7 @@ public class CrowdProjectServiceImpl implements CrowdProjectService {
 
     @Override
     public List<CrowdTestProject> getByProject() {
+
         return projectRepo.getByProject();
     }
 

+ 5 - 0
site/src/main/java/com/mooctest/crowd/site/service/impl/PersonalDataServiceImpl.java

@@ -62,4 +62,9 @@ public class PersonalDataServiceImpl implements PersonalDataService {
     public BankCardDTO deleteBankCard(long id, long userId) {
         return viewMediator.deleteBankCard(id,userId);
     }
+
+    @Override
+    public QualificationDTO getOne(long id) {
+        return viewMediator.getOne(id);
+    }
 }

+ 11 - 11
site/src/main/java/com/mooctest/crowd/site/service/impl/ThemeSchedulerServiceImpl.java

@@ -43,24 +43,24 @@ public class ThemeSchedulerServiceImpl implements ThemeSchedulerService {
         return false;
     }
 
-    public String generateNextCronExp(CrowdTestProject themeDetail) {
+    public String generateNextCronExp(CrowdTestProject crowdTestProject) {
         String cronExp = null;
         String dateFormat="ss mm HH dd MM EE";
         SimpleDateFormat sdf = new SimpleDateFormat(dateFormat, Locale.US);
         Date now = new Date();
-        if(now.before(themeDetail.getCreateTime())) {
-            cronExp = sdf.format(themeDetail.getCreateTime());
-        } else if(now.before(themeDetail.getDeadTime())){
-            cronExp = sdf.format(themeDetail.getDeadTime());
+        if(now.before(crowdTestProject.getCreateTime())) {
+            cronExp = sdf.format(crowdTestProject.getCreateTime());
+        } else if(now.before(crowdTestProject.getDeadTime())){
+            cronExp = sdf.format(crowdTestProject.getDeadTime());
         }
         return cronExp;
     }
     @Override
-    public boolean cancelThemeScheduler(CrowdTestProject themeDetail) {
-        if(this.map.containsKey(themeDetail)) {
-            ThemeScheduler themeDetailScheduler = map.get(themeDetail);
+    public boolean cancelThemeScheduler(CrowdTestProject crowdTestProject) {
+        if(this.map.containsKey(crowdTestProject)) {
+            ThemeScheduler themeDetailScheduler = map.get(crowdTestProject);
             themeDetailScheduler.stopCron();
-            map.remove(themeDetail);
+            map.remove(crowdTestProject);
             return true;
         }
         return false;
@@ -98,12 +98,12 @@ public class ThemeSchedulerServiceImpl implements ThemeSchedulerService {
 
             public MyRunnable() {}
 
-            public MyRunnable (CrowdTestProject themeDetail) {
+            public MyRunnable (CrowdTestProject crowdTestProject) {
                 this.crowdTestProject = crowdTestProject;
             }
-
             @Override
             public void run() {
+                System.out.println("ThemeScheduler " + this.crowdTestProject.getName() + " updateStatus," + new Date());
                 Integer result = themeStatusService.updateStatus(this.crowdTestProject);
                 map.remove(crowdTestProject);
                 if(result.equals(CrowdTestProject.HAS_CREATED) || result.equals(CrowdTestProject.HAS_RELEASED)) {

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
site/src/main/java/com/mooctest/crowd/site/service/impl/UserServiceImpl.java


Некоторые файлы не были показаны из-за большого количества измененных файлов