소스 검색

我的信息-直接修改

user4 5 년 전
부모
커밋
f693360961

+ 2 - 0
src/main/java/com/jeeplus/modules/workstaff/dao/WorkStaffBasicInfoDao.java

@@ -51,4 +51,6 @@ public interface WorkStaffBasicInfoDao extends CrudDao<WorkStaffBasicInfo> {
     List<WorkStaffBasicInfo> findByName(String name);
 
     int updateWorkStaffBasicInfo(WorkStaffBasicInfo workStaffBasicInfo);
+
+    WorkStaffBasicInfo getByAchieveId(String achieveId);
 }

+ 5 - 1
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffBasicInfoService.java

@@ -205,8 +205,8 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         workStaffBasicInfo.setAchiveId(workStaffBasicInfo.getId());
         workStaffBasicInfo.setId(baseId);
         super.save(workStaffBasicInfo);
-        workStaffBasicInfoDao.updateWorkStaffBasicInfo(workStaffBasicInfo);
         this.saveDetails(workStaffBasicInfo,false);
+
     }
     public void preSave(WorkStaffBasicInfo workStaffBasicInfo, HttpServletRequest request) throws IOException {
         if(workStaffBasicInfo.getCompany()==null){
@@ -845,4 +845,8 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         workStaffAchivesDao.updateWorkStaffAchieves(workStaffBasicInfo);
     }
 
+    public WorkStaffBasicInfo getBasicInfoByAchiveId(String achiveId){
+        return workStaffBasicInfoDao.getByAchieveId(achiveId);
+    }
+
 }

+ 6 - 4
src/main/java/com/jeeplus/modules/workstaff/web/WorkStaffBasicInfoController.java

@@ -34,6 +34,7 @@ import com.jeeplus.modules.workstaffachiveslog.dao.WorkStaffAchivesLogDao;
 import com.jeeplus.modules.workstaffachiveslog.entity.WorkStaffAchivesLog;
 import com.jeeplus.modules.workstaffachiveslog.service.WorkStaffAchivesLogService;
 import net.sf.json.JSONObject;
+import netscape.security.UserTarget;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -537,11 +538,12 @@ public class WorkStaffBasicInfoController extends BaseController {
 		if (!beanValidator(model, workStaffBasicInfo)){
 			return form(workStaffBasicInfo, model,false);
 		}
-        WorkStaffBasicInfo basicInfo = UserUtils.getBasicInfo();
-		workStaffBasicInfo.setId(basicInfo.getId());
-		workStaffBasicInfo.setAchiveId(basicInfo.getId());
-        workStaffBasicInfoService.updateAchieveDirectly(workStaffBasicInfo,request);
+		workStaffBasicInfo.setIsNewRecord(false);
+		WorkStaffBasicInfo t = workStaffBasicInfoService.getBasicInfoByAchiveId(workStaffBasicInfo.getId());//从数据库取出记录的值
+		MyBeanUtils.copyBeanNotNull2Bean(workStaffBasicInfo, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
+		workStaffBasicInfoService.updateAchieveDirectly(workStaffBasicInfo,request);
 		addMessage(redirectAttributes, "保存员工档案信息成功");
+
 		return "redirect:"+Global.getAdminPath()+"/sys/user/info?repage";
 	}
 

+ 2 - 0
src/main/resources/mappings/modules/workstaff/WorkStaffAchivesDao.xml

@@ -772,6 +772,8 @@
 		FROM work_staff_achives a
 		<include refid="workStaffBasicInfoJoins"/>
 		WHERE a.user_id = #{userId} and a.company_id=#{company.id} and a.status not in ('离职','退休')
+		order by a.create_date desc
+		limit 1
 	</select>
 	<select id="getJob" resultType="WorkStaffBasicInfo" >
 		SELECT

+ 6 - 0
src/main/resources/mappings/modules/workstaff/WorkStaffBasicInfoDao.xml

@@ -538,4 +538,10 @@
 		where user_id = #{userId}
 	</update>
 
+	<select id="getByAchieveId" parameterType="String" resultType="WorkStaffBasicInfo">
+		select w.*
+		from work_staff_basic_info w left join work_staff_achives a
+		on w.user_id = a.user_id
+		where a.id = #{achieveId}
+	</select>
 </mapper>

+ 0 - 5
src/main/webapp/webpage/modules/projectrecord/projectRecordsForm.jsp

@@ -302,11 +302,6 @@
 
                         $("#"+"workClientLinkmanList"+row+"_id").val(d.id);
                         $("#"+"workClientLinkmanList"+row+"_clientId_id").val(d.clientId);
-                        console.log("------------")
-                        console.log(d.clientId);
-                        console.log("+++++++++++++++");
-                        console.log($("#"+"workClientLinkmanList"+row+"_clientId.id").val());
-
                         $("#"+"workClientLinkmanList"+row+"_clientName").val(d.clientName);
                         $("#"+"workClientLinkmanList"+row+"_name").val(d.linkName);
                         $("#"+"workClientLinkmanList"+row+"_linkMobile").val(d.linkMobile);

+ 30 - 36
src/main/webapp/webpage/modules/sys/userInfo.jsp

@@ -199,45 +199,39 @@
             });
         }
         function openDialog2(title,url,width,height,target) {
-            $.ajax({
-                type:'post',
-                url:'${ctx}/workstaff/workStaffBasicInfo/getApply',
-                success:function(data) {
-                    if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
-                        width = 'auto';
-                        height = 'auto';
-                    } else {//如果是PC端,根据用户设置的width和height显示。
+            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+                width = 'auto';
+                height = 'auto';
+            } else {//如果是PC端,根据用户设置的width和height显示。
 
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                content: url,
+                btn: ["提交","关闭"],
+                btn1: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
                     }
-                    top.layer.open({
-                        type: 2,
-                        area: [width, height],
-                        title: title,
-                        maxmin: true, //开启最大化最小化按钮
-                        content: url,
-                        btn: ["提交","关闭"],
-                        btn1: function(index, layero){
-                            var body = top.layer.getChildFrame('body', index);
-                            var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
-                            var inputForm = body.find('#inputForm');
-                            var top_iframe;
-                            if(target){
-                                top_iframe = target;//如果指定了iframe,则在改frame中跳转
-                            }else{
-                                top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
-                            }
-                            inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
 
-                            if(iframeWin.contentWindow.doSubmit(index) ){
-                                // top.layer.close(index);//关闭对话框。
-                                setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
-                            }
-                            return false;
-                        },
-                        btn2: function (index) {
+                    if(iframeWin.contentWindow.doSubmit(index) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                    return false;
+                },
+                btn2: function (index) {
 
-                        }
-                    });
                 }
             });
         }
@@ -684,7 +678,7 @@
                                             </thead>
                                             <tbody id="educationList">
                                             <c:forEach items="${workStaffBasicInfo.educationList}" var="education" varStatus="varStatus">
-                                                <tr>
+                                                <tr id="${education.id}">
                                                     <td>
                                                             ${education.school}
                                                     </td>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1139 - 1140
src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailModifyDirectly.jsp