Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	common/src/main/java/com/jpsoft/employment/modules/base/dao/PersonLoginLogDAO.java
#	common/src/main/java/com/jpsoft/employment/modules/base/service/impl/PersonLoginLogServiceImpl.java
#	common/src/main/resources/mapper/base/PersonLoginLog.xml
shuzhan 1 vuosi sitten
vanhempi
commit
9c89190e9e

+ 1 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dao/PersonLoginLogDAO.java

@@ -21,5 +21,6 @@ public interface PersonLoginLogDAO {
 	Integer dailyReportList(@Param("searchParams") Map<String, Object> searchParams);
 	List<String> totalDailyReportList(@Param("searchParams") Map<String, Object> searchParams);
 	PersonLoginLog findTopByPersonId(String personId);
+	PersonLoginLog lastLogin(String personId);
 
 }

+ 1 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/PersonLoginLogService.java

@@ -17,6 +17,7 @@ public interface PersonLoginLogService {
 	Page<Map> dailyReportPage(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
 	Integer dailyReportList(Map<String, Object> searchParams);
 	List<String> totalDailyReportList(Map<String, Object> searchParams);
+	PersonLoginLog lastLogin(String personId);
 
 	PersonLoginLog findTopByPersonId(String personId);
 }

+ 5 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/impl/PersonLoginLogServiceImpl.java

@@ -93,4 +93,9 @@ public class PersonLoginLogServiceImpl implements PersonLoginLogService {
 	public PersonLoginLog findTopByPersonId(String personId){
 		return personLoginLogDAO.findTopByPersonId(personId);
 	}
+
+	@Override
+	public PersonLoginLog lastLogin(String personId){
+		return personLoginLogDAO.lastLogin(personId);
+	}
 }

+ 7 - 1
common/src/main/resources/mapper/base/PersonLoginLog.xml

@@ -66,7 +66,8 @@
         where id_=#{id}
     </update>
     <select id="get" parameterType="string" resultMap="PersonLoginLogMap">
-		select * from base_person_login_log where id_=#{0}
+		select 
+id_,person_id,remark_,create_by,create_time,update_by,update_time,del_flag		from base_person_login_log where id_=#{0}
 	</select>
     <select id="exist" parameterType="string" resultType="int">
 		select count(*) from base_person_login_log where id_=#{0}
@@ -148,4 +149,9 @@
         order by create_time desc
         limit 1
     </select>
+    <select id="lastLogin" resultMap="PersonLoginLogMap">
+		select * from base_person_login_log
+		where del_flag=false and person_id=#{0}
+		order by create_time desc limit 1
+	</select>
 </mapper>

+ 8 - 4
web/src/main/java/com/jpsoft/employment/modules/base/controller/NewsInfoController.java

@@ -201,7 +201,7 @@ public class NewsInfoController {
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
-            String title,
+            String title,String category,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             HttpServletRequest request){
@@ -221,13 +221,17 @@ public class NewsInfoController {
             searchParams.put("title","%" + title + "%");
         }
 
+        if (StringUtils.isNotEmpty(category)) {
+            searchParams.put("category",category);
+        }
+
 
         Page<NewsInfo> page = newsInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
 
         for (NewsInfo newsInfo:page) {
-            String category = dataDictionaryService.findNameByCatalogNameAndValue("新闻类型",newsInfo.getCategory());
-            if(StringUtils.isNotEmpty(category)){
-                newsInfo.setCategoryN(category);
+            String categoryN = dataDictionaryService.findNameByCatalogNameAndValue("新闻类型",newsInfo.getCategory());
+            if(StringUtils.isNotEmpty(categoryN)){
+                newsInfo.setCategoryN(categoryN);
             }
         }
 

+ 18 - 1
web/src/main/java/com/jpsoft/employment/modules/base/controller/PersonInfoController.java

@@ -4,7 +4,9 @@ import cn.hutool.core.util.IdcardUtil;
 import com.github.pagehelper.Page;
 import com.jpsoft.employment.config.OSSConfig;
 import com.jpsoft.employment.modules.base.entity.EnterpriseInfo;
+import com.jpsoft.employment.modules.base.entity.PersonLoginLog;
 import com.jpsoft.employment.modules.base.service.EnterpriseInfoService;
+import com.jpsoft.employment.modules.base.service.PersonLoginLogService;
 import com.jpsoft.employment.modules.common.dto.MessageResult;
 import com.jpsoft.employment.modules.common.utils.DES3;
 import com.jpsoft.employment.modules.common.utils.OSSUtil;
@@ -47,6 +49,9 @@ public class PersonInfoController {
     @Autowired
     private EnterpriseInfoService enterpriseInfoService;
 
+    @Autowired
+    private PersonLoginLogService personLoginLogService;
+
     @Value("${jwt.secret}")
     private String jwtSecret;
 
@@ -258,6 +263,8 @@ public class PersonInfoController {
 
             List<Map> mapList = new ArrayList<>();
 
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
             for (PersonInfo personInfo : page) {
                 Map map = new HashMap();
                 map.put("id", personInfo.getId());
@@ -286,6 +293,15 @@ public class PersonInfoController {
                 map.put("status", personInfo.getStatus());
                 map.put("statusN", statusN);
 
+                //最近登录时间
+                String lastLoginTime = "";
+                PersonLoginLog personLoginLog = personLoginLogService.lastLogin(personInfo.getId());
+                if (personLoginLog != null) {
+                    lastLoginTime = sdf.format(personLoginLog.getCreateTime());
+                }
+
+                map.put("lastLoginTime", lastLoginTime);
+
                 mapList.add(map);
             }
 
@@ -495,7 +511,7 @@ public class PersonInfoController {
         //表头
         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);
@@ -514,6 +530,7 @@ public class PersonInfoController {
             row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("idCard"), ""));
             row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("genderN"), ""));
             row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("age"), ""));
+            row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("lastLoginTime"), ""));
             row.createCell(colIndex++).setCellValue(com.jpsoft.employment.modules.common.utils.StringUtils.strValue(map.get("statusN"), ""));
         }