|
|
@@ -48,15 +48,15 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@Resource
|
|
|
private OrgIntellectualPropertyService orgIntellectualPropertyService;
|
|
|
@Resource
|
|
|
- private OrganizationIdentityService organizationIdentityService;
|
|
|
+ private OrganizationIdentityService organizationIdentityService;
|
|
|
@Resource
|
|
|
- private OrgTechProductService orgTechProductService;
|
|
|
+ private OrgTechProductService orgTechProductService;
|
|
|
@Resource
|
|
|
- private OrgActivityCostService orgActivityCostService;
|
|
|
+ private OrgActivityCostService orgActivityCostService;
|
|
|
@Resource
|
|
|
- private OrgRatepayService orgRatepayService;
|
|
|
+ private OrgRatepayService orgRatepayService;
|
|
|
@Resource
|
|
|
- private OrgFinanceService orgFinanceService;
|
|
|
+ private OrgFinanceService orgFinanceService;
|
|
|
|
|
|
/**
|
|
|
* 企业研究开发活动情况表入口
|
|
|
@@ -71,11 +71,11 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
* @throws ParseException
|
|
|
*/
|
|
|
@RequestMapping(value = "/activityList", method = RequestMethod.POST)
|
|
|
- public Result activityList(String activityNumber, String activityName, String startDateFormattedDate, String endDateFormattedDate, String pageNo,
|
|
|
- String pageSize) throws ParseException {
|
|
|
+ public Result activityList(String activityNumber, String activityName, String startDateFormattedDate,
|
|
|
+ String endDateFormattedDate, String pageNo, String pageSize) throws ParseException {
|
|
|
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)) {
|
|
|
@@ -84,8 +84,8 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
if (StringUtils.isNumeric(pageNo)) {
|
|
|
pNo = Integer.parseInt(pageNo);
|
|
|
}
|
|
|
- res.setData(orgActivityService.listOrgActivity(activityNumber, activityName, startDateFormattedDate, endDateFormattedDate, pNo, pSize,
|
|
|
- TokenManager.getUserId()));
|
|
|
+ res.setData(orgActivityService.listOrgActivity(activityNumber, activityName, startDateFormattedDate,
|
|
|
+ endDateFormattedDate, pNo, pSize, TokenManager.getUserId()));
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -98,7 +98,8 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
* @throws ParseException
|
|
|
*/
|
|
|
@RequestMapping(value = "/activity", method = RequestMethod.POST)
|
|
|
- public Result activity(OrgActivity orgActivity, String startDateFormattedDate, String endDateFormattedDate) throws ParseException {
|
|
|
+ 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"));
|
|
|
@@ -111,56 +112,57 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
orgActivityService.updateByPrimaryKeySelective(orgActivity);
|
|
|
Boolean flag = false;
|
|
|
OrgActivityCost cost = orgActivityCostService.selectOrgActivityCostByAid(orgActivity.getId());
|
|
|
- if (null != cost){
|
|
|
- if (!StringUtils.isBlank(orgActivity.getActivityNumber())){
|
|
|
+ if (null != cost) {
|
|
|
+ if (!StringUtils.isBlank(orgActivity.getActivityNumber())) {
|
|
|
cost.setActivityNumber(orgActivity.getActivityNumber());
|
|
|
flag = true;
|
|
|
}
|
|
|
- if (null == orgActivity.getStartDate()){
|
|
|
+ if (null == orgActivity.getStartDate()) {
|
|
|
cost.setStartDate(orgActivity.getStartDate());
|
|
|
flag = true;
|
|
|
}
|
|
|
- if (null == orgActivity.getEndDate()){
|
|
|
+ if (null == orgActivity.getEndDate()) {
|
|
|
cost.setEndDate(orgActivity.getEndDate());
|
|
|
flag = true;
|
|
|
}
|
|
|
}
|
|
|
- if (flag){
|
|
|
+ if (flag) {
|
|
|
orgActivityCostService.updateByPrimaryKeySelective(cost);
|
|
|
}
|
|
|
}
|
|
|
res.setData(orgActivity);
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 删除企业研究开发活动情况
|
|
|
+ *
|
|
|
* @param ids
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/deleteActivity", method = RequestMethod.POST)
|
|
|
- public Result deleteActivity(@RequestParam(name = "ids[]", required = true) String[] ids){
|
|
|
+ public Result deleteActivity(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
Result res = new Result();
|
|
|
List<String> id = new ArrayList<String>();
|
|
|
- for (String s : ids){
|
|
|
+ for (String s : ids) {
|
|
|
id.add(s);
|
|
|
}
|
|
|
res.setData(orgActivityService.batchDeleteByPrimaryKey(id));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 企业年度研究开发费用结构明细表列表入口
|
|
|
+ *
|
|
|
* @return
|
|
|
- * @throws ParseException
|
|
|
+ * @throws ParseException
|
|
|
*/
|
|
|
- @RequestMapping(value = "/activityCostList", method = RequestMethod.POST )
|
|
|
- public Result activityCostList(String activityNumber, String startDateFormattedDate, String endDateFormattedDate, String pageNo,
|
|
|
- String pageSize) throws ParseException{
|
|
|
+ @RequestMapping(value = "/activityCostList", method = RequestMethod.POST)
|
|
|
+ public Result activityCostList(String activityNumber, String startDateFormattedDate, String endDateFormattedDate,
|
|
|
+ String pageNo, String pageSize) throws ParseException {
|
|
|
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)) {
|
|
|
@@ -169,18 +171,19 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
if (StringUtils.isNumeric(pageNo)) {
|
|
|
pNo = Integer.parseInt(pageNo);
|
|
|
}
|
|
|
- res.setData(orgActivityCostService.listOrgActivityCost(activityNumber, startDateFormattedDate, endDateFormattedDate, pNo, pSize,
|
|
|
- TokenManager.getUserId()));
|
|
|
+ res.setData(orgActivityCostService.listOrgActivityCost(activityNumber, startDateFormattedDate,
|
|
|
+ endDateFormattedDate, pNo, pSize, TokenManager.getUserId()));
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 企业年度研究开发费用结构明细表(新增+修改)
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/activityCost", method = RequestMethod.POST)
|
|
|
- public Result activityCost(OrgActivityCost orgActivityCost, String signDateFormattedDate){
|
|
|
+ public Result activityCost(OrgActivityCost orgActivityCost, String signDateFormattedDate) {
|
|
|
Result res = new Result();
|
|
|
try {
|
|
|
orgActivityCost.setSignDate(DateUtils.parseDate(signDateFormattedDate, "yyyy-MM-dd"));
|
|
|
@@ -188,7 +191,7 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "日期格式不正确"));
|
|
|
return res;
|
|
|
}
|
|
|
- if (null == orgActivityCost.getId()){
|
|
|
+ if (null == orgActivityCost.getId()) {
|
|
|
OrgActivity ac = orgActivityService.selectOrgActivityByPrimaryKey(orgActivityCost.getAid());
|
|
|
orgActivityCost.setStartDate(ac.getStartDate());
|
|
|
orgActivityCost.setEndDate(ac.getEndDate());
|
|
|
@@ -201,17 +204,18 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 删除企业年度研究开发费用结构明细表
|
|
|
+ *
|
|
|
* @param ids
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/deleteActivityCost", method = RequestMethod.POST)
|
|
|
- public Result deleteActivityCost(@RequestParam(name = "ids[]", required = true) String[] ids){
|
|
|
+ public Result deleteActivityCost(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
Result res = new Result();
|
|
|
List<String> id = new ArrayList<String>();
|
|
|
- for (String s : ids){
|
|
|
+ for (String s : ids) {
|
|
|
id.add(s);
|
|
|
}
|
|
|
res.setData(orgActivityCostService.batchDeleteByPrimaryKey(id));
|
|
|
@@ -228,7 +232,7 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
String pageNo, String pageSize) {
|
|
|
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)) {
|
|
|
@@ -237,8 +241,8 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
if (StringUtils.isNumeric(pageNo)) {
|
|
|
pNo = Integer.parseInt(pageNo);
|
|
|
}
|
|
|
- res.setData(orgStandardService.listOrgStandard(standardName, standardNumber, standardLevel, participateWay, pNo,
|
|
|
- pSize, TokenManager.getUserId()));
|
|
|
+ res.setData(orgStandardService.listOrgStandard(standardName, standardNumber, standardLevel, participateWay,
|
|
|
+ pNo, pSize, TokenManager.getUserId()));
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -277,7 +281,7 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
public Result deleteStandard(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
Result res = new Result();
|
|
|
List<String> id = new ArrayList<String>();
|
|
|
- for (String s : ids){
|
|
|
+ for (String s : ids) {
|
|
|
id.add(s);
|
|
|
}
|
|
|
res.setData(orgStandardService.batchDeleteByPrimaryKey(id));
|
|
|
@@ -292,14 +296,16 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/intellectual", method = RequestMethod.POST)
|
|
|
public Result intellectual(OrgIntellectualProperty orgIntellectualProperty, String authorizationDateFormattedDate) {
|
|
|
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(TokenManager.getUserId());
|
|
|
- orgIntellectualProperty.setEvaluationCategory(orgIntellectualProperty.getCatagory() <= 2 ? 1 : 0);
|
|
|
+ orgIntellectualProperty.setEvaluationCategory(
|
|
|
+ (orgIntellectualProperty.getCatagory() >= 2 && orgIntellectualProperty.getCatagory() <= 4) ? 1
|
|
|
+ : 0);
|
|
|
orgIntellectualProperty
|
|
|
.setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
|
|
|
orgIntellectualProperty.setDeletedSign(0);
|
|
|
@@ -312,7 +318,7 @@ public class CognizanceApiController 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;
|
|
|
@@ -321,19 +327,20 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 用户知识产权列表
|
|
|
+ *
|
|
|
* @param pageNo
|
|
|
* @param pageSize
|
|
|
* @return
|
|
|
*/
|
|
|
-
|
|
|
+
|
|
|
@RequestMapping(value = "/intellectualList", method = RequestMethod.GET)
|
|
|
public Result intellectualList(String pageNo, String pageSize) {
|
|
|
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)) {
|
|
|
@@ -346,34 +353,36 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 删除选中知识产权记录
|
|
|
+ *
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/deleteIntellectual", method = RequestMethod.POST)
|
|
|
- public Result deleteIntellectual(@RequestParam(name = "ids[]", required = true) String[] ids){
|
|
|
+ public Result deleteIntellectual(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
Result res = new Result();
|
|
|
List<String> id = new ArrayList<String>();
|
|
|
- for (String s : ids){
|
|
|
+ for (String s : ids) {
|
|
|
id.add(s);
|
|
|
}
|
|
|
res.setData(orgIntellectualPropertyService.batchDeleteByPrimaryKey(id));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 上年度高新技术产品(服务)情况列表
|
|
|
+ *
|
|
|
* @param pageNo
|
|
|
* @param pageSize
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/techProductList", method = RequestMethod.GET)
|
|
|
- public Result techProductList(String pageNo, String pageSize){
|
|
|
+ public Result techProductList(String pageNo, String pageSize) {
|
|
|
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)) {
|
|
|
@@ -386,16 +395,17 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
}
|
|
|
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 (StringUtils.isBlank(orgTechProduct.getId())){
|
|
|
+ if (StringUtils.isBlank(orgTechProduct.getId())) {
|
|
|
orgTechProduct.setId(UUID.randomUUID().toString());
|
|
|
orgTechProduct.setUid(TokenManager.getUserId());
|
|
|
orgTechProduct.setDeletedSign(0);
|
|
|
@@ -406,41 +416,43 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
res.setData(orgTechProduct);
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 删除选中上年度高新技术产品(服务)情况记录
|
|
|
+ *
|
|
|
* @param ids
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/deleteTechProduct", method = RequestMethod.POST)
|
|
|
- public Result deleteTechProduct(@RequestParam(name = "ids[]", required = true) String[] ids){
|
|
|
+ public Result deleteTechProduct(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
Result res = new Result();
|
|
|
List<String> id = new ArrayList<String>();
|
|
|
- for (String s : ids){
|
|
|
+ for (String s : ids) {
|
|
|
id.add(s);
|
|
|
}
|
|
|
res.setData(orgTechProductService.batchDeleteByPrimaryKey(id));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 企业纳税申报信息入口
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/ratepay", method = RequestMethod.GET)
|
|
|
- public Result ratepay (){
|
|
|
+ public Result ratepay() {
|
|
|
Result res = new Result();
|
|
|
res.setData(orgRatepayService.selectOrgRatepayByUid(TokenManager.getUserId()));
|
|
|
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());
|
|
|
orgRatepay.setUid(TokenManager.getUserId());
|
|
|
orgRatepayService.insert(orgRatepay);
|
|
|
@@ -449,27 +461,29 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 财务报表信息入口
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/finance", method = RequestMethod.GET)
|
|
|
- public Result finance(){
|
|
|
+ public Result finance() {
|
|
|
Result res = new Result();
|
|
|
res.setData(orgFinanceService.selectOrgFinanceByUid(TokenManager.getUserId()));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 财务报表录入+修改
|
|
|
+ *
|
|
|
* @param orgFinance
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/disposeFinance", method = RequestMethod.POST)
|
|
|
- public Result disposeFinance(OrgFinance orgFinance){
|
|
|
+ public Result disposeFinance(OrgFinance orgFinance) {
|
|
|
Result res = new Result();
|
|
|
- if (null == orgFinance.getId()){
|
|
|
+ if (null == orgFinance.getId()) {
|
|
|
orgFinance.setId(UUID.randomUUID().toString());
|
|
|
orgFinance.setUid(TokenManager.getUserId());
|
|
|
orgFinanceService.insert(orgFinance);
|
|
|
@@ -478,16 +492,13 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- //判断用户是否通过认证
|
|
|
- private Result checkCertify(Result res){
|
|
|
- if (5 != organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId()).getAuditStatus()){
|
|
|
+
|
|
|
+ // 判断用户是否通过认证
|
|
|
+ private Result checkCertify(Result res) {
|
|
|
+ if (5 != organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId()).getAuditStatus()) {
|
|
|
res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
|
|
|
- }
|
|
|
+ }
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
}
|