| | |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.system.model.SystemDict; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import com.doumee.dao.web.response.MailConfigResponse; |
| | | import com.doumee.service.system.SystemDictDataService; |
| | | import com.doumee.service.system.SystemDictService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | public class SystemDictDataBizImpl implements SystemDictDataBiz { |
| | |
| | | one.setCode(path+one.getCode()); |
| | | return one; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public MailConfigResponse getMailConfig(){ |
| | | MailConfigResponse mailConfigResponse = new MailConfigResponse(); |
| | | |
| | | SystemDictData systemDictData = new SystemDictData(); |
| | | systemDictData.setDeleted(Boolean.FALSE); |
| | | systemDictData.setLabel(Constants.FIRST_WEIGHT); |
| | | SystemDictData one = systemDictDataService.findOne(systemDictData); |
| | | if(Objects.isNull(one)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "数据值不存在"); |
| | | } |
| | | mailConfigResponse.setFee0(new BigDecimal(one.getCode())); |
| | | systemDictData.setLabel(Constants.CONTINUE_FEE); |
| | | one = systemDictDataService.findOne(systemDictData); |
| | | if(Objects.isNull(one)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "数据值不存在"); |
| | | } |
| | | mailConfigResponse.setFee1(new BigDecimal(one.getCode())); |
| | | |
| | | systemDictData.setLabel(Constants.FIRST_WEIGHT); |
| | | one = systemDictDataService.findOne(systemDictData); |
| | | if(Objects.isNull(one)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "数据值不存在"); |
| | | } |
| | | mailConfigResponse.setWeight0(new BigDecimal(one.getCode())); |
| | | |
| | | systemDictData.setLabel(Constants.CONTINUE_WEIGHT); |
| | | one = systemDictDataService.findOne(systemDictData); |
| | | if(Objects.isNull(one)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "数据值不存在"); |
| | | } |
| | | |
| | | mailConfigResponse.setWeight1(new BigDecimal(one.getCode())); |
| | | |
| | | |
| | | |
| | | return mailConfigResponse; |
| | | |
| | | |
| | | } |
| | | |
| | | } |