Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

AppSysLoanApplyServiceImpl.java 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package io.renren.service.impl;
  2. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  3. import io.renren.common.exception.RenException;
  4. import io.renren.common.service.impl.CrudServiceImpl;
  5. import io.renren.dao.AppSysLoanApplyDao;
  6. import io.renren.dto.AppSysLoanApplyDTO;
  7. import io.renren.entity.AppSysLoanApplyEntity;
  8. import io.renren.interceptor.ThreadLocalLoginUser;
  9. import io.renren.service.AppSysLoanApplyService;
  10. import org.apache.commons.lang3.StringUtils;
  11. import org.springframework.stereotype.Service;
  12. import java.util.Map;
  13. /**
  14. * APP系统用户贷款申请表
  15. *
  16. * @author Mark sunlightcs@gmail.com
  17. * @since 1.0.0 2022-05-11
  18. */
  19. @Service
  20. public class AppSysLoanApplyServiceImpl extends CrudServiceImpl<AppSysLoanApplyDao, AppSysLoanApplyEntity, AppSysLoanApplyDTO> implements AppSysLoanApplyService {
  21. @Override
  22. public QueryWrapper<AppSysLoanApplyEntity> getWrapper(Map<String, Object> params){
  23. String id = (String)params.get("id");
  24. String appUserId = params.get("app_user_id")+"";
  25. QueryWrapper<AppSysLoanApplyEntity> wrapper = new QueryWrapper<>();
  26. wrapper.eq(StringUtils.isNotBlank(id), "id", id);
  27. wrapper.eq(StringUtils.isNotBlank(appUserId), "app_user_id", appUserId);
  28. return wrapper;
  29. }
  30. @Override
  31. public void updateLoanStep(Integer step) {
  32. Long userId = ThreadLocalLoginUser.getUserId();
  33. AppSysLoanApplyEntity applyEntity = baseDao.selectOne(new QueryWrapper<AppSysLoanApplyEntity>().eq("app_user_id",userId));
  34. if (applyEntity==null){
  35. throw new RenException("贷款申请不存在");
  36. }
  37. if (step>applyEntity.getStep()) {
  38. applyEntity.setStep(step);
  39. baseDao.updateById(applyEntity);
  40. }
  41. }
  42. }