| | |
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.bus.help.HelpClass;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType;
|
| | | import com.yeshi.fanli.exception.banner.SwiperPictureException;
|
| | | import com.yeshi.fanli.exception.config.HelpClassException;
|
| | | import com.yeshi.fanli.exception.homemodule.FloatADException;
|
| | | import com.yeshi.fanli.service.inter.help.HelpClassService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.AdActivityVersionControlService;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | |
| | | if (record.getId() == null) {
|
| | | int maxOrder = helpClassMapper.getMaxOrder();
|
| | | record.setSort(maxOrder + 1);
|
| | | record.setPicture(picture);
|
| | | record.setCreateTime(new Date());
|
| | | helpClassMapper.insertSelective(record);
|
| | | } else {
|
| | | // 修改
|
| | | HelpClass resultObj = helpClassMapper.selectByPrimaryKey(record.getId());
|
| | | if (resultObj == null)
|
| | | throw new FloatADException(1, "修改内容已不存在");
|
| | | throw new HelpClassException(1, "修改内容已不存在");
|
| | |
|
| | | if (picture != null && picture.trim().length() > 0) {
|
| | | String pictureOld = resultObj.getPicture();
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public void switchState(Long id) throws HelpClassException {
|
| | | if (id == null) {
|
| | | throw new HelpClassException(1, "请传递正确参数");
|
| | | }
|
| | | |
| | | HelpClass resultObj = helpClassMapper.selectByPrimaryKey(id);
|
| | | if (resultObj == null) {
|
| | | throw new HelpClassException(1, "此内容已不存在");
|
| | | }
|
| | | |
| | | Integer state = resultObj.getShowState();
|
| | | if (state == null || state == 0) {
|
| | | state = 1;
|
| | | } else {
|
| | | state = 0;
|
| | | }
|
| | | |
| | | HelpClass updateObj = new HelpClass();
|
| | | updateObj.setId(id);
|
| | | updateObj.setShowState(state);
|
| | | helpClassMapper.updateByPrimaryKeySelective(updateObj);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public int updateShowState(Long id) throws HelpClassException {
|
| | |
|
| | | if (id == null) {
|