bobol
9 months ago
25 changed files with 927 additions and 104 deletions
@ -0,0 +1,16 @@ |
|||
package com.lzbi.common.config; |
|||
|
|||
import lombok.Data; |
|||
import org.springframework.boot.context.properties.ConfigurationProperties; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
@Data |
|||
@Component |
|||
@ConfigurationProperties(prefix = "magic-server-api") |
|||
public class MagicServerApiConfig { |
|||
|
|||
/** |
|||
* 获取收费系统参数 |
|||
*/ |
|||
private String chargeSystemParams; |
|||
} |
@ -0,0 +1,74 @@ |
|||
package com.lzbi.common.constant; |
|||
|
|||
public class ParamsModelCodeConstants { |
|||
|
|||
public static final String 二次网供温设定 = "005"; |
|||
public static final String 一次网供温 = "011"; |
|||
public static final String 一次网回温 = "012"; |
|||
public static final String 瞬时热量 = "008"; |
|||
public static final String 累计热量 = "009"; |
|||
public static final String 水箱水位计 = "015"; |
|||
public static final String 瞬时流量 = "007"; |
|||
public static final String 热量累计清零 = "010"; |
|||
public static final String 地面水面报警器 = "016"; |
|||
public static final String 一次网供压 = "013"; |
|||
public static final String 一次网回压 = "014"; |
|||
public static final String 总电表 = "017"; |
|||
public static final String 一次网管道泵远控就地 = "018"; |
|||
public static final String 电调阀远控就地 = "003"; |
|||
public static final String 电调阀开度给定 = "001"; |
|||
public static final String 电调阀开度反馈 = "002"; |
|||
public static final String 二次网供回水平均温设定 = "006"; |
|||
public static final String 水表累计补水量 = "031"; |
|||
public static final String 一次网管道泵频率给定 = "023"; |
|||
public static final String 一次网混水电调阀开度给定 = "028"; |
|||
public static final String 一次网混水电调阀开度反馈 = "029"; |
|||
public static final String 补水泵1号故障状态 = "035"; |
|||
public static final String 水表累计补水量清零 = "032"; |
|||
public static final String 供水焓值 = "053"; |
|||
public static final String 回水热量 = "057"; |
|||
public static final String 补水泵2号故障状态 = "036"; |
|||
public static final String 循环泵远控就地选择 = "037"; |
|||
public static final String 一次网管道泵频率反馈 = "024"; |
|||
public static final String 循环泵1号或2号泵选择 = "038"; |
|||
public static final String 一次网管道泵下电 = "020"; |
|||
public static final String 一次网管道泵启动 = "021"; |
|||
public static final String 循环泵控制模式选择 = "039"; |
|||
public static final String 一次网管道泵运行或停止状态 = "025"; |
|||
public static final String 一次网管道泵故障状态 = "026"; |
|||
public static final String 一次网混水电调阀远控或就地 = "027"; |
|||
public static final String 补水泵1号运行或停止状态 = "033"; |
|||
public static final String 补水泵2号运行或停止状态 = "034"; |
|||
public static final String 循环泵变频上电 = "040"; |
|||
public static final String 循环泵变频下电 = "041"; |
|||
public static final String 循环泵变频启动 = "042"; |
|||
public static final String 循环泵变频停止 = "043"; |
|||
public static final String 二次网压差设定 = "044"; |
|||
public static final String 二次网供水温 = "045"; |
|||
public static final String 二次网回水温 = "046"; |
|||
public static final String 供水流量 = "049"; |
|||
public static final String 供水流量累计 = "051"; |
|||
public static final String 供水流量信号 = "050"; |
|||
public static final String 回水流量 = "054"; |
|||
public static final String 回水流量信号 = "055"; |
|||
public static final String 回水流量累计 = "056"; |
|||
public static final String 回水焓值 = "058"; |
|||
public static final String 耗流瞬时 = "059"; |
|||
public static final String 耗流累计 = "060"; |
|||
public static final String 耗热累计 = "062"; |
|||
public static final String 能耗焓值 = "063"; |
|||
public static final String 耗热瞬时 = "061"; |
|||
public static final String 电调阀控制模式选择 = "004"; |
|||
public static final String 一次网管道泵停止 = "022"; |
|||
public static final String 水表瞬时补水量 = "030"; |
|||
public static final String 供水热量 = "052"; |
|||
public static final String 二次网供水压力 = "047"; |
|||
public static final String 二次网回水压力 = "048"; |
|||
public static final String 循环泵频率反馈 = "064"; |
|||
public static final String 循环泵频率给定 = "065"; |
|||
public static final String 一次网管道泵启或停 = "066"; |
|||
public static final String 一次网管道泵上电 = "019"; |
|||
public static final String 供暖面积 = "P00001"; |
|||
public static final String 开栓已执行 = "P00002"; |
|||
|
|||
} |
@ -0,0 +1,69 @@ |
|||
package com.lzbi.asset.domain; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 收费系统参数 |
|||
*/ |
|||
@Data |
|||
public class ChargeSystemParamsDTO { |
|||
|
|||
/** |
|||
* 目标资产编码 |
|||
*/ |
|||
private String goalAssetCode; |
|||
/** |
|||
* 统计单元编码 |
|||
*/ |
|||
private String assetCode; |
|||
|
|||
/** 统计单元ID */ |
|||
private Long assetId; |
|||
|
|||
/** 指标模型编码 */ |
|||
private String targetModelCode; |
|||
|
|||
/** 指标名称 */ |
|||
private String targetName; |
|||
|
|||
/** 指标别名 */ |
|||
private String targetNameAlias; |
|||
|
|||
/** 指标编码 */ |
|||
private String targetCode; |
|||
|
|||
/** 所属专业 */ |
|||
private String fieldCode; |
|||
|
|||
/** 上限 */ |
|||
private BigDecimal limitUp; |
|||
|
|||
/** 下限 */ |
|||
private BigDecimal limitDown; |
|||
|
|||
/** 值 */ |
|||
private BigDecimal valueBase; |
|||
|
|||
/** 是否均值 */ |
|||
private String flagAvg; |
|||
|
|||
/** 是否汇总 */ |
|||
private String flagSum; |
|||
|
|||
/** 是否积算 */ |
|||
private String flagCompute; |
|||
|
|||
/** */ |
|||
private String sort; |
|||
|
|||
/** 所属专业名称 */ |
|||
private String fieldName; |
|||
|
|||
/** T指标P参数 */ |
|||
private String columnType; |
|||
|
|||
/** 单位 */ |
|||
private String fieldUnit; |
|||
} |
@ -0,0 +1,65 @@ |
|||
package com.lzbi.asset.domain; |
|||
|
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import lombok.Data; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.experimental.Accessors; |
|||
import com.lzbi.common.annotation.Excel; |
|||
import com.lzbi.module.base.BaseModuleEntity; |
|||
|
|||
/** |
|||
* 统计单元与外部资产对照配置对象 dc_base_asset_contrast_config |
|||
* |
|||
* @author lienbo |
|||
* @date 2024-02-05 |
|||
*/ |
|||
@Data |
|||
@Accessors(chain = true) |
|||
public class DcBaseAssetContrastConfig extends BaseModuleEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 统计单元ID */ |
|||
private Long id; |
|||
|
|||
/** 统计单元编码 */ |
|||
@Excel(name = "统计单元编码") |
|||
@ApiModelProperty(name = "统计单元编码",notes = "assetCode") |
|||
private String assetCode; |
|||
|
|||
/** 统计单元名称 */ |
|||
@Excel(name = "统计单元名称") |
|||
@ApiModelProperty(name = "统计单元名称",notes = "assetName") |
|||
private String assetName; |
|||
|
|||
/** 目标资产编码 */ |
|||
@Excel(name = "目标资产编码") |
|||
@ApiModelProperty(name = "目标资产编码",notes = "goalAssetCode") |
|||
private String goalAssetCode; |
|||
|
|||
/** 目标资产名称 */ |
|||
@Excel(name = "目标资产名称") |
|||
@ApiModelProperty(name = "目标资产名称",notes = "goalAssetName") |
|||
private String goalAssetName; |
|||
|
|||
/** 数据来源;生产IOT:work;计费:charge;Erp:erp */ |
|||
@Excel(name = "数据来源;生产IOT:work;计费:charge;Erp:erp") |
|||
@ApiModelProperty(name = "数据来源;生产IOT:work;计费:charge;Erp:erp",notes = "goalSource") |
|||
private String goalSource; |
|||
|
|||
/** 创建人 */ |
|||
private String createdBy; |
|||
|
|||
/** 创建时间 */ |
|||
private Date createdTime; |
|||
|
|||
/** 更新人 */ |
|||
private String updatedBy; |
|||
|
|||
/** 更新时间 */ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,62 @@ |
|||
package com.lzbi.asset.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.lzbi.asset.domain.DcBaseAssetContrastConfig; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
|
|||
/** |
|||
* 统计单元与外部资产对照配置Mapper接口 |
|||
* |
|||
* @author lienbo |
|||
* @date 2024-02-05 |
|||
*/ |
|||
|
|||
public interface DcBaseAssetContrastConfigMapper extends BaseMapper<DcBaseAssetContrastConfig> |
|||
{ |
|||
/** |
|||
* 查询统计单元与外部资产对照配置 |
|||
* |
|||
* @param id 统计单元与外部资产对照配置主键 |
|||
* @return 统计单元与外部资产对照配置 |
|||
*/ |
|||
public DcBaseAssetContrastConfig selectDcBaseAssetContrastConfigById(Long id); |
|||
|
|||
/** |
|||
* 查询统计单元与外部资产对照配置列表 |
|||
* |
|||
* @return 统计单元与外部资产对照配置集合 |
|||
*/ |
|||
public List<DcBaseAssetContrastConfig> selectDcBaseAssetContrastConfigList(); |
|||
|
|||
/** |
|||
* 新增统计单元与外部资产对照配置 |
|||
* |
|||
* @param dcBaseAssetContrastConfig 统计单元与外部资产对照配置 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertDcBaseAssetContrastConfig(DcBaseAssetContrastConfig dcBaseAssetContrastConfig); |
|||
|
|||
/** |
|||
* 修改统计单元与外部资产对照配置 |
|||
* |
|||
* @param dcBaseAssetContrastConfig 统计单元与外部资产对照配置 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateDcBaseAssetContrastConfig(DcBaseAssetContrastConfig dcBaseAssetContrastConfig); |
|||
|
|||
/** |
|||
* 删除统计单元与外部资产对照配置 |
|||
* |
|||
* @param id 统计单元与外部资产对照配置主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteDcBaseAssetContrastConfigById(Long id); |
|||
|
|||
/** |
|||
* 批量删除统计单元与外部资产对照配置 |
|||
* |
|||
* @param ids 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteDcBaseAssetContrastConfigByIds(Long[] ids); |
|||
} |
@ -0,0 +1,162 @@ |
|||
package com.lzbi.asset.service; |
|||
|
|||
import cn.hutool.core.date.DatePattern; |
|||
import cn.hutool.core.date.DateUtil; |
|||
import com.alibaba.fastjson2.JSONArray; |
|||
import com.alibaba.fastjson2.JSONObject; |
|||
import com.lzbi.asset.domain.ChargeSystemParamsDTO; |
|||
import com.lzbi.asset.domain.DcBaseAssetContrastConfig; |
|||
import com.lzbi.asset.mapper.DcBaseAssetContrastConfigMapper; |
|||
import com.lzbi.code.domain.DcBaseCoderuleDefineDao; |
|||
import com.lzbi.code.domain.DcBusiCoderuleConfigDao; |
|||
import com.lzbi.code.service.CodeNoGenerater; |
|||
import com.lzbi.code.service.DcBaseCoderuleDefineService; |
|||
import com.lzbi.common.config.MagicServerApiConfig; |
|||
import com.lzbi.common.constant.BizConstants; |
|||
import com.lzbi.common.constant.ParamsModelCodeConstants; |
|||
import com.lzbi.draft.domain.DcBusiParamBillMaster; |
|||
import com.lzbi.draft.domain.DcBusiParamBillSub; |
|||
import com.lzbi.draft.service.DcBusiParamBillMasterService; |
|||
import com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.boot.web.client.RestTemplateBuilder; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.util.CollectionUtils; |
|||
import org.springframework.web.client.RestTemplate; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.time.Duration; |
|||
import java.time.LocalDate; |
|||
import java.time.LocalDateTime; |
|||
import java.time.format.DateTimeFormatter; |
|||
import java.util.ArrayList; |
|||
import java.util.Iterator; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 收费系统业务逻辑层 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
public class ChargeSystemService { |
|||
|
|||
/** |
|||
* 创建参数采集但 |
|||
* inComeDate 采集的目标时间 格式为yyyy-MM-dd |
|||
*/ |
|||
private final String BUSICODE = "param_bill_adjust"; |
|||
|
|||
@Autowired |
|||
private MagicServerApiConfig magicServerApiConfig; |
|||
|
|||
@Autowired |
|||
private DcBaseCoderuleDefineService dcBaseCoderuleDefineService; |
|||
|
|||
@Autowired |
|||
private CodeNoGenerater codeNoGenerater; |
|||
|
|||
@Autowired |
|||
private DcBusiParamBillMasterService dcBusiParamBillMasterService; |
|||
|
|||
@Resource |
|||
private DcBaseAssetContrastConfigMapper dcBaseAssetContrastConfigMapper; |
|||
|
|||
@Resource |
|||
private DcBaseAssetTargetMapper dcBaseAssetTargetMapper; |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void syncChargeSystemParams() { |
|||
DcBaseAssetContrastConfig params = new DcBaseAssetContrastConfig(); |
|||
params.setGoalSource(BizConstants.GoalSource.CHARGE); |
|||
List<DcBaseAssetContrastConfig> dcBaseAssetContrastConfigs = dcBaseAssetContrastConfigMapper.selectDcBaseAssetContrastConfigList(); |
|||
if (CollectionUtils.isEmpty(dcBaseAssetContrastConfigs)) { |
|||
log.warn("系统中未配置统计单元与外部资产对照关系"); |
|||
return; |
|||
} |
|||
|
|||
RestTemplate restTemplate = new RestTemplateBuilder() |
|||
.setConnectTimeout(Duration.ofMinutes(5)) |
|||
.setReadTimeout(Duration.ofMinutes(5)) |
|||
.build(); |
|||
String str = restTemplate.getForObject(magicServerApiConfig.getChargeSystemParams(), String.class); |
|||
|
|||
if (StringUtils.isNotBlank(str)) { |
|||
JSONObject jsonObject = JSONObject.parseObject(str); |
|||
Integer code = jsonObject.getInteger("code"); |
|||
if (1 == code) { |
|||
JSONArray jsonArray = jsonObject.getJSONArray("data"); |
|||
if (null != jsonArray && !jsonArray.isEmpty()) { |
|||
log.info("收费系统换热站参数:{}", jsonArray.toJSONString()); |
|||
this.createParamBill(jsonArray); |
|||
} |
|||
} |
|||
|
|||
} |
|||
} |
|||
|
|||
private void createParamBill(JSONArray jsonArray) { |
|||
LocalDateTime localDateTime = LocalDateTime.now(); |
|||
int hour = localDateTime.getHour(); |
|||
LocalDate localDate = localDateTime.toLocalDate(); |
|||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN); |
|||
String dateStr = localDate.format(dateTimeFormatter); |
|||
DcBusiCoderuleConfigDao ruleIdByBusicode = dcBaseCoderuleDefineService.getRuleIdByBusicode(BUSICODE); |
|||
DcBaseCoderuleDefineDao ruleDao = dcBaseCoderuleDefineService.selectDcBaseCoderuleDefineDaoById(ruleIdByBusicode.getRuleId()); |
|||
DcBusiParamBillMaster billm = new DcBusiParamBillMaster(); |
|||
String billNo = codeNoGenerater.getCode(ruleDao); |
|||
if (com.lzbi.common.utils.StringUtils.isNull(billNo)) { |
|||
billNo = "AD_" + System.currentTimeMillis(); |
|||
} |
|||
billm.setBillNo(billNo); |
|||
billm.setCreatedBy("robot"); |
|||
billm.setCreatedTime(DateUtil.date()); |
|||
billm.setBillIncomeDate(dateStr); |
|||
billm.setBillType("2"); |
|||
billm.setCheckType("1"); |
|||
billm.setCheckStatus("1"); |
|||
List<DcBusiParamBillSub> billSub = new ArrayList<>(); |
|||
List<String> paramsModelCodeList = new ArrayList<>(); |
|||
paramsModelCodeList.add(ParamsModelCodeConstants.供暖面积); |
|||
paramsModelCodeList.add(ParamsModelCodeConstants.开栓已执行); |
|||
List<ChargeSystemParamsDTO> targetList = dcBaseAssetTargetMapper.selectChargeAssetContrastParams(paramsModelCodeList); |
|||
Map<String, List<ChargeSystemParamsDTO>> goalAssetCodeMap = targetList.stream().collect(Collectors.groupingBy(ChargeSystemParamsDTO::getGoalAssetCode)); |
|||
Iterator iterator = jsonArray.iterator(); |
|||
|
|||
while(iterator.hasNext()) { |
|||
JSONObject next = (JSONObject) iterator.next(); |
|||
String huanrezhanid = next.getString("HUANREZHANID"); |
|||
List<ChargeSystemParamsDTO> chargeSystemParamsDTOS = goalAssetCodeMap.get(huanrezhanid); |
|||
if (!CollectionUtils.isEmpty(chargeSystemParamsDTOS)) { |
|||
for (ChargeSystemParamsDTO chargeSystemParamsDTO : chargeSystemParamsDTOS) { |
|||
DcBusiParamBillSub subDao = new DcBusiParamBillSub(); |
|||
subDao.setCreatedBy("robot"); |
|||
subDao.setAssetCode(chargeSystemParamsDTO.getAssetCode()); |
|||
subDao.setBillNo(billNo); |
|||
subDao.setParamCode(chargeSystemParamsDTO.getTargetCode()); |
|||
subDao.setFieldCode(chargeSystemParamsDTO.getFieldCode()); |
|||
subDao.setCountDate(dateStr); |
|||
subDao.setCountHour(hour); |
|||
if (ParamsModelCodeConstants.供暖面积.equals(chargeSystemParamsDTO.getTargetModelCode())) { |
|||
subDao.setParamValue(next.getDouble("GONGNUANMIANJI")); |
|||
billSub.add(subDao); |
|||
} else if (ParamsModelCodeConstants.开栓已执行.equals(chargeSystemParamsDTO.getTargetModelCode())){ |
|||
subDao.setParamValue(next.getDouble("KAISHUANYIZHIXING")); |
|||
billSub.add(subDao); |
|||
} else { |
|||
subDao = null; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
billm.setDcBusiParamBillSubList(billSub); |
|||
log.info("参数采集单:{}", JSONObject.toJSONString(billm)); |
|||
dcBusiParamBillMasterService.insertDcBusiParamBillMasterDao(billm); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,91 @@ |
|||
package com.lzbi.asset.service; |
|||
|
|||
import java.util.List; |
|||
import com.lzbi.common.utils.DateUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import com.lzbi.asset.domain.DcBaseAssetContrastConfig; |
|||
import com.lzbi.asset.mapper.DcBaseAssetContrastConfigMapper; |
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
/** |
|||
* 统计单元与外部资产对照配置Service业务层处理 |
|||
* |
|||
* @author lienbo |
|||
* @date 2024-02-05 |
|||
*/ |
|||
@Service |
|||
public class DcBaseAssetContrastConfigService extends ServiceImpl<DcBaseAssetContrastConfigMapper, DcBaseAssetContrastConfig> implements IService<DcBaseAssetContrastConfig> |
|||
{ |
|||
|
|||
/** |
|||
* 查询统计单元与外部资产对照配置 |
|||
* |
|||
* @param id 统计单元与外部资产对照配置主键 |
|||
* @return 统计单元与外部资产对照配置 |
|||
*/ |
|||
public DcBaseAssetContrastConfig selectDcBaseAssetContrastConfigById(Long id) |
|||
{ |
|||
return baseMapper.selectDcBaseAssetContrastConfigById(id); |
|||
} |
|||
|
|||
/** |
|||
* 查询统计单元与外部资产对照配置列表 |
|||
* |
|||
* @param dcBaseAssetContrastConfig 统计单元与外部资产对照配置 |
|||
* @return 统计单元与外部资产对照配置 |
|||
*/ |
|||
public List<DcBaseAssetContrastConfig> selectDcBaseAssetContrastConfigList(DcBaseAssetContrastConfig dcBaseAssetContrastConfig) |
|||
{ |
|||
return baseMapper.selectDcBaseAssetContrastConfigList(); |
|||
} |
|||
|
|||
/** |
|||
* 新增统计单元与外部资产对照配置 |
|||
* |
|||
* @param dcBaseAssetContrastConfig 统计单元与外部资产对照配置 |
|||
* @return 结果 |
|||
*/ |
|||
|
|||
public int insertDcBaseAssetContrastConfig(DcBaseAssetContrastConfig dcBaseAssetContrastConfig) |
|||
{ |
|||
dcBaseAssetContrastConfig.setCreatedTime(DateUtils.getNowDate()); |
|||
return baseMapper.insertDcBaseAssetContrastConfig(dcBaseAssetContrastConfig); |
|||
} |
|||
|
|||
/** |
|||
* 修改统计单元与外部资产对照配置 |
|||
* |
|||
* @param dcBaseAssetContrastConfig 统计单元与外部资产对照配置 |
|||
* @return 结果 |
|||
*/ |
|||
|
|||
public int updateDcBaseAssetContrastConfig(DcBaseAssetContrastConfig dcBaseAssetContrastConfig) |
|||
{ |
|||
dcBaseAssetContrastConfig.setUpdatedTime(DateUtils.getNowDate()); |
|||
return baseMapper.updateDcBaseAssetContrastConfig(dcBaseAssetContrastConfig); |
|||
} |
|||
|
|||
/** |
|||
* 批量删除统计单元与外部资产对照配置 |
|||
* |
|||
* @param ids 需要删除的统计单元与外部资产对照配置主键 |
|||
* @return 结果 |
|||
*/ |
|||
|
|||
public int deleteDcBaseAssetContrastConfigByIds(Long[] ids) |
|||
{ |
|||
return baseMapper.deleteDcBaseAssetContrastConfigByIds(ids); |
|||
} |
|||
|
|||
/** |
|||
* 删除统计单元与外部资产对照配置信息 |
|||
* |
|||
* @param id 统计单元与外部资产对照配置主键 |
|||
* @return 结果 |
|||
*/ |
|||
|
|||
public int deleteDcBaseAssetContrastConfigById(Long id) |
|||
{ |
|||
return baseMapper.deleteDcBaseAssetContrastConfigById(id); |
|||
} |
|||
} |
@ -0,0 +1,108 @@ |
|||
<?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.lzbi.asset.mapper.DcBaseAssetContrastConfigMapper"> |
|||
|
|||
<resultMap type="com.lzbi.asset.domain.DcBaseAssetContrastConfig" id="DcBaseAssetContrastConfigResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="assetCode" column="asset_code" /> |
|||
<result property="assetName" column="asset_name" /> |
|||
<result property="goalAssetCode" column="goal_asset_code" /> |
|||
<result property="goalAssetName" column="goal_asset_name" /> |
|||
<result property="goalSource" column="goal_source" /> |
|||
<result property="tenantId" column="tenant_id" /> |
|||
<result property="revision" column="revision" /> |
|||
<result property="createdBy" column="created_by" /> |
|||
<result property="createdTime" column="created_time" /> |
|||
<result property="updatedBy" column="updated_by" /> |
|||
<result property="updatedTime" column="updated_time" /> |
|||
<result property="deleteBy" column="delete_by" /> |
|||
<result property="deleteTime" column="delete_time" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectDcBaseAssetContrastConfigVo"> |
|||
select id, asset_code, asset_name, goal_asset_code, goal_asset_name, goal_source, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time from dc_base_asset_contrast_config |
|||
</sql> |
|||
|
|||
<select id="selectDcBaseAssetContrastConfigList" parameterType="DcBaseAssetContrastConfig" resultMap="DcBaseAssetContrastConfigResult"> |
|||
<include refid="selectDcBaseAssetContrastConfigVo"/> |
|||
<where> |
|||
<if test="assetCode != null and assetCode != ''"> and asset_code = #{assetCode}</if> |
|||
<if test="assetName != null and assetName != ''"> and asset_name like concat('%', #{assetName}, '%')</if> |
|||
<if test="goalAssetCode != null and goalAssetCode != ''"> and goal_asset_code = #{goalAssetCode}</if> |
|||
<if test="goalAssetName != null and goalAssetName != ''"> and goal_asset_name like concat('%', #{goalAssetName}, '%')</if> |
|||
<if test="goalSource != null and goalSource != ''"> and goal_source = #{goalSource}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectDcBaseAssetContrastConfigById" parameterType="Long" resultMap="DcBaseAssetContrastConfigResult"> |
|||
<include refid="selectDcBaseAssetContrastConfigVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertDcBaseAssetContrastConfig" parameterType="DcBaseAssetContrastConfig" useGeneratedKeys="true" keyProperty="id"> |
|||
insert into dc_base_asset_contrast_config |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="assetCode != null and assetCode != ''">asset_code,</if> |
|||
<if test="assetName != null and assetName != ''">asset_name,</if> |
|||
<if test="goalAssetCode != null and goalAssetCode != ''">goal_asset_code,</if> |
|||
<if test="goalAssetName != null and goalAssetName != ''">goal_asset_name,</if> |
|||
<if test="goalSource != null">goal_source,</if> |
|||
<if test="tenantId != null">tenant_id,</if> |
|||
<if test="revision != null">revision,</if> |
|||
<if test="createdBy != null">created_by,</if> |
|||
<if test="createdTime != null">created_time,</if> |
|||
<if test="updatedBy != null">updated_by,</if> |
|||
<if test="updatedTime != null">updated_time,</if> |
|||
<if test="deleteBy != null">delete_by,</if> |
|||
<if test="deleteTime != null">delete_time,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="assetCode != null and assetCode != ''">#{assetCode},</if> |
|||
<if test="assetName != null and assetName != ''">#{assetName},</if> |
|||
<if test="goalAssetCode != null and goalAssetCode != ''">#{goalAssetCode},</if> |
|||
<if test="goalAssetName != null and goalAssetName != ''">#{goalAssetName},</if> |
|||
<if test="goalSource != null">#{goalSource},</if> |
|||
<if test="tenantId != null">#{tenantId},</if> |
|||
<if test="revision != null">#{revision},</if> |
|||
<if test="createdBy != null">#{createdBy},</if> |
|||
<if test="createdTime != null">#{createdTime},</if> |
|||
<if test="updatedBy != null">#{updatedBy},</if> |
|||
<if test="updatedTime != null">#{updatedTime},</if> |
|||
<if test="deleteBy != null">#{deleteBy},</if> |
|||
<if test="deleteTime != null">#{deleteTime},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateDcBaseAssetContrastConfig" parameterType="DcBaseAssetContrastConfig"> |
|||
update dc_base_asset_contrast_config |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="assetCode != null and assetCode != ''">asset_code = #{assetCode},</if> |
|||
<if test="assetName != null and assetName != ''">asset_name = #{assetName},</if> |
|||
<if test="goalAssetCode != null and goalAssetCode != ''">goal_asset_code = #{goalAssetCode},</if> |
|||
<if test="goalAssetName != null and goalAssetName != ''">goal_asset_name = #{goalAssetName},</if> |
|||
<if test="goalSource != null">goal_source = #{goalSource},</if> |
|||
<if test="tenantId != null">tenant_id = #{tenantId},</if> |
|||
<if test="revision != null">revision = #{revision},</if> |
|||
<if test="createdBy != null">created_by = #{createdBy},</if> |
|||
<if test="createdTime != null">created_time = #{createdTime},</if> |
|||
<if test="updatedBy != null">updated_by = #{updatedBy},</if> |
|||
<if test="updatedTime != null">updated_time = #{updatedTime},</if> |
|||
<if test="deleteBy != null">delete_by = #{deleteBy},</if> |
|||
<if test="deleteTime != null">delete_time = #{deleteTime},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteDcBaseAssetContrastConfigById" parameterType="Long"> |
|||
delete from dc_base_asset_contrast_config where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteDcBaseAssetContrastConfigByIds" parameterType="String"> |
|||
delete from dc_base_asset_contrast_config where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
</mapper> |
@ -0,0 +1,23 @@ |
|||
package com.lzbi.quartz.task; |
|||
|
|||
import com.lzbi.task.TaskParamDfratProcess; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 自动审批任务 |
|||
*/ |
|||
@Slf4j |
|||
@Component("autoAuditTask") |
|||
public class AutoAuditTask { |
|||
|
|||
@Autowired |
|||
private TaskParamDfratProcess taskParamDfratProcess; |
|||
|
|||
public void auditParamsBill() { |
|||
log.info("===========自动审核参数单据开始============"); |
|||
taskParamDfratProcess.doBills(); |
|||
log.info("===========自动审核参数单据结束============"); |
|||
} |
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.lzbi.quartz.task; |
|||
|
|||
import com.lzbi.asset.service.ChargeSystemService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 同步收费系统任务 |
|||
*/ |
|||
@Slf4j |
|||
@Component("syncChargeSystemTask") |
|||
public class SyncChargeSystemTask { |
|||
|
|||
@Autowired |
|||
private ChargeSystemService chargeSystemService; |
|||
|
|||
public void syncChargeSystemParams() { |
|||
log.info("===========同步收费系统参数开始============"); |
|||
chargeSystemService.syncChargeSystemParams(); |
|||
log.info("===========同步收费系统参数结束============"); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.lzbi.quartz.task; |
|||
|
|||
import com.lzbi.task.TaskWorkParamRead; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 同步IOT系统任务 |
|||
*/ |
|||
@Slf4j |
|||
@Component("syncIotSystemTask") |
|||
public class SyncIotSystemTask { |
|||
|
|||
@Autowired |
|||
private TaskWorkParamRead taskWorkParamRead; |
|||
|
|||
/** |
|||
* 同步参数 |
|||
* @param ifLog 是否存入日志 |
|||
*/ |
|||
public void syncIotParams(Boolean ifLog) { |
|||
log.info("===========同步IOT参数开始,是否存入日志:{}============", ifLog); |
|||
taskWorkParamRead.runTask(ifLog); |
|||
log.info("===========同步IOT参数结束,是否存入日志:{}============", ifLog); |
|||
} |
|||
} |
Loading…
Reference in new issue