|
@@ -13,6 +13,7 @@ import com.jpsoft.employment.modules.common.utils.PojoUtils;
|
|
|
import com.jpsoft.employment.modules.common.dto.Sort;
|
|
import com.jpsoft.employment.modules.common.dto.Sort;
|
|
|
import com.jpsoft.employment.modules.base.entity.WishInfoUserRecord;
|
|
import com.jpsoft.employment.modules.base.entity.WishInfoUserRecord;
|
|
|
import com.jpsoft.employment.modules.base.service.WishInfoUserRecordService;
|
|
import com.jpsoft.employment.modules.base.service.WishInfoUserRecordService;
|
|
|
|
|
+import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
@@ -40,6 +41,9 @@ public class WishInfoUserRecordController {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private StudentAspirationsService studentAspirationsService;
|
|
private StudentAspirationsService studentAspirationsService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private DataDictionaryService dataDictionaryService;
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value="创建空记录")
|
|
@ApiOperation(value="创建空记录")
|
|
@@ -115,6 +119,13 @@ public class WishInfoUserRecordController {
|
|
|
wishInfoUserRecord.setRegUserName(regUser.getRealName());
|
|
wishInfoUserRecord.setRegUserName(regUser.getRealName());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if(StringUtils.isNotEmpty(wishInfoUserRecord.getStudentAspirationsId())){
|
|
|
|
|
+ StudentAspirations studentAspirations = studentAspirationsService.get(wishInfoUserRecord.getStudentAspirationsId());
|
|
|
|
|
+ if(studentAspirations!=null){
|
|
|
|
|
+ wishInfoUserRecord.setAspirationsName(studentAspirations.getName());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
dto.setWishInfoUserRecord(wishInfoUserRecord);
|
|
dto.setWishInfoUserRecord(wishInfoUserRecord);
|
|
|
dto.setWishInfo(wishInfo);
|
|
dto.setWishInfo(wishInfo);
|
|
|
msgResult.setResult(true);
|
|
msgResult.setResult(true);
|
|
@@ -194,6 +205,44 @@ public class WishInfoUserRecordController {
|
|
|
return msgResult;
|
|
return msgResult;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @ApiOperation(value="更改状态")
|
|
|
|
|
+ @PostMapping("changeStatus")
|
|
|
|
|
+ public MessageResult<WishInfoUserRecord> changeStatus(String id,String status,@RequestAttribute String subject){
|
|
|
|
|
+ MessageResult<WishInfoUserRecord> msgResult = new MessageResult<>();
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ Date now = new Date();
|
|
|
|
|
+ WishInfoUserRecord wishInfoUserRecord = wishInfoUserRecordService.get(id);
|
|
|
|
|
+ wishInfoUserRecord.setStatus(status);
|
|
|
|
|
+ if(status.equals("1")){
|
|
|
|
|
+ wishInfoUserRecord.setCompletionTime(now);
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ wishInfoUserRecord.setCompletionTime(null);
|
|
|
|
|
+ }
|
|
|
|
|
+ wishInfoUserRecord.setUpdateBy(subject);
|
|
|
|
|
+ wishInfoUserRecord.setUpdateTime(new Date());
|
|
|
|
|
+
|
|
|
|
|
+ int affectCount = wishInfoUserRecordService.update(wishInfoUserRecord);
|
|
|
|
|
+
|
|
|
|
|
+ if (affectCount > 0) {
|
|
|
|
|
+ msgResult.setResult(true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ msgResult.setResult(false);
|
|
|
|
|
+ msgResult.setMessage("数据库删除失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ catch(Exception ex){
|
|
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
|
|
+
|
|
|
|
|
+ msgResult.setResult(false);
|
|
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return msgResult;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@ApiOperation(value="批量删除")
|
|
@ApiOperation(value="批量删除")
|
|
|
@PostMapping("batchDelete")
|
|
@PostMapping("batchDelete")
|
|
@@ -233,7 +282,8 @@ public class WishInfoUserRecordController {
|
|
|
@ApiOperation(value="列表")
|
|
@ApiOperation(value="列表")
|
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
public MessageResult<Map> pageList(
|
|
public MessageResult<Map> pageList(
|
|
|
- String wishInfoId,String status,
|
|
|
|
|
|
|
+ String wishInfoId,String status,String num,String wishInfoTitle,
|
|
|
|
|
+ String category,String phone,
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
HttpServletRequest request){
|
|
HttpServletRequest request){
|
|
@@ -247,7 +297,7 @@ public class WishInfoUserRecordController {
|
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
|
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("create_time","desc"));
|
|
|
|
|
|
|
+ sortList.add(new Sort("a.create_time","desc"));
|
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(wishInfoId)) {
|
|
if (StringUtils.isNotEmpty(wishInfoId)) {
|
|
|
searchParams.put("wishInfoId",wishInfoId);
|
|
searchParams.put("wishInfoId",wishInfoId);
|
|
@@ -257,6 +307,22 @@ public class WishInfoUserRecordController {
|
|
|
searchParams.put("status",status);
|
|
searchParams.put("status",status);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(num)) {
|
|
|
|
|
+ searchParams.put("num",num+"%");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtils.isNotEmpty(wishInfoTitle)) {
|
|
|
|
|
+ searchParams.put("wishInfoTitle",wishInfoTitle);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtils.isNotEmpty(category)) {
|
|
|
|
|
+ searchParams.put("category",category);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtils.isNotEmpty(phone)) {
|
|
|
|
|
+ searchParams.put("phone",phone);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
Page<WishInfoUserRecord> page = wishInfoUserRecordService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
Page<WishInfoUserRecord> page = wishInfoUserRecordService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
|
|
|
|
@@ -264,12 +330,20 @@ public class WishInfoUserRecordController {
|
|
|
RegUser regUser = regUserService.get(wishInfoUserRecord.getRegUserId());
|
|
RegUser regUser = regUserService.get(wishInfoUserRecord.getRegUserId());
|
|
|
if(regUser!=null){
|
|
if(regUser!=null){
|
|
|
wishInfoUserRecord.setRegUserName(regUser.getRealName());
|
|
wishInfoUserRecord.setRegUserName(regUser.getRealName());
|
|
|
|
|
+ wishInfoUserRecord.setRegUserPhone(regUser.getPhone());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
WishInfo wishInfo = wishInfoService.get(wishInfoUserRecord.getWishInfoId());
|
|
WishInfo wishInfo = wishInfoService.get(wishInfoUserRecord.getWishInfoId());
|
|
|
if(wishInfo!=null){
|
|
if(wishInfo!=null){
|
|
|
wishInfoUserRecord.setStudentName(wishInfo.getStudentName());
|
|
wishInfoUserRecord.setStudentName(wishInfo.getStudentName());
|
|
|
wishInfoUserRecord.setStudentType(wishInfo.getStudentType());
|
|
wishInfoUserRecord.setStudentType(wishInfo.getStudentType());
|
|
|
|
|
+ wishInfoUserRecord.setWishInfoTitle(wishInfo.getTitle());
|
|
|
|
|
+
|
|
|
|
|
+ String categoryN = dataDictionaryService.findNameByCatalogNameAndValue("心愿类型",wishInfo.getCategory());
|
|
|
|
|
+ if(StringUtils.isNotEmpty(categoryN)){
|
|
|
|
|
+ wishInfoUserRecord.setCategoryN(categoryN);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if(StringUtils.isNotEmpty(wishInfoUserRecord.getStudentAspirationsId())){
|
|
if(StringUtils.isNotEmpty(wishInfoUserRecord.getStudentAspirationsId())){
|