ariesy 增加税率字段,补充表中数据

release
yefei 2 years ago
parent 672d71bc4d
commit 4316a17ffe
  1. 4
      dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java
  2. 13
      dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java
  3. 4
      dxhy-erp/src/main/java/com/dxhy/erp/dao/TdxRecordInvoiceDao.java
  4. 52
      dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java
  5. 2
      dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ReceiptOutServiceImpl.java
  6. 12
      dxhy-erp/src/main/resources/mapper/TdxRecordInvoiceDao.xml

@ -106,7 +106,9 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
String hjsl = "0";
String hjje = "0";
String hjse = "0";
long start = System.currentTimeMillis();
List<BaseTDxRecordInvoice> hjList = super.baseMapper.selectHj(pramsMap);
log.info("手工认证 查询合计信息耗时:{}",System.currentTimeMillis()-start);
BaseTDxRecordInvoice hjxx = hjList.get(0);
hjsl = hjxx.getSfygx();
if (!"0".equals(hjsl)) {
@ -124,7 +126,9 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx
}
PageHelper.startPage(curr, size);
long start1 = System.currentTimeMillis();
List<BaseTDxRecordInvoice> pageList = super.baseMapper.selectSggxcx(pramsMap);
log.info("手工认证 查询列表信息耗时:{}",System.currentTimeMillis()-start1);
PageInfo<BaseTDxRecordInvoice> pageInfo = new PageInfo<>(pageList);
log.info("返回的列表为:{}",pageList);

@ -1253,4 +1253,17 @@ public class SDNYMainProcessController extends AbstractController {
}
return ZCYJG;
}
/**
* 查验发票
*/
@PostMapping("/refresh")
@ResponseBody
@SysLog("发票查验")
public String refreshDetailData(@RequestBody Map<String, Integer> pramsMap) throws Exception {
log.info("接口请求的参数为:{}",pramsMap);
String result = snPushCheckRecordService.getRecords(pramsMap);
return result;
}
}

@ -185,4 +185,8 @@ public interface TdxRecordInvoiceDao extends BaseMapper<TdxRecordInvoice> {
void saveInvoiceAccount(TdxInvoiceAccount invoice);
void deleteByuuid(@Param("uuids") String[] uuids);
List<String> selectRecords(@Param("pramsMap") Map<String, Integer> pramsMap);
void updateTaxRate(@Param("pramsMap") Map<String, String> pramsMap);
}

@ -4,7 +4,9 @@ import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.dxhy.common.constant.DbConstant;
import com.dxhy.common.datasource.config.DynamicContextHolder;
import com.dxhy.common.enums.FplxEnum;
@ -40,6 +42,7 @@ import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* 与山东能源交互数据主类
@ -88,12 +91,18 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
@Resource
private TDxInvoiceReimburseDao invoiceReimburseDao;
@Resource
private TdxRecordInvoiceDao tdxRecordInvoiceDao;
@Resource
private BaseTDxRecordInvoiceDao baseTDxRecordInvoiceDao;
@Resource
private TDxInvoiceReimburseService tDxInvoiceReimburseService;
@Resource
private BaseTDxRecordInvoiceDetailDao baseTDxRecordInvoiceDetailDao;
@Resource
private SysDeptDao sysDeptDao;
@ -270,6 +279,49 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
return queryInvoiceResult;
}
public String getRecords(Map<String, Integer> pramsMap) {
QueryWrapper<TdxRecordInvoice> recordWrapper = new QueryWrapper<>();
List<String> uuids = tdxRecordInvoiceDao.selectRecords(pramsMap);
log.info("获取的uuid为{}",uuids);
for (String uuid: uuids) {
boolean flag = false;
QueryWrapper<BaseTDxRecordInvoiceDetail> detailWrapper = new QueryWrapper<>();
detailWrapper.eq("uuid", uuid);
DynamicContextHolder.push("business" + DbConstant.DETAIL_READ);
List<BaseTDxRecordInvoiceDetail> details = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper);
DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ);
log.info("获取到的明细为:{}",details);
String taxRate = "";
for(BaseTDxRecordInvoiceDetail detail : details){
//获取明细信息 更新主表税率
if(StringUtils.isNotEmpty(detail.getTaxRate())){
if(flag){
if(!taxRate.contains(detail.getTaxRate())) {
taxRate = taxRate + "," + detail.getTaxRate();
}
}else{
if(!taxRate.contains(detail.getTaxRate())) {
taxRate = taxRate + detail.getTaxRate();
}
flag = true;
}
}
}
log.info("taxRate={}",taxRate);
Map<String, String> pramsUpdate = new HashMap<>();
pramsUpdate.put("taxRate",taxRate);
pramsUpdate.put("uuid",uuid);
tdxRecordInvoiceDao.updateTaxRate(pramsUpdate);
}
return "ok";
}
public JSONObject singleCheckInvoice(Map<String, String> pramsMap) throws Exception {
//1.封装查验参数

@ -71,7 +71,7 @@ public class ReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutDao,
List<BaseTDxRecordInvoice> condList = setPartInvoiceByType(invoices, condVO, userInfo);
List<BaseTDxRecordInvoiceOut> outList = new ArrayList<>();
// fourth:对比流水明细,区分底账表list中需要update或者insert数据
// fourth:对比流水明细,区分底账表list中需要update或者insert数据
invoices.forEach(invoice -> {
BaseTDxRecordInvoiceOut e = new BaseTDxRecordInvoiceOut();
if (outMap.containsKey(invoice.getUuid())) {

@ -688,5 +688,17 @@
</select>
<select id="selectRecords" resultType="java.lang.String">
select t.uuid
from t_dx_record_invoice t
limit #{pramsMap.start},#{pramsMap.num}
</select>
<update id="updateTaxRate" parameterType="java.util.Map">
update t_dx_record_invoice
set tax_rate = #{taxRate}
where uuid = #{uuid}
</update>
</mapper>

Loading…
Cancel
Save