|
|
@ -144,19 +144,19 @@ public class EfcodeCpNoticeServiceImpl implements IEfcodeCpNoticeService { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
baseMapper.insert(entity); |
|
|
baseMapper.insert(entity); |
|
|
// // 同步写入 notice_users 表
|
|
|
// 同步写入 notice_users 表
|
|
|
// syncNoticeUsers(entity.getId(), bo.getEnforceUserNames(), bo.getEnforceUserIds(), bo.getEnforceUserTels());
|
|
|
syncNoticeUsers(entity.getId(), bo.getEnforceUserNames(), bo.getEnforceUserIds(), bo.getEnforceUserTels()); |
|
|
// // 发布时自动生成系统提示消息
|
|
|
// 发布时自动生成系统提示消息
|
|
|
// if (entity.getStatus() != null && entity.getStatus() == 1L) {
|
|
|
if (entity.getStatus() != null && entity.getStatus() == 1L) { |
|
|
// // 调用站内信发送预告消息(发送前内部校验系统参数 sns.send)
|
|
|
// 调用站内信发送预告消息(发送前内部校验系统参数 sns.send)
|
|
|
// getSendYuGaoMsg(entity);
|
|
|
getSendYuGaoMsg(entity); |
|
|
// }
|
|
|
} |
|
|
//
|
|
|
|
|
|
// //同步更新企业电话
|
|
|
//同步更新企业电话
|
|
|
// UpdateWrapper<EnterpriseInformation> updateWrapper = new UpdateWrapper<>();
|
|
|
UpdateWrapper<EnterpriseInformation> updateWrapper = new UpdateWrapper<>(); |
|
|
// updateWrapper.eq("enterprise_number",entity.getEnterpriseNumber());
|
|
|
updateWrapper.eq("enterprise_number",entity.getEnterpriseNumber()); |
|
|
// updateWrapper.set("enterprise_tel",entity.getContactPhone());
|
|
|
updateWrapper.set("enterprise_tel",entity.getContactPhone()); |
|
|
// enterpriseInformationMapper.update(updateWrapper);
|
|
|
enterpriseInformationMapper.update(updateWrapper); |
|
|
return "操作成功"; |
|
|
return "操作成功"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -179,7 +179,7 @@ public class EfcodeCpNoticeServiceImpl implements IEfcodeCpNoticeService { |
|
|
paramBo.setEnterpriseId(entity.getEnterpriseId()); |
|
|
paramBo.setEnterpriseId(entity.getEnterpriseId()); |
|
|
paramBo.setEnterpriseName(entity.getEnterpriseName()); |
|
|
paramBo.setEnterpriseName(entity.getEnterpriseName()); |
|
|
paramBo.setCreateByName(LoginHelper.getUsername()); |
|
|
paramBo.setCreateByName(LoginHelper.getUsername()); |
|
|
paramBo.setDeptName(entity.getBureauDeptName()); |
|
|
paramBo.setDeptName(entity.getDeptName()); |
|
|
paramBo.setEnforceDate(entity.getEnforceDate()); |
|
|
paramBo.setEnforceDate(entity.getEnforceDate()); |
|
|
siqService.sendYuGaoMsg(paramBo); |
|
|
siqService.sendYuGaoMsg(paramBo); |
|
|
|
|
|
|
|
|
@ -208,38 +208,46 @@ public class EfcodeCpNoticeServiceImpl implements IEfcodeCpNoticeService { |
|
|
}; |
|
|
}; |
|
|
String checkTime = entity.getEnforceDate() + (StringUtils.isBlank(enforceTimeText) ? "" : " " + enforceTimeText); |
|
|
String checkTime = entity.getEnforceDate() + (StringUtils.isBlank(enforceTimeText) ? "" : " " + enforceTimeText); |
|
|
String content = |
|
|
String content = |
|
|
"【深圳政务短信平台】尊敬的" + entity.getContactPerson() + "(先生/女士),您好!您收到一则行政检查预告消息。信息内容如下:\n" |
|
|
"【深圳政务短信平台】尊敬的" + entity.getContactPerson() + "(先生/女士),您好!您收到一则行政检查预告消息。信息内容如下:" |
|
|
+ "企业名称:" + entity.getEnterpriseName() + "\n" |
|
|
+ "企业名称:" + entity.getEnterpriseName() |
|
|
+ "执法单位:" + entity.getBureauDeptName() + "\n" |
|
|
+ ";执法单位:" + entity.getBureauDeptName() |
|
|
+ "检查时间:" + checkTime + "\n" |
|
|
+ ";检查时间:" + checkTime |
|
|
+ "如需了解预告详情,请登录深i企,进入“执法监督码”查看,感谢您的理解!"; |
|
|
+ "。如需了解预告详情,请登录深i企,进入“执法监督码”查看,感谢您的理解!"; |
|
|
zwSmsClient.asyncSendSms(entity.getContactPhone(), content); |
|
|
zwSmsClient.asyncSendSms(entity.getContactPhone(), content); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 修改预告(仅草稿可修改) |
|
|
* 修改预告(仅草稿可修改)并同步更新 notice_users 表 |
|
|
* 单条 UPDATE 原子完成"草稿校验+更新": 一次DB往返, 行锁仅覆盖单语句执行期, 消除先查后改的竞态窗口 |
|
|
|
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public String updateNotice(EfcodeCpNoticeBo bo) { |
|
|
public String updateNotice(EfcodeCpNoticeBo bo) { |
|
|
|
|
|
// 校验:只有草稿(status=0)能修改
|
|
|
|
|
|
EfcodeCpNotice existing = baseMapper.selectById(bo.getId()); |
|
|
|
|
|
if (existing == null) { |
|
|
|
|
|
return "预告不存在"; |
|
|
|
|
|
} |
|
|
|
|
|
if (existing.getStatus() != null && existing.getStatus() != 0L) { |
|
|
|
|
|
return "非草稿状态的预告不能修改"; |
|
|
|
|
|
} |
|
|
EfcodeCpNotice update = MapstructUtils.convert(bo, EfcodeCpNotice.class); |
|
|
EfcodeCpNotice update = MapstructUtils.convert(bo, EfcodeCpNotice.class); |
|
|
// 如果此次操作是发布(status=1),设置发布时间
|
|
|
// 如果此次操作是发布(status=1),设置发布时间
|
|
|
if (update.getStatus() != null && update.getStatus() == 1L) { |
|
|
if (update.getStatus() != null && update.getStatus() == 1L) { |
|
|
update.setPublishTime(new Date()); |
|
|
update.setPublishTime(new Date()); |
|
|
} |
|
|
} |
|
|
LambdaUpdateWrapper<EfcodeCpNotice> uw = Wrappers.lambdaUpdate(); |
|
|
baseMapper.updateById(update); |
|
|
uw.eq(EfcodeCpNotice::getId, bo.getId()) |
|
|
// 同步更新 notice_users 表(先删后插)
|
|
|
.eq(EfcodeCpNotice::getStatus, 0L) |
|
|
syncNoticeUsers(bo.getId(), bo.getEnforceUserNames(), bo.getEnforceUserIds(), bo.getEnforceUserTels()); |
|
|
.eq(EfcodeCpNotice::getIsDelete, 0L); |
|
|
// 发布时自动生成系统提示消息
|
|
|
int rows = baseMapper.update(update, uw); |
|
|
if (update.getStatus() != null && update.getStatus() == 1L) { |
|
|
// 常态(更新成功)路径不再回查, 仅失败时区分原因
|
|
|
generateSystemMessage(update); |
|
|
if (rows == 0) { |
|
|
|
|
|
EfcodeCpNotice existing = baseMapper.selectById(bo.getId()); |
|
|
|
|
|
if (existing == null) { |
|
|
|
|
|
return "预告不存在"; |
|
|
|
|
|
} |
|
|
|
|
|
return "非草稿状态的预告不能修改"; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//同步更新企业电话
|
|
|
|
|
|
UpdateWrapper<EnterpriseInformation> updateWrapper = new UpdateWrapper<>(); |
|
|
|
|
|
updateWrapper.eq("enterprise_number",bo.getEnterpriseNumber()); |
|
|
|
|
|
updateWrapper.set("enterprise_tel",bo.getContactPhone()); |
|
|
|
|
|
enterpriseInformationMapper.update(updateWrapper); |
|
|
return "操作成功"; |
|
|
return "操作成功"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -342,6 +350,8 @@ public class EfcodeCpNoticeServiceImpl implements IEfcodeCpNoticeService { |
|
|
lqw.like(StringUtils.isNotBlank(bo.getBureauDeptName()), EfcodeCpNotice::getBureauDeptName, bo.getBureauDeptName()); |
|
|
lqw.like(StringUtils.isNotBlank(bo.getBureauDeptName()), EfcodeCpNotice::getBureauDeptName, bo.getBureauDeptName()); |
|
|
lqw.eq(StringUtils.isNotBlank(bo.getEnterpriseId()), EfcodeCpNotice::getEnterpriseId, bo.getEnterpriseId()); |
|
|
lqw.eq(StringUtils.isNotBlank(bo.getEnterpriseId()), EfcodeCpNotice::getEnterpriseId, bo.getEnterpriseId()); |
|
|
lqw.like(StringUtils.isNotBlank(bo.getEnterpriseName()), EfcodeCpNotice::getEnterpriseName, bo.getEnterpriseName()); |
|
|
lqw.like(StringUtils.isNotBlank(bo.getEnterpriseName()), EfcodeCpNotice::getEnterpriseName, bo.getEnterpriseName()); |
|
|
|
|
|
lqw.eq(bo.getStatus() != null, EfcodeCpNotice::getStatus, bo.getStatus()); |
|
|
|
|
|
lqw.eq(bo.getIsDelete() != null, EfcodeCpNotice::getIsDelete, bo.getIsDelete()); |
|
|
//企业统一信用代码(为空时不作为查询条件)
|
|
|
//企业统一信用代码(为空时不作为查询条件)
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getEnterpriseNumber()), EfcodeCpNotice::getEnterpriseNumber, bo.getEnterpriseNumber()); |
|
|
lqw.eq(StringUtils.isNotBlank(bo.getEnterpriseNumber()), EfcodeCpNotice::getEnterpriseNumber, bo.getEnterpriseNumber()); |
|
|
lqw.eq(bo.getStatus() != null, EfcodeCpNotice::getStatus, bo.getStatus()); |
|
|
lqw.eq(bo.getStatus() != null, EfcodeCpNotice::getStatus, bo.getStatus()); |
|
|
@ -387,8 +397,6 @@ public class EfcodeCpNoticeServiceImpl implements IEfcodeCpNoticeService { |
|
|
lqw.apply("DATE_FORMAT(enforce_date, '%Y-%m') = {0}", bo.getDateSearch()); |
|
|
lqw.apply("DATE_FORMAT(enforce_date, '%Y-%m') = {0}", bo.getDateSearch()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return lqw; |
|
|
return lqw; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|