提交 e28a2eaf 编写于 作者: MoneyQ's avatar MoneyQ

更新 %ITEM%Service.java.ftl

上级 24ec7e76
...@@ -32,14 +32,13 @@ TARGET=PSAPPDATAENTITY ...@@ -32,14 +32,13 @@ TARGET=PSAPPDATAENTITY
<#assign itemCodeNameLC = itemCodeName?lower_case> <#assign itemCodeNameLC = itemCodeName?lower_case>
<#assign itemSysApiCodeName = deapi.getPSSysServiceAPI().getCodeName()> <#assign itemSysApiCodeName = deapi.getPSSysServiceAPI().getCodeName()>
<#assign itemSysApiCodeNameLC = deapi.getPSSysServiceAPI().getCodeName()?lower_case> <#assign itemSysApiCodeNameLC = deapi.getPSSysServiceAPI().getCodeName()?lower_case>
package ${pub.getPKGCodeName()}.${app.getPKGCodeName()?lower_case}.${de.getPSSystemModule().codeName?lower_case}.service; package ${pub.getPKGCodeName()}.${app.getPKGCodeName()?lower_case}.${de.getPSSystemModule().codeName?lower_case}.service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import com.alibaba.fastjson.JSONObject;
import feign.Client; import feign.Client;
import feign.Contract; import feign.Contract;
...@@ -47,13 +46,14 @@ import feign.Feign; ...@@ -47,13 +46,14 @@ import feign.Feign;
import feign.codec.Decoder; import feign.codec.Decoder;
import feign.codec.Encoder; import feign.codec.Encoder;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.DigestUtils; import org.springframework.util.DigestUtils;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient;
import org.springframework.stereotype.Service;
import ${pub.getPKGCodeName()}.util.feign.suport.SearchContextFeignEncode; import ${pub.getPKGCodeName()}.util.feign.suport.SearchContextFeignEncode;
import ${pub.getPKGCodeName()}.${app.getPKGCodeName()?lower_case}.${de.getPSSystemModule().codeName?lower_case}.domain.${item.getCodeName()}; import ${pub.getPKGCodeName()}.${app.getPKGCodeName()?lower_case}.${de.getPSSystemModule().codeName?lower_case}.domain.${item.getCodeName()};
...@@ -74,7 +74,10 @@ import ${pub.getPKGCodeName()}.util.config.WFActivitiEngineClientProperties; ...@@ -74,7 +74,10 @@ import ${pub.getPKGCodeName()}.util.config.WFActivitiEngineClientProperties;
import ${pub.getPKGCodeName()}.util.feign.WFEngineFeignClient; import ${pub.getPKGCodeName()}.util.feign.WFEngineFeignClient;
</#if> </#if>
</#if> </#if>
import ${pub.getPKGCodeName()}.util.log.IBIZLog;
@Slf4j
@IBIZLog
@Service @Service
public class ${item.getCodeName()}Service { public class ${item.getCodeName()}Service {
...@@ -457,9 +460,21 @@ public class ${item.getCodeName()}Service { ...@@ -457,9 +460,21 @@ public class ${item.getCodeName()}Service {
// 登录用户信息 // 登录用户信息
LoginUser loginUser = SpringContextHolder.getCurLoginUser(); LoginUser loginUser = SpringContextHolder.getCurLoginUser();
if (loginUser == null) { if (loginUser == null) {
JSONObject jsonLoginUser = data.getJSONObject("loginuser");
if (jsonLoginUser == null) {
data.put("srfmsg", "用户未登录"); data.put("srfmsg", "用户未登录");
return false; return false;
} }
// 组织信息存储
wfinstance.setOriginpersonid(jsonLoginUser.getString("personId"));
wfinstance.setOriginpersonname(jsonLoginUser.getString("orgUserName"));
wfinstance.setOriginorgid(jsonLoginUser.getString("orgId"));
wfinstance.setOriginorgname(jsonLoginUser.getString("orgName"));
wfinstance.setOriginorgdeptid(jsonLoginUser.getString("orgDeptId"));
wfinstance.setOriginorgdeptname(jsonLoginUser.getString("orgDeptName"));
loginuserStr = jsonLoginUser.getString("personId");
} else {
// 组织信息存储 // 组织信息存储
wfinstance.setOriginpersonid(loginUser.getPersonId()); wfinstance.setOriginpersonid(loginUser.getPersonId());
wfinstance.setOriginpersonname(loginUser.getOrgUserName()); wfinstance.setOriginpersonname(loginUser.getOrgUserName());
...@@ -470,6 +485,8 @@ public class ${item.getCodeName()}Service { ...@@ -470,6 +485,8 @@ public class ${item.getCodeName()}Service {
loginuserStr = loginUser.getPersonId(); loginuserStr = loginUser.getPersonId();
} }
}
wfinstance = uniWFFeignClient.createWFInstance(wfinstance); wfinstance = uniWFFeignClient.createWFInstance(wfinstance);
${itemCodeNameLC}.set${de.getDefaultPSDEWF().getWFInstPSDEField().getCodeName()?cap_first}(wfinstance.getWfinstanceid()); ${itemCodeNameLC}.set${de.getDefaultPSDEWF().getWFInstPSDEField().getCodeName()?cap_first}(wfinstance.getWfinstanceid());
client.update(${itemCodeNameLC}${keyCNLC}, ${itemCodeNameLC}); client.update(${itemCodeNameLC}${keyCNLC}, ${itemCodeNameLC});
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册