品牌校区管理员管理;添加工单工具;集成微信小程序;添加数据导入;添加字典

This commit is contained in:
DB 2023-12-11 15:02:06 +08:00
parent cb3d91202a
commit d3aca91b40
97 changed files with 3157 additions and 263 deletions

View File

@ -34,6 +34,11 @@
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<!-- okhttp3 -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -204,4 +204,9 @@ public interface Constants {
*/
String USERNAME = "UserName";
/**
* 二维码Base64头
*/
String QRCODE_HEADER = "data:image/png;base64,";
}

View File

@ -2,6 +2,7 @@ package com.cpop.common.utils.http;
import com.cpop.common.constant.Constants;
import com.cpop.common.utils.StringUtils;
import okhttp3.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -344,4 +345,32 @@ public class HttpUtils {
}
}
/**
* okhttpPost请求
* @param url 地址
* @param jsonBody 请求体
*/
public static Response sendOkHttpPost(String url,String jsonBody) throws IOException {
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.Companion.parse("application/json;charset=utf-8");
RequestBody body = RequestBody.Companion.create(jsonBody, mediaType);
Request request = new Request
.Builder()
.url(url)
.post(body)
.addHeader("Content-Type", "application/json")
.build();
return client.newCall(request).execute();
}
/**
* okhttpGet请求
* @param url 地址
*/
public static Response sendOkHttpGet(String url) throws IOException {
OkHttpClient client = new OkHttpClient().newBuilder().build();
Request request = new Request.Builder().url(url).get().build();
return client.newCall(request).execute();
}
}

View File

@ -107,11 +107,6 @@
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
</dependency>
<!-- okhttp3 -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -0,0 +1,115 @@
package com.cpop.core.base.entity;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
/**
* @author DB
* @since 2023-12-10 9:35
* @version 1.0.0
*
* 负责将InputStream转换MultipartFile,可以少引一个jar包,本来用的是spring-test-4.3.9中的MockMultipartFile,直接提取出来使用
*/
public class MultipartFileDto implements MultipartFile {
private final String name;
private String originalFilename;
private String contentType;
private final byte[] content;
/**
* Create a new MultipartFileDto with the given content.
* @param name the name of the file
* @param content the content of the file
*/
public MultipartFileDto(String name, byte[] content) {
this(name, "", null, content);
}
/**
* Create a new MultipartFileDto with the given content.
* @param name the name of the file
* @param contentStream the content of the file as stream
* @throws IOException if reading from the stream failed
*/
public MultipartFileDto(String name, InputStream contentStream) throws IOException {
this(name, "", null, FileCopyUtils.copyToByteArray(contentStream));
}
/**
* Create a new MultipartFileDto with the given content.
* @param name the name of the file
* @param originalFilename the original filename (as on the client's machine)
* @param contentType the content type (if known)
* @param content the content of the file
*/
public MultipartFileDto(String name, String originalFilename, String contentType, byte[] content) {
this.name = name;
this.originalFilename = (originalFilename != null ? originalFilename : "");
this.contentType = contentType;
this.content = (content != null ? content : new byte[0]);
}
/**
* Create a new MultipartFileDto with the given content.
* @param name the name of the file
* @param originalFilename the original filename (as on the client's machine)
* @param contentType the content type (if known)
* @param contentStream the content of the file as stream
* @throws IOException if reading from the stream failed
*/
public MultipartFileDto(String name, String originalFilename, String contentType, InputStream contentStream)
throws IOException {
this(name, originalFilename, contentType, FileCopyUtils.copyToByteArray(contentStream));
}
@Override
public String getName() {
return this.name;
}
@Override
public String getOriginalFilename() {
return this.originalFilename;
}
@Override
public String getContentType() {
return this.contentType;
}
@Override
public boolean isEmpty() {
return (this.content.length == 0);
}
@Override
public long getSize() {
return this.content.length;
}
@Override
public byte[] getBytes() throws IOException {
return this.content;
}
@Override
public InputStream getInputStream() throws IOException {
return new ByteArrayInputStream(this.content);
}
@Override
public void transferTo(File dest) throws IOException, IllegalStateException {
FileCopyUtils.copy(this.content, dest);
}
}

View File

@ -0,0 +1,32 @@
package com.cpop.core.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
/**
* @author DB
* @version 1.0.0
* @since 2023-12-08 16:35
*/
@Configuration
public class RestTemplateConfig {
@Bean
public RestTemplate restTemplate(ClientHttpRequestFactory factory) {
return new RestTemplate(factory);
}
@Bean
public ClientHttpRequestFactory simpleClientHttpRequestFactory() {
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setReadTimeout(5000);
factory.setConnectTimeout(15000);
// 设置代理
//factory.setProxy(null);
return factory;
}
}

View File

@ -2,17 +2,18 @@ package com.cpop.core.handler;
import com.cpop.core.base.exception.UtilException;
import com.cpop.core.config.TencentCosProperties;
import com.cpop.core.utils.file.FileTypeUtils;
import com.cpop.core.utils.uuid.IdUtils;
import com.qcloud.cos.COSClient;
import com.qcloud.cos.ClientConfig;
import com.qcloud.cos.auth.BasicCOSCredentials;
import com.qcloud.cos.auth.COSCredentials;
import com.qcloud.cos.exception.CosClientException;
import com.qcloud.cos.exception.CosServiceException;
import com.qcloud.cos.http.HttpProtocol;
import com.qcloud.cos.model.ObjectMetadata;
import com.qcloud.cos.model.PutObjectRequest;
import com.qcloud.cos.model.StorageClass;
import com.qcloud.cos.model.UploadResult;
import com.qcloud.cos.model.*;
import com.qcloud.cos.region.Region;
import com.qcloud.cos.transfer.Download;
import com.qcloud.cos.transfer.TransferManager;
import com.qcloud.cos.transfer.TransferManagerConfiguration;
import com.qcloud.cos.transfer.Upload;
@ -22,6 +23,7 @@ import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.PostConstruct;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.ExecutorService;
@ -124,6 +126,7 @@ public class TencentCosHandler {
* @return: com.qcloud.cos.model.UploadResult
*/
public UploadResult cdnUpload(MultipartFile file) {
String fileType = FileTypeUtils.getInstance().getFileType(file.getOriginalFilename());
try {
ObjectMetadata objectMetadata = new ObjectMetadata();
// 上传的流如果能够获取准确的流长度则推荐一定填写 content-length
@ -131,7 +134,7 @@ public class TencentCosHandler {
objectMetadata.setContentLength(file.getSize());
objectMetadata.setContentType(file.getContentType());
InputStream inputStream = file.getInputStream();
PutObjectRequest putObjectRequest = new PutObjectRequest(properties.getBucketName(), IdUtils.fastSimpleUUID(), inputStream, objectMetadata);
PutObjectRequest putObjectRequest = new PutObjectRequest(properties.getBucketName(), IdUtils.fastSimpleUUID() + "." + fileType, inputStream, objectMetadata);
// 设置存储类型如有需要不需要请忽略此行代码, 默认是标准(Standard), 低频(standard_ia)
// 更多存储类型请参见 https://cloud.tencent.com/document/product/436/33417
putObjectRequest.setStorageClass(StorageClass.Standard);

View File

@ -5,6 +5,7 @@ import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.cpop.common.utils.DateUtils;
import com.cpop.common.utils.StringUtils;
import com.cpop.core.base.entity.MultipartFileDto;
import com.cpop.core.base.exception.UtilException;
import com.cpop.core.config.CpopConfig;
import com.cpop.core.utils.SpringUtils;
@ -12,15 +13,23 @@ import com.cpop.core.utils.uuid.IdUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.http.entity.ContentType;
import org.apache.poi.ss.formula.functions.T;
import org.apache.tomcat.util.http.fileupload.FileItem;
import org.apache.tomcat.util.http.fileupload.FileItemFactory;
import org.apache.tomcat.util.http.fileupload.disk.DiskFileItemFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.List;
/**
@ -261,28 +270,7 @@ public class FileUtils {
if (fileName == null) {
return null;
}
String baseName = FilenameUtils.getBaseName(fileName);
return baseName;
}
/**
* @Description: 下载Excel
* @param response
* @return
* @author DB
* @Date: 2023/7/14 0014 13:42
*/
public void downloadExcel(HttpServletResponse response, List<T> list) {
// 写入数据
try {
response.setContentType("application/vnd.excel");
response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("file", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), T.class).sheet("sheet1").doWrite(list);
} catch (IOException e) {
throw new UtilException(e);
}
return FilenameUtils.getBaseName(fileName);
}
/**
@ -309,5 +297,17 @@ public class FileUtils {
}).sheet("sheet1").doRead();
}
/**
* 文件转上传文件格式
* @author DB
* @since 2023/12/08
* @param file 文件
* @return MultipartFile 上传文件
*/
public MultipartFile getMultipartFile(File file) throws IOException {
FileInputStream inputStream = new FileInputStream(file);
return new MockMultipartFile(file.getName(), file.getName(), ContentType.APPLICATION_OCTET_STREAM.toString(), inputStream);
}
}

View File

@ -26,7 +26,7 @@ public class CpopGenerator {
* 数据库 URL
*/
// private static final String URL = "jdbc:mysql://localhost:3306/cpop-dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8";
private static final String URL = "jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8";
private static final String URL = "jdbc:mysql://localhost:3306/cpop_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8";
/**
* 数据库用户名
*/
@ -34,23 +34,23 @@ public class CpopGenerator {
/**
* 数据库密码
*/
//private static final String PASSWORD = "root";
private static final String PASSWORD = "Customer0401";
private static final String PASSWORD = "root";
//private static final String PASSWORD = "Customer0401";
/**
* 输出路径
*/
private static final String EXPORT_URL = "/Cpop-System";
private static final String EXPORT_URL = "/Cpop-Oam";
/**
* 模块
*/
private static final String EXPORT_ITEM = "system";
private static final String EXPORT_ITEM = "oam";
/**
* 表前缀
*/
private static final String TABLE_PREFIX = "cp_sys_";
private static final String TABLE_PREFIX = "cp_oam_";
/**
* 主入口

View File

@ -14,6 +14,7 @@ import okhttp3.Request;
import okhttp3.RequestBody;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.time.LocalDate;
@ -32,65 +33,52 @@ public class CardTemplateAsyncTask {
*/
@Async("customAsyncThreadPool")
public void cloudCreateCard(JSONObject jsonBody,String cardTemplateId) {
try {
//查询课卡信息
CardTemplate cardTemplate = SpringUtils.getBean(CardTemplateService.class).getById(cardTemplateId);
//时限卡
if (cardTemplate.getTemplateType().equals(1)) {
jsonBody.put("moneyCard", true);
jsonBody.put("amount", cardTemplate.getPrice());
} else if (cardTemplate.getTemplateType().equals(2)) {
jsonBody.put("timeLimit", true);
jsonBody.put("periodNumber", cardTemplate.getValidDay());
jsonBody.put("periodType", cardTemplate.getTemplateType());
} else {
// 课卡类型课时卡
jsonBody.put("periodType", cardTemplate.getTemplateType());
// 课卡计费类型 true false 课时卡
jsonBody.put("timeLimit", false);
// 课时卡课时数
jsonBody.put("periodNumber", cardTemplate.getClassNumber());
}
// 课卡到期时间
if (null != cardTemplate.getDayAppointment()){
// 日最大约课次数
jsonBody.put("maxFrequency", cardTemplate.getDayAppointment());
}
if (StringUtils.isNotBlank(cardTemplate.getName())){
// 课卡名称
jsonBody.put("periodName", cardTemplate.getName());
}
if (null != cardTemplate.getWeekAppointment()){
// 周最大约课次数
jsonBody.put("maxWeekFrequency", cardTemplate.getWeekAppointment());
}
// 首次上课开始计有效期
if (null != cardTemplate.getBufferDay()){
// 最大停卡次数
jsonBody.put("maxStopTime", cardTemplate.getBufferDay());
}
//课卡有效期
String periodExpire;
if (null != cardTemplate.getValidDay() && cardTemplate.getValidDay() > 0) {
//减一天
LocalDate localDate = LocalDate.now().plusDays(cardTemplate.getValidDay() - 1);
periodExpire = localDate.format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD));
} else {
periodExpire = cardTemplate.getEndDate().format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD));
}
jsonBody.put("periodExpire", periodExpire);
//获取课卡信息
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, jsonBody.toJSONString());
Request request = new Request.Builder()
.url(JamboxCloudUrl.COMMON_CARD_URL)
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
client.newCall(request).execute();
} catch (IOException e) {
throw new ServiceException(e.getMessage());
//查询课卡信息
CardTemplate cardTemplate = SpringUtils.getBean(CardTemplateService.class).getById(cardTemplateId);
//时限卡
if (cardTemplate.getTemplateType().equals(1)) {
jsonBody.put("moneyCard", true);
jsonBody.put("amount", cardTemplate.getPrice());
} else if (cardTemplate.getTemplateType().equals(2)) {
jsonBody.put("timeLimit", true);
jsonBody.put("periodNumber", cardTemplate.getValidDay());
jsonBody.put("periodType", cardTemplate.getTemplateType());
} else {
// 课卡类型课时卡
jsonBody.put("periodType", cardTemplate.getTemplateType());
// 课卡计费类型 true false 课时卡
jsonBody.put("timeLimit", false);
// 课时卡课时数
jsonBody.put("periodNumber", cardTemplate.getClassNumber());
}
// 课卡到期时间
if (null != cardTemplate.getDayAppointment()){
// 日最大约课次数
jsonBody.put("maxFrequency", cardTemplate.getDayAppointment());
}
if (StringUtils.isNotBlank(cardTemplate.getName())){
// 课卡名称
jsonBody.put("periodName", cardTemplate.getName());
}
if (null != cardTemplate.getWeekAppointment()){
// 周最大约课次数
jsonBody.put("maxWeekFrequency", cardTemplate.getWeekAppointment());
}
// 首次上课开始计有效期
if (null != cardTemplate.getBufferDay()){
// 最大停卡次数
jsonBody.put("maxStopTime", cardTemplate.getBufferDay());
}
//课卡有效期
String periodExpire;
if (null != cardTemplate.getValidDay() && cardTemplate.getValidDay() > 0) {
//减一天
LocalDate localDate = LocalDate.now().plusDays(cardTemplate.getValidDay() - 1);
periodExpire = localDate.format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD));
} else {
periodExpire = cardTemplate.getEndDate().format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD));
}
jsonBody.put("periodExpire", periodExpire);
SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.COMMON_CARD_URL, jsonBody, JSONObject.class);
}
}

View File

@ -14,4 +14,9 @@ public interface JamboxCloudUrl {
* 课卡相关云函数
*/
String COMMON_CARD_URL = BASE_URL + "/merchant_cloud";
/**
* 数据导入
*/
String DATA_IMPORT = BASE_URL + "/dataImport";
}

View File

@ -27,6 +27,7 @@
<groupId>com.cpop</groupId>
<artifactId>Cpop-Jambox</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -1,11 +1,9 @@
package com.cpop.mall.business.controller.backstage;
import com.cpop.core.base.R;
import com.cpop.core.utils.SpringUtils;
import com.cpop.mall.business.bo.LogisticsOrderBo;
import com.cpop.mall.business.bo.OrderPageBo;
import com.cpop.mall.business.service.OrderService;
import com.cpop.mall.business.task.OrderDetailAsyncTask;
import com.cpop.mall.business.vo.OrderPageVo;
import com.mybatisflex.core.paginate.Page;
import io.swagger.annotations.Api;

View File

@ -7,7 +7,7 @@ import com.cpop.mall.business.bo.ProductPageBo;
import com.cpop.mall.business.service.ProductRecordService;
import com.cpop.mall.business.service.ProductService;
import com.cpop.mall.business.service.ProductSpecificationService;
import com.cpop.mall.business.task.ShoppingCartAsyncTask;
import com.cpop.mall.framework.task.ShoppingCartAsyncTask;
import com.cpop.mall.business.vo.JamboxCardTemplateListVo;
import com.cpop.mall.business.vo.ProductInfoVo;
import com.cpop.mall.business.vo.ProductPageVo;
@ -21,7 +21,6 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.Serializable;
import java.util.List;
import static com.cpop.mall.business.entity.table.ProductRecordTableDef.PRODUCT_RECORD;

View File

