Merge branch 'feature/acctV2' into develop
This commit is contained in:
commit
18025fd4b6
Binary file not shown.
|
|
@ -1,9 +1,7 @@
|
|||
package com.engine.salary.wrapper;
|
||||
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.component.SalaryWeaTable;
|
||||
import com.engine.salary.component.WeaFormOption;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
import com.engine.salary.entity.salaryitem.bo.SalaryItemBO;
|
||||
|
|
@ -69,42 +67,6 @@ public class SalaryItemWrapper extends Service {
|
|||
* @param searchParam 查询参数
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> listPage(SalaryItemSearchParam searchParam) {
|
||||
|
||||
SalaryWeaTable<SalaryItemListDTO> table = new SalaryWeaTable<SalaryItemListDTO>(user, SalaryItemListDTO.class);
|
||||
|
||||
String fields = " t.id" +
|
||||
" , t.name" +
|
||||
" , t.code" +
|
||||
" , t.system_type" +
|
||||
" , t.sys_salary_item_id" +
|
||||
" , t.use_default as useDefault" +
|
||||
" , t.use_in_employee_salary as useInEmployeeSalary" +
|
||||
" , t.rounding_mode as roundingMode" +
|
||||
" , t.pattern" +
|
||||
" , t.value_type as valueType" +
|
||||
" , t.formula_id" +
|
||||
" , t.description" +
|
||||
" , t.can_edit" +
|
||||
" , t.data_type as dataType" +
|
||||
" , t.can_delete";
|
||||
|
||||
String from = "from hrsa_salary_item t";
|
||||
|
||||
table.setBackfields(fields);
|
||||
table.setSqlform(from);
|
||||
table.setSqlwhere(SalaryItemSearchParam.makeSqlWhere(searchParam));
|
||||
table.setSqlorderby("t.id DESC");
|
||||
table.setSqlprimarykey("t.id");
|
||||
table.setSqlisdistinct("false");
|
||||
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
return result.getResultMap();
|
||||
|
||||
}
|
||||
|
||||
public PageInfo<SalaryItemListDTO> listPageV2(SalaryItemSearchParam searchParam) {
|
||||
|
||||
// 1、查询薪资项目
|
||||
|
|
@ -175,24 +137,11 @@ public class SalaryItemWrapper extends Service {
|
|||
}
|
||||
// 查询公式详情
|
||||
Set<Long> formulaIds = SalaryEntityUtil.properties(salaryItemPOS, SalaryItemPO::getFormulaId);
|
||||
// todo List<ExpressFormula> expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds);
|
||||
List<ExpressFormula> expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds);
|
||||
// 转换成薪资项目列表dto
|
||||
return SalaryItemBO.convert2ListDTO(salaryItemPOS, null);
|
||||
return SalaryItemBO.convert2ListDTO(salaryItemPOS, expressFormulas);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 薪资项目列表的高级搜索
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// public WeaSearchCondition getSearchCondition() {
|
||||
// WeaSearchCondition searchCondition = SalaryFormatUtil.<SalaryItemSearchConditionDTO>getInstance()
|
||||
// .buildCondition(SalaryItemSearchConditionDTO.class, new SalaryItemSearchConditionDTO(), "salaryItemCondition");
|
||||
// // "其他条件"不要
|
||||
// searchCondition.getGroups().remove(1);
|
||||
// return searchCondition;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 薪资项目详情
|
||||
*
|
||||
|
|
@ -211,17 +160,16 @@ public class SalaryItemWrapper extends Service {
|
|||
if (Objects.isNull(salaryItemPO) && Objects.isNull(sysSalaryItemPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98299, "参数错误,薪资项目不存在或已被删除"));
|
||||
}
|
||||
//todo 公式详情
|
||||
// ExpressFormula expressFormula;
|
||||
ExpressFormula expressFormula;
|
||||
// // 转换成薪资项目详情dto
|
||||
if (Objects.isNull(salaryItemPO)) {
|
||||
salaryItemFormDTO = SysSalaryItemBO.convert2FormDTO(sysSalaryItemPO);
|
||||
// expressFormula = getSalaryFormulaService(user).getExpressFormula(sysSalaryItemPO.getFormulaId());
|
||||
expressFormula = getSalaryFormulaService(user).getExpressFormula(sysSalaryItemPO.getFormulaId());
|
||||
} else {
|
||||
salaryItemFormDTO = SalaryItemBO.convert2FormDTO(salaryItemPO);
|
||||
// expressFormula = getSalaryFormulaService(user).getExpressFormula(salaryItemPO.getFormulaId());
|
||||
expressFormula = getSalaryFormulaService(user).getExpressFormula(salaryItemPO.getFormulaId());
|
||||
}
|
||||
// salaryItemFormDTO.setFormulaContent(Optional.ofNullable(expressFormula).map(ExpressFormula::getFormula).orElse(""));
|
||||
salaryItemFormDTO.setFormulaContent(Optional.ofNullable(expressFormula).map(ExpressFormula::getFormula).orElse(""));
|
||||
}
|
||||
return salaryItemFormDTO;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,160 @@
|
|||
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");
|
||||
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"), "utf-8")).trim();
|
||||
String Domain = Util.null2String(new String(Util.null2String(baseBean.getPropValue("SZSM_subcompany_domain_config", "Domain")).getBytes("ISO-8859-1"), "utf-8")).trim();
|
||||
String XXFWSubCompanyName = Util.null2String(new String(Util.null2String(baseBean.getPropValue("SZSM_subcompany_domain_config", "XXFWSubCompanyName")).getBytes("ISO-8859-1"), "utf-8")).trim();
|
||||
String XXFWDomain = Util.null2String(new String(Util.null2String(baseBean.getPropValue("SZSM_subcompany_domain_config", "XXFWDomain")).getBytes("ISO-8859-1"), "utf-8")).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
Loading…
Reference in New Issue