Browse Source

Merge remote-tracking branch 'origin/master'

Enford 5 years ago
parent
commit
b054fa38dc

+ 3 - 0
src/main/java/com/jeeplus/modules/projectplanweekly/dao/ProjectPlanWeeklyDao.java

@@ -13,6 +13,9 @@ public interface ProjectPlanWeeklyDao extends CrudDao<ProjectPlanWeekly> {
 
     public List<ProjectPlanWeekly> findWeekly(ProjectPlanWeekly projectPlanWeekly);
 
+    //基础员工获取信息
+    public List<ProjectPlanWeekly> findWeeklyByStaff(ProjectPlanWeekly projectPlanWeekly);
+
     public Integer saveRemarksReason(ProjectPlanWeekly projectPlanWeekly);
 
     public Integer saveRemarksReasonInfo(ProjectPlanWeekly projectPlanWeekly);

+ 18 - 0
src/main/java/com/jeeplus/modules/projectplanweekly/entity/ProjectPlanWeekly.java

@@ -19,6 +19,8 @@ public class ProjectPlanWeekly extends DataEntity<ProjectPlanWeekly> {
     private String remarksReason; //备注原因
     private String officeId;
     private String companyId;
+    private String projectUserId;//项目负责人id
+    private String principalUserName;//负责人名称
 
     private String btnAgent;//按钮控制
 
@@ -123,4 +125,20 @@ public class ProjectPlanWeekly extends DataEntity<ProjectPlanWeekly> {
     public void setRemarksReason(String remarksReason) {
         this.remarksReason = remarksReason;
     }
+
+    public String getProjectUserId() {
+        return projectUserId;
+    }
+
+    public void setProjectUserId(String projectUserId) {
+        this.projectUserId = projectUserId;
+    }
+
+    public String getPrincipalUserName() {
+        return principalUserName;
+    }
+
+    public void setPrincipalUserName(String principalUserName) {
+        this.principalUserName = principalUserName;
+    }
 }

+ 12 - 1
src/main/java/com/jeeplus/modules/projectplanweekly/service/ProjectPlanWeeklyService.java

@@ -65,7 +65,18 @@ public class ProjectPlanWeeklyService extends CrudService<ProjectPlanWeeklyDao,
             entity.setWeeklyStatus("0");
         }
         entity.setPage(page);
-        List<ProjectPlanWeekly> weekly = projectPlanWeeklyDao.findWeekly(entity);
+        List<ProjectPlanWeekly> weekly = new ArrayList<>();
+        if (0 != entity.getSqlMap().size()){
+            String dataSql = entity.getSqlMap().get("dsf");
+            boolean boolResult = dataSql.contains("create_by");
+            if (boolResult){
+                weekly = projectPlanWeeklyDao.findWeeklyByStaff(entity);
+            }else{
+                weekly = projectPlanWeeklyDao.findWeekly(entity);
+            }
+        }else{
+            weekly = projectPlanWeeklyDao.findWeekly(entity);
+        }
         page.setList(weekly);
         return page;
     }

+ 9 - 0
src/main/java/com/jeeplus/modules/projectrecord/entity/ProjectRecordsAlter.java

