请购单、请款单接口完善

2024年9月20日14:35:03
This commit is contained in:
xiang2lin 2024-09-20 14:35:10 +08:00
parent b6b4fd877d
commit 0f6ee62126
13 changed files with 451 additions and 38 deletions

View File

@ -0,0 +1,12 @@
package com.hzya.frame.plugin.dgx.u9c.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.dgx.u9c.entity.PrepaymentDetailEntity;
/**
* @Description 德广信U9C预付单明细表
* @Author xiangerlin
* @Date 2024/9/18 17:18
**/
public interface IPrepaymentDetailDao extends IBaseDao<PrepaymentDetailEntity,String> {
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.plugin.dgx.u9c.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.dgx.u9c.entity.RequisitionDetailEntity;
/**
* @Description 德广信U9C请购单明细
* @Author xiangerlin
* @Date 2024/9/18 17:15
**/
public interface IRequisitionDetailDao extends IBaseDao<RequisitionDetailEntity,String> {
}

View File

@ -0,0 +1,13 @@
package com.hzya.frame.plugin.dgx.u9c.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.dgx.u9c.dao.IPrepaymentDetailDao;
import com.hzya.frame.plugin.dgx.u9c.entity.PrepaymentDetailEntity;
/**
* @Description 德广信U9C预付单明细表
* @Author xiangerlin
* @Date 2024/9/18 17:19
**/
public class PrepaymentDetailDaoImpl extends MybatisGenericDao<PrepaymentDetailEntity,String> implements IPrepaymentDetailDao {
}

View File

@ -0,0 +1,13 @@
package com.hzya.frame.plugin.dgx.u9c.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.dgx.u9c.dao.IRequisitionDetailDao;
import com.hzya.frame.plugin.dgx.u9c.entity.RequisitionDetailEntity;
/**
* @Description 德广信U9C请购单明细
* @Author xiangerlin
* @Date 2024/9/18 17:17
**/
public class RequisitionDetailDaoImpl extends MybatisGenericDao<RequisitionDetailEntity,String> implements IRequisitionDetailDao {
}

View File

@ -0,0 +1,11 @@
package com.hzya.frame.plugin.dgx.u9c.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* @Description 德广信U9C预付单明细
* @Author xiangerlin
* @Date 2024/9/18 17:11
**/
public class PrepaymentDetailEntity extends BaseEntity {
}

View File

@ -0,0 +1,11 @@
package com.hzya.frame.plugin.dgx.u9c.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* @Description 德广信U9C请购单明细
* @Author xiangerlin
* @Date 2024/9/18 17:11
**/
public class RequisitionDetailEntity extends BaseEntity {
}

View File

@ -0,0 +1,21 @@
package com.hzya.frame.plugin.dgx.u9c.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.plugin.dgx.u9c.entity.PrepaymentDetailEntity;
import java.util.List;
/**
* @Description 德广信U9C预付单明细
* @Author xiangerlin
* @Date 2024/9/18 17:22
**/
public interface IPrepaymentDetailService extends IBaseService<PrepaymentDetailEntity,String> {
/**
* 查询预付单明细
* @param entity
* @return
*/
List<PrepaymentDetailEntity> queryDetails(PrepaymentDetailEntity entity);
}

View File

@ -0,0 +1,20 @@
package com.hzya.frame.plugin.dgx.u9c.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.plugin.dgx.u9c.entity.RequisitionDetailEntity;
import java.util.List;
/**
* @Description 广信U9C请购单 明细
* @Author xiangerlin
* @Date 2024/9/18 17:22
**/
public interface IRequisitionDetailService extends IBaseService<RequisitionDetailEntity,String> {
/**
* 查询请购单明细
* @param entity
* @return
*/
List<RequisitionDetailEntity> queryDetails(RequisitionDetailEntity entity);
}

View File

@ -0,0 +1,38 @@
package com.hzya.frame.plugin.dgx.u9c.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.plugin.dgx.u9c.dao.IPrepaymentDetailDao;
import com.hzya.frame.plugin.dgx.u9c.entity.PrepaymentDetailEntity;
import com.hzya.frame.plugin.dgx.u9c.service.IPrepaymentDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @Description 德广信U9C预付单明细
* @Author xiangerlin
* @Date 2024/9/18 17:23
**/
public class PrepaymentDetailServiceImpl extends BaseService<PrepaymentDetailEntity,String> implements IPrepaymentDetailService {
private IPrepaymentDetailDao prepaymentDetailDao;
@Autowired
public void setPrepaymentDetailDao(IPrepaymentDetailDao dao) {
this.prepaymentDetailDao = dao;
this.dao = dao;
}
/**
* 查询预付单明细
*
* @param entity
* @return
*/
@DS("#entity.dataSourceCode")
@Override
public List<PrepaymentDetailEntity> queryDetails(PrepaymentDetailEntity entity) {
return null;
}
}

View File

@ -0,0 +1,38 @@
package com.hzya.frame.plugin.dgx.u9c.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.plugin.dgx.u9c.dao.IRequisitionDetailDao;
import com.hzya.frame.plugin.dgx.u9c.entity.RequisitionDetailEntity;
import com.hzya.frame.plugin.dgx.u9c.service.IRequisitionDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @Description
* @Author xiangerlin
* @Date 2024/9/18 17:25
**/
public class RequisitionDetailServiceImpl extends BaseService<RequisitionDetailEntity,String> implements IRequisitionDetailService {
private IRequisitionDetailDao requisitionDetailDao;
@Autowired
public void setRequisitionDetailDao(IRequisitionDetailDao dao) {
this.requisitionDetailDao = dao;
this.dao = dao;
}
/**
* 查询请购单明细
*
* @param entity
* @return
*/
@DS("#entity.dataSourceCode")
@Override
public List<RequisitionDetailEntity> queryDetails(RequisitionDetailEntity entity) {
return null;
}
}

View File

@ -4,11 +4,11 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.plugin.dgx.u9c.entity.PrepaymentDetailEntity;
import com.hzya.frame.plugin.dgx.u9c.entity.PrepaymentEntity;
import com.hzya.frame.plugin.dgx.u9c.entity.RequisitionDetailEntity;
import com.hzya.frame.plugin.dgx.u9c.entity.RequisitionEntity;
import com.hzya.frame.plugin.dgx.u9c.service.IPrepaymentService;
import com.hzya.frame.plugin.dgx.u9c.service.IRequisitionService;
import com.hzya.frame.plugin.dgx.u9c.service.IU9CPluginService;
import com.hzya.frame.plugin.dgx.u9c.service.*;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.commons.collections.CollectionUtils;
@ -28,8 +28,12 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
Logger logger = LoggerFactory.getLogger(getClass());
@Resource(name = "prepaymentServiceImpl")
private IPrepaymentService prepaymentService;
@Resource
private IPrepaymentDetailService prepaymentDetailServiceImpl;
@Resource(name = "requisitionServiceImpl")
private IRequisitionService requisitionService;
@Resource
private IRequisitionDetailService requisitionDetailServiceImpl;
/**
* u9c预付单发起OA请款单流程
@ -59,23 +63,175 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
List<PrepaymentEntity> prepaymentList = prepaymentService.queryList(prepaymentEntity);
if (CollectionUtils.isNotEmpty(prepaymentList)){
for (PrepaymentEntity prepayment : prepaymentList) {
//主表
JSONObject formmain_0668 = new JSONObject();
//子表
List<JSONObject> formsonList = new LinkedList<>();
JSONObject formson_0669 = new JSONObject();
formsonList.add(formson_0669);
JSONObject formData = new JSONObject();
formData.put("formmain_0668",formmain_0668);
formData.put("formson_0669",formsonList);
JSONObject data = new JSONObject();
data.put("templateCode","");
data.put("draft","0");
data.put("data",formData);
JSONObject param = new JSONObject();
param.put("appName","collaboration");
param.put("data",data);
String s = invokeEsb(param, "800045", "8000450001");
//查询u9c预付单明细
PrepaymentDetailEntity prepaymentDetailEntity = new PrepaymentDetailEntity();
List<PrepaymentDetailEntity> prepaymentDetailList = prepaymentDetailServiceImpl.queryDetails(prepaymentDetailEntity);
if (CollectionUtils.isNotEmpty(prepaymentDetailList)){
//主表
JSONObject formmain_0668 = new JSONObject();
//单据类型
formmain_0668.put("field0001","");
//币种
formmain_0668.put("field0002","");
//单号
formmain_0668.put("field0003","");
//业务员
formmain_0668.put("field0004","");
//申请日期
formmain_0668.put("field0005","");
//部门
formmain_0668.put("field0006","");
//预计付款日
formmain_0668.put("field0007","");
//付款方式
formmain_0668.put("field0008","");
//请款对象
formmain_0668.put("field0009","");
//状态
formmain_0668.put("field0010","");
//请款用途
formmain_0668.put("field0011","");
//出纳确认
formmain_0668.put("field0012","");
//折扣前请款金额合计
formmain_0668.put("field0044","");
//请款对应折扣合计
formmain_0668.put("field0045","");
//折扣后请款金额合计
formmain_0668.put("field0046","");
//付款本币金额合计
formmain_0668.put("field0047","");
//请款金额合计
formmain_0668.put("field0053","");
//请款数量合计
formmain_0668.put("field0061","");
//请款金额和明细合计
formmain_0668.put("field0063","");
//单据编号
formmain_0668.put("field0070","");
//发起人
formmain_0668.put("field0071","");
//发起部门
formmain_0668.put("field0072","");
//发起时间
formmain_0668.put("field0073","");
//子表
List<JSONObject> formson69List = new LinkedList<>();
List<JSONObject> formson70List = new LinkedList<>();
for (PrepaymentDetailEntity detail : prepaymentDetailList) {
JSONObject formson_0669 = new JSONObject();
//行号
formson_0669.put("field0013","");
//供应商
formson_0669.put("field0014","");
//选单
formson_0669.put("field0015","");
//折扣前请款金额
formson_0669.put("field0016","");
//请款对应折扣
formson_0669.put("field0017","");
//折扣后请款金额
formson_0669.put("field0018","");
//付款本币金额
formson_0669.put("field0019","");
//结算方式
formson_0669.put("field0020","");
//收款银行帐号
formson_0669.put("field0021","");
//收款账号名称
formson_0669.put("field0022","");
//开户银行
formson_0669.put("field0023","");
//收支项目
formson_0669.put("field0024","");
//部门-供应商
formson_0669.put("field0025","");
//业务员-供应商
formson_0669.put("field0026","");
//项目-供应商
formson_0669.put("field0027","");
//预付款类型
formson_0669.put("field0051","");
//请款金额
formson_0669.put("field0052","");
//料品
formson_0669.put("field0054","");
formson69List.add(formson_0669);
JSONObject formson_0070 = new JSONObject();
//单据类型明细
formson_0070.put("field0028","");
//应付单
formson_0070.put("field0029","");
//折扣前可请款金额
formson_0070.put("field0030","");
//可享受折扣
formson_0070.put("field0031","");
//折扣前请款金额明细
formson_0070.put("field0032","");
//请款享受折扣
formson_0070.put("field0033","");
//折扣后请款金额明细
formson_0070.put("field0034","");
//累计确认对应金额
formson_0070.put("field0035","");
//发票号
formson_0070.put("field0036","");
//发票日期
formson_0070.put("field0037","");
//立账日期
formson_0070.put("field0038","");
//记账日期
formson_0070.put("field0039","");
//到期日
formson_0070.put("field0040","");
//付款条件
formson_0070.put("field0041","");
//部门明细
formson_0070.put("field0042","");
//业务员明细
formson_0070.put("field0043","");
//预付款类型明细
formson_0070.put("field0055","");
//单号明细
formson_0070.put("field0056","");
//单价
formson_0070.put("field0057","");
//数量
formson_0070.put("field0058","");
//单位
formson_0070.put("field0059","");
//请款数量
formson_0070.put("field0060","");
//请款金额明细
formson_0070.put("field0062","");
//费用
formson_0070.put("field0064","");
//料号
formson_0070.put("field0065","");
//料品明细
formson_0070.put("field0066","");
//项目
formson_0070.put("field0067","");
//立账供应商
formson_0070.put("field0068","");
//单据状态
formson_0070.put("field0069","");
formson70List.add(formson_0070);
}
JSONObject formData = new JSONObject();
formData.put("formmain_0668",formmain_0668);
formData.put("formson_0669",formson69List);
formData.put("formson_0670",formson70List);
JSONObject data = new JSONObject();
data.put("templateCode","");
data.put("draft","0");
data.put("data",formData);
JSONObject param = new JSONObject();
param.put("appName","collaboration");
param.put("data",data);
String s = invokeEsb(param, "800045", "8000450001");
}
}
}
@ -100,6 +256,7 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
String taskId = requestJson.getString("integration_task_living_details_id");
//查询u9c请购单
RequisitionEntity requisitionEntity = new RequisitionEntity();
requisitionEntity.setDataSourceCode(datasourceCode);
if (StrUtil.isEmpty(taskId)){
requisitionEntity.setStartTime(startTime);
requisitionEntity.setEndTime(endTime);
@ -109,23 +266,86 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
List<RequisitionEntity> requisitionList = requisitionService.queryList(requisitionEntity);
if (CollectionUtils.isNotEmpty(requisitionList)){
for (RequisitionEntity requisition : requisitionList) {
//主表
JSONObject formmain_0652 = new JSONObject();
//子表
List<JSONObject> formsonList = new LinkedList<>();
JSONObject formson_0653 = new JSONObject();
formsonList.add(formson_0653);
JSONObject formData = new JSONObject();
formData.put("formmain_0652",formmain_0652);
formData.put("formson_0653",formsonList);
JSONObject data = new JSONObject();
data.put("templateCode","");
data.put("draft","0");
data.put("data",formData);
JSONObject param = new JSONObject();
param.put("appName","collaboration");
param.put("data",data);
String s = invokeEsb(param, "800045", "8000450001");
//查询u9c请购单明细
RequisitionDetailEntity requisitionDetail = new RequisitionDetailEntity();
List<RequisitionDetailEntity> requisitionDetailList = requisitionDetailServiceImpl.queryDetails(requisitionDetail);
if (CollectionUtils.isNotEmpty(requisitionDetailList)){
//主表
JSONObject formmain_0652 = new JSONObject();
//单据类型
formmain_0652.put("field0001","");
//发起人
formmain_0652.put("field0002","");
//发起部门
formmain_0652.put("field0003","");
//发起时间
formmain_0652.put("field0004","");
//需求人员
formmain_0652.put("field0005","");
//来源类型
formmain_0652.put("field0006","");
//单号
formmain_0652.put("field0007","");
//需求部门
formmain_0652.put("field0008","");
//来源单号
formmain_0652.put("field0009","");
//日期
formmain_0652.put("field0010","");
//项目
formmain_0652.put("field0011","");
//厂区
formmain_0652.put("field0012","");
//状态
formmain_0652.put("field0013","");
//请购数量合计
formmain_0652.put("field0030","");
//子表
List<JSONObject> formsonList = new LinkedList<>();
for (RequisitionDetailEntity detail : requisitionDetailList) {
JSONObject formson_0653 = new JSONObject();
//行号
formson_0653.put("field0014","");
//需求分类
formson_0653.put("field0015","");
//厂区明细
formson_0653.put("field0016","");
//项目明细
formson_0653.put("field0017","");
//料号
formson_0653.put("field0018","");
//品名
formson_0653.put("field0021","");
//规格
formson_0653.put("field0022","");
//请购数量
formson_0653.put("field0023","");
//单位
formson_0653.put("field0024","");
//单据备注
formson_0653.put("field0025","");
//需求交货日期
formson_0653.put("field0026","");
//来源单号明细
formson_0653.put("field0027","");
//库存可用量
formson_0653.put("field0028","");
//状态明细
formson_0653.put("field0029","");
formsonList.add(formson_0653);
}
JSONObject formData = new JSONObject();
formData.put("formmain_0652",formmain_0652);
formData.put("formson_0653",formsonList);
JSONObject data = new JSONObject();
data.put("templateCode","");
data.put("draft","0");
data.put("data",formData);
JSONObject param = new JSONObject();
param.put("appName","collaboration");
param.put("data",data);
String s = invokeEsb(param, "800045", "8000450002");
}
}
}
return BaseResult.getSuccessMessageEntity("德广信U9C请购单推送OA插件执行成功");

View File

@ -2,5 +2,7 @@
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName">
<bean name="requisitionDaoImpl" class="com.hzya.frame.plugin.dgx.u9c.dao.impl.RequisitionDaoImpl" />
<bean name="PrepaymentDaoImpl" class="com.hzya.frame.plugin.dgx.u9c.dao.impl.PrepaymentDaoImpl" />
<bean name="requisitionDetailDaoImpl" class="com.hzya.frame.plugin.dgx.u9c.dao.impl.RequisitionDetailDaoImpl" />
<bean name="prepaymentDaoImpl" class="com.hzya.frame.plugin.dgx.u9c.dao.impl.PrepaymentDaoImpl" />
<bean name="prepaymentDetailDaoImpl" class="com.hzya.frame.plugin.dgx.u9c.dao.impl.PrepaymentDetailDaoImpl" />
</beans>

View File

@ -2,6 +2,8 @@
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName">
<bean name="requisitionServiceImpl" class="com.hzya.frame.plugin.dgx.u9c.service.impl.RequisitionServiceImpl" />
<bean name="requisitionDetailServiceImpl" class="com.hzya.frame.plugin.dgx.u9c.service.impl.RequisitionDetailServiceImpl" />
<bean name="prepaymentServiceImpl" class="com.hzya.frame.plugin.dgx.u9c.service.impl.PrepaymentServiceImpl" />
<bean name="prepaymentDetailServiceImpl" class="com.hzya.frame.plugin.dgx.u9c.service.impl.PrepaymentDetailServiceImpl" />
<bean name="u9CPluginServiceImpl" class="com.hzya.frame.plugin.dgx.u9c.service.impl.U9CPluginServiceImpl" />
</beans>