Bläddra i källkod

手机H5页面支付;部分bug修改

dongbw 8 år sedan
förälder
incheckning
6c0081b0b6
43 ändrade filer med 515 tillägg och 615 borttagningar
  1. 1 0
      donate-console/src/main/java/com/uas/console/donate/Application.java
  2. 0 44
      donate-console/src/main/java/com/uas/console/donate/controller/ProjectQualificationController.java
  3. 3 3
      donate-console/src/main/java/com/uas/console/donate/dao/OrgDao.java
  4. 0 35
      donate-console/src/main/java/com/uas/console/donate/dao/ProjectQualificationDao.java
  5. 0 58
      donate-console/src/main/java/com/uas/console/donate/model/ProjectQualification.java
  6. 18 48
      donate-console/src/main/java/com/uas/console/donate/model/User.java
  7. 0 25
      donate-console/src/main/java/com/uas/console/donate/service/ProjectQualificationService.java
  8. 0 44
      donate-console/src/main/java/com/uas/console/donate/service/impl/ProjectQualificationServiceImpl.java
  9. 2 1
      donate-console/src/main/java/com/uas/console/donate/service/impl/ProjectServiceImpl.java
  10. 3 1
      donate-console/src/main/resources/config/application-dev.properties
  11. 3 1
      donate-console/src/main/resources/config/application-prod.properties
  12. 3 1
      donate-console/src/main/resources/config/application-test.properties
  13. 1 1
      donate-console/src/main/webapp/WEB-INF/views/charityCertification.html
  14. 2 2
      donate-console/src/main/webapp/WEB-INF/views/index.html
  15. 1 1
      donate-console/src/main/webapp/WEB-INF/views/launchProject.html
  16. 1 1
      donate-console/src/main/webapp/WEB-INF/views/publicOfferingCertification.html
  17. 25 0
      donate-console/src/main/webapp/resources/css/base.css
  18. BIN
      donate-console/src/main/webapp/resources/images/loading.gif
  19. 25 13
      donate-console/src/main/webapp/resources/js/index/app.js
  20. 3 3
      donate-console/src/main/webapp/resources/view/activity/activity_launch.html
  21. 1 1
      donate-console/src/main/webapp/resources/view/project/audit_confirm.html
  22. 22 2
      donate-console/src/main/webapp/resources/view/project/project_launch_1.html
  23. 10 10
      donate-console/src/main/webapp/resources/view/project/project_launch_2.html
  24. 1 1
      donate-console/src/main/webapp/resources/view/user/charityCertification.html
  25. 1 1
      donate-console/src/main/webapp/resources/view/user/publicOfferingCertification.html
  26. 0 14
      donate-service/src/main/java/com/uas/service/donate/controller/ActiveCenterController.java
  27. 9 13
      donate-service/src/main/java/com/uas/service/donate/controller/ProjectController.java
  28. 7 4
      donate-service/src/main/java/com/uas/service/donate/dao/ActivityDao.java
  29. 0 6
      donate-service/src/main/java/com/uas/service/donate/dao/ProjectDao.java
  30. 123 48
      donate-service/src/main/java/com/uas/service/donate/model/Activity.java
  31. 2 3
      donate-service/src/main/java/com/uas/service/donate/model/Org.java
  32. 0 97
      donate-service/src/main/java/com/uas/service/donate/model/ProjectQualification.java
  33. 44 38
      donate-service/src/main/java/com/uas/service/donate/model/User.java
  34. 7 3
      donate-service/src/main/java/com/uas/service/donate/service/ProjectService.java
  35. 11 44
      donate-service/src/main/java/com/uas/service/donate/service/impl/ActivityServiceImpl.java
  36. 16 3
      donate-service/src/main/java/com/uas/service/donate/service/impl/ProjectServiceImpl.java
  37. 83 0
      donate-service/src/main/webapp/resources/css/base.css
  38. BIN
      donate-service/src/main/webapp/resources/images/loading.gif
  39. 3 2
      donate-service/src/main/webapp/resources/js/common/query/Project.js
  40. 27 13
      donate-service/src/main/webapp/resources/js/mobile/controllers/MobileProjectDetailCtrl.js
  41. 52 25
      donate-service/src/main/webapp/resources/view/mobile/mobile_project_detail.html
  42. 1 1
      donate-service/src/main/webapp/resources/view/project/organization_detail.html
  43. 4 4
      donate-service/src/main/webapp/resources/view/project/project_detail.html

+ 1 - 0
donate-console/src/main/java/com/uas/console/donate/Application.java

