Parcourir la source

4. 心愿管理页面,“标题”改为“作品名”,“数量”改为“上架总量”;
5. 心愿管理,增加列“已互换数量”;“显示状态”改为“是否上架”取值【是、否】
6. 心愿管理,增加列“互换记录”,为链接列打开该作品的历史互换记录
7. 心愿管理,查询条件增加按“类别”查询
8. 心愿管理,有互换记录的,禁止删除;可删除的,删除前要弹框确认删除

yanliming il y a 1 an
Parent
commit
def190b979

+ 3 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dao/WishInfoUserRecordDAO.java

@@ -1,6 +1,8 @@
 package com.jpsoft.employment.modules.base.dao;
 
 import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 import com.jpsoft.employment.modules.base.entity.WishInfoUserRecord;
 import java.util.Map;
@@ -16,6 +18,7 @@ public interface WishInfoUserRecordDAO {
 	List<WishInfoUserRecord> list();
 	List<WishInfoUserRecord> search(Map<String, Object> searchParams, List<Sort> sortList);
 	int countByWish(String wishInfoId);
+	int countByWishAndStatus(@Param("wishInfoId")String wishInfoId, @Param("status")String status);
 	String getLastSerialNumber(String date);
 	int countByUser(String regUserId);
 }

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

@@ -4,6 +4,8 @@ import java.io.Serializable;
 import java.util.Date;
 import java.text.SimpleDateFormat;
 import java.math.BigDecimal;
+import java.util.List;
+
 import org.springframework.format.annotation.DateTimeFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
@@ -52,5 +54,9 @@ public class RegUser {
 	
 			@ApiModelProperty(value = "是否删除")
 	private Boolean delFlag;
+
+
+	@ApiModelProperty(value = "地址列表")
+	private String address;
 	
 		}

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

@@ -85,4 +85,12 @@ public class WishInfo {
 	@Transient
 	@ApiModelProperty(value = "学生心愿列表")
 	private List<StudentAspirations> studentAspirationsList;
+
+
+	@Transient
+	@ApiModelProperty(value = "互换记录数量")
+	private Integer wishInfoUserRecordNum;
+
+
+
 	}

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

@@ -15,6 +15,7 @@ public interface WishInfoUserRecordService {
 	List<WishInfoUserRecord> list();
 	Page<WishInfoUserRecord> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
 	int countByWish(String wishInfoId);
+	int countByWishAndStatus(String wishInfoId,String status);
 	String getLastSerialNumber(String date);
 	int countByUser(String regUserId);
 }

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

@@ -73,6 +73,11 @@ public class WishInfoUserRecordServiceImpl implements WishInfoUserRecordService
 		return wishInfoUserRecordDAO.countByWish(wishInfoId);
 	}
 
+	@Override
+	public int countByWishAndStatus(String wishInfoId,String status){
+		return wishInfoUserRecordDAO.countByWishAndStatus(wishInfoId,status);
+	}
+
 	@Override
 	public String getLastSerialNumber(String date) {
 		return wishInfoUserRecordDAO.getLastSerialNumber(date);

+ 6 - 0
common/src/main/resources/mapper/base/WishInfoUserRecord.xml

@@ -142,6 +142,12 @@
 		WHERE del_flag = 0
 		AND wish_info_id = #{0}
 	</select>
+	<select id="countByWishAndStatus" parameterType="string" resultType="int">
+		SELECT COUNT(*) FROM base_wish_info_user_record
+		WHERE del_flag = 0
+		AND status_= #{status}
+		AND wish_info_id = #{wishInfoId}
+	</select>
 	<select id="countByUser" parameterType="string" resultType="int">
 		SELECT COUNT(*) FROM base_wish_info_user_record
 		WHERE del_flag = 0

+ 15 - 3
web/src/main/java/com/jpsoft/employment/modules/base/controller/RegUserController.java

@@ -1,6 +1,8 @@
 package com.jpsoft.employment.modules.base.controller;
 
 import com.github.pagehelper.Page;
+import com.jpsoft.employment.modules.base.entity.AddressInfo;
+import com.jpsoft.employment.modules.base.service.AddressInfoService;
 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,9 +26,12 @@ public class RegUserController {
 
     @Autowired
     private RegUserService regUserService;
-	
-	
-	@ApiOperation(value="创建空记录")
+
+    @Autowired
+    private AddressInfoService addressInfoService;
+
+
+    @ApiOperation(value="创建空记录")
     @GetMapping("create")
     public MessageResult<RegUser> create(){
         MessageResult<RegUser> msgResult = new MessageResult<>();
@@ -218,6 +223,13 @@ public class RegUserController {
 
         Page<RegUser> page = regUserService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
 
+        for (RegUser regUser:page) {
+            AddressInfo addressInfo = addressInfoService.getByUser(regUser.getId());
+            if(addressInfo!=null){
+                regUser.setAddress(addressInfo.getDetailAddress());
+            }
+        }
+
 
         msgResult.setResult(true);
         msgResult.setData(PojoUtils.pageWrapper(page));

+ 13 - 2
web/src/main/java/com/jpsoft/employment/modules/base/controller/WishInfoController.java

@@ -3,6 +3,7 @@ package com.jpsoft.employment.modules.base.controller;
 import com.github.pagehelper.Page;
 import com.jpsoft.employment.modules.base.entity.StudentAspirations;
 import com.jpsoft.employment.modules.base.service.StudentAspirationsService;
+import com.jpsoft.employment.modules.base.service.WishInfoUserRecordService;
 import com.jpsoft.employment.modules.common.dto.MessageResult;
 import com.jpsoft.employment.modules.common.utils.PojoUtils;
 import com.jpsoft.employment.modules.common.dto.Sort;
@@ -33,6 +34,9 @@ public class WishInfoController {
 
     @Autowired
     private DataDictionaryService dataDictionaryService;
+
+    @Autowired
+    private WishInfoUserRecordService wishInfoUserRecordService;
 	
 	
 	@ApiOperation(value="创建空记录")
@@ -214,7 +218,7 @@ public class WishInfoController {
     @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){
@@ -228,12 +232,16 @@ public class WishInfoController {
         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(title)) {
             searchParams.put("title",title + "%");
         }
 
+        if (StringUtils.isNotEmpty(category)) {
+            searchParams.put("category",category);
+        }
+
 
         Page<WishInfo> page = wishInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
 
@@ -251,6 +259,9 @@ public class WishInfoController {
                     wishInfo.setStatusN("上架");
                 }
             }
+
+            int wishInfoUserRecordNum = wishInfoUserRecordService.countByWishAndStatus(wishInfo.getId(),"1");
+            wishInfo.setWishInfoUserRecordNum(wishInfoUserRecordNum);
         }
 
 

+ 21 - 4
web/src/main/java/com/jpsoft/employment/modules/base/controller/WishInfoUserRecordController.java

@@ -3,8 +3,10 @@ package com.jpsoft.employment.modules.base.controller;
 import com.github.pagehelper.Page;
 import com.jpsoft.employment.modules.base.dto.WishInfoUserRecordDTO;
 import com.jpsoft.employment.modules.base.entity.RegUser;
+import com.jpsoft.employment.modules.base.entity.StudentAspirations;
 import com.jpsoft.employment.modules.base.entity.WishInfo;
 import com.jpsoft.employment.modules.base.service.RegUserService;
+import com.jpsoft.employment.modules.base.service.StudentAspirationsService;
 import com.jpsoft.employment.modules.base.service.WishInfoService;
 import com.jpsoft.employment.modules.common.dto.MessageResult;
 import com.jpsoft.employment.modules.common.utils.PojoUtils;
@@ -35,6 +37,9 @@ public class WishInfoUserRecordController {
 
     @Autowired
     private RegUserService regUserService;
+
+    @Autowired
+    private StudentAspirationsService studentAspirationsService;
 	
 	
 	@ApiOperation(value="创建空记录")
@@ -228,7 +233,7 @@ public class WishInfoUserRecordController {
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
-            String id,
+            String wishInfoId,String status,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             HttpServletRequest request){
@@ -242,10 +247,14 @@ public class WishInfoUserRecordController {
         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(wishInfoId)) {
+            searchParams.put("wishInfoId",wishInfoId);
+        }
 
-        if (StringUtils.isNotEmpty(id)) {
-            searchParams.put("id","%" + id + "%");
+        if (StringUtils.isNotEmpty(status)) {
+            searchParams.put("status",status);
         }
 
 
@@ -262,6 +271,14 @@ public class WishInfoUserRecordController {
                 wishInfoUserRecord.setStudentName(wishInfo.getStudentName());
                 wishInfoUserRecord.setStudentType(wishInfo.getStudentType());
             }
+
+            if(StringUtils.isNotEmpty(wishInfoUserRecord.getStudentAspirationsId())){
+                StudentAspirations studentAspirations = studentAspirationsService.get(wishInfoUserRecord.getStudentAspirationsId());
+                if(studentAspirations!=null){
+                    wishInfoUserRecord.setAspirationsName(studentAspirations.getName());
+                }
+            }
+
         }