| | |
| | | import com.by4cloud.platformx.business.service.AnnualPlanService; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.security.util.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | /** |
| | | * 单位计划 |
| | |
| | | @Service |
| | | public class AnnualPlanServiceImpl extends ServiceImpl<AnnualPlanMapper, AnnualPlan> implements AnnualPlanService { |
| | | |
| | | @Value("${dept.smj}") |
| | | private String smj; |
| | | |
| | | @Value("${dept.smjsc}") |
| | | private String smjsc; |
| | | |
| | | @Value("${dept.smjzt}") |
| | | private String smjzt; |
| | | |
| | | @Value("${dept.smjhw}") |
| | | private String smjhw; |
| | | |
| | | @Override |
| | | public R add(AnnualPlan entity) { |
| | | Long compId = SecurityUtils.getUser().getCompId(); |
| | | if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjhw) |
| | | || ("" + SecurityUtils.getUser().getCompId()).equals(smjsc)|| ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)) { |
| | | compId = 2089995177814495234L; |
| | | } |
| | | AnnualPlan plan = baseMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery().eq(AnnualPlan::getPlanYear,entity.getPlanYear()) |
| | | .eq(AnnualPlan::getPlanType,entity.getPlanType()).eq(AnnualPlan::getCompId, SecurityUtils.getUser().getCompId()) |
| | | .last("limit 1")); |