Merge branch 'test' of http://192.168.12.182/invoice/pt into release

release
gaorl 2 years ago
commit f792cedeff
  1. 10
      dxhy-base/src/main/java/com/dxhy/base/service/fpxxrz/BaseRzFpxxServiceImpl.java
  2. 5
      dxhy-base/src/main/java/com/dxhy/base/service/tdxrecordinvoice/BaseFpdrrzServiceImpl.java
  3. 1
      dxhy-common/src/main/java/com/dxhy/common/service/impl/DictdetaServciceImpl.java
  4. 29
      dxhy-core/src/main/java/com/dxhy/core/thread/FpcjhzExportThread.java
  5. 24
      dxhy-core/src/main/java/com/dxhy/core/thread/PoolAddTaxThread.java
  6. 23
      dxhy-core/src/main/java/com/dxhy/core/thread/PoolSaleThread.java
  7. 48
      dxhy-core/src/main/resources/mapper/ExtPaperMapper.xml
  8. 1
      dxhy-core/src/main/resources/mapper/FpZhMapper.xml
  9. 39
      dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtInvoicePoolController.java
  10. 44
      dxhy-extend/src/main/resources/mapper/ExtInvoicePoolMapper.xml
  11. 22
      dxhy-extend/src/main/resources/mapper/ExtJxssbbMapper.xml

