Browse Source

入职登记人员信息添加手签章图片上传功能

user5 3 years ago
parent
commit
dc6458b0b7
17 changed files with 718 additions and 42 deletions
  1. 78 0
      src/main/java/com/jeeplus/common/bos/BosController.java
  2. 27 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/Form.java
  3. 27 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/Operator.java
  4. 47 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/OperatorData.java
  5. 146 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/PhysicsSeal.java
  6. 45 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/SealAuthBean.java
  7. 65 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/ThirdFlowNode.java
  8. 36 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectSignatureOldMessageDisposeController.java
  9. 62 0
      src/main/java/com/jeeplus/modules/tools/utils/SignaturePostUtil.java
  10. 46 28
      src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffBasicInfo.java
  11. 15 1
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffBasicInfoService.java
  12. 21 4
      src/main/java/com/jeeplus/modules/workstaff/web/WorkStaffBasicInfoController.java
  13. 8 4
      src/main/resources/mappings/modules/workstaff/WorkStaffBasicInfoDao.xml
  14. 3 3
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailForm.jsp
  15. 1 1
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailModifyDirectly.jsp
  16. 73 0
      src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoForm.jsp
  17. 18 1
      src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoView.jsp

+ 78 - 0
src/main/java/com/jeeplus/common/bos/BosController.java

@@ -110,6 +110,84 @@ public class BosController {
         }
         return map;
     }
+    @RequestMapping("upLoadHandSignatureImg")
+    @ResponseBody
+    public Map upLoadHandSignatureImg(HttpServletRequest request, MultipartFile file, MultipartHttpServletRequest multiRequest){
+        Map map = new HashMap();
+        String storeAs = "handSignature";
+        // 文件存储方式(0:本地服务器存储。1:云端存储)
+        if("1".equals(uploadMode)){
+            try {
+                //MultipartFile转File
+                File srcFile = transformMultipartFile(file);
+                String path = directory+"/"+storeAs+datePath()+"/"+ System.currentTimeMillis()+srcFile.getName();
+                BOSClientUtil bosClientUtil = new BOSClientUtil();
+                InputStream inputStream = file.getInputStream();
+                String upload = bosClientUtil.upload(path, inputStream);
+                if(srcFile.exists()){
+                    srcFile.delete();
+                }
+                map.put("msg","上传成功");
+                map.put("code","1");
+                map.put("url",upload);
+            }catch (Exception e){
+                map.put("msg","上传失败");
+                map.put("code","0");
+                logger.error("Exception e:"+e);
+            }
+        }else if("2".equals(uploadMode)){
+            String filepath = "";
+            LayFileJsonData data = new LayFileJsonData();
+            // 判断文件是否为空
+            Iterator<String> fileNames = multiRequest.getFileNames();
+            while(fileNames.hasNext()) {
+                //取得上传文件
+                file = multiRequest.getFile(fileNames.next());
+                if (!file.isEmpty()) {
+                    // 文件保存路径
+
+                    String realPath =directory.replace("/","")+"/"+storeAs+datePath()+"/"+ System.currentTimeMillis();
+                    OSSClientUtil ossUtil = new OSSClientUtil();
+                    String newName = file.getOriginalFilename();
+
+                    try {
+                        ossUtil.uploadFile2OSS(file.getInputStream(),realPath,newName);
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                        logger.error("Exception e:"+e);
+                    }
+                    filepath = Global.getAliDownloadUrl() + "/" + realPath + newName;
+
+                    data.setName(file.getOriginalFilename());
+                    data.setSrc(filepath);
+                }
+            }
+
+            map.put("code", "1");
+            map.put("url", data.getSrc());
+        }else{
+
+            try {
+                //MultipartFile转File
+                File srcFile = transformMultipartFile(file);
+                SftpClientUtil fileUploadUtil = new SftpClientUtil();
+                String uploadPath = "/" + storeAs + datePath();
+                String uploadFile = fileUploadUtil.uploadFile(uploadPath, srcFile, srcFile.getName());
+                if(srcFile.exists()){
+                    srcFile.delete();
+                }
+                map.put("msg","上传成功");
+                map.put("code","1");
+                map.put("url","/a/workfullmanage/workFullManage/downLoadAttach?file=" + uploadFile);
+            } catch (Exception e) {
+                logger.error("Exception e:"+e);
+                e.printStackTrace();
+                map.put("msg","上传失败");
+                map.put("code","0");
+            }
+        }
+        return map;
+    }
 
     /*@RequestMapping("upload")
     @ResponseBody*/

+ 27 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/Form.java

@@ -0,0 +1,27 @@
+package com.jeeplus.modules.ruralprojectrecords.entity;
+
+/**
+ * 第三方表单
+ * @author: 徐滕
+ * @create: 2022-03-16 13:46
+ **/
+public class Form {
+    private String key;     //(是)
+    private String value;   //(是)
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+}

+ 27 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/Operator.java

@@ -0,0 +1,27 @@
+package com.jeeplus.modules.ruralprojectrecords.entity;
+
+/**
+ * 第三方节点操作人
+ * @author: 徐滕
+ * @create: 2022-03-16 13:59
+ **/
+public class Operator {
+    private String mobile;  //联系方式,联系方式允许使用大陆、台湾和香港的手机号,台湾和香港的手机号格式为:区号+空格+手机号,例:8529xxxxxxx(obile和number至少填写一个)
+    private String number;  //员工编号(obile和number至少填写一个)
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public String getNumber() {
+        return number;
+    }
+
+    public void setNumber(String number) {
+        this.number = number;
+    }
+}

+ 47 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/OperatorData.java

@@ -0,0 +1,47 @@
+package com.jeeplus.modules.ruralprojectrecords.entity;
+
+import java.util.Date;
+
+/**
+ * 第三方节点操作数据
+ * @author: 徐滕
+ * @create: 2022-03-16 13:54
+ **/
+public class OperatorData {
+    private String operateType; //(是)
+    private String info;        //(否)
+    private Date operatorTime;  //(节点完成时必传)
+    private Operator operators; //(是)
+
+    public String getOperateType() {
+        return operateType;
+    }
+
+    public void setOperateType(String operateType) {
+        this.operateType = operateType;
+    }
+
+    public String getInfo() {
+        return info;
+    }
+
+    public void setInfo(String info) {
+        this.info = info;
+    }
+
+    public Date getOperatorTime() {
+        return operatorTime;
+    }
+
+    public void setOperatorTime(Date operatorTime) {
+        this.operatorTime = operatorTime;
+    }
+
+    public Operator getOperators() {
+        return operators;
+    }
+
+    public void setOperators(Operator operators) {
+        this.operators = operators;
+    }
+}

+ 146 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/PhysicsSeal.java

