| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.mindskip.xzs.base.BaseApiController; |
| | | import com.mindskip.xzs.base.RestResponse; |
| | | import com.mindskip.xzs.domain.Notify; |
| | | import com.mindskip.xzs.domain.UserConditionExamine; |
| | | import com.mindskip.xzs.domain.enums.NotifyRefType; |
| | | import com.mindskip.xzs.domain.vo.UserConditionExamineVO; |
| | | import com.mindskip.xzs.service.NotifyService; |
| | | import com.mindskip.xzs.service.UserConditionExamineService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public class UserConditionExamineController extends BaseApiController { |
| | | |
| | | private final UserConditionExamineService userConditionExamineService; |
| | | private final NotifyService notifyService; |
| | | |
| | | @RequestMapping(value = "list", method = RequestMethod.POST) |
| | | public RestResponse<PageInfo<UserConditionExamineVO>> list(@RequestBody UserConditionExamineVO userConditionExamineVO) { |
| | |
| | | return RestResponse.ok(userConditionExamineService.pageInfo(userConditionExamineVO)); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @RequestMapping(value = "save", method = RequestMethod.POST) |
| | | public RestResponse<Boolean> save(@RequestBody UserConditionExamine userConditionExamine) { |
| | | userConditionExamine.setCreateTime(LocalDateTime.now()); |
| | | userConditionExamine.setCreateUser(getCurrentUser().getId()); |
| | | return RestResponse.ok(userConditionExamineService.save(userConditionExamine)); |
| | | userConditionExamineService.save(userConditionExamine); |
| | | |
| | | // 添加通知 |
| | | Notify notify = new Notify(); |
| | | notify.setCreateTime(new Date()); |
| | | notify.setReadStatus(2); |
| | | notify.setRefId(userConditionExamine.getId()); |
| | | notify.setRefType(NotifyRefType.STATUS.getValue()); |
| | | notify.setCreateUserId(webContext.getCurrentUser().getId()); |
| | | notifyService.add(notify); |
| | | return RestResponse.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "delete/{id}", method = RequestMethod.POST) |