Quellcode durchsuchen

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

anderx vor 3 Jahren
Ursprung
Commit
41a8b028c9

+ 1 - 0
src/main/java/com/goafanti/common/dao/BusinessProjectMapper.java

@@ -49,4 +49,5 @@ public interface BusinessProjectMapper {
 
 
     List<Map> selectProjectAndTypeAll();
+
 }

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

@@ -572,4 +572,5 @@
         left join business_project bp on bc.id =bp.cid group by bc.id
     </select>
 
+
 </mapper>

+ 24 - 2
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -367,8 +367,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 			ui.setAuditStatus(IdentityProcess.SUCCESS.getCode());// 认证个人
 			userIdentityMapper.insert(ui);
 		} else if (in.getType() == UserType.ORGANIZATION.getCode()) {
-			if (userMapper.checkUser("", in.getName(), "", in.getType(), null, null).size() > 0)
-				throw new BusinessException(new Error(ErrorConstants.CUSTOMER_ALREADY_EXIST, in.getName(), ""));
+			checkUserName(in);
 			UserMid um=new UserMid();
 			um.setAid(user.getAid());
 			um.setUid(uid);
@@ -428,6 +427,21 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		return 1;
 	}
 
+	private void checkUserName(InputAddCustomer in) {
+		if (userMapper.checkUser("", in.getName(), "", in.getType(), null, null).size() > 0)
+			throw new BusinessException(new Error(ErrorConstants.CUSTOMER_ALREADY_EXIST, in.getName(), ""));
+		String name2=null;
+		if (in.getName().contains("(")){
+			name2=in.getName().replace("(","(").replace(")",")");
+		}else if (in.getName().contains("(")){
+			name2=in.getName().replace("(","(").replace(")",")");
+		}
+		if (name2!=null){
+			if (userMapper.checkUser("", name2, "", in.getType(), null, null).size() > 0)
+				throw new BusinessException(new Error(ErrorConstants.CUSTOMER_ALREADY_EXIST, name2, ""));
+		}
+	}
+
 	@Override
 	public CustomerPersonalDetailBo findPersonalCustomerDetail(String uid) {
 		return userMapper.findPersonalCustomerDetail(uid);
@@ -2388,7 +2402,15 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 
 	@Override
 	public boolean checkUserName(String userName) {
+		String name2=null;
+		if (userName.contains("(")){
+			name2=userName.replace("(","(").replace(")",")");
+		}else if (userName.contains("(")){
+			name2=userName.replace("(","(").replace(")",")");
+		}
 		int i=userNamesMapper.checkUserName(userName);
+		i+=userNamesMapper.checkUserName(name2);
+
 		if (i>0) {
 			return true;
 		}

+ 33 - 3
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -31,6 +31,7 @@ import com.goafanti.common.utils.StringUtils;
 import groovy.transform.Synchronized;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.cache.annotation.Cacheable;
@@ -194,10 +195,39 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if(t.getCommodityPrice()!=null) {
 			order.setTotalAmount(order.getTotalAmount());
 		}
+		addTTaskMember(t, order);
+		//如果是会员添加同性质不同项目
+		BusinessProject bp=businessProjectMapper.selectByPrimaryKey(t.getCommodityId());
+		if (bp.getType()==ProjectType.HY.getCode()){
+			InputAddTask t2=new InputAddTask();
+			BeanUtils.copyProperties(t,t2);
+			//会员项目替换
+			if (t.getCommodityName().contains("财税")){
+				String t2Name=t.getCommodityName().replaceAll("财税","技术");
+				BusinessProject bp2=businessProjectMapper.selectByPrimaryBname(t2Name);
+				if (bp2==null)return t;
+				t2.setCommodityId(bp2.getId());
+				t2.setCommodityName(bp2.getBname());
+			}else if (t.getCommodityName().contains("技术")){
+				String t2Name=t.getCommodityName().replaceAll("技术","财税");
+				BusinessProject bp2=businessProjectMapper.selectByPrimaryBname(t2Name);
+				if (bp2==null)return t;
+				t2.setCommodityId(bp2.getId());
+				t2.setCommodityName(bp2.getBname());
+			}
+			t2.setMain(0);
+			t2.setCommodityPrice(new BigDecimal(0));
+			t2.setId(null);
+			addTTaskMember(t2, order);
+		}
+		return t;
+	}
+
+	private void addTTaskMember(InputAddTask t, TOrderNew order) {
 		String str=tOrderTaskMapper.selectByidGetCname(t.getCommodityId());
 		t.setCname(str);
 		tOrderTaskMapper.insertSelective(t);
-		if (t.getServiceLife()!=null||t.getServiceYear()!=null||t.getYearSum()!=null||t.getContractTerm()!=null){
+		if (t.getServiceLife()!=null|| t.getServiceYear()!=null|| t.getYearSum()!=null|| t.getContractTerm()!=null){
 			TTaskMember ttm=new TTaskMember();
 			ttm.setTid(t.getId());
 			if(t.getServiceLife()!=null)ttm.setServiceLife(t.getServiceLife());
@@ -206,9 +236,9 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			if(t.getContractTerm()!=null)ttm.setContractTerm(t.getContractTerm());
 			tTaskMemberMapper.insertSelective(ttm);
 		}
-		addTaskMid(t.getId(),t.getCommodityId(), order.getOrderNo());
-		return t;
+		addTaskMid(t.getId(), t.getCommodityId(), order.getOrderNo());
 	}
+
 	@Override
 	public int addTaskMid(Integer id,String commodityId, String orderNo) {
 		TTaskMid tm=new TTaskMid();

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

@@ -46,7 +46,7 @@ user_remind_days=15
 user_channel_days=90
 
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.2.39
+static.host=//static.jishutao.com/1.2.40
 #avatar.host=//172.16.0.255:3000
 #static.host=//172.16.0.255:3000/1.2.27
 #static.host=http://172.16.1.187/prod/1.2.25

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

@@ -43,7 +43,7 @@ user_remind_days=15
 #\u63D0\u524D\u63D0\u9192\u5929\u6570
 user_channel_days=90
 
-static.host=//static.jishutao.com/1.2.39
+static.host=//static.jishutao.com/1.2.40
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload