Browse Source

审批的图片正常显示

user4 5 years ago
parent
commit
72b1405670

+ 5 - 5
src/main/java/com/jeeplus/modules/projectcontentinfo/web/ProjectcontentinfoController.java

@@ -788,8 +788,8 @@ public class ProjectcontentinfoController extends BaseController {
 	//
 	@RequestMapping(value = {"saveReport"})
 	public String saveReport(Projectcontentinfo projectcontentinfo, HttpServletRequest request, HttpServletResponse response,
-							 Model model,RedirectAttributes redirectAttributes) throws Exception {
-//		try{
+							 Model model,RedirectAttributes redirectAttributes)  {
+		try{
 			String str = projectcontentinfoService.saveData(projectcontentinfo,2);
 			addMessage(redirectAttributes, "发起报告审批"+(str.equals("true")?"成功":"失败"));
 			ProjectReportData projectReportData = projectcontentinfo.getProjectReportData();
@@ -801,9 +801,9 @@ public class ProjectcontentinfoController extends BaseController {
 				}
 				return "redirect:"+Global.getAdminPath()+"/projectcontentinfo/projectcontentinfo/?id="+projectcontentinfo.getId();
 			}
-//		}catch (Exception e){
-//			logger.error("ProjectcontentinfoController save Exception e"+e);
-//		}
+		}catch (Exception e){
+			logger.error("ProjectcontentinfoController save Exception e"+e);
+		}
 		if(UserUtils.isManager()){
 			model.addAttribute("flag","1");
 		}

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

@@ -20,6 +20,7 @@ import com.google.common.collect.Maps;
 import com.jeeplus.common.bos.BOSClientUtil;
 import com.jeeplus.common.json.AjaxJson;
 import com.jeeplus.common.oss.OSSClientUtil;
+import com.jeeplus.common.utils.FileUtils;
 import com.jeeplus.modules.sys.entity.Area;
 import com.jeeplus.modules.sys.entity.Role;
 import com.jeeplus.modules.sys.service.RoleService;
@@ -232,6 +233,8 @@ public class WorkStaffBasicInfoController extends BaseController {
             BOSClientUtil bosClientUtil = new BOSClientUtil();
 			String url = bosClientUtil.upload(path, inputStream);
             workStaffBasicInfo.setPicture(url);
+		}else{
+			workStaffBasicInfo.setPicture("");
 		}
 
 		if(!workStaffBasicInfo.getIsNewRecord()){//编辑表单保存
@@ -519,6 +522,9 @@ public class WorkStaffBasicInfoController extends BaseController {
 			workProjectNotify.setNotifyId(workStaffBasicInfo.getId());
 			workProjectNotifyService.readByNotifyId(workProjectNotify);
 		}
+		if (workStaffBasicInfo.getPictureFile() == null || workStaffBasicInfo.getPictureFile().getSize() < 0) {
+			workStaffBasicInfo.setPicture("");
+		}
 		workStaffBasicInfoService.completeApply(workStaffBasicInfo.getId());
 		workStaffBasicInfoService.saveLog(workStaffBasicInfo);
 		addMessage(redirectAttributes, "申请员工档案信息成功");
@@ -631,12 +637,6 @@ public class WorkStaffBasicInfoController extends BaseController {
 		if (!beanValidator(model, workStaffBasicInfo)){
 			return form(workStaffBasicInfo, model,false);
 		}
-		String url = new StringBuffer().append("/employeeImg/").
-				append(workStaffBasicInfo.getName()).append(System.currentTimeMillis()).append(".png").toString();
-		BOSClientUtil bosClientUtil = new BOSClientUtil();
-		String upload = bosClientUtil.upload(url, workStaffBasicInfo.getPictureFile().getInputStream());
-		workStaffBasicInfo.setPicture(upload);
-
 		WorkStaffBasicInfo basicInfo = workStaffBasicInfoService.getBasicInfoByAchiveId(workStaffBasicInfo.getId());
 		WorkStaffBasicInfo select = new WorkStaffBasicInfo();
 		select.setAchiveId(workStaffBasicInfo.getId());

+ 3 - 4
src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailAudit.jsp

@@ -40,8 +40,8 @@
                                 $("#nativePlaceName").css("color","red");
                             }else if(name=="picture"){
                                 $("#this_upload_image_1").prop("src",data.newValue);
-                                this_upload_show_image("1");
-
+                                $("#picture").val(data.newValue);
+                                // this_upload_show_image("1");
                             }else{
                                 if(name=='exSoldier'){
                                     $("#exSoldierId").val(data.newValue);
@@ -415,11 +415,10 @@
                                                 <img alt="_blank" id="this_upload_image_1" class="upload_ico" style="cursor:pointer;"  src="${workStaffBasicInfo.picture}"/>
                                             </c:when>
                                             <c:otherwise>
-                                                <span id="this_upload_close_1" class="pic_close glyphicon glyphicon-remove" onclick="this_close_img(1)"></span>
                                                 <img alt="_blank" id="this_upload_image_1" name="pictureFile" class="upload_ico" style="cursor:pointer;"  src="${pageContext.request.contextPath}/static/common/img/pic_add.png"/>
                                             </c:otherwise>
                                         </c:choose>
-                                        <input style="display: none" name="picture" class="basicInfo">
+                                        <input id="picture" type="text" name="picture" style="display: none" class="basicInfo">
                                         <input id="this_upload_file_1" type="file" style="display:none"  name="pictureFile"  onchange="this_upload_show_image(1)"  class="form-control"/>
                                     </div>
                                 </div>

+ 1 - 1
src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailForm.jsp

@@ -94,7 +94,7 @@
             var this_upload_div_1 =
                 '<div id="this_upload_div_'+ index + '" style="position:relative;">'+
                 '<img  id="this_upload_image_' + index + '" class="upload_ico" style="cursor:pointer;"  src="${pageContext.request.contextPath}/static/common/img/pic_add.png"  onclick="this_upload_image_button('+index+')"/>'+
-                '<input id="this_upload_file_'+ index + '" type="file" style="display:none"  name="this_upload_files"  onchange="this_upload_show_image('+index+ ')" /><br>'+
+                '<input id="this_upload_file_'+ index + '" type="file" style="display:none"  name="pictureFile"  onchange="this_upload_show_image('+index+ ')" /><br>'+
                 '</div>';
             $("#this_upload_image_div_"+ index).html("").append(this_upload_div_1);
         }

+ 1 - 1
src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoForm.jsp

@@ -28,7 +28,7 @@
                 if(!existMobile){
                     var  flag = $("#updateFlag").val();
                     if(flag === '1'){
-                        $("#notifyFlag").val("1");
+                        // $("#notifyFlag").val("1");
                         $("#inputForm").submit();
                         parent.layer.closeAll();
                     }else {