分组类型查询单据

This commit is contained in:
lvleigang 2024-11-04 10:01:46 +08:00
parent 5209d7cfd5
commit 537b70f510
2 changed files with 152 additions and 156 deletions

View File

@ -108,22 +108,22 @@
</trim> </trim>
</select> </select>
<update id="entity_update" parameterType="com.hzya.frame.plugin.dgx.u9c.entity.RequisitionEntity">
update v_hzya_u9c_pr_pr 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>
<!-- <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 PR_PR set--> <!-- update v_hzya_u9c_pr_pr set-->
<!-- <trim suffix="" suffixOverrides=",">--> <!-- <trim suffix="" suffixOverrides=",">-->
<!-- <if test="dataStatus != null and dataStatus != ''"> DescFlexField_PrivateDescSeg2 = #{dataStatus},</if>--> <!-- <if test="dataStatus != null and dataStatus != ''"> dataStatus = #{dataStatus},</if>-->
<!-- <if test="dataMsg != null and dataMsg != ''"> DescFlexField_PrivateDescSeg1 = #{dataMsg},</if>--> <!-- <if test="dataMsg != null and dataMsg != ''"> dataMsg = #{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

@ -256,14 +256,14 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
String res = null; String res = null;
Boolean flag = false; Boolean flag = false;
try { try {
//1获取token ////1获取token
JSONObject nouserToken = getToken(null, "800045", "8000450000"); //JSONObject nouserToken = getToken(null, "800045", "8000450000");
if (nouserToken.getBoolean("flag")) { //if (nouserToken.getBoolean("flag")) {
//2根据电话获取code //2根据电话获取code
JSONObject usercode = getUsercode(nouserToken.getString("token"), prepayment.getUserPhone(), "800045", "8000450005"); //JSONObject usercode = getUsercode(nouserToken.getString("token"), prepayment.getUserPhone(), "800045", "8000450005");
if (usercode.getBoolean("flag")) { //if (usercode.getBoolean("flag")) {
//3根据code再次获取token //3根据code再次获取token
JSONObject token = getToken(usercode.getString("code"), "800045", "8000450000"); JSONObject token = getToken(prepayment.getUserPhone(), "800045", "8000450000");
if (token.getBoolean("flag")) { if (token.getBoolean("flag")) {
res = invokeEsb(param, "800045", "8000450001", token.getString("token")); res = invokeEsb(param, "800045", "8000450001", token.getString("token"));
JSONObject jsonObject = JSONObject.parseObject(res); JSONObject jsonObject = JSONObject.parseObject(res);
@ -271,12 +271,12 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
} else { } else {
res = token.getString("msg"); res = token.getString("msg");
} }
} else { //} else {
res = usercode.getString("msg"); // res = usercode.getString("msg");
} //}
} else { //} else {
res = nouserToken.getString("msg"); // res = nouserToken.getString("msg");
} //}
} catch (Exception e) { } catch (Exception e) {
logger.error("调用oa接口出错:{}", e); logger.error("调用oa接口出错:{}", e);
res = e.getMessage(); res = e.getMessage();
@ -376,15 +376,11 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
formmain_0652.put("field0012", requisitionDetailList.get(0).getFactoryName()); formmain_0652.put("field0012", requisitionDetailList.get(0).getFactoryName());
//状态 //状态
formmain_0652.put("field0013", requisition.getStatusName()); formmain_0652.put("field0013", requisition.getStatusName());
String res = null;
Boolean flag = false;
JSONObject token = getToken(requisition.getSendPhone(), "800045", "8000450000");
//3根据code再次获取token
if (token.getBoolean("flag")) {
//发起人 //发起人
formmain_0652.put("field0002", token.getString("name")); //formmain_0652.put("field0002", token.getString("name"));
//发起部门 //发起部门
formmain_0652.put("field0003", token.getString("bm")); //formmain_0652.put("field0003", token.getString("bm"));
//发起时间 //发起时间
formmain_0652.put("field0004", DateUtil.now()); formmain_0652.put("field0004", DateUtil.now());
//来源类型 不要 //来源类型 不要
@ -441,7 +437,10 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
param.put("data", data); param.put("data", data);
String paramStr = param.toString(); String paramStr = param.toString();
logger.info("u9c请购单发起OA流程请求参数:{}", paramStr); logger.info("u9c请购单发起OA流程请求参数:{}", paramStr);
String res = null;
Boolean flag = false;
try { try {
JSONObject token = getToken(requisition.getSendPhone(), "800045", "8000450000");
//3根据code再次获取token //3根据code再次获取token
if (token.getBoolean("flag")) { if (token.getBoolean("flag")) {
res = invokeEsb(param, "800045", "8000450002", token.getString("token")); res = invokeEsb(param, "800045", "8000450002", token.getString("token"));
@ -467,9 +466,6 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
saveLog(taskId, flag, taskLivingDetail); saveLog(taskId, flag, taskLivingDetail);
logger.info("u9c请购单发起OA流程返回结果:{}", res); logger.info("u9c请购单发起OA流程返回结果:{}", res);
// 发送完成修改主表状态 已完成或发送失败 flag判断 // 发送完成修改主表状态 已完成或发送失败 flag判断
} else {
res = token.getString("msg");
}
if (flag) { if (flag) {
RequisitionEntity updateRequisition = new RequisitionEntity(); RequisitionEntity updateRequisition = new RequisitionEntity();
updateRequisition.setDataSourceCode(datasourceCode); updateRequisition.setDataSourceCode(datasourceCode);
@ -560,7 +556,7 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
String res = null; String res = null;
String token = null; String token = null;
Boolean flag = false; Boolean flag = false;
String bm = null; //String bm = null;
String name = null; String name = null;
try { try {
res = invokeEsb(param, appId, apiCode, null); res = invokeEsb(param, appId, apiCode, null);
@ -568,7 +564,7 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
flag = jsonObject.getBoolean("flag"); flag = jsonObject.getBoolean("flag");
if (flag) { if (flag) {
token = jsonObject.getJSONObject("attribute").getString("id"); token = jsonObject.getJSONObject("attribute").getString("id");
bm = jsonObject.getJSONObject("attribute").getJSONObject("bindingUser").getString("orgDepartmentName"); //bm = jsonObject.getJSONObject("attribute").getJSONObject("bindingUser").getString("orgDepartmentName");
name = jsonObject.getJSONObject("attribute").getJSONObject("bindingUser").getString("name"); name = jsonObject.getJSONObject("attribute").getJSONObject("bindingUser").getString("name");
} }
} catch (Exception e) { } catch (Exception e) {
@ -578,7 +574,7 @@ public class U9CPluginServiceImpl implements IU9CPluginService {
if (flag) { if (flag) {
returnData.put("flag", "true"); returnData.put("flag", "true");
returnData.put("token", token); returnData.put("token", token);
returnData.put("bm", bm); //returnData.put("bm", bm);
returnData.put("name", name); returnData.put("name", name);
} else { } else {
returnData.put("flag", "false"); returnData.put("flag", "false");