|
|
@@ -2,6 +2,7 @@ package com.goafanti.admin.controller;
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
import java.util.Calendar;
|
|
|
+import java.util.List;
|
|
|
import java.util.UUID;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
@@ -14,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.controller.BaseApiController;
|
|
|
+import com.goafanti.common.model.OrgActivity;
|
|
|
+import com.goafanti.common.model.OrgActivityCost;
|
|
|
import com.goafanti.common.model.OrgFinance;
|
|
|
import com.goafanti.common.model.OrgHumanResource;
|
|
|
import com.goafanti.common.model.OrgIntellectualProperty;
|
|
|
@@ -26,6 +29,9 @@ import com.goafanti.common.utils.DateUtils;
|
|
|
import com.goafanti.common.utils.StringUtils;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
+import com.goafanti.techservice.cognizance.bo.ActivityNumberBo;
|
|
|
+import com.goafanti.techservice.cognizance.service.OrgActivityCostService;
|
|
|
+import com.goafanti.techservice.cognizance.service.OrgActivityService;
|
|
|
import com.goafanti.techservice.cognizance.service.OrgFinanceService;
|
|
|
import com.goafanti.techservice.cognizance.service.OrgIntellectualPropertyService;
|
|
|
import com.goafanti.techservice.cognizance.service.OrgRatepayService;
|
|
|
@@ -42,23 +48,27 @@ import com.goafanti.user.service.UserService;
|
|
|
@RequestMapping(value = "/api/admin")
|
|
|
public class AdminApiController extends BaseApiController {
|
|
|
@Resource
|
|
|
- private UserService userService;
|
|
|
+ private UserService userService;
|
|
|
@Resource
|
|
|
- private UserIdentityService userIdentityService;
|
|
|
+ private UserIdentityService userIdentityService;
|
|
|
@Resource
|
|
|
- private OrganizationIdentityService organizationIdentityService;
|
|
|
+ private OrganizationIdentityService organizationIdentityService;
|
|
|
@Resource
|
|
|
- private OrgHumanResourceService orgHumanResourceService;
|
|
|
+ private OrgHumanResourceService orgHumanResourceService;
|
|
|
@Resource
|
|
|
- private OrgStandardService orgStandardService;
|
|
|
+ private OrgStandardService orgStandardService;
|
|
|
@Resource
|
|
|
- private OrgIntellectualPropertyService orgIntellectualPropertyService;
|
|
|
+ private OrgIntellectualPropertyService orgIntellectualPropertyService;
|
|
|
@Resource
|
|
|
- private OrgTechProductService orgTechProductService;
|
|
|
+ private OrgTechProductService orgTechProductService;
|
|
|
@Resource
|
|
|
- private OrgRatepayService orgRatepayService;
|
|
|
+ private OrgRatepayService orgRatepayService;
|
|
|
@Resource
|
|
|
- private OrgFinanceService orgFinanceService;
|
|
|
+ private OrgFinanceService orgFinanceService;
|
|
|
+ @Resource
|
|
|
+ private OrgActivityService orgActivityService;
|
|
|
+ @Resource
|
|
|
+ private OrgActivityCostService orgActivityCostService;
|
|
|
|
|
|
/**
|
|
|
* 个人用户列表
|
|
|
@@ -226,7 +236,7 @@ public class AdminApiController extends BaseApiController {
|
|
|
Integer participateWay, String pageNo, String pageSize) {
|
|
|
Result res = new Result();
|
|
|
res = checkCertify(res, uid);
|
|
|
- if (res.getError().isEmpty()){
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
Integer pNo = 1;
|
|
|
Integer pSize = 10;
|
|
|
if (StringUtils.isNumeric(pageSize)) {
|
|
|
@@ -235,21 +245,22 @@ public class AdminApiController extends BaseApiController {
|
|
|
if (StringUtils.isNumeric(pageNo)) {
|
|
|
pNo = Integer.parseInt(pageNo);
|
|
|
}
|
|
|
- res.setData(orgStandardService.listOrgStandard(standardName, standardNumber, standardLevel, participateWay, pNo,
|
|
|
- pSize, uid));
|
|
|
+ res.setData(orgStandardService.listOrgStandard(standardName, standardNumber, standardLevel, participateWay,
|
|
|
+ pNo, pSize, uid));
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 企业参与国家标准或行业标准制定情况明细修改保存
|
|
|
+ *
|
|
|
* @param orgStandard
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/developStandard", method = RequestMethod.POST)
|
|
|
- public Result developStandard(OrgStandard orgStandard){
|
|
|
+ public Result developStandard(OrgStandard orgStandard) {
|
|
|
Result res = new Result();
|
|
|
- if (StringUtils.isBlank(orgStandard.getId())){
|
|
|
+ if (StringUtils.isBlank(orgStandard.getId())) {
|
|
|
orgStandard.setId(UUID.randomUUID().toString());
|
|
|
orgStandard.setDeletedSign(0);
|
|
|
Calendar now = Calendar.getInstance();
|
|
|
@@ -259,21 +270,23 @@ public class AdminApiController extends BaseApiController {
|
|
|
} else {
|
|
|
orgStandardService.updateByPrimaryKeySelective(orgStandard);
|
|
|
}
|
|
|
- res.setData(orgStandard);
|
|
|
+ res.setData(orgStandard);
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
- * 管理端录入知识产权信息
|
|
|
+ * 管理端录入+修改知识产权信息
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
- @RequestMapping(value="/intellectual", method = RequestMethod.POST)
|
|
|
- public Result intellectual(OrgIntellectualProperty orgIntellectualProperty, String authorizationDateFormattedDate, String uid){
|
|
|
+ @RequestMapping(value = "/intellectual", method = RequestMethod.POST)
|
|
|
+ public Result intellectual(OrgIntellectualProperty orgIntellectualProperty, String authorizationDateFormattedDate,
|
|
|
+ String uid) {
|
|
|
Result res = new Result();
|
|
|
- if (null == authorizationDateFormattedDate){
|
|
|
+ if (null == authorizationDateFormattedDate) {
|
|
|
res.getError().add(buildError(ErrorConstants.DATA_EMPTY_ERROR, "授权日期不能为空"));
|
|
|
}
|
|
|
- if (null == orgIntellectualProperty.getId()){
|
|
|
+ if (null == orgIntellectualProperty.getId()) {
|
|
|
try {
|
|
|
orgIntellectualProperty.setId(UUID.randomUUID().toString());
|
|
|
orgIntellectualProperty.setUid(uid);
|
|
|
@@ -292,7 +305,7 @@ public class AdminApiController extends BaseApiController {
|
|
|
orgIntellectualProperty.setEvaluationCategory(orgIntellectualProperty.getCatagory() <= 2 ? 1 : 0);
|
|
|
try {
|
|
|
orgIntellectualProperty
|
|
|
- .setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
|
|
|
+ .setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
|
|
|
} catch (ParseException e) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "日期格式不正确"));
|
|
|
return res;
|
|
|
@@ -301,9 +314,10 @@ public class AdminApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 知识产权列表
|
|
|
+ *
|
|
|
* @param pageNo
|
|
|
* @param pageSize
|
|
|
* @return
|
|
|
@@ -312,7 +326,7 @@ public class AdminApiController extends BaseApiController {
|
|
|
public Result intellectualList(String pageNo, String pageSize, String uid) {
|
|
|
Result res = new Result();
|
|
|
res = checkCertify(res, uid);
|
|
|
- if (res.getError().isEmpty()){
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
Integer pNo = 1;
|
|
|
Integer pSize = 10;
|
|
|
if (StringUtils.isNumeric(pageSize)) {
|
|
|
@@ -325,18 +339,19 @@ public class AdminApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 上年度高新技术产品(服务)情况列表
|
|
|
+ *
|
|
|
* @param pageNo
|
|
|
* @param pageSize
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/techProductList", method = RequestMethod.POST)
|
|
|
- public Result techProductList(String pageNo, String pageSize, String uid){
|
|
|
+ public Result techProductList(String pageNo, String pageSize, String uid) {
|
|
|
Result res = new Result();
|
|
|
res = checkCertify(res);
|
|
|
- if (res.getError().isEmpty()){
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
Integer pNo = 1;
|
|
|
Integer pSize = 10;
|
|
|
if (StringUtils.isNumeric(pageSize)) {
|
|
|
@@ -351,14 +366,146 @@ public class AdminApiController extends BaseApiController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 企业研究开发活动情况表入口
|
|
|
+ *
|
|
|
+ * @param activityNumber
|
|
|
+ * @param activityName
|
|
|
+ * @param startDate
|
|
|
+ * @param endDate
|
|
|
+ * @param pageNo
|
|
|
+ * @param pageSize
|
|
|
+ * @return
|
|
|
+ * @throws ParseException
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/activityList", method = RequestMethod.POST)
|
|
|
+ public Result activityList(String activityNumber, String activityName, String startDateFormattedDate,
|
|
|
+ String endDateFormattedDate, String pageNo, String pageSize, String uid) throws ParseException {
|
|
|
+ Result res = new Result();
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ Integer pNo = 1;
|
|
|
+ Integer pSize = 10;
|
|
|
+ if (StringUtils.isNumeric(pageSize)) {
|
|
|
+ pSize = Integer.parseInt(pageSize);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNumeric(pageNo)) {
|
|
|
+ pNo = Integer.parseInt(pageNo);
|
|
|
+ }
|
|
|
+ res.setData(orgActivityService.listOrgActivity(activityNumber, activityName, startDateFormattedDate,
|
|
|
+ endDateFormattedDate, pNo, pSize, uid));
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 企业研究开发活动情况新增、修改
|
|
|
+ *
|
|
|
+ * @param orgActivity
|
|
|
+ * @return
|
|
|
+ * @throws ParseException
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/activity", method = RequestMethod.POST)
|
|
|
+ public Result activity(OrgActivity orgActivity, String startDateFormattedDate, String endDateFormattedDate)
|
|
|
+ throws ParseException {
|
|
|
+ Result res = new Result();
|
|
|
+ orgActivity.setDeletedSign(0);
|
|
|
+ orgActivity.setStartDate(DateUtils.parseDate(startDateFormattedDate, "yyyy-MM-dd"));
|
|
|
+ orgActivity.setEndDate(DateUtils.parseDate(endDateFormattedDate, "yyyy-MM-dd"));
|
|
|
+ if (StringUtils.isBlank(orgActivity.getId())) {
|
|
|
+ orgActivity.setId(UUID.randomUUID().toString());
|
|
|
+ orgActivity.setUid(TokenManager.getUserId());
|
|
|
+ orgActivityService.insert(orgActivity);
|
|
|
+ } else {
|
|
|
+ orgActivityService.updateByPrimaryKeySelective(orgActivity);
|
|
|
+ Boolean flag = false;
|
|
|
+ OrgActivityCost cost = orgActivityCostService.selectOrgActivityCostByAid(orgActivity.getId());
|
|
|
+ if (null != cost) {
|
|
|
+ if (!StringUtils.isBlank(orgActivity.getActivityNumber())) {
|
|
|
+ cost.setActivityNumber(orgActivity.getActivityNumber());
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ if (null == orgActivity.getStartDate()) {
|
|
|
+ cost.setStartDate(orgActivity.getStartDate());
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ if (null == orgActivity.getEndDate()) {
|
|
|
+ cost.setEndDate(orgActivity.getEndDate());
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (flag) {
|
|
|
+ orgActivityCostService.updateByPrimaryKeySelective(cost);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ res.setData(orgActivity);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 企业年度研究开发费用结构明细表列表入口
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ * @throws ParseException
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/activityCostList", method = RequestMethod.POST)
|
|
|
+ public Result activityCostList(String activityNumber, String startDateFormattedDate, String endDateFormattedDate,
|
|
|
+ String pageNo, String pageSize, String uid) throws ParseException {
|
|
|
+ Result res = new Result();
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ Integer pNo = 1;
|
|
|
+ Integer pSize = 10;
|
|
|
+ if (StringUtils.isNumeric(pageSize)) {
|
|
|
+ pSize = Integer.parseInt(pageSize);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNumeric(pageNo)) {
|
|
|
+ pNo = Integer.parseInt(pageNo);
|
|
|
+ }
|
|
|
+ res.setData(orgActivityCostService.listOrgActivityCost(activityNumber, startDateFormattedDate,
|
|
|
+ endDateFormattedDate, pNo, pSize, uid));
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 企业年度研究开发费用结构明细表(新增+修改)
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/activityCost", method = RequestMethod.POST)
|
|
|
+ public Result activityCost(OrgActivityCost orgActivityCost, String signDateFormattedDate) {
|
|
|
+ Result res = new Result();
|
|
|
+ try {
|
|
|
+ orgActivityCost.setSignDate(DateUtils.parseDate(signDateFormattedDate, "yyyy-MM-dd"));
|
|
|
+ } catch (ParseException e) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "日期格式不正确"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if (null == orgActivityCost.getId()) {
|
|
|
+ OrgActivity ac = orgActivityService.selectOrgActivityByPrimaryKey(orgActivityCost.getAid());
|
|
|
+ orgActivityCost.setStartDate(ac.getStartDate());
|
|
|
+ orgActivityCost.setEndDate(ac.getEndDate());
|
|
|
+ orgActivityCost.setId(UUID.randomUUID().toString());
|
|
|
+ orgActivityCost.setUid(TokenManager.getUserId());
|
|
|
+ orgActivityCost.setDeletedSign(0);
|
|
|
+ orgActivityCostService.insert(orgActivityCost);
|
|
|
+ } else {
|
|
|
+ orgActivityCostService.updateByPrimaryKeySelective(orgActivityCost);
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
* 上年度高新技术产品(服务)情况(新增+修改)
|
|
|
+ *
|
|
|
* @param orgTechProduct
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/techProduct", method = RequestMethod.POST)
|
|
|
- public Result techProduct(OrgTechProduct orgTechProduct){
|
|
|
+ public Result techProduct(OrgTechProduct orgTechProduct) {
|
|
|
Result res = new Result();
|
|
|
- if (null == orgTechProduct.getId()){
|
|
|
+ if (null == orgTechProduct.getId()) {
|
|
|
orgTechProduct.setId(UUID.randomUUID().toString());
|
|
|
orgTechProduct.setDeletedSign(0);
|
|
|
orgTechProductService.insert(orgTechProduct);
|
|
|
@@ -368,13 +515,14 @@ public class AdminApiController extends BaseApiController {
|
|
|
res.setData(orgTechProduct);
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 企业纳税申报信息入口
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/ratepay", method = RequestMethod.POST)
|
|
|
- public Result ratepay (Integer year, String pageNo, String pageSize, String uid){
|
|
|
+ public Result ratepay(Integer year, String pageNo, String pageSize, String uid) {
|
|
|
Result res = new Result();
|
|
|
res = checkCertify(res);
|
|
|
if (res.getError().isEmpty()) {
|
|
|
@@ -390,14 +538,14 @@ public class AdminApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 企业纳税申报信息录入+修改
|
|
|
*/
|
|
|
@RequestMapping(value = "/disposeRatepay", method = RequestMethod.POST)
|
|
|
- public Result disposeRatepay(OrgRatepay orgRatepay){
|
|
|
+ public Result disposeRatepay(OrgRatepay orgRatepay) {
|
|
|
Result res = new Result();
|
|
|
- if (null == orgRatepay.getId()){
|
|
|
+ if (null == orgRatepay.getId()) {
|
|
|
orgRatepay.setId(UUID.randomUUID().toString());
|
|
|
orgRatepayService.insert(orgRatepay);
|
|
|
} else {
|
|
|
@@ -405,7 +553,7 @@ public class AdminApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 财务报表信息入口
|
|
|
*
|
|
|
@@ -446,21 +594,35 @@ public class AdminApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- //判断用户是否通过认证
|
|
|
- private Result checkCertify(Result res,String uid){
|
|
|
- if (5 != organizationIdentityService.selectOrgIdentityByUserId(uid).getAuditStatus()){
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取当前用户已录入项目标号列表
|
|
|
+ *
|
|
|
+ * @param uid
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/activityNumber", method = RequestMethod.POST)
|
|
|
+ public Result listActivityNumber(String uid) {
|
|
|
+ Result res = new Result();
|
|
|
+ List<ActivityNumberBo> activityNumberBo = orgActivityService
|
|
|
+ .selectOrgActivityNumberBoByUid(uid);
|
|
|
+ res.setData(activityNumberBo);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断用户是否通过认证
|
|
|
+ private Result checkCertify(Result res, String uid) {
|
|
|
+ if (5 != organizationIdentityService.selectOrgIdentityByUserId(uid).getAuditStatus()) {
|
|
|
res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
|
|
|
- }
|
|
|
+ }
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
// org团体列表
|
|
|
private Pagination<OrgListBo> getOrgList(String mobile, String email, String[] createTime, Integer number,
|
|
|
String aftUsername, Integer auditStatus, Integer pNo, Integer pSize) throws ParseException {
|
|
|
- return (Pagination<OrgListBo>) userService.listOrg(mobile, email, createTime, number, aftUsername,
|
|
|
- auditStatus, pNo, pSize);
|
|
|
+ return (Pagination<OrgListBo>) userService.listOrg(mobile, email, createTime, number, aftUsername, auditStatus,
|
|
|
+ pNo, pSize);
|
|
|
}
|
|
|
|
|
|
// user个人列表
|
|
|
@@ -469,12 +631,12 @@ public class AdminApiController extends BaseApiController {
|
|
|
return (Pagination<UserListBo>) userService.listUser(mobile, email, createTime, number, aftUsername,
|
|
|
auditStatus, pNo, pSize);
|
|
|
}
|
|
|
-
|
|
|
- //判断用户是否通过认证
|
|
|
- private Result checkCertify(Result res){
|
|
|
- if (5 != organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId()).getAuditStatus()){
|
|
|
- res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
|
|
|
- }
|
|
|
- return res;
|
|
|
+
|
|
|
+ // 判断用户是否通过认证
|
|
|
+ private Result checkCertify(Result res) {
|
|
|
+ if (5 != organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId()).getAuditStatus()) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
|
|
|
}
|
|
|
+ return res;
|
|
|
+ }
|
|
|
}
|