Compare commits
10 Commits
5e932d56af
...
2ff94c4500
Author | SHA1 | Date | |
---|---|---|---|
2ff94c4500 | |||
dc2acdbf58 | |||
![]() |
a21540fc27 | ||
![]() |
21185aa726 | ||
50a3b0d23c | |||
fa8b566da9 | |||
4624b9d0b7 | |||
78be975a6a | |||
9ea6a3b501 | |||
90f0929c62 |
@ -52,10 +52,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@ -121,6 +118,16 @@ public class AuthController {
|
||||
QueryWrapper<SysNotice> queryWrapper = new QueryWrapper<SysNotice>()
|
||||
.in( "rec_uid", userId);
|
||||
List<SysNotice> sysNotices = sysNoticeMapper.selectList(queryWrapper);
|
||||
sysNotices.sort(new Comparator<SysNotice>() {
|
||||
@Override
|
||||
public int compare(SysNotice o1, SysNotice o2) {
|
||||
if (o1.getReaded() == 1){
|
||||
return 1;
|
||||
}else{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
});
|
||||
// for (int i = 0; i < 100; i++) {
|
||||
for (SysNotice sysNotice : sysNotices) {
|
||||
dto = new WebSocketMessageDto();
|
||||
|
@ -28,7 +28,7 @@
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<level>DEBUG</level>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<level>DEBUG</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
|
@ -251,6 +251,10 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 本月首日0点
|
||||
* @return
|
||||
*/
|
||||
public static Date getFirstDayZeroTimeByMonth() {
|
||||
// 获取当前日期的Calendar对象
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
@ -270,6 +274,11 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
// System.out.println("本月第一天的0点日期: " + firstDayOfMonth);
|
||||
return firstDayOfMonth;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上月首日
|
||||
* @return
|
||||
*/
|
||||
public static Date getLastMonthFirstDayZeroTime() {
|
||||
// 获取当前日期的Calendar对象
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
@ -291,6 +300,12 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
// System.out.println("本月第一天的0点日期: " + firstDayOfMonth);
|
||||
return firstDayOfMonth;
|
||||
}
|
||||
|
||||
/**
|
||||
* 本月最后时间
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static Date getEndTimeByMonth(Date date) {
|
||||
// 获取当前日期的Calendar对象
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
@ -4,7 +4,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class TranslationThreadLocal {
|
||||
Map<String, String> cache = new HashMap<>();
|
||||
Map<String, Object> cache = new HashMap<>();
|
||||
|
||||
/*把线程相关的部分内聚到 类里面 相当于map 每个类是对应key*/
|
||||
private static ThreadLocal<TranslationThreadLocal> t = new ThreadLocal<TranslationThreadLocal>();
|
||||
@ -25,9 +25,20 @@ public class TranslationThreadLocal {
|
||||
}
|
||||
|
||||
public String get(String key1, String key2) {
|
||||
return cache.get(key1 + "_" + key2);
|
||||
Object o = cache.get(key1 + "_" + key2);
|
||||
if (o == null){
|
||||
return null;
|
||||
}
|
||||
public String set(String key1, String key2, String val) {
|
||||
return o.toString();
|
||||
}
|
||||
public Object set(String key1, String key2, String val) {
|
||||
return cache.put(key1 + "_" + key2, val);
|
||||
}
|
||||
|
||||
public Object get(String key1) {
|
||||
return cache.get(key1);
|
||||
}
|
||||
public Object set(String key1, Object val) {
|
||||
return cache.put(key1, val);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
package com.pusong.common.json.config;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
@ -10,9 +13,12 @@ import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import com.pusong.common.json.handler.BigNumberSerializer;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
@ -30,7 +36,14 @@ import java.util.TimeZone;
|
||||
@Slf4j
|
||||
@AutoConfiguration(before = JacksonAutoConfiguration.class)
|
||||
public class JacksonConfig {
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
@ConditionalOnMissingBean(ObjectMapper.class)
|
||||
public ObjectMapper jacksonObjectMapper(Jackson2ObjectMapperBuilder builder) {
|
||||
ObjectMapper objectMapper = builder.createXmlMapper(false).build();
|
||||
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
return objectMapper;
|
||||
}
|
||||
@Bean
|
||||
public Jackson2ObjectMapperBuilderCustomizer customizer() {
|
||||
return builder -> {
|
||||
@ -58,6 +71,7 @@ public class JacksonConfig {
|
||||
javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(formatter));
|
||||
builder.modules(javaTimeModule);
|
||||
builder.timeZone(TimeZone.getDefault());
|
||||
builder.featuresToDisable(SerializationFeature.WRITE_NULL_MAP_VALUES);
|
||||
log.info("初始化 jackson 配置");
|
||||
};
|
||||
}
|
||||
|
@ -43,14 +43,14 @@ public enum DataScopeType {
|
||||
DEPT_AND_CHILD("4", " #{#deptName} IN ( #{@sdss.getDeptAndChild( #user.deptId )} )", " 1 = 1 "),
|
||||
|
||||
/**
|
||||
* 仅本人数据权限
|
||||
* 仅本人数据权限。 方法注解加该参数并且有《财务合同》角色,这个方法则强制查询仅自己,不管这个角色是否还有高级角色
|
||||
*/
|
||||
SELF("5", " #{#userName} = #{#user.userId} ", " 1 = 0 "),
|
||||
|
||||
/**
|
||||
* 财务合同部门及以下数据
|
||||
* 财务合同部门及以下数据 方法注解加该参数并且有《财务合同》角色,这个方法则强制查询部门及以下,不管这个用户是否还有高级角色
|
||||
*/
|
||||
CAIWU_HETONG("6", " #{#deptName} = #{#user.deptId} ", " 1 = 0 ")
|
||||
CAIWU_HETONG("6", " #{#deptName} = #{#user.deptId} or #{#userName} = #{#user.userId} ", " 1 = 1 ")
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
@ -105,7 +105,7 @@ public class PlusDataPermissionHandler {
|
||||
/**
|
||||
* 构造数据过滤sql
|
||||
*/
|
||||
private String buildDataFilter(DataColumn[] dataColumns, boolean isSelect) {
|
||||
private String buildDataFilter(DataColumn[] funcDataColumns, boolean isSelect) {
|
||||
// 更新或删除需满足所有条件
|
||||
String joinStr = isSelect ? " OR " : " AND ";
|
||||
LoginUser user = DataPermissionHelper.getVariable("user");
|
||||
@ -116,42 +116,67 @@ public class PlusDataPermissionHandler {
|
||||
for (RoleDTO role : user.getRoles()) {
|
||||
user.setRoleId(role.getRoleId());
|
||||
// 获取角色权限泛型
|
||||
DataScopeType type = DataScopeType.findCode(role.getDataScope());
|
||||
if (ObjectUtil.isNull(type)) {
|
||||
DataScopeType roleDataType = DataScopeType.findCode(role.getDataScope());
|
||||
if (ObjectUtil.isNull(roleDataType)) {
|
||||
throw new ServiceException("角色数据范围异常 => " + role.getDataScope());
|
||||
}
|
||||
// 全部数据权限直接返回
|
||||
if (type == DataScopeType.ALL) {
|
||||
if (roleDataType == DataScopeType.ALL) {
|
||||
// return "";
|
||||
continue;
|
||||
}
|
||||
boolean isSuccess = false;
|
||||
for (DataColumn dataColumn : dataColumns) {
|
||||
if (type == DataScopeType.CAIWU_HETONG && DataScopeType.CAIWU_HETONG != dataColumn.dataScopeType()){
|
||||
for (DataColumn funcDataColumn : funcDataColumns) {
|
||||
// if (type == DataScopeType.CAIWU_HETONG && DataScopeType.CAIWU_HETONG != dataColumn.dataScopeType()){
|
||||
// continue;
|
||||
// }
|
||||
String sqlTemplate = roleDataType.getSqlTemplate();
|
||||
|
||||
boolean check = false;
|
||||
if (roleDataType == DataScopeType.CAIWU_HETONG){
|
||||
if (DataScopeType.SELF == funcDataColumn.dataScopeType() || DataScopeType.CAIWU_HETONG == funcDataColumn.dataScopeType()){
|
||||
check = true;
|
||||
sqlTemplate = funcDataColumn.dataScopeType().getSqlTemplate();
|
||||
}
|
||||
}else{
|
||||
check = true;
|
||||
}
|
||||
|
||||
if (!check){
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dataColumn.key().length != dataColumn.value().length) {
|
||||
|
||||
// if (DataScopeType.SELF != funcDataColumn.dataScopeType()
|
||||
// && DataScopeType.CAIWU_HETONG != funcDataColumn.dataScopeType()
|
||||
// && DataScopeType.CAIWU_HETONG != funcDataColumn.dataScopeType()){
|
||||
// continue;
|
||||
// }
|
||||
|
||||
if (funcDataColumn.key().length != funcDataColumn.value().length) {
|
||||
throw new ServiceException("角色数据范围异常 => key与value长度不匹配");
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 不包含 key 变量 则不处理
|
||||
if (!StringUtils.containsAny(type.getSqlTemplate(),
|
||||
Arrays.stream(dataColumn.key()).map(key -> "#" + key).toArray(String[]::new))) {
|
||||
if (!StringUtils.containsAny(sqlTemplate,
|
||||
Arrays.stream(funcDataColumn.key()).map(key -> "#" + key).toArray(String[]::new))) {
|
||||
continue;
|
||||
}
|
||||
// 设置注解变量 key 为表达式变量 value 为变量值
|
||||
for (int i = 0; i < dataColumn.key().length; i++) {
|
||||
context.setVariable(dataColumn.key()[i], dataColumn.value()[i]);
|
||||
for (int i = 0; i < funcDataColumn.key().length; i++) {
|
||||
context.setVariable(funcDataColumn.key()[i], funcDataColumn.value()[i]);
|
||||
}
|
||||
|
||||
// 解析sql模板并填充
|
||||
String sql = parser.parseExpression(type.getSqlTemplate(), parserContext).getValue(context, String.class);
|
||||
String sql = parser.parseExpression(sqlTemplate, parserContext).getValue(context, String.class);
|
||||
conditions.add(joinStr + sql);
|
||||
isSuccess = true;
|
||||
}
|
||||
// 未处理成功则填充兜底方案
|
||||
if (!isSuccess && StringUtils.isNotBlank(type.getElseSql())) {
|
||||
conditions.add(joinStr + type.getElseSql());
|
||||
if (!isSuccess && StringUtils.isNotBlank(roleDataType.getElseSql())) {
|
||||
conditions.add(joinStr + roleDataType.getElseSql());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.pusong.common.redis.manager;
|
||||
|
||||
import com.pusong.common.core.utils.SpringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cache.Cache;
|
||||
@ -12,6 +13,7 @@ import java.util.concurrent.Callable;
|
||||
*
|
||||
* @author LionLi
|
||||
*/
|
||||
@Slf4j
|
||||
public class CaffeineCacheDecorator implements Cache {
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(CaffeineCacheDecorator.class);
|
||||
|
@ -6,6 +6,7 @@ import com.pusong.common.translation.annotation.TranslationType;
|
||||
import com.pusong.common.translation.constant.TransConstant;
|
||||
import com.pusong.common.translation.core.TranslationInterface;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -16,6 +17,7 @@ import org.slf4j.LoggerFactory;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@TranslationType(type = TransConstant.DICT_TYPE_TO_LABEL)
|
||||
@Slf4j
|
||||
public class DictTypeTranslationImpl implements TranslationInterface<String> {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(DictTypeTranslationImpl.class);
|
||||
|
@ -264,7 +264,7 @@ public class CalSalaryBatch {
|
||||
*/
|
||||
private BigDecimal calSalary(List<PsContractBusinessVo> businessVo, Map<String, BigDecimal> configMap, Map<String, BigDecimal> costMap){
|
||||
String cbStr = "0.0";
|
||||
BigDecimal rateStr = new BigDecimal(configMap ==null || configMap.isEmpty() ? "0" : "100");
|
||||
BigDecimal minRate = new BigDecimal(configMap ==null || configMap.isEmpty() ? "0" : "100");
|
||||
|
||||
configMap = CollectionUtils.isEmpty(configMap) ? new HashMap<>() : configMap;
|
||||
costMap = CollectionUtils.isEmpty(costMap) ? new HashMap<>() : costMap;
|
||||
@ -272,8 +272,8 @@ public class CalSalaryBatch {
|
||||
|
||||
|
||||
for (BigDecimal value : configMap.values()) {
|
||||
if (value.doubleValue() < rateStr.doubleValue()){
|
||||
rateStr = value;
|
||||
if (value.doubleValue() < minRate.doubleValue()){
|
||||
minRate = value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -282,13 +282,22 @@ public class CalSalaryBatch {
|
||||
//如果详情没有填写金额的话按照详情中最低的提成比例进行计算(按照详情算)
|
||||
if(item.getDetailVoList().get(0).getAmount() == null
|
||||
|| BigDecimal.ZERO.compareTo(item.getDetailVoList().get(0).getAmount()) == 0){
|
||||
BigDecimal rate = rateStr;
|
||||
BigDecimal rate = null;
|
||||
|
||||
BigDecimal cost = new BigDecimal(cbStr);
|
||||
for (PsContractBusinessDetailVo detail : item.getDetailVoList()){
|
||||
BigDecimal rateConfig = configMap.get(detail.getBusinessProject()) == null ? new BigDecimal("0.1") : configMap.get(detail.getBusinessProject());
|
||||
rate = rate.compareTo(rateConfig) < 0 ? rate : rateConfig;
|
||||
// BigDecimal rateConfig = configMap.get(detail.getBusinessProject()) ;
|
||||
// if (rateConfig != null){
|
||||
// if (rate == null || rate.compareTo(rateConfig) < 0){
|
||||
// rate = rateConfig;
|
||||
// }
|
||||
// }
|
||||
cost = cost.add(costMap.get(detail.getBusinessProject()) == null ? new BigDecimal(cbStr) : costMap.get(detail.getBusinessProject()));
|
||||
}
|
||||
if (rate == null){
|
||||
rate = minRate;
|
||||
}
|
||||
|
||||
//服务类型金额 - 成本
|
||||
BigDecimal amount = item.getBusinessAmount() == null ? new BigDecimal(0) : item.getBusinessAmount().subtract(cost);
|
||||
// ×比例
|
||||
@ -297,7 +306,7 @@ public class CalSalaryBatch {
|
||||
}else{//(按照类型算)
|
||||
for (PsContractBusinessDetailVo detail : item.getDetailVoList()){
|
||||
//比例
|
||||
BigDecimal rateConfig = configMap.get(detail.getBusinessProject()) == null ? rateStr : configMap.get(detail.getBusinessProject());
|
||||
BigDecimal rateConfig = configMap.get(detail.getBusinessProject()) == null ? minRate : configMap.get(detail.getBusinessProject());
|
||||
rateConfig = rateConfig.multiply(new BigDecimal("0.01"));
|
||||
//成本
|
||||
BigDecimal rateCost = costMap.get(detail.getBusinessProject()) == null ? new BigDecimal(cbStr) : costMap.get(detail.getBusinessProject());
|
||||
|
@ -62,6 +62,17 @@ public class HomeController extends BaseController {
|
||||
public R<RenewalInfoVo> renewal(@RequestParam() Integer type) {
|
||||
return R.ok(homeService.renewal(type));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新签老客户新客户统计
|
||||
*/
|
||||
@SaCheckPermission("business:salary:list")
|
||||
@GetMapping("/contractNumByCusIsOld")
|
||||
public R<OldOrNewCusContractCountVo> contractNumByCusIsOld(@RequestParam() Integer type) {
|
||||
return R.ok(homeService.contractNumByCusIsOld(type));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 首页大盘数据:回款情况
|
||||
* @param type 1本月 2上月 3本季度 4本年 5所有
|
||||
|
@ -64,7 +64,7 @@ public class PsCompanyInfoController extends BaseController {
|
||||
* 服务公司列表
|
||||
*/
|
||||
@SaCheckPermission("business:companyInfo:list")
|
||||
@Log(title = "服务公司列表" )
|
||||
// @Log(title = "服务公司列表" )
|
||||
@GetMapping("/serviceList")
|
||||
public TableDataInfo<PsCompanyInfoVo> serviceList(PsCompanyQueryBo queryBo, PageQuery pageQuery) {
|
||||
return psCompanyInfoService.queryServiceCompany(queryBo, pageQuery);
|
||||
|
@ -84,6 +84,15 @@ public class PsContractInfoController extends BaseController {
|
||||
return R.ok(psContractInfoService.queryInfoByCustomId(customerId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询合同列表
|
||||
*/
|
||||
@SaCheckPermission("business:contractInfo:LIST")
|
||||
@GetMapping("/countContract")
|
||||
public R<PsContractCountVo> countContract(PsContractInfoQueryBo bo) {
|
||||
PsContractCountVo contractCountVo = psContractInfoService.countContractInfo(bo);
|
||||
return R.ok(contractCountVo);
|
||||
}
|
||||
/**
|
||||
* 分页查询合同列表
|
||||
*/
|
||||
@ -91,8 +100,6 @@ public class PsContractInfoController extends BaseController {
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<PsContractInfoVo> list(PsContractInfoQueryBo bo, PageQuery pageQuery) {
|
||||
TableDataInfo<PsContractInfoVo> psContractInfoVoTableDataInfo = psContractInfoService.queryPageList(bo, pageQuery);
|
||||
|
||||
PsContractCountVo contractCountVo = psContractInfoService.countContractInfo(bo);
|
||||
return psContractInfoVoTableDataInfo;
|
||||
}
|
||||
@SaCheckPermission("business:contractInfo:LIST")
|
||||
|
@ -44,15 +44,16 @@ public class PsCustomController extends BaseController {
|
||||
private final DictService dictService;
|
||||
private final IPsCustomInfoService psCustomInfoService;
|
||||
private final ISysNoticeService noticeService;
|
||||
|
||||
/**
|
||||
* 查询登陆人下所有的客户名称和id
|
||||
*/
|
||||
|
||||
@SaCheckPermission("business:customInfo:list")
|
||||
@GetMapping("/listByLoginUser")
|
||||
public R<List<Map<String,Object>>> listByLoginUser(String name, PageQuery pageQuery) {
|
||||
return R.ok(psCustomInfoService.listByLoginUser(name, pageQuery));
|
||||
public TableDataInfo<List<Map<String,Object>>> listByLoginUser(String customName, String customMobile, String companyName, PageQuery pageQuery) {
|
||||
return psCustomInfoService.listByLoginUser(customName, customMobile, companyName, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户信息列表
|
||||
*/
|
||||
|
@ -25,6 +25,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -44,7 +45,7 @@ public class PsTaskController extends BaseController {
|
||||
/**
|
||||
* 查询主任务列表
|
||||
*/
|
||||
@Log(title = "查询主任务列表")
|
||||
// @Log(title = "查询主任务列表")
|
||||
@SaCheckPermission("business:task:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<PsTaskMainVo> list(PsTaskQueryBo bo, PageQuery pageQuery) {
|
||||
@ -54,7 +55,7 @@ public class PsTaskController extends BaseController {
|
||||
/**
|
||||
* 查询内外特任务列表
|
||||
*/
|
||||
@Log(title = "查询内外特任务列表")
|
||||
// @Log(title = "查询内外特任务列表")
|
||||
@SaCheckPermission("business:task:list")
|
||||
@GetMapping("/childList")
|
||||
public TableDataInfo<PsTaskMainVo> childList(@Validated(QueryGroup.class) PsTaskQueryBo bo, PageQuery pageQuery) {
|
||||
@ -114,8 +115,8 @@ public class PsTaskController extends BaseController {
|
||||
@Log(title = "主任务完成")
|
||||
@SaCheckPermission("business:task:list")
|
||||
@GetMapping("/mainFinish")
|
||||
public R<Void> mainFinish(@NotNull Long id) {
|
||||
contractInfoService.finish(psTaskMainService.finishMain(id));
|
||||
public R<Void> mainFinish(@NotNull Long id, Date firstFilingTime) {
|
||||
contractInfoService.finish(psTaskMainService.finishMain(id, firstFilingTime));
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ public class PsTaskWorkRecordController extends BaseController {
|
||||
* 根据任务委派id查询工作进度列表
|
||||
*/
|
||||
@Log(title = "根据任务委派id查询工作进度列表")
|
||||
@SaCheckPermission("business:taskWorkRecord:list")
|
||||
// @SaCheckPermission("business:taskWorkRecord:list")
|
||||
@GetMapping("/list")
|
||||
public R<List<PsTaskWorkRecordVo>> list(@NotNull Long id) {
|
||||
return R.ok(psTaskWorkRecordService.queryListByAppointId(id));
|
||||
@ -51,7 +51,7 @@ public class PsTaskWorkRecordController extends BaseController {
|
||||
* 根据主任务id查询工作进度列表
|
||||
*/
|
||||
@Log(title = "根据主任务id查询工作进度列表")
|
||||
@SaCheckPermission("business:taskWorkRecord:listByTaskId")
|
||||
// @SaCheckPermission("business:taskWorkRecord:listByTaskId")
|
||||
@GetMapping("/listByTaskId")
|
||||
public R<List<PsTaskWorkRecordVo>> listByTaskId(@NotNull Long id) {
|
||||
return R.ok(psTaskWorkRecordService.queryListByTaskId(id));
|
||||
|
@ -205,5 +205,8 @@ public class PsCompanyInfo extends TenantEntity {
|
||||
*/
|
||||
private Integer serviceStatus;
|
||||
|
||||
|
||||
/**
|
||||
* 首次申报时间
|
||||
*/
|
||||
private Date firstFilingTime;
|
||||
}
|
||||
|
@ -48,5 +48,4 @@ public class PsContractCompany extends TenantEntity {
|
||||
private String taskRemark;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -178,4 +178,9 @@ public class PsContractInfo extends TenantEntity {
|
||||
* 是否作废CommonStatusEnum
|
||||
*/
|
||||
private String isCancel;
|
||||
|
||||
/**
|
||||
* 0新客户 1老客户
|
||||
*/
|
||||
private byte isOldCus;
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package com.pusong.business.domain.bo;
|
||||
|
||||
import com.pusong.system.domain.bo.SysDictDataBo;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import io.swagger.v3.oas.annotations.media.PatternProperty;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
@ -5,6 +5,7 @@ import com.pusong.business.domain.PsCompanyInfo;
|
||||
import com.pusong.common.core.validate.AddGroup;
|
||||
import com.pusong.common.core.validate.EditGroup;
|
||||
import com.pusong.common.core.validate.QueryGroup;
|
||||
import com.pusong.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
@ -22,7 +23,7 @@ import java.util.Date;
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode
|
||||
public class PsCompanyQueryBo {
|
||||
public class PsCompanyQueryBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 公司ID
|
||||
@ -63,4 +64,6 @@ public class PsCompanyQueryBo {
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -163,6 +163,10 @@ public class PsContractInfoBo {
|
||||
*/
|
||||
private int firstPartyType;
|
||||
|
||||
/**
|
||||
* 0新客户 1老客户
|
||||
*/
|
||||
private byte isOldCus;
|
||||
|
||||
public enum FIRSTPARTYTYPE{
|
||||
COMPANY(1),
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.pusong.business.domain.bo;
|
||||
|
||||
import com.pusong.common.core.validate.QueryGroup;
|
||||
import com.pusong.common.mybatis.core.domain.BaseEntity;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@ -15,7 +16,7 @@ import java.util.List;
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode
|
||||
public class PsTaskQueryBo {
|
||||
public class PsTaskQueryBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
|
@ -276,4 +276,9 @@ public class PsCompanyInfoVo implements Serializable {
|
||||
* 公司类型
|
||||
*/
|
||||
private String companyType;
|
||||
|
||||
/**
|
||||
* 首次申报时间
|
||||
*/
|
||||
private Date firstFilingTime;
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 公司信息对象 ps_company_info
|
||||
@ -35,5 +36,4 @@ public class PsContractCompanyVo {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -38,10 +38,6 @@ public class PsContractCountVo implements Serializable {
|
||||
* 已付金额
|
||||
*/
|
||||
private BigDecimal payMoney;
|
||||
/**
|
||||
* 退款金额
|
||||
*/
|
||||
private BigDecimal returnMoney;
|
||||
|
||||
/**
|
||||
* 未付金额 = 所有已有回款合同的总金额 - 所有已有回款合同的已回款金额
|
||||
|
@ -272,6 +272,11 @@ public class PsContractInfoVo implements Serializable {
|
||||
*/
|
||||
private List<PsApproverRecordVo> lastApprover;
|
||||
|
||||
/**
|
||||
* 0新客户 1老客户
|
||||
*/
|
||||
private byte isOldCus;
|
||||
|
||||
/**
|
||||
* 服务项目里是否为 托管服务
|
||||
* @return
|
||||
|
@ -0,0 +1,38 @@
|
||||
package com.pusong.business.domain.vo.home;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class OldOrNewCusContractCountVo {
|
||||
/**
|
||||
* 当前时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private Date currentDate = new Date();
|
||||
/**
|
||||
* 统计范围
|
||||
*/
|
||||
private String dateStr;
|
||||
/**
|
||||
* 新客户 新签 数量
|
||||
*/
|
||||
private Long newContractNum;
|
||||
/**
|
||||
* 老客户 新签 数量
|
||||
*/
|
||||
private Long oldContractNum;
|
||||
|
||||
/**
|
||||
* 新客户 新签 占比
|
||||
*/
|
||||
private BigDecimal newContractPer;
|
||||
/**
|
||||
* 老客户 新签 占比
|
||||
*/
|
||||
private BigDecimal oldContractPer;
|
||||
|
||||
}
|
@ -36,4 +36,8 @@ public interface PsCompanyInfoMapper extends BaseMapperPlus<PsCompanyInfo, PsCom
|
||||
List<PsCompanyInfoVo> selectVoCustomManager(@Param(Constants.WRAPPER) Wrapper<PsCompanyInfo> queryWrapper, @Param("contractCode")String contractCode);
|
||||
|
||||
List<SysUserVo> selectFollowUser(@Param(Constants.WRAPPER) Wrapper<PsCompanyInfo> queryWrapper);
|
||||
|
||||
|
||||
|
||||
List<PsCompanyInfoVo> selectContractServiceCompany(@Param(Constants.WRAPPER) Wrapper<PsCompanyInfoVo> queryWrapper);
|
||||
}
|
||||
|
@ -26,6 +26,6 @@ public interface PsContractBusinessMapper extends BaseMapperPlus<PsContractBusin
|
||||
List<PsContractBusinessVo> selectTuoGuanBusinessList(@Param(Constants.WRAPPER) Wrapper<PsContractBusiness> queryWrapper);
|
||||
|
||||
|
||||
List<PsContractBusinessDetailVo> selectListByContractCodeAndComanyId(@Param(Constants.WRAPPER) Wrapper<PsContractBusiness> queryWrapper);
|
||||
List<PsContractBusinessDetailVo> selectListByContractCodeAndCompanyId(@Param(Constants.WRAPPER) Wrapper<PsContractBusiness> queryWrapper);
|
||||
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public interface PsContractInfoMapper extends BaseMapperPlus<PsContractInfo, PsC
|
||||
List<ChannelPayInfo> byChannel(@Param(Constants.WRAPPER) Wrapper<PsContractInfo> queryWrapper, Temporal startTime, Temporal endTime);
|
||||
//首页查询各个渠道成交的合同
|
||||
@DataPermission({
|
||||
@DataColumn(key = "userName", value = "info.custom_manager")
|
||||
@DataColumn(key = "userName", value = "info.custom_manager", dataScopeType = DataScopeType.SELF)
|
||||
})
|
||||
List<ChannelPayInfo> byChannelUser(@Param(Constants.WRAPPER) Wrapper<PsContractInfo> queryWrapper, Temporal startTime, Temporal endTime);
|
||||
|
||||
|
@ -30,7 +30,7 @@ public interface PsCustomInfoMapper extends BaseMapperPlus<PsCustomInfo, PsCusto
|
||||
List<PsCustomInfo> selectList(@Param(Constants.WRAPPER) Wrapper<PsCustomInfo> queryWrapper);
|
||||
|
||||
@DataPermission({
|
||||
@DataColumn(key = "deptName", value = "info.create_dept", dataScopeType = DataScopeType.CAIWU_HETONG),
|
||||
@DataColumn(key = {"deptName", "userName"}, value = {"info.create_dept", "info.custom_manager"}, dataScopeType = DataScopeType.CAIWU_HETONG),
|
||||
@DataColumn(key = "userName", value = "info.custom_manager")
|
||||
})
|
||||
Page<PsCustomInfoVo> selectPageCustomerList(@Param("page") Page<PsCustomInfo> page, @Param(Constants.WRAPPER) Wrapper<PsCustomInfo> queryWrapper);
|
||||
|
@ -28,25 +28,25 @@ public interface PsHomeMapper extends BaseMapperPlus<PsSalary, SalasVo> {
|
||||
int selectGonghaiNum(@Param("queryParam") Map<String, Object> queryParam);
|
||||
|
||||
@DataPermission({
|
||||
@DataColumn(key = "userName", value = "cus.custom_manager")
|
||||
@DataColumn(key = "userName", value = "cus.custom_manager", dataScopeType = DataScopeType.SELF)
|
||||
})
|
||||
int selectCallbackRecordNum(@Param("queryParam") Map<String, Object> queryParam);
|
||||
|
||||
|
||||
@DataPermission({
|
||||
@DataColumn(key = "userName", value = "cus.custom_manager")
|
||||
@DataColumn(key = "userName", value = "cus.custom_manager", dataScopeType = DataScopeType.SELF)
|
||||
})
|
||||
int selectNoCallbackRecordNum(@Param("queryParam") Map<String, Object> queryParam);
|
||||
|
||||
|
||||
@DataPermission({
|
||||
@DataColumn(key = "userName", value = "info.custom_manager")
|
||||
@DataColumn(key = "userName", value = "info.custom_manager", dataScopeType = DataScopeType.SELF)
|
||||
})
|
||||
SalasVo selectContractNumAndAmount(@Param("queryParam") Map<String, Object> queryParam);
|
||||
|
||||
|
||||
@DataPermission({
|
||||
@DataColumn(key = "userName", value = "info.custom_manager")
|
||||
@DataColumn(key = "userName", value = "info.custom_manager", dataScopeType = DataScopeType.SELF)
|
||||
})
|
||||
BigDecimal selectSumPayContractAmount(@Param("queryParam") Map<String, Object> queryParam);
|
||||
}
|
||||
|
@ -16,6 +16,9 @@ public interface HomeService {
|
||||
|
||||
ReturnMoneyInfoVo returnMoney(Integer type);
|
||||
RenewalInfoVo renewal(Integer type);
|
||||
|
||||
OldOrNewCusContractCountVo contractNumByCusIsOld(Integer type);
|
||||
|
||||
UserAmountVo getUserContractSourceAmountsByDeptId(Integer type, int tabType);
|
||||
List<UserContractAmountVo> getUserContractAmountsByDeptId(Integer type, Long deptId);
|
||||
UserAmountVo getUserContractAndPayInfo(Integer type, int tabType);
|
||||
|
@ -60,6 +60,8 @@ public interface IPsApproverRecordService {
|
||||
Map<String, String> getLastFail(List<String> businessIds, List<String> businessTypes);
|
||||
|
||||
Map<String, List<PsApproverRecordVo>> getLastRecord(List<String> contractCodes, List<String> businessTypes);
|
||||
|
||||
Map<String, List<PsApproverRecordVo>> getLastRecordByBus(List<String> businessIds, List<String> businessTypes);
|
||||
//
|
||||
// /**
|
||||
// * 新增审批记录
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.pusong.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pusong.business.domain.PsCustomCallback;
|
||||
import com.pusong.business.domain.PsCustomInfo;
|
||||
import com.pusong.business.domain.bo.PsCustomCallbackBo;
|
||||
@ -31,7 +32,7 @@ public interface IPsCustomInfoService {
|
||||
* 查询登陆人下所有的客户名称和id
|
||||
* @return 客户id和姓名
|
||||
*/
|
||||
List<Map<String,Object>> listByLoginUser(String name, PageQuery pageQuery);
|
||||
TableDataInfo listByLoginUser(String customName, String customMobile, String companyName, PageQuery pageQuery);
|
||||
/**
|
||||
* 分页查询客户基本信息列表
|
||||
*
|
||||
|
@ -16,6 +16,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -104,7 +105,7 @@ public interface IPsTaskService {
|
||||
* @param id 任务主键id
|
||||
* @return
|
||||
*/
|
||||
String finishMain(Long id);
|
||||
String finishMain(Long id, Date firstFilingTime);
|
||||
/**
|
||||
* 子任务完成
|
||||
*
|
||||
|
@ -15,6 +15,7 @@ import com.pusong.business.enums.ApproverStatusEnum;
|
||||
import com.pusong.business.enums.ApproverTypeEnum;
|
||||
import com.pusong.business.enums.PayStatusEnum;
|
||||
import com.pusong.business.mapper.PsApproverRecordMapper;
|
||||
import com.pusong.business.mapper.PsCompanyInfoMapper;
|
||||
import com.pusong.business.mapper.PsContractPayMapper;
|
||||
import com.pusong.business.service.IPsCompanyInfoService;
|
||||
import com.pusong.business.service.approver.ApproverContainer;
|
||||
@ -34,6 +35,8 @@ import jakarta.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 审批记录Service接口
|
||||
@ -54,6 +57,8 @@ public abstract class ApproverAbstractServiceImpl implements ApproverService {
|
||||
private IPsCompanyInfoService companyInfoService;
|
||||
@Resource
|
||||
private ISysNoticeService noticeService;
|
||||
@Resource
|
||||
private PsCompanyInfoMapper companyInfoMapper;
|
||||
/**
|
||||
* 通用申请方法
|
||||
* @param bussinessId
|
||||
@ -129,18 +134,28 @@ public abstract class ApproverAbstractServiceImpl implements ApproverService {
|
||||
}
|
||||
Page<PsApproverRecordVo> res = recordMapper.selectPageApproverList(pageQuery.build(), lqw, bo.getPay());
|
||||
|
||||
List<String> codes = res.getRecords().stream().map(PsApproverRecordVo::getContractCode).toList();
|
||||
|
||||
QueryWrapper<PsCompanyInfoVo> wq = Wrappers.<PsCompanyInfoVo>query()
|
||||
.eq("com.del_flag", "0")
|
||||
.eq("pcc.del_flag","0")
|
||||
.in("pcc.contract_code", codes);
|
||||
List<PsCompanyInfoVo> list = companyInfoMapper.selectContractServiceCompany(wq);
|
||||
Map<String, List<PsCompanyInfoVo>> contractCompanyMap = list.stream().collect(Collectors.groupingBy(PsCompanyInfoVo::getContractCode));
|
||||
|
||||
|
||||
if(CollectionUtils.isNotEmpty(res.getRecords())){
|
||||
res.getRecords().forEach(item->{
|
||||
if (item.getContractAmount() != null)
|
||||
item.setResidualMoney(item.getContractAmount().subtract(item.getPayMoney()));
|
||||
//装填回款周期
|
||||
List<PsContractPayVo> payList = queryListByContractCode(item.getContractCode(),"1", PayStatusEnum.SUCCESS);
|
||||
if(CollectionUtils.isNotEmpty(payList)){
|
||||
item.setPeriod(DateUtils.calWorkDate(payList.get(0).getPayDate(),payList.get(payList.size()-1).getPayDate()));
|
||||
}
|
||||
// List<PsContractPayVo> payList = queryListByContractCode(item.getContractCode(),"1", PayStatusEnum.SUCCESS);
|
||||
// if(CollectionUtils.isNotEmpty(payList)){
|
||||
// item.setPeriod(DateUtils.calWorkDate(payList.get(0).getPayDate(), payList.get(payList.size() - 1).getPayDate()));
|
||||
// }
|
||||
//装填服务公司信息
|
||||
List<PsCompanyInfoVo> list = companyInfoService.getServiceCompany(item.getContractCode());
|
||||
item.setServicePsCompanyInfoVo(list);
|
||||
// List<PsCompanyInfoVo> list = companyInfoService.getServiceCompany(item.getContractCode());
|
||||
item.setServicePsCompanyInfoVo(contractCompanyMap.get(item.getContractCode()));
|
||||
});
|
||||
}
|
||||
return res;
|
||||
@ -155,7 +170,9 @@ public abstract class ApproverAbstractServiceImpl implements ApproverService {
|
||||
* @return
|
||||
*/
|
||||
public List<PsContractPayVo> queryListByContractCode(String contractCode, String business, PayStatusEnum enu){
|
||||
if(StringUtils.isBlank(contractCode)){return new ArrayList<>();}
|
||||
if(StringUtils.isBlank(contractCode)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<PsContractPayVo> list = baseMapper.selectVoList(Wrappers.<PsContractPay>lambdaQuery().
|
||||
eq(PsContractPay::getContractCode, contractCode).eq(PsContractPay::getDelFlag,0)
|
||||
.eq(StringUtils.isNotBlank(business),PsContractPay::getBusinessType,business)
|
||||
|
@ -310,6 +310,46 @@ public class HomeServiceImpl implements HomeService {
|
||||
return renewalInfoVo;
|
||||
}
|
||||
|
||||
public OldOrNewCusContractCountVo contractNumByCusIsOld(Integer type){
|
||||
Map<String, Object> mapParam = this.getDate(type);
|
||||
LocalDate startDate = (LocalDate)mapParam.get("startDate");
|
||||
LocalDate endDate = (LocalDate)mapParam.get("endDate");
|
||||
String date = (String)mapParam.get("date");
|
||||
|
||||
OldOrNewCusContractCountVo ret = new OldOrNewCusContractCountVo();
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("is_old_cus", 1);
|
||||
queryWrapper.eq("is_due", "0");
|
||||
queryWrapper.ge(startDate != null,"apply_date", startDate)
|
||||
.lt(endDate != null,"apply_date", endDate);
|
||||
Long oldCusNum = psContractInfoMapper.selectCount(queryWrapper);
|
||||
|
||||
|
||||
queryWrapper.clear();
|
||||
queryWrapper.eq("is_old_cus", 0);
|
||||
queryWrapper.eq("is_due", "0");
|
||||
queryWrapper.ge(startDate != null,"apply_date", startDate)
|
||||
.lt(endDate != null,"apply_date", endDate);
|
||||
Long newCusNum = psContractInfoMapper.selectCount(queryWrapper);
|
||||
|
||||
long sum = oldCusNum + newCusNum;
|
||||
|
||||
ret.setOldContractNum(oldCusNum);
|
||||
ret.setNewContractNum(newCusNum);
|
||||
if (oldCusNum != 0){
|
||||
ret.setOldContractPer(new BigDecimal(oldCusNum).divide(new BigDecimal(sum), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)));
|
||||
} else{
|
||||
ret.setOldContractPer(new BigDecimal(0));
|
||||
}
|
||||
if (newCusNum != 0){
|
||||
ret.setNewContractPer((new BigDecimal(100).subtract(ret.getOldContractPer())));
|
||||
} else{
|
||||
ret.setNewContractPer(new BigDecimal(0));
|
||||
}
|
||||
|
||||
ret.setDateStr(date);
|
||||
return ret;
|
||||
}
|
||||
private String contractSource = "转介绍";
|
||||
/**
|
||||
* 按人员成交【转介绍】列表,根据部门获取
|
||||
|
@ -149,13 +149,13 @@ public class PsApproverRecordServiceImpl implements IPsApproverRecordService {
|
||||
*/
|
||||
public String getLastFail(String businessId, String contractCode, List<String> businessTypes){
|
||||
PsApproverRecord record = baseMapper.selectOne(Wrappers.<PsApproverRecord>lambdaQuery()
|
||||
.select(PsApproverRecord::getApproverStatus,PsApproverRecord::getApproverDesc)
|
||||
.select(PsApproverRecord::getApproverStatus, PsApproverRecord::getApproverDesc)
|
||||
.eq(StringUtils.isNotBlank(businessId), PsApproverRecord::getBusinessId, businessId)
|
||||
.eq(StringUtils.isNotBlank(contractCode), PsApproverRecord::getContractCode, contractCode)
|
||||
.in(CollectionUtils.isNotEmpty(businessTypes), PsApproverRecord::getBusinessType, businessTypes)
|
||||
.orderByDesc(PsApproverRecord::getApplyDate).last("limit 1"));
|
||||
return record!=null&&StringUtils.equals(ApproverStatusEnum.FAIL.getCode(),record.getApproverStatus())
|
||||
?record.getApproverDesc():null;
|
||||
return record != null && StringUtils.equals(ApproverStatusEnum.FAIL.getCode(), record.getApproverStatus())
|
||||
? record.getApproverDesc() : null;
|
||||
}
|
||||
|
||||
public Map<String, String> getLastFail(List<String> businessIds, List<String> businessTypes){
|
||||
@ -184,7 +184,9 @@ public class PsApproverRecordServiceImpl implements IPsApproverRecordService {
|
||||
return new HashMap<>();
|
||||
}
|
||||
QueryWrapper<PsApproverRecord> qw = Wrappers.query();
|
||||
qw.in("r.contract_code", contractCodes)
|
||||
|
||||
qw
|
||||
.in("r.contract_code", contractCodes)
|
||||
.in("r.business_type", businessTypes);
|
||||
List<PsApproverRecordVo> record = baseMapper.getLastFail(qw);
|
||||
|
||||
@ -195,6 +197,23 @@ public class PsApproverRecordServiceImpl implements IPsApproverRecordService {
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public Map<String, List<PsApproverRecordVo>> getLastRecordByBus(List<String> businessIds, List<String> businessTypes){
|
||||
if (businessIds.isEmpty()){
|
||||
return new HashMap<>();
|
||||
}
|
||||
QueryWrapper<PsApproverRecord> qw = Wrappers.query();
|
||||
|
||||
qw.in("r.business_id", businessIds).in("r.business_type", businessTypes);
|
||||
List<PsApproverRecordVo> record = baseMapper.getLastFail(qw);
|
||||
|
||||
Map<String, List<PsApproverRecordVo>> map = new HashMap<>();
|
||||
for (PsApproverRecordVo v : record) {
|
||||
List<PsApproverRecordVo> psApproverRecordVos = map.computeIfAbsent(v.getBusinessId(), s -> new ArrayList<>());
|
||||
psApproverRecordVos.add(v);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
// /**
|
||||
// * 新增审批记录
|
||||
// *
|
||||
|
@ -154,6 +154,8 @@ public class PsCompanyInfoServiceImpl implements IPsCompanyInfoService {
|
||||
lqw.like(bo.getCompanyName() != null,"com.company_name", bo.getCompanyName());
|
||||
lqw.eq(bo.getServiceStatus() != null,"com.service_status", bo.getServiceStatus());
|
||||
|
||||
lqw.between(bo.getParams().get("beginTime") != null && bo.getParams().get("endTime") != null,
|
||||
"com.first_filing_time", bo.getParams().get("beginTime"), bo.getParams().get("endTime"));
|
||||
|
||||
|
||||
String followUserSql = "";
|
||||
@ -188,6 +190,7 @@ public class PsCompanyInfoServiceImpl implements IPsCompanyInfoService {
|
||||
lqw.exists(bo.getType() != 1, sql.toString());
|
||||
lqw.orderByAsc("CASE WHEN bus.min_end_date IS NULL THEN 1 ELSE 0 END, bus.min_end_date");
|
||||
lqw.orderByDesc("finish_date");
|
||||
|
||||
// lqw.groupBy("com.id");
|
||||
Page<PsCompanyInfoVo> result = baseMapper.selectPageList2(pageQuery.build(), lqw);
|
||||
if (!result.getRecords().isEmpty()){
|
||||
@ -225,7 +228,6 @@ public class PsCompanyInfoServiceImpl implements IPsCompanyInfoService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
|
@ -393,7 +393,6 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
||||
bo.setInContractStatus(List.of(ContractStatusEnum.SUCCESS.getCode()));
|
||||
log.info("托管服务");
|
||||
}
|
||||
|
||||
QueryWrapper<PsContractInfo> lqw = buildQueryWrapper(bo);
|
||||
Page<PsContractInfoVo> result = baseMapper.selectPageContractList(pageQuery.build(), lqw);
|
||||
if(CollectionUtils.isEmpty(result.getRecords())){
|
||||
@ -738,8 +737,23 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
||||
List<PsContractBusinessBo> detailBos = new ArrayList<>();
|
||||
for (PsCompanyInfoBo psCompanyInfoBo : bo.getServiceCompanyInfoList()) {
|
||||
for (PsContractBusinessBo item : psCompanyInfoBo.getBusinessList()) {
|
||||
item.setBusinessTypeName(dictDataService.selectDictLabel("contract_type",item.getBusinessType()));
|
||||
SysDictData contractType = dictDataService.selectDict("contract_type", item.getBusinessType());
|
||||
item.setBusinessTypeName(contractType.getDictLabel());
|
||||
detailBos.add(item);
|
||||
|
||||
for (PsContractBusinessDetailBo detailBo : item.getDetailBos()) {
|
||||
contractType = dictDataService.selectDict("service_project", detailBo.getBusinessProject());
|
||||
String dictLabel = contractType.getDictLabel();
|
||||
String remark = contractType.getRemark();
|
||||
if (!StringUtils.isEmpty(remark)){
|
||||
JSONObject jsonObject = JSONObject.parseObject(remark);
|
||||
String extend = jsonObject.getString("extend");
|
||||
if (extend != null){
|
||||
dictLabel += extend;
|
||||
}
|
||||
}
|
||||
detailBo.setBusinessProjectLabel(dictLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,21 +72,37 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
||||
* @return 客户id和姓名
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String,Object>> listByLoginUser(String name, PageQuery pageQuery) {
|
||||
public TableDataInfo listByLoginUser(String customName, String customMobile, String companyName, PageQuery pageQuery) {
|
||||
//查询客户基本信息
|
||||
Page<PsCustomInfoVo> list = baseMapper.selectVoPage(pageQuery.build()
|
||||
Page<PsCustomInfoVo> list = baseMapper.selectPageCustomerList(pageQuery.build()
|
||||
, new QueryWrapper<PsCustomInfo>()
|
||||
.select("id", "custom_name", "custom_mobile", "create_time", "custom_source")
|
||||
.lambda().eq(PsCustomInfo::getDelFlag, 0).isNotNull(PsCustomInfo::getCustomName).ne(PsCustomInfo::getCustomName,"").ne(PsCustomInfo::getCustomName,"无")
|
||||
.and(StringUtils.isNotBlank(name), wq->wq.like(PsCustomInfo::getCustomName,name).or().like(PsCustomInfo::getCustomMobile,name)));
|
||||
// .select("id", "custom_name", "custom_mobile", "create_time", "custom_source")
|
||||
// .lambda()
|
||||
.eq("info.del_flag", 0)
|
||||
.isNotNull("info.custom_name")
|
||||
.ne("info.custom_name","")
|
||||
.ne("info.custom_name","无")
|
||||
.and(StringUtils.isNotBlank(customName) || StringUtils.isNotBlank(customMobile) || StringUtils.isNotBlank(companyName)
|
||||
, wq -> wq.like(StringUtils.isNotBlank(customName), "info.custom_name", customName)
|
||||
.or()
|
||||
.like(StringUtils.isNotBlank(customMobile), "info.custom_mobile", customMobile)
|
||||
.or()
|
||||
.exists(StringUtils.isNotBlank(companyName), "select 1 from ps_company_info where ps_company_info.custom_id = ps_custom_info.id and ps_company_info.del_flag = 0 and company_type = 2 and company_name like '%" + companyName + "%'")
|
||||
|
||||
));
|
||||
if (list.getRecords().isEmpty()){
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setRows(null);
|
||||
tableDataInfo.setTotal(0);
|
||||
return tableDataInfo;
|
||||
}
|
||||
List<Long> ids = list.getRecords().stream().map(PsCustomInfoVo::getId).collect(Collectors.toList());
|
||||
|
||||
//查询公司信息
|
||||
List<PsCompanyInfoVo> companyInfoVos = companyInfoMapper.selectVoList(Wrappers.<PsCompanyInfo>lambdaQuery()
|
||||
.in(PsCompanyInfo::getCustomId, ids)
|
||||
.eq(PsCompanyInfo::getDelFlag, 0)
|
||||
.eq(PsCompanyInfo::getCompanyType, "2")
|
||||
// .eq(PsCompanyInfo::getCompanyType, "2")
|
||||
);
|
||||
Map<Long, List<PsCompanyInfoVo>> id_companyMap = new HashMap<>();
|
||||
if(CollectionUtils.isNotEmpty(companyInfoVos)){
|
||||
@ -98,6 +114,8 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
List<Map<String,Object>> listmap = new ArrayList<>();
|
||||
for (PsCustomInfoVo item : list.getRecords()) {
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
@ -106,11 +124,32 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
||||
map.put("custom_mobile", item.getCustomMobile());
|
||||
map.put("createTime", DateUtils.toString(item.getCreateTime(),"yyyy-MM-dd"));
|
||||
map.put("customSource", item.getCustomSource());
|
||||
map.put("psCompanySerivceVo", id_companyMap.get(item.getId()));
|
||||
|
||||
|
||||
|
||||
List<PsCompanyInfoVo> allPsCompanyInfoVos = id_companyMap.get(item.getId());
|
||||
if (allPsCompanyInfoVos != null){
|
||||
List<PsCompanyInfoVo> psCompanyInfoVos = new ArrayList<>();
|
||||
List<PsCompanyInfoVo> psServiceCompanyInfoVos = new ArrayList<>();
|
||||
for (PsCompanyInfoVo psCompanyInfoVo : allPsCompanyInfoVos) {
|
||||
if ("1".equals(psCompanyInfoVo.getCompanyType())){
|
||||
psCompanyInfoVos.add(psCompanyInfoVo);
|
||||
}else if ("2".equals(psCompanyInfoVo.getCompanyType())){
|
||||
psServiceCompanyInfoVos.add(psCompanyInfoVo);
|
||||
}
|
||||
}
|
||||
map.put("psCompanySerivceVo", psServiceCompanyInfoVos);
|
||||
map.put("psCompanyVo", psCompanyInfoVos);
|
||||
}
|
||||
|
||||
|
||||
listmap.add(map);
|
||||
}
|
||||
|
||||
return listmap;
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setRows(listmap);
|
||||
tableDataInfo.setTotal(list.getTotal());
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -11,11 +11,8 @@ import com.pusong.business.domain.bo.MediaCompanySaveBo;
|
||||
import com.pusong.business.domain.bo.PsTaskMediaBo;
|
||||
import com.pusong.business.domain.bo.PsTaskQueryBo;
|
||||
import com.pusong.business.domain.vo.*;
|
||||
import com.pusong.business.enums.ApproverTypeEnum;
|
||||
import com.pusong.business.enums.ContractStatusEnum;
|
||||
import com.pusong.business.enums.TaskStatusEnum;
|
||||
import com.pusong.business.enums.*;
|
||||
import com.pusong.business.enums.TaskStatusEnum.AppointStatusEnum;
|
||||
import com.pusong.business.enums.TaskTypeEnum;
|
||||
import com.pusong.business.mapper.*;
|
||||
import com.pusong.business.service.*;
|
||||
import com.pusong.business.service.approver.ApproverContainer;
|
||||
@ -79,7 +76,7 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
private final IPsContractInfoService contractInfoService;
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
private final PsCompanyInfoMapper companyInfoMapper;
|
||||
/**
|
||||
* 新增主任务
|
||||
*
|
||||
@ -123,6 +120,21 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
// lqw.orderByAsc("assigned");
|
||||
lqw.orderByDesc("main.create_time");
|
||||
page = baseMapper.queryTaskPageList(pageQuery.build(), lqw);
|
||||
|
||||
if (page.getSize() > 0){
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
List<Long> list = page.getRecords().stream().map(PsTaskMainVo::getId).toList();
|
||||
queryWrapper.in("task_id", list);
|
||||
queryWrapper.ne("appoint_status", "50");
|
||||
queryWrapper.eq("del_flag", "0");
|
||||
List<PsTaskAppointVo> taskAppointVos = appointMapper.selectVoList(queryWrapper);
|
||||
LinkedHashMap<Long, List<PsTaskAppointVo>> collect = taskAppointVos.stream().collect(Collectors.groupingBy(PsTaskAppointVo::getTaskId, LinkedHashMap::new, Collectors.toList()));
|
||||
for (PsTaskMainVo record : page.getRecords()) {
|
||||
record.setPsTaskAppointVoList(collect.get(record.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
fillInfo(page);
|
||||
@ -132,30 +144,33 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
}
|
||||
|
||||
private void fillInfo(Page<PsTaskMainVo> page) {
|
||||
String contractCode = null;
|
||||
if (page.getRecords().isEmpty()){
|
||||
return;
|
||||
}
|
||||
Map<String, List<PsContractBusinessDetailVo>> busMap = new HashMap<>();
|
||||
List<Long> serviceCompanyIdList = page.getRecords().stream().map(PsTaskMainVo::getServiceCompanyId).toList();
|
||||
List<String> contractCodeList = page.getRecords().stream().map(PsTaskMainVo::getContractCode).toList();
|
||||
// List<String> taskIdList = page.getRecords().stream().map(PsTaskMainVo::getId).map(Object::toString).toList();
|
||||
|
||||
QueryWrapper<PsContractBusiness> objectQueryWrapper = new QueryWrapper<PsContractBusiness>()
|
||||
.in("bus.contract_code", contractCodeList)
|
||||
.in("bus.company_id", serviceCompanyIdList);
|
||||
List<PsContractBusinessDetailVo> psContractBusinesses = businessMapper.selectListByContractCodeAndComanyId(objectQueryWrapper);
|
||||
List<PsContractBusinessDetailVo> psContractBusinesses = businessMapper.selectListByContractCodeAndCompanyId(objectQueryWrapper);
|
||||
|
||||
for (PsContractBusinessDetailVo psContractBusiness : psContractBusinesses) {
|
||||
List<PsContractBusinessDetailVo> psContractBusinesses1 = busMap.computeIfAbsent(psContractBusiness.getContractCode() + "_" + psContractBusiness.getCompanyId(), a -> new ArrayList<>());
|
||||
psContractBusinesses1.add(psContractBusiness);
|
||||
}
|
||||
|
||||
// Map<String, List<PsApproverRecordVo>> lastFailMap = approverRecordService.getLastRecordByBus( taskIdList
|
||||
// , List.of(ApproverTypeEnum.TASKCANCE.getCode()));
|
||||
|
||||
for (PsTaskMainVo vo : page.getRecords()) {
|
||||
if(vo.getStartDate() != null){
|
||||
vo.setNumOfDat(DateUtils.calWorkDate(vo.getCreateTime(), new Date()));
|
||||
}
|
||||
//任务作废审批
|
||||
vo.setTaskStatusDesc(approverRecordService.getLastFail(vo.getId() + "",null,List.of(ApproverTypeEnum.TASKCANCE.getCode())));
|
||||
// vo.setTaskStatusDesc(approverRecordService.getLastFail(vo.getId() + "",null, List.of(ApproverTypeEnum.TASKCANCE.getCode())));
|
||||
|
||||
//装填服务公司信息
|
||||
if (vo.getServiceCompanyId() != null){
|
||||
@ -168,6 +183,14 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
vo.setBusinessTypeName(vo.getBusinessType());
|
||||
}
|
||||
|
||||
// List<PsApproverRecordVo> psApproverRecordVos = lastFailMap.get(vo.getId());
|
||||
// if (psApproverRecordVos != null && !psApproverRecordVos.isEmpty()) {
|
||||
// PsApproverRecordVo record = psApproverRecordVos.get(0);
|
||||
// String s = record != null && StringUtils.equals(ApproverStatusEnum.FAIL.getCode(), record.getApproverStatus())
|
||||
// ? record.getApproverDesc() : null;
|
||||
// vo.setTaskStatusDesc(s);
|
||||
// }
|
||||
|
||||
vo.setPsContractBusinesses(busMap.get(vo.getContractCode() + "_" + vo.getServiceCompanyId()));
|
||||
}
|
||||
|
||||
@ -198,10 +221,12 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
lqw.eq("appo.del_flag","0");
|
||||
lqw.ne(StringUtils.isBlank(bo.getTaskStatus()), "main.task_status", TaskStatusEnum.CANCEL.getCode());
|
||||
lqw.exists(StringUtils.isNotBlank(ex), "select 1 from sys_user su where appo.executor = su.user_id and su.nick_name like '%" + ex + "%'");
|
||||
lqw.eq("appo.appoint_type",bo.getAppointType());
|
||||
lqw.eq(id != null,"appo.id",id);
|
||||
lqw.eq("appo.appoint_type", bo.getAppointType());
|
||||
lqw.eq(id != null,"appo.id", id);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAppointStatus()),"appo.appoint_status", bo.getAppointStatus());
|
||||
|
||||
lqw.orderByDesc("appo.create_time");
|
||||
|
||||
Page<PsTaskMainVo> page = baseMapper.queryChildTaskPageList(pageQuery.build(), lqw);
|
||||
fillInfo(page);
|
||||
|
||||
@ -429,7 +454,7 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
* @param id 任务主键id
|
||||
* @return
|
||||
*/
|
||||
public String finishMain(Long id){
|
||||
public String finishMain(Long id, Date firstFilingTime){
|
||||
PsTaskMain main = baseMapper.selectById(id);
|
||||
if(!TaskStatusEnum.canFinish(main.getTaskStatus())){
|
||||
throw new ServiceException("此任务无法执行此操作,请刷新页面后重新操作");
|
||||
@ -447,6 +472,14 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
PsContractInfoVo contract = contractInfoService.queryContractByCode(main.getContractCode());
|
||||
noticeService.sendNotice(SysNoticeBo.getTaskFinishInstance(contract.getCustomManager(), contract.getPsCustomInfoVo().getCustomName()));
|
||||
|
||||
|
||||
// QueryWrapper<PsContractCompany> queryWrapper = new QueryWrapper();
|
||||
// queryWrapper.eq("id", main.getServiceCompanyId());
|
||||
PsCompanyInfo psContractCompany = new PsCompanyInfo();
|
||||
psContractCompany.setId(main.getServiceCompanyId());
|
||||
psContractCompany.setFirstFilingTime(firstFilingTime);
|
||||
companyInfoMapper.updateById(psContractCompany);
|
||||
|
||||
return main.getContractCode();
|
||||
}
|
||||
/**
|
||||
@ -636,16 +669,16 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
lqw.in(bo.getExtendList() != null && !bo.getExtendList().isEmpty(),"main.extend", bo.getExtendList());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getContractCode()), "main.contract_code", bo.getContractCode());
|
||||
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCompanyName()), "com.company_name", bo.getCompanyName());//公司名称
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCompanyName()), "scom.company_name", bo.getCompanyName());//公司名称
|
||||
lqw.like(StringUtils.isNotBlank(bo.getServiceCompanyName()), "scom.company_name", bo.getServiceCompanyName());//公司名称
|
||||
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomerNum()), "com.customer_num", bo.getCustomerNum());//纳税人识别号
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomerCert()), "com.customer_cert", bo.getCustomerCert());//纳税人资格
|
||||
// lqw.like(StringUtils.isNotBlank(bo.getCustomerNum()), "com.customer_num", bo.getCustomerNum());//纳税人识别号
|
||||
// lqw.eq(StringUtils.isNotBlank(bo.getCustomerCert()), "com.customer_cert", bo.getCustomerCert());//纳税人资格
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomManagerName()), "usr.nick_name", bo.getCustomManagerName());//销售经理姓名
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCompanyAdress()), "com.company_adress", bo.getCompanyAdress());//公司地址
|
||||
lqw.like(StringUtils.isNotBlank(bo.getMobile()), "com.legal_person_phone", bo.getMobile());//法人手机号
|
||||
lqw.like(StringUtils.isNotBlank(bo.getIdNo()), "com.legal_person_idcard", bo.getIdNo());//法人身份证
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), "com.legal_person_name", bo.getName());//法人姓名
|
||||
// lqw.like(StringUtils.isNotBlank(bo.getCompanyAdress()), "com.company_adress", bo.getCompanyAdress());//公司地址
|
||||
// lqw.like(StringUtils.isNotBlank(bo.getMobile()), "com.legal_person_phone", bo.getMobile());//法人手机号
|
||||
// lqw.like(StringUtils.isNotBlank(bo.getIdNo()), "com.legal_person_idcard", bo.getIdNo());//法人身份证
|
||||
// lqw.like(StringUtils.isNotBlank(bo.getName()), "com.legal_person_name", bo.getName());//法人姓名
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomName()), "scom.contact_person_name", bo.getCustomName());//客户姓名
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomMobile()), "scom.contact_person_phone", bo.getCustomMobile());//客户电话
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomScene()), "con.custom_scene", bo.getCustomScene());//是否到达现场
|
||||
@ -666,9 +699,10 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
.or()
|
||||
.likeLeft("cus.custom_mobile", bo.getAppKeyWord())
|
||||
.or()
|
||||
.exists("com.company_name", bo.getAppKeyWord())
|
||||
.like("scom.company_name", bo.getAppKeyWord())
|
||||
);
|
||||
|
||||
lqw.between(bo.getParams().get("beginTime") != null && bo.getParams().get("endTime") != null,
|
||||
"main.create_time", bo.getParams().get("beginTime"), bo.getParams().get("endTime"));
|
||||
|
||||
return lqw;
|
||||
}
|
||||
|
@ -130,6 +130,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
left join ps_contract_business_detail det on det.business_id = bus.id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectContractServiceCompany" resultMap="serviceCompanyServiceResult2">
|
||||
select pcc.contract_code,com.*
|
||||
from ps_contract_company pcc
|
||||
inner join ps_company_info com on pcc.company_id = com.id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectFollowUser" resultType="com.pusong.system.domain.vo.SysUserVo">
|
||||
select u.*,cf.company_id from ps_company_follow cf
|
||||
inner join sys_user u on u.user_id = cf.user_id
|
||||
|
@ -52,11 +52,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where cc.company_id = ${companyId}
|
||||
</select>
|
||||
|
||||
<select id="selectListByContractCodeAndComanyId" resultType="com.pusong.business.domain.vo.PsContractBusinessDetailVo">
|
||||
<select id="selectListByContractCodeAndCompanyId" resultType="com.pusong.business.domain.vo.PsContractBusinessDetailVo">
|
||||
select
|
||||
detail.*,
|
||||
bus.company_id
|
||||
from ps_contract_business bus
|
||||
left join ps_contract_business_detail detail on bus.id = detail.business_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -16,10 +16,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<collection columnPrefix="appoint_" property="psTaskAppointVoList" ofType="com.pusong.business.domain.vo.PsTaskAppointVo" >
|
||||
</collection>
|
||||
|
||||
<collection property="psTaskAppointVoList" javaType="ArrayList"
|
||||
column="mainid" ofType="com.pusong.business.domain.vo.PsTaskAppointVo"
|
||||
select="queryByMainId" fetchType="eager">
|
||||
</collection>
|
||||
<!-- <collection property="psTaskAppointVoList" javaType="ArrayList"-->
|
||||
<!-- column="mainid" ofType="com.pusong.business.domain.vo.PsTaskAppointVo"-->
|
||||
<!-- select="queryByMainId" fetchType="eager">-->
|
||||
<!-- </collection>-->
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
@ -79,7 +79,6 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser, SysUserVo> {
|
||||
|
||||
@Override
|
||||
@DataPermission({
|
||||
@DataColumn(key = "deptName", value = "dept_id"),
|
||||
@DataColumn(key = "userName", value = "user_id")
|
||||
})
|
||||
int update(@Param(Constants.ENTITY) SysUser user, @Param(Constants.WRAPPER) Wrapper<SysUser> updateWrapper);
|
||||
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pusong.common.json.TranslationThreadLocal;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.pusong.common.core.constant.CacheNames;
|
||||
import com.pusong.common.core.exception.ServiceException;
|
||||
@ -25,6 +26,7 @@ import com.pusong.system.domain.vo.SysDictTypeVo;
|
||||
import com.pusong.system.mapper.SysDictDataMapper;
|
||||
import com.pusong.system.mapper.SysDictTypeMapper;
|
||||
import com.pusong.system.service.ISysDictTypeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cache.annotation.CachePut;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -43,6 +45,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService {
|
||||
|
||||
private final SysDictTypeMapper baseMapper;
|
||||
@ -217,7 +220,15 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
|
||||
*/
|
||||
@Override
|
||||
public String getDictLabel(String dictType, String dictValue, String separator) {
|
||||
List<SysDictDataVo> datas = SpringUtils.getAopProxy(this).selectDictDataByType(dictType);
|
||||
Object result = TranslationThreadLocal.getThreadInstance().get(dictType);
|
||||
List<SysDictDataVo> datas;
|
||||
if (result != null && result instanceof List){
|
||||
datas = (List<SysDictDataVo>)result;
|
||||
}else{
|
||||
datas = SpringUtils.getAopProxy(this).selectDictDataByType(dictType);
|
||||
TranslationThreadLocal.getThreadInstance().set(dictType, datas);
|
||||
}
|
||||
|
||||
Map<String, String> map = StreamUtils.toMap(datas, SysDictDataVo::getDictValue, SysDictDataVo::getDictLabel);
|
||||
if (StringUtils.containsAny(dictValue, separator)) {
|
||||
return Arrays.stream(dictValue.split(separator))
|
||||
|
Loading…
Reference in New Issue
Block a user