正式端发送短信及大屏接口

wushunjie
杜函宇 9 months ago
parent 5eb3646c9c
commit a10c439860

@ -0,0 +1,133 @@
package com.ruoyi.jjh.declaration.component;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.jjh.declaration.service.IBmsEnterpriseBasicInfoService;
import com.ruoyi.jjh.ent.entity.JEnterpriseContact;
import com.ruoyi.jjh.ent.entity.JSmartDeclaration;
import com.ruoyi.jjh.ent.service.JEnterpriseContactService;
import com.ruoyi.jjh.ent.service.JSmartDeclarationService;
import com.ruoyi.jjh.ent.service.SmsAlertsService;
import com.ruoyi.system.mapper.SysUserMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
*
*
* @author du
* @since 2024/7/18 9:55
*/
@Component("TimingRemind")
public class TimingRemindImpl implements TimingRemindService{
private static final Logger log = LoggerFactory.getLogger(TimingRemindImpl.class);
/**
*
*/
@Resource
private JSmartDeclarationService jSmartDeclarationService;
/**
*
*/
@Autowired
private IBmsEnterpriseBasicInfoService bmsEnterpriseBasicInfoService;
/**
*
*/
@Resource
private JEnterpriseContactService jEnterpriseContactService;
/**
*
*/
@Value("${isTiming}")
private Boolean isTiming;
/**
*
*/
@Resource
private SmsAlertsService smsAlertsService;
/**
*
*/
@Resource
private SysUserMapper sysUserMapper;
/**
*
*/
public void enterpriseTiming(String t, Long id) {
List<JSmartDeclaration> listAdd = new ArrayList<>();
//给所有的企业都要添加一条智能提醒数据
//要给每个企业端对应的所有常用联系人发短信
bmsEnterpriseBasicInfoService.list().forEach(x -> {
JSmartDeclaration sd = new JSmartDeclaration();
sd.setAlertTime(LocalDateTime.parse(t));
sd.setIsRead(1);
sd.setSmartRemindersId(id);
sd.setTyshxydm(x.getTyshxydm());
listAdd.add(sd);
getContact( x.getTyshxydm(), "您有1个全局自定义通知,请前往系统首页查看");
});
jSmartDeclarationService.saveBatch(listAdd);
}
/**
*
*/
public void getContact(String code, String s) {
if (isTiming) {
List<JEnterpriseContact> list1 = jEnterpriseContactService.lambdaQuery().eq(JEnterpriseContact::getEnterpriseCode, code).list();
list1.forEach(y -> {
//先添加工单再发送短信
//可在导入或者新增的时候将该常用联系人的手机号添加进工单
smsAlertsService.enterSms(y.getEnterpriseName(), s, y.getContactPhone());
log.info(y.getEnterpriseName() + "发送短信成功!");
});
}
}
/**
*
*/
public void chiefTiming(String t, Long id, String pid) {
List<JSmartDeclaration> listAdd = new ArrayList<>();
//给所有政务人员发通知和短信
//添加用户进表的时候手机号已经经过处理
SysUser user = new SysUser();
user.setUserType("02");
sysUserMapper.selectUserList(user).forEach(x -> {
JSmartDeclaration sd = new JSmartDeclaration();
sd.setIsRead(1);
sd.setAlertTime(LocalDateTime.parse(t));
sd.setSmartRemindersId(id);
if ("null".equals(pid)) {
sd.setProjectId(null);
} else {
sd.setProjectId(Long.valueOf(pid));
}
sd.setZwId(x.getUserId());
if (isTiming) {
if (sd.getProjectId() != null & !x.getPhonenumber().isEmpty()) {
smsAlertsService.enterSms("政府人员-" + x.getNickName(), "您有1个项目自定义通知,请前往工作台查看", x.getPhonenumber());
}
if (!x.getPhonenumber().isEmpty() & sd.getProjectId() == null) {
smsAlertsService.enterSms("政府人员-" + x.getNickName(), "您有1个全局自定义通知,请前往工作台查看", x.getPhonenumber());
}
}
listAdd.add(sd);
});
jSmartDeclarationService.saveBatch(listAdd);
}
}

@ -0,0 +1,24 @@
package com.ruoyi.jjh.declaration.component;
/**
*
* @author du
* @since 2024/7/19 9:50
*/
public interface TimingRemindService {
/**
*
*/
void enterpriseTiming(String t, Long id);
/**
*
*/
void getContact(String code, String s);
/**
*
*/
void chiefTiming(String t, Long id, String pid);
}

@ -100,7 +100,7 @@ public class BmsTemplateRecordController extends BaseController {
* 线
*/
@ApiOperation(value = "新增在线模板")
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov')")
@Log(title = "在线模板", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BmsTemplateRecordAddDto bmsTemplateRecordAddDto) {

@ -45,6 +45,10 @@ public class BmsDeclarationRecordsQueryVo implements Serializable {
@Excel(name = "申报单位")
private String enterpriseName;
@ApiModelProperty(value = "项目小类")
@Excel(name = "项目小类")
private Integer projectSmallType;
@ApiModelProperty(value = "级别 0:本级,1:省级")
@Excel(name = "级别", readConverterExp = "0=本级,1=省级")
private Long level;

@ -0,0 +1,75 @@
package com.ruoyi.jjh.declaration.regular;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.jjh.declaration.entity.BmsDeclarationRecords;
import com.ruoyi.jjh.declaration.service.IBmsDeclarationRecordsService;
import com.ruoyi.jjh.ent.service.SmsAlertsService;
import com.ruoyi.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import javax.annotation.Resource;
import java.util.List;
/**
*
* @author du
* @since 2024/7/17 10:30
*/
@Configuration
@EnableScheduling
public class SmsEnterChange {
@Resource
private SysUserMapper sysUserMapper;
@Resource
private IBmsDeclarationRecordsService iBmsDeclarationRecordsService;
@Resource
private SmsAlertsService smsAlertsService;
@Value("${isTiming}")
private Boolean isTiming;
// 每三小时执行一次
@Scheduled(cron = "0 0 */3 * * *")
private void runTask() {
if(isTiming){
//查询初审的所有用户
SysUser user = new SysUser();
user.setDeptId(105L);
Long count = iBmsDeclarationRecordsService.lambdaQuery().eq(BmsDeclarationRecords::getStatus, 1).count();
if(count>0){
List<SysUser> list1 = sysUserMapper.selectUserList(user);
list1.removeIf(x-> x.getPhonenumber().isEmpty());
for (SysUser items : list1) {
smsAlertsService.enterSms("政府人员-"+items.getNickName(),"您有"+count+"个新的申报审核任务[待初审]",items.getPhonenumber());
}
}
//查询复审的所有用户
SysUser user1 = new SysUser();
user.setDeptId(101L);
Long count1 = iBmsDeclarationRecordsService.lambdaQuery().eq(BmsDeclarationRecords::getStatus, 2).count();
if(count1>0){
List<SysUser> list2 = sysUserMapper.selectUserList(user1);
list2.removeIf(x-> x.getPhonenumber().isEmpty());
for (SysUser items : list2) {
smsAlertsService.enterSms("政府人员-"+items.getNickName(),"您有"+count1+"个新的申报审核任务[待复审]",items.getPhonenumber());
}
}
//查询终审的所有用户
SysUser user2 = new SysUser();
user.setDeptId(103L);
Long count2 = iBmsDeclarationRecordsService.lambdaQuery().eq(BmsDeclarationRecords::getStatus, 3).count();
if(count2>0){
List<SysUser> list3 = sysUserMapper.selectUserList(user2);
list3.removeIf(x-> x.getPhonenumber().isEmpty());
for (SysUser items : list3) {
smsAlertsService.enterSms("政府人员-"+items.getNickName(),"您有"+count2+"个新的申报审核任务[待终审]",items.getPhonenumber());
}
}
}
}
}

@ -1,13 +1,12 @@
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.component.TimingRemindService;
import com.ruoyi.jjh.declaration.entity.BmsEnterpriseBasicInfo;
import com.ruoyi.jjh.declaration.entity.BmsTemplateInfo;
import com.ruoyi.jjh.declaration.entity.BmsTemplateRecord;
@ -19,10 +18,8 @@ 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.jjh.ent.service.*;
import com.ruoyi.quartz.service.ISysJobService;
import com.ruoyi.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -32,13 +29,12 @@ 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;
/**
*
*
*
* @author du
* @since 2024/5/20 10:59
@ -53,6 +49,8 @@ public class TimeChange {
@Value("${isTiming}")
private Boolean isTiming;
@Autowired
private ISysJobService jobService;
/**
*
*/
@ -95,6 +93,11 @@ public class TimeChange {
@Resource
private IBmsDeclarationRecordsService bmsDeclarationRecordsService;
/**
*
*/
@Resource
private SmsAlertsService smsAlertsService;
/**
*
@ -102,6 +105,9 @@ public class TimeChange {
@Resource
private SysUserMapper sysUserMapper;
@Resource
private TimingRemindService timingRemindImpl;
/**
*
*/
@ -234,42 +240,6 @@ 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);
}
/**
*
@ -291,6 +261,12 @@ public class TimeChange {
y.setSmartRemindersId(1L);
y.setIsRead(1);
y.setAlertTime(y.getEndTime().minusDays(qy.getDaysAdvance()));
if(y.getTyshxydm()!=null){
if(isTiming){
//发送短信
timingRemindImpl.getContact(y.getTyshxydm(),"您有1个申报任务即将结束,请前往系统首页查看");
}
}
});
//可以优化
@ -309,6 +285,9 @@ public class TimeChange {
y.setProjectId(x.getId());
y.setZwId(o.getUserId());
bmsDeclarationRecords.add(y);
if(isTiming){
smsAlertsService.enterSms("政府人员-" + o.getNickName(), "您有1个项目即将建设完成,请前往工作台查看。", o.getPhonenumber());
}
});
});
jSmartDeclarationService.saveBatch(bmsDeclarationRecords);

@ -8,9 +8,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.context.SecurityContextHolder;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.jjh.declaration.component.TimingRemindService;
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;
@ -18,6 +18,7 @@ import com.ruoyi.jjh.declaration.entity.vo.DeclarationRecordsVo;
import com.ruoyi.jjh.declaration.mapper.BmsDeclarationRecordsMapper;
import com.ruoyi.jjh.declaration.service.*;
import com.ruoyi.jjh.ent.entity.JProject;
import com.ruoyi.jjh.ent.entity.JSmartDeclaration;
import com.ruoyi.jjh.ent.service.JProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -25,7 +26,10 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -123,6 +127,12 @@ public class BmsDeclarationRecordsServiceImpl extends ServiceImpl<BmsDeclaration
@Value("${ruoyi.profile}")
private String fileAddress;
/**
*
*/
@Resource
private TimingRemindService timingRemindImpl;
/**
* 线
*
@ -291,6 +301,7 @@ public class BmsDeclarationRecordsServiceImpl extends ServiceImpl<BmsDeclaration
public int approval(BmsApprovalInfoUpdateDto bmsApprovalInfoUpdateDto, BmsProcessInfo bmsProcessInfo) {
BmsDeclarationRecords bmsDeclarationRecords = baseMapper.selectById(bmsApprovalInfoUpdateDto.getDeclarationRecordsId());
BmsEnterpriseBasicInfo one = iBmsEnterpriseBasicInfoService.lambdaQuery().eq(BmsEnterpriseBasicInfo::getTyshxydm,bmsDeclarationRecords.getCreditCode()).one();
JProject jp = new JProject();
jp.setId(bmsDeclarationRecords.getJjhProjectId());
if (bmsProcessInfo.getApprovalLevel().equals(0)) {
@ -301,10 +312,12 @@ public class BmsDeclarationRecordsServiceImpl extends ServiceImpl<BmsDeclaration
if(bmsApprovalInfoUpdateDto.getApprovalStatus() == 2){
jp.setStatus(8);
bmsDeclarationRecords.setStatus(8L);
timingRemindImpl.getContact(one.getTyshxydm(),"您有1个申报任务[初审不通过]");
}
if(bmsApprovalInfoUpdateDto.getApprovalStatus() == 3){
jp.setStatus(10);
bmsDeclarationRecords.setStatus(10L);
timingRemindImpl.getContact(one.getTyshxydm(),"您有1个申报任务[初审退回],待重新填报");
}
} else if (bmsProcessInfo.getApprovalLevel().equals(1)) {
if (bmsApprovalInfoUpdateDto.getApprovalStatus() == 1) {
@ -313,6 +326,7 @@ public class BmsDeclarationRecordsServiceImpl extends ServiceImpl<BmsDeclaration
} else {
jp.setStatus(7);
bmsDeclarationRecords.setStatus(7L);
timingRemindImpl.getContact(one.getTyshxydm(),"您有1个申报任务[复审不通过]");
}
} else if (bmsProcessInfo.getApprovalLevel().equals(2)) {
// if (bmsApprovalInfoUpdateDto.getApprovalStatus() == 1) {
@ -325,9 +339,11 @@ public class BmsDeclarationRecordsServiceImpl extends ServiceImpl<BmsDeclaration
if (bmsApprovalInfoUpdateDto.getApprovalStatus() == 1) {
jp.setStatus(5);
bmsDeclarationRecords.setStatus(5L);
timingRemindImpl.getContact(one.getTyshxydm(),"您有1个申报任务[终审通过]");
} else {
jp.setStatus(9);
bmsDeclarationRecords.setStatus(9L);
timingRemindImpl.getContact(one.getTyshxydm(),"您有1个申报任务[终审不通过]");
}
}
// else if (bmsProcessInfo.getApprovalLevel().equals(3)) {

@ -3,10 +3,11 @@ package com.ruoyi.jjh.declaration.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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.component.TimingRemindImpl;
import com.ruoyi.jjh.declaration.component.TimingRemindService;
import com.ruoyi.jjh.declaration.entity.BmsDeclarationRecords;
import com.ruoyi.jjh.declaration.entity.BmsEnterpriseBasicInfo;
import com.ruoyi.jjh.declaration.entity.BmsEnterpriseDirectory;
@ -17,7 +18,6 @@ import com.ruoyi.jjh.declaration.entity.dto.BmsTemplateRecordQueryDto;
import com.ruoyi.jjh.declaration.entity.dto.BmsTemplateRecordUpdateDto;
import com.ruoyi.jjh.declaration.entity.vo.BmsTemplateRecordQueryVo;
import com.ruoyi.jjh.declaration.entity.vo.BmsTemplateRecordVo;
import com.ruoyi.jjh.declaration.mapper.BmsDeclarationRecordsMapper;
import com.ruoyi.jjh.declaration.mapper.BmsTemplateRecordMapper;
import com.ruoyi.jjh.declaration.regular.TimeChange;
import com.ruoyi.jjh.declaration.service.IBmsDeclarationRecordsService;
@ -25,15 +25,14 @@ import com.ruoyi.jjh.declaration.service.IBmsEnterpriseBasicInfoService;
import com.ruoyi.jjh.declaration.service.IBmsEnterpriseDirectoryService;
import com.ruoyi.jjh.declaration.service.IBmsTemplateRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.Year;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 线Service
@ -49,8 +48,21 @@ public class BmsTemplateRecordServiceImpl extends ServiceImpl<BmsTemplateRecordM
@Autowired
private IBmsEnterpriseBasicInfoService iBmsEnterpriseBasicInfoService;
@Resource
private TimingRemindService timingRemindImpl;
@Resource
private IBmsDeclarationRecordsService bmsDeclarationRecordsService;
@Resource
private IBmsEnterpriseDirectoryService iBmsEnterpriseDirectoryService;
/**
*
*/
@Value("${isTiming}")
private Boolean isTiming;
@Autowired
private IBmsDeclarationRecordsService iBmsDeclarationRecordsService;
@Resource
@ -157,25 +169,17 @@ public class BmsTemplateRecordServiceImpl extends ServiceImpl<BmsTemplateRecordM
enterpriseDirectoryService.saveBatch(copyList);
}
iBmsDeclarationRecordsService.saveBatch(drlist);
//给刚刚添加进企业名录的所有企业的联系人发短信
//获取每个企业对应的常用联系人
if(isTiming){
List<BmsEnterpriseDirectory> list = enterpriseDirectoryService.lambdaQuery().eq(BmsEnterpriseDirectory::getTemplateRecordId, bmsTemplateRecordAddDto.getId()).list();
for (BmsEnterpriseDirectory x : list) {
timingRemindImpl.getContact(x.getCreditCode(),"您有1个新的申报任务[待填报]");
}
}
return num;
}
// /**
// * 假如给该企业已经加了申报任务指定申报模板,就不能再给这个企业加该申报模板的申报任务(所有的企业)
// *
// * @param list
// */
// private void judgement(List<BmsDeclarationRecords> bm, List<BmsEnterpriseDirectory> list) {
// List<String> str1 = new ArrayList<>();
// bm.forEach(x -> {
// list.forEach(y -> {
// if (Objects.equals(x.getEnterpriseId(), y.getId())) {
// str1.add(y.getEnterpriseName());
// }
// });
// });
// throw new ServiceException(StringUtils.join(str1, ",") + "已经分配该模板任务");
// }
private void getDeclarationRecordsList(BmsTemplateRecord bmsTemplateRecordAddDto, List<BmsDeclarationRecords> drlist, String creditCode, Long items) {
BmsDeclarationRecords drItems = new BmsDeclarationRecords();

@ -12,7 +12,9 @@ import com.ruoyi.framework.manager.factory.AsyncFactory;
import com.ruoyi.framework.security.context.AuthenticationContextHolder;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.jjh.declaration.single.service.SingleLoginService;
import com.ruoyi.jjh.ent.service.SmsAlertsService;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
@ -29,6 +31,9 @@ import java.util.Map;
@Service
public class SingleLoginServiceImpl implements SingleLoginService {
@Resource
private SmsAlertsService smsAlertsService;
@Resource
private AuthenticationManager authenticationManager;
@ -38,6 +43,9 @@ public class SingleLoginServiceImpl implements SingleLoginService {
@Resource
private ISysUserService userService;
@Value("${isTiming}")
private Boolean isTiming;
@Override
public String singleLogin(String userName, String nickName, Long id, String userType,String phone) {
// 用户验证
@ -66,6 +74,11 @@ public class SingleLoginServiceImpl implements SingleLoginService {
{
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
userService.insertUser(user);
if("02".equals(userType)&isTiming){
if(user.getPhonenumber()!=null){
smsAlertsService.addSsmPhone(user.getPhonenumber());
}
}
}
//新增user账号密码
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(userName, "admin123");

@ -0,0 +1,57 @@
package com.ruoyi.jjh.ent.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.jjh.ent.entity.response.HonorResponse;
import com.ruoyi.jjh.ent.entity.response.ProjectTrackingResponse;
import com.ruoyi.jjh.ent.service.JDataScreenService;
import com.ruoyi.jjh.ent.service.SmsAlertsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
*
*
* @author du
* @since 2024/7/15 14:54
*/
@RestController
@RequestMapping("/jjh/dataScreen")
@Api(tags = "数据大屏")
public class JDataScreenController extends BaseController {
@Resource
private JDataScreenService jDataScreenService;
@Resource
private SmsAlertsService sms;
/**
*
* @return
*/
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@ApiOperation(value = "荣誉情况")
@GetMapping("/honor")
public AjaxResult getHonor(HonorResponse a) {
return success(jDataScreenService.getHonor());
}
/**
*
* @return
*/
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@ApiOperation(value = "项目追踪情况")
@GetMapping("/projectTracking")
public AjaxResult getProjectTracking(ProjectTrackingResponse a) {
return success(jDataScreenService.getProjectTracking());
}
}

@ -8,8 +8,10 @@ import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.jjh.ent.entity.JEnterpriseContact;
import com.ruoyi.jjh.ent.entity.request.JEnterpriseContactRequest;
import com.ruoyi.jjh.ent.service.JEnterpriseContactService;
import com.ruoyi.jjh.ent.service.SmsAlertsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -31,6 +33,11 @@ public class JEnterpriseContactController extends BaseController {
@Resource
private JEnterpriseContactService jEnterpriseContactService;
@Value("${isTiming}")
private Boolean isTiming;
@Resource
private SmsAlertsService smsAlertsService;
/**
*
*
@ -87,6 +94,9 @@ public class JEnterpriseContactController extends BaseController {
@ApiOperation(value = "新增数据")
@PostMapping
public AjaxResult insert(@RequestBody JEnterpriseContact jEnterpriseContact) {
if(isTiming){
smsAlertsService.addSsmPhone(jEnterpriseContact.getContactPhone());
}
return success(jEnterpriseContactService.save(jEnterpriseContact));
}
@ -100,6 +110,9 @@ public class JEnterpriseContactController extends BaseController {
@ApiOperation(value = "修改数据")
@PostMapping("/edit")
public AjaxResult update(@RequestBody JEnterpriseContact jEnterpriseContact) {
if(isTiming){
smsAlertsService.addSsmPhone(jEnterpriseContact.getContactPhone());
}
return success(jEnterpriseContactService.updateById(jEnterpriseContact));
}

@ -4,16 +4,23 @@ 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.exception.ServiceException;
import com.ruoyi.common.exception.job.TaskException;
import com.ruoyi.common.utils.SecurityUtils;
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.JAddJobSmart;
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.JSmartDeclarationService;
import com.ruoyi.jjh.ent.service.JSmartRemindersService;
import com.ruoyi.quartz.domain.SysJob;
import com.ruoyi.quartz.service.ISysJobService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -35,6 +42,13 @@ public class JSmartRemindersController extends BaseController {
@Resource
private JSmartRemindersService jSmartRemindersService;
@Autowired
private ISysJobService jobService;
@Resource
private JSmartRemindersMapper jSmartRemindersMapper;
/**
*
*/
@ -45,18 +59,6 @@ public class JSmartRemindersController extends BaseController {
@Resource
private TimeChange timeChange;
/**
*
*
* @return
*/
@PreAuthorize("@ss.hasAnyRoles('admin')")
@ApiOperation(value = "定时器更新定期提醒数据(暂存)")
@GetMapping("/updateRegularReminders")
public AjaxResult updateRegularReminders() {
timeChange.changeDq();
return success();
}
/**
*
*
@ -167,10 +169,10 @@ public class JSmartRemindersController extends BaseController {
* @param jSmartRemindersDq
* @return
*/
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov,ent')")
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@ApiOperation(value = "新增定期提醒数据(政务端和企业端)")
@PostMapping
public AjaxResult insertDs(@RequestBody @Valid JSmartRemindersDq jSmartRemindersDq) {
public AjaxResult insertDs(@RequestBody @Valid JSmartRemindersDq jSmartRemindersDq) throws SchedulerException, TaskException {
if(jSmartRemindersDq.getProjectId()!=null){
jSmartRemindersDq.setAlertType(4);
}else {
@ -189,7 +191,7 @@ public class JSmartRemindersController extends BaseController {
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@ApiOperation(value = "修改定期提醒数据")
@PostMapping("/updateDq")
public AjaxResult updateDq(@RequestBody @Valid JSmartRemindersDq dq) {
public AjaxResult updateDq(@RequestBody @Valid JSmartRemindersDq dq) throws SchedulerException, TaskException {
if(dq.getAlertType() == 1 || dq.getAlertType()==4){
return success(jSmartRemindersService.updateDq(dq));
}else {
@ -224,11 +226,17 @@ public class JSmartRemindersController extends BaseController {
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@ApiOperation(value = "删除数据")
@PostMapping("/{id}")
public AjaxResult delete( @PathVariable Long id) {
public AjaxResult delete( @PathVariable Long id) throws SchedulerException {
JSmartReminders js = jSmartRemindersService.getById(id);
if (js.getAlertManner() == 2) {
throw new ServiceException("不定期提醒不允许删除");
}
JAddJobSmart jAddJobSmart = jSmartRemindersMapper.selectJobSmart(id);
if(jAddJobSmart.getJobId()!=null){
SysJob sysJob = new SysJob();
sysJob.setJobId(jAddJobSmart.getJobId());
jobService.deleteJob(sysJob);
}
return success(jSmartRemindersService.removeById(id));
}
}

@ -0,0 +1,27 @@
package com.ruoyi.jjh.ent.entity.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
*
* @author du
* @since 2024/7/18 17:14
*/
@Data
public class JAddJobSmart {
/**
* id
*/
@ApiModelProperty("统一社会信用代码")
private Long smartId;
/**
* id
*/
@ApiModelProperty("统一社会信用代码")
private Long jobId;
}

@ -0,0 +1,77 @@
package com.ruoyi.jjh.ent.entity.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
* @author du
* @since 2024/7/15 15:04
*/
@Data
@ApiModel("荣誉情况返回体")
public class HonorResponse {
/**
*
*/
@ApiModelProperty("项目大类名字")
private String projectBigName;
/**
*
*/
@ApiModelProperty("项目大类")
private Integer projectBigType;
/**
*
*/
@ApiModelProperty("大类数量")
private Integer count1;
/**
*
*/
@ApiModelProperty("项目中类名字")
private String projectMiddleName;
/**
*
*/
@ApiModelProperty("项目中类")
private Integer projectMiddleType;
/**
*
*/
@ApiModelProperty("中类数量")
private Integer count2;
/**
*
*/
@ApiModelProperty("项目小类名字")
private String projectSmallName;
/**
*
*/
@ApiModelProperty("项目小类")
private Integer projectSmallType;
/**
*
*/
@ApiModelProperty("小类数量")
private Integer count3;
/**
*
*/
@ApiModelProperty("当前年增加项目数量")
private Integer currentYearAdd;
}

@ -0,0 +1,46 @@
package com.ruoyi.jjh.ent.entity.response;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDate;
/**
*
* @author du
* @since 2024/7/16 9:15
*/
@Data
@ApiModel("项目追踪情况返回体")
public class ProjectTrackingResponse {
/**
*
*/
@ApiModelProperty("项目大类名字")
private String enterpriseDirectory;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "填报开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDate startTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "填报结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDate endTime;
/**
*
*/
@ApiModelProperty("数量")
private Integer count;
}

@ -0,0 +1,29 @@
package com.ruoyi.jjh.ent.mapper;
import com.ruoyi.jjh.ent.entity.response.HonorResponse;
import com.ruoyi.jjh.ent.entity.response.ProjectTrackingResponse;
import java.util.List;
/**
*
*
* @author du
* @since 2024/7/15 13:57
*/
public interface JDataScreenMapper {
/**
*
*
* @return
*/
List<HonorResponse> getHonor();
/**
*
*
* @return
*/
List<ProjectTrackingResponse> getProjectTracking();
}

@ -3,6 +3,7 @@ package com.ruoyi.jjh.ent.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.jjh.ent.entity.JSmartReminders;
import com.ruoyi.jjh.ent.entity.request.JAddJobSmart;
import org.apache.ibatis.annotations.Param;
import java.io.Serializable;
@ -34,5 +35,15 @@ public interface JSmartRemindersMapper extends BaseMapper<JSmartReminders> {
* @return
*/
JSmartReminders selectOneSmart(Serializable id);
/**
*
*/
void addJobSmart(@Param("req") JAddJobSmart s);
/**
*
*/
JAddJobSmart selectJobSmart(Long smartId);
}

@ -0,0 +1,26 @@
package com.ruoyi.jjh.ent.service;
import com.ruoyi.jjh.ent.entity.response.HonorResponse;
import com.ruoyi.jjh.ent.entity.response.ProjectTrackingResponse;
import java.util.List;
/**
*
* @author du
* @since 2024/5/13 9:58
*/
public interface JDataScreenService {
/**
*
* @return
*/
List<HonorResponse> getHonor();
/**
*
* @return
*/
List<ProjectTrackingResponse> getProjectTracking();
}

@ -2,11 +2,14 @@ package com.ruoyi.jjh.ent.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.exception.job.TaskException;
import com.ruoyi.jjh.ent.entity.JSmartReminders;
import com.ruoyi.jjh.ent.entity.request.JSmartRemindersDq;
import com.ruoyi.jjh.ent.entity.request.JSmartRemindersNDq;
import org.quartz.SchedulerException;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
@ -30,7 +33,18 @@ public interface JSmartRemindersService extends IService<JSmartReminders> {
* @param jSmartRemindersDq
* @return
*/
Long add(JSmartRemindersDq jSmartRemindersDq);
Long add(JSmartRemindersDq jSmartRemindersDq) throws SchedulerException, TaskException;
/**
* cron
* @return cron
*/
String generateCron(LocalDateTime time);
/**
*
*/
void updateAndAdd(JSmartReminders s,Boolean a) throws SchedulerException, TaskException;
/**
*
@ -38,7 +52,7 @@ public interface JSmartRemindersService extends IService<JSmartReminders> {
* @param dq
* @return
*/
Long updateDq(JSmartRemindersDq dq);
Long updateDq(JSmartRemindersDq dq) throws SchedulerException, TaskException;
/**
@ -57,5 +71,6 @@ public interface JSmartRemindersService extends IService<JSmartReminders> {
* @return
*/
JSmartReminders selectOneSmart(Serializable id);
}

@ -0,0 +1,31 @@
package com.ruoyi.jjh.ent.service;
import java.util.HashMap;
/**
*
* @author du
* @since 2024/7/16 13:27
*/
public interface SmsAlertsService {
/**
*
* @return
*/
HashMap<String, String> getMap();
/**
*
* @param param1
* @param param2
* @return
*/
String enterSms(String param1,String param2,String numbers);
/**
*
* @return
*/
String addSsmPhone(String nums);
}

@ -0,0 +1,68 @@
package com.ruoyi.jjh.ent.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.jjh.declaration.entity.BmsFundingDetail;
import com.ruoyi.jjh.ent.entity.JProject;
import com.ruoyi.jjh.ent.entity.response.HonorResponse;
import com.ruoyi.jjh.ent.entity.response.ProjectTrackingResponse;
import com.ruoyi.jjh.ent.mapper.JDataScreenMapper;
import com.ruoyi.jjh.ent.service.JDataScreenService;
import com.ruoyi.jjh.ent.service.JProjectService;
import com.ruoyi.jjh.ent.service.SmsAlertsService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
*
* @author du
* @since 2024/5/13 9:58
*/
@Service
public class JDataScreenImpl implements JDataScreenService {
@Resource
private JDataScreenMapper jDataScreenMapper;
@Resource
private JProjectService jProjectService;
/**
*
* @return
*/
@Override
public List<HonorResponse> getHonor() {
int x = 0;
for (JProject jp : jProjectService.lambdaQuery().eq(JProject::getProjectMiddleType,4).list()) {
if("否".equals(JSONObject.parseObject(jp.getOtherJson()).get("是否通过2022年度“331”评价"))){
x+=1;
}
}
List<HonorResponse> honor = jDataScreenMapper.getHonor();
for (HonorResponse y : honor) {
if(y.getProjectBigType()==4){
y.setCount1(y.getCount1()-x);
}
if(y.getProjectMiddleType()==4){
y.setCount2(y.getCount2()-x);
}
if(y.getProjectSmallType()==6){
y.setCount3(y.getCount3()-x);
}
}
return honor;
}
/**
*
* @return
*/
@Override
public List<ProjectTrackingResponse> getProjectTracking() {
return jDataScreenMapper.getProjectTracking();
}
}

@ -4,17 +4,26 @@ 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.common.exception.job.TaskException;
import com.ruoyi.jjh.declaration.service.IBmsDeclarationRecordsService;
import com.ruoyi.jjh.ent.entity.JSmartReminders;
import com.ruoyi.jjh.ent.entity.request.JAddJobSmart;
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 com.ruoyi.quartz.domain.SysJob;
import com.ruoyi.quartz.service.ISysJobService;
import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* j_smart_reminders
@ -25,7 +34,11 @@ import java.time.LocalDate;
@Service
public class JSmartRemindersServiceImpl extends ServiceImpl<JSmartRemindersMapper, JSmartReminders> implements JSmartRemindersService {
@Autowired
private ISysJobService jobService;
@Value("${isTiming}")
private Boolean isTiming;
@Resource
private IBmsDeclarationRecordsService bmsDeclarationRecordsService;
@ -47,21 +60,70 @@ public class JSmartRemindersServiceImpl extends ServiceImpl<JSmartRemindersMappe
* @param jSmartRemindersDq
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Long add(JSmartRemindersDq jSmartRemindersDq) {
public Long add(JSmartRemindersDq jSmartRemindersDq) throws SchedulerException, TaskException {
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("不可新增不定期提醒!");
}
save(jSmartReminders);
return jSmartRemindersDq.getId();
updateAndAdd(jSmartReminders,true);
return jSmartReminders.getId();
}
/**
* cron
* @return cron
*/
@Override
public String generateCron(LocalDateTime localDateTime) {
int second = 0; // 固定为0秒
int minute = localDateTime.getMinute();
int hour = localDateTime.getHour();
int dayOfMonth = localDateTime.getDayOfMonth();
int month = localDateTime.getMonthValue();
String dayOfWeek = "?";
// 构造 Cron 表达式
return String.format("%d %d %d %d %d %s",
second, minute, hour, dayOfMonth, month, dayOfWeek);
}
/**
*
*/
@Override
public void updateAndAdd(JSmartReminders jSmartReminders,Boolean flag) throws SchedulerException, TaskException {
SysJob sysJob = new SysJob();
sysJob.setConcurrent("1");//不允许并发执行
sysJob.setCronExpression(generateCron(jSmartReminders.getAlertTime()));//生成cron表达式
if(jSmartReminders.getAlertRecipients() == 1){
//如果是企业的定时提醒
sysJob.setInvokeTarget("TimingRemind.enterpriseTiming("+"'"+jSmartReminders.getAlertTime()+"'"+","+jSmartReminders.getId()+"L"+")");
}else {
//如果是政务端的定时提醒
sysJob.setInvokeTarget("TimingRemind.chiefTiming("+"'"+jSmartReminders.getAlertTime()+"'"+","+jSmartReminders.getId()+"L,"+"'"+jSmartReminders.getProjectId()+"'"+")");
}
sysJob.setJobGroup("DEFAULT");
sysJob.setJobName(jSmartReminders.getRulesName());
sysJob.setMisfirePolicy("3");
sysJob.setStatus("0");
if(flag){
jobService.insertJob(sysJob);
JAddJobSmart ja = new JAddJobSmart();
ja.setSmartId(jSmartReminders.getId());
ja.setJobId(sysJob.getJobId());
baseMapper.addJobSmart(ja);
}else{
JAddJobSmart jAddJobSmart = baseMapper.selectJobSmart(jSmartReminders.getId());
sysJob.setJobId(jAddJobSmart.getJobId());
jobService.updateJob(sysJob);
}
}
/**
*
*
@ -69,18 +131,15 @@ public class JSmartRemindersServiceImpl extends ServiceImpl<JSmartRemindersMappe
* @return
*/
@Override
public Long updateDq(JSmartRemindersDq jSmartRemindersDq) {
public Long updateDq(JSmartRemindersDq jSmartRemindersDq) throws SchedulerException, TaskException {
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();
updateAndAdd(jSmartReminders,false);
return jSmartReminders.getId();
}
/**
@ -111,6 +170,9 @@ public class JSmartRemindersServiceImpl extends ServiceImpl<JSmartRemindersMappe
return baseMapper.selectOneSmart(id);
}
// /**
// * 企业端首页智能提醒查询所有数据
// *

@ -0,0 +1,108 @@
package com.ruoyi.jjh.ent.service.impl;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.crypto.digest.DigestAlgorithm;
import cn.hutool.crypto.digest.Digester;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.ruoyi.jjh.ent.service.SmsAlertsService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.time.Instant;
import java.util.HashMap;
import java.util.Map;
/**
*
* @author du
* @since 2024/7/16 13:26
*/
@Service
public class SmsAlertsServiceImpl implements SmsAlertsService {
@Value("${smsSend}")
private String smsSend;
@Value("${smsPhoneAdd}")
private String smsPhoneAdd;
@Value("${paaSID}")
private String paaSID;
@Value("${smsToken}")
private String smsToken;
@Value("${code}")
private String code;
@Value("${smsV}")
private String smsV;
@Value("${paramType}")
private String paramType;
/**
*
* @return
*/
@Override
public HashMap<String, String> getMap() {
Digester sha256 = new Digester(DigestAlgorithm.SHA256);
String timestamp = String.valueOf(Instant.now().getEpochSecond());
String str = RandomUtil.randomString(30);
//请求头
HashMap<String, String> headers = new HashMap<>();//存放请求头,可以存放多个请求头
headers.put("x-tif-paasid", paaSID);
headers.put("x-tif-signature", sha256.digestHex(timestamp+smsToken+str+timestamp).toUpperCase());
headers.put("x-tif-timestamp", timestamp);
headers.put("x-tif-nonce", str);
return headers;
}
/**
*
* @param param1
* @param param2
* @return
*/
@Override
public String enterSms(String param1,String param2,String numbers) {
JSONObject jsonObject = new JSONObject();//存放参数
//请求体
JSONObject params = new JSONObject();//存放参数
params.set("param1",param1);
params.set("param2",param2);
jsonObject.set("type", paramType);
jsonObject.set("empowerCode", smsV);
jsonObject.set("numbers", numbers);
jsonObject.set("params", params);
HttpResponse response = HttpRequest.post(smsSend)
.addHeaders(getMap())
.body(jsonObject.toString())
.execute();
JSONObject jsonObj = JSONUtil.parseObj(response.body());
return String.valueOf(jsonObj.get("msg"));
}
/**
*
* @return
*/
@Override
public String addSsmPhone(String nums) {
Map<String,Object> js1 = new HashMap<>();//存放参数
js1.put("orderId", code);
js1.put("nums", nums);
HttpResponse response = HttpRequest.post(smsPhoneAdd)
.addHeaders(getMap())
.form(js1)
.execute();
JSONObject jsonObj = JSONUtil.parseObj(response.body());
return String.valueOf(jsonObj.get("msg"));
}
}

@ -88,4 +88,19 @@ server:
#企业端单点登陆url
url: https://qytt.sipac.gov.cn/api/usercenter/User/ssoLogin
#企业端用户信息url
infoUrl: https://qytt.sipac.gov.cn/api/usercenter/User/getInfo
infoUrl: https://qytt.sipac.gov.cn/api/usercenter/User/getInfo
#短信发送接口
smsSend: http://zwyyone.sipac.gov.cn/ebus/szyqznzs/dx
#短信接收人号码新增
smsPhoneAdd: http://zwyyone.sipac.gov.cn/ebus/szyqznzs/dxhm
#测试类型
paramType: cs
#测试授权码
smsV: oVFPU1y1wYJIatvqrGoTAE5ycguUyjaY
#工单编号
code: SC24071600001
#PaaSID
paaSID: xdfwy
#短信token
smsToken: iM89cd4b0cGNVYAqKu7jl7EONyHgTa0N

@ -117,4 +117,19 @@ isTiming: true
#企业端单点登陆url
url: https://qytt.sipac.gov.cn/api/usercenter/User/ssoLogin
#企业端用户信息url
infoUrl: https://qytt.sipac.gov.cn/api/usercenter/User/getInfo
infoUrl: https://qytt.sipac.gov.cn/api/usercenter/User/getInfo
#短信发送接口
smsSend: http://zwyyone.sipac.gov.cn/ebus/szyqznzs/dx
#短信接收人号码新增
smsPhoneAdd: http://zwyyone.sipac.gov.cn/ebus/szyqznzs/dxhm
#测试类型
paramType: zs
#测试授权码
smsV: 3b3jaDmYcf87Mk7NqEmzis=3AaaFeYmV4DIf
#工单编号
code: SC24071600001
#PaaSID
paaSID: xdfwy
#短信token
smsToken: iM89cd4b0cGNVYAqKu7jl7EONyHgTa0N

@ -232,6 +232,7 @@
a.credit_code,
b.id as enterpriseId,
c.LEVEL,
c.project_small_type as projectSmallType,
a.YEAR,
a.template_record_id,
a.template_id,

@ -0,0 +1,69 @@
<?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.JDataScreenMapper">
<select id="getHonor" resultType="com.ruoyi.jjh.ent.entity.response.HonorResponse">
SELECT a.dict_label AS projectBigName,
a.dict_value AS projectBigType,
IFNULL(rs.count, 0) AS count1,
b.dict_label AS projectMiddleName,
b.dict_value AS projectMiddleType,
IFNULL(ys.count, 0) AS count2,
c.dict_label AS projectSmallName,
c.dict_value AS projectSmallType,
IFNULL(us.count, 0) AS count3,
IFNULL(ns.count, 0) AS currentYearAdd
FROM sys_dict_data a
JOIN sys_dict_data b ON a.remark = b.dict_type
JOIN sys_dict_data c ON b.remark = c.dict_type
LEFT JOIN (SELECT project_big_type,
IF
(
project_big_type = 1
OR project_big_type = 9,
COUNT(DISTINCT credit_code),
COUNT(*)) AS count
FROM j_project
GROUP BY project_big_type) AS rs ON a.dict_value = rs.project_big_type
LEFT JOIN (SELECT project_middle_type,
IF
(
project_middle_type = 1
OR project_middle_type = 9,
COUNT(DISTINCT credit_code),
COUNT(*)) AS count
FROM j_project
GROUP BY project_middle_type) AS ys ON b.dict_value = ys.project_middle_type
LEFT JOIN (SELECT project_small_type,
IF(project_small_type = 14, COUNT(DISTINCT credit_code), COUNT(*)) AS count
FROM j_project
GROUP BY project_small_type) AS us ON c.dict_value = us.project_small_type
LEFT JOIN (SELECT ns.project_small_type,
COUNT(*) AS count
FROM j_project ns
WHERE YEAR(
NOW()) = YEAR(ns.project_year)
GROUP BY ns.project_small_type) AS ns ON c.dict_value = ns.project_small_type
WHERE a.dict_type = 'project_categories'
ORDER BY CAST(c.dict_value AS UNSIGNED);
</select>
<select id="getProjectTracking" resultType="com.ruoyi.jjh.ent.entity.response.ProjectTrackingResponse">
SELECT
b.enterprise_directory,
b.start_time,
b.end_time,
COUNT(*) as count
FROM
bms_declaration_records a
INNER JOIN bms_template_record b ON a.template_record_id = b.id
WHERE
a.`status` != 0
GROUP BY
a.template_record_id
order by
count desc
</select>
</mapper>

@ -4,6 +4,11 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.jjh.ent.mapper.JSmartRemindersMapper">
<insert id="addJobSmart">
INSERT INTO sys_job_smart (smart_id, job_id)
VALUES (#{req.smartId}, #{req.jobId});
</insert>
<select id="page" resultType="com.ruoyi.jjh.ent.entity.JSmartReminders">
select a.*,
@ -30,4 +35,8 @@
left join j_project jp on a.project_id = jp.id
where a.id=#{id}
</select>
<select id="selectJobSmart" resultType="com.ruoyi.jjh.ent.entity.request.JAddJobSmart">
select * from sys_job_smart
where smart_id = #{smartId}
</select>
</mapper>

@ -172,7 +172,7 @@ public class Constants
/**
* 访
*/
public static final String[] JOB_WHITELIST_STR = { "com.ruoyi.quartz.task" };
public static final String[] JOB_WHITELIST_STR = { "com.ruoyi.quartz.task","com.ruoyi.jjh.declaration.component" };
/**
*

@ -201,7 +201,7 @@ public class SysJobServiceImpl implements ISysJobService
@Transactional(rollbackFor = Exception.class)
public int insertJob(SysJob job) throws SchedulerException, TaskException
{
job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
// job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
int rows = jobMapper.insertJob(job);
if (rows > 0)
{

Loading…
Cancel
Save