Browse Source

发起修改

anderx 1 year ago
parent
commit
94683f7af1

+ 2 - 0
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -246,4 +246,6 @@ public interface UserMapper {
     List<AdminUserCount>selectListByaidAndDate(String  aid);
 
     List<CustomerSimpleBo> getRestrictCustomerByName(@Param("name") String name, @Param("aid") String aid);
+
+    int getCountRestrictProject(@Param("uid") String uid, @Param("aid") String aid);
 }

+ 1 - 1
src/main/java/com/goafanti/common/mapper/BusinessProjectMapper.xml

@@ -274,7 +274,7 @@
     <select id="findProjectListByPage" resultType="com.goafanti.business.bo.BusinessProjectBo">
         select b.id, b.create_id as createId, b.create_time as createTime, b.update_time as updateTime,  b.delete_sign deleteSign, b.bname,
         b.cid,  b.price,  b.offset,  b.activity_price as activityPrice,  b.activity_flag as activityFlag,  b.member_price as memberPrice,
-        b.introduce,  b.status,  b.country,  b.province,  b.city,  b.district, b.type,
+        b.introduce,  b.status,  b.country,  b.province,  b.city,  b.district, b.type,b.restrict_status as restrictStatus,
         b.principal_id as principalId,  b.Value_effect as ValueEffect,  b.client_size as  clientSize,b2.cname
         from business_project b
         left join business_category b2 on b.cid = b2.id

+ 7 - 0
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -2370,4 +2370,11 @@ inner join(
 		  and a.aid = #{aid}
 		  and b.nickname like concat('%',#{name},'%')
 	</select>
+	<select id="getCountRestrictProject" resultType="integer">
+		select count(*)
+		from restrict_project a left join user b on a.uid =b.id
+		where a.`type` in (1,2)
+		  and a.aid = #{aid}
+		and b.id= #{uid}
+	</select>
 </mapper>

+ 22 - 17
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -88,6 +88,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		}
 		Map checkOrderNo =null;
 		if (in.getType() == 1) {
+			//技术公出
 			checkOrderNo = checkOrderNoDuration(in,my,1);
 			boolean isValid = (boolean) checkOrderNo.get("code");
 			if (isValid){
@@ -219,23 +220,27 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			//不是业务员
 			if (in.getType()==0){
 				if (my.getPublicPurview()==0){
-					users.forEach(u->{
-						if (!u.getAid().equals(my.getId())){
-							StringBuffer str2=new StringBuffer();
-							str2=str2.append(my.getName()).append("(需审核),准备公出您的企业");
-							str2=str2.append("[").append(u.getNickname()).append("]!!!。");
-							sendEmailAndNoticeAndSoucket(u.getAid(),3,str2.toString());
-							Admin admin = adminMapper.selectByPrimaryKey(u.getAid());
-							if (in.getType()==0){
-								//不是自己的企业则需要审核并设置非自己客户待审核
-								addPublicExamine(in.getId(), admin);
-								if(in.getPublicType()==null|| in.getPublicType()==0)in.setPublicType(1);
-							}
-							pushNoticeAndSoucketAndEmail(my, in, date, admin, str, map);
-							status.set(0);
-						}
-					});
-				}else {
+                    for (User u : users) {
+                        if (!u.getAid().equals(my.getId())) {
+                            StringBuffer str2 = new StringBuffer();
+                            str2 = str2.append(my.getName()).append("(需审核),准备公出您的企业");
+                            str2 = str2.append("[").append(u.getNickname()).append("]!!!。");
+                            sendEmailAndNoticeAndSoucket(u.getAid(), 3, str2.toString());
+                            Admin admin = adminMapper.selectByPrimaryKey(u.getAid());
+                            if (in.getType() == 0) {
+                                //不是自己的企业则需要审核并设置非自己客户待审核
+                                //新增限定项目逻辑,如果是我的限定项目,则可以公出,不是则需要审核
+								int countRestrictProject = userMapper.getCountRestrictProject(u.getId(), my.getId());
+								if (countRestrictProject==0){
+									addPublicExamine(in.getId(), admin);
+									if (in.getPublicType() == null || in.getPublicType() == 0) in.setPublicType(1);
+								}
+                            }
+                            pushNoticeAndSoucketAndEmail(my, in, date, admin, str, map);
+                            status.set(0);
+                        }
+                    }
+                }else {
 					users.forEach(u->{
 						if (!u.getAid().equals(my.getId())){
 							StringBuffer str2=new StringBuffer();

+ 7 - 7
src/main/resources/props/config_local.properties

@@ -1,16 +1,16 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
 
-static.host=//static.jishutao.com/1.3.15
-#static.host=//172.16.1.187/1.3.15
+#static.host=//static.jishutao.com/1.3.15
+static.host=//172.16.1.187/1.3.15
 
 #jdbc.url=jdbc\:mysql://localhost:3306/aft20240430?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-jdbc.username=root
-jdbc.password=123456
-#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.username=root
-#jdbc.password=aftdev
+#jdbc.password=123456
+jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.username=root
+jdbc.password=aftdev
 jdbc.validationQuery=SELECT 'x'
 jdbc.initialSize=3
 jdbc.maxActive=20