|
|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.xunmei.common.core.constant.SecurityConstants;
|
|
|
+import com.xunmei.common.core.utils.StringUtils;
|
|
|
import com.xunmei.common.core.web.domain.AjaxResult;
|
|
|
import com.xunmei.core.information.service.ICoreMessageCenterService;
|
|
|
import com.xunmei.system.api.RemoteJobService;
|
|
|
@@ -79,6 +80,18 @@ public class CoreResumptionConfigurationServiceImpl extends ServiceImpl<CoreResu
|
|
|
return coreResumptionConfigurationMapper.selectList(new QueryWrapper<>(coreResumptionConfiguration));
|
|
|
}
|
|
|
|
|
|
+ String split(String time) {
|
|
|
+ if (StringUtils.isEmpty(time)) {
|
|
|
+ return time;
|
|
|
+ }
|
|
|
+ if (time.indexOf(":") != -1) {
|
|
|
+ String[] split = time.split(":");
|
|
|
+ return split[0];
|
|
|
+ } else {
|
|
|
+ return time;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 新增履职任务定时提醒
|
|
|
*
|
|
|
@@ -87,10 +100,15 @@ public class CoreResumptionConfigurationServiceImpl extends ServiceImpl<CoreResu
|
|
|
*/
|
|
|
@Override
|
|
|
public int insertCoreResumptionConfiguration(CoreResumptionConfigurationDTO coreResumptionConfiguration) {
|
|
|
+
|
|
|
Long[] jobIds = {100l, 101L, 102L, 103L};
|
|
|
remoteJobService.remoteRemove(jobIds, SecurityConstants.INNER);
|
|
|
int insert = 0;
|
|
|
for (CoreResumptionConfiguration c : coreResumptionConfiguration.getCoreResumptionConfiguration()) {
|
|
|
+ c.setFront(split(c.getFront()));
|
|
|
+ c.setCentre(split(c.getCentre()));
|
|
|
+ c.setAfter(split(c.getAfter()));
|
|
|
+ c.setAllDay(split(c.getAllDay()));
|
|
|
if (null == c.getId()) {
|
|
|
c.setCreateTime(DateUtils.getNowDate());
|
|
|
c.setCreateBy(SecurityUtils.getUsername());
|
|
|
@@ -206,7 +224,7 @@ public class CoreResumptionConfigurationServiceImpl extends ServiceImpl<CoreResu
|
|
|
String timeUnit = "天";
|
|
|
if (cycle.equals("1")) {
|
|
|
coreMessageCenter.setContent("您有履职任务" + taskName + "快到期");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
coreMessageCenter.setContent("您有履职任务" + taskName + "还有" + time + timeUnit + "到期");
|
|
|
}
|
|
|
coreMessageCenter.setUserId(sysUser.getId());
|
|
|
@@ -241,49 +259,49 @@ public class CoreResumptionConfigurationServiceImpl extends ServiceImpl<CoreResu
|
|
|
|
|
|
@Override
|
|
|
public void font() {
|
|
|
- CoreResumptionConfiguration coreResumptionConfiguration=new CoreResumptionConfiguration();
|
|
|
+ CoreResumptionConfiguration coreResumptionConfiguration = new CoreResumptionConfiguration();
|
|
|
coreResumptionConfiguration.setTimeUnit("1");
|
|
|
coreResumptionConfiguration.setDelFlag("0");
|
|
|
List<CoreResumptionConfiguration> coreResumptionConfigurations = baseMapper.selectCoreResumptionConfigurationList(coreResumptionConfiguration);
|
|
|
- List<Resumption> resumptions = resumptionMapper.selectDay(getTime(0),"2");
|
|
|
- resumptions.forEach(r->{
|
|
|
- addMassageCenter(r.getName(),null, coreResumptionConfigurations.get(0).getTimeUnit(),r.getOrgId(),r.getRoleId());
|
|
|
+ List<Resumption> resumptions = resumptionMapper.selectDay(getTime(0), "2");
|
|
|
+ resumptions.forEach(r -> {
|
|
|
+ addMassageCenter(r.getName(), null, coreResumptionConfigurations.get(0).getTimeUnit(), r.getOrgId(), r.getRoleId());
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void centre() {
|
|
|
- CoreResumptionConfiguration coreResumptionConfiguration=new CoreResumptionConfiguration();
|
|
|
+ CoreResumptionConfiguration coreResumptionConfiguration = new CoreResumptionConfiguration();
|
|
|
coreResumptionConfiguration.setTimeUnit("1");
|
|
|
coreResumptionConfiguration.setDelFlag("0");
|
|
|
List<CoreResumptionConfiguration> coreResumptionConfigurations = baseMapper.selectCoreResumptionConfigurationList(coreResumptionConfiguration);
|
|
|
- List<Resumption> resumptions = resumptionMapper.selectDay(getTime(0),"3");
|
|
|
- resumptions.forEach(r->{
|
|
|
- addMassageCenter(r.getName(),null, coreResumptionConfigurations.get(0).getTimeUnit(),r.getOrgId(),r.getRoleId());
|
|
|
+ List<Resumption> resumptions = resumptionMapper.selectDay(getTime(0), "3");
|
|
|
+ resumptions.forEach(r -> {
|
|
|
+ addMassageCenter(r.getName(), null, coreResumptionConfigurations.get(0).getTimeUnit(), r.getOrgId(), r.getRoleId());
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void after() {
|
|
|
- CoreResumptionConfiguration coreResumptionConfiguration=new CoreResumptionConfiguration();
|
|
|
+ CoreResumptionConfiguration coreResumptionConfiguration = new CoreResumptionConfiguration();
|
|
|
coreResumptionConfiguration.setTimeUnit("1");
|
|
|
coreResumptionConfiguration.setDelFlag("0");
|
|
|
List<CoreResumptionConfiguration> coreResumptionConfigurations = baseMapper.selectCoreResumptionConfigurationList(coreResumptionConfiguration);
|
|
|
- List<Resumption> resumptions = resumptionMapper.selectDay(getTime(0),"4");
|
|
|
- resumptions.forEach(r->{
|
|
|
- addMassageCenter(r.getName(),null, coreResumptionConfigurations.get(0).getTimeUnit(),r.getOrgId(),r.getRoleId());
|
|
|
+ List<Resumption> resumptions = resumptionMapper.selectDay(getTime(0), "4");
|
|
|
+ resumptions.forEach(r -> {
|
|
|
+ addMassageCenter(r.getName(), null, coreResumptionConfigurations.get(0).getTimeUnit(), r.getOrgId(), r.getRoleId());
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void allDay() {
|
|
|
- CoreResumptionConfiguration coreResumptionConfiguration=new CoreResumptionConfiguration();
|
|
|
+ CoreResumptionConfiguration coreResumptionConfiguration = new CoreResumptionConfiguration();
|
|
|
coreResumptionConfiguration.setTimeUnit("1");
|
|
|
coreResumptionConfiguration.setDelFlag("0");
|
|
|
List<CoreResumptionConfiguration> coreResumptionConfigurations = baseMapper.selectCoreResumptionConfigurationList(coreResumptionConfiguration);
|
|
|
- List<Resumption> resumptions = resumptionMapper.selectDay(getTime(0),"1");
|
|
|
- resumptions.forEach(r->{
|
|
|
- addMassageCenter(r.getName(),null, coreResumptionConfigurations.get(0).getTimeUnit(),r.getOrgId(),r.getRoleId());
|
|
|
+ List<Resumption> resumptions = resumptionMapper.selectDay(getTime(0), "1");
|
|
|
+ resumptions.forEach(r -> {
|
|
|
+ addMassageCenter(r.getName(), null, coreResumptionConfigurations.get(0).getTimeUnit(), r.getOrgId(), r.getRoleId());
|
|
|
});
|
|
|
}
|
|
|
}
|