Просмотр исходного кода

后台实体类构建,基本功能实现

yanliming 2 лет назад
Родитель
Сommit
e9b2743e4b

+ 6 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/JobInformationInfo.java

@@ -7,6 +7,7 @@ import java.math.BigDecimal;
 
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.springframework.data.annotation.Transient;
 import org.springframework.format.annotation.DateTimeFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 
@@ -67,4 +68,9 @@ public class JobInformationInfo {
 
 	@ApiModelProperty(value = "是否删除")
 	private Boolean delFlag;
+
+
+	@Transient
+	@ApiModelProperty(value = "真实姓名")
+	private String personName;
 }

+ 6 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/NewsInfo.java

@@ -7,6 +7,7 @@ import java.math.BigDecimal;
 
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.springframework.data.annotation.Transient;
 import org.springframework.format.annotation.DateTimeFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 
@@ -52,4 +53,9 @@ public class NewsInfo {
 
 	@ApiModelProperty(value = "是否删除")
 	private Boolean delFlag;
+
+
+	@Transient
+	@ApiModelProperty(value = "类型翻译")
+	private String categoryN;
 }

+ 1 - 0
common/src/main/resources/mapper/base/JobInformationInfo.xml

@@ -119,6 +119,7 @@
 			select * from base_job_information_info
 		]]>
 		<where>
+			del_flag=false
 			<if test="searchParams.id != null">
 				and ID_ like #{searchParams.id}
 			</if>

+ 3 - 2
common/src/main/resources/mapper/base/NewsInfo.xml

@@ -94,8 +94,9 @@
 			select * from base_news_info
 		]]>
 		<where>
-			<if test="searchParams.id != null">
-				and ID_ like #{searchParams.id}
+			del_flag=false
+			<if test="searchParams.title != null">
+				and title_ like #{searchParams.title}
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

+ 13 - 1
web/src/main/java/com/jpsoft/employment/modules/base/controller/JobInformationInfoController.java

@@ -1,6 +1,8 @@
 package com.jpsoft.employment.modules.base.controller;
 
 import com.github.pagehelper.Page;
+import com.jpsoft.employment.modules.base.entity.PersonInfo;
+import com.jpsoft.employment.modules.base.service.PersonInfoService;
 import com.jpsoft.employment.modules.common.dto.MessageResult;
 import com.jpsoft.employment.modules.common.utils.PojoUtils;
 import com.jpsoft.employment.modules.common.dto.Sort;
@@ -24,6 +26,9 @@ public class JobInformationInfoController {
 
     @Autowired
     private JobInformationInfoService jobInformationInfoService;
+
+    @Autowired
+    private PersonInfoService personInfoService;
 	
 	
 	@ApiOperation(value="创建空记录")
@@ -209,7 +214,7 @@ public class JobInformationInfoController {
         Map<String,Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("id_","asc"));
+        sortList.add(new Sort("create_time","desc"));
 
         if (StringUtils.isNotEmpty(id)) {
             searchParams.put("id","%" + id + "%");
@@ -218,6 +223,13 @@ public class JobInformationInfoController {
 
         Page<JobInformationInfo> page = jobInformationInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
 
+        for (JobInformationInfo jobInformationInfo:page) {
+            PersonInfo personInfo = personInfoService.get(jobInformationInfo.getPersonId());
+            if(personInfo!=null){
+                jobInformationInfo.setPersonName(personInfo.getRealName());
+            }
+        }
+
 
         msgResult.setResult(true);
         msgResult.setData(PojoUtils.pageWrapper(page));

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

@@ -6,6 +6,7 @@ import com.jpsoft.employment.modules.common.utils.PojoUtils;
 import com.jpsoft.employment.modules.common.dto.Sort;
 import com.jpsoft.employment.modules.base.entity.NewsInfo;
 import com.jpsoft.employment.modules.base.service.NewsInfoService;
+import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -24,6 +25,9 @@ public class NewsInfoController {
 
     @Autowired
     private NewsInfoService newsInfoService;
+
+    @Autowired
+    private DataDictionaryService dataDictionaryService;
 	
 	
 	@ApiOperation(value="创建空记录")
@@ -49,6 +53,7 @@ public class NewsInfoController {
 			newsInfo.setDelFlag(false);
             newsInfo.setCreateBy(subject);
             newsInfo.setCreateTime(new Date());
+            newsInfo.setBrowseNumber(0);
 
             int affectCount = newsInfoService.insert(newsInfo);
 
@@ -195,7 +200,7 @@ public class NewsInfoController {
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
-            String id,
+            String title,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             HttpServletRequest request){
@@ -209,15 +214,22 @@ public class NewsInfoController {
         Map<String,Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("id_","asc"));
+        sortList.add(new Sort("create_time","desc"));
 
-        if (StringUtils.isNotEmpty(id)) {
-            searchParams.put("id","%" + id + "%");
+        if (StringUtils.isNotEmpty(title)) {
+            searchParams.put("title","%" + title + "%");
         }
 
 
         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);
+            }
+        }
+
 
         msgResult.setResult(true);
         msgResult.setData(PojoUtils.pageWrapper(page));