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:修改值为" + attResStagChar.getTbChecFlStag();
|
if (StringUtil.isNotBlank(attResStagChar.getTbDeadStag()))
|
editPar += ",tb_dead_stag:修改值为" + attResStagChar.getTbDeadStag();
|
if (StringUtil.isNotBlank(attResStagChar.getTbDesFlStag()))
|
editPar += ",tb_des_fl_stag:修改值为" + attResStagChar.getTbDesFlStag();
|
if (StringUtil.isNotBlank(attResStagChar.getTbFlprHighStag()))
|
editPar += ",tb_flpr_high_stag:修改值为" + attResStagChar.getTbFlprHighStag();
|
if (StringUtil.isNotBlank(attResStagChar.getTbNormPoolStag()))
|
editPar += ",tb_norm_pool_stag:修改值为" + attResStagChar.getTbNormPoolStag();
|
if (StringUtil.isNotBlank(attResStagChar.getTbDeadCap()))
|
editPar += ",tb_dead_cap:修改值为" + attResStagChar.getTbDeadCap();
|
if (StringUtil.isNotBlank(attResStagChar.getTbTotCap()))
|
editPar += ",tb_tot_cap:修改值为" + attResStagChar.getTbTotCap();
|
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());
|
Integer ret = baseMapper.customizeUpdateByGuid(attResStagChar);
|
|
if (ret == 0) {
|
ret = baseMapper.addattResStagChar(attResStagChar);
|
}
|
return SqlHelper.retBool(ret);
|
}
|
}
|