|
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.pavis.app.saasbacken.dao.TaxInfoMapper;
|
|
|
import com.pavis.app.saasbacken.entity.TaxInfo;
|
|
|
import com.pavis.app.saasbacken.service.TaxInfoService;
|
|
|
+import com.pavis.app.saasbacken.utils.CommonUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -25,6 +26,26 @@ public class TaxInfoServiceImpl extends ServiceImpl<TaxInfoMapper, TaxInfo> impl
|
|
|
@Autowired
|
|
|
private TaxInfoMapper taxInfoMapper;
|
|
|
|
|
|
+ @Override
|
|
|
+ public TaxInfo dealTax(Integer year, Double annualRevenue, Double rdDeductible, String orgId) {
|
|
|
+ List<TaxInfo> selTaxInfos = taxInfoMapper.selectList(new QueryWrapper<TaxInfo>().lambda()
|
|
|
+ .eq(TaxInfo::getEnterpriseId,orgId).eq(TaxInfo::getTaxYear,year));
|
|
|
+ TaxInfo taxInfo;
|
|
|
+ List<TaxInfo> taxInfos = new ArrayList<>();
|
|
|
+ if (selTaxInfos.size() > 0){
|
|
|
+ // 已存在税务数据信息。
|
|
|
+ taxInfo = TaxInfo.builder().id(selTaxInfos.get(0).getId())
|
|
|
+ .enterpriseId(orgId).taxYear(year).annualRevenue(annualRevenue).rdDeductible(rdDeductible).build();
|
|
|
+ taxInfos.add(taxInfo);
|
|
|
+ }else {
|
|
|
+ // 企业税务数据不存在。
|
|
|
+ taxInfo = TaxInfo.builder().id(CommonUtils.initId())
|
|
|
+ .enterpriseId(orgId).taxYear(year).annualRevenue(annualRevenue).rdDeductible(rdDeductible).build();
|
|
|
+ taxInfos.add(taxInfo);
|
|
|
+ }
|
|
|
+ return taxInfo;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<TaxInfo> dealTaxInfo(List<TaxInfo> addTaxInfos, String orgId) {
|
|
|
List<TaxInfo> taxInfos = new ArrayList<>();
|