@ -72,6 +72,7 @@ public class BaseRzFpxxServiceImpl extends MpBaseServiceImpl<BaseFpxxZhDao, Base
orgList.add(t.getTaxno());
}
}
log.info("orgList======>{}",orgList);
if (gfshList.size() == 0) {
// 未从getUserInfo()获取到购方税号信息
@ -124,11 +125,9 @@ public class BaseRzFpxxServiceImpl extends MpBaseServiceImpl<BaseFpxxZhDao, Base
for (int i = 0; i < pageList.size(); i++) {
pageList.get(i).setSelect(false);
String taxno = pageList.get(i).getGfsh();
// if (orgList.contains(taxno) && "1".equals(pageList.get(i).getRzzt())) {
// pageList.get(i).setSelect(true);
// }
if ("0".equals(pageList.get(i).getRzzt())) {
if (orgList.contains(taxno) && "1".equals(pageList.get(i).getRzzt())) {
pageList.get(i).setSelect(true);
log.info("rzzt和orgList设置成true");
}
String skssq = pageList.get(i).getSkssq();
QueryWrapper<BaseTDxTaxCurrent> queryWrapper = new QueryWrapper<>();
@ -138,6 +137,7 @@ public class BaseRzFpxxServiceImpl extends MpBaseServiceImpl<BaseFpxxZhDao, Base
if (!taxCurrent.getCurrentTaxPeriod().equals(skssq)
|| !"1".equals(pageList.get(i).getRzzt())) {
pageList.get(i).setSelect(false);
log.info("skssq设置为false");
}
}
@ -155,6 +155,7 @@ public class BaseRzFpxxServiceImpl extends MpBaseServiceImpl<BaseFpxxZhDao, Base
if (!"0".equals(pageList.get(i).getCxrzStatus())
&& !"5".equals(pageList.get(i).getCxrzStatus())) {
pageList.get(i).setSelect(false);
log.info("撤销认证状态设置false");
}
String sign = (String) pramsMap.get("sign");
if (!"88".equals(sign)){
@ -166,6 +167,7 @@ public class BaseRzFpxxServiceImpl extends MpBaseServiceImpl<BaseFpxxZhDao, Base
if ("1".equals(pageList.get(i).getOutStatus()) || "2".equals(pageList.get(i).getOutStatus())) {
pageList.get(i).setSelect(false);
log.info("转出状态设置false");
}
// 字典转换

@ -81,12 +81,14 @@ public class BaseFpdrrzServiceImpl extends MpBaseServiceImpl<BaseFpdrrzDao, Base
String fphm = jsonObject.getString("invoiceNo");
String kprq = jsonObject.getString("invoiceDate");
String se = jsonObject.getString("taxAmount");
String dkse1 = jsonObject.getString("taxAmount");
BaseFpdrrzRespVO rzlb = new BaseFpdrrzRespVO();
rzlb.setSelect(true);
rzlb.setXh(String.valueOf(i + 1));
rzlb.setBkrzts("");
rzlb.setFpdm(fpdm);
rzlb.setFphm(fphm);
rzlb.setDkse(dkse1);
if (fphm.length() == 20) {
rzlb.setFpdm(fphm.substring(0, 12));
rzlb.setFphm(fphm.substring(12, 20));
@ -144,6 +146,9 @@ public class BaseFpdrrzServiceImpl extends MpBaseServiceImpl<BaseFpdrrzDao, Base
QueryWrapper<BaseTDxRecordInvoice> queryRecord = new QueryWrapper<>();
queryRecord.eq("uuid", uuid);
BaseTDxRecordInvoice rdxRecordInvoice = baseTDxRecordInvoiceDao.selectOne(queryRecord);
if (rdxRecordInvoice.getDkTaxAmount() != null && StringHelper.isNotBlank(rdxRecordInvoice.getDkTaxAmount().toPlainString())){
rzlb.setDkse(rdxRecordInvoice.getDkTaxAmount().toPlainString());
}
if (rdxRecordInvoice != null) {
if (list == null || list.size() == 0 || !list.contains(rdxRecordInvoice.getGfTaxNo())) {
rzlb.setBkrzts("无该发票购方税号权限");

@ -34,7 +34,6 @@ public class DictdetaServciceImpl implements DictdetaServcice {
@Override
public String queryDictName(String type,String code) {
log.info("type={},code={}",type,code);
String dictJson = redisUtils.get(RedisConstant.KEY_DICT + type);
List<DictdetaModel> dictdetaModels = JSON.parseArray(dictJson, DictdetaModel.class);
Map<String, String> collect = dictdetaModels.stream().collect(Collectors.toMap(DictdetaModel::getDictcode, DictdetaModel::getDictname));

@ -169,14 +169,18 @@ public class FpcjhzExportThread extends BaseThread {
excelFile.append(ftpFileName.toString());
// 递归导出数据到excel
this.cicleExport(pramsMap, default_curr, excelFile.toString(), jsonObject);
// FTP文件存储路径
String[] toDay = DateUtil.today().split("-");
String ftpFilePath = fileService.getPathPrefix() + userName + "/" + "excelFile/" + toDay[0] + "/"
+ toDay[1] + "/" + toDay[2] + "/" + ftpFileName.toString();
// 文件上传ftp
fileService.uploadFile(ftpFilePath, excelFile.toString());
String ftpFilePath = "";
String rtnMsg = this.cicleExport(pramsMap, default_curr, excelFile.toString(), jsonObject);
if("ok".equals(rtnMsg)) {
// FTP文件存储路径
String[] toDay = DateUtil.today().split("-");
ftpFilePath = fileService.getPathPrefix() + userName + "/" + "excelFile/" + toDay[0] + "/"
+ toDay[1] + "/" + toDay[2] + "/" + ftpFileName.toString();
// 文件上传ftp
fileService.uploadFile(ftpFilePath, excelFile.toString());
}else{
ftpFilePath = rtnMsg;
}
// 设置成功消息内容
msg.put("title", super.getSuccTitle(title));
@ -222,12 +226,15 @@ public class FpcjhzExportThread extends BaseThread {
*
*/
private boolean cicleExport(Map<String, Object> pramsMap, int curr, String excelFile, JSONObject jsonObject)
private String cicleExport(Map<String, Object> pramsMap, int curr, String excelFile, JSONObject jsonObject)
throws Exception {
// 查询指定页数的数据
JSONObject pageData = fpcjService.selectByGfshAndCjrq(pramsMap, curr, default_size);
boolean hasNext = pageData.getBooleanValue("hasNext");
List<FpcjCjhzRespVO> dataList = (List<FpcjCjhzRespVO>)pageData.get("datalist");
if(dataList.size() > 5000){
return "数据不能超过5000条";
}
boolean firstPage = false;
if (curr == default_curr) {
@ -243,7 +250,7 @@ public class FpcjhzExportThread extends BaseThread {
// 写入当前页数据
ExcelPoiUtil.exportListArrayToExcel1(excelFile, title, jsonObject, dataList, firstPage, false);
// 更新页数
return cicleExport(pramsMap, nextPage, excelFile, jsonObject);
cicleExport(pramsMap, nextPage, excelFile, jsonObject);
} else {
// 写入最后一页数据
FpcjCjhzRespVO vo = new FpcjCjhzRespVO();
@ -253,7 +260,7 @@ public class FpcjhzExportThread extends BaseThread {
vo.setSe(hjse);
dataList.add(vo);
ExcelPoiUtil.exportListArrayToExcel1(excelFile, title, jsonObject, dataList, firstPage, true);
return hasNext;
}
return "ok";
}
}

@ -181,6 +181,12 @@ public class PoolAddTaxThread extends BaseThread {
} else {
pramsMap.put("gfsh", gfshList);
}
boolean flag = checkList(gfshList);
if (flag){
pramsMap.put("sign","88");
log.info("登陆账号无税号");
}
if (cjksyf != null && !"".equals(cjksyf)) {
pramsMap.put("cjksyf", DateUtils.getMorning(DateUtils.strToDate(cjksyf)));
}
@ -468,4 +474,22 @@ public class PoolAddTaxThread extends BaseThread {
return filePath.toString();
}
public boolean checkList(List<String> list) {
boolean flag =false;
if (list == null || list.isEmpty()){
flag = true;
}else {
String s = list.toString().replace("[","").replace("]","");
if (StringHelper.isBlank(s)){
flag = true;
}
if (StringHelper.isNotBlank(s) && s.contains(",")){
String replace = s.replace(",", "");
if (StringHelper.isBlank(replace)){
flag = true;
}
}
}
return flag;
}
}

@ -186,6 +186,11 @@ public class PoolSaleThread extends BaseThread {
} else {
pramsMap.put("gfsh", gfshList);
}
boolean flag = checkList(gfshList);
if (flag){
pramsMap.put("sign","88");
log.info("登陆账号无税号");
}
if (cjksyf != null && !"".equals(cjksyf)) {
pramsMap.put("cjksyf", DateUtils.getMorning(DateUtils.strToDate(cjksyf)));
}
@ -468,4 +473,22 @@ public class PoolSaleThread extends BaseThread {
return filePath.toString();
}
public boolean checkList(List<String> list) {
boolean flag =false;
if (list == null || list.isEmpty()){
flag = true;
}else {
String s = list.toString().replace("[","").replace("]","");
if (StringHelper.isBlank(s)){
flag = true;
}
if (StringHelper.isNotBlank(s) && s.contains(",")){
String replace = s.replace(",", "");
if (StringHelper.isBlank(replace)){
flag = true;
}
}
}
return flag;
}
}

@ -293,10 +293,13 @@
like
CONCAT('%',#{keyWord},'%')
</if>
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="sign != '88'">
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
and t.invoice_type = #{invoiceType}
</if>
@ -400,10 +403,13 @@
like
CONCAT('%',#{keyWord},'%')
</if>
and t.xf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="sign != '88'">
and t.xf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
and t.invoice_type = #{invoiceType}
</if>
@ -547,7 +553,7 @@
from
${dxhyTertiary}.t_dx_record_invoice t
left JOIN ${dxhyDetail}.t_dx_record_invoice_detail b ON t.uuid = b.uuid
where t.detail_yesorno = '1'
where '1' = '1'
<if test="cjksyf != null and cjksyf!= '' and cjjsyf != null and cjjsyf != ''">
AND t.create_date BETWEEN #{cjksyf} and #{cjjsyf}
</if>
@ -559,10 +565,13 @@
like
CONCAT('%',#{keyWord},'%')
</if>
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="sign != '88'">
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
and t.invoice_type = #{invoiceType}
</if>
@ -657,7 +666,7 @@
from
${dxhyTertiary}.t_dx_sale_record_invoice t
left JOIN ${dxhyDetail}.t_dx_record_invoice_detail_sales b ON t.uuid = b.uuid
where t.detail_yesorno = '1'
where 1 = 1
<if test="cjksyf != null and cjksyf!= '' and cjjsyf != null and cjjsyf != ''">
AND t.create_date between #{cjksyf} and #{cjjsyf}
</if>
@ -669,10 +678,13 @@
like
CONCAT('%',#{keyWord},'%')
</if>
and t.xf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="sign != '88'">
and t.xf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
and t.invoice_type = #{invoiceType}
</if>

@ -100,7 +100,6 @@
and t.bdk_status in ('1','2')
and t.export_mark = '0'
and t.auth_status != '0'
and t.rzh_yesorno != '0'
and t.company = #{company}
<if test="sign !='88'">
and t.gf_tax_no in

@ -66,9 +66,14 @@ public class ExtInvoicePoolController extends AbstractController {
// }
// }
gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg());
if (gfshList.size() == 0) {
return ResponseEntity.ok(R.ok().put("data", ""));
boolean flag = checkList(gfshList);
if (flag){
pramsMap.put("sign","88");
log.info("登陆账号无税号");
}
// if (gfshList.size() == 0) {
// return ResponseEntity.ok(R.ok().put("data", ""));
// }
pramsMap.put("gfsh", gfshList);
if (pramsMap.get("cjksyf") != null && !"".equals(pramsMap.get("cjksyf"))) {
pramsMap.put("cjksyf", DateUtils.getMorning(DateUtils.strToDate(pramsMap.get("cjksyf").toString())));
@ -219,10 +224,16 @@ public class ExtInvoicePoolController extends AbstractController {
// return ResponseEntity.ok(R.ok().put("data", ""));
// }
// }
gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg());
if (gfshList.size() == 0) {
return ResponseEntity.ok(R.ok().put("data", ""));
}
boolean flag = checkList(gfshList);
if (flag){
pramsMap.put("sign","88");
log.info("登陆账号无税号");
}
// if (gfshList.size() == 0) {
// return ResponseEntity.ok(R.ok().put("data", ""));
// }
pramsMap.put("taxno", gfshList);
if (pramsMap.get("cjksyf") != null && !"".equals(pramsMap.get("cjksyf"))) {
pramsMap.put("cjksyf", DateUtils.getMorning(DateUtils.strToDate(pramsMap.get("cjksyf").toString())));
@ -327,4 +338,22 @@ public class ExtInvoicePoolController extends AbstractController {
System.out.println(replace);
}
}
public boolean checkList(List<String> list) {
boolean flag =false;
if (list == null || list.isEmpty()){
flag = true;
}else {
String s = list.toString().replace("[","").replace("]","");
if (StringHelper.isBlank(s)){
flag = true;
}
if (StringHelper.isNotBlank(s) && s.contains(",")){
String replace = s.replace(",", "");
if (StringHelper.isBlank(replace)){
flag = true;
}
}
}
return flag;
}
}

@ -69,10 +69,13 @@
like
CONCAT('%',#{keyWord},'%')
</if>
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="sign != '88'">
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
and t.invoice_type = #{invoiceType}
</if>
@ -218,10 +221,13 @@
like
CONCAT('%',#{keyWord},'%')
</if>
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="sign != '88'">
and t.gf_tax_no in
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
and t.invoice_type = #{invoiceType}
</if>
@ -506,10 +512,13 @@
like
CONCAT('%',#{keyWord},'%')
</if>
and t.xf_tax_no in
<foreach collection="taxno" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="sign != '88'">
and t.xf_tax_no in
<foreach collection="taxno" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if
test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
and t.invoice_type = #{invoiceType}
@ -617,10 +626,13 @@
like
CONCAT('%',#{keyWord},'%')
</if>
and t.xf_tax_no in
<foreach collection="taxno" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
<if test="sign != '88'">
and t.xf_tax_no in
<foreach collection="taxno" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if
test="invoiceType != null and invoiceType != '' and invoiceType != 'null' and invoiceType != '99' ">
and t.invoice_type = #{invoiceType}

@ -13,8 +13,10 @@
select count(1) totalCount, ifnull(sum(invoice_amount), 0) totalAmount,
ifnull(sum(dk_tax_amount), 0) totalTax
FROM t_dx_record_invoice
WHERE valid='1' and invoice_type in ('01','03','08','14') AND invoice_status='0' AND
rzh_yesorno='1'
WHERE valid='1'
and (invoice_type in('01','03','08','14','31','283','161','183','185') or (invoice_type ='32' and t.lq_tdyslxDm='08'))
AND invoice_status='0'
AND rzh_yesorno='1'
<if test="skssq !=null and skssq != ''">
and rzh_belong_date = #{skssq}
</if>
@ -54,9 +56,11 @@
<select id="getTotalOutTax" resultType="Double" databaseId="mysql">
SELECT ifnull(sum(out_tax_amount), 0) FROM t_dx_record_invoice
WHERE valid='1' and invoice_type in ('01','03','08','14') AND invoice_status='0' AND
rzh_yesorno='1' AND
out_status in ('1','2')
WHERE valid='1'
and (invoice_type in('01','03','08','14','31','283','161','183','185') or (invoice_type ='32' and t.lq_tdyslxDm='08'))
AND invoice_status='0'
AND rzh_yesorno='1'
AND out_status in ('1','2')
<if test="skssq !=null and skssq != ''">
and out_belong_date = #{skssq}
</if>
@ -69,9 +73,11 @@
out_reason rzhDate,
ifnull(sum(out_tax_amount), 0) tax
FROM t_dx_record_invoice
WHERE valid='1' and invoice_type in ('01','03','08','14') AND invoice_status='0' AND
rzh_yesorno='1' AND
out_status in ('1','2')
WHERE valid='1'
and (invoice_type in('01','03','08','14','31','283','161','183','185') or (invoice_type ='32' and t.lq_tdyslxDm='08'))
AND invoice_status='0'
AND rzh_yesorno='1'
AND out_status in ('1','2')
<if test="skssq !=null and skssq != ''">
and out_belong_date = #{skssq}
</if>

Loading…
Cancel
Save