diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/config/ErpWebConfiguration.java b/dxhy-erp/src/main/java/com/dxhy/erp/config/ErpWebConfiguration.java index f5b39590..8b1c373a 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/config/ErpWebConfiguration.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/config/ErpWebConfiguration.java @@ -59,7 +59,7 @@ public class ErpWebConfiguration implements WebMvcConfigurer { */ private ArrayList getIncludePathPatterns() { ArrayList list = new ArrayList<>(); - String[] urls = {"/order/**"}; + String[] urls = {"/order/**,/sn/**"}; Collections.addAll(list, urls); return list; } diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java b/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java index 9981c76b..8a07e574 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java @@ -8,6 +8,7 @@ import com.dxhy.common.constant.ConfigureConstant; import com.dxhy.common.controller.AbstractController; import com.dxhy.common.enums.SNFplxEnum; import com.dxhy.common.util.InvoiceUtil; +import com.dxhy.common.util.UserInfoUtil; import com.dxhy.common.utils.R; import com.dxhy.erp.dao.TdxSaleRecordInvoiceDao; import com.dxhy.erp.entity.TDxInvoiceReimburse; @@ -73,14 +74,14 @@ public class SDNYMainProcessController extends AbstractController { @SysLog("发票查验") public ResponseEntity singleInvoiceCheck(@RequestBody Map pramsMap) throws ParseException { log.info("传入的参数为:{}", pramsMap); - String userid = "101833"; - String dbName = "business"; - String company = "BIGB"; +// String userid = "101833"; +// String dbName = "business"; +// String company = "BIGB"; // 入参统一在入口处理 -// String userid = getLoginName(); -// String dbName = getUserInfo().getDbName(); -// String company = getUserInfo().getCompany(); + String userid = getLoginName(); + String dbName = getUserInfo().getDbName(); + String company = getUserInfo().getCompany(); JSONObject checkInvoiceResult = null; InvoiceUtil iu = new InvoiceUtil(pramsMap.get("invoiceCode")); String fplxdm = iu.getFplxdm(); @@ -229,10 +230,12 @@ public class SDNYMainProcessController extends AbstractController { checkInvoice.put("invoiceNumber", checkInvoice.get("invoiceNo").toString()); String kprq = checkInvoice.get("invoiceDate").toString(); - String str = new SimpleDateFormat("yyyy-MM-dd").format(kprq); - log.info("开票日期为:{} ", str); + SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US); + Date date = sdf.parse(kprq); + String formatStr = new SimpleDateFormat("yyyy-MM-dd").format(date); + log.info("开票日期为:{} ", formatStr); - checkInvoice.put("billingDate", str); + checkInvoice.put("billingDate", formatStr); checkInvoice.put("purchaserName", checkInvoice.get("gfName")); checkInvoice.put("purchaserTaxNo", checkInvoice.get("gfTaxNo")); checkInvoice.put("purchaserBank", checkInvoice.get("gfBankAndNo")); @@ -347,20 +350,20 @@ public class SDNYMainProcessController extends AbstractController { log.info("影像系统同步数据:{}", JSONObject.toJSONString(snRequestObject)); - String userid = "101833"; - String dbName = "business"; - String company = "BIGB"; - String taxNo = "9111112222333344DD"; +// String userid = "101833"; +// String dbName = "business"; +// String company = "BIGB"; +// String taxNo = "9111112222333344DD"; // // 入参统一在入口处理 -// String userid = getLoginName(); -// String dbName = getUserInfo().getDbName(); -// String company = getUserInfo().getCompany(); -// List gfshAll = UserInfoUtil.getGfshAll(getUserInfo().getOrg()); -// String gfsh = ""; -// if (gfshAll.size() > 0) { -// gfsh = gfshAll.get(0); -// } + String userid = getLoginName(); + String dbName = getUserInfo().getDbName(); + String company = getUserInfo().getCompany(); + List gfshAll = UserInfoUtil.getGfshAll(getUserInfo().getOrg()); + String gfsh = ""; + if (gfshAll.size() > 0) { + gfsh = gfshAll.get(0); + } String result = ""; @@ -391,7 +394,7 @@ public class SDNYMainProcessController extends AbstractController { for (SNInvoice invoice : invoiceInfoList) { String fplxdm = ""; String snFplx = ""; - result = snPushCheckRecordService.updateInvoicePoll(company, taxNo, reimburse, invoice, fplxdm, imageId, compCode); + result = snPushCheckRecordService.updateInvoicePoll(company, gfsh, reimburse, invoice, fplxdm, imageId, compCode); //价税分离判断 if (!"ok".equals(result) && !"0000".equals(result)) { diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/entity/TdxSaleRecordInvoice.java b/dxhy-erp/src/main/java/com/dxhy/erp/entity/TdxSaleRecordInvoice.java index 15852206..816b73fd 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/entity/TdxSaleRecordInvoice.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/entity/TdxSaleRecordInvoice.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.math.BigDecimal; @@ -42,6 +43,7 @@ public class TdxSaleRecordInvoice implements Serializable { /** * 开票日期 */ + @DateTimeFormat(pattern="yyyy-MM-dd") private Date invoiceDate; /** diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java index 94a122d2..ab1555b9 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java @@ -104,7 +104,17 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { return post; } - public String pushInvoiceToRecordInvoice(SNInvoice snInvoice, String taxNo, String company) throws Exception { + public String pushInvoiceToRecordInvoice(SNInvoice snInvoice, String taxNo, String company,String compCode) throws Exception { + + BaseTDxRecordInvoice recordInvoice = new BaseTDxRecordInvoice(); + DynamicContextHolder.push(DbConstant.BASICS_READ); + + SysDeptEntity orgByCompCode = sysDeptDao.getOrgByCompCode(compCode); + log.info("查询的组织信息为:{}",JSONObject.toJSONString(orgByCompCode)); + recordInvoice.setGfTaxNo(orgByCompCode.getTaxno()); + recordInvoice.setGfName(orgByCompCode.getTaxname()); + recordInvoice.setGfAddressAndPhone(orgByCompCode.getAddress() + orgByCompCode.getPhone()); + recordInvoice.setGfBankAndNo(orgByCompCode.getBank() + orgByCompCode.getAccount()); QueryWrapper currentWrapper = new QueryWrapper<>(); currentWrapper.eq("taxno", taxNo); @@ -135,7 +145,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { String gfmc = snInvoice.getPurchaserName(); String invoiceType = snInvoice.getInvoiceType(); - BaseTDxRecordInvoice recordInvoice = new BaseTDxRecordInvoice(); + recordInvoice.setUuid(fpdm + fphm); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); if (kprq != null) { @@ -593,13 +603,15 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { reimburse = convertToReimburse(invoice, reimburse, fplxdm, company); + log.info("插库的发票信息:{}",reimburse); + DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); int insert = 0; QueryWrapper wrapper = new QueryWrapper(); wrapper.eq("uuid", reimburse.getUuid()); TDxInvoiceReimburse reimburse1 = tDxInvoiceReimburseService.getBaseMapper().selectOne(wrapper); if (reimburse1 != null) { - insert = tDxInvoiceReimburseService.getBaseMapper().updateById(reimburse1); + insert = tDxInvoiceReimburseService.getBaseMapper().updateById(reimburse); } else { insert = tDxInvoiceReimburseService.getBaseMapper().insert(reimburse); } @@ -616,7 +628,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { log.info("可查验发票,更新底账库完成"); } else { //不可查验发票,未入库,插入票池 - this.pushInvoiceToRecordInvoice(invoice, taxNo, company); + this.pushInvoiceToRecordInvoice(invoice, taxNo, company,compCode); log.info("不可查验发票,插入底账库成功"); } @@ -653,11 +665,6 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { reimburse.setXfAddressAndPhone(invoice.getSalesAddressPhone()); reimburse.setXfBankAndNo(invoice.getSalesBank()); - reimburse.setGfTaxNo(invoice.getPurchaserTaxNo()); - reimburse.setGfName(invoice.getPurchaserName()); - reimburse.setGfAddressAndPhone(invoice.getPurchaserAddressPhone()); - reimburse.setGfBankAndNo(invoice.getPurchaserBank()); - reimburse.setTaxRate(invoice.getTaxRate()); reimburse.setIsDeduction(invoice.getIsDeductible()); diff --git a/dxhy-erp/src/main/resources/bootstrap-std.yaml b/dxhy-erp/src/main/resources/bootstrap-std.yaml index 588bf1e1..d2241fff 100644 --- a/dxhy-erp/src/main/resources/bootstrap-std.yaml +++ b/dxhy-erp/src/main/resources/bootstrap-std.yaml @@ -4,13 +4,13 @@ spring: nacos: config: # Nacos config 地址 - server-addr: 172.31.36.143:33000 + server-addr: 172.31.36.147:33000 # Nacos config 命名空间,对应配置中的名称(dxhy-jxpt-namespace) - namespace: b271ba8e-84d9-4393-88b8-9271aff9465c + namespace: eb6eab27-62a4-4ccf-8640-b8e91df0a1a6 # Nacos config 分组 group: dxhy-erp-group # Nacos config 登录用户名 - username: admin + username: nacos # Nacos config 登录密码 password: Invoice.nacos.!1 # Nacos config 配置文件前缀 @@ -19,9 +19,9 @@ spring: file-extension: yaml # Nacos discovery 配置 discovery: - server-addr: 172.31.36.143:33000 + server-addr: 172.31.36.147:33000 # Nacos config 登录用户名 - username: admin + username: nacos # Nacos config 登录密码 password: Invoice.nacos.!1 - namespace: b271ba8e-84d9-4393-88b8-9271aff9465c \ No newline at end of file + namespace: eb6eab27-62a4-4ccf-8640-b8e91df0a1a6 \ No newline at end of file diff --git a/dxhy-export-domestic/src/main/java/com/dxhy/domestic/controller/DomesticInvoiceDrawbackController.java b/dxhy-export-domestic/src/main/java/com/dxhy/domestic/controller/DomesticInvoiceDrawbackController.java index bb3a11ee..831ea0bd 100644 --- a/dxhy-export-domestic/src/main/java/com/dxhy/domestic/controller/DomesticInvoiceDrawbackController.java +++ b/dxhy-export-domestic/src/main/java/com/dxhy/domestic/controller/DomesticInvoiceDrawbackController.java @@ -42,22 +42,20 @@ public class DomesticInvoiceDrawbackController extends AbstractController { /** * 退税手工认证列表接口 * - * @param dto - * 参数 + * @param dto 参数 */ @PostMapping("/authentication_list") @ApiOperation(value = "退税手工认证列表接口") public ResponseEntity authenticationList(@RequestBody @Valid AuthenticationConditionDTO dto) { CommonListResponseVO resultVO = - domesticInvoiceDrawbackService.authenticationList(dto, getUserInfo()); + domesticInvoiceDrawbackService.authenticationList(dto, getUserInfo()); return ResponseEntity.ok(R.ok().put("data", responseResult(JSON.toJSONString(resultVO)))); } /** * 退税手工认证接口 * - * @param dto - * 参数 + * @param dto 参数 */ @PostMapping("/authentication") @ApiOperation(value = "退税手工认证接口") @@ -70,8 +68,7 @@ public class DomesticInvoiceDrawbackController extends AbstractController { /** * 退税导入认证信息查询接口 * - * @param datalist - * 参数 + * @param datalist 参数 */ @ResponseBody @PostMapping("/import_authentication_check") @@ -79,24 +76,24 @@ public class DomesticInvoiceDrawbackController extends AbstractController { public ResponseEntity importAuthenticationCheck(@RequestBody Map datalist) { List dtoList = - JSON.parseArray(datalist.get("datalist"), AuthenticationImportDTO.class); + JSON.parseArray(datalist.get("datalist"), AuthenticationImportDTO.class); dtoList.forEach(dto -> { - dto.setInvoiceCode(dto.getInvoiceCode().replace(" ", "")); + if (dto.getInvoiceCode() != null) + dto.setInvoiceCode(dto.getInvoiceCode().replace(" ", "")); dto.setInvoiceDate(dto.getInvoiceDate().replace(" ", "")); dto.setInvoiceNo(dto.getInvoiceNo().replace(" ", "")); dto.setTaxAmount(dto.getTaxAmount().replace(" ", "")); }); String menuId = datalist.get("menuId"); CommonListResponseVO resultList = - domesticInvoiceDrawbackService.importAuthenticationCheck(dtoList, getUserInfo(), menuId); + domesticInvoiceDrawbackService.importAuthenticationCheck(dtoList, getUserInfo(), menuId); return ResponseEntity.ok(R.ok().put("data", responseResult(JSON.toJSONString(resultList)))); } /** * 退税认证查询接口 * - * @param dto - * 参数 + * @param dto 参数 */ @PostMapping("/authentication_check") @ApiOperation(value = "退税认证查询接口") @@ -105,15 +102,14 @@ public class DomesticInvoiceDrawbackController extends AbstractController { dto.setCompany(getUserInfo().getCompany()); } CommonListResponseVO responseVO = - domesticInvoiceDrawbackService.authenticationCheck(dto, getUserInfo()); + domesticInvoiceDrawbackService.authenticationCheck(dto, getUserInfo()); return ResponseEntity.ok(R.ok().put("data", responseResult(JSON.toJSONString(responseVO)))); } /** * 请求结果加密封装 * - * @param json - * json + * @param json json */ private String responseResult(String json) { String jsonString = null; diff --git a/dxhy-sign/src/main/resources/mapper/SignInvoiceMapper.xml b/dxhy-sign/src/main/resources/mapper/SignInvoiceMapper.xml index d20485af..4421119a 100644 --- a/dxhy-sign/src/main/resources/mapper/SignInvoiceMapper.xml +++ b/dxhy-sign/src/main/resources/mapper/SignInvoiceMapper.xml @@ -32,7 +32,7 @@