瀏覽代碼

公共头部修改,文件上传修改,需求、成果详情修改,企业认证修改

liliang4869 7 年之前
父節點
當前提交
3d1b3cfd19

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

@@ -355,7 +355,7 @@ public class AdminApiController extends CertifyApiController {
 		OrganizationIdentity oi = new OrganizationIdentity();
 		BeanUtils.copyProperties(orgIdentity, oi);
 		if (orgIdentity.getRegisteredCapital() != null) {
-			oi.setRegisteredCapital(new BigDecimal(orgIdentity.getRegisteredCapital()));
+			oi.setRegisteredCapital(orgIdentity.getRegisteredCapital());
 		}
 		if (CertifySubmitType.SUBMIT.getCode().equals(saveSign)) {
 			User u = userService.selectByPrimaryKey(oi.getUid());

+ 247 - 247
src/main/java/com/goafanti/admin/controller/AdminUserCertifyApiController.java

@@ -1,247 +1,247 @@
-package com.goafanti.admin.controller;
-
-import java.math.BigDecimal;
-import java.util.Calendar;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.validation.Valid;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.BeanUtils;
-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.RestController;
-
-import com.goafanti.admin.service.AdminService;
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.constant.ErrorConstants;
-import com.goafanti.common.controller.CertifyApiController;
-import com.goafanti.common.enums.AttachmentType;
-import com.goafanti.common.enums.IdentityAuditStatus;
-import com.goafanti.common.enums.IdentityProcess;
-import com.goafanti.common.enums.OrganizationIdentityFields;
-import com.goafanti.common.enums.UserIdentityFields;
-import com.goafanti.common.enums.UserLevel;
-import com.goafanti.common.model.OrganizationIdentity;
-import com.goafanti.common.model.UserIdentity;
-import com.goafanti.user.bo.InputOrganizationIdentity;
-import com.goafanti.user.bo.InputUserIdentity;
-import com.goafanti.user.service.OrganizationIdentityService;
-import com.goafanti.user.service.UserIdentityService;
-
-@RestController
-@RequestMapping(value = "/api/admin/userCertify")
-public class AdminUserCertifyApiController extends CertifyApiController {
-	@Resource
-	private UserIdentityService			userIdentityService;
-	@Resource
-	private OrganizationIdentityService	organizationIdentityService;
-	@Resource
-	private AdminService				adminService;
-
-	/**
-	 * 审核员--获取客户经理下拉
-	 */
-	@RequestMapping(value = "/accountManager", method = RequestMethod.GET)
-	public Result getAccountManager() {
-		Result res = new Result();
-		res.setData(adminService.selectAccoutManager());
-		return res;
-	}
-
-	/**
-	 * 审核员--获取业务员(技术员)下拉
-	 */
-	@RequestMapping(value = "/technician", method = RequestMethod.GET)
-	public Result getTechnician() {
-		Result res = new Result();
-		res.setData(adminService.selectTechnician());
-		return res;
-	}
-
-	/**
-	 * 上传认证资料(营业执照图片、组织机构代码证图片、上年度纳税申报表)
-	 */
-	@RequestMapping(value = "/upload", method = RequestMethod.POST)
-	public Result uploadCertify(HttpServletRequest req, String sign, String uid) {
-		Result res = new Result();
-		if (StringUtils.isBlank(uid)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
-			return res;
-		}
-
-		AttachmentType attachmentType = AttachmentType.getField(sign);
-		/*if (attachmentType == AttachmentType.ORGCODE || attachmentType == AttachmentType.LICENCE) {
-			res.setData(handleFiles(res, "/identity/", true, req, sign, uid));
-		} else if (attachmentType == AttachmentType.RATEPAY) {
-			sign = sign + "_" + (Calendar.getInstance().get(Calendar.YEAR) - 1);
-			res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
-		} else {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
-		}*/
-		return res;
-	}
-
-	/**
-	 * 审核员--个人用户详情
-	 */
-	@RequestMapping(value = "/userDetail", method = RequestMethod.GET)
-	public Result userDetail(String uid) {
-		Result res = new Result();
-		if (StringUtils.isBlank(uid)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
-			return res;
-		}
-		res.setData(userIdentityService.selectAuditorUserIdentityByUserId(uid));
-		return res;
-	}
-
-	/**
-	 * 审核员审核个人用户信息
-	 */
-	@RequestMapping(value = "/updateUserDetail", method = RequestMethod.POST)
-	public Result disposeUser(@Valid InputUserIdentity userIdentity, BindingResult bindingResult,
-			String paymentDateFormattedDate, String aid, String mid) {
-		Result res = new Result();
-		if (bindingResult.hasErrors()) {
-			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
-					UserIdentityFields.getFieldDesc(bindingResult.getFieldError().getField())));
-			return res;
-		}
-
-		if (StringUtils.isBlank(userIdentity.getId())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户认证ID", "用户认证ID"));
-			return res;
-		}
-
-		if (StringUtils.isBlank(userIdentity.getUid())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
-			return res;
-		}
-
-		if (null == userIdentity.getAuditStatus()) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到审核状态", "审核状态"));
-			return res;
-		}
-
-		/*if (null == userIdentity.getLevel()) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户等级", "用户等级"));
-			return res;
-		}*/
-
-		if (!UserLevel.GENERAL.getCode().equals(userIdentity.getLevel())
-				|| IdentityAuditStatus.PASSED.getCode().equals(userIdentity.getAuditStatus())) {
-			if (StringUtils.isBlank(aid)) {
-				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到业务员ID", "业务员ID"));
-				return res;
-			}
-
-			if (StringUtils.isBlank(mid)) {
-				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到客户经理ID", "客户经理ID"));
-				return res;
-			}
-		}
-
-		UserIdentity ui = new UserIdentity();
-		BeanUtils.copyProperties(userIdentity, ui);
-
-		if (IdentityAuditStatus.UNCOMMITTED.getCode().equals(ui.getAuditStatus())) {
-			ui.setProcess(IdentityProcess.UNCOMMITTED.getCode());
-		} else if (IdentityAuditStatus.COMMITTED.getCode().equals(ui.getAuditStatus())
-				|| IdentityAuditStatus.UNPAID.getCode().equals(ui.getAuditStatus())) {
-			ui.setProcess(IdentityProcess.COMMITTED.getCode());
-		} else if (IdentityAuditStatus.PAID.getCode().equals(ui.getAuditStatus())) {
-			ui.setProcess(IdentityProcess.FAIL.getCode());
-		} else if (IdentityAuditStatus.NOTPASSED.getCode().equals(ui.getAuditStatus())
-				|| IdentityAuditStatus.PASSED.getCode().equals(ui.getAuditStatus())) {
-			ui.setProcess(IdentityProcess.SUCCESS.getCode());
-		}
-		res.setData(userIdentityService.updateUserDetailByAuditAdmin(ui, aid, mid, userIdentity.getLevel()));
-		return res;
-	}
-
-	/**
-	 * 审核员---团体用户详情
-	 */
-	@RequestMapping(value = "/orgDetail", method = RequestMethod.GET)
-	public Result orgDetail(String uid) {
-		Result res = new Result();
-		if (StringUtils.isBlank(uid)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
-			return res;
-		}
-		res.setData(organizationIdentityService.selectAuditorOrgIdentityDetailByUserId(uid));
-		return res;
-	}
-
-	/**
-	 * 审核员审核团体用户信息
-	 */
-	@RequestMapping(value = "/updateOrgDetail", method = RequestMethod.POST)
-	public Result updateOrgDetail(@Valid InputOrganizationIdentity orgIdentity, BindingResult bindingResult,
-			String paymentDateFormattedDate, String aid, String mid) {
-		Result res = new Result();
-
-		if (bindingResult.hasErrors()) {
-			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
-					OrganizationIdentityFields.getFieldDesc(bindingResult.getFieldError().getField())));
-			return res;
-		}
-
-		if (StringUtils.isBlank(orgIdentity.getId())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户认证ID", "用户认证ID"));
-			return res;
-		}
-
-		if (StringUtils.isBlank(orgIdentity.getUid())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
-			return res;
-		}
-
-		if (null == orgIdentity.getAuditStatus()) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到审核状态", "审核状态"));
-			return res;
-		}
-		
-		/*if (null == orgIdentity.getLevel()) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户等级", "用户等级"));
-			return res;
-		}*/
-
-		if (!UserLevel.GENERAL.getCode().equals(orgIdentity.getLevel())
-				|| IdentityAuditStatus.PASSED.getCode().equals(orgIdentity.getAuditStatus())) {
-			if (StringUtils.isBlank(aid)) {
-				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到业务员ID", "业务员ID"));
-				return res;
-			}
-
-			if (StringUtils.isBlank(mid)) {
-				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到客户经理ID", "客户经理ID"));
-				return res;
-			}
-		}
-
-		OrganizationIdentity oi = new OrganizationIdentity();
-		BeanUtils.copyProperties(orgIdentity, oi);
-		if (orgIdentity.getRegisteredCapital() != null) {
-			oi.setRegisteredCapital(new BigDecimal(orgIdentity.getRegisteredCapital()));
-		}
-		if (IdentityAuditStatus.UNCOMMITTED.getCode().equals(oi.getAuditStatus())) {
-			oi.setProcess(IdentityProcess.UNCOMMITTED.getCode());
-		} else if (IdentityAuditStatus.COMMITTED.getCode().equals(oi.getAuditStatus())
-				|| IdentityAuditStatus.UNPAID.getCode().equals(oi.getAuditStatus())) {
-			oi.setProcess(IdentityProcess.COMMITTED.getCode());
-		} else if (IdentityAuditStatus.PAID.getCode().equals(oi.getAuditStatus())) {
-			oi.setProcess(IdentityProcess.FAIL.getCode());
-		} else if (IdentityAuditStatus.NOTPASSED.getCode().equals(oi.getAuditStatus())
-				|| IdentityAuditStatus.PASSED.getCode().equals(oi.getAuditStatus())){
-			oi.setProcess(IdentityProcess.SUCCESS.getCode());
-		}
-		res.setData(organizationIdentityService.updateOrgDetailByAuditAdmin(oi, aid, mid, orgIdentity.getLevel()));
-		return res;
-	}
-	
-
-}
+package com.goafanti.admin.controller;
+
+import java.math.BigDecimal;
+import java.util.Calendar;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+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.RestController;
+
+import com.goafanti.admin.service.AdminService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.AttachmentType;
+import com.goafanti.common.enums.IdentityAuditStatus;
+import com.goafanti.common.enums.IdentityProcess;
+import com.goafanti.common.enums.OrganizationIdentityFields;
+import com.goafanti.common.enums.UserIdentityFields;
+import com.goafanti.common.enums.UserLevel;
+import com.goafanti.common.model.OrganizationIdentity;
+import com.goafanti.common.model.UserIdentity;
+import com.goafanti.user.bo.InputOrganizationIdentity;
+import com.goafanti.user.bo.InputUserIdentity;
+import com.goafanti.user.service.OrganizationIdentityService;
+import com.goafanti.user.service.UserIdentityService;
+
+@RestController
+@RequestMapping(value = "/api/admin/userCertify")
+public class AdminUserCertifyApiController extends CertifyApiController {
+	@Resource
+	private UserIdentityService			userIdentityService;
+	@Resource
+	private OrganizationIdentityService	organizationIdentityService;
+	@Resource
+	private AdminService				adminService;
+
+	/**
+	 * 审核员--获取客户经理下拉
+	 */
+	@RequestMapping(value = "/accountManager", method = RequestMethod.GET)
+	public Result getAccountManager() {
+		Result res = new Result();
+		res.setData(adminService.selectAccoutManager());
+		return res;
+	}
+
+	/**
+	 * 审核员--获取业务员(技术员)下拉
+	 */
+	@RequestMapping(value = "/technician", method = RequestMethod.GET)
+	public Result getTechnician() {
+		Result res = new Result();
+		res.setData(adminService.selectTechnician());
+		return res;
+	}
+
+	/**
+	 * 上传认证资料(营业执照图片、组织机构代码证图片、上年度纳税申报表)
+	 */
+	@RequestMapping(value = "/upload", method = RequestMethod.POST)
+	public Result uploadCertify(HttpServletRequest req, String sign, String uid) {
+		Result res = new Result();
+		if (StringUtils.isBlank(uid)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
+			return res;
+		}
+
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		/*if (attachmentType == AttachmentType.ORGCODE || attachmentType == AttachmentType.LICENCE) {
+			res.setData(handleFiles(res, "/identity/", true, req, sign, uid));
+		} else if (attachmentType == AttachmentType.RATEPAY) {
+			sign = sign + "_" + (Calendar.getInstance().get(Calendar.YEAR) - 1);
+			res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+		}*/
+		return res;
+	}
+
+	/**
+	 * 审核员--个人用户详情
+	 */
+	@RequestMapping(value = "/userDetail", method = RequestMethod.GET)
+	public Result userDetail(String uid) {
+		Result res = new Result();
+		if (StringUtils.isBlank(uid)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
+			return res;
+		}
+		res.setData(userIdentityService.selectAuditorUserIdentityByUserId(uid));
+		return res;
+	}
+
+	/**
+	 * 审核员审核个人用户信息
+	 */
+	@RequestMapping(value = "/updateUserDetail", method = RequestMethod.POST)
+	public Result disposeUser(@Valid InputUserIdentity userIdentity, BindingResult bindingResult,
+			String paymentDateFormattedDate, String aid, String mid) {
+		Result res = new Result();
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					UserIdentityFields.getFieldDesc(bindingResult.getFieldError().getField())));
+			return res;
+		}
+
+		if (StringUtils.isBlank(userIdentity.getId())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户认证ID", "用户认证ID"));
+			return res;
+		}
+
+		if (StringUtils.isBlank(userIdentity.getUid())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
+			return res;
+		}
+
+		if (null == userIdentity.getAuditStatus()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到审核状态", "审核状态"));
+			return res;
+		}
+
+		/*if (null == userIdentity.getLevel()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户等级", "用户等级"));
+			return res;
+		}*/
+
+		if (!UserLevel.GENERAL.getCode().equals(userIdentity.getLevel())
+				|| IdentityAuditStatus.PASSED.getCode().equals(userIdentity.getAuditStatus())) {
+			if (StringUtils.isBlank(aid)) {
+				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到业务员ID", "业务员ID"));
+				return res;
+			}
+
+			if (StringUtils.isBlank(mid)) {
+				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到客户经理ID", "客户经理ID"));
+				return res;
+			}
+		}
+
+		UserIdentity ui = new UserIdentity();
+		BeanUtils.copyProperties(userIdentity, ui);
+
+		if (IdentityAuditStatus.UNCOMMITTED.getCode().equals(ui.getAuditStatus())) {
+			ui.setProcess(IdentityProcess.UNCOMMITTED.getCode());
+		} else if (IdentityAuditStatus.COMMITTED.getCode().equals(ui.getAuditStatus())
+				|| IdentityAuditStatus.UNPAID.getCode().equals(ui.getAuditStatus())) {
+			ui.setProcess(IdentityProcess.COMMITTED.getCode());
+		} else if (IdentityAuditStatus.PAID.getCode().equals(ui.getAuditStatus())) {
+			ui.setProcess(IdentityProcess.FAIL.getCode());
+		} else if (IdentityAuditStatus.NOTPASSED.getCode().equals(ui.getAuditStatus())
+				|| IdentityAuditStatus.PASSED.getCode().equals(ui.getAuditStatus())) {
+			ui.setProcess(IdentityProcess.SUCCESS.getCode());
+		}
+		res.setData(userIdentityService.updateUserDetailByAuditAdmin(ui, aid, mid, userIdentity.getLevel()));
+		return res;
+	}
+
+	/**
+	 * 审核员---团体用户详情
+	 */
+	@RequestMapping(value = "/orgDetail", method = RequestMethod.GET)
+	public Result orgDetail(String uid) {
+		Result res = new Result();
+		if (StringUtils.isBlank(uid)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
+			return res;
+		}
+		res.setData(organizationIdentityService.selectAuditorOrgIdentityDetailByUserId(uid));
+		return res;
+	}
+
+	/**
+	 * 审核员审核团体用户信息
+	 */
+	@RequestMapping(value = "/updateOrgDetail", method = RequestMethod.POST)
+	public Result updateOrgDetail(@Valid InputOrganizationIdentity orgIdentity, BindingResult bindingResult,
+			String paymentDateFormattedDate, String aid, String mid) {
+		Result res = new Result();
+
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					OrganizationIdentityFields.getFieldDesc(bindingResult.getFieldError().getField())));
+			return res;
+		}
+
+		if (StringUtils.isBlank(orgIdentity.getId())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户认证ID", "用户认证ID"));
+			return res;
+		}
+
+		if (StringUtils.isBlank(orgIdentity.getUid())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
+			return res;
+		}
+
+		if (null == orgIdentity.getAuditStatus()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到审核状态", "审核状态"));
+			return res;
+		}
+		
+		/*if (null == orgIdentity.getLevel()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户等级", "用户等级"));
+			return res;
+		}*/
+
+		if (!UserLevel.GENERAL.getCode().equals(orgIdentity.getLevel())
+				|| IdentityAuditStatus.PASSED.getCode().equals(orgIdentity.getAuditStatus())) {
+			if (StringUtils.isBlank(aid)) {
+				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到业务员ID", "业务员ID"));
+				return res;
+			}
+
+			if (StringUtils.isBlank(mid)) {
+				res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到客户经理ID", "客户经理ID"));
+				return res;
+			}
+		}
+
+		OrganizationIdentity oi = new OrganizationIdentity();
+		BeanUtils.copyProperties(orgIdentity, oi);
+		if (orgIdentity.getRegisteredCapital() != null) {
+			oi.setRegisteredCapital(orgIdentity.getRegisteredCapital());
+		}
+		if (IdentityAuditStatus.UNCOMMITTED.getCode().equals(oi.getAuditStatus())) {
+			oi.setProcess(IdentityProcess.UNCOMMITTED.getCode());
+		} else if (IdentityAuditStatus.COMMITTED.getCode().equals(oi.getAuditStatus())
+				|| IdentityAuditStatus.UNPAID.getCode().equals(oi.getAuditStatus())) {
+			oi.setProcess(IdentityProcess.COMMITTED.getCode());
+		} else if (IdentityAuditStatus.PAID.getCode().equals(oi.getAuditStatus())) {
+			oi.setProcess(IdentityProcess.FAIL.getCode());
+		} else if (IdentityAuditStatus.NOTPASSED.getCode().equals(oi.getAuditStatus())
+				|| IdentityAuditStatus.PASSED.getCode().equals(oi.getAuditStatus())){
+			oi.setProcess(IdentityProcess.SUCCESS.getCode());
+		}
+		res.setData(organizationIdentityService.updateOrgDetailByAuditAdmin(oi, aid, mid, orgIdentity.getLevel()));
+		return res;
+	}
+	
+
+}

