数据推送管理
This commit is contained in:
parent
f4de5b16e9
commit
527bd5e1ed
|
|
@ -0,0 +1,39 @@
|
|||
package com.engine.salary.entity.push.dto;
|
||||
|
||||
import com.engine.salary.entity.push.po.PushSettingItemPO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据推送配置
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PushSettingDTO {
|
||||
|
||||
private String sql;
|
||||
|
||||
/**
|
||||
* 建模id
|
||||
*/
|
||||
private Integer modeId;
|
||||
|
||||
/**
|
||||
* 模块名称
|
||||
*/
|
||||
private String modeName;
|
||||
|
||||
/**
|
||||
* 数据库表
|
||||
*/
|
||||
private String tableName;
|
||||
|
||||
private List<PushSettingItemPO> items;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.engine.salary.entity.push.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PushParam {
|
||||
|
||||
|
||||
private Long salaryAcctRecordId;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.engine.salary.entity.push.param;
|
||||
|
||||
import com.engine.salary.enums.push.PushItemFieldEnum;
|
||||
import com.engine.salary.enums.push.PushItemSourceEnum;
|
||||
import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
|
@ -44,7 +44,7 @@ public class PushSettingItemSaveParam {
|
|||
* 项目类型
|
||||
*/
|
||||
@DataCheck(require = true, message = "数据来源")
|
||||
private PushItemSourceEnum source;
|
||||
private SalarySQLReferenceEnum source;
|
||||
|
||||
/**
|
||||
* 数据库字段
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.entity.push.po;
|
||||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -42,9 +43,10 @@ public class PushSettingItemPO {
|
|||
|
||||
/**
|
||||
* 项目类型
|
||||
* @see SalarySQLReferenceEnum
|
||||
*/
|
||||
@ElogTransform(name = "项目类型")
|
||||
private Integer source;
|
||||
private String source;
|
||||
|
||||
/**
|
||||
* 数据库字段
|
||||
|
|
|
|||
|
|
@ -1,10 +1,17 @@
|
|||
package com.engine.salary.enums.push;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.engine.salary.util.SalaryDateUtil.DATE_TIME_FORMATTER_PATTERN;
|
||||
|
||||
/**
|
||||
* 推送数据来源
|
||||
* <p>Copyright: Copyright (c) 2024</p>
|
||||
|
|
@ -15,12 +22,56 @@ import java.util.Objects;
|
|||
**/
|
||||
public enum PushItemFieldEnum implements BaseEnum<Integer> {
|
||||
|
||||
NUMBER(1, "数值", 87625),
|
||||
TEXT(2, "文本", 85393),
|
||||
DATE(3, "日期", 85393),
|
||||
YEAR(4, "日期文本-年", 85393),
|
||||
YEAR_MONTH(5, "日期文本-年月", 85393),
|
||||
YEAR_MONTH_DAY(6, "日期文本-年月日", 85393);
|
||||
NUMBER(1, "数值", 87625) {
|
||||
@Override
|
||||
public Object convertValue(String value) {
|
||||
if (NumberUtil.isNumber(value)) {
|
||||
return new BigDecimal(value).toPlainString();
|
||||
}
|
||||
return "null";
|
||||
}
|
||||
},
|
||||
TEXT(2, "文本", 85393) {
|
||||
@Override
|
||||
public Object convertValue(String value) {
|
||||
return StrUtil.isEmpty(value) ? "''" : value;
|
||||
}
|
||||
},
|
||||
// DATE(3, "日期", 85393) {
|
||||
// @Override
|
||||
// public Object convertValue(String value) {
|
||||
//
|
||||
// //to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss')
|
||||
// return value;
|
||||
// }
|
||||
// },
|
||||
YEAR(4, "日期文本-年", 85393) {
|
||||
@Override
|
||||
public Object convertValue(String value) {
|
||||
if (StringUtils.isNotBlank(value) && value.length() > 10 && SalaryDateUtil.parse(value, DATE_TIME_FORMATTER_PATTERN) != null) {
|
||||
value = value.substring(0, 4);
|
||||
}
|
||||
return StrUtil.isEmpty(value) ? "''" : value;
|
||||
}
|
||||
},
|
||||
YEAR_MONTH(5, "日期文本-年月", 85393) {
|
||||
@Override
|
||||
public Object convertValue(String value) {
|
||||
if (StringUtils.isNotBlank(value) && value.length() > 10 && SalaryDateUtil.parse(value, DATE_TIME_FORMATTER_PATTERN) != null) {
|
||||
value = value.substring(0, 7);
|
||||
}
|
||||
return StrUtil.isEmpty(value) ? "''" : value;
|
||||
}
|
||||
},
|
||||
YEAR_MONTH_DAY(6, "日期文本-年月日", 85393) {
|
||||
@Override
|
||||
public Object convertValue(String value) {
|
||||
if (StringUtils.isNotBlank(value) && value.length() > 10 && SalaryDateUtil.parse(value, DATE_TIME_FORMATTER_PATTERN) != null) {
|
||||
value = value.substring(0, 10);
|
||||
}
|
||||
return StrUtil.isEmpty(value) ? "''" : value;
|
||||
}
|
||||
};
|
||||
|
||||
private int value;
|
||||
|
||||
|
|
@ -49,13 +100,15 @@ public enum PushItemFieldEnum implements BaseEnum<Integer> {
|
|||
return labelId;
|
||||
}
|
||||
|
||||
public abstract Object convertValue(String value);
|
||||
|
||||
public static PushItemFieldEnum parseByValue(int value) {
|
||||
for (PushItemFieldEnum salaryDataSourceEnum : PushItemFieldEnum.values()) {
|
||||
if (Objects.equals(salaryDataSourceEnum.getValue(), value)) {
|
||||
return salaryDataSourceEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return TEXT;
|
||||
}
|
||||
|
||||
public static String getDefaultLabelByValue(Integer value) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
package com.engine.salary.handle;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.type.BaseTypeHandler;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
|
||||
import java.sql.CallableStatement;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 集合的转换
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Slf4j
|
||||
public class LongListTypeHandler extends BaseTypeHandler<List<Long>> {
|
||||
|
||||
@Override
|
||||
public void setNonNullParameter(PreparedStatement preparedStatement, int i, List<Long> list, JdbcType jdbcType) throws SQLException {
|
||||
preparedStatement.setString(i, JSON.toJSONString(list));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getNullableResult(ResultSet resultSet, String s) throws SQLException {
|
||||
List jsonArray = JSONArray.parseArray(resultSet.getString(s), Long.class);
|
||||
return jsonArray == null ? new ArrayList<>() : jsonArray;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getNullableResult(ResultSet resultSet, int i) throws SQLException {
|
||||
List jsonArray = JSONArray.parseArray(resultSet.getString(i), Long.class);
|
||||
return jsonArray == null ? new ArrayList<>() : jsonArray;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getNullableResult(CallableStatement callableStatement, int i) throws SQLException {
|
||||
List jsonArray = JSONArray.parseArray(callableStatement.getString(i), Long.class);
|
||||
return jsonArray == null ? new ArrayList<>() : jsonArray;
|
||||
}
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
<result column="id" property="id"/>
|
||||
<result column="able" property="able"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="salary_sob_ids" property="salarySobIds" typeHandler="com.engine.salary.handle.SalaryListTypeHandler"/>
|
||||
<result column="salary_sob_ids" property="salarySobIds" typeHandler="com.engine.salary.handle.LongListTypeHandler"/>
|
||||
<result column="table_name" property="tableName"/>
|
||||
<result column="mode_id" property="modeId"/>
|
||||
<result column="mode_name" property="modeName"/>
|
||||
|
|
@ -81,7 +81,7 @@
|
|||
AND mode_name = #{modeName}
|
||||
</if>
|
||||
<if test="salarySobIds != null">
|
||||
AND salary_sob_ids = #{salarySobIds, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler}
|
||||
AND salary_sob_ids = #{salarySobIds, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.LongListTypeHandler}
|
||||
</if>
|
||||
<if test="tableName != null">
|
||||
AND table_name = #{tableName}
|
||||
|
|
@ -170,7 +170,7 @@
|
|||
#{modeName},
|
||||
</if>
|
||||
<if test="salarySobIds != null">
|
||||
#{salarySobIds, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
|
||||
#{salarySobIds, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.LongListTypeHandler},
|
||||
</if>
|
||||
<if test="tableName != null">
|
||||
#{tableName},
|
||||
|
|
@ -195,7 +195,7 @@
|
|||
name=#{name},
|
||||
mode_id=#{modeId},
|
||||
mode_name=#{modeName},
|
||||
salary_sob_ids=#{salarySobIds, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
|
||||
salary_sob_ids=#{salarySobIds, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.LongListTypeHandler},
|
||||
table_name=#{tableName},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
|
|
@ -230,7 +230,7 @@
|
|||
mode_name=#{modeName},
|
||||
</if>
|
||||
<if test="salarySobIds != null">
|
||||
salary_sob_ids=#{salarySobIds, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
|
||||
salary_sob_ids=#{salarySobIds, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.LongListTypeHandler},
|
||||
</if>
|
||||
<if test="tableName != null">
|
||||
table_name=#{tableName},
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.push.dto.PushSettingDTO;
|
||||
import com.engine.salary.entity.push.param.PushSettingItemSaveParam;
|
||||
import com.engine.salary.entity.push.param.PushSettingSaveParam;
|
||||
import com.engine.salary.entity.push.po.PushSettingItemPO;
|
||||
import com.engine.salary.entity.push.po.PushSettingPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface PushService {
|
||||
|
||||
/**
|
||||
|
|
@ -18,4 +21,14 @@ public interface PushService {
|
|||
* @param param
|
||||
*/
|
||||
PushSettingItemPO saveItem(PushSettingItemSaveParam param);
|
||||
|
||||
/**
|
||||
* 推送一条核算记录下的所有数据
|
||||
* @param salarySobId
|
||||
* @return
|
||||
*/
|
||||
List<PushSettingDTO> pushOneRecord(Long salarySobId);
|
||||
|
||||
|
||||
// void push(List<Long> recodes);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,21 +3,37 @@ package com.engine.salary.service.impl;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.push.dto.PushSettingDTO;
|
||||
import com.engine.salary.entity.push.param.PushSettingItemSaveParam;
|
||||
import com.engine.salary.entity.push.param.PushSettingSaveParam;
|
||||
import com.engine.salary.entity.push.po.PushSettingItemPO;
|
||||
import com.engine.salary.entity.push.po.PushSettingPO;
|
||||
import com.engine.salary.entity.salaryacct.bo.CalculateFormulaVarBO;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctCalculateBO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.enums.push.PushItemFieldEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.push.PushSettingItemMapper;
|
||||
import com.engine.salary.mapper.push.PushSettingMapper;
|
||||
import com.engine.salary.service.PushService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.setup.ModeRightInfo;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 推送服务
|
||||
|
|
@ -37,9 +53,24 @@ public class PushServiceImpl extends Service implements PushService {
|
|||
return MapperProxyFactory.getProxy(PushSettingItemMapper.class);
|
||||
}
|
||||
|
||||
private SalaryEmployeeService getSalaryEmployeeService(User user) {
|
||||
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentService getTaxAgentService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
private SalaryItemService getSalaryItemService(User user) {
|
||||
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctResultService getSalaryAcctResultService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -131,4 +162,105 @@ public class PushServiceImpl extends Service implements PushService {
|
|||
|
||||
return po;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PushSettingDTO> pushOneRecord(Long salaryAcctRecordId) {
|
||||
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId);
|
||||
|
||||
//查询核算人员
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecordPO.getId());
|
||||
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listAll();
|
||||
|
||||
//查询薪资核算记录的薪资周期、考勤周期等
|
||||
SalarySobCycleDTO salarySobCycleDTO = getSalaryAcctRecordService(user).getSalarySobCycleById(salaryAcctRecordPO.getId());
|
||||
|
||||
SalaryAcctCalculateBO salaryAcctCalculateBO = new SalaryAcctCalculateBO()
|
||||
.setSalaryAcctRecordPO(salaryAcctRecordPO)
|
||||
.setSalarySobPO(new SalarySobPO())
|
||||
.setSalarySobCycleDTO(salarySobCycleDTO)
|
||||
.setOtherSalaryAcctRecordPOS(new ArrayList<>())
|
||||
.setSalarySobItemPOS(new ArrayList<>())
|
||||
.setSalaryItemIdWithPriorityList(new ArrayList<>())
|
||||
.setExpressFormulas(new ArrayList<>())
|
||||
.setSalaryItemPOS(salaryItemPOS)
|
||||
.setSalarySobAdjustRulePOS(new ArrayList<>())
|
||||
.setWelfareColumns(new HashMap<>())
|
||||
.setAttendQuoteFieldListDTOS(new ArrayList<>())
|
||||
.setSalaryAcctEmployeePOS(salaryAcctEmployeePOS)
|
||||
.setIssuedFieldIds(new HashSet<>())
|
||||
.setChildMonitor(null)
|
||||
.setResults(null)
|
||||
.setCalculateKey(null)
|
||||
.setVariableItems(new ArrayList<>())
|
||||
.setTaxDeclarationFunction(TaxDeclarationFunctionEnum.OPEN);
|
||||
|
||||
|
||||
List<Long> employeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getEmployeeId, Collectors.toList());
|
||||
List<DataCollectionEmployee> simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds);
|
||||
|
||||
List<Long> salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getId, Collectors.toList());
|
||||
List<SalaryAcctResultPO> salaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds);
|
||||
|
||||
CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), salaryAcctResultPOS, new ArrayList<>());
|
||||
Map<String, List<CalculateFormulaVarBO.FormulaVarValue>> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO);
|
||||
|
||||
|
||||
List<PushSettingPO> pushSettingPOS = getPushSettingMapper().listSome(PushSettingPO.builder().able(1).build());
|
||||
pushSettingPOS.stream()
|
||||
.filter(po -> po.getSalarySobIds().contains(salaryAcctRecordPO.getSalarySobId()))
|
||||
.forEach(setting -> {
|
||||
|
||||
Long id = setting.getId();
|
||||
List<PushSettingItemPO> pushSettingItemPOS = getPushSettingItemMapper().listSome(PushSettingItemPO.builder().settingId(id).build());
|
||||
|
||||
|
||||
//每个人插入一条
|
||||
for (SalaryAcctEmployeePO emp : salaryAcctEmployeePOS) {
|
||||
//1 获取当前薪资核算人员的公式中的变量的值
|
||||
List<CalculateFormulaVarBO.FormulaVarValue> formulaVarValues = formulaVarMap.get(emp.getEmployeeId() + "_" + emp.getTaxAgentId());
|
||||
//2 人员信息
|
||||
List<CalculateFormulaVarBO.FormulaVarValue> empInfo = formulaVarMap.get(emp.getEmployeeId() + "");
|
||||
formulaVarValues.addAll(empInfo);
|
||||
Map<String, String> formulaVarValueMap = SalaryEntityUtil.convert2Map(formulaVarValues, CalculateFormulaVarBO.FormulaVarValue::getFieldId, CalculateFormulaVarBO.FormulaVarValue::getFieldValue);
|
||||
|
||||
Integer modeId = setting.getModeId();
|
||||
|
||||
|
||||
List<String> fields = new ArrayList<>();
|
||||
List<Object> values = new ArrayList<>();
|
||||
for (PushSettingItemPO item : pushSettingItemPOS) {
|
||||
//数据库字段
|
||||
String fieldName = item.getFieldName();
|
||||
fields.add(fieldName);
|
||||
// 公式变量的值
|
||||
String field = item.getSource() + "_" + item.getItem();
|
||||
String value = formulaVarValueMap.getOrDefault(field, StringUtils.EMPTY);
|
||||
PushItemFieldEnum pushItemFieldEnum = PushItemFieldEnum.parseByValue(item.getFieldType());
|
||||
values.add(pushItemFieldEnum.convertValue(value));
|
||||
}
|
||||
String tableName = setting.getTableName();
|
||||
String sql = String.format("insert into %s (%s) values (%s)", tableName, String.join(",", fields), values.stream().map(Object::toString).collect(Collectors.joining(",")));
|
||||
System.out.println(sql);
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.execute(sql);
|
||||
|
||||
if (modeId != null) {
|
||||
rs.executeQuery("select max(id) from " + tableName);
|
||||
int mainId = 0;
|
||||
if (rs.next()) {
|
||||
mainId = rs.getInt(1);
|
||||
}
|
||||
ModeRightInfo ModeRightInfo = new ModeRightInfo();
|
||||
ModeRightInfo.setNewRight(true);
|
||||
ModeRightInfo.editModeDataShare(1, modeId, mainId);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.push.param.PushParam;
|
||||
import com.engine.salary.entity.push.param.PushSettingItemSaveParam;
|
||||
import com.engine.salary.entity.push.param.PushSettingSaveParam;
|
||||
import com.engine.salary.entity.push.po.PushSettingItemPO;
|
||||
|
|
@ -50,4 +51,11 @@ public class PushController {
|
|||
return new ResponseResult<PushSettingItemSaveParam, PushSettingItemPO>(user).run(getPushWrapper(user)::saveItem, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/push")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveitem(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody PushParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<PushParam, String>(user).run(getPushWrapper(user)::push, param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.engine.salary.wrapper;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.push.param.PushParam;
|
||||
import com.engine.salary.entity.push.param.PushSettingItemSaveParam;
|
||||
import com.engine.salary.entity.push.param.PushSettingSaveParam;
|
||||
import com.engine.salary.entity.push.po.PushSettingItemPO;
|
||||
|
|
@ -25,4 +26,8 @@ public class PushWrapper extends Service {
|
|||
public PushSettingItemPO saveItem(PushSettingItemSaveParam param) {
|
||||
return getPushService(user).saveItem(param);
|
||||
}
|
||||
|
||||
public void push(PushParam pushParam) {
|
||||
getPushService(user).pushOneRecord(pushParam.getSalaryAcctRecordId());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue