数据推送
This commit is contained in:
parent
e4e3fb4bec
commit
dd77a2f11b
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.engine.salary.entity.push.dto;
|
||||||
|
|
||||||
|
import com.engine.salary.annotation.TableTitle;
|
||||||
|
import com.engine.salary.enums.push.PushItemFieldEnum;
|
||||||
|
import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据推送配置明细
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PushSettingItemDTO {
|
||||||
|
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置id
|
||||||
|
*/
|
||||||
|
private Long settingId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目
|
||||||
|
*/
|
||||||
|
private String item;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目名
|
||||||
|
*/
|
||||||
|
@TableTitle(title = "项目名", dataIndex = "itemName", key = "itemName")
|
||||||
|
private String itemName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目类型
|
||||||
|
* @see SalarySQLReferenceEnum
|
||||||
|
*/
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
private String sourceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据库字段
|
||||||
|
*/
|
||||||
|
@TableTitle(title = "数据库字段", dataIndex = "fieldName", key = "fieldName")
|
||||||
|
private String fieldName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字段类型
|
||||||
|
* @see PushItemFieldEnum
|
||||||
|
*/
|
||||||
|
private PushItemFieldEnum fieldType;
|
||||||
|
|
||||||
|
@TableTitle(title = "字段类型", dataIndex = "fieldTypeName", key = "fieldTypeName")
|
||||||
|
private String fieldTypeName;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.engine.salary.entity.push.po;
|
package com.engine.salary.entity.push.po;
|
||||||
|
|
||||||
import com.engine.hrmelog.annotation.ElogTransform;
|
import com.engine.hrmelog.annotation.ElogTransform;
|
||||||
import com.engine.salary.annotation.TableTitle;
|
import com.engine.salary.enums.push.PushItemFieldEnum;
|
||||||
import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum;
|
import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
|
|
@ -34,14 +34,12 @@ public class PushSettingItemPO {
|
||||||
* 项目
|
* 项目
|
||||||
*/
|
*/
|
||||||
@ElogTransform(name = "项目")
|
@ElogTransform(name = "项目")
|
||||||
@TableTitle(title = "项目", dataIndex = "item", key = "item")
|
|
||||||
private String item;
|
private String item;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目名
|
* 项目名
|
||||||
*/
|
*/
|
||||||
@ElogTransform(name = "项目名")
|
@ElogTransform(name = "项目名")
|
||||||
@TableTitle(title = "项目名", dataIndex = "itemName", key = "itemName")
|
|
||||||
private String itemName;
|
private String itemName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -49,21 +47,19 @@ public class PushSettingItemPO {
|
||||||
* @see SalarySQLReferenceEnum
|
* @see SalarySQLReferenceEnum
|
||||||
*/
|
*/
|
||||||
@ElogTransform(name = "项目类型")
|
@ElogTransform(name = "项目类型")
|
||||||
@TableTitle(title = "项目类型", dataIndex = "source", key = "source")
|
|
||||||
private String source;
|
private String source;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据库字段
|
* 数据库字段
|
||||||
*/
|
*/
|
||||||
@ElogTransform(name = "数据库字段")
|
@ElogTransform(name = "数据库字段")
|
||||||
@TableTitle(title = "数据库字段", dataIndex = "fieldName", key = "fieldName")
|
|
||||||
private String fieldName;
|
private String fieldName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字段类型
|
* 字段类型
|
||||||
|
* @see PushItemFieldEnum
|
||||||
*/
|
*/
|
||||||
@ElogTransform(name = "字段类型")
|
@ElogTransform(name = "字段类型")
|
||||||
@TableTitle(title = "字段类型", dataIndex = "fieldType", key = "fieldType")
|
|
||||||
private Integer fieldType;
|
private Integer fieldType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.engine.salary.service;
|
package com.engine.salary.service;
|
||||||
|
|
||||||
import com.engine.salary.entity.push.dto.PushSettingDTO;
|
import com.engine.salary.entity.push.dto.PushSettingDTO;
|
||||||
|
import com.engine.salary.entity.push.dto.PushSettingItemDTO;
|
||||||
import com.engine.salary.entity.push.param.PushSettingItemQueryParam;
|
import com.engine.salary.entity.push.param.PushSettingItemQueryParam;
|
||||||
import com.engine.salary.entity.push.param.PushSettingItemSaveParam;
|
import com.engine.salary.entity.push.param.PushSettingItemSaveParam;
|
||||||
import com.engine.salary.entity.push.param.PushSettingQueryParam;
|
import com.engine.salary.entity.push.param.PushSettingQueryParam;
|
||||||
|
|
@ -13,6 +14,7 @@ public interface PushService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 推送任务列表
|
* 推送任务列表
|
||||||
|
*
|
||||||
* @param param
|
* @param param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -21,28 +23,47 @@ public interface PushService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存推送配置
|
* 保存推送配置
|
||||||
|
*
|
||||||
* @param param
|
* @param param
|
||||||
*/
|
*/
|
||||||
PushSettingPO save(PushSettingSaveParam param);
|
PushSettingPO save(PushSettingSaveParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除推送配置
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
void delete(Long id);
|
void delete(Long id);
|
||||||
|
|
||||||
PageInfo<PushSettingItemPO> itemList(PushSettingItemQueryParam param);
|
/**
|
||||||
|
* 推送明细列表
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageInfo<PushSettingItemDTO> itemList(PushSettingItemQueryParam param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存明细配置
|
* 保存明细配置
|
||||||
|
*
|
||||||
* @param param
|
* @param param
|
||||||
*/
|
*/
|
||||||
PushSettingItemPO saveItem(PushSettingItemSaveParam param);
|
PushSettingItemPO saveItem(PushSettingItemSaveParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除明细配置
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
void deleteItem(Long id);
|
void deleteItem(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 推送一条核算记录下的所有数据
|
* 推送一条核算记录下的所有数据
|
||||||
|
*
|
||||||
* @param salarySobId
|
* @param salarySobId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void pushOneRecord(Long salarySobId);
|
void pushOneRecord(Long salarySobId);
|
||||||
|
|
||||||
|
|
||||||
// void push(List<Long> recodes);
|
// void push(List<Long> recodes);
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.engine.core.impl.Service;
|
||||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||||
import com.engine.salary.entity.push.dto.PushSettingDTO;
|
import com.engine.salary.entity.push.dto.PushSettingDTO;
|
||||||
|
import com.engine.salary.entity.push.dto.PushSettingItemDTO;
|
||||||
import com.engine.salary.entity.push.param.PushSettingItemQueryParam;
|
import com.engine.salary.entity.push.param.PushSettingItemQueryParam;
|
||||||
import com.engine.salary.entity.push.param.PushSettingItemSaveParam;
|
import com.engine.salary.entity.push.param.PushSettingItemSaveParam;
|
||||||
import com.engine.salary.entity.push.param.PushSettingQueryParam;
|
import com.engine.salary.entity.push.param.PushSettingQueryParam;
|
||||||
|
|
@ -21,6 +22,7 @@ import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||||
import com.engine.salary.enums.push.PushItemFieldEnum;
|
import com.engine.salary.enums.push.PushItemFieldEnum;
|
||||||
|
import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum;
|
||||||
import com.engine.salary.exception.SalaryRunTimeException;
|
import com.engine.salary.exception.SalaryRunTimeException;
|
||||||
import com.engine.salary.mapper.push.PushSettingItemMapper;
|
import com.engine.salary.mapper.push.PushSettingItemMapper;
|
||||||
import com.engine.salary.mapper.push.PushSettingMapper;
|
import com.engine.salary.mapper.push.PushSettingMapper;
|
||||||
|
|
@ -158,9 +160,23 @@ public class PushServiceImpl extends Service implements PushService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<PushSettingItemPO> itemList(PushSettingItemQueryParam param) {
|
public PageInfo<PushSettingItemDTO> itemList(PushSettingItemQueryParam param) {
|
||||||
List<PushSettingItemPO> pushSettingItemPOS = getPushSettingItemMapper().listSome(PushSettingItemPO.builder().settingId(param.getSettingId()).build());
|
List<PushSettingItemPO> pushSettingItemPOS = getPushSettingItemMapper().listSome(PushSettingItemPO.builder().settingId(param.getSettingId()).build());
|
||||||
return new PageInfo<PushSettingItemPO>(pushSettingItemPOS, PushSettingItemPO.class);
|
|
||||||
|
List<PushSettingItemDTO> list = pushSettingItemPOS.stream().map(po -> PushSettingItemDTO.builder()
|
||||||
|
.id(po.getId())
|
||||||
|
.settingId(po.getSettingId())
|
||||||
|
.item(po.getItem())
|
||||||
|
.itemName(po.getItemName())
|
||||||
|
.source(po.getSource())
|
||||||
|
.sourceName(SalarySQLReferenceEnum.parseByValue(po.getSource()).getDefaultLabel())
|
||||||
|
.fieldName(po.getFieldName())
|
||||||
|
.fieldType(PushItemFieldEnum.parseByValue(po.getFieldType()))
|
||||||
|
.fieldTypeName(PushItemFieldEnum.parseByValue(po.getFieldType()).getDefaultLabel())
|
||||||
|
.build()
|
||||||
|
).collect(Collectors.toList());
|
||||||
|
|
||||||
|
return new PageInfo<>(list, PushSettingItemDTO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -217,6 +233,10 @@ public class PushServiceImpl extends Service implements PushService {
|
||||||
|
|
||||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId);
|
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(salaryAcctRecordId);
|
||||||
|
|
||||||
|
if (salaryAcctRecordPO == null) {
|
||||||
|
throw new SalaryRunTimeException("核算记录不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
//查询核算人员
|
//查询核算人员
|
||||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecordPO.getId());
|
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecordPO.getId());
|
||||||
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listAll();
|
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listAll();
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.engine.salary.web;
|
||||||
|
|
||||||
import com.engine.common.util.ServiceUtil;
|
import com.engine.common.util.ServiceUtil;
|
||||||
import com.engine.salary.entity.push.dto.PushSettingDTO;
|
import com.engine.salary.entity.push.dto.PushSettingDTO;
|
||||||
|
import com.engine.salary.entity.push.dto.PushSettingItemDTO;
|
||||||
import com.engine.salary.entity.push.param.*;
|
import com.engine.salary.entity.push.param.*;
|
||||||
import com.engine.salary.entity.push.po.PushSettingItemPO;
|
import com.engine.salary.entity.push.po.PushSettingItemPO;
|
||||||
import com.engine.salary.entity.push.po.PushSettingPO;
|
import com.engine.salary.entity.push.po.PushSettingPO;
|
||||||
|
|
@ -61,7 +62,7 @@ public class PushController {
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public String itemList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody PushSettingItemQueryParam param) {
|
public String itemList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody PushSettingItemQueryParam param) {
|
||||||
User user = HrmUserVarify.getUser(request, response);
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
return new ResponseResult<PushSettingItemQueryParam, PageInfo<PushSettingItemPO>>(user).run(getPushWrapper(user)::itemList, param);
|
return new ResponseResult<PushSettingItemQueryParam, PageInfo<PushSettingItemDTO>>(user).run(getPushWrapper(user)::itemList, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.engine.salary.wrapper;
|
||||||
import com.engine.common.util.ServiceUtil;
|
import com.engine.common.util.ServiceUtil;
|
||||||
import com.engine.core.impl.Service;
|
import com.engine.core.impl.Service;
|
||||||
import com.engine.salary.entity.push.dto.PushSettingDTO;
|
import com.engine.salary.entity.push.dto.PushSettingDTO;
|
||||||
|
import com.engine.salary.entity.push.dto.PushSettingItemDTO;
|
||||||
import com.engine.salary.entity.push.param.*;
|
import com.engine.salary.entity.push.param.*;
|
||||||
import com.engine.salary.entity.push.po.PushSettingItemPO;
|
import com.engine.salary.entity.push.po.PushSettingItemPO;
|
||||||
import com.engine.salary.entity.push.po.PushSettingPO;
|
import com.engine.salary.entity.push.po.PushSettingPO;
|
||||||
|
|
@ -31,7 +32,7 @@ public class PushWrapper extends Service {
|
||||||
getPushService(user).delete(id);
|
getPushService(user).delete(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PageInfo<PushSettingItemPO> itemList(PushSettingItemQueryParam param) {
|
public PageInfo<PushSettingItemDTO> itemList(PushSettingItemQueryParam param) {
|
||||||
return getPushService(user).itemList(param);
|
return getPushService(user).itemList(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue