回传状态

This commit is contained in:
lvleigang 2024-11-20 16:17:42 +08:00
parent b35b87cc5f
commit 9068a98f7a
12 changed files with 365 additions and 116 deletions

View File

@ -0,0 +1,45 @@
package com.hzya.frame.plugin.dgx.u9c.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.dgx.u9c.entity.OaEntity;
import java.util.List;
public interface IOaDao extends IBaseDao<OaEntity,String> {
/**
* @Author lvleigang
* @Description 查询oa请款单
* @Date 2:56 下午 2024/11/14
* @param oaEntity
* @return java.util.List<com.hzya.frame.plugin.dgx.u9c.entity.OaEntity>
**/
List<OaEntity> queryQkdList(OaEntity oaEntity);
/**
* @Author lvleigang
* @Description 修改oa请款单
* @Date 2:56 下午 2024/11/14
* @param oaEntity
* @return java.util.List<com.hzya.frame.plugin.dgx.u9c.entity.OaEntity>
**/
Integer updateQkd(OaEntity oaEntity);
/**
* @Author lvleigang
* @Description 查询oa请购单
* @Date 2:56 下午 2024/11/14
* @param oaEntity
* @return java.util.List<com.hzya.frame.plugin.dgx.u9c.entity.OaEntity>
**/
List<OaEntity> queryQgdList(OaEntity oaEntity);
/**
* @Author lvleigang
* @Description 修改oa请购单
* @Date 2:56 下午 2024/11/14
* @param oaEntity
* @return java.util.List<com.hzya.frame.plugin.dgx.u9c.entity.OaEntity>
**/
Integer updateQgd(OaEntity oaEntity);
}

View File

@ -0,0 +1,67 @@
package com.hzya.frame.plugin.dgx.u9c.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.dgx.u9c.dao.IOaDao;
import com.hzya.frame.plugin.dgx.u9c.entity.OaEntity;
import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiVo;
import java.util.List;
public class OaDaoImpl extends MybatisGenericDao<OaEntity,String> implements IOaDao {
/**
* @param entity
* @return java.util.List<com.hzya.frame.plugin.dgx.u9c.entity.OaEntity>
* @Author lvleigang
* @Description 查询oa请款单
* @Date 2:56 下午 2024/11/14
**/
@Override
@DS("#entity.dataSourceCode")
public List<OaEntity> queryQkdList(OaEntity entity) {
List<OaEntity> o = (List<OaEntity>) super.selectList(getSqlIdPrifx() + "queryQkdList", entity);
return o;
}
/**
* @param entity
* @return java.util.List<com.hzya.frame.plugin.dgx.u9c.entity.OaEntity>
* @Author lvleigang
* @Description 修改oa请款单
* @Date 2:56 下午 2024/11/14
**/
@Override
@DS("#entity.dataSourceCode")
public Integer updateQkd(OaEntity entity) {
Integer o = super.update(getSqlIdPrifx() + "updateQkd", entity);
return o;
}
/**
* @param entity
* @return java.util.List<com.hzya.frame.plugin.dgx.u9c.entity.OaEntity>
* @Author lvleigang
* @Description 查询oa请购单
* @Date 2:56 下午 2024/11/14
**/
@Override
@DS("#entity.dataSourceCode")
public List<OaEntity> queryQgdList(OaEntity entity) {
List<OaEntity> o = (List<OaEntity>) super.selectList(getSqlIdPrifx() + "queryQgdList", entity);
return o;
}
/**
* @param entity
* @return java.util.List<com.hzya.frame.plugin.dgx.u9c.entity.OaEntity>
* @Author lvleigang
* @Description 修改oa请购单
* @Date 2:56 下午 2024/11/14
**/
@Override
@DS("#entity.dataSourceCode")
public Integer updateQgd(OaEntity entity) {
Integer o = super.update(getSqlIdPrifx() + "updateQgd", entity);
return o;
}
}

View File

@ -0,0 +1,65 @@
package com.hzya.frame.plugin.dgx.u9c.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* @Description Oa
* @Author xiangerlin
* @Date 2024/9/18 14:08
**/
public class OaEntity extends BaseEntity {
//id
private String id;
//单号
private String docNo;
//单据状态code
private String status;
//推送状态
private String sendStatus;
//推送描述
private String sendMsg;
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
public String getDocNo() {
return docNo;
}
public void setDocNo(String docNo) {
this.docNo = docNo;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getSendStatus() {
return sendStatus;
}
public void setSendStatus(String sendStatus) {
this.sendStatus = sendStatus;
}
public String getSendMsg() {
return sendMsg;
}
public void setSendMsg(String sendMsg) {
this.sendMsg = sendMsg;
}
}

View File

@ -0,0 +1,48 @@
<?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.dgx.u9c.dao.impl.OaDaoImpl">
<!-- 查询 采用==查询 -->
<select id="queryQkdList" resultType="com.hzya.frame.plugin.dgx.u9c.entity.OaEntity" parameterType = "com.hzya.frame.plugin.dgx.u9c.entity.OaEntity">
select
formmain_0664.id,
formmain_0664.field0003 as docNo,
COL_SUMMARY.STATE as status
from formmain_0664
LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0664.id
WHERE formmain_0664.field0074 is NULL and COL_SUMMARY.STATE in ( '1','3','0')
and formmain_0664.finishedflag = 1
</select>
<update id="updateQkd" parameterType="com.hzya.frame.plugin.dgx.u9c.entity.OaEntity">
update formmain_0664 set
<trim suffix="" suffixOverrides=",">
<if test="sendStatus != null and sendStatus != ''"> field0074 = #{sendStatus},</if>
<if test="sendMsg != null and sendMsg != ''"> field0075 = #{sendMsg},</if>
</trim>
where id = #{id}
</update>
<!-- 查询 采用==查询 -->
<select id="queryQgdList" resultType="com.hzya.frame.plugin.dgx.u9c.entity.OaEntity" parameterType = "com.hzya.frame.plugin.dgx.u9c.entity.OaEntity">
select
formmain_0673.id,
formmain_0673.field0007 as docNo,
COL_SUMMARY.STATE as status
from formmain_0673
LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0673.id
WHERE formmain_0673.field0032 is NULL and COL_SUMMARY.STATE in ( '1','3','0')
and formmain_0673.finishedflag = 1
</select>
<update id="updateQgd" parameterType="com.hzya.frame.plugin.dgx.u9c.entity.OaEntity">
update formmain_0673 set
<trim suffix="" suffixOverrides=",">
<if test="sendStatus != null and sendStatus != ''"> field0032 = #{sendStatus},</if>
<if test="sendMsg != null and sendMsg != ''"> field0033 = #{sendMsg},</if>
</trim>
where id = #{id}
</update>
</mapper>

View File

@ -90,7 +90,7 @@
<if test="createdOn != null and createdOn != ''"> and createdOn = #{createdOn} </if> <if test="createdOn != null and createdOn != ''"> and createdOn = #{createdOn} </if>
<if test="startTime != null and startTime != ''"> and modifiedOn >= #{startTime} </if> <if test="startTime != null and startTime != ''"> and modifiedOn >= #{startTime} </if>
<if test="endTime != null and endTime != ''"> <![CDATA[ and modifiedOn <= #{endTime} ]]> </if> <if test="endTime != null and endTime != ''"> <![CDATA[ and modifiedOn <= #{endTime} ]]> </if>
and dataStatus is null and dataStatus is null or dataStatus = ''
</trim> </trim>
order by v_hzya_u9c_payreq.modifiedOn desc order by v_hzya_u9c_payreq.modifiedOn desc
</select> </select>
@ -121,25 +121,17 @@
<if test="createdOn != null and createdOn != ''"> and createdOn = #{createdOn} </if> <if test="createdOn != null and createdOn != ''"> and createdOn = #{createdOn} </if>
<if test="startTime != null and startTime != ''"> and modifiedOn >= #{startTime} </if> <if test="startTime != null and startTime != ''"> and modifiedOn >= #{startTime} </if>
<if test="endTime != null and endTime != ''"> <![CDATA[ and modifiedOn <= #{endTime} ]]> </if> <if test="endTime != null and endTime != ''"> <![CDATA[ and modifiedOn <= #{endTime} ]]> </if>
and dataStatus is null and dataStatus is null or dataStatus = ''
</trim> </trim>
</select> </select>
<update id="entity_update" parameterType="com.hzya.frame.plugin.dgx.u9c.entity.PrepaymentEntity"> <update id="entity_update" parameterType="com.hzya.frame.plugin.dgx.u9c.entity.PrepaymentEntity">
update v_hzya_u9c_payreq set update AP_PayReqBillHead set
<trim suffix="" suffixOverrides=","> <trim suffix="" suffixOverrides=",">
<if test="dataStatus != null and dataStatus != ''"> dataStatus = #{dataStatus},</if> <if test="dataStatus != null and dataStatus != ''"> DescFlexField_PrivateDescSeg2 = #{dataStatus},</if>
<if test="dataMsg != null and dataMsg != ''"> dataMsg = #{dataMsg},</if> <if test="dataMsg != null and dataMsg != ''"> DescFlexField_PrivateDescSeg1 = #{dataMsg},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<!-- <update id="entity_update" parameterType="com.hzya.frame.plugin.dgx.u9c.entity.PrepaymentEntity">-->
<!-- update AP_PayReqBillHead set-->
<!-- <trim suffix="" suffixOverrides=",">-->
<!-- <if test="dataStatus != null and dataStatus != ''"> dataStatus = #{dataStatus},</if>-->
<!-- <if test="dataMsg != null and dataMsg != ''"> dataMsg = #{dataMsg},</if>-->
<!-- </trim>-->
<!-- where id = #{id}-->
<!-- </update>-->
</mapper> </mapper>

View File

@ -35,8 +35,6 @@ public class RequisitionEntity extends BaseEntity {
private String reqDepartmentName; private String reqDepartmentName;
//来源类型code //来源类型code
private String sourceTypeCode; private String sourceTypeCode;
//来源类型名字
private String sourceTypeName;
//单据状态code //单据状态code
private String status; private String status;
//单据状态name //单据状态name
@ -58,8 +56,6 @@ public class RequisitionEntity extends BaseEntity {
//数据状态描述 //数据状态描述
private String dataMsg; private String dataMsg;
//用户手机号 //用户手机号
private String userPhone;
//用户手机号
private String sendPhone; private String sendPhone;
public String getStartTime() { public String getStartTime() {
@ -174,13 +170,7 @@ public class RequisitionEntity extends BaseEntity {
this.sourceTypeCode = sourceTypeCode; this.sourceTypeCode = sourceTypeCode;
} }
public String getSourceTypeName() {
return sourceTypeName;
}
public void setSourceTypeName(String sourceTypeName) {
this.sourceTypeName = sourceTypeName;
}
public String getStatus() { public String getStatus() {
return status; return status;
@ -230,13 +220,6 @@ public class RequisitionEntity extends BaseEntity {
this.dataMsg = dataMsg; this.dataMsg = dataMsg;
} }
public String getUserPhone() {
return userPhone;
}
public void setUserPhone(String userPhone) {
this.userPhone = userPhone;
}
public String getSendPhone() { public String getSendPhone() {
return sendPhone; return sendPhone;

View File

@ -16,12 +16,10 @@
<result property="reqDepartmentCode" column="reqDepartmentCode"/> <result property="reqDepartmentCode" column="reqDepartmentCode"/>
<result property="reqDepartmentName" column="reqDepartmentName"/> <result property="reqDepartmentName" column="reqDepartmentName"/>
<result property="sourceTypeCode" column="sourceTypeCode"/> <result property="sourceTypeCode" column="sourceTypeCode"/>
<result property="sourceTypeName" column="sourceTypeName"/>
<result property="status" column="status"/> <result property="status" column="status"/>
<result property="statusName" column="statusName"/> <result property="statusName" column="statusName"/>
<result property="modifiedOn" column="modifiedOn"/> <result property="modifiedOn" column="modifiedOn"/>
<result property="createdOn" column="createdOn"/> <result property="createdOn" column="createdOn"/>
<result property="userPhone" column="userPhone"/>
<result property="dataMsg" column="dataMsg"/> <result property="dataMsg" column="dataMsg"/>
<result property="dataStatus" column="dataStatus"/> <result property="dataStatus" column="dataStatus"/>
<result property="sendPhone" column="sendPhone"/> <result property="sendPhone" column="sendPhone"/>
@ -41,15 +39,13 @@
reqDepartmentCode, reqDepartmentCode,
reqDepartmentName, reqDepartmentName,
sourceTypeCode, sourceTypeCode,
sourceTypeName,
status, status,
statusName, statusName,
modifiedOn, modifiedOn,
createdOn, createdOn,
dataStatus, dataStatus,
dataMsg, dataMsg,
sendPhone, sendPhone
userPhone
</sql> </sql>
<!-- 查询 采用==查询 --> <!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-RequisitionEntity-result" parameterType = "com.hzya.frame.plugin.dgx.u9c.entity.RequisitionEntity"> <select id="entity_list_base" resultMap="get-RequisitionEntity-result" parameterType = "com.hzya.frame.plugin.dgx.u9c.entity.RequisitionEntity">
@ -70,14 +66,13 @@
<if test="reqDepartmentCode != null and reqDepartmentCode != ''"> and reqDepartmentCode = #{reqDepartmentCode} </if> <if test="reqDepartmentCode != null and reqDepartmentCode != ''"> and reqDepartmentCode = #{reqDepartmentCode} </if>
<if test="reqDepartmentName != null and reqDepartmentName != ''"> and reqDepartmentName = #{reqDepartmentName} </if> <if test="reqDepartmentName != null and reqDepartmentName != ''"> and reqDepartmentName = #{reqDepartmentName} </if>
<if test="sourceTypeCode != null and sourceTypeCode != ''"> and sourceTypeCode = #{sourceTypeCode} </if> <if test="sourceTypeCode != null and sourceTypeCode != ''"> and sourceTypeCode = #{sourceTypeCode} </if>
<if test="sourceTypeName != null and sourceTypeName != ''"> and sourceTypeName = #{sourceTypeName} </if>
<if test="status != null and status != ''"> and status = #{status} </if> <if test="status != null and status != ''"> and status = #{status} </if>
<if test="statusName != null and statusName != ''"> and statusName = #{statusName} </if> <if test="statusName != null and statusName != ''"> and statusName = #{statusName} </if>
<if test="modifiedOn != null and modifiedOn != ''"> and modifiedOn = #{modifiedOn} </if> <if test="modifiedOn != null and modifiedOn != ''"> and modifiedOn = #{modifiedOn} </if>
<if test="createdOn != null and createdOn != ''"> and createdOn = #{createdOn} </if> <if test="createdOn != null and createdOn != ''"> and createdOn = #{createdOn} </if>
<if test="startTime != null and startTime != ''"> and modifiedOn >= #{startTime} </if> <if test="startTime != null and startTime != ''"> and modifiedOn >= #{startTime} </if>
<if test="endTime != null and endTime != ''"> <![CDATA[ and modifiedOn <= #{endTime} ]]> </if> <if test="endTime != null and endTime != ''"> <![CDATA[ and modifiedOn <= #{endTime} ]]> </if>
and dataStatus is null and dataStatus is null or dataStatus = ''
</trim> </trim>
order by v_hzya_u9c_pr_pr.modifiedOn desc order by v_hzya_u9c_pr_pr.modifiedOn desc
</select> </select>
@ -99,31 +94,21 @@
<if test="reqDepartmentCode != null and reqDepartmentCode != ''"> and reqDepartmentCode = #{reqDepartmentCode} </if> <if test="reqDepartmentCode != null and reqDepartmentCode != ''"> and reqDepartmentCode = #{reqDepartmentCode} </if>
<if test="reqDepartmentName != null and reqDepartmentName != ''"> and reqDepartmentName = #{reqDepartmentName} </if> <if test="reqDepartmentName != null and reqDepartmentName != ''"> and reqDepartmentName = #{reqDepartmentName} </if>
<if test="sourceTypeCode != null and sourceTypeCode != ''"> and sourceTypeCode = #{sourceTypeCode} </if> <if test="sourceTypeCode != null and sourceTypeCode != ''"> and sourceTypeCode = #{sourceTypeCode} </if>
<if test="sourceTypeName != null and sourceTypeName != ''"> and sourceTypeName = #{sourceTypeName} </if>
<if test="status != null and status != ''"> and status = #{status} </if> <if test="status != null and status != ''"> and status = #{status} </if>
<if test="statusName != null and statusName != ''"> and statusName = #{statusName} </if> <if test="statusName != null and statusName != ''"> and statusName = #{statusName} </if>
<if test="modifiedOn != null and modifiedOn != ''"> and modifiedOn = #{modifiedOn} </if> <if test="modifiedOn != null and modifiedOn != ''"> and modifiedOn = #{modifiedOn} </if>
<if test="createdOn != null and createdOn != ''"> and createdOn = #{createdOn} </if> <if test="createdOn != null and createdOn != ''"> and createdOn = #{createdOn} </if>
and dataStatus is null and dataStatus is null or dataStatus = ''
</trim> </trim>
</select> </select>
<update id="entity_update" parameterType="com.hzya.frame.plugin.dgx.u9c.entity.RequisitionEntity"> <update id="entity_update" parameterType="com.hzya.frame.plugin.dgx.u9c.entity.RequisitionEntity">
update v_hzya_u9c_pr_pr set update PR_PR set
<trim suffix="" suffixOverrides=","> <trim suffix="" suffixOverrides=",">
<if test="dataStatus != null and dataStatus != ''"> dataStatus = #{dataStatus},</if> <if test="dataStatus != null and dataStatus != ''"> DescFlexField_PrivateDescSeg2 = #{dataStatus},</if>
<if test="dataMsg != null and dataMsg != ''"> dataMsg = #{dataMsg},</if> <if test="dataMsg != null and dataMsg != ''"> DescFlexField_PrivateDescSeg1 = #{dataMsg},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<!-- <update id="entity_update" parameterType="com.hzya.frame.plugin.dgx.u9c.entity.RequisitionEntity">-->
<!-- update PR_PR set-->
<!-- <trim suffix="" suffixOverrides=",">-->
<!-- <if test="dataStatus != null and dataStatus != ''"> DescFlexField_PrivateDescSeg2 = #{dataStatus},</if>-->
<!-- <if test="dataMsg != null and dataMsg != ''"> DescFlexField_PrivateDescSeg1 = #{dataMsg},</if>-->
<!-- </trim>-->
<!-- where id = #{id}-->
<!-- </update>-->
</mapper> </mapper>

View File

@ -24,7 +24,7 @@ public class AcquireTokenServiceImpl extends BaseService implements IAcquireToke
@Override @Override
public String getToken() { public String getToken() {
String clientid="001"; String clientid="001";
String clientsecret="1f8b947a5e7543d09ebb2a051d1725da"; String clientsecret="8364356273724b499fb840efbc53edb4";
String entCode="002"; String entCode="002";
String userCode="OA"; String userCode="OA";
String orgCode="1001"; String orgCode="1001";

View File

@ -4,7 +4,9 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.plugin.dgx.u9c.dao.IOaDao;
import com.hzya.frame.plugin.dgx.u9c.entity.*; import com.hzya.frame.plugin.dgx.u9c.entity.*;
import com.hzya.frame.plugin.dgx.u9c.service.*; import com.hzya.frame.plugin.dgx.u9c.service.*;
import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; import com.hzya.frame.sysnew.application.entity.SysApplicationEntity;
@ -17,9 +19,11 @@ import org.apache.commons.collections.CollectionUtils;
import org.bson.types.Code; import org.bson.types.Code;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.LinkedList; import java.util.LinkedList;
@ -44,6 +48,10 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
private IRequisitionDetailService requisitionDetailServiceImpl; private IRequisitionDetailService requisitionDetailServiceImpl;
@Resource @Resource
private IIntegrationTaskLivingDetailsService taskLivingDetailsService; private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
@Autowired
private AcquireTokenServiceImpl acquireTokenService;
@Resource
private IOaDao oaDao;
@Value("${zt.url}") @Value("${zt.url}")
private String url; private String url;
@ -65,11 +73,8 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
String taskId = requestJson.getString("integration_task_living_details_id"); String taskId = requestJson.getString("integration_task_living_details_id");
//查询U9C预付单 //查询U9C预付单
PrepaymentEntity prepaymentEntity = new PrepaymentEntity(); PrepaymentEntity prepaymentEntity = new PrepaymentEntity();
//prepaymentEntity.setDocNo("RE-1563");
prepaymentEntity.setDataSourceCode(datasourceCode); prepaymentEntity.setDataSourceCode(datasourceCode);
if (StrUtil.isEmpty(taskId)) { if (StrUtil.isEmpty(taskId)) {
//prepaymentEntity.setStartTime(startTime);
//prepaymentEntity.setEndTime(endTime);
} else { } else {
prepaymentEntity.setId(taskId); prepaymentEntity.setId(taskId);
} }
@ -666,42 +671,70 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
**/ **/
@Override @Override
public JsonResultEntity backPrepaymentStartFlow(JSONObject requestJson) { public JsonResultEntity backPrepaymentStartFlow(JSONObject requestJson) {
//WHERE formmain_0049.field0044 is NULL and COL_SUMMARY.STATE in ( '1','3','0')
//and formmain_0049.finishedflag = 1
//数据源编码 //数据源编码
String datasourceCode = requestJson.getString("sourceCode"); String datasourceCode = requestJson.getString("sourceCode");
//重试id //重试id
String taskId = requestJson.getString("integration_task_living_details_id"); String taskId = requestJson.getString("integration_task_living_details_id");
//查询OA预付单 //查询OA预付单
PrepaymentEntity prepaymentEntity = new PrepaymentEntity(); OaEntity oaEntity = new OaEntity();
//todo 查询数据 oaEntity.setDataSourceCode(datasourceCode);
prepaymentEntity.setDataSourceCode(datasourceCode);
if (!StrUtil.isEmpty(taskId)) { if (!StrUtil.isEmpty(taskId)) {
prepaymentEntity.setId(taskId); oaEntity.setId(taskId);
} }
List<PrepaymentEntity> prepaymentList = prepaymentService.queryList(prepaymentEntity); List<OaEntity> oaEntities = oaDao.queryQkdList(oaEntity);
//发送数据 //发送数据
if (CollectionUtils.isNotEmpty(prepaymentList)) { if (CollectionUtils.isNotEmpty(oaEntities)) {
for (PrepaymentEntity prepayment : prepaymentList) { for (OaEntity oaEntity1 : oaEntities) {
//todo 组装数据 if(oaEntity1.getDocNo() == null || "".equals(oaEntity1.getDocNo())){
OaEntity updateOa = new OaEntity();
updateOa.setDataSourceCode(datasourceCode);
updateOa.setId(oaEntity1.getId());
updateOa.setSendStatus("2");
updateOa.setSendMsg("失败:单据号为空");
oaDao.updateQkd(updateOa);
continue;
}
JSONArray senddataList = new JSONArray();
JSONObject senddata = new JSONObject(); JSONObject senddata = new JSONObject();
logger.info("德广信OA回传预付单状态到U9C参数:{}", senddata.toString()); senddata.put("Code",oaEntity1.getDocNo());
senddataList.add(senddata);
logger.info("德广信OA回传预付单状态到U9C参数:{}", senddataList.toString());
String res = null; String res = null;
Boolean flag = false; Boolean flag = false;
try { try {
//todo调用接口 //todo调用接口
String token = acquireTokenService.getToken();
if(StrUtil.isEmpty(token)){
continue;
}
String apicode = "8000440005";
if(oaEntity1.getStatus() != null && "3".equals(oaEntity1.getStatus())){
apicode ="8000440004";
}
String result = HttpRequest.post(url)
.header("token", token)//目标应用
.header("appId", "800044")//目标应用
.header("apiCode", apicode)//目标api
.header("publicKey", "ZJYAdmAd+G+wwPab5xb6R6a/n+AJoLcXTWy4IYUJSsIZCkxCe7eDIk+3zDUT+v578prj")//调用方key
.header("secretKey", "5oaeo0y2U+3ocl2dbvvStTINXKUNXyiDwiwkim0v/DG4WrdQ97jMoE2/za5T5GcFj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//调用方密钥
.body(senddataList.toString())
.timeout(30000)
.execute()
.body();
JSONObject jsonObject = JSONObject.parseObject(result);
flag = jsonObject.getBoolean("flag");
res = result;
} catch (Exception e) { } catch (Exception e) {
logger.error("调用oa接口出错:{}", e); logger.error("调用U9接口出错:{}", e);
res = e.getMessage(); res = e.getMessage();
} }
//保存日志 //保存日志
IntegrationTaskLivingDetailsEntity taskLivingDetail = new IntegrationTaskLivingDetailsEntity(); IntegrationTaskLivingDetailsEntity taskLivingDetail = new IntegrationTaskLivingDetailsEntity();
taskLivingDetail.setCreate_time(new Date()); taskLivingDetail.setCreate_time(new Date());
taskLivingDetail.setModify_time(new Date()); taskLivingDetail.setModify_time(new Date());
taskLivingDetail.setRootAppPk(prepayment.getId());// todo taskLivingDetail.setRootAppPk(oaEntity1.getId());
taskLivingDetail.setRootAppBill(prepayment.getDocNo());// todo taskLivingDetail.setRootAppBill(oaEntity1.getDocNo());
taskLivingDetail.setPluginId("BackStatusPrepaymentPlugin"); taskLivingDetail.setPluginId("BackStatusPrepaymentPlugin");
taskLivingDetail.setRootAppNewData(senddata.toString()); taskLivingDetail.setRootAppNewData(senddata.toString());
taskLivingDetail.setNewTransmitInfo(res); taskLivingDetail.setNewTransmitInfo(res);
@ -710,21 +743,19 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
logger.info("OA回传预付单状态到U9C流程返回结果:{}", res); logger.info("OA回传预付单状态到U9C流程返回结果:{}", res);
// 发送完成修改主表状态 已完成或发送失败 flag判断 // 发送完成修改主表状态 已完成或发送失败 flag判断
if (flag) { if (flag) {
// todo OaEntity updateOa = new OaEntity();
PrepaymentEntity updatePrepayment = new PrepaymentEntity(); updateOa.setDataSourceCode(datasourceCode);
updatePrepayment.setDataSourceCode(datasourceCode); updateOa.setId(oaEntity1.getId());
updatePrepayment.setId(prepayment.getId()); updateOa.setSendStatus("1");
updatePrepayment.setDataStatus("1"); updateOa.setSendMsg("成功");
updatePrepayment.setDataMsg("成功"); oaDao.updateQkd(updateOa);
prepaymentService.updateStatus(updatePrepayment);
} else { } else {
// todo OaEntity updateOa = new OaEntity();
PrepaymentEntity updatePrepayment = new PrepaymentEntity(); updateOa.setDataSourceCode(datasourceCode);
updatePrepayment.setDataSourceCode(datasourceCode); updateOa.setId(oaEntity1.getId());
updatePrepayment.setId(prepayment.getId()); updateOa.setSendStatus("2");
updatePrepayment.setDataStatus("1"); updateOa.setSendMsg("失败:" + res);
updatePrepayment.setDataMsg("失败:" + res); oaDao.updateQkd(updateOa);
prepaymentService.updateStatus(updatePrepayment);
} }
} }
} }
@ -740,41 +771,72 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
**/ **/
@Override @Override
public JsonResultEntity backRequisitionStartFlow(JSONObject requestJson) { public JsonResultEntity backRequisitionStartFlow(JSONObject requestJson) {
//WHERE formmain_0049.field0044 is NULL and COL_SUMMARY.STATE in ( '1','3','0')
//and formmain_0049.finishedflag = 1
//数据源编码 //数据源编码
String datasourceCode = requestJson.getString("sourceCode"); String datasourceCode = requestJson.getString("sourceCode");
//重试id //重试id
String taskId = requestJson.getString("integration_task_living_details_id"); String taskId = requestJson.getString("integration_task_living_details_id");
//查询OA预付单 //查询OA预付单
PrepaymentEntity prepaymentEntity = new PrepaymentEntity(); OaEntity oaEntity = new OaEntity();
//todo 查询数据 oaEntity.setDataSourceCode(datasourceCode);
prepaymentEntity.setDataSourceCode(datasourceCode);
if (!StrUtil.isEmpty(taskId)) { if (!StrUtil.isEmpty(taskId)) {
prepaymentEntity.setId(taskId); oaEntity.setId(taskId);
} }
List<PrepaymentEntity> prepaymentList = prepaymentService.queryList(prepaymentEntity); List<OaEntity> oaEntities = oaDao.queryQgdList(oaEntity);
//发送数据 //发送数据
if (CollectionUtils.isNotEmpty(prepaymentList)) { if (CollectionUtils.isNotEmpty(oaEntities)) {
for (PrepaymentEntity prepayment : prepaymentList) { for (OaEntity oaEntity1 : oaEntities) {
//todo 组装数据 if(oaEntity1.getDocNo() == null || "".equals(oaEntity1.getDocNo())){
OaEntity updateOa = new OaEntity();
updateOa.setDataSourceCode(datasourceCode);
updateOa.setId(oaEntity1.getId());
updateOa.setSendStatus("2");
updateOa.setSendMsg("失败:单据号为空");
oaDao.updateQkd(updateOa);
continue;
}
JSONArray senddataList = new JSONArray();
JSONObject PRData = new JSONObject();
JSONObject senddata = new JSONObject(); JSONObject senddata = new JSONObject();
logger.info("德广信OA回传请购单状态到U9C参数:{}", senddata.toString()); senddata.put("Code",oaEntity1.getDocNo());
PRData.put("PRData",senddata);
senddataList.add(PRData);
logger.info("德广信OA回传请购单状态到U9C参数:{}", senddataList.toString());
String res = null; String res = null;
Boolean flag = false; Boolean flag = false;
try { try {
//todo调用接口 //todo调用接口
String token = acquireTokenService.getToken();
if(StrUtil.isEmpty(token)){
continue;
}
String apicode = "8000440007";
if(oaEntity1.getStatus() != null && "3".equals(oaEntity1.getStatus())){
apicode ="8000440006";
}
String result = HttpRequest.post(url)
.header("token", token)//目标应用
.header("appId", "800044")//目标应用
.header("apiCode", apicode)//目标api
.header("publicKey", "ZJYAdmAd+G+wwPab5xb6R6a/n+AJoLcXTWy4IYUJSsIZCkxCe7eDIk+3zDUT+v578prj")//调用方key
.header("secretKey", "5oaeo0y2U+3ocl2dbvvStTINXKUNXyiDwiwkim0v/DG4WrdQ97jMoE2/za5T5GcFj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//调用方密钥
.body(senddataList.toString())
.timeout(30000)
.execute()
.body();
JSONObject jsonObject = JSONObject.parseObject(result);
flag = jsonObject.getBoolean("flag");
res = result;
} catch (Exception e) { } catch (Exception e) {
logger.error("调用oa接口出错:{}", e); logger.error("调用U9接口出错:{}", e);
res = e.getMessage(); res = e.getMessage();
} }
//保存日志 //保存日志
IntegrationTaskLivingDetailsEntity taskLivingDetail = new IntegrationTaskLivingDetailsEntity(); IntegrationTaskLivingDetailsEntity taskLivingDetail = new IntegrationTaskLivingDetailsEntity();
taskLivingDetail.setCreate_time(new Date()); taskLivingDetail.setCreate_time(new Date());
taskLivingDetail.setModify_time(new Date()); taskLivingDetail.setModify_time(new Date());
taskLivingDetail.setRootAppPk(prepayment.getId());// todo taskLivingDetail.setRootAppPk(oaEntity1.getId());
taskLivingDetail.setRootAppBill(prepayment.getDocNo());// todo taskLivingDetail.setRootAppBill(oaEntity1.getDocNo());
taskLivingDetail.setPluginId("BackStatusRequisitionPlugin"); taskLivingDetail.setPluginId("BackStatusRequisitionPlugin");
taskLivingDetail.setRootAppNewData(senddata.toString()); taskLivingDetail.setRootAppNewData(senddata.toString());
taskLivingDetail.setNewTransmitInfo(res); taskLivingDetail.setNewTransmitInfo(res);
@ -783,23 +845,20 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
logger.info("OA回传请购单状态到U9C流程返回结果:{}", res); logger.info("OA回传请购单状态到U9C流程返回结果:{}", res);
// 发送完成修改主表状态 已完成或发送失败 flag判断 // 发送完成修改主表状态 已完成或发送失败 flag判断
if (flag) { if (flag) {
// todo OaEntity updateOa = new OaEntity();
PrepaymentEntity updatePrepayment = new PrepaymentEntity(); updateOa.setDataSourceCode(datasourceCode);
updatePrepayment.setDataSourceCode(datasourceCode); updateOa.setId(oaEntity1.getId());
updatePrepayment.setId(prepayment.getId()); updateOa.setSendStatus("1");
updatePrepayment.setDataStatus("1"); updateOa.setSendMsg("成功");
updatePrepayment.setDataMsg("成功"); oaDao.updateQgd(updateOa);
prepaymentService.updateStatus(updatePrepayment);
} else { } else {
// todo OaEntity updateOa = new OaEntity();
PrepaymentEntity updatePrepayment = new PrepaymentEntity(); updateOa.setDataSourceCode(datasourceCode);
updatePrepayment.setDataSourceCode(datasourceCode); updateOa.setId(oaEntity1.getId());
updatePrepayment.setId(prepayment.getId()); updateOa.setSendStatus("2");
updatePrepayment.setDataStatus("1"); updateOa.setSendMsg("失败:" + res);
updatePrepayment.setDataMsg("失败:" + res); oaDao.updateQgd(updateOa);
prepaymentService.updateStatus(updatePrepayment);
} }
} }
} }
return BaseResult.getSuccessMessageEntity("德广信OA回传请购单状态到U9C插件执行成功"); return BaseResult.getSuccessMessageEntity("德广信OA回传请购单状态到U9C插件执行成功");

View File

@ -6,4 +6,5 @@
<bean name="prepaymentDaoImpl" class="com.hzya.frame.plugin.dgx.u9c.dao.impl.PrepaymentDaoImpl" /> <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" /> <bean name="prepaymentDetailDaoImpl" class="com.hzya.frame.plugin.dgx.u9c.dao.impl.PrepaymentDetailDaoImpl" />
<bean name="prepaymentSuppDaoImpl" class="com.hzya.frame.plugin.dgx.u9c.dao.impl.PrepaymentSuppDaoImpl" /> <bean name="prepaymentSuppDaoImpl" class="com.hzya.frame.plugin.dgx.u9c.dao.impl.PrepaymentSuppDaoImpl" />
<bean name="oaDaoImpl" class="com.hzya.frame.plugin.dgx.u9c.dao.impl.OaDaoImpl" />
</beans> </beans>

View File

@ -20,7 +20,7 @@ public class temButtom {
public void test01() { public void test01() {
String a = AESUtil.encrypt("dgx@2018"); String a = AESUtil.encrypt("dgx@2018");
System.out.println(a); System.out.println(a);
String b = AESUtil.decrypt("62e4295b615a30dbf3b8ee96f41c820b"); String b = AESUtil.decrypt("f571f73abf62eeef41f0a0993bb01db9");
System.out.println(b); System.out.println(b);
} }

View File

@ -2575,7 +2575,11 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
boolean flags = false; boolean flags = false;
for (int i = 0; i < fileds.length; i++) { for (int i = 0; i < fileds.length; i++) {
if (JSONUtil.isTypeJSON(datas.getString(fileds[i]))) { if (JSONUtil.isTypeJSON(datas.getString(fileds[i]))) {
datas = datas.getJSONObject(fileds[i]); if(JSONUtil.isTypeJSONArray(datas.getString(fileds[i]))){
datas = datas.getJSONArray(fileds[i]).getJSONObject(0);
}else {
datas = datas.getJSONObject(fileds[i]);
}
if(fileds.length-2 == i ){ if(fileds.length-2 == i ){
String a = datas.getString(fileds[i+1]); String a = datas.getString(fileds[i+1]);
if (a != null && receiveApi.getReturnSuccessValue().equals(a)) { if (a != null && receiveApi.getReturnSuccessValue().equals(a)) {