Antiloveg 8 years ago
parent
commit
3617e1fec7

+ 8 - 1
src/main/java/com/goafanti/admin/controller/AdminOrgBaiscInfoApiController.java

@@ -157,7 +157,10 @@ public class AdminOrgBaiscInfoApiController extends CertifyApiController {
 				lpo.add(ja.getJSONObject(idx).toJavaObject(LegalPersonOwnership.class));
 			}
 			for (LegalPersonOwnership l : lpo) {
-
+				if (StringUtils.isBlank(l.getUid())){
+					res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
+					return res;
+				}
 				if (StringUtils.isBlank(l.getId())) {
 					l.setId(UUID.randomUUID().toString());
 				}
@@ -241,6 +244,10 @@ public class AdminOrgBaiscInfoApiController extends CertifyApiController {
 				no.add(ja.getJSONObject(idx).toJavaObject(NatureOwnership.class));
 			}
 			for (NatureOwnership n : no) {
+				if (StringUtils.isBlank(n.getUid())){
+					res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
+					return res;
+				}
 				if (StringUtils.isBlank(n.getId())) {
 					n.setId(UUID.randomUUID().toString());
 				}

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

@@ -277,7 +277,7 @@
 	</if>
 	where ci.delete_sign = 0
 	<if test="principal != null">
-		and cl.principal = #{principal,jdbcType=VARCHAR})
+		and cl.principal = #{principal,jdbcType=VARCHAR}
 	</if>
 	<if test="province != null">
 	    and oi.licence_province =  #{province,jdbcType=VARCHAR}
@@ -330,7 +330,7 @@
 	</if>
 	where ci.delete_sign = 0
 	<if test="principal != null">
-		and cl.principal = #{principal,jdbcType=VARCHAR})
+		and cl.principal = #{principal,jdbcType=VARCHAR}
 	</if>
 	<if test="province != null">
 	    and oi.licence_province =  #{province,jdbcType=VARCHAR}

+ 2 - 1
src/main/java/com/goafanti/copyright/service/CopyrightInfoService.java

@@ -6,6 +6,7 @@ import com.goafanti.common.enums.CopyrightStatus;
 import com.goafanti.common.model.CopyrightInfo;
 import com.goafanti.common.model.CopyrightLog;
 import com.goafanti.copyright.bo.CopyrightInfoDetail;
+import com.goafanti.copyright.bo.CopyrightInfoSummary;
 import com.goafanti.copyright.bo.CopyrightLogBO;
 import com.goafanti.core.mybatis.page.Pagination;
 
@@ -27,7 +28,7 @@ public interface CopyrightInfoService {
 			CopyrightStatus status, String[] createTime, String[] acceptTime, String[] authTime, Integer pageNo,
 			Integer pageSize);
 	
-	Pagination<CopyrightInfo> listMyCopyrightInfo(String province, String unitName, String copyrightName,
+	Pagination<CopyrightInfoSummary> listMyCopyrightInfo(String province, String unitName, String copyrightName,
 			CopyrightStatus status, String[] createTime, String[] acceptTime, String[] authTime, Integer pageNo,
 			Integer pageSize, String uid);
 

+ 3 - 2
src/main/java/com/goafanti/copyright/service/impl/CopyrightInfoServiceImpl.java

@@ -26,6 +26,7 @@ import com.goafanti.common.model.CopyrightLog;
 import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.OrgIntellectualProperty;
 import com.goafanti.copyright.bo.CopyrightInfoDetail;
+import com.goafanti.copyright.bo.CopyrightInfoSummary;
 import com.goafanti.copyright.bo.CopyrightLogBO;
 import com.goafanti.copyright.service.CopyrightInfoService;
 import com.goafanti.core.mybatis.BaseMybatisDao;
@@ -120,10 +121,10 @@ public class CopyrightInfoServiceImpl extends BaseMybatisDao<CopyrightInfoMapper
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<CopyrightInfo> listMyCopyrightInfo(String province, String unitName, String copyrightName,
+	public Pagination<CopyrightInfoSummary> listMyCopyrightInfo(String province, String unitName, String copyrightName,
 			CopyrightStatus status, String[] createTime, String[] acceptTime, String[] authTime, Integer pageNo,
 			Integer pageSize, String uid) {
-		return (Pagination<CopyrightInfo>) findPage("findListByPage", "findListCount", buildListParams(province,
+		return (Pagination<CopyrightInfoSummary>) findPage("findListByPage", "findListCount", buildListParams(province,
 				unitName, copyrightName, status, createTime, acceptTime, authTime, pageNo, pageSize, uid), pageNo,
 				pageSize);
 	}

+ 0 - 6
src/main/java/com/goafanti/techproject/controller/TechProjectApiController.java

@@ -113,9 +113,6 @@ public class TechProjectApiController extends CertifyApiController {
 	@RequestMapping(value = "/techProjectDetial", method = RequestMethod.POST)
 	public Result techProjectDetial(String pid) {
 		Result res = new Result();
-		if (!checkUserLogin(res)) {
-			return res;
-		}
 		if (StringUtils.isBlank(pid)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "科技项目ID"));
 		} else {
@@ -179,9 +176,6 @@ public class TechProjectApiController extends CertifyApiController {
 					CopyrightFields.getFieldDesc(bindingResult.getFieldError().getField())));
 			return res;
 		}
-		if (!checkUserLogin(res)) {
-			return res;
-		}
 
 		User curUser = TokenManager.getUserToken();
 		if (!checkCertify(res, curUser)) {

+ 287 - 0
src/main/java/com/goafanti/user/controller/UserBasicInfoController.java

@@ -0,0 +1,287 @@
+package com.goafanti.user.controller;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.time.DateUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Controller;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.DeleteStatus;
+import com.goafanti.common.enums.OrgBasicInfoFields;
+import com.goafanti.common.model.LegalPersonOwnership;
+import com.goafanti.common.model.NatureOwnership;
+import com.goafanti.common.model.OrgHumanResource;
+import com.goafanti.common.model.OrganizationIdentity;
+import com.goafanti.common.model.User;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.user.bo.InputOrgBasicInfo;
+import com.goafanti.user.service.LegalPersonOwnershipService;
+import com.goafanti.user.service.NatureOwnershipService;
+import com.goafanti.user.service.OrganizationIdentityService;
+
+@Controller
+@RequestMapping(value = "/api/user/basic")
+public class UserBasicInfoController extends CertifyApiController{
+	
+	@Resource
+	private LegalPersonOwnershipService	legalPersonOwnershipService;
+	@Resource
+	private NatureOwnershipService		natureOwnershipService;
+	@Resource
+	private OrganizationIdentityService	organizationIdentityService;
+
+	/**
+	 * 企业基本信息保存
+	 * 
+	 * @param info
+	 * @param bindingResult
+	 * @return
+	 */
+	@RequestMapping(value = "/disposeInfo", method = RequestMethod.POST)
+	public Result disposeInfo(@Valid InputOrgBasicInfo info, BindingResult bindingResult,
+			String listedDateFormattedDate, String registrationTimeFormattedDate) {
+		Result res = new Result();
+		User curUser = TokenManager.getUserToken();
+		if (!checkCertify(res, curUser)) {
+			return res;
+		}
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					OrgBasicInfoFields.getFieldDesc(bindingResult.getFieldError().getField())));
+			return res;
+		}
+
+		if (StringUtils.isBlank(info.getUid())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
+			return res;
+		}
+
+		Date listedDate = null;
+		Date registrationTime = null;
+		if (!StringUtils.isBlank(listedDateFormattedDate)) {
+			try {
+				listedDate = DateUtils.parseDate(listedDateFormattedDate, AFTConstants.YYYYMMDD);
+			} catch (ParseException e) {
+				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "上市时间"));
+				return res;
+			}
+		}
+
+		if (!StringUtils.isBlank(registrationTimeFormattedDate)) {
+			try {
+				registrationTime = DateUtils.parseDate(registrationTimeFormattedDate, AFTConstants.YYYYMMDD);
+			} catch (ParseException e) {
+				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "注册时间"));
+				return res;
+			}
+		}
+
+		OrganizationIdentity oi = new OrganizationIdentity();
+		OrgHumanResource ohr = new OrgHumanResource();
+
+		BeanUtils.copyProperties(info, oi);
+		BeanUtils.copyProperties(info, ohr);
+
+		if (null != listedDate) {
+			oi.setListedDate(listedDate);
+		}
+
+		if (null != registrationTime) {
+			oi.setRegistrationTime(registrationTime);
+		}
+		ohr.setId(info.getHid());
+
+		organizationIdentityService.saveBasicInfo(oi, ohr);
+
+		return res;
+	}
+
+	/**
+	 * 企业基本信息入口
+	 * 
+	 * @param uid
+	 * @return
+	 */
+	@RequestMapping(value = "/info", method = RequestMethod.GET)
+	public Result info() {
+		Result res = new Result();
+		User curUser = TokenManager.getUserToken();
+		if (!checkCertify(res, curUser)) {
+			return res;
+		}
+		Calendar now = Calendar.getInstance();
+		res.setData(organizationIdentityService.selectBasicInfo(TokenManager.getUserId(), now.get(Calendar.YEAR) - 1));
+		return res;
+	}
+
+	/**
+	 * 法人股权列表
+	 */
+	@RequestMapping(value = "/listLegalPerson", method = RequestMethod.GET)
+	public Result listLegalPerson() {
+		Result res = new Result();
+		User curUser = TokenManager.getUserToken();
+		if (!checkCertify(res, curUser)) {
+			return res;
+		}
+		res.setData(legalPersonOwnershipService.selectByUid(TokenManager.getUserId()));
+		return res;
+	}
+
+	/**
+	 * 法人股权保存修改
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/legalPerson", method = RequestMethod.POST)
+	public Result legalPerson(String data) {
+		Result res = new Result();
+		User curUser = TokenManager.getUserToken();
+		if (!checkCertify(res, curUser)) {
+			return res;
+		}
+		JSONArray ja = (JSONArray) JSON.parse(data);
+		if (ja != null && !ja.isEmpty()) {
+			List<LegalPersonOwnership> lpo = new ArrayList<LegalPersonOwnership>();
+			for (int idx = 0; idx < ja.size(); idx++) {
+				lpo.add(ja.getJSONObject(idx).toJavaObject(LegalPersonOwnership.class));
+			}
+			for (LegalPersonOwnership l : lpo) {
+				if (StringUtils.isBlank(l.getUid())){
+					res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
+					return res;
+				}
+				if (StringUtils.isBlank(l.getId())) {
+					l.setId(UUID.randomUUID().toString());
+				}
+
+				if (null == l.getDeletedSign()) {
+					l.setDeletedSign(DeleteStatus.UNDELETE.getCode());
+				}
+			}
+			res.setData(legalPersonOwnershipService.batchInsert(lpo));
+		} else {
+			res.getError().add(buildError("", "参数格式不正确"));
+		}
+		return res;
+	}
+
+	/**
+	 * 删除法人股权人
+	 * 
+	 * @param ids
+	 * @return
+	 */
+	@RequestMapping(value = "/deleteLegalPerson", method = RequestMethod.POST)
+	public Result deleteLegalPerson(@RequestParam(name = "ids[]", required = false) String[] ids) {
+		Result res = new Result();
+		User curUser = TokenManager.getUserToken();
+		if (!checkCertify(res, curUser)) {
+			return res;
+		}
+		if (ids == null || ids.length < 1) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
+		} else {
+			res.setData(legalPersonOwnershipService.batchDeleteByPrimaryKey(Arrays.asList(ids)));
+		}
+		return res;
+	}
+
+	/**
+	 * 自然人股权列表
+	 * 
+	 * @param uid
+	 * @return
+	 */
+	@RequestMapping(value = "/listNature", method = RequestMethod.GET)
+	public Result listNature() {
+		Result res = new Result();
+		User curUser = TokenManager.getUserToken();
+		if (!checkCertify(res, curUser)) {
+			return res;
+		}
+		res.setData(natureOwnershipService.selectByUid(TokenManager.getUserId()));
+		return res;
+	}
+
+	/**
+	 * 删除自然人股权
+	 * 
+	 * @param ids
+	 * @return
+	 */
+	@RequestMapping(value = "/deleteNature", method = RequestMethod.POST)
+	public Result deleteNature(@RequestParam(name = "ids[]", required = false) String[] ids) {
+		Result res = new Result();
+		User curUser = TokenManager.getUserToken();
+		if (!checkCertify(res, curUser)) {
+			return res;
+		}
+		if (ids == null || ids.length < 1) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
+		} else {
+			res.setData(natureOwnershipService.batchDeleteByPrimaryKey(Arrays.asList(ids)));
+		}
+		return res;
+	}
+
+	/**
+	 * 自然人股权保存修改
+	 * 
+	 * @param data
+	 * @return
+	 */
+	@RequestMapping(value = "/nature", method = RequestMethod.POST)
+	public Result nature(String data) {
+		Result res = new Result();
+		User curUser = TokenManager.getUserToken();
+		if (!checkCertify(res, curUser)) {
+			return res;
+		}
+		JSONArray ja = (JSONArray) JSON.parse(data);
+		if (ja != null && !ja.isEmpty()) {
+			List<NatureOwnership> no = new ArrayList<NatureOwnership>();
+			for (int idx = 0; idx < ja.size(); idx++) {
+				no.add(ja.getJSONObject(idx).toJavaObject(NatureOwnership.class));
+			}
+			for (NatureOwnership n : no) {
+				if (StringUtils.isBlank(n.getUid())){
+					res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
+					return res;
+				}
+				if (StringUtils.isBlank(n.getId())) {
+					n.setId(UUID.randomUUID().toString());
+				}
+
+				if (null == n.getDeletedSign()) {
+					n.setDeletedSign(DeleteStatus.UNDELETE.getCode());
+				}
+			}
+			res.setData(natureOwnershipService.batchInsert(no));
+		} else {
+			res.getError().add(buildError("", "参数格式不正确"));
+		}
+		return res;
+	}
+
+}

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

@@ -51,7 +51,7 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//afts.hnzhiming.com/1.0.18
+static.host=//afts.hnzhiming.com/1.0.19
 
 upload.path=/data/wwwroot/aft/upload
 upload.private.path=/data/upload

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

@@ -53,7 +53,7 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//afts.hnzhiming.com/1.0.18
+static.host=//afts.hnzhiming.com/1.0.19
 
 upload.path=/Users/xiaolong/Sites/upload
 upload.private.path=/Users/xiaolong/Sites/doc

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

@@ -51,4 +51,4 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//afts.hnzhiming.com/1.0.18
+static.host=//afts.hnzhiming.com/1.0.19

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

@@ -53,7 +53,7 @@ session.validate.timespan=18000000
 
 app.name=AFT
 
-static.host=//aftts.hnzhiming.com/1.0.18
+static.host=//aftts.hnzhiming.com/1.0.19
 
 upload.path=/data/aft/public/upload
 upload.private.path=/data/aft/private/upload