|
|
|
@@ -3,6 +3,7 @@ package com.xueyi.system.staff.service.impl; |
|
|
|
import cn.hutool.core.date.LocalDateTimeUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
import com.baomidou.dynamic.datasource.annotation.DSTransactional; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
import com.xueyi.common.cache.utils.SourceUtil; |
|
|
|
@@ -43,8 +44,10 @@ import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.io.Serializable; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Collection; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@@ -97,8 +100,7 @@ public class DmStaffServiceImpl extends BaseServiceImpl<DmStaffQuery, DmStaffDto |
|
|
|
@Override |
|
|
|
@TenantIgnore(tenantLine = true) |
|
|
|
public List<DmStaffPo> selectStaffList(DmStaffPo staff) { |
|
|
|
List<DmStaffPo> result = staffMapper.selectStaffList(staff); |
|
|
|
return result; |
|
|
|
return staffMapper.selectStaffList(staff); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@@ -319,7 +321,6 @@ public class DmStaffServiceImpl extends BaseServiceImpl<DmStaffQuery, DmStaffDto |
|
|
|
birthJson.put("timestamp",dmStaff.getBirthDate().getTime()); |
|
|
|
vo.setTemplate("birthday"); |
|
|
|
vo.setFormat(birthJson); |
|
|
|
System.out.println(birthJson.toJSONString()); |
|
|
|
remoteIntentService.sendMessage(vo,tenantId,source.getMaster(), SecurityConstants.INNER); |
|
|
|
} |
|
|
|
if (dmStaff.getHireDate() != null) { |
|
|
|
@@ -331,20 +332,19 @@ public class DmStaffServiceImpl extends BaseServiceImpl<DmStaffQuery, DmStaffDto |
|
|
|
hireJson.put("timestamp",dmStaff.getHireDate().getTime()); |
|
|
|
vo2.setTemplate("hireDate"); |
|
|
|
vo2.setFormat(hireJson); |
|
|
|
System.out.println(hireJson.toJSONString()); |
|
|
|
remoteIntentService.sendMessage(vo2,tenantId,source.getMaster(), SecurityConstants.INNER); |
|
|
|
} |
|
|
|
return super.insert(dmStaff); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public int update(DmStaffDto dmStaff) { |
|
|
|
Long tenantId = SecurityContextHolder.getEnterpriseId(); |
|
|
|
SysEnterpriseDto enterpriseDto = enterpriseService.selectById(tenantId); |
|
|
|
Source source = SourceUtil.getSourceCache(enterpriseDto.getStrategyId()); |
|
|
|
SysEnterpriseStaffPo enterpriseStaff = new SysEnterpriseStaffPo(); |
|
|
|
SysEnterpriseStaffPo enterpriseStaff = new SysEnterpriseStaffPo(dmStaff.getId()); |
|
|
|
enterpriseStaff.setPhone(dmStaff.getPhone()); |
|
|
|
enterpriseStaff.setId(dmStaff.getId()); |
|
|
|
enterpriseStaff.setTId(SecurityContextHolder.getEnterpriseId()); |
|
|
|
tenantService.saveEnterpriseStaff(enterpriseStaff, SecurityConstants.INNER); |
|
|
|
|
|
|
|
@@ -369,10 +369,27 @@ public class DmStaffServiceImpl extends BaseServiceImpl<DmStaffQuery, DmStaffDto |
|
|
|
hireJson.put("timestamp",dmStaff.getHireDate().getTime()); |
|
|
|
vo2.setTemplate("hireDate"); |
|
|
|
vo2.setFormat(hireJson); |
|
|
|
System.out.println(hireJson.toJSONString()); |
|
|
|
remoteIntentService.sendMessage(vo2,tenantId,source.getMaster(), SecurityConstants.INNER); |
|
|
|
} |
|
|
|
|
|
|
|
return super.update(dmStaff); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@DSTransactional |
|
|
|
public int deleteByIds(Collection<? extends Serializable> idList) { |
|
|
|
for (Serializable id : idList) { |
|
|
|
SysEnterpriseStaffPo enterpriseStaff = new SysEnterpriseStaffPo((Long) id); |
|
|
|
tenantService.delEnterpriseStaff(enterpriseStaff, SecurityConstants.INNER); |
|
|
|
} |
|
|
|
return super.deleteByIds(idList); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@DSTransactional |
|
|
|
public int deleteById(Serializable id) { |
|
|
|
SysEnterpriseStaffPo enterpriseStaff = new SysEnterpriseStaffPo((Long) id); |
|
|
|
tenantService.delEnterpriseStaff(enterpriseStaff, SecurityConstants.INNER); |
|
|
|
return super.deleteById(id); |
|
|
|
} |
|
|
|
} |