Compare commits
67 Commits
e634c4c789
...
a1d3c74553
| Author | SHA1 | Date |
|---|---|---|
|
|
a1d3c74553 | |
|
|
aa79284eea | |
|
|
235f6b4543 | |
|
|
e59b3f7b0a | |
|
|
2a1420c2ff | |
|
|
51282ede84 | |
|
|
eb18bcd47a | |
|
|
187e503ce0 | |
|
|
0904f2ed8c | |
|
|
6ca0d589e4 | |
|
|
ef36d7736d | |
|
|
fe3d0a5176 | |
|
|
c407f62199 | |
|
|
bb81885eca | |
|
|
04d6bae1f6 | |
|
|
32c8637573 | |
|
|
fa853a2eb6 | |
|
|
776c8a8be3 | |
|
|
62ce622d9b | |
|
|
fe6c3cc27a | |
|
|
77a1981f20 | |
|
|
ea25e4e6ee | |
|
|
61999f84d6 | |
|
|
73ca81291c | |
|
|
45c4399369 | |
|
|
7d1d588238 | |
|
|
048b8c7c15 | |
|
|
e22e20ae10 | |
|
|
9ea8a7a167 | |
|
|
c6328d251d | |
|
|
f2957eb44f | |
|
|
df47016907 | |
|
|
109b49d5ec | |
|
|
c8d6870ba7 | |
|
|
1bae2a3dea | |
|
|
8e1b1c2f61 | |
|
|
acf73b2799 | |
|
|
ac59042d1a | |
|
|
26e7ea8fab | |
|
|
4aacfd4d36 | |
|
|
66791df863 | |
|
|
b0ce5f888b | |
|
|
2b04b8380b | |
|
|
87527325e9 | |
|
|
4ad9b67df1 | |
|
|
6f3857f898 | |
|
|
37ba42fc2b | |
|
|
6c0941c1fa | |
|
|
fe391761b8 | |
|
|
76418cc7d4 | |
|
|
0319ab72fc | |
|
|
2010e0b5a8 | |
|
|
5fe030e663 | |
|
|
67fef396ff | |
|
|
d8343eaf1a | |
|
|
773e744291 | |
|
|
0f86534e1b | |
|
|
f075968269 | |
|
|
e5bf7cdd58 | |
|
|
fbbf872517 | |
|
|
ae8a4e2cde | |
|
|
f8e4c95077 | |
|
|
ef015c4336 | |
|
|
25d6fdf863 | |
|
|
3203408193 | |
|
|
3b6d221f9e | |
|
|
225bd41f37 |
|
|
@ -90,6 +90,7 @@ public class PositionController extends ControllerBase {
|
|||
}
|
||||
}
|
||||
result.setLanguage(positionLanguageResult);
|
||||
result.setTicketManage(ent.getTicketManage());
|
||||
return ApiResult.success(result);
|
||||
|
||||
|
||||
|
|
@ -121,6 +122,7 @@ public class PositionController extends ControllerBase {
|
|||
// ent.setDataModifyUserNo(AdminUserUtil.getUserNo());
|
||||
// ent.setDataModifyUserName(AdminUserUtil.getUserName());
|
||||
// ent.setDataModifyTime(LocalDateTime.now());
|
||||
ent.setTicketManage(positionDetailDto.getTicketManage());
|
||||
positionService.save(ent);
|
||||
return ApiResult.success(true);
|
||||
}
|
||||
|
|
@ -136,6 +138,7 @@ public class PositionController extends ControllerBase {
|
|||
ent.setDataModifyUserNo(AdminUserUtil.getUserNo());
|
||||
ent.setDataModifyUserName(AdminUserUtil.getUserName());
|
||||
ent.setDataModifyTime(LocalDateTime.now());
|
||||
ent.setTicketManage(positionDetailDto.getTicketManage());
|
||||
positionService.updateById(ent);
|
||||
return ApiResult.success(true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ public class ProductBaseController extends ControllerBase{
|
|||
* @param request 请求参数
|
||||
*/
|
||||
@PostMapping("/publishHonor")
|
||||
public ApiResult<Void> publishHonor(@Valid @RequestBody ProductPublishRequest request){
|
||||
public ApiResult<Void> publishHonor(@Valid @RequestBody BatchPublishRequest request) {
|
||||
productHonorService.publish(request);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
|
@ -233,7 +233,7 @@ public class ProductBaseController extends ControllerBase{
|
|||
* @param request 请求参数
|
||||
*/
|
||||
@PostMapping("/publishCase")
|
||||
public ApiResult<Void> publishCase(@Valid @RequestBody ProductPublishRequest request){
|
||||
public ApiResult<Void> publishCase(@Valid @RequestBody BatchPublishRequest request) {
|
||||
productCaseService.publish(request);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,9 +62,6 @@ public class ProductModelController extends ControllerBase{
|
|||
@Resource
|
||||
private IProductModelParamsItemService productModelParamsItemService;
|
||||
|
||||
@Resource
|
||||
private IProductModelImageService productModelImageService;
|
||||
|
||||
@Resource
|
||||
private IProductModelVideoService productModelVideoService;
|
||||
|
||||
|
|
@ -848,7 +845,7 @@ public class ProductModelController extends ControllerBase{
|
|||
* @param request 请求参数
|
||||
*/
|
||||
@PostMapping("/publishVideo")
|
||||
public ApiResult<Void> publishVideo(@Valid @RequestBody ProductPublishRequest request){
|
||||
public ApiResult<Void> publishVideo(@Valid @RequestBody BatchPublishRequest request) {
|
||||
productModelVideoService.publish(request);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
|
@ -934,7 +931,7 @@ public class ProductModelController extends ControllerBase{
|
|||
* @param request 请求参数
|
||||
*/
|
||||
@PostMapping("/publishFile")
|
||||
public ApiResult<Void> publishFile(@Valid @RequestBody ProductModelPublishRequest request) {
|
||||
public ApiResult<Void> publishFile(@Valid @RequestBody BatchPublishRequest request) {
|
||||
productModelFileService.publish(request);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,10 +49,10 @@ public class TestController extends ControllerBase{
|
|||
}
|
||||
}
|
||||
|
||||
@GetMapping("test")
|
||||
public ApiResult<Boolean> test(@RequestParam Integer userId){
|
||||
return ApiResult.success(ticketCallService.isInCall(userId));
|
||||
}
|
||||
// @GetMapping("test")
|
||||
// public ApiResult<Boolean> test(@RequestParam Integer userId){
|
||||
// return ApiResult.success(ticketCallService.isInCall(userId));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 翻译为日语
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import lombok.Data;
|
|||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -31,6 +30,11 @@ public class PositionDetailDTO {
|
|||
@NotNull(message = "属性不能为空")
|
||||
private Integer positionAttribute;
|
||||
|
||||
/**
|
||||
* 是否授予工单权限
|
||||
*/
|
||||
private Boolean ticketManage;
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,11 @@ public class PositionDetailVO {
|
|||
*/
|
||||
private Integer positionAttribute;
|
||||
|
||||
/**
|
||||
* 是否授予工单权限
|
||||
*/
|
||||
private Boolean ticketManage;
|
||||
|
||||
/**
|
||||
* 创建人-账号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
package com.nflg.mobilebroken.admin.task;
|
||||
|
||||
import com.nflg.mobilebroken.repository.entity.ProductModel;
|
||||
import com.nflg.mobilebroken.repository.service.IProductModelService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ProductScheduledTasks {
|
||||
|
||||
@Resource
|
||||
private IProductModelService productModelService;
|
||||
|
||||
/**
|
||||
* 机型是否新版本设置
|
||||
* 每天午夜12点执行一次
|
||||
*/
|
||||
@Scheduled(cron = "0 0 0 * * ?")
|
||||
public void resetRecommend() {
|
||||
log.info("【产品中心-机型-新品】开始执行");
|
||||
productModelService.lambdaUpdate()
|
||||
.set(ProductModel::getRecommend, false)
|
||||
.eq(ProductModel::getRecommend, true)
|
||||
.gt(ProductModel::getRecommendTime, LocalDateTime.now().minusYears(2))
|
||||
.update();
|
||||
log.info("【产品中心-机型-新品】执行完毕");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,5 @@
|
|||
package com.nflg.mobilebroken.common.constant;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Constant {
|
||||
|
||||
public static final String FROM_APP = "app";
|
||||
|
|
@ -112,9 +108,8 @@ public class Constant {
|
|||
|
||||
public static final String DICTIONARY_ITEM_ACCOUNT_HAS_EXPIRED="AccountHasExpired";
|
||||
|
||||
public static final List<String> ROLE_CODE_TICKET_MANAGERS = ListUtil.of(TITLE_DIRECTOROF_BUSINESS_UNIT,TITLE_TECHNICAL_MANAGER,TITLE_SALES_MANAGER,TITLE_TEST_MANAGER,TITLE_QUALITY_MANAGER,DICTIONARY_TYPE_TITLE_CQM);
|
||||
|
||||
public static final String DICTIONARY_SOLUTION_MEASURES = "SolutionMeasures";
|
||||
|
||||
public static final String DICTIONARY_SOLUTION_REVIEW_DEPARTMENT = "SolutionReviewDepartment";
|
||||
|
||||
public static final String DICTIONARY_DEVICE_STATE ="deviceState";
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
package com.nflg.mobilebroken.common.pojo.request;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ProductModelPublishRequest {
|
||||
@Accessors(chain = true)
|
||||
public class BatchPublishRequest {
|
||||
|
||||
@NotEmpty
|
||||
private List<Integer> ids;
|
||||
|
|
@ -2,7 +2,6 @@ package com.nflg.mobilebroken.common.pojo.request;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -18,6 +17,5 @@ public class FileDefaultConfigRequest {
|
|||
/**
|
||||
* 配置项
|
||||
*/
|
||||
@NotEmpty
|
||||
private List<FileDefaultConfigItemRequest> items;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import lombok.Data;
|
|||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class ProductModelAddRequest {
|
||||
|
|
@ -48,6 +49,11 @@ public class ProductModelAddRequest {
|
|||
*/
|
||||
private Boolean recommend;
|
||||
|
||||
/**
|
||||
* 新品过期时间
|
||||
*/
|
||||
private LocalDateTime recommendExpireTime;
|
||||
|
||||
/**
|
||||
* 是否发布
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@ package com.nflg.mobilebroken.common.pojo.vo;
|
|||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Data
|
||||
@Accessors
|
||||
|
|
@ -56,6 +58,15 @@ public class FrontendProductModelSearchVO {
|
|||
*/
|
||||
private Boolean recommend;
|
||||
|
||||
public Boolean getRecommend() {
|
||||
return recommend && (Objects.nonNull(recommendExpireTime) && LocalDateTime.now().isBefore(recommendExpireTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新品过期时间
|
||||
*/
|
||||
private LocalDateTime recommendExpireTime;
|
||||
|
||||
/**
|
||||
* 机型介绍
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -54,6 +54,11 @@ public class ProductModelSearchVO {
|
|||
*/
|
||||
private Boolean recommend;
|
||||
|
||||
/**
|
||||
* 新品过期时间
|
||||
*/
|
||||
private LocalDateTime recommendExpireTime;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@ package com.nflg.mobilebroken.common.pojo.vo;
|
|||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
|
|
@ -26,6 +28,15 @@ public class ProductModelVO {
|
|||
*/
|
||||
private Boolean recommend;
|
||||
|
||||
public Boolean getRecommend() {
|
||||
return recommend && (Objects.nonNull(recommendExpireTime) && LocalDateTime.now().isBefore(recommendExpireTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新品过期时间
|
||||
*/
|
||||
private LocalDateTime recommendExpireTime;
|
||||
|
||||
/**
|
||||
* 主要参数列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# Nacos 地址
|
||||
nacos.server-addr=${NACOS_SERVER_ADDR:112.74.186.154:8848}
|
||||
nacos.server-addr=${NACOS_SERVER_ADDR:192.168.0.194:8848}
|
||||
#nacos.server-addr=192.168.0.194:8848
|
||||
#spring.cloud.nacos.discovery.username=nacos
|
||||
#spring.cloud.nacos.discovery.password=ZLQ8vgmjoJ4?EPJ4]fs_
|
||||
|
|
|
|||
|
|
@ -65,9 +65,9 @@ public class ProductModel implements Serializable {
|
|||
private Boolean recommend;
|
||||
|
||||
/**
|
||||
* 设置为新品的时间
|
||||
* 新品过期时间
|
||||
*/
|
||||
private LocalDateTime recommendTime;
|
||||
private LocalDateTime recommendExpireTime;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class ProductModelFileItem implements Serializable {
|
|||
private Integer modelId;
|
||||
|
||||
/**
|
||||
* 产品机型id
|
||||
* 产品机型文件id
|
||||
*/
|
||||
private Integer modelFileId;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@ package com.nflg.mobilebroken.repository.entity;
|
|||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 职位管理
|
||||
|
|
@ -85,4 +86,9 @@ public class TBasePosition implements Serializable {
|
|||
* 语言-json
|
||||
*/
|
||||
private String positionLanguage;
|
||||
|
||||
/**
|
||||
* 是否授予工单权限
|
||||
*/
|
||||
private Boolean ticketManage;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.nflg.mobilebroken.repository.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Getter;
|
||||
|
|
@ -35,16 +34,16 @@ public class TicketCall implements Serializable {
|
|||
*/
|
||||
private Integer ticketId;
|
||||
|
||||
/**
|
||||
* 呼叫来源,app或者admin
|
||||
*/
|
||||
@TableField("`from`")
|
||||
private String from;
|
||||
|
||||
/**
|
||||
* 呼叫人id
|
||||
*/
|
||||
private Integer callerUserId;
|
||||
// /**
|
||||
// * 呼叫来源,app或者admin
|
||||
// */
|
||||
// @TableField("`from`")
|
||||
// private String from;
|
||||
//
|
||||
// /**
|
||||
// * 呼叫人id
|
||||
// */
|
||||
// private Integer callerUserId;
|
||||
|
||||
/**
|
||||
* 状态,0-呼叫中;1-通话中;2-已结束
|
||||
|
|
|
|||
|
|
@ -20,5 +20,7 @@ public interface AdminUserMapper extends BaseMapper<AdminUser> {
|
|||
|
||||
List<AdminUserSimpleVO> getSimples(List<Integer> userIds);
|
||||
|
||||
List<Integer> getTickerMangagers(List<String> titleCodes);
|
||||
List<Integer> getTickerMangagers();
|
||||
|
||||
List<Integer> getCQMIds(String titleCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,5 +13,5 @@ import com.nflg.mobilebroken.repository.entity.TicketCallJoin;
|
|||
*/
|
||||
public interface TicketCallJoinMapper extends BaseMapper<TicketCallJoin> {
|
||||
|
||||
boolean isInCall(Integer userId);
|
||||
boolean isInCall(Integer ticketId, String from, Integer userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public interface IProductCaseService extends IService<ProductCase> {
|
|||
|
||||
void delete(@Valid BatchDeleteRequest request);
|
||||
|
||||
void publish(@Valid ProductPublishRequest request);
|
||||
void publish(@Valid BatchPublishRequest request);
|
||||
|
||||
ProductCaseInfoVO getInfo(@Valid @NotNull Integer caseId);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public interface IProductHonorService extends IService<ProductHonor> {
|
|||
|
||||
List<ProductHonorVO> get(String language);
|
||||
|
||||
void publish(@Valid ProductPublishRequest request);
|
||||
void publish(@Valid BatchPublishRequest request);
|
||||
|
||||
void delete(@Valid BatchDeleteRequest request);
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.nflg.mobilebroken.common.pojo.request.FileDefaultConfigRequest;
|
|||
import com.nflg.mobilebroken.common.pojo.request.ProductModelFileItemAddRequest;
|
||||
import com.nflg.mobilebroken.repository.entity.ProductModelFileItem;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -24,4 +25,6 @@ public interface IProductModelFileItemService extends IService<ProductModelFileI
|
|||
void setFileDefaultCondig(FileDefaultConfigRequest request);
|
||||
|
||||
List<ProductModelFileItem> getPublishedByLanguage(Integer modelId);
|
||||
|
||||
void removeByFileIds(@NotEmpty List<Integer> ids);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public interface IProductModelFileService extends IService<ProductModelFile> {
|
|||
|
||||
void delete(@Valid BatchDeleteRequest request);
|
||||
|
||||
void publish(@Valid ProductModelPublishRequest request);
|
||||
void publish(@Valid BatchPublishRequest request);
|
||||
|
||||
IPage<ProductModelFile> getList(@Valid ProductModelImageSearchRequest request);
|
||||
|
||||
|
|
|
|||
|
|
@ -39,5 +39,5 @@ public interface IProductModelHotimageService extends IService<ProductModelHotim
|
|||
|
||||
void copyTo(Integer oldId, Integer newId);
|
||||
|
||||
ProductHotImageInfoVO getListByLanguage(Integer modelId);
|
||||
ProductHotImageInfoVO getListByLanguage(Integer modelId, String language);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public interface IProductModelImageService extends IService<ProductModelImage> {
|
|||
|
||||
void delete(@Valid BatchDeleteRequest request);
|
||||
|
||||
void publish(@Valid ProductPublishRequest request);
|
||||
void publish(@Valid BatchPublishRequest request);
|
||||
|
||||
IPage<ProductModelImage> getList(@Valid ProductModelImageSearchRequest request);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public interface IProductModelVideoService extends IService<ProductModelVideo> {
|
|||
|
||||
void delete(@Valid BatchDeleteRequest request);
|
||||
|
||||
void publish(@Valid ProductPublishRequest request);
|
||||
void publish(@Valid BatchPublishRequest request);
|
||||
|
||||
IPage<ProductModelVideo> getList(@Valid ProductModelImageSearchRequest request);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import javax.validation.constraints.NotNull;
|
|||
*/
|
||||
public interface ITicketCallJoinService extends IService<TicketCallJoin> {
|
||||
|
||||
boolean isInCall(Integer userId);
|
||||
boolean isInCall(Integer ticketId, String from, Integer userId);
|
||||
|
||||
void join(@Valid @NotNull Integer ticketId, Integer userId, String from);
|
||||
|
||||
|
|
@ -25,6 +25,4 @@ public interface ITicketCallJoinService extends IService<TicketCallJoin> {
|
|||
boolean hangUp(Integer callId, Integer userId, String from, boolean reject);
|
||||
|
||||
void add(Integer callId, Integer userId, String from);
|
||||
|
||||
void hangUpAll(Integer id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@ import javax.validation.constraints.NotNull;
|
|||
*/
|
||||
public interface ITicketCallService extends IService<TicketCall> {
|
||||
|
||||
boolean isInCall(Integer userId);
|
||||
// boolean isInCall(Integer userId);
|
||||
|
||||
void add(Integer ticketId, Integer callerUserId,String callerUserFrom, Integer calledUserId, String calledUserFrom);
|
||||
|
||||
boolean hangUp(@NotNull Integer ticketId, Integer userId, String from, boolean reject);
|
||||
// boolean hangUp(@NotNull Integer ticketId, Integer userId, String from, boolean reject);
|
||||
|
||||
TicketCall getLast(@NotNull Integer ticketId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
|
@ -351,12 +350,12 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|||
|
||||
@Override
|
||||
public List<Integer> getTickerMangagers() {
|
||||
return baseMapper.getTickerMangagers(Constant.ROLE_CODE_TICKET_MANAGERS);
|
||||
return baseMapper.getTickerMangagers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> getCQMIds() {
|
||||
return baseMapper.getTickerMangagers(ListUtil.of(Constant.DICTIONARY_TYPE_TITLE_CQM));
|
||||
return baseMapper.getCQMIds(Constant.DICTIONARY_TYPE_TITLE_CQM);
|
||||
}
|
||||
|
||||
private String getDepartmentName(Long departmentId) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
|
@ -27,6 +29,7 @@ import javax.annotation.Resource;
|
|||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -54,8 +57,8 @@ public class ProductCaseServiceImpl extends ServiceImpl<ProductCaseMapper, Produ
|
|||
.setCreateTime(LocalDateTime.now());
|
||||
save(entity);
|
||||
if (request.getPublish()) {
|
||||
publish(new ProductPublishRequest()
|
||||
.setId(entity.getId())
|
||||
publish(new BatchPublishRequest()
|
||||
.setIds(List.of(entity.getId()))
|
||||
.setState(PublishState.Published.getState()));
|
||||
}
|
||||
productCaseInfoService.add(entity.getId(), request.getItems());
|
||||
|
|
@ -79,8 +82,8 @@ public class ProductCaseServiceImpl extends ServiceImpl<ProductCaseMapper, Produ
|
|||
info.setUpdateTime(LocalDateTime.now());
|
||||
updateById(info);
|
||||
if (request.getPublish()) {
|
||||
publish(new ProductPublishRequest()
|
||||
.setId(info.getId())
|
||||
publish(new BatchPublishRequest()
|
||||
.setIds(List.of(info.getId()))
|
||||
.setState(PublishState.Published.getState()));
|
||||
}
|
||||
productCaseInfoService.update(request.getItems());
|
||||
|
|
@ -145,14 +148,20 @@ public class ProductCaseServiceImpl extends ServiceImpl<ProductCaseMapper, Produ
|
|||
productCaseInfoService.delete(request.getIds());
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void publish(ProductPublishRequest request) {
|
||||
ProductCase info = getById(request.getId());
|
||||
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的数据");
|
||||
VUtils.trueThrowBusinessError(Objects.equals(info.getState(), request.getState()))
|
||||
.throwMessage("请勿重复操作");
|
||||
public void publish(BatchPublishRequest request) {
|
||||
List<ProductCase> list = listByIds(request.getIds());
|
||||
if (Objects.equals(request.getState(), PublishState.Published.getState())) {
|
||||
VUtils.trueThrowBusinessError(!info.getEnable()).throwMessage("不能发布已禁用的数据");
|
||||
List<String> names = list.stream().filter(ph -> !ph.getEnable()).map(ProductCase::getTitle).collect(Collectors.toList());
|
||||
VUtils.trueThrowBusinessError(CollectionUtil.isNotEmpty(names)).throwMessage("以下案例被禁用不能发布:" + StrUtil.join(",", names));
|
||||
}
|
||||
list.forEach(it -> publish(it, request.getState()));
|
||||
}
|
||||
|
||||
private void publish(ProductCase info, Integer state) {
|
||||
if (Objects.equals(state, info.getState())) return;
|
||||
if (Objects.equals(state, PublishState.Published.getState())) {
|
||||
info.setState(PublishState.Published.getState());
|
||||
info.setPublishBy(AdminUserUtil.getUserName());
|
||||
info.setPublishTime(LocalDateTime.now());
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
|
@ -23,6 +24,7 @@ import javax.annotation.Resource;
|
|||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -55,8 +57,8 @@ public class ProductHonorServiceImpl extends ServiceImpl<ProductHonorMapper, Pro
|
|||
.setCreateTime(LocalDateTime.now());
|
||||
save(productHonor);
|
||||
if (request.getPublish()) {
|
||||
publish(new ProductPublishRequest()
|
||||
.setId(productHonor.getId())
|
||||
publish(new BatchPublishRequest()
|
||||
.setIds(List.of(productHonor.getId()))
|
||||
.setState(PublishState.Published.getState()));
|
||||
}
|
||||
productHonorInfoService.add(productHonor.getId(), request.getItems());
|
||||
|
|
@ -86,8 +88,8 @@ public class ProductHonorServiceImpl extends ServiceImpl<ProductHonorMapper, Pro
|
|||
.eq(ProductHonor::getId, request.getId())
|
||||
.update();
|
||||
if (request.getPublish()) {
|
||||
publish(new ProductPublishRequest()
|
||||
.setId(request.getId())
|
||||
publish(new BatchPublishRequest()
|
||||
.setIds(List.of(request.getId()))
|
||||
.setState(PublishState.Published.getState()));
|
||||
}
|
||||
productHonorInfoService.update(request.getItems());
|
||||
|
|
@ -105,14 +107,20 @@ public class ProductHonorServiceImpl extends ServiceImpl<ProductHonorMapper, Pro
|
|||
return baseMapper.get(language);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void publish(ProductPublishRequest request) {
|
||||
ProductHonor info = getById(request.getId());
|
||||
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的数据");
|
||||
VUtils.trueThrowBusinessError(Objects.equals(info.getState(), request.getState()))
|
||||
.throwMessage("请勿重复操作");
|
||||
public void publish(BatchPublishRequest request) {
|
||||
List<ProductHonor> list = listByIds(request.getIds());
|
||||
if (Objects.equals(request.getState(), PublishState.Published.getState())) {
|
||||
VUtils.trueThrowBusinessError(!info.getEnable()).throwMessage("不能发布已禁用的数据");
|
||||
List<String> names = list.stream().filter(ph -> !ph.getEnable()).map(ProductHonor::getTitle).collect(Collectors.toList());
|
||||
VUtils.trueThrowBusinessError(CollectionUtil.isNotEmpty(names)).throwMessage("以下荣誉被禁用不能发布:" + StrUtil.join(",", names));
|
||||
}
|
||||
list.forEach(it -> publish(it, request.getState()));
|
||||
}
|
||||
|
||||
private void publish(ProductHonor info, Integer state) {
|
||||
if (Objects.equals(state, info.getState())) return;
|
||||
if (Objects.equals(state, PublishState.Published.getState())) {
|
||||
info.setState(PublishState.Published.getState());
|
||||
info.setPublishBy(AdminUserUtil.getUserName());
|
||||
info.setPublishTime(LocalDateTime.now());
|
||||
|
|
|
|||
|
|
@ -72,18 +72,27 @@ public class ProductModelFileItemServiceImpl extends ServiceImpl<ProductModelFil
|
|||
.set(ProductModelFileItem::getShowInList, false)
|
||||
.eq(ProductModelFileItem::getModelId, request.getModelId())
|
||||
.update();
|
||||
request.getItems().forEach(item -> {
|
||||
if (Objects.nonNull(item.getFileItemId())) {
|
||||
lambdaUpdate()
|
||||
.set(ProductModelFileItem::getShowInList, true)
|
||||
.eq(ProductModelFileItem::getId, item.getFileItemId())
|
||||
.update();
|
||||
}
|
||||
});
|
||||
if (CollectionUtil.isNotEmpty(request.getItems())) {
|
||||
request.getItems().forEach(item -> {
|
||||
if (Objects.nonNull(item.getFileItemId())) {
|
||||
lambdaUpdate()
|
||||
.set(ProductModelFileItem::getShowInList, true)
|
||||
.eq(ProductModelFileItem::getId, item.getFileItemId())
|
||||
.update();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductModelFileItem> getPublishedByLanguage(Integer modelId) {
|
||||
return baseMapper.getPublishedByLanguage(modelId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeByFileIds(List<Integer> ids) {
|
||||
remove(new LambdaQueryWrapper<ProductModelFileItem>()
|
||||
.in(ProductModelFileItem::getModelFileId, ids)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -116,6 +116,7 @@ public class ProductModelFileServiceImpl extends ServiceImpl<ProductModelFileMap
|
|||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void delete(BatchDeleteRequest request) {
|
||||
VUtils.trueThrowBusinessError(lambdaQuery()
|
||||
|
|
@ -128,11 +129,12 @@ public class ProductModelFileServiceImpl extends ServiceImpl<ProductModelFileMap
|
|||
.ne(ProductModelFile::getCreateBy, AdminUserUtil.getUserName())
|
||||
.exists()).throwMessage("不能删除其他人创建的数据");
|
||||
removeByIds(request.getIds());
|
||||
productModelFileItemService.removeByFileIds(request.getIds());
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void publish(ProductModelPublishRequest request) {
|
||||
public void publish(BatchPublishRequest request) {
|
||||
List<ProductModelFile> datas = listByIds(request.getIds());
|
||||
datas.removeIf(item -> !item.getEnable());
|
||||
datas.forEach(info -> {
|
||||
|
|
@ -247,12 +249,12 @@ public class ProductModelFileServiceImpl extends ServiceImpl<ProductModelFileMap
|
|||
.setLanguageCode(language.getCode())
|
||||
.setLanguageName(language.getName())
|
||||
.setItems(list.stream().filter(item -> StrUtil.equals(language.getCode(), item.getLanguageCode()))
|
||||
.map(item -> {
|
||||
return new FileDefaultConfigItemVO()
|
||||
.setId(item.getId())
|
||||
.setName(item.getName())
|
||||
.setSelected(item.getShowInList());
|
||||
}).collect(Collectors.toList()));
|
||||
.map(item -> new FileDefaultConfigItemVO()
|
||||
.setId(item.getId())
|
||||
.setName(item.getName())
|
||||
.setSelected(item.getShowInList())
|
||||
).collect(Collectors.toList())
|
||||
);
|
||||
vos.add(vo);
|
||||
});
|
||||
return vos;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
|
@ -11,11 +15,15 @@ import com.nflg.mobilebroken.common.pojo.vo.ProductHotImageInfoVO;
|
|||
import com.nflg.mobilebroken.common.util.AdminUserUtil;
|
||||
import com.nflg.mobilebroken.common.util.VUtils;
|
||||
import com.nflg.mobilebroken.repository.entity.ProductModelHotimage;
|
||||
import com.nflg.mobilebroken.repository.entity.ProductPartInfo;
|
||||
import com.nflg.mobilebroken.repository.mapper.ProductModelHotimageMapper;
|
||||
import com.nflg.mobilebroken.repository.service.IProductModelHotimageService;
|
||||
import com.nflg.mobilebroken.repository.service.IProductPartInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
@ -30,6 +38,9 @@ import java.util.Objects;
|
|||
@Service
|
||||
public class ProductModelHotimageServiceImpl extends ServiceImpl<ProductModelHotimageMapper, ProductModelHotimage> implements IProductModelHotimageService {
|
||||
|
||||
@Resource
|
||||
private IProductPartInfoService productPartInfoService;
|
||||
|
||||
@Override
|
||||
public Integer add(ProductModelHotImageAddRequest request) {
|
||||
ProductModelHotimage info=new ProductModelHotimage()
|
||||
|
|
@ -143,10 +154,33 @@ public class ProductModelHotimageServiceImpl extends ServiceImpl<ProductModelHot
|
|||
}
|
||||
|
||||
@Override
|
||||
public ProductHotImageInfoVO getListByLanguage(Integer modelId) {
|
||||
return Convert.convert(ProductHotImageInfoVO.class,lambdaQuery()
|
||||
public ProductHotImageInfoVO getListByLanguage(Integer modelId, String language) {
|
||||
ProductModelHotimage info = lambdaQuery()
|
||||
.eq(ProductModelHotimage::getModelId, modelId)
|
||||
.eq(ProductModelHotimage::getState, PublishState.Published.getState())
|
||||
.one());
|
||||
.one();
|
||||
if (Objects.isNull(info)) return null;
|
||||
JSONArray jsonArray = JSONUtil.parseArray(info.getData());
|
||||
List<JSONObject> jsonObjects = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(jsonArray)) {
|
||||
List<Integer> ids = new ArrayList<>();
|
||||
jsonArray.forEach(item -> {
|
||||
JSONObject jsonObject = JSONUtil.parseObj(item);
|
||||
ids.add(jsonObject.getInt("id"));
|
||||
});
|
||||
List<ProductPartInfo> partInfos = productPartInfoService.lambdaQuery().eq(ProductPartInfo::getLanguageCode, language).in(ProductPartInfo::getPartId, ids).list();
|
||||
jsonArray.forEach(obj -> {
|
||||
JSONObject jsonObject = (JSONObject) obj;
|
||||
ProductPartInfo pi = partInfos.stream().filter(partInfo -> Objects.equals(partInfo.getPartId(), jsonObject.getInt("id"))).findFirst().orElse(null);
|
||||
if (Objects.nonNull(pi) && StrUtil.isNotBlank(pi.getName()) && Objects.equals(jsonObject.getInt("id"), pi.getPartId())) {
|
||||
jsonObject.set("name", pi.getName());
|
||||
}
|
||||
jsonObjects.add(jsonObject);
|
||||
});
|
||||
}
|
||||
return new ProductHotImageInfoVO()
|
||||
.setImage(info.getImage())
|
||||
.setImgRect(info.getImgRect())
|
||||
.setData(JSONUtil.toJsonStr(jsonObjects));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
|
@ -25,6 +26,7 @@ import javax.annotation.Resource;
|
|||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -89,13 +91,18 @@ public class ProductModelImageServiceImpl extends ServiceImpl<ProductModelImageM
|
|||
}
|
||||
|
||||
@Override
|
||||
public void publish(ProductPublishRequest request) {
|
||||
ProductModelImage info = getById(request.getId());
|
||||
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的数据");
|
||||
VUtils.trueThrowBusinessError(Objects.equals(info.getState(), request.getState()))
|
||||
.throwMessage("请勿重复操作");
|
||||
public void publish(BatchPublishRequest request) {
|
||||
List<ProductModelImage> list = listByIds(request.getIds());
|
||||
if (Objects.equals(request.getState(), PublishState.Published.getState())) {
|
||||
VUtils.trueThrowBusinessError(!info.getEnable()).throwMessage("不能发布已禁用的数据");
|
||||
List<String> names = list.stream().filter(ph -> !ph.getEnable()).map(ProductModelImage::getName).collect(Collectors.toList());
|
||||
VUtils.trueThrowBusinessError(CollectionUtil.isNotEmpty(names)).throwMessage("以下图片被禁用不能发布:" + StrUtil.join(",", names));
|
||||
}
|
||||
list.forEach(it -> publish(it, request.getState()));
|
||||
}
|
||||
|
||||
private void publish(ProductModelImage info, Integer state) {
|
||||
if (Objects.equals(state, info.getState())) return;
|
||||
if (Objects.equals(state, PublishState.Published.getState())) {
|
||||
info.setState(PublishState.Published.getState());
|
||||
info.setPublishBy(AdminUserUtil.getUserName());
|
||||
info.setPublishTime(LocalDateTime.now());
|
||||
|
|
|
|||
|
|
@ -67,13 +67,11 @@ public class ProductModelServiceImpl extends ServiceImpl<ProductModelMapper, Pro
|
|||
// .setBatchNumber(request.getBatchNumber())
|
||||
.setNo(request.getNo())
|
||||
.setRecommend(request.getRecommend())
|
||||
.setRecommendExpireTime(request.getRecommendExpireTime())
|
||||
.setSort(RandomUtil.randomInt(0,10000))
|
||||
.setImage(request.getImage())
|
||||
.setCreateBy(AdminUserUtil.getUserName())
|
||||
.setCreateTime(LocalDateTime.now());
|
||||
if (request.getRecommend()){
|
||||
productModel.setRecommendTime(LocalDateTime.now());
|
||||
}
|
||||
save(productModel);
|
||||
if (request.getPublish()) {
|
||||
publish(new ProductPublishRequest()
|
||||
|
|
@ -95,15 +93,8 @@ public class ProductModelServiceImpl extends ServiceImpl<ProductModelMapper, Pro
|
|||
} else {
|
||||
info.setNo(request.getNo());
|
||||
// info.setSort(request.getSort());
|
||||
if (request.getRecommend()) {
|
||||
if (!info.getRecommend()) {
|
||||
info.setRecommend(true);
|
||||
info.setRecommendTime(LocalDateTime.now());
|
||||
}
|
||||
} else {
|
||||
info.setRecommend(false);
|
||||
info.setRecommendTime(null);
|
||||
}
|
||||
info.setRecommend(request.getRecommend());
|
||||
info.setRecommendExpireTime(request.getRecommendExpireTime());
|
||||
info.setModuleId(request.getModuleId());
|
||||
info.setSeriesNumber(request.getSeriesNumber());
|
||||
info.setTypeNumber(request.getTypeNumber());
|
||||
|
|
@ -205,6 +196,7 @@ public class ProductModelServiceImpl extends ServiceImpl<ProductModelMapper, Pro
|
|||
.setId(item.getId())
|
||||
.setNo(item.getNo())
|
||||
.setRecommend(item.getRecommend())
|
||||
.setRecommendExpireTime(item.getRecommendExpireTime())
|
||||
.setImage(item.getImage())
|
||||
.setParams(productPartParamsService.getMainListByLanguage(item.getId(), language))
|
||||
.setFile(productModelFileService.getDefaultByLanguage(item.getId(), language)))
|
||||
|
|
@ -306,7 +298,7 @@ public class ProductModelServiceImpl extends ServiceImpl<ProductModelMapper, Pro
|
|||
.setDesc(Objects.isNull(intro)?"":intro.getDesc())
|
||||
.setFeature(Objects.isNull(intro)?"":intro.getFeature())
|
||||
.setMerits(Objects.isNull(intro)?"":intro.getMerits())
|
||||
.setHotImage(productModelHotimageService.getListByLanguage(modelId))
|
||||
.setHotImage(productModelHotimageService.getListByLanguage(modelId, language))
|
||||
.setParams(productPartParamsService.getAListByLanguage(modelId, language))
|
||||
.setMainParams(productPartParamsService.getMainListByLanguage(modelId, language))
|
||||
.setImportantParams(productPartParamsService.getImportantListByLanguage(modelId, language))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
|
@ -25,6 +26,7 @@ import javax.annotation.Resource;
|
|||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -110,26 +112,31 @@ public class ProductModelVideoServiceImpl extends ServiceImpl<ProductModelVideoM
|
|||
}
|
||||
|
||||
@Override
|
||||
public void publish(ProductPublishRequest request) {
|
||||
ProductModelVideo info = getById(request.getId());
|
||||
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的数据");
|
||||
VUtils.trueThrowBusinessError(Objects.equals(info.getState(), request.getState()))
|
||||
.throwMessage("请勿重复操作");
|
||||
public void publish(BatchPublishRequest request) {
|
||||
List<ProductModelVideo> list = listByIds(request.getIds());
|
||||
if (Objects.equals(request.getState(), PublishState.Published.getState())) {
|
||||
VUtils.trueThrowBusinessError(!info.getEnable()).throwMessage("不能发布已禁用的数据");
|
||||
List<String> names = list.stream().filter(ph -> !ph.getEnable()).map(ProductModelVideo::getName).collect(Collectors.toList());
|
||||
VUtils.trueThrowBusinessError(CollectionUtil.isNotEmpty(names)).throwMessage("以下视频被禁用不能发布:" + StrUtil.join(",", names));
|
||||
}
|
||||
list.forEach(it -> publish(it, request.getState()));
|
||||
}
|
||||
|
||||
private void publish(ProductModelVideo info, Integer state) {
|
||||
if (Objects.equals(state, info.getState())) return;
|
||||
if (Objects.equals(state, PublishState.Published.getState())) {
|
||||
info.setState(PublishState.Published.getState());
|
||||
info.setPublishBy(AdminUserUtil.getUserName());
|
||||
info.setPublishTime(LocalDateTime.now());
|
||||
lambdaUpdate()
|
||||
.set(ProductModelVideo::getState, PublishState.Obsolete.getState())
|
||||
.eq(ProductModelVideo::getModelId, info.getModelId())
|
||||
.eq(ProductModelVideo::getBatchNumber,info.getBatchNumber())
|
||||
.eq(ProductModelVideo::getBatchNumber, info.getBatchNumber())
|
||||
.eq(ProductModelVideo::getState, PublishState.Published.getState())
|
||||
.update();
|
||||
} else {
|
||||
ProductModelVideo obsolete = lambdaQuery()
|
||||
.eq(ProductModelVideo::getModelId, info.getModelId())
|
||||
.eq(ProductModelVideo::getBatchNumber,info.getBatchNumber())
|
||||
.eq(ProductModelVideo::getBatchNumber, info.getBatchNumber())
|
||||
.eq(ProductModelVideo::getState, PublishState.Obsolete.getState())
|
||||
.orderByDesc(ProductModelVideo::getPublishTime)
|
||||
.last("Limit 1")
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ public class TicketCallJoinServiceImpl extends ServiceImpl<TicketCallJoinMapper,
|
|||
private ITicketCallService ticketCallService;
|
||||
|
||||
@Override
|
||||
public boolean isInCall(Integer userId) {
|
||||
return baseMapper.isInCall(userId);
|
||||
public boolean isInCall(Integer ticketId, String from, Integer userId) {
|
||||
return baseMapper.isInCall(ticketId, from, userId);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
@ -84,7 +84,14 @@ public class TicketCallJoinServiceImpl extends ServiceImpl<TicketCallJoinMapper,
|
|||
.set(TicketCallJoin::getState, 2)
|
||||
.set(reject, TicketCallJoin::getHangupTime, LocalDateTime.now())
|
||||
.eq(TicketCallJoin::getCallId, callId)
|
||||
.ne(TicketCallJoin::getFrom, from)
|
||||
.update();
|
||||
} else {
|
||||
lambdaUpdate()
|
||||
.set(TicketCallJoin::getState, 2)
|
||||
.set(reject, TicketCallJoin::getHangupTime, LocalDateTime.now())
|
||||
.eq(TicketCallJoin::getCallId, callId)
|
||||
.eq(TicketCallJoin::getUserId, userId)
|
||||
.eq(TicketCallJoin::getFrom, from)
|
||||
.update();
|
||||
}
|
||||
if (!lambdaQuery()
|
||||
|
|
@ -119,12 +126,4 @@ public class TicketCallJoinServiceImpl extends ServiceImpl<TicketCallJoinMapper,
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hangUpAll(Integer id) {
|
||||
lambdaUpdate()
|
||||
.set(TicketCallJoin::getState, 2)
|
||||
.eq(TicketCallJoin::getCallId, id)
|
||||
.update();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nflg.mobilebroken.common.constant.Constant;
|
||||
import com.nflg.mobilebroken.repository.entity.TicketCall;
|
||||
import com.nflg.mobilebroken.repository.entity.TicketCallJoin;
|
||||
import com.nflg.mobilebroken.repository.mapper.TicketCallMapper;
|
||||
|
|
@ -13,7 +11,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -29,26 +26,33 @@ public class TicketCallServiceImpl extends ServiceImpl<TicketCallMapper, TicketC
|
|||
@Resource
|
||||
private ITicketCallJoinService ticketCallJoinService;
|
||||
|
||||
@Override
|
||||
public boolean isInCall(Integer userId) {
|
||||
return lambdaQuery()
|
||||
.eq(TicketCall::getState, 1)
|
||||
.eq(TicketCall::getCallerUserId, userId)
|
||||
.exists()
|
||||
||
|
||||
ticketCallJoinService.isInCall(userId);
|
||||
}
|
||||
// @Override
|
||||
// public boolean isInCall(Integer userId) {
|
||||
// return lambdaQuery()
|
||||
// .eq(TicketCall::getState, 1)
|
||||
// .eq(TicketCall::getCallerUserId, userId)
|
||||
// .exists()
|
||||
// ||
|
||||
// ticketCallJoinService.isInCall(userId);
|
||||
// }
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void add(Integer ticketId, Integer callerUserId,String callerUserFrom, Integer calledUserId, String calledUserFrom) {
|
||||
TicketCall ticketCall = new TicketCall()
|
||||
.setTicketId(ticketId)
|
||||
.setCallerUserId(callerUserId)
|
||||
// .setCallerUserId(callerUserId)
|
||||
.setState(0)
|
||||
.setFrom(callerUserFrom)
|
||||
// .setFrom(callerUserFrom)
|
||||
.setCreateTime(LocalDateTime.now());
|
||||
save(ticketCall);
|
||||
ticketCallJoinService.save(new TicketCallJoin()
|
||||
.setCallId(ticketCall.getId())
|
||||
.setFrom(callerUserFrom)
|
||||
.setUserId(callerUserId)
|
||||
.setState(0)
|
||||
.setCreateTime(LocalDateTime.now())
|
||||
);
|
||||
ticketCallJoinService.save(new TicketCallJoin()
|
||||
.setCallId(ticketCall.getId())
|
||||
.setFrom(calledUserFrom)
|
||||
|
|
@ -58,24 +62,24 @@ public class TicketCallServiceImpl extends ServiceImpl<TicketCallMapper, TicketC
|
|||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hangUp(Integer ticketId, Integer userId, String from, boolean reject) {
|
||||
TicketCall ticketCall = getLast(ticketId);
|
||||
boolean flag = false;
|
||||
if (Objects.nonNull(ticketCall)){
|
||||
if ((Objects.equals(ticketCall.getCallerUserId(), userId) && StrUtil.equals(ticketCall.getFrom(), Constant.FROM_APP))
|
||||
|| ticketCallJoinService.allIsHangUp(ticketCall.getId())){
|
||||
ticketCall.setState(2);
|
||||
ticketCallJoinService.hangUpAll(ticketCall.getId());
|
||||
if (reject) {
|
||||
ticketCall.setHangupTime(LocalDateTime.now());
|
||||
}
|
||||
updateById(ticketCall);
|
||||
}
|
||||
flag=ticketCallJoinService.hangUp(ticketCall.getId(), userId, from, reject);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
// @Override
|
||||
// public boolean hangUp(Integer ticketId, Integer userId, String from, boolean reject) {
|
||||
// TicketCall ticketCall = getLast(ticketId);
|
||||
// boolean flag = false;
|
||||
// if (Objects.nonNull(ticketCall)){
|
||||
// if ((Objects.equals(ticketCall.getCallerUserId(), userId) && StrUtil.equals(ticketCall.getFrom(), Constant.FROM_APP))
|
||||
// || ticketCallJoinService.allIsHangUp(ticketCall.getId())){
|
||||
// ticketCall.setState(2);
|
||||
// ticketCallJoinService.hangUpAll(ticketCall.getId());
|
||||
// if (reject) {
|
||||
// ticketCall.setHangupTime(LocalDateTime.now());
|
||||
// }
|
||||
// updateById(ticketCall);
|
||||
// }
|
||||
// flag=ticketCallJoinService.hangUp(ticketCall.getId(), userId, from, reject);
|
||||
// }
|
||||
// return flag;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public TicketCall getLast(Integer ticketId) {
|
||||
|
|
|
|||
|
|
@ -28,9 +28,13 @@
|
|||
SELECT au.id
|
||||
FROM t_base_position p
|
||||
INNER JOIN admin_user au ON au.title_id=p.id
|
||||
WHERE au.state=1 AND au.is_del=0 AND p.position_code IN
|
||||
<foreach collection="titleCodes" item="titleCode" separator="," open="(" close=")">
|
||||
#{titleCode}
|
||||
</foreach>
|
||||
WHERE au.state=1 AND au.is_del=0 AND p.ticket_manage
|
||||
</select>
|
||||
|
||||
<select id="getCQMIds" resultType="java.lang.Integer">
|
||||
SELECT au.id
|
||||
FROM t_base_position p
|
||||
INNER JOIN admin_user au ON au.title_id=p.id
|
||||
WHERE au.state=1 AND au.is_del=0 AND p.position_code=#{titleCode}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@
|
|||
from product_model_file pmf
|
||||
inner join product_model_file_item pmfi on pmfi.model_file_id=pmf.id
|
||||
where pmf.state=1 and pmf.enable=1 and pmf.model_id=#{modelId}
|
||||
order by pmfi.language_code,pmfi.show_in_list desc
|
||||
order by pmfi.language_code,pmfi.show_in_list desc,pmfi.id desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nflg.mobilebroken.repository.mapper.ProductModelFileMapper">
|
||||
<select id="getDefaultByLanguage" resultType="com.nflg.mobilebroken.common.pojo.vo.ProductFileVO">
|
||||
SELECT pmfi.name, pmfi.*
|
||||
SELECT pmfi.name,pmf.*
|
||||
FROM product_model_file pmf
|
||||
INNER JOIN product_model_file_item pmfi ON pmf.id = pmfi.model_file_id
|
||||
WHERE pmf.`enable` = 1
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@
|
|||
</sql>
|
||||
|
||||
<select id="getList" resultType="com.nflg.mobilebroken.repository.entity.TBasePosition">
|
||||
select id, position_code, position_name, position_attribute, data_create_user_no,
|
||||
data_create_user_name, data_create_time, data_modify_user_no, data_modify_user_name,
|
||||
data_modify_time
|
||||
select *
|
||||
from t_base_position
|
||||
where data_valid_state=1 <include refid="whr" />
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@
|
|||
INNER JOIN ticket_call_join tcj ON tc.id = tcj.call_id
|
||||
WHERE tc.state = 1
|
||||
AND tcj.state = 1
|
||||
AND tcj.user_id = #{userId}
|
||||
AND tcj.user_id = #{userId} and tcj.from = #{from} and tc.ticket_id = #{ticketId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue