| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | |
| | |
|
| | | @Resource
|
| | | private SpecialCardMapper specialCardMapper;
|
| | |
|
| | | @Resource
|
| | | private BusinessSystemService businessSystemService;
|
| | |
|
| | | @Resource
|
| | | private SpecialService specialService;
|
| | |
| | |
|
| | | /**
|
| | | * 删除图片-不更新数据库
|
| | | * @param record
|
| | | * @throws Exception
|
| | | */
|
| | | public void removePicture(String picture) throws Exception {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<SpecialCard> listQuery(long start, int count, String key, Integer sort) {
|
| | | public List<SpecialCard> listQuery(long start, int count, String key, Integer sort, List<Long> listPid, SystemEnum system) {
|
| | |
|
| | | List<SpecialCard> listObj = specialCardMapper.listQuery(start, count, key);
|
| | | List<SpecialCard> listObj = specialCardMapper.listQuery(start, count, key, listPid,system);
|
| | | if (listObj == null || listObj.size() == 0) {
|
| | | return null;
|
| | | }
|
| | |
| | | for (SpecialCard specialCard: listObj) {
|
| | | long totalSpecial= specialService.countlistQueryByCard(specialCard.getId(), null, null);
|
| | | specialCard.setTotalSpecial(totalSpecial);
|
| | | |
| | | // 将状态变化
|
| | | if (specialCard.getState() != null && specialCard.getState() == 0) {
|
| | | specialCard.setState(1);
|
| | | } else {
|
| | | specialCard.setState(0);
|
| | | }
|
| | | |
| | |
|
| | | Date startTime = specialCard.getStartTime();
|
| | | Date endTime = specialCard.getEndTime();
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public long countlistQuery(String key) {
|
| | | return specialCardMapper.countlistQuery(key);
|
| | | public long countlistQuery(String key, List<Long> listPid, SystemEnum system) {
|
| | | return specialCardMapper.countlistQuery(key, listPid,system);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String getbottomPicture(String placeKey) {
|
| | | return specialCardMapper.getbottomPicture(placeKey);
|
| | | public String getbottomPicture(String placeKey, SystemEnum system) {
|
| | | return specialCardMapper.getbottomPicture(placeKey,system);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public void switchState(Long id) throws SpecialCardException {
|
| | | if (id == null) {
|
| | | throw new SpecialCardException(1, "请传递正确参数");
|
| | | }
|
| | | |
| | | SpecialCard resultObj = specialCardMapper.selectByPrimaryKey(id);
|
| | | if (resultObj == null) {
|
| | | throw new SpecialCardException(1, "此内容已不存在");
|
| | | }
|
| | | |
| | | Integer state = resultObj.getState();
|
| | | if (state == null || state == 0) {
|
| | | state = 1;
|
| | | } else {
|
| | | state = 0;
|
| | | }
|
| | | |
| | | SpecialCard updateObj = new SpecialCard();
|
| | | updateObj.setId(id);
|
| | | updateObj.setState(state);
|
| | | specialCardMapper.updateByPrimaryKeySelective(updateObj);
|
| | | }
|
| | |
|
| | |
|
| | | }
|