guoshilong
2023-05-30 bbaaa7dda42c73311c2cd526f7d31fcf4988a61c
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
61
62
63
64
65
66
67
68
package cn.gistack.sm.sjztmd.service.impl;
 
import cn.gistack.sm.sjztmd.entity.AttResStagChar;
import cn.gistack.sm.sjztmd.mapper.AttResStagCharMapper;
import cn.gistack.sm.sjztmd.service.IAttResStagCharService;
import cn.gistack.system.user.feign.IUserClient;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.shaded.com.google.gson.JsonObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.Date;
 
/**
 * @ClassName AttResStagCharServiceImpl
 * @Description TODO
 * @Author aix
 * @Date 2023/4/21 20:01
 * @Version 1.0
 */
@Service
@DS("zt")
public class AttResStagCharServiceImpl extends ServiceImpl<AttResStagCharMapper, AttResStagChar> implements IAttResStagCharService {
 
    @Autowired
    private IUserClient userClient;
 
    @Override
    public AttResStagChar getByResGuid(String resGuid) {
        return baseMapper.getByResGuid(resGuid);
    }
 
    @Override
    public Boolean customizeUpdateByGuid(AttResStagChar attResStagChar) {
        attResStagChar.setUpdateTime(DateUtil.now());
        JSONObject paramJson = new JSONObject();
        paramJson.put("time", DateUtil.format(new Date(),"yyyy-MM-dd"));
        String editPar = "";
        if (StringUtil.isNotBlank(attResStagChar.getTbChecFlStag()))
            editPar += ",tb_chec_fl_stag";
        if (StringUtil.isNotBlank(attResStagChar.getTbDeadStag()))
            editPar += ",tb_dead_stag";
        if (StringUtil.isNotBlank(attResStagChar.getTbDesFlStag()))
            editPar += ",tb_des_fl_stag";
        if (StringUtil.isNotBlank(attResStagChar.getTbFlprHighStag()))
            editPar += ",tb_flpr_high_stag";
        if (StringUtil.isNotBlank(attResStagChar.getTbNormPoolStag()))
            editPar += ",tb_norm_pool_stag";
        if (StringUtil.isNotBlank(attResStagChar.getTbDeadCap()))
            editPar += ",tb_dead_cap";
        if (StringUtil.isNotBlank(attResStagChar.getTbTotCap()))
            editPar += ",tb_tot_cap";
        paramJson.put("editPar", editPar);
        paramJson.put("ly", "ywxt");
        paramJson.put("user_id", AuthUtil.getUserId());
        paramJson.put("user_name", AuthUtil.getUserName());
        paramJson.put("phone", userClient.userInfoById(AuthUtil.getUserId()).getData().getPhone());
 
        attResStagChar.setUpdateBy(paramJson.toJSONString());
        return SqlHelper.retBool(baseMapper.customizeUpdateByGuid(attResStagChar));
    }
}