|
@@ -19,6 +19,7 @@ import javax.annotation.Resource;
|
|
|
|
|
|
/**
|
|
|
* 二手商品Service
|
|
|
+ *
|
|
|
* @author admin
|
|
|
* @version 2020-07-15
|
|
|
*/
|
|
@@ -26,94 +27,97 @@ import javax.annotation.Resource;
|
|
|
@Transactional(readOnly = true)
|
|
|
public class CmSecondHandDetailService extends CrudService<CmSecondHandDetailDao, CmSecondHandDetail> {
|
|
|
|
|
|
-@Resource
|
|
|
-private CmSecondHandDetailDao cmSecondHandDetailDao;
|
|
|
-@Resource
|
|
|
-private ProductDao productDao;
|
|
|
-
|
|
|
- public CmSecondHandDetail get(String id) {
|
|
|
- return super.get(id);
|
|
|
- }
|
|
|
-
|
|
|
- public List<CmSecondHandDetail> findList(CmSecondHandDetail cmSecondHandDetail) {
|
|
|
- return super.findList(cmSecondHandDetail);
|
|
|
- }
|
|
|
-
|
|
|
- public Page<CmSecondHandDetail> findPage(Page<CmSecondHandDetail> page, CmSecondHandDetail cmSecondHandDetail) {
|
|
|
- return super.findPage(page, cmSecondHandDetail);
|
|
|
- }
|
|
|
-
|
|
|
- @Transactional(readOnly = false)
|
|
|
- public void save(CmSecondHandDetail cmSecondHandDetail) {
|
|
|
- super.save(cmSecondHandDetail);
|
|
|
- }
|
|
|
-
|
|
|
- @Transactional(readOnly = false)
|
|
|
- public void delete(CmSecondHandDetail cmSecondHandDetail) {
|
|
|
- super.delete(cmSecondHandDetail);
|
|
|
- }
|
|
|
-
|
|
|
- @Transactional(readOnly = false)
|
|
|
- public void updateRevieweInfo(Date reviewedDate, Date onLineDate,Integer productID){
|
|
|
- cmSecondHandDetailDao.updateRevieweInfo(reviewedDate,onLineDate,productID);
|
|
|
- }
|
|
|
-
|
|
|
- @Transactional(readOnly = false)
|
|
|
- public void updateOnLineDate(Date date,Integer productID) {
|
|
|
- cmSecondHandDetailDao.updateOnLineDate(date,productID);
|
|
|
- }
|
|
|
-
|
|
|
- @Transactional(readOnly = false)
|
|
|
- public void saveProduct(Product product) {
|
|
|
- Integer productID = product.getProductID();
|
|
|
- if(null != productID){
|
|
|
- // 更新
|
|
|
- productDao.updateByPrimaryKeySelective(product);
|
|
|
- }else{
|
|
|
- // 插入
|
|
|
- productDao.insertProduct(product);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Transactional(readOnly = false)
|
|
|
- public void updatSecondHnadproductSold(Integer productID) {
|
|
|
- cmSecondHandDetailDao.updatSecondHnadproductSold(productID);
|
|
|
- }
|
|
|
-
|
|
|
- @Transactional(readOnly = false)
|
|
|
- public void saveFileType(Integer productId, String secondId, List<String> fileTypes) {
|
|
|
- cmSecondHandDetailDao.deleteFileType(productId);
|
|
|
- for (String fileType : fileTypes) {
|
|
|
- cmSecondHandDetailDao.insertFileType(productId,secondId,fileType);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public void setValue(CmSecondHandDetail cmSecondHandDetail) {
|
|
|
- Integer productID = cmSecondHandDetail.getProductID();
|
|
|
- CmSecondHandDetail value = cmSecondHandDetailDao.findValue(productID);
|
|
|
- if(null!=value){
|
|
|
- if(StringUtils.isNoneBlank(value.getAuthenticationBackImage())){
|
|
|
- cmSecondHandDetail.setAuthenticationBackImage(value.getAuthenticationBackImage());
|
|
|
- }
|
|
|
- if(null!=value.getPublishIdentity()){
|
|
|
- cmSecondHandDetail.setPublishIdentity(value.getPublishIdentity());
|
|
|
- }
|
|
|
- if(StringUtils.isNotBlank(value.getLicenseImage())){
|
|
|
- cmSecondHandDetail.setLicenseImage(value.getLicenseImage());
|
|
|
- }
|
|
|
- List<Integer> flieTypes = cmSecondHandDetailDao.findFlieTypes(productID);
|
|
|
- if(null!=flieTypes&&flieTypes.size()>0){
|
|
|
- cmSecondHandDetail.setFileTypes(flieTypes);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ @Resource
|
|
|
+ private CmSecondHandDetailDao cmSecondHandDetailDao;
|
|
|
+ @Resource
|
|
|
+ private ProductDao productDao;
|
|
|
+
|
|
|
+ public CmSecondHandDetail get(String id) {
|
|
|
+ return super.get(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<CmSecondHandDetail> findList(CmSecondHandDetail cmSecondHandDetail) {
|
|
|
+ return super.findList(cmSecondHandDetail);
|
|
|
+ }
|
|
|
+
|
|
|
+ public Page<CmSecondHandDetail> findPage(Page<CmSecondHandDetail> page, CmSecondHandDetail cmSecondHandDetail) {
|
|
|
+ return super.findPage(page, cmSecondHandDetail);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void save(CmSecondHandDetail cmSecondHandDetail) {
|
|
|
+ super.save(cmSecondHandDetail);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void delete(CmSecondHandDetail cmSecondHandDetail) {
|
|
|
+ super.delete(cmSecondHandDetail);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void updateRevieweInfo(Date reviewedDate, Date onLineDate, Integer productID) {
|
|
|
+ cmSecondHandDetailDao.updateRevieweInfo(reviewedDate, onLineDate, productID);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void updateOnLineDate(Date date, Integer productID) {
|
|
|
+ cmSecondHandDetailDao.updateOnLineDate(date, productID);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void saveProduct(Product product) {
|
|
|
+ Integer productID = product.getProductID();
|
|
|
+ if (null != productID) {
|
|
|
+ // 更新
|
|
|
+ productDao.updateByPrimaryKeySelective(product);
|
|
|
+ } else {
|
|
|
+ // 插入
|
|
|
+ productDao.insertProduct(product);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void updatSecondHnadproductSold(Integer productID) {
|
|
|
+ cmSecondHandDetailDao.updatSecondHnadproductSold(productID);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void saveFileType(Integer productId, String secondId, List<String> fileTypes) {
|
|
|
+ cmSecondHandDetailDao.deleteFileType(productId);
|
|
|
+ for (String fileType : fileTypes) {
|
|
|
+ cmSecondHandDetailDao.insertFileType(productId, secondId, fileType);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setValue(CmSecondHandDetail cmSecondHandDetail) {
|
|
|
+ Integer productID = cmSecondHandDetail.getProductID();
|
|
|
+ CmSecondHandDetail value = cmSecondHandDetailDao.findValue(productID);
|
|
|
+ if (null != value) {
|
|
|
+ if (StringUtils.isNoneBlank(value.getAuthenticationBackImage())) {
|
|
|
+ cmSecondHandDetail.setAuthenticationBackImage(value.getAuthenticationBackImage());
|
|
|
+ }
|
|
|
+ if (null != value.getPublishIdentity()) {
|
|
|
+ cmSecondHandDetail.setPublishIdentity(value.getPublishIdentity());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(value.getLicenseImage())) {
|
|
|
+ cmSecondHandDetail.setLicenseImage(value.getLicenseImage());
|
|
|
+ }
|
|
|
+ List<Integer> flieTypes = cmSecondHandDetailDao.findFlieTypes(productID);
|
|
|
+ if (null != flieTypes && flieTypes.size() > 0) {
|
|
|
+ cmSecondHandDetail.setFileTypes(flieTypes);
|
|
|
+ }
|
|
|
+ if (null != value.getCardNumber()) {
|
|
|
+ cmSecondHandDetail.setCardNumber(value.getCardNumber());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
public Integer findSecondShop(String cardNumber) {
|
|
|
- return cmSecondHandDetailDao.findShopId(cardNumber);
|
|
|
+ return cmSecondHandDetailDao.findShopId(cardNumber);
|
|
|
}
|
|
|
|
|
|
- @Transactional(readOnly = false)
|
|
|
- public void insertShop(Shop shopVo) {
|
|
|
- cmSecondHandDetailDao.insertShop(shopVo);
|
|
|
- }
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void insertShop(Shop shopVo) {
|
|
|
+ cmSecondHandDetailDao.insertShop(shopVo);
|
|
|
+ }
|
|
|
}
|