Browse Source

发布岗位接口添加补全公司名称(企业已经认证过情况下)

LiFei 6 years ago
parent
commit
afe8a31d4e

+ 2 - 0
happy-boot-module-hppay/src/main/java/org/jeecg/modules/company/mapper/CompanyAuthenticationMapper.java

@@ -18,4 +18,6 @@ public interface CompanyAuthenticationMapper extends BaseMapper<CompanyAuthentic
     List<CompanyAuthentication> queryPageList1(Page<CompanyAuthentication> page,@Param("CompanyAuthentication") CompanyAuthentication companyAuthentication);
 
     List<CompanyAuthentication> getEnterpriseList(@Param("CompanyAuthentication") CompanyAuthentication companyAuthentication);
+
+    String findCompanyName(@Param("userId") int i);
 }

+ 11 - 0
happy-boot-module-hppay/src/main/java/org/jeecg/modules/company/mapper/xml/CompanyAuthenticationMapper.xml

@@ -57,4 +57,15 @@
 
     </select>
 
+
+
+    <select id="findCompanyName" resultType="String">
+        SELECT
+        a.enterprise_name
+        FROM dp_enterprise_authentication a
+        <where>
+            a.user_id=#{userId} and a.authentication_status=3
+        </where>
+
+    </select>
 </mapper>

+ 1 - 1
happy-boot-module-hppay/src/main/java/org/jeecg/modules/company/service/impl/CompanyAuthenticationServiceImpl.java

@@ -217,7 +217,7 @@ public class CompanyAuthenticationServiceImpl extends ServiceImpl<CompanyAuthent
                 message.setTitle("企业认证通过审核");
                 message.setContent("您的企业信息已通过审核");
                 List<Position> list=positionMapper.findPosition(companyAuthentication.getUserId());
-                if(list.size()<0){
+                if(list.size()>0){
                     for (int i = 0; i <list.size() ; i++) {
                         Position position=list.get(i);
                         position.setEnterpriseName(companyAuthentication.getEnterpriseName());

+ 1 - 1
happy-boot-module-hppay/src/main/java/org/jeecg/modules/hpposition/mapper/xml/PositionMapper.xml

@@ -266,7 +266,7 @@
 		<include refid="positionColumns"/>
 		FROM dp_position a
 		<where>
-			a.user_id = #{userId}
+			a.user_id = #{userId} and a.enterprise_name is null
 		</where>
 	</select>
 </mapper>

+ 25 - 3
happy-boot-module-hppay/src/main/java/org/jeecg/modules/hpposition/service/impl/PositionServiceImpl.java

@@ -8,6 +8,7 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.util.CommUtil;
 import org.jeecg.common.util.StringUtils;
 import org.jeecg.modules.api.dpposition.entity.PositionAPI;
+import org.jeecg.modules.company.mapper.CompanyAuthenticationMapper;
 import org.jeecg.modules.hpposition.entity.Position;
 import org.jeecg.modules.hpposition.entity.PositionAddress;
 import org.jeecg.modules.hpposition.mapper.PositionMapper;
@@ -41,6 +42,8 @@ public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position> i
     private PositionMapper positionMapper;
     @Resource
     private IMessageService iMessageService;
+    @Resource
+    private CompanyAuthenticationMapper companyAuthenticationMapper;
     @Autowired
     private IPositionAddressService positionAddressService;
     @Value("${jeecg.c_port.path}")
@@ -344,8 +347,17 @@ public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position> i
                     positionAddressService.save(positionAddress);
                 }
             }
-
-
+            String  companyName = companyAuthenticationMapper.findCompanyName(Integer.parseInt(userId));
+            if (StringUtils.isNotBlank(companyName)) {
+                List<Position> list=positionMapper.findPosition(Integer.parseInt(userId));
+                if(list.size()>0){
+                    for (int i = 0; i <list.size() ; i++) {
+                        Position position1=list.get(i);
+                        position1.setEnterpriseName(companyName);
+                        positionMapper.changePositionName(position);
+                    }
+                }
+            }
         } else {
             returnMap.put("success", "1004");
         }
@@ -450,7 +462,17 @@ public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position> i
                     positionAddressService.save(positionAddress);
                 }
             }
-
+            String  companyName = companyAuthenticationMapper.findCompanyName(Integer.parseInt(userId));
+            if (StringUtils.isNotBlank(companyName)) {
+                List<Position> list=positionMapper.findPosition(Integer.parseInt(userId));
+                if(list.size()>0){
+                    for (int i = 0; i <list.size() ; i++) {
+                        Position position1=list.get(i);
+                        position1.setEnterpriseName(companyName);
+                        positionMapper.changePositionName(position);
+                    }
+                }
+            }
 
         } else {
             returnMap.put("success", "1004");