@@ -0,0 +1,146 @@
+package com.jeeplus.modules.ruralprojectrecords.entity;
+
+import java.util.List;
+
+/**
+ * 物理印章信息类
+ * @author: 徐滕
+ * @create: 2022-03-16 13:43
+ **/
+public class PhysicsSeal {
+    private String tenantName;              //发起公司,用印流程id为空时必传(否)
+    private Long categoryId;              //用印流程id(否)
+    private String categoryName;            //用印流程名称,用印流程id为空时必传(否)
+    private String subject;                 //主题(是)
+    private String serialNo;                //序列号(否)
+    private String description;             //描述(否)
+    private String applyerName;             //申请人姓名(否)
+    private String applyerContact;          //申请人联系方式,联系方式允许使用:手机号、电子邮箱(联系方式与员工编号必须二选)
+    private String applyerNumber;           //申请人员工编号(联系方式与员工编号必须二选一)
+    private String callbackUrl;             //回调地址(否)
+    private Integer count;                   //申请人申请用印次数,若auths不传,则该字段必传(否)
+    private List<SealAuthBean> auths;       //用印授权人;参照SealAuthBean(否)
+    private List<ThirdFlowNode> flowNodes;  //第三方审批节点;参照ThirdFlowNode(是)
+    private List<Long> documents;           //文档ID的集合(否)
+    private List<Form> forms;               //第三方传入的表单集合,参照Form(否)
+
+    public String getTenantName() {
+        return tenantName;
+    }
+
+    public void setTenantName(String tenantName) {
+        this.tenantName = tenantName;
+    }
+
+    public Long getCategoryId() {
+        return categoryId;
+    }
+
+    public void setCategoryId(Long categoryId) {
+        this.categoryId = categoryId;
+    }
+
+    public String getCategoryName() {
+        return categoryName;
+    }
+
+    public void setCategoryName(String categoryName) {
+        this.categoryName = categoryName;
+    }
+
+    public String getSubject() {
+        return subject;
+    }
+
+    public void setSubject(String subject) {
+        this.subject = subject;
+    }
+
+    public String getSerialNo() {
+        return serialNo;
+    }
+
+    public void setSerialNo(String serialNo) {
+        this.serialNo = serialNo;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getApplyerName() {
+        return applyerName;
+    }
+
+    public void setApplyerName(String applyerName) {
+        this.applyerName = applyerName;
+    }
+
+    public String getApplyerContact() {
+        return applyerContact;
+    }
+
+    public void setApplyerContact(String applyerContact) {
+        this.applyerContact = applyerContact;
+    }
+
+    public String getApplyerNumber() {
+        return applyerNumber;
+    }
+
+    public void setApplyerNumber(String applyerNumber) {
+        this.applyerNumber = applyerNumber;
+    }
+
+    public String getCallbackUrl() {
+        return callbackUrl;
+    }
+
+    public void setCallbackUrl(String callbackUrl) {
+        this.callbackUrl = callbackUrl;
+    }
+
+    public Integer getCount() {
+        return count;
+    }
+
+    public void setCount(Integer count) {
+        this.count = count;
+    }
+
+    public List<SealAuthBean> getAuths() {
+        return auths;
+    }
+
+    public void setAuths(List<SealAuthBean> auths) {
+        this.auths = auths;
+    }
+
+    public List<ThirdFlowNode> getFlowNodes() {
+        return flowNodes;
+    }
+
+    public void setFlowNodes(List<ThirdFlowNode> flowNodes) {
+        this.flowNodes = flowNodes;
+    }
+
+    public List<Long> getDocuments() {
+        return documents;
+    }
+
+    public void setDocuments(List<Long> documents) {
+        this.documents = documents;
+    }
+
+    public List<Form> getForms() {
+        return forms;
+    }
+
+    public void setForms(List<Form> forms) {
+        this.forms = forms;
+    }
+}

+ 45 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/SealAuthBean.java

@@ -0,0 +1,45 @@
+package com.jeeplus.modules.ruralprojectrecords.entity;
+
+/**
+ * 用印授权
+ * @author: 徐滕
+ * @create: 2022-03-16 13:46
+ **/
+public class SealAuthBean {
+    private String deviceNo;    //deviceNo与sealName至少填写一个
+    private String sealName;    //deviceNo与sealName至少填写一个
+    private String ownerName;   //sealName不为空时必填
+    private Integer count;      //是
+
+    public String getDeviceNo() {
+        return deviceNo;
+    }
+
+    public void setDeviceNo(String deviceNo) {
+        this.deviceNo = deviceNo;
+    }
+
+    public String getSealName() {
+        return sealName;
+    }
+
+    public void setSealName(String sealName) {
+        this.sealName = sealName;
+    }
+
+    public String getOwnerName() {
+        return ownerName;
+    }
+
+    public void setOwnerName(String ownerName) {
+        this.ownerName = ownerName;
+    }
+
+    public Integer getCount() {
+        return count;
+    }
+
+    public void setCount(Integer count) {
+        this.count = count;
+    }
+}

+ 65 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/ThirdFlowNode.java

@@ -0,0 +1,65 @@
+package com.jeeplus.modules.ruralprojectrecords.entity;
+
+import java.util.Date;
+
+/**
+ * 第三方审批节点,必须按照[完成->未完成]的顺序排序
+ * @author: 徐滕
+ * @create: 2022-03-16 13:46
+ **/
+public class ThirdFlowNode {
+    private String name;                    //节点名称(是)
+    private String category;                //固定为SEAL_AUDIT(是)
+    private Boolean complete;               //节点是否完成,不传则默认完成(否)
+    private Date createTime;                //开始时间(节点完成时必传)
+    private Date completeTime;              //完成时间(节点完成时必传)
+    private OperatorData operatorData;      //操作数据,见OperatorData(是)
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getCategory() {
+        return category;
+    }
+
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
+    public Boolean getComplete() {
+        return complete;
+    }
+
+    public void setComplete(Boolean complete) {
+        this.complete = complete;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getCompleteTime() {
+        return completeTime;
+    }
+
+    public void setCompleteTime(Date completeTime) {
+        this.completeTime = completeTime;
+    }
+
+    public OperatorData getOperatorData() {
+        return operatorData;
+    }
+
+    public void setOperatorData(OperatorData operatorData) {
+        this.operatorData = operatorData;
+    }
+}

+ 36 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectSignatureOldMessageDisposeController.java

@@ -1,5 +1,6 @@
 package com.jeeplus.modules.ruralprojectrecords.web;
 
+import com.alibaba.fastjson.JSON;
 import com.google.common.collect.Lists;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.oss.OSSClientUtil;
@@ -7,7 +8,9 @@ import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.common.web.BaseController;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
+import com.jeeplus.modules.ruralprojectrecords.entity.PhysicsSeal;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.entity.SealAuthBean;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectSignatureOldMessageDisposeService;
 import com.jeeplus.modules.statement.service.StatementCompanyComprehensiveService;
@@ -209,4 +212,37 @@ public class RuralProjectSignatureOldMessageDisposeController extends BaseContro
         return map;
     }
 
+
+
+    /**
+     * 下载附件
+     */
+    @RequestMapping(value = "/getPhysicsSeal", method=RequestMethod.GET)
+    public HashMap getPhysicsSeal() {
+        HashMap hashMap = new HashMap();
+        //根据contractId将文件下载下来 并上传到阿里云服务种
+        //添加请求头
+        Map<String,String> requestHeaderMap = new HashMap<>();
+        requestHeaderMap.put("x-qys-accesstoken", apptoken);
+        requestHeaderMap.put("x-qys-signature", signature);
+        requestHeaderMap.put("x-qys-timestamp", "0");
+        PhysicsSeal physicsSeal = new PhysicsSeal();
+        physicsSeal.setTenantName("江苏兴光项目管理有限公司");
+        physicsSeal.setCategoryId(2938635332599652891L);
+        physicsSeal.setSubject("测试");
+        //员工联系方式
+        physicsSeal.setApplyerContact("18351935168");
+        List<SealAuthBean> auths = Lists.newArrayList();
+        SealAuthBean seal = new SealAuthBean();
+        seal.setSealName("江苏兴光项目管理有限公司公章");
+        seal.setOwnerName("江苏兴光项目管理有限公司");
+        seal.setCount(2);
+        auths.add(seal);
+        physicsSeal.setAuths(auths);
+        net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(physicsSeal);
+        String resultStr = SignaturePostUtil.sendPostApplicationJson(HTTPTOP + "/seal/apply/mulitipleByCategory", json.toString());
+        hashMap = JSON.parseObject(resultStr, HashMap.class);
+        return hashMap;
+    }
+
 }

