| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import sun.security.krb5.internal.ccache.CCacheInputStream;
|
| | |
|
| | | @Service
|
| | | public class SpecialServiceImpl implements SpecialService {
|
| | |
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | |
| | | @Override
|
| | | public Special selectByPrimaryKey(Long id) {
|
| | | return specialMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void saveObject(MultipartFile file, MultipartFile file2, MultipartFile file3, Special record, String jumpType) |
| | | throws SpecialException, Exception{
|
| | | public void saveObject(MultipartFile file, MultipartFile file2, MultipartFile file3, Special record,
|
| | | String jumpType) throws SpecialException, Exception {
|
| | |
|
| | | Long cardId = record.getCardId();
|
| | | if (cardId == null) {
|
| | |
| | | resultObj.setSubPicture(null);
|
| | | }
|
| | |
|
| | | |
| | | |
| | | if (picture != null && picture.trim().length() > 0) {
|
| | | // 删除老图
|
| | | removePicture(resultObj.getPicture());
|
| | |
| | | record.setSubPicture(resultObj.getSubPicture());
|
| | | }
|
| | |
|
| | | |
| | | if (icon != null && icon.trim().length() > 0) {
|
| | | // 删除老图
|
| | | removePicture(resultObj.getIcon());
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 上传图片
|
| | | * |
| | | * @param file
|
| | | * @return
|
| | | * @throws Exception
|
| | |
| | |
|
| | | /**
|
| | | * 删除图片-不更新数据库
|
| | | * |
| | | * @param record
|
| | | * @throws Exception
|
| | | */
|
| | |
| | | COSManager.getInstance().deleteFile(picture);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | @Transactional
|
| | |
| | | specialMapper.updateByPrimaryKey(resultObj);
|
| | | specialMapper.updateByPrimaryKey(exchangeObject);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | @Transactional
|
| | |
| | | return specialMapper.deleteBatchByCardID(list);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<Special> listQueryByCard(long start, int count, Long card, String key){
|
| | |
|
| | |
| | | return list;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public long countlistQueryByCard(Long card, String key) {
|
| | | return specialMapper.countlistQueryByCard(card, key);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | @Cacheable(value = "configCache", key = "'listBySystemAndCard-'+#card+'-'+#systemId")
|
| | |
| | | return specialMapper.listBySystemAndCard(card, systemId);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | @Cacheable(value = "configCache", key = "'listPageBySystemAndCard-'+#start+'-'+#count+'-'+#card+'-'+#systemId")
|
| | | public List<Special> listPageBySystemAndCard(long start, int count, String card, Long systemId) {
|
| | | return specialMapper.listPageBySystemAndCard(start, count, card, systemId);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | @Cacheable(value = "configCache", key = "'listCacheSpecialToIndex'")
|
| | |
| | | handlelist(listArc);
|
| | | arcMap.put("list", JsonUtil.getApiCommonGson().toJson(listArc));
|
| | |
|
| | | |
| | | // 首页-活动区域(女王节)
|
| | | JSONObject activityMap = new JSONObject();
|
| | | List<Special> listActivity = null;
|
| | |
| | | activityMap.put("bottomPicture", special.getBottomPicture());
|
| | | }
|
| | | }
|
| | | // 数据处理
|
| | | // 品牌券
|
| | | // >=1.5.40后的版本可以用
|
| | | if (("android".equalsIgnoreCase(acceptData.getPlatform()) && Integer.parseInt(acceptData.getVersion()) > 39)
|
| | | || "ios".equalsIgnoreCase(acceptData.getPlatform()) && Integer.parseInt(acceptData.getVersion()) > 48)
|
| | | if (listActivity != null)
|
| | | for (int i = 0; i < listActivity.size(); i++) {
|
| | | if ("品牌券".equalsIgnoreCase(listActivity.get(i).getName())) {
|
| | | listActivity.get(i).setJumpDetail(jumpDetailV2Service.getByTypeCache("hot_cakes"));
|
| | | }
|
| | | }
|
| | |
|
| | | handlelist(listActivity);
|
| | |
|
| | | activityMap.put("list", JsonUtil.getApiCommonGson().toJson(listActivity));
|
| | | |
| | | |
| | |
|
| | | // 首页-方形专题(品牌券、母婴...)
|
| | | JSONObject blockJsonMap = new JSONObject();
|
| | |
| | | return specialMapper.listByPlaceKey(placeKey);
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 处理 数据
|
| | | * |
| | | * @param list
|
| | | */
|
| | | public void handlelist(List<Special> list) {
|