浏览代码

修改企业认证接口

LiFei 6 年之前
父节点
当前提交
ab1a74781c

+ 2 - 2
happy-boot-module-hppay/src/main/java/org/jeecg/modules/api/dpposition/entity/PositionAPI.java

@@ -185,8 +185,8 @@ public class PositionAPI {
     @ApiModelProperty(value = "创建时间,也就是发布时间")
     private java.util.Date createTime;
     /**截至时间(岗位招聘结束时间,不填即为长期招聘)*/
-    @Excel(name = "截至时间(岗位招聘结束时间,不填即为长期招聘)", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "截至时间(岗位招聘结束时间,不填即为长期招聘)", width = 20, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "截至时间(岗位招聘结束时间,不填即为长期招聘)")
     private java.util.Date endDate;

+ 2 - 2
happy-boot-module-hppay/src/main/java/org/jeecg/modules/company/entity/CompanyAuthentication.java

@@ -50,8 +50,8 @@ public class CompanyAuthentication {
     @ApiModelProperty(value = "企业全称")
 	private java.lang.String enterpriseName;
 	/**过期时间(长期:用2100-01-01)*/
-	@Excel(name = "过期时间(长期:用2100-01-01)", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+	@Excel(name = "过期时间(长期:用2100-01-01)", width = 20, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "过期时间(长期:用2100-01-01)")
 	private java.util.Date expiryDate;

+ 3 - 1
happy-boot-module-hppay/src/main/java/org/jeecg/modules/company/service/ICompanyAuthenticationService.java

@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.text.ParseException;
 import java.util.Map;
 
 /**
@@ -18,7 +20,7 @@ public interface ICompanyAuthenticationService extends IService<CompanyAuthentic
 
     Page<CompanyAuthentication> queryPageList1(Page<CompanyAuthentication> pageList, CompanyAuthentication companyAuthentication);
 
-    Map<String,Object> anterpriseAuth(HttpServletRequest request, HttpServletResponse response);
+    Map<String,Object> anterpriseAuth(HttpServletRequest request, HttpServletResponse response) throws ParseException, IOException;
 
     Map<String,Object> getIsAnterpriseAuth(Map<String,String> requestMap, HttpServletRequest request, HttpServletResponse response);
 

+ 33 - 39
happy-boot-module-hppay/src/main/java/org/jeecg/modules/company/service/impl/CompanyAuthenticationServiceImpl.java

@@ -63,7 +63,7 @@ public class CompanyAuthenticationServiceImpl extends ServiceImpl<CompanyAuthent
      */
     @Override
     @Transactional
-    public Map<String, Object> anterpriseAuth(HttpServletRequest request, HttpServletResponse response) {
+    public Map<String, Object> anterpriseAuth(HttpServletRequest request, HttpServletResponse response) throws ParseException, IOException {
         Map<String, Object> returnMap = new HashMap<String, Object>();
         String userId = request.getParameter("user_id");
         String userToken = request.getParameter("user_token");
@@ -74,42 +74,35 @@ public class CompanyAuthenticationServiceImpl extends ServiceImpl<CompanyAuthent
             if (StringUtils.isBlank(expiryDate)) {
                 expiryDate = "2100-01-01 00:00:00";
             }
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
             String isHumanResource = request.getParameter("isHumanResource"); //是否人力资源公司
             CompanyAuthentication companyAuthentication = new CompanyAuthentication();
             companyAuthentication.setUserId(Integer.parseInt(userId));
             companyAuthentication.setEnterpriseName(enterpriseName);
             companyAuthentication.setIsHumanResource(Integer.parseInt(isHumanResource));
             companyAuthentication.setAuthenticationStatus(1);
-            try {
-                companyAuthentication.setExpiryDate(sdf.parse(expiryDate));
-
-                if (request instanceof MultipartHttpServletRequest) {
-                    //营业执照上传调用
-                    Result<JSONObject> result = webupload(request, "licenseFront", companyAuthentication, "/hpuser/resume");
-                    if (result.isSuccess()) {
-                        companyAuthentication.setLicenseFront(result.getMessage());
-                    } else {
-                        System.out.println("wpload========" + result.getMessage());
-                    }
-
-                    Result<JSONObject> result1 = webupload(request, "otherLicense", companyAuthentication, "/hpuser/resume");
-                    if (result.isSuccess()) {
-                        companyAuthentication.setOtherLicense(result1.getMessage());
-                    } else {
-                        System.out.println("wpload========" + result1.getMessage());
-                    }
+            companyAuthentication.setExpiryDate(sdf.parse(expiryDate));
+            if (request instanceof MultipartHttpServletRequest) {
+                //营业执照上传调用
+                Result<JSONObject> result = webupload(request, "licenseFront", companyAuthentication, "/hpuser/resume");
+                if (result.isSuccess()) {
+                    companyAuthentication.setLicenseFront(result.getMessage());
+                } else {
+                    System.out.println("wpload========" + result.getMessage());
+                }
 
+                Result<JSONObject> result1 = webupload(request, "otherLicense", companyAuthentication, "/hpuser/resume");
+                if (result.isSuccess()) {
+                    companyAuthentication.setOtherLicense(result1.getMessage());
                 } else {
-                    System.out.println("wpnonono========没有文件上传");
+                    System.out.println("wpload========" + result1.getMessage());
                 }
-                save(companyAuthentication);
-                returnMap.put("companyAuthentication", companyAuthentication);
-                returnMap.put("success", true);
-            } catch (Exception e) {
-                returnMap.put("success", false);
-                e.printStackTrace();
+
+            } else {
+                System.out.println("wpnonono========没有文件上传");
             }
+            save(companyAuthentication);
+            returnMap.put("companyAuthentication", companyAuthentication);
         } else {
             returnMap.put("success", "1004");
         }
@@ -201,30 +194,31 @@ public class CompanyAuthenticationServiceImpl extends ServiceImpl<CompanyAuthent
 
 
     /**
-     *  审批
+     * 审批
+     *
      * @param
      * @return
      */
     @Override
     public boolean updateById1(CompanyAuthentication companyAuthentication) {
-        boolean ok= false;
+        boolean ok = false;
         try {
             ok = updateById(companyAuthentication);
-            companyAuthentication=getById(companyAuthentication.getId());
-            Message message=new Message();
+            companyAuthentication = getById(companyAuthentication.getId());
+            Message message = new Message();
             message.setUserId(companyAuthentication.getUserId());
-            if(companyAuthentication.getAuthenticationStatus()==2){
+            if (companyAuthentication.getAuthenticationStatus() == 2) {
                 message.setTitle("企业认证通过审核");
                 message.setContent("您的企业信息已通过审核");
-                List<Position> list=positionMapper.findPosition(companyAuthentication.getUserId());
-                if(list.size()>0){
-                    for (int i = 0; i <list.size() ; i++) {
-                        Position position=list.get(i);
+                List<Position> list = positionMapper.findPosition(companyAuthentication.getUserId());
+                if (list.size() > 0) {
+                    for (int i = 0; i < list.size(); i++) {
+                        Position position = list.get(i);
                         position.setEnterpriseName(companyAuthentication.getEnterpriseName());
                         positionMapper.changePositionName(position);
                     }
                 }
-            }else if(companyAuthentication.getAuthenticationStatus()==3){
+            } else if (companyAuthentication.getAuthenticationStatus() == 3) {
                 message.setTitle("企业认证未通过审核");
                 message.setContent("您的企业信息未通过审核");
             }
@@ -232,7 +226,7 @@ public class CompanyAuthenticationServiceImpl extends ServiceImpl<CompanyAuthent
             message.setType(2);
             message.setIsRead(0);
             message.setDelFlag("0");
-            ok=iMessageService.save(message);
+            ok = iMessageService.save(message);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -288,7 +282,7 @@ public class CompanyAuthenticationServiceImpl extends ServiceImpl<CompanyAuthent
         //验证用户合法性
         if (TokenUtil.validateToken(userId, userToken)) {
             String messageId = requestMap.get("messageId");
-            Message message=iMessageService.getById(messageId);
+            Message message = iMessageService.getById(messageId);
             message.setIsRead(1);
             iMessageService.updateById(message);
         } else {

+ 2 - 2
happy-boot-module-hppay/src/main/java/org/jeecg/modules/hpposition/entity/Position.java

@@ -151,8 +151,8 @@ public class Position {
     @ApiModelProperty(value = "创建时间,也就是发布时间")
 	private java.util.Date createTime;
 	/**截至时间(岗位招聘结束时间,不填即为长期招聘)*/
-	@Excel(name = "截至时间(岗位招聘结束时间,不填即为长期招聘)", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+	@Excel(name = "截至时间(岗位招聘结束时间,不填即为长期招聘)", width = 20, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "截至时间(岗位招聘结束时间,不填即为长期招聘)")
 	private java.util.Date endDate;