Browse Source

新增统计单元指标调整单子表(日)数据时,target_name字段从dc_base_asset_target表中获取

develop
bobol 12 months ago
parent
commit
7481cc673d
  1. 14
      lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetAdjustDaySubService.java
  2. 8
      lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java
  3. 5
      lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml

14
lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetAdjustDaySubService.java

@ -4,11 +4,16 @@ import java.util.List;
import com.lzbi.common.utils.DateUtils;
import com.lzbi.draft.domain.DcBusiTargetAdjustDaySubDao;
import com.lzbi.draft.mapper.DcBusiTargetAdjustDaySubMapper;
import com.lzbi.targetFolder.domain.DcBaseAssetTargetDao;
import com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
* 统计单元指标调整单子()Service业务层处理
*
@ -19,6 +24,9 @@ import org.springframework.transaction.annotation.Transactional;
public class DcBusiTargetAdjustDaySubService extends ServiceImpl<DcBusiTargetAdjustDaySubMapper, DcBusiTargetAdjustDaySubDao> implements IService<DcBusiTargetAdjustDaySubDao>
{
@Resource
private DcBaseAssetTargetMapper dcBaseAssetTargetMapper;
/**
* 查询统计单元指标调整单子()
*
@ -51,8 +59,10 @@ public class DcBusiTargetAdjustDaySubService extends ServiceImpl<DcBusiTargetAdj
@Transactional(rollbackFor = Exception.class)
public int insertDcBusiTargetAdjustDaySubDao(DcBusiTargetAdjustDaySubDao dcBusiTargetAdjustDaySubDao, String assetId)
{
String targetName = "123"; //TODO 从service获取
dcBusiTargetAdjustDaySubDao.setTargetName(targetName);
DcBaseAssetTargetDao dcBaseAssetTargetDao = dcBaseAssetTargetMapper.selectDcBaseAssetTargetDaoByTargetCodeAndAssetId(dcBusiTargetAdjustDaySubDao.getTargetCode(), assetId);
if (ObjectUtils.isNotEmpty(dcBaseAssetTargetDao)) {
dcBusiTargetAdjustDaySubDao.setTargetName(dcBaseAssetTargetDao.getTargetName());
}
dcBusiTargetAdjustDaySubDao.setCreatedTime(DateUtils.getNowDate());
return baseMapper.insertDcBusiTargetAdjustDaySubDao(dcBusiTargetAdjustDaySubDao);
}

8
lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java

@ -22,6 +22,14 @@ public interface DcBaseAssetTargetMapper extends BaseMapper<DcBaseAssetTargetDao
* @return 资产指标配置
*/
public DcBaseAssetTargetDao selectDcBaseAssetTargetDaoById(Long id);
/**
* 查询资产指标配置
*
* @param targetCode 指标编码
* @param assetId 统计单元ID
* @return 资产指标配置
*/
public DcBaseAssetTargetDao selectDcBaseAssetTargetDaoByTargetCodeAndAssetId(String targetCode, String assetId);
/**
* 查询资产指标配置列表

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

@ -54,6 +54,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectDcBaseAssetTargetVo"/>
where id = #{id}
</select>
<select id="selectDcBaseAssetTargetDaoByTargetCodeAndAssetId" parameterType="String" resultMap="DcBaseAssetTargetResult">
<include refid="selectDcBaseAssetTargetVo"/>
where target_code = #{targetCode} and asset_id = #{assetId}
</select>
<insert id="insertDcBaseAssetTargetDao" parameterType="DcBaseAssetTargetDao" useGeneratedKeys="true" keyProperty="id">
insert into dc_base_asset_target

Loading…
Cancel
Save