@ -3,8 +3,6 @@ package com.cpop.mall.business.controller.callback;
import com.cpop.mall.business.service.OrderRefundService;
import com.cpop.mall.business.service.OrderService;
import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse;
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
import com.github.binarywang.wxpay.service.WxPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

View File

@ -10,7 +10,6 @@ import com.cpop.core.base.enums.OrderSource;
import com.cpop.core.base.enums.UserType;
import com.cpop.core.base.exception.ServiceException;
import com.cpop.core.base.table.SysUser;
import com.cpop.core.service.CoreService;
import com.cpop.core.service.RedisService;
import com.cpop.core.utils.QuartzUtils;
import com.cpop.core.utils.SecurityUtils;
@ -24,10 +23,10 @@ import com.cpop.mall.business.dto.WxPayGoodsDetailDto;
import com.cpop.mall.business.entity.*;
import com.cpop.mall.business.mapper.OrderMapper;
import com.cpop.mall.business.service.*;
import com.cpop.mall.business.task.OrderDetailAsyncTask;
import com.cpop.mall.business.task.OrderOverTimeUnPayTask;
import com.cpop.mall.business.task.ProductRecordSyncStockTask;
import com.cpop.mall.business.task.WxPayAsyncTask;
import com.cpop.mall.framework.task.OrderDetailAsyncTask;
import com.cpop.mall.framework.task.OrderOverTimeUnPayTask;
import com.cpop.mall.framework.task.ProductRecordSyncStockTask;
import com.cpop.mall.framework.task.WxPayAsyncTask;
import com.cpop.mall.business.vo.OrderDetailVo;
import com.cpop.mall.business.vo.OrderInfoVo;
import com.cpop.mall.business.vo.OrderPageVo;

View File

@ -24,7 +24,7 @@ import com.cpop.mall.business.service.OrderEvaluateService;
import com.cpop.mall.business.service.ProductRecordService;
import com.cpop.mall.business.service.ProductService;
import com.cpop.mall.business.service.ProductSpecificationService;
import com.cpop.mall.business.task.ShoppingCartAsyncTask;
import com.cpop.mall.framework.task.ShoppingCartAsyncTask;
import com.cpop.mall.business.vo.*;
import com.cpop.mall.framework.constant.MallRedisConstant;
import com.cpop.system.business.service.StoreService;

View File

@ -1,4 +1,4 @@
package com.cpop.mall.business.task;
package com.cpop.mall.framework.task;
import com.alibaba.fastjson.JSONObject;
import com.cpop.core.base.enums.OrderSource;
@ -16,6 +16,7 @@ import okhttp3.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.util.List;
@ -84,19 +85,7 @@ public class OrderDetailAsyncTask {
//模板对应实际地址
jsonBody.put("templateUrl", cloudBaseUrl);
//获取课卡信息
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, jsonBody.toJSONString());
Request request = new Request.Builder()
.url(JamboxCloudUrl.COMMON_CARD_URL)
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
try {
client.newCall(request).execute();
} catch (IOException e) {
throw new ServiceException(e.getMessage());
}
SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.COMMON_CARD_URL, jsonBody, JSONObject.class);
}
});
}

View File

@ -1,4 +1,4 @@
package com.cpop.mall.business.task;
package com.cpop.mall.framework.task;
import com.cpop.core.service.RedisService;
import com.cpop.core.utils.SpringUtils;

View File

@ -1,4 +1,4 @@
package com.cpop.mall.business.task;
package com.cpop.mall.framework.task;
import com.cpop.core.service.RedisService;
import com.cpop.core.utils.SpringUtils;

View File

@ -1,4 +1,4 @@
package com.cpop.mall.business.task;
package com.cpop.mall.framework.task;
import com.cpop.core.utils.SpringUtils;
import com.cpop.mall.business.entity.Product;

View File

@ -1,22 +1,18 @@
package com.cpop.mall.business.task;
package com.cpop.mall.framework.task;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.cpop.common.utils.StringUtils;
import com.cpop.core.base.enums.OrderSource;
import com.cpop.core.base.exception.ServiceException;
import com.cpop.core.base.exception.UtilException;
import com.cpop.core.utils.SpringUtils;
import com.cpop.mall.framework.config.wxPay.WxPayProperties;
import com.cpop.system.business.entity.ProfitSharing;
import com.cpop.system.business.service.BrandService;
import com.cpop.system.business.service.ProfitSharingService;
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
import com.github.binarywang.wxpay.bean.profitsharing.ProfitSharingReceiverRequest;
import com.github.binarywang.wxpay.bean.profitsharing.ProfitSharingRequest;
import com.github.binarywang.wxpay.bean.profitsharing.ProfitSharingResult;
import com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingReceiver;
import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.WxPayService;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -60,9 +60,9 @@ mybatis-flex:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
datasource:
oam:
url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://localhost:3306/cpop_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: Customer0401
password: root
jambox:
url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/jambox_test?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
username: root

View File

@ -150,7 +150,6 @@ wx:
token: 1i2dz2yxD0Np2xvMYTD
# (应用中的 “接受消息” 部分的 “接收消息服务器配置” 里的EncodingAESKey值
aesKey: DLSzfHVUZN3O9WhtL07RBXUoooqC2bjEJYwep8k8ojt
#开放平台
open:
openAppid: wx6e07ba6606e912a5
@ -170,4 +169,16 @@ wx:
apiV3Key: JamBox20230919174000000000000002
#分账服务商账号
sharingAccount: 1618884922
sharingAccountName: 果酱盒子
sharingAccountName: 果酱盒子
miniapp:
configs:
#微信小程序的appid
- appid: wx20853d18c455e874
#微信小程序的Secret
secret: 217caf62439579195c8da19774de40d1
#微信小程序消息服务器配置的token
token:
#微信小程序消息服务器配置的EncodingAESKey
aesKey:
#数据格式
msgDataFormat: JSON

View File

@ -10,12 +10,19 @@ import com.cpop.jambox.business.entity.BrandExtend;
import com.cpop.jambox.business.entity.StoreExtend;
import com.cpop.jambox.business.service.BrandExtendService;
import com.cpop.jambox.business.service.StoreExtendService;
import com.cpop.oam.business.entity.BrandManager;
import com.cpop.oam.business.entity.BrandManagerStore;
import com.cpop.oam.business.service.BrandManagerService;
import com.cpop.oam.business.service.BrandManagerStoreService;
import com.cpop.system.business.entity.Brand;
import com.cpop.system.business.entity.Store;
import com.cpop.system.business.mapper.StoreMapper;
import com.cpop.system.business.service.BrandService;
import com.cpop.system.business.service.StoreService;
import com.mybatisflex.core.row.DbChain;
import com.mybatisflex.core.row.Row;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.core.datasource.DataSourceKey;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.core.row.*;
import lombok.Data;
import lombok.Value;
import lombok.extern.slf4j.Slf4j;
@ -25,14 +32,14 @@ import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
import static com.cpop.jambox.business.entity.table.BrandExtendTableDef.BRAND_EXTEND;
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
/**
* @author DB
@ -96,7 +103,6 @@ public class CpopImportTests {
.filter(item -> !filterList.contains(item.getBrandCloudId()) &&
//品牌不为null和空
null != item.getBrandCloudId() && StringUtils.isNotBlank(item.getBrandCloudId())).collect(Collectors.toList());
//打印
Map<StoreExtend, Store> storeExtendStoreMap = new HashMap<>();
//获取所有品牌
@ -125,6 +131,130 @@ public class CpopImportTests {
SpringUtils.getBean(StoreExtendService.class).saveBatch(storeExtendStoreMap.keySet());
}
/**
* 更新导入的旧数据
* @author DB
* @since 2023/12/08
*/
@Test
public void updateImportData() {
List<Row> rowList = null;
try {
//查询旧表
DataSourceKey.use("jambox");
rowList = DbChain.table("t_mechanism_info")
.select("tmi.store_id as storeCloudId")
.select("tmi.charge_name as personCharge")
.select("tmi.charge_phone as phone")
.select("tmi.address as storeAddr")
.select("ifnull(date_format(tsm.end_time,'%Y-%m-%d'),null) as expireDate")
.select("if(tmi.clue_id is null,0,1) as haveCounselor")
.select("if(of.activation is null,0,of.activation) as haveActive")
.from("t_mechanism_info").as("tmi")
.leftJoin("OAM_finance").as("of").on("of.clue_id LIKE tmi.clue_id")
.leftJoin("t_signContract_mechanism").as("tsm").on("tsm.store_id = tmi.store_id")
.list();
} finally {
DataSourceKey.clear();
}
//以云id换id
Map<String, String> cloudToIdMap = SpringUtils.getBean(StoreExtendService.class).list()
.stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId));
//用迭代器
Iterator<Row> iterator = rowList.iterator();
while (iterator.hasNext()) {
Row next = iterator.next();
if (StringUtils.isBlank(cloudToIdMap.get(next.getString("storeCloudId")))) {
iterator.remove();
} else {
next.set("id", cloudToIdMap.get(next.getString("storeCloudId")));
if (StringUtils.isBlank(next.getString("id"))){
iterator.remove();
}
}
}
List<Store> entityList = RowUtil.toEntityList(rowList, Store.class);
entityList.forEach(item->{
if (StringUtils.isBlank(item.getId())){
log.error(item.toString());
}
});
SpringUtils.getBean(StoreService.class).updateBatch(entityList);
}
/**
* 导入品牌管理员
* @author DB
* @since 2023/12/08
*/
@Test
public void importBrandManage() throws IOException {
String brandManagerFileUrl = "C:\\Users\\Administrator\\Desktop\\brandManager.json";
List<JsonBrandManager> jsonBrands = JSONArray.parseArray(readJson(brandManagerFileUrl), JsonBrandManager.class);
List<BrandManager> brandManagers = BeanUtils.mapToList(jsonBrands, BrandManager.class);
SpringUtils.getBean(BrandManagerService.class).saveBatch(brandManagers);
Map<String, String> brandManagerMap = brandManagers.stream().collect(Collectors.toMap(BrandManager::getBrandManagerCloudId, BrandManager::getId));
//中间表数据
Map<String, String> brandMap = SpringUtils.getBean(BrandExtendService.class).list()
.stream().collect(Collectors.toMap(BrandExtend::getBrandCloudId, BrandExtend::getBrandId));
Map<String, String> storMap = SpringUtils.getBean(StoreExtendService.class).list()
.stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId));
List<BrandManagerStore> brandManagerStores = new ArrayList<>();
jsonBrands.forEach(item->{
if (item.getStoreCloudIds() != null && !item.getStoreCloudIds().isEmpty()) {
item.getStoreCloudIds().forEach(inner -> {
BrandManagerStore brandManagerStore = new BrandManagerStore();
brandManagerStore.setBrandId(brandMap.get(item.getBrandCloudId()))
.setBrandManagerId(brandManagerMap.get(item.getBrandManagerCloudId()))
.setStoreId(storMap.get(inner));
brandManagerStores.add(brandManagerStore);
});
} else {
if (StringUtils.isNotBlank(item.getBrandCloudId())) {
BrandManagerStore brandManagerStore = new BrandManagerStore();
brandManagerStore.setBrandId(brandMap.get(item.getBrandCloudId())).setBrandManagerId(brandManagerMap.get(item.getBrandManagerCloudId()));
brandManagerStores.add(brandManagerStore);
}
}
});
SpringUtils.getBean(BrandManagerStoreService.class).saveBatch(brandManagerStores);
}
@Data
private class JsonBrandManager implements Serializable {
/**
* 云品牌id
*/
@JSONField(name = "_brandid")
private String brandCloudId;
/**
* 云校区id集合
*/
@JSONField(name = "store")
private List<String> storeCloudIds;
/**
* 手机号
*/
@JSONField(name = "phone")
private String phoneNumber;
/**
* 姓名
*/
@JSONField(name = "name")
private String name;
/**
* 云id
*/
@JSONField(name = "_id")
private String brandManagerCloudId;
}
/**
* json格式品牌
*/
@ -170,6 +300,45 @@ public class CpopImportTests {
private String brandCloudId;
}
@Data
private class UpdateStore implements Serializable {
/**
* 云校区id
*/
private String storeCloudId;
/**
* 店铺/校区地址
*/
private String storeAddr;
/**
* 负责人
*/
private String personCharge;
/**
* 手机号
*/
private String phone;
/**
* 到期日期
*/
private LocalDate expireDate;
/**
* 是否有顾问
*/
private Boolean haveCounselor;
/**
* 是否激活
*/
private Boolean haveActive;
}
/**
* 读取json文件数据
*

View File

@ -0,0 +1,66 @@
package com.cpop.oam.web;
import com.cpop.core.utils.QuartzUtils;
import com.cpop.core.utils.SpringUtils;
import com.cpop.oam.business.entity.Task;
import com.cpop.oam.business.service.TaskService;
import com.cpop.oam.business.service.TaskStaffGroupService;
import org.junit.jupiter.api.Test;
import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import static com.cpop.oam.business.entity.table.TaskStaffGroupTableDef.TASK_STAFF_GROUP;
/**
* @author DB
* @version 1.0.0
* @since 2023-12-07 11:55
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class CpopQrtzTest {
@Autowired
private QuartzUtils quartzUtils;
/**
* 定时任务删除
* @author DB
* @since 2023/12/07
*/
@Test
public void jobRemove() throws SchedulerException {
quartzUtils.deleteJob("WorkOrderAcceptOvertimeTask:90214101954240512","WorkOrder");
}
@Test
public void workOrderAcceptOverTimeTask() {
// 获取任务
TaskService taskService = SpringUtils.getBean(TaskService.class);
Task task = taskService.getById("90263826384441344");
// 工单超时为接收扣除5绩点
TaskStaffGroupService taskStaffGroupService = SpringUtils.getBean(TaskStaffGroupService.class);
taskStaffGroupService.updateChain()
.set(TASK_STAFF_GROUP.GRADE_POINT, -5)
.set(TASK_STAFF_GROUP.REMARK, "工单接收超时扣除5绩点 ")
.where(TASK_STAFF_GROUP.TASK_ID.eq(task.getId()))
.and(TASK_STAFF_GROUP.STAFF_ID.eq(task.getResponsibleStaffId()))
.update();
}
@Test
public void workOrderOverTimeTask() {
// 获取任务
TaskService taskService = SpringUtils.getBean(TaskService.class);
Task task = taskService.getById("90282358270763008");
// 扣除5点绩点
SpringUtils.getBean(TaskStaffGroupService.class).updateChain()
.setRaw(TASK_STAFF_GROUP.GRADE_POINT, "grade_point - 5")
.setRaw(TASK_STAFF_GROUP.REMARK, "concat(remark,'工单完结超时扣除5绩点')")
.where(TASK_STAFF_GROUP.TASK_ID.eq(task.getId()))
.and(TASK_STAFF_GROUP.STAFF_ID.eq(task.getResponsibleStaffId()))
.update();
}
}

View File

@ -41,15 +41,15 @@
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-open</artifactId>
</dependency>
<!-- devtools热部署依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<!-- 防止将依赖传递到其他模块中 -->
<optional>true</optional>
<!-- 只在运行时起作用打包时不打进去防止线上执行打包后的程序启动文件监听线程File Watcher耗费大量的内存资源 -->
<scope>runtime</scope>
</dependency>
<!--微信小程序-->
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-miniapp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -0,0 +1,54 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.List;
/**
* @author DB
* @version 1.0.0
* @since 2023-12-07 17:57
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "BrandManager对象", description = "品牌管理员")
public class BrandManagerBo {
/**
* 主键
*/
@ApiModelProperty("主键")
private String id;
/**
* 姓名
*/
@NotBlank(message = "姓名不能为空")
@ApiModelProperty(value = "姓名",required = true)
private String name;
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空")
@ApiModelProperty(value = "手机号",required = true)
private String phone;
/**
* 品牌
*/
@NotBlank(message = "品牌不能为空")
@ApiModelProperty(value = "品牌",required = true )
private String brandId;
/**
* 校区id集合
*/
@ApiModelProperty(value = "校区id集合")
private List<String> storeIds;
}

View File

@ -0,0 +1,33 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author DB
* @version 1.0.0
* @since 2023-12-07 17:25
*/
@Data
@ApiModel(value = "品牌管理员参数")
public class BrandManagerPageBo {
/**
* 品牌名
*/
@ApiModelProperty(value = "品牌名")
private String brandName;
/**
* 手机号
*/
@ApiModelProperty(value = "手机号")
private String phoneNumber;
/**
*
*/
@ApiModelProperty(value = "姓名")
private String name;
}

View File

@ -0,0 +1,57 @@
package com.cpop.oam.business.bo;
import com.cpop.core.annontation.StringArrayConvert;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
/**
* @author DB
* @version 1.0.0
* @since 2023-12-10 11:56
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "DataImportBo对象")
public class DataImportBo {
/**
* 主键
*/
@ApiModelProperty(value = "主键")
private String id;
/**
* 品牌id
*/
@NotBlank(message = "不能为空")
@ApiModelProperty(value = "品牌")
private String brandId;
/**
* 校区
*/
@NotBlank(message = "不能为空")
@ApiModelProperty(value = "校区")
private String storeId;
/**
* 导入文件地址
*/
@NotBlank(message = "不能为空")
@StringArrayConvert
@ApiModelProperty(value = "导入文件地址")
private String fileUrl;
/**
* 是否清空
*/
@ApiModelProperty(value = "是否清空")
private Boolean isClear;
}

View File

@ -0,0 +1,34 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @author DB
* @version 1.0.0
* @since 2023-12-10 11:05
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "DataImportPageBo对象")
public class DataImportPageBo {
/**
* 导入状态
*/
@NotNull(message = "导入状态不能为空")
@ApiModelProperty(value = "导入状态")
private Boolean importStatus;
/**
* 校区名
*/
@ApiModelProperty(value = "校区名")
private String storeName;
}

View File

@ -0,0 +1,34 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @author DB
* @version 1.0.0
* @since 2023-12-07 18:14
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "OperationStatusBo对象")
public class OperationStatusBo {
/**
* 员工id
*/
@NotBlank(message = "员工id不能为空")
@ApiModelProperty(value = "员工id",required = true)
private String id;
/**
* 操作状态
*/
@NotNull(message = "操作状态不能为空")
@ApiModelProperty(value = "操作状态",required = true)
private Boolean isOperation;
}

View File

@ -0,0 +1,26 @@
package com.cpop.oam.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 任务需求加急
* @author DB
* @version 1.0.0
* @since 2023-12-08 11:10
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "TaskDemandUrgentBo对象")
public class TaskDemandUrgentBo {
/**
* 需求id
*/
@ApiModelProperty("需求id")
private String id;
}

View File

@ -0,0 +1,56 @@
package com.cpop.oam.business.bo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
/**
* @author DB
* @version 1.0.0
* @since 2023-12-10 10:36
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "TechnologyToolBo对象")
public class TechnologyToolBo {
/**
* 主键
*/
@ApiModelProperty(value = "主键")
private String id;
/**
* 工具名
*/
@NotBlank(message = "工具名不能为空")
@ApiModelProperty(value = "工具名",required = true)
private String toolName;
/**
* 工具地址
*/
@NotBlank(message = "工具地址不能为空")
@ApiModelProperty(value = "工具地址",required = true)
private String toolUrl;
/**
* 工具介绍
*/
@NotBlank(message = "工具介绍不能为空")
@ApiModelProperty(value = "工具介绍",required = true)
private String toolDesc;
/**
* 工具类型(字典)
*/
@NotBlank(message = "工具类型不能为空")
@ApiModelProperty(value = "工具类型(字典)",required = true)
private String toolType;
}

View File

@ -0,0 +1,113 @@
package com.cpop.oam.business.controller.backstage;
import com.cpop.core.base.R;
import com.cpop.oam.business.bo.BrandManagerBo;
import com.cpop.oam.business.bo.BrandManagerPageBo;
import com.cpop.oam.business.service.BrandManagerService;
import com.cpop.system.business.bo.StoreListByBrandBo;
import com.cpop.system.business.entity.table.BrandTableDef;
import com.cpop.system.business.entity.table.StoreTableDef;
import com.cpop.system.business.service.BrandService;
import com.cpop.system.business.service.StoreService;
import com.cpop.system.business.vo.BrandListVo;
import com.cpop.oam.business.vo.BrandManagePageVo;
import com.cpop.system.business.vo.StoreListByBrandVo;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
/**
* 品牌管理员表 控制层
*
* @author DB
* @since 2023-12-07
*/
@RestController
@Api(tags = "品牌管理员表接口")
@RequestMapping("/brandManage")
public class BrandManagerController {
@Autowired
private BrandManagerService brandManageService;
@Autowired
private BrandService brandService;
@Autowired
private StoreService storeService;
/**
* 查询品牌管理员分页
* @author DB
* @since 2023/12/07
* @param bo 请求参数
* @return R<Page<BrandManagePageVo>>
*/
@ApiOperation("查询品牌管理员分页")
@GetMapping("/getBrandManagePage")
public R<Page<BrandManagePageVo>> getBrandManagePage(BrandManagerPageBo bo) {
Page<BrandManagePageVo> page = brandManageService.getBrandManagerPage(bo);
return R.ok(page);
}
/**
* 查询品牌列表
* @author DB
* @since 2023/09/07 18:07
* @return R<List<BrandListVo>>
*/
@ApiOperation("查询品牌列表")
@GetMapping("/getBrandList")
public R<List<BrandListVo>> getBrandList(String query) {
List<BrandListVo> list = brandService.listAs(QueryWrapper.create().and(BrandTableDef.BRAND.BRAND_NAME.like(query)), BrandListVo.class);
return R.ok(list);
}
/**
* 查询品牌列表
* @return R<PageVo<BrandPageListVo>>
* @author DB
* @since 2023/6/2 17:37
**/
@ApiOperation("根据品牌查询校区列表")
@PostMapping("/getStoreListByBrand")
public R<List<StoreListByBrandVo>> getCampusListByBrand(@RequestBody StoreListByBrandBo bo) {
List<StoreListByBrandVo> vos = storeService.listAs(QueryWrapper.create().and(StoreTableDef.STORE.BRAND_ID.in(bo.getBrandIds())), StoreListByBrandVo.class);
return R.ok(vos);
}
/**
* 删除品牌管理员
* @author DB
* @since 2023/12/07
* @param id 主键
* @return R<Void>
*/
@ApiOperation("删除品牌管理员")
@DeleteMapping("/removeBrandManageById/{id}")
public R<Void> removeBrandManageById(@PathVariable String id) {
brandManageService.removeBrandManagerById(id);
return R.ok();
}
/**
* 新增品牌管理员
* @author DB
* @since 2023/12/07
* @param bo 请求
* @return R<Void>
*/
@ApiOperation("新增品牌管理员")
@PostMapping("insertBrandManage")
public R<Void> insertBrandManage(@RequestBody @Validated BrandManagerBo bo) {
brandManageService.insertBrandManager(bo);
return R.ok();
}
}

View File

@ -0,0 +1,173 @@
package com.cpop.oam.business.controller.backstage;
import com.alibaba.excel.EasyExcel;
import com.cpop.core.base.R;
import com.cpop.core.utils.file.FileUploadUtils;
import com.cpop.core.utils.file.FileUtils;
import com.cpop.oam.business.bo.DataImportBo;
import com.cpop.oam.business.bo.DataImportPageBo;
import com.cpop.oam.business.bo.StaffBo;
import com.cpop.oam.business.dto.DataImportDto;
import com.cpop.oam.business.vo.DataImportPageVo;
import com.cpop.oam.business.vo.StoreListVo;
import com.cpop.system.business.service.BrandService;
import com.cpop.system.business.service.StoreService;
import com.cpop.system.business.vo.BrandListVo;
import com.cpop.system.business.vo.SysFileVo;
import com.mybatisflex.core.paginate.Page;
import com.qcloud.cos.model.UploadResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.cpop.oam.business.entity.DataImport;
import com.cpop.oam.business.service.DataImportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.Serializable;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
/**
* oam-数据导入表 控制层
*
* @author DB
* @since 2023-12-10
*/
@RestController
@Api(tags = "数据导入接口")
@RequestMapping("/dataImport")
public class DataImportController {
@Autowired
private DataImportService dataImportService;
@Autowired
private BrandService brandService;
@Autowired
private StoreService storeService;
/**
* 数据导入分页查询
* @author DB
* @since 2023/12/10
* @param bo 请求参数
* @return R<Page<DataImportPageVo>>
*/
@GetMapping("/getDataImportPage")
@ApiOperation("数据导入分页查询")
public R<Page<DataImportPageVo>> getDataImportPage(DataImportPageBo bo) {
Page<DataImportPageVo> page = dataImportService.getDataImportPage(bo);
return R.ok(page);
}
/**
* 获取品牌列表
*
* @param brandName 品牌名
* @author DB
* @since 2023-11-30 17:59:29
*/
@ApiOperation("获取品牌列表")
@GetMapping("/getBrandList")
public R<List<BrandListVo>> getBrandList(@ApiParam("品牌名") String brandName) {
List<BrandListVo> list = brandService.queryChain().and(BRAND.BRAND_NAME.like(brandName)).listAs(BrandListVo.class);
return R.ok(list);
}
/**
* 获取校区/店铺列表
*
* @param brandId 品牌id
* @author DB
* @since 2023-11-30 18:00:08
*/
@ApiOperation("获取校区/店铺列表")
@GetMapping("/getStoreList")
public R<List<StoreListVo>> getStoreList(@ApiParam("品牌id") String brandId) {
List<StoreListVo> list = storeService.queryChain().and(STORE.BRAND_ID.eq(brandId)).listAs(StoreListVo.class);
return R.ok(list);
}
/**
* 新增数据导入
* @author DB
* @since 2023/12/10
* @param bo 请求参数
* @return boolean
*/
@PostMapping("/insertDataImport")
@ApiOperation("新增数据导入")
public R<Void> insertDataImport(@RequestBody @Validated DataImportBo bo) {
dataImportService.insertDataImport(bo);
return R.ok();
}
/**
* 根据主键删除oam-数据导入表
*
* @param id 主键
* @return {@code true} 删除成功{@code false} 删除失败
*/
@DeleteMapping("/removeById/{id}")
@ApiOperation("根据主键删除未导入数据记录")
public boolean removeById(@PathVariable @ApiParam("数据导入主键") String id) {
return dataImportService.removeById(id);
}
/**
* 检查上传的文件
* @author DB
* @since 2023/12/10
* @param file 文件
* @return R<SysFileVo>
*/
@ApiOperation("检查上传的文件")
@PostMapping("/checkImportData")
public R<SysFileVo> checkImportData(@RequestParam("file") MultipartFile file){
SysFileVo sysFileVo = dataImportService.checkImportData(file);
return R.ok(sysFileVo);
}
/**
* 立即导入
* @author DB
* @since 2023/12/10
* @return R<Void>
*/
@ApiOperation("立即导入")
@PutMapping("/importNow/{id}")
public R<Void> importNow(@PathVariable @ApiParam("数据导入主键") String id) {
dataImportService.importNow(id);
return R.ok();
}
/**
* 模板下载
* @author DB
* @since 2023/12/10
* @param response 响应
*/
@ApiOperation("模板下载")
@GetMapping("/download")
public R<Void> download(HttpServletResponse response) throws IOException {
// 这里注意 有同学反应使用swagger 会导致各种问题请直接用浏览器或者用postman
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
// 这里URLEncoder.encode可以防止中文乱码 当然和easyExcel没有关系
String fileName = URLEncoder.encode("数据导入模板", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), DataImportDto.class).sheet("模板").doWrite(new ArrayList<>());
return R.ok();
}
}

View File

