Compare commits
2 Commits
705bfda166
...
03808c145c
| Author | SHA1 | Date |
|---|---|---|
|
|
03808c145c | |
|
|
383fbed6b4 |
|
|
@ -52,15 +52,6 @@ public class QualityNotificationController extends BaseController {
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布质量通知
|
|
||||||
*/
|
|
||||||
@PostMapping("publish")
|
|
||||||
public ApiResult<Void> publish(@NotNull Long id) {
|
|
||||||
qualityNotificationControllerService.publish(id);
|
|
||||||
return ApiResult.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询质量通知列表
|
* 分页查询质量通知列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -64,20 +64,12 @@ public class QualityNotificationControllerService {
|
||||||
Long operatorId = UserUtil.getUserId();
|
Long operatorId = UserUtil.getUserId();
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
|
||||||
// 如果状态为已发布,设置发布时间
|
|
||||||
LocalDateTime publishTime = null;
|
|
||||||
if (request.getStatus() == 2) {
|
|
||||||
publishTime = now;
|
|
||||||
}
|
|
||||||
|
|
||||||
QmsQualityNotification entity = new QmsQualityNotification()
|
QmsQualityNotification entity = new QmsQualityNotification()
|
||||||
.setNotificationTypeId(request.getNotificationTypeId())
|
.setNotificationTypeId(request.getNotificationTypeId())
|
||||||
.setTitle(request.getTitle())
|
.setTitle(request.getTitle())
|
||||||
.setTargetType(request.getTargetType())
|
.setTargetType(request.getTargetType())
|
||||||
.setContent(request.getContent())
|
.setContent(request.getContent())
|
||||||
.setStatus(request.getStatus())
|
|
||||||
.setState(1) // 默认启用
|
.setState(1) // 默认启用
|
||||||
.setPublishTime(publishTime)
|
|
||||||
.setCreateById(operatorId)
|
.setCreateById(operatorId)
|
||||||
.setCreateBy(operator)
|
.setCreateBy(operator)
|
||||||
.setCreateTime(now)
|
.setCreateTime(now)
|
||||||
|
|
@ -101,9 +93,6 @@ public class QualityNotificationControllerService {
|
||||||
QmsQualityNotification exist = qualityNotificationService.getById(request.getId());
|
QmsQualityNotification exist = qualityNotificationService.getById(request.getId());
|
||||||
VUtil.trueThrowBusinessError(Objects.isNull(exist)).throwMessage("通知不存在");
|
VUtil.trueThrowBusinessError(Objects.isNull(exist)).throwMessage("通知不存在");
|
||||||
|
|
||||||
// 已发布的通知不允许编辑
|
|
||||||
VUtil.trueThrowBusinessError(exist.getStatus() == 2).throwMessage("已发布的通知不允许编辑");
|
|
||||||
|
|
||||||
// 如果是手动选择用户,必须提供用户ID列表
|
// 如果是手动选择用户,必须提供用户ID列表
|
||||||
if (request.getTargetType() == 2) {
|
if (request.getTargetType() == 2) {
|
||||||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(request.getUserIds()))
|
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(request.getUserIds()))
|
||||||
|
|
@ -120,7 +109,6 @@ public class QualityNotificationControllerService {
|
||||||
.set(QmsQualityNotification::getTitle, request.getTitle())
|
.set(QmsQualityNotification::getTitle, request.getTitle())
|
||||||
.set(QmsQualityNotification::getTargetType, request.getTargetType())
|
.set(QmsQualityNotification::getTargetType, request.getTargetType())
|
||||||
.set(QmsQualityNotification::getContent, request.getContent())
|
.set(QmsQualityNotification::getContent, request.getContent())
|
||||||
.set(QmsQualityNotification::getStatus, request.getStatus())
|
|
||||||
.set(QmsQualityNotification::getUpdateById, operatorId)
|
.set(QmsQualityNotification::getUpdateById, operatorId)
|
||||||
.set(QmsQualityNotification::getUpdateBy, operator)
|
.set(QmsQualityNotification::getUpdateBy, operator)
|
||||||
.set(QmsQualityNotification::getUpdateTime, now)
|
.set(QmsQualityNotification::getUpdateTime, now)
|
||||||
|
|
@ -145,9 +133,6 @@ public class QualityNotificationControllerService {
|
||||||
QmsQualityNotification exist = qualityNotificationService.getById(id);
|
QmsQualityNotification exist = qualityNotificationService.getById(id);
|
||||||
VUtil.trueThrowBusinessError(Objects.isNull(exist)).throwMessage("通知不存在");
|
VUtil.trueThrowBusinessError(Objects.isNull(exist)).throwMessage("通知不存在");
|
||||||
|
|
||||||
// 已发布的通知不允许删除
|
|
||||||
VUtil.trueThrowBusinessError(exist.getStatus() == 2).throwMessage("已发布的通知不允许删除");
|
|
||||||
|
|
||||||
// 删除通知
|
// 删除通知
|
||||||
qualityNotificationService.removeById(id);
|
qualityNotificationService.removeById(id);
|
||||||
|
|
||||||
|
|
@ -157,31 +142,6 @@ public class QualityNotificationControllerService {
|
||||||
.remove();
|
.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布质量通知
|
|
||||||
*/
|
|
||||||
@Transactional
|
|
||||||
public void publish(Long id) {
|
|
||||||
QmsQualityNotification exist = qualityNotificationService.getById(id);
|
|
||||||
VUtil.trueThrowBusinessError(Objects.isNull(exist)).throwMessage("通知不存在");
|
|
||||||
|
|
||||||
// 已发布的通知不能重复发布
|
|
||||||
VUtil.trueThrowBusinessError(exist.getStatus() == 2).throwMessage("通知已发布,不能重复发布");
|
|
||||||
|
|
||||||
String operator = UserUtil.getUserName();
|
|
||||||
Long operatorId = UserUtil.getUserId();
|
|
||||||
LocalDateTime now = LocalDateTime.now();
|
|
||||||
|
|
||||||
qualityNotificationService.lambdaUpdate()
|
|
||||||
.eq(QmsQualityNotification::getId, id)
|
|
||||||
.set(QmsQualityNotification::getStatus, 2)
|
|
||||||
.set(QmsQualityNotification::getPublishTime, now)
|
|
||||||
.set(QmsQualityNotification::getUpdateById, operatorId)
|
|
||||||
.set(QmsQualityNotification::getUpdateBy, operator)
|
|
||||||
.set(QmsQualityNotification::getUpdateTime, now)
|
|
||||||
.update();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询质量通知列表
|
* 分页查询质量通知列表
|
||||||
*/
|
*/
|
||||||
|
|
@ -205,9 +165,7 @@ public class QualityNotificationControllerService {
|
||||||
vo.setTitle(entity.getTitle());
|
vo.setTitle(entity.getTitle());
|
||||||
vo.setTargetType(entity.getTargetType());
|
vo.setTargetType(entity.getTargetType());
|
||||||
vo.setContent(entity.getContent());
|
vo.setContent(entity.getContent());
|
||||||
vo.setStatus(entity.getStatus());
|
|
||||||
vo.setState(entity.getState());
|
vo.setState(entity.getState());
|
||||||
vo.setPublishTime(entity.getPublishTime());
|
|
||||||
vo.setCreateById(entity.getCreateById());
|
vo.setCreateById(entity.getCreateById());
|
||||||
vo.setCreateBy(entity.getCreateBy());
|
vo.setCreateBy(entity.getCreateBy());
|
||||||
vo.setCreateTime(entity.getCreateTime());
|
vo.setCreateTime(entity.getCreateTime());
|
||||||
|
|
@ -294,10 +252,6 @@ public class QualityNotificationControllerService {
|
||||||
if (vo.getTargetType() != null) {
|
if (vo.getTargetType() != null) {
|
||||||
vo.setTargetTypeName(vo.getTargetType() == 1 ? "全部" : "手动选择");
|
vo.setTargetTypeName(vo.getTargetType() == 1 ? "全部" : "手动选择");
|
||||||
}
|
}
|
||||||
// 发布状态名称
|
|
||||||
if (vo.getStatus() != null) {
|
|
||||||
vo.setStatusName(vo.getStatus() == 1 ? "草稿" : "已发布");
|
|
||||||
}
|
|
||||||
// 启用状态名称
|
// 启用状态名称
|
||||||
if (vo.getState() != null) {
|
if (vo.getState() != null) {
|
||||||
vo.setStateName(vo.getState() == 1 ? "启用" : "禁用");
|
vo.setStateName(vo.getState() == 1 ? "启用" : "禁用");
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,10 @@ import java.util.List;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class DeploySitTest {
|
public class DeploySitTest {
|
||||||
|
|
||||||
private static final String serviceName = "admin";
|
private static final String serviceName = "qms";
|
||||||
private static final String localPath = System.getProperty("user.dir") + "//target//";
|
private static final String localPath = System.getProperty("user.dir") + "//target//";
|
||||||
private static final String remotePath = "/mnt/app/qms/" + serviceName + "/";
|
private static final String remotePath = "/mnt/app/" + serviceName + "/admin/";
|
||||||
private static final String jarName = "nflg-qms-" + serviceName + "-1.0.0-SNAPSHOT.jar";
|
private static final String jarName = "nflg-" + serviceName + "-admin-1.0.0-SNAPSHOT.jar";
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void DeployToSit() throws Exception {
|
public void DeployToSit() throws Exception {
|
||||||
|
|
@ -32,7 +32,7 @@ public class DeploySitTest {
|
||||||
//处理字体目录
|
//处理字体目录
|
||||||
// handleDir(sshUtil, localPath, remotePath, "fonts");
|
// handleDir(sshUtil, localPath, remotePath, "fonts");
|
||||||
//处理lib目录
|
//处理lib目录
|
||||||
// handleDir(sshUtil, localPath, remotePath, "lib");
|
handleDir(sshUtil, localPath, remotePath, "lib");
|
||||||
//执行脚本启动服务
|
//执行脚本启动服务
|
||||||
sshUtil.exec("cd " + remotePath + " && ./restart.sh");
|
sshUtil.exec("cd " + remotePath + " && ./restart.sh");
|
||||||
sshUtil.disconnect();
|
sshUtil.disconnect();
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,4 @@ public class QmsQualityNotificationAddQO {
|
||||||
* 通知内容(HTML格式)
|
* 通知内容(HTML格式)
|
||||||
*/
|
*/
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:1=草稿,2=已发布
|
|
||||||
*/
|
|
||||||
@NotNull(message = "状态不能为空")
|
|
||||||
private Integer status;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,6 @@ public class QmsQualityNotificationSearchQO extends SearchBaseQO {
|
||||||
*/
|
*/
|
||||||
private Long notificationTypeId;
|
private Long notificationTypeId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:1=草稿,2=已发布
|
|
||||||
*/
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启用状态:1=启用,2=禁用
|
* 启用状态:1=启用,2=禁用
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -45,10 +45,4 @@ public class QmsQualityNotificationUpdateQO {
|
||||||
* 通知内容(HTML格式)
|
* 通知内容(HTML格式)
|
||||||
*/
|
*/
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:1=草稿,2=已发布
|
|
||||||
*/
|
|
||||||
@NotNull(message = "状态不能为空")
|
|
||||||
private Integer status;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,16 +43,6 @@ public class QmsQualityNotificationVO {
|
||||||
*/
|
*/
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:1=草稿,2=已发布
|
|
||||||
*/
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态名称
|
|
||||||
*/
|
|
||||||
private String statusName;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启用状态:1=启用,2=禁用
|
* 启用状态:1=启用,2=禁用
|
||||||
*/
|
*/
|
||||||
|
|
@ -63,11 +53,6 @@ public class QmsQualityNotificationVO {
|
||||||
*/
|
*/
|
||||||
private String stateName;
|
private String stateName;
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime publishTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建人ID
|
* 创建人ID
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -46,21 +46,11 @@ public class QmsQualityNotification implements Serializable {
|
||||||
*/
|
*/
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:1=草稿,2=已发布
|
|
||||||
*/
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启用状态:1=启用,2=禁用
|
* 启用状态:1=启用,2=禁用
|
||||||
*/
|
*/
|
||||||
private Integer state;
|
private Integer state;
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime publishTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建人ID
|
* 创建人ID
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,7 @@
|
||||||
q.title,
|
q.title,
|
||||||
q.target_type,
|
q.target_type,
|
||||||
q.content,
|
q.content,
|
||||||
q.status,
|
|
||||||
q.state,
|
q.state,
|
||||||
q.publish_time,
|
|
||||||
q.create_by_id,
|
q.create_by_id,
|
||||||
q.create_by,
|
q.create_by,
|
||||||
q.create_time,
|
q.create_time,
|
||||||
|
|
@ -27,9 +25,6 @@
|
||||||
<if test="request.notificationTypeId != null">
|
<if test="request.notificationTypeId != null">
|
||||||
AND q.notification_type_id = #{request.notificationTypeId}
|
AND q.notification_type_id = #{request.notificationTypeId}
|
||||||
</if>
|
</if>
|
||||||
<if test="request.status != null">
|
|
||||||
AND q.status = #{request.status}
|
|
||||||
</if>
|
|
||||||
<if test="request.state != null">
|
<if test="request.state != null">
|
||||||
AND q.state = #{request.state}
|
AND q.state = #{request.state}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue