增加u8接口返回信息字段

2024年8月29日17:47:09
This commit is contained in:
xiang2lin 2024-08-29 17:47:16 +08:00
parent 9198838cc7
commit ad94d9af6b
9 changed files with 103 additions and 4 deletions

View File

@ -9,7 +9,16 @@ import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.execsql.service.IExecSqlService; import com.hzya.frame.execsql.service.IExecSqlService;
import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity; import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity;
import com.hzya.frame.seeyon.service.ISeeyonExtService; import com.hzya.frame.seeyon.service.ISeeyonExtService;
import com.hzya.frame.seeyon.ydc.dao.IFormmain0225Dao;
import com.hzya.frame.seeyon.ydc.dao.IFormmain0226Dao;
import com.hzya.frame.seeyon.ydc.dao.IFormmain0227Dao;
import com.hzya.frame.seeyon.ydc.entity.Formmain0225Entity;
import com.hzya.frame.seeyon.ydc.entity.Formmain0226Entity;
import com.hzya.frame.seeyon.ydc.entity.Formmain0227Entity;
import com.hzya.frame.seeyon.ydc.entity.FormmainEntity; import com.hzya.frame.seeyon.ydc.entity.FormmainEntity;
import com.hzya.frame.seeyon.ydc.service.IFormmain0225Service;
import com.hzya.frame.seeyon.ydc.service.IFormmain0226Service;
import com.hzya.frame.seeyon.ydc.service.IFormmain0227Service;
import com.hzya.frame.seeyon.ydc.service.IFormmainService; import com.hzya.frame.seeyon.ydc.service.IFormmainService;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
@ -22,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -49,7 +59,12 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
private IIntegrationTaskLivingDetailsService taskLivingDetailsService; private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
@Autowired @Autowired
private IExecSqlService executionService; private IExecSqlService executionService;
@Resource
private IFormmain0225Service formmain0225Service;
@Resource
private IFormmain0226Service formmain0226Service;
@Resource
private IFormmain0227Service formmain0227Service;
static { static {
inventoryAttrMap = new HashMap<>(); inventoryAttrMap = new HashMap<>();
inventoryAttrMap.put("4447593729630683530","采购"); inventoryAttrMap.put("4447593729630683530","采购");
@ -122,6 +137,7 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
JSONObject sourceHeaders = sourceData.getJSONObject("header");//源数据header JSONObject sourceHeaders = sourceData.getJSONObject("header");//源数据header
JSONObject targetHeaders = targetData.getJSONObject("header");//源数据header JSONObject targetHeaders = targetData.getJSONObject("header");//源数据header
JSONObject sourceBody = sourceData.getJSONObject("body");//源数据body JSONObject sourceBody = sourceData.getJSONObject("body");//源数据body
JSONObject targetBody = targetData.getJSONObject("body");//目标数据body
JSONObject hzyaExtData = targetHeaders.getJSONObject("hzyaExtData");// 这里刚开始用sourceHeaders取的2024-06-04 14:24:19改成从target里取因为从apipost请求后在source里取不到 JSONObject hzyaExtData = targetHeaders.getJSONObject("hzyaExtData");// 这里刚开始用sourceHeaders取的2024-06-04 14:24:19改成从target里取因为从apipost请求后在source里取不到
String targetFormApp = targetHeaders.getString("formApp");//这个字段可以判断出来是新增还是修改 String targetFormApp = targetHeaders.getString("formApp");//这个字段可以判断出来是新增还是修改
JSONArray formMainIds = new JSONArray(); JSONArray formMainIds = new JSONArray();
@ -171,6 +187,34 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
} }
} }
} }
try {
//更新u8返回信息到流程表
switch (formApp){
case "-8691606453890363968"://存货
Formmain0227Entity formmain0227 = new Formmain0227Entity();
formmain0227.setId(targetBody.getString("billid"));
formmain0227.setField0029(returnData.getString("message"));
formmain0227.setDataSourceCode(dataSourceCode);
formmain0227Service.updateU8ResMsg(formmain0227);
break;
case "6223456019738676230"://供应商
Formmain0225Entity formmain0225 = new Formmain0225Entity();
formmain0225.setId(targetBody.getString("billid"));
formmain0225.setField0032(returnData.getString("message"));
formmain0225.setDataSourceCode(dataSourceCode);
formmain0225Service.updateFlag(formmain0225);
break;
case "-9122508232154527168"://客户
Formmain0226Entity formmain0226 = new Formmain0226Entity();
formmain0226.setId(targetBody.getString("billid"));
formmain0226.setField0082(returnData.getString("message"));
formmain0226.setDataSourceCode(dataSourceCode);
formmain0226Service.updateFlag(formmain0226);
break;
}
}catch (Exception e){
logger.error("更新u8返回信息到OA流程表出错",e);
}
} }
IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity();
logDetails.setRootAppPk(JSON.toJSONString(param)); logDetails.setRootAppPk(JSON.toJSONString(param));

View File

@ -18,7 +18,8 @@ public class Formmain0225Entity extends BaseEntity {
private String field0025Flag; private String field0025Flag;
//流程结束标记 //流程结束标记
private String finishedflag; private String finishedflag;
//u8返回信息
private String field0032;
public String getField0001() { public String getField0001() {
return field0001; return field0001;
} }
@ -74,4 +75,12 @@ public class Formmain0225Entity extends BaseEntity {
public void setFinishedflag(String finishedflag) { public void setFinishedflag(String finishedflag) {
this.finishedflag = finishedflag; this.finishedflag = finishedflag;
} }
public String getField0032() {
return field0032;
}
public void setField0032(String field0032) {
this.field0032 = field0032;
}
} }

View File

@ -39,7 +39,8 @@
<update id="entity_update" parameterType = "com.hzya.frame.seeyon.ydc.entity.Formmain0225Entity" > <update id="entity_update" parameterType = "com.hzya.frame.seeyon.ydc.entity.Formmain0225Entity" >
update formmain_0225 set update formmain_0225 set
<trim suffix="" suffixOverrides=","> <trim suffix="" suffixOverrides=",">
<if test="field0025 != null and field0025 != ''"> field0025 = #{field0025}</if> <if test="field0025 != null and field0025 != ''"> field0025 = #{field0025},</if>
<if test="field0032 != null and field0032 != ''"> field0032 = #{field0032}</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

View File

@ -24,6 +24,7 @@ public class Formmain0226Entity extends BaseEntity {
//流程结束标记 //流程结束标记
private String finishedflag; private String finishedflag;
private String field0082;//u8返回信息
public String getField0001() { public String getField0001() {
return field0001; return field0001;
} }
@ -127,4 +128,12 @@ public class Formmain0226Entity extends BaseEntity {
public void setFinishedflag(String finishedflag) { public void setFinishedflag(String finishedflag) {
this.finishedflag = finishedflag; this.finishedflag = finishedflag;
} }
public String getField0082() {
return field0082;
}
public void setField0082(String field0082) {
this.field0082 = field0082;
}
} }

View File

@ -51,7 +51,8 @@
<update id="entity_update" parameterType = "com.hzya.frame.seeyon.ydc.entity.Formmain0226Entity" > <update id="entity_update" parameterType = "com.hzya.frame.seeyon.ydc.entity.Formmain0226Entity" >
update formmain_0226 set update formmain_0226 set
<trim suffix="" suffixOverrides=","> <trim suffix="" suffixOverrides=",">
<if test="field0028 != null and field0028 != ''"> field0028 = #{field0028}</if> <if test="field0028 != null and field0028 != ''"> field0028 = #{field0028},</if>
<if test="field0082 != null and field0082 != ''"> field0082 = #{field0082}</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

View File

@ -30,6 +30,7 @@ public class Formmain0227Entity extends BaseEntity {
//流程结束标记 //流程结束标记
private String finishedflag; private String finishedflag;
private String field0029;//子表的u8返回信息
public String getField0009() { public String getField0009() {
return field0009; return field0009;
} }
@ -109,4 +110,12 @@ public class Formmain0227Entity extends BaseEntity {
public void setField0022Flag(String field0022Flag) { public void setField0022Flag(String field0022Flag) {
this.field0022Flag = field0022Flag; this.field0022Flag = field0022Flag;
} }
public String getField0029() {
return field0029;
}
public void setField0029(String field0029) {
this.field0029 = field0029;
}
} }

View File

@ -47,5 +47,14 @@
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<!--更新子表-->
<update id="entity_update_formson" parameterType = "com.hzya.frame.seeyon.ydc.entity.Formmain0227Entity" >
update formson_0228 set
<trim suffix="" suffixOverrides=",">
<if test="field0029 != null and field0029 != ''"> field0029 = #{field0029}</if>
</trim>
where id = #{id}
</update>
</mapper> </mapper>

View File

@ -15,4 +15,10 @@ public interface IFormmain0227Service extends IBaseService<Formmain0227Entity, S
* @param entity * @param entity
*/ */
void updateFlag(Formmain0227Entity entity); void updateFlag(Formmain0227Entity entity);
/**
* 更新u8返回信息
* @param entity
*/
void updateU8ResMsg(Formmain0227Entity entity);
} }

View File

@ -34,4 +34,15 @@ public class Formmain0227ServiceImpl extends BaseService<Formmain0227Entity, Str
public void updateFlag(Formmain0227Entity entity) { public void updateFlag(Formmain0227Entity entity) {
formmain0227Dao.update("com.hzya.frame.seeyon.ydc.dao.impl.Formmain0227DaoImpl.entity_update",entity); formmain0227Dao.update("com.hzya.frame.seeyon.ydc.dao.impl.Formmain0227DaoImpl.entity_update",entity);
} }
/**
* 更新u8返回信息
*
* @param entity
*/
@DS("#entity.dataSourceCode")
@Override
public void updateU8ResMsg(Formmain0227Entity entity) {
formmain0227Dao.update("com.hzya.frame.seeyon.ydc.dao.impl.Formmain0227DaoImpl.entity_update_formson",entity);
}
} }