@ -55,7 +55,7 @@ public class DutyController {
* @Author: DB
* @Date: 2023/5/18 9:50
**/
@PreAuthorize("@aps.hasPermission('dutyCalendar:duty:insert')")
@PreAuthorize("@aps.hasPermission('dutyCalendar:duty:management')")
@ApiOperation("新增值班")
@PostMapping("/insertDuty")
public R<Void> insertDuty(@RequestBody @Validated DutyBo bo) {
@ -70,7 +70,7 @@ public class DutyController {
* @param dutyDate 值班日期
* @return com.pupu.core.base.R<java.lang.Void>
*/
@PreAuthorize("@aps.hasPermission('dutyCalendar:duty:remove')")
@PreAuthorize("@aps.hasPermission('dutyCalendar:duty:management')")
@ApiOperation("删除值班信息")
@DeleteMapping("/removeDutyByDate/{dutyDate}")
public R<Void> removeDutyByDate(@PathVariable String dutyDate) {

View File

@ -93,7 +93,7 @@ public class FinanceReimburseController {
* @Author: DB
* @Date: 2023/5/30 15:44
**/
@PreAuthorize("@aps.hasPermission('financial:reimburseAudit:list')")
@PreAuthorize("@aps.hasPermission('financial:audit:list')")
@ApiOperation("财务报销模块-报销审核分页列表")
@GetMapping("/getReimburseAuditPage")
public R<Page<FinanceReimburseAuditPageVo>> getReimburseAuditPage(FinanceReimburseAuditPageBo bo) {
@ -107,7 +107,6 @@ public class FinanceReimburseController {
* @Author: DB
* @Date: 2023/5/10 16:01
**/
@PreAuthorize("@aps.hasPermission('financial:reimburseAudit:update')")
@ApiOperation("修改报销状态")
@PutMapping("/updateReimburseStatus")
public R<Void> updateReimburseStatus(@RequestBody @Validated ReimburseStatusBo bo) {
@ -122,7 +121,6 @@ public class FinanceReimburseController {
* @param bo 请求参数
* @return com.pupu.core.base.R<java.lang.Void>
*/
@PreAuthorize("@aps.hasPermission('financial:reimburseAudit:insert')")
@ApiOperation("新增报销类型")
@PostMapping("/insertReimburseType")
public R<Void> insertReimburseApplication(@RequestBody @Validated ReimburseTypeBo bo) {
@ -137,7 +135,6 @@ public class FinanceReimburseController {
* @param bo 请求参数
* @return com.jambox.core.base.R<java.lang.Void>
*/
@PreAuthorize("@aps.hasPermission('financial:reimburseAudit:update')")
@ApiOperation("修改报销类型")
@PutMapping("/updateReimburseType")
public R<Void> updateReimburseType(@RequestBody @Validated ReimburseTypeBo bo) {
@ -152,7 +149,6 @@ public class FinanceReimburseController {
* @param id 主键
* @return com.jambox.core.base.R<java.lang.Void>
*/
@PreAuthorize("@aps.hasPermission('financial:reimburseAudit:remove')")
@ApiOperation("删除报销类型")
@DeleteMapping("/removeReimburseTypeById/{id}")
public R<Void> removeReimburseTypeById(@PathVariable String id) {
@ -166,7 +162,6 @@ public class FinanceReimburseController {
* @Author: DB
* @Date: 2023/5/30 15:44
**/
@PreAuthorize("@aps.hasPermission('financial:application:list')")
@ApiOperation("财务报销模块-个人报销统计")
@GetMapping("/getPersonStatistic")
public R<ReimbursePersonStatisticVo> getPersonStatistic() {
@ -178,7 +173,6 @@ public class FinanceReimburseController {
* @Author: DB
* @Date: 2023/5/10 16:01
**/
@PreAuthorize("@aps.hasPermission('financial:reimburseAudit:update')")
@ApiOperation("审核员工申请报销")
@PutMapping("/auditReimburseApplication/{id}")
public R<Void> auditReimburseApplication(@PathVariable String id) {
@ -193,7 +187,6 @@ public class FinanceReimburseController {
* @param bo 请求参数
* @return com.jambox.core.base.R<java.lang.Void>
*/
@PreAuthorize("@aps.hasPermission('financial:reimburseAudit:update')")
@ApiOperation("报销驳回")
@PutMapping("/reimburseReject")
public R<Void> reimburseReject(@RequestBody @Validated ReimburseRejectBo bo) {
@ -212,7 +205,6 @@ public class FinanceReimburseController {
* @param bo 请求参数
* @return com.jambox.core.base.R<java.lang.Void>
*/
@PreAuthorize("@aps.hasPermission('financial:reimburseAudit:update')")
@ApiOperation("报销下款")
@PutMapping("/reimbursePay")
public R<Void> reimbursePay(@RequestBody @Validated ReimbursePayBo bo) {
@ -227,7 +219,6 @@ public class FinanceReimburseController {
* @Author: DB
* @Date: 2023/5/30 15:44
**/
@PreAuthorize("@aps.hasPermission('financial:application:list')")
@ApiOperation("财务报销模块-报销详情记录列表")
@GetMapping("/getReimburseRecordList/{id}")
public R<List<FinanceReimburseRecordListVo>> getReimburseRecordList(@PathVariable String id) {

View File

@ -5,7 +5,7 @@ import com.cpop.core.service.CoreService;
import com.cpop.core.utils.SpringUtils;
import com.cpop.oam.business.bo.MallStaffBo;
import com.cpop.oam.business.service.OamMallService;
import com.cpop.oam.business.vo.BrandListVo;
import com.cpop.system.business.vo.BrandListVo;
import com.cpop.oam.business.vo.MallStaffPageVo;
import com.cpop.system.business.service.BrandService;
import com.mybatisflex.core.paginate.Page;
@ -52,7 +52,7 @@ public class OamMallController {
* @descriptions 查询品牌列表
* @author DB
* @date 2023/11/10 11:45
* @return: com.cpop.core.base.R<java.util.List<com.cpop.oam.business.vo.BrandListVo>>
* @return: com.cpop.core.base.R<java.util.List<com.cpop.system.business.vo.BrandListVo>>
*/
@ApiOperation("查询品牌列表")
@GetMapping("/getBrandList")
@ -84,7 +84,6 @@ public class OamMallController {
* @param bo 请求参数
* @return com.jambox.core.base.R<java.lang.Void>
*/
@PreAuthorize("@aps.hasPermission('mall:admin:insert')")
@ApiOperation("新增管理员")
@PostMapping("/insertAdmin")
public R<Void> insertAdmin(@RequestBody @Validated MallStaffBo bo) {
@ -99,7 +98,6 @@ public class OamMallController {
* @param id 主键
* @return: com.cpop.core.base.R<java.lang.Void>
*/
@PreAuthorize("@aps.hasPermission('mall:admin:remove')")
@ApiOperation("删除管理员")
@DeleteMapping("/removeAdmin/{id}")
public R<Void> removeAdmin(@PathVariable String id) {

View File

@ -198,4 +198,18 @@ public class StaffController {
return R.ok();
}
/**
* 修改运维状态
* @author DB
* @since 2023/12/07
* @param bo 请求参数
* @return R<Void>
*/
@ApiOperation("修改运维状态")
@PutMapping("/changeOperationStatus")
public R<Void> changeOperationStatus(@Validated @RequestBody OperationStatusBo bo) {
staffService.changeOperationStatus(bo);
return R.ok();
}
}

View File

@ -47,7 +47,6 @@ public class SysConfigController {
* @Author: DB
* @Date: 2023/5/11 15:48
**/
@PreAuthorize("@aps.hasPermission('system:config:update')")
@OperationLog(operationLogEnumType = OperationLogEnum.UPDATE_OAM_CONFIG)
@ApiOperation("设置系统配置信息")
@PutMapping("/setSysConfigInfo")

View File

@ -3,8 +3,10 @@ package com.cpop.oam.business.controller.backstage;
import com.cpop.core.base.R;
import com.cpop.oam.business.bo.TaskDemandBo;
import com.cpop.oam.business.bo.TaskDemandPageBo;
import com.cpop.oam.business.bo.TaskDemandUrgentBo;
import com.cpop.oam.business.service.TaskDemandService;
import com.cpop.oam.business.vo.BrandListVo;
import com.cpop.oam.business.vo.TaskDemandUrgentVo;
import com.cpop.system.business.vo.BrandListVo;
import com.cpop.oam.business.vo.StoreListVo;
import com.cpop.oam.business.vo.TaskDemandPageVo;
import com.cpop.system.business.service.BrandService;
@ -63,7 +65,6 @@ public class TaskDemandController {
* @param bo 请求参数
* @since 2023-11-30 17:27:24
*/
@PreAuthorize("@aps.hasPermission('oamTask:taskDemand:insert')")
@ApiOperation("工单模块-需求-新增需求")
@PostMapping("/insertDemandTask")
public R<Void> insertDemandTask(@RequestBody @Validated
@ -78,7 +79,6 @@ public class TaskDemandController {
* @param bo 请求参数
* @since 2023-11-30 18:26:42
*/
@PreAuthorize("@aps.hasPermission('oamTask:taskDemand:update')")
@ApiOperation("工单模块-需求-修改需求")
@PutMapping("/updateDemandTask")
public R<Void> updateDemandTask(@RequestBody @Validated
@ -93,7 +93,6 @@ public class TaskDemandController {
* @param demandId 需求id
* @since 2023-11-30 20:30:54
*/
@PreAuthorize("@aps.hasPermission('oamTask:taskDemand:remove')")
@ApiOperation("工单模块-需求-删除需求")
@DeleteMapping("/removeDemandTask/{demandId}")
public R<Void> removeDemandTask(@PathVariable @ApiParam(value = "需求id")
@ -131,4 +130,18 @@ public class TaskDemandController {
return R.ok(list);
}
/**
* 工单模块-需求-需求加急
* @author DB
* @since 2023/12/08
* @param bo 请求参数
* @return R<Void>
*/
@ApiOperation("工单模块-需求-需求加急")
@PutMapping("/demandUrgent")
public R<TaskDemandUrgentVo> demandUrgent(@RequestBody @Validated TaskDemandUrgentBo bo) {
TaskDemandUrgentVo vo = taskDemandService.demandUrgent(bo);
return R.ok(vo);
}
}

View File

@ -48,7 +48,7 @@ public class TaskTechnologyController {
* @author DB
* @since 2023-11-30 19:41:32
*/
//@PreAuthorize("@aps.hasPermission('oamTask:taskTechnology:list')")
@PreAuthorize("@aps.hasPermission('oamTask:technology:list')")
@ApiOperation("技术模块-今日事务-获取个人工单列表")
@GetMapping("/getPersonWorkOrder")
public R<List<TaskWorkOrderPersonVo>> getPersonWorkOrder() {
@ -63,7 +63,6 @@ public class TaskTechnologyController {
* @author DB
* @since 2023-11-29 11:25:28
*/
//@PreAuthorize("@aps.hasPermission('oamTask:workOrder:record')")
@ApiOperation("技术模块-今日事务-工单记录列表")
@GetMapping("/getWorkOrderRecordList/{workOrderId}")
public R<List<TaskWorkOrderRecordListVo>> getWorkOrderRecordList(@PathVariable @ApiParam("工单id")
@ -79,7 +78,6 @@ public class TaskTechnologyController {
* @author DB
* @since 2023-11-29 11:33:35
*/
//@PreAuthorize("@aps.hasPermission('oamTask:workOrder:record')")
@ApiOperation("技术模块-今日事务-新增工单记录")
@PostMapping("/insertWorkOrderRecord")
public R<Void> insertWorkOrderRecord(@RequestBody @Validated
@ -96,7 +94,7 @@ public class TaskTechnologyController {
* @author DB
* @since 2023-11-30 21:11:47
*/
//@PreAuthorize("@aps.hasPermission('oamTask:taskArchiving:list')")
@PreAuthorize("@aps.hasPermission('oamTask:technology:list')")
@ApiOperation("技术模块-任务归档-获取任务归档分页")
@GetMapping("/getTaskArchivingPage")
public R<Page<TaskArchivingPagVo>> getTaskArchivingPage(TaskArchivingPagBo bo) {
@ -111,7 +109,7 @@ public class TaskTechnologyController {
* @author DB
* @since 2023-11-30 21:49:05
*/
//@PreAuthorize("@aps.hasPermission('oamTask:taskArchiving:update')")
@PreAuthorize("@aps.hasPermission('oamTask:technology:deploy')")
@ApiOperation("技术模块-任务归档-设置任务归档")
@PutMapping("/setTaskArchiving/{taskId}")
public R<Void> setTaskArchiving(@PathVariable @ApiParam("任务id")
@ -129,7 +127,7 @@ public class TaskTechnologyController {
* @author DB
* @since 2023-11-30 22:21:58
*/
//@PreAuthorize("@aps.hasPermission('oamTask:task:list')")
@PreAuthorize("@aps.hasPermission('oamTask:technology:list')")
@ApiOperation("技术模块-任务领取-获取领取任务分页")
@GetMapping("/getToBeClaimedPage")
public R<Page<TaskToBeClaimedPageVo>> getToBeClaimedPage(@ApiParam(value = "主体")
@ -179,11 +177,10 @@ public class TaskTechnologyController {
* @author DB
* @since 2023-12-01 10:35:31
*/
//@PreAuthorize("@aps.hasPermission('oamTask:taskAudit:update')")
@PreAuthorize("@aps.hasPermission('oamTask:technology:audit')")
@ApiOperation("技术模块-任务领取-任务审核")
@PutMapping("/setTaskAuditComments")
public R<Void> setTaskAuditComments(@RequestBody @Validated
TaskAuditCommentsBo bo) {
public R<Void> setTaskAuditComments(@RequestBody @Validated TaskAuditCommentsBo bo) {
taskService.setTaskAuditComments(bo);
return R.ok();
}
@ -195,7 +192,7 @@ public class TaskTechnologyController {
* @author DB
* @since 2023/12/04
*/
//@PreAuthorize("@aps.hasPermission('oamTask:task:list')")
@PreAuthorize("@aps.hasPermission('oamTask:technology:list')")
@ApiOperation("技术模块-今日事务-个人任务分页列表")
@GetMapping("/getPersonTaskPage")
public R<Page<PersonTaskPageVo>> getPersonTaskPage() {
@ -298,25 +295,27 @@ public class TaskTechnologyController {
/**
* 技术模块-今日事务-更新任务进度
* @author DB
* @since 2023/12/04
*
* @param bo 请求参数
* @return R<Void>
* @author DB
* @since 2023/12/04
*/
@ApiOperation("技术模块-今日事务-更新任务进度")
@PutMapping("/updateTaskProgress")
public R<Void> updateTaskProgress(@RequestBody @Validated
TaskProgressBo bo) {
TaskProgressBo bo) {
taskService.updateTaskProgress(bo);
return R.ok();
}
/**
* "技术模块-今日事务-转交任务
* @author DB
* @since 2023/12/04
*
* @param bo 请求参数
* @return R<Void>
* @author DB
* @since 2023/12/04
*/
@ApiOperation("技术模块-今日事务-转交任务")
@PutMapping("/updateTaskItem")
@ -328,11 +327,13 @@ public class TaskTechnologyController {
/**
* 技术模块-数据统计-获取月度任务统计列表
* @author DB
* @since 2023/12/04
*
* @param bo 请求参数
* @return R<TaskMonthStatisticsVo>
* @author DB
* @since 2023/12/04
*/
@PreAuthorize("@aps.hasPermission('oamTask:technology:list')")
@ApiOperation("技术模块-数据统计-获取月度任务统计列表")
@GetMapping("/getTaskMonthStatistics")
public R<TaskMonthStatisticsVo> getTaskMonthStatistics(TaskMonthStatisticsBo bo) {
@ -341,9 +342,10 @@ public class TaskTechnologyController {
/**
* 技术模块-数据统计-获取任务日报
*
* @return R<TaskMonthStatisticsVo>
* @author DB
* @since 2023/12/05
* @return R<TaskMonthStatisticsVo>
*/
@ApiOperation("技术模块-数据统计-获取任务日报")
@GetMapping("/getTaskDailyPaper")
@ -354,10 +356,12 @@ public class TaskTechnologyController {
/**
* 技术模块-今日事务-个人绩点
*
* @return R<TaskIndividualGpaVo>
* @author DB
* @since 2023/12/05
* @return R<TaskIndividualGpaVo>
*/
@PreAuthorize("@aps.hasPermission('oamTask:technology:list')")
@ApiOperation("技术模块-今日事务-个人绩点")
@GetMapping("/getIndividualGpa")
public R<TaskIndividualGpaVo> getIndividualGpa() {

View File

@ -65,7 +65,6 @@ public class TaskWorkOrderController {
* @author DB
* @since 2023-11-29 14:01:03
*/
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:list')")
@ApiOperation("工单模块-工单提交-获取当天值班人员")
@GetMapping("/getWorkOrderDutyStaff")
public R<WorkOrderDutyVo> getWorkOrderDutyStaff() {
@ -78,7 +77,6 @@ public class TaskWorkOrderController {
* @author DB
* @since 2023-11-29 14:35:08
*/
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:list')")
@ApiOperation("工单模块-工单提交-已办结分页列表")
@GetMapping("/finishWorkOrderPage")
public R<Page<TaskWorkOrderPageVo>> finishWorkOrderPage() {
@ -93,7 +91,6 @@ public class TaskWorkOrderController {
* @author DB
* @since 2023/5/30 16:53
**/
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:insert')")
@ApiOperation("工单模块-工单提交-新增工单")
@PostMapping("/insertWorkOrder")
public R<Void> insertWorkOrder(@RequestBody @Validated
@ -108,7 +105,6 @@ public class TaskWorkOrderController {
* @param workOrderId 工单id
* @since 2023-11-29 11:25:28
*/
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:record')")
@ApiOperation("工单模块-工单提交-工单记录列表")
@GetMapping("/getWorkOrderRecordList/{workOrderId}")
public R<List<TaskWorkOrderRecordListVo>> getWorkOrderRecordList(@PathVariable @ApiParam("工单id")
@ -123,7 +119,6 @@ public class TaskWorkOrderController {
* @param bo 请求参数
* @since 2023-11-29 11:33:35
*/
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:record')")
@ApiOperation("工单模块-工单提交-新增工单记录")
@PostMapping("/insertWorkOrderRecord")
public R<Void> insertWorkOrderRecord(@RequestBody @Validated
@ -138,7 +133,6 @@ public class TaskWorkOrderController {
* @param workOrderId 工单id
* @since 2023-11-29 11:41:46
*/
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:record')")
@ApiOperation("工单模块-工单提交-工单提醒")
@PutMapping("/workOrderRemind/{workOrderId}")
public R<Void> workOrderRemind(@PathVariable @ApiParam("工单id")
@ -153,8 +147,6 @@ public class TaskWorkOrderController {
* @param workOrderId 工单id
* @since 2023-11-29 12:30:21
*/
@Deprecated
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:update')")
@ApiOperation("工单模块-工单提交-工单转需求")
@PutMapping("/workOrderToDemand/{workOrderId}")
public R<Void> workOrderToDemand(@PathVariable @ApiParam("工单id")
@ -169,7 +161,6 @@ public class TaskWorkOrderController {
* @param bo 请求参数
* @since 2023-11-29 16:00:18
*/
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:update')")
@ApiOperation("工单模块-工单提交-工单暂停")
@PutMapping("/pauseWorkOrder")
public R<Void> pauseWorkOrder(@RequestBody @Validated
@ -184,7 +175,6 @@ public class TaskWorkOrderController {
* @param workOrderId 工单id
* @since 2023-11-29 15:44:08
*/
@PreAuthorize("@aps.hasPermission('oamTask:workOrder:update')")
@ApiOperation("工单模块-工单提交-工单办结")
@PutMapping("/workOrderFinish/{workOrderId}")
public R<Void> workOrderFinish(@PathVariable("workOrderId") @ApiParam("工单id")

View File

@ -0,0 +1,102 @@
package com.cpop.oam.business.controller.backstage;
import com.cpop.common.utils.bean.BeanUtils;
import com.cpop.core.base.R;
import com.cpop.core.base.entity.PageDomain;
import com.cpop.core.utils.SpringUtils;
import com.cpop.core.utils.sql.SqlUtils;
import com.cpop.oam.business.bo.TechnologyToolBo;
import com.cpop.oam.business.vo.TechnologyToolPageVo;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.cpop.oam.business.entity.TechnologyTool;
import com.cpop.oam.business.service.TechnologyToolService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import java.io.Serializable;
import java.util.List;
import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER;
import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF;
import static com.cpop.oam.business.entity.table.TechnologyToolTableDef.TECHNOLOGY_TOOL;
/**
* oam-技术工具表 控制层
*
* @author DB
* @since 2023-12-10
*/
@RestController
@Api(tags = "技术工具管理")
@RequestMapping("/technologyTool")
public class TechnologyToolController {
@Autowired
private TechnologyToolService technologyToolService;
/**
* 技术工具分页查询
* @author DB
* @since 2023/12/10
* @return Page<TechnologyToolPageVo>
*/
@GetMapping("/getTechnologyToolPage")
@ApiOperation("技术工具分页查询")
public R<Page<TechnologyToolPageVo>> getTechnologyToolPage(@RequestParam("toolType") @ApiParam(value = "工具类型", required = true) String toolType) {
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
Page<TechnologyToolPageVo> page = technologyToolService.pageAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()),
QueryWrapper.create().select(TECHNOLOGY_TOOL.ALL_COLUMNS)
.select(STAFF.NAME.as(TechnologyToolPageVo::getCreateUser))
.leftJoin(SYS_USER).on(SYS_USER.ID.eq(TECHNOLOGY_TOOL.CREATE_USER_ID))
.leftJoin(STAFF).on(STAFF.USER_ID.eq(SYS_USER.ID))
.where(TECHNOLOGY_TOOL.TOOL_TYPE.eq(toolType)),
TechnologyToolPageVo.class);
return R.ok(page);
}
/**
* 保存技术工具
* @author DB
* @since 2023/12/10
* @param bo 请求参数
* @return R<Void>
*/
@PostMapping("/insertTool")
@ApiOperation("保存技术工具")
public R<Void> insertTool(@RequestBody @Validated TechnologyToolBo bo) {
technologyToolService.save(BeanUtils.mapToClass(bo, TechnologyTool.class));
return R.ok();
}
/**
* 根据主键更新技术工具
* @author DB
* @since 2023/12/10
* @param bo 请求参数
* @return R<Void>
*/
@PutMapping("/updateTool")
@ApiOperation("根据主键更新技术工具")
public R<Void> update(@RequestBody @Validated TechnologyToolBo bo) {
technologyToolService.updateById(BeanUtils.mapToClass(bo, TechnologyTool.class));
return R.ok();
}
/**
* 根据主键删除oam-技术工具表
*
* @param id 主键
* @return {@code true} 删除成功{@code false} 删除失败
*/
@DeleteMapping("/removeById/{id}")
@ApiOperation("根据主键删除技术工具")
public R<Void> remove(@PathVariable @ApiParam("技术工具表主键") String id) {
technologyToolService.removeById(id);
return R.ok();
}
}

View File

@ -14,7 +14,6 @@ import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.WxPayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;

View File

@ -0,0 +1,116 @@
package com.cpop.oam.business.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
/**
* 数据导入Dto
* @author DB
* @version 1.0.0
* @since 2023-12-10 12:47
*/
@Data
public class DataImportDto {
/**
* 姓名
*/
@ExcelProperty("姓名")
private String name;
/**
* 电话
*/
@ExcelProperty("电话")
private String phone;
/**
* 课卡类型
*/
@ExcelProperty("课卡类型")
private String cardType;
/**
* 计费类型
*/
@ExcelProperty("计费类型")
private String billingType;
/**
* 首充课时
*/
@ExcelProperty("首充课时")
private Integer firstChargePeriod;
/**
* 剩余课时
*/
@ExcelProperty("剩余课时")
private Integer remainingClassHours;
/**
* 消费金额
*/
@ExcelProperty("消费金额")
private Integer amountSpent;
/**
* 办卡日期
*/
@DateTimeFormat(pattern = "yyyy/MM/dd")
@ExcelProperty("办卡日期")
private LocalDate createCardDate;
/**
* 有效期至
*/
@DateTimeFormat(pattern = "yyyy/MM/dd")
@ExcelProperty("有效期至")
private LocalDate expiryDate;
/**
* 课程顾问
*/
@ExcelProperty("课程顾问")
private String courseConsultant;
/**
* 性别
*/
@ExcelProperty("性别")
private String sex;
/**
* 课卡名称
*/
@ExcelProperty("课卡名称")
private String cardName;
/**
* 课卡状态
*/
@ExcelProperty("课卡状态")
private String cardStatus;
/**
* 备注
*/
@ExcelProperty("备注")
private String remark;
/**
* 停卡时剩余天数
*/
@ExcelProperty("停卡时剩余天数")
private Integer stopCardRemainingDays;
/**
* 停卡缓冲天数
*/
@ExcelProperty("停卡缓冲天数")
private Integer stopCardBufferDays;
}

View File

@ -0,0 +1,30 @@
package com.cpop.oam.business.dto;
import lombok.Data;
import lombok.experimental.Accessors;
import org.checkerframework.checker.units.qual.C;
/**
* @author DB
* @version 1.0.0
* @since 2023-12-10 17:03
*/
@Data
@Accessors(chain = true)
public class DataImportParamsDto {
/**
* 文件地址
*/
private String fileUrl;
/**
* 云校区id
*/
private String storeId;
/**
* 是否清空
*/
private String emptyTag;
}

View File

@ -0,0 +1,58 @@
package com.cpop.oam.business.entity;
import com.cpop.core.base.entity.BaseEntity;
import com.cpop.core.base.entity.BaseInsertListener;
import com.cpop.core.base.entity.BaseUpdateListener;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
/**
* 品牌管理员表 实体类
*
* @author DB
* @since 2023-12-07
*/
@Data
@EqualsAndHashCode(callSuper=false)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Table(value = "cp_oam_brand_manager", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
public class BrandManager extends BaseEntity implements Serializable {
/**
* 主键
*/
@Id
private String id;
/**
* 手机号
*/
private String phone;
/**
* 姓名
*/
private String name;
/**
* 云id
*/
private String brandManagerCloudId;
/**
* 是否删除(0否1是)
*/
@Column(isLogicDelete = true)
private Boolean isDelete;
}

View File

@ -0,0 +1,52 @@
package com.cpop.oam.business.entity;
import com.cpop.core.base.entity.BaseEntity;
import com.cpop.core.base.entity.BaseInsertListener;
import com.cpop.core.base.entity.BaseUpdateListener;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
/**
* 品牌管理员-品牌-校区表 实体类
*
* @author DB
* @since 2023-12-07
*/
@Data
@EqualsAndHashCode(callSuper=false)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Table(value = "cp_oam_brand_manager_store", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
public class BrandManagerStore extends BaseEntity implements Serializable {
/**
* 品管id
*/
@Id
private String brandManagerId;
/**
* 品牌id
*/
@Id
private String brandId;
/**
* 店铺/校区id
*/
@Id
private String storeId;
}

View File

@ -0,0 +1,73 @@
package com.cpop.oam.business.entity;
import com.cpop.core.base.entity.BaseEntity;
import com.cpop.core.base.entity.BaseInsertListener;
import com.cpop.core.base.entity.BaseUpdateListener;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
/**
* oam-数据导入表 实体类
*
* @author DB
* @since 2023-12-10
*/
@Data
@EqualsAndHashCode(callSuper=false)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Table(value = "cp_oam_data_import", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
public class DataImport extends BaseEntity implements Serializable {
/**
* 主键
*/
@Id
private String id;
/**
* 品牌id
*/
private String brandId;
/**
* 校区id
*/
private String storeId;
/**
* 导入文件地址
*/
private String fileUrl;
/**
* 是否清空
*/
private Boolean isClear;
/**
* 来源类型
*/
private String sourceType;
/**
* 导入状态
*/
private Boolean importStatus;
/**
* 是否删除(0否1是)
*/
@Column(isLogicDelete = true)
private Boolean isDelete;
}

View File

@ -52,6 +52,11 @@ public class Staff extends BaseEntity implements Serializable {
*/
private String roleId;
/**
* 是否是运维账号
*/
private Boolean isOperation;
/**
* 企微用户id
*/

View File

@ -92,7 +92,7 @@ public class Task extends BaseEntity implements Serializable {
/**
* 是否加急
*/
private Integer isUrgent;
private Boolean isUrgent;
/**
* 预期完成日期

View File

@ -56,7 +56,7 @@ public class TaskDemand extends BaseEntity implements Serializable {
/**
* 签约二维码
*/
private String signUrl;
private String payQrCode;
/**
* 预付款

View File

@ -0,0 +1,67 @@
package com.cpop.oam.business.entity;
import com.cpop.core.base.entity.BaseEntity;
import com.cpop.core.base.entity.BaseInsertListener;
import com.cpop.core.base.entity.BaseUpdateListener;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
/**
* oam-技术工具表 实体类
*
* @author DB
* @since 2023-12-10
*/
@Data
@EqualsAndHashCode(callSuper=false)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Table(value = "cp_oam_technology_tool", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
public class TechnologyTool extends BaseEntity implements Serializable {
/**
* 主键
*/
@Id
private String id;
/**
* 工具名
*/
private String toolName;
/**
* 工具地址
*/
private String toolUrl;
/**
* 工具介绍
*/
private String toolDesc;
/**
* 工具类型(字典)
*/
private String toolType;
/**
* 是否删除(0否1是)
*/
@Column(isLogicDelete = true)
private Boolean isDelete;
}

View File

@ -0,0 +1,14 @@
package com.cpop.oam.business.mapper;
import com.cpop.oam.business.entity.BrandManager;
import com.mybatisflex.core.BaseMapper;
/**
* 品牌管理员表 映射层
*
* @author DB
* @since 2023-12-07
*/
public interface BrandManagerMapper extends BaseMapper<BrandManager> {
}

View File

@ -0,0 +1,14 @@
package com.cpop.oam.business.mapper;
import com.cpop.oam.business.entity.BrandManagerStore;
import com.mybatisflex.core.BaseMapper;
/**
* 品牌管理员-品牌-校区表 映射层
*
* @author DB
* @since 2023-12-07
*/
public interface BrandManagerStoreMapper extends BaseMapper<BrandManagerStore> {
}

View File

@ -0,0 +1,14 @@
package com.cpop.oam.business.mapper;
import com.mybatisflex.core.BaseMapper;
import com.cpop.oam.business.entity.DataImport;
/**
* oam-数据导入表 映射层
*
* @author DB
* @since 2023-12-10
*/
public interface DataImportMapper extends BaseMapper<DataImport> {
}

View File

@ -0,0 +1,14 @@
package com.cpop.oam.business.mapper;
import com.mybatisflex.core.BaseMapper;
import com.cpop.oam.business.entity.TechnologyTool;
/**
* oam-技术工具表 映射层
*
* @author DB
* @since 2023-12-10
*/
public interface TechnologyToolMapper extends BaseMapper<TechnologyTool> {
}

View File

@ -0,0 +1,43 @@
package com.cpop.oam.business.service;
import com.cpop.oam.business.bo.BrandManagerBo;
import com.cpop.oam.business.bo.BrandManagerPageBo;
import com.cpop.oam.business.entity.BrandManager;
import com.cpop.oam.business.vo.BrandManagePageVo;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;
/**
* 品牌管理员表 服务层
*
* @author DB
* @since 2023-12-07
*/
public interface BrandManagerService extends IService<BrandManager> {
/**
* 查询品牌管理员分页
* @author DB
* @since 2023/12/07
* @param bo 请求参数
* @return Page<BrandManagePageVo>
*/
Page<BrandManagePageVo> getBrandManagerPage(BrandManagerPageBo bo);
/**
* 删除品牌管理员
* @author DB
* @since 2023/12/07
* @param id 主键
*/
void removeBrandManagerById(String id);
/**
* 新增品牌管理员
* @author DB
* @since 2023/12/08
* @param bo 请求参数
*/
void insertBrandManager(BrandManagerBo bo);
}

View File

@ -0,0 +1,14 @@
package com.cpop.oam.business.service;
import com.cpop.oam.business.entity.BrandManagerStore;
import com.mybatisflex.core.service.IService;
/**
* 品牌管理员-品牌-校区表 服务层
*
* @author DB
* @since 2023-12-07
*/
public interface BrandManagerStoreService extends IService<BrandManagerStore> {
}

View File

@ -0,0 +1,61 @@
package com.cpop.oam.business.service;
import com.cpop.oam.business.bo.DataImportBo;
import com.cpop.oam.business.bo.DataImportPageBo;
import com.cpop.oam.business.vo.DataImportPageVo;
import com.cpop.system.business.vo.SysFileVo;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;
import com.cpop.oam.business.entity.DataImport;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
/**
* oam-数据导入表 服务层
*
* @author DB
* @since 2023-12-10
*/
public interface DataImportService extends IService<DataImport> {
/**
* 数据导入分页查询
* @author DB
* @since 2023/12/10
* @param bo 请求参数
* @return R<Page<DataImportPageVo>>
*/
Page<DataImportPageVo> getDataImportPage(DataImportPageBo bo);
/**
* 新增数据导入
* @author DB
* @since 2023/12/10
* @param bo 请求参数
*/
void insertDataImport(DataImportBo bo);
/**
* 立即导入
* @author DB
* @since 2023/12/10
*/
void importNow(String id);
/**
* 导入
* @author DB
* @since 2023/12/10
* @param dataImport 导入详情
*/
void importNow(DataImport dataImport);
/**
* 检查上传的文件
* @author DB
* @since 2023/12/10
* @param file 文件
*/
SysFileVo checkImportData(MultipartFile file);
}

View File

@ -1,12 +1,9 @@
package com.cpop.oam.business.service;
import com.cpop.core.base.table.SysUser;
import com.cpop.oam.business.bo.*;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;
import com.cpop.oam.business.bo.ModifyUserPasswordBo;
import com.cpop.oam.business.bo.StaffBo;
import com.cpop.oam.business.bo.StaffPageBo;
import com.cpop.oam.business.bo.SysUserLogBo;
import com.cpop.oam.business.entity.Staff;
import com.cpop.oam.business.vo.StaffInfoVo;
import com.cpop.oam.business.vo.StaffPageVo;
@ -112,4 +109,11 @@ public interface StaffService extends IService<Staff> {
*/
List<StaffVo> getTechnologyStaffList();
/**
* 修改运维状态
* @author DB
* @since 2023/12/07
* @param bo 请求参数
*/
void changeOperationStatus(OperationStatusBo bo);
}

View File

@ -1,5 +1,7 @@
package com.cpop.oam.business.service;
import com.cpop.oam.business.bo.TaskDemandUrgentBo;
import com.cpop.oam.business.vo.TaskDemandUrgentVo;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;
import com.cpop.oam.business.bo.TaskDemandBo;
@ -46,4 +48,12 @@ public interface TaskDemandService extends IService<TaskDemand> {
* @since 2023-11-30 20:30:54
*/
void removeDemandTask(String demandId);
/**
* 工单模块-需求-需求加急
* @author DB
* @since 2023/12/08
* @param bo 请求参数
*/
TaskDemandUrgentVo demandUrgent(TaskDemandUrgentBo bo);
}

View File

@ -0,0 +1,14 @@
package com.cpop.oam.business.service;
import com.mybatisflex.core.service.IService;
import com.cpop.oam.business.entity.TechnologyTool;
/**
* oam-技术工具表 服务层
*
* @author DB
* @since 2023-12-10
*/
public interface TechnologyToolService extends IService<TechnologyTool> {
}

View File

@ -0,0 +1,18 @@
package com.cpop.oam.business.service.impl;
import com.cpop.oam.business.entity.BrandManagerStore;
import com.cpop.oam.business.mapper.BrandManagerStoreMapper;
import com.cpop.oam.business.service.BrandManagerStoreService;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* 品牌管理员-品牌-校区表 服务层实现
*
* @author DB
* @since 2023-12-07
*/
@Service("brandManageStoreService")
public class BrandManageStoreServiceImpl extends ServiceImpl<BrandManagerStoreMapper, BrandManagerStore> implements BrandManagerStoreService {
}

View File

@ -0,0 +1,154 @@
package com.cpop.oam.business.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.cpop.common.utils.bean.BeanUtils;
import com.cpop.common.utils.http.HttpUtils;
import com.cpop.core.base.entity.PageDomain;
import com.cpop.core.base.exception.ServiceException;
import com.cpop.core.utils.SpringUtils;
import com.cpop.core.utils.sql.SqlUtils;
import com.cpop.jambox.business.entity.BrandExtend;
import com.cpop.jambox.business.entity.StoreExtend;
import com.cpop.jambox.business.entity.table.BrandExtendTableDef;
import com.cpop.jambox.business.entity.table.StoreExtendTableDef;
import com.cpop.jambox.business.service.BrandExtendService;
import com.cpop.jambox.business.service.StoreExtendService;
import com.cpop.jambox.framework.constant.JamboxCloudUrl;
import com.cpop.oam.business.bo.BrandManagerBo;
import com.cpop.oam.business.bo.BrandManagerPageBo;
import com.cpop.oam.business.entity.BrandManagerStore;
import com.cpop.oam.business.entity.BrandManager;
import com.cpop.oam.business.mapper.BrandManagerMapper;
import com.cpop.oam.business.service.BrandManagerStoreService;
import com.cpop.oam.business.service.BrandManagerService;
import com.cpop.oam.business.vo.BrandManagePageVo;
import com.cpop.system.business.entity.table.BrandTableDef;
import com.cpop.system.business.entity.table.StoreTableDef;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import okhttp3.Response;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import static com.cpop.oam.business.entity.table.BrandManagerStoreTableDef.BRAND_MANAGER_STORE;
import static com.cpop.oam.business.entity.table.BrandManagerTableDef.BRAND_MANAGER;
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
import static com.mybatisflex.core.query.QueryMethods.distinct;
import static com.mybatisflex.core.query.QueryMethods.groupConcat;
/**
* 品牌管理员表 服务层实现
*
* @author DB
* @since 2023-12-07
*/
@Slf4j
@Service("brandManageService")
public class BrandManagerServiceImpl extends ServiceImpl<BrandManagerMapper, BrandManager> implements BrandManagerService {
/**
* 查询品牌管理员分页
* @author DB
* @since 2023/12/07
* @param bo 请求参数
* @return Page<BrandManagePageVo>
*/
@Override
public Page<BrandManagePageVo> getBrandManagerPage(BrandManagerPageBo bo) {
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
return this.pageAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()),
QueryWrapper.create()
//品管
.select(distinct(BRAND_MANAGER.ID, BRAND_MANAGER.NAME, BRAND_MANAGER.PHONE, BRAND_MANAGER.CREATE_TIME))
//品牌
.select(BRAND.BRAND_NAME)
//校区
.select(groupConcat(STORE.STORE_NAME).as(BrandManagePageVo::getStoreName))
//中间表
.leftJoin(BRAND_MANAGER_STORE).on(BRAND_MANAGER_STORE.BRAND_MANAGER_ID.eq(BRAND_MANAGER.ID))
//品牌
.leftJoin(BRAND).on(BRAND.ID.eq(BRAND_MANAGER_STORE.BRAND_ID))
//校区
.leftJoin(STORE).on(STORE.ID.eq(BRAND_MANAGER_STORE.STORE_ID))
.and(BRAND_MANAGER.PHONE.like(bo.getPhoneNumber()))
.and(BRAND_MANAGER.NAME.like(bo.getName()))
.and(BRAND.BRAND_NAME.like(bo.getBrandName()))
.groupBy(BRAND_MANAGER.ID),
BrandManagePageVo.class);
}
/**
* 删除品牌管理员
* @author DB
* @since 2023/12/07
* @param id 主键
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void removeBrandManagerById(String id) {
BrandManager brandManage = this.getById(id);
JSONObject jsonBody = new JSONObject();
jsonBody.put("_type","brandManagerDel");
jsonBody.put("brandManagerId", brandManage.getBrandManagerCloudId());
SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.COMMON_CARD_URL, jsonBody, JSONObject.class);
this.removeById(id);
//删除中间表
SpringUtils.getBean(BrandManagerStoreService.class).updateChain().where(BRAND_MANAGER_STORE.BRAND_MANAGER_ID.eq(id)).remove();
}
/**
* 新增品牌管理员
* @author DB
* @since 2023/12/08
* @param bo 请求参数
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void insertBrandManager(BrandManagerBo bo) {
//获取云品牌id
BrandExtend brandExtend = SpringUtils.getBean(BrandExtendService.class).queryChain().where(BrandExtendTableDef.BRAND_EXTEND.BRAND_ID.eq(bo.getBrandId())).one();
//获取用户信息
JSONObject jsonBody = new JSONObject();
jsonBody.put("_type", "brandManagerAdd");
jsonBody.put("brandId", brandExtend.getBrandCloudId());
jsonBody.put("name", bo.getName());
jsonBody.put("phone", bo.getPhone());
jsonBody.put("position", "OAM添加");
if (bo.getStoreIds() != null) {
//获取云校区id
List<String> cloudStoreIds = SpringUtils.getBean(StoreExtendService.class).queryChain().where(StoreExtendTableDef.STORE_EXTEND.STORE_ID.in(bo.getStoreIds())).list()
.stream().map(StoreExtend::getStoreCloudId).collect(Collectors.toList());
jsonBody.put("store", cloudStoreIds);
}
//本地新增
BrandManager brandManage = BeanUtils.mapToClass(bo, BrandManager.class);
JSONObject result = SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.COMMON_CARD_URL, jsonBody, JSONObject.class);
assert result != null;
brandManage.setBrandManagerCloudId(result.getString("data"));
this.save(brandManage);
List<BrandManagerStore> brandManagerStores = new ArrayList<>();
//添加中间表
if (bo.getStoreIds() != null) {
bo.getStoreIds().forEach(item -> {
BrandManagerStore brandManageStore = new BrandManagerStore();
brandManageStore.setStoreId(item).setBrandId(bo.getBrandId()).setBrandManagerId(brandManage.getId());
brandManagerStores.add(brandManageStore);
});
} else {
BrandManagerStore brandManageStore = new BrandManagerStore();
brandManageStore.setBrandId(bo.getBrandId()).setBrandManagerId(brandManage.getId());
brandManagerStores.add(brandManageStore);
}
SpringUtils.getBean(BrandManagerStoreService.class).saveBatch(brandManagerStores);
}
}

View File

@ -0,0 +1,238 @@
package com.cpop.oam.business.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.exception.ExcelDataConvertException;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.util.ListUtils;
import com.cpop.common.utils.StringUtils;
import com.cpop.common.utils.bean.BeanUtils;
import com.cpop.core.base.entity.PageDomain;
import com.cpop.core.base.enums.SourceType;
import com.cpop.core.base.exception.ServiceException;
import com.cpop.core.handler.TencentCosHandler;
import com.cpop.core.utils.SpringUtils;
import com.cpop.core.utils.file.FileUploadUtils;
import com.cpop.core.utils.file.FileUtils;
import com.cpop.core.utils.sql.SqlUtils;
import com.cpop.jambox.business.entity.StoreExtend;
import com.cpop.jambox.business.service.StoreExtendService;
import com.cpop.jambox.framework.constant.JamboxCloudUrl;
import com.cpop.oam.business.bo.DataImportBo;
import com.cpop.oam.business.bo.DataImportPageBo;
import com.cpop.oam.business.dto.DataImportDto;
import com.cpop.oam.business.dto.DataImportParamsDto;
import com.cpop.oam.business.vo.DataImportPageVo;
import com.cpop.system.business.vo.SysFileVo;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.cpop.oam.business.entity.DataImport;
import com.cpop.oam.business.mapper.DataImportMapper;
import com.cpop.oam.business.service.DataImportService;
import com.qcloud.cos.model.UploadResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.List;
import static com.alibaba.excel.cache.Ehcache.BATCH_COUNT;
import static com.cpop.jambox.business.entity.table.StoreExtendTableDef.STORE_EXTEND;
import static com.cpop.oam.business.entity.table.DataImportTableDef.DATA_IMPORT;
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
/**
* oam-数据导入表 服务层实现
*
* @author DB
* @since 2023-12-10
*/
@Service("dataImportService")
@Slf4j
public class DataImportServiceImpl extends ServiceImpl<DataImportMapper, DataImport> implements DataImportService {
/**
* 数据导入分页查询
* @author DB
* @since 2023/12/10
* @param bo 请求参数
* @return R<Page<DataImportPageVo>>
*/
@Override
public Page<DataImportPageVo> getDataImportPage(DataImportPageBo bo) {
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
return this.pageAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()),
QueryWrapper.create().select(DATA_IMPORT.ID, DATA_IMPORT.FILE_URL, DATA_IMPORT.IS_CLEAR, DATA_IMPORT.IMPORT_STATUS, DATA_IMPORT.CREATE_TIME)
.select(BRAND.BRAND_NAME)
.select(STORE.STORE_NAME)
.leftJoin(BRAND).on(BRAND.ID.eq(DATA_IMPORT.BRAND_ID))
.leftJoin(STORE).on(STORE.ID.eq(DATA_IMPORT.STORE_ID))
.where(DATA_IMPORT.IMPORT_STATUS.eq(bo.getImportStatus()))
.and(STORE.STORE_NAME.like(bo.getStoreName())),
DataImportPageVo.class);
}
/**
* 新增数据导入
* @author DB
* @since 2023/12/10
* @param bo 请求参数
*/
@Override
public void insertDataImport(DataImportBo bo) {
DataImport dataImport = BeanUtils.mapToClass(bo, DataImport.class);
dataImport.setImportStatus(false).setSourceType(SourceType.JAMBOX.getName());
this.save(dataImport);
}
/**
* 立即导入
* @author DB
* @since 2023/12/10
*/
@Override
public void importNow(String id) {
//读取数据
DataImport dataImport = this.getById(id);
importNow(dataImport);
}
@Override
public void importNow(DataImport dataImport) {
//读取数据
DataImportParamsDto dataImportParamsDto = new DataImportParamsDto();
dataImportParamsDto.setFileUrl(dataImport.getFileUrl()).setEmptyTag(dataImport.getIsClear() ? "清空" : "不清空");
if (SourceType.valueOf(dataImport.getSourceType()) == SourceType.JAMBOX) {
StoreExtend storeExtend = SpringUtils.getBean(StoreExtendService.class).queryChain().where(STORE_EXTEND.STORE_ID.eq(dataImport.getStoreId())).one();
dataImportParamsDto.setStoreId(storeExtend.getStoreCloudId());
} else {
dataImportParamsDto.setStoreId(dataImport.getStoreId());
}
SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.DATA_IMPORT, dataImportParamsDto, String.class);
this.updateChain().set(DATA_IMPORT.IMPORT_STATUS, true).where(DATA_IMPORT.ID.eq(dataImport.getId())).update();
}
/**
* 检查上传的文件
* @author DB
* @since 2023/12/10
* @param file 文件
*/
@Override
public SysFileVo checkImportData(MultipartFile file) {
//临时存储
List<DataImportDto> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
//文件检查
File tempFile = null;
String fileName = file.getOriginalFilename();
try {
EasyExcel.read(file.getInputStream(), DataImportDto.class, new ReadListener<DataImportDto>() {
@Override
public void invoke(DataImportDto dataImportDto, AnalysisContext analysisContext) {
//检查手机号
if (StringUtils.isBlank(dataImportDto.getPhone())) {
throw new ServiceException("手机号为空!");
}
//课卡类型
if (StringUtils.isBlank(dataImportDto.getCardType())) {
dataImportDto.setCardType("少儿");
}
//计费类型
if (StringUtils.isBlank(dataImportDto.getBillingType())) {
dataImportDto.setBillingType("限时卡");
}
//首充课时
if (dataImportDto.getFirstChargePeriod() == null) {
dataImportDto.setFirstChargePeriod(0);
}
//剩余课时
if (dataImportDto.getRemainingClassHours() == null) {
dataImportDto.setFirstChargePeriod(0);
}
//消费金额
if (dataImportDto.getAmountSpent() == null) {
dataImportDto.setAmountSpent(0);
}
//课程顾问
if (StringUtils.isBlank(dataImportDto.getBillingType())) {
dataImportDto.setBillingType("校长");
}
//性别
if (StringUtils.isBlank(dataImportDto.getSex())) {
dataImportDto.setSex("");
}
//课卡名称
if (StringUtils.isBlank(dataImportDto.getCardName())) {
throw new ServiceException("课卡名称不能为空");
}
//停卡时剩余天数
if (dataImportDto.getStopCardRemainingDays() == null) {
dataImportDto.setStopCardRemainingDays(0);
dataImportDto.setCardStatus("使用中");
} else {
dataImportDto.setCardStatus("停卡");
}
//停卡缓冲天数
if (dataImportDto.getStopCardBufferDays() == null) {
dataImportDto.setStopCardBufferDays(0);
}
if (dataImportDto.getStopCardBufferDays() != 0 && StringUtils.equals("使用中", dataImportDto.getCardStatus())) {
dataImportDto.setCardStatus("未激活");
} else if (dataImportDto.getStopCardBufferDays() != 0 && StringUtils.equals("停卡", dataImportDto.getCardStatus())) {
dataImportDto.setCardStatus("停卡未激活");
}
cachedDataList.add(dataImportDto);
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
/**
* 在转换异常 获取其他异常下会调用本接口抛出异常则停止读取如果这里不抛出异常则 继续读取下一行
*
* @param exception 异常
* @param context 内容
*/
@Override
public void onException(Exception exception, AnalysisContext context) {
// 如果是某一个单元格的转换异常 能获取到具体行号 如果要获取头的信息 配合invokeHeadMap使用
if (exception instanceof ExcelDataConvertException) {
ExcelDataConvertException excelDataConvertException = (ExcelDataConvertException) exception;
throw new ServiceException("" + (excelDataConvertException.getRowIndex() + 1) + "行,第" + (excelDataConvertException.getColumnIndex() + 1) + "列解析异常,数据为:" + excelDataConvertException.getCellData());
}
}
}).sheet().doRead();
tempFile = File.createTempFile(fileName, ".xlsx");
log.info("文件名:{};临时文件地址: {}", fileName, tempFile.getPath());
EasyExcel.write(tempFile.getPath(), DataImportDto.class)
.sheet("模板")
.doWrite(() -> {
// 分页查询数据
return cachedDataList;
});
MultipartFile multipartFile = FileUtils.getInstance().getMultipartFile(tempFile);
//文件上传
TencentCosHandler tencentCosHandler = SpringUtils.getBean(TencentCosHandler.class);
UploadResult uploadResult = tencentCosHandler.cdnUpload(multipartFile);
String filename = FileUploadUtils.getInstance().extractFilename(multipartFile);
SysFileVo sysFileVo = new SysFileVo();
sysFileVo.setUrl("https://" + uploadResult.getBucketName() + tencentCosHandler.getCdnUrl() + uploadResult.getKey())
.setFileName(filename)
.setNewFileName(FileUtils.getInstance().getName(filename))
.setOriginalFilename(file.getOriginalFilename());
return sysFileVo;
} catch (IOException e) {
throw new ServiceException("文件上传失败!");
} finally {
assert tempFile != null;
//tempFile.delete();
}
}
}

View File

@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
import com.cpop.common.constant.Constants;
import com.cpop.common.utils.StringUtils;
import com.cpop.common.utils.bean.BeanUtils;
import com.cpop.common.utils.http.HttpUtils;
import com.cpop.core.base.R;
import com.cpop.core.base.entity.LoginUser;
import com.cpop.core.base.entity.PageDomain;
import com.cpop.core.base.entity.loginInfo.OamStaffLoginInfo;
@ -15,10 +17,8 @@ import com.cpop.core.service.RedisService;
import com.cpop.core.utils.*;
import com.cpop.core.utils.sql.SqlUtils;
import com.cpop.core.utils.uuid.IdUtils;
import com.cpop.oam.business.bo.ModifyUserPasswordBo;
import com.cpop.oam.business.bo.StaffBo;
import com.cpop.oam.business.bo.StaffPageBo;
import com.cpop.oam.business.bo.SysUserLogBo;
import com.cpop.jambox.framework.constant.JamboxCloudUrl;
import com.cpop.oam.business.bo.*;
import com.cpop.oam.business.entity.Staff;
import com.cpop.oam.business.entity.StaffMidDept;
import com.cpop.oam.business.mapper.StaffMapper;
@ -37,10 +37,13 @@ import com.mybatisflex.spring.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage;
import okhttp3.*;
import org.springframework.security.crypto.bcrypt.BCrypt;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
@ -381,4 +384,27 @@ public class StaffServiceImpl extends ServiceImpl<StaffMapper, Staff> implements
StaffVo.class);
}
/**
* 修改运维状态
* @author DB
* @since 2023/12/07
* @param bo 请求参数
*/
@Override
public void changeOperationStatus(OperationStatusBo bo) {
//获取用户信息
Staff staff = this.getById(bo.getId());
SysUser sysUser = DbChain.table(SYS_USER).select(SYS_USER.PHONE_NUMBER).where(SYS_USER.ID.eq(staff.getUserId())).oneAs(SysUser.class);
JSONObject jsonBody = new JSONObject();
if (bo.getIsOperation()) {
jsonBody.put("_type", "oamAdd");
jsonBody.put("name", staff.getName());
jsonBody.put("phone", sysUser.getPhoneNumber());
} else {
jsonBody.put("_type", "oamDel");
jsonBody.put("phone", sysUser.getPhoneNumber());
}
SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.COMMON_CARD_URL, jsonBody, JSONObject.class);
}
}

View File

@ -1,12 +1,13 @@
package com.cpop.oam.business.service.impl;
import cn.binarywang.wx.miniapp.api.WxMaQrcodeService;
import cn.binarywang.wx.miniapp.api.WxMaService;
import com.alibaba.fastjson.JSONObject;
import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler;
import com.cpop.common.constant.Constants;
import com.cpop.common.utils.StringUtils;
import com.cpop.common.utils.bean.BeanUtils;
import com.cpop.core.base.entity.LoginUser;
import com.cpop.core.base.entity.PageDomain;
import com.cpop.core.base.entity.loginInfo.OamStaffLoginInfo;
import com.cpop.core.base.enums.UserType;
import com.cpop.core.base.exception.ServiceException;
import com.cpop.core.base.table.SysConfig;
@ -17,21 +18,29 @@ import com.cpop.core.utils.SpringUtils;
import com.cpop.core.utils.sql.SqlUtils;
import com.cpop.oam.business.bo.TaskDemandBo;
import com.cpop.oam.business.bo.TaskDemandPageBo;
import com.cpop.oam.business.bo.TaskDemandUrgentBo;
import com.cpop.oam.business.entity.Task;
import com.cpop.oam.business.entity.TaskDemand;
import com.cpop.oam.business.mapper.TaskDemandMapper;
import com.cpop.oam.business.service.TaskDemandService;
import com.cpop.oam.business.service.TaskService;
import com.cpop.oam.business.vo.TaskDemandPageVo;
import com.cpop.oam.business.vo.TaskDemandUrgentVo;
import com.cpop.oam.framework.constant.WebHookKeyConstant;
import com.cpop.oam.framework.enums.OamConfigEnum;
import com.cpop.system.business.vo.SysFileVo;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.qcloud.cos.model.UploadResult;
import me.chanjar.weixin.common.error.WxErrorException;
import org.springframework.stereotype.Service;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER;
@ -41,6 +50,7 @@ import static com.cpop.oam.business.entity.table.TaskTableDef.TASK;
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
/**
* OAM-任务-需求表 服务层实现
@ -236,4 +246,40 @@ public class TaskDemandServiceImpl extends ServiceImpl<TaskDemandMapper, TaskDem
this.removeById(demandId);
SpringUtils.getBean(TaskService.class).removeById(demand.getTaskId());
}
/**
* 工单模块-需求-需求加急
* @author DB
* @since 2023/12/08
* @param bo 请求参数
*/
@Override
public TaskDemandUrgentVo demandUrgent(TaskDemandUrgentBo bo) {
//获取需求任务
TaskDemand demand = this.getById(bo.getId());
TaskDemandUrgentVo taskDemandUrgentVo = BeanUtils.mapToClass(demand, TaskDemandUrgentVo.class);
TaskService taskService = SpringUtils.getBean(TaskService.class);
Task task = taskService.getById(demand.getTaskId());
taskDemandUrgentVo.setTaskRating(task.getTaskRating());
if (!task.getIsUrgent()){
WxMaQrcodeService qrcodeService = SpringUtils.getBean(WxMaService.class).getQrcodeService();
try {
// 获取当前执行环境
String active = SpringUtils.getActiveProfile();
byte[] qrCodeBytes = qrcodeService.createWxaCodeUnlimitBytes(bo.getId(), "pages/index/index", false, StringUtils.equals(active, "prod") ? "release" : "trial", 430,
true, null, false);
Base64.Encoder encoder = Base64.getEncoder();
String qrCode = encoder.encodeToString(qrCodeBytes);
//存在本地
this.updateChain().set(TASK_DEMAND.PAY_QR_CODE, Constants.QRCODE_HEADER + qrCode)
.where(TASK_DEMAND.ID.eq(bo.getId())).update();
//更新任务
taskService.updateChain().set(TASK.IS_URGENT,true).where(TASK.ID.eq(demand.getTaskId())).update();
taskDemandUrgentVo.setPayQrCode(Constants.QRCODE_HEADER + qrCode);
} catch (WxErrorException e) {
throw new ServiceException("生成支付码失败");
}
}
return taskDemandUrgentVo;
}
}

View File

@ -237,7 +237,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
task.setTaskStatus(1)
// 默认开发中
.setTaskItem(0)
.setTaskWeight(10)
.setTaskWeight(0)
// 工单不参与评级
.setTaskRating("N")
.setRecordStaffId(loginUserInfo.getString("id"))
@ -298,15 +298,14 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
QuartzEnums acceptEnums = QuartzEnums.WORK_ORDER_ACCEPT_OVERTIME_TASK;
// 开始
if (isStart) {
// 未接收半小时后触发
LocalDateTime localDateTime = dateTime.plusMinutes(30);
ZoneId zoneId = ZoneId.systemDefault();
String cron = quartzUtils.convertToCron(Date.from(localDateTime.atZone(zoneId).toInstant()));
// 通过JobBuilder构建JobDetail实例JobDetail规定其job只能是实现Job接口的实例
JobDetail jobDetail = JobBuilder.newJob(WorkOrderAcceptOverTimeTask.class)
.withIdentity(acceptEnums.getName() + workOrderId, acceptEnums.getGroup())
.usingJobData("WorkOrderId", workOrderId)
.build();
LocalDateTime localDateTime = dateTime.plusMinutes(30);
ZoneId zoneId = ZoneId.systemDefault();
String cron = quartzUtils.convertToCron(Date.from(localDateTime.atZone(zoneId).toInstant()));
CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(cron);
// CronTrigger表达式触发器 继承于TriggerTriggerBuilder 用于构建触发器实例
CronTrigger cronTrigger = TriggerBuilder.newTrigger()
@ -336,7 +335,10 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
// 基于表达式构建触发器
QuartzUtils quartzUtils = SpringUtils.getBean(QuartzUtils.class);
try {
LocalDateTime localDateTime = dateTime.plusHours(2);
//本地快速测试5min
//实际两小时
//LocalDateTime localDateTime = dateTime.plusHours(2);
LocalDateTime localDateTime = dateTime.plusMinutes(2);
ZoneId zoneId = ZoneId.systemDefault();
String cron = quartzUtils.convertToCron(Date.from(localDateTime.atZone(zoneId).toInstant()));
if (isUpdate) {
@ -636,22 +638,13 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
*/
@Override
public List<TaskWorkOrderPersonVo> getPersonWorkOrder() {
// 获取当前用户
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
// 获取当天技术值班
// 获取值班员工
DutyService dutyService = SpringUtils.getBean(DutyService.class);
Duty duty = dutyService.getOne(QueryWrapper.create().where(DUTY.DUTY_DATE.eq(DateUtils.getDate())));
if (duty == null) {
throw new ServiceException("当天没有值班员工,请联系相关人员添加值班信息!");
}
// 判断当前用户是不是值班用户
QueryWrapper queryWrapper = QueryWrapper.create();
if (!StringUtils.equals(duty.getTechnologyStaffId(), loginUserInfo.getString("id"))) {
// 获取未接受的工单
queryWrapper.or(TASK.TASK_STATUS.in(1, 7));
}
return this.mapper.selectListByQueryAs(queryWrapper
return this.mapper.selectListByQueryAs(QueryWrapper.create()
.select(TASK_WORK_ORDER.ID,
TASK_WORK_ORDER.PHONE_NUMBER,
TASK_WORK_ORDER.CREATE_TIME.as("createTime"),
@ -662,13 +655,13 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
.select(BRAND.BRAND_NAME)
// 校区
.select(STORE.STORE_NAME)
.where(TASK.RESPONSIBLE_STAFF_ID.eq(loginUserInfo.getString("id")))
.leftJoin(TASK)
.on(TASK.ID.eq(TASK_WORK_ORDER.TASK_ID))
.leftJoin(BRAND)
.on(BRAND.ID.eq(TASK_WORK_ORDER.BRAND_ID))
.leftJoin(STORE)
.on(STORE.ID.eq(TASK_WORK_ORDER.STORE_ID)),
.on(STORE.ID.eq(TASK_WORK_ORDER.STORE_ID))
.where(TASK.TASK_STATUS.in(1, 2, 4, 5, 6, 7)),
TaskWorkOrderPersonVo.class,
// 提交人
item -> item.field(TaskWorkOrderPersonVo::getRecordStaffName)
@ -705,13 +698,16 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
LocalDateTime now = LocalDateTime.now();
SpringUtils.getBean(TaskService.class).updateChain()
.set(TASK.TASK_STATUS, 2)
.set(TASK.TASK_RECEIPT_TIME, now).where(TASK.ID.eq(task.getId()))
.set(TASK.TASK_RECEIPT_TIME, now)
.where(TASK.ID.eq(task.getId()))
.update();
int receivingTime = now.compareTo(workOrder.getCreateTime());
workOrder.setReceivingTime(receivingTime);
this.updateById(workOrder);
//删除时任务
//删除工单接收超时任务
startOrRemoveWorkOrderAcceptTask(taskWorkOrderId, false, now);
//生成工单处理超时任务
startOrUpdateWorkOrderOvertimeTask(taskWorkOrderId,false,now);
}
}

View File

@ -0,0 +1,18 @@
package com.cpop.oam.business.service.impl;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.cpop.oam.business.entity.TechnologyTool;
import com.cpop.oam.business.mapper.TechnologyToolMapper;
import com.cpop.oam.business.service.TechnologyToolService;
import org.springframework.stereotype.Service;
/**
* oam-技术工具表 服务层实现
*
* @author DB
* @since 2023-12-10
*/
@Service("technologyToolService")
public class TechnologyToolServiceImpl extends ServiceImpl<TechnologyToolMapper, TechnologyTool> implements TechnologyToolService {
}

View File

@ -0,0 +1,57 @@
package com.cpop.oam.business.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
/**
* @author DB
* @version 1.0.0
* @since 2023-12-07 17:26
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "BrandManage对象", description = "品牌管理员")
public class BrandManagePageVo {
/**
* 主键
*/
@ApiModelProperty("主键")
private String id;
/**
* 姓名
*/
@ApiModelProperty("姓名")
private String name;
/**
* 手机号
*/
@ApiModelProperty("手机号")
private String phone;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
/**
* 品牌名
*/
@ApiModelProperty("品牌名")
private String brandName;
/**
* 校区名
*/
@ApiModelProperty("校区名")
private String storeName;
}

View File

@ -0,0 +1,63 @@
package com.cpop.oam.business.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
/**
* @author DB
* @version 1.0.0
* @since 2023-12-10 11:08
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "DataImportPageVo对象")
public class DataImportPageVo {
/**
* 主键
*/
@ApiModelProperty(value = "主键")
private String id;
/**
* 品牌id
*/
@ApiModelProperty(value = "品牌")
private String brandName;
/**
* 校区
*/
@ApiModelProperty(value = "校区")
private String storeName;
/**
* 导入文件地址
*/
@ApiModelProperty(value = "导入文件地址")
private String fileUrl;
/**
* 是否清空
*/
@ApiModelProperty(value = "是否清空")
private Boolean isClear;
/**
* 导入状态
*/
@ApiModelProperty(value = "导入状态")
private Boolean importStatus;
/**
* 上传时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
@ApiModelProperty(value = "上传时间")
private LocalDateTime createTime;
}

View File

@ -120,4 +120,10 @@ public class StaffPageVo implements Serializable {
*/
@ApiModelProperty("密码")
private String password;
/**
* 是否是运维账号
*/
@ApiModelProperty("是否是运维账号")
private Boolean isOperation;
}

View File

@ -0,0 +1,55 @@
package com.cpop.oam.business.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* @author DB
* @version 1.0.0
* @since 2023-12-10 10:04
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "任务加急返回对象", description = "任务加急返回对象")
public class TaskDemandUrgentVo {
/**
* 需求id
*/
@ApiModelProperty(value = "需求id")
private String id;
/**
* 支付二维码
*/
@ApiModelProperty(value = "支付二维码")
private String payQrCode;
/**
* 签约图片
*/
@ApiModelProperty(value = "签约图片")
private String signPic;
/**
* 任务评级(A;B:C:D:E)
*/
@ApiModelProperty(value = "任务评级(A;B:C:D:E)")
private String taskRating;
/**
* 预付款
*/
@ApiModelProperty(value = "预付款")
private BigDecimal prepayment;
/**
* 应付款
*/
@ApiModelProperty(value = "应付款")
private BigDecimal payable;
}

View File

@ -0,0 +1,64 @@
package com.cpop.oam.business.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.annotation.Id;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
/**
* @author DB
* @version 1.0.0
* @since 2023-12-10 10:30
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "TechnologyToolPageVo对象", description = "TechnologyToolPageVo对象")
public class TechnologyToolPageVo {
/**
* 主键
*/
@ApiModelProperty(value = "主键")
private String id;
/**
* 工具名
*/
@ApiModelProperty(value = "工具名")
private String toolName;
/**
* 工具地址
*/
@ApiModelProperty(value = "工具地址")
private String toolUrl;
/**
* 工具介绍
*/
@ApiModelProperty(value = "工具介绍")
private String toolDesc;
/**
* 工具类型(字典)
*/
@ApiModelProperty(value = "工具类型")
private String toolType;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private String createUser;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
}

View File

@ -0,0 +1,132 @@
package com.cpop.oam.framework.config.wxMa;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
import cn.binarywang.wx.miniapp.bean.WxMaKefuMessage;
import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage;
import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
import cn.binarywang.wx.miniapp.message.WxMaMessageHandler;
import cn.binarywang.wx.miniapp.message.WxMaMessageRouter;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.error.WxRuntimeException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.io.File;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author <a href="https://github.com/binarywang">Binary Wang</a>
*/
@Slf4j
@Configuration
@EnableConfigurationProperties(WxMaProperties.class)
public class WxMaConfiguration {
private final WxMaProperties properties;
@Autowired
public WxMaConfiguration(WxMaProperties properties) {
this.properties = properties;
}
@Bean
public WxMaService wxMaService() {
List<WxMaProperties.Config> configs = this.properties.getConfigs();
if (configs == null) {
throw new WxRuntimeException("小程序相关信息配置错误");
}
WxMaService maService = new WxMaServiceImpl();
maService.setMultiConfigs(
configs.stream()
.map(a -> {
WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
//WxMaDefaultConfigImpl config = new WxMaRedisConfigImpl(new JedisPool());
// 使用上面的配置时需要同时引入jedis-lock的依赖否则会报类无法找到的异常
config.setAppid(a.getAppid());
config.setSecret(a.getSecret());
config.setToken(a.getToken());
config.setAesKey(a.getAesKey());
config.setMsgDataFormat(a.getMsgDataFormat());
return config;
}).collect(Collectors.toMap(WxMaDefaultConfigImpl::getAppid, a -> a, (o, n) -> o)));
return maService;
}
@Bean
public WxMaMessageRouter wxMaMessageRouter(WxMaService wxMaService) {
final WxMaMessageRouter router = new WxMaMessageRouter(wxMaService);
router
.rule().handler(logHandler).next()
.rule().async(false).content("订阅消息").handler(subscribeMsgHandler).end()
.rule().async(false).content("文本").handler(textHandler).end()
.rule().async(false).content("图片").handler(picHandler).end()
.rule().async(false).content("二维码").handler(qrcodeHandler).end();
return router;
}
private final WxMaMessageHandler subscribeMsgHandler = (wxMessage, context, service, sessionManager) -> {
service.getMsgService().sendSubscribeMsg(WxMaSubscribeMessage.builder()
.templateId("此处更换为自己的模板id")
.data(Lists.newArrayList(
new WxMaSubscribeMessage.MsgData("keyword1", "339208499")))
.toUser(wxMessage.getFromUser())
.build());
return null;
};
private final WxMaMessageHandler logHandler = (wxMessage, context, service, sessionManager) -> {
log.info("收到消息:" + wxMessage.toString());
service.getMsgService().sendKefuMsg(WxMaKefuMessage.newTextBuilder().content("收到信息为:" + wxMessage.toJson())
.toUser(wxMessage.getFromUser()).build());
return null;
};
private final WxMaMessageHandler textHandler = (wxMessage, context, service, sessionManager) -> {
service.getMsgService().sendKefuMsg(WxMaKefuMessage.newTextBuilder().content("回复文本消息")
.toUser(wxMessage.getFromUser()).build());
return null;
};
private final WxMaMessageHandler picHandler = (wxMessage, context, service, sessionManager) -> {
try {
WxMediaUploadResult uploadResult = service.getMediaService()
.uploadMedia("image", "png",
ClassLoader.getSystemResourceAsStream("tmp.png"));
service.getMsgService().sendKefuMsg(
WxMaKefuMessage
.newImageBuilder()
.mediaId(uploadResult.getMediaId())
.toUser(wxMessage.getFromUser())
.build());
} catch (WxErrorException e) {
e.printStackTrace();
}
return null;
};
private final WxMaMessageHandler qrcodeHandler = (wxMessage, context, service, sessionManager) -> {
try {
final File file = service.getQrcodeService().createQrcode("123", 430);
WxMediaUploadResult uploadResult = service.getMediaService().uploadMedia("image", file);
service.getMsgService().sendKefuMsg(
WxMaKefuMessage
.newImageBuilder()
.mediaId(uploadResult.getMediaId())
.toUser(wxMessage.getFromUser())
.build());
} catch (WxErrorException e) {
e.printStackTrace();
}
return null;
};
}

View File

@ -0,0 +1,46 @@
package com.cpop.oam.framework.config.wxMa;
import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties;
import lombok.Data;
/**
* @author <a href="https://github.com/binarywang">Binary Wang</a>
*/
@Data
@ConfigurationProperties(prefix = "wx.miniapp")
public class WxMaProperties {
private List<Config> configs;
@Data
public static class Config {
/**
* 设置微信小程序的appid
*/
private String appid;
/**
* 设置微信小程序的Secret
*/
private String secret;
/**
* 设置微信小程序消息服务器配置的token
*/
private String token;
/**
* 设置微信小程序消息服务器配置的EncodingAESKey
*/
private String aesKey;
/**
* 消息格式XML或者JSON
*/
private String msgDataFormat;
}
}

View File

@ -0,0 +1,72 @@
package com.cpop.oam.framework.handler.wxPay;
import com.alibaba.fastjson.JSONObject;
import com.cpop.common.utils.StringUtils;
import com.cpop.core.base.exception.ServiceException;
import com.cpop.core.utils.SecurityUtils;
import com.cpop.core.utils.SpringUtils;
import com.cpop.system.business.entity.Brand;
import com.cpop.system.business.service.BrandService;
import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.service.WxPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author DB
* @createTime 2023/10/27 15:47
* @description
*/
@Component
public class WxPayHandler {
@Autowired
private WxPayService wxPayService;
/**
* @descriptions 获取微信支付service
* @author DB
* @date 2023/10/27 15:53
* @return: com.github.binarywang.wxpay.service.WxPayService
*/
public WxPayService getWxPayService(){
//查询当前登陆用户所在品牌的商户id
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
if (loginUserInfo == null) {
//直接返回
return wxPayService;
}
String brandId = loginUserInfo.getString("brandId");
Brand brand = SpringUtils.getBean(BrandService.class).getById(brandId);
//检查是否开启分账
if (!brand.getIsOpenSharing()) {
throw new ServiceException("当前商户暂未开启分账,请联系相关客服");
}
WxPayConfig payConfig = wxPayService.getConfig();
//子商户信息
payConfig.setSubMchId(StringUtils.trimToNull(brand.getWxMchId()));
// 可以指定是否使用沙箱环境
payConfig.setUseSandboxEnv(false);
wxPayService.setConfig(payConfig);
return wxPayService;
}
/**
* @descriptions 根据商户appid或商户号获取对应微信支付接口
* @author DB
* @date 2023/10/18 10:34
* @param subAppId 子商户appid
* @param subMchId 子商户id
* @return: com.github.binarywang.wxpay.service.WxPayService
*/
public WxPayService getWxPayService(String subAppId, String subMchId) {
WxPayConfig payConfig = wxPayService.getConfig();
//子商户信息
payConfig.setSubAppId(StringUtils.trimToNull(subAppId));
payConfig.setSubMchId(StringUtils.trimToNull(subMchId));
// 可以指定是否使用沙箱环境
payConfig.setUseSandboxEnv(false);
wxPayService.setConfig(payConfig);
return wxPayService;
}
}

View File

@ -0,0 +1,21 @@
package com.cpop.oam.framework.tasks;
import com.cpop.core.utils.SpringUtils;
import com.cpop.oam.business.entity.DataImport;
import com.cpop.oam.business.service.DataImportService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
/**
* @author DB
* @version 1.0.0
* @since 2023-12-10 17:19
*/
@Component
public class DataImportAsyncTask {
@Async("customAsyncThreadPool")
public void asyncUpdateShoppingCartAmount(DataImport dataImport) {
SpringUtils.getBean(DataImportService.class).importNow(dataImport);
}
}

View File

@ -1,13 +1,19 @@
package com.cpop.oam.framework.tasks;
import com.cpop.core.utils.SpringUtils;
import com.cpop.oam.business.entity.DataImport;
import com.cpop.oam.business.entity.table.DataImportTableDef;
import com.cpop.oam.business.service.DataImportService;
import com.cpop.oam.business.service.DutyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import java.util.List;
/**
* @author DB
* @createTime 2023/11/22 18:07
@ -31,4 +37,24 @@ public class OamScheduledTasks {
public void dutyNotice() {
dutyService.dutyNotice();
}
/**
* 凌晨20分同步导入的数据
* @author DB
* @since 2023/12/10
*/
@Scheduled(cron = "0 20 0 * * *")
public void syncImportData() throws InterruptedException {
log.info("==============开始同步校区数据===========");
long start = System.currentTimeMillis();
DataImportService dataImportService = SpringUtils.getBean(DataImportService.class);
List<DataImport> dataList = dataImportService.queryChain()
.where(DataImportTableDef.DATA_IMPORT.IMPORT_STATUS.eq(false)).list();
for (DataImport item : dataList) {
SpringUtils.getBean(DataImportAsyncTask.class).asyncUpdateShoppingCartAmount(item);
Thread.sleep(600000);
}
long end = System.currentTimeMillis();
log.info("同步校区数据执行时间:{}ms", end - start);
}
}

View File

@ -1,10 +1,12 @@
package com.cpop.oam.framework.tasks;
import com.cpop.common.utils.http.HttpHelper;
import com.cpop.core.utils.SpringUtils;
import com.cpop.oam.business.entity.Task;
import com.cpop.oam.business.entity.TaskWorkOrder;
import com.cpop.oam.business.service.TaskStaffGroupService;
import com.cpop.oam.business.service.TaskWorkOrderService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
@ -14,18 +16,18 @@ import static com.cpop.oam.business.entity.table.TaskStaffGroupTableDef.TASK_STA
import static com.cpop.oam.business.entity.table.TaskTableDef.TASK;
import com.cpop.oam.business.service.TaskService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 工单接收超时定时任务
*
* @author DB
* @since 2023-11-29 10:13:22
* @version 1.0.0
*/
public class WorkOrderAcceptOverTimeTask implements Job {
private static final Logger LOGGER = LoggerFactory.getLogger(HttpHelper.class);
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
public void execute(JobExecutionContext jobExecutionContext) {
// 获取工单id
JobDataMap jobDataMap = jobExecutionContext.getJobDetail().getJobDataMap();
String workOrderId = jobDataMap.getString("WorkOrderId");
@ -35,18 +37,18 @@ public class WorkOrderAcceptOverTimeTask implements Job {
TaskService taskService = SpringUtils.getBean(TaskService.class);
Task task = taskService.getById(workOrder.getTaskId());
if (task != null) {
// 工单超时为接收扣除5绩点
TaskStaffGroupService taskStaffGroupService = SpringUtils.getBean(TaskStaffGroupService.class);
taskStaffGroupService.updateChain()
.set(TASK_STAFF_GROUP.GRADE_POINT, -5)
.set(TASK_STAFF_GROUP.REMARK, "工单接收超时扣除5绩点 ")
.where(TASK_STAFF_GROUP.TASK_ID.eq(task.getId())
.and(TASK_STAFF_GROUP.STAFF_ID.eq(task.getResponsibleStaffId())));
// 更新任务为接收超时
taskService.updateChain()
.set(TASK.TASK_STATUS, 7)
.where(TASK.ID.eq(task.getId()))
.update();
// 工单超时为接收扣除5绩点
SpringUtils.getBean(TaskStaffGroupService.class).updateChain()
.set(TASK_STAFF_GROUP.GRADE_POINT, -5)
.set(TASK_STAFF_GROUP.REMARK, "工单接收超时扣除5绩点 ")
.where(TASK_STAFF_GROUP.TASK_ID.eq(task.getId()))
.and(TASK_STAFF_GROUP.STAFF_ID.eq(task.getResponsibleStaffId()))
.update();
}
}
}

View File

@ -1,6 +1,7 @@
package com.cpop.oam.framework.tasks;
import com.cpop.core.utils.SpringUtils;
import com.cpop.oam.business.entity.Task;
import com.cpop.oam.business.entity.TaskWorkOrder;
import com.cpop.oam.business.service.TaskService;
import com.cpop.oam.business.service.TaskWorkOrderService;
@ -31,16 +32,13 @@ public class WorkOrderOvertimeTask implements Job {
// 修改任务逾期
TaskService taskService = SpringUtils.getBean(TaskService.class);
taskService.updateChain().set(TASK.TASK_STATUS, 4).where(TASK.ID.eq(taskWorkOrder.getTaskId())).update();
Task task = taskService.getById(taskWorkOrder.getTaskId());
// 扣除5点绩点
TaskStaffGroupService taskStaffGroupService = SpringUtils.getBean(TaskStaffGroupService.class);
taskStaffGroupService.updateChain()
SpringUtils.getBean(TaskStaffGroupService.class).updateChain()
.setRaw(TASK_STAFF_GROUP.GRADE_POINT, "grade_point - 5")
.set(TASK_STAFF_GROUP.REMARK, "remark + '工单完结超时扣除5绩点'")
.where(TASK_STAFF_GROUP.TASK_ID.eq(workOrderId));
// 更新任务为逾期
taskService.updateChain()
.set(TASK.TASK_STATUS, 4)
.where(TASK.ID.eq(taskWorkOrder.getTaskId()))
.setRaw(TASK_STAFF_GROUP.REMARK, "concat(remark,'工单完结超时扣除5绩点')")
.where(TASK_STAFF_GROUP.TASK_ID.eq(task.getId()))
.and(TASK_STAFF_GROUP.STAFF_ID.eq(task.getResponsibleStaffId()))
.update();
}
}

View File

@ -0,0 +1,7 @@
<?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.cpop.oam.business.mapper.BrandManagerMapper">
</mapper>

View File

@ -0,0 +1,7 @@
<?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.cpop.oam.business.mapper.BrandManagerStoreMapper">
</mapper>

View File

@ -0,0 +1,7 @@
<?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.cpop.oam.business.mapper.DataImportMapper">
</mapper>

View File

@ -0,0 +1,7 @@
<?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.cpop.oam.business.mapper.TechnologyToolMapper">
</mapper>

View File

@ -0,0 +1,25 @@
package com.cpop.system.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
/**
* @author DB
* @version 1.0.0
* @since 2023-12-07 17:51
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "StoreListByBrandBo对象")
public class StoreListByBrandBo {
/**
* 品牌id集合
*/
@ApiModelProperty("品牌id集合")
private List<String> brandIds;
}

View File

@ -44,7 +44,6 @@ public class BrandController {
* @param bo 品牌参数
* @return: com.cpop.core.base.R<java.lang.Void>
*/
@PreAuthorize("@aps.hasPermission('brandStore:brand:insert')")
@PostMapping("/insertSysBrand")
@ApiOperation("新增系统品牌")
public R<Void> insertSysBrand(@RequestBody @ApiParam("系统-品牌") @Validated BrandBo bo) {
@ -61,7 +60,6 @@ public class BrandController {
* @param bo 品牌参数
* @return: com.cpop.core.base.R<java.lang.Void>
*/
@PreAuthorize("@aps.hasPermission('brandStore:brand:update')")
@ApiOperation("修改系统品牌")
@PutMapping("/updateSysBrand")
public R<Void> updateSysBrand(@RequestBody @ApiParam("系统-品牌") @Validated BrandBo bo) {
@ -77,7 +75,6 @@ public class BrandController {
* @param brandId 果酱品牌信息
* @return: boolean
*/
@PreAuthorize("@aps.hasPermission('brandStore:brand:insert')")
@PostMapping("/importJamboxBrand/{brandId}")
@ApiOperation("导入果酱品牌")
public R<Void> importJamboxBrand(@PathVariable String brandId) {
@ -107,7 +104,6 @@ public class BrandController {
* @param id 主键
* @return: com.cpop.core.base.R<java.lang.Void>
*/
@PreAuthorize("@aps.hasPermission('brandStore:brand:remove')")
@ApiOperation("根据品牌id删除品牌")
@DeleteMapping("/removeBrandById/{id}")
public R<Void> removeBrandById(@PathVariable String id) {

View File

@ -55,6 +55,7 @@ public class DictTypeController {
* @author DB
* @since 2023/12/01
*/
@PreAuthorize("@aps.hasPermission('system:dict:list')")
@GetMapping("/getDictTypePage")
@ApiOperation("获取系统字典类型分页")
public R<Page<DictTypePageVo>> getDictTypePage(@ApiParam(value = "字典名") String dictName) {

View File

@ -40,6 +40,36 @@ public class Store extends BaseEntity implements Serializable {
*/
private String storeName;
/**
* 店铺/校区地址
*/
private String storeAddr;
/**
* 负责人
*/
private String personCharge;
/**
* 手机号
*/
private String phone;
/**
* 到期日期
*/
private String expireDate;
/**
* 是否有顾问
*/
private String haveCounselor;
/**
* 是否激活
*/
private String haveActive;
/**
* 品牌id
*/

View File

@ -41,8 +41,11 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
public Page<StorePageVo> getStorePage(StorePageBo bo) {
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
return this.getMapper().paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()),
QueryWrapper.create().select(STORE.ALL_COLUMNS).select(BRAND.BRAND_NAME).from(STORE).leftJoin(BRAND)
.on(BRAND.ID.eq(STORE.BRAND_ID)),
QueryWrapper.create().select(STORE.ALL_COLUMNS)
.select(BRAND.BRAND_NAME).from(STORE)
.select("cp_j_store_extend.store_cloud_id as storeCloudId")
.leftJoin(BRAND).on(BRAND.ID.eq(STORE.BRAND_ID))
.leftJoin("cp_j_store_extend").on("`cp_j_store_extend`.`store_id` = `cp_sys_store`.`id`"),
StorePageVo.class);
}
}

View File

@ -1,4 +1,4 @@
package com.cpop.oam.business.vo;
package com.cpop.system.business.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -0,0 +1,35 @@
package com.cpop.system.business.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* @author DB
* @version 1.0.0
* @since 2023-12-07 17:50
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "StoreList对象", description = "校区表")
public class StoreListByBrandVo {
/**
* 主键
*/
@ApiModelProperty("主键")
private String id;
/**
* 品牌id
*/
@ApiModelProperty("品牌id")
private String brandId;
/**
* 校区名
*/
@ApiModelProperty("校区名")
private String name;
}

View File

@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import com.cpop.core.base.enums.SourceType;
@ -32,7 +33,7 @@ public class StorePageVo implements Serializable {
* 云校区id
*/
@ApiModelProperty("云校区id")
private String campusCloudId;
private String storeCloudId;
/**
* 品牌id
@ -65,4 +66,41 @@ public class StorePageVo implements Serializable {
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
/**
* 店铺/校区地址
*/
@ApiModelProperty("店铺/校区地址")
private String storeAddr;
/**
* 负责人
*/
@ApiModelProperty("负责人")
private String personCharge;
/**
* 手机号
*/
@ApiModelProperty("手机号")
private String phone;
/**
* 到期日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("到期日期")
private LocalDate expireDate;
/**
* 是否有顾问
*/
@ApiModelProperty("是否有顾问")
private Boolean haveCounselor;
/**
* 是否激活
*/
@ApiModelProperty("是否激活")
private Boolean haveActive;
}

View File

@ -200,6 +200,10 @@
<artifactId>bcprov-jdk15on</artifactId>
<version>${bcprov-jdk15on.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
</dependencies>
</dependencyManagement>