公式去除id生成
This commit is contained in:
parent
82230fba96
commit
f7760bf833
|
|
@ -14,6 +14,7 @@ import com.engine.salary.util.db.MapperProxyFactory;
|
|||
import com.engine.salary.util.valid.RuntimeTypeEnum;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
|
|
@ -104,6 +105,7 @@ public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaSe
|
|||
|
||||
FormulaPO formulaPO = new FormulaPO();
|
||||
String formula = param.getFormula();
|
||||
formulaPO.setId(IdGenerator.generate());
|
||||
formulaPO.setName(param.getName());
|
||||
formulaPO.setDescription(param.getDescription());
|
||||
formulaPO.setModule(param.getModule());
|
||||
|
|
@ -134,6 +136,7 @@ public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaSe
|
|||
getFormulaMapper().insertIgnoreNull(formulaPO);
|
||||
|
||||
for (FormulaVar po : parameters) {
|
||||
po.setId(IdGenerator.generate());
|
||||
po.setFormulaId(formulaPO.getId());
|
||||
po.setDeleteType(NumberUtils.INTEGER_ZERO);
|
||||
po.setCreator((long) user.getUID());
|
||||
|
|
|
|||
|
|
@ -1,162 +0,0 @@
|
|||
package com.engine.workflow.cmd.requestForm.remind;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.GCONST;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 邮件提醒候取链接
|
||||
* Created by wcc on 2019/7/2.
|
||||
*/
|
||||
public class GetEmailRemindUrlCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
protected String requestName;
|
||||
protected String requestId;
|
||||
|
||||
public GetEmailRemindUrlCmd(User user, Map<String, Object> params, String requestId, String requestName) throws UnsupportedEncodingException {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
this.requestId = requestId;
|
||||
this.requestName = requestName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
BaseBean baseBean = new BaseBean();
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
if (Strings.isNullOrEmpty(requestName)) {
|
||||
rs.executeQuery("select requestNameNew from workflow_requestbase where requestid = ?", requestId);
|
||||
rs.next();
|
||||
requestName = rs.getString(1);
|
||||
}
|
||||
String emailLink = "(" + requestName + ")";
|
||||
|
||||
// 从数据库中取得OAaddress数据作为host
|
||||
rs.executeQuery("select oaaddress from systemset");
|
||||
rs.next();
|
||||
String host = Util.null2String(rs.getString("oaaddress"));
|
||||
baseBean.writeLog("qc1602252---static_host=" + host);
|
||||
|
||||
// String domain = (String) Util_DataCache.getObjVal("qc1602252"+this.user.getUID());
|
||||
// baseBean.writeLog("qc1602252---key="+"qc1602252"+this.user.getUID());
|
||||
// baseBean.writeLog("qc1602252---domain="+domain);
|
||||
// if(StringUtils.isNotBlank(domain)){
|
||||
// host = domain;
|
||||
// }else{
|
||||
// //找不到人与域名映射的情况,获取requestId映射的域名
|
||||
// String requestIdDomain = (String) Util_DataCache.getObjVal("domain"+requestId);
|
||||
// baseBean.writeLog("domain---key="+"domain"+requestId);
|
||||
// baseBean.writeLog("requestIdDomain="+requestIdDomain);
|
||||
// if(StringUtils.isNotBlank(requestIdDomain)){
|
||||
// host = requestIdDomain;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
//为适配移动端,将流程创建人的分部与域名绑定
|
||||
if (StringUtils.isNotBlank(requestId) && !"-1".equals(requestId)) {
|
||||
baseBean.writeLog("qc1602252---requestId=" + requestId);
|
||||
baseBean.writeLog("qc1602252---config=" + SubCompanyName + "--" + Domain + "--" + XXFWSubCompanyName + "--" + XXFWDomain);
|
||||
baseBean.writeLog("qc1602252---requestId=" + requestId);
|
||||
rs.executeQuery("select creater from workflow_requestbase where requestid = ?", requestId);
|
||||
if (rs.next()) {
|
||||
String creater = rs.getString("creater");
|
||||
baseBean.writeLog("qc1602252---requestId creater= " + requestId + "---" + creater);
|
||||
rs.executeQuery("select subcompanyid1 from hrmresource where id = ?", creater);
|
||||
if (rs.next()) {
|
||||
String subcompanyid1 = rs.getString("subcompanyid1");
|
||||
baseBean.writeLog("qc1602252---requestId creater subcompanyid1=" + requestId + "---" + creater + "---" + subcompanyid1);
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("subcompanyid1", subcompanyid1);
|
||||
Map<String, String> subcompany = getSubcompany(map);
|
||||
String targetUrl = subcompany.get("targetUrl");
|
||||
if (StringUtils.isNotBlank(targetUrl)) {
|
||||
host = targetUrl;
|
||||
}
|
||||
baseBean.writeLog("qc1602252---" + "---requestId creater lastsubcompanyid1=" + requestId + "---" + creater + "---" + subcompany.get("subcompanyid1"));
|
||||
baseBean.writeLog("qc1602252---requestId creater subcompanyname=" + requestId + "---" + creater + "---" + subcompany.get("subcompanyname"));
|
||||
baseBean.writeLog("qc1602252---requestId creater targetUrl=" + requestId + "---" + creater + "---" + subcompany.get("targetUrl"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!Strings.isNullOrEmpty(host)) {
|
||||
String loginPage = "/login/LoginMail.jsp";
|
||||
String gotoPage = "/common/chatResource/view.html?resourcetype=0&resourceid=" + requestId;
|
||||
if (GCONST.getMailReminderSet()) {
|
||||
loginPage = Strings.isNullOrEmpty(GCONST.getMailLoginPage()) ? loginPage : GCONST.getMailLoginPage();
|
||||
gotoPage = Strings.isNullOrEmpty(GCONST.getMailGotoPage()) ? gotoPage : GCONST.getMailGotoPage();
|
||||
}
|
||||
try {
|
||||
gotoPage = URLEncoder.encode(gotoPage, "utf-8");
|
||||
//需要编码两次
|
||||
gotoPage = URLEncoder.encode(gotoPage, "utf-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
String url = String.format("%s?gopage=%s&target=2", loginPage, gotoPage);
|
||||
emailLink = "(<a style='text-decoration: underline; color: blue;cursor:hand' target='_blank' href='" +
|
||||
host + url + " '>" + requestName + "</a>)";
|
||||
}
|
||||
baseBean.writeLog("qc1602252---requestId=" + requestId);
|
||||
baseBean.writeLog("qc1602252---emailLink=" + emailLink);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("url", emailLink);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
BaseBean baseBean = new BaseBean();
|
||||
String SubCompanyName = Util.null2String(new String(Util.null2String(baseBean.getPropValue("SZSM_subcompany_domain_config", "SubCompanyName")).getBytes("ISO-8859-1"), "GBK")).trim();
|
||||
String Domain = Util.null2String(new String(Util.null2String(baseBean.getPropValue("SZSM_subcompany_domain_config", "Domain")).getBytes("ISO-8859-1"), "GBK")).trim();
|
||||
String XXFWSubCompanyName = Util.null2String(new String(Util.null2String(baseBean.getPropValue("SZSM_subcompany_domain_config", "XXFWSubCompanyName")).getBytes("ISO-8859-1"), "GBK")).trim();
|
||||
String XXFWDomain = Util.null2String(new String(Util.null2String(baseBean.getPropValue("SZSM_subcompany_domain_config", "XXFWDomain")).getBytes("ISO-8859-1"), "GBK")).trim();
|
||||
|
||||
private List<String> SubCompanyNameList = Arrays.stream(SubCompanyName.split(",")).collect(Collectors.toList());
|
||||
private List<String> XXFWSubCompanyNameList = Arrays.stream(XXFWSubCompanyName.split(",")).collect(Collectors.toList());
|
||||
|
||||
private Map<String, String> getSubcompany(Map<String, String> map) {
|
||||
|
||||
Map<String, String> hashMap = Maps.newHashMap();
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select SUPSUBCOMID,SUBCOMPANYNAME from hrmsubcompany where id = ? ", map.get("subcompanyid1"));
|
||||
if (rs.next()) {
|
||||
String subcompanyid1 = rs.getString("SUPSUBCOMID");
|
||||
String subcompanyname = rs.getString("SUBCOMPANYNAME");
|
||||
hashMap.put("subcompanyid1", subcompanyid1);
|
||||
hashMap.put("subcompanyname", subcompanyname);
|
||||
if (SubCompanyNameList.contains(subcompanyname)) {
|
||||
hashMap.put("targetUrl", Domain);
|
||||
return hashMap;
|
||||
} else if (XXFWSubCompanyNameList.contains(subcompanyname)) {
|
||||
hashMap.put("targetUrl", XXFWDomain);
|
||||
return hashMap;
|
||||
} else {
|
||||
if (!map.get("subcompanyid1").equals(hashMap.get("subcompanyid1"))) {
|
||||
return getSubcompany(hashMap);
|
||||
} else {
|
||||
return hashMap;
|
||||
}
|
||||
}
|
||||
}
|
||||
return hashMap;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,4 +0,0 @@
|
|||
package com.weaver.teams.domain.entity;
|
||||
|
||||
public class BaseEntity {
|
||||
}
|
||||
Loading…
Reference in New Issue