| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.admin.request.OptionsObject; |
| | | import com.doumee.dao.admin.response.ProblemDTO; |
| | | import com.doumee.dao.business.ProblemsMapper; |
| | | import com.doumee.dao.business.model.Problems; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | insert.setIsdeleted(Constants.ZERO); |
| | | insert.setRemark(problems.getRemark()); |
| | | insert.setTitle(problems.getTitle()); |
| | | insert.setOptions(problems.getOptions()); |
| | | if(null != problems.getObjectList() && problems.getObjectList().size() > 0) { |
| | | insert.setOptions(JSON.toJSONString(problems.getObjectList())); |
| | | } |
| | | insert.setAnswer(problems.getAnswer()); |
| | | insert.setSortnu(problems.getSortnu()); |
| | | insert.setType(problems.getType()); |
| | |
| | | |
| | | @Override |
| | | public Problems findById(Integer id) { |
| | | return problemsMapper.selectById(id); |
| | | Problems problems = problemsMapper.selectById(id); |
| | | if(null != problems && StringUtils.isNotBlank(problems.getOptions())) { |
| | | problems.setObjectList(JSON.parseArray(problems.getOptions(), OptionsObject.class)); |
| | | } |
| | | return problems; |
| | | } |
| | | |
| | | @Override |