智能提醒

wushunjie
杜函宇 10 months ago
parent 84d48102b9
commit 6beedebf98

@ -87,7 +87,7 @@ public class BmsTemplateInfoController extends BaseController {
/**
*
*/
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov,ent')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(bmsTemplateInfoService.selectBmsTemplateInfoById(id));

@ -90,7 +90,7 @@ public class BmsTemplateRecordController extends BaseController {
* 线
*/
@ApiOperation(value = "获取在线模板详细信息")
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov,ent')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(bmsTemplateRecordService.selectBmsTemplateRecordById(id));
@ -113,7 +113,7 @@ public class BmsTemplateRecordController extends BaseController {
* 线
*/
@ApiOperation(value = "修改在线模板")
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@PreAuthorize("@ss.hasAnyRoles('admin')")
@Log(title = "在线模板", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BmsTemplateRecordUpdateDto bmsTemplateRecordUpdateDto) {

@ -20,23 +20,7 @@ public class BmsEnterpriseBasicInfoAddDto implements Serializable {
@Excel(name = "企业统一信用代码")
@ApiModelProperty(value = "企业统一信用代码")
private String creditCode;
@Excel(name = "企业名称")
@ApiModelProperty(value = "企业名称")
private String enterpriseName;
@Excel(name = "联系人")
@ApiModelProperty(value = "联系人")
private String contacts;
@Excel(name = "联系人电话")
@ApiModelProperty(value = "联系人电话")
private String contactsNumber;
@Excel(name = "企业地址")
@ApiModelProperty(value = "企业地址")
private String address;
private String tyshxydm;
@ApiModelProperty(value = "在线申报模版id")
private int templateRecordId;

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.jjh.declaration.entity.BmsDeclarationRecords;
import com.ruoyi.jjh.declaration.entity.dto.ApprovalDeclarationRecordsQueryDto;
import com.ruoyi.jjh.declaration.entity.dto.BmsDeclarationRecordsDto;
import com.ruoyi.jjh.ent.entity.JSmartDeclaration;
import com.ruoyi.jjh.declaration.entity.vo.ApprovalDeclarationRecordsQueryVo;
import com.ruoyi.jjh.declaration.entity.vo.BmsDeclarationRecordsQueryVo;
import com.ruoyi.jjh.declaration.entity.vo.BmsMunicipalBureauReviewQueryVo;
@ -90,4 +91,11 @@ public interface BmsDeclarationRecordsMapper extends BaseMapper<BmsDeclarationRe
* @return
*/
List<BmsDeclarationRecords> selectET(@Param("templateId") Long templateId, @Param("list") List<String> list);
/**
*
* @return
*/
List<JSmartDeclaration> allNoLimited();
}

@ -1,18 +1,29 @@
package com.ruoyi.jjh.declaration.regular;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.jjh.declaration.entity.BmsEnterpriseBasicInfo;
import com.ruoyi.jjh.declaration.entity.BmsTemplateInfo;
import com.ruoyi.jjh.declaration.entity.BmsTemplateRecord;
import com.ruoyi.jjh.declaration.service.IBmsDeclarationRecordsService;
import com.ruoyi.jjh.declaration.service.IBmsEnterpriseBasicInfoService;
import com.ruoyi.jjh.declaration.service.IBmsTemplateInfoService;
import com.ruoyi.jjh.declaration.service.IBmsTemplateRecordService;
import com.ruoyi.jjh.ent.entity.JContacts;
import com.ruoyi.jjh.ent.entity.JProject;
import com.ruoyi.jjh.ent.entity.JSmartDeclaration;
import com.ruoyi.jjh.ent.entity.JSmartReminders;
import com.ruoyi.jjh.ent.service.JContactsService;
import com.ruoyi.jjh.ent.service.JProjectService;
import com.ruoyi.jjh.ent.service.JSmartDeclarationService;
import com.ruoyi.jjh.ent.service.JSmartRemindersService;
import com.ruoyi.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
@ -21,6 +32,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -65,6 +77,31 @@ public class TimeChange {
@Autowired
private IBmsEnterpriseBasicInfoService bmsEnterpriseBasicInfoService;
/**
*
*/
@Resource
private JSmartRemindersService jSmartRemindersService;
/**
*
*/
@Resource
private JSmartDeclarationService jSmartDeclarationService;
/**
*
*/
@Resource
private IBmsDeclarationRecordsService bmsDeclarationRecordsService;
/**
*
*/
@Resource
private SysUserMapper sysUserMapper;
/**
*
*/
@ -84,6 +121,12 @@ public class TimeChange {
bmsTemplateInfoService.updateBatchById(list);
}
/**
*
*/
@Resource
private JProjectService jProjectService;
public void getTime(BmsTemplateRecord items) {
LocalDate currentDate = LocalDate.now();
LocalDate startDate = LocalDate.of(items.getStartTime().getYear(), items.getStartTime().getMonth(), items.getStartTime().getDayOfMonth());
@ -189,4 +232,88 @@ public class TimeChange {
}
}
}
/**
*
*/
@Scheduled(cron = "0 20 1 * * *")
public void changeDq() {
//定时提醒
List<JSmartReminders> list = jSmartRemindersService.lambdaQuery().eq(JSmartReminders::getAlertManner, 1).list();
List<JSmartDeclaration> listAdd = new ArrayList<>();
//删除不在今天的定时提醒
list.removeIf(x -> !(LocalDate.now().equals(x.getAlertTime().toLocalDate())));
list.forEach(y -> {
if (y.getAlertRecipients() == 1) {
bmsEnterpriseBasicInfoService.list().forEach(x -> {
JSmartDeclaration sd = new JSmartDeclaration();
sd.setAlertTime(y.getAlertTime());
sd.setIsRead(1);
sd.setSmartRemindersId(y.getId());
sd.setTyshxydm(x.getTyshxydm());
listAdd.add(sd);
});
} else if (y.getAlertRecipients() == 2) {
SysUser user = new SysUser();
user.setUserType("02");
sysUserMapper.selectUserList(user).forEach(x -> {
JSmartDeclaration sd = new JSmartDeclaration();
sd.setIsRead(1);
sd.setAlertTime(y.getAlertTime());
sd.setSmartRemindersId(y.getId());
sd.setProjectId(y.getProjectId());
sd.setZwId(x.getUserId());
listAdd.add(sd);
});
}
});
jSmartDeclarationService.saveBatch(listAdd);
}
/**
*
*/
@Scheduled(cron = "0 40 1 * * *")
public void changeNdq() {
//前端已经去除修改在线模板,所以开始时间和结束时间不会进行更改,未作声明何种状态下删除该条不定期提醒,故不做
//获取企业的不定时提醒
JSmartReminders qy = jSmartRemindersService.getById(1);
//获取政务的不定时提醒
JSmartReminders zw = jSmartRemindersService.getById(2);
//查询所有企业申报记录,对应的申报模板不是长期有效并且申报记录未填的,
List<JSmartDeclaration> bmsDeclarationRecords = bmsDeclarationRecordsService.allNoLimited();
//如果当前时间在该申报模板的结束时间前自定义的提前天数之前,就去掉
bmsDeclarationRecords.removeIf(x ->
!(LocalDateTime.now().isAfter(x.getEndTime().minusDays(qy.getDaysAdvance()))
&& LocalDateTime.now().isBefore(x.getEndTime())
) || !(LocalDate.now().equals(x.getEndTime().minusDays(qy.getDaysAdvance()).toLocalDate()))
);
bmsDeclarationRecords.forEach(y -> {
y.setSmartRemindersId(1L);
y.setIsRead(1);
y.setAlertTime(y.getEndTime().minusDays(qy.getDaysAdvance()));
});
List<JProject> jp = jProjectService.lambdaQuery().isNotNull(JProject::getProjectEndTime).list();
jp.removeIf(x ->
!(LocalDateTime.now().isAfter(x.getProjectEndTime().minusDays(zw.getDaysAdvance()))
&& LocalDateTime.now().isBefore(x.getProjectEndTime())
) || !(LocalDate.now().equals(x.getProjectEndTime().minusDays(zw.getDaysAdvance()).toLocalDate()))
);
jp.forEach(x -> {
SysUser user = new SysUser();
user.setUserType("02");
sysUserMapper.selectUserList(user).forEach(o -> {
JSmartDeclaration y = new JSmartDeclaration();
y.setSmartRemindersId(2L);
y.setIsRead(1);
y.setAlertTime(x.getProjectEndTime().minusDays(zw.getDaysAdvance()));
y.setProjectId(x.getId());
y.setZwId(o.getUserId());
bmsDeclarationRecords.add(y);
});
});
jSmartDeclarationService.saveBatch(bmsDeclarationRecords);
}
}

@ -2,8 +2,8 @@ package com.ruoyi.jjh.declaration.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.jjh.declaration.entity.BmsDeclarationRecords;
import com.ruoyi.jjh.declaration.entity.BmsEnterpriseDirectory;
import com.ruoyi.jjh.declaration.entity.dto.*;
import com.ruoyi.jjh.ent.entity.JSmartDeclaration;
import com.ruoyi.jjh.declaration.entity.vo.ApprovalDeclarationRecordsQueryVo;
import com.ruoyi.jjh.declaration.entity.vo.BmsDeclarationRecordsQueryVo;
import com.ruoyi.jjh.declaration.entity.vo.BmsMunicipalBureauReviewQueryVo;
@ -102,4 +102,10 @@ public interface IBmsDeclarationRecordsService extends IService<BmsDeclarationRe
* @return
*/
List<BmsDeclarationRecords> selectET(Long templateId,List<String> list);
/**
*
* @return
*/
List<JSmartDeclaration> allNoLimited();
}

@ -82,9 +82,9 @@ public class BmsBigStrongAwardServiceImpl extends ServiceImpl<BmsBigStrongAwardM
public int insertBmsBigStrongAward(BmsBigStrongAwardAddDto bmsBigStrongAwardAddDto) {
// check 企业信息
Long enterpriseId = iCommonService.checkEnterprise(bmsBigStrongAwardAddDto.getCreditCode(), bmsBigStrongAwardAddDto.getTemplateRecordId());
Long enterpriseId = iCommonService.checkEnterprise(bmsBigStrongAwardAddDto.getTyshxydm(), bmsBigStrongAwardAddDto.getTemplateRecordId());
// check 申报信息
iCommonService.checkDeclaration(bmsBigStrongAwardAddDto.getCreditCode()
iCommonService.checkDeclaration(bmsBigStrongAwardAddDto.getTyshxydm()
, bmsBigStrongAwardAddDto.getTemplateRecordId());
if (enterpriseId == 0) {
return 0;

@ -76,10 +76,10 @@ public class BmsBrandingAwardServiceImpl extends ServiceImpl<BmsBrandingAwardMap
@Override
@Transactional(rollbackFor = Exception.class)
public int insertBmsBrandingAward(BmsBrandingAwardAddDto bmsBrandingAwardAddDto) {
Long enterpriseId = iCommonService.checkEnterprise(bmsBrandingAwardAddDto.getCreditCode()
Long enterpriseId = iCommonService.checkEnterprise(bmsBrandingAwardAddDto.getTyshxydm()
,bmsBrandingAwardAddDto.getTemplateRecordId());
// check 申报信息
iCommonService.checkDeclaration(bmsBrandingAwardAddDto.getCreditCode()
iCommonService.checkDeclaration(bmsBrandingAwardAddDto.getTyshxydm()
,bmsBrandingAwardAddDto.getTemplateRecordId());
BmsBrandingAward bmsBrandingAward = new BmsBrandingAward();
BeanUtil.copyProperties(bmsBrandingAwardAddDto,bmsBrandingAward);

@ -78,10 +78,10 @@ public class BmsCarrierConstructionAwardServiceImpl extends ServiceImpl<BmsCarri
@Transactional(rollbackFor = Exception.class)
public int insertBmsCarrierConstructionAward(BmsCarrierConstructionAwardAddDto bmsCarrierConstructionAwardAddDto) {
Long enterpriseId = iCommonService.checkEnterprise(bmsCarrierConstructionAwardAddDto.getCreditCode()
Long enterpriseId = iCommonService.checkEnterprise(bmsCarrierConstructionAwardAddDto.getTyshxydm()
,bmsCarrierConstructionAwardAddDto.getTemplateRecordId());
// check 申报信息
iCommonService.checkDeclaration(bmsCarrierConstructionAwardAddDto.getCreditCode()
iCommonService.checkDeclaration(bmsCarrierConstructionAwardAddDto.getTyshxydm()
,bmsCarrierConstructionAwardAddDto.getTemplateRecordId());
BmsCarrierConstructionAward bmsCarrierConstructionAward = new BmsCarrierConstructionAward();
BeanUtil.copyProperties(bmsCarrierConstructionAwardAddDto,bmsCarrierConstructionAward);

@ -77,10 +77,10 @@ public class BmsCreditManagementServiceImpl extends ServiceImpl<BmsCreditManagem
@Override
@Transactional(rollbackFor = Exception.class)
public int insertBmsCreditManagement(BmsCreditManagementAddDto bmsCreditManagementAddDto) {
Long enterpriseId = iCommonService.checkEnterprise(bmsCreditManagementAddDto.getCreditCode()
Long enterpriseId = iCommonService.checkEnterprise(bmsCreditManagementAddDto.getTyshxydm()
,bmsCreditManagementAddDto.getTemplateRecordId());
// check 申报信息
iCommonService.checkDeclaration(bmsCreditManagementAddDto.getCreditCode()
iCommonService.checkDeclaration(bmsCreditManagementAddDto.getTyshxydm()
,bmsCreditManagementAddDto.getTemplateRecordId());
BmsCreditManagement bmsCreditManagement = new BmsCreditManagement();
BeanUtil.copyProperties(bmsCreditManagementAddDto,bmsCreditManagement);

@ -10,6 +10,7 @@ import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.jjh.declaration.entity.*;
import com.ruoyi.jjh.declaration.entity.dto.*;
import com.ruoyi.jjh.ent.entity.JSmartDeclaration;
import com.ruoyi.jjh.declaration.entity.vo.ApprovalDeclarationRecordsQueryVo;
import com.ruoyi.jjh.declaration.entity.vo.BmsDeclarationRecordsQueryVo;
import com.ruoyi.jjh.declaration.entity.vo.BmsMunicipalBureauReviewQueryVo;
@ -144,7 +145,7 @@ public class BmsDeclarationRecordsServiceImpl extends ServiceImpl<BmsDeclaration
iCommonService.getData(declarationTemplateType, detailId, declarationRecordsVo);
//企业基本信息
QueryWrapper<BmsEnterpriseBasicInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("credit_code", creditCode);
queryWrapper.eq("tyshxydm", creditCode);
BmsEnterpriseBasicInfo one = iBmsEnterpriseBasicInfoService.getOne(queryWrapper);
declarationRecordsVo.setBmsEnterpriseBasicInfo(one);
@ -700,4 +701,14 @@ public class BmsDeclarationRecordsServiceImpl extends ServiceImpl<BmsDeclaration
public List<BmsDeclarationRecords> selectET(Long templateId, List<String> list) {
return baseMapper.selectET(templateId,list);
}
/**
*
* @return
*/
@Override
public List<JSmartDeclaration> allNoLimited() {
return baseMapper.allNoLimited();
}
}

@ -75,10 +75,10 @@ public class BmsIndustrialInternetAwardServiceImpl extends ServiceImpl<BmsIndust
@Override
@Transactional(rollbackFor = Exception.class)
public int insertBmsIndustrialInternetAward(BmsIndustrialInternetAwardAddDto bmsIndustrialInternetAwardAddDto) {
Long enterpriseId = iCommonService.checkEnterprise(bmsIndustrialInternetAwardAddDto.getCreditCode()
Long enterpriseId = iCommonService.checkEnterprise(bmsIndustrialInternetAwardAddDto.getTyshxydm()
,bmsIndustrialInternetAwardAddDto.getTemplateRecordId());
// check 申报信息
iCommonService.checkDeclaration(bmsIndustrialInternetAwardAddDto.getCreditCode()
iCommonService.checkDeclaration(bmsIndustrialInternetAwardAddDto.getTyshxydm()
,bmsIndustrialInternetAwardAddDto.getTemplateRecordId());
BmsIndustrialInternetAward bmsIndustrialInternetAward = new BmsIndustrialInternetAward();
BeanUtil.copyProperties(bmsIndustrialInternetAwardAddDto,bmsIndustrialInternetAward);

@ -76,10 +76,10 @@ public class BmsIntegrationIndustriesServiceImpl extends ServiceImpl<BmsIntegrat
@Override
@Transactional(rollbackFor = Exception.class)
public int insertBmsIntegrationIndustries(BmsIntegrationIndustriesAddDto bmsIntegrationIndustriesAddDto) {
Long enterpriseId = iCommonService.checkEnterprise(bmsIntegrationIndustriesAddDto.getCreditCode()
Long enterpriseId = iCommonService.checkEnterprise(bmsIntegrationIndustriesAddDto.getTyshxydm()
,bmsIntegrationIndustriesAddDto.getTemplateRecordId());
// check 申报信息
iCommonService.checkDeclaration(bmsIntegrationIndustriesAddDto.getCreditCode()
iCommonService.checkDeclaration(bmsIntegrationIndustriesAddDto.getTyshxydm()
,bmsIntegrationIndustriesAddDto.getTemplateRecordId());
BmsIntegrationIndustries bmsIntegrationIndustries = new BmsIntegrationIndustries();
BeanUtil.copyProperties(bmsIntegrationIndustriesAddDto,bmsIntegrationIndustries);

@ -79,10 +79,10 @@ public class BmsLogisticsDevelopmentAwardServiceImpl extends ServiceImpl<BmsLogi
@Override
@Transactional(rollbackFor = Exception.class)
public int insertBmsLogisticsDevelopmentAward(BmsLogisticsDevelopmentAwardAddDto bmsLogisticsDevelopmentAwardAddDto) {
Long enterpriseId = iCommonService.checkEnterprise(bmsLogisticsDevelopmentAwardAddDto.getCreditCode()
Long enterpriseId = iCommonService.checkEnterprise(bmsLogisticsDevelopmentAwardAddDto.getTyshxydm()
,bmsLogisticsDevelopmentAwardAddDto.getTemplateRecordId());
// check 申报信息
iCommonService.checkDeclaration(bmsLogisticsDevelopmentAwardAddDto.getCreditCode()
iCommonService.checkDeclaration(bmsLogisticsDevelopmentAwardAddDto.getTyshxydm()
,bmsLogisticsDevelopmentAwardAddDto.getTemplateRecordId());
BmsLogisticsDevelopmentAward bmsLogisticsDevelopmentAward = new BmsLogisticsDevelopmentAward();

@ -75,10 +75,10 @@ public class BmsManufacturingServicesAwardServiceImpl extends ServiceImpl<BmsMan
@Override
@Transactional(rollbackFor = Exception.class)
public int insertBmsManufacturingServicesAward(BmsManufacturingServicesAwardAddDto bmsManufacturingServicesAwardAddDto) {
Long enterpriseId = iCommonService.checkEnterprise(bmsManufacturingServicesAwardAddDto.getCreditCode()
Long enterpriseId = iCommonService.checkEnterprise(bmsManufacturingServicesAwardAddDto.getTyshxydm()
,bmsManufacturingServicesAwardAddDto.getTemplateRecordId());
// check 申报信息
iCommonService.checkDeclaration(bmsManufacturingServicesAwardAddDto.getCreditCode()
iCommonService.checkDeclaration(bmsManufacturingServicesAwardAddDto.getTyshxydm()
,bmsManufacturingServicesAwardAddDto.getTemplateRecordId());
BmsManufacturingServicesAward bmsManufacturingServicesAward = new BmsManufacturingServicesAward();
BeanUtil.copyProperties(bmsManufacturingServicesAwardAddDto,bmsManufacturingServicesAward);

@ -65,10 +65,10 @@ public class BmsOutQuitProductsServiceImpl extends ServiceImpl<BmsOutQuitProduct
*/
@Override
public int insertBmsOutQuitProducts(BmsOutQuitProductsAddDto bmsOutQuitProductsAddDto) {
Long enterpriseId = iCommonService.checkEnterprise(bmsOutQuitProductsAddDto.getCreditCode()
Long enterpriseId = iCommonService.checkEnterprise(bmsOutQuitProductsAddDto.getTyshxydm()
,bmsOutQuitProductsAddDto.getTemplateRecordId());
// check 申报信息
iCommonService.checkDeclaration(bmsOutQuitProductsAddDto.getCreditCode()
iCommonService.checkDeclaration(bmsOutQuitProductsAddDto.getTyshxydm()
,bmsOutQuitProductsAddDto.getTemplateRecordId());
BmsOutQuitProducts products = new BmsOutQuitProducts();

@ -78,10 +78,10 @@ public class BmsPlatformConstructionAwardServiceImpl extends ServiceImpl<BmsPlat
@Override
@Transactional(rollbackFor = Exception.class)
public int insertBmsPlatformConstructionAward(BmsPlatformConstructionAwardAddDto bmsPlatformConstructionAwardAddDto) {
Long enterpriseId = iCommonService.checkEnterprise(bmsPlatformConstructionAwardAddDto.getCreditCode()
Long enterpriseId = iCommonService.checkEnterprise(bmsPlatformConstructionAwardAddDto.getTyshxydm()
,bmsPlatformConstructionAwardAddDto.getTemplateRecordId());
// check 申报信息
iCommonService.checkDeclaration(bmsPlatformConstructionAwardAddDto.getCreditCode()
iCommonService.checkDeclaration(bmsPlatformConstructionAwardAddDto.getTyshxydm()
,bmsPlatformConstructionAwardAddDto.getTemplateRecordId());
BmsPlatformConstructionAward bmsPlatformConstructionAward = new BmsPlatformConstructionAward();
BeanUtil.copyProperties(bmsPlatformConstructionAwardAddDto,bmsPlatformConstructionAward);

@ -90,10 +90,10 @@ public class BmsProjectSettlementAwardServiceImpl extends ServiceImpl<BmsProject
public int insertBmsProjectSettlementAward(BmsProjectSettlementAwardAddDto bmsProjectSettlementAwardAddDto) {
//检测企业信息
Long enterpriseId = iCommonService.checkEnterprise(bmsProjectSettlementAwardAddDto.getCreditCode()
Long enterpriseId = iCommonService.checkEnterprise(bmsProjectSettlementAwardAddDto.getTyshxydm()
, bmsProjectSettlementAwardAddDto.getTemplateRecordId());
// check 申报信息
iCommonService.checkDeclaration(bmsProjectSettlementAwardAddDto.getCreditCode()
iCommonService.checkDeclaration(bmsProjectSettlementAwardAddDto.getTyshxydm()
, bmsProjectSettlementAwardAddDto.getTemplateRecordId());
BmsProjectSettlementAward projectSettlementAward = new BmsProjectSettlementAward();
BeanUtil.copyProperties(bmsProjectSettlementAwardAddDto, projectSettlementAward);

@ -78,10 +78,10 @@ public class BmsSceneOpeningAwardServiceImpl extends ServiceImpl<BmsSceneOpening
@Override
@Transactional(rollbackFor = Exception.class)
public int insertBmsSceneOpeningAward(BmsSceneOpeningAwardAddDto bmsSceneOpeningAwardAddDto) {
Long enterpriseId = iCommonService.checkEnterprise(bmsSceneOpeningAwardAddDto.getCreditCode()
Long enterpriseId = iCommonService.checkEnterprise(bmsSceneOpeningAwardAddDto.getTyshxydm()
,bmsSceneOpeningAwardAddDto.getTemplateRecordId());
// check 申报信息
iCommonService.checkDeclaration(bmsSceneOpeningAwardAddDto.getCreditCode()
iCommonService.checkDeclaration(bmsSceneOpeningAwardAddDto.getTyshxydm()
,bmsSceneOpeningAwardAddDto.getTemplateRecordId());
BmsSceneOpeningAward bmsSceneOpeningAward = new BmsSceneOpeningAward();
BeanUtil.copyProperties(bmsSceneOpeningAwardAddDto,bmsSceneOpeningAward);

@ -3,11 +3,14 @@ package com.ruoyi.jjh.ent.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.jjh.ent.entity.JEnterpriseContact;
import com.ruoyi.jjh.declaration.regular.TimeChange;
import com.ruoyi.jjh.ent.entity.JSmartDeclaration;
import com.ruoyi.jjh.ent.entity.JSmartReminders;
import com.ruoyi.jjh.ent.entity.request.JEnterpriseContactRequest;
import com.ruoyi.jjh.ent.entity.request.JSmartRemindersDq;
import com.ruoyi.jjh.ent.entity.request.JSmartRemindersNDq;
import com.ruoyi.jjh.ent.service.JSmartDeclarationService;
import com.ruoyi.jjh.ent.service.JSmartRemindersService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -15,11 +18,12 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.io.Serializable;
import java.util.Arrays;
/**
* j_smart_reminders
*
* @author du
* @since 2024/7/1 13:33
*/
@ -32,14 +36,109 @@ public class JSmartRemindersController extends BaseController {
private JSmartRemindersService jSmartRemindersService;
/**
*
*
*/
@Resource
private JSmartDeclarationService jSmartDeclarationService;
@Resource
private TimeChange timeChange;
/**
*
*
* @return
*/
@ApiOperation(value = "定时器更新定期提醒数据(暂存)")
@GetMapping("/updateRegularReminders")
public AjaxResult updateRegularReminders() {
timeChange.changeDq();
return success();
}
/**
*
*
* @return
*/
@ApiOperation(value = "定时器更新不定期提醒数据(暂存)")
@GetMapping("/updateNoRegularReminders")
public AjaxResult updateNoRegularReminders() {
timeChange.changeNdq();
return success();
}
/**
*
*
* @return
*/
@PreAuthorize("@ss.hasAnyRoles('ent')")
@ApiOperation(value = "企业端首页智能提醒查询所有数据", response = JSmartDeclaration.class)
@GetMapping("/enterpriseAll")
public AjaxResult enterpriseAll() {
// 获取当前登录用户是否是企业端
boolean admin = false;
String str = null;
try {
admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
str = SecurityUtils.getUsername();
} catch (Exception ignored) {
}
if (admin) {
str = null;
}
return success(jSmartDeclarationService.selectEnterpriseAllList(str));
}
/**
*
*
* @param page
* @return
*/
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@ApiOperation(value = "政务端首页智能提醒查询所有数据", response = JSmartDeclaration.class)
@GetMapping("/chiefAll")
public AjaxResult chiefAll(Long projectId) {
// 获取当前登录用户是否是政务端
boolean admin = false;
Long userId = null;
try {
admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
userId = SecurityUtils.getUserId();
} catch (Exception ignored) {
}
if (admin) {
userId = null;
}
return success(jSmartDeclarationService.chiefAll(userId,projectId));
}
/**
*
*
* @return
*/
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov,ent')")
@ApiOperation(value = "智能提醒已读")
@GetMapping("/changeIsRead")
public AjaxResult changeIsRead(@RequestParam Long id) {
JSmartDeclaration sma = new JSmartDeclaration();
sma.setId(id);
sma.setIsRead(2);
return success(jSmartDeclarationService.updateById(sma));
}
/**
*
*
* @param page
* @param jSmartReminders
* @return
*/
// @PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@ApiOperation(value = "分页查询所有数据", response = JSmartReminders.class)
@ApiOperation(value = "分页查询智能提醒规则数据", response = JSmartReminders.class)
@GetMapping
public AjaxResult selectAll(Page<JSmartReminders> page, JSmartReminders jSmartReminders) {
return success(jSmartRemindersService.page(page, jSmartReminders));
@ -47,44 +146,59 @@ public class JSmartRemindersController extends BaseController {
/**
*
*
*
* @param id
* @return
*/
// @PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@ApiOperation(value = "通过主键查询单条数据", response = JSmartReminders.class)
@ApiOperation(value = "通过主键查询单条智能提醒规则数据", response = JSmartReminders.class)
@GetMapping("{id}")
public AjaxResult selectOne(@PathVariable Serializable id) {
return success(jSmartRemindersService.getById(id));
}
/**
*
*
*
* @param jSmartReminders
* @param jSmartRemindersDq
* @return
*/
// @PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@ApiOperation(value = "新增数据")
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov,ent')")
@ApiOperation(value = "新增定期提醒数据(政务端和企业端)")
@PostMapping
public AjaxResult insert(@RequestBody JSmartReminders jSmartReminders) {
return success(jSmartRemindersService.add(jSmartReminders));
public AjaxResult insertDs(@RequestBody @Valid JSmartRemindersDq jSmartRemindersDq) {
return success(jSmartRemindersService.add(jSmartRemindersDq));
}
/**
*
*
*
* @param jSmartReminders
* @param dq
* @return
*/
// @PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@ApiOperation(value = "修改数据")
@PutMapping
public AjaxResult update(@RequestBody JSmartReminders jSmartReminders) {
return success(jSmartRemindersService.updateById(jSmartReminders));
@ApiOperation(value = "修改定期提醒数据")
@PutMapping("/updateDq")
public AjaxResult updateDq(@RequestBody @Valid JSmartRemindersDq dq) {
return success(jSmartRemindersService.updateDq(dq));
}
/**
*
*
* @param ndq
* @return
*/
// @PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@ApiOperation(value = "修改不定期提醒数据")
@PutMapping("/updateNdq")
public AjaxResult updateNdq(@RequestBody @Valid JSmartRemindersNDq ndq) {
return success(jSmartRemindersService.updateNdq(ndq));
}
/**
*
*
@ -95,6 +209,10 @@ public class JSmartRemindersController extends BaseController {
@ApiOperation(value = "删除数据")
@DeleteMapping
public AjaxResult delete(@RequestParam("id") Long id) {
JSmartReminders js = jSmartRemindersService.getById(id);
if (js.getAlertManner() == 2) {
throw new ServiceException("不定期提醒不允许删除");
}
return success(jSmartRemindersService.removeById(id));
}
}

@ -0,0 +1,91 @@
package com.ruoyi.jjh.ent.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
*
* @author du
* @since 2024/7/1 19:29
*/
@Data
@ApiModel("首页智能提醒数据返回体")
public class HomeRequestSmart {
/**
* id
*/
@ApiModelProperty("id")
private Long id;
/**
* id
*/
@ApiModelProperty("申报记录id")
private Long declarationId;
/**
*
*/
@ApiModelProperty("申报记录名称")
private String declarationName;
/**
*
*/
@ApiModelProperty("是否已读 1未读 2已读")
private Integer isRead;
/**
*
*/
@ApiModelProperty("统一社会信用代码")
private String tyshxydm;
/**
* 1. 2
*/
@ApiModelProperty("提醒对象 1.企业用户 2政务用户")
private Integer alertRecipients;
/**
* 1. 2.
*/
@ApiModelProperty("提醒方式 1.定期提醒 2.不定期提醒")
private Integer alertManner;
/**
*
*/
@ApiModelProperty("提醒时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime alertTime;
/**
*
*/
@ApiModelProperty("提前天数提醒")
private Integer daysAdvance;
/**
*
*/
@ApiModelProperty("提醒内容")
private String alertContent;
/**
* ID
*/
@ApiModelProperty("项目ID")
private String projectId;
}

@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.Date;
/**
@ -84,6 +85,14 @@ public class JProject{
@ApiModelProperty("状态")
private Integer status;
/**
*
*/
@ApiModelProperty("项目结束时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime projectEndTime;
/**
* ID
*/

@ -0,0 +1,92 @@
package com.ruoyi.jjh.ent.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
*
* @author du
* @since 2024/7/1 19:29
*/
@Data
@ApiModel("企业端首页智能提醒返回体")
public class JSmartDeclaration {
/**
* Id
*/
@TableId(value = "id", type = IdType.AUTO)
@ApiModelProperty("Id")
private Long id;
/**
* id
*/
@ApiModelProperty("申报记录id")
private Long declarationId;
/**
* id
*/
@ApiModelProperty("智能提醒id")
private Long smartRemindersId;
/**
* 线
*/
@ApiModelProperty("在线模板开始时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime startTime;
/**
* 线
*/
@ApiModelProperty("在线模板结束时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime;
/**
*
*/
@ApiModelProperty("提醒时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime alertTime;
/**
*
*/
@ApiModelProperty("是否已读 1未读 2已读")
private Integer isRead;
/**
*
*/
@ApiModelProperty("统一社会信用代码")
private String tyshxydm;
/**
* ID
*/
@ApiModelProperty("项目ID")
private Long projectId;
/**
* id
*/
@ApiModelProperty("政务用户id")
private Long zwId;
}

@ -8,7 +8,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
/**
@ -31,21 +30,18 @@ public class JSmartReminders extends BaseInfoEntity {
/**
*
*/
@NotNull
@ApiModelProperty("规则名称")
private String rulesName;
/**
* 1. 2
*/
@NotNull
@ApiModelProperty("提醒对象 1.企业用户 2政务用户")
private Integer alertRecipients;
/**
* 1. 2.
*/
@NotNull
@ApiModelProperty("提醒方式 1.定期提醒 2.不定期提醒")
private Integer alertManner;
@ -69,6 +65,13 @@ public class JSmartReminders extends BaseInfoEntity {
@ApiModelProperty("提前天数提醒")
private Integer daysAdvance;
/**
* id
*/
@ApiModelProperty("项目id")
private Long projectId;
/**
*
*/

@ -0,0 +1,73 @@
package com.ruoyi.jjh.ent.entity.request;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
/**
*
* @author du
* @since 2024/7/1 15:56
*/
@Data
@ApiModel("定期提醒")
public class JSmartRemindersDq {
/**
* Id
*/
@ApiModelProperty("Id")
private Long id;
/**
*
*/
@NotBlank
@ApiModelProperty("规则名称")
private String rulesName;
/**
* 1. 2
*/
@NotNull
@ApiModelProperty("提醒对象 1.企业用户 2政务用户")
private Integer alertRecipients;
/**
* 1. 2.
*/
@NotNull
@ApiModelProperty("提醒方式 1.定期提醒 2.不定期提醒")
private Integer alertManner;
/**
* yyyy-MM-dd HH:mm:ss
*/
@NotNull
@ApiModelProperty("提醒时间 yyyy-MM-dd HH:mm:ss")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime alertTime;
/**
*
*/
@NotBlank
@ApiModelProperty("提醒内容")
private String alertContent;
/**
* id
*/
@ApiModelProperty("项目id 非必传")
private String projectId;
}

@ -0,0 +1,69 @@
package com.ruoyi.jjh.ent.entity.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
/**
*
* @author du
* @since 2024/7/1 15:56
*/
@Data
@ApiModel("不定期提醒")
public class JSmartRemindersNDq {
/**
* Id
*/
@ApiModelProperty("Id")
private Long id;
/**
*
*/
@NotBlank
@ApiModelProperty("规则名称")
private String rulesName;
/**
* 1. 2
*/
@NotNull
@ApiModelProperty("提醒对象 1.企业用户 2政务用户")
private Integer alertRecipients;
/**
* 1. 2.
*/
@NotNull
@ApiModelProperty("提醒方式 1.定期提醒 2.不定期提醒")
private Integer alertManner;
/**
* 1.() 2()
*/
@NotNull
@ApiModelProperty("提醒分类 1.申报任务即将结束(企业) 2项目即将建设完成(政务)")
private Integer alertType;
/**
*
*/
@NotNull
@ApiModelProperty("提前天数提醒")
private Integer daysAdvance;
/**
*
*/
@NotBlank
@ApiModelProperty("提醒内容")
private String alertContent;
}

@ -0,0 +1,32 @@
package com.ruoyi.jjh.ent.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.jjh.ent.entity.HomeRequestSmart;
import com.ruoyi.jjh.ent.entity.JSmartDeclaration;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* j_smart_declaration访
*
* @author makejava
* @since 2024-03-25 11:49:34
*/
public interface JSmartDeclarationMapper extends BaseMapper<JSmartDeclaration> {
/**
*
*
* @return
*/
List<HomeRequestSmart> selectEnterpriseAllList(@Param("userName") String userName);
/**
*
*
* @return
*/
List<HomeRequestSmart> chiefAll(@Param("userId") Long userId,@Param("projectId") Long projectId);
}

@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.jjh.ent.entity.JSmartReminders;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* j_smart_reminders访
*
@ -21,5 +23,7 @@ public interface JSmartRemindersMapper extends BaseMapper<JSmartReminders> {
* @return
*/
Page<JSmartReminders> page(Page<JSmartReminders> page, @Param("req") JSmartReminders jSmartReminders);
List<JSmartReminders> selectWorkAll();
}

@ -0,0 +1,32 @@
package com.ruoyi.jjh.ent.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.jjh.ent.entity.HomeRequestSmart;
import com.ruoyi.jjh.ent.entity.JSmartDeclaration;
import java.util.List;
/**
* j_smart_declaration
* @author du
* @since 2024/7/1 13:33
*/
public interface JSmartDeclarationService extends IService<JSmartDeclaration> {
/**
*
*
* @return
*/
List<HomeRequestSmart> selectEnterpriseAllList(String userName);
/**
*
*
* @return
*/
List<HomeRequestSmart> chiefAll(Long userId,Long projectId);
}

@ -3,6 +3,8 @@ package com.ruoyi.jjh.ent.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.jjh.ent.entity.JSmartReminders;
import com.ruoyi.jjh.ent.entity.request.JSmartRemindersDq;
import com.ruoyi.jjh.ent.entity.request.JSmartRemindersNDq;
/**
@ -21,11 +23,35 @@ public interface JSmartRemindersService extends IService<JSmartReminders> {
Page<JSmartReminders> page(Page<JSmartReminders> page, JSmartReminders jSmartReminders);
/**
*
*
*
* @param jSmartReminders
* @param jSmartRemindersDq
* @return
*/
int add(JSmartReminders jSmartReminders);
Long add(JSmartRemindersDq jSmartRemindersDq);
/**
*
*
* @param dq
* @return
*/
Long updateDq(JSmartRemindersDq dq);
/**
*
*
* @param ndq
* @return
*/
Long updateNdq(JSmartRemindersNDq ndq);
// /**
// * 企业端首页智能提醒查询所有数据
// *
// * @return 所有数据
// */
// List<SmartGetDeclaration> selectWorkAll();
}

@ -0,0 +1,41 @@
package com.ruoyi.jjh.ent.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.jjh.ent.entity.HomeRequestSmart;
import com.ruoyi.jjh.ent.entity.JSmartDeclaration;
import com.ruoyi.jjh.ent.mapper.JSmartDeclarationMapper;
import com.ruoyi.jjh.ent.service.JSmartDeclarationService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* j_smart_declaration
*
* @author du
* @since 2024/7/1 13:33
*/
@Service
public class JSmartDeclarationServiceImpl extends ServiceImpl<JSmartDeclarationMapper, JSmartDeclaration> implements JSmartDeclarationService {
/**
*
*
* @return
*/
@Override
public List<HomeRequestSmart> selectEnterpriseAllList(String userName) {
return baseMapper.selectEnterpriseAllList(userName);
}
/**
*
*
* @return
*/
@Override
public List<HomeRequestSmart> chiefAll(Long userId,Long projectId) {
return baseMapper.chiefAll(userId,projectId);
}
}

@ -1,16 +1,19 @@
package com.ruoyi.jjh.ent.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.jjh.declaration.entity.BmsFundingDetail;
import com.ruoyi.jjh.declaration.service.IBmsDeclarationRecordsService;
import com.ruoyi.jjh.ent.entity.JSmartReminders;
import com.ruoyi.jjh.ent.entity.request.JSmartRemindersDq;
import com.ruoyi.jjh.ent.entity.request.JSmartRemindersNDq;
import com.ruoyi.jjh.ent.mapper.JSmartRemindersMapper;
import com.ruoyi.jjh.ent.service.JSmartRemindersService;
import org.springframework.stereotype.Service;
import java.util.List;
import javax.annotation.Resource;
import java.time.LocalDate;
/**
* j_smart_reminders
@ -21,6 +24,10 @@ import java.util.List;
@Service
public class JSmartRemindersServiceImpl extends ServiceImpl<JSmartRemindersMapper, JSmartReminders> implements JSmartRemindersService {
@Resource
private IBmsDeclarationRecordsService bmsDeclarationRecordsService;
/**
*
*
@ -34,26 +41,102 @@ public class JSmartRemindersServiceImpl extends ServiceImpl<JSmartRemindersMappe
}
/**
*
*
*
* @param jSmartReminders
* @param jSmartRemindersDq
* @return
*/
@Override
public int add(JSmartReminders jSmartReminders) {
public Long add(JSmartRemindersDq jSmartRemindersDq) {
JSmartReminders jSmartReminders = new JSmartReminders();
BeanUtil.copyProperties(jSmartRemindersDq, jSmartReminders);
if (LocalDate.now().isAfter(jSmartReminders.getAlertTime().toLocalDate())
||LocalDate.now().equals(jSmartReminders.getAlertTime().toLocalDate())) {
throw new ServiceException("提醒时间需设置为今天之后!");
}
if (jSmartReminders.getAlertManner() == 2) {
List<JSmartReminders> list = lambdaQuery().eq(JSmartReminders::getAlertManner, 2).list();
if (list.size() >= 2) {
throw new ServiceException("已有不定期提醒,不可新增!");
}
if ((jSmartReminders.getAlertRecipients() == 1 && jSmartReminders.getAlertType() == 1)
|| (jSmartReminders.getAlertRecipients() == 2 && jSmartReminders.getAlertType() == 2)) {
save(jSmartReminders);
} else {
throw new ServiceException("参数请求错误");
}
throw new ServiceException("不可新增不定期提醒!");
}
return 0;
save(jSmartReminders);
return jSmartRemindersDq.getId();
}
/**
*
*
* @param jSmartRemindersDq
* @return
*/
@Override
public Long updateDq(JSmartRemindersDq jSmartRemindersDq) {
JSmartReminders jSmartReminders = new JSmartReminders();
BeanUtil.copyProperties(jSmartRemindersDq, jSmartReminders);
if (LocalDate.now().isAfter(jSmartReminders.getAlertTime().toLocalDate())
||LocalDate.now().equals(jSmartReminders.getAlertTime().toLocalDate())) {
throw new ServiceException("提醒时间需设置为今天之后!");
}
if (jSmartReminders.getAlertManner() == 2) {
throw new ServiceException("参数错误");
}
updateById(jSmartReminders);
return jSmartRemindersDq.getId();
}
/**
*
*
* @param ndq
* @return
*/
@Override
public Long updateNdq(JSmartRemindersNDq ndq) {
JSmartReminders jSmartReminders = new JSmartReminders();
BeanUtil.copyProperties(ndq, jSmartReminders);
if (jSmartReminders.getAlertManner() == 1) {
throw new ServiceException("参数错误");
}
updateById(jSmartReminders);
return ndq.getId();
}
// /**
// * 企业端首页智能提醒查询所有数据
// *
// * @return 所有数据
// */
// @Override
// public List<SmartGetDeclaration> selectWorkAll() {
//获取企业的不定时提醒
// 企业端
// JSmartReminders qy = getById(1);
// String userName = null;
// try {
// userName = SecurityUtils.getUsername();
// } catch (Exception ignored) {
// }
//查询当前企业申报记录,对应的申报模板不是长期有效并且申报记录未填的,
// List<SmartGetDeclaration> bmsDeclarationRecords = bmsDeclarationRecordsService.allNoLimited(userName);
// //如果当前时间在该申报模板的结束时间前自定义的提前天数之前,就去掉
// bmsDeclarationRecords.removeIf(x -> LocalDateTime.now().isBefore(x.getEndTime().minusDays(qy.getDaysAdvance())));
// bmsDeclarationRecords.forEach(y->{
// y.setDaysAdvance(qy.getDaysAdvance());
// y.setAlertTime(y.getEndTime().minusDays(qy.getDaysAdvance()));
// y.setAlertContent(qy.getAlertContent());
// });
// //获取企业的定时提醒
// List<JSmartReminders> list = lambdaQuery().eq(JSmartReminders::getAlertRecipients, 1).eq(JSmartReminders::getAlertManner, 1).list();
// list.forEach(x->{
// if(LocalDateTime.now().isAfter(x.getAlertTime())){
// SmartGetDeclaration sd = new SmartGetDeclaration();
// sd.setAlertContent(x.getAlertContent());
// sd.setAlertTime(x.getAlertTime());
// bmsDeclarationRecords.add(sd);
// }
// });
// bmsDeclarationRecords.sort(Comparator.comparing(entity -> Math.abs(ChronoUnit.MINUTES.between(LocalDateTime.now(), entity.getAlertTime()))));
// return bmsDeclarationRecords;
// return null;
// }
}

@ -63,5 +63,6 @@ spring:
multi-statement-allow: true
#自己客户端地址
returnUrl: http://39.101.188.84:9999/demo/JinJiHu
#returnUrl: http://192.168.0.114:80
#定时任务更新企业信息和联系人的开启
isTiming: false

@ -295,6 +295,16 @@
</if>
</where>
</select>
<select id="allNoLimited" resultType="com.ruoyi.jjh.ent.entity.JSmartDeclaration">
select a.id as declarationId,
f.start_time as startTime,
f.end_time as endTime,
a.credit_code as tyshxydm
from bms_declaration_records a
left join bms_template_record f on a.template_record_id = f.id
where f.status != 3 and a.status = 0
</select>
<insert id="insertBmsDeclarationRecords" parameterType="com.ruoyi.jjh.declaration.entity.BmsDeclarationRecords"
useGeneratedKeys="true" keyProperty="id">

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.jjh.ent.mapper.JSmartDeclarationMapper">
<select id="selectEnterpriseAllList" resultType="com.ruoyi.jjh.ent.entity.HomeRequestSmart">
SELECT
a.id as id,
b.id as declarationId,
b.project_name as declarationName,
a.is_read as isRead,
a.tyshxydm as tyshxydm,
c.alert_recipients as alertRecipients,
c.alert_Manner as alertManner,
a.alert_time as alertTime,
c.days_advance as daysAdvance,
c.alert_content as alertContent,
a.project_id as projectId
FROM
j_smart_declaration AS a
LEFT JOIN bms_declaration_records AS b ON a.declaration_id = b.id
LEFT JOIN j_smart_reminders AS c ON a.smart_reminders_id = c.id
<where>
c.alert_recipients = 1
<if test="userName != null and userName != '' ">
and a.tyshxydm = #{userName}
</if>
and a.alert_time &lt; NOW()
</where>
order by a.alert_time desc;
</select>
<select id="chiefAll" resultType="com.ruoyi.jjh.ent.entity.HomeRequestSmart">
SELECT
a.id as id,
b.project_name as declarationName,
a.is_read as isRead,
a.tyshxydm as tyshxydm,
c.alert_recipients as alertRecipients,
c.alert_Manner as alertManner,
a.alert_time as alertTime,
c.days_advance as daysAdvance,
c.alert_content as alertContent,
a.project_id as projectId
FROM
j_smart_declaration AS a
LEFT JOIN j_project AS b ON a.project_id = b.id
LEFT JOIN j_smart_reminders AS c ON a.smart_reminders_id = c.id
<where>
c.alert_recipients = 2
<if test="projectId != null and projectId != '' ">
and a.project_id = #{projectId}
</if>
<if test="userId != null and userId != '' ">
and a.zw_id = #{userId}
</if>
and a.alert_time &lt; NOW()
</where>
order by a.alert_time desc;
</select>
</mapper>

@ -14,4 +14,7 @@
</where>
order by create_time desc
</select>
<select id="selectWorkAll" resultType="com.ruoyi.jjh.ent.entity.JSmartReminders">
</select>
</mapper>

@ -118,7 +118,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// .antMatchers("/common/**").permitAll()
.antMatchers("/system/chief").permitAll()
.antMatchers("/system/singlelogin/**").permitAll()
.antMatchers("/jjh/**").permitAll()
// .antMatchers("/jjh/**").permitAll()

@ -105,6 +105,9 @@
<if test="status != null and status != ''">
AND u.status = #{status}
</if>
<if test="userType != null and userType != ''">
AND u.user_type = #{userType}
</if>
<if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>

Loading…
Cancel
Save