|
@@ -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.common.dto.Sort;
|
|
|
import com.jpsoft.employment.modules.base.entity.VolunteerSignRecord;
|
|
import com.jpsoft.employment.modules.base.entity.VolunteerSignRecord;
|
|
|
import com.jpsoft.employment.modules.base.service.VolunteerSignRecordService;
|
|
import com.jpsoft.employment.modules.base.service.VolunteerSignRecordService;
|
|
|
|
|
+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.apache.ibatis.mapping.ResultMap;
|
|
import org.apache.ibatis.mapping.ResultMap;
|
|
@@ -25,6 +26,9 @@ public class VolunteerSignRecordController {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private VolunteerSignRecordService volunteerSignRecordService;
|
|
private VolunteerSignRecordService volunteerSignRecordService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private DataDictionaryService dataDictionaryService;
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value="创建空记录")
|
|
@ApiOperation(value="创建空记录")
|
|
@@ -219,10 +223,55 @@ public class VolunteerSignRecordController {
|
|
|
|
|
|
|
|
Page<VolunteerSignRecord> page = volunteerSignRecordService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
Page<VolunteerSignRecord> page = volunteerSignRecordService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
|
|
|
|
|
|
|
+ for (VolunteerSignRecord volunteerSignRecord:page) {
|
|
|
|
|
+ String statusN = dataDictionaryService.findNameByCatalogNameAndValue("参与项目状态",volunteerSignRecord.getStatus());
|
|
|
|
|
+ if(StringUtils.isNotEmpty(statusN)){
|
|
|
|
|
+ volunteerSignRecord.setStatusN(statusN);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
msgResult.setResult(true);
|
|
msgResult.setResult(true);
|
|
|
msgResult.setData(PojoUtils.pageWrapper(page));
|
|
msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
|
|
|
|
|
return msgResult;
|
|
return msgResult;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation(value="更改状态")
|
|
|
|
|
+ @PostMapping("changeStatus")
|
|
|
|
|
+ public MessageResult<VolunteerSignRecord> changeStatus(String id,String status,@RequestAttribute String subject){
|
|
|
|
|
+ MessageResult<VolunteerSignRecord> msgResult = new MessageResult<>();
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ Date now = new Date();
|
|
|
|
|
+ VolunteerSignRecord volunteerSignRecord = volunteerSignRecordService.get(id);
|
|
|
|
|
+ volunteerSignRecord.setStatus(status);
|
|
|
|
|
+ if(status.equals("2")){
|
|
|
|
|
+ volunteerSignRecord.setCompletionTime(now);
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ volunteerSignRecord.setCompletionTime(null);
|
|
|
|
|
+ }
|
|
|
|
|
+ volunteerSignRecord.setUpdateBy(subject);
|
|
|
|
|
+ volunteerSignRecord.setUpdateTime(new Date());
|
|
|
|
|
+
|
|
|
|
|
+ int affectCount = volunteerSignRecordService.update(volunteerSignRecord);
|
|
|
|
|
+
|
|
|
|
|
+ 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;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|