@@ -55,6 +55,7 @@ public class ProjectRecordsAlter extends ActEntity<ProjectRecordsAlter> {
 	private Double buildingUnitFees;  //土建单位造价
 	private Double installUnitFees;    //安装单位造价
 	private Double totalFees;        //总合同额
+	private List<ProjectPlanInfo> projectPlanList;  //项目计划
 
 	@NotNull(message = "委托方联系人不能为空")
 	private List<WorkClientLinkman> workClientLinkmanList;		// 委托方联系人
@@ -515,4 +516,12 @@ public class ProjectRecordsAlter extends ActEntity<ProjectRecordsAlter> {
 	public void setTotalFees(Double totalFees) {
 		this.totalFees = totalFees;
 	}
+
+	public List<ProjectPlanInfo> getProjectPlanList() {
+		return projectPlanList;
+	}
+
+	public void setProjectPlanList(List<ProjectPlanInfo> projectPlanList) {
+		this.projectPlanList = projectPlanList;
+	}
 }

+ 4 - 4
src/main/resources/jeeplus.properties

@@ -6,13 +6,13 @@
 jdbc.type=mysql
 jdbc.driver=com.mysql.jdbc.Driver
 db.name=ruihuaoa-activity-data
-jdbc.url=jdbc:mysql://47.114.188.201:3306/hp_total_process?useUnicode=true&characterEncoding=utf-8
+#jdbc.url=jdbc:mysql://47.114.188.201:3306/hp_total_process?useUnicode=true&characterEncoding=utf-8
 #jdbc.url=jdbc:mysql://192.168.2.4:3306/hp_total_process?useUnicode=true&characterEncoding=utf-8
-#jdbc.url=jdbc:mysql://127.0.0.1:3306/hp_total_pocess?useUnicode=true&characterEncoding=utf-8
+jdbc.url=jdbc:mysql://127.0.0.1:3306/hp_total_process?useUnicode=true&characterEncoding=utf-8
 jdbc.username=root
 #jdbc.password=123456
-jdbc.password=jsjy2020.
-#jdbc.password=root
+#jdbc.password=jsjy2020.
+jdbc.password=root
 
 #pool settings
 jdbc.pool.init=20

+ 86 - 18
src/main/resources/mappings/modules/projectplanweekly/ProjectPlanWeeklyDao.xml

@@ -229,35 +229,40 @@
 			a.projectId AS "projectRecords.id",
 			a.project_name AS "projectRecords.projectName",
 			a.company_id as "company.id",
-			a.office_id as "office.id"
+			a.office_id as "office.id",
+            a.user_id as "projectUserId",
+            a.principal_name as "principalUserName"
 		from(
-			select
-				p.id ,p.create_by ,p.create_date ,p.update_by ,p.update_date ,p.remarks ,p.del_flag ,p.begin_date,p.end_date,p.project_id,p.weekly_status,p.remarks_status,p.remarks_reason,p.project_id as projectId,r.project_name,p.company_id,p.office_id
-			  from
-				project_plan_weekly p
-		left join project_records r on  p.project_id = r.id
-			  union all
 			  select
-				i.id ,i.create_by ,i.create_date ,i.update_by ,i.update_date ,i.remarks ,i.del_flag ,i.begin_date,i.end_date,i.project_id,i.weekly_status,i.remarks_status,i.remarks_reason,i.project_id as projectId,r.project_name,i.company_id,i.office_id
-			  from
-				project_plan_info i
-		left join project_records r on  i.project_id = r.id
+				p.id ,p.create_by ,p.create_date ,p.update_by ,p.update_date ,p.remarks ,p.del_flag ,p.begin_date,p.end_date,p.project_id,p.weekly_status,p.remarks_status,p.remarks_reason,p.project_id as projectId,r.project_name,p.company_id,p.office_id,wpr.user_id,su.name as "principal_name"
+			  from project_plan_weekly p
+		      left join project_records r on  p.project_id = r.id
+		      left join work_project_user wpr on  wpr.project_id = r.id
+              left join sys_user su on su.id = p.create_by
+			union all
+			  select
+				i.id ,i.create_by ,i.create_date ,i.update_by ,i.update_date ,i.remarks ,i.del_flag ,i.begin_date,i.end_date,i.project_id,i.weekly_status,i.remarks_status,i.remarks_reason,i.project_id as projectId,r.project_name,i.company_id,i.office_id,wpr.user_id,su.name as "principal_name"
+			  from project_plan_info i
+		      left join project_records r on  i.project_id = r.id
+              left join work_project_user wpr on  wpr.project_id = r.id
+              left join sys_user su on su.id = wpr.user_id
+		where r.status = 5 and r.del_flag=0
 		) as a
 		left join project_records r on  a.project_id = r.id
 		left join work_project_user wpu on wpu.project_id = r.id
 		<where>
 
-			<if test="weeklyStatus !=null and weeklyStatus == '0'">
+			<if test="weeklyStatus !=null and weeklyStatus == 0">
 				AND a.weekly_status = #{weeklyStatus}
-				and a.end_date 	&lt;= #{endDate}
+				and (a.end_date &lt;= #{endDate} or #{endDate} between a.begin_date and a.end_date )
 			</if>
-			<if test="weeklyStatus !=null and weeklyStatus == '1'">
+			<if test="weeklyStatus !=null and weeklyStatus == 1">
 				AND a.weekly_status = #{weeklyStatus}
-				and a.begin_date >= #{beginDate} and a.begin_date 	&lt;= #{endDate}
-				and a.end_date >= #{endDate}
+				and (#{beginDate} between a.begin_date and a.end_date
+				 or #{endDate} between a.begin_date and a.end_date
+				)
 			</if>
-			(wpu.user_id = #{currentUser.id} ${sqlMap.dsf}) and
-			r.status = 5 and r.del_flag=0
+			 and (wpu.user_id = #{currentUser.id} ${sqlMap.dsf})
 		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
@@ -269,6 +274,69 @@
 		</choose>
 	</select>
 
+    <select id="findWeeklyByStaff" resultType="com.jeeplus.modules.projectplanweekly.entity.ProjectPlanWeekly">
+        select
+        a.id AS "id",
+        a.create_by AS "createBy.id",
+        a.create_date AS "createDate",
+        a.update_by AS "updateBy.id",
+        a.update_date AS "updateDate",
+        a.remarks AS "remarks",
+        a.del_flag AS "delFlag",
+        a.begin_date AS "beginDate",
+        a.end_date AS "endDate",
+        a.project_id AS "projectId",
+        a.weekly_status AS "weeklyStatus",
+        a.remarks_status AS "remarksStatus",
+        a.remarks_reason AS "remarksReason",
+        a.projectId AS "projectRecords.id",
+        a.project_name AS "projectRecords.projectName",
+        a.company_id as "company.id",
+        a.office_id as "office.id",
+        a.user_id as "projectUserId",
+        a.principal_name as "principalUserName"
+        from(
+        select
+        p.id ,p.create_by ,p.create_date ,p.update_by ,p.update_date ,p.remarks ,p.del_flag ,p.begin_date,p.end_date,p.project_id,p.weekly_status,p.remarks_status,p.remarks_reason,p.project_id as projectId,r.project_name,p.company_id,p.office_id,wpr.user_id,su.name as "principal_name"
+        from project_plan_weekly p
+        left join project_records r on  p.project_id = r.id
+        left join work_project_user wpr on  wpr.project_id = r.id
+        left join sys_user su on su.id = p.create_by
+        union all
+        select
+        i.id ,i.create_by ,i.create_date ,i.update_by ,i.update_date ,i.remarks ,i.del_flag ,i.begin_date,i.end_date,i.project_id,i.weekly_status,i.remarks_status,i.remarks_reason,i.project_id as projectId,r.project_name,i.company_id,i.office_id,wpr.user_id,su.name as "principal_name"
+        from project_plan_info i
+        left join project_records r on  i.project_id = r.id
+        left join work_project_user wpr on  wpr.project_id = r.id
+        left join sys_user su on su.id = wpr.user_id
+        where r.status = 5 and r.del_flag=0 and wpr.user_id = #{currentUser.id}
+        ) as a
+        left join project_records r on  a.project_id = r.id
+        left join work_project_user wpu on wpu.project_id = r.id
+        <where>
+
+            <if test="weeklyStatus !=null and weeklyStatus == 0">
+                AND a.weekly_status = #{weeklyStatus}
+                and ((a.end_date &lt;= #{endDate} or #{endDate} between a.begin_date and a.end_date )
+            </if>
+            <if test="weeklyStatus !=null and weeklyStatus == 1">
+                AND a.weekly_status = #{weeklyStatus}
+                and ((#{beginDate} between a.begin_date and a.end_date
+                or #{endDate} between a.begin_date and a.end_date
+                )
+            </if>
+            ${sqlMap.dsf})
+        </where>
+        <choose>
+            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
+                ORDER BY ${page.orderBy}
+            </when>
+            <otherwise>
+                ORDER BY a.weekly_status asc,a.begin_date asc,a.end_date asc
+            </otherwise>
+        </choose>
+    </select>
+
 
 	<update id="saveRemarksReason">
 		UPDATE project_plan_weekly SET

+ 2 - 2
src/main/resources/spring-context-jedis.xml

@@ -20,8 +20,8 @@
 		<constructor-arg index="0" ref="jedisPoolConfig" />
 		<constructor-arg index="1" value="${redis.host}" />
 		<constructor-arg index="2" value="${redis.port}" type="int" />
-		<!--<constructor-arg index="3" value="${redis.timeout}" type="int" />-->
-		<!--<constructor-arg index="4" value="${redis.password}" />-->
+		<constructor-arg index="3" value="${redis.timeout}" type="int" />
+		<constructor-arg index="4" value="${redis.password}" />
 	</bean>
 	
 </beans>

+ 86 - 0
src/main/webapp/webpage/modules/projectrecord/projectRecordsView.jsp

@@ -41,6 +41,42 @@
                 }
             });
         }
+        function addPlanRow(list, idx, tpl, row){
+            // var idx1 = $("#workClientLinkmanList tr").length;
+            bornTempletePlan(list, idx, tpl, row, idx);
+        }
+
+        function bornTempletePlan(list, idx, tpl, row, idx1){
+            $(list).append(Mustache.render(tpl, {
+                idx: idx, delBtn: true, row: row,
+                order:idx1 + 1
+            }));
+            $(list+idx).find("select").each(function(){
+                $(this).val($(this).attr("data-value"));
+            });
+            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+                var ss = $(this).attr("data-value").split(',');
+                for (var i=0; i<ss.length; i++){
+                    if($(this).val() == ss[i]){
+                        $(this).attr("checked","checked");
+                    }
+                }
+            });
+
+            laydate.render({
+                elem : (list+idx+"_beginDate"),
+                event: 'focus',
+                type : 'date',
+                trigger: 'click'
+            });
+            laydate.render({
+                elem : (list+idx+"_endDate"),
+                event: 'focus',
+                type : 'date',
+                trigger: 'click'
+            });
+        }
+
         function seeFile(fileUrl,fileName) {
             //   location.href = "/followRecord/seeFile";
             var index = fileName.lastIndexOf(".");
@@ -302,6 +338,40 @@
 						<textarea htmlEscape="false" rows="4" readonly="true" maxlength="1000" class="form-control" >${projectRecords.remarks}</textarea>
 					</div>
 				</div>
+                <div class="layui-item layui-col-sm12 lw7">
+                    <label class="layui-form-label"><span class="require-item">*</span>项目计划书:</label>
+                    <div class="layui-input-block">
+                        <table id="bankinfo" class="table table-bordered table-condensed no-bottom-margin details">
+                            <thead>
+                            <tr>
+                                <th width="20%">开始时间</th>
+                                <th width="20%">结束时间</th>
+                                <th width="60%;">工作内容</th>
+                            </tr>
+                            </thead>
+                            <tbody id="projectPlanList">
+
+                            </tbody>
+                        </table>
+                        <script type="text/template" id="workClientBankTpl">//<!--
+                            <tr id="projectPlanList{{idx}}">
+                                <td class="hide">
+                                    <input id="projectPlanList{{idx}}_id" name="projectPlanList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+                                    <input id="projectPlanList{{idx}}_delFlag" name="projectPlanList[{{idx}}].delFlag" type="hidden" value="0"/>
+                                </td>
+                                <td>
+                                    {{row.beginDate}}
+                                </td>
+                                <td>
+                                    {{row.endDate}}
+                                </td>
+                                <td>
+                                    {{row.remarks}}
+                                </td>
+                            </tr>//-->
+                        </script>
+                    </div>
+                </div>
 			</div>
 
 			<div class="form-group layui-row">
@@ -631,5 +701,21 @@
 		</form:form>
 	</div>
 </div>
+<script type="text/javascript">
+    var workClientLinkmanRowIdx = 0,
+        workClientLinkmanTpl = $("#workClientLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
+    var workClientBankRowIdx = 0,
+        workClientBankTpl = $("#workClientBankTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
+    $(document).ready(function () {
+        var data = ${fns:toJson(projectRecords.projectPlanList)};
+        if (null!=data){
+            for (var i = 0; i < data.length; i++) {
+                addPlanRow('#projectPlanList', workClientBankRowIdx, workClientBankTpl, data[i]);
+                workClientBankRowIdx = workClientBankRowIdx + 1;
+            }
+        }
+    });
+
+</script>
 </body>
 </html>