|
@@ -7,6 +7,7 @@ import com.ssj.framework.core.persistence.DynamicSpecifications;
|
|
|
import com.ssj.framework.core.persistence.SearchFilter;
|
|
|
import com.ssj.framework.idworker.IdWorker;
|
|
|
import com.ssj.service.weixin.sales.service.LibBorrowedServiceService;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
@@ -15,7 +16,9 @@ import org.springframework.data.repository.PagingAndSortingRepository;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -45,13 +48,17 @@ public class LibBorrowedServiceServiceImpl extends BaseServiceImpl<LibBorrowedSe
|
|
|
public void insertBorrowedService(String libId,Integer libType) {
|
|
|
Integer count=libBorrowedServiceDao.getLibCount(libId);
|
|
|
if(count==0){
|
|
|
- String id = IdWorker.generateId();
|
|
|
- if(libType == 1){
|
|
|
- libBorrowedServiceDao.insertBorrowedService(libId,"SSJ",id);
|
|
|
- }else{
|
|
|
- libBorrowedServiceDao.insertBorrowedService(libId,"SSJGx",id);//共享
|
|
|
- }
|
|
|
-
|
|
|
+ String addType = libType==1?"SSJ":"SSJGx";
|
|
|
+ List<LibBorrowedService> list = libBorrowedServiceDao.findListByAddType(addType);
|
|
|
+ if(Objects.nonNull(list) && list.size()>0){
|
|
|
+ for (LibBorrowedService libBorrowedService:list){
|
|
|
+ LibBorrowedService vo = new LibBorrowedService();
|
|
|
+ BeanUtils.copyProperties(libBorrowedService,vo);
|
|
|
+ vo.setId(IdWorker.generateId());
|
|
|
+ vo.setLibId(libId);
|
|
|
+ this.save(vo);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|