Bladeren bron

客户档案信息修改
客户上级评价新增与列表开发
修改客户信息接口修改

anderx 1 jaar geleden
bovenliggende
commit
f7f9e80b2c

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

@@ -2389,7 +2389,8 @@ inner join(
 		and b.id= #{uid}
 	</select>
     <select id="selectUser" resultType="com.goafanti.customer.bo.UserArchivesDetails">
-		select a.id uid,c.name industryName,b.org_code orgCode,b.business_scope businessScope ,b.intended_project intendedProject
+		select a.id uid,c.name industryName,b.org_code orgCode,b.business_scope businessScope ,b.intended_project intendedProject,
+		       a.nickname
 		from `user` a
 				 left join organization_identity b on a.id = b.uid
 				 left join industry_category c  on b.industry =c.id
@@ -2424,9 +2425,14 @@ inner join(
 
 	<select id="selectMyUserList" resultType="com.goafanti.customer.bo.SelectMyUserOut">
 		SELECT a.id,a.nickname ,a.share_type as shareType,a.new_channel as newChannel,a.sign_bills as signBills,
-		       a.sign_time as signTime,d.name as adminName ,b.org_code as orgCode
+		       a.sign_time as signTime,d.name as adminName ,b.org_code as orgCode,b.location_province as locationProvince,
+		       b.location_city as locationCity,b.location_area as locationArea,e.name as locationProvinceName,
+		       f.name as locationCityName,g.name as locationAreaName
 		from `user` a left join organization_identity b on a.id=b.uid left join user_mid c on a.id =c.uid
 					  left join admin d on a.aid=d.id
+		    left join district_glossory e on b.location_province=e.id
+		    left join district_glossory f on b.location_city=f.id
+		    left join district_glossory g on b.location_area=g.id
 		<if test="type==1">
 		inner join (SELECT b.uid
 			from public_release a left join public_release_details b on a.id=b.prid

+ 12 - 23
src/main/java/com/goafanti/common/mapper/UserSuperEvaluateMapper.xml

@@ -23,29 +23,24 @@ id, uid, aid, content, create_time
     </select>
 
     <!--查询指定行数据-->
-    <select id="findUserSuperEvaluateList" resultMap="UserSuperEvaluateMap">
+    <select id="findUserSuperEvaluateList" resultType="com.goafanti.customer.bo.OutUserSuperEvaluate">
         select
-          <include refid="UserSuperEvaluateAllSql"/>
-
-        from user_super_evaluate
+          a.id, a.uid, a.aid, a.content, a.create_time as createTime,b.name adminName
+        from user_super_evaluate a left join admin b  on a.aid=b.id
         <where>
             <if test="id != null">
-                and id = #{id}
+                and a.id = #{id}
             </if>
             <if test="uid != null and uid != ''">
-                and uid = #{uid}
+                and a.uid = #{uid}
             </if>
             <if test="aid != null and aid != ''">
-                and aid = #{aid}
-            </if>
-            <if test="content != null and content != ''">
-                and content = #{content}
-            </if>
-            <if test="createTime != null">
-                and create_time = #{createTime}
+                and a.aid = #{aid}
             </if>
         </where>
-        limit #{pageable.offset}, #{pageable.pageSize}
+        <if test="page_sql != null">
+            ${page_sql}
+        </if>
     </select>
 
     <!--统计总行数-->
@@ -54,19 +49,13 @@ id, uid, aid, content, create_time
         from user_super_evaluate
         <where>
             <if test="id != null">
-                and id = #{id}
+                and a.id = #{id}
             </if>
             <if test="uid != null and uid != ''">
-                and uid = #{uid}
+                and a.uid = #{uid}
             </if>
             <if test="aid != null and aid != ''">
-                and aid = #{aid}
-            </if>
-            <if test="content != null and content != ''">
-                and content = #{content}
-            </if>
-            <if test="createTime != null">
-                and create_time = #{createTime}
+                and a.aid = #{aid}
             </if>
         </where>
     </select>

+ 3 - 0
src/main/java/com/goafanti/common/model/UserSuperEvaluate.java

@@ -1,5 +1,7 @@
 package com.goafanti.common.model;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+
 import java.io.Serializable;
 import java.util.Date;
 
@@ -62,6 +64,7 @@ public class UserSuperEvaluate implements Serializable {
         this.content = content;
     }
 
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
     public Date getCreateTime() {
         return createTime;
     }

+ 94 - 0
src/main/java/com/goafanti/customer/bo/InputUserData.java

@@ -0,0 +1,94 @@
+package com.goafanti.customer.bo;
+
+public class InputUserData {
+   private String uid;
+   private Integer province;
+   private Integer city;
+   private Integer area;
+   private String businessScope;
+   private String intendedProject;
+   private String introduction;
+   private Integer channelType;
+   private String orgCode;
+   private Integer industry;
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public Integer getProvince() {
+        return province;
+    }
+
+    public void setProvince(Integer province) {
+        this.province = province;
+    }
+
+    public Integer getCity() {
+        return city;
+    }
+
+    public void setCity(Integer city) {
+        this.city = city;
+    }
+
+    public Integer getArea() {
+        return area;
+    }
+
+    public void setArea(Integer area) {
+        this.area = area;
+    }
+
+    public String getBusinessScope() {
+        return businessScope;
+    }
+
+    public void setBusinessScope(String businessScope) {
+        this.businessScope = businessScope;
+    }
+
+    public String getIntendedProject() {
+        return intendedProject;
+    }
+
+    public void setIntendedProject(String intendedProject) {
+        this.intendedProject = intendedProject;
+    }
+
+    public String getIntroduction() {
+        return introduction;
+    }
+
+    public void setIntroduction(String introduction) {
+        this.introduction = introduction;
+    }
+
+    public Integer getChannelType() {
+        return channelType;
+    }
+
+    public void setChannelType(Integer channelType) {
+        this.channelType = channelType;
+    }
+
+    public String getOrgCode() {
+        return orgCode;
+    }
+
+    public void setOrgCode(String orgCode) {
+        this.orgCode = orgCode;
+    }
+
+    public Integer getIndustry() {
+        return industry;
+    }
+
+    public void setIndustry(Integer industry) {
+        this.industry = industry;
+    }
+}

+ 16 - 0
src/main/java/com/goafanti/customer/bo/OutUserSuperEvaluate.java

@@ -0,0 +1,16 @@
+package com.goafanti.customer.bo;
+
+import com.goafanti.common.model.UserSuperEvaluate;
+
+public class OutUserSuperEvaluate extends UserSuperEvaluate {
+
+    private String adminName;
+
+    public String getAdminName() {
+        return adminName;
+    }
+
+    public void setAdminName(String adminName) {
+        this.adminName = adminName;
+    }
+}

+ 55 - 0
src/main/java/com/goafanti/customer/bo/SelectMyUserOut.java

@@ -15,6 +15,61 @@ public class SelectMyUserOut {
     private String adminName;
     private String orgCode;
 
+    private Integer locationProvince;
+    private Integer locationCity;
+    private Integer locationArea;
+    private String locationProvinceName;
+    private String locationCityName;
+    private String locationAreaName;
+
+    public Integer getLocationProvince() {
+        return locationProvince;
+    }
+
+    public void setLocationProvince(Integer locationProvince) {
+        this.locationProvince = locationProvince;
+    }
+
+    public Integer getLocationCity() {
+        return locationCity;
+    }
+
+    public void setLocationCity(Integer locationCity) {
+        this.locationCity = locationCity;
+    }
+
+    public Integer getLocationArea() {
+        return locationArea;
+    }
+
+    public void setLocationArea(Integer locationArea) {
+        this.locationArea = locationArea;
+    }
+
+    public String getLocationProvinceName() {
+        return locationProvinceName;
+    }
+
+    public void setLocationProvinceName(String locationProvinceName) {
+        this.locationProvinceName = locationProvinceName;
+    }
+
+    public String getLocationCityName() {
+        return locationCityName;
+    }
+
+    public void setLocationCityName(String locationCityName) {
+        this.locationCityName = locationCityName;
+    }
+
+    public String getLocationAreaName() {
+        return locationAreaName;
+    }
+
+    public void setLocationAreaName(String locationAreaName) {
+        this.locationAreaName = locationAreaName;
+    }
+
     public String getId() {
         return id;
     }

+ 8 - 0
src/main/java/com/goafanti/customer/bo/UserArchivesDetails.java

@@ -10,11 +10,19 @@ public class UserArchivesDetails extends UserArchives {
     private String orgCode;
     private String businessScope;
     private String intendedProject;
+    private String nickname;
+
 
     List<OrganizationContactBook> contactList;
 
 
+    public String getNickname() {
+        return nickname;
+    }
 
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
 
     public String getIndustryName() {
         return industryName;

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

@@ -1498,17 +1498,16 @@ public class AdminCustomerApiController extends BaseApiController{
 
 	/** 修改客户关键资料 **/
 	@RequestMapping(value = "/updateUserDate", method = RequestMethod.POST)
-	public Result updateUserDate(String uid,Integer province,Integer city,Integer area,String businessScope,String intendedProject,String introduction
-	,Integer channelType,String orgCode){
+	public Result updateUserDate(InputUserData in ){
 		Result res = new Result();
-		if (orgCode!=null){
-			orgCode=orgCode.trim();
-			if (customerService.checkOrgCode(orgCode)){
+		if (in.getOrgCode()!=null){
+			in.setOrgCode(in.getOrgCode().trim());
+			if (customerService.checkOrgCode(in.getOrgCode())){
 				res.getError().add(buildError("","统一信用代码已存在"));
 				return res;
 			}
 		}
-		res.data(customerService.updateUserDate(uid, province, city, area, businessScope, intendedProject,introduction,channelType,orgCode));
+		res.data(customerService.updateUserDate(in));
 		return res;
 	}
 

+ 2 - 0
src/main/java/com/goafanti/customer/controller/UserArchivesController.java

@@ -106,5 +106,7 @@ public class UserArchivesController {
         return new Result<>().data(this.userArchivesService.queryByUidAll(id));
     }
 
+
+
 }
 

+ 7 - 2
src/main/java/com/goafanti/customer/controller/UserSuperEvaluateController.java

@@ -1,7 +1,9 @@
 package com.goafanti.customer.controller;
 
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.BaseApiController;
 import com.goafanti.common.model.UserSuperEvaluate;
+import com.goafanti.common.utils.StringUtils;
 import com.goafanti.customer.service.UserSuperEvaluateService;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -18,7 +20,7 @@ import javax.annotation.Resource;
  */
 @RestController
 @RequestMapping("/api/admin/userSuperEvaluate")
-public class UserSuperEvaluateController {
+public class UserSuperEvaluateController extends BaseApiController{
     /**
      * 服务对象
      */
@@ -79,7 +81,10 @@ public class UserSuperEvaluateController {
      * @return
      */
     @GetMapping("/list")
-    public Result<UserSuperEvaluate> list(UserSuperEvaluate in , Integer pageNo, Integer pageSize) {
+    public Result list(UserSuperEvaluate in , Integer pageNo, Integer pageSize) {
+        if (StringUtils.isBlank(in.getUid())){
+            return new Result<>().error(buildError("客户选择不能为空"));
+        }
         return new Result<>().data(this.userSuperEvaluateService.list(in,  pageNo,  pageSize));
     }
 

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

@@ -540,8 +540,7 @@ public interface CustomerService {
 
 	boolean checkData(String uid, String aid);
 
-    int updateUserDate(String uid,Integer province, Integer city, Integer area, String businessScope, String intendedProject,
-					   String introduction,Integer channelType,String orgCode);
+    int updateUserDate(InputUserData in );
 
 	Pagination<OutChannelListBo> channelUserList(InputChannelListBo in);
 

+ 22 - 21
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -2902,33 +2902,34 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	}
 
 	@Override
-	public int updateUserDate(String uid,Integer province, Integer city, Integer area, String businessScope, String intendedProject,
-							  String introduction,Integer channelType,String orgCode) {
+	public int updateUserDate(InputUserData in ) {
 		OrganizationIdentity oi =new OrganizationIdentity();
-		oi.setUid(uid);
-		if (province!=null ||city !=null ||area!=null|| businessScope!=null ||intendedProject!=null||orgCode!=null){
-			if(province!=null)oi.setLocationProvince(province);
-			if(city!=null)oi.setLocationCity(city);
-			if(area!=null)oi.setLocationArea(area);
-			if (orgCode!=null)oi.setOrgCode(orgCode);
-			if (businessScope!=null){
-				OrganizationIdentity use=organizationIdentityMapper.selectOrgIdentityByUserId(uid);
-				updateBusinessScope(uid,businessScope,use.getBusinessScope(),new Date());
-				oi.setBusinessScope(businessScope);
+		oi.setUid(in.getUid());
+		if (in.getProvince()!=null ||in.getCity() !=null ||in.getArea()!=null|| in.getBusinessScope()!=null
+				||in.getIntendedProject()!=null||in.getOrgCode()!=null||in.getIndustry()!=null){
+			if(in.getProvince()!=null)oi.setLocationProvince(in.getProvince());
+			if(in.getCity()!=null)oi.setLocationCity(in.getCity());
+			if(in.getArea()!=null)oi.setLocationArea(in.getArea());
+			if (in.getOrgCode()!=null)oi.setOrgCode(in.getOrgCode());
+			if (in.getIndustry()!=null)oi.setIndustry(in.getIndustry());
+			if (in.getBusinessScope()!=null){
+				OrganizationIdentity use=organizationIdentityMapper.selectOrgIdentityByUserId(in.getUid());
+				updateBusinessScope(in.getUid(),in.getBusinessScope(),use.getBusinessScope(),new Date());
+				oi.setBusinessScope(in.getBusinessScope());
 			}
-			if(intendedProject!=null)oi.setIntendedProject(intendedProject);
+			if(in.getIntendedProject()!=null)oi.setIntendedProject(in.getIntendedProject());
 			organizationIdentityMapper.updateServiceByUid(oi);
 		}
-		if (introduction!=null){
+		if (in.getIntroduction()!=null){
 			User user=new User();
-			user.setId(uid);
-			user.setIntroduction(introduction);
+			user.setId(in.getUid());
+			user.setIntroduction(in.getIntroduction());
 			userMapper.updateByPrimaryKeySelective(user);
 		}
-		if (channelType !=null){
+		if (in.getChannelType() !=null){
 			UserMid um =new UserMid();
-			um.setUid(uid);
-			um.setChannelType(channelType);
+			um.setUid(in.getUid());
+			um.setChannelType(in.getChannelType());
 			userMidMapper.updateByUid(um);
 		}
 		return 1;
@@ -3208,13 +3209,13 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		params.put("count",publicReleases.size());
 		params.put("minPublicRelease",minPr);
 		params.put("maxPublicRelease",maxPr);
+		Map<String, Object> map = new LinkedHashMap<>();
         latestFollow.ifPresent(userFollow -> {
-			Map<String, Object> map = new LinkedHashMap<>();
 			map.put("id",userFollow.getId());
 			map.put("followTime",DateUtils.formatDate(userFollow.getCreateTime(),AFTConstants.YYYYMMDD));
 			map.put("followName",userFollow.getFollowName());
-			params.put("latestFollow",map);
 		});
+		params.put("latestFollow",map);
 		return params;
 	}
 

+ 36 - 6
src/main/java/com/goafanti/customer/service/impl/UserArchivesServiceImpl.java

@@ -101,15 +101,45 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
      */
     @Override
     public UserArchives update(UserArchives userArchives) {
+        UserArchives use =  this.queryById(userArchives.getId());
         int count = 0;
-        count+=userArchives.getAppearancePatentCount();
-        count+=userArchives.getInventionPatentCount();
-        count+=userArchives.getUtilityModelCount();
-        count+=userArchives.getSoftwareWorksCount();
-        count+=userArchives.getOtherCount();
+        if (userArchives.getAppearancePatentCount()!=null){
+            count+=userArchives.getAppearancePatentCount();
+            use.setAppearancePatentCount(userArchives.getAppearancePatentCount());
+        }else {
+            count+=use.getAppearancePatentCount();
+        }
+        if (userArchives.getInventionPatentCount()!=null){
+            count+=userArchives.getInventionPatentCount();
+            use.setInventionPatentCount(userArchives.getInventionPatentCount());
+        }else {
+            count+=use.getInventionPatentCount();
+        }
+        if (userArchives.getUtilityModelCount() !=null){
+            count+=userArchives.getUtilityModelCount();
+            use.setUtilityModelCount(userArchives.getUtilityModelCount());
+        }else {
+            count+=use.getSoftwareWorksCount();
+        }
+        if (userArchives.getOtherCount()!=null){
+            count+=userArchives.getOtherCount();
+            use.setOtherCount(userArchives.getOtherCount());
+        }else {
+            count+=use.getOtherCount();
+        }
         userArchives.setPatentCount(count);
+        use.setPatentCount(count);
+        if (userArchives.getFinancialData()!=null){
+            use.setFinancialData(userArchives.getFinancialData());
+        }
+        if (userArchives.getInterviewIdeas()!=null){
+            use.setInterviewIdeas(userArchives.getInterviewIdeas());
+        }
+        if (userArchives.getEarlyCommunication()!=null){
+            use.setEarlyCommunication(userArchives.getEarlyCommunication());
+        }
         this.userArchivesMapper.update(userArchives);
-        return this.queryById(userArchives.getId());
+        return use;
     }
 
     /**

+ 3 - 2
src/main/java/com/goafanti/customer/service/impl/UserSuperEvaluateServiceImpl.java

@@ -5,6 +5,7 @@ import com.goafanti.common.model.UserSuperEvaluate;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.customer.bo.OutUserSuperEvaluate;
 import com.goafanti.customer.service.UserSuperEvaluateService;
 import org.springframework.stereotype.Service;
 
@@ -26,10 +27,10 @@ public class UserSuperEvaluateServiceImpl extends BaseMybatisDao< UserSuperEvalu
     
     
     @Override
-    public Pagination<UserSuperEvaluate> list(UserSuperEvaluate userSuperEvaluate, Integer pageNo, Integer pageSize) {
+    public Pagination<OutUserSuperEvaluate> list(UserSuperEvaluate userSuperEvaluate, Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
         params.put("in",userSuperEvaluate); 
-		return (Pagination<UserSuperEvaluate>) findPage("findUserSuperEvaluateList",
+		return (Pagination<OutUserSuperEvaluate>) findPage("findUserSuperEvaluateList",
 				"findUserSuperEvaluateCount", params, pageNo, pageSize);
 	}