소스 검색

修改企业删除(添加判断平台支付相关业务)

LiFei 5 년 전
부모
커밋
70a2226d4a

+ 8 - 3
happy-boot-module-powerjob/src/main/java/org/jeecg/modules/hlgcompany/controller/HlgCompanyController.java

@@ -28,7 +28,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 
 
 import org.jeecg.modules.hlgcompany.service.IHlgCompanySubcontractorService;
 import org.jeecg.modules.hlgcompany.service.IHlgCompanySubcontractorService;
+import org.jeecg.modules.hlgcpmanager.entity.HlgCpAccountDetail;
 import org.jeecg.modules.hlgcpmanager.entity.HlgCpSetting;
 import org.jeecg.modules.hlgcpmanager.entity.HlgCpSetting;
+import org.jeecg.modules.hlgcpmanager.mapper.HlgCpAccountDetailMapper;
+import org.jeecg.modules.hlgcpmanager.service.IHlgCpAccountDetailService;
 import org.jeecg.modules.hlgpayment.entity.HlgPaymentDetail;
 import org.jeecg.modules.hlgpayment.entity.HlgPaymentDetail;
 import org.jeecg.modules.hlgplatform.entity.HlgPlatform;
 import org.jeecg.modules.hlgplatform.entity.HlgPlatform;
 import org.jeecg.modules.hlgplatform.mapper.HlgPlatformMapper;
 import org.jeecg.modules.hlgplatform.mapper.HlgPlatformMapper;
@@ -59,8 +62,8 @@ public class HlgCompanyController {
 	private IHlgCompanyService hlgCompanyService;
 	private IHlgCompanyService hlgCompanyService;
 	@Autowired
 	@Autowired
 	private IHlgCompanySubcontractorService hlgCompanySubcontractorService;
 	private IHlgCompanySubcontractorService hlgCompanySubcontractorService;
-	 @Autowired
-	 private IHlgAccountDetailService hlgAccountDetailService;
+	 @Resource
+	 private HlgCpAccountDetailMapper hlgCpAccountDetailMapper;
 
 
 
 
 	 /**
 	 /**
@@ -205,7 +208,9 @@ public class HlgCompanyController {
 	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
 	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
 		Result<HlgCompany> result = new Result<HlgCompany>();
 		Result<HlgCompany> result = new Result<HlgCompany>();
 		List<HlgCompanySubcontractor> hlgCompanySubcontractorList=hlgCompanySubcontractorService.findSubcontractorListByCompanyid(id);
 		List<HlgCompanySubcontractor> hlgCompanySubcontractorList=hlgCompanySubcontractorService.findSubcontractorListByCompanyid(id);
-		if(hlgCompanySubcontractorList.size()>0){
+		HlgCompany hlgCompany=hlgCompanyService.getById(id);
+		List<HlgCpAccountDetail> hlgCpAccountDetailList=hlgCpAccountDetailMapper.findHlgCpAccountDetailListByCompanyId(id);
+		if(hlgCompanySubcontractorList.size()>0 || hlgCompany.getIsCpOn()==1 || hlgCpAccountDetailList.size()>0){
 			result.error500("该企业已存在业务数据,不能删除");
 			result.error500("该企业已存在业务数据,不能删除");
 		}else {
 		}else {
 			hlgCompanyService.removeCompanyById(id);
 			hlgCompanyService.removeCompanyById(id);

+ 2 - 0
happy-boot-module-powerjob/src/main/java/org/jeecg/modules/hlgcpmanager/mapper/HlgCpAccountDetailMapper.java

@@ -35,4 +35,6 @@ public interface HlgCpAccountDetailMapper extends BaseMapper<HlgCpAccountDetail>
     List<HlgCpAccountDetail> findRechargeExportList(@Param("hlgCpAccountDetail") HlgCpAccountDetailExport hlgCpAccountDetailExport, @Param(Constants.WRAPPER) QueryWrapper<HlgCpAccountDetailExport> queryWrapper);
     List<HlgCpAccountDetail> findRechargeExportList(@Param("hlgCpAccountDetail") HlgCpAccountDetailExport hlgCpAccountDetailExport, @Param(Constants.WRAPPER) QueryWrapper<HlgCpAccountDetailExport> queryWrapper);
 
 
     List<HlgCpAccountDetail> findPaymentExportList(@Param("hlgCpAccountDetail") HlgCpAccountDetailExport hlgCpAccountDetailExport, @Param(Constants.WRAPPER) QueryWrapper<HlgCpAccountDetailExport> queryWrapper);
     List<HlgCpAccountDetail> findPaymentExportList(@Param("hlgCpAccountDetail") HlgCpAccountDetailExport hlgCpAccountDetailExport, @Param(Constants.WRAPPER) QueryWrapper<HlgCpAccountDetailExport> queryWrapper);
+
+    List<HlgCpAccountDetail> findHlgCpAccountDetailListByCompanyId(String id);
 }
 }

+ 10 - 0
happy-boot-module-powerjob/src/main/java/org/jeecg/modules/hlgcpmanager/mapper/xml/HlgCpAccountDetailMapper.xml

@@ -383,4 +383,14 @@
 		<include refid="hlgCpAccountDetailJoins"/>
 		<include refid="hlgCpAccountDetailJoins"/>
 		WHERE a.account_detail_id = #{accountDetailId}
 		WHERE a.account_detail_id = #{accountDetailId}
 	</select>
 	</select>
+
+
+	<select id="findHlgCpAccountDetailListByCompanyId" resultType="org.jeecg.modules.hlgcpmanager.entity.HlgCpAccountDetail" >
+		SELECT
+		a.*
+		FROM hlg_cp_account_detail a
+		left join hlg_cp_account hca on hca.id=a.cp_account_id
+		left join hlg_company hc on hc.id=hca.company_id
+		WHERE hc.id = #{0}
+	</select>
 </mapper>
 </mapper>