|
@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|
|
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|
|
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|
|
|
|
|
import com.elink.esua.epdc.commons.tools.constant.StrConstant; |
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO; |
|
|
import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO; |
|
|
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|
|
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|
@ -116,7 +117,11 @@ public class EnterpriseReportServiceImpl extends BaseServiceImpl<EnterpriseRepor |
|
|
@Override |
|
|
@Override |
|
|
public EnterpriseReportDTO get(String id) { |
|
|
public EnterpriseReportDTO get(String id) { |
|
|
EnterpriseReportEntity entity = baseDao.selectById(id); |
|
|
EnterpriseReportEntity entity = baseDao.selectById(id); |
|
|
return ConvertUtils.sourceToTarget(entity, EnterpriseReportDTO.class); |
|
|
EnterpriseReportDTO result = ConvertUtils.sourceToTarget(entity, EnterpriseReportDTO.class); |
|
|
|
|
|
if (StringUtils.isNotBlank(result.getAllDeptIds())) { |
|
|
|
|
|
result.setGridIdArray(result.getAllDeptIds().split(StrConstant.COMMA)); |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
@ -128,9 +133,24 @@ public class EnterpriseReportServiceImpl extends BaseServiceImpl<EnterpriseRepor |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void update(EnterpriseReportDTO dto) { |
|
|
public Result update(EnterpriseReportDTO dto) { |
|
|
|
|
|
// 根据 【公司名称、所属年度、所属季度】 校验唯一性,如果匹配到数据,则拒绝修改。
|
|
|
|
|
|
QueryWrapper<EnterpriseReportEntity> entityQueryWrapper =new QueryWrapper<>(); |
|
|
|
|
|
entityQueryWrapper.eq("YEAR", dto.getYear()); |
|
|
|
|
|
entityQueryWrapper.eq("QUARTER", dto.getQuarter()); |
|
|
|
|
|
entityQueryWrapper.eq("ENTERPRISE_NAME", dto.getEnterpriseName()); |
|
|
|
|
|
entityQueryWrapper.eq("DEL_FLAG", NumConstant.ZERO); |
|
|
|
|
|
entityQueryWrapper.ne("ID", dto.getId()); |
|
|
|
|
|
List<EnterpriseReportEntity> entities = baseDao.selectList(entityQueryWrapper); |
|
|
|
|
|
if(entities.size() > 0) { |
|
|
|
|
|
Integer quarter = Integer.valueOf(entities.get(NumConstant.ZERO).getQuarter()) + NumConstant.ONE; |
|
|
|
|
|
return new Result().error("拒绝修改!该 [" + entities.get(NumConstant.ZERO).getEnterpriseName() + "] 公司, " + |
|
|
|
|
|
entities.get(NumConstant.ZERO).getYear() + " 年第"+ quarter + "季度的企业上报记录已存在。"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
EnterpriseReportEntity entity = ConvertUtils.sourceToTarget(dto, EnterpriseReportEntity.class); |
|
|
EnterpriseReportEntity entity = ConvertUtils.sourceToTarget(dto, EnterpriseReportEntity.class); |
|
|
updateById(entity); |
|
|
updateById(entity); |
|
|
|
|
|
return new Result(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|