市场模块;修复密码未正常校验问题
This commit is contained in:
parent
d3aca91b40
commit
ea4513f266
@ -0,0 +1,14 @@
|
||||
package com.cpop.api.ecpp.anno;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* @author 蜘蛛酱
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.FIELD})
|
||||
public @interface EcppUnSignField {
|
||||
}
|
||||
@ -1,6 +1,5 @@
|
||||
package com.cpop.api.tencent.wxWork.core.config;
|
||||
package com.cpop.api.ecpp.config;
|
||||
|
||||
import com.cpop.api.tencent.wxWork.core.config.ecpp.EcppProperties;
|
||||
import lombok.Getter;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
@ -16,5 +15,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
|
||||
@EnableConfigurationProperties(EcppProperties.class)
|
||||
public class EcppApiConfig {
|
||||
|
||||
|
||||
EcppProperties properties;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.cpop.api.tencent.wxWork.core.config.ecpp;
|
||||
package com.cpop.api.ecpp.config;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@ -18,16 +18,21 @@ public class EcppProperties {
|
||||
/**应用/平台标识 */
|
||||
private String appId;
|
||||
|
||||
/**公钥 */
|
||||
private String appType;
|
||||
|
||||
/**签名身份类型(1、平台;2、商户; 3、用户) */
|
||||
private String signatureIdType;
|
||||
|
||||
/**签名身份标识 */
|
||||
private String signatureId;
|
||||
|
||||
/**应用类型 */
|
||||
private String appType;
|
||||
|
||||
/**公钥 */
|
||||
private String publicKey;
|
||||
private String publicKey;
|
||||
|
||||
/**
|
||||
* 私钥
|
||||
*/
|
||||
private String privateKey;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cpop.api.ecpp.core;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2023-12-12 11:39
|
||||
*/
|
||||
public interface EcppApiConstant {
|
||||
|
||||
/**
|
||||
* 安全会话密钥接口
|
||||
*/
|
||||
String CONSULT_SESSION_KEY = "/prepay/security/consultSessionKey";
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.cpop.api.ecpp.core;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Ecpp核心请求类
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2023-12-12 9:18
|
||||
*/
|
||||
@Data
|
||||
public class EcppBaseRequest {
|
||||
|
||||
/**
|
||||
* 00、通用;01、设备
|
||||
*/
|
||||
private String jSessionType;;
|
||||
|
||||
/**
|
||||
* 会话类型为设备时,送设备标识
|
||||
*/
|
||||
private String jSessionId;
|
||||
|
||||
/**
|
||||
* 1、DES;2、AES;3、SM4
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 由业务报文JSON加密而成。
|
||||
*/
|
||||
private String content;
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.cpop.api.ecpp.core;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Ecpp核心响应类
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2023-12-12 9:23
|
||||
*/
|
||||
@Data
|
||||
public class EcppBaseResponse {
|
||||
|
||||
/**
|
||||
* 响应消息
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 响应数据
|
||||
*/
|
||||
private String data;
|
||||
|
||||
/**
|
||||
* 00、通用;01、设备
|
||||
*/
|
||||
private String jSessionType;;
|
||||
|
||||
/**
|
||||
* 会话类型为设备时,送设备标识
|
||||
*/
|
||||
private String jSessionId;
|
||||
|
||||
/**
|
||||
* 加密类型
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 响应密文
|
||||
*/
|
||||
private String content;
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
package com.cpop.api.ecpp.core;
|
||||
|
||||
/**
|
||||
* 数币加密数据
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2023-12-12 9:48
|
||||
*/
|
||||
public class EcppVerifyJson {
|
||||
}
|
||||
@ -0,0 +1,98 @@
|
||||
package com.cpop.api.ecpp.handler;
|
||||
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.crypto.asymmetric.Sign;
|
||||
import cn.hutool.crypto.asymmetric.SignAlgorithm;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.cpop.api.ecpp.config.EcppApiConfig;
|
||||
import com.cpop.api.ecpp.core.EcppBaseRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.*;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* 数币请求工具类
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2023-12-12 9:27
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class EcppHandler {
|
||||
|
||||
@Autowired
|
||||
private EcppApiConfig ecppApiConfig;
|
||||
|
||||
/**
|
||||
* 发送Post请求
|
||||
* @author DB
|
||||
* @since 2023/12/12
|
||||
* @param url 请求路径
|
||||
* @param baseRequest Ecpp核心请求
|
||||
* @return Response
|
||||
*/
|
||||
private Response sendPost(String url, EcppBaseRequest baseRequest) throws IOException {
|
||||
OkHttpClient client = new OkHttpClient().newBuilder().build();
|
||||
MediaType mediaType = MediaType.Companion.parse("application/json;charset=utf-8");
|
||||
RequestBody body = RequestBody.Companion.create(JSONObject.toJSONString(baseRequest), mediaType);
|
||||
Request request = new Request
|
||||
.Builder()
|
||||
.url(url)
|
||||
.post(body)
|
||||
.addHeader("Content-Type", "application/json")
|
||||
//请求头校验
|
||||
.addHeader("ecpp-heade", getEcppHeader(baseRequest))
|
||||
.build();
|
||||
return client.newCall(request).execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取签名
|
||||
* @author DB
|
||||
* @since 2023/12/12
|
||||
* @return String
|
||||
*/
|
||||
private <T extends EcppBaseRequest> String getEcppHeader(T request) {
|
||||
HashMap<String, String> ecppHeader = new HashMap<>(5);
|
||||
ecppHeader.put("appId", ecppApiConfig.getProperties().getAppId());
|
||||
ecppHeader.put("signatureIdType", ecppApiConfig.getProperties().getSignatureIdType());
|
||||
ecppHeader.put("signatureId", ecppApiConfig.getProperties().getSignatureId());
|
||||
ecppHeader.put("timestamp", String.valueOf(System.currentTimeMillis()));
|
||||
//TODO: 设置签名
|
||||
ecppHeader.put("signature", null);
|
||||
return JSON.toJSONString(ecppHeader);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* sha256私钥加密
|
||||
* @author DB
|
||||
* @since 2023/12/12
|
||||
* @param strSrc 加密内容
|
||||
* @param privateKey 私钥
|
||||
* @return String
|
||||
*/
|
||||
public String genSha256HexSign(String strSrc, String privateKey) {
|
||||
Sign sign = new Sign(SignAlgorithm.SHA256withRSA, privateKey, null);
|
||||
return HexUtil.encodeHexStr(sign.sign(strSrc.getBytes(StandardCharsets.UTF_8)));
|
||||
}
|
||||
|
||||
/**
|
||||
* sha256验证签名
|
||||
* @param strSrc 加密内容
|
||||
* @param signature 签名
|
||||
* @param publicKey 公钥
|
||||
*/
|
||||
public Boolean verifySha256HexSign(String strSrc, String signature, String publicKey) {
|
||||
Sign sign = new Sign(SignAlgorithm.SHA256withRSA, null, publicKey);
|
||||
return sign.verify(strSrc.getBytes(StandardCharsets.UTF_8), HexUtil.decodeHex(signature));
|
||||
}
|
||||
}
|
||||
@ -107,6 +107,15 @@
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15on</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/cn.hutool/hutool-all -->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@ -2,11 +2,13 @@ package com.cpop.core.gateway.sys;
|
||||
|
||||
import com.cpop.core.base.entity.LoginUser;
|
||||
import com.cpop.core.base.enums.UserType;
|
||||
import com.cpop.core.base.exception.CpopAuthenticationException;
|
||||
import com.cpop.core.gateway.miniProgram.MiniProgramAuthenticationToken;
|
||||
import com.cpop.core.service.CoreService;
|
||||
import com.cpop.core.utils.PasswordEncoder;
|
||||
import com.cpop.core.utils.SpringUtils;
|
||||
import org.springframework.security.authentication.AuthenticationProvider;
|
||||
import org.springframework.security.authentication.BadCredentialsException;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
@ -30,7 +32,10 @@ public class SysAuthenticationProvider implements AuthenticationProvider {
|
||||
//认证用户名密码
|
||||
LoginUser loginUser = SpringUtils.getBean(CoreService.class).loadUserByUsername(principal, userType);
|
||||
//账号密码校验
|
||||
SpringUtils.getBean(PasswordEncoder.class).matches((String) credentials.get("password"), loginUser.getUser().getPassword());
|
||||
boolean password = SpringUtils.getBean(PasswordEncoder.class).matches((String) credentials.get("password"), loginUser.getUser().getPassword());
|
||||
if (!password){
|
||||
throw new BadCredentialsException("用户名密码错误!");
|
||||
}
|
||||
SysAuthenticationToken result = new SysAuthenticationToken(principal, loginUser);
|
||||
result.setDetails(loginUser);
|
||||
return result;
|
||||
|
||||
@ -29,7 +29,7 @@ public class PasswordEncoder extends BCryptPasswordEncoder {
|
||||
} catch (Exception e) {
|
||||
throw new BadCredentialsException(e.getMessage());
|
||||
}
|
||||
if (encodedPassword != null && encodedPassword.length() != 0) {
|
||||
if (encodedPassword != null && !encodedPassword.isEmpty()) {
|
||||
return BCrypt.checkpw(pwd, encodedPassword);
|
||||
} else {
|
||||
return false;
|
||||
|
||||
@ -5,8 +5,6 @@ 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;
|
||||
import com.cpop.core.utils.uuid.IdUtils;
|
||||
@ -15,21 +13,16 @@ 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;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.cpop.oam.web;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.cpop.common.utils.StringUtils;
|
||||
@ -16,8 +17,10 @@ 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.entity.StoreLicense;
|
||||
import com.cpop.system.business.mapper.StoreMapper;
|
||||
import com.cpop.system.business.service.BrandService;
|
||||
import com.cpop.system.business.service.StoreLicenseService;
|
||||
import com.cpop.system.business.service.StoreService;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.core.datasource.DataSourceKey;
|
||||
@ -38,6 +41,7 @@ import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cpop.jambox.business.entity.table.BrandExtendTableDef.BRAND_EXTEND;
|
||||
import static com.cpop.jambox.business.entity.table.StoreExtendTableDef.STORE_EXTEND;
|
||||
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
|
||||
import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
|
||||
|
||||
@ -92,14 +96,14 @@ public class CpopImportTests {
|
||||
*/
|
||||
@Test
|
||||
public void importStoreJson() throws IOException {
|
||||
String brandFileUrl = "C:\\Users\\Administrator\\Desktop\\store.json";
|
||||
String storeFileUrl = "C:\\Users\\Administrator\\Desktop\\store.json";
|
||||
List<String> filterList = new ArrayList<>();
|
||||
filterList.add("b00064a760d0c4f121b0835d09b909ca");
|
||||
filterList.add("ac1268b164d1d20700080aae1703ecf8");
|
||||
filterList.add("0122a5876468513f0d42569d389e8264");
|
||||
List<JsonStore> jsonBrands = JSONArray.parseArray(readJson(brandFileUrl), JsonStore.class);
|
||||
List<JsonStore> jsonStores = JSONArray.parseArray(readJson(storeFileUrl), JsonStore.class);
|
||||
//过滤已存在的品牌
|
||||
List<JsonStore> filterStore = jsonBrands.stream()
|
||||
List<JsonStore> filterStore = jsonStores.stream()
|
||||
.filter(item -> !filterList.contains(item.getBrandCloudId()) &&
|
||||
//品牌不为null和空
|
||||
null != item.getBrandCloudId() && StringUtils.isNotBlank(item.getBrandCloudId())).collect(Collectors.toList());
|
||||
@ -220,6 +224,61 @@ public class CpopImportTests {
|
||||
SpringUtils.getBean(BrandManagerStoreService.class).saveBatch(brandManagerStores);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改校区是否是测试校区
|
||||
* @author DB
|
||||
* @since 2023/12/12
|
||||
*/
|
||||
@Test
|
||||
public void batchUpdateStoreIsTest() {
|
||||
List<String> storeCloudIds;
|
||||
try {
|
||||
DataSourceKey.use("jambox");
|
||||
List<Row> rowList = DbChain.table("t_mechanism_info").select("store_id").where("test = 1").list();
|
||||
storeCloudIds = RowUtil.toEntityList(rowList, String.class);
|
||||
//批量修改
|
||||
} finally {
|
||||
DataSourceKey.clear();
|
||||
}
|
||||
if (storeCloudIds != null) {
|
||||
Set<String> storeSet = SpringUtils.getBean(StoreExtendService.class).queryChain().where(STORE_EXTEND.STORE_CLOUD_ID.in(storeCloudIds)).list()
|
||||
.stream().map(StoreExtend::getId).collect(Collectors.toSet());
|
||||
SpringUtils.getBean(StoreService.class).updateChain().set(STORE.IS_TEST,true).where(STORE.ID.in(storeSet)).update();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入校区营业执照
|
||||
* @author DB
|
||||
* @since 2023/12/12
|
||||
*/
|
||||
@Test
|
||||
public void batchImportStoreLicense() {
|
||||
List<Row> rowList;
|
||||
try {
|
||||
DataSourceKey.use("jambox");
|
||||
rowList = DbChain.table("t_mechanism_info").select("store_id as storeCloudId", "reg_addr as licenseAddr", "str_to_date(reg_date,'%Y年%m月%d') as licenseDate", "reg_Name as licenseName",
|
||||
"ness_license_id as licenseCode", "corp_name as licenseUserName", "reg_pic as licensePicUrl")
|
||||
.where("reg_addr is not null")
|
||||
.list();
|
||||
|
||||
|
||||
} finally {
|
||||
DataSourceKey.clear();
|
||||
}
|
||||
//获取校区信息
|
||||
Map<String, String> storeMap = SpringUtils.getBean(StoreExtendService.class).queryChain()
|
||||
.where(STORE_EXTEND.STORE_CLOUD_ID.in(rowList.stream().map(item -> item.getString("storeCloudId")).collect(Collectors.toSet())))
|
||||
.list()
|
||||
.stream().collect(Collectors.toMap(StoreExtend::getStoreCloudId, StoreExtend::getStoreId));
|
||||
rowList.forEach(item -> {
|
||||
item.set("storeId", storeMap.get(item.getString("storeCloudId")));
|
||||
System.out.println(item.toString());
|
||||
});
|
||||
List<StoreLicense> licenseList = RowUtil.toEntityList(rowList, StoreLicense.class).stream().filter(item->item.getStoreId() != null).collect(Collectors.toList());
|
||||
SpringUtils.getBean(StoreLicenseService.class).saveBatch(licenseList);
|
||||
}
|
||||
|
||||
@Data
|
||||
private class JsonBrandManager implements Serializable {
|
||||
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
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-13 15:47
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "BusinessDisposeBo对象",description = "事务处理请求对象")
|
||||
public class BusinessDisposeBo {
|
||||
|
||||
/**
|
||||
* 详情描述
|
||||
*/
|
||||
@ApiModelProperty(value = "详情描述")
|
||||
private String detailDesc;
|
||||
/**
|
||||
* 详情状态,状态(0:进行中;1:完成:2:挂起)
|
||||
*/
|
||||
@ApiModelProperty(value = "详情状态")
|
||||
private Integer detailStatus;
|
||||
/**
|
||||
* 事务详情id
|
||||
*/
|
||||
@ApiModelProperty(value = "事务详情id")
|
||||
private String id;
|
||||
/**
|
||||
* 校区id
|
||||
*/
|
||||
@ApiModelProperty(value = "校区id")
|
||||
private String storeId;
|
||||
|
||||
/**
|
||||
* 事务id
|
||||
*/
|
||||
@ApiModelProperty(value = "事务id")
|
||||
private String businessId;
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
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;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2023-12-13 10:33
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "BusinessDistributeBo对象",description = "事务分发请求对象")
|
||||
public class BusinessDistributeBo {
|
||||
|
||||
/**
|
||||
* 业务等级
|
||||
*/
|
||||
@NotNull(message = "业务等级不能为空")
|
||||
@ApiModelProperty(value = "业务等级")
|
||||
private Integer businessLevel;
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
@NotNull(message = "业务类型不能为空")
|
||||
@ApiModelProperty(value = "业务类型")
|
||||
private Integer businessType;
|
||||
/**
|
||||
* 对接列表
|
||||
*/
|
||||
@ApiModelProperty(value = "对接列表")
|
||||
private List<ButtJoint> buttJoint;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@NotBlank(message = "描述不能为空")
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String desc;
|
||||
/**
|
||||
* 到期时间
|
||||
*/
|
||||
@NotNull(message = "到期时间不能为空")
|
||||
@ApiModelProperty(value = "到期时间")
|
||||
private LocalDateTime endTime;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 签约列表
|
||||
*/
|
||||
@ApiModelProperty(value = "签约列表")
|
||||
private List<Sign> sign;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@NotNull(message = "开始时间不能为空")
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Data
|
||||
public class ButtJoint {
|
||||
/**
|
||||
* 文档地址
|
||||
*/
|
||||
@ApiModelProperty(value = "文档地址")
|
||||
private String businessDocUrl;
|
||||
/**
|
||||
* 接收员工id
|
||||
*/
|
||||
@ApiModelProperty(value = "接收员工id")
|
||||
private String staffId;
|
||||
}
|
||||
|
||||
@Data
|
||||
public class Sign {
|
||||
/**
|
||||
* 接收员工id
|
||||
*/
|
||||
@ApiModelProperty(value = "接收员工id")
|
||||
private String staffId;
|
||||
/**
|
||||
* 剩余数量
|
||||
*/
|
||||
@ApiModelProperty(value = "剩余数量")
|
||||
private Integer surplusQuantity;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2023-12-13 13:43
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "BusinessInfoPageBo对象",description = "事务详情请求分页对象")
|
||||
public class BusinessInfoPageBo {
|
||||
|
||||
/**
|
||||
* 品牌或校区名模糊查询
|
||||
*/
|
||||
@ApiModelProperty(value = "品牌或校区名模糊查询")
|
||||
private String brandOrStore;
|
||||
|
||||
/**
|
||||
* 校区地址或校区名模糊查询
|
||||
*/
|
||||
@ApiModelProperty(value = "校区地址或校区名模糊查询")
|
||||
private String addrOrName;
|
||||
|
||||
/**
|
||||
* 事务详情状态
|
||||
*/
|
||||
@ApiModelProperty(value = "事务详情状态(0:进行中;1:完成:2:挂起)")
|
||||
private Integer detailStatus;
|
||||
|
||||
/**
|
||||
* 事务id
|
||||
*/
|
||||
@NotBlank(message = "事务id不能为空")
|
||||
@ApiModelProperty(value = "事务id",required = true)
|
||||
private String id;
|
||||
}
|
||||
@ -32,7 +32,6 @@ import java.util.List;
|
||||
@Api(tags = "品牌管理员表接口")
|
||||
@RequestMapping("/brandManage")
|
||||
public class BrandManagerController {
|
||||
|
||||
@Autowired
|
||||
private BrandManagerService brandManageService;
|
||||
|
||||
|
||||
@ -0,0 +1,150 @@
|
||||
package com.cpop.oam.business.controller.backstage;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.cpop.core.base.R;
|
||||
import com.cpop.core.utils.SpringUtils;
|
||||
import com.cpop.oam.business.bo.BusinessDisposeBo;
|
||||
import com.cpop.oam.business.bo.BusinessDistributeBo;
|
||||
import com.cpop.oam.business.bo.BusinessInfoPageBo;
|
||||
import com.cpop.oam.business.dto.BusinessDistributeDto;
|
||||
import com.cpop.oam.business.dto.DataImportDto;
|
||||
import com.cpop.oam.business.entity.Staff;
|
||||
import com.cpop.oam.business.service.StaffService;
|
||||
import com.cpop.oam.business.vo.BusinessInfoPageVo;
|
||||
import com.cpop.oam.business.vo.BusinessPageVo;
|
||||
import com.cpop.oam.business.vo.StaffInfoVo;
|
||||
import com.cpop.oam.business.vo.StaffVo;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.cpop.oam.business.entity.Business;
|
||||
import com.cpop.oam.business.service.BusinessService;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Oam-事务表 控制层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2023-12-12
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "市场模块")
|
||||
@RequestMapping("/business")
|
||||
public class BusinessController {
|
||||
|
||||
@Autowired
|
||||
private BusinessService businessService;
|
||||
|
||||
/**
|
||||
* 获取事务分页列表
|
||||
* @author DB
|
||||
* @since 2023/12/13
|
||||
* @param status 状态(0:进行中;1:已完成)
|
||||
* @return R<Page<BusinessPageVo>>
|
||||
*/
|
||||
@GetMapping("/getBusinessPage")
|
||||
@ApiOperation("获取事务分页列表")
|
||||
public R<Page<BusinessPageVo>> getBusinessPage(@ApiParam("状态(0:进行中;1:已完成)") Integer status) {
|
||||
Page<BusinessPageVo> page = businessService.getBusinessPage(status);
|
||||
return R.ok(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取机构对接xml模板
|
||||
* @author DB
|
||||
* @since 2023/12/13
|
||||
* @return R<Void>
|
||||
*/
|
||||
@GetMapping("/getBusinessTemplate")
|
||||
@ApiOperation("获取机构对接xml模板")
|
||||
public void getBusinessTemplate(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(), BusinessDistributeDto.class).sheet("模板").doWrite(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 事务分发
|
||||
* @author DB
|
||||
* @since 2023/12/13
|
||||
* @param bo 请求数据
|
||||
* @return R<Void>
|
||||
*/
|
||||
@PostMapping("/businessDistribute")
|
||||
@ApiOperation("事务分发")
|
||||
public R<Void> businessDistribute(@RequestBody @ApiParam("请求参数") @Validated BusinessDistributeBo bo) {
|
||||
businessService.businessDistribute(bo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取市场部员工
|
||||
* @author DB
|
||||
* @since 2023/12/13
|
||||
* @return R<List<StaffVo>>
|
||||
*/
|
||||
@GetMapping("/getBusinessStaff")
|
||||
@ApiOperation("获取市场部员工")
|
||||
public R<List<StaffVo>> getBusinessStaff() {
|
||||
List<StaffVo> list = SpringUtils.getBean(StaffService.class).queryChain()
|
||||
.leftJoin(SYS_USER).on(SYS_USER.ID.eq(STAFF.USER_ID))
|
||||
.where(STAFF.STAFF_TYPE.eq(1))
|
||||
.and(SYS_USER.STATUS.eq(1))
|
||||
.listAs(StaffVo.class);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取个人事务分页列表/管理人员事务详情列表
|
||||
* @author DB
|
||||
* @since 2023/12/13
|
||||
* @param bo 请求参数
|
||||
* @return R<Page<BusinessInfoPageVo>>
|
||||
*/
|
||||
@GetMapping("/getBusinessInfoPage")
|
||||
@ApiOperation("获取个人事务分页列表/管理人员事务详情列表")
|
||||
public R<Page<BusinessInfoPageVo>> getBusinessInfoPage(@ApiParam("请求参数") @Validated BusinessInfoPageBo bo) {
|
||||
Page<BusinessInfoPageVo> page = businessService.getBusinessInfoPage(bo);
|
||||
return R.ok(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 员工事务处理
|
||||
* @author DB
|
||||
* @since 2023/12/13
|
||||
* @param bo 请求
|
||||
* @return R<Void>
|
||||
*/
|
||||
@PutMapping("/businessDispose")
|
||||
@ApiOperation("员工事务处理")
|
||||
public R<Void> businessDistribute(@RequestBody @ApiParam("请求参数") @Validated BusinessDisposeBo bo) {
|
||||
businessService.businessDispose(bo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@ -159,7 +159,7 @@ public class DataImportController {
|
||||
*/
|
||||
@ApiOperation("模板下载")
|
||||
@GetMapping("/download")
|
||||
public R<Void> download(HttpServletResponse response) throws IOException {
|
||||
public void download(HttpServletResponse response) throws IOException {
|
||||
// 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
@ -167,7 +167,6 @@ public class DataImportController {
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
package com.cpop.oam.business.dto;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2023-12-13 10:55
|
||||
*/
|
||||
@Data
|
||||
public class BusinessDistributeDto {
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
@ExcelProperty("品牌")
|
||||
private String brandName;
|
||||
|
||||
/**
|
||||
* 校区id
|
||||
*/
|
||||
@ExcelProperty("校区id")
|
||||
private String storeId;
|
||||
|
||||
/**
|
||||
* 校区名
|
||||
*/
|
||||
@ExcelProperty("校区名")
|
||||
private String storeName;
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
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-12
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@Table(value = "cp_oam_business", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
|
||||
public class Business extends BaseEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 业务等级(0:轻;1:重;2:缓;3:急)
|
||||
*/
|
||||
private Integer businessLevel;
|
||||
|
||||
/**
|
||||
* 业务类型(0:机构对接;1:机构签约)
|
||||
*/
|
||||
private Integer businessType;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String desc;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 分发人id
|
||||
*/
|
||||
private String initiatorId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态(0:进行中;1:已完成)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 总剩余数量
|
||||
*/
|
||||
private Integer allSurplusQuantity;
|
||||
|
||||
/**
|
||||
* 逻辑删除(0否1是)
|
||||
*/
|
||||
@Column(isLogicDelete = true)
|
||||
private Boolean isDelete;
|
||||
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
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-12
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@Table(value = "cp_oam_business_detail", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
|
||||
public class BusinessDetail extends BaseEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 事务id
|
||||
*/
|
||||
@Id
|
||||
private String businessId;
|
||||
|
||||
/**
|
||||
* 品牌id
|
||||
*/
|
||||
private String brandId;
|
||||
|
||||
/**
|
||||
* 校区id
|
||||
*/
|
||||
private String storeId;
|
||||
|
||||
/**
|
||||
* 状态(0:进行中;1:完成:2:挂起)
|
||||
*/
|
||||
private Integer detailStatus;
|
||||
|
||||
/**
|
||||
* 详情描述
|
||||
*/
|
||||
private String detailDesc;
|
||||
|
||||
/**
|
||||
* 处理时间
|
||||
*/
|
||||
private LocalDateTime detailRecordTime;
|
||||
|
||||
|
||||
/**
|
||||
* 逻辑删除(0否1是)
|
||||
*/
|
||||
@Column(isLogicDelete = true)
|
||||
private Boolean isDelete;
|
||||
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
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-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@Table(value = "cp_oam_business_staff", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
|
||||
public class BusinessStaff extends BaseEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* 事务id
|
||||
*/
|
||||
@Id
|
||||
private String businessId;
|
||||
|
||||
/**
|
||||
* 员工id
|
||||
*/
|
||||
@Id
|
||||
private String staffId;
|
||||
|
||||
/**
|
||||
* 剩余数量
|
||||
*/
|
||||
private Integer surplusQuantity;
|
||||
|
||||
/**
|
||||
* 事务文档地址
|
||||
*/
|
||||
private String businessDocUrl;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cpop.oam.business.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.cpop.oam.business.entity.BusinessDetail;
|
||||
|
||||
/**
|
||||
* 业务详情表 映射层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2023-12-12
|
||||
*/
|
||||
public interface BusinessDetailMapper extends BaseMapper<BusinessDetail> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cpop.oam.business.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.cpop.oam.business.entity.Business;
|
||||
|
||||
/**
|
||||
* Oam-事务表 映射层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2023-12-12
|
||||
*/
|
||||
public interface BusinessMapper extends BaseMapper<Business> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cpop.oam.business.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.cpop.oam.business.entity.BusinessStaff;
|
||||
|
||||
/**
|
||||
* 事务-负责员工表 映射层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2023-12-13
|
||||
*/
|
||||
public interface BusinessStaffMapper extends BaseMapper<BusinessStaff> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cpop.oam.business.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.cpop.oam.business.entity.BusinessDetail;
|
||||
|
||||
/**
|
||||
* 业务详情表 服务层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2023-12-12
|
||||
*/
|
||||
public interface BusinessDetailService extends IService<BusinessDetail> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.cpop.oam.business.service;
|
||||
|
||||
import com.cpop.oam.business.bo.BusinessDisposeBo;
|
||||
import com.cpop.oam.business.bo.BusinessDistributeBo;
|
||||
import com.cpop.oam.business.bo.BusinessInfoPageBo;
|
||||
import com.cpop.oam.business.vo.BusinessInfoPageVo;
|
||||
import com.cpop.oam.business.vo.BusinessPageVo;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.cpop.oam.business.entity.Business;
|
||||
|
||||
/**
|
||||
* Oam-事务表 服务层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2023-12-12
|
||||
*/
|
||||
public interface BusinessService extends IService<Business> {
|
||||
|
||||
/**
|
||||
* 获取事务分页列表
|
||||
* @author DB
|
||||
* @since 2023/12/13
|
||||
* @param status 状态(0:进行中;1:已完成)
|
||||
* @return Page<BusinessPageVo>
|
||||
*/
|
||||
Page<BusinessPageVo> getBusinessPage(Integer status);
|
||||
|
||||
/**
|
||||
* 事务分发
|
||||
* @author DB
|
||||
* @since 2023/12/13
|
||||
* @param bo 请求数据
|
||||
*/
|
||||
void businessDistribute(BusinessDistributeBo bo);
|
||||
|
||||
/**
|
||||
* 获取个人事务分页列表/管理人员事务详情列表
|
||||
* @author DB
|
||||
* @since 2023/12/13
|
||||
* @param bo 请求参数
|
||||
* @return Page<BusinessInfoPageVo>
|
||||
*/
|
||||
Page<BusinessInfoPageVo> getBusinessInfoPage(BusinessInfoPageBo bo);
|
||||
|
||||
/**
|
||||
* 员工事务处理
|
||||
* @author DB
|
||||
* @since 2023/12/13
|
||||
* @param bo 请求
|
||||
*/
|
||||
void businessDispose(BusinessDisposeBo bo);
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cpop.oam.business.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.cpop.oam.business.entity.BusinessStaff;
|
||||
|
||||
/**
|
||||
* 事务-负责员工表 服务层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2023-12-13
|
||||
*/
|
||||
public interface BusinessStaffService extends IService<BusinessStaff> {
|
||||
|
||||
}
|
||||
@ -121,4 +121,5 @@ public interface TaskService extends IService<Task> {
|
||||
* @return TaskIndividualGpaVo
|
||||
*/
|
||||
TaskIndividualGpaVo getIndividualGpa();
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
package com.cpop.oam.business.service.impl;
|
||||
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.cpop.oam.business.entity.BusinessDetail;
|
||||
import com.cpop.oam.business.mapper.BusinessDetailMapper;
|
||||
import com.cpop.oam.business.service.BusinessDetailService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 业务详情表 服务层实现。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2023-12-12
|
||||
*/
|
||||
@Service("businessDetailService")
|
||||
public class BusinessDetailServiceImpl extends ServiceImpl<BusinessDetailMapper, BusinessDetail> implements BusinessDetailService {
|
||||
|
||||
}
|
||||
@ -0,0 +1,345 @@
|
||||
package com.cpop.oam.business.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ByteUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.read.listener.ReadListener;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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.exception.ServiceException;
|
||||
import com.cpop.core.utils.SecurityUtils;
|
||||
import com.cpop.core.utils.SpringUtils;
|
||||
import com.cpop.core.utils.sql.SqlUtils;
|
||||
import com.cpop.oam.business.bo.BusinessDisposeBo;
|
||||
import com.cpop.oam.business.bo.BusinessDistributeBo;
|
||||
import com.cpop.oam.business.bo.BusinessInfoPageBo;
|
||||
import com.cpop.oam.business.dto.BusinessDistributeDto;
|
||||
import com.cpop.oam.business.entity.BusinessDetail;
|
||||
import com.cpop.oam.business.entity.BusinessStaff;
|
||||
import com.cpop.oam.business.service.BusinessDetailService;
|
||||
import com.cpop.oam.business.service.BusinessStaffService;
|
||||
import com.cpop.oam.business.vo.BusinessInfoPageVo;
|
||||
import com.cpop.oam.business.vo.BusinessPageVo;
|
||||
import com.cpop.system.business.entity.Store;
|
||||
import com.cpop.system.business.service.StoreService;
|
||||
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.Business;
|
||||
import com.cpop.oam.business.mapper.BusinessMapper;
|
||||
import com.cpop.oam.business.service.BusinessService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cpop.oam.business.entity.table.BusinessDetailTableDef.BUSINESS_DETAIL;
|
||||
import static com.cpop.oam.business.entity.table.BusinessStaffTableDef.BUSINESS_STAFF;
|
||||
import static com.cpop.oam.business.entity.table.BusinessTableDef.BUSINESS;
|
||||
import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF;
|
||||
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
|
||||
import static com.cpop.system.business.entity.table.StoreLicenseTableDef.STORE_LICENSE;
|
||||
import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
|
||||
import static com.mybatisflex.core.query.QueryMethods.select;
|
||||
|
||||
/**
|
||||
* Oam-事务表 服务层实现。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2023-12-12
|
||||
*/
|
||||
@Service("businessService")
|
||||
public class BusinessServiceImpl extends ServiceImpl<BusinessMapper, Business> implements BusinessService {
|
||||
|
||||
/**
|
||||
* 获取事务分页列表
|
||||
* @author DB
|
||||
* @since 2023/12/13
|
||||
* @param status 状态(0:进行中;1:已完成)
|
||||
* @return Page<BusinessPageVo>
|
||||
*/
|
||||
@Override
|
||||
public Page<BusinessPageVo> getBusinessPage(Integer status) {
|
||||
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
|
||||
return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()),
|
||||
QueryWrapper.create()
|
||||
.select(BUSINESS.ID, BUSINESS.BUSINESS_LEVEL, BUSINESS.BUSINESS_TYPE, BUSINESS.DESC, BUSINESS.START_TIME, BUSINESS.END_TIME, BUSINESS.ALL_SURPLUS_QUANTITY, BUSINESS.REMARK, BUSINESS.STATUS)
|
||||
//员工表
|
||||
.select(STAFF.NAME.as(BusinessPageVo::getInitiatorName))
|
||||
.leftJoin(STAFF).on(STAFF.ID.eq(BUSINESS.INITIATOR_ID))
|
||||
.where(BUSINESS.STATUS.eq(status)),
|
||||
BusinessPageVo.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 事务分发
|
||||
* @author DB
|
||||
* @since 2023/12/13
|
||||
* @param bo 请求数据
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void businessDistribute(BusinessDistributeBo bo) {
|
||||
Business business = BeanUtils.mapToClass(bo, Business.class);
|
||||
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
|
||||
business.setInitiatorId(loginUserInfo.getString("id"));
|
||||
this.save(business);
|
||||
Integer allSurplusQuantity;
|
||||
//机构对接
|
||||
if (business.getBusinessType() == 0){
|
||||
allSurplusQuantity = createButtJoint(bo, business.getId());
|
||||
} else {
|
||||
allSurplusQuantity = createSign(bo,business.getId());
|
||||
}
|
||||
business.setAllSurplusQuantity(allSurplusQuantity);
|
||||
this.updateById(business);
|
||||
//TODO:定时检查事务过期?
|
||||
}
|
||||
|
||||
/**
|
||||
* 事务签约
|
||||
* @author DB
|
||||
* @since 2023/12/13
|
||||
* @param bo 请求
|
||||
* @param businessId 事务id
|
||||
* @return Integer
|
||||
*/
|
||||
private Integer createSign(BusinessDistributeBo bo, String businessId) {
|
||||
//事务详情数量标记
|
||||
AtomicReference<Integer> flag = new AtomicReference<>(0);
|
||||
if (bo.getSign().isEmpty()){
|
||||
throw new ServiceException("签约人不能为空");
|
||||
}
|
||||
List<BusinessStaff> businessStaffs = BeanUtils.mapToList(bo.getSign(), BusinessStaff.class);
|
||||
businessStaffs.forEach(item -> {
|
||||
item.setBusinessId(businessId);
|
||||
flag.set(item.getSurplusQuantity());
|
||||
});
|
||||
//保存负责员工
|
||||
SpringUtils.getBean(BusinessStaffService.class).saveBatch(businessStaffs);
|
||||
return flag.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* 事务对接
|
||||
* @author DB
|
||||
* @param bo 请求
|
||||
* @param businessId 事务id
|
||||
* @since 2023/12/13
|
||||
* @return 返回事务详情总数
|
||||
*/
|
||||
private Integer createButtJoint(BusinessDistributeBo bo,String businessId) {
|
||||
//事务详情数量标记
|
||||
AtomicReference<Integer> flag = new AtomicReference<>(0);
|
||||
//读取模板
|
||||
if (bo.getButtJoint().isEmpty()){
|
||||
throw new ServiceException("对接人不能为空");
|
||||
}
|
||||
//导入数据
|
||||
List<BusinessDistributeDto> businessDistributeDataList = new ArrayList<>();
|
||||
List<BusinessStaff> businessStaffList = new ArrayList<>();
|
||||
bo.getButtJoint().forEach(item -> {
|
||||
//对接文件
|
||||
File buttJointFile = new File(item.getBusinessDocUrl());
|
||||
FileInputStream fileInputStream = null;
|
||||
try {
|
||||
fileInputStream = new FileInputStream(buttJointFile);
|
||||
} catch (FileNotFoundException e) {
|
||||
throw new ServiceException("读取文件失败!");
|
||||
}
|
||||
EasyExcel.read(fileInputStream, BusinessDistributeDto.class,new ReadListener<BusinessDistributeDto>() {
|
||||
|
||||
@Override
|
||||
public void invoke(BusinessDistributeDto data, AnalysisContext context) {
|
||||
businessDistributeDataList.add(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterAllAnalysed(AnalysisContext context) {
|
||||
|
||||
}
|
||||
});
|
||||
if (businessDistributeDataList.isEmpty()) {
|
||||
throw new ServiceException("导入的excel存在空文件,请检查后重新操作");
|
||||
}
|
||||
List<Store> storeList = SpringUtils.getBean(StoreService.class).queryChain()
|
||||
.where(STORE.ID.in(businessDistributeDataList.stream().map(BusinessDistributeDto::getStoreId).collect(Collectors.toSet()))).list();
|
||||
List<BusinessDetail> businessDetails = BeanUtils.mapToList(storeList, BusinessDetail.class);
|
||||
businessDetails.forEach(inner->{
|
||||
inner.setBusinessId(businessId);
|
||||
});
|
||||
//保存详情
|
||||
SpringUtils.getBean(BusinessDetailService.class).saveBatch(businessDetails);
|
||||
//负责员工
|
||||
BusinessStaff businessStaff = BeanUtils.mapToClass(item, BusinessStaff.class);
|
||||
businessStaff.setBusinessId(businessId).setSurplusQuantity(businessDetails.size());
|
||||
businessStaffList.add(businessStaff);
|
||||
flag.updateAndGet(v -> v + businessDetails.size());
|
||||
});
|
||||
//保存负责员工
|
||||
SpringUtils.getBean(BusinessStaffService.class).saveBatch(businessStaffList);
|
||||
return flag.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取个人事务分页列表/管理人员事务详情列表
|
||||
* @author DB
|
||||
* @since 2023/12/13
|
||||
* @param bo 请求参数
|
||||
* @return Page<BusinessInfoPageVo>
|
||||
*/
|
||||
@Override
|
||||
public Page<BusinessInfoPageVo> getBusinessInfoPage(BusinessInfoPageBo bo) {
|
||||
//获取当前事务
|
||||
Business business = this.getById(bo.getId());
|
||||
//对接
|
||||
if (business.getBusinessType() == 0) {
|
||||
return getButtJoint(bo);
|
||||
} else {
|
||||
//签约
|
||||
return getSign(bo);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取签约数据
|
||||
* @author DB
|
||||
* @since 2023/12/13
|
||||
* @param bo 请求
|
||||
* @return Page<BusinessInfoPageVo>
|
||||
*/
|
||||
private Page<BusinessInfoPageVo> getSign(BusinessInfoPageBo bo) {
|
||||
//获取当前员工信息
|
||||
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
|
||||
QueryWrapper queryWrapper = QueryWrapper.create();
|
||||
//运营人员
|
||||
if (loginUserInfo.getInteger("staffType") == 1) {
|
||||
//查询自己处理中的校区的记录
|
||||
queryWrapper.and(BUSINESS_STAFF.STAFF_ID.eq(loginUserInfo.getString("id"))
|
||||
//获取所有无人处理的校区
|
||||
.or(STORE.ID.notIn(select(BUSINESS_DETAIL.STORE_ID)
|
||||
.from(BUSINESS_DETAIL)
|
||||
.leftJoin(BUSINESS_STAFF).on(BUSINESS_STAFF.BUSINESS_ID.eq(BUSINESS_DETAIL.BUSINESS_ID))
|
||||
.where(BUSINESS_STAFF.STAFF_ID.ne(loginUserInfo.getString("id")))
|
||||
)));
|
||||
}
|
||||
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
|
||||
return SpringUtils.getBean(StoreService.class).getMapper().paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()),
|
||||
queryWrapper
|
||||
.select(BUSINESS_DETAIL.ID, BUSINESS_DETAIL.DETAIL_STATUS, BUSINESS_DETAIL.DETAIL_DESC, BUSINESS_DETAIL.DETAIL_RECORD_TIME)
|
||||
//品牌
|
||||
.select(BRAND.BRAND_NAME)
|
||||
//校区
|
||||
.select(STORE.STORE_NAME, STORE.PERSON_CHARGE, STORE.PHONE)
|
||||
//营业执照
|
||||
.select(STORE_LICENSE.LICENSE_NAME, STORE_LICENSE.LICENSE_USER_NAME, STORE_LICENSE.LICENSE_ADDR)
|
||||
.leftJoin(BRAND).on(BRAND.ID.eq(STORE.BRAND_ID))
|
||||
.leftJoin(STORE_LICENSE).on(STORE_LICENSE.STORE_ID.eq(STORE.ID))
|
||||
.leftJoin(BUSINESS_DETAIL).on(BUSINESS_DETAIL.STORE_ID.eq(STORE.ID))
|
||||
.leftJoin(STAFF).on(STAFF.ID.eq(BUSINESS_STAFF.STAFF_ID))
|
||||
//品牌或校区名模糊查询
|
||||
.and(BRAND.BRAND_NAME.like(bo.getBrandOrStore()).or(STORE.STORE_NAME.like(bo.getBrandOrStore())))
|
||||
//校区地址或校区名模糊查询
|
||||
.and(STORE_LICENSE.LICENSE_NAME.like(bo.getAddrOrName()).or(STORE_LICENSE.LICENSE_ADDR.like(bo.getAddrOrName())))
|
||||
//未签约-非测试
|
||||
.and(STORE.IS_TEST.eq(false))
|
||||
.and(STORE.HAVE_ACTIVE.eq(false))
|
||||
.orderBy(BUSINESS_DETAIL.CREATE_TIME.asc()),
|
||||
BusinessInfoPageVo.class);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对接数据
|
||||
* @author DB
|
||||
* @since 2023/12/13
|
||||
* @param bo 请求
|
||||
* @return Page<BusinessInfoPageVo>
|
||||
*/
|
||||
private Page<BusinessInfoPageVo> getButtJoint(BusinessInfoPageBo bo) {
|
||||
//获取当前员工信息
|
||||
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
|
||||
QueryWrapper queryWrapper = QueryWrapper.create();
|
||||
//运营人员
|
||||
if (loginUserInfo.getInteger("staffType") == 1) {
|
||||
queryWrapper.and(BUSINESS_STAFF.STAFF_ID.eq(loginUserInfo.getString("id")));
|
||||
}
|
||||
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
|
||||
return SpringUtils.getBean(BusinessDetailService.class).getMapper().paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()),
|
||||
queryWrapper
|
||||
//事务详情
|
||||
.select(BUSINESS_DETAIL.ID, BUSINESS_DETAIL.DETAIL_STATUS, BUSINESS_DETAIL.DETAIL_DESC, BUSINESS_DETAIL.DETAIL_RECORD_TIME)
|
||||
//员工
|
||||
.select(STAFF.NAME.as(BusinessInfoPageVo::getStaffName))
|
||||
//品牌
|
||||
.select(BRAND.BRAND_NAME)
|
||||
//校区
|
||||
.select(STORE.STORE_NAME, STORE.PERSON_CHARGE, STORE.PHONE)
|
||||
//营业执照
|
||||
.select(STORE_LICENSE.LICENSE_NAME, STORE_LICENSE.LICENSE_USER_NAME, STORE_LICENSE.LICENSE_ADDR)
|
||||
.leftJoin(BUSINESS_STAFF).on(BUSINESS_STAFF.BUSINESS_ID.eq(BUSINESS_DETAIL.BUSINESS_ID))
|
||||
.leftJoin(STAFF).on(STAFF.ID.eq(BUSINESS_STAFF.STAFF_ID))
|
||||
.leftJoin(BRAND).on(BRAND.ID.eq(BUSINESS_DETAIL.BRAND_ID))
|
||||
.leftJoin(STORE).on(STORE.ID.eq(BUSINESS_DETAIL.STORE_ID))
|
||||
.leftJoin(STORE_LICENSE).on(STORE_LICENSE.STORE_ID.eq(STORE.ID))
|
||||
.where(BUSINESS_DETAIL.BUSINESS_ID.eq(bo.getId()))
|
||||
//品牌或校区名模糊查询
|
||||
.and(BRAND.BRAND_NAME.like(bo.getBrandOrStore()).or(STORE.STORE_NAME.like(bo.getBrandOrStore())))
|
||||
//校区地址或校区名模糊查询
|
||||
.and(STORE_LICENSE.LICENSE_NAME.like(bo.getAddrOrName()).or(STORE_LICENSE.LICENSE_ADDR.like(bo.getAddrOrName())))
|
||||
.and(BUSINESS_DETAIL.DETAIL_STATUS.eq(bo.getDetailStatus())),
|
||||
BusinessInfoPageVo.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 员工事务处理
|
||||
* @author DB
|
||||
* @since 2023/12/13
|
||||
* @param bo 请求
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void businessDispose(BusinessDisposeBo bo) {
|
||||
BusinessDetailService businessDetailService = SpringUtils.getBean(BusinessDetailService.class);
|
||||
BusinessDetail businessDetail;
|
||||
//查询当前事务
|
||||
if (StringUtils.isNotBlank(bo.getId())){
|
||||
businessDetail = businessDetailService.getById(bo.getId());
|
||||
businessDetail.setDetailStatus(bo.getDetailStatus()).setDetailDesc(bo.getDetailDesc()).setDetailRecordTime(LocalDateTime.now());
|
||||
//新增或修改
|
||||
businessDetailService.updateById(businessDetail);
|
||||
} else {
|
||||
businessDetail = new BusinessDetail();
|
||||
//获取校区数据
|
||||
Store store = SpringUtils.getBean(StoreService.class).getById(bo.getStoreId());
|
||||
businessDetail.setBrandId(store.getBrandId()).setStoreId(store.getId()).setBusinessId(bo.getBusinessId());
|
||||
businessDetail.setDetailStatus(bo.getDetailStatus()).setDetailDesc(bo.getDetailDesc()).setDetailRecordTime(LocalDateTime.now());
|
||||
//新增或修改
|
||||
businessDetailService.save(businessDetail);
|
||||
}
|
||||
//完成的时候数量减少
|
||||
if (bo.getDetailStatus() == 1) {
|
||||
Business business = this.getById(businessDetail.getBusinessId());
|
||||
//所有任务都完成
|
||||
if (business.getAllSurplusQuantity() - 1 == 0) {
|
||||
business.setStatus(1);
|
||||
}
|
||||
business.setAllSurplusQuantity(business.getAllSurplusQuantity() - 1);
|
||||
this.updateById(business);
|
||||
SpringUtils.getBean(BusinessStaffService.class).updateChain()
|
||||
.setRaw(BUSINESS_STAFF.SURPLUS_QUANTITY, "surplus_quantity - 1")
|
||||
.where(BUSINESS_STAFF.BUSINESS_ID.eq(businessDetail.getBusinessId()))
|
||||
.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.cpop.oam.business.service.impl;
|
||||
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.cpop.oam.business.entity.BusinessStaff;
|
||||
import com.cpop.oam.business.mapper.BusinessStaffMapper;
|
||||
import com.cpop.oam.business.service.BusinessStaffService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 事务-负责员工表 服务层实现。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2023-12-13
|
||||
*/
|
||||
@Service("businessStaffService")
|
||||
public class BusinessStaffServiceImpl extends ServiceImpl<BusinessStaffMapper, BusinessStaff> implements BusinessStaffService {
|
||||
|
||||
}
|
||||
@ -73,6 +73,9 @@ public class TaskDemandServiceImpl extends ServiceImpl<TaskDemandMapper, TaskDem
|
||||
QueryWrapper queryWrapper = QueryWrapper.create();
|
||||
if (null != bo.getTaskStatus()) {
|
||||
switch (bo.getTaskStatus()) {
|
||||
case 10:
|
||||
queryWrapper.and(TASK.TASK_STATUS.eq(10));
|
||||
break;
|
||||
// 待评估
|
||||
case 0:
|
||||
queryWrapper.and(TASK.TASK_STATUS.eq(0));
|
||||
|
||||
@ -39,6 +39,7 @@ import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER;
|
||||
import static com.cpop.oam.business.entity.table.DutyTableDef.DUTY;
|
||||
import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF;
|
||||
import static com.cpop.oam.business.entity.table.TaskDemandTableDef.TASK_DEMAND;
|
||||
@ -625,7 +626,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
||||
*/
|
||||
private String createDailyPaper(List<Task> taskList, Map<String, List<TaskStaffGroup>> taskStaffGroupMap) {
|
||||
//所有技术员工信息
|
||||
Map<String, Staff> staffMap = SpringUtils.getBean(StaffService.class).queryChain().where(STAFF.STAFF_TYPE.eq(0)).list()
|
||||
Map<String, Staff> staffMap = SpringUtils.getBean(StaffService.class).queryChain()
|
||||
.leftJoin(SYS_USER).on(SYS_USER.ID.eq(STAFF.USER_ID))
|
||||
.where(STAFF.STAFF_TYPE.eq(0))
|
||||
.and(SYS_USER.STATUS.eq(1))
|
||||
.list()
|
||||
.stream().collect(Collectors.toMap(Staff::getId, item -> item));
|
||||
StringBuilder dailyPaper = new StringBuilder();
|
||||
dailyPaper.append("开发:\n");
|
||||
|
||||
@ -204,7 +204,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
|
||||
.on(TASK.ID.eq(TASK_WORK_ORDER.TASK_ID))
|
||||
// 工单
|
||||
.where(TASK.TASK_TYPE.eq(2))
|
||||
.and(TASK.TASK_STATUS.in(3, 6)),
|
||||
.and(TASK.TASK_STATUS.eq(9)),
|
||||
TaskWorkOrderPageVo.class,
|
||||
item -> item.field(TaskWorkOrderPageVo::getFinishStaffName)
|
||||
.queryWrapper(finishStaff -> queryChain().select(STAFF.NAME.as("finishStaffName"))
|
||||
@ -267,6 +267,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
|
||||
if (technologyStaffInfo != null) {
|
||||
// 企微通知值班人员
|
||||
List<String> phoneList = new ArrayList<String>();
|
||||
phoneList.add(loginUserInfo.getString("phoneNumber"));
|
||||
phoneList.add(technologyStaffInfo.getPhoneNumber());
|
||||
try {
|
||||
SpringUtils.getBean(WebHookSendHandler.class)
|
||||
@ -335,10 +336,8 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
|
||||
// 基于表达式构建触发器
|
||||
QuartzUtils quartzUtils = SpringUtils.getBean(QuartzUtils.class);
|
||||
try {
|
||||
//本地快速测试5min
|
||||
//实际两小时
|
||||
//LocalDateTime localDateTime = dateTime.plusHours(2);
|
||||
LocalDateTime localDateTime = dateTime.plusMinutes(2);
|
||||
LocalDateTime localDateTime = dateTime.plusHours(2);
|
||||
ZoneId zoneId = ZoneId.systemDefault();
|
||||
String cron = quartzUtils.convertToCron(Date.from(localDateTime.atZone(zoneId).toInstant()));
|
||||
if (isUpdate) {
|
||||
@ -526,6 +525,9 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl<TaskWorkOrderMapper, T
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void pauseWorkOrder(PauseWorkOrderBo bo) {
|
||||
if (bo.getPauseExpireTime().isBefore(LocalDateTime.now())){
|
||||
throw new ServiceException("暂停时间小于当前时间,暂停失败");
|
||||
}
|
||||
// 获取工单信息
|
||||
TaskWorkOrder workOrder = this.getById(bo.getWorkOrderId());
|
||||
TaskService taskService = SpringUtils.getBean(TaskService.class);
|
||||
|
||||
@ -0,0 +1,82 @@
|
||||
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.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.OffsetDateTime;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2023-12-13 13:42
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "BusinessInfoPageVo对象", description = "事务详情分页返回对象")
|
||||
public class BusinessInfoPageVo {
|
||||
|
||||
/**
|
||||
* 品牌名
|
||||
*/
|
||||
@ApiModelProperty(value = "品牌名")
|
||||
private String brandName;
|
||||
/**
|
||||
* 处理描述
|
||||
*/
|
||||
@ApiModelProperty(value = "处理描述")
|
||||
private String detailDesc;
|
||||
/**
|
||||
* 处理时间
|
||||
*/
|
||||
@ApiModelProperty(value = "处理时间")
|
||||
private LocalDateTime detailRecordTime;
|
||||
/**
|
||||
* 事务详情状态(0:进行中;1:完成:2:挂起)
|
||||
*/
|
||||
@ApiModelProperty(value = "事务详情状态(0:进行中;1:完成:2:挂起)")
|
||||
private long detailStatus;
|
||||
/**
|
||||
* 营业执照地址
|
||||
*/
|
||||
@ApiModelProperty(value = "营业执照地址")
|
||||
private String licenseAddr;
|
||||
/**
|
||||
* 营业执照公司
|
||||
*/
|
||||
@ApiModelProperty(value = "营业执照公司")
|
||||
private String licenseName;
|
||||
/**
|
||||
* 营业执照法人
|
||||
*/
|
||||
@ApiModelProperty(value = "营业执照法人")
|
||||
private String licenseUserName;
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@ApiModelProperty(value = "联系人")
|
||||
private String personCharge;
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private String phone;
|
||||
/**
|
||||
* 负责员工
|
||||
*/
|
||||
@ApiModelProperty(value = "负责员工")
|
||||
private String staffName;
|
||||
/**
|
||||
* 校区名
|
||||
*/
|
||||
@ApiModelProperty(value = "校区名")
|
||||
private String storeName;
|
||||
/**
|
||||
* 事务详情id
|
||||
*/
|
||||
@ApiModelProperty(value = "事务详情id")
|
||||
private String id;
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
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.time.LocalDateTime;
|
||||
import java.time.OffsetDateTime;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2023-12-13 10:20
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "BusinessPageVoe对象", description = "事务分页返回对象")
|
||||
public class BusinessPageVo {
|
||||
|
||||
/**
|
||||
* 总剩余数量
|
||||
*/
|
||||
@ApiModelProperty(value = "总剩余数量")
|
||||
private Integer allSurplusQuantity;
|
||||
/**
|
||||
* 业务等级,业务等级(0:轻;1:重;2:缓;3:急)
|
||||
*/
|
||||
@ApiModelProperty(value = "业务等级(0:轻;1:重;2:缓;3:急)")
|
||||
private Integer businessLevel;
|
||||
/**
|
||||
* 业务类型,业务类型(0:机构对接;1:机构签约)
|
||||
*/
|
||||
@ApiModelProperty(value = "业务类型(0:机构对接;1:机构签约)")
|
||||
private Integer businessType;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String desc;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private LocalDateTime endTime;
|
||||
/**
|
||||
* 事务id
|
||||
*/
|
||||
@ApiModelProperty(value = "事务id")
|
||||
private String id;
|
||||
/**
|
||||
* 分发人
|
||||
*/
|
||||
@ApiModelProperty(value = "分发人")
|
||||
private String initiatorName;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private OffsetDateTime startTime;
|
||||
/**
|
||||
* 状态,状态(0:进行中;1:已完成)
|
||||
*/
|
||||
@ApiModelProperty(value = "状态(0:进行中;1:已完成)")
|
||||
private Integer status;
|
||||
}
|
||||
@ -2,16 +2,22 @@ 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.Task;
|
||||
import com.cpop.oam.business.entity.table.DataImportTableDef;
|
||||
import com.cpop.oam.business.service.DataImportService;
|
||||
import com.cpop.oam.business.service.DutyService;
|
||||
import com.cpop.oam.business.service.TaskService;
|
||||
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.Scheduled;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cpop.oam.business.entity.table.TaskTableDef.TASK;
|
||||
|
||||
|
||||
/**
|
||||
@ -57,4 +63,20 @@ public class OamScheduledTasks {
|
||||
long end = System.currentTimeMillis();
|
||||
log.info("同步校区数据执行时间:{}ms", end - start);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查任务是否逾期
|
||||
* @author DB
|
||||
* @since 2023/12/11
|
||||
*/
|
||||
@Scheduled(cron = "0 10 0 * * *")
|
||||
public void checkTaskWhetherFinish() {
|
||||
log.info("==============开始检查进行中任务===========");
|
||||
TaskService taskService = SpringUtils.getBean(TaskService.class);
|
||||
List<Task> taskList = taskService.queryChain().where(TASK.TASK_STATUS.eq(2)).list();
|
||||
List<Task> filterList = taskList.stream().filter(item -> item.getExpectedCompletionDate().isBefore(LocalDate.now())).collect(Collectors.toList());
|
||||
if (!filterList.isEmpty()) {
|
||||
taskService.updateChain().set(TASK.TASK_STATUS, 4).where(TASK.ID.in(filterList.stream().map(Task::getId).collect(Collectors.toSet()))).update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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.BusinessDetailMapper">
|
||||
|
||||
</mapper>
|
||||
7
Cpop-Oam/src/main/resources/mapper/BusinessMapper.xml
Normal file
7
Cpop-Oam/src/main/resources/mapper/BusinessMapper.xml
Normal 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.BusinessMapper">
|
||||
|
||||
</mapper>
|
||||
@ -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.BusinessStaffMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,106 @@
|
||||
package com.cpop.system.business.controller;
|
||||
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.cpop.system.business.entity.StoreLicense;
|
||||
import com.cpop.system.business.service.StoreLicenseService;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 校区/店铺营业执照 控制层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2023-12-12
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "校区/店铺营业执照接口")
|
||||
@RequestMapping("/storeLicense")
|
||||
public class StoreLicenseController {
|
||||
|
||||
@Autowired
|
||||
private StoreLicenseService storeLicenseService;
|
||||
|
||||
/**
|
||||
* 添加校区/店铺营业执照。
|
||||
*
|
||||
* @param storeLicense 校区/店铺营业执照
|
||||
* @return {@code true} 添加成功,{@code false} 添加失败
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperation("保存校区/店铺营业执照")
|
||||
public boolean save(@RequestBody @ApiParam("校区/店铺营业执照") StoreLicense storeLicense) {
|
||||
return storeLicenseService.save(storeLicense);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键删除校区/店铺营业执照。
|
||||
*
|
||||
* @param id 主键
|
||||
* @return {@code true} 删除成功,{@code false} 删除失败
|
||||
*/
|
||||
@DeleteMapping("/remove/{id}")
|
||||
@ApiOperation("根据主键校区/店铺营业执照")
|
||||
public boolean remove(@PathVariable @ApiParam("校区/店铺营业执照主键") Serializable id) {
|
||||
return storeLicenseService.removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键更新校区/店铺营业执照。
|
||||
*
|
||||
* @param storeLicense 校区/店铺营业执照
|
||||
* @return {@code true} 更新成功,{@code false} 更新失败
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("根据主键更新校区/店铺营业执照")
|
||||
public boolean update(@RequestBody @ApiParam("校区/店铺营业执照主键") StoreLicense storeLicense) {
|
||||
return storeLicenseService.updateById(storeLicense);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有校区/店铺营业执照。
|
||||
*
|
||||
* @return 所有数据
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询所有校区/店铺营业执照")
|
||||
public List<StoreLicense> list() {
|
||||
return storeLicenseService.list();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据校区/店铺营业执照主键获取详细信息。
|
||||
*
|
||||
* @param id 校区/店铺营业执照主键
|
||||
* @return 校区/店铺营业执照详情
|
||||
*/
|
||||
@GetMapping("/getInfo/{id}")
|
||||
@ApiOperation("根据主键获取校区/店铺营业执照")
|
||||
public StoreLicense getInfo(@PathVariable @ApiParam("校区/店铺营业执照主键") Serializable id) {
|
||||
return storeLicenseService.getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询校区/店铺营业执照。
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @return 分页对象
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("分页查询校区/店铺营业执照")
|
||||
public Page<StoreLicense> page(@ApiParam("分页信息") Page<StoreLicense> page) {
|
||||
return storeLicenseService.page(page);
|
||||
}
|
||||
|
||||
}
|
||||
@ -80,6 +80,11 @@ public class Store extends BaseEntity implements Serializable {
|
||||
*/
|
||||
private String sourceType;
|
||||
|
||||
/**
|
||||
* 是否是测试
|
||||
*/
|
||||
private Boolean isTest;
|
||||
|
||||
/**
|
||||
* 逻辑删除(0否1是)
|
||||
*/
|
||||
|
||||
@ -0,0 +1,83 @@
|
||||
package com.cpop.system.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.sql.Date;
|
||||
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-12
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@Table(value = "cp_sys_store_license", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
|
||||
public class StoreLicense extends BaseEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* 营业执照主键
|
||||
*/
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 校区/店铺id
|
||||
*/
|
||||
private String storeId;
|
||||
|
||||
/**
|
||||
* 营业执照地址
|
||||
*/
|
||||
private String licenseAddr;
|
||||
|
||||
/**
|
||||
* 营业执照日期
|
||||
*/
|
||||
private Date licenseDate;
|
||||
|
||||
/**
|
||||
* 营业执照公司名
|
||||
*/
|
||||
private String licenseName;
|
||||
|
||||
/**
|
||||
* 营业执照证书码
|
||||
*/
|
||||
private String licenseCode;
|
||||
|
||||
/**
|
||||
* 营业执照法人名
|
||||
*/
|
||||
private String licenseUserName;
|
||||
|
||||
/**
|
||||
* 营业执照图片地址
|
||||
*/
|
||||
private String licensePicUrl;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 逻辑删除(0否1是)
|
||||
*/
|
||||
@Column(isLogicDelete = true)
|
||||
private Boolean isDelete;
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cpop.system.business.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.cpop.system.business.entity.StoreLicense;
|
||||
|
||||
/**
|
||||
* 校区/店铺营业执照 映射层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2023-12-12
|
||||
*/
|
||||
public interface StoreLicenseMapper extends BaseMapper<StoreLicense> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cpop.system.business.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.cpop.system.business.entity.StoreLicense;
|
||||
|
||||
/**
|
||||
* 校区/店铺营业执照 服务层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2023-12-12
|
||||
*/
|
||||
public interface StoreLicenseService extends IService<StoreLicense> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.cpop.system.business.service.impl;
|
||||
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.cpop.system.business.entity.StoreLicense;
|
||||
import com.cpop.system.business.mapper.StoreLicenseMapper;
|
||||
import com.cpop.system.business.service.StoreLicenseService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 校区/店铺营业执照 服务层实现。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2023-12-12
|
||||
*/
|
||||
@Service("storeLicenseService")
|
||||
public class StoreLicenseServiceImpl extends ServiceImpl<StoreLicenseMapper, StoreLicense> implements StoreLicenseService {
|
||||
|
||||
}
|
||||
@ -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.system.business.mapper.StoreLicenseMapper">
|
||||
|
||||
</mapper>
|
||||
10
pom.xml
10
pom.xml
@ -47,6 +47,8 @@
|
||||
<wechat-java.version>4.5.0</wechat-java.version>
|
||||
<bcprov-jdk15on.version>1.70</bcprov-jdk15on.version>
|
||||
<cos_api.version>5.6.155</cos_api.version>
|
||||
<spring-test.version>5.3.31</spring-test.version>
|
||||
<hutool.version>5.8.23</hutool.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
@ -203,7 +205,15 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<version>${spring-test.version}</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/cn.hutool/hutool-all -->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user