yangys
2024-03-27 e48aa2ac8dea1be5db11c63edf0b912c4ad5ce65
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.qianwen.smartman.modules.cps.service;
 
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import java.lang.invoke.SerializedLambda;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import com.qianwen.smartman.common.constant.ExtCacheConstant;
import com.qianwen.smartman.common.enums.GlobalWcsTypeEnum;
import com.qianwen.smartman.common.utils.Lambda;
import com.qianwen.smartman.modules.cps.entity.GlobalWcs;
import com.qianwen.smartman.modules.cps.vo.WcsAchievementsUpdateVO;
import com.qianwen.smartman.modules.cps.vo.WcsAndAchievementsVO;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
 
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/service/IGlobalWcsService.class */
public interface IGlobalWcsService extends IService<GlobalWcs> {
    @Cacheable(cacheNames = {ExtCacheConstant.GLOBAL_WCS}, key = "'list:type:'+#globalWcsTypeEnum.type")
    List<GlobalWcs> getGlobalWcsList(GlobalWcsTypeEnum globalWcsTypeEnum);
 
    List<WcsAndAchievementsVO> getWcsAndAchievements();
 
    @Cacheable(cacheNames = {ExtCacheConstant.GLOBAL_WCS}, key = "'code:'.concat(#code) + ':type:'.concat(#globalWcsTypeEnum.type)")
    GlobalWcs getByCode(String code, GlobalWcsTypeEnum globalWcsTypeEnum);
 
    @CacheEvict(cacheNames = {ExtCacheConstant.GLOBAL_WCS}, allEntries = true)
    void updateWcsAndAchievements(WcsAchievementsUpdateVO wcsAchievements);
 
    @CacheEvict(cacheNames = {ExtCacheConstant.GLOBAL_WCS}, allEntries = true)
    boolean insertWcsAndAchievements(WcsAchievementsUpdateVO wcsAchievementsUpdateVO);
 
 
    @CacheEvict(cacheNames = {ExtCacheConstant.GLOBAL_WCS}, allEntries = true)
    default boolean removeByCode(String code, GlobalWcsTypeEnum typeEnum) {
        return remove(Lambda.eq(GlobalWcs::getCode, code).eq(GlobalWcs::getType, typeEnum.getType()));
        /*
        return remove((Wrapper) Lambda.eq((v0) -> {
            return v0.getCode();
        }, code).eq((v0) -> {
            return v0.getType();
        }, typeEnum.getType()));*/
    }
 
    @CacheEvict(cacheNames = {ExtCacheConstant.GLOBAL_WCS}, allEntries = true)
    default void updateWcsSeq(List<String> codeList) {
        AtomicInteger seq = new AtomicInteger(1);
        
        codeList.forEach(code -> lambdaUpdate().set(GlobalWcs::getSeq, Integer.valueOf(seq.getAndIncrement())).eq(GlobalWcs::getCode, code).update());
        /*
        codeList.forEach(code -> {
            ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) lambdaUpdate().set((v0) -> {
                return v0.getSeq();
            }, Integer.valueOf(seq.getAndIncrement()))).eq((v0) -> {
                return v0.getCode();
            }, code)).update();
        });*/
    }
}