Browse Source

指标阅读计划

develop
bobol 12 months ago
parent
commit
2a84565108
  1. 77
      lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiPlanTargetMonthService.java
  2. 3
      lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetDao.java
  3. 1
      lzbi-module/src/main/resources/mapper/asset/DcBusiPlanTargetMonthMapper.xml
  4. 1
      lzbi-module/src/main/resources/mapper/asset/DcBusiTargetAdjustDayMasterMapper.xml
  5. 7
      lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml

77
lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiPlanTargetMonthService.java

@ -1,12 +1,26 @@
package com.lzbi.bill.service; package com.lzbi.bill.service;
import java.util.List; import java.util.List;
import com.lzbi.asset.domain.DcBaseAssetInfo;
import com.lzbi.asset.mapper.DcBaseAssetInfoMapper;
import com.lzbi.common.core.domain.entity.SysDept;
import com.lzbi.common.utils.DateUtils; import com.lzbi.common.utils.DateUtils;
import com.lzbi.special.domain.DcBaseWorkSpecial;
import com.lzbi.special.mapper.DcBaseWorkSpecialMapper;
import com.lzbi.system.service.impl.SysDeptServiceImpl;
import com.lzbi.targetFolder.domain.DcBaseAssetTargetDao;
import com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.lzbi.bill.domain.DcBusiPlanTargetMonth; import com.lzbi.bill.domain.DcBusiPlanTargetMonth;
import com.lzbi.bill.mapper.DcBusiPlanTargetMonthMapper; import com.lzbi.bill.mapper.DcBusiPlanTargetMonthMapper;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
/** /**
* 指标月度计划Service业务层处理 * 指标月度计划Service业务层处理
* *
@ -17,6 +31,18 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
public class DcBusiPlanTargetMonthService extends ServiceImpl<DcBusiPlanTargetMonthMapper, DcBusiPlanTargetMonth> implements IService<DcBusiPlanTargetMonth> public class DcBusiPlanTargetMonthService extends ServiceImpl<DcBusiPlanTargetMonthMapper, DcBusiPlanTargetMonth> implements IService<DcBusiPlanTargetMonth>
{ {
@Autowired
private SysDeptServiceImpl sysDeptService;
@Resource
private DcBaseAssetInfoMapper dcBaseAssetInfoMapper;
@Resource
private DcBaseWorkSpecialMapper dcBaseWorkSpecialMapper;
@Resource
private DcBaseAssetTargetMapper dcBaseAssetTargetMapper;
/** /**
* 查询指标月度计划 * 查询指标月度计划
* *
@ -48,6 +74,32 @@ public class DcBusiPlanTargetMonthService extends ServiceImpl<DcBusiPlanTargetMo
public int insertDcBusiPlanTargetMonth(DcBusiPlanTargetMonth dcBusiPlanTargetMonth) public int insertDcBusiPlanTargetMonth(DcBusiPlanTargetMonth dcBusiPlanTargetMonth)
{ {
// 查询公司
SysDept company = sysDeptService.selectDeptById(dcBusiPlanTargetMonth.getCompanyId());
if (ObjectUtils.isNotEmpty(company)) {
dcBusiPlanTargetMonth.setCompanyName(company.getDeptName());
}
// 查询组织
SysDept organize = sysDeptService.selectDeptById(dcBusiPlanTargetMonth.getOrgId());
if (ObjectUtils.isNotEmpty(organize)) {
dcBusiPlanTargetMonth.setOrgName(organize.getDeptName());
}
// 查询生产专业
DcBaseWorkSpecial dcBaseWorkSpecial = dcBaseWorkSpecialMapper.selectDcBaseWorkSpecialByCode(dcBusiPlanTargetMonth.getFieldCode());
if (ObjectUtils.isNotEmpty(dcBaseWorkSpecial)) {
dcBusiPlanTargetMonth.setFieldName(dcBaseWorkSpecial.getSpecialName());
}
// 查询统计单元
DcBaseAssetInfo dcBaseAssetInfo = dcBaseAssetInfoMapper.selectDcBaseAssetInfoByCode(dcBusiPlanTargetMonth.getAssetCode());
if (ObjectUtils.isNotEmpty(dcBaseAssetInfo)) {
dcBusiPlanTargetMonth.setAssetName(dcBaseAssetInfo.getAssetName());
}
DcBaseAssetTargetDao dcBaseAssetTargetDao = dcBaseAssetTargetMapper.selectDcBaseAssetTargetDaoByTargetCodeAndAssetCode(dcBusiPlanTargetMonth.getTargetCode(), dcBusiPlanTargetMonth.getAssetCode());
if (ObjectUtils.isNotEmpty(dcBaseAssetTargetDao)) {
dcBusiPlanTargetMonth.setTargetNameDefine(dcBaseAssetTargetDao.getTargetName());
dcBusiPlanTargetMonth.setTargetNameAlias(dcBaseAssetTargetDao.getTargetNameAlias());
}
dcBusiPlanTargetMonth.setCreatedTime(DateUtils.getNowDate()); dcBusiPlanTargetMonth.setCreatedTime(DateUtils.getNowDate());
return baseMapper.insertDcBusiPlanTargetMonth(dcBusiPlanTargetMonth); return baseMapper.insertDcBusiPlanTargetMonth(dcBusiPlanTargetMonth);
} }
@ -61,6 +113,31 @@ public class DcBusiPlanTargetMonthService extends ServiceImpl<DcBusiPlanTargetMo
public int updateDcBusiPlanTargetMonth(DcBusiPlanTargetMonth dcBusiPlanTargetMonth) public int updateDcBusiPlanTargetMonth(DcBusiPlanTargetMonth dcBusiPlanTargetMonth)
{ {
// 查询公司
SysDept company = sysDeptService.selectDeptById(dcBusiPlanTargetMonth.getCompanyId());
if (ObjectUtils.isNotEmpty(company)) {
dcBusiPlanTargetMonth.setCompanyName(company.getDeptName());
}
// 查询组织
SysDept organize = sysDeptService.selectDeptById(dcBusiPlanTargetMonth.getOrgId());
if (ObjectUtils.isNotEmpty(organize)) {
dcBusiPlanTargetMonth.setOrgName(organize.getDeptName());
}
// 查询生产专业
DcBaseWorkSpecial dcBaseWorkSpecial = dcBaseWorkSpecialMapper.selectDcBaseWorkSpecialByCode(dcBusiPlanTargetMonth.getFieldCode());
if (ObjectUtils.isNotEmpty(dcBaseWorkSpecial)) {
dcBusiPlanTargetMonth.setFieldName(dcBaseWorkSpecial.getSpecialName());
}
// 查询统计单元
DcBaseAssetInfo dcBaseAssetInfo = dcBaseAssetInfoMapper.selectDcBaseAssetInfoByCode(dcBusiPlanTargetMonth.getAssetCode());
if (ObjectUtils.isNotEmpty(dcBaseAssetInfo)) {
dcBusiPlanTargetMonth.setAssetName(dcBaseAssetInfo.getAssetName());
}
DcBaseAssetTargetDao dcBaseAssetTargetDao = dcBaseAssetTargetMapper.selectDcBaseAssetTargetDaoByTargetCodeAndAssetCode(dcBusiPlanTargetMonth.getTargetCode(), dcBusiPlanTargetMonth.getAssetCode());
if (ObjectUtils.isNotEmpty(dcBaseAssetTargetDao)) {
dcBusiPlanTargetMonth.setTargetNameDefine(dcBaseAssetTargetDao.getTargetName());
dcBusiPlanTargetMonth.setTargetNameAlias(dcBaseAssetTargetDao.getTargetNameAlias());
}
dcBusiPlanTargetMonth.setUpdatedTime(DateUtils.getNowDate()); dcBusiPlanTargetMonth.setUpdatedTime(DateUtils.getNowDate());
return baseMapper.updateDcBusiPlanTargetMonth(dcBusiPlanTargetMonth); return baseMapper.updateDcBusiPlanTargetMonth(dcBusiPlanTargetMonth);
} }

3
lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetDao.java

@ -34,6 +34,9 @@ public class DcBaseAssetTargetDao extends BaseModuleEntity
@Excel(name = "指标名称") @Excel(name = "指标名称")
private String targetName; private String targetName;
@Excel(name = "指标别名")
private String targetNameAlias;
/** 指标编码 */ /** 指标编码 */
@Excel(name = "指标编码") @Excel(name = "指标编码")
private String targetCode; private String targetCode;

1
lzbi-module/src/main/resources/mapper/asset/DcBusiPlanTargetMonthMapper.xml

@ -47,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="countYear != null and countYear != ''"> and count_year = #{countYear}</if> <if test="countYear != null and countYear != ''"> and count_year = #{countYear}</if>
<if test="countMonth != null and countMonth != ''"> and count_month = #{countMonth}</if> <if test="countMonth != null and countMonth != ''"> and count_month = #{countMonth}</if>
</where> </where>
order by created_time desc
</select> </select>
<select id="selectDcBusiPlanTargetMonthById" parameterType="Long" resultMap="DcBusiPlanTargetMonthResult"> <select id="selectDcBusiPlanTargetMonthById" parameterType="Long" resultMap="DcBusiPlanTargetMonthResult">

1
lzbi-module/src/main/resources/mapper/asset/DcBusiTargetAdjustDayMasterMapper.xml

@ -77,6 +77,7 @@
<if test="checkStauts != null and checkStauts != ''">and check_stauts = #{checkStauts}</if> <if test="checkStauts != null and checkStauts != ''">and check_stauts = #{checkStauts}</if>
<if test="checkType != null and checkType != ''">and check_type = #{checkType}</if> <if test="checkType != null and checkType != ''">and check_type = #{checkType}</if>
</where> </where>
order by created_time desc
</select> </select>
<select id="selectDcBusiTargetAdjustDayMasterDaoById" parameterType="Long" <select id="selectDcBusiTargetAdjustDayMasterDaoById" parameterType="Long"

7
lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml

@ -11,6 +11,7 @@
<result property="assetCode" column="asset_code" /> <result property="assetCode" column="asset_code" />
<result property="targetModelCode" column="target_model_code" /> <result property="targetModelCode" column="target_model_code" />
<result property="targetName" column="target_name" /> <result property="targetName" column="target_name" />
<result property="targetNameAlias" column="target_name_alias" />
<result property="targetCode" column="target_code" /> <result property="targetCode" column="target_code" />
<result property="targetField" column="target_field" /> <result property="targetField" column="target_field" />
<result property="limitUp" column="limit_up" /> <result property="limitUp" column="limit_up" />
@ -30,7 +31,7 @@
</resultMap> </resultMap>
<sql id="selectDcBaseAssetTargetVo"> <sql id="selectDcBaseAssetTargetVo">
select id, asset_id,asset_code, target_model_code, target_name, target_code, target_field, limit_up, limit_down, value_base, flag_avg, flag_sum, flag_compute, sort, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time from dc_base_asset_target select id, asset_id,asset_code, target_model_code, target_name, target_name_alias, target_code, target_field, limit_up, limit_down, value_base, flag_avg, flag_sum, flag_compute, sort, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time from dc_base_asset_target
</sql> </sql>
<select id="selectDcBaseAssetTargetDaoList" parameterType="DcBaseAssetTargetDao" resultMap="DcBaseAssetTargetResult"> <select id="selectDcBaseAssetTargetDaoList" parameterType="DcBaseAssetTargetDao" resultMap="DcBaseAssetTargetResult">
@ -40,6 +41,7 @@
<if test="assetId != null "> and asset_id = #{assetId}</if> <if test="assetId != null "> and asset_id = #{assetId}</if>
<if test="targetModelCode != null and targetModelCode != ''"> and target_model_code = #{targetModelCode}</if> <if test="targetModelCode != null and targetModelCode != ''"> and target_model_code = #{targetModelCode}</if>
<if test="targetName != null and targetName != ''"> and target_name like concat('%', #{targetName}, '%')</if> <if test="targetName != null and targetName != ''"> and target_name like concat('%', #{targetName}, '%')</if>
<if test="targetNameAlias != null and targetNameAlias != ''"> and target_name_alias like concat('%', #{targetNameAlias}, '%')</if>
<if test="targetCode != null and targetCode != ''"> and target_code = #{targetCode}</if> <if test="targetCode != null and targetCode != ''"> and target_code = #{targetCode}</if>
<if test="targetField != null and targetField != ''"> and target_field = #{targetField}</if> <if test="targetField != null and targetField != ''"> and target_field = #{targetField}</if>
<if test="assetCode != null "> and asset_code = #{assetCode}</if> <if test="assetCode != null "> and asset_code = #{assetCode}</if>
@ -69,6 +71,7 @@
<if test="assetId != null">asset_id,</if> <if test="assetId != null">asset_id,</if>
<if test="targetModelCode != null">target_model_code,</if> <if test="targetModelCode != null">target_model_code,</if>
<if test="targetName != null">target_name,</if> <if test="targetName != null">target_name,</if>
<if test="targetNameAlias != null and targetNameAlias != ''">target_name_alias,</if>
<if test="targetCode != null">target_code,</if> <if test="targetCode != null">target_code,</if>
<if test="targetField != null">target_field,</if> <if test="targetField != null">target_field,</if>
<if test="limitUp != null">limit_up,</if> <if test="limitUp != null">limit_up,</if>
@ -91,6 +94,7 @@
<if test="assetId != null">#{assetId},</if> <if test="assetId != null">#{assetId},</if>
<if test="targetModelCode != null">#{targetModelCode},</if> <if test="targetModelCode != null">#{targetModelCode},</if>
<if test="targetName != null">#{targetName},</if> <if test="targetName != null">#{targetName},</if>
<if test="targetNameAlias != null and targetNameAlias != ''">#{targetNameAlias},</if>
<if test="targetCode != null">#{targetCode},</if> <if test="targetCode != null">#{targetCode},</if>
<if test="targetField != null">#{targetField},</if> <if test="targetField != null">#{targetField},</if>
<if test="limitUp != null">#{limitUp},</if> <if test="limitUp != null">#{limitUp},</if>
@ -117,6 +121,7 @@
<if test="assetId != null">asset_id = #{assetId},</if> <if test="assetId != null">asset_id = #{assetId},</if>
<if test="targetModelCode != null">target_model_code = #{targetModelCode},</if> <if test="targetModelCode != null">target_model_code = #{targetModelCode},</if>
<if test="targetName != null">target_name = #{targetName},</if> <if test="targetName != null">target_name = #{targetName},</if>
<if test="targetNameAlias != null and targetNameAlias != ''">target_name_alias = #{targetNameAlias},</if>
<if test="targetCode != null">target_code = #{targetCode},</if> <if test="targetCode != null">target_code = #{targetCode},</if>
<if test="targetField != null">target_field = #{targetField},</if> <if test="targetField != null">target_field = #{targetField},</if>
<if test="limitUp != null">limit_up = #{limitUp},</if> <if test="limitUp != null">limit_up = #{limitUp},</if>

Loading…
Cancel
Save