|
|
@ -22,14 +22,15 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
|
import com.epmet.dao.stats.CustomerProjectCategoryDictDao; |
|
|
|
import com.epmet.dto.screen.CategoryDictDataFormDTO; |
|
|
|
import com.epmet.dto.screen.form.CategoryDictFormDTO; |
|
|
|
import com.epmet.dto.screencoll.ScreenCollFormDTO; |
|
|
|
import com.epmet.entity.issue.IssueProjectCategoryDictEntity; |
|
|
|
import com.epmet.entity.stats.CustomerProjectCategoryDictEntity; |
|
|
|
import com.epmet.service.stats.CustomerProjectCategoryDictService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
@ -97,18 +98,19 @@ public class CustomerProjectCategoryDictServiceImpl extends BaseServiceImpl<Cust |
|
|
|
return baseDao.getLatestUpdatedEntity(); |
|
|
|
} |
|
|
|
|
|
|
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX) |
|
|
|
|
|
|
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void uploadCategoryDict(String customerId, CategoryDictDataFormDTO formDTO) { |
|
|
|
public void uploadCategoryDict(ScreenCollFormDTO<CategoryDictFormDTO> formDTO) { |
|
|
|
if (formDTO.getIsFirst()) { |
|
|
|
int deleteNum; |
|
|
|
do { |
|
|
|
deleteNum = baseDao.deleteCustomerProjectCategoryDict(customerId); |
|
|
|
deleteNum = baseDao.deleteCustomerProjectCategoryDict(formDTO.getCustomerId()); |
|
|
|
} while (deleteNum > NumConstant.ZERO); |
|
|
|
} |
|
|
|
if (!CollectionUtils.isEmpty(formDTO.getDataList())) { |
|
|
|
baseDao.batchInsertCustomerProjectCategoryDict(formDTO.getDataList(), customerId); |
|
|
|
baseDao.batchInsertCustomerProjectCategoryDict(formDTO.getDataList(), formDTO.getCustomerId()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|