+ 224 - 223
src/main/java/com/goafanti/common/utils/FileUtils.java

@@ -1,223 +1,224 @@
-package com.goafanti.common.utils;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.regex.Pattern;
-
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.web.multipart.MultipartFile;
-
-import com.goafanti.common.enums.AttachmentType;
-
-public class FileUtils {
-	@Value(value = "${upload.private.path}")
-	private String					uploadPrivatePath	= null;
-
-	private static final Pattern	SLASH_PATTERN		= Pattern.compile("^/|/$");
-	private static final String		SLASH				= "/";
-	private static final String		UNDERLINE			= "_";
-
-	/**
-	 * response 输出JSON
-	 * 
-	 * @param hresponse
-	 * @param resultMap
-	 * @throws IOException
-	 */
-	public static void out(HttpServletResponse response, String jsonStr) {
-		PrintWriter out = null;
-		try {
-			response.setHeader("Content-Type", "application/json");
-			response.setCharacterEncoding("UTF-8");
-			out = response.getWriter();
-			out.println(jsonStr);
-		} catch (Exception e) {
-			LoggerUtils.fmtError(FileUtils.class, e, "输出数据失败");
-		} finally {
-			if (null != out) {
-				out.flush();
-				out.close();
-			}
-		}
-	}
-
-	/**
-	 * Excel报表导出
-	 * 
-	 * @param response
-	 * @param fileName
-	 * @param workbook
-	 */
-	public static void downloadExcel(HttpServletResponse response, String fileName, HSSFWorkbook workbook) {
-		String fn = null;
-		try {
-			fn = URLEncoder.encode(fileName, "UTF-8");
-		} catch (UnsupportedEncodingException e1) {
-			fn = fileName;
-		}
-		response.setContentType("application/x-download;charset=UTF-8");
-		response.setHeader("Content-Disposition", "attachment; filename=\"" + fn + "\";");
-		OutputStream out = null;
-		try {
-			out = response.getOutputStream();
-			workbook.write(out);
-		} catch (IOException e) {
-			LoggerUtils.fmtError(FileUtils.class, e, "输出Excel失败");
-		} finally {
-			if (null != out) {
-				try {
-					out.flush();
-					out.close();
-				} catch (IOException e) {
-					out = null;
-				}
-			}
-		}
-	}
-
-	/**
-	 * 根据上传文件 拼接fileName
-	 * 
-	 * @param mf
-	 * @param isPrivate
-	 * @param sign
-	 * @param path
-	 * @return
-	 */
-	public static String mosaicFileName(MultipartFile mf, boolean isPrivate, String sign, String path, String uid) {
-		String suffix = mf.getOriginalFilename().substring(mf.getOriginalFilename().lastIndexOf("."));
-		boolean uniq = false;
-		if (sign.indexOf("demand_picture") != -1|| sign.indexOf("achievement_picture") != -1 || sign.indexOf("user_picture")!=-1) {
-			uniq = true;
-		}
-		String fileName = "";
-		if (isPrivate || StringUtils.isNotBlank(sign)) {
-			if (uniq) {
-				fileName = path + uid + "/" + System.nanoTime() + "_" + sign + suffix;
-			} else {
-				fileName = path + uid + "/" +  sign + suffix;
-			}
-		} else {
-			fileName = path + uid + "/" + System.nanoTime() + suffix;
-		}
-		return fileName;
-	}
-
-	/**
-	 * 获取下载文件名称
-	 * 
-	 * @param path
-	 * @return
-	 */
-	public static String getDownloadFileName(String path) {
-		if (StringUtils.isBlank(path) || path.lastIndexOf(".") < 0) {
-			return null;
-		}
-		String prefix = "附件";
-		String suffix = path.substring(path.lastIndexOf("."));
-		return prefix + suffix;
-	}
-
-	public static String getSuffix(String path) {
-		if (StringUtils.isBlank(path) || path.lastIndexOf(".") < 0) {
-			return "";
-		}
-		return path.substring(path.lastIndexOf("."));
-	}
-
-	/**
-	 * 拼接文件路径
-	 * 
-	 * @param root
-	 * @param params
-	 * @return
-	 */
-	public static String buildFilePath(String... params) {
-		StringBuilder sb = new StringBuilder();
-		if (params != null) {
-			for (String s : params) {
-				sb.append(SLASH);
-				sb.append(SLASH_PATTERN.matcher(s).replaceAll(""));
-			}
-		}
-		return sb.toString();
-	}
-
-	/**
-	 * 拼接文件名字
-	 * 
-	 * @param root
-	 * @param params
-	 * @return
-	 */
-	public static String buildFileName(String... params) {
-		return StringUtils.join(params, UNDERLINE);
-	}
-
-	// year
-	private static String subStr(String s) {
-		return "企业" + s.substring(s.lastIndexOf(UNDERLINE) + 1, s.lastIndexOf("."));
-	}
-
-	public static boolean deleteFile(String realFilePath) {
-		return new File(realFilePath).delete();
-	}
-
-	/**
-	 * 
-	 * @param response
-	 * @param fileName
-	 * @param realFilePath
-	 */
-	public static void downloadFile(HttpServletResponse response, String fileName, String realFilePath) {
-		InputStream in = null;
-		OutputStream out = null;
-		byte[] buffer = new byte[8 * 1024];
-		try {
-			File file = new File(realFilePath);
-			in = new FileInputStream(file);
-			out = response.getOutputStream();
-			// 设置文件MIME类型
-			response.setContentType("application/octet-stream");
-			fileName = java.net.URLEncoder.encode(fileName, "UTF-8");
-			response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
-			response.setHeader("Content-Length", String.valueOf(file.length()));
-			for (;;) {
-				int bytes = in.read(buffer);
-				if (bytes == -1) {
-					break;
-				}
-				out.write(buffer, 0, bytes);
-			}
-		} catch (IOException e) {
-			LoggerUtils.fmtError(FileUtils.class, e, "IO错误:%s", e.getMessage());
-		} finally {
-			try {
-				if (in != null) {
-					in.close();
-				}
-			} catch (IOException e) {
-				in = null;
-				LoggerUtils.fmtError(FileUtils.class, e, "IO错误:%s", e.getMessage());
-			}
-			try {
-				if (out != null) {
-					out.close();
-				}
-			} catch (IOException e) {
-				out = null;
-				LoggerUtils.fmtError(FileUtils.class, e, "IO错误:%s", e.getMessage());
-			}
-		}
-	}
-
-}
+package com.goafanti.common.utils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.regex.Pattern;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.multipart.MultipartFile;
+
+import com.goafanti.common.enums.AttachmentType;
+
+public class FileUtils {
+	@Value(value = "${upload.private.path}")
+	private String					uploadPrivatePath	= null;
+
+	private static final Pattern	SLASH_PATTERN		= Pattern.compile("^/|/$");
+	private static final String		SLASH				= "/";
+	private static final String		UNDERLINE			= "_";
+
+	/**
+	 * response 输出JSON
+	 * 
+	 * @param hresponse
+	 * @param resultMap
+	 * @throws IOException
+	 */
+	public static void out(HttpServletResponse response, String jsonStr) {
+		PrintWriter out = null;
+		try {
+			response.setHeader("Content-Type", "application/json");
+			response.setCharacterEncoding("UTF-8");
+			out = response.getWriter();
+			out.println(jsonStr);
+		} catch (Exception e) {
+			LoggerUtils.fmtError(FileUtils.class, e, "输出数据失败");
+		} finally {
+			if (null != out) {
+				out.flush();
+				out.close();
+			}
+		}
+	}
+
+	/**
+	 * Excel报表导出
+	 * 
+	 * @param response
+	 * @param fileName
+	 * @param workbook
+	 */
+	public static void downloadExcel(HttpServletResponse response, String fileName, HSSFWorkbook workbook) {
+		String fn = null;
+		try {
+			fn = URLEncoder.encode(fileName, "UTF-8");
+		} catch (UnsupportedEncodingException e1) {
+			fn = fileName;
+		}
+		response.setContentType("application/x-download;charset=UTF-8");
+		response.setHeader("Content-Disposition", "attachment; filename=\"" + fn + "\";");
+		OutputStream out = null;
+		try {
+			out = response.getOutputStream();
+			workbook.write(out);
+		} catch (IOException e) {
+			LoggerUtils.fmtError(FileUtils.class, e, "输出Excel失败");
+		} finally {
+			if (null != out) {
+				try {
+					out.flush();
+					out.close();
+				} catch (IOException e) {
+					out = null;
+				}
+			}
+		}
+	}
+
+	/**
+	 * 根据上传文件 拼接fileName
+	 * 
+	 * @param mf
+	 * @param isPrivate
+	 * @param sign
+	 * @param path
+	 * @return
+	 */
+	public static String mosaicFileName(MultipartFile mf, boolean isPrivate, String sign, String path, String uid) {
+		String suffix = mf.getOriginalFilename().substring(mf.getOriginalFilename().lastIndexOf("."));
+		boolean uniq = false;
+		if (sign.indexOf("demand_picture") != -1|| sign.indexOf("achievement_picture") != -1 || sign.indexOf("user_picture")!=-1
+				|| sign.indexOf("jt_project_picture")!=-1 || sign.indexOf("jt_business_picture")!=-1) {
+			uniq = true;
+		}
+		String fileName = "";
+		if (isPrivate || StringUtils.isNotBlank(sign)) {
+			if (uniq) {
+				fileName = path + uid + "/" + System.nanoTime() + "_" + sign + suffix;
+			} else {
+				fileName = path + uid + "/" +  sign + suffix;
+			}
+		} else {
+			fileName = path + uid + "/" + System.nanoTime() + suffix;
+		}
+		return fileName;
+	}
+
+	/**
+	 * 获取下载文件名称
+	 * 
+	 * @param path
+	 * @return
+	 */
+	public static String getDownloadFileName(String path) {
+		if (StringUtils.isBlank(path) || path.lastIndexOf(".") < 0) {
+			return null;
+		}
+		String prefix = "附件";
+		String suffix = path.substring(path.lastIndexOf("."));
+		return prefix + suffix;
+	}
+
+	public static String getSuffix(String path) {
+		if (StringUtils.isBlank(path) || path.lastIndexOf(".") < 0) {
+			return "";
+		}
+		return path.substring(path.lastIndexOf("."));
+	}
+
+	/**
+	 * 拼接文件路径
+	 * 
+	 * @param root
+	 * @param params
+	 * @return
+	 */
+	public static String buildFilePath(String... params) {
+		StringBuilder sb = new StringBuilder();
+		if (params != null) {
+			for (String s : params) {
+				sb.append(SLASH);
+				sb.append(SLASH_PATTERN.matcher(s).replaceAll(""));
+			}
+		}
+		return sb.toString();
+	}
+
+	/**
+	 * 拼接文件名字
+	 * 
+	 * @param root
+	 * @param params
+	 * @return
+	 */
+	public static String buildFileName(String... params) {
+		return StringUtils.join(params, UNDERLINE);
+	}
+
+	// year
+	private static String subStr(String s) {
+		return "企业" + s.substring(s.lastIndexOf(UNDERLINE) + 1, s.lastIndexOf("."));
+	}
+
+	public static boolean deleteFile(String realFilePath) {
+		return new File(realFilePath).delete();
+	}
+
+	/**
+	 * 
+	 * @param response
+	 * @param fileName
+	 * @param realFilePath
+	 */
+	public static void downloadFile(HttpServletResponse response, String fileName, String realFilePath) {
+		InputStream in = null;
+		OutputStream out = null;
+		byte[] buffer = new byte[8 * 1024];
+		try {
+			File file = new File(realFilePath);
+			in = new FileInputStream(file);
+			out = response.getOutputStream();
+			// 设置文件MIME类型
+			response.setContentType("application/octet-stream");
+			fileName = java.net.URLEncoder.encode(fileName, "UTF-8");
+			response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
+			response.setHeader("Content-Length", String.valueOf(file.length()));
+			for (;;) {
+				int bytes = in.read(buffer);
+				if (bytes == -1) {
+					break;
+				}
+				out.write(buffer, 0, bytes);
+			}
+		} catch (IOException e) {
+			LoggerUtils.fmtError(FileUtils.class, e, "IO错误:%s", e.getMessage());
+		} finally {
+			try {
+				if (in != null) {
+					in.close();
+				}
+			} catch (IOException e) {
+				in = null;
+				LoggerUtils.fmtError(FileUtils.class, e, "IO错误:%s", e.getMessage());
+			}
+			try {
+				if (out != null) {
+					out.close();
+				}
+			} catch (IOException e) {
+				out = null;
+				LoggerUtils.fmtError(FileUtils.class, e, "IO错误:%s", e.getMessage());
+			}
+		}
+	}
+
+}

+ 17 - 0
src/main/java/com/goafanti/demand/bo/DemandListBo.java

@@ -28,8 +28,17 @@ public class DemandListBo extends InputDemand{
 	private String employerName;
 	private BigDecimal fundForPersonnel;
 	private BigDecimal fundForCrowd;
+	private String firstPic;
 	
 
+	public String getFirstPic() {
+		return firstPic;
+	}
+
+	public void setFirstPic(String firstPic) {
+		this.firstPic = firstPic;
+	}
+
 	public String getDemandTypeS() {
 		return demandTypeS;
 	}
@@ -133,6 +142,14 @@ public class DemandListBo extends InputDemand{
 		setDemandTypeS(DemandTypeEnum.find(demandType.intValue()).getName());
 		
 	}
+	@Override
+	public void setPictureUrl(String pictureUrl) {
+		// TODO Auto-generated method stub
+		super.setPictureUrl(pictureUrl);
+		if(pictureUrl!=null) {
+			setFirstPic(pictureUrl.split(",")[0]);
+		}
+	}
 	
 
 	

+ 8 - 8
src/main/java/com/goafanti/demand/controller/UserDemandApiController.java

@@ -105,14 +105,14 @@ public class UserDemandApiController extends CertifyApiController {
 		Demand d = new Demand();
 		BeanUtils.copyProperties(demand, d);
 		d.setEmployerId(TokenManager.getUserId());
-		if(TokenManager.getUserToken().getType().intValue() == UserType.PERSONAL.getCode().intValue()){
-			d.setDataCategory(DemandDataCategory.USERDEMAND.getCode());
-		}else if(TokenManager.getUserToken().getType().intValue() == UserType.ORGANIZATION.getCode().intValue()){
-			d.setDataCategory(DemandDataCategory.ORGDEMAND.getCode());
-		}else{
-			res.getError().add(buildError(ErrorConstants.USER_UN_AUTHENTICATION,"","用户未认证"));
-			return res;
-		}
+//		if(TokenManager.getUserToken().getType().intValue() == UserType.PERSONAL.getCode().intValue()){
+//			d.setDataCategory(DemandDataCategory.USERDEMAND.getCode());
+//		}else if(TokenManager.getUserToken().getType().intValue() == UserType.ORGANIZATION.getCode().intValue()){
+//			d.setDataCategory(DemandDataCategory.ORGDEMAND.getCode());
+//		}else{
+//			res.getError().add(buildError(ErrorConstants.USER_UN_AUTHENTICATION,"","用户未认证"));
+//			return res;
+//		}
 		List<String> webPages = new ArrayList<String>();
 		List<String> appPages = new ArrayList<String>();
 		PageConstants.putDemand(publishPages, webPages, appPages);

+ 3 - 3
src/main/java/com/goafanti/user/bo/InputOrganizationIdentity.java

@@ -43,7 +43,7 @@ public class InputOrganizationIdentity {
 
 	@Max(value = 999999, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	private Integer		registeredCapital;
+	private BigDecimal		registeredCapital;
 
 	@Size(min = 0, max = 32, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String		licenceNumber;
@@ -271,11 +271,11 @@ public class InputOrganizationIdentity {
 		this.identifyName = identifyName;
 	}
 
-	public Integer getRegisteredCapital() {
+	public BigDecimal getRegisteredCapital() {
 		return registeredCapital;
 	}
 
-	public void setRegisteredCapital(Integer registeredCapital) {
+	public void setRegisteredCapital(BigDecimal registeredCapital) {
 		this.registeredCapital = registeredCapital;
 	}
 

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

@@ -54,24 +54,24 @@
             <div class="logo_right"></div>
             <div class="nav">
                 <ul>
-                    <li th:class="${subM}=='serviceIndex'?active:null">
+                    <li >
                     <div>
                         <a th:href="@{/portal/service/serviceIndex}">科技服务</a>
  
                        </div>
                     </li>
-                    <li th:class="${subM}=='achievement'?active:null">
+                    <li >
                     <div>
                         <a th:href="@{/portal/technologyTrading/achievement}">技术成果</a>
                         </div>
                     </li>
-                    <li th:class="${subM}=='demand'?active:null">
+                    <li>
                     <div>
                         <a th:href="@{/portal/technologyTrading/demand}">技术需求</a></div>
                     </li>
                             
                     
-                    <li th:class="${subM}=='thinkTankIndex'?active:null">
+                    <li >
                     <div>
                         <a th:href="@{/portal/thinkTank/index.html}">智库咨询</a>
                         <ol class="subnavigation">
@@ -85,7 +85,7 @@
                         </div>
                     </li>
 
-                    <li th:class="${subM}=='aboutUs'?active:null">
+                    <li >
                     <div>
                         <a th:href="@{/portal/aboutUs}">关于公司</a>
                         <ol class="subnavigation" style="display: none;">

+ 9 - 9
src/main/webapp/WEB-INF/views/portal/technologyTrading/achievementDetail.html

@@ -33,11 +33,11 @@
 						<h3 th:text="${achievementdetail.name}"></h3>
 					</div>
 					<div class="big_img">
-						<div th:if="${achievementdetail.technicalPictureUrl} == null ">
+						<div th:if="${achievementdetail.firstPicture} == null ">
 							<img th:src="${portalHost+'/img/indexNewTab.jpg'}" alt=""/>
 						</div>
-						<div th:if="${achievementdetail.technicalPictureUrl} != null ">
-							<img th:src= "${avatarUploadHost+achievementdetail.technicalPictureUrl}"alt=""  />
+						<div th:if="${achievementdetail.firstPicture} != null ">
+							<img th:src= "${avatarUploadHost+achievementdetail.firstPicture}"alt=""  />
 						</div>
 					</div>
 					<div class="basic">
@@ -77,11 +77,11 @@
 						<div class="fine_title">精品专利</div>
 						<div th:each="reboutiqueachievement:${reboutiqueachievement}" class="pointer" >
 							
-							<div th:if="${reboutiqueachievement.technicalPictureUrl} == null " >
+							<div th:if="${reboutiqueachievement.firstPicture} == null " >
 								<img th:src="${portalHost+'/img/indexNewTab.jpg'}" alt=""/>
 							</div>
-							<div th:if="${reboutiqueachievement.technicalPictureUrl} != null ">
-								<img th:src="${avatarUploadHost+reboutiqueachievement.technicalPictureUrl}" alt=""/>
+							<div th:if="${reboutiqueachievement.firstPicture} != null ">
+								<img th:src="${avatarUploadHost+reboutiqueachievement.firstPicture}" alt=""/>
 							</div>
 							<p th:text="${reboutiqueachievement.name}"></p>
 							<p class="demandId" th:text="${reboutiqueachievement.id}"></p>
@@ -102,11 +102,11 @@
 				<div class="main_introduce" >
 					<ul>
 						<li th:each="reachievementlist:${guess}">
-							<div th:if="${reachievementlist.technicalPictureUrl} == null " >
+							<div th:if="${reachievementlist.firstPicture} == null " >
 								<img th:src="${portalHost+'/img/indexNewTab.jpg'}" alt=""/>
 							</div>
-							<div th:if="${reachievementlist.technicalPictureUrl} != null " >
-								<img th:src="${avatarUploadHost+reachievementlist.technicalPictureUrl}" alt=""/>
+							<div th:if="${reachievementlist.firstPicture} != null " >
+								<img th:src="${avatarUploadHost+reachievementlist.firstPicture}" alt=""/>
 							</div>
 							
 							<div class="list_text">

+ 2 - 2
src/main/webapp/WEB-INF/views/portal/technologyTrading/demand.html

@@ -153,7 +153,7 @@
 							</p>
 							
 							<p>
-								 <span class="problemDes" th:text="${u2.problemDes}"></span>	
+								 <p class="problemDes" th:text="${u2.problemDes}"></p>	
 								 <span class="colorTime" th:if="${u2.validityPeriod}==null" th:text="无期限"></span>
 								 <span class="colorTime" th:if="${u2.validityPeriod}!=null" th:text="${#dates.format(u2.validityPeriod,'yyyy-MM-dd')+'到期'}"></span>
 								 <span class="colorOrange" th:if="${u2.demandType}==5" th:text="${u2.fundForPersonnel}==null?'人才:¥0元/月':${'人才:¥'+u2.fundForPersonnel+'元/月'}"></span>
@@ -225,7 +225,7 @@
 								  <span class="name" th:text="${h2.name}"></span>
 							</p>
 							<p>
-								 <span class="problemDes" th:text="${h2.problemDes}"></span>	
+								 <p class="problemDes" th:text="${h2.problemDes}"></p>	
 								 <span class="colorOrange" th:if="${h2.demandType}==5" th:text="${h2.fundForPersonnel}==null?'人才:¥0.00元/月':${'人才:¥'+h2.fundForPersonnel}+'元/月'"></span>
 								 <span class="colorOrange" th:if="${h2.demandType}==3" th:text="${'期望资金:¥'+h2.fundForCrowd}+'万'"></span>
 								<span class="colorTime">	<img th:src="${portalHost+'/img/newMenu/demand-5.jpg'}" alt=""></span>

+ 9 - 9
src/main/webapp/WEB-INF/views/portal/technologyTrading/demandDetail.html

@@ -26,11 +26,11 @@
 						<h3 th:text="${#strings.abbreviate(demand.name,11)}"></h3>
 					</div>
 					<div class="big_img">
-						<div th:if="${demand.pictureUrl} == null " >
+						<div th:if="${demand.firstPic} == null " >
 							<img th:src="${portalHost+'/img/indexNewTab.jpg'}" alt=""/>
 						</div>
-						<div th:if="${demand.pictureUrl} != null " >
-							<img th:src= "${avatarUploadHost+demand.pictureUrl}"alt="" />
+						<div th:if="${demand.firstPic} != null " >
+							<img th:src= "${avatarUploadHost+demand.firstPic}"alt="" />
 						</div>
 					</div>
 					<div class="basic">
@@ -64,11 +64,11 @@
 						<div class="fine_title">精品需求</div>
 						<div th:each="reboutiquedemand:${reboutiquedemand}" class="pointer">
 							
-							<div th:if="${reboutiquedemand.pictureUrl} == null " >
+							<div th:if="${reboutiquedemand.firstPic} == null " >
 								<img th:src="${portalHost+'/img/indexNewTab.jpg'}" alt=""/>
 							</div>
-							<div th:if="${reboutiquedemand.pictureUrl} != null" >
-								<img th:src="${avatarUploadHost+reboutiquedemand.pictureUrl}" alt=""/>
+							<div th:if="${reboutiquedemand.firstPic} != null" >
+								<img th:src="${avatarUploadHost+reboutiquedemand.firstPic}" alt=""/>
 							</div>
 							<p th:text="${reboutiquedemand.name}"></p>
 							<p th:text="${reboutiquedemand.id}" class="demandId"></p>
@@ -88,11 +88,11 @@
 				<div class="main_introduce">
 					<ul>
 						<li th:each="redemandlist:${redemandlist}"> 
-							<div th:if="${redemandlist.pictureUrl} == null " >
+							<div th:if="${redemandlist.firstPic} == null " >
 								<img th:src="${portalHost+'/img/indexNewTab.jpg'}" alt=""/>
 							</div>
-							<div th:if="${redemandlist.pictureUrl} != null" >
-								<img th:src="${avatarUploadHost+redemandlist.pictureUrl}" alt=""/>
+							<div th:if="${redemandlist.firstPic} != null" >
+								<img th:src="${avatarUploadHost+redemandlist.firstPic}" alt=""/>
 							</div>
 						 
 							<div class="list_text">