诺诺发票

This commit is contained in:
lvleigang 2025-06-27 13:57:22 +08:00
parent 999e462465
commit ef4c20645e
18 changed files with 298 additions and 1 deletions

View File

@ -0,0 +1,9 @@
package com.hzya.frame.plugin.nuonuo.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.nuonuo.entity.NuoNuoEntity;
public interface INuoNuoDao extends IBaseDao<NuoNuoEntity, String> {
}

View File

@ -0,0 +1,11 @@
package com.hzya.frame.plugin.nuonuo.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.nuonuo.dao.INuoNuoDao;
import com.hzya.frame.plugin.nuonuo.entity.NuoNuoEntity;
public class NuoNuoDaoImpl extends MybatisGenericDao<NuoNuoEntity, String> implements INuoNuoDao {
}

View File

@ -0,0 +1,8 @@
package com.hzya.frame.plugin.nuonuo.entity;
import com.hzya.frame.web.entity.BaseEntity;
public class NuoNuoEntity extends BaseEntity {
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.plugin.nuonuo.entity.NuoNuoEntity">
</mapper>

View File

@ -0,0 +1,62 @@
package com.hzya.frame.plugin.nuonuo.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.plugin.masterData.plugin.MdmPluginInitializer;
import com.hzya.frame.plugin.nuonuo.service.INuoNuoService;
import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
* 诺诺发票
*
* @author makejava
* @since 2024-06-21 13:52:35
*/
public class NuoNuoPluginInitializer extends PluginBaseEntity{
Logger logger = LoggerFactory.getLogger(NuoNuoPluginInitializer.class);
@Autowired
private INuoNuoService nuoNuoService;
@Override
public void initialize() {
logger.info(getPluginLabel() + "执行初始化方法initialize()");
}
@Override
public void destroy() {
logger.info(getPluginLabel() + "执行销毁方法destroy()");
}
@Override
public String getPluginId() {
return "NuoNuoPlugin";
}
@Override
public String getPluginName() {
return "NuoNuoPlugin插件";
}
@Override
public String getPluginLabel() {
return "NuoNuoPlugin";
}
@Override
public String getPluginType() {
return "1";
}
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) {
try {
logger.info("======开始执行诺诺发票同步========");
return nuoNuoService.sendNuoNuoFaPiao(requestJson);
}catch (Exception e){
logger.info("======执行诺诺发票同步失败:{}========",e.getMessage());
}
return null;
}
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.plugin.nuonuo.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.plugin.nuonuo.entity.NuoNuoEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
public interface INuoNuoService extends IBaseService<NuoNuoEntity, String>{
/**
* @Author lvleigang
* @Description 同步诺诺发票
* @Date 5:31 下午 2025/6/26
* @param requestJson
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity sendNuoNuoFaPiao(JSONObject requestJson);
}

View File

@ -0,0 +1,32 @@
package com.hzya.frame.plugin.nuonuo.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.plugin.nuonuo.dao.INuoNuoDao;
import com.hzya.frame.plugin.nuonuo.entity.NuoNuoEntity;
import com.hzya.frame.plugin.nuonuo.service.INuoNuoService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import com.hzya.frame.basedao.service.impl.BaseService;
public class NuoNuoServiceImpl extends BaseService<NuoNuoEntity, String> implements INuoNuoService {
private INuoNuoDao nuoNuoDao;
@Autowired
public void setNuoNuoCustomerDao(INuoNuoDao dao) {
this.nuoNuoDao = dao;
this.dao = dao;
}
/**
* @param requestJson
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 同步诺诺发票
* @Date 5:31 下午 2025/6/26
**/
@Override
public JsonResultEntity sendNuoNuoFaPiao(JSONObject requestJson) {
return null;
}
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<id>NuoNuoPlugin</id>
<name>NuoNuoPlugin插件</name>
<category>20250626001</category>
</plugin>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName">
<bean name="nuoNuoDao" class="com.hzya.frame.plugin.nuonuo.dao.impl.NuoNuoDaoImpl" />
</beans>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName">
<bean name="nuoNuoPluginInitializer" class="com.hzya.frame.plugin.nuonuo.plugin.NuoNuoPluginInitializer" />
</beans>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName">
<bean name="nuoNuoService" class="com.hzya.frame.plugin.nuonuo.service.impl.NuoNuoServiceImpl" />
</beans>

View File

@ -1,5 +1,7 @@
package com.hzya.frame.webapp.entrance.controler;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.seeyon.service.INuoNuoCallbackService;
import com.hzya.frame.sys.entity.EsbReturnEntity;
import com.hzya.frame.sys.file.download.entity.FileDownloadEntity;
import com.hzya.frame.sys.file.download.service.IFileDownloadService;
@ -50,6 +52,8 @@ public class EntranceController {
protected IFileDownloadService filedownloadService;
@Resource
protected ISysApplicationService sysApplicationService;
@Autowired
private INuoNuoCallbackService nuoNuoCallbackService;
@RequestMapping(value = "/option")
@ResponseBody
public JsonResultEntity option(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception {
@ -222,6 +226,10 @@ public class EntranceController {
public JsonResultEntity externalCallInterfaceToESB(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception {
return sysApplicationService.externalCallInterfaceToESB(servletRequest,servletResponse);
}
@RequestMapping(value = "/nuoNuoCallback")
@ResponseBody
public JSONObject nuoNuoCallback(@RequestBody JSONObject jsonObject) throws Exception {
return nuoNuoCallbackService.nuoNuoCallback(jsonObject);
}
}

View File

@ -0,0 +1,10 @@
package com.hzya.frame.seeyon.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.seeyon.entity.NuoNuoCallbackEntity;
public interface INuoNuoCallbackDao extends IBaseDao<NuoNuoCallbackEntity, String> {
}

View File

@ -0,0 +1,11 @@
package com.hzya.frame.seeyon.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.seeyon.dao.INuoNuoCallbackDao;
import com.hzya.frame.seeyon.entity.NuoNuoCallbackEntity;
public class NuoNuoCallbackDaoImpl extends MybatisGenericDao<NuoNuoCallbackEntity, String> implements INuoNuoCallbackDao {
}

View File

@ -0,0 +1,8 @@
package com.hzya.frame.seeyon.entity;
import com.hzya.frame.web.entity.BaseEntity;
public class NuoNuoCallbackEntity extends BaseEntity {
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.seeyon.entity.NuoNuoCallbackEntity">
</mapper>

View File

@ -0,0 +1,18 @@
package com.hzya.frame.seeyon.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
public interface INuoNuoCallbackService {
/**
* @Author lvleigang
* @Description 诺诺发票回调接口
* @Date 6:13 下午 2025/6/26
* @param jsonObject
* @return com.alibaba.fastjson.JSONObject
**/
JSONObject nuoNuoCallback(JSONObject jsonObject);
}

View File

@ -0,0 +1,70 @@
package com.hzya.frame.seeyon.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.seeyon.service.INuoNuoCallbackService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Service;
@Service(value = "nuoNuoCallbackService")
public class NuoNuoCallbackServiceImpl implements INuoNuoCallbackService {
Logger logger = LogManager.getLogger(getClass());
/**
* @param jsonObject
* @return com.alibaba.fastjson.JSONObject
* @Author lvleigang
* @Description 诺诺发票回调接口
* @Date 6:13 下午 2025/6/26
**/
@Override
public JSONObject nuoNuoCallback(JSONObject jsonObject) {
logger.error("诺诺发票回调接口:"+jsonObject.toJSONString());
String successFlag = jsonObject.getString("successFlag");//True:开票成功false开票失败
String errorMessage = jsonObject.getString("errorMessage");//开票异常信息
String pdfUrl = jsonObject.getString("pdfUrl");//发票pdf地址
String imageUrl = jsonObject.getString("imageUrl");//发票jpg地址
String invoiceTime = jsonObject.getString("invoiceTime");//开票日期
String invoiceCode = jsonObject.getString("invoiceCode");//发票代码
String invoiceNumber = jsonObject.getString("invoiceNumber");//发票号码
String orderNo = jsonObject.getString("orderNo");//订单编号
if(orderNo == null || "".equals(orderNo)){
JSONObject returnData = new JSONObject();
returnData.put("code","9999");
returnData.put("message","订单编号不存在");
return returnData;
}
if(successFlag == null || "".equals(successFlag)){
JSONObject returnData = new JSONObject();
returnData.put("code","9999");
returnData.put("message","开票状态不存在");
return returnData;
}
if(jsonObject.getBoolean("successFlag")){
errorMessage = "开票成功";
}else {
if(errorMessage == null || "".equals(errorMessage)){
JSONObject returnData = new JSONObject();
returnData.put("code","9999");
returnData.put("message","开票异常信息不存在");
return returnData;
}
}
//查找单据上传附件
//修改单据信息
JSONObject returnData = new JSONObject();
returnData.put("code","0000");
returnData.put("message","业务方接收同步成功");
return returnData;
}
}