+ 62 - 0
src/main/java/com/jeeplus/modules/tools/utils/SignaturePostUtil.java

@@ -455,6 +455,68 @@ public class SignaturePostUtil {
         System.out.println(result);
         return result;
     }
+    /**
+     * imagePng的post请求
+     * @return
+     */
+    public static String sendPostImagePng(String url, String jsonString) {
+        CloseableHttpClient httpClient = null;
+        CloseableHttpResponse httpResponse = null;
+        String result = "";
+        // 创建httpClient实例
+        httpClient = HttpClients.createDefault();
+        // 创建httpPost远程连接实例
+        HttpPost httpPost = new HttpPost(url);
+        // 配置请求参数实例
+        RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000)// 设置连接主机服务超时时间
+                .setConnectionRequestTimeout(35000)// 设置连接请求超时时间
+                .setSocketTimeout(60000)// 设置读取数据连接超时时间
+                .build();
+        // 为httpPost实例设置配置
+        httpPost.setConfig(requestConfig);
+        // 设置请求头鉴权
+        httpPost.setHeader("x-qys-accesstoken", apptoken);
+        httpPost.setHeader("x-qys-signature", signature);
+        httpPost.setHeader("x-qys-timestamp", "0");
+        // 包含内容格式设置
+        httpPost.addHeader("Content-Type", "image/png");
+        // 封装post请求参数
+        if (null != jsonString) {
+            // 为httpPost设置封装好的请求参数
+            System.out.println("添加到实体------");
+            httpPost.setEntity(new StringEntity(jsonString, "UTF-8"));
+        }
+        try {
+            // httpClient对象执行post请求,并返回响应参数对象
+            httpResponse = httpClient.execute(httpPost);
+            // 从响应对象中获取响应内容
+            HttpEntity entity = httpResponse.getEntity();
+            result = EntityUtils.toString(entity);
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            // 关闭资源
+            if (null != httpResponse) {
+                try {
+                    httpResponse.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (null != httpClient) {
+                try {
+                    httpClient.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        result = decodeUnicode(result);
+        System.out.println(result);
+        return result;
+    }
 
     private static String decodeUnicode(String theString) {
         char aChar;

+ 46 - 28
src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffBasicInfo.java

@@ -25,7 +25,7 @@ import javax.validation.constraints.Size;
  * @version 2018-07-26
  */
 public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
-	
+
 	private static final long serialVersionUID = 1L;
 	private String userId;
 	private String sqlStr;
@@ -108,6 +108,8 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
     private String trialPeriod;   //试用期(月)
 	private String individualResume;   //个人简介
 	private String highestEducation;	//最高学历
+	private String handSignature;	//手签章路径
+	private String handSignatureUrl;	//手签章路径(展示)
 
 	//劳动关系临时属性
 	private String relationshipStatus;
@@ -241,7 +243,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setOffice(Office office) {
 		this.office = office;
 	}
-	
+
 	public Office getCompany() {
 		return company;
 	}
@@ -258,7 +260,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setNo(String no) {
 		this.no = no;
 	}
-	
+
 	@ExcelField(title="姓    名", align=2, sort=3)
 	public String getName() {
 		return name;
@@ -267,7 +269,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setName(String name) {
 		this.name = name;
 	}
-	
+
 	@ExcelField(title="性    别", dictType="sex", align=2, sort=4)
 	public String getGender() {
 		return gender;
@@ -276,7 +278,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setGender(String gender) {
 		this.gender = gender;
 	}
-	
+
 	@ExcelField(title="民    族", dictType="nation_type", align=2, sort=5)
 	public String getNation() {
 		return nation;
@@ -285,7 +287,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setNation(String nation) {
 		this.nation = nation;
 	}
-	
+
 	@ExcelField(title="身份证号码", align=2, sort=6)
 	public String getIdCard() {
 		return idCard;
@@ -310,7 +312,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setAge(Integer age) {
 		this.age = age;
 	}
-	
+
 	@JsonFormat(pattern = "yyyy-MM-dd")
 	@ExcelField(title="出生日期", align=2, sort=8)
 	public Date getBirthday() {
@@ -320,7 +322,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setBirthday(Date birthday) {
 		this.birthday = birthday;
 	}
-	
+
 	@ExcelField(title="公历/农历", dictType="calendar_type", align=2, sort=9)
 	public String getCalendar() {
 		return calendar;
@@ -329,7 +331,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setCalendar(String calendar) {
 		this.calendar = calendar;
 	}
-	
+
 	@ExcelField(title="电子邮箱", align=2, sort=10)
 	public String getEmail() {
 		return email;
@@ -338,7 +340,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setEmail(String email) {
 		this.email = email;
 	}
-	
+
 	@ExcelField(title="移动电话", align=2, sort=11)
 	public String getMobile() {
 		return mobile;
@@ -365,7 +367,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setMarriage(String marriage) {
 		this.marriage = marriage;
 	}
-	
+
 	@ExcelField(title="政治面貌", align=2, sort=13, valiName = "politics_type")
 	public String getPolitics() {
 		return politics;
@@ -374,7 +376,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setPolitics(String politics) {
 		this.politics = politics;
 	}
-	
+
 	@ExcelField(title="是否退伍军人", dictType="yes_no", align=2, sort=14)
 	public String getExSoldier() {
 		return exSoldier;
@@ -383,7 +385,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setExSoldier(String exSoldier) {
 		this.exSoldier = exSoldier;
 	}
-	
+
 	@ExcelField(title="常住地址", align=2, sort=15)
 	public String getAddress() {
 		return address;
@@ -392,7 +394,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setAddress(String address) {
 		this.address = address;
 	}
-	
+
 	@ExcelField(title="籍    贯", fieldType=Area.class, value="", align=2, sort=16)
 	public Area getNativePlace() {
 		return nativePlace;
@@ -401,7 +403,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setNativePlace(Area nativePlace) {
 		this.nativePlace = nativePlace;
 	}
-	
+
 	@ExcelField(title="户口所在地", align=2, sort=17)
 	public String getHousehold() {
 		return household;
@@ -410,7 +412,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setHousehold(String household) {
 		this.household = household;
 	}
-	
+
 	@ExcelField(title="职务", align=2, sort=18,valiName = "staff_duty")
 	public String getDuty() {
 		return duty;
@@ -419,7 +421,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setDuty(String duty) {
 		this.duty = duty;
 	}
-	
+
 	@ExcelField(title="职    级", align=2, value="jobGrade.name", sort=19, valiName = "WorkJobGrade")
 	public WorkJobGrade getJobGrade() {
 		return jobGrade;
@@ -428,7 +430,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setJobGrade(WorkJobGrade jobGrade) {
 		this.jobGrade = jobGrade;
 	}
-	
+
 	@ExcelField(title="员工状态", align=2, sort=20, valiName = "staff_status")
 	public String getStatus() {
 		return status;
@@ -437,7 +439,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setStatus(String status) {
 		this.status = status;
 	}
-	
+
 	@JsonFormat(pattern = "yyyy-MM-dd")
 	@ExcelField(title="入职日期", align=2, sort=21)
 	public Date getEntryDate() {
@@ -447,7 +449,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setEntryDate(Date entryDate) {
 		this.entryDate = entryDate;
 	}
-	
+
 	@JsonFormat(pattern = "yyyy-MM-dd")
 	@ExcelField(title="参加工作日期", align=2, sort=22)
 	public Date getWorkDate() {
@@ -457,7 +459,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setWorkDate(Date workDate) {
 		this.workDate = workDate;
 	}
-	
+
 	@ExcelField(title="开户银行", align=2, sort=23, valiName = "bank_type")
 	public String getBankName() {
 		return bankName;
@@ -466,7 +468,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setBankName(String bankName) {
 		this.bankName = bankName;
 	}
-	
+
 	@ExcelField(title="银行卡号", align=2, sort=24)
 	public String getBankCard() {
 		return bankCard;
@@ -475,7 +477,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setBankCard(String bankCard) {
 		this.bankCard = bankCard;
 	}
-	
+
 	@JsonFormat(pattern = "yyyy-MM-dd")
 	@ExcelField(title="从事本行业日期", align=2, sort=25)
 	public Date getIndustryDate() {
@@ -485,7 +487,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setIndustryDate(Date industryDate) {
 		this.industryDate = industryDate;
 	}
-	
+
 	@ExcelField(title="是否TS人员", dictType="yes_no", align=2, sort=26)
 	public String getTs() {
 		return ts;
@@ -494,7 +496,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setTs(String ts) {
 		this.ts = ts;
 	}
-	
+
 	public String getPicture() {
 		return picture;
 	}
@@ -502,7 +504,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setPicture(String picture) {
 		this.picture = picture;
 	}
-	
+
 	public Date getBeginEntryDate() {
 		return beginEntryDate;
 	}
@@ -510,7 +512,7 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setBeginEntryDate(Date beginEntryDate) {
 		this.beginEntryDate = beginEntryDate;
 	}
-	
+
 	public Date getEndEntryDate() {
 		return endEntryDate;
 	}
@@ -817,4 +819,20 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
 	public void setHighestEducation(String highestEducation) {
 		this.highestEducation = highestEducation;
 	}
-}
+
+	public String getHandSignature() {
+		return handSignature;
+	}
+
+	public void setHandSignature(String handSignature) {
+		this.handSignature = handSignature;
+	}
+
+	public String getHandSignatureUrl() {
+		return handSignatureUrl;
+	}
+
+	public void setHandSignatureUrl(String handSignatureUrl) {
+		this.handSignatureUrl = handSignatureUrl;
+	}
+}

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

@@ -61,6 +61,11 @@ import javax.servlet.http.HttpServletRequest;
 @Transactional(readOnly = true)
 public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao, WorkStaffBasicInfo> {
 
+    /**
+     * 阿里云文件服务器前缀
+     */
+    private final static String aliyunUrl = Global.getConfig("aliyunUrl");
+
     @Autowired
     private  RoleService roleService;
     @Autowired
@@ -136,7 +141,11 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
 
 
     public WorkStaffBasicInfo get(String id) {
-		return super.get(id);
+        WorkStaffBasicInfo workStaffBasicInfo = super.get(id);
+        if(StringUtils.isNotBlank(workStaffBasicInfo.getHandSignature())){
+            workStaffBasicInfo.setHandSignatureUrl(new OSSClientUtil().getFileTemporaryLookUrl(aliyunUrl + workStaffBasicInfo.getHandSignature()));
+        }
+		return workStaffBasicInfo;
 	}
 
     /**
@@ -234,6 +243,11 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         this.saveAchive(workStaffBasicInfo,request);
         workStaffBasicInfo.setAchiveId(workStaffBasicInfo.getId());
         workStaffBasicInfo.setId(baseId);
+        if(StringUtils.isNotBlank(workStaffBasicInfo.getHandSignature())){
+            if(workStaffBasicInfo.getHandSignature().indexOf(aliyunUrl)!=-1){
+                workStaffBasicInfo.setHandSignature(workStaffBasicInfo.getHandSignature().replace(aliyunUrl,""));
+            }
+        }
         //调用保存方法
 		super.save(workStaffBasicInfo);
 	    //同步修改sys_user表中的name

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

@@ -51,10 +51,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
+import java.io.*;
 import java.net.URLDecoder;
 import java.text.ParseException;
 import java.util.ArrayList;
@@ -163,6 +160,26 @@ public class WorkStaffBasicInfoController extends BaseController {
 	}
 
 	/**
+	 * 手签章上传
+	 * @param file
+	 * @return
+	 * @throws Exception
+	 */
+	@RequestMapping(value = "upLoadHandSignatureImg")
+	@ResponseBody
+	public Map<String,Object> upLoadHandSignatureImg(MultipartFile file) throws Exception{
+		Map map = new HashMap();
+
+		/*if(result == 1){
+
+		}else{
+			map.put("msg","修改失败");
+		}*/
+		map.put("msg","修改成功");
+		return map;
+	}
+
+	/**
 	 * 查看,增加,编辑员工信息表单页面
 	 */
 	@RequiresPermissions(value={"workstaff:workStaffAchiveInfo:add","workstaff:workStaffAchiveInfo:edit"},logical=Logical.OR)

+ 8 - 4
src/main/resources/mappings/modules/workstaff/WorkStaffBasicInfoDao.xml

@@ -58,7 +58,8 @@
 		a.try_out_job AS "tryOutJob",
 		a.trial_period AS "trialPeriod",
 		a.individual_resume AS "individualResume",
-		a.highest_education As "highestEducation"
+		a.highest_education As "highestEducation",
+		a.hand_signature As "handSignature"
 <!--		ur.role_id AS "roleId",-->
 <!--		r.name AS "roleName"-->
 	</sql>
@@ -355,7 +356,8 @@
 			try_out_job,
 			trial_period,
 			individual_resume,
-			highest_education
+			highest_education,
+			hand_signature
 		) VALUES (
 			#{id},
 			#{createBy.id},
@@ -405,7 +407,8 @@
 			#{tryOutJob},
 			#{trialPeriod},
 			#{individualResume},
-			#{highestEducation}
+			#{highestEducation},
+			#{handSignature}
 		)
 	</insert>
 
@@ -455,7 +458,8 @@
 			try_out_job = #{tryOutJob},
 			trial_period = #{trialPeriod},
 			individual_resume = #{individualResume},
-			highest_education = #{highestEducation}
+			highest_education = #{highestEducation},
+			hand_signature = #{handSignature}
 		WHERE id = #{id}
 	</update>
 

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

@@ -17,7 +17,7 @@
 			  $("#inputForm").submit();
 			  return true;
 		  }
-	
+
 		  return false;
 		}
 
@@ -37,7 +37,7 @@
 					}
 				}
 			});
-			
+
             var layDateArr = $(".layer-date");
             for(var i=0;i<layDateArr.length;i++){
                 var id = '#'+$(layDateArr[i]).attr("id");
@@ -1888,4 +1888,4 @@
 
     </script>
 </body>
-</html>
+</html>

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

@@ -1838,4 +1838,4 @@
 
 </script>
 </body>
-</html>
+</html>

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

@@ -6,6 +6,8 @@
     <meta name="decorator" content="default"/>
     <script type="text/javascript" src="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.js"></script>
     <link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
+    <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
     <style>
         label.error{
             left:0;
@@ -46,6 +48,56 @@
             return false;
         }
         $(document).ready(function() {
+
+
+            layui.use(['upload', 'element', 'layer'], function() {
+                var $ = layui.jquery
+                    , upload = layui.upload
+                    , element = layui.element
+                    , layer = layui.layer;
+
+                //常规使用 - 普通图片上传
+                var uploadInst = upload.render({
+                    elem: '#test1'
+                    ,url: '${ctx}/bos/upLoadHandSignatureImg' //此处用的是第三方的 http 请求演示,实际使用时改成您自己的上传接口即可。
+                    ,before: function(obj){
+                        //预读本地文件示例,不支持ie8
+                        obj.preview(function(index, file, result){
+                            $('#handSignatureImg').attr('src', result); //图片链接(base64)
+                        });
+                        layer.msg('上传中', {icon: 16, time: 0});
+                    }
+                    ,done: function(res){
+                        //如果上传失败
+                        if(res.code != 1){
+                            return layer.msg('上传失败');
+                        }
+                        //上传成功的一些操作
+                        //console.log(res.url)
+                        $("#handSignature").val(res.url);
+                        layer.msg('上传完毕', {icon: 1});
+                        //……
+                        $('#handSignatureText').html(''); //置空上传失败的状态
+                    }
+                    ,error: function(){
+                        //演示失败状态,并实现重传
+                        var handSignatureText = $('#handSignatureText');
+                        handSignatureText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
+                        handSignatureText.find('.demo-reload').on('click', function(){
+                            uploadInst.upload();
+                        });
+                    }
+                    //进度条
+                    /*,progress: function(n, elem, e){
+                        if(n == 100){
+                            layer.msg('上传完毕', {icon: 1});
+                        }
+                    }*/
+                });
+            })
+
+
+
             laydate.render({
                 elem: '#tryEndTime', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                 event: 'focus', //响应事件。如果没有传入event,则按照默认的click
@@ -369,6 +421,7 @@
             <form:hidden path="id"/>
             <form:hidden path="notifyFlag"/>
             <form:hidden path="userId"/>
+            <form:hidden path="handSignature"/>
             <input id="updateFlag" value="${updateFlag}" style="display:none;">
             <div class="form-group layui-row first">
                 <div class="form-group-label"><h2>基本信息</h2></div>
@@ -691,6 +744,26 @@
                     </div>
                 </div>--%>
             </div>
+
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>手签章</h2></div>
+                <div class="layui-item nav-btns">
+                    <button type="button" class="layui-btn" id="test1">上传手签章</button>
+                    <div class="layui-upload-list">
+                        <c:choose>
+                            <c:when test="${not empty workStaffBasicInfo.handSignatureUrl}">
+                                <img class="layui-upload-img" width="200px" height="150px" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workStaffBasicInfo.handSignatureUrl}','90%','90%')" id="handSignatureImg" src="${workStaffBasicInfo.handSignatureUrl}">
+                            </c:when>
+                            <c:otherwise>
+                                <img class="layui-upload-img" width="200px" height="150px" id="handSignatureImg">
+                            </c:otherwise>
+                        </c:choose>
+                        <p id="handSignatureText"></p>
+                    </div>
+                </div>
+            </div>
+
+
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2>教育经历</h2></div>
                 <div class="layui-item nav-btns">

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

@@ -345,6 +345,23 @@
                         </div>
                     </div>--%>
                 </div>
+
+                <div class="form-group layui-row">
+                    <div class="form-group-label"><h2>手签章</h2></div>
+                    <div class="layui-item nav-btns">
+                        <div class="layui-upload-list">
+                            <c:choose>
+                                <c:when test="${not empty workStaffBasicInfo.handSignatureUrl}">
+                                    <img class="layui-upload-img" width="200px" height="150px" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workStaffBasicInfo.handSignatureUrl}','90%','90%')" id="handSignatureImg" src="${workStaffBasicInfo.handSignatureUrl}">
+                                </c:when>
+                                <c:otherwise>
+                                    <img class="layui-upload-img" width="200px" height="150px" id="handSignatureImg">
+                                </c:otherwise>
+                            </c:choose>
+                            <p id="handSignatureText"></p>
+                        </div>
+                    </div>
+                </div>
                 <div class="form-group layui-row">
                     <div class="form-group-label"><h2>教育经历</h2></div>
                     <div class="layui-item layui-col-xs12 form-table-container">
@@ -863,4 +880,4 @@
         </div>
     </div>
 </body>
-</html>
+</html>