@@ -16,6 +16,7 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
 public class Application {
 
     public static void main(String[] args){
+//        System.setProperty("java.io.tmpdir", "C:\\Users\\welldone\\AppData\\Local\\Temp");
         SpringApplication application=new SpringApplication(Application.class);
         application.addListeners(new ApplicationListener<ApplicationPreparedEvent>() {
             @Override

+ 0 - 44
donate-console/src/main/java/com/uas/console/donate/controller/ProjectQualificationController.java

@@ -1,44 +0,0 @@
-package com.uas.console.donate.controller;
-
-import com.uas.console.donate.model.Project;
-import com.uas.console.donate.model.ProjectQualification;
-import com.uas.console.donate.service.ProjectQualificationService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-
-import java.util.List;
-
-@Controller
-@RequestMapping("/projectqualification")
-public class ProjectQualificationController {
-
-    @Autowired
-    private ProjectQualificationService projectQualificationService;
-
-    /**
-     * 查询某活动已关联的项目
-     */
-    public List<ProjectQualification> hasConnected(Long activityId){
-        return projectQualificationService.hasConnected(activityId);
-    }
-
-    /**
-     *  查询所有还未被关联活动的项目
-     */
-    @ResponseBody
-    @RequestMapping("/notConnect")
-    public List<Project> notConnectList(){
-
-        return projectQualificationService.notConnectList();
-    }
-    /**
-     * 删除该活动所有关联的有资格参与该活动的所有项目
-     */
-     public void  deletByActivityId(Long activityId){
-         projectQualificationService.deletByActivityId(activityId);
-     }
-
-
-}

+ 3 - 3
donate-console/src/main/java/com/uas/console/donate/dao/OrgDao.java

@@ -32,9 +32,9 @@ public interface OrgDao extends JpaRepository<Org,Long>,JpaSpecificationExecutor
     @Query("from Org o where type=:type and majorArea=:majorArea and status=:status and publish=2 order By createTime desc" )
     List<Org> findByTypeAndMajorArea(@Param("type") Integer type,@Param("majorArea")Integer majorArea,@Param("status")Integer status);
 
-//    //根据UUID取出唯一的机构信息
-//    @Query("from Org  o where  uuid=:uuid")
-//    Org findOne(@Param("uuid") Long uuid);
+    //根据UUID取出唯一的机构信息
+    @Query("from Org  o where  uuid=:uuid")
+    Org findByUuid(@Param("uuid") Long uuid);
 
     Page<Org> findAll(Pageable pageable);
 

+ 0 - 35
donate-console/src/main/java/com/uas/console/donate/dao/ProjectQualificationDao.java

@@ -1,35 +0,0 @@
-package com.uas.console.donate.dao;
-
-import com.uas.console.donate.model.Project;
-import com.uas.console.donate.model.ProjectQualification;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.Modifying;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.repository.query.Param;
-import org.springframework.stereotype.Repository;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
-
-@Repository
-@Transactional
-public interface ProjectQualificationDao extends JpaRepository<ProjectQualification,Long> {
-
-
-    //删除该活动所有关联的有资格参与该活动的所有项目
-    @Modifying
-    @Query("delete  from ProjectQualification  where activityId=:activityId")
-    void deletByActivityId(@Param("activityId")Long activityId);
-
-    //查询所有还未被关联活动的项目
-    @Query("from Project as p where p.id not in (select  pq.proId from ProjectQualification as pq)")
-    List<Project> notConnectList();
-
-    //查询某活动已关联的项目
-    @Query("from ProjectQualification where activityId=:activityId")
-    List<ProjectQualification> hasConnected(@Param("activityId")Long activityId);
-
-
-
-
-}

+ 0 - 58
donate-console/src/main/java/com/uas/console/donate/model/ProjectQualification.java

@@ -1,58 +0,0 @@
-package com.uas.console.donate.model;
-
-import javax.persistence.*;
-
-/**
- * 项目与活动关联表
- */
-@Entity
-@Table(name="donate$projectqualification")
-public class ProjectQualification {
-    private static final long serialVersionUID = 1L;
-
-    @Id
-    @GeneratedValue(strategy= GenerationType.IDENTITY)
-    @Column(name="actqua_id")
-    private  Long id;
-
-    @Column(name = "actqua_act_id")
-    private Long activityId;
-
-    @Column(name = "actqua_pro_id")
-    private Long proId;
-
-    @Column(name = "actqua_pro_name")
-    private String name;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getActivityId() {
-        return activityId;
-    }
-
-    public void setActivityId(Long activityId) {
-        this.activityId = activityId;
-    }
-
-    public Long getProId() {
-        return proId;
-    }
-
-    public void setProId(Long proId) {
-        this.proId = proId;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-}

+ 18 - 48
donate-console/src/main/java/com/uas/console/donate/model/User.java

@@ -4,7 +4,6 @@ import com.uas.account.entity.UserView;
 
 import javax.persistence.*;
 import java.io.Serializable;
-import java.util.Set;
 
 @Entity
 @Table(name="donate$user")
@@ -26,12 +25,6 @@ public class User implements Serializable{
     @Column(name = "user_name")
     private String name;
 
-//    /**
-//     * 用户密码
-//     */
-//    @Column(name = "user_pwd")
-//    private String pwd;
-
     /**
      * 用户手机号
      */
@@ -44,19 +37,13 @@ public class User implements Serializable{
     @Column(name = "user_identity")
     private Integer identity;
 
-//    /**
-//     * 用户在的公司
-//     */
-//    @Column(name = "user_company")
-//    private String company;
-
     /**
      * 所属机构
      */
-    @ManyToMany(cascade = { CascadeType.REFRESH, CascadeType.REMOVE }, fetch = FetchType.EAGER)
-    @JoinTable(name = "donate$userorg", joinColumns = @JoinColumn(name = "user_uu", referencedColumnName = "user_uu"), inverseJoinColumns = @JoinColumn(name = "org_id", referencedColumnName = "org_id"))
+    @OneToOne(cascade = { CascadeType.REFRESH}, fetch = FetchType.EAGER)
+    @JoinColumn(name = "user_orgid")
     @OrderBy("id")
-    private Set<Org> orgs;
+    private Org org;
 
     @Column(name = "user_imid")
     private Long userIMId;
@@ -78,7 +65,6 @@ public class User implements Serializable{
         this.setUserEmail(user.getSecondUID());
     }
 
-
     public Long getUserUU() {
         return userUU;
     }
@@ -95,14 +81,6 @@ public class User implements Serializable{
         this.name = name;
     }
 
-//    public String getPwd() {
-//        return pwd;
-//    }
-//
-//    public void setPwd(String pwd) {
-//        this.pwd = pwd;
-//    }
-
     public String getTel() {
         return tel;
     }
@@ -111,6 +89,14 @@ public class User implements Serializable{
         this.tel = tel;
     }
 
+    public String getUserEmail() {
+        return userEmail;
+    }
+
+    public void setUserEmail(String userEmail) {
+        this.userEmail = userEmail;
+    }
+
     public Integer getIdentity() {
         return identity;
     }
@@ -119,13 +105,13 @@ public class User implements Serializable{
         this.identity = identity;
     }
 
-//    public String getCompany() {
-//        return company;
-//    }
-//
-//    public void setCompany(String company) {
-//        this.company = company;
-//    }
+    public Org getOrg() {
+        return org;
+    }
+
+    public void setOrg(Org org) {
+        this.org = org;
+    }
 
     public Long getUserIMId() {
         return userIMId;
@@ -142,20 +128,4 @@ public class User implements Serializable{
     public void setType(String type) {
         this.type = type;
     }
-
-    public Set<Org> getOrgs() {
-        return orgs;
-    }
-
-    public void setOrgs(Set<Org> orgs) {
-        this.orgs = orgs;
-    }
-
-    public String getUserEmail() {
-        return userEmail;
-    }
-
-    public void setUserEmail(String userEmail) {
-        this.userEmail = userEmail;
-    }
 }

+ 0 - 25
donate-console/src/main/java/com/uas/console/donate/service/ProjectQualificationService.java

@@ -1,25 +0,0 @@
-package com.uas.console.donate.service;
-
-import com.uas.console.donate.model.Project;
-import com.uas.console.donate.model.ProjectQualification;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
-
-
-public interface ProjectQualificationService {
-
-    ProjectQualification save(ProjectQualification projectQualification);
-
-    /*ProjectQualification deleteByProject(Long proId);*/
-
-    //查询某活动已关联的项目
-    List<ProjectQualification> hasConnected(Long activityId);
-
-    //查询所有还未被关联活动的项目
-    List<Project> notConnectList();
-
-    //删除该活动所有关联的有资格参与该活动的所有项目
-    @Transactional
-    void  deletByActivityId(Long activityId);
-}

+ 0 - 44
donate-console/src/main/java/com/uas/console/donate/service/impl/ProjectQualificationServiceImpl.java

@@ -1,44 +0,0 @@
-package com.uas.console.donate.service.impl;
-
-import com.uas.console.donate.dao.ProjectQualificationDao;
-import com.uas.console.donate.model.Project;
-import com.uas.console.donate.model.ProjectQualification;
-import com.uas.console.donate.service.ProjectQualificationService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
-
-
-@Service
-public class ProjectQualificationServiceImpl implements ProjectQualificationService{
-
-    @Autowired
-    private ProjectQualificationDao projectQualificationDao;
-
-    public ProjectQualification save(ProjectQualification projectQualification){
-        return projectQualificationDao.save(projectQualification);
-    }
-
-
-    //查询某活动已关联的项目
-    public List<ProjectQualification> hasConnected(Long activityId){
-        return projectQualificationDao.hasConnected(activityId);
-    }
-
-    //查询所有还未被关联活动的项目
-    public List<Project> notConnectList(){
-        return projectQualificationDao.notConnectList();
-    }
-
-
-    //删除该活动所有关联的有资格参与该活动的所有项目
-    @Transactional
-    public void deletByActivityId(Long activityId){
-        projectQualificationDao.deletByActivityId(activityId);
-    }
-
-
-
-}

+ 2 - 1
donate-console/src/main/java/com/uas/console/donate/service/impl/ProjectServiceImpl.java

@@ -62,7 +62,8 @@ public class ProjectServiceImpl implements ProjectService {
         if(project.getPublish()==null||project.getPublish()==1){
             project.setPublish(1);
         }
-        return projectDao.save(project);
+        project = projectDao.save(project);
+        return project;
     }
 
     //提交项目

+ 3 - 1
donate-console/src/main/resources/config/application-dev.properties

@@ -37,4 +37,6 @@ dubbo.group=dev
 spring.http.encoding.force=true
 spring.http.multipart.enabled=true
 spring.http.multipart.max-file-size=128MB
-spring.http.multipart.max-request-size=128MB
+spring.http.multipart.max-request-size=128MB
+
+server.tomcat.basedir=C:/Temp/test-tomcat

+ 3 - 1
donate-console/src/main/resources/config/application-prod.properties

@@ -37,4 +37,6 @@ dubbo.group=dev
 spring.http.encoding.force=true
 spring.http.multipart.enabled=true
 spring.http.multipart.max-file-size=128MB
-spring.http.multipart.max-request-size=128MB
+spring.http.multipart.max-request-size=128MB
+
+server.tomcat.basedir=/tmp/test-tomcat

+ 3 - 1
donate-console/src/main/resources/config/application-test.properties

@@ -37,4 +37,6 @@ dubbo.group=dev
 spring.http.encoding.force=true
 spring.http.multipart.enabled=true
 spring.http.multipart.max-file-size=128MB
-spring.http.multipart.max-request-size=128MB
+spring.http.multipart.max-request-size=128MB
+
+server.tomcat.basedir=C:/Temp/test-tomcat

+ 1 - 1
donate-console/src/main/webapp/WEB-INF/views/charityCertification.html

@@ -544,7 +544,7 @@
                                     </div>
                                     <div class="agree clearfix">
                                         <input type="checkbox" class="fl"/>
-                                        <div class="fl read"><span>我已经阅读并同意<a href="http://lj.ubtob.com/userAgreement">《优软一元捐用户协议》</a></span></div>
+                                        <div class="fl read"><span>我已经阅读并同意<a href="http://lj.ubtob.com/userAgreement" target="_blank">《优软一元捐用户协议》</a></span></div>
                                     </div>
                                     <a href="charityCertification1" class="btn">确定,下一步</a>
                                 </div>

+ 2 - 2
donate-console/src/main/webapp/WEB-INF/views/index.html

@@ -44,7 +44,7 @@
     <!--顶部导航-->
     <header class="main-header">
         <!-- Logo -->
-        <a href="/index" class="logo">
+        <a class="logo">
             <span class="logo-mini"><b>UAS</b></span>
             <span class="logo-lg"><b>一元捐后台系统</b></span>
         </a>
@@ -144,7 +144,7 @@
                         <i class="fa fa-angle-left pull-right"></i>
                     </a>
                     <ul class="treeview-menu">
-                        <li id=""><a href="bannerSetting">Banner设置</a></li>
+                        <li id=""><a href="http://10.10.101.23:20010/carousels/donate">Banner设置</a></li>
                         <li id=""><a href="contentBoxSetting">内容框背景设置</a></li>
                     </ul>
                 </li>

+ 1 - 1
donate-console/src/main/webapp/WEB-INF/views/launchProject.html

@@ -716,7 +716,7 @@
                                     <div class="form-group clearfix text-left">
                                         <input type="checkbox" class="fl">
                                         <div class="agree">
-                                            <span>我已阅读并同意</span><a href="http://lj.ubtob.com/userAgreement">《优软一元捐用户协议》</a>
+                                            <span>我已阅读并同意</span><a href="http://lj.ubtob.com/userAgreement" target="_blank">《优软一元捐用户协议》</a>
                                         </div>
                                     </div>
                                     <div class="text-left">

+ 1 - 1
donate-console/src/main/webapp/WEB-INF/views/publicOfferingCertification.html

@@ -587,7 +587,7 @@
                                     </div>
                                     <div class="agree clearfix">
                                         <input type="checkbox" class="fl"/>
-                                        <div class="fl read"><span>我已经阅读并同意<a href="http://lj.ubtob.com/userAgreement">《优软一元捐用户协议》</a></span></div>
+                                        <div class="fl read"><span>我已经阅读并同意<a href="http://lj.ubtob.com/userAgreement" target="_blank">《优软一元捐用户协议》</a></span></div>
                                     </div>
                                     <a class="btn" href="publicOfferingCertification1">确定,下一步</a>
                                 </div>

+ 25 - 0
donate-console/src/main/webapp/resources/css/base.css

@@ -226,4 +226,29 @@ input,button,select,textarea{outline:none}
 button[disabled] {
 	cursor: not-allowed;
 	background-color: #a0a0a0;
+}
+
+/*loading*/
+.loading {
+	display: none;
+	position: fixed;
+	width: 100%;
+	height: 100%;
+	top: 0;
+	left: 0;
+	z-index: 1000;
+}
+
+.loading.in {
+	display: block;
+}
+
+.loading.in>i {
+	position: absolute;
+	top: 50%;
+	left: 50%;
+	margin: -33px 0 0 -33px;
+	background: url("../images/loading.gif") no-repeat center center;
+	width: 66px;
+	height: 66px;
 }

BIN
donate-console/src/main/webapp/resources/images/loading.gif


+ 25 - 13
donate-console/src/main/webapp/resources/js/index/app.js

@@ -25,7 +25,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
         return httpInterceptor;
     }]);
 	app.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {
-		$urlRouterProvider.otherwise("/");
+        $urlRouterProvider.otherwise("/");
 		$stateProvider.state("project", {
 			url : '/',
 			title : '项目列表',
@@ -788,12 +788,6 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
             $scope.checked = !$scope.checked;
         };
 
-        $scope.project = {
-            area: $scope.areas[0],
-            classify: $scope.classifys[0],
-            population: $scope.populations[0]
-        };
-
         // 获取已保存的项目
         var getSavedProject = function() {
             Project.getSavedProject({}, {}, function(data) {
@@ -815,9 +809,24 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
                   $scope.logoUrl = data.logo;
               });
             }
+
+            if (angular.isUndefined($scope.project)) {
+                $scope.project = {
+                    area: $scope.areas[0],
+                    classify: $scope.classifys[0],
+                    population: $scope.populations[0]
+                };
+            }
         };
         getSavedProject();
 
+        // 日期选择
+        $scope.openDatePicker = function ($event, item, openParam) {
+            $event.preventDefault();
+            $event.stopPropagation();
+            item[openParam] = !item[openParam];
+        };
+
         // 设置区域
         $scope.setArea = function(index) {
             $scope.project.area = $scope.areas[index];
@@ -844,10 +853,13 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
         $scope.saveBaseInfo = function(project) {
             Project.saveBaseInfo({}, project, function(data) {
                 $scope.project = data;
-                BaseService.scrollBackToTop();
-                window.location.hash = '#/launchProject/detail/' + $scope.project.id;
-            }, function(response) {
-                toaster.pop('error', '出现错误');
+                var proId = $scope.project.id;
+                if(proId) {
+                    BaseService.scrollBackToTop();
+                    window.location.href = '#/launchProject/detail/' + proId;
+                }
+            },function(res) {
+                toaster.pop('error', '出现错误,操作失败');
             });
         };
 
@@ -1000,10 +1012,10 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
                 if (type) {
                     toaster.pop('success', '发布成功');
                     BaseService.scrollBackToTop();
-                    window.location.hash='#/launchProject/success';
+                    window.location.href='#/launchProject/success';
                 } else {
                     toaster.pop('success', '保存成功');
-                    window.location.hash='#/';
+                    window.location.href='#/';
                 }
             }).error(function (data) {
                 $scope.loadingShow = false;

+ 3 - 3
donate-console/src/main/webapp/resources/view/activity/activity_launch.html

@@ -576,7 +576,7 @@
                         <label class="control-label fl">封面图片</label>
                         <div class="fl uploadImage">
                             <div><button>上传图片</button><span>(160*160)</span></div>
-                            <input type="file" ng-multiple="false" onchange='angular.element(this).scope().fileChanged(this, 0)'>
+                            <input type="file" ng-multiple="false" accept="image/*" onchange='angular.element(this).scope().fileChanged(this, 0)'>
                             <div ng-if="null != actImgUrl" style="max-height: 100px; max-width: 300px">
                                 <img style="max-height: 100px; max-width: 100px" src="{{actImgUrl}}">
                                 <span class="hover-show">
@@ -590,7 +590,7 @@
                         <label class="control-label fl">Banner</label>
                         <div class="fl uploadImage">
                             <div><button>上传图片</button><span>(1140*140)</span></div>
-                            <input type="file" ng-multiple="false" onchange='angular.element(this).scope().fileChanged(this, 1)'>
+                            <input type="file" ng-multiple="false" accept="image/*" onchange='angular.element(this).scope().fileChanged(this, 1)'>
                             <div ng-if="null != bannerUrl" style="max-height: 100px; max-width: 300px">
                                 <img style="max-height: 100px; max-width: 100px" src="{{bannerUrl}}">
                                 <span class="hover-show">
@@ -627,7 +627,7 @@
                                 </div>
                                 <div class="uploadImg">
                                     上传图片
-                                    <input type="file" ng-multiple="false" id="award{{$index}}" ng-model="award.prizeImgs" ng-file-select ng-change="uploadPrizeImg(award, $index)" required>
+                                    <input type="file" ng-multiple="false" accept="image/*" id="award{{$index}}" ng-model="award.prizeImgs" ng-file-select ng-change="uploadPrizeImg(award, $index)" required>
                                 </div>
                                 <div ng-if="null != award.img" style="max-height: 100px; max-width: 300px">
                                     <img style="max-height: 100px; max-width: 100px" src="{{award.img}}">

+ 1 - 1
donate-console/src/main/webapp/resources/view/project/audit_confirm.html

@@ -10,7 +10,7 @@
             <div class="header modal-header clearfix">
                 <p class="fl" ng-if="result">项目通过确认</p>
                 <p class="fl" ng-if="!result">项目申请驳回</p>
-                <div class="close fr" data-dismiss="modal">&times;</div>
+                <div class="close fr" data-dismiss="modal" ng-click="cancel()">&times;</div>
             </div>
             <div class="body modal-body clearfix">
                 <div class="through-item fl">

+ 22 - 2
donate-console/src/main/webapp/resources/view/project/project_launch_1.html

@@ -540,6 +540,26 @@
                                     <input type="text" ng-model="project.name" class="form-control fl" ng-maxlength="9" required>
                                     <span class="fl help-txt">(不超过9个字)</span>
                                 </div>
+                                <div class="form-group clearfix">
+                                    <label class="control-label fl">项目时间</label>
+                                    <div class="active-time fl">
+                                        <input type="text" ng-model="project.startTime" readonly style="float:left" required
+                                               class="date-choose f1 form-control" placeholder="开始时间"
+                                               datepicker-popup="yyyy-MM-dd" is-open="project.$startTimeOpened"
+                                               ng-required="true" max-date="project.endTime"
+                                               current-text="今天" clear-text="清除" close-text="关闭"
+                                               datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+                                               ng-click="openDatePicker($event, project, '$startTimeOpened')">
+                                        <span class="fl" style="margin-left: 10px;margin-right: 10px;">至</span>
+                                        <input type="text" ng-model="project.endTime" readonly required
+                                               class="date-choose f1 form-control" placeholder="结束时间"
+                                               datepicker-popup="yyyy-MM-dd" is-open="project.$endTimeOpened" min-date="project.startTime"
+                                               ng-required="true"
+                                               current-text="今天" clear-text="清除" close-text="关闭"
+                                               datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+                                               ng-click="openDatePicker($event, project, '$endTimeOpened')">
+                                    </div>
+                                </div>
                                 <div class="form-group clearfix">
                                     <label for="" class="fl">捐助领域</label>
                                     <div class="fl sort">
@@ -622,11 +642,11 @@
                                 <div class="form-group clearfix text-left">
                                     <input type="checkbox" ng-click="changeChecked()" ng-checked="checked" required class="fl">
                                     <div class="agree">
-                                        <span>我已阅读并同意《<a href="http://lj.ubtob.com/userAgreement">优软一元捐用户协议</a>》</span>
+                                        <span>我已阅读并同意《<a href="http://lj.ubtob.com/userAgreement" target="_blank">优软一元捐用户协议</a>》</span>
                                     </div>
                                 </div>
                                 <div class="text-left">
-                                    <button ng-disabled="baseInfoForm.$invalid || !checked" ng-click="saveBaseInfo(project)" class="btn">保存,下一步</button>
+                                    <button type="button" ng-disabled="baseInfoForm.$invalid || !checked" ng-click="saveBaseInfo(project)" class="btn">保存,下一步</button>
                                 </div>
                             </form>
                         </div>

+ 10 - 10
donate-console/src/main/webapp/resources/view/project/project_launch_2.html

@@ -531,8 +531,8 @@
                                     <div class="computer">
                                         <span>PC端主图</span>
                                         <button>上传图片</button>
-                                        <input type="file" ng-multiple="false" id="pcImg" onchange='angular.element(this).scope().fileChanged(this, 0)'>
-                                        <em>(最能代表项目的焦点图,图片尺寸不小于500*280px,支持jpggif,png格式,不超过10MB)</em>
+                                        <input type="file" ng-multiple="false" id="pcImg" accept="image/*" onchange='angular.element(this).scope().fileChanged(this, 0)'>
+                                        <em>(最能代表项目的焦点图,图片尺寸不小于500*280px,支持jpg,gif,png格式,不超过10MB)</em>
                                         <div ng-if="null != pcImgUrl" style="max-height: 100px; max-width: 300px">
                                             <img style="max-height: 100px; max-width: 100px" src="{{pcImgUrl}}">
                                             <span class="hover-show">
@@ -544,8 +544,8 @@
                                     <div class="computer">
                                         <span>手机端主图</span>
                                         <button>上传图片</button>
-                                        <input type="file" ng-multiple="false" id="mobileImg" onchange='angular.element(this).scope().fileChanged(this, 1)'>
-                                        <em>(最能代表项目的焦点图,图片尺寸不小于500*280px,支持jpggif,png格式,不超过10MB)</em>
+                                        <input type="file" ng-multiple="false" id="mobileImg" accept="image/*" onchange='angular.element(this).scope().fileChanged(this, 1)'>
+                                        <em>(最能代表项目的焦点图,图片尺寸不小于500*280px,支持jpg,gif,png格式,不超过10MB)</em>
                                         <div ng-if="null != mobileImgUrl" style="max-height: 100px; max-width: 300px">
                                             <img style="max-height: 100px; max-width: 100px" src="{{mobileImgUrl}}">
                                             <span class="hover-show">
@@ -561,8 +561,8 @@
                                 <div class="fl">
                                     <div class="computer uploadImg">
                                         <button>上传图片</button>
-                                        <input type="file" ng-multiple="false" id="mobileListImg" onchange='angular.element(this).scope().fileChanged(this, 2)'>
-                                        <em>(最能代表项目的焦点图,图片尺寸不小于500*375像素以上,支持jpggif,png格式,不超过10MB)</em>
+                                        <input type="file" ng-multiple="false" id="mobileListImg" accept="image/*" onchange='angular.element(this).scope().fileChanged(this, 2)'>
+                                        <em>(最能代表项目的焦点图,图片尺寸不小于500*375像素以上,支持jpg,gif,png格式,不超过10MB)</em>
                                         <div ng-if="null != mobileListImgUrl" style="max-height: 100px; max-width: 300px">
                                             <img style="max-height: 100px; max-width: 100px" src="{{mobileListImgUrl}}">
                                             <span class="hover-show">
@@ -585,8 +585,8 @@
                                         <span class="fl">头像</span>
                                         <div class="button fl">
                                             <button>上传图片</button>
-                                            <input type="file" ng-multiple="false" id="logo" onchange='angular.element(this).scope().fileChanged(this, 3)'>
-                                            <em>(图片尺寸不小于500*500px,支持jpg,gif,png格式,不超过2MB)</em>
+                                            <input type="file" ng-multiple="false" id="logo" accept="image/*" onchange='angular.element(this).scope().fileChanged(this, 3)'>
+                                            <em>(图片尺寸不小于500*500px,不超过2MB)</em>
                                             <div ng-if="null != logoUrl" style="max-height: 100px; max-width: 300px">
                                                 <img style="max-height: 100px; max-width: 100px" src="{{logoUrl}}">
                                                 <span class="hover-show">
@@ -622,8 +622,8 @@
                                 </div>
                                 <div class="fl submitButton">
                                     <div class="sub">
-                                        <button ng-disabled="detailForm.$invalid || !project.introduction || !pcImg || !mobileImg || !mobileListImg || !logo" ng-click="saveDetail(project, true)">提交</button>
-                                        <button ng-click="saveDetail(project, false)">保存草稿</button></div>
+                                        <button type="button" ng-disabled="detailForm.$invalid || !project.introduction || !pcImg || !mobileImg || !mobileListImg || !logo" ng-click="saveDetail(project, true)">提交</button>
+                                        <button type="button" ng-click="saveDetail(project, false)">保存草稿</button></div>
                                     <a ui-sref="launchProject1">返回上一页</a>
                                 </div>
                             </div>

+ 1 - 1
donate-console/src/main/webapp/resources/view/user/charityCertification.html

@@ -409,7 +409,7 @@
                             </div>
                             <div class="agree clearfix">
                                 <input type="checkbox" class="fl"/>
-                                <div class="fl read"><span>我已经阅读并同意<a href="http://lj.ubtob.com/userAgreement">《优软一元捐用户协议》</a></span></div>
+                                <div class="fl read"><span>我已经阅读并同意<a href="http://lj.ubtob.com/userAgreement" target="_blank">《优软一元捐用户协议》</a></span></div>
                             </div>
                             <a ui-sref="charityCertificationStep1" class="btn">确定,下一步</a>
                         </div>

+ 1 - 1
donate-console/src/main/webapp/resources/view/user/publicOfferingCertification.html

@@ -534,7 +534,7 @@
                             </div>
                             <div class="agree clearfix">
                                 <input type="checkbox" class="fl"/>
-                                <div class="fl read"><span>我已经阅读并同意<a href="http://lj.ubtob.com/userAgreement">《优软一元捐用户协议》</a></span></div>
+                                <div class="fl read"><span>我已经阅读并同意<a href="http://lj.ubtob.com/userAgreement" target="_blank">《优软一元捐用户协议》</a></span></div>
                             </div>
                             <a ui-sref="publicOfferingCertificationStep1" class="btn">确定,下一步</a>
                         </div>

+ 0 - 14
donate-service/src/main/java/com/uas/service/donate/controller/ActiveCenterController.java

@@ -2,7 +2,6 @@ package com.uas.service.donate.controller;
 
 import com.alibaba.fastjson.JSONObject;
 import com.uas.service.donate.model.Activity;
-import com.uas.service.donate.model.Award;
 import com.uas.service.donate.service.ActivityService;
 import com.uas.service.donate.service.AwardService;
 import com.uas.service.donate.service.CarouselService;
@@ -16,7 +15,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
-import java.util.ArrayList;
 import java.util.List;
 
 
@@ -67,26 +65,14 @@ public class ActiveCenterController {
         } else if ("已结束".equals(status)) {
             Page<Activity> activities = activityService.findEndActivities(pageable);
             modelMap.put("page", activities);
-            for(Activity activity:activities){
-                List<Award> awardList=awardService.getAwards(activity.getId());
-                activity.setAwards(awardList);
-            }
         } else if ("全部".equals(status)) {
             Page<Activity> activities = activityService.findAll(pageable);
             modelMap.put("page", activities);
-            for(Activity activity:activities){
-                List<Award> awardList=awardService.getAwards(activity.getId());
-                activity.setAwards(awardList);
-            }
         }
 
         if (search != null) {
             Page<Activity> activities = activityService.search(search, pageable);
             modelMap.put("page", activities);
-            for(Activity activity:activities){
-                List<Award> awardList=awardService.getAwards(activity.getId());
-                activity.setAwards(awardList);
-            }
         }
         modelMap.put("carouselList",carouselList);
         modelMap.put("historyPerson", historyPerson);

+ 9 - 13
donate-service/src/main/java/com/uas/service/donate/controller/ProjectController.java

@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSONObject;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.PageParams;
 import com.uas.platform.core.web.bind.RequestState;
-import com.uas.service.donate.dao.ProjectDao;
 import com.uas.service.donate.model.Activity;
 import com.uas.service.donate.model.Project;
 import com.uas.service.donate.model.SearchFilter;
@@ -288,18 +287,6 @@ public class ProjectController {
         return projectService.getThisDonation(id);
     }
 
-    /**
-     * 查询项目关联的活动
-     * @param id
-     * @return
-     */
-    @RequestMapping(value = "/findByProId/{id}", method = RequestMethod.GET)
-    @ResponseBody
-    public Activity findByProId (@PathVariable("id") Long id) {
-        return projectService.findByProId(id);
-    }
-
-
     /**
      *找到某项目的相关项目
      */
@@ -318,4 +305,13 @@ public class ProjectController {
         return projectService.allArea();
     }
 
+    /**
+     *找到某项目的关联活动
+     */
+    @RequestMapping(value = "/getJoinedActivity/{id}",method = RequestMethod.GET)
+    @ResponseBody
+    public Activity getJoinedActivity(@PathVariable("id") Long id){
+        return projectService.getJoinedActivity(id);
+    }
+
 }

+ 7 - 4
donate-service/src/main/java/com/uas/service/donate/dao/ActivityDao.java

@@ -40,10 +40,6 @@ public interface ActivityDao extends JpaRepository<Activity,Long>,JpaSpecificati
     @Query("from Activity a where NOW()>a.endTime and publish=2")
     Page<Activity> findEndActivities(Pageable pageable);
 
-    //计算与活动相关的项目筹集的总金额
-    @Query("select sum(p.totalAmount) from Project p where p.id in (select pq.proId from ProjectQualification pq where pq.activityId=:activityId)")
-    Double sumMoney(@Param("activityId")Long activityId);
-
     //根据活动名关键字,奖品名关键字查询活动
     @Query("from Activity a where a.name like %:search% or a.id in (select aw.activityId from Award aw where aw.awardName like %:search%)")
     List<Activity> search(@Param("search")String search);
@@ -51,5 +47,12 @@ public interface ActivityDao extends JpaRepository<Activity,Long>,JpaSpecificati
     @Query("from Activity a where a.name like %:search% or a.id in (select aw.activityId from Award aw where aw.awardName like %:search%)")
     Page<Activity> search(@Param("search")String search,Pageable pageable);
 
+    /**
+     * 根据项目id获取关联活动
+     * @param proId
+     * @return
+     */
+    @Query(value = "select act.* from donate$activity act where act.act_id in (select actpro.act_id from donate$activityproject actpro where actpro.pro_id = :proId)", nativeQuery = true)
+    List<Activity> findJoinedActivityByProId(@Param("proId") Long proId);
 }
 

+ 0 - 6
donate-service/src/main/java/com/uas/service/donate/dao/ProjectDao.java

@@ -92,10 +92,4 @@ public interface ProjectDao extends JpaRepository<Project,Long>,JpaSpecification
      */
     @Query("from Project p where p.area=(select p.area from Project p where p.id=:id) order by p.startTime desc ")
     List<Project> findSimilar(@Param("id")Long id);
-
-    /**
-     * 查询某项目关联的活动
-     */
-    @Query("from Activity a where a.id=(select pq.activityId from ProjectQualification pq where pq.proId=:proId) ")
-    Activity findByProId(@Param("proId")Long proId);
 }

+ 123 - 48
donate-service/src/main/java/com/uas/service/donate/model/Activity.java

@@ -1,12 +1,14 @@
 package com.uas.service.donate.model;
 
 
+import com.uas.service.donate.util.CollectionUtils;
+
 import javax.persistence.*;
 import java.io.Serializable;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
-import java.util.List;
+import java.util.Set;
 
 @Entity
 @Table(name="donate$activity")
@@ -42,33 +44,40 @@ public class Activity implements Serializable{
     /**
      * 开始时间
      */
-    @Column(name="act_start_time", nullable = false)
+    @Column(name="act_start_time")
     private Date startTime;
 
     /**
      * 结束时间
      */
-    @Column(name="act_end_time", nullable = false)
+    @Column(name="act_end_time")
     private  Date endTime;
 
     /**
      * 开奖日期
      */
-    @Column(name="act_lucky_time", nullable = false)
+    @Column(name="act_lucky_time")
     private  Date luckyTime;
 
     /**
      * 兑奖开始时间
      */
-    @Column(name="act_receive_start", nullable = false)
+    @Column(name="act_receive_start")
     private Date receiveStartTime;
 
     /**
      * 兑奖结束时间
      */
-    @Column(name="act_receive_end", nullable = false)
+    @Column(name="act_receive_end")
     private Date receiveEndTime;
 
+    /**
+     * 活动提交人UU
+     * @return
+     */
+    @Column(name="act_useruu")
+    private Long userUU;
+
     /**
      * 活动提交人
      * @return
@@ -84,7 +93,7 @@ public class Activity implements Serializable{
     private Date submitTime;
 
     /**
-     * publish   1:已保存 2:已提交
+     * 是否发布,1:草稿  2:发布
      */
     @Column(name="act_publish")
     private Integer publish;
@@ -96,11 +105,11 @@ public class Activity implements Serializable{
     private Integer priority;
 
     /**
-     * 活动所处阶段(前台显示)
+     * 活动参与人数
+     * @return
      */
-    @Transient
-    private Short stage;
-
+    @Column(name = "act_joinAmount")
+    private Long joinAmount;
     /**
      * 活动中奖人数
      * @return
@@ -119,7 +128,7 @@ public class Activity implements Serializable{
      * @return
      */
     @Column(name="act_amount")
-    private Long amount;
+    private Double amount;
     /**
      * 相关项目数
      */
@@ -141,19 +150,48 @@ public class Activity implements Serializable{
     private String actImg;
 
     /**
-     * 活动参与人数
+     * 活动背景
      * @return
      */
-    @Column(name = "act_joinAmount")
-    private Long joinAmount;
+    @Column(name = "act_banner")
+    private String banner;
 
+    /**
+     * 参与记录
+     * @return
+     */
+    @OneToMany(mappedBy = "activity", cascade =  CascadeType.REFRESH, fetch = FetchType.EAGER)
+    @OrderBy("id")
+    private Set<ActivityRecode> activityRecords;
 
-    @OneToMany(cascade = CascadeType.REFRESH)
-    private  List<Award> awards;
 
-    @OneToMany(mappedBy = "activity", cascade = CascadeType.REFRESH, fetch = FetchType.EAGER)
-    @OrderBy("activityId")
-    private List<ProjectQualification> projectQualificationList;
+    /**
+     * 奖品
+     * @return
+     */
+    @OneToMany(mappedBy = "activity", cascade =  {CascadeType.REFRESH, CascadeType.PERSIST}, fetch = FetchType.EAGER)
+    @OrderBy("awardLevel")
+    private Set<Award> awards;
+
+    /**
+     * 关联项目
+     * @return
+     */
+    @OneToMany(fetch = FetchType.EAGER, cascade = {CascadeType.REFRESH})
+    @JoinTable(name = "donate$activityproject", joinColumns = @JoinColumn(name = "act_id", referencedColumnName = "act_id"), inverseJoinColumns = @JoinColumn(name="pro_id", referencedColumnName = "pro_id"))
+    private Set<Project> projects;
+
+    /**
+     * 奖品总数
+     */
+    @Transient
+    private Integer awardAmount;
+
+    /**
+     * 活动所处阶段(前台显示)
+     */
+    @Transient
+    private Short stage;
 
     public Long getId() {
         return id;
@@ -164,8 +202,7 @@ public class Activity implements Serializable{
     }
 
     public String getCode() {
-        Date date=new Date();
-        return date!=null?sdf.format(date):null;
+        return code;
     }
 
     public void setCode(String code) {
@@ -215,6 +252,15 @@ public class Activity implements Serializable{
         this.luckyTime = luckyTime;
     }
 
+    public String getReceiveStartTime() {
+        Date date=this.receiveStartTime;
+        return date!=null?sdf.format(this.receiveStartTime):null;
+    }
+
+    public void setReceiveStartTime(Date receiveStartTime) {
+        this.receiveStartTime = receiveStartTime;
+    }
+
     public String getReceiveEndTime() {
         Date date=this.receiveEndTime;
         return date!=null?sdf.format(this.receiveEndTime):null;
@@ -273,11 +319,11 @@ public class Activity implements Serializable{
         this.receivePerson = receivePerson;
     }
 
-    public Long getAmount() {
+    public Double getAmount() {
         return amount;
     }
 
-    public void setAmount(Long amount) {
+    public void setAmount(Double amount) {
         this.amount = amount;
     }
 
@@ -313,6 +359,59 @@ public class Activity implements Serializable{
         this.joinAmount = joinAmount;
     }
 
+    public Long getUserUU() {
+        return userUU;
+    }
+
+    public void setUserUU(Long userUU) {
+        this.userUU = userUU;
+    }
+
+    public Integer getAwardAmount() {
+        Integer amount = 0;
+        if (!CollectionUtils.isEmpty(this.getAwards())) {
+            for (Award award : this.getAwards()) {
+                amount += award.getAmount();
+            }
+        }
+        return amount;
+    }
+
+    public void setAwardAmount(Integer awardAmount) {
+        this.awardAmount = awardAmount;
+    }
+
+    public Set<ActivityRecode> getActivityRecords() {
+        return activityRecords;
+    }
+
+    public void setActivityRecords(Set<ActivityRecode> activityRecords) {
+        this.activityRecords = activityRecords;
+    }
+
+    public String getBanner() {
+        return banner;
+    }
+
+    public void setBanner(String banner) {
+        this.banner = banner;
+    }
+
+    public Set<Award> getAwards() {
+        return awards;
+    }
+
+    public void setAwards(Set<Award> awards) {
+        this.awards = awards;
+    }
+
+    public Set<Project> getProjects() {
+        return projects;
+    }
+
+    public void setProjects(Set<Project> projects) {
+        this.projects = projects;
+    }
 
     @SuppressWarnings("deprecation")
     public String getStage() {
@@ -359,28 +458,4 @@ public class Activity implements Serializable{
     public void setStage(Short stage) {
         this.stage = stage;
     }
-
-    public Date getReceiveStartTime() {
-        return receiveStartTime;
-    }
-
-    public void setReceiveStartTime(Date receiveStartTime) {
-        this.receiveStartTime = receiveStartTime;
-    }
-
-    public List<Award> getAwards() {
-        return awards;
-    }
-
-    public void setAwards(List<Award> awards) {
-        this.awards = awards;
-    }
-
-    public List<ProjectQualification> getProjectQualificationList() {
-        return projectQualificationList;
-    }
-
-    public void setProjectQualificationList(List<ProjectQualification> projectQualificationList) {
-        this.projectQualificationList = projectQualificationList;
-    }
 }

+ 2 - 3
donate-service/src/main/java/com/uas/service/donate/model/Org.java

@@ -317,9 +317,8 @@ public class Org implements Serializable{
         this.person = person;
     }
 
-    public String getSubmitTime() {
-        Date date=this.submitTime;
-        return date!=null?sdf.format(this.submitTime):null;
+    public Date getSubmitTime() {
+        return submitTime;
     }
 
     public void setSubmitTime(Date submitTime) {

+ 0 - 97
donate-service/src/main/java/com/uas/service/donate/model/ProjectQualification.java

@@ -1,97 +0,0 @@
-package com.uas.service.donate.model;
-
-import com.alibaba.fastjson.annotation.JSONField;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name="donate$projectqualification")
-public class ProjectQualification {
-    private static final long serialVersionUID = 1L;
-
-    @Id
-    @GeneratedValue(strategy= GenerationType.IDENTITY)
-    @Column(name="actqua_id")
-    private  Long id;
-
-    @Column(name = "actqua_act_id")
-    private Long activityId;
-
-    @Column(name = "actqua_pro_id")
-    private Long proId;
-
-    @Column(name = "actqua_pro_name")
-    private String name;
-
-    @Column(name = "actqua_pro_thumbnail")
-    private String projectThumbnail;
-
-    @Column(name = "actqua_pro_summary")
-    private String projectSummary;
-
-    /**
-     * 活动
-     */
-    @ManyToOne(cascade = {CascadeType.MERGE, CascadeType.REFRESH})
-    @JoinColumn(name = "actqua_act_id", nullable = false, insertable = false, updatable = false)
-    private Activity activity;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getActivityId() {
-        return activityId;
-    }
-
-    public void setActivityId(Long activityId) {
-        this.activityId = activityId;
-    }
-
-    public Long getProId() {
-        return proId;
-    }
-
-    public void setProId(Long proId) {
-        this.proId = proId;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getProjectThumbnail() {
-        return projectThumbnail;
-    }
-
-    public void setProjectThumbnail(String projectThumbnail) {
-        this.projectThumbnail = projectThumbnail;
-    }
-
-    public String getProjectSummary() {
-        return projectSummary;
-    }
-
-    public void setProjectSummary(String projectSummary) {
-        this.projectSummary = projectSummary;
-    }
-
-    @JsonIgnore
-    @JSONField(serialize = false)
-    public Activity getActivity() {
-        return activity;
-    }
-
-    public void setActivity(Activity activity) {
-        this.activity = activity;
-    }
-}

+ 44 - 38
donate-service/src/main/java/com/uas/service/donate/model/User.java

@@ -1,12 +1,10 @@
 package com.uas.service.donate.model;
 
+import com.uas.account.entity.UserView;
 
 import javax.persistence.*;
 import java.io.Serializable;
 
-/**
- * 个人账户信息
- */
 @Entity
 @Table(name="donate$user")
 public class User implements Serializable{
@@ -17,7 +15,7 @@ public class User implements Serializable{
      * 用户uu号
      */
     @Id
-    @GeneratedValue(strategy= GenerationType.IDENTITY)
+//    @GeneratedValue(strategy= GenerationType.IDENTITY)
     @Column(name = "user_uu")
     private Long userUU;
 
@@ -27,26 +25,25 @@ public class User implements Serializable{
     @Column(name = "user_name")
     private String name;
 
-    /**
-     * 用户密码
-     */
-    @Column(name = "user_pwd")
-    private String pwd;
-
     /**
      * 用户手机号
      */
     @Column(name = "user_tel")
-    private Long tel;
+    private String tel;
+
+    @Column(name = "user_email")
+    private String userEmail;
 
     @Column(name = "user_identity")
     private Integer identity;
 
     /**
-     * 用户在的公司
+     * 所属机构
      */
-    @Column(name = "user_company")
-    private String company;
+    @OneToOne(cascade = { CascadeType.REFRESH}, fetch = FetchType.EAGER)
+    @JoinColumn(name = "user_orgid")
+    @OrderBy("id")
+    private Org org;
 
     @Column(name = "user_imid")
     private Long userIMId;
@@ -59,6 +56,24 @@ public class User implements Serializable{
 
     private String wxOpenId;
 
+    public User() {
+
+    }
+
+    public User(UserView user) {
+        this.setUserUU(Long.valueOf(user.getDialectUID()));
+        this.setName(user.getName());
+        this.setTel(user.getUid());
+        this.setUserEmail(user.getSecondUID());
+    }
+
+    public Long getUserUU() {
+        return userUU;
+    }
+
+    public void setUserUU(Long userUU) {
+        this.userUU = userUU;
+    }
 
     public String getName() {
         return name;
@@ -68,44 +83,36 @@ public class User implements Serializable{
         this.name = name;
     }
 
-    public Long getTel() {
+    public String getTel() {
         return tel;
     }
 
-    public void setTel(Long tel) {
+    public void setTel(String tel) {
         this.tel = tel;
     }
 
-    public Integer getIdentity() {
-        return identity;
-    }
-
-    public void setIdentity(Integer identity) {
-        this.identity = identity;
-    }
-
-    public Long getUserUU() {
-        return userUU;
+    public String getUserEmail() {
+        return userEmail;
     }
 
-    public void setUserUU(Long userUU) {
-        this.userUU = userUU;
+    public void setUserEmail(String userEmail) {
+        this.userEmail = userEmail;
     }
 
-    public String getCompany() {
-        return company;
+    public Integer getIdentity() {
+        return identity;
     }
 
-    public void setCompany(String company) {
-        this.company = company;
+    public void setIdentity(Integer identity) {
+        this.identity = identity;
     }
 
-    public String getPwd() {
-        return pwd;
+    public Org getOrg() {
+        return org;
     }
 
-    public void setPwd(String pwd) {
-        this.pwd = pwd;
+    public void setOrg(Org org) {
+        this.org = org;
     }
 
     public Long getUserIMId() {
@@ -137,10 +144,9 @@ public class User implements Serializable{
         return "User{" +
                 "userUU=" + userUU +
                 ", name='" + name + '\'' +
-                ", pwd='" + pwd + '\'' +
                 ", tel=" + tel +
                 ", identity=" + identity +
-                ", company='" + company + '\'' +
+                ", organization='" + org.getName() + '\'' +
                 ", userIMId=" + userIMId +
                 ", type='" + type + '\'' +
                 ", wxOpenId='" + wxOpenId + '\'' +

+ 7 - 3
donate-service/src/main/java/com/uas/service/donate/service/ProjectService.java

@@ -65,9 +65,6 @@ public interface ProjectService {
     //找出某机构下面的所有项目
     List<Project> findProjectsByOrg(Long orgId);
 
-    //查询某项目关联的活动
-    Activity findByProId(Long proId);
-
     //找到某项目的相关项目
     List<Project> findSimilar(Long id);
 
@@ -78,4 +75,11 @@ public interface ProjectService {
      * @return
      */
     Page<Project> getOrgProjects(PageInfo pageInfo, SearchFilter filter);
+
+    /**
+     * 获取项目关联的活动
+     * @param id
+     * @return
+     */
+    Activity getJoinedActivity(Long id);
 }

+ 11 - 44
donate-service/src/main/java/com/uas/service/donate/service/impl/ActivityServiceImpl.java

@@ -5,7 +5,7 @@ import com.uas.service.donate.dao.ActivityRecodeDao;
 import com.uas.service.donate.dao.AwardDao;
 import com.uas.service.donate.model.Activity;
 import com.uas.service.donate.model.ActivityRecode;
-import com.uas.service.donate.model.Award;
+import com.uas.service.donate.model.Project;
 import com.uas.service.donate.model.SystemSession;
 import com.uas.service.donate.service.ActivityService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -13,7 +13,6 @@ import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
 import java.util.List;
 
 @Service
@@ -28,31 +27,10 @@ public class ActivityServiceImpl implements ActivityService {
     @Autowired
     private ActivityRecodeDao activityRecodeDao;
 
-    /**
-     * 将活动关联的奖品存进活动字段
-     * @return
-     */
-    private List<Activity> getAwards(List<Activity> activityList){
-
-        List<Activity> list=new ArrayList<>();
-        for(Activity activity:activityList){
-            //通过活动id取到奖品有哪些
-            List<Award> awardList=awardDao.findByActivityId(activity.getId());
-            activity.setAwards(awardList);
-            Activity newActivity=activityDao.save(activity);
-            list.add(newActivity);
-        }
-        return list;
-    }
-
     //搜索出所有进行中和已结束的活动
     public List<Activity> findAll(){
         //取得所有已开始和已结束的活动
-        List<Activity> activityList= activityDao.findAll();
-        //将所有活动所对应的奖品set进活动里
-        List<Activity> list=getAwards(activityList);
-
-        return activityDao.save(list);
+        return activityDao.findAll();
     }
 
     public Page<Activity> findAll(Pageable pageable){
@@ -61,23 +39,12 @@ public class ActivityServiceImpl implements ActivityService {
 
     public Activity fingById(Long id){
         //根据活动id找出活动
-        Activity activity=activityDao.findOne(id);
-        //获取活动的奖品
-        List<Award> awardList=awardDao.findByActivityId(id);
-        activity.setAwards(awardList);
-
-
-        return  activityDao.save(activity);
+        return activityDao.findOne(id);
     }
 
     //搜索出所有正在进行的活动
     public List<Activity> findInProcess() {
-
-        List<Activity> activityList= activityDao.findInProcess();
-        //将所有活动所对应的奖品set进活动里
-        List<Activity> list=getAwards(activityList);
-
-        return activityDao.save(list);
+        return activityDao.findInProcess();
     }
 
     public Page<Activity> findInProcess(Pageable pageable){
@@ -86,12 +53,7 @@ public class ActivityServiceImpl implements ActivityService {
 
     //搜索出所有已结束的活动,当前时间大于活动结束时间
     public List<Activity> findEndActivities(){
-
-        List<Activity> activityList= activityDao.findEndActivities();
-        //将所有活动所对应的奖品set进活动里
-        List<Activity> list=getAwards(activityList);
-
-        return activityDao.save(list);
+        return activityDao.findEndActivities();
     }
 
     public Page<Activity> findEndActivities(Pageable pageable){
@@ -104,7 +66,12 @@ public class ActivityServiceImpl implements ActivityService {
 
     //计算与活动相关的项目筹集的总金额
     public Double sumMoney(Long id){
-        return activityDao.sumMoney(id);
+        Double amount = 0d;
+        Activity activity = activityDao.findOne(id);
+        for (Project project : activity.getProjects()) {
+            amount += project.getTotalAmount();
+        }
+        return amount;
     }
 
     //根据活动名关键字,奖品名关键字查询活动

+ 16 - 3
donate-service/src/main/java/com/uas/service/donate/service/impl/ProjectServiceImpl.java

@@ -3,6 +3,7 @@ package com.uas.service.donate.service.impl;
 
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
+import com.uas.service.donate.dao.ActivityDao;
 import com.uas.service.donate.dao.ProjectDao;
 import com.uas.service.donate.dao.ProjectRecodeDao;
 import com.uas.service.donate.model.Activity;
@@ -16,6 +17,7 @@ import org.springframework.data.domain.Pageable;
 import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Service;
 import org.springframework.ui.ModelMap;
+import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 
 import javax.persistence.criteria.CriteriaBuilder;
@@ -35,6 +37,9 @@ public class ProjectServiceImpl implements ProjectService {
     @Autowired
     private ProjectRecodeDao projectRecodeDao;
 
+    @Autowired
+    private ActivityDao activityDao;
+
     //获取所有审核通过,进行中或者已结束的捐款项目
     public Page<Project> findAll(Pageable pageable){
 
@@ -194,11 +199,19 @@ public class ProjectServiceImpl implements ProjectService {
         return null;
     }
 
-    //查询某项目关联的活动
-    public Activity findByProId(Long proId){
-        return projectDao.findByProId(proId);
+    /**
+     * 获取项目关联的活动
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    public Activity getJoinedActivity(Long id) {
+        List<Activity> activities = activityDao.findJoinedActivityByProId(id);
+        return !CollectionUtils.isEmpty(activities) ? activities.get(0) : null;
     }
 
+
     //找到某项目的相关项目
     public List<Project> findSimilar(Long id){
         return projectDao.findSimilar(id);

+ 83 - 0
donate-service/src/main/webapp/resources/css/base.css

@@ -74,4 +74,87 @@ input,button,select,textarea{outline:none}
 button[disabled] {
 	cursor: not-allowed;
 	background-color: #acabab !important ;
+}
+/* 预览框 */
+#image-box .x-floating-wrap {
+	position: fixed;
+	z-index: 99998;
+	background: #000;
+	top: 0;
+	left: 0;
+	width: 100%;
+	height: 100%;
+	opacity: 0.5;
+}
+#image-box .x-floating {
+	position: fixed;
+	z-index: 99999;
+	width: 1200px;
+	height: 600px;
+	top: 50%;
+	left: 50%;
+	margin-left: -600px;
+	margin-top: -300px;
+	line-height: 560px;
+	text-align: center;
+	vertical-align: middle;
+}
+#image-box .x-floating img {
+	margin: auto auto;
+	max-width: 100% !important;
+	max-height: 600px !important;
+	-webkit-user-select: none;
+	-moz-user-select: none;
+	-ms-user-select: none;
+	user-select: none
+}
+
+#image-box .x-close-wrap {
+	position: fixed;
+	top: 0;
+	right: 0;
+	z-index: 100000;
+	width: 120px;
+	height: 120px;
+	margin: -60px -60px 0 0;
+	border-radius: 100%;
+	background: #000;
+	opacity: .3
+}
+
+#image-box .x-close-wrap a {
+	position: absolute;
+	left: 25px;
+	bottom: 25px;
+	font-size: 42px;
+	color: #fff
+}
+
+#image-box .x-close-wrap:hover {
+	opacity: .7
+}
+
+/*loading*/
+.loading {
+	display: none;
+	position: fixed;
+	width: 100%;
+	height: 100%;
+	top: 0;
+	left: 0;
+	z-index: 1000;
+}
+
+.loading.in {
+	display: block;
+}
+
+.loading.in>i {
+	position: absolute;
+	top: 50%;
+	left: 50%;
+	margin: -33px 0 0 -33px;
+	background: url("../images/loading.gif") no-repeat center center;
+	width: 66px;
+	height: 66px;
 }

BIN
donate-service/src/main/webapp/resources/images/loading.gif


+ 3 - 2
donate-service/src/main/webapp/resources/js/common/query/Project.js

@@ -58,7 +58,7 @@ define ([ 'ngResource' ], function() {
             },
             // 获取当前项目参与的活动
             getJoinedActivity: {
-                url:'',
+                url:'project/getJoinedActivity/:id',
                 method: 'GET'
             },
             // 获取当前项目的同类项目
@@ -67,7 +67,8 @@ define ([ 'ngResource' ], function() {
                 method: 'GET',
                 params: {
                     id: 'id'
-                }
+                },
+                isArray: true
             },
             // 获取所有项目进度
             getSchedules: {

+ 27 - 13
donate-service/src/main/webapp/resources/js/mobile/controllers/MobileProjectDetailCtrl.js

@@ -61,26 +61,40 @@ define([ 'app/app' ], function(app) {
         };
         init();
 
+        $scope.donation = null;
+        $scope.checked = false;
+
+        $scope.reload = function() {
+            if ($scope.projectParams.page() == 1)
+                $scope.projectParams.reload();
+            else
+                $scope.projectParams.page(1);
+        };
+
         // 捐款记录
         $scope.record = {
-            amount: null,
-            way: null
+            amount: 1,
+            way: '支付宝'
         };
 
+        // 设置捐款金额
         $scope.setMoney = function(value) {
-            if ($scope.record.amount !== value) {
-                $scope.record.amount = value;
-            }
+            $scope.record.amount = value;
+            $scope.donation = null;
+        };
+
+        // 输入金额
+        $scope.inputMoney = function() {
+            $scope.record.amount = $scope.donation;
         };
 
-        // 捐款
-        $scope.donate = function(id, record) {
-            record.proId = id;
-            Project.donate({imId: imId}, record, function (data) {
+        // 设置支付方式
+        $scope.setWay = function(way) {
+            $scope.record.way = way;
+        };
 
-            }, function () {
-                toaster.pop('error', '出现错误,操作失败');
-            });
-        }
+        $scope.changeChecked = function() {
+            $scope.checked = !$scope.checked;
+        };
     }]);
 });

+ 52 - 25
donate-service/src/main/webapp/resources/view/mobile/mobile_project_detail.html

@@ -558,6 +558,11 @@
         outline: none;
         border: none;
     }
+
+    .donation .btn button[disabled] {
+        background-color: #a0a0a0;
+        cursor: not-allowed;
+    }
 </style>
 <div class="nav">
     <div class="container">
@@ -610,7 +615,7 @@
                     </div>
                     <div class="intro-list">
                         <span>筹款截止日期</span>
-                        <p class="time">{{project.startTime | date:'yyyy-MM-dd'}}<br/>至nbsp;{{project.endTime | date:'yyyy-MM-dd'}}</p>
+                        <p class="time">{{project.startTime | date:'yyyy-MM-dd'}}<br/>至&nbsp;{{project.endTime | date:'yyyy-MM-dd'}}</p>
                     </div>
                 </div>
             </div>
@@ -662,7 +667,7 @@
             </div>
             <div class="footer">
                 <!--<a href="" class="look"><img src="../static/images/mobile/list-ul.png" alt=""/>查看同类其他项目</a>-->
-                <a class="attend" ng-click="donate(project.id, record)">我要捐款</a>
+                <a class="attend">我要捐款</a>
             </div>
         </div>
         <!--进度-->
@@ -694,7 +699,7 @@
             <!--</div>-->
             <div class="footer">
                 <!--<a href="" class="look"><img src="../static/images/mobile/list-ul.png" alt=""/>查看同类其他项目</a>-->
-                <a href="" class="attend" ng-click="donate(project.id, record)">我要捐款</a>
+                <a href="" class="attend">我要捐款</a>
             </div>
         </div>
         <!--活动-->
@@ -726,7 +731,7 @@
             </div>
             <div class="footer">
                 <!--<a href="" class="look"><img src="../static/images/mobile/list-ul.png" alt=""/>查看同类其他项目</a>-->
-                <a href="" class="attend" ng-click="donate(project.id, record)">我要捐款</a>
+                <a href="" class="attend">我要捐款</a>
             </div>
         </div>
         <!--机构-->
@@ -766,7 +771,7 @@
             </div>
             <div class="footer">
                 <!--<a href="" class="look"><img src="../static/images/mobile/list-ul.png" alt=""/>查看同类其他项目</a>-->
-                <a href="" class="attend" ng-click="donate(project.id, record)">我要捐款</a>
+                <a href="" class="attend">我要捐款</a>
             </div>
         </div>
         <!--结项报告-->
@@ -867,33 +872,35 @@
             </div>
         </div>
         <!--捐款弹出框-->
-        <div class="donation">
+        <div class="donation" style="display: none;">
             <div class="header">
                 <p>一元捐 <span>一份爱心,一份温暖</span></p>
                 <div class="close">&times;</div>
             </div>
-            <div class="body">
-                <ul id="choose-money" class="choose-money">
-                    <li class="active">1元</li>
-                    <li>50元</li>
-                    <li>100元</li>
-                    <li>200元</li>
-                </ul>
-                <div class="write"><input type="text" placeholder="自定义金额" class="form-control" id=""/><em>元</em></div>
-                <div class="mode">
-                    <span>付款方式:</span>
-                    <div class="mode-list">
-                        <div class="item active"><img src="" alt=""/>微信</div>
-                        <div class="item"><img src="" alt=""/>支付宝</div>
+            <form name="donationForm">
+                <div class="body">
+                    <ul id="choose-money" class="choose-money">
+                        <li class="active" ng-click="setMoney(1)">1元</li>
+                        <li ng-click="setMoney(1)">50元</li>
+                        <li ng-click="setMoney(1)">100元</li>
+                        <li ng-click="setMoney(1)">200元</li>
+                    </ul>
+                    <div class="write"><input type="text" ng-model="donation" ng-pattern="/^\d{1,9}(.\d{1,2})?$/" placeholder="自定义金额" class="form-control input-money" id=""/><em>元</em></div>
+                    <div class="mode">
+                        <span>付款方式:</span>
+                        <div class="mode-list">
+                            <div class="item active select-way"><a style="text-decoration: none" ng-click="setWay('支付宝')"><img src="static/images/zfb.png" alt=""/>支付宝</a></div>
+                            <div class="item select-way"><a style="text-decoration: none" ng-click="setWay('微信支付')"><img src="static/images/wx.png" alt=""/>微信支付</a></div>
+                        </div>
+                    </div>
+                    <div class="agree">
+                        <input type="checkbox" class="fl" required ng-checked="checked" ng-click="changeChecked()"><span class="fl">同意并接受《<a href="/userAgreement" target="_blank" style="color: #5078cb;">优软一元捐用户协议</a>》</span>
                     </div>
                 </div>
-                <div class="agree">
-                    <input type="checkbox"><span>同意并接受<a href="" target="_blank">《优软一元捐用户协议》</a></span></span>
+                <div class="btn">
+                    <button type="button" ng-disabled="donationForm.$invalid || !checked || record.amount == null || record.amount == 0"  onclick="pay(angular.element(this).scope().project.id, angular.element(this).scope().record.amount, angular.element(this).scope().record.way)">立即捐款</button>
                 </div>
-            </div>
-            <div class="btn">
-                <button>立即捐款</button>
-            </div>
+            </form>
         </div>
     </div>
 </div>
@@ -921,4 +928,24 @@
                 .css('-moz-box-shadow','0 -15px 4px rgba(255, 255, 255, 0.6)');
         }
     });
+
+    $('.attend').on('click', function() {
+        $('.donation').toggle();
+    });
+
+    $('.close').on('click', function() {
+        $('.donation').hide();
+    });
+
+    $('#choose-money').children().on('click', function() {
+        $(this).addClass('active').siblings().removeClass('active');
+    });
+
+    $('.input-money').on('focus', function () {
+        $('#choose-money').children().removeClass('active');
+    });
+
+    $('.select-way').on('click', function () {
+        $(this).addClass('active').siblings().removeClass('active');
+    });
 </script>

+ 1 - 1
donate-service/src/main/webapp/resources/view/project/organization_detail.html

@@ -766,7 +766,7 @@
                                     <div><span>已参与:<em>{{joinedPersonHistory | number}}</em>人</span></div>
                                     <div><span>已筹款:<em>{{project.totalAmount | number}}</em>元({{project.totalAmount * 100 / project.target | number: 2}}%)</span></div>
                                 </div>
-                                <a class="fr donation" data-toggle="modal" data-target="#layer">我要捐款</a>
+                                <button class="fr donation" data-toggle="modal" data-target="#layer" ng-disbled="project.overdue == '已结束'">我要捐款</button>
                             </div>
                         </td>
                     </tr>

+ 4 - 4
donate-service/src/main/webapp/resources/view/project/project_detail.html

@@ -769,7 +769,7 @@
                         <p>联系电话:<span ng-bind="project.personTel"></span></p>
                     </div>
                     <div class="button">
-                        <a data-toggle="modal" data-target="#layer"  ng-disabled="project.overdue == '已结束'">我要捐款</a>
+                        <button data-toggle="modal" data-target="#layer"  ng-disabled="project.overdue == '已结束'">我要捐款</button>
                     </div>
                 </div>
                 <div ng-include src="'static/view/project/project_detail_side.html'"></div>
@@ -896,7 +896,7 @@
                                 <li class="select-money" ng-click="setMoney(100)">100元</li>
                                 <li class="select-money" ng-click="setMoney(200)">200元</li>
                             </ul>
-                            <div class="write"><input type="text" ng-pattern="/^\d{1,9}(.\d{1,2})?$/" ng-model="donation" ng-click="setMoney(0)" ng-change="inputMoney()" placeholder="其他金额" class="write-money  form-control" maxlength="10"/><em>元</em></div>
+                            <div class="write"><input type="text" ng-pattern="/^\d{1,9}(.\d{1,2})?$/" ng-model="donation" ng-click="setMoney(0)" ng-change="inputMoney()" placeholder="其他金额" class="input-money  form-control" maxlength="10"/><em>元</em></div>
                         </div>
                     </div>
                     <div class="choose clearfix">
@@ -914,7 +914,7 @@
                             <input type="checkbox" class="fl" required ng-checked="checked" ng-click="changeChecked()"><span class="fl">同意并接受《<a href="/userAgreement" target="_blank" style="color: #5078cb;">优软一元捐用户协议</a>》</span>
                         </div>
                     </div>
-                    <button ng-disabled="donationForm.$invalid || !checked || projectRecord.amount == 0" onclick="pay(angular.element(this).scope().project.id, angular.element(this).scope().projectRecord.amount, angular.element(this).scope().projectRecord.way)">确认捐款</button>
+                    <button type="button" ng-disabled="donationForm.$invalid || !checked || projectRecord.amount == 0" onclick="pay(angular.element(this).scope().project.id, angular.element(this).scope().projectRecord.amount, angular.element(this).scope().projectRecord.way)">确认捐款</button>
                 </div>
             </form>
         </div>
@@ -934,7 +934,7 @@
     $('.select-way').on('click', function () {
         $(this).addClass('active').siblings().removeClass('active');
     });
-    $('.write-money').on('focus', function () {
+    $('.input-money').on('focus', function () {
         $('.select-money').removeClass('active');
     });
 </script>