Merge branches '1007-认证人为空时设置成admin' and 'release' of http://192.168.12.182/invoice/pt into 1007-认证人为空时设置成admin

release
yefei 2 years ago
commit 0422bcf621
  1. 6
      dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java
  2. 445
      dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java
  3. 4
      dxhy-base/src/main/java/com/dxhy/base/model/BaseSggxCxRespVO.java
  4. 18
      dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml
  5. 24
      dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml
  6. 4
      dxhy-core/pom.xml
  7. 33
      dxhy-core/src/main/java/com/dxhy/core/config/RedissionConfig.java
  8. 241
      dxhy-core/src/main/java/com/dxhy/core/job/service/impl/InvoiceInterfaceServiceImpl.java
  9. 76
      dxhy-core/src/main/java/com/dxhy/core/task/SdnyClientTask.java
  10. 5
      dxhy-customs/src/main/java/com/dxhy/customs/service/impl/CustomsCustomsJkszhcxServiceImpl.java
  11. 39
      dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java
  12. 5
      dxhy-export-domestic/src/main/java/com/dxhy/domestic/service/count/impl/DomesticCustomsExportCountServiceImpl.java
  13. 5
      dxhy-export-domestic/src/main/java/com/dxhy/domestic/service/count/impl/DomesticInvoiceExportCountServiceImpl.java
  14. 7
      dxhy-extend/src/main/java/com/dxhy/extend/service/bb/impl/ExtFpzhcxServiceImpl.java

@ -160,8 +160,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
// 保存客户信息,更新企业税号
user.getUserOrgEntities().stream().forEach(userOrg -> {
if(StringUtils.isEmpty(userOrg.getTaxno())){
if(StringUtils.isNotEmpty(taxnos.get(userOrg.getDeptId()))) {
userOrg.setTaxno(taxnos.get(userOrg.getDeptId()));
String taxno = taxnos.get(String.valueOf(userOrg.getDeptId()));
log.info("销项同步税号为:taxno={}",taxno);
if(StringUtils.isNotEmpty(taxno)){
userOrg.setTaxno(taxno);
}
}
});

@ -51,7 +51,6 @@ import java.util.stream.Collectors;
public class BaseInvoiceController extends AbstractController {
/**
* 认证发票查询service
*
*/
@Resource
private BaseRzFpxxService baseRzFpxxService;
@ -107,7 +106,7 @@ public class BaseInvoiceController extends AbstractController {
private static final Pattern PATTERN_DATE = Pattern.compile(
"^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$");
"^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$");
private static final Pattern PATTERN_AMOUNT = Pattern.compile("^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?$");
/**
@ -119,45 +118,45 @@ public class BaseInvoiceController extends AbstractController {
@ResponseBody
@SysLog("调用发票认证综合查询入口接口")
public Object listRzFpxx(@RequestBody Map<String, Object> map) {
String gfsh = (String)map.get("gfsh");
String gfsh = (String) map.get("gfsh");
String companyCode = (String) map.get("companyCode");
if (StringUtils.isBlank(gfsh)||StringUtils.isBlank(companyCode)){
if (StringUtils.isBlank(gfsh) || StringUtils.isBlank(companyCode)) {
return ResponseEntity.ok(R.error(CommonConstants.GFSH_OR_COMPANYCODE_MISS));
}
String invoiceType = (String)map.get("invoiceType");
String invoiceSource = (String)map.get("invoiceSource");
String kpksrq = (String)map.get("kpksrq");
String kpjsrq = (String)map.get("kpjsrq");
String qszt = (String)map.get("qszt");
String rzzt = (String)map.get("rzzt");
String rzclzt = (String)map.get("rzclzt");
String rzlx = (String)map.get("rzlx");
String skssq = (String)map.get("skssq");
String qsfs = (String)map.get("qsfs");
String invoiceStatus = (String)map.get("invoiceStatus");
String qsksrq = (String)map.get("qsksrq");
String qsjsrq = (String)map.get("qsjsrq");
String rzksrq = (String)map.get("rzksrq");
String rzjsrq = (String)map.get("rzjsrq");
String invoiceNo = (String)map.get("invoiceNo");
String xfmc = (String)map.get("xfmc");
String businessCode = (String)map.get("businessCode");
String qsr = (String)map.get("qsr");
String rzhr = (String)map.get("rzhr");
String invoiceType = (String) map.get("invoiceType");
String invoiceSource = (String) map.get("invoiceSource");
String kpksrq = (String) map.get("kpksrq");
String kpjsrq = (String) map.get("kpjsrq");
String qszt = (String) map.get("qszt");
String rzzt = (String) map.get("rzzt");
String rzclzt = (String) map.get("rzclzt");
String rzlx = (String) map.get("rzlx");
String skssq = (String) map.get("skssq");
String qsfs = (String) map.get("qsfs");
String invoiceStatus = (String) map.get("invoiceStatus");
String qsksrq = (String) map.get("qsksrq");
String qsjsrq = (String) map.get("qsjsrq");
String rzksrq = (String) map.get("rzksrq");
String rzjsrq = (String) map.get("rzjsrq");
String invoiceNo = (String) map.get("invoiceNo");
String xfmc = (String) map.get("xfmc");
String businessCode = (String) map.get("businessCode");
String qsr = (String) map.get("qsr");
String rzhr = (String) map.get("rzhr");
// String sortPzbh = String.valueOf(map.get("sortPzbh"));
// String sortBzdh = String.valueOf(map.get("sortBzdh"));
// String sortKprq = String.valueOf(map.get("sortKprq"));
String taxRate = String.valueOf(map.get("taxRate"));
log.info("taxRate={}",taxRate);
String inAccountStatus = (String)map.get("inAccountStatus");
int curr = (int)map.get("curr");
int size = (int)map.get("size");
log.info("taxRate={}", taxRate);
String inAccountStatus = (String) map.get("inAccountStatus");
int curr = (int) map.get("curr");
int size = (int) map.get("size");
String bzdh = (String) map.get("bzdh");
String bzr = (String) map.get("bzr");
Map<String, Object> pramsMap = new HashMap<>(25);
pramsMap.put("bzdh", bzdh);
pramsMap.put("bzr",bzr);
pramsMap.put("bzr", bzr);
pramsMap.put("inAccountStatus", inAccountStatus);
pramsMap.put("qszt", map.get("qszt"));
pramsMap.put("wrzfpStart", map.get("wrzfpStart"));
@ -166,9 +165,9 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("postingTimeStart", map.get("postingTimeStart"));
pramsMap.put("postingTimeEnd", map.get("postingTimeEnd"));
if (map.get("accountPeriod") != null && !"".equals(map.get("accountPeriod"))) {
String accountPeriod = map.get("accountPeriod").toString().substring(0,7);
String accountPeriod = map.get("accountPeriod").toString().substring(0, 7);
pramsMap.put("accountPeriod", accountPeriod);
log.info("accountPeriod:{}",accountPeriod);
log.info("accountPeriod:{}", accountPeriod);
}
// pramsMap.put("accountPeriodStart", map.get("accountPeriodStart"));
// pramsMap.put("accountPeriodEnd", map.get("accountPeriodEnd"));
@ -195,9 +194,9 @@ public class BaseInvoiceController extends AbstractController {
}
if (!StringUtils.isBlank(invoiceNo)) {
if(invoiceNo.length()==8){
if (invoiceNo.length() == 8) {
pramsMap.put("invoiceNo", invoiceNo);
}else {
} else {
pramsMap.put("eleInvoiceNo", invoiceNo);
}
}
@ -206,13 +205,13 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("payment", map.get("payment"));
pramsMap.put("paymentStatus", map.get("paymentStatus"));
if(map.get("paymentDateStart") != null) {
if (map.get("paymentDateStart") != null) {
if (StringUtils.isNotEmpty(map.get("paymentDateStart").toString())) {
String paymentDateStart = DateUtils.getMorning(DateUtils.strToDate(map.get("paymentDateStart").toString()));
pramsMap.put("paymentDateStart", paymentDateStart);
}
}
if(map.get("paymentEnd") != null) {
if (map.get("paymentEnd") != null) {
if (StringUtils.isNotEmpty(map.get("paymentEnd").toString())) {
String paymentDateEnd = DateUtils.getNight(DateUtils.strToDate(map.get("paymentEnd").toString()));
pramsMap.put("paymentDateEnd", paymentDateEnd);
@ -225,13 +224,13 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("gfsh", gfsh);
pramsMap.put("companyCode",companyCode);
pramsMap.put("companyCode", companyCode);
if (StringUtils.isNotBlank(taxRate) && !"99".equals(taxRate)){
if (StringUtils.isNotBlank(taxRate) && !"99".equals(taxRate)) {
// List<String> rates = new ArrayList<>();
// rates = convertRates(taxRate,rates);
pramsMap.put("taxRate",taxRate);
pramsMap.put("taxRate", taxRate);
}
if (!StringHelper.isBlank(invoiceType)) {
@ -289,22 +288,22 @@ public class BaseInvoiceController extends AbstractController {
// 已认证传 认证起止日期和税款所属期做判断
if (!"99".equals(rzzt)) {
pramsMap.put("rzzt", rzzt);
if (!"0".equals(rzzt)) {
if (!StringHelper.isBlank(rzksrq)) {
rzksrq = DateUtils.getMorning(DateUtils.strToDate(rzksrq));
pramsMap.put("rzksrq", rzksrq);
} else {
return ResponseEntity.ok(R.error("认证开始日期不能为空!"));
}
if (!StringHelper.isBlank(rzjsrq)) {
rzjsrq = DateUtils.getNight(DateUtils.strToDate(rzjsrq));
pramsMap.put("rzjsrq", rzjsrq);
} else {
return ResponseEntity.ok(R.error("认证结束日期不能为空!"));
}
if (!StringHelper.isBlank(skssq)) {
pramsMap.put("skssq", skssq);
}
}
if (!"0".equals(rzzt)) {
if (!StringHelper.isBlank(rzksrq)) {
rzksrq = DateUtils.getMorning(DateUtils.strToDate(rzksrq));
pramsMap.put("rzksrq", rzksrq);
} else {
return ResponseEntity.ok(R.error("认证开始日期不能为空!"));
}
if (!StringHelper.isBlank(rzjsrq)) {
rzjsrq = DateUtils.getNight(DateUtils.strToDate(rzjsrq));
pramsMap.put("rzjsrq", rzjsrq);
} else {
return ResponseEntity.ok(R.error("认证结束日期不能为空!"));
}
if (!StringHelper.isBlank(skssq)) {
pramsMap.put("skssq", skssq);
}
}
} else {
@ -343,19 +342,19 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("inAccountStatus", inAccountStatus);
}
if(pramsMap.get("imageNumber") != null){
pramsMap.put("imageNumber",pramsMap.get("imageNumber"));
if (pramsMap.get("imageNumber") != null) {
pramsMap.put("imageNumber", pramsMap.get("imageNumber"));
}
if(pramsMap.get("snVoucherNumber") != null){
pramsMap.put("snVoucherNumber",pramsMap.get("snVoucherNumber"));
if (pramsMap.get("snVoucherNumber") != null) {
pramsMap.put("snVoucherNumber", pramsMap.get("snVoucherNumber"));
}
if(pramsMap.get("accountPeriod") != null ){
if(pramsMap.get("accountPeriod").toString().length() > 7) {
if (pramsMap.get("accountPeriod") != null) {
if (pramsMap.get("accountPeriod").toString().length() > 7) {
String accountPeriod = pramsMap.get("accountPeriod").toString().substring(0, 7);
pramsMap.put("accountPeriod", accountPeriod);
}else{
} else {
pramsMap.put("accountPeriod", pramsMap.get("accountPeriod"));
}
}
@ -369,7 +368,7 @@ public class BaseInvoiceController extends AbstractController {
DateUtils.getNight(DateUtils.strToDate(pramsMap.get("postingTimeEnd").toString())));
}
log.info("请求列表的参数为:{}",pramsMap);
log.info("请求列表的参数为:{}", pramsMap);
try {
return ResponseEntity.ok(R.ok().put("data", baseRzFpxxService.selectByPramsMap(pramsMap, curr, size)));
@ -384,14 +383,13 @@ public class BaseInvoiceController extends AbstractController {
/**
* 撤销认证
*
* @param map
* 请求参数 id逗号分隔
* @param map 请求参数 id逗号分隔
* @return 返回结果
*/
@PostMapping("/rzzhcx/cxrz")
@SysLog("调用撤销认证接口")
public Object cxrz(@RequestBody Map<String, Object> map) {
String cxids = (String)map.get("cxids");
String cxids = (String) map.get("cxids");
Map<String, Object> pramsMap = new HashMap<>(16);
pramsMap.put("dbName", getUserInfo().getDbName());
@ -412,7 +410,6 @@ public class BaseInvoiceController extends AbstractController {
}
/**
*
* 扫码勾选录入查询
*/
@PostMapping("/smgx/smgxcx")
@ -483,55 +480,54 @@ public class BaseInvoiceController extends AbstractController {
@ResponseBody
public Object sggxcx(@RequestBody Map<String, Object> map) {
if(map.get("gfsh") == null || "".equals(map.get("gfsh"))){
if (map.get("gfsh") == null || "".equals(map.get("gfsh"))) {
return ResponseEntity.ok(R.error(CommonConstants.GFSH_OR_COMPANYCODE_MISS));
}
if (map.get("companyCode") == null || "".equals(map.get("companyCode"))){
if (map.get("companyCode") == null || "".equals(map.get("companyCode"))) {
return ResponseEntity.ok(R.error("组织编码不能为空"));
}
String gfsh = (String) map.get("gfsh");
String companyCode = (String) map.get("companyCode");
String invoiceType = (String)map.get("invoiceType");
String invoiceSource = (String)map.get("invoiceSource");
String kpksrq = (String)map.get("kpksrq");
String kpjsrq = (String)map.get("kpjsrq");
String qszt = (String)map.get("qszt");
String qsfs = (String)map.get("qsfs");
String businessCode = (String)map.get("businessCode");
String invoiceNo = (String)map.get("invoiceNo");
String qsksrq = (String)map.get("qsksrq");
String qsjsrq = (String)map.get("qsjsrq");
String xfmc = (String)map.get("xfmc");
String invoiceType = (String) map.get("invoiceType");
String invoiceSource = (String) map.get("invoiceSource");
String kpksrq = (String) map.get("kpksrq");
String kpjsrq = (String) map.get("kpjsrq");
String qszt = (String) map.get("qszt");
String rzzt = (String) map.get("rzzt");
String qsfs = (String) map.get("qsfs");
String businessCode = (String) map.get("businessCode");
String invoiceNo = (String) map.get("invoiceNo");
String qsksrq = (String) map.get("qsksrq");
String qsjsrq = (String) map.get("qsjsrq");
String xfmc = (String) map.get("xfmc");
String sortPzbh = String.valueOf(map.get("sortPzbh"));
String sortBzdh = String.valueOf(map.get("sortBzdh"));
String sortKprq = String.valueOf(map.get("sortKprq"));
String position = (String)map.get("position");
String fpzt = (String)map.get("invoiceStatus");
String sfkrz = (String)map.get("sfkrz");
int curr = (int)map.get("curr");
int size = (int)map.get("size");
String qsr = (String)map.get("qsr");
String company = (String)map.get("company");
String menuId = (String)map.get("menuId");
String position = (String) map.get("position");
String fpzt = (String) map.get("invoiceStatus");
String sfkrz = (String) map.get("sfkrz");
int curr = (int) map.get("curr");
int size = (int) map.get("size");
String qsr = (String) map.get("qsr");
String company = (String) map.get("company");
String menuId = (String) map.get("menuId");
String bzdh = (String) map.get("bzdh");
String inAccountStatus = (String) map.get("inAccountStatus");
String suspendStatus = (String) map.get("suspendStastus");
String suspendDate = (String) map.get("suspendDate");
String bzr = (String) map.get("bzr");
String taxRate = String.valueOf(map.get("taxRate"));
if (StringUtils.isNotEmpty(suspendDate) && suspendDate.length() >7){
suspendDate = suspendDate.substring(0,7);
if (StringUtils.isNotEmpty(suspendDate) && suspendDate.length() > 7) {
suspendDate = suspendDate.substring(0, 7);
}
Map<String, Object> pramsMap = new HashMap<>(32);
pramsMap.put("companyCode",companyCode);
pramsMap.put("companyCode", companyCode);
pramsMap.put("gfsh", gfsh);
pramsMap.put("bzdh", bzdh);
pramsMap.put("inAccountStatus", inAccountStatus);
@ -552,26 +548,26 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("postingTimeEnd", map.get("postingTimeEnd"));
pramsMap.put("postingTimeStart", map.get("postingTimeStart"));
pramsMap.put("imageNumber", map.get("imageNumber"));
pramsMap.put("suspendStatus",suspendStatus);
pramsMap.put("suspendDate",suspendDate);
pramsMap.put("sortPzbh",sortPzbh);
pramsMap.put("sortBzdh",sortBzdh);
pramsMap.put("sortKprq",sortKprq);
pramsMap.put("bzr",bzr);
if(StringUtils.isNotEmpty(sortPzbh)) {
pramsMap.put("suspendStatus", suspendStatus);
pramsMap.put("suspendDate", suspendDate);
pramsMap.put("sortPzbh", sortPzbh);
pramsMap.put("sortBzdh", sortBzdh);
pramsMap.put("sortKprq", sortKprq);
pramsMap.put("bzr", bzr);
if (StringUtils.isNotEmpty(sortPzbh)) {
pramsMap.put("sortPzbh", sortPzbh);
}
if(StringUtils.isNotEmpty(sortBzdh)) {
if (StringUtils.isNotEmpty(sortBzdh)) {
pramsMap.put("sortBzdh", sortBzdh);
}
if(StringUtils.isNotEmpty(sortKprq)) {
if (StringUtils.isNotEmpty(sortKprq)) {
pramsMap.put("sortKprq", sortKprq);
}
if (map.get("accountPeriod") != null && !"".equals(map.get("accountPeriod"))) {
String accountPeriod = map.get("accountPeriod").toString().substring(0,7);
String accountPeriod = map.get("accountPeriod").toString().substring(0, 7);
pramsMap.put("accountPeriod", accountPeriod);
log.info("accountPeriod:{}",accountPeriod);
log.info("accountPeriod:{}", accountPeriod);
}
if (sfkrz != null) {
@ -584,16 +580,19 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("invoiceSource", invoiceSource);
}
}
if (!StringUtils.isNotBlank(gfsh)){
pramsMap.put("sign","88");
if (!StringUtils.isNotBlank(gfsh)) {
pramsMap.put("sign", "88");
}
if (StringUtils.isNotBlank(taxRate) && !"99".equals(taxRate)){
if (StringUtils.isNotBlank(taxRate) && !"99".equals(taxRate)) {
// List<String> rates = new ArrayList<>();
// rates = convertRates(taxRate,rates);
pramsMap.put("taxRate",taxRate);
pramsMap.put("taxRate", taxRate);
}
if (StringUtils.isNotBlank(rzzt) && !"99".equals(rzzt)) {
pramsMap.put("rzzt", rzzt);
}
if (!StringUtils.isBlank(invoiceType)) {
if (!"99".equals(invoiceType)) {
@ -661,9 +660,9 @@ public class BaseInvoiceController extends AbstractController {
//发票号码
if (!StringUtils.isBlank(invoiceNo)) {
if(invoiceNo.length()==8){
if (invoiceNo.length() == 8) {
pramsMap.put("invoiceNo", invoiceNo);
}else {
} else {
pramsMap.put("eleInvoiceNo", invoiceNo);
}
}
@ -680,7 +679,7 @@ public class BaseInvoiceController extends AbstractController {
// }
try {
return ResponseEntity
.ok(R.ok().put("data", baseInvoiceManualCheckService.selectByManualCheck(pramsMap, curr, size)));
.ok(R.ok().put("data", baseInvoiceManualCheckService.selectByManualCheck(pramsMap, curr, size)));
} catch (Exception e) {
e.printStackTrace();
log.error("", e);
@ -690,11 +689,11 @@ public class BaseInvoiceController extends AbstractController {
}
private List<String> getGfshList(List<String> gfshList, List<String> companyCodes) {
gfshList = baseInvoiceManualCheckService.getGfshList(gfshList,companyCodes);
gfshList = baseInvoiceManualCheckService.getGfshList(gfshList, companyCodes);
return gfshList;
}
private List<String> convertRates(String taxRate,List<String> rates) {
private List<String> convertRates(String taxRate, List<String> rates) {
switch (taxRate) {
case "0":
rates.add("0");
@ -745,17 +744,17 @@ public class BaseInvoiceController extends AbstractController {
}
public boolean checkList(List<String> list) {
boolean flag =false;
if (list == null || list.isEmpty()){
boolean flag = false;
if (list == null || list.isEmpty()) {
flag = true;
}else {
String s = list.toString().replace("[","").replace("]","");
if (StringHelper.isBlank(s)){
} else {
String s = list.toString().replace("[", "").replace("]", "");
if (StringHelper.isBlank(s)) {
flag = true;
}
if (StringHelper.isNotBlank(s) && s.contains(",")){
if (StringHelper.isNotBlank(s) && s.contains(",")) {
String replace = s.replace(",", "");
if (StringHelper.isBlank(replace)){
if (StringHelper.isBlank(replace)) {
flag = true;
}
}
@ -772,22 +771,22 @@ public class BaseInvoiceController extends AbstractController {
@SysLog("调用智能勾选查询接口")
@ResponseBody
public Object zngxcx(@RequestBody Map<String, Object> map) {
String gfsh = (String)map.get("gfsh");
String invoiceType = (String)map.get("invoiceType");
String invoiceSource = (String)map.get("invoiceSource");
String kpksrq = (String)map.get("kpksrq");
String kpjsrq = (String)map.get("kpjsrq");
String qszt = (String)map.get("qszt");
String qsfs = (String)map.get("qsfs");
String businessCode = (String)map.get("businessCode");
String qsksrq = (String)map.get("qsksrq");
String qsjsrq = (String)map.get("qsjsrq");
String xfmc = (String)map.get("xfmc");
String maxTax = (String)map.get("maxTax");
String floatTax = (String)map.get("floatTax");
String yxsxfs = (String)map.get("yxsxfs");
String qsr = (String)map.get("qsr");
String invoiceNo = (String)map.get("invoiceNo");
String gfsh = (String) map.get("gfsh");
String invoiceType = (String) map.get("invoiceType");
String invoiceSource = (String) map.get("invoiceSource");
String kpksrq = (String) map.get("kpksrq");
String kpjsrq = (String) map.get("kpjsrq");
String qszt = (String) map.get("qszt");
String qsfs = (String) map.get("qsfs");
String businessCode = (String) map.get("businessCode");
String qsksrq = (String) map.get("qsksrq");
String qsjsrq = (String) map.get("qsjsrq");
String xfmc = (String) map.get("xfmc");
String maxTax = (String) map.get("maxTax");
String floatTax = (String) map.get("floatTax");
String yxsxfs = (String) map.get("yxsxfs");
String qsr = (String) map.get("qsr");
String invoiceNo = (String) map.get("invoiceNo");
Map<String, Object> pramsMap = new HashMap<>(18);
pramsMap.put("business", getUserInfo().getBusiness());
@ -878,9 +877,9 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("xfmc", xfmc);
}
if (!StringUtils.isBlank(invoiceNo)) {
if(invoiceNo.length()==8){
if (invoiceNo.length() == 8) {
pramsMap.put("invoiceNo", invoiceNo);
}else {
} else {
pramsMap.put("eleInvoiceNo", invoiceNo);
}
}
@ -907,38 +906,38 @@ public class BaseInvoiceController extends AbstractController {
String inAccountStatus = (String) map.get("inAccountStatus");
String companyCode = (String) map.get("companyCode");
String gfsh = (String)map.get("gfsh");
String gfsh = (String) map.get("gfsh");
String maxTax = (String) map.get("maxTax");
String menuId = (String)map.get("menuId");
String company = (String)map.get("company");
String menuId = (String) map.get("menuId");
String company = (String) map.get("company");
String isChooseAll = (String) map.get("isChooseAll");
if (org.apache.commons.lang3.StringUtils.isBlank(isChooseAll)){
if (org.apache.commons.lang3.StringUtils.isBlank(isChooseAll)) {
isChooseAll = "N";
}
int curr = 0;
int size = 0;
if ("N".equalsIgnoreCase(isChooseAll)){
if ("N".equalsIgnoreCase(isChooseAll)) {
if (map.get("curr") != null){
if (map.get("curr") != null) {
curr = (int) map.get("curr");
}else {
} else {
ResponseEntity.ok(R.error("分页数据不能为空"));
}
if (map.get("size")!= null){
if (map.get("size") != null) {
size = (int) map.get("size");
}else {
} else {
ResponseEntity.ok(R.error("分页大小不能为空"));
}
}
if (StringUtils.isBlank(inAccountStatus)){
if (StringUtils.isBlank(inAccountStatus)) {
return ResponseEntity.ok(R.error("入账状态不能为空"));
}
if (StringUtils.isBlank(maxTax)){
if (StringUtils.isBlank(maxTax)) {
return ResponseEntity.ok(R.error("税额上限不能为空"));
}
@ -954,10 +953,10 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("inAccountStatus", inAccountStatus);
pramsMap.put("company", company);
pramsMap.put("menuId", menuId);
pramsMap.put("maxTax",maxTax);
pramsMap.put("curr",curr);
pramsMap.put("size",size);
pramsMap.put("isChooseAll",isChooseAll);
pramsMap.put("maxTax", maxTax);
pramsMap.put("curr", curr);
pramsMap.put("size", size);
pramsMap.put("isChooseAll", isChooseAll);
pramsMap.put("business", getUserInfo().getBusiness());
pramsMap.put("dbName", getUserInfo().getDbName());
List<Tax> taxList = getUserInfo().getOrg();
@ -972,21 +971,20 @@ public class BaseInvoiceController extends AbstractController {
//TODO 合并分支后把checkList加上可以让用户不使用上级权限就可以进行认证
pramsMap.put("gfsh",gfshList);
pramsMap.put("gfsh", gfshList);
pramsMap.put("sign","99");
pramsMap.put("sign", "99");
if (StringHelper.isNotBlank(companyCode) && "99".equals(companyCode)){
pramsMap.put("companyCodes",getUserInfo().getCompanyCodes());
log.info("组织机构====>{}",pramsMap.get("companyCodes"));
if (StringHelper.isNotBlank(companyCode) && "99".equals(companyCode)) {
pramsMap.put("companyCodes", getUserInfo().getCompanyCodes());
log.info("组织机构====>{}", pramsMap.get("companyCodes"));
}
if (StringUtils.isNotBlank(companyCode)){
pramsMap.put("companyCode",companyCode);
if (StringUtils.isNotBlank(companyCode)) {
pramsMap.put("companyCode", companyCode);
}
try {
return ResponseEntity
.ok(R.ok().put("data", baseInvoiceManualCheckService.inTellingCheck(pramsMap)));
@ -1009,7 +1007,7 @@ public class BaseInvoiceController extends AbstractController {
// isChooseAll = "Y";
// }
map.put("isChooseAll","Y");
map.put("isChooseAll", "Y");
int curr = 1;
int size = 10;
int count = 0;
@ -1017,16 +1015,16 @@ public class BaseInvoiceController extends AbstractController {
Map<String, Object> pramsMap = new HashMap<>(16);
String companyCode = (String) map.get("companyCode");
String gfsh = (String)map.get("gfsh");
String gfsh = (String) map.get("gfsh");
List<String> gfshList = new ArrayList<>();
if(StringUtils.isNotBlank(gfsh) && "99".equals(gfsh)){
gfshList=UserInfoUtil.getGfshAll(getUserInfo().getOrg());
}else {
if (StringUtils.isNotBlank(gfsh) && "99".equals(gfsh)) {
gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg());
} else {
gfshList.add(gfsh);
}
String gxType = (String) map.get("gxType");
if (StringUtils.isBlank(gxType)){
if (StringUtils.isBlank(gxType)) {
return ResponseEntity.ok(R.error("所选发票勾选类型不能为空"));
}
@ -1034,7 +1032,7 @@ public class BaseInvoiceController extends AbstractController {
map.put("dbName", getUserInfo().getDbName());
List<Tax> taxList = getUserInfo().getOrg();
map.put("taxList", taxList);
map.put("gfsh",gfshList);
map.put("gfsh", gfshList);
map.put("qsflag", getUserInfo().getQsStatus());
// List<String> gfshList = new ArrayList<>();
// if (!"99".equals(gfsh) && StringUtils.isNotBlank(gfsh)) {
@ -1047,41 +1045,41 @@ public class BaseInvoiceController extends AbstractController {
//
// map.put("gfsh",gfshList);
//
map.put("sign","99");
map.put("sign", "99");
if (StringHelper.isNotBlank(companyCode) && "99".equals(companyCode)){
map.put("companyCodes",getUserInfo().getCompanyCodes());
log.info("组织机构====>{}",map.get("companyCodes"));
if (StringHelper.isNotBlank(companyCode) && "99".equals(companyCode)) {
map.put("companyCodes", getUserInfo().getCompanyCodes());
log.info("组织机构====>{}", map.get("companyCodes"));
}
if (StringUtils.isNotBlank(companyCode)){
map.put("companyCode",companyCode);
if (StringUtils.isNotBlank(companyCode)) {
map.put("companyCode", companyCode);
}
String sgrzzngxcx = baseInvoiceManualCheckService.inTellingCheck(map);
log.info("sgrzzngxcx======={}",sgrzzngxcx);
log.info("sgrzzngxcx======={}", sgrzzngxcx);
String decodeStr = Base64.decodeStr(sgrzzngxcx);
BaseReturnEntity baseReturnEntity = JSON.parseObject(decodeStr, BaseReturnEntity.class);
List<BaseTDxRecordInvoice> dataList = baseReturnEntity.getDataList();
StringBuilder uuids = new StringBuilder();
StringBuilder dkses = new StringBuilder();
if (dataList != null && dataList.size() > 0){
if (dataList != null && dataList.size() > 0) {
for (int i = 0; i < dataList.size(); i++) {
uuids.append(dataList.get(i).getUuid());
dkses.append(dataList.get(i).getTaxAmount());
if (i<dataList.size()-1){
if (i < dataList.size() - 1) {
uuids.append(",");
dkses.append(",");
}
}
log.info("uuids====>{}",uuids);
log.info("dkses====>{}",dkses);
}else {
log.info("uuids====>{}", uuids);
log.info("dkses====>{}", dkses);
} else {
return ResponseEntity.ok(R.error("没有可操作的数据"));
}
pramsMap.put("uuids",uuids);
pramsMap.put("dkses",dkses);
pramsMap.put("uuids", uuids);
pramsMap.put("dkses", dkses);
pramsMap.put("name", getUserName());
pramsMap.put("dbName", getUserInfo().getDbName());
pramsMap.put("loginName", getLoginName());
@ -1109,12 +1107,12 @@ public class BaseInvoiceController extends AbstractController {
@SysLog("智能勾选发票入库接口")
@ResponseBody
public Object insertZngx(@RequestBody Map<String, Object> map) {
List<String> idlist = (List<String>)map.get("ids");
List<String> idlist = (List<String>) map.get("ids");
Map<String, Object> pramsMap = new HashMap<>(16);
pramsMap.put("business", getUserInfo().getBusiness());
pramsMap.put("dbName", getUserInfo().getDbName());
pramsMap.put("userName", getUserName());
pramsMap.put("userAccount",getUserInfo().getLoginname());
pramsMap.put("userAccount", getUserInfo().getLoginname());
pramsMap.put("company", map.get("company"));
pramsMap.put("menuId", map.get("menuId"));
pramsMap.put("gxType", map.get("gxType"));
@ -1173,7 +1171,7 @@ public class BaseInvoiceController extends AbstractController {
/**
* 扫码手工导入勾选操做入口
*
* <p>
* 0-手工勾选 1-扫码勾选 2-导入勾选 3- 智能勾选 4-手工认证 5-扫码认证 6-导入认证
*
* @return 返回结果
@ -1181,9 +1179,9 @@ public class BaseInvoiceController extends AbstractController {
@PostMapping("/gx/invoiceCheck")
@SysLog("调用扫码,手工,导入勾选操做入口接口")
public Object invoiceCheck(@RequestBody Map<String, Object> map) {
String ids = (String)map.get("ids");
String gxType = String.valueOf((int)map.get("gxType"));
String ses = (String)map.get("ses");
String ids = (String) map.get("ids");
String gxType = String.valueOf((int) map.get("gxType"));
String ses = (String) map.get("ses");
Map<String, Object> pramsMap = new HashMap<>(16);
pramsMap.put("dbName", getUserInfo().getDbName());
@ -1217,23 +1215,22 @@ public class BaseInvoiceController extends AbstractController {
/**
* 已勾选发票待确认列表
*
* @param map
* 请求参数
* @param map 请求参数
* @return 返回结果
*/
@PostMapping("/ygxfp/jgxfpcx")
@SysLog("调用已勾选发票待确认列表接口")
public Object jgxfpcx(@RequestBody Map<String, Object> map) {
String gfsh = (String)map.get("gfsh");
String invoiceType = (String)map.get("invoiceType");
String invoiceSource = (String)map.get("invoiceSource");
String gxksrq = (String)map.get("gxksrq");
String gxjsrq = (String)map.get("gxjsrq");
String businessCode = (String)map.get("businessCode");
String invoiceNo = (String)map.get("invoiceNo");
String xfmc = (String)map.get("xfmc");
int curr = (int)map.get("curr");
int size = (int)map.get("size");
String gfsh = (String) map.get("gfsh");
String invoiceType = (String) map.get("invoiceType");
String invoiceSource = (String) map.get("invoiceSource");
String gxksrq = (String) map.get("gxksrq");
String gxjsrq = (String) map.get("gxjsrq");
String businessCode = (String) map.get("businessCode");
String invoiceNo = (String) map.get("invoiceNo");
String xfmc = (String) map.get("xfmc");
int curr = (int) map.get("curr");
int size = (int) map.get("size");
Map<String, Object> pramsMap = new HashMap<>(16);
pramsMap.put("dbName", getUserInfo().getDbName());
List<Tax> taxList = getUserInfo().getOrg();
@ -1290,16 +1287,16 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("xfmc", xfmc);
}
if (!StringUtils.isBlank(invoiceNo)) {
if(invoiceNo.length()==8){
if (invoiceNo.length() == 8) {
pramsMap.put("invoiceNo", invoiceNo);
}else {
} else {
pramsMap.put("eleInvoiceNo", invoiceNo);
}
}
try {
return ResponseEntity.ok(Objects
.requireNonNull(R.ok().put("data", baseYgxfpqrService.selectByGfshAndKprq(pramsMap, curr, size))));
.requireNonNull(R.ok().put("data", baseYgxfpqrService.selectByGfshAndKprq(pramsMap, curr, size))));
} catch (Exception e) {
e.printStackTrace();
log.error("", e);
@ -1310,14 +1307,13 @@ public class BaseInvoiceController extends AbstractController {
/**
* 撤销已经勾选的发票
*
* @param map
* 请求参数
* @param map 请求参数
* @return 返回结果
*/
@PostMapping("/gxfp/cxgx")
@SysLog("调用撤销已经勾选的发票接口")
public Object cxgx(@RequestBody Map<String, Object> map) {
String cxids = (String)map.get("cxids");
String cxids = (String) map.get("cxids");
Map<String, Object> pramsMap = new HashMap<>(16);
pramsMap.put("dbName", getUserInfo().getDbName());
@ -1340,17 +1336,16 @@ public class BaseInvoiceController extends AbstractController {
/**
* 一键提交
*
* @param map
* 请求参数
* @param map 请求参数
* @return 返回结果
*/
@PostMapping("/gxfp/tjrz")
@SysLog("调用一键提交接口")
public Object fprz(@RequestBody Map<String, Object> map) {
String uuids = (String)map.get("uuids");
String dkses = (String)map.get("dkses");
String gxType = (String)map.get("gxType");
String uuids = (String) map.get("uuids");
String dkses = (String) map.get("dkses");
String gxType = (String) map.get("gxType");
int curr = 0;
int size = 50;
int count = 0;
@ -1379,7 +1374,7 @@ public class BaseInvoiceController extends AbstractController {
try {
return ResponseEntity
.ok(R.ok().put("data", baseIRzTDxRecordInvoiceService.identifiByIds(pramsMap, curr, size, count)));
.ok(R.ok().put("data", baseIRzTDxRecordInvoiceService.identifiByIds(pramsMap, curr, size, count)));
} catch (Exception e) {
e.printStackTrace();
log.error("", e);
@ -1390,49 +1385,49 @@ public class BaseInvoiceController extends AbstractController {
@PostMapping("/sgrz/changeSuspend")
@SysLog("修改暂挂状态")
@ResponseBody
public Object changeSuspend(@RequestBody Map<String,Object> map){
public Object changeSuspend(@RequestBody Map<String, Object> map) {
if (map == null){
if (map == null) {
return ResponseEntity.ok(R.error("缺少请求参数"));
}
log.info("getUserInfo====>{}",getUserInfo());
log.info("getUserInfo====>{}", getUserInfo());
List<String> gfshAll = UserInfoUtil.getGfshAll(getUserInfo().getOrg());
if (gfshAll ==null || gfshAll.isEmpty()){
if (gfshAll == null || gfshAll.isEmpty()) {
return ResponseEntity.ok(R.error("购方信息不能为空"));
}
JSONObject jsonObject = new JSONObject(map);
String uuids = jsonObject.getString("uuids");
if (StringUtils.isEmpty(uuids) ||(uuids.length() == 1 && uuids.contains(","))){
if (StringUtils.isEmpty(uuids) || (uuids.length() == 1 && uuids.contains(","))) {
return ResponseEntity.ok(R.error("请先选择要暂挂的数据"));
}
String suspendType = jsonObject.getString("suspendType");
if (StringUtils.isEmpty(suspendType)){
if (StringUtils.isEmpty(suspendType)) {
return ResponseEntity.ok(R.error("暂挂状态不能为空"));
}
String[] uuidArray = uuids.split(",");
List<String> uuidList = Arrays.asList(uuidArray);
//查询库中是否包含对应数据
DynamicContextHolder.push(getUserInfo().getDbName()+ DbConstant.BUSINESS_READ);
DynamicContextHolder.push(getUserInfo().getDbName() + DbConstant.BUSINESS_READ);
List<String> list = baseIRzTDxRecordInvoiceService.findSuspendStatus(uuidList);
if (list == null || list.isEmpty()){
if (list == null || list.isEmpty()) {
return ResponseEntity.ok(R.error("没有可操作的数据"));
}
if (list.contains("1")&& (list.contains("0")||list.contains(null) || list.contains(""))){
if (list.contains("1") && (list.contains("0") || list.contains(null) || list.contains(""))) {
return ResponseEntity.ok(R.error("同时存在暂挂状态为是和否的数据,请重新选择!"));
}
Map<String,Object> pramsMap = new HashMap<>();
pramsMap.put("suspendType",suspendType);
pramsMap.put("uuids",uuidList);
pramsMap.put("dbName",getUserInfo().getDbName());
Map<String, Object> pramsMap = new HashMap<>();
pramsMap.put("suspendType", suspendType);
pramsMap.put("uuids", uuidList);
pramsMap.put("dbName", getUserInfo().getDbName());
// pramsMap.put("dbName","business");
try {
return ResponseEntity
.ok(R.ok().put("data",baseIRzTDxRecordInvoiceService.updateSuspendType(pramsMap)));
.ok(R.ok().put("data", baseIRzTDxRecordInvoiceService.updateSuspendType(pramsMap)));
} catch (Exception e) {
e.printStackTrace();
log.error("", e);

@ -74,6 +74,10 @@ public class BaseSggxCxRespVO {
* 签收方式
*/
private String qsfs;
/**
* 认证状态
*/
private String rzzt;
/**
* 签收人
*/

@ -77,7 +77,7 @@
and t.invoice_type in('01','03','08','14','31','283','161','183','185')
and t.bdk_status in ('1','2')
and t.export_mark = '0'
and t.auth_status in ('2','3','4')
and t.auth_status in ('0','2','3','4','5','6')
and t.company = #{company}
and t.gf_tax_no = #{gfsh}
and t.comp_code = #{companyCode}
@ -124,9 +124,12 @@
<if test="imageId != null and imageId != '' and imageId != 'null' ">
and t.image_id = #{imageId}
</if>
<if test="rzclzt !=null and rzclzt != ''">
<if test="rzclzt == '0'.toString() or rzclzt == '4'.toString() or rzclzt == '5'.toString() or rzclzt == '6'.toString()">
and t.auth_status = #{rzclzt}
</if>
<if test="rzclzt == '1'.toString() ">
and (t.auth_status = '2' or t.auth_status = '3')
</if>
<if test="rzlx!=null and rzlx!=''">
and t.bdk_status = #{rzlx}
</if>
@ -152,7 +155,7 @@
<if test="qsr != null and qsr != '' and qsr != 'null' ">
and t.qs_name = #{qsr}
</if>
<if test="rzhr != null and rzhr != '' and rzhr != 'null' ">
<if test="rzhr != null and rzhr != '' and rzhr != 'null'">
and t.confirm_user in
<foreach collection="rzhr" index="index" item="item" open="(" separator="," close=")">
#{item}
@ -354,7 +357,7 @@
and t.gf_tax_no = #{gfsh}
and t.comp_code = #{companyCode}
and t.invoice_type in('01','03','08','14','31','283','161','183','185')
and t.auth_status in ('2','3','4')
and t.auth_status in ('0','2','3','4','5','6')
and t.bdk_status in ('1','2')
and t.export_mark = '0'
and t.company =#{company}
@ -402,9 +405,12 @@
<if test="rzzt != null and rzzt != '' and rzzt != 'null' ">
and t.rzh_yesorno = #{rzzt}
</if>
<if test="rzclzt != null and rzclzt != '' and rzclzt != 'null' ">
<if test="rzclzt == '0'.toString() or rzclzt == '4'.toString() or rzclzt == '5'.toString() or rzclzt == '6'.toString()">
and t.auth_status = #{rzclzt}
</if>
<if test="rzclzt == '1'.toString() ">
and (t.auth_status = '2' or t.auth_status = '3')
</if>
<if test="rzlx!=null and rzlx!=''">
and t.bdk_status = #{rzlx}
</if>
@ -427,7 +433,7 @@
<if test="qsr != null and qsr != '' and qsr != 'null' ">
and t.qs_name = #{qsr}
</if>
<if test="rzhr != null and rzhr != '' and rzhr != 'null' ">
<if test="rzhr != null and rzhr != '' and rzhr != 'null'">
and t.confirm_user in
<foreach collection="rzhr" index="index" item="item" open="(" separator="," close=")">
#{item}

@ -86,7 +86,7 @@
WHERE t.invoice_date between #{kpksrq} and #{kpjsrq}
and t.invoice_type in('01','03','08','14','31','283','161','183','185')
and t.rzh_yesorno = '0'
and t.auth_status in('0','5','6')
and t.auth_status in('0','2','3','5','6')
and t.export_mark = '0'
and t.inaccount_status = '1'
and t.company = #{company}
@ -129,6 +129,15 @@
<if test="qszt != null and qszt != '' and qszt != 'null' ">
and t.qs_status = #{qszt}
</if>
<if test="rzzt == '0'.toString()">
and t.auth_status = #{rzzt}
</if>
<if test="rzzt == '1'.toString()">
and (t.auth_status = '2' or t.auth_status = '3')
</if>
<if test="rzzt == '2'.toString()">
and t.auth_status = '5'
</if>
<if test="inAccountStatus != null and inAccountStatus != '' and inAccountStatus != 'null' and inAccountStatus != '99' and inAccountStatus == '1'.toString()">
and t.inaccount_status = #{inAccountStatus}
@ -417,7 +426,7 @@
WHERE t.invoice_date between #{kpksrq} and #{kpjsrq}
and t.invoice_type in('01','03','08','14','31','283','161','183','185')
and t.rzh_yesorno = '0'
and t.auth_status in('0','5','6')
and t.auth_status in('0','2','3','5','6')
and t.inaccount_status = '1'
and t.export_mark = '0'
and t.company = #{company}
@ -442,6 +451,16 @@
<if test="qszt != null and qszt != '' and qszt != 'null' ">
and t.qs_status = #{qszt}
</if>
<if test="rzzt == '0'.toString()">
and t.auth_status = #{rzzt}
</if>
<if test="rzzt == '1'.toString()">
and (t.auth_status = '2' or t.auth_status = '3')
</if>
<if test="rzzt == '2'.toString()">
and t.auth_status = '5'
</if>
<if test="suspendStatus != null and suspendStatus != '' and suspendStatus != 'null' and suspendStatus != '99' and suspendStatus == '1'.toString()">
and t.suspend_status = '1'
</if>
@ -1255,6 +1274,7 @@
and t.rzh_yesorno = '0'
and t.invoice_status in ('0','7')
and t.auth_status in('0','5','6')
and t.inaccount_status = '1'
and t.export_mark = '0'
and t.invoice_amount>0
and t.tax_amount>=0

@ -164,6 +164,10 @@
<artifactId>itext-asian</artifactId>
<version>5.2.0</version>
</dependency>
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>

@ -0,0 +1,33 @@
package com.dxhy.core.config;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
//@Configuration
//public class RedissionConfig {
//
// @Value("${spring.redis.host}")
// private String host;
//
// @Value("${spring.redis.port}")
// private String port;
//
// @Value("${spring.redis.password}")
// private String redisPassword;
//
// @Bean
// public RedissonClient getRedisson(){
//
// Config config = new Config();
// //单机模式 依次设置redis地址和密码
// config.useSingleServer()
// .setAddress("redis://" + host + ":" + port)
// .setPassword(redisPassword);
// return Redisson.create(config);
// }
//}
//

@ -14,7 +14,10 @@ import javax.crypto.spec.SecretKeySpec;
import com.dxhy.core.job.thread.InvoiceParseHandle;
import org.apache.commons.lang.StringUtils;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
@ -72,6 +75,16 @@ public class InvoiceInterfaceServiceImpl implements InvoiceInterfaceService {
@Resource
private Sender sender;
@Resource
private StringRedisTemplate stringRedisTemplate;
// @Resource
// private RedissonClient redisson;
private static final String REDIS_KEY = "collect_invoice_";
private static final int MAX_SIZE = 1000;
@Value("${jxjk.collectUrl}")
private String collectUrl;
@Value("${jxjk.invoiceGet}")
@ -644,6 +657,9 @@ public class InvoiceInterfaceServiceImpl implements InvoiceInterfaceService {
String company = tDxRecordInvoiceJobDao.findCompany(taxno);
List<InvoiceLog> logList = new ArrayList<>();
for (InvoiceSelectInfo invoiceSelectInfo : invoicesList) {
//加分布式锁
// String lockKey = REDIS_KEY + invoiceSelectInfo.getUuid();
// RLock lock = redisson.getLock(lockKey);
invoiceSelectInfo.setUuid(invoiceSelectInfo.getInvoiceCode() + invoiceSelectInfo.getInvoiceNo());
if ("1".equals(invoiceSelectInfo.getLegalizeState())) {
//认证处理状态 0-未认证 1-已勾选未确认,2已确认 3 已发送认证 4 认证成功 5 认证失败
@ -651,119 +667,132 @@ public class InvoiceInterfaceServiceImpl implements InvoiceInterfaceService {
} else {
invoiceSelectInfo.setAuthStatus("0");
}
// 判断库里是否已经存在,存在则只更新发票状态,状态更新时间,认证状态以及相关字段更新
DynamicContextHolder.push(db + DbConstant.BUSINESS_READ);
TDxRecordInvoiceJobEntity entity = tDxRecordInvoiceJobDao
.findInvoiceByUUid(invoiceSelectInfo.getUuid());
if (entity != null) {
boolean flag = false;
if (StringUtils.isBlank(entity.getCheckCode())
&& StringUtils.isNotBlank(invoiceSelectInfo.getCheckCode())) {
entity.setCheckCode(invoiceSelectInfo.getCheckCode());
entity.setCheckDate(new Date());
flag = true;
}
if (!entity.getInvoiceStatus().equals(invoiceSelectInfo.getInvoiceStatus())) {
entity.setInvoiceStatus(invoiceSelectInfo.getInvoiceStatus());
entity.setStatusUpdateDate(new Date());
flag = true;
}
if ("0".equals(entity.getRzhYesorno())
&& !entity.getRzhYesorno().equals(invoiceSelectInfo.getLegalizeState())) {
if ("1".equals(invoiceSelectInfo.getRzlx())) {
entity.setRzhYesorno(invoiceSelectInfo.getLegalizeState());
entity.setRzhBelongDate(invoiceSelectInfo.getLegalizeBlongDate());
entity.setRzlx(invoiceSelectInfo.getRzlx());
entity.setRzhType(invoiceSelectInfo.getLegalizeType());
entity.setSfygx("1");
if (StringUtils.isNotBlank(invoiceSelectInfo.getLegalizeDate())) {
SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd");
entity.setRzhDate(sim.parse(invoiceSelectInfo.getLegalizeDate()));
}
if ("1".equals(invoiceSelectInfo.getLegalizeState())) {
entity.setAuthStatus("4");
} else {
entity.setAuthStatus("0");
}
entity.setBdkStatus("1");
} else if ("4".equals(invoiceSelectInfo.getRzlx())) {
entity.setRzhYesorno("2");
entity.setRzhBelongDate(invoiceSelectInfo.getLegalizeBlongDate());
entity.setRzlx(invoiceSelectInfo.getRzlx());
entity.setRzhType(invoiceSelectInfo.getLegalizeType());
entity.setSfygx("1");
if (StringUtils.isNotBlank(invoiceSelectInfo.getLegalizeDate())) {
SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd");
entity.setRzhDate(sim.parse(invoiceSelectInfo.getLegalizeDate()));
try {
// boolean isLock = lock.tryLock();
// if(!isLock){
// log.info("当前已有线程获取到锁");
// }else {
// 判断库里是否已经存在,存在则只更新发票状态,状态更新时间,认证状态以及相关字段更新
DynamicContextHolder.push(db + DbConstant.BUSINESS_READ);
TDxRecordInvoiceJobEntity entity = tDxRecordInvoiceJobDao.findInvoiceByUUid(invoiceSelectInfo.getUuid());
if (entity != null) {
boolean flag = false;
if (StringUtils.isBlank(entity.getCheckCode())
&& StringUtils.isNotBlank(invoiceSelectInfo.getCheckCode())) {
entity.setCheckCode(invoiceSelectInfo.getCheckCode());
entity.setCheckDate(new Date());
flag = true;
}
if (!entity.getInvoiceStatus().equals(invoiceSelectInfo.getInvoiceStatus())) {
entity.setInvoiceStatus(invoiceSelectInfo.getInvoiceStatus());
entity.setStatusUpdateDate(new Date());
flag = true;
}
if ("0".equals(entity.getRzhYesorno())
&& !entity.getRzhYesorno().equals(invoiceSelectInfo.getLegalizeState())) {
if ("1".equals(invoiceSelectInfo.getRzlx())) {
entity.setRzhYesorno(invoiceSelectInfo.getLegalizeState());
entity.setRzhBelongDate(invoiceSelectInfo.getLegalizeBlongDate());
entity.setRzlx(invoiceSelectInfo.getRzlx());
entity.setRzhType(invoiceSelectInfo.getLegalizeType());
entity.setSfygx("1");
if (StringUtils.isNotBlank(invoiceSelectInfo.getLegalizeDate())) {
SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd");
entity.setRzhDate(sim.parse(invoiceSelectInfo.getLegalizeDate()));
}
if ("1".equals(invoiceSelectInfo.getLegalizeState())) {
entity.setAuthStatus("4");
} else {
entity.setAuthStatus("0");
}
entity.setBdkStatus("1");
} else if ("4".equals(invoiceSelectInfo.getRzlx())) {
entity.setRzhYesorno("2");
entity.setRzhBelongDate(invoiceSelectInfo.getLegalizeBlongDate());
entity.setRzlx(invoiceSelectInfo.getRzlx());
entity.setRzhType(invoiceSelectInfo.getLegalizeType());
entity.setSfygx("1");
if (StringUtils.isNotBlank(invoiceSelectInfo.getLegalizeDate())) {
SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd");
entity.setRzhDate(sim.parse(invoiceSelectInfo.getLegalizeDate()));
}
if ("1".equals(invoiceSelectInfo.getLegalizeState())) {
entity.setAuthStatus("4");
} else {
entity.setAuthStatus("0");
}
entity.setBdkStatus("2");
}
if ("1".equals(invoiceSelectInfo.getLegalizeState())) {
entity.setAuthStatus("4");
} else {
entity.setAuthStatus("0");
flag = true;
} else if (!"0".equals(entity.getRzhYesorno())
&& !"1".equals(invoiceSelectInfo.getLegalizeState())) {
entity.setRzhYesorno("0");
entity.setRzhBelongDate(null);
entity.setRzlx("0");
entity.setRzhType(null);
entity.setRzhDate(null);
entity.setAuthStatus("0");
entity.setBdkStatus("0");
entity.setSfygx("0");
flag = true;
}
//TODO 这块业务不理解??
if ("1".equals(entity.getSourceSystem()) && "0".equals(entity.getCollectStatus())) {
entity.setCollectStatus("1");
entity.setCollectFrom("0");
entity.setCollectDate(new Date());
entity.setPoolStatus("1");
entity.setInPoolReason("数据重复");
flag = true;
}
if (flag) {
DynamicContextHolder.push(db + DbConstant.BUSINESS_WRITE);
if (StringUtils.isBlank(entity.getInvoiceCode())) {
entity.setInvoiceCode("");
}
entity.setBdkStatus("2");
tDxRecordInvoiceJobDao.updateInvoice(entity, taxno);
}
flag = true;
} else if (!"0".equals(entity.getRzhYesorno())
&& !"1".equals(invoiceSelectInfo.getLegalizeState())) {
entity.setRzhYesorno("0");
entity.setRzhBelongDate(null);
entity.setRzlx("0");
entity.setRzhType(null);
entity.setRzhDate(null);
entity.setAuthStatus("0");
entity.setBdkStatus("0");
entity.setSfygx("0");
flag = true;
}
//TODO 这块业务不理解??
if ("1".equals(entity.getSourceSystem()) && "0".equals(entity.getCollectStatus())) {
entity.setCollectStatus("1");
entity.setCollectFrom("0");
entity.setCollectDate(new Date());
entity.setPoolStatus("1");
entity.setInPoolReason("数据重复");
flag = true;
}
if (flag) {
DynamicContextHolder.push(db + DbConstant.BUSINESS_WRITE);
if (StringUtils.isBlank(entity.getInvoiceCode())) {
entity.setInvoiceCode("");
// 艺龙推送数据
if (yLcompany.equals(company)) {
DynamicContextHolder.push(db + DbConstant.BUSINESS_READ);
InvoiceScanEntity selectSign = tDxRecordInvoiceJobDao
.selectByScan(entity.getInvoiceCode() + entity.getInvoiceNo(), dxhyAdmin);
if (selectSign != null && "1".equals(selectSign.getQsStatus())) {
String record = JSON.toJSONString(entity);
sender.sendToStatus(Base64.encode(record));
}
}
tDxRecordInvoiceJobDao.updateInvoice(entity, taxno);
}
// 艺龙推送数据
if (yLcompany.equals(company)) {
DynamicContextHolder.push(db + DbConstant.BUSINESS_READ);
InvoiceScanEntity selectSign = tDxRecordInvoiceJobDao
.selectByScan(entity.getInvoiceCode() + entity.getInvoiceNo(), dxhyAdmin);
if (selectSign != null && "1".equals(selectSign.getQsStatus())) {
String record = JSON.toJSONString(entity);
sender.sendToStatus(Base64.encode(record));
} else {
if (StringUtils.isBlank(invoiceSelectInfo.getLegalizeDate())) {
invoiceSelectInfo.setLegalizeDate(null);
}
TDxRecordInvoiceJobEntity record = exchangePo2Entity(invoiceSelectInfo);
record.setCompany(company);
record.setCollectStatus("1");
record.setCollectFrom("0");
record.setCollectDate(new Date());
record.setPoolStatus("0");
DynamicContextHolder.push(db + DbConstant.BUSINESS_WRITE);
tDxRecordInvoiceJobDao.insert(record);
}
} else {
if (StringUtils.isBlank(invoiceSelectInfo.getLegalizeDate())) {
invoiceSelectInfo.setLegalizeDate(null);
}
TDxRecordInvoiceJobEntity record = exchangePo2Entity(invoiceSelectInfo);
record.setCompany(company);
record.setCollectStatus("1");
record.setCollectFrom("0");
record.setCollectDate(new Date());
record.setPoolStatus("0");
DynamicContextHolder.push(db + DbConstant.BUSINESS_WRITE);
tDxRecordInvoiceJobDao.insert(record);
InvoiceLog invoiceLog = new InvoiceLog();
invoiceLog.setInvoiceCode(invoiceSelectInfo.getInvoiceCode());
invoiceLog.setInvoiceNo(invoiceSelectInfo.getInvoiceNo());
invoiceLog.setType("1");
invoiceLog.setInputStatus("0");
invoiceLog.setCreateDate(new Date());
invoiceLog.setInputName("系统自动");
logList.add(invoiceLog);
// }
}catch (Exception e) {
e.printStackTrace();
}
InvoiceLog invoiceLog = new InvoiceLog();
invoiceLog.setInvoiceCode(invoiceSelectInfo.getInvoiceCode());
invoiceLog.setInvoiceNo(invoiceSelectInfo.getInvoiceNo());
invoiceLog.setType("1");
invoiceLog.setInputStatus("0");
invoiceLog.setCreateDate(new Date());
invoiceLog.setInputName("系统自动");
logList.add(invoiceLog);
// finally {
// //关锁
// lock.unlock();
// }
}
httpLog.setStatus("1");
httpLog.setTotal(total);

@ -37,6 +37,9 @@ public class SdnyClientTask extends AbstractController {
@Value("${sdny.snYxUrl}")
private String snYxUrl;
@Value("${sdny.client}")
private String client;
@Value("${po.userName}")
private String userName;
@ -77,43 +80,45 @@ public class SdnyClientTask extends AbstractController {
scheduleJobEntity.setJobStatus("1");
DynamicContextHolder.push(DbConstant.BASICS_WRITE);
scheduleJobService.updateById(scheduleJobEntity);
long startTime = System.currentTimeMillis();
List<GsClient> list = new ArrayList<>();
// 准备请求参数
// 需判断 设置不认证状态
List<GsClient> list = new ArrayList<>();
long startTime = System.currentTimeMillis();
SNSAPObject object = new SNSAPObject();
object.setSYSID("FPXT");
object.setIFYWID("FI846");
object.setBSKEY(UUID.randomUUID().toString().replace("-", ""));
object.setZFILED5("200");
object.setZDATA("");
//推送到SAP
log.info("推送山能数据:{}", JSONObject.toJSONString(object));
JSONObject request = new JSONObject();
request.put("IS_INPUT", object);
log.info("{}获取公司client入参:{}", LOGGER_MSG, request.toJSONString());
String result = HttpUtils.sendPo(snYxUrl, request.toJSONString(), userName, password);
log.info("{}获取公司client出参:{}", LOGGER_MSG, result);
PoCommonResponseParam poCommonResponseParam = JsonUtils.getInstance().parseObject(result, PoCommonResponseParam.class);
EsOutput es_output = poCommonResponseParam.getES_OUTPUT();
String ztype = es_output.getZTYPE();
String zmessage = es_output.getZMESSAGE();
Object zdata = es_output.getZDATA();
if ("s".equals(ztype)) {
List<Map<String, String>> gsClientList = JsonUtils.getInstance().parseObject(zdata.toString(), List.class);
gsClientList.stream().forEach(f -> {
GsClient gsClient = new GsClient();
gsClient.setGsdm(ObjectUtil.isNull(f.get("BUKRS")) ? "" : f.get("BUKRS").toString());
gsClient.setGsmc(ObjectUtil.isNull(f.get("BUTXT")) ? "" : f.get("BUTXT").toString());
gsClient.setClient(ObjectUtil.isNull(f.get("MANDT")) ? "" : f.get("MANDT").toString());
gsClient.setCreateTime(new Date());
list.add(gsClient);
});
} else {
log.error("{}client:{},获取公司client出错:{}", LOGGER_MSG, "200", zmessage);
String[] split = client.split(",");
for(int i = 0;i < split.length;i++) {
SNSAPObject object = new SNSAPObject();
object.setSYSID("FPXT");
object.setIFYWID("FI846");
object.setBSKEY(UUID.randomUUID().toString().replace("-", ""));
object.setZFILED5(split[i]);
object.setZDATA("");
//推送到SAP
log.info("推送山能数据:{}", JSONObject.toJSONString(object));
JSONObject request = new JSONObject();
request.put("IS_INPUT", object);
log.info("{}获取公司client入参:{}", LOGGER_MSG, request.toJSONString());
String result = HttpUtils.sendPo(snYxUrl, request.toJSONString(), userName, password);
log.info("{}获取公司client出参:{}", LOGGER_MSG, result);
PoCommonResponseParam poCommonResponseParam = JsonUtils.getInstance().parseObject(result, PoCommonResponseParam.class);
EsOutput es_output = poCommonResponseParam.getES_OUTPUT();
String ztype = es_output.getZTYPE();
String zmessage = es_output.getZMESSAGE();
Object zdata = es_output.getZDATA();
if ("S".equals(ztype)) {
List<Map<String, String>> gsClientList = JsonUtils.getInstance().parseObject(zdata.toString(), List.class);
gsClientList.stream().forEach(f -> {
GsClient gsClient = new GsClient();
gsClient.setGsdm(ObjectUtil.isNull(f.get("BUKRS")) ? "" : f.get("BUKRS").toString());
gsClient.setGsmc(ObjectUtil.isNull(f.get("BUTXT")) ? "" : f.get("BUTXT").toString());
gsClient.setClient(ObjectUtil.isNull(f.get("MANDT")) ? "" : f.get("MANDT").toString());
gsClient.setCreateTime(new Date());
list.add(gsClient);
});
} else {
log.error("{}client:{},获取公司client出错:{}", LOGGER_MSG, "200", zmessage);
}
}
log.info("{}删除gs_client表数据", LOGGER_MSG);
gsClientMapper.deleteAll();
@ -122,6 +127,7 @@ public class SdnyClientTask extends AbstractController {
long endTime = System.currentTimeMillis();
log.debug("{}任务结束,耗时:{}", LOGGER_MSG, endTime - startTime);
} catch (Exception e) {
e.printStackTrace();
} finally {

@ -148,6 +148,11 @@ public class CustomsCustomsJkszhcxServiceImpl extends MpBaseServiceImpl<CustomsJ
pageList.get(i).setQsType(dictdetaServcice.queryDictName(DictConstant.QS_TYPE, qsType));
String rzhYesorno = pageList.get(i).getRzhYesorno();
pageList.get(i).setRzhYesorno(dictdetaServcice.queryDictName(DictConstant.DEDU_STATUS, rzhYesorno));
String confirmUser = pageList.get(i).getConfirmUser();
if(StringUtils.isEmpty(confirmUser) && "4".equals(auditStatus)){
pageList.get(i).setConfirmUser("admin");
}
}
}
// 设置记录总数

@ -263,6 +263,42 @@ public class SDNYMainProcessController extends AbstractController {
if (checkInvoiceByUuid != null) {
log.info("进项票池已存在发票.直接返回票池信息");
R data = new R(1000, "default success");
//如果购方名称为空,则查验之后补充购销方相关信息
String gfName = checkInvoiceByUuid.getGfName();
String gfAddressAndPhone = checkInvoiceByUuid.getGfAddressAndPhone();
if(StringUtils.isEmpty(gfName) || StringUtils.isEmpty(gfAddressAndPhone)){
log.info("购方名称为空,查验补充信息");
checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap, null);
if (!checkInvoiceResult.containsKey("code")) {
if (!checkInvoiceResult.containsKey("cyjg")) {
//先删除原有主数据,再查验更新主数据和明细数据
int delete = baseTDxRecordInvoiceDao.delete(recordWrapper);
if (delete > 0) {
checkInvoiceResult.put("invoiceNo", checkInvoiceResult.getString("invoiceNumber"));
signSaveInvoiceInfoService.saveQueryInvoiceResult(checkInvoiceResult, userid, "1", dbName);
}
} else if (checkInvoiceResult.containsKey("cyjg") && !"0001".equals(checkInvoiceResult.getString("cyjg"))) {
data = errorInfo(checkInvoiceResult, data);
try {
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE);
requestRecordService.saveFailedRequestRecord(singleInvoiceCheckRecord, 0, JSONObject.toJSONString(data),
(String) checkInvoiceResult.get("cyjgxx"));
} catch (Exception e) {
log.error("发票查验接口记录保存失败,errormsg:{}", e);
}
return ResponseEntity.ok(JSONObject.toJSONString(data));
}
}
DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ);
checkInvoiceByUuid = baseTDxRecordInvoiceDao.selectOne(recordWrapper);
}
String invoiceNo = checkInvoiceByUuid.getInvoiceNo();
QueryWrapper<BaseTDxRecordInvoiceDetail> detailWrapper = new QueryWrapper<>();
detailWrapper.eq("uuid", uuid);
@ -1012,7 +1048,8 @@ public class SDNYMainProcessController extends AbstractController {
if (gsClients != null && gsClients.size() > 0) {
object.setZFILED5(gsClients.get(0).getClient());
} else {
object.setZFILED5(environment);
log.error("未能查到 "+orgCode+" 公司对应的推送client");
return ResponseEntity.ok(JSONObject.toJSONString(R.error("未能查到 "+orgCode+" 公司对应的推送client")));
}
List<SAPInvoiceInfo> sapInvoiceInfos = new ArrayList<>();

@ -92,6 +92,11 @@ public class DomesticCustomsExportCountServiceImpl extends MpBaseServiceImpl<Dom
AmountFormatUtil.fmtMicrometer(MathUtil.round((String)map.get("yxExportTaxAmount"))));
map.put("select", true);
String confirmUser = (String)map.get("confirmUser");
if(StringUtils.isEmpty(confirmUser) && "4".equals(authStatus)){
map.put("confirmUser","admin");
}
if ("1".equals(map.get("inAccountStatus"))){
map.put("inAccountStatus","已入账");
}else {

@ -89,7 +89,10 @@ public class DomesticInvoiceExportCountServiceImpl extends MpBaseServiceImpl<Dom
map.put("bdkStatus", dictdetaServcice.queryDictName(DictConstant.BDK_STATUS, bdkStatus));
String cxbdkStatus = (String)map.get("cxbdkStatus");
map.put("cxbdkStatus", dictdetaServcice.queryDictName(DictConstant.CXRZ_STATUS, cxbdkStatus));
String confirmUser = (String)map.get("confirmUser");
if(StringUtils.isEmpty(confirmUser) && "4".equals(authStatus)){
map.put("confirmUser","admin");
}
// if (cxrzModels!=null){
// for (DictdetaModel model:cxrzModels){
// if (model.getDictcode().equals(map.get("cxbdkStatus"))){

@ -101,6 +101,11 @@ public class ExtFpzhcxServiceImpl extends MpBaseServiceImpl<ExtBbfpzhDao, ExtBbf
AmountFormatUtil.fmtMicrometer(MathUtil.round(resultList.get(i).getTaxAmount())));
}
}
String rzhr = resultList.get(i).getRzhr();
String rzclzt = resultList.get(i).getRzclzt();
if(StringUtils.isEmpty(rzhr) && "4".equals(rzclzt)){
resultList.get(i).setRzhr("admin");
}
resultList.get(i)
.setTaxAmount(AmountFormatUtil.fmtMicrometer(MathUtil.round(resultList.get(i).getTaxAmount())));
@ -117,7 +122,7 @@ public class ExtFpzhcxServiceImpl extends MpBaseServiceImpl<ExtBbfpzhDao, ExtBbf
.setInvoiceStatus(dictdetaServcice.queryDictName(DictConstant.INVOICE_STATUS, invoiceStatus));
String rzzt = resultList.get(i).getRzzt();
resultList.get(i).setRzzt(dictdetaServcice.queryDictName(DictConstant.DEDU_STATUS, rzzt));
String rzclzt = resultList.get(i).getRzclzt();
resultList.get(i).setRzclzt(dictdetaServcice.queryDictName(DictConstant.AUTH_STATUS_ALL, rzclzt));
String qszt = resultList.get(i).getQszt();
resultList.get(i).setQszt(dictdetaServcice.queryDictName(DictConstant.QS_STATUS, qszt));

Loading…
Cancel
Save