parent
0777f99870
commit
ba650b9fe6
|
|
@ -50,7 +50,7 @@ public class PushRecordDTO {
|
||||||
/**
|
/**
|
||||||
* 数据库表名
|
* 数据库表名
|
||||||
*/
|
*/
|
||||||
@TableTitle(title = "记录名", dataIndex = "name", key = "name")
|
@TableTitle(title = "数据表名", dataIndex = "name", key = "tableName")
|
||||||
private String tableName;
|
private String tableName;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -59,7 +59,8 @@ public class PushRecordDTO {
|
||||||
*
|
*
|
||||||
* @see PushRecordStatusEnum
|
* @see PushRecordStatusEnum
|
||||||
*/
|
*/
|
||||||
@TableTitle(title = "推送状态", dataIndex = "status", key = "status")
|
@TableTitle(title = "推送状态", dataIndex = "statusName", key = "statusName")
|
||||||
|
private String statusName;
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -33,18 +33,22 @@ public class PushRecordDetailDTO {
|
||||||
*/
|
*/
|
||||||
private Long acctEmpId;
|
private Long acctEmpId;
|
||||||
|
|
||||||
|
@TableTitle(title = "人员", dataIndex = "username",key = "username")
|
||||||
|
private String username;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行状态
|
* 执行状态
|
||||||
* @see com.engine.salary.enums.push.PushRecordDetailStatusEnum
|
* @see com.engine.salary.enums.push.PushRecordDetailStatusEnum
|
||||||
*/
|
*/
|
||||||
@TableTitle(title = "执行状态", dataIndex = "status",key = "status")
|
@TableTitle(title = "执行状态", dataIndex = "statusName",key = "statusName")
|
||||||
|
private String statusName;
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 失败原因
|
* 失败原因
|
||||||
*/
|
*/
|
||||||
@TableTitle(title = "失败原因", dataIndex = "fail_reason",key = "status")
|
@TableTitle(title = "失败原因", dataIndex = "fail_reason",key = "status")
|
||||||
private String fail_reason;
|
private String failReason;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行sql
|
* 执行sql
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public class PushRecordDetailPO {
|
||||||
* 失败原因
|
* 失败原因
|
||||||
*/
|
*/
|
||||||
@ElogTransform(name = "失败原因")
|
@ElogTransform(name = "失败原因")
|
||||||
private String fail_reason;
|
private String failReason;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行sql
|
* 执行sql
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ public enum PushRecordDetailStatusEnum implements BaseEnum<Integer> {
|
||||||
return salaryDataSourceEnum;
|
return salaryDataSourceEnum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return PREPARE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getDefaultLabelByValue(Integer value) {
|
public static String getDefaultLabelByValue(Integer value) {
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ public enum PushRecordStatusEnum implements BaseEnum<Integer> {
|
||||||
return salaryDataSourceEnum;
|
return salaryDataSourceEnum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return DATA_PREPARE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getDefaultLabelByValue(Integer value) {
|
public static String getDefaultLabelByValue(Integer value) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.engine.salary.mapper.push;
|
package com.engine.salary.mapper.push;
|
||||||
|
|
||||||
|
import com.engine.salary.entity.push.dto.PushRecordDetailDTO;
|
||||||
import com.engine.salary.entity.push.po.PushRecordDetailPO;
|
import com.engine.salary.entity.push.po.PushRecordDetailPO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
@ -22,6 +23,8 @@ public interface PushRecordDetailMapper {
|
||||||
*/
|
*/
|
||||||
List<PushRecordDetailPO> listSome(PushRecordDetailPO pushRecordDetail);
|
List<PushRecordDetailPO> listSome(PushRecordDetailPO pushRecordDetail);
|
||||||
|
|
||||||
|
List<PushRecordDetailDTO> listDTO(PushRecordDetailDTO dto);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据主键查询
|
* 根据主键查询
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
<result column="status" property="status"/>
|
<result column="status" property="status"/>
|
||||||
<result column="tenant_key" property="tenantKey"/>
|
<result column="tenant_key" property="tenantKey"/>
|
||||||
<result column="update_time" property="updateTime"/>
|
<result column="update_time" property="updateTime"/>
|
||||||
|
<result column="fail_reason" property="failReason"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!-- 表字段 -->
|
<!-- 表字段 -->
|
||||||
|
|
@ -28,6 +29,7 @@
|
||||||
, t.status
|
, t.status
|
||||||
, t.tenant_key
|
, t.tenant_key
|
||||||
, t.update_time
|
, t.update_time
|
||||||
|
, t.fail_reason
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 查询全部 -->
|
<!-- 查询全部 -->
|
||||||
|
|
@ -88,6 +90,53 @@
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
ORDER BY id DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="listDTO" resultType="com.engine.salary.entity.push.dto.PushRecordDetailDTO" parameterType="com.engine.salary.entity.push.dto.PushRecordDetailDTO">
|
||||||
|
SELECT
|
||||||
|
t.acct_emp_id
|
||||||
|
, t.create_time
|
||||||
|
, t.creator
|
||||||
|
, t.delete_type
|
||||||
|
, t.execute
|
||||||
|
, t.id
|
||||||
|
, t.record_id
|
||||||
|
, t.status
|
||||||
|
, t.tenant_key
|
||||||
|
, t.update_time
|
||||||
|
, t.fail_reason
|
||||||
|
, e.LASTNAME as username
|
||||||
|
FROM hrsa_push_record_detail t
|
||||||
|
left join hrsa_salary_acct_emp emp
|
||||||
|
on t.acct_emp_id=emp.id
|
||||||
|
left join hrsa_salary_sob sob
|
||||||
|
on emp.salary_sob_id = sob.id
|
||||||
|
left join hrmresource e
|
||||||
|
on emp.employee_id=e.id
|
||||||
|
|
||||||
|
WHERE t.delete_type = 0
|
||||||
|
and emp.delete_type = 0
|
||||||
|
and sob.delete_type = 0
|
||||||
|
|
||||||
|
<if test="acctEmpId != null">
|
||||||
|
AND t.acct_emp_id = #{acctEmpId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="id != null">
|
||||||
|
AND t.id = #{id}
|
||||||
|
</if>
|
||||||
|
<if test="recordId != null">
|
||||||
|
AND t.record_id = #{recordId}
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
AND t.status = #{status}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ORDER BY id DESC
|
ORDER BY id DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -127,6 +176,9 @@
|
||||||
<if test="updateTime != null">
|
<if test="updateTime != null">
|
||||||
update_time,
|
update_time,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="failReason != null">
|
||||||
|
fail_reason,
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||||
<if test="acctEmpId != null">
|
<if test="acctEmpId != null">
|
||||||
|
|
@ -159,6 +211,9 @@
|
||||||
<if test="updateTime != null">
|
<if test="updateTime != null">
|
||||||
#{updateTime},
|
#{updateTime},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="failReason != null">
|
||||||
|
#{failReason},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
@ -175,6 +230,7 @@
|
||||||
status=#{status},
|
status=#{status},
|
||||||
tenant_key=#{tenantKey},
|
tenant_key=#{tenantKey},
|
||||||
update_time=#{updateTime},
|
update_time=#{updateTime},
|
||||||
|
fail_reason=#{failReason},
|
||||||
</set>
|
</set>
|
||||||
WHERE id = #{id} AND delete_type = 0
|
WHERE id = #{id} AND delete_type = 0
|
||||||
</update>
|
</update>
|
||||||
|
|
@ -211,6 +267,9 @@
|
||||||
<if test="updateTime != null">
|
<if test="updateTime != null">
|
||||||
update_time=#{updateTime},
|
update_time=#{updateTime},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="failReason != null">
|
||||||
|
fail_reason=#{failReason},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
WHERE id = #{id} AND delete_type = 0
|
WHERE id = #{id} AND delete_type = 0
|
||||||
</update>
|
</update>
|
||||||
|
|
|
||||||
|
|
@ -257,7 +257,7 @@ public class PushServiceImpl extends Service implements PushService {
|
||||||
|
|
||||||
//查询推送配置
|
//查询推送配置
|
||||||
List<PushSettingPO> pushSettingPOS = getPushSettingMapper().listSome(PushSettingPO.builder().able(1).build());
|
List<PushSettingPO> pushSettingPOS = getPushSettingMapper().listSome(PushSettingPO.builder().able(1).build());
|
||||||
if(CollUtil.isEmpty(pushSettingPOS)){
|
if (CollUtil.isEmpty(pushSettingPOS)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -436,9 +436,10 @@ public class PushServiceImpl extends Service implements PushService {
|
||||||
|
|
||||||
pushRecordDetailPO.setStatus(PushRecordDetailStatusEnum.SUCCESS.getValue());
|
pushRecordDetailPO.setStatus(PushRecordDetailStatusEnum.SUCCESS.getValue());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
pushRecordDetailPO.setFail_reason(e.getMessage());
|
pushRecordDetailPO.setFailReason(e.getMessage());
|
||||||
pushRecordDetailPO.setStatus(PushRecordDetailStatusEnum.FAIL.getValue());
|
pushRecordDetailPO.setStatus(PushRecordDetailStatusEnum.FAIL.getValue());
|
||||||
}
|
}
|
||||||
|
getPushRecordDetailMapper().updateIgnoreNull(pushRecordDetailPO);
|
||||||
});
|
});
|
||||||
|
|
||||||
pushRecordPO.setEndTime(new Date());
|
pushRecordPO.setEndTime(new Date());
|
||||||
|
|
@ -460,7 +461,6 @@ public class PushServiceImpl extends Service implements PushService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeRecords(List<Long> recordIds) {
|
public void removeRecords(List<Long> recordIds) {
|
||||||
recordIds.forEach(recordId -> {
|
recordIds.forEach(recordId -> {
|
||||||
|
|
@ -487,6 +487,7 @@ public class PushServiceImpl extends Service implements PushService {
|
||||||
.acctRecordId(po.getAcctRecordId())
|
.acctRecordId(po.getAcctRecordId())
|
||||||
.type(po.getType())
|
.type(po.getType())
|
||||||
.status(po.getStatus())
|
.status(po.getStatus())
|
||||||
|
.statusName(PushRecordStatusEnum.parseByValue(po.getStatus()).getDefaultLabel())
|
||||||
.startTime(po.getStartTime())
|
.startTime(po.getStartTime())
|
||||||
.endTime(po.getEndTime())
|
.endTime(po.getEndTime())
|
||||||
.build())
|
.build())
|
||||||
|
|
@ -501,22 +502,13 @@ public class PushServiceImpl extends Service implements PushService {
|
||||||
public PageInfo<PushRecordDetailDTO> recordDetailList(RecordDetailListQueryParam param) {
|
public PageInfo<PushRecordDetailDTO> recordDetailList(RecordDetailListQueryParam param) {
|
||||||
ValidUtil.doValidator(param);
|
ValidUtil.doValidator(param);
|
||||||
|
|
||||||
List<PushRecordDetailPO> pushRecordDetailPOS = getPushRecordDetailMapper().listSome(PushRecordDetailPO.builder().recordId(param.getRecordId()).build());
|
List<PushRecordDetailDTO> list = getPushRecordDetailMapper().listDTO(PushRecordDetailDTO.builder().recordId(param.getRecordId()).build());
|
||||||
List<PushRecordDetailDTO> listDTOS = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), pushRecordDetailPOS)
|
List<PushRecordDetailDTO> listDTOS = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), list);
|
||||||
.stream()
|
listDTOS.forEach(dto -> dto.setStatusName(PushRecordDetailStatusEnum.parseByValue(dto.getStatus()).getDefaultLabel()));
|
||||||
.map(po -> PushRecordDetailDTO.builder()
|
|
||||||
.id(po.getId())
|
PageInfo<PushRecordDetailDTO> pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), PushRecordDetailDTO.class);
|
||||||
.recordId(po.getRecordId())
|
pageInfo.setList(listDTOS);
|
||||||
.acctEmpId(po.getAcctEmpId())
|
pageInfo.setTotal(list.size());
|
||||||
.status(po.getStatus())
|
|
||||||
.fail_reason(po.getFail_reason())
|
|
||||||
.execute(po.getExecute())
|
|
||||||
.createTime(po.getCreateTime())
|
|
||||||
.creator(po.getCreator())
|
|
||||||
.build())
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
PageInfo<PushRecordDetailDTO> pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, PushRecordDetailDTO.class);
|
|
||||||
pageInfo.setTotal(pushRecordDetailPOS.size());
|
|
||||||
return pageInfo;
|
return pageInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue