Browse Source

Merge branch 'test' of jishutao/kede-server into prod

gitadmin 2 days ago
parent
commit
ecc7940f3e

+ 4 - 0
Dockerfile

@@ -0,0 +1,4 @@
+FROM eclipse-temurin:1.8-jre-alpine
+WORKDIR /app
+COPY test.jar test.jar
+ENTRYPOINT ["java", "-jar", "test.jar"]

+ 31 - 29
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -329,7 +329,7 @@
 	</select>
 
 	<select id="selectOrganizationCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
-	 	select DISTINCT
+	 	select
 		a.id as uid,
 			a.nickname as name,
 			date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
@@ -344,29 +344,30 @@
 	 		a.new_channel as newChannel,
 	 		a.level,
 			b.org_code orgCode
-
 		from  `user` a
-		left join user_names un on a.id=un.uid
+		inner join (SELECT DISTINCT uid FROM user_names
+		<if test="role == 0">
+			<if test="names !=null">
+				WHERE name in
+				<foreach close=")" collection="names" item="name" open="(" separator=",">
+					#{name}
+				</foreach>
+			</if>
+			<if test="names ==null and orgCode==null">
+				is null
+			</if>
+		</if>
+		<if test="role == 1 and name != null">
+			WHERE name like concat('%', #{name},'%')
+		</if>
+		                                               ) un on a.id=un.uid
 		left join organization_identity b on a.id = b.uid
 		left join district_glossory dg1 on b.location_province = dg1.id
 		left join district_glossory dg2 on b.location_city = dg2.id
 		left join district_glossory dg3 on b.location_area = dg3.id
 		left join admin d on a.aid = d.id
 		where a.type = 1 and a.status =0 and a.source in (1,2,3)
-	<if test="role == 0">
-		<if test="names !=null">
-			and un.name in
-		<foreach close=")" collection="names" item="name" open="(" separator=",">
-			#{name}
-		</foreach>
-		</if>
-		<if test="names ==null and orgCode==null">
-			is null
-		</if>
-	</if>
-	<if test="role == 1 and name != null">
-		and un.name like concat('%', #{name},'%')
-	</if>
+
 	<if test="aid != null and aid !=''">
 		and a.aid = #{aid,jdbcType=VARCHAR}
 	</if>
@@ -400,17 +401,10 @@
 		select
 		count(0)
 		from(select a.id from `user` a
-		left join user_names un on a.id=un.uid
-		left join organization_identity b on a.id = b.uid
-		<if test="departmentId != null and departmentId !=''">
-		INNER join (select id
-		from admin
-		where department_id=#{departmentId,jdbcType=VARCHAR}) d on a.aid = d.id
-		</if>
-		where a.type = 1 and a.status =0 and a.source in (1,2,3)
+		inner join (SELECT DISTINCT uid FROM user_names
 		<if test="role == 0">
 			<if test="names !=null">
-				and un.name in
+				WHERE name in
 				<foreach close=")" collection="names" item="name" open="(" separator=",">
 					#{name}
 				</foreach>
@@ -419,9 +413,17 @@
 				is null
 			</if>
 		</if>
-	<if test="role == 1 and name != null">
-		and un.name like concat('%', #{name},'%')
-	</if>
+		<if test="role == 1 and name != null">
+			WHERE name like concat('%', #{name},'%')
+		</if>
+		) un on a.id=un.uid
+		left join organization_identity b on a.id = b.uid
+		<if test="departmentId != null and departmentId !=''">
+		INNER join (select id
+		from admin
+		where department_id=#{departmentId,jdbcType=VARCHAR}) d on a.aid = d.id
+		</if>
+		where a.type = 1 and a.status =0 and a.source in (1,2,3)
 		<if test="aid != null and aid !=''">
 			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>

+ 5 - 1
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -463,7 +463,11 @@ public class AdminCustomerApiController extends BaseApiController{
 		return res;
 	}
 
-	/** 查看客户联系人列表 **/
+	/**
+	 * 查看客户联系人列表
+	 * @param uid 客户编号
+	 * @param type 联系人类型 0=我的联系人 1=所有联系人
+	 * **/
 	@RequestMapping(value = "/findCustomerContacts", method = RequestMethod.GET)
 	public Result findCustomerContacts(String uid,Integer type){
 		Result res = new Result();

+ 10 - 5
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -742,14 +742,15 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 //			}
 		}else {
 			list = userMapper.findCustomerContacts(uid, null);
-			for (OrganizationContactBook ob : list) {
-				if (!ob.getAid().equals(TokenManager.getAdminId())){
-					ob.setName("***");
-					ob.setMobile("***");
+			if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)){
+				for (OrganizationContactBook ob : list) {
+					if (!ob.getAid().equals(TokenManager.getAdminId())){
+						ob.setName("***");
+						ob.setMobile("***");
+					}
 				}
 			}
 		}
-
 		return list;
 	}
 
@@ -1995,6 +1996,10 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		ocb.setId(UUID.randomUUID().toString());
 		Admin ad = adminMapper.selectById(TokenManager.getAdminId());
 		ocb.setAname(ad.getName());
+		User u =userMapper.queryById(ocb.getUid());
+		if (!u.getAid().equals(TokenManager.getAdminId())&&ocb.getMajor()==1){
+			throw new BusinessException("非客户归属人不能设置主要联系人");
+		}
 		if (ocb.getMajor()==1){
 			organizationContactBookMapper.updateSubContact(ocb.getUid());
 			OrganizationIdentity n=new OrganizationIdentity();

+ 1 - 13
src/main/java/com/goafanti/weChat/controller/AdminReleaseApiController.java

@@ -129,19 +129,7 @@ public class AdminReleaseApiController extends CertifyApiController{
 			return res;
 		}
 
-			if (StringUtils.isNotBlank(in.getReleaseStarts())&&StringUtils.isNotBlank(in.getReleaseEnds())){
-				try {
-					String format = AFTConstants.YYYYMMDDHHMMSS;
-				if (in.getType()==5){
-					format = AFTConstants.YYYYMMDD;
-				}
-				in.setReleaseStart(DateUtils.parseDate(in.getReleaseStarts(), format));
-				in.setReleaseEnd(DateUtils.parseDate(in.getReleaseEnds(), format));
-				} catch (ParseException e) {
-					e.printStackTrace();
-					throw new BusinessException("转换异常");
-				}
-			}
+
 
 		if (in.getStatus()!=3&&in.getType()<4) {
 			int i = publicReleaseService.checkTime(in);

+ 16 - 3
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -665,6 +665,18 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 				in.setTechStartProcess(0);
 			}
 
+				try {
+					String format = AFTConstants.YYYYMMDDHHMMSS;
+					if (in.getType()==5){
+						format = AFTConstants.YYYYMMDD;
+					}
+					in.setReleaseStart(DateUtils.parseDate(in.getReleaseStarts(), format));
+					in.setReleaseEnd(DateUtils.parseDate(in.getReleaseEnds(), format));
+				} catch (ParseException e) {
+					e.printStackTrace();
+					throw new BusinessException("转换异常");
+				}
+
 			if (in.getAssist()==1){
 				in.setAssistProcess(1);
 				//在有协单的情况下,新增是审核完成才新增,修改是审核完成才修改。
@@ -1105,7 +1117,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 								}
 							}
 							if (str.length()>1)e.setAdminExamine(str.substring(0,str.length()-1)+" 未审核");
-						}else if ((e.getType()==0||e.getType()>4)&&e.getAssistProcess()==2){
+						}else if ((e.getType()==0||e.getType()>4)&&(e.getAssistProcess()==2||e.getAssistProcess()==3)){
 							//获取技术协单
 							List<PublicRelease> publicReleases = publicReleaseMapper.selectByMainId(e.getId(), null, null);
 							StringBuffer str =new StringBuffer();
@@ -1470,6 +1482,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		}else if(status==2){
 			content+="已通过审核。";
 			addpublicLog(id, status, remarks);
+			//通过先修改协单的状态
 			for (PublicRelease e : publicReleases) {
 				PublicRelease newPublic2=new PublicRelease();
 				newPublic2.setId(e.getId());
@@ -2277,7 +2290,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 							outPublicReleaseLog.setAname(str.substring(0,str.length()-1));
 							list.add(outPublicReleaseLog);
 						}
-					}else if ((e.getType()==0||e.getType()==5)&&e.getAssistProcess()==2){
+					}else if ((e.getType()==0||e.getType()==5)&&(e.getAssistProcess()==2||e.getAssistProcess()==3)){
 						//获取技术协单
 						List<PublicRelease> publicReleases = publicReleaseMapper.selectByMainId(e.getId(), null, null);
 						StringBuffer str =new StringBuffer();
@@ -2652,7 +2665,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 				}
 				//业务公出且协单部分审核(看着流程有点问题)
 			}else if ((out.getType()==0||out.getType()==5)
-					&& out.getAssistProcess()==2){
+					&& (out.getAssistProcess()==2 || out.getAssistProcess()==3)){
 				//获取技术协单
 				List<PublicRelease> publicReleases = publicReleaseMapper.selectByMainId(out.getId(), null, null);
 				List<String> names=new ArrayList<>();

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

@@ -7,7 +7,7 @@ static.host=//static.jishutao.com/${kede.version}
 #static.host=//172.16.1.187/${kede.version}
 #avatar.host=//172.16.1.199:3000
 
-#jdbc.url=jdbc\:mysql://localhost:3306/aft20250313?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.url=jdbc\:mysql://localhost:3306/aft20250613?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