wanghui 8 vuotta sitten
vanhempi
commit
0e598f69f5

+ 6 - 9
src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java

@@ -96,7 +96,7 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 			Integer boutique, Integer hot) {
 			Integer boutique, Integer hot) {
 		Map<String, Object> params = disposeParams(username, ownerName, ownerId, auditStatus, serialNumber, name, keyword, category, status,
 		Map<String, Object> params = disposeParams(username, ownerName, ownerId, auditStatus, serialNumber, name, keyword, category, status,
 				releaseDateStartDate, releaseDateEndDate, releaseStatus, UserType.ORGANIZATION.getCode(),
 				releaseDateStartDate, releaseDateEndDate, releaseStatus, UserType.ORGANIZATION.getCode(),
-				boutique, hot,TokenManager.getAdminId());
+				boutique, hot);
 		if (pNo == null || pNo < 0) {
 		if (pNo == null || pNo < 0) {
 			pNo = 1;
 			pNo = 1;
 		}
 		}
@@ -121,7 +121,7 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 			Integer boutique, Integer hot) {
 			Integer boutique, Integer hot) {
 		Map<String, Object> params = disposeParams(unitName, ownerName, ownerId, auditStatus, serialNumber, name, keyword, category, status,
 		Map<String, Object> params = disposeParams(unitName, ownerName, ownerId, auditStatus, serialNumber, name, keyword, category, status,
 				releaseDateStartDate, releaseDateEndDate, releaseStatus, UserType.ORGANIZATION.getCode(),
 				releaseDateStartDate, releaseDateEndDate, releaseStatus, UserType.ORGANIZATION.getCode(),
-				boutique, hot,TokenManager.getAdminId());
+				boutique, hot);
 		if (pNo == null || pNo < 0) {
 		if (pNo == null || pNo < 0) {
 			pNo = 1;
 			pNo = 1;
 		}
 		}
@@ -129,9 +129,6 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		if (pSize == null || pSize < 0 || pSize > 10) {
 		if (pSize == null || pSize < 0 || pSize > 10) {
 			pSize = 10;
 			pSize = 10;
 		}
 		}
-		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN) && !TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
-			params.put("adminId", TokenManager.getAdminId());
-		}
 		
 		
 		return (Pagination<AchievementListBo>) findPage("findOrgOwnerAchievementListByPage",
 		return (Pagination<AchievementListBo>) findPage("findOrgOwnerAchievementListByPage",
 				"findOrgOwnerAchievementCount",params,pNo, pSize);
 				"findOrgOwnerAchievementCount",params,pNo, pSize);
@@ -215,14 +212,14 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		}
 		}
 		return (Pagination<AchievementListBo>) findPage("findAchievementListByPage", "findAchievementCount",
 		return (Pagination<AchievementListBo>) findPage("findAchievementListByPage", "findAchievementCount",
 				disposeParams(null, null, TokenManager.getUserId(), auditStatus, serialNumber, name, keyword, category,
 				disposeParams(null, null, TokenManager.getUserId(), auditStatus, serialNumber, name, keyword, category,
-						status, releaseDateStartDate, releaseDateEndDate, releaseStatus, null, null, null,TokenManager.getAdminId()),
+						status, releaseDateStartDate, releaseDateEndDate, releaseStatus, null, null, null),
 				pNo, pSize);
 				pNo, pSize);
 	}
 	}
 
 
 	private Map<String, Object> disposeParams(String username, String ownerName, String ownerId, Integer auditStatus,
 	private Map<String, Object> disposeParams(String username, String ownerName, String ownerId, Integer auditStatus,
 			Integer serialNumber, String name, String keyword, Integer category, Integer status,
 			Integer serialNumber, String name, String keyword, Integer category, Integer status,
 			String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus, Integer type,
 			String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus, Integer type,
-			Integer boutique, Integer hot,String techBrokerId) {
+			Integer boutique, Integer hot) {
 		Map<String, Object> params = new HashMap<>();
 		Map<String, Object> params = new HashMap<>();
 
 
 		Date rStart = null;
 		Date rStart = null;
@@ -299,10 +296,10 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		if (null != hot) {
 		if (null != hot) {
 			params.put("hot", hot);
 			params.put("hot", hot);
 		}
 		}
-		if (TokenManager.hasRole(AFTConstants.TECHBROKER)) {
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN) && !TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
 			params.put("techBrokerId", TokenManager.getAdminId());
 			params.put("techBrokerId", TokenManager.getAdminId());
 		}
 		}
-
+		
 		return params;
 		return params;
 	}
 	}
 
 

+ 1 - 0
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -8,6 +8,7 @@ import java.util.TreeMap;
 
 
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import com.goafanti.admin.bo.AdminDetail;
 import com.goafanti.admin.bo.AdminDetail;

+ 4 - 0
src/main/java/com/goafanti/common/constant/ErrorConstants.java

@@ -107,4 +107,8 @@ public class ErrorConstants {
 	public static final String MARKET_BOOTH_MAX						= "MARKET_BOOTH_MAX";	
 	public static final String MARKET_BOOTH_MAX						= "MARKET_BOOTH_MAX";	
 	
 	
 	public static final String CUSTOMER_ALREADY_EXIST				= "CUSTOMER_ALREADY_EXIST";
 	public static final String CUSTOMER_ALREADY_EXIST				= "CUSTOMER_ALREADY_EXIST";
+	
+	public static final String BUSINESS_ALREADY_EXIST				= "BUSINESS_ALREADY_EXIST";
+	
+	public static final String AT_LEAST_A_BUSINESS					= "AT_LEAST_A_BUSINESS";
 }
 }

+ 1 - 9
src/main/java/com/goafanti/common/controller/PortalController.java

@@ -316,7 +316,7 @@ public class PortalController extends BaseController {
 			if (StringUtils.isNotBlank(achievementdetail.getFieldBS())) {
 			if (StringUtils.isNotBlank(achievementdetail.getFieldBS())) {
 				b = Boolean.TRUE;
 				b = Boolean.TRUE;
 			}
 			}
-
+			
 			field += (a ? achievementdetail.getFieldAS() : "") + (a && b ? DELIMITER : "")
 			field += (a ? achievementdetail.getFieldAS() : "") + (a && b ? DELIMITER : "")
 					+ (b ? achievementdetail.getFieldBS() : "");
 					+ (b ? achievementdetail.getFieldBS() : "");
 			achievementdetail.setField(field);
 			achievementdetail.setField(field);
@@ -324,7 +324,6 @@ public class PortalController extends BaseController {
 			if (StringUtils.isNotBlank(technicalPictureUrl)) {
 			if (StringUtils.isNotBlank(technicalPictureUrl)) {
 				achievementdetail.setPictureList(Arrays.asList(technicalPictureUrl.trim().split(",|,")));
 				achievementdetail.setPictureList(Arrays.asList(technicalPictureUrl.trim().split(",|,")));
 			}
 			}
-
 			Integer transfermode = achievementdetail.getTransferMode();
 			Integer transfermode = achievementdetail.getTransferMode();
 			if (null != transfermode) {
 			if (null != transfermode) {
 				if (AchievementTransferMode.FULLTRANSFER.getCode().equals(transfermode)) {
 				if (AchievementTransferMode.FULLTRANSFER.getCode().equals(transfermode)) {
@@ -361,7 +360,6 @@ public class PortalController extends BaseController {
 					achievementdetail.setTechnicalPictureUrl(picurl[0]);
 					achievementdetail.setTechnicalPictureUrl(picurl[0]);
 				}
 				}
 			}
 			}
-
 			String location = "";
 			String location = "";
 			String province = achievementdetail.getProvince();
 			String province = achievementdetail.getProvince();
 			String city = achievementdetail.getCity();
 			String city = achievementdetail.getCity();
@@ -381,7 +379,6 @@ public class PortalController extends BaseController {
 			achievementdetail.setLocation(location);
 			achievementdetail.setLocation(location);
 
 
 		}
 		}
-
 		// 查询精品成果
 		// 查询精品成果
 		List<AchievementListBo> boutiqueachievement = achievementService.getAchievement(1);
 		List<AchievementListBo> boutiqueachievement = achievementService.getAchievement(1);
 		List<AchievementListBo> reboutiqueachievement = new ArrayList<AchievementListBo>();
 		List<AchievementListBo> reboutiqueachievement = new ArrayList<AchievementListBo>();
@@ -406,7 +403,6 @@ public class PortalController extends BaseController {
 			}
 			}
 		}
 		}
 		;
 		;
-
 		// 判断登录没登录. 登录了.查找用户喜欢的. 没登录就随机查四个.
 		// 判断登录没登录. 登录了.查找用户喜欢的. 没登录就随机查四个.
 		boolean isLogin = TokenManager.isLogin();
 		boolean isLogin = TokenManager.isLogin();
 		List<AchievementListBo> achievementlist = achievementService.getAchievement(0);// 查询所有专利
 		List<AchievementListBo> achievementlist = achievementService.getAchievement(0);// 查询所有专利
@@ -435,7 +431,6 @@ public class PortalController extends BaseController {
 				reachievementlist.set(i, customerlikelist.get(i));
 				reachievementlist.set(i, customerlikelist.get(i));
 			}
 			}
 		}
 		}
-
 		/*----------------------------------------------------------*/
 		/*----------------------------------------------------------*/
 
 
 		for (int i = 0; i < reachievementlist.size(); i++) {
 		for (int i = 0; i < reachievementlist.size(); i++) {
@@ -483,7 +478,6 @@ public class PortalController extends BaseController {
 					reachievementlist.get(i).setOwnerTypeS("组织所有");
 					reachievementlist.get(i).setOwnerTypeS("组织所有");
 				}
 				}
 			}
 			}
-
 			Integer transfermode = reachievementlist.get(i).getTransferMode();
 			Integer transfermode = reachievementlist.get(i).getTransferMode();
 			if (null != transfermode) {
 			if (null != transfermode) {
 				if (AchievementTransferMode.FULLTRANSFER.getCode().equals(transfermode)) {
 				if (AchievementTransferMode.FULLTRANSFER.getCode().equals(transfermode)) {
@@ -497,7 +491,6 @@ public class PortalController extends BaseController {
 							.setTransferModeS(AchievementTransferMode.EXCLUSIVETECHNOLOGYSHARES.getDesc());
 							.setTransferModeS(AchievementTransferMode.EXCLUSIVETECHNOLOGYSHARES.getDesc());
 				}
 				}
 			}
 			}
-
 			Integer maturity = reachievementlist.get(i).getMaturity();
 			Integer maturity = reachievementlist.get(i).getMaturity();
 			if (null != maturity) {
 			if (null != maturity) {
 				if (AchievementMaturity.RESEARCH.getCode().equals(maturity)) {
 				if (AchievementMaturity.RESEARCH.getCode().equals(maturity)) {
@@ -513,7 +506,6 @@ public class PortalController extends BaseController {
 				}
 				}
 			}
 			}
 			;
 			;
-
 			String pic = reachievementlist.get(i).getTechnicalpictureurl();// 在存在多张图片的情况下,暂时先取第一张
 			String pic = reachievementlist.get(i).getTechnicalpictureurl();// 在存在多张图片的情况下,暂时先取第一张
 			if (null != pic) {
 			if (null != pic) {
 				boolean hascomma = pic.contains(",");
 				boolean hascomma = pic.contains(",");

+ 5 - 21
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -864,19 +864,11 @@
 		left join marketing_management mm on a.id = mm.product_id 
 		left join marketing_management mm on a.id = mm.product_id 
 	</if>
 	</if>
   	where a.deleted_sign = 0 and a.owner_type = 1
   	where a.deleted_sign = 0 and a.owner_type = 1
-  	<if test="adminId != null">
-		and (u.mid = #{adminId,jdbcType=VARCHAR}
-	</if>
-	<if test="adminId != null">
-		or  a.salesman_id = #{adminId,jdbcType=VARCHAR}
-	</if>
-	<if test="adminId != null">
-		or  a.tech_broker_id = #{adminId,jdbcType=VARCHAR}
-		)
+  	<if test="techBrokerId != null">
+		a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
 	</if>
 	</if>
   	<if test="ownerName != null">
   	<if test="ownerName != null">
-  		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
-  		and  (a.owner_id is null or a.owner_id = '')
+  		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%') 	
   	</if>
   	</if>
   	<if test="unitName != null">
   	<if test="unitName != null">
   		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
   		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
@@ -945,19 +937,11 @@
 		left join marketing_management mm on a.id = mm.product_id 
 		left join marketing_management mm on a.id = mm.product_id 
 	</if>
 	</if>
   	where a.deleted_sign = 0 and a.owner_type = 1
   	where a.deleted_sign = 0 and a.owner_type = 1
-  	<if test="adminId != null">
-		and (u.mid = #{adminId,jdbcType=VARCHAR}
-	</if>
-	<if test="adminId != null">
-		or  a.salesman_id = #{adminId,jdbcType=VARCHAR}
-	</if>
-	<if test="adminId != null">
-		or  a.tech_broker_id = #{adminId,jdbcType=VARCHAR}
-		)
+  	<if test="techBrokerId != null">
+		a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
 	</if>
 	</if>
   	<if test="ownerName != null">
   	<if test="ownerName != null">
   		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
   		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
-  		and  (a.owner_id is null or a.owner_id = '')
   	</if>
   	</if>
   	<if test="unitName != null">
   	<if test="unitName != null">
   		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
   		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')

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

@@ -314,7 +314,7 @@
 			a.create_time as followTime,
 			a.create_time as followTime,
 			a.contact_type as contactType,
 			a.contact_type as contactType,
 			a.result, 
 			a.result, 
-			b.identify_name as identityName,
+			b.identify_name as identifyName,
 			c.name as contacts,
 			c.name as contacts,
 			c.mobile as contactMobile,
 			c.mobile as contactMobile,
 			d.name as adminName
 			d.name as adminName

+ 9 - 8
src/main/java/com/goafanti/common/utils/ExcelUtils.java

@@ -18,13 +18,14 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import com.goafanti.customer.bo.CustomerExcelBo;
 import com.goafanti.customer.bo.CustomerExcelBo;
 
 
 public class ExcelUtils {
 public class ExcelUtils {
-	private Set repeatRows = new TreeSet<Integer>(); //数据重复的
-	private Set vacantRows = new TreeSet<Integer>(); //数据不完整的
+	private Set<Integer> repeatRows = new TreeSet<Integer>(); //数据重复的
+	private Set<Integer> vacantRows = new TreeSet<Integer>(); //数据不完整的
 	DecimalFormat df = new DecimalFormat("0");  
 	DecimalFormat df = new DecimalFormat("0");  
+	@SuppressWarnings({ "unused", "resource" })
 	public  List<CustomerExcelBo> parseExcel(String excelPath) throws IOException{
 	public  List<CustomerExcelBo> parseExcel(String excelPath) throws IOException{
 		InputStream excelFile = new FileInputStream(new File(excelPath));
 		InputStream excelFile = new FileInputStream(new File(excelPath));
 		XSSFWorkbook wb = new XSSFWorkbook(excelFile);	
 		XSSFWorkbook wb = new XSSFWorkbook(excelFile);	
-		List result = new ArrayList<CustomerExcelBo>();
+		List<CustomerExcelBo> result = new ArrayList<CustomerExcelBo>();
 		XSSFSheet sheet = wb.getSheetAt(0);
 		XSSFSheet sheet = wb.getSheetAt(0);
 		Iterator<Row> rowIterator = sheet.iterator();
 		Iterator<Row> rowIterator = sheet.iterator();
 		Row currentRow = rowIterator.next(); //表头
 		Row currentRow = rowIterator.next(); //表头
@@ -41,7 +42,7 @@ public class ExcelUtils {
 		return result;
 		return result;
 	}
 	}
 	
 	
-	@SuppressWarnings("unchecked")
+	@SuppressWarnings("unused")
 	private String checkCustomerType(String customerType,int rowNumber){
 	private String checkCustomerType(String customerType,int rowNumber){
 		if(StringUtils.isEmpty(customerType)) {
 		if(StringUtils.isEmpty(customerType)) {
 			vacantRows.add(rowNumber);
 			vacantRows.add(rowNumber);
@@ -53,7 +54,7 @@ public class ExcelUtils {
 		vacantRows.add(rowNumber);
 		vacantRows.add(rowNumber);
 		return "";
 		return "";
 	}
 	}
-	@SuppressWarnings("unchecked")
+	@SuppressWarnings("unused")
 	private String checkFollowSituation(String followSituation,int rowNumber){
 	private String checkFollowSituation(String followSituation,int rowNumber){
 		if(StringUtils.isEmpty(followSituation)){
 		if(StringUtils.isEmpty(followSituation)){
 			vacantRows.add(rowNumber);
 			vacantRows.add(rowNumber);
@@ -71,7 +72,7 @@ public class ExcelUtils {
 		vacantRows.add(rowNumber);
 		vacantRows.add(rowNumber);
 		return "";
 		return "";
 	}
 	}
-	@SuppressWarnings("unchecked")
+	@SuppressWarnings("unused")
 	private String checkCustomerStatus(String customerStatus,int rowNumber){
 	private String checkCustomerStatus(String customerStatus,int rowNumber){
 		if(StringUtils.isEmpty(customerStatus)) {
 		if(StringUtils.isEmpty(customerStatus)) {
 			vacantRows.add(rowNumber);
 			vacantRows.add(rowNumber);
@@ -92,7 +93,7 @@ public class ExcelUtils {
 
 
 		return flag;
 		return flag;
 	}
 	}
-	@SuppressWarnings("unchecked")
+	@SuppressWarnings("unused")
 	private String checkCompanyIntention(String companyIntention,int rowNumber){
 	private String checkCompanyIntention(String companyIntention,int rowNumber){
 		if(StringUtils.isEmpty(companyIntention)){
 		if(StringUtils.isEmpty(companyIntention)){
 			vacantRows.add(rowNumber);
 			vacantRows.add(rowNumber);
@@ -114,7 +115,7 @@ public class ExcelUtils {
 		return "";
 		return "";
 	}
 	}
 	
 	
-	@SuppressWarnings("unchecked")
+	@SuppressWarnings("unused")
 	private String checkOther(String cellValue,int rowNumber){
 	private String checkOther(String cellValue,int rowNumber){
 		if(StringUtils.isEmpty(cellValue)){
 		if(StringUtils.isEmpty(cellValue)){
 			vacantRows.add(rowNumber);
 			vacantRows.add(rowNumber);

+ 5 - 5
src/main/java/com/goafanti/customer/bo/FollowBusinessBo.java

@@ -15,7 +15,7 @@ public class FollowBusinessBo {
 	/** 客户ID **/
 	/** 客户ID **/
 	private String uid;
 	private String uid;
 	/** 客户名 **/
 	/** 客户名 **/
-	private String identityName;
+	private String identifyName;
 	/** 当前联系人姓名 **/
 	/** 当前联系人姓名 **/
 	private String contacts;
 	private String contacts;
 	/** 当前联系电话 **/
 	/** 当前联系电话 **/
@@ -45,11 +45,11 @@ public class FollowBusinessBo {
 	public void setUid(String uid) {
 	public void setUid(String uid) {
 		this.uid = uid;
 		this.uid = uid;
 	}
 	}
-	public String getIdentityName() {
-		return identityName;
+	public String getIdentifyName() {
+		return identifyName;
 	}
 	}
-	public void setIdentityName(String identityName) {
-		this.identityName = identityName;
+	public void setIdentifyName(String identifyName) {
+		this.identifyName = identifyName;
 	}
 	}
 	public String getContacts() {
 	public String getContacts() {
 		return contacts;
 		return contacts;

+ 3 - 3
src/main/java/com/goafanti/customer/controller/CustomerApiController.java

@@ -101,9 +101,9 @@ public class CustomerApiController extends BaseController{
 	 * @throws Exception 
 	 * @throws Exception 
 	 * @throws NumberFormatException **/
 	 * @throws NumberFormatException **/
 	@RequestMapping(value = "/addCustomer", method = RequestMethod.POST)
 	@RequestMapping(value = "/addCustomer", method = RequestMethod.POST)
-	public Result addCustomer(String name,String contacts,String contactMobile,String type) throws Exception{
+	public Result addCustomer(String name,String contacts,String contactMobile,String type,String societyTag) throws Exception{
 		Result res = new Result();
 		Result res = new Result();
-		customerService.addCustomer(name, contacts, contactMobile, Integer.parseInt(type));
+		customerService.addCustomer(name, contacts, contactMobile, Integer.parseInt(type),societyTag);
 		return res;
 		return res;
 	}
 	}
 	
 	
@@ -188,7 +188,7 @@ public class CustomerApiController extends BaseController{
 		FollowBusinessBo fbb = new FollowBusinessBo();
 		FollowBusinessBo fbb = new FollowBusinessBo();
 		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
 		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
 		fbb.setFollowTime(format.format(new Date()));
 		fbb.setFollowTime(format.format(new Date()));
-		fbb.setIdentityName(user.getIdentifyName());
+		fbb.setIdentifyName(user.getIdentifyName());
 		fbb.setUid(uid);
 		fbb.setUid(uid);
 		fbb.setUserBusinessList(businessService.findBusinessByUAid(uid, TokenManager.getAdminId()));
 		fbb.setUserBusinessList(businessService.findBusinessByUAid(uid, TokenManager.getAdminId()));
 		res.setData(fbb);
 		res.setData(fbb);

+ 2 - 1
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -93,9 +93,10 @@ public interface CustomerService {
 	 * @param contacts 联系人
 	 * @param contacts 联系人
 	 * @param contactMobile 联系电话
 	 * @param contactMobile 联系电话
 	 * @param type 客户类型
 	 * @param type 客户类型
+	 * @param societyTag 社会属性
 	 * @return
 	 * @return
 	 */
 	 */
-	int addCustomer(String name,String contacts,String contactMobile,Integer type)  throws BusinessException;
+	int addCustomer(String name,String contacts,String contactMobile,Integer type,String societyTag)  throws BusinessException;
 	
 	
 	
 	
 	/**
 	/**

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

@@ -174,7 +174,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 
 
 	@Override
 	@Override
 	@Transactional
 	@Transactional
-	public int addCustomer(String name, String contacts, String contactMobile, Integer type)  throws BusinessException{
+	public int addCustomer(String name, String contacts, String contactMobile, Integer type,String societyTag)  throws BusinessException{
 		User user = new User();
 		User user = new User();
 		Date now = new Date();
 		Date now = new Date();
 		String uid = UUID.randomUUID().toString();
 		String uid = UUID.randomUUID().toString();
@@ -191,10 +191,12 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		user.setType(type);
 		user.setType(type);
 		user.setCurrentMemberStatus(0);
 		user.setCurrentMemberStatus(0);
 		user.setLvl(1);
 		user.setLvl(1);
+		user.setSocietyTag(societyTag);
 		user.setCreateTime(now);
 		user.setCreateTime(now);
 		user.setUpdateTime(now);
 		user.setUpdateTime(now);
 		user.setMobile(contactMobile);
 		user.setMobile(contactMobile);
 		user.setPassword(AFTConstants.INITIALPASSWORD);
 		user.setPassword(AFTConstants.INITIALPASSWORD);
+		user.setIsMember(0);
 		passwordUtil.encryptPassword(user);
 		passwordUtil.encryptPassword(user);
 		if(type == 0){
 		if(type == 0){
 			UserIdentity ui = new UserIdentity();
 			UserIdentity ui = new UserIdentity();
@@ -209,7 +211,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 			ui.setAuditStatus(0);
 			ui.setAuditStatus(0);
 			userIdentityMapper.insert(ui);
 			userIdentityMapper.insert(ui);
 		}else if(type == 1){
 		}else if(type == 1){
-			if(userMapper.judgeCustomerByName(name)>1) throw new BusinessException(new Error(ErrorConstants.PARAM_ERROR, name , "客户已存在"));
+			if(userMapper.judgeCustomerByName(name)>0) throw new BusinessException(new Error(ErrorConstants.CUSTOMER_ALREADY_EXIST, name,""));
 			// 创建企业认证信息
 			// 创建企业认证信息
 			OrganizationIdentity oi = new OrganizationIdentity();
 			OrganizationIdentity oi = new OrganizationIdentity();
 			oi.setUnitName(name);
 			oi.setUnitName(name);
@@ -299,7 +301,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 	@Override
 	@Override
 	@Transactional
 	@Transactional
 	public int addFollow(FollowBusinessBo fbb) throws BusinessException{
 	public int addFollow(FollowBusinessBo fbb) throws BusinessException{
-		if(fbb.getUserBusinessList().size()<1) throw new BusinessException(new Error(ErrorConstants.PARAM_ERROR, "", "至少需要填写一个跟进业务"));
+		if(fbb.getUserBusinessList().size()<1) throw new BusinessException(new Error("","","至少需要填写一个跟进业务"));
 		//更新跟进记录表
 		//更新跟进记录表
 		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
 		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
 		UserFollow userFollow = new UserFollow();
 		UserFollow userFollow = new UserFollow();
@@ -353,7 +355,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 				//检测是否可以创建业务	
 				//检测是否可以创建业务	
 				if(userBusinessMapper.judgeBusiness(fbb.getUid(), ub.getBusinessGlossoryId(), "")>0){
 				if(userBusinessMapper.judgeBusiness(fbb.getUid(), ub.getBusinessGlossoryId(), "")>0){
 					String businessName = businessGlossoryMapper.selectByPrimaryKey(ub.getBusinessGlossoryId()).getName();
 					String businessName = businessGlossoryMapper.selectByPrimaryKey(ub.getBusinessGlossoryId()).getName();
-					throw new BusinessException(new Error(ErrorConstants.PARAM_ERROR, businessName, "已经被跟进"));
+					throw new BusinessException(new Error(ErrorConstants.BUSINESS_ALREADY_EXIST,businessName,""));
 				}
 				}
 				String ubId = UUID.randomUUID().toString();
 				String ubId = UUID.randomUUID().toString();
 				//更新业务表
 				//更新业务表
@@ -419,7 +421,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 				//检测是否可以创建业务	
 				//检测是否可以创建业务	
 				if(userBusinessMapper.judgeBusiness(fbb.getUid(), ub.getBusinessGlossoryId(), "")>0){
 				if(userBusinessMapper.judgeBusiness(fbb.getUid(), ub.getBusinessGlossoryId(), "")>0){
 					String businessName = businessGlossoryMapper.selectByPrimaryKey(ub.getBusinessGlossoryId()).getName();
 					String businessName = businessGlossoryMapper.selectByPrimaryKey(ub.getBusinessGlossoryId()).getName();
-					throw new BusinessException(new Error(ErrorConstants.PARAM_ERROR, businessName, "已经被跟进"));
+					throw new BusinessException(new Error(ErrorConstants.BUSINESS_ALREADY_EXIST,businessName,""));
 				}
 				}
 				String ubId = UUID.randomUUID().toString();		
 				String ubId = UUID.randomUUID().toString();		
 				UserBusiness userBusiness = new UserBusiness();
 				UserBusiness userBusiness = new UserBusiness();

+ 5 - 1
src/main/resources/props/error.properties

@@ -95,4 +95,8 @@ MOBILE_SAME_ERROR=\u65B0\u624B\u673A\u53F7\u5FC5\u987B\u548C\u539F\u624B\u673A\u
 
 
 MARKET_BOOTH_MAX = \u8425\u9500\u6D3B\u52A8\u5C55\u4F4D\u5DF2\u6EE1{0}\u4E2A
 MARKET_BOOTH_MAX = \u8425\u9500\u6D3B\u52A8\u5C55\u4F4D\u5DF2\u6EE1{0}\u4E2A
 
 
-CUSTOMER_ALREADY_EXIST = \u5BA2\u6237\u5DF2\u5B58\u5728
+CUSTOMER_ALREADY_EXIST = \u5BA2\u6237\u5DF2\u5B58\u5728
+
+BUSINESS_ALREADY_EXIST = \u9879\u76EE\u5DF2\u5B58\u5728
+
+AT_LEAST_A_BUSINESS = \u81F3\u5C11\u9700\u8981\u586B\u5199\u4E00\u9879\u4E1A\u52A1

+ 1 - 1
src/main/resources/spring/spring-mybatis.xml

@@ -86,7 +86,7 @@
 			<tx:method name="*"  read-only="true" />
 			<tx:method name="*"  read-only="true" />
 		</tx:attributes>
 		</tx:attributes>
 	</tx:advice>
 	</tx:advice>
- 	
+		
 	<aop:config proxy-target-class="true">
 	<aop:config proxy-target-class="true">
 		<aop:pointcut id="myPointcut" expression="execution(* com.goafanti.*.service..*.*(..))" />
 		<aop:pointcut id="myPointcut" expression="execution(* com.goafanti.*.service..*.*(..))" />
 		<aop:advisor advice-ref="txAdvice" pointcut-ref="myPointcut" />
 		<aop:advisor advice-ref="txAdvice" pointcut-ref="myPointcut" />

+ 2 - 1
src/main/webapp/WEB-INF/views/common.html

@@ -387,7 +387,8 @@
 				name : /*[[${adminData.name}]]*/'',
 				name : /*[[${adminData.name}]]*/'',
 				email : /*[[${adminData.email}]]*/'',
 				email : /*[[${adminData.email}]]*/'',
 				createTime : /*[[${adminData.createTime}]]*/'',
 				createTime : /*[[${adminData.createTime}]]*/'',
-				uid : /*[[${adminData.id}]]*/''
+				uid : /*[[${adminData.id}]]*/'',
+				isSuperAdmin : /*[[${shiro.hasRole('999999')}]]*/false
 			}
 			}
 			window.showUserManage = /*[[${shiro.hasRole('999999') || shiro.isPermitted('admin/userManage')}]]*/false;
 			window.showUserManage = /*[[${shiro.hasRole('999999') || shiro.isPermitted('admin/userManage')}]]*/false;
 			window.showServices = /*[[${shiro.hasRole('999999') || shiro.isPermitted('admin/services')}]]*/false;
 			window.showServices = /*[[${shiro.hasRole('999999') || shiro.isPermitted('admin/services')}]]*/false;