|
|
@@ -2,6 +2,7 @@ package org.jeecg.modules.hlgplatform.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.modules.hlgplatform.entity.HlgPlatformSubcontractor;
|
|
|
import org.jeecg.modules.hlgplatform.mapper.HlgPlatformSubcontractorMapper;
|
|
|
import org.jeecg.modules.hlgplatform.service.IHlgPlatformSubcontractorService;
|
|
|
@@ -13,7 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
/**
|
|
|
* @Description: 平台服务商表
|
|
|
* @Author: jeecg-boot
|
|
|
- * @Date: 2020-02-18
|
|
|
+ * @Date: 2020-02-18
|
|
|
* @Version: V1.0
|
|
|
*/
|
|
|
@Service
|
|
|
@@ -26,8 +27,17 @@ public class HlgPlatformSubcontractorServiceImpl extends ServiceImpl<HlgPlatform
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public void savePlatformSubcontractor(HlgPlatformSubcontractor hlgPlatformSubcontractor) {
|
|
|
+ public Result<HlgPlatformSubcontractor> savePlatformSubcontractor(HlgPlatformSubcontractor hlgPlatformSubcontractor) {
|
|
|
+ Result<HlgPlatformSubcontractor> result = new Result<HlgPlatformSubcontractor>();
|
|
|
+ //查看该平台是否已绑定该服务商
|
|
|
+ int count = baseMapper.getCountForPlatformSubcontractor(hlgPlatformSubcontractor);
|
|
|
+ if (count > 0) {
|
|
|
+ result.error500("服务商已存在,请勿重复添加");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
hlgPlatformSubcontractor.setIsOn("1");
|
|
|
save(hlgPlatformSubcontractor);
|
|
|
+ result.success("添加成功!");
|
|
|
+ return result;
|
|
|
}
|
|
|
}
|