Merge branch '0609-税率筛选' of http://192.168.12.182/invoice/pt into test

 Conflicts:
	dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java
release
yefei 2 years ago
commit 2681d6b7c0
  1. 13
      dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java
  2. 4
      dxhy-erp/src/main/java/com/dxhy/erp/dao/TdxRecordInvoiceDao.java
  3. 51
      dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java
  4. 2
      dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ReceiptOutServiceImpl.java
  5. 12
      dxhy-erp/src/main/resources/mapper/TdxRecordInvoiceDao.xml

@ -1260,4 +1260,17 @@ public class SDNYMainProcessController extends AbstractController {
}
return ZCYJG;
}
/**
* 查验发票
*/
@PostMapping("/refresh")
@ResponseBody
@SysLog("发票查验")
public String refreshDetailData(@RequestBody Map<String, Object> 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, Object> 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,48 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
return queryInvoiceResult;
}
public String getRecords(Map<String, Object> pramsMap) {
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE);
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> updateParam = new HashMap<>();
updateParam.put("taxRate",taxRate);
updateParam.put("uuid",uuid);
tdxRecordInvoiceDao.updateTaxRate(updateParam);
}
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">
update t_dx_record_invoice
set tax_rate = #{pramsMap.taxRate}
where uuid = #{pramsMap.uuid}
</update>
</mapper>

Loading…
Cancel
Save