Commit 9b584f87 by guojuxing

查询无效的记录,用于判断是否修改过配置,如果修改过,不允许再次edit

parent 4e42a5ea
......@@ -63,6 +63,20 @@ public interface DataConfigApiService {
ServiceResponse<Void> configActuallyPaid(Integer enterpriseId, Integer memberBusiness, Integer performanceCount);
/**
* 是否已经配置过会员业务(实付)
* @param enterpriseId
* @return
*/
ServiceResponse<Boolean> hasConfigMemberBusiness(Integer enterpriseId);
/**
* 是否已经配置过业绩统计(实付)
* @param enterpriseId
* @return
*/
ServiceResponse<Boolean> hasConfigPerformanceCount(Integer enterpriseId);
/**
* 实付配置信息
* @Title: listActuallyPaidConfig

* @Description:
......
......@@ -57,4 +57,6 @@ public interface TabDataActuallyPaidConfigMapper {
List<TabDataActuallyPaidConfig> listByEnterpriseId(Integer enterpriseId);
int delete(@Param("enterpriseId") Integer enterpriseId, @Param("classify") Integer classify);
int count(@Param("enterpriseId") Integer enterpriseId, @Param("classify") Integer classify);
}
\ No newline at end of file
......@@ -32,8 +32,16 @@ public interface DataActuallyPaidConfigService {
* @Description:

* @author guojuxing
* @param enterpriseId
* @param classify

* @param classify
count
* @return int


*/
int delete(Integer enterpriseId, Integer classify);
/**
* 查询无效的记录,用于判断是否修改过配置,如果修改过,不允许再次edit
* @param enterpriseId
* @param classify
* @return
*/
int count(Integer enterpriseId, Integer classify);
}
......@@ -36,4 +36,9 @@ public class DataActuallyPaidConfigServiceImpl implements DataActuallyPaidConfig
public int delete(Integer enterpriseId, Integer classify) {
return tabDataActuallyPaidConfigMapper.delete(enterpriseId, classify);
}
@Override
public int count(Integer enterpriseId, Integer classify) {
return tabDataActuallyPaidConfigMapper.count(enterpriseId, classify);
}
}
......@@ -97,6 +97,9 @@ public class DataConfigApiServiceImpl implements DataConfigApiService {
if (dto.getClassify() == null) {
dto.setClassify(1);
}
if (dataActuallyPaidConfigService.count(dto.getEnterpriseId(), dto.getClassify()) > 0) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "已经配置过,不允许再次配置");
}
dataActuallyPaidConfigService.delete(dto.getEnterpriseId(), dto.getClassify());
dto.setConfigStatus(Optional.ofNullable(dto.getConfigStatus()).orElse(0));
dataActuallyPaidConfigService.saveActuallyPaidConfig(dto);
......@@ -136,6 +139,16 @@ public class DataConfigApiServiceImpl implements DataConfigApiService {
}
@Override
public ServiceResponse<Boolean> hasConfigMemberBusiness(Integer enterpriseId) {
return ServiceResponse.success(dataActuallyPaidConfigService.count(enterpriseId, 1) > 0);
}
@Override
public ServiceResponse<Boolean> hasConfigPerformanceCount(Integer enterpriseId) {
return ServiceResponse.success(dataActuallyPaidConfigService.count(enterpriseId, 3) > 0);
}
@Override
public ServiceResponse<List<DataActuallyPaidConfigDTO>> listActuallyPaidConfig(Integer enterpriseId) {
List<TabDataActuallyPaidConfig> list = dataActuallyPaidConfigService.listByEnterpriseId(enterpriseId);
if (CollectionUtils.isEmpty(list)) {
......
......@@ -130,4 +130,11 @@
and classify = #{classify}
and status = 1
</update>
<select id="count" resultType="int">
select count(1) from tab_data_actually_paid_config
where enterprise_id = #{enterpriseId}
and classify = #{classify}
and status = 0
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment