Browse Source

增加企业联系电话,认证时间

yanliming 1 year ago
parent
commit
22988b6a6a

+ 8 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/EnterpriseInfo.java

@@ -53,4 +53,12 @@ public class EnterpriseInfo {
 
 	@ApiModelProperty(value = "联系人ID")
 	private String contactsPersonId;
+
+	@ApiModelProperty(value = "认证时间")
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	private Date checkTime;
+
+	@ApiModelProperty(value = "联系电话")
+	private String contactsPhone;
 }

+ 14 - 1
common/src/main/resources/mapper/base/EnterpriseInfo.xml

@@ -15,6 +15,9 @@
 			<result property="delFlag" column="del_flag" />
 			<result property="address" column="address_" />
 			<result property="contactsPersonId" column="contacts_person_id" />
+			<result property="checkTime" column="check_time" />
+			<result property="contactsPhone" column="contacts_phone" />
+
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.EnterpriseInfo">
 	<!--
@@ -24,7 +27,9 @@
 	-->
 	<![CDATA[
 		insert into base_enterprise_info
-	    (id_,name_,license_image,status_,create_by,create_time,update_by,update_time,del_flag,address_,contacts_person_id)
+	    (id_,name_,license_image,status_,create_by,create_time,
+	    update_by,update_time,del_flag,address_,contacts_person_id,
+	    check_time,contacts_phone)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -38,6 +43,8 @@
 ,#{delFlag,jdbcType= NUMERIC }
 ,#{address,jdbcType=VARCHAR}
 ,#{contactsPersonId,jdbcType=VARCHAR}
+,#{checkTime,jdbcType= TIMESTAMP }
+,#{contactsPhone,jdbcType=VARCHAR}
 		)
 	]]>
 	</insert>
@@ -77,6 +84,12 @@
 			<if test="contactsPersonId!=null">
 				contacts_person_id=#{contactsPersonId,jdbcType=VARCHAR},
 			</if>
+			<if test="checkTime!=null">
+				check_time=#{checkTime,jdbcType= TIMESTAMP },
+			</if>
+			<if test="contactsPhone!=null">
+				contacts_phone=#{contactsPhone,jdbcType=VARCHAR},
+			</if>
 		</set>
 	where id_=#{id}
 	</update>

+ 22 - 9
web/src/main/java/com/jpsoft/employment/modules/base/controller/EnterpriseInfoController.java

@@ -236,6 +236,8 @@ public class EnterpriseInfoController {
 
             List<Map> mapList = new ArrayList<>();
 
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
             for (EnterpriseInfo enterpriseInfo : page) {
                 Map map = new HashMap();
                 map.put("id", enterpriseInfo.getId());
@@ -254,6 +256,15 @@ public class EnterpriseInfoController {
                 map.put("status", enterpriseInfo.getStatus());
                 map.put("statusN", statusN);
 
+                String checkTime = "";
+                if (enterpriseInfo.getCheckTime() != null) {
+                    checkTime = sdf.format(enterpriseInfo.getCheckTime());
+                }
+
+                map.put("checkTime", checkTime);
+
+                map.put("contactsPhone", enterpriseInfo.getContactsPhone());
+
                 mapList.add(map);
             }
 
@@ -267,8 +278,7 @@ public class EnterpriseInfoController {
             }
 
             msgResult.setResult(true);
-        }
-        catch (Exception ex) {
+        } catch (Exception ex) {
             logger.error(ex.getMessage(), ex);
             msgResult.setResult(false);
         }
@@ -286,7 +296,7 @@ public class EnterpriseInfoController {
         //表头
         Row rowTitle = sheet.createRow(0);
 
-        String[] titles = new String[]{"序号", "企业名称", "企业地址", "企业联系人", "认证状态"};
+        String[] titles = new String[]{"序号", "企业名称", "企业地址", "企业联系人","联系电话", "认证状态", "认证时间"};
 
         for (int i = 0; i < titles.length; i++) {
             Cell cell = rowTitle.createCell(i);
@@ -303,7 +313,9 @@ public class EnterpriseInfoController {
             row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("name"), ""));
             row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("address"), ""));
             row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("contactsPersonId"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("contactsPhone"), ""));
             row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("statusN"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("checkTime"), ""));
         }
 
         ByteArrayOutputStream output = new ByteArrayOutputStream();
@@ -350,10 +362,12 @@ public class EnterpriseInfoController {
 
         try {
 
+            Date now = new Date();
             EnterpriseInfo enterpriseInfo = enterpriseInfoService.get(id);
             enterpriseInfo.setStatus("1");
             enterpriseInfo.setUpdateBy(subject);
-            enterpriseInfo.setUpdateTime(new Date());
+            enterpriseInfo.setUpdateTime(now);
+            enterpriseInfo.setCheckTime(now);
 
             int affectCount = enterpriseInfoService.update(enterpriseInfo);
 
@@ -406,7 +420,7 @@ public class EnterpriseInfoController {
                     }
 
                     EnterpriseInfo currItem = enterpriseInfoService.findByName(name);
-                    if(currItem!=null){
+                    if (currItem != null) {
                         sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("该企业名称已存在系统当中,不能重复添加!");
                         failCount++;
                         continue;
@@ -466,7 +480,7 @@ public class EnterpriseInfoController {
 
     @ApiOperation(value = "判断企业名称是否重复")
     @PostMapping("nameIsRepeatCheck")
-    public MessageResult<Boolean> nameIsRepeatCheck(String id,String name) {
+    public MessageResult<Boolean> nameIsRepeatCheck(String id, String name) {
         MessageResult<Boolean> msgResult = new MessageResult<>();
 
         try {
@@ -476,9 +490,8 @@ public class EnterpriseInfoController {
 
             if (enterpriseInfo == null) {
                 flag = true;
-            }
-            else{
-                if(id.equals(enterpriseInfo.getId())){
+            } else {
+                if (id.equals(enterpriseInfo.getId())) {
                     flag = true;
                 }
             }