diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/dao/INuoNuoDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/dao/INuoNuoDao.java new file mode 100644 index 00000000..afbdb384 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/dao/INuoNuoDao.java @@ -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 { + +} + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/dao/impl/NuoNuoDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/dao/impl/NuoNuoDaoImpl.java new file mode 100644 index 00000000..a99b9fcd --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/dao/impl/NuoNuoDaoImpl.java @@ -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 implements INuoNuoDao { + +} + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/entity/NuoNuoEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/entity/NuoNuoEntity.java new file mode 100644 index 00000000..cf9a6712 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/entity/NuoNuoEntity.java @@ -0,0 +1,8 @@ +package com.hzya.frame.plugin.nuonuo.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +public class NuoNuoEntity extends BaseEntity { + +} + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/entity/NuoNuoEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/entity/NuoNuoEntity.xml new file mode 100644 index 00000000..a11bc405 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/entity/NuoNuoEntity.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/plugin/NuoNuoPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/plugin/NuoNuoPluginInitializer.java new file mode 100644 index 00000000..4727560d --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/plugin/NuoNuoPluginInitializer.java @@ -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; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/service/INuoNuoService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/service/INuoNuoService.java new file mode 100644 index 00000000..2e699a3e --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/service/INuoNuoService.java @@ -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{ + /** + * @Author lvleigang + * @Description 同步诺诺发票 + * @Date 5:31 下午 2025/6/26 + * @param requestJson + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity sendNuoNuoFaPiao(JSONObject requestJson); +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/service/impl/NuoNuoServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/service/impl/NuoNuoServiceImpl.java new file mode 100644 index 00000000..2f88de56 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/nuonuo/service/impl/NuoNuoServiceImpl.java @@ -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 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; + } +} diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/nuonuo/pluginCfg.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/nuonuo/pluginCfg.xml new file mode 100644 index 00000000..60c36bd0 --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/nuonuo/pluginCfg.xml @@ -0,0 +1,6 @@ + + +NuoNuoPlugin +NuoNuoPlugin插件 +20250626001 + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/nuonuo/spring/spring-buildpackage-dao.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/nuonuo/spring/spring-buildpackage-dao.xml new file mode 100644 index 00000000..2dba0b69 --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/nuonuo/spring/spring-buildpackage-dao.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/nuonuo/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/nuonuo/spring/spring-buildpackage-plugin.xml new file mode 100644 index 00000000..fc1fa758 --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/nuonuo/spring/spring-buildpackage-plugin.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/nuonuo/spring/spring-buildpackage-service.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/nuonuo/spring/spring-buildpackage-service.xml new file mode 100644 index 00000000..c74f34f8 --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/nuonuo/spring/spring-buildpackage-service.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java b/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java index 253ef940..bc9a2ccd 100644 --- a/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java +++ b/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java @@ -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); + } } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/INuoNuoCallbackDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/INuoNuoCallbackDao.java new file mode 100644 index 00000000..172a52ee --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/INuoNuoCallbackDao.java @@ -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 { + +} + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/NuoNuoCallbackDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/NuoNuoCallbackDaoImpl.java new file mode 100644 index 00000000..2b74d0d7 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/NuoNuoCallbackDaoImpl.java @@ -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 implements INuoNuoCallbackDao { + +} + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/NuoNuoCallbackEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/NuoNuoCallbackEntity.java new file mode 100644 index 00000000..89583a04 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/NuoNuoCallbackEntity.java @@ -0,0 +1,8 @@ +package com.hzya.frame.seeyon.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +public class NuoNuoCallbackEntity extends BaseEntity { + +} + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/NuoNuoCallbackEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/NuoNuoCallbackEntity.xml new file mode 100644 index 00000000..7c7e8b6e --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/NuoNuoCallbackEntity.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/INuoNuoCallbackService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/INuoNuoCallbackService.java new file mode 100644 index 00000000..38c815d7 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/INuoNuoCallbackService.java @@ -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); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/NuoNuoCallbackServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/NuoNuoCallbackServiceImpl.java new file mode 100644 index 00000000..78965684 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/NuoNuoCallbackServiceImpl.java @@ -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; + } +}