|
|
@ -1,12 +1,26 @@ |
|
|
|
package com.lzbi.bill.service; |
|
|
|
|
|
|
|
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.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 com.lzbi.bill.domain.DcBusiPlanTargetMonth; |
|
|
|
import com.lzbi.bill.mapper.DcBusiPlanTargetMonthMapper; |
|
|
|
import com.baomidou.mybatisplus.extension.service.IService; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
|
|
|
/** |
|
|
|
* 指标月度计划Service业务层处理 |
|
|
|
* |
|
|
@ -17,6 +31,18 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
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) |
|
|
|
{ |
|
|
|
// 查询公司
|
|
|
|
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()); |
|
|
|
return baseMapper.insertDcBusiPlanTargetMonth(dcBusiPlanTargetMonth); |
|
|
|
} |
|
|
@ -61,6 +113,31 @@ public class DcBusiPlanTargetMonthService extends ServiceImpl<DcBusiPlanTargetMo |
|
|
|
|
|
|
|
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()); |
|
|
|
return baseMapper.updateDcBusiPlanTargetMonth(dcBusiPlanTargetMonth); |
|
|
|
} |
|
|
|