|
@@ -10,6 +10,7 @@ import com.leromro.common.core.domain.R;
|
|
|
import com.leromro.common.core.domain.entity.SysUser;
|
|
|
import com.leromro.common.core.page.TableDataInfo;
|
|
|
import com.leromro.common.utils.SecurityUtils;
|
|
|
+import com.leromro.core.domain.MainOrders;
|
|
|
import com.leromro.core.domain.VolunteerFaceRecord;
|
|
|
import com.leromro.core.domain.VolunteerInfo;
|
|
|
import com.leromro.core.domain.dto.ConversationMsgDTO;
|
|
@@ -20,6 +21,7 @@ import com.leromro.core.domain.vo.VolunteerInfoVO;
|
|
|
import com.leromro.core.service.IConversationRecordService;
|
|
|
import com.leromro.core.service.IVolunteerFaceRecordService;
|
|
|
import com.leromro.core.service.IVolunteerInfoService;
|
|
|
+import com.leromro.core.service.impl.MainOrderServiceImpl;
|
|
|
import com.leromro.core.utils.SendSmsUtil;
|
|
|
import com.leromro.framework.config.ConstantsConfig;
|
|
|
import com.leromro.system.mapper.SysUserMapper;
|
|
@@ -37,6 +39,7 @@ import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* 志愿者信息
|
|
|
+ *
|
|
|
* @author lr
|
|
|
* @since 2025-04-07
|
|
|
*/
|
|
@@ -52,51 +55,68 @@ public class VolunteerInfoController extends BaseController {
|
|
|
@Autowired
|
|
|
private IVolunteerFaceRecordService volunteerFaceRecordService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private MainOrderServiceImpl mainOrderService;
|
|
|
+
|
|
|
/**
|
|
|
* 新增志愿者信息
|
|
|
* 已测试
|
|
|
*/
|
|
|
- @ApiOperation( value = "新增志愿者信息",notes = "传入路径参数 大分类,传入对象参数志愿者信息")
|
|
|
+ @ApiOperation(value = "新增志愿者信息", notes = "传入路径参数 大分类,传入对象参数志愿者信息")
|
|
|
@PostMapping("/newVolunteerInfo/{serviceCategory}")
|
|
|
- public AjaxResult newVolunteerInfoByuserId(@Valid @RequestBody VolunteerInfoDTO dto, @PathVariable Long serviceCategory){
|
|
|
- volunteerInfoService.newVolunteerInfoByuserId(dto,serviceCategory);
|
|
|
+ public AjaxResult newVolunteerInfoByuserId(@Valid @RequestBody VolunteerInfoDTO dto, @PathVariable Long serviceCategory) {
|
|
|
+ volunteerInfoService.newVolunteerInfoByuserId(dto, serviceCategory);
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 修改志愿者信息
|
|
|
* 未测试
|
|
|
*/
|
|
|
-// @ApiOperation(value = "修改志愿者信息" , notes = "传入志愿者修改后的对象")
|
|
|
-// @PutMapping("/updateInfo")
|
|
|
-// public AjaxResult updateVolunteerInfo(@RequestBody VolunteerInfoVO volunteerInfoVO){
|
|
|
-// boolean b = volunteerInfoService.updateById(volunteerInfoVO);
|
|
|
-// return AjaxResult.success();
|
|
|
-// }
|
|
|
+ @ApiOperation(value = "修改志愿者信息", notes = "传入志愿者修改后的对象,记得也把volunteerInfoId也传过来")
|
|
|
+ @PutMapping("/updateInfo")
|
|
|
+ public R updateVolunteerInfo(@RequestBody VolunteerInfoDTO volunteerInfoDTO) {
|
|
|
+
|
|
|
+ return volunteerInfoService.updateVolunteerInfoById(volunteerInfoDTO);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 志愿者信息回显
|
|
|
+ * 已测试
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "查看志愿者是否有订单", notes = "什么都不传,有订单会报错")
|
|
|
+ @GetMapping("/hadOrder")
|
|
|
+ public R selectVolunteerhasOrder(Long volunteerInfoId) {
|
|
|
+ List<MainOrders> list = mainOrderService.list(new LambdaQueryWrapper<MainOrders>().eq(MainOrders::getVolunteerInfoId, volunteerInfoId));
|
|
|
+ if (!list.isEmpty()){
|
|
|
+ return R.fail("该志愿者不可修改,志愿者已有订单");
|
|
|
+ }
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 志愿者信息回显
|
|
|
* 已测试
|
|
|
*/
|
|
|
- @ApiOperation(value = "志愿者信息回显" , notes = "传入大分类,返回大分类中志愿者已有信息")
|
|
|
+ @ApiOperation(value = "志愿者信息回显", notes = "传入大分类,返回大分类中志愿者已有信息")
|
|
|
@GetMapping("/volunteerInfo")
|
|
|
- public R<VolunteerInfo> selectVolunteerInfo(Long serviceCategory){
|
|
|
+ public R<VolunteerInfo> selectVolunteerInfo(Long serviceCategory) {
|
|
|
Long userId = SecurityUtils.getUserId();
|
|
|
- VolunteerInfo info = volunteerInfoService.selectByUserID(serviceCategory,userId);
|
|
|
- return R.ok(info);
|
|
|
+ return volunteerInfoService.selectByUserID(serviceCategory, userId);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 查询志愿者信息列表
|
|
|
* 已测试
|
|
|
*/
|
|
|
- @ApiOperation(value = "(后台)查询志愿者信息列表",notes = "传入进行分类的字段,根据分类字段查询,返回List 集合")
|
|
|
+ @ApiOperation(value = "(后台)查询志愿者信息列表", notes = "传入进行分类的字段,根据分类字段查询,返回List 集合")
|
|
|
@ApiImplicitParams(value = {
|
|
|
@ApiImplicitParam(name = "appStatus", value = "审批传1,管理传2", required = true)
|
|
|
})
|
|
|
@GetMapping("/web/list")
|
|
|
- public TableDataInfo<VolunteerInfo> webList(VolunteerInfoDTO dto)
|
|
|
- {
|
|
|
+ public TableDataInfo<VolunteerInfo> webList(VolunteerInfoDTO dto) {
|
|
|
startPage();
|
|
|
SysUser sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId());
|
|
|
- if (Objects.equals(sysUser.getAreaType(), "4")){
|
|
|
+ if (Objects.equals(sysUser.getAreaType(), "4")) {
|
|
|
//如果是服务中心,那就把服务中心id传进去,查的时候联查
|
|
|
dto.setServiceCenterId(SecurityUtils.getDeptId());
|
|
|
}
|
|
@@ -108,10 +128,9 @@ public class VolunteerInfoController extends BaseController {
|
|
|
* 获取志愿者信息列表
|
|
|
* 已测试
|
|
|
*/
|
|
|
- @ApiOperation(value = "(小程序)查询志愿者信息列表",notes = "传入进行分类的字段,根据分类字段查询,返回List 集合")
|
|
|
- @GetMapping ("/list")
|
|
|
- public TableDataInfo<VolunteerInfoVO> list( VolunteerListDTO volunteerInfo)
|
|
|
- {
|
|
|
+ @ApiOperation(value = "(小程序)查询志愿者信息列表", notes = "传入进行分类的字段,根据分类字段查询,返回List 集合")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo<VolunteerInfoVO> list(VolunteerListDTO volunteerInfo) {
|
|
|
startPage();
|
|
|
List<VolunteerInfoVO> list = volunteerInfoService.selectVolunteerInfoList(volunteerInfo);
|
|
|
return getDataTable(list);
|
|
@@ -121,10 +140,9 @@ public class VolunteerInfoController extends BaseController {
|
|
|
* 获取志愿者信息详细信息
|
|
|
* 已测试
|
|
|
*/
|
|
|
- @ApiOperation( value = "获取志愿者信息详细信息",notes = "传入志愿者id,以及分类的id, 返回志愿者的信息")
|
|
|
+ @ApiOperation(value = "获取志愿者信息详细信息", notes = "传入志愿者id,以及分类的id, 返回志愿者的信息")
|
|
|
@PostMapping(value = "/getDetails")
|
|
|
- public R<VolunteerInfoDetailVO> getInfo(@RequestBody VolunteerInfo volunteerInfo)
|
|
|
- {
|
|
|
+ public R<VolunteerInfoDetailVO> getInfo(@RequestBody VolunteerInfo volunteerInfo) {
|
|
|
|
|
|
return R.ok(volunteerInfoService.selectLVolunteerInfoByVolunteerId(volunteerInfo));
|
|
|
}
|
|
@@ -132,28 +150,29 @@ public class VolunteerInfoController extends BaseController {
|
|
|
/**
|
|
|
* 志愿者审批
|
|
|
*/
|
|
|
- @ApiOperation(value = "志愿者审批",notes = "传入当前行主键volunteerInfoId,审批状态appStatus:2通过,3拒绝,驳回原因rejectReason,状态为3则必填")
|
|
|
+ @ApiOperation(value = "志愿者审批", notes = "传入当前行主键volunteerInfoId,审批状态appStatus:2通过,3拒绝,驳回原因rejectReason,状态为3则必填")
|
|
|
@PostMapping("/web/approval")
|
|
|
- public AjaxResult approval(@RequestBody VolunteerInfo volunteerInfo){
|
|
|
- if ("3".equals(volunteerInfo.getAppStatus()) && StrUtil.isBlank(volunteerInfo.getRejectReason())){
|
|
|
+ public AjaxResult approval(@RequestBody VolunteerInfo volunteerInfo) {
|
|
|
+ if ("3".equals(volunteerInfo.getAppStatus()) && StrUtil.isBlank(volunteerInfo.getRejectReason())) {
|
|
|
return AjaxResult.warn("请填写驳回原因");
|
|
|
}
|
|
|
// 志愿者审批
|
|
|
volunteerInfoService.approval(volunteerInfo);
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
+
|
|
|
@ApiOperation("小程序志愿者首页获取自己的头像(用于排班管理)")
|
|
|
@GetMapping("/volunteerPicture")
|
|
|
- public List<String> getVolunteerPicture(){
|
|
|
+ public List<String> getVolunteerPicture() {
|
|
|
return volunteerInfoService.getVolunteerPicture(SecurityUtils.getUserId());
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取志愿者人脸核身状态
|
|
|
*/
|
|
|
- @ApiOperation(value = "获取志愿者人脸核身状态",notes = "传入志愿者id,返回核身状态,如果为false,则提示志愿者先去人脸核身")
|
|
|
+ @ApiOperation(value = "获取志愿者人脸核身状态", notes = "传入志愿者id,返回核身状态,如果为false,则提示志愿者先去人脸核身")
|
|
|
@GetMapping("/getFaceStatus")
|
|
|
- public R<Boolean> getFaceStatus(Long volunteerInfoId){
|
|
|
+ public R<Boolean> getFaceStatus(Long volunteerInfoId) {
|
|
|
return volunteerFaceRecordService.getFaceStatus(volunteerInfoId);
|
|
|
}
|
|
|
|
|
@@ -162,7 +181,7 @@ public class VolunteerInfoController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation(value = "新增志愿者人脸核身记录")
|
|
|
@PostMapping("/addFaceRecord")
|
|
|
- public R<Boolean> addFaceRecord(@RequestBody VolunteerFaceRecord volunteerFaceRecord){
|
|
|
+ public R<Boolean> addFaceRecord(@RequestBody VolunteerFaceRecord volunteerFaceRecord) {
|
|
|
return volunteerFaceRecordService.addFaceRecord(volunteerFaceRecord);
|
|
|
}
|
|
|
|