yonge 3 éve
szülő
commit
8f32e9ac08

+ 17 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ContractServiceImpl.java

@@ -115,6 +115,9 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 
     @Autowired
     private EmployeeDao employeeDao;
+    
+    @Autowired
+    private TenantInfoService tenantInfoService;
 
     @Value("${contract.baseDir:/var/pdf}")
     private String contractBaseDir;
@@ -924,11 +927,20 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 
 
         String organCode = "";
-        if (OwnershipType.OWN.name().equals(params.get("ownershipType"))) {
-            organCode = "91440300326364429H";
-        } else {
-            organCode = "91420106333619290A";
-        }
+        
+		if (user.getTenantId() == 1) {
+			if (OwnershipType.OWN.name().equals(params.get("ownershipType"))) {
+				organCode = "91440300326364429H";
+			} else {
+				organCode = "91420106333619290A";
+			}
+		} else {
+			TenantInfo tenantInfo = tenantInfoService.get(user.getTenantId());
+			if(tenantInfo == null){
+				throw new BizException("机构信息不存在");
+			}
+			organCode = tenantInfo.getTsignCode();
+		}
         SysUserTsign organTsign = sysUserTsignService.queryByCardNo(organCode);
         if (organTsign == null) {
             logger.error("甲方未创建签章");