| | |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.pojo.VerifyResult; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.core.tools.*; |
| | | import com.matrix.system.app.dto.ServiceOrderListDto; |
| | | import com.matrix.system.app.vo.ServiceOrderListVo; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.constance.Dictionary; |
| | |
| | | taocan.setSurplusCount(0); |
| | | taocan.setStatus(Dictionary.TAOCAN_STATUS_WX); |
| | | } else if (Dictionary.FLAG_YES_Y.equals(taocan.getIsCourse())) { |
| | | //任选套餐检查套餐整体剩余次数 |
| | | int tcSurplusCount = taocan.getSurplusCount() - sysProjUse.getDeductionNum(); |
| | | if (tcSurplusCount < 0) { |
| | | throw new GlobleException(taocan.getProjName() + "已经达到最大使用次数"); |
| | | } else { |
| | | taocan.setSurplusCount(tcSurplusCount); |
| | | if (StringUtils.isBlank(taocan.getIsInfinite()) || Dictionary.FLAG_NO_N.equals(taocan.getIsInfinite())) { |
| | | //任选套餐检查套餐整体剩余次数 |
| | | int tcSurplusCount = taocan.getSurplusCount() - sysBeauticianState.getCount(); |
| | | if (tcSurplusCount < 0) { |
| | | throw new GlobleException(taocan.getProjName() + "已经达到最大使用次数"); |
| | | } else { |
| | | taocan.setSurplusCount(tcSurplusCount); |
| | | } |
| | | |
| | | if (tcSurplusCount == 0) { |
| | | taocan.setIsOver(Dictionary.FLAG_YES_Y); |
| | | taocan.setStatus(Dictionary.TAOCAN_STATUS_WX); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | upProjUse.setStatus(Dictionary.MONEYCARD_STATUS_YX); |
| | | if (sysProjUse.getTaocanId() != null) { |
| | | //TODO 更新套餐状态为有效 |
| | | SysProjUse taocanProjUse = sysProjUseDao.selectById(sysProjUse.getTaocanId()); |
| | | taocanProjUse.setIsOver(Dictionary.DELETED_N); |
| | | taocanProjUse.setStatus(Dictionary.MONEYCARD_STATUS_YX); |
| | | |
| | | if (Dictionary.FLAG_YES_Y.equals(taocanProjUse.getIsCourse())) { |
| | | if (StringUtils.isBlank(taocanProjUse.getIsInfinite()) || Dictionary.FLAG_NO_N.equals(taocanProjUse.getIsInfinite())) { |
| | | taocanProjUse.setSurplusCount(taocanProjUse.getSurplusCount() + beauticianState.getCount()); |
| | | } |
| | | } |
| | | sysProjUseDao.update(taocanProjUse); |
| | | } |
| | | } |
| | | int surplus = sysProjUse.getSurplusCount() + beauticianState.getCount(); |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<ServiceOrderListVo> findApiServiceOrderListInPage(ServiceOrderListDto serviceOrderListDto, PaginationVO pageVo) { |
| | | return sysProjServicesDao.selectApiServiceOrderListInPage(serviceOrderListDto, pageVo); |
| | | } |
| | | |
| | | @Override |
| | | public int findApiServiceOrderListTotal(ServiceOrderListDto serviceOrderListDto) { |
| | | return sysProjServicesDao.selectApiServiceOrderListTotal(serviceOrderListDto); |
| | | } |
| | | } |