diff --git a/evcs-modules/evcs-core/src/main/resources/bootstrap.yml b/evcs-modules/evcs-core/src/main/resources/bootstrap.yml index 200f8415..1cd5322f 100644 --- a/evcs-modules/evcs-core/src/main/resources/bootstrap.yml +++ b/evcs-modules/evcs-core/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-auth/src/main/resources/bootstrap.yml b/ruoyi-auth/src/main/resources/bootstrap.yml index e7e2a0b1..bd7dd225 100644 --- a/ruoyi-auth/src/main/resources/bootstrap.yml +++ b/ruoyi-auth/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-common/ruoyi-common-security/src/main/java/com/xhpc/common/security/service/TokenService.java b/ruoyi-common/ruoyi-common-security/src/main/java/com/xhpc/common/security/service/TokenService.java index 392a3c19..db7e5354 100644 --- a/ruoyi-common/ruoyi-common-security/src/main/java/com/xhpc/common/security/service/TokenService.java +++ b/ruoyi-common/ruoyi-common-security/src/main/java/com/xhpc/common/security/service/TokenService.java @@ -27,7 +27,7 @@ public class TokenService { @Autowired private RedisService redisService; - private final static long EXPIRE_TIME = Constants.TOKEN_EXPIRE * 60; + private final static long EXPIRE_TIME = Constants.TOKEN_EXPIRE * 6000; private final static String ACCESS_TOKEN = CacheConstants.LOGIN_TOKEN_KEY; diff --git a/ruoyi-gateway/src/main/java/com/xhpc/gateway/filter/AuthFilter.java b/ruoyi-gateway/src/main/java/com/xhpc/gateway/filter/AuthFilter.java index a6d18156..69394c89 100644 --- a/ruoyi-gateway/src/main/java/com/xhpc/gateway/filter/AuthFilter.java +++ b/ruoyi-gateway/src/main/java/com/xhpc/gateway/filter/AuthFilter.java @@ -34,6 +34,7 @@ import javax.annotation.Resource; */ @Component public class AuthFilter implements GlobalFilter, Ordered { + private static final Logger log = LoggerFactory.getLogger(AuthFilter.class); private final static long EXPIRE_TIME = Constants.TOKEN_EXPIRE * 60; @@ -50,6 +51,7 @@ public class AuthFilter implements GlobalFilter, Ordered { @Override public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { + String url = exchange.getRequest().getURI().getPath(); // 跳过不需要验证的路径 if (StringUtils.matches(url, ignoreWhite.getWhites())) { @@ -80,7 +82,7 @@ public class AuthFilter implements GlobalFilter, Ordered { .header(CacheConstants.DETAILS_USERNAME, ServletUtils.urlEncode(username)).build(); ServerWebExchange mutableExchange = exchange.mutate().request(mutableReq).build(); - return chain.filter(mutableExchange); + return chain.filter(exchange); } private Mono setUnauthorizedResponse(ServerWebExchange exchange, String msg) { diff --git a/ruoyi-gateway/src/main/resources/bootstrap.yml b/ruoyi-gateway/src/main/resources/bootstrap.yml index 2a75caef..9bc1a55c 100644 --- a/ruoyi-gateway/src/main/resources/bootstrap.yml +++ b/ruoyi-gateway/src/main/resources/bootstrap.yml @@ -16,10 +16,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 @@ -35,7 +35,7 @@ spring: datasource: ds1: nacos: - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 dataId: sentinel-ruoyi-gateway groupId: DEFAULT_GROUP data-type: json diff --git a/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml index 6c2cdb09..f1b6134d 100644 --- a/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml index de9b5154..48d8988c 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml index cce34971..65b833c4 100644 --- a/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml index 6881c7e6..9f189be1 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml b/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml index e61a355f..4a049625 100644 --- a/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml +++ b/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java index 1ccc4f00..71868ba8 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java @@ -193,10 +193,10 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService { if (xhpc.getSerialNumber() != xhpc.getSerialNumber()) { return AjaxResult.error("桩编号不能编辑"); } - if(xhpcChargingPile.getGunNumber() ==null || xhpcChargingPile.getGunNumber()>26){ + if (xhpcChargingPile.getGunNumber() == null || xhpcChargingPile.getGunNumber() > 26) { return AjaxResult.error("终端数量不能大于26"); } - if (!xhpcChargingPile.getGunNumber().equals(xhpc.getGunNumber())) { + if (!xhpcChargingPile.getGunNumber().equals(xhpc.getGunNumber()) || !xhpcChargingPile.getSerialNumber().equals(xhpc.getSerialNumber())) { //删除之前的终端 xhpcChargingPileMapper.updateXhpcTerminal(chargingPileId); int number = xhpcChargingPileMapper.countXhpcTerminal(xhpcChargingPile.getChargingStationId()); diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/constant/AliyunSendResult.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/constant/AliyunSendResult.java new file mode 100644 index 00000000..369e3d9a --- /dev/null +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/constant/AliyunSendResult.java @@ -0,0 +1,17 @@ +package com.xhpc.general.constant; + +/** + * 阿里云短信服务发送结果常量类 + * + * @author WH + * @date 2021/12/30 14:56 + * @since version-1.0 + */ +public class AliyunSendResult { + + /** + * 短信发送成功 + */ + public static final String SUCCESS = "OK"; + +} diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/constant/AliyunTemplate.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/constant/AliyunTemplate.java new file mode 100644 index 00000000..e04df85b --- /dev/null +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/constant/AliyunTemplate.java @@ -0,0 +1,42 @@ +package com.xhpc.general.constant; + +/** + * 阿里云短信模板常量类 + * + * @author WH + * @date 2021/12/30 14:40 + * @since version-1.0 + */ +public class AliyunTemplate { + + /** + * 阿里云短信签名 + */ + public static final String SIGNATURE_NAME = "小华充电"; + /** + * 电量充满 + */ + public static final String CHARGE_FULL = "SMS_227005968"; + /** + * 充电金额不足 + */ + public static final String CHARGE_MONEY_INSUFFICIENT = "SMS_226935795"; + /** + * 直流桩停止充电 + */ + public static final String DIRECT_STREAM_PILE_STOP_CHARGE = "SMS_226945037"; + /** + * 直流桩停止充电 + */ + public static final String INTERFLOW_STREAM_PILE_STOP_CHARGE = "SMS_226786374"; + /** + * 验证码 + */ + public static final String VALIDATE_CODE = "SMS_226786362"; + /** + * 退款失败 + */ + public static final String REFUND_FAIL = "SMS_231445428"; + + +} diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/constant/AliyunTemplateKeyWord.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/constant/AliyunTemplateKeyWord.java new file mode 100644 index 00000000..0e46ec9d --- /dev/null +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/constant/AliyunTemplateKeyWord.java @@ -0,0 +1,38 @@ +package com.xhpc.general.constant; + +/** + * 阿里云模板内容关键字常量类 + * 根据模板话语判断该调用哪个模板id + * + * @author WH + * @date 2021/12/30 15:59 + * @since version-1.0 + */ +public class AliyunTemplateKeyWord { + + /** + * 电量充满 + */ + public static final String CHARGE_FULL = "设定的SOC"; + /** + * 充电金额不足 + */ + public static final String CHARGE_MONEY_INSUFFICIENT = "余额小于"; + /** + * 直流桩停止充电 + */ + public static final String DIRECT_STREAM_PILE_STOP_CHARGE = "电量为"; + /** + * 直流桩停止充电 + */ + public static final String INTERFLOW_STREAM_PILE_STOP_CHARGE = "总费用为"; + /** + * 验证码 + */ + public static final String VALIDATE_CODE = "SMS_226786362"; + /** + * 退款失败 + */ + public static final String REFUND_FAIL = "退款-尊敬的用户"; + +} diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcSmsController.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcSmsController.java index 3d765ae4..72327ae2 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcSmsController.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcSmsController.java @@ -1,11 +1,10 @@ package com.xhpc.general.controller; -import com.xhpc.common.api.UserTypeService; -import com.xhpc.common.core.domain.R; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; -import com.xhpc.common.util.UserTypeUtil; +import com.xhpc.general.constant.AliyunTemplate; +import com.xhpc.general.constant.AliyunTemplateKeyWord; import com.xhpc.general.service.IXhpcSmsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -23,13 +22,12 @@ public class XhpcSmsController extends BaseController { @Autowired private IXhpcSmsService xhpcSmsService; - @Autowired - private UserTypeService userTypeService; + /** * 注册获取手机号验证码 */ @GetMapping(value = "/getLogonPhoneCode") - public AjaxResult getLogonPhoneCode(@RequestParam("phone") String phone,@RequestParam("tenantId")String tenantId) { + public AjaxResult getLogonPhoneCode(@RequestParam("phone") String phone) { String signatureName = null; String templateId = null; @@ -37,20 +35,7 @@ public class XhpcSmsController extends BaseController { signatureName = "小华充电"; templateId = "SMS_226786362"; - if(phone !=null || "".equals(phone)){ - if(!UserTypeUtil.COMMUNIT.equals(phone.substring(0,2)) && !UserTypeUtil.CUSTOMERS.equals(phone.substring(0,2))){ - //C端用户 - return xhpcSmsService.getLogonPhoneCode(phone, signatureName, templateId,null); - }else if (UserTypeUtil.COMMUNIT.equals(phone.substring(0,2)) || UserTypeUtil.CUSTOMERS.equals(phone.substring(0,2))){ - R user = userTypeService.getUser(phone, null, null, null,tenantId); - if(user !=null && user.getData() !=null){ - Map map = (Map)user.getData(); - return xhpcSmsService.getLogonPhoneCode(map.get("phone").toString(), signatureName, templateId,map.get("account").toString()); - } - } - } - return AjaxResult.error("1003", "请输入正确的手机号或账号"); - + return xhpcSmsService.getLogonPhoneCode(phone, signatureName, templateId); } @GetMapping(value = "/getList") @@ -75,21 +60,21 @@ public class XhpcSmsController extends BaseController { paramMap.remove("phone"); paramMap.remove("content"); //判断内容是什么,调用相应的模板 - if (content.contains("电量为")) { - signatureName = "小华充电"; - templateId = "SMS_226945037"; - } else if (content.contains("总费用为")) { - signatureName = "小华充电"; - templateId = "SMS_226786374"; - } else if (content.contains("余额小于")) { - signatureName = "小华充电"; - templateId = "SMS_226935795"; - } else if (content.contains("设定的SOC")) { - signatureName = "小华充电"; - templateId = "SMS_227005968"; - }else if (content.contains("退款-尊敬的用户")) { - signatureName = "小华充电"; - templateId = "SMS_231445428"; + if (content.contains(AliyunTemplateKeyWord.DIRECT_STREAM_PILE_STOP_CHARGE)) { + signatureName = AliyunTemplate.SIGNATURE_NAME; + templateId = AliyunTemplate.DIRECT_STREAM_PILE_STOP_CHARGE; + } else if (content.contains(AliyunTemplateKeyWord.INTERFLOW_STREAM_PILE_STOP_CHARGE)) { + signatureName = AliyunTemplate.SIGNATURE_NAME; + templateId = AliyunTemplate.INTERFLOW_STREAM_PILE_STOP_CHARGE; + } else if (content.contains(AliyunTemplateKeyWord.CHARGE_MONEY_INSUFFICIENT)) { + signatureName = AliyunTemplate.SIGNATURE_NAME; + templateId = AliyunTemplate.CHARGE_MONEY_INSUFFICIENT; + } else if (content.contains(AliyunTemplateKeyWord.CHARGE_FULL)) { + signatureName = AliyunTemplate.SIGNATURE_NAME; + templateId = AliyunTemplate.CHARGE_FULL; + } else if (content.contains(AliyunTemplateKeyWord.REFUND_FAIL)) { + signatureName = AliyunTemplate.SIGNATURE_NAME; + templateId = AliyunTemplate.REFUND_FAIL; } xhpcSmsService.sendNotice(phone, signatureName, templateId, paramMap); @@ -100,9 +85,4 @@ public class XhpcSmsController extends BaseController { Object messageInfo = xhpcSmsService.getAliyunShortMessageInfo(); return AjaxResult.success(messageInfo); } - - public static void main(String[] args) { - String phone="ST18123374"; - System.out.println(phone.substring(0,2)); - } } diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcSmsServiceImpl.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcSmsServiceImpl.java index 79799940..6594514b 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcSmsServiceImpl.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcSmsServiceImpl.java @@ -7,6 +7,8 @@ import com.aliyun.dysmsapi20170525.models.SendSmsResponse; import com.aliyun.dysmsapi20170525.models.SendSmsResponseBody; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.redis.service.RedisService; +import com.xhpc.general.constant.AliyunSendResult; +import com.xhpc.general.constant.AliyunTemplate; import com.xhpc.general.domain.XhpcSms; import com.xhpc.general.mapper.XhpcSmsMapper; import com.xhpc.general.util.sms.SmsUtil; @@ -115,7 +117,7 @@ public class XhpcSmsServiceImpl implements IXhpcSmsService { //判断发送结果 String statusCode = neededParam.get("statusCode"); - if (statusCode.equals("OK")) { + if (statusCode.equals(AliyunSendResult.SUCCESS)) { REDIS.setCacheObject(pvToken, random, 300L, TimeUnit.SECONDS); //1分钟有效时间设置,防止用户频繁调用 REDIS.setCacheObject(token, random, 60L, TimeUnit.SECONDS); @@ -164,7 +166,7 @@ public class XhpcSmsServiceImpl implements IXhpcSmsService { //判断发送结果 String statusCode = neededParam.get("statusCode"); - if ("OK".equals(statusCode)) { + if (AliyunSendResult.SUCCESS.equals(statusCode)) { xhpcSms.setStatus(0); } else { xhpcSms.setStatus(1); @@ -229,40 +231,30 @@ public class XhpcSmsServiceImpl implements IXhpcSmsService { private String getTemplateContent(String templateId, Map paramMap) throws Exception { - if (templateId == "SMS_227005968") { + if (AliyunTemplate.CHARGE_FULL.equals(templateId)) { String battery = paramMap.get("battery"); - String templateContent = "尊敬的用户,你的车辆已充电达至设定的SOC:" + battery + "%并停止充电,请您尽快将车辆挪走以方便他人使用充电桩,谢谢合作。"; - return templateContent; + return "尊敬的用户,你的车辆已充电达至设定的SOC:" + battery + "%并停止充电,请您尽快将车辆挪走以方便他人使用充电桩,谢谢合作。"; } - if (templateId == "SMS_226935795") { + if (AliyunTemplate.CHARGE_MONEY_INSUFFICIENT.equals(templateId)) { String money = paramMap.get("money"); - String templateContent = "尊敬的用户,你的账户余额小于" + money + "元,为不影响您的正常充电,请您尽快充值交费,谢谢。"; - return templateContent; + return "尊敬的用户,你的账户余额小于" + money + "元,为不影响您的正常充电,请您尽快充值交费,谢谢。"; } - if (templateId == "SMS_226786374") { - String sumMoney = paramMap.get("sumMoney"); - String templateContent = "尊敬的用户,你的爱车已停止充电,请尽快挪车。总费用为:" + sumMoney + "元,充电费用明细,请查询小华充电小程序,谢谢。"; - return templateContent; - } - if (templateId == "SMS_227005968") { + if (AliyunTemplate.DIRECT_STREAM_PILE_STOP_CHARGE.equals(templateId)) { String elec = paramMap.get("elec"); String sumMoney = paramMap.get("sumMoney"); - String templateContent = "尊敬的用户,你的爱车已停止充电,请尽快挪车。电量为:" + elec + ",总费用为:" + sumMoney + "元,充电费用明细,请查询小华充电小程序,谢谢。"; - return templateContent; + return "尊敬的用户,你的爱车已停止充电,请尽快挪车。电量为:" + elec + ",总费用为:" + sumMoney + "元,充电费用明细,请查询小华充电小程序,谢谢。"; } - if (templateId == "SMS_226786362") { + if (AliyunTemplate.INTERFLOW_STREAM_PILE_STOP_CHARGE.equals(templateId)) { + String sumMoney = paramMap.get("sumMoney"); + return "尊敬的用户,你的爱车已停止充电,请尽快挪车。总费用为:" + sumMoney + "元,充电费用明细,请查询小华充电小程序,谢谢。"; + } + if (AliyunTemplate.VALIDATE_CODE.equals(templateId)) { String code = paramMap.get("code"); - String templateContent = "您的验证码是:" + code + ",有效期为5分钟。如非本人操作,可不用理会。"; - return templateContent; + return "您的验证码是:" + code + ",有效期为5分钟。如非本人操作,可不用理会。"; } - if (templateId == "SMS_231445428") { - String templateContent = "【小华充电】退款-尊敬的用户,当前退款人数较多,申请退款失败,请您重新提交申请!"; - return templateContent; + if (AliyunTemplate.REFUND_FAIL.equals(templateId)) { + return "【小华充电】退款-尊敬的用户,当前退款人数较多,申请退款失败,请您重新提交申请!"; } - throw new Exception("没有对应的模板id"); - } - - } diff --git a/xhpc-modules/xhpc-general/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-general/src/main/resources/bootstrap.yml index 8c383dbe..d1cc6f1e 100644 --- a/xhpc-modules/xhpc-general/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-general/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-invoice/pom.xml b/xhpc-modules/xhpc-invoice/pom.xml index 0d54c218..2cae6d59 100644 --- a/xhpc-modules/xhpc-invoice/pom.xml +++ b/xhpc-modules/xhpc-invoice/pom.xml @@ -109,6 +109,12 @@ 3.0.0 compile + + com.aliyun.oss + aliyun-sdk-oss + 3.10.2 + compile + diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/api/XhpcInvoiceApiController.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/api/XhpcInvoiceApiController.java index 35198b86..0f4c192d 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/api/XhpcInvoiceApiController.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/api/XhpcInvoiceApiController.java @@ -2,6 +2,8 @@ package com.xhpc.invoice.api; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import com.xhpc.invoice.domain.*; import com.xhpc.invoice.service.XhpcInvoiceService; import org.springframework.web.bind.annotation.*; @@ -22,6 +24,35 @@ public class XhpcInvoiceApiController extends BaseController { @Resource XhpcInvoiceService xhpcInvoiceService; + /** + * 查询用户显示小红点,即查询用户有几个未读的已开发票 + * + * @author WH + * @date 2021/12/28 18:51 + * @since version-1.0 + */ + @GetMapping("/user/no-read") + public AjaxResult findNotReadCount(@RequestParam Long creatorId, @RequestParam Integer creatorType) { + + Long notRead = xhpcInvoiceService.findNotReadCount(creatorId, creatorType); + return AjaxResult.success(notRead); + } + + /** + * 保存用户提交的开发票的信息 + * + * @author WH + * @date 2021/12/28 14:54 + * @since version-1.0 + */ + @Log(title = "用户要开发票", businessType = BusinessType.INSERT) + @PostMapping("/user/commit") + public AjaxResult saveInvoiceInfo(@RequestBody SaveInvoiceInfoRequest saveInvoiceInfoRequest) throws Exception { + + xhpcInvoiceService.saveInvoiceInfo(saveInvoiceInfoRequest); + return AjaxResult.success(); + } + /** * 查询用户开发票的历史记录 * @@ -29,15 +60,15 @@ public class XhpcInvoiceApiController extends BaseController { * @date 2021/12/27 12:23 * @since version-1.0 */ - @PostMapping(value = "/selectInvoiceHistoryRecords") - public AjaxResult selectInvoiceHistoryRecords(@RequestBody InvoiceHistoryRecordsRequest invoiceHistoryRecordsRequest) { + @GetMapping(value = "/user/history") + public AjaxResult findInvoiceHistoryRecords(@RequestBody InvoiceHistoryRecordsRequest invoiceHistoryRecordsRequest) { - InvoiceHistoryRecordsResponse invoiceHistoryRecordsResponse = xhpcInvoiceService.selectInvoiceHistoryRecords(invoiceHistoryRecordsRequest); + InvoiceHistoryRecordsResponse invoiceHistoryRecordsResponse = xhpcInvoiceService.findInvoiceHistoryRecords(invoiceHistoryRecordsRequest); return AjaxResult.success(invoiceHistoryRecordsResponse); } /** - * 回显已经处理的开的的电子发票的详情信息 + * 回显电子发票详情信息 * * @param invoiceId 要回显的发票id * @return 返回包含了指定数据的AjaxResult @@ -45,28 +76,28 @@ public class XhpcInvoiceApiController extends BaseController { * @date 2021/12/27 13:11 * @since version-1.0 */ - @GetMapping(value = "/selectSpecificInvoiced") - public AjaxResult selectSpecificInvoiced(@RequestParam Long invoiceId) { + @GetMapping(value = "/specific-info") + public AjaxResult findSpecificInvoicedInfo(@RequestParam Long invoiceId) { - SpecificInvoicedResponse specificInvoicedResponse = xhpcInvoiceService.selectSpecificInvoiced(invoiceId); + SpecificInvoicedResponse specificInvoicedResponse = xhpcInvoiceService.findSpecificInvoicedInfo(invoiceId); return AjaxResult.success(specificInvoicedResponse); } /** - * 根据用户id,用户类型,要查询的当前时间的年月日,查询该用户3个月内可以开发票的订单 + * 根据用户id,用户类型,要查询的当前时间的年月日,查询该用户3个月内可以开发票的历史订单 * * @author WH * @date 2021/12/24 14:10 * @since version-1.0 */ - @PostMapping(value = "/selectInvoicedOrders") - public AjaxResult selectInvoicedOrders(@RequestBody InvoicedOrdersRequest invoicedOrdersRequest) { + @GetMapping(value = "/user/history-orders") + public AjaxResult findUserHistoryOrders(@RequestBody InvoicedOrdersRequest invoicedOrdersRequest) { if (invoicedOrdersRequest.getCurrentPage() == null || invoicedOrdersRequest.getItems() == null) { return AjaxResult.error("分页参数不能为空:当前页数参数或当页要显示的条数为空"); } - InvoiceOrdersResponse invoiceOrdersResponse = xhpcInvoiceService.selectInvoicedOrders(invoicedOrdersRequest); + InvoiceOrdersResponse invoiceOrdersResponse = xhpcInvoiceService.findUserHistoryOrders(invoicedOrdersRequest); return AjaxResult.success(invoiceOrdersResponse); @@ -79,24 +110,24 @@ public class XhpcInvoiceApiController extends BaseController { * @date 2021/12/23 15:07 * @since version-1.0 */ - @GetMapping(value = "/selectInvoiceTitleInfo") - public AjaxResult selectInvoiceTitleInfo(@RequestParam(value = "firmName") String firmName) { + @GetMapping(value = "/title-info") + public AjaxResult findTitleInfo(@RequestParam(value = "firmName") String firmName) { - InvoiceTitleResponse invoiceTitleResponse = xhpcInvoiceService.selectInvoiceTitleInfo(firmName); + InvoiceTitleResponse invoiceTitleResponse = xhpcInvoiceService.findTitleInfo(firmName); return AjaxResult.success(invoiceTitleResponse); } /** - * 查询用户最后一次输入的发票信息 + * 查询用户最后一次所提交的发票信息 * * @author WH * @date 2021/12/23 15:07 * @since version-1.0 */ - @GetMapping(value = "/selectUserInputInvoiceInfo") - public AjaxResult selectUserInputInvoiceInfo(@RequestParam(value = "creatorId") Long creatorId, @RequestParam("creatorType") Integer creatorType) { + @GetMapping(value = "/user/last-info") + public AjaxResult findUserLastInputInfo(@RequestParam(value = "creatorId") Long creatorId, @RequestParam("creatorType") Integer creatorType) { - TitleResponse titleResponse = xhpcInvoiceService.selectUserInputInvoiceInfo(creatorId, creatorType); + TitleResponse titleResponse = xhpcInvoiceService.findUserLastInputInfo(creatorId, creatorType); return AjaxResult.success(titleResponse); } diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constant/InvoiceMapHistoryOrderStatusConst.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constant/InvoiceMapHistoryOrderStatusConst.java new file mode 100644 index 00000000..185c5333 --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constant/InvoiceMapHistoryOrderStatusConst.java @@ -0,0 +1,27 @@ +package com.xhpc.invoice.constant; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 发票所包含的订单状态的常量类 + * + * @author WH + * @date 2021/12/29 10:34 + * @since version-1.0 + */ +@Data +@NoArgsConstructor +public class InvoiceMapHistoryOrderStatusConst { + + /** + * 已被发票包含,即锁定 + */ + public static final Integer LOCK = 0; + + /** + * 解除发票包含关系,即解锁 + */ + public static final Integer UNLOCK = 0; + +} diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constPackage/InvoiceStatusConst.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constant/InvoiceStatusConst.java similarity index 92% rename from xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constPackage/InvoiceStatusConst.java rename to xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constant/InvoiceStatusConst.java index 8615d4af..111f5272 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constPackage/InvoiceStatusConst.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/constant/InvoiceStatusConst.java @@ -1,4 +1,4 @@ -package com.xhpc.invoice.constPackage; +package com.xhpc.invoice.constant; import lombok.Data; import lombok.NoArgsConstructor; diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/controller/XhpcInvoiceController.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/controller/XhpcInvoiceController.java index c9126f51..646a9a4e 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/controller/XhpcInvoiceController.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/controller/XhpcInvoiceController.java @@ -1,19 +1,26 @@ package com.xhpc.invoice.controller; +import com.aliyun.oss.OSSClient; +import com.xhpc.common.core.utils.DateUtils; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; -import com.xhpc.invoice.constPackage.InvoiceStatusConst; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; +import com.xhpc.invoice.constant.InvoiceStatusConst; import com.xhpc.invoice.domain.AllInvoiceOrdersRequest; import com.xhpc.invoice.domain.AllInvoiceOrdersResponse; import com.xhpc.invoice.domain.InvoiceToUserRequest; import com.xhpc.invoice.domain.SpecificInvoiceWrap; import com.xhpc.invoice.service.XhpcInvoiceService; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.core.env.Environment; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; import java.util.Map; /** @@ -29,6 +36,51 @@ public class XhpcInvoiceController extends BaseController { @Resource XhpcInvoiceService xhpcInvoiceService; + @Resource + Environment environment; + + /** + * 导出发票Excel接口 + * + * @author WH + * @date 2021/12/29 16:45 + * @since version-1.0 + */ + @GetMapping("/excel") + public AjaxResult exportExcel(@RequestParam("invoiceIds") String invoiceIds, HttpServletResponse response) throws IOException { + //处理字符串,转换成数组 + String[] ids = invoiceIds.split(","); + List resultList = Arrays.asList(ids); + xhpcInvoiceService.exportExcel(resultList, response); + return AjaxResult.success(); + } + + + /** + * 上传图片到阿里云接口 + * + * @param invoicePdf 文件二进制对象 + * @return 该文件在阿里云中的地址 + * + * @author WH + * @date 2021/12/29 16:40 + * @since version-1.0 + */ + @Log(title = "电子发票上传", businessType = BusinessType.INSERT) + @PostMapping("/pdf") + public AjaxResult uploadPdf(MultipartFile invoicePdf) throws IOException { + + String filename = "electricInvoice" + DateUtils.dateTimeNow() + ".pdf"; + // 上传文件到阿里云 + OSSClient ossClient = new OSSClient(environment.getProperty("oss.endpoint"), environment.getProperty("oss.access-key"), environment.getProperty("oss.secret-key")); + // 放置到哪个块中去,key为目录,file为文件 + ossClient.putObject(environment.getProperty("oss.bucket-name"), environment.getProperty("file.aliyunPath") + filename, invoicePdf.getInputStream()); + ossClient.shutdown(); + // 返回上传到阿里云中的文件的uri地址 + String fileAddress = "/" + environment.getProperty("file.aliyunPath") + filename; + return AjaxResult.success(fileAddress); + } + /** * 给指定用户开发票,开票完成之后将开出的电子发票发送至用户的接收邮箱 @@ -38,7 +90,8 @@ public class XhpcInvoiceController extends BaseController { * @date 2021/12/22 12:03 * @since version-1.0 */ - @PostMapping("/invoiceToUser") + @Log(title = "用户提交发票状态", businessType = BusinessType.UPDATE) + @PatchMapping() public AjaxResult invoiceToUser(@RequestBody InvoiceToUserRequest requestData) { //前置条件 if (requestData.getInvoiceId() == null) { @@ -79,13 +132,13 @@ public class XhpcInvoiceController extends BaseController { * @date 2021/12/21 11:33 * @since version-1.0 */ - @PostMapping("/selectAllInvoiceOrders") - public AjaxResult selectAllInvoiceOrders(@RequestBody AllInvoiceOrdersRequest requestData) { + @GetMapping("/all-info") + public AjaxResult findAllInvoiceOrders(@RequestBody AllInvoiceOrdersRequest requestData) { if (requestData.getCurrentPage() == null || requestData.getItems() == null) { return AjaxResult.error("当前页数、每页要显示的条数为必传递项"); } - AllInvoiceOrdersResponse allInvoiceOrdersResponse = xhpcInvoiceService.selectAllInvoiceOrders(requestData); + AllInvoiceOrdersResponse allInvoiceOrdersResponse = xhpcInvoiceService.findAllInvoiceOrders(requestData); return AjaxResult.success(allInvoiceOrdersResponse); } @@ -98,11 +151,11 @@ public class XhpcInvoiceController extends BaseController { * @date 2021/12/20 10:48 * @since version-1.0 */ - @PostMapping("/selectSpecificInvoice") - public AjaxResult selectSpecificInvoice(@RequestBody Map invoiceIdMap) { + @GetMapping("/detail") + public AjaxResult findSpecificInvoice(@RequestBody Map invoiceIdMap) { Long invoiceId = Long.valueOf(String.valueOf(invoiceIdMap.get("invoiceId"))); - SpecificInvoiceWrap specificInvoiceWrap = xhpcInvoiceService.selectSpecificInvoice(invoiceId); + SpecificInvoiceWrap specificInvoiceWrap = xhpcInvoiceService.findSpecificInvoice(invoiceId); if (specificInvoiceWrap == null) { return AjaxResult.error("要回显的订单发票id有误"); } diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/AllInvoiceOrdersRequest.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/AllInvoiceOrdersRequest.java index 711ab6a3..36e4609c 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/AllInvoiceOrdersRequest.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/AllInvoiceOrdersRequest.java @@ -25,6 +25,11 @@ public class AllInvoiceOrdersRequest { */ @JsonProperty("creatorType") private Integer creatorType; + /** + * 发票类型 0为普票,1为专票 + */ + @JsonProperty("invoiceType") + private Integer invoiceType; /** * 发票状态(0表示未开票,1表示已经开票,2表示开票失败) */ diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/AllInvoiceOrdersResponse.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/AllInvoiceOrdersResponse.java index f865a59e..ebeeffe6 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/AllInvoiceOrdersResponse.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/AllInvoiceOrdersResponse.java @@ -58,6 +58,11 @@ public class AllInvoiceOrdersResponse { */ @JsonProperty("creatorType") private Integer creatorType; + /** + * 发票类型 0为普票,1为专票 + */ + @JsonProperty("invoiceType") + private Integer invoiceType; /** * 发票金额 */ diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/ExcelInvoiceRow.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/ExcelInvoiceRow.java new file mode 100644 index 00000000..6035bedf --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/ExcelInvoiceRow.java @@ -0,0 +1,47 @@ +package com.xhpc.invoice.domain; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 用于存储导出发票的一行记录的Bean类 + * + * @author WH + * @date 2021/12/30 14:13 + * @since version-1.0 + */ +@Data +@NoArgsConstructor +public class ExcelInvoiceRow { + + private Integer rowsNumber; + private String invoiceType; + private String receiveEmail; + private String titleType; + private String titleContent; + private String dutyNumber; + private String invoiceContent; + private String invoiceOrderElectricTotalMoney; + private String invoiceOrderServiceTotalMoney; + private String firmAddress; + private String firmPhone; + private String firmBank; + private String firmBankAccount; + private String isShowDate; + private String userNotes; + private String creatorType; + private String iCreateTime; + private String invoicingTime; + private String drawer; + private String financeNotes; + private String electricInvoiceUrl; + private String isRead; + private String historySerialNumber; + private String powerPriceTotal; + private String servicePriceTotal; + private String promotionDiscount; + private String historyActPrice; + private String hCreateTime; + private String chargingMode; + +} diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/InvoiceHistoryRecordsResponse.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/InvoiceHistoryRecordsResponse.java index 3656ed30..a8c47abb 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/InvoiceHistoryRecordsResponse.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/InvoiceHistoryRecordsResponse.java @@ -35,6 +35,8 @@ public class InvoiceHistoryRecordsResponse { private Integer status; @JsonProperty("invoicingMoney") private BigDecimal invoicingMoney; + @JsonProperty("isRead") + private Integer isRead; } diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/SaveInvoiceInfoRequest.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/SaveInvoiceInfoRequest.java new file mode 100644 index 00000000..6cd389be --- /dev/null +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/domain/SaveInvoiceInfoRequest.java @@ -0,0 +1,57 @@ +package com.xhpc.invoice.domain; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; +import java.util.List; + +/** + * POST /invoice/接口的请求包装类 + * + * @author WH + * @date 2021/12/28 14:29 + * @since version-1.0 + */ +@NoArgsConstructor +@Data +public class SaveInvoiceInfoRequest { + + + @JsonProperty("receiveEmail") + private String receiveEmail; + @JsonProperty("titleType") + private Integer titleType; + @JsonProperty("titleContent") + private String titleContent; + @JsonProperty("dutyNumber") + private String dutyNumber; + @JsonProperty("invoiceContent") + private String invoiceContent; + @JsonProperty("invoiceMoney") + private BigDecimal invoiceMoney; + @JsonProperty("firmAddress") + private String firmAddress; + @JsonProperty("firmPhone") + private String firmPhone; + @JsonProperty("firmBank") + private String firmBank; + @JsonProperty("firmBankAccount") + private String firmBankAccount; + @JsonProperty("isShowDate") + private Integer isShowDate; + @JsonProperty("userNotes") + private String userNotes; + @JsonProperty("creatorId") + private Long creatorId; + @JsonProperty("creatorType") + private Integer creatorType; + @JsonProperty("creator") + private String creator; + @JsonProperty("createTime") + private String createTime; + @JsonProperty("historyOrderIds") + private List historyOrderIds; + +} diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcChargingStationMapper.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcChargingStationMapper.java index 214ef059..abf61f0e 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcChargingStationMapper.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcChargingStationMapper.java @@ -1,14 +1,6 @@ package com.xhpc.invoice.mapper; import com.xhpc.common.domain.XhpcChargingStation; -import com.xhpc.common.domain.XhpcRate; -import com.xhpc.common.domain.XhpcRateModel; -import com.xhpc.common.domain.XhpcRateTime; -import org.apache.ibatis.annotations.Param; - -import java.util.List; -import java.util.Map; -import java.util.Set; /** * 电站Mapper接口 @@ -26,245 +18,4 @@ public interface XhpcChargingStationMapper { */ XhpcChargingStation selectXhpcChargingStationById(Long chargingStationId); - - /** - * 查询电站 - * - * @param chargingStationName 电站名称 - * @return 电站 - */ - XhpcChargingStation selectXhpcChargingStationByName(String chargingStationName); - - /** - * 查询电站列表 - * - * @param name 电站名称 - * @param operatorName 运营商名称 - * @return 电站集合 - */ - List> selectXhpcChargingStationList(@Param("name") String name, @Param("operatorName") String operatorName, @Param("operatorId") Long operatorId, @Param("type") Integer type); - - /** - * 新增电站 - * - * @param xhpcChargingStation 电站 - * @return 结果 - */ - int insertXhpcChargingStation(XhpcChargingStation xhpcChargingStation); - - /** - * 修改电站 - * - * @param xhpcChargingStation 电站 - * @return 结果 - */ - int updateXhpcChargingStation(XhpcChargingStation xhpcChargingStation); - - /** - * 删除电站 - * - * @param chargingStationId 电站ID - * @return 结果 - */ - int updateXhpcChargingStationById(Long chargingStationId); - - /** - * 批量删除电站 - * - * @param chargingStationIds 需要删除的数据ID - * @return 结果 - */ - int updateXhpcChargingStationByIds(Long[] chargingStationIds); - - /** - * 状态(0启用 1停用) - * - * @param status 0启用 1停用 - * @return 结果 - */ - void status(@Param("status") Integer status, @Param("chargingStationId") Long chargingStationId); - - - /** - * APP端、小程序是否可见 - * - * @param clientVisible app可见值 - * @param chargingStationId 场站id - * @return 结果 - */ - void clientVisible(@Param("clientVisible") String clientVisible, @Param("chargingStationId") Long chargingStationId); - - /** - * 合作的电站 - * - * @param chargingStationId 电站ID - * @return 电站 - */ - List> stationInternetBlackList(Long chargingStationId); - - - /** - * 电站详情信息 - * - * @param chargingStationId 电站ID - * @return 电站 - */ - Map getXhpcChargingStationMessage(@Param("chargingStationId") Long chargingStationId); - - - /** - * 微信小程序电站列表 - * - * @param name 电站名称 - * @param serviceFacilities 标签集合(服务设施) - * @param code 城市id - * @param longitude 经度 - * @param latitude 维度 - * @param clientVisible 微信小程序是否可见 2可见 - * @return - */ - List> getWXList(@Param("name") String name, @Param("serviceFacilities") List serviceFacilities, @Param("code") Integer code, @Param("longitude") String longitude, @Param("latitude") String latitude, @Param("clientVisible") Integer clientVisible, @Param("date") String date); - - - /** - * 根据code获取数据 - * - * @param code 字典code - * @param serviceFacilities 筛选条件 - * @return 电站 - */ - List> getCode(@Param("code") String code, @Param("serviceFacilities") List serviceFacilities); - - /** - * 电站详情(站点详情) - * - * @param chargingStationId 电站ID - * @return 电站 - */ - Map getWXXhpcChargingStationMessage(@Param("chargingStationId") Long chargingStationId, @Param("longitude") String longitude, @Param("latitude") String latitude); - - - /** - * 获取图片信息 - * - * @param imgIds - * @return - */ - List> getImageList(@Param("imgIds") List imgIds); - - - /** - * 电站详情---价格详情 - * - * @param chargingStationId 电站ID - * @return 电站 - */ - List> getWXXhpcRateTimeMassage(@Param("chargingStationId") Long chargingStationId); - - - /** - * 电站详情---终端列表 - * - * @param chargingStationId 电站ID - * @return 电站 - */ - List> getWXXhpcTerminalMassage(@Param("chargingStationId") Long chargingStationId); - - - /** - * 添加费率模型 - */ - int addXhpcRateModel(XhpcRateModel xhpcRateModel); - - /** - * 添加场站信息 - */ - int addXhpcChargingStation(XhpcChargingStation xhpcChargingStation); - - /** - * 添加费率 - */ - int addXhpcRate(XhpcRate xhpcRate); - - - /** - * 添加费率时段 - */ - int addXhpcRateTime(XhpcRateTime xhpcRateTime); - - - /** - * 返回费率 - */ - List> getXhpcRateList(@Param("chargingStationId") Long chargingStationId); - - - /** - * 返回费率时段(设置时段) - */ - List> getXhpcRateTimeTypeList(@Param("chargingStationId") Long chargingStationId, @Param("type") Integer type); - - - /** - * 今日充电量、今日充电用户、今日充电次数 - */ - Map getXhpcRateTimeOrderStatistics(@Param("chargingStationId") Long chargingStationId, @Param("createTime") String createTime); - - /** - * 删除之前的费率 - * - * @param chargingStationId - * @return - */ - int updateXhpcRate(@Param("chargingStationId") Long chargingStationId); - - /** - * 删除之前的费率时段 - * - * @param chargingStationId - * @return - */ - int updateXhpcRateTime(@Param("chargingStationId") Long chargingStationId); - - /** - * 根据场站id获取桩编号 - * - * @param chargingStationId - * @return - */ - Set getXchargingPileList(@Param("chargingStationId") Long chargingStationId); - - /** - * 按照没30分钟为一段进行分组 - * - * @param chargingStationId - * @return - */ - List> getXhpcRateTimeNumber(@Param("chargingStationId") Long chargingStationId); - - /** - * 修改桩的计费模型id - * - * @param chargingStationId - */ - void updateXhpcChargingPile(@Param("chargingStationId") Long chargingStationId, @Param("rateModelId") Long rateModelId); - - /** - * 修改终端的计费模型id - * - * @param chargingStationId - */ - void updateXhpcTerminal(@Param("chargingStationId") Long chargingStationId, @Param("rateModelId") Long rateModelId); - - - /** - * 获取登陆用户信息 - */ - Map getLandUser(@Param("userId") Long userId); - - /** - * 添加场站数据权限 - */ - void addXhpcUserPrivilege(@Param("userId") Long userId, @Param("chargingStationId") Long chargingStationId); - } diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcHistoryOrderMapper.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcHistoryOrderMapper.java index ca16faf1..a32da202 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcHistoryOrderMapper.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcHistoryOrderMapper.java @@ -39,4 +39,15 @@ public interface XhpcHistoryOrderMapper { */ Long findAllOrdersByCondition(@Param("invoicedOrdersRequest") InvoicedOrdersRequest invoicedOrdersRequest, @Param("lockOrderNumberList") List lockOrderNumberList); + /** + * 查询指定id的历史订单 + * + * @param historyOrderIds 历史订单id集合 + * @return 历史订单 + * @author WH + * @date 2021/12/28 17:47 + * @since version-1.0 + */ + List findById(List historyOrderIds); + } diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcInvoiceMapHistoryOrderMapper.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcInvoiceMapHistoryOrderMapper.java index 9603f691..500bbfae 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcInvoiceMapHistoryOrderMapper.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcInvoiceMapHistoryOrderMapper.java @@ -62,4 +62,25 @@ public interface XhpcInvoiceMapHistoryOrderMapper { */ List findLockOrdersByUserIdAndUserType(InvoicedOrdersRequest invoicedOrdersRequest); + /** + * 解除锁定的用户历史订单 + * + * @param invoiceId 发票id + * @author WH + * @date 2021/12/29 11:00 + * @since version-1.0 + */ + void updateUnlockHistoryOrdersByInvoiceId(Long invoiceId); + + /** + * 查询该发票关联表中,该历史订单是否已经被存储且被锁定 + * + * @param historyOrderIds 历史订单id集合 + * @return 返回被某发票包含,且已经锁定的历史订单记录 + * @author WH + * @date 2021/12/29 14:30 + * @since version-1.0 + */ + List getLockedOnesByHistoryOrderId(List historyOrderIds); + } \ No newline at end of file diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcInvoiceMapper.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcInvoiceMapper.java index 9f51f66b..79d1bcd1 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcInvoiceMapper.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcInvoiceMapper.java @@ -1,6 +1,7 @@ package com.xhpc.invoice.mapper; import com.xhpc.invoice.domain.AllInvoiceOrdersRequest; +import com.xhpc.invoice.domain.ExcelInvoiceRow; import com.xhpc.invoice.domain.InvoiceHistoryRecordsRequest; import com.xhpc.invoice.domain.InvoiceToUserRequest; import com.xhpc.invoice.pojo.XhpcInvoice; @@ -75,7 +76,7 @@ public interface XhpcInvoiceMapper { BigDecimal allNotInvoicedMoney(); /** - * 更新指定发票状态,让其成为已开发票状态 + * 更新指定发票状态,让其成为已开发票状态,并设置用户未阅读标签 * * @param requestData 更新数据的来源 * @return Long 返回更新受影响的条数 @@ -83,7 +84,7 @@ public interface XhpcInvoiceMapper { * @date 2021/12/22 15:07 * @since version-1.0 */ - Long invoiceToUser(InvoiceToUserRequest requestData); + Long updateInvoiceToUser(InvoiceToUserRequest requestData); /** * 更新指定发票状态,让其成为开发票失败状态 @@ -94,7 +95,7 @@ public interface XhpcInvoiceMapper { * @date 2021/12/23 13:30 * @since version-1.0 */ - Long failInvoiceToUser(InvoiceToUserRequest requestData); + Long updateFailInvoiceToUser(InvoiceToUserRequest requestData); /** * 模糊查询指定公司名称和税号 @@ -136,6 +137,7 @@ public interface XhpcInvoiceMapper { * * @param creatorId 用户id * @param creatorType 用户类型 + * * @return 用户发票条数 * @author WH * @date 2021/12/27 16:47 @@ -143,5 +145,57 @@ public interface XhpcInvoiceMapper { */ Long getUserInvoiceItemsByCreatorIdAndCreatorType(@Param("creatorId") Long creatorId, @Param("creatorType") Integer creatorType); + /** + * 插入发票记录,获取所插入的发票记录的发票id(会被放置到实体类id属性中) + * + * @param xhpcInvoice 发票记录 + * @author WH + * @date 2021/12/28 15:09 + * @since version-1.0 + */ + void insertSelectiveAndReturnId(XhpcInvoice xhpcInvoice); + + /** + * 查找指定用户开了的发票未读的数量 + * + * @param creatorId 用户id + * @param creatorType 用户类型 + * @return 返回发票未读的数量 + * @author WH + * @date 2021/12/28 20:31 + * @since version-1.0 + */ + Long findNotReadCount(@Param("creatorId") Long creatorId, @Param("creatorType") Integer creatorType); + + /** + * 更新发票状态,从未读变成已读 + * + * @param invoiceId 要更新的发票id + * @author WH + * @date 2021/12/29 17:26 + * @since version-1.0 + */ + void updateByInvoiceId(Long invoiceId); + + /** + * 获取发票内容 + * + * @param invoiceId 发票id + * @return 专门用于放置到Excel中Map + * @author WH + * @date 2021/12/30 18:08 + * @since version-1.0 + */ + List selectExcelInvoiceById(Long invoiceId); + + /** + * 更新发票所包含的电量总金额,服务费总金额 + * + * @param xhpcInvoice 存放要更新数据的实体类 + * @author WH + * @date 2022/1/3 17:06 + * @since version-1.0 + */ + void updateElectricAndServiceById(XhpcInvoice xhpcInvoice); } \ No newline at end of file diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcOperatorMapper.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcOperatorMapper.java index c754db50..a814dcc5 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcOperatorMapper.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/mapper/XhpcOperatorMapper.java @@ -1,10 +1,7 @@ package com.xhpc.invoice.mapper; -import com.xhpc.invoice.pojo.XhpcOperator; -import com.xhpc.system.api.domain.SysUser; import org.apache.ibatis.annotations.Param; -import java.util.List; import java.util.Map; /** @@ -14,101 +11,12 @@ import java.util.Map; */ public interface XhpcOperatorMapper { - /** - * 修改运营商信息 - * - * @param xhpcOperator 运营商信息 - * @return 结果 - */ - public int update(XhpcOperator xhpcOperator); - - /** - * 新增运营商信息 - * - * @param xhpcOperator 运营商信息 - * @return 结果 - */ - public int insert(XhpcOperator xhpcOperator); - - /** - * 批量删除运营商信息 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - public int deleteByIds(String[] ids); - - /** - * 校验账号是否唯一 - * - * @param phone 用户手机号 - * @return 结果 - */ - public XhpcOperator checkAccountUnique(@Param("phone") String phone); - /** * 查询运营商详情 * * @param operatorId 运营商id * @return 结果 */ - public Map info(@Param("operatorId") Long operatorId); - - /** - * 获取运营商分页列表 - * - * @param name 运营商名称 - * @param contactName 联系人 - * @param contactPhone 联系人电话 - * @return 结果 - */ - public List> selectOperatorList(@Param("name") String name, @Param("contactName") String contactName, @Param("contactPhone") String contactPhone, @Param("createTimeStart") String createTimeStart, @Param("createTimeEnd") String createTimeEnd); - - /** - * 通过用户ID删除用户和角色关联 - * - * @param userId 用户ID - * @return 结果 - */ - public int deleteUserRoleByUserId(@Param("userId") Long userId); - - /** - * 通过用户ID删除用户和岗位关联 - * - * @param userId 用户ID - * @return 结果 - */ - public int deleteUserPostByUserId(@Param("userId") Long userId); - - /** - * 删除角色信息 - * - * @param roleName 角色名称 - * @return 结果 - */ - public int deleteRoleByName(@Param("roleName") String roleName); - - /** - * 通过用户ID删除用户 - * - * @param sysUser 用户 - * @return 结果 - */ - public int deleteUserById(SysUser sysUser); - - /** - * 通过运营商ID查询用户 - * - * @param operatorId 运营商ID - * @return 结果 - */ - public SysUser getUserByOperatorId(@Param("operatorId") Long operatorId); - - /** - * 查询运营商列表 - * - * @return 结果 - */ - public List> getOperatorId(); + Map info(@Param("operatorId") Long operatorId); } diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcInvoice.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcInvoice.java index 4bfa93ce..474fa6e5 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcInvoice.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcInvoice.java @@ -9,7 +9,7 @@ import java.util.Date; /** * xhpc_invoice * - * @author + * @author WH */ @Data public class XhpcInvoice implements Serializable { @@ -19,6 +19,11 @@ public class XhpcInvoice implements Serializable { */ private Long invoiceId; + /** + * 发票类型(默认0普票,1为专票) + */ + private Integer invoiceType; + /** * 接收邮箱 */ @@ -145,7 +150,7 @@ public class XhpcInvoice implements Serializable { private Date updateTime; /** - * 是否已经阅读(默认0表示没有阅读,1表示已经阅读) + * 是否已经阅读(默认未空,0表示没有阅读,1表示已经阅读) */ private Integer isRead; diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcInvoiceMapHistoryOrder.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcInvoiceMapHistoryOrder.java index 7b955be7..232887b3 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcInvoiceMapHistoryOrder.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/pojo/XhpcInvoiceMapHistoryOrder.java @@ -1,6 +1,7 @@ package com.xhpc.invoice.pojo; import lombok.Data; +import lombok.NoArgsConstructor; import java.io.Serializable; import java.math.BigDecimal; @@ -9,8 +10,9 @@ import java.util.Date; /** * xhpc_invoice_map_history_order * - * @author + * @author WH */ +@NoArgsConstructor @Data public class XhpcInvoiceMapHistoryOrder implements Serializable { @@ -37,7 +39,7 @@ public class XhpcInvoiceMapHistoryOrder implements Serializable { /** * 该发票所选中的历史订单订单编号 */ - private String hisotrySerialNumber; + private String historySerialNumber; /** * 该发票所选中的历史订单电费 @@ -82,7 +84,7 @@ public class XhpcInvoiceMapHistoryOrder implements Serializable { /** * 该发票所选中的历史订单是否被锁定 */ - private Integer delLock; + private Integer lockFlag; /** * 逻辑删除字段 diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/XhpcInvoiceService.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/XhpcInvoiceService.java index a3821193..39d0ad3b 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/XhpcInvoiceService.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/XhpcInvoiceService.java @@ -2,6 +2,10 @@ package com.xhpc.invoice.service; import com.xhpc.invoice.domain.*; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; + /** * 用于处理发票相关请求的Service * @@ -20,7 +24,7 @@ public interface XhpcInvoiceService { * @date 2021/12/20 14:10 * @since version-1.0 */ - SpecificInvoiceWrap selectSpecificInvoice(Long invoiceId); + SpecificInvoiceWrap findSpecificInvoice(Long invoiceId); /** * 通过requestData中的申请人、申请人类型、发票状态、发票起始时间、发票申请终止时间、开票起始时间、开票终点时间、当前所在页数、当前页所要显示几行,来查询发票列表信息 @@ -31,7 +35,7 @@ public interface XhpcInvoiceService { * @date 2021/12/21 16:02 * @since version-1.0 */ - AllInvoiceOrdersResponse selectAllInvoiceOrders(AllInvoiceOrdersRequest requestData); + AllInvoiceOrdersResponse findAllInvoiceOrders(AllInvoiceOrdersRequest requestData); /** * 存储开发票的状态,将开票信息入库,并向指定用户的邮箱发送短信 @@ -63,7 +67,7 @@ public interface XhpcInvoiceService { * @date 2021/12/23 15:29 * @since version-1.0 */ - InvoiceTitleResponse selectInvoiceTitleInfo(String firmName); + InvoiceTitleResponse findTitleInfo(String firmName); /** * 查询用户输入的最后一次的开发票所填写的信息 @@ -75,7 +79,7 @@ public interface XhpcInvoiceService { * @date 2021/12/23 17:23 * @since version-1.0 */ - TitleResponse selectUserInputInvoiceInfo(Long creatorId, Integer creatorType); + TitleResponse findUserLastInputInfo(Long creatorId, Integer creatorType); /** * 根据用户id,用户类型,要查询的当前时间的年月日,查询该用户3个月内可以开发票的订单 @@ -86,7 +90,7 @@ public interface XhpcInvoiceService { * @date 2021/12/24 10:42 * @since version-1.0 */ - InvoiceOrdersResponse selectInvoicedOrders(InvoicedOrdersRequest invoicedOrdersRequest); + InvoiceOrdersResponse findUserHistoryOrders(InvoicedOrdersRequest invoicedOrdersRequest); /** * 根据发票id,查询回显发票所需要的数据 @@ -97,7 +101,7 @@ public interface XhpcInvoiceService { * @date 2021/12/27 13:12 * @since version-1.0 */ - SpecificInvoicedResponse selectSpecificInvoiced(Long invoiceId); + SpecificInvoicedResponse findSpecificInvoicedInfo(Long invoiceId); /** * 根据前端传递过来的请求参数,查询所需要的开发票历史记录 @@ -108,6 +112,41 @@ public interface XhpcInvoiceService { * @date 2021/12/27 14:49 * @since version-1.0 */ - InvoiceHistoryRecordsResponse selectInvoiceHistoryRecords(InvoiceHistoryRecordsRequest invoiceHistoryRecordsRequest); + InvoiceHistoryRecordsResponse findInvoiceHistoryRecords(InvoiceHistoryRecordsRequest invoiceHistoryRecordsRequest); + + /** + * 将用户申请的发票信息,保存到数据库中 + * + * @param saveInvoiceInfoRequest 发票信息 + * @throws Exception 传入发票金额参数与内部该发票所包含的所有订单金额参数不一致出现,出现此异常 + * @author WH + * @date 2021/12/28 14:33 + * @since version-1.0 + */ + void saveInvoiceInfo(SaveInvoiceInfoRequest saveInvoiceInfoRequest) throws Exception; + + /** + * 查询指定用户没有查看的已开的发票的数量,即该用户有几个未读发票 + * + * @param creatorId 用户id + * @param creatorType 用户类型 + * @return 未读发票数量 + * @author WH + * @date 2021/12/28 19:01 + * @since version-1.0 + */ + Long findNotReadCount(Long creatorId, Integer creatorType); + + /** + * 导出所有发票记录(已开与未开)到Excel中 + * + * @param invoiceIds 发票id + * @param response 响应的response + * @throws IOException 该Response对象不存在时,抛出该异常对象 + * @author WH + * @date 2021/12/30 10:16 + * @since version-1.0 + */ + void exportExcel(List invoiceIds, HttpServletResponse response) throws IOException; } diff --git a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/impl/XhpcInvoiceServiceImpl.java b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/impl/XhpcInvoiceServiceImpl.java index c764362d..8a7f5133 100644 --- a/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/impl/XhpcInvoiceServiceImpl.java +++ b/xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/invoice/service/impl/XhpcInvoiceServiceImpl.java @@ -1,9 +1,15 @@ package com.xhpc.invoice.service.impl; import cn.hutool.extra.mail.MailUtil; +import cn.hutool.http.HttpUtil; +import cn.hutool.poi.excel.ExcelUtil; +import cn.hutool.poi.excel.ExcelWriter; import com.xhpc.common.core.utils.DateUtils; import com.xhpc.common.core.utils.bean.BeanUtils; import com.xhpc.common.domain.XhpcChargingStation; +import com.xhpc.common.redis.service.RedisService; +import com.xhpc.invoice.constant.InvoiceMapHistoryOrderStatusConst; +import com.xhpc.invoice.constant.InvoiceStatusConst; import com.xhpc.invoice.domain.*; import com.xhpc.invoice.mapper.*; import com.xhpc.invoice.pojo.XhpcInvoice; @@ -11,11 +17,14 @@ import com.xhpc.invoice.pojo.XhpcInvoiceMapHistoryOrder; import com.xhpc.invoice.service.XhpcInvoiceService; import com.xhpc.order.domain.XhpcHistoryOrder; import com.xhpc.system.api.domain.SysUser; +import org.springframework.core.env.Environment; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; import java.io.File; +import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -43,9 +52,13 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { SysUserMapper sysUserMapper; @Resource XhpcHistoryOrderMapper xhpcHistoryOrderMapper; + @Resource + Environment environment; + @Resource + RedisService redisService; /** - * 通过requestData中的申请人、申请人类型、发票状态、发票起始时间、发票申请终止时间、开票起始时间、开票终点时间、当前所在页数、当前页所要显示几行,来查询发票列表信息 + * 通过requestData中的申请人、申请人类型、发票类型、发票状态、发票起始时间、发票申请终止时间、开票起始时间、开票终点时间、当前所在页数、当前页所要显示几行,来查询发票列表信息 * * @param requestData 传递过来的查询参数 * @return AllInvoiceOrdersResponse 发票列表对象 @@ -54,22 +67,25 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { * @since version-1.0 */ @Override - public AllInvoiceOrdersResponse selectAllInvoiceOrders(AllInvoiceOrdersRequest requestData) { + public AllInvoiceOrdersResponse findAllInvoiceOrders(AllInvoiceOrdersRequest requestData) { //计算分页索引 requestData.setCurrentPage((requestData.getCurrentPage() - 1) * requestData.getItems()); - //获取每个历史订单信息 + //获取每张发票信息 List xhpcInvoiceList = xhpcInvoiceMapper.selectAllInvoiceOrdersByCondition(requestData); //对拷,放置到itemsDTO中,然后将itemsDTO存放到itemsDTOList中 ArrayList itemsDTOList = new ArrayList<>(); for (XhpcInvoice xhpcInvoice : xhpcInvoiceList) { AllInvoiceOrdersResponse.ItemsDTO itemsDTO = new AllInvoiceOrdersResponse.ItemsDTO(); itemsDTO.setInvoiceId(xhpcInvoice.getInvoiceId()); + itemsDTO.setInvoiceType(xhpcInvoice.getInvoiceType()); itemsDTO.setCreator(xhpcInvoice.getCreator()); itemsDTO.setCreatorType(xhpcInvoice.getCreatorType()); itemsDTO.setInvoiceMoney(xhpcInvoice.getInvoiceMoney()); itemsDTO.setStatus(xhpcInvoice.getStatus()); itemsDTO.setCreateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getCreateTime())); - itemsDTO.setInvoicingTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getInvoicingTime())); + if (xhpcInvoice.getInvoicingTime() != null) { + itemsDTO.setInvoicingTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getInvoicingTime())); + } itemsDTO.setDrawer(xhpcInvoice.getDrawer()); itemsDTOList.add(itemsDTO); } @@ -87,6 +103,10 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { allInvoiceOrdersResponse.setInvoicedSumMoney(allInvoicedMoney); //查询所有未开发票总金额 BigDecimal allNotInvoicedMoney = xhpcInvoiceMapper.allNotInvoicedMoney(); + if (allNotInvoicedMoney == null) { + //如果没有任何未开发票,那么总金额就设置成0.00 + allNotInvoicedMoney = new BigDecimal("0.00"); + } allInvoiceOrdersResponse.setNotInvoiceSumMoney(allNotInvoicedMoney); return allInvoiceOrdersResponse; } @@ -109,19 +129,27 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { //发送电子发票pdf到接收者邮箱 XhpcInvoice xhpcInvoice = xhpcInvoiceMapper.selectByPrimaryKey(requestData.getInvoiceId()); String receiveEmail = xhpcInvoice.getReceiveEmail(); - //todo 从阿里云上下载下来电子发票 - File electricInvoiceFile = new File("D:\\Enterprise_Resources\\ElectricInvoice\\ElectricInvoice.pdf"); + //从阿里云上下载下来电子发票 + String fileUrl = requestData.getEletricInvoiceUrl(); + File electricInvoiceFile = new File(environment.getProperty("file.serverStoreDisposableFileLocation") + "ElectricInvoice.pdf"); + HttpUtil.downloadFile(fileUrl, electricInvoiceFile); try { MailUtil.send(receiveEmail, "【小华充电】电子发票", "邮件来自小华充电", false, electricInvoiceFile); } catch (Exception e) { System.out.println(e.getMessage()); return Boolean.FALSE; + } finally { + if (electricInvoiceFile.exists()) { + electricInvoiceFile.delete(); + } } - //更新发票数据 - Long successFlag = xhpcInvoiceMapper.invoiceToUser(requestData); + //更新发票数据,并设置用户未阅读状态 + Long successFlag = xhpcInvoiceMapper.updateInvoiceToUser(requestData); if (successFlag == 0) { throw new RuntimeException("无法更新指定发票,传入的数据有问题"); } + //将该用户未阅读的数量放入到redis中 + putNoReadInvoiceCountIntoRedis(requestData); return Boolean.TRUE; } @@ -131,12 +159,36 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { //根据操作人的id,查询操作人的名字 SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(requestData.getDrawer())); requestData.setDrawer(sysUser.getNickName()); - //入库更新 - xhpcInvoiceMapper.failInvoiceToUser(requestData); + //更新发票状态 + xhpcInvoiceMapper.updateFailInvoiceToUser(requestData); + //解除锁定 + xhpcInvoiceMapHistoryOrderMapper.updateUnlockHistoryOrdersByInvoiceId(requestData.getInvoiceId()); + //将该用户未阅读的数量放入到redis中 + putNoReadInvoiceCountIntoRedis(requestData); + } + + /** + * 将该用户没有阅读的发票的数量放入到Redis中保存,供别人调用 + * + * @author WH + * @date 2021/12/30 13:54 + * @since version-1.0 + */ + private void putNoReadInvoiceCountIntoRedis(InvoiceToUserRequest requestData) { + + XhpcInvoice xhpcInvoice = xhpcInvoiceMapper.selectByPrimaryKey(requestData.getInvoiceId()); + String redisKey = generateRedisKey(xhpcInvoice); + if (redisService.getCacheObject(redisKey) == null) { + redisService.setCacheObject(redisKey, 1); + } else { + Integer noReadCount = redisService.getCacheObject(redisKey); + noReadCount = noReadCount + 1; + redisService.setCacheObject(redisKey, noReadCount); + } } @Override - public InvoiceTitleResponse selectInvoiceTitleInfo(String firmName) { + public InvoiceTitleResponse findTitleInfo(String firmName) { List xhpcInvoiceList = xhpcInvoiceMapper.selectInvoiceTitleInfo(firmName); ArrayList dataDTOList = new ArrayList<>(); @@ -162,7 +214,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { * @since version-1.0 */ @Override - public TitleResponse selectUserInputInvoiceInfo(Long creatorId, Integer creatorType) { + public TitleResponse findUserLastInputInfo(Long creatorId, Integer creatorType) { XhpcInvoice xhpcInvoice = xhpcInvoiceMapper.selectUserLastInputInvoiceInfo(creatorId, creatorType); TitleResponse titleResponse = new TitleResponse(); @@ -181,7 +233,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { * @since version-1.0 */ @Override - public InvoiceOrdersResponse selectInvoicedOrders(InvoicedOrdersRequest invoicedOrdersRequest) { + public InvoiceOrdersResponse findUserHistoryOrders(InvoicedOrdersRequest invoicedOrdersRequest) { //计算分页索引,放置到currentPage属性中 int startIndex = (invoicedOrdersRequest.getCurrentPage() - 1) * invoicedOrdersRequest.getItems(); invoicedOrdersRequest.setCurrentPage(startIndex); @@ -216,7 +268,8 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { * @since version-1.0 */ @Override - public SpecificInvoicedResponse selectSpecificInvoiced(Long invoiceId) { + @Transactional(rollbackFor = Exception.class) + public SpecificInvoicedResponse findSpecificInvoicedInfo(Long invoiceId) { //对拷发票部分数据 XhpcInvoice xhpcInvoice = xhpcInvoiceMapper.selectByPrimaryKey(invoiceId); @@ -238,7 +291,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { SpecificInvoicedResponse.HistoryOrdersDTO.HistoryOrdersDataDTO historyOrdersDataDTO = new SpecificInvoicedResponse.HistoryOrdersDTO.HistoryOrdersDataDTO(); historyOrdersDataDTO.setHistoryOrderId(xhpcInvoiceMapHistoryOrder.getHistoryOrderId()); historyOrdersDataDTO.setActPrice(xhpcInvoiceMapHistoryOrder.getHistoryActPrice()); - historyOrdersDataDTO.setHistorySerialNumber(xhpcInvoiceMapHistoryOrder.getHisotrySerialNumber()); + historyOrdersDataDTO.setHistorySerialNumber(xhpcInvoiceMapHistoryOrder.getHistorySerialNumber()); historyOrdersDataDTO.setOrderCreateTime(DateUtils.parseDateToStr(xhpcInvoiceMapHistoryOrder.getCreateTime())); historyOrdersDataDTOS.add(historyOrdersDataDTO); } @@ -246,9 +299,68 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { historyOrdersDTO.setHistoryOrdersData(historyOrdersDataDTOS); historyOrdersDTO.setTotalItems(historyOrdersList.size()); specificInvoicedResponse.setHistoryOrders(historyOrdersDTO); + + //如果用户在该发票还没有被处理时,点击查看该发票详情,那么就直接返回数据。 + if (xhpcInvoice.getStatus().equals(InvoiceStatusConst.INVOICING)) { + return specificInvoicedResponse; + } + + //一旦调了详情接口,就去掉该已开发票的未读状态,同时redis中的未读数量数据-1 + xhpcInvoiceMapper.updateByInvoiceId(invoiceId); + reduceNoReadInvoiceCount(xhpcInvoice); return specificInvoicedResponse; } + /** + * 将用户未读的发票数量-1 + * + * @param xhpcInvoice 用户查看的发票 + * @author WH + * @date 2021/12/30 13:55 + * @since version-1.0 + */ + private void reduceNoReadInvoiceCount(XhpcInvoice xhpcInvoice) { + + String redisKey = generateRedisKey(xhpcInvoice); + if (redisService.getCacheObject(redisKey).equals(1)) { + redisService.deleteObject(redisKey); + } else { + Integer noReadCount = redisService.getCacheObject(redisKey); + noReadCount = noReadCount - 1; + redisService.setCacheObject(redisKey, noReadCount); + } + } + + /** + * 生成该用户在Redis中的唯一表示key + * + * @param xhpcInvoice 用户查看的发票 + * @author WH + * @date 2021/12/30 13:52 + * @since version-1.0 + */ + private String generateRedisKey(XhpcInvoice xhpcInvoice) { + + String redisKey = "global:invoice:"; + switch (xhpcInvoice.getCreatorType()) { + case 0: + redisKey = redisKey + "C" + xhpcInvoice.getCreatorId(); + break; + case 1: + redisKey = redisKey + "L" + xhpcInvoice.getCreatorId(); + break; + case 2: + redisKey = redisKey + "ST" + xhpcInvoice.getCreatorId(); + break; + case 3: + redisKey = redisKey + "BE" + xhpcInvoice.getCreatorId(); + break; + default: + break; + } + return redisKey; + } + /** * 根据前端传递过来的请求参数,查询所需要的开发票历史记录 * @@ -259,7 +371,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { * @since version-1.0 */ @Override - public InvoiceHistoryRecordsResponse selectInvoiceHistoryRecords(InvoiceHistoryRecordsRequest invoiceHistoryRecordsRequest) { + public InvoiceHistoryRecordsResponse findInvoiceHistoryRecords(InvoiceHistoryRecordsRequest invoiceHistoryRecordsRequest) { //计算分页索引 int startIndex = (int) ((invoiceHistoryRecordsRequest.getCurrentPage() - 1) * invoiceHistoryRecordsRequest.getItems()); if (startIndex < 0) { @@ -276,6 +388,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { itemsDTO.setCreateTime(DateUtils.parseDateToStr(xhpcInvoice.getCreateTime())); itemsDTO.setStatus(xhpcInvoice.getStatus()); itemsDTO.setInvoicingMoney(xhpcInvoice.getInvoiceMoney()); + itemsDTO.setIsRead(xhpcInvoice.getIsRead()); itemsDTOS.add(itemsDTO); } InvoiceHistoryRecordsResponse invoiceHistoryRecordsResponse = new InvoiceHistoryRecordsResponse(); @@ -285,6 +398,194 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { return invoiceHistoryRecordsResponse; } + /** + * 将用户申请的发票信息,保存到数据库中 + * + * @param saveInvoiceInfoRequest 发票信息 + * @throws Exception 传入发票金额参数与内部该发票所包含的所有订单金额参数不一致出现,出现此异常 + * @author WH + * @date 2021/12/28 14:33 + * @since version-1.0 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void saveInvoiceInfo(SaveInvoiceInfoRequest saveInvoiceInfoRequest) throws Exception { + //判断传入的历史订单是否被其他发票包含 + List historyOrderIds = saveInvoiceInfoRequest.getHistoryOrderIds(); + List lockOrderList = xhpcInvoiceMapHistoryOrderMapper.getLockedOnesByHistoryOrderId(historyOrderIds); + if (lockOrderList.size() > 0) { + throw new Exception("该历史订单已被其他发票包含"); + } + //将该发票记录放入数据库生成发票记录,除了所包含的历史订单的总电费,总服务费 + XhpcInvoice xhpcInvoice = new XhpcInvoice(); + xhpcInvoice.setReceiveEmail(saveInvoiceInfoRequest.getReceiveEmail()); + xhpcInvoice.setTitleType(saveInvoiceInfoRequest.getTitleType()); + xhpcInvoice.setTitleContent(saveInvoiceInfoRequest.getTitleContent()); + xhpcInvoice.setDutyNumber(saveInvoiceInfoRequest.getDutyNumber()); + xhpcInvoice.setInvoiceContent(saveInvoiceInfoRequest.getInvoiceContent()); + xhpcInvoice.setInvoiceMoney(saveInvoiceInfoRequest.getInvoiceMoney()); + xhpcInvoice.setFirmAddress(saveInvoiceInfoRequest.getFirmAddress()); + xhpcInvoice.setFirmPhone(saveInvoiceInfoRequest.getFirmPhone()); + xhpcInvoice.setFirmBank(saveInvoiceInfoRequest.getFirmBank()); + xhpcInvoice.setFirmBankAccount(saveInvoiceInfoRequest.getFirmBankAccount()); + xhpcInvoice.setIsShowDate(saveInvoiceInfoRequest.getIsShowDate()); + xhpcInvoice.setUserNotes(saveInvoiceInfoRequest.getUserNotes()); + xhpcInvoice.setCreatorId(saveInvoiceInfoRequest.getCreatorId()); + xhpcInvoice.setCreatorType(saveInvoiceInfoRequest.getCreatorType()); + xhpcInvoice.setCreator(saveInvoiceInfoRequest.getCreator()); + xhpcInvoice.setCreateTime(DateUtils.parseDate(saveInvoiceInfoRequest.getCreateTime())); + xhpcInvoice.setStatus(0); + xhpcInvoiceMapper.insertSelectiveAndReturnId(xhpcInvoice); + //建立订单与发票之间的关联 + List xhpcHistoryOrderList = xhpcHistoryOrderMapper.findById(historyOrderIds); + //获取所插入的发票id + Long invoiceId = xhpcInvoice.getInvoiceId(); + //存储该发票所包含的所有历史订单总电量 + double totalPowerPrice = 0; + //存储该发票所包含的所有历史订单总服务费 + double totalServicePrice = 0; + //该变量是用来计算内部存储的历史订单金额是否与传入的一致 + double totalActPrice = 0; + for (XhpcHistoryOrder xhpcHistoryOrder : xhpcHistoryOrderList) { + XhpcInvoiceMapHistoryOrder xhpcInvoiceMapHistoryOrder = new XhpcInvoiceMapHistoryOrder(); + xhpcInvoiceMapHistoryOrder.setInvoiceId(invoiceId); + xhpcInvoiceMapHistoryOrder.setHistoryOrderId(xhpcHistoryOrder.getHistoryOrderId()); + xhpcInvoiceMapHistoryOrder.setHistoryUserId(xhpcHistoryOrder.getUserId()); + xhpcInvoiceMapHistoryOrder.setHistoryUserType(Long.valueOf(xhpcHistoryOrder.getSource())); + xhpcInvoiceMapHistoryOrder.setHistorySerialNumber(xhpcHistoryOrder.getSerialNumber()); + xhpcInvoiceMapHistoryOrder.setPowerPriceTotal(xhpcHistoryOrder.getPowerPriceTotal()); + xhpcInvoiceMapHistoryOrder.setServicePriceTotal(BigDecimal.valueOf(xhpcHistoryOrder.getServicePriceTotal().doubleValue() - xhpcHistoryOrder.getPromotionDiscount().doubleValue())); + xhpcInvoiceMapHistoryOrder.setPromotionDiscount(xhpcHistoryOrder.getPromotionDiscount()); + xhpcInvoiceMapHistoryOrder.setHistoryActPrice(xhpcHistoryOrder.getActPrice()); + xhpcInvoiceMapHistoryOrder.setCreateTime(xhpcHistoryOrder.getCreateTime()); + xhpcInvoiceMapHistoryOrder.setChargingMode(xhpcHistoryOrder.getChargingMode()); + xhpcInvoiceMapHistoryOrder.setChargingStationId(xhpcHistoryOrder.getChargingStationId()); + xhpcInvoiceMapHistoryOrder.setTerminalId(xhpcHistoryOrder.getTerminalId()); + xhpcInvoiceMapHistoryOrder.setLockFlag(InvoiceMapHistoryOrderStatusConst.LOCK); + xhpcInvoiceMapHistoryOrderMapper.insertSelective(xhpcInvoiceMapHistoryOrder); + totalPowerPrice += xhpcHistoryOrder.getPowerPriceTotal().doubleValue(); + totalServicePrice += (xhpcHistoryOrder.getServicePriceTotal().doubleValue() - xhpcHistoryOrder.getPromotionDiscount().doubleValue()); + totalActPrice += xhpcHistoryOrder.getTotalPrice().doubleValue(); + } + if (!BigDecimal.valueOf(totalActPrice).equals(saveInvoiceInfoRequest.getInvoiceMoney())) { + throw new Exception("传入的发票金额与实际包含的历史订单总金额参数不匹配"); + } + xhpcInvoice.setInvoiceOrderEletricTotalMoney(BigDecimal.valueOf(totalPowerPrice)); + xhpcInvoice.setInvoiceOrderServiceTotalMoney(BigDecimal.valueOf(totalServicePrice)); + xhpcInvoiceMapper.updateElectricAndServiceById(xhpcInvoice); + } + + /** + * 查询指定用户没有查看的已开的发票的数量,即该用户有几个未读发票 + * + * @param creatorId 用户id + * @param creatorType 用户类型 + * @return 未读发票数量 + * @author WH + * @date 2021/12/28 19:01 + * @since version-1.0 + */ + @Override + public Long findNotReadCount(Long creatorId, Integer creatorType) { + + return xhpcInvoiceMapper.findNotReadCount(creatorId, creatorType); + } + + /** + * 导出所有发票记录(已开与未开)到Excel中 + * + * @param invoiceIds 发票id + * @param response 响应对象 + * @author WH + * @date 2021/12/30 10:16 + * @since version-1.0 + */ + @Override + public void exportExcel(List invoiceIds, HttpServletResponse response) throws IOException { + //创建Excel写入对象 + ExcelWriter writer = ExcelUtil.getWriter("record.xlsx"); + //设置单元格标题别名 + setExcelCellName(writer); + //定义每一行的行号(1,2,3,4...) + int rowsNumber = 1; + //设定初始合并行参数(即第一行该从哪行开始合并,合并几行) + int rowStart = 1; + int lastRow = 0; + for (String invoiceId : invoiceIds) { + List excelInvoiceRows = xhpcInvoiceMapper.selectExcelInvoiceById(Long.valueOf(invoiceId)); + //往记录中塞入行号 + for (ExcelInvoiceRow excelInvoiceRow : excelInvoiceRows) { + excelInvoiceRow.setRowsNumber(rowsNumber); + } + //写入记录 + writer.write(excelInvoiceRows); + int invoiceCount = excelInvoiceRows.size(); + //如果写入的发票记录只有一个,就不合并单元格,增加合并行索引,为下面需要合并的行做准备。 + if (invoiceCount == 1) { + lastRow = lastRow + 1; + rowStart = rowStart + 1; + } else { + //计算每条要合并发票记录的行的最后一个行号 + lastRow = lastRow + invoiceCount; + //合并单元格 + for (int columnIndex = 0; columnIndex <= 21; columnIndex++) { + writer.merge(rowStart, lastRow, columnIndex, columnIndex, null, false); + } + //计算每条要合并发票记录的行的第一个行号 + rowStart = rowStart + invoiceCount; + } + rowsNumber++; + } + //设置文件类型 + response.setContentType(ExcelUtil.XLSX_CONTENT_TYPE); + //让浏览器下载 + response.addHeader("Content-Disposition", "attachment;filename=" + "invoiceRecord.xlsx"); //设置返回的文件名称 + //写入到Response中 + writer.flush(response.getOutputStream(), true); + } + + /** + * 设置生成的Excel表格单元格标题 + * + * @param writer Excel写入器 + * @author WH + * @date 2021/12/31 11:10 + * @since version-1.0 + */ + private void setExcelCellName(ExcelWriter writer) { + + writer.addHeaderAlias("rowsNumber", "序号"); + writer.addHeaderAlias("invoiceType", "发票类型"); + writer.addHeaderAlias("receiveEmail", "接收邮箱"); + writer.addHeaderAlias("titleType", "抬头类型"); + writer.addHeaderAlias("titleContent", "抬头内容"); + writer.addHeaderAlias("dutyNumber", "税号"); + writer.addHeaderAlias("invoiceContent", "发票内容"); + writer.addHeaderAlias("invoiceMoney", "发票总金额"); + writer.addHeaderAlias("invoiceOrderServiceTotalMoney", "总服务费金额"); + writer.addHeaderAlias("firmAddress", "地址"); + writer.addHeaderAlias("firmPhone", "电话号码"); + writer.addHeaderAlias("firmBank", "开户行"); + writer.addHeaderAlias("firmBankAccount", "银行开户账号"); + writer.addHeaderAlias("isShowDate", "用户是否要求展示交易日期"); + writer.addHeaderAlias("userNotes", "用户备注"); + writer.addHeaderAlias("creatorType", "用户类型"); + writer.addHeaderAlias("iCreateTime", "发票申请时间"); + writer.addHeaderAlias("invoicingTime", "发票开票时间"); + writer.addHeaderAlias("drawer", "开票人"); + writer.addHeaderAlias("financeNotes", "财物备注"); + writer.addHeaderAlias("electricInvoiceUrl", "电子发票地址"); + writer.addHeaderAlias("isRead", "用户是否阅读发票信息"); + writer.addHeaderAlias("historySerialNumber", "订单编号"); + writer.addHeaderAlias("powerPriceTotal", "订单电费"); + writer.addHeaderAlias("servicePriceTotal", "订单服务费"); + writer.addHeaderAlias("promotionDiscount", "折扣费用"); + writer.addHeaderAlias("historyActPrice", "用户实际支付金额"); + writer.addHeaderAlias("hCreateTime", "订单创建时间"); + writer.addHeaderAlias("chargingMode", "订单来源"); + } + + /** * 通过发票id查找对应的发票数据 * @@ -293,7 +594,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { * @since version-1.0 */ @Override - public SpecificInvoiceWrap selectSpecificInvoice(Long invoiceId) { + public SpecificInvoiceWrap findSpecificInvoice(Long invoiceId) { //处理包装类外层数据 XhpcInvoice xhpcInvoice = xhpcInvoiceMapper.selectByPrimaryKey(invoiceId); @@ -303,7 +604,9 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { specificInvoiceWrap.setInvoiceMoney(xhpcInvoice.getInvoiceMoney()); specificInvoiceWrap.setInvoiceTotalEletricMoney(xhpcInvoice.getInvoiceOrderEletricTotalMoney()); specificInvoiceWrap.setInvoiceTotalServiceMoney(xhpcInvoice.getInvoiceOrderServiceTotalMoney()); - specificInvoiceWrap.setInvoicingTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getInvoicingTime())); + if (xhpcInvoice.getInvoicingTime() != null) { + specificInvoiceWrap.setInvoicingTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getInvoicingTime())); + } //处理包装类内层数据 specificInvoiceWrap.setHistoryOrders(new SpecificInvoiceWrap.HistoryOrdersDTO()); SpecificInvoiceWrap.HistoryOrdersDTO historyOrdersDTO = specificInvoiceWrap.getHistoryOrders(); @@ -320,7 +623,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { historyOrdersDataDTO.setHistoryCreateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoiceMapHistoryOrder.getCreateTime())); historyOrdersDataDTO.setServiceMoney(xhpcInvoiceMapHistoryOrder.getServicePriceTotal()); historyOrdersDataDTO.setEletricMoney(xhpcInvoiceMapHistoryOrder.getPowerPriceTotal()); - historyOrdersDataDTO.setHistorySerialNumber(xhpcInvoiceMapHistoryOrder.getHisotrySerialNumber()); + historyOrdersDataDTO.setHistorySerialNumber(xhpcInvoiceMapHistoryOrder.getHistorySerialNumber()); XhpcChargingStation xhpcChargingStation = xhpcChargingStationMapper.selectXhpcChargingStationById(xhpcInvoiceMapHistoryOrder.getChargingStationId()); Map operatorInfo = xhpcOperatorMapper.info(xhpcChargingStation.getOperatorId()); String operatorName = (String) operatorInfo.get("name"); diff --git a/xhpc-modules/xhpc-invoice/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-invoice/src/main/resources/bootstrap.yml index bacdb6d8..9f962452 100644 --- a/xhpc-modules/xhpc-invoice/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-invoice/src/main/resources/bootstrap.yml @@ -22,4 +22,19 @@ spring: file-extension: yml # 共享配置 shared-configs: - - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} \ No newline at end of file + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + +#oss默认配置 +oss: + enabled: true + name: qiniu + tenant-mode: true + endpoint: oss-accelerate.aliyuncs.com + access-key: LTAI5tBWjnuQGxGicnThwMF1 + secret-key: b0WNtFYtWyTEkZzcr2WOAPoZg6w2Xu + bucket-name: xhpc-bucket1 + +#文件路径 +file: + aliyunPath: invoicePdf/ + serverStoreDisposableFileLocation: /www/wwwroot/xhpc.scxhua.com/disposableFiles/ \ No newline at end of file diff --git a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcChargingStationMapper.xml b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcChargingStationMapper.xml index fdbfa050..7db564cb 100644 --- a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcChargingStationMapper.xml +++ b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcChargingStationMapper.xml @@ -63,860 +63,9 @@ from xhpc_charging_station - - - - - - - - insert into xhpc_charging_station - - charging_station_id, - name, - operator_id, - type, - construction_site, - service_facilities, - periphery_facilities, - area_code, - address, - detailed_address, - longitude, - latitude, - parking_instructions, - serial_number, - client_visible, - status, - del_flag, - create_time, - create_by, - update_time, - update_by, - remark, - rate_model_id, - - - #{chargingStationId}, - #{name}, - #{operatorId}, - #{type}, - #{constructionSite}, - #{serviceFacilities}, - #{peripheryFacilities}, - #{areaCode}, - #{address}, - #{detailedAddress}, - #{longitude}, - #{latitude}, - #{parkingInstructions}, - #{serialNumber}, - #{clientVisible}, - #{status}, - #{delFlag}, - #{createTime}, - #{createBy}, - #{updateTime}, - #{updateBy}, - #{remark}, - #{rateModelId}, - - - - - update xhpc_charging_station - - name = #{name}, - operator_id = #{operatorId}, - type = #{type}, - construction_site = #{constructionSite}, - service_facilities = #{serviceFacilities}, - periphery_facilities = #{peripheryFacilities}, - area_code = #{areaCode}, - address = #{address}, - detailed_address = #{detailedAddress}, - longitude = #{longitude}, - latitude = #{latitude}, - parking_instructions = #{parkingInstructions}, - serial_number = #{serialNumber}, - client_visible = #{clientVisible}, - status = #{status}, - del_flag = #{delFlag}, - create_time = #{createTime}, - create_by = #{createBy}, - update_time = #{updateTime}, - update_by = #{updateBy}, - remark = #{remark}, - rate_model_id = #{rateModelId}, - business_instructions = #{businessInstructions}, - reminder_instructions = #{reminderInstructions}, - img_id = #{imgId}, - station_type = #{stationType}, - operator_id_evcs = #{operatorIdEvcs}, - service_tel = #{serviceTel}, - park_nums = #{parkNums} - - where charging_station_id = #{chargingStationId} - - - - update xhpc_charging_station - set del_flag =1 - where charging_station_id = #{chargingStationId} - - - - update xhpc_charging_station set del_flag =1 where charging_station_id in - - #{chargingStationId} - - - - - update xhpc_charging_station - set status =#{status} - where charging_station_id = #{chargingStationId} - and del_flag = 0 - - - - update xhpc_charging_station - set client_visible =#{clientVisible} - where charging_station_id = #{chargingStationId} - and del_flag = 0 - - - - - - - - - - - - - - - - - - - - - insert into xhpc_rate_model - - - status, - - - del_flag, - - - create_time, - - - create_by, - - - update_time, - - - update_by, - - - remark - - - - - #{status}, - - - #{delFlag}, - - - #{createTime}, - - - #{createBy}, - - - #{updateTime}, - - - #{updateBy}, - - - #{remark} - - - - - - insert into xhpc_charging_station - - - name, - - - operator_id, - - - type, - - - construction_site, - - - service_facilities, - - - periphery_facilities, - - - area_code, - - - address, - - - detailed_address, - - - longitude, - - - latitude, - - - parking_instructions, - - - serial_number, - - - client_visible, - - - rate_model_id, - - - img_id, - - - business_instructions, - - - reminder_instructions, - - - status, - - - del_flag, - - - create_time, - - - create_by, - - - update_time, - - - update_by, - - - remark, - - - station_type, - - - operator_id_evcs, - - - service_tel, - - - park_nums - - - - - #{name}, - - - #{operatorId}, - - - #{type}, - - - #{constructionSite}, - - - #{serviceFacilities}, - - - #{peripheryFacilities}, - - - #{areaCode}, - - - #{address}, - - - #{detailedAddress}, - - - #{longitude}, - - - #{latitude}, - - - #{parkingInstructions}, - - - #{serialNumber}, - - - #{clientVisible}, - - - #{rateModelId}, - - - #{imgId}, - - - #{businessInstructions}, - - - #{reminderInstructions}, - - - #{status}, - - - #{delFlag}, - - - #{createTime}, - - - #{createBy}, - - - #{updateTime}, - - - #{updateBy}, - - - #{remark}, - - - #{stationType}, - - - #{operatorIdEvcs}, - - - #{serviceTel}, - - - #{parkNums} - - - - - - insert into xhpc_rate - - - charging_station_id, - - - power_fee, - - - service_fee, - - - name, - - - del_flag, - - - create_time, - - - create_by, - - - update_time, - - - update_by, - - - remark, - - - rate_value, - - - rate_model_id - - - - - #{chargingStationId}, - - - #{powerFee}, - - - #{serviceFee}, - - - #{name}, - - - #{status}, - - - #{delFlag}, - - - #{createTime}, - - - #{createBy}, - - - #{updateTime}, - - - #{updateBy}, - - - #{remark}, - - - #{rateValue}, - - - #{rateModelId} - - - - - - - - insert into xhpc_rate_time - - - charging_station_id, - - - rate_id, - - - start_time, - - - end_time, - - - rate_model_id, - - - sort, - - - status, - - - del_flag, - - - create_time, - - - create_by, - - - update_time, - - - update_by, - - - remark, - - - type, - - - rate_value - - - - - #{chargingStationId}, - - - #{rateId}, - - - #{startTime}, - - - #{endTime}, - - - #{rateModelId}, - - - #{sort}, - - - #{status}, - - - #{delFlag}, - - - #{createTime}, - - - #{createBy}, - - - #{updateTime}, - - - #{updateBy}, - - - #{remark}, - - - #{type}, - - - #{rateValue} - - - - - - - - - - - - update xhpc_rate - set del_flag =1 - where charging_station_id = #{chargingStationId} - and del_flag = 0 - - - - update xhpc_rate_time - set del_flag =1 - where charging_station_id = #{chargingStationId} - and del_flag = 0 - - - - - - - - update xhpc_charging_pile - set rate_model_id=#{rateModelId} - WHERE charging_station_id = #{chargingStationId} - - - - update xhpc_terminal - set rate_model_id=#{rateModelId} - WHERE charging_station_id = #{chargingStationId} - - - - - - insert into xhpc_user_privilege( - - user_id, - - - charging_station_id - - )values( - - #{userId}, - - - #{chargingStationId} - - ) - diff --git a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcHistoryOrderMapper.xml b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcHistoryOrderMapper.xml index 0e20c160..d273a0b1 100644 --- a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcHistoryOrderMapper.xml +++ b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcHistoryOrderMapper.xml @@ -53,21 +53,67 @@ + history_order_id - , charging_station_id, charge_order_id, user_id, terminal_id, serial_number, - internet_serial_number, power_price_total, service_price_total, total_price, promotion_discount, - act_price, act_power_price, act_service_price, internet_commission, internet_svc_commission, - platform_commission, platform_svc_commisssion, operation_commission, operation_svc_commission, - start_soc, end_soc, reconciliation_status, sorting_status, `type`, `status`, del_flag, - create_time, create_by, update_time, update_by, remark, `state`, vin_normal, search_value, - operator_id_evcs, charge_model_evcs, connector_power_evcs, meter_value_end_evcs, - meter_value_start_evcs, operator_id3rdpty_evcs, start_time, stop_reason_evcs, total_power, - user_name_evcs, phone, rate_model_id + , + charging_station_id, + charge_order_id, + user_id, + terminal_id, + serial_number, + internet_serial_number, + power_price_total, + service_price_total, + total_price, + promotion_discount, + act_price, + act_power_price, + act_service_price, + internet_commission, + internet_svc_commission, + platform_commission, + platform_svc_commisssion, + operation_commission, + operation_svc_commission, + start_soc, + end_soc, + reconciliation_status, + sorting_status, + type, + status, + del_flag, + create_time, + create_by, + update_time, + update_by, + remark, + state, + vin_normal, + search_value, + operator_id_evcs, + charge_model_evcs, + connector_power_evcs, + meter_value_end_evcs, + meter_value_start_evcs, + operator_id3rdpty_evcs, + start_time, + end_time, + stop_reason_evcs, + total_power, + user_name_evcs, + phone, + evcs_order_no, + confirm_Result, + rate_model_id, + charging_mode, + internet_degree_commission, + source, + tenant_id + diff --git a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapHistoryOrderMapper.xml b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapHistoryOrderMapper.xml index abd34273..08622bd6 100644 --- a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapHistoryOrderMapper.xml +++ b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapHistoryOrderMapper.xml @@ -6,7 +6,7 @@ - + @@ -15,10 +15,29 @@ - + + + `invoice_id` + , + `history_order_id`, + `history_user_id`, + `history_user_type`, + `history_serial_number`, + `power_price_total`, + `service_price_total`, + `promotion_discount`, + `history_act_price`, + `create_time`, + `charging_mode`, + `charging_station_id`, + `terminal_id`, + `lock_flag`, + `del_flag` + + insert into xhpc_invoice_map_history_order (invoice_id, history_order_id, history_user_id, history_user_type, hisotry_serial_number, power_price_total, @@ -49,8 +68,8 @@ history_user_type, - - hisotry_serial_number, + + history_serial_number, power_price_total, @@ -76,6 +95,9 @@ terminal_id, + + lock_flag, + del_flag, @@ -93,8 +115,8 @@ #{historyUserType,jdbcType=BIGINT}, - - #{hisotrySerialNumber,jdbcType=VARCHAR}, + + #{historySerialNumber,jdbcType=VARCHAR}, #{powerPriceTotal,jdbcType=DECIMAL}, @@ -120,6 +142,9 @@ #{terminalId,jdbcType=BIGINT}, + + #{lockFlag,jdbcType=INTEGER}, + #{delFlag,jdbcType=INTEGER}, @@ -136,11 +161,17 @@ ) ) + + UPDATE xhpc_invoice_map_history_order + SET lock_flag = NULL + WHERE invoice_id = #{invoiceId} + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapper.xml b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapper.xml index e95a89a4..ed6251f8 100644 --- a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapper.xml +++ b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcInvoiceMapper.xml @@ -3,6 +3,7 @@ + @@ -30,14 +31,39 @@ + - invoice_id - , receive_email, title_type, title_content, duty_number, invoice_content, - invoice_money, invoice_order_eletric_total_money, invoice_order_service_total_money, - firm_address, firm_phone, firm_bank, firm_bank_account, is_show_date, user_notes, - creator_id, creator_type, creator, create_time, `status`, invoicing_time, drawer, - finance_notes, electric_invoice_url, updator, update_time, del_flag + `invoice_id` + , + `receive_email`, + `title_type`, + `title_content`, + `duty_number`, + `invoice_content`, + `invoice_money`, + `invoice_order_eletric_total_money`, + `invoice_order_service_total_money`, + `firm_address`, + `firm_phone`, + `firm_bank`, + `firm_bank_account`, + `is_show_date`, + `user_notes`, + `creator_id`, + `creator_type`, + `creator`, + `create_time`, + `status`, + `invoicing_time`, + `drawer`, + `finance_notes`, + `electric_invoice_url`, + `updator`, + `update_time`, + `is_read`, + `del_flag` + SELECT invoice_id, + invoice_type, creator, creator_type, invoice_money, @@ -62,7 +89,10 @@ and creator = #{creator} - and creatorType = #{creatorType} + and creator_type = #{creatorType} + + + and invoice_type = #{invoiceType} and status = #{status} @@ -93,7 +123,10 @@ and creator = #{creator} - and creatorType = #{creatorType} + and creator_type = #{creatorType} + + + and invoice_type = #{invoiceType} and status = #{status} @@ -132,19 +165,21 @@ GROUP BY title_content LIMIT 0,3 + + delete from xhpc_invoice @@ -343,6 +428,170 @@ + + insert into xhpc_invoice + + + receive_email, + + + title_type, + + + title_content, + + + duty_number, + + + invoice_content, + + + invoice_money, + + + invoice_order_eletric_total_money, + + + invoice_order_service_total_money, + + + firm_address, + + + firm_phone, + + + firm_bank, + + + firm_bank_account, + + + is_show_date, + + + user_notes, + + + creator_id, + + + creator_type, + + + creator, + + + create_time, + + + `status`, + + + invoicing_time, + + + drawer, + + + finance_notes, + + + electric_invoice_url, + + + updator, + + + update_time, + + + del_flag, + + + + + #{receiveEmail,jdbcType=VARCHAR}, + + + #{titleType,jdbcType=INTEGER}, + + + #{titleContent,jdbcType=VARCHAR}, + + + #{dutyNumber,jdbcType=VARCHAR}, + + + #{invoiceContent,jdbcType=VARCHAR}, + + + #{invoiceMoney,jdbcType=DECIMAL}, + + + #{invoiceOrderEletricTotalMoney,jdbcType=DECIMAL}, + + + #{invoiceOrderServiceTotalMoney,jdbcType=DECIMAL}, + + + #{firmAddress,jdbcType=VARCHAR}, + + + #{firmPhone,jdbcType=VARCHAR}, + + + #{firmBank,jdbcType=VARCHAR}, + + + #{firmBankAccount,jdbcType=VARCHAR}, + + + #{isShowDate,jdbcType=INTEGER}, + + + #{userNotes,jdbcType=VARCHAR}, + + + #{creatorId,jdbcType=BIGINT}, + + + #{creatorType,jdbcType=INTEGER}, + + + #{creator,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{status,jdbcType=INTEGER}, + + + #{invoicingTime,jdbcType=TIMESTAMP}, + + + #{drawer,jdbcType=VARCHAR}, + + + #{financeNotes,jdbcType=VARCHAR}, + + + #{electricInvoiceUrl,jdbcType=VARCHAR}, + + + #{updator,jdbcType=BIGINT}, + + + #{updateTime,jdbcType=DATE}, + + + #{delFlag,jdbcType=INTEGER}, + + + update xhpc_invoice @@ -458,24 +707,38 @@ where invoice_id = #{invoiceId,jdbcType=BIGINT} - + UPDATE xhpc_invoice SET finance_notes = #{financeNotes}, invoicing_time = #{invoicingTime}, electric_invoice_url = #{eletricInvoiceUrl}, `status` = #{status}, - drawer = #{drawer} + drawer = #{drawer}, + is_read = 0 WHERE invoice_id = #{invoiceId}; - + UPDATE xhpc_invoice SET finance_notes = #{financeNotes}, invoicing_time = #{invoicingTime}, electric_invoice_url = #{eletricInvoiceUrl}, `status` = #{status}, - drawer = #{drawer} + drawer = #{drawer}, + is_read = 0 WHERE invoice_id = #{invoiceId} + + UPDATE xhpc_invoice + SET is_read = 1 + WHERE del_flag IS NULL + AND invoice_id = #{invoiceId} + + + UPDATE xhpc_invoice + SET invoice_order_eletric_total_money = #{invoiceOrderEletricTotalMoney}, + invoice_order_service_total_money = #{invoiceOrderServiceTotalMoney} + WHERE invoice_id = #{invoiceId}; + \ No newline at end of file diff --git a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcOperatorMapper.xml b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcOperatorMapper.xml index 7e0568e3..0b82fb81 100644 --- a/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcOperatorMapper.xml +++ b/xhpc-modules/xhpc-invoice/src/main/resources/mapper/XhpcOperatorMapper.xml @@ -51,236 +51,6 @@ xo.create_by createBy, xo.update_time updateTime, xo.update_by updateBy, xo.remark, - - insert into xhpc_operator - - - name, - - - contact_name, - - - contact_phone, - - - phone, - - - attribute, - - - duty_paragraph, - - - detailed_address, - - - open_bank, - - - card_number, - - - area_code, - - - address, - - - longitude, - - - latitude, - - - email, - - - commission_type, - - - platform_commission_rate, - - - maintenance_commission_rate, - - - business_license_id, - - - withdrawal_time, - - - soc, - - - status, - - - del_flag, - - - create_time, - - - create_by, - - - update_time, - - - update_by, - - - remark, - - - operator_id_evcs - - - - - #{name}, - - - #{contactName}, - - - #{contactPhone}, - - - #{phone}, - - - #{attribute}, - - - #{dutyParagraph}, - - - #{detailedAddress}, - - - #{openBank}, - - - #{cardNumber}, - - - #{areaCode}, - - - #{address}, - - - #{longitude}, - - - #{latitude}, - - - #{email}, - - - #{commissionType}, - - - #{platformCommissionRate}, - - - #{maintenanceCommissionRate}, - - - #{businessLicenseId}, - - - #{withdrawalTime}, - - - #{soc}, - - - #{status}, - - - #{delFlag}, - - - #{createTime}, - - - #{createBy}, - - - #{updateTime}, - - - #{updateBy}, - - - #{remark}, - - - #{operatorIdEvcs} - - - - - - UPDATE xhpc_operator - - operator_id = #{operatorId}, - name = #{name}, - contact_name = #{contactName}, - contact_phone = #{contactPhone}, - phone = #{phone}, - attribute = #{attribute}, - open_bank = #{openBank}, - card_number = #{cardNumber}, - area_code = #{areaCode}, - address = #{address}, - longitude = #{longitude}, - latitude = #{latitude}, - email = #{email}, - commission_type = #{commissionType}, - platform_commission_rate = - #{platformCommissionRate}, - - maintenance_commission_rate - = #{maintenanceCommissionRate}, - - business_license_id = - #{businessLicenseId}, - - withdrawal_time = #{withdrawalTime}, - soc = #{soc}, - status = #{status}, - del_flag = #{delFlag}, - create_time = #{createTime}, - create_by = #{createBy}, - update_time = #{updateTime}, - update_by = #{updateBy}, - remark = #{remark}, - operator_id_evcs = #{operatorIdEvcs} - - WHERE operator_id = #{operatorId} - - - - delete from xhpc_operator where operator_id in - - #{ids} - - - - - - - - - delete - from sys_user_role - where user_id = #{userId} - - - - delete - from sys_user_post - where user_id = #{userId} - - - - update sys_user - set del_flag = #{delFlag} - where user_id = #{userId} - - - - - - - - - delete - from sys_role - where role_name = #{roleName} - diff --git a/xhpc-modules/xhpc-order/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-order/src/main/resources/bootstrap.yml index dde4d751..5571b791 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-order/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-payment/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-payment/src/main/resources/bootstrap.yml index 8f3891cf..339e2e7c 100644 --- a/xhpc-modules/xhpc-payment/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-payment/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-power-pile/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-power-pile/src/main/resources/bootstrap.yml index df3a5bc9..8c12f14b 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-power-pile/src/main/resources/bootstrap.yml @@ -18,10 +18,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml index 38aa8d6e..c570dc4f 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-wxma/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-wxma/src/main/resources/bootstrap.yml index c6ad3564..35c8095c 100644 --- a/xhpc-modules/xhpc-wxma/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-wxma/src/main/resources/bootstrap.yml @@ -16,10 +16,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 config: # 配置中心地址 - server-addr: 172.31.183.135:8848 + server-addr: 127.0.0.1:8848 # 配置文件格式 file-extension: yml # 共享配置