From 30d8e227e8d823b6c38c3b9c90ac2df03b63befe Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 25 二月 2025 16:41:22 +0800 Subject: [PATCH] 淘宝转链接口更新 --- fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialPlaceImpl.java | 172 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 86 insertions(+), 86 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialPlaceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialPlaceImpl.java index a75bb51..0b821c1 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialPlaceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialPlaceImpl.java @@ -1,86 +1,86 @@ -package com.yeshi.fanli.service.impl.homemodule; - -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import com.yeshi.fanli.dao.mybatis.homemodule.SpecialPlaceMapper; -import com.yeshi.fanli.entity.bus.homemodule.SpecialPlace; -import com.yeshi.fanli.exception.homemodule.SpecialPlaceException; -import com.yeshi.fanli.service.inter.homemodule.SpecialPlaceService; - -@Service -public class SpecialPlaceImpl implements SpecialPlaceService { - - @Resource - private SpecialPlaceMapper specialPlaceMapper; - - - @Override - public SpecialPlace selectByPrimaryKey(Long id) { - return specialPlaceMapper.selectByPrimaryKey(id); - } - - - @Override - public void saveObject(SpecialPlace record) throws SpecialPlaceException, Exception{ - - String placeName = record.getName(); - if (placeName == null || placeName.trim().length() == 0) { - throw new SpecialPlaceException(1, "浣嶇疆鍚嶇О涓嶈兘涓虹┖"); - } - - String key = record.getKey(); - if (key == null || key.trim().length() == 0) { - throw new SpecialPlaceException(1, "浣嶇疆鏍囪瘑涓嶈兘涓虹┖"); - } - - Long id = record.getId(); - if (id == null) { - record.setCreateTime(new Date()); - record.setUpdateTime(new Date()); - specialPlaceMapper.insert(record); - } else { - // 淇敼 - SpecialPlace resultObj = specialPlaceMapper.selectByPrimaryKey(id); - if (resultObj == null) { - throw new SpecialPlaceException(1, "淇敼鍐呭宸蹭笉瀛樺湪"); - } - - record.setCreateTime(resultObj.getCreateTime()); - record.setUpdateTime(new Date()); - specialPlaceMapper.updateByPrimaryKey(record); - } - } - - - @Override - @Transactional - public int deleteByPrimaryKeyList(List<Long> list) throws Exception{ - return specialPlaceMapper.deleteByPrimaryKeyList(list); - } - - - - @Override - public List<SpecialPlace> listQuery(long start, int count, String key) throws Exception { - return specialPlaceMapper.listQuery(start, count, key); - } - - - @Override - public long countQuery(String key) { - return specialPlaceMapper.countQuery(key); - } - - @Override - public List<SpecialPlace> getEffectiveList() { - return specialPlaceMapper.getAll(); - } - -} - +package com.yeshi.fanli.service.impl.homemodule; + +import java.util.Date; +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.yeshi.fanli.dao.mybatis.homemodule.SpecialPlaceMapper; +import com.yeshi.fanli.entity.bus.homemodule.SpecialPlace; +import com.yeshi.fanli.exception.homemodule.SpecialPlaceException; +import com.yeshi.fanli.service.inter.homemodule.SpecialPlaceService; + +@Service +public class SpecialPlaceImpl implements SpecialPlaceService { + + @Resource + private SpecialPlaceMapper specialPlaceMapper; + + + @Override + public SpecialPlace selectByPrimaryKey(Long id) { + return specialPlaceMapper.selectByPrimaryKey(id); + } + + + @Override + public void saveObject(SpecialPlace record) throws SpecialPlaceException, Exception{ + + String placeName = record.getName(); + if (placeName == null || placeName.trim().length() == 0) { + throw new SpecialPlaceException(1, "浣嶇疆鍚嶇О涓嶈兘涓虹┖"); + } + + String key = record.getKey(); + if (key == null || key.trim().length() == 0) { + throw new SpecialPlaceException(1, "浣嶇疆鏍囪瘑涓嶈兘涓虹┖"); + } + + Long id = record.getId(); + if (id == null) { + record.setCreateTime(new Date()); + record.setUpdateTime(new Date()); + specialPlaceMapper.insert(record); + } else { + // 淇敼 + SpecialPlace resultObj = specialPlaceMapper.selectByPrimaryKey(id); + if (resultObj == null) { + throw new SpecialPlaceException(1, "淇敼鍐呭宸蹭笉瀛樺湪"); + } + + record.setCreateTime(resultObj.getCreateTime()); + record.setUpdateTime(new Date()); + specialPlaceMapper.updateByPrimaryKey(record); + } + } + + + @Override + @Transactional(rollbackFor=Exception.class) + public int deleteByPrimaryKeyList(List<Long> list) throws Exception{ + return specialPlaceMapper.deleteByPrimaryKeyList(list); + } + + + + @Override + public List<SpecialPlace> listQuery(long start, int count, String key) throws Exception { + return specialPlaceMapper.listQuery(start, count, key); + } + + + @Override + public long countQuery(String key) { + return specialPlaceMapper.countQuery(key); + } + + @Override + public List<SpecialPlace> getEffectiveList() { + return specialPlaceMapper.getAll(); + } + +} + -- Gitblit v1.8.0