|
|
@@ -22,6 +22,7 @@ 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.OrgHonorDatum;
|
|
|
import com.goafanti.common.model.OrgIntellectualProperty;
|
|
|
import com.goafanti.common.model.OrgRatepay;
|
|
|
import com.goafanti.common.model.OrgStandard;
|
|
|
@@ -35,6 +36,7 @@ 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.OrgHonorDatumService;
|
|
|
import com.goafanti.techservice.cognizance.service.OrgIntellectualPropertyService;
|
|
|
import com.goafanti.techservice.cognizance.service.OrgRatepayService;
|
|
|
import com.goafanti.techservice.cognizance.service.OrgStandardService;
|
|
|
@@ -65,7 +67,9 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@Resource
|
|
|
private OrgFinanceService orgFinanceService;
|
|
|
@Resource
|
|
|
- private OrgTechAchievementService orgTechAchievementService;
|
|
|
+ private OrgTechAchievementService orgTechAchievementService;
|
|
|
+ @Resource
|
|
|
+ private OrgHonorDatumService orgHonorDatumService;
|
|
|
|
|
|
/**
|
|
|
* 企业研究开发活动情况表入口
|
|
|
@@ -111,8 +115,13 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
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(startDateFormattedDate)) {
|
|
|
+ orgActivity.setStartDate(DateUtils.parseDate(startDateFormattedDate, "yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!StringUtils.isBlank(endDateFormattedDate)) {
|
|
|
+ orgActivity.setEndDate(DateUtils.parseDate(endDateFormattedDate, "yyyy-MM-dd"));
|
|
|
+ }
|
|
|
if (StringUtils.isBlank(orgActivity.getId())) {
|
|
|
orgActivity.setId(UUID.randomUUID().toString());
|
|
|
orgActivity.setUid(TokenManager.getUserId());
|
|
|
@@ -191,15 +200,13 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
* 企业年度研究开发费用结构明细表(新增+修改)
|
|
|
*
|
|
|
* @return
|
|
|
+ * @throws ParseException
|
|
|
*/
|
|
|
@RequestMapping(value = "/activityCost", method = RequestMethod.POST)
|
|
|
- public Result activityCost(OrgActivityCost orgActivityCost, String signDateFormattedDate) {
|
|
|
+ public Result activityCost(OrgActivityCost orgActivityCost, String signDateFormattedDate) throws ParseException {
|
|
|
Result res = new Result();
|
|
|
- try {
|
|
|
+ if (!StringUtils.isBlank(signDateFormattedDate)){
|
|
|
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());
|
|
|
@@ -302,37 +309,25 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
* 用户端录入+修改知识产权信息(专利+软著)
|
|
|
*
|
|
|
* @return
|
|
|
+ * @throws ParseException
|
|
|
*/
|
|
|
@RequestMapping(value = "/intellectual", method = RequestMethod.POST)
|
|
|
- public Result intellectual(OrgIntellectualProperty orgIntellectualProperty, String authorizationDateFormattedDate) {
|
|
|
+ public Result intellectual(OrgIntellectualProperty orgIntellectualProperty, String authorizationDateFormattedDate) throws ParseException {
|
|
|
Result res = new Result();
|
|
|
- if (null == authorizationDateFormattedDate) {
|
|
|
- res.getError().add(buildError(ErrorConstants.DATA_EMPTY_ERROR, "授权日期不能为空"));
|
|
|
+ if (!StringUtils.isBlank(authorizationDateFormattedDate)) {
|
|
|
+ orgIntellectualProperty
|
|
|
+ .setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
|
|
|
}
|
|
|
if (null == orgIntellectualProperty.getId()) {
|
|
|
- try {
|
|
|
orgIntellectualProperty.setId(UUID.randomUUID().toString());
|
|
|
orgIntellectualProperty.setUid(TokenManager.getUserId());
|
|
|
orgIntellectualProperty.setEvaluationCategory(
|
|
|
(orgIntellectualProperty.getCatagory() >= 2 && orgIntellectualProperty.getCatagory() <= 4) ? 1
|
|
|
: 0);
|
|
|
- orgIntellectualProperty
|
|
|
- .setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
|
|
|
orgIntellectualProperty.setDeletedSign(0);
|
|
|
- } catch (ParseException e) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "日期格式不正确"));
|
|
|
- return res;
|
|
|
- }
|
|
|
res.setData(orgIntellectualPropertyService.insert(orgIntellectualProperty));
|
|
|
} else {
|
|
|
orgIntellectualProperty.setEvaluationCategory(orgIntellectualProperty.getCatagory() <= 2 ? 1 : 0);
|
|
|
- try {
|
|
|
- orgIntellectualProperty
|
|
|
- .setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
|
|
|
- } catch (ParseException e) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "日期格式不正确"));
|
|
|
- return res;
|
|
|
- }
|
|
|
res.setData(orgIntellectualPropertyService.updateByPrimaryKeySelective(orgIntellectualProperty));
|
|
|
}
|
|
|
return res;
|
|
|
@@ -419,6 +414,10 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
orgTechProduct.setId(UUID.randomUUID().toString());
|
|
|
orgTechProduct.setUid(TokenManager.getUserId());
|
|
|
orgTechProduct.setDeletedSign(0);
|
|
|
+ Calendar now = Calendar.getInstance();
|
|
|
+ now.set(Calendar.MILLISECOND, 0);
|
|
|
+ orgTechProduct.setCreateTime(now.getTime());
|
|
|
+ orgTechProduct.setYear(Calendar.getInstance().get(Calendar.YEAR) - 1);
|
|
|
orgTechProductService.insert(orgTechProduct);
|
|
|
} else {
|
|
|
orgTechProductService.updateByPrimaryKeySelective(orgTechProduct);
|
|
|
@@ -476,12 +475,29 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
if (null == orgRatepay.getId()) {
|
|
|
orgRatepay.setId(UUID.randomUUID().toString());
|
|
|
orgRatepay.setUid(TokenManager.getUserId());
|
|
|
+ orgRatepay.setDeletedSign(0);
|
|
|
orgRatepayService.insert(orgRatepay);
|
|
|
} else {
|
|
|
orgRatepayService.updateByPrimaryKeySelective(orgRatepay);
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 刪除企业纳税申报信息
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/deleteRatepay", method = RequestMethod.POST)
|
|
|
+ public Result deleteRatepay(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
+ Result res = new Result();
|
|
|
+ List<String> id = new ArrayList<String>();
|
|
|
+ for (String s : ids) {
|
|
|
+ id.add(s);
|
|
|
+ }
|
|
|
+ res.setData(orgRatepayService.batchDeleteByPrimaryKey(id));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 财务报表信息入口
|
|
|
@@ -518,6 +534,7 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
if (null == orgFinance.getId()) {
|
|
|
orgFinance.setId(UUID.randomUUID().toString());
|
|
|
orgFinance.setUid(TokenManager.getUserId());
|
|
|
+ orgFinance.setDeletedSign(0);
|
|
|
orgFinanceService.insert(orgFinance);
|
|
|
} else {
|
|
|
orgFinanceService.updateByPrimaryKeySelective(orgFinance);
|
|
|
@@ -526,20 +543,39 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 删除财务报表
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/deleteFinance", method = RequestMethod.POST)
|
|
|
+ public Result deleteFinance(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
+ Result res = new Result();
|
|
|
+ List<String> id = new ArrayList<String>();
|
|
|
+ for (String s : ids) {
|
|
|
+ id.add(s);
|
|
|
+ }
|
|
|
+ res.setData(orgFinanceService.batchDeleteByPrimaryKey(id));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 获取当前用户已录入项目标号列表
|
|
|
+ *
|
|
|
* @param uid
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/activityNumber", method = RequestMethod.GET)
|
|
|
- public Result listActivityNumber(){
|
|
|
+ public Result listActivityNumber() {
|
|
|
Result res = new Result();
|
|
|
- List<ActivityNumberBo> activityNumberBo = orgActivityService.selectOrgActivityNumberBoByUid(TokenManager.getUserId());
|
|
|
+ List<ActivityNumberBo> activityNumberBo = orgActivityService
|
|
|
+ .selectOrgActivityNumberBoByUid(TokenManager.getUserId());
|
|
|
res.setData(activityNumberBo);
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 高企相关材料上传
|
|
|
+ *
|
|
|
* @param req
|
|
|
* @param sign
|
|
|
* @return
|
|
|
@@ -550,15 +586,16 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
res.setData(handleFile(res, "/cognizance/", true, req, sign, uid));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 科技成果转化情况列表入口
|
|
|
+ *
|
|
|
* @param pageNo
|
|
|
* @param pageSize
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/achievementList", method = RequestMethod.GET)
|
|
|
- public Result achievementList(String pageNo, String pageSize){
|
|
|
+ public Result achievementList(String pageNo, String pageSize) {
|
|
|
Result res = new Result();
|
|
|
res = checkCertify(res);
|
|
|
if (res.getError().isEmpty()) {
|
|
|
@@ -574,16 +611,21 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 科技成果转化情况新增+修改
|
|
|
+ *
|
|
|
* @param achievement
|
|
|
* @return
|
|
|
+ * @throws ParseException
|
|
|
*/
|
|
|
- @RequestMapping(value= "/disposeAchievement", method = RequestMethod.POST)
|
|
|
- public Result disposeAchievement(OrgTechAchievement achievement){
|
|
|
+ @RequestMapping(value = "/disposeAchievement", method = RequestMethod.POST)
|
|
|
+ public Result disposeAchievement(OrgTechAchievement achievement, String acquisitionTimeFormattedDate) throws ParseException {
|
|
|
Result res = new Result();
|
|
|
- if (null == achievement.getId()){
|
|
|
+ if (!StringUtils.isBlank(acquisitionTimeFormattedDate)){
|
|
|
+ achievement.setAcquisitionTime(DateUtils.parseDate(acquisitionTimeFormattedDate, "yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+ if (null == achievement.getId()) {
|
|
|
achievement.setId(UUID.randomUUID().toString());
|
|
|
achievement.setUid(TokenManager.getUserId());
|
|
|
achievement.setDeletedSign(0);
|
|
|
@@ -593,9 +635,10 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 删除科技成果转化情况
|
|
|
+ *
|
|
|
* @param ids
|
|
|
* @return
|
|
|
*/
|
|
|
@@ -609,15 +652,76 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
res.setData(orgTechAchievementService.batchDeleteByPrimaryKey(id));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- private String handleFile(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign, String uid) {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 企业荣誉及其他证明材料列表入口
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/honorList", method = RequestMethod.GET)
|
|
|
+ public Result honorList(String pageNo, String pageSize) {
|
|
|
+ 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(orgHonorDatumService.listOrgHonorDatum(pNo, pSize, TokenManager.getUserId()));
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 企业荣誉及其他证明材料新增+修改
|
|
|
+ *
|
|
|
+ * @param achievement
|
|
|
+ * @return
|
|
|
+ * @throws ParseException
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/disposeHonor", method = RequestMethod.POST)
|
|
|
+ public Result disposeHonor(OrgHonorDatum honor, String issuingTimeFormattedDate) throws ParseException {
|
|
|
+ Result res = new Result();
|
|
|
+ if (!StringUtils.isBlank(issuingTimeFormattedDate)){
|
|
|
+ honor.setIssuingTime(DateUtils.parseDate(issuingTimeFormattedDate, "yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+ if (null == honor.getId()) {
|
|
|
+ honor.setId(UUID.randomUUID().toString());
|
|
|
+ honor.setUid(TokenManager.getUserId());
|
|
|
+ honor.setDeletedSign(0);
|
|
|
+ orgHonorDatumService.inset(honor);
|
|
|
+ } else {
|
|
|
+ orgHonorDatumService.updateByPrimaryKeySelective(honor);
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除企业荣誉及其他证明材料
|
|
|
+ *
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/deleteHonor", method = RequestMethod.POST)
|
|
|
+ public Result deleteHonor(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
+ Result res = new Result();
|
|
|
+ List<String> id = new ArrayList<String>();
|
|
|
+ for (String s : ids) {
|
|
|
+ id.add(s);
|
|
|
+ }
|
|
|
+ res.setData(orgHonorDatumService.batchDeleteByPrimaryKey(id));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ private String handleFile(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign,
|
|
|
+ String uid) {
|
|
|
List<MultipartFile> files = getFiles(req);
|
|
|
String fileName = "";
|
|
|
- if (StringUtils.isBlank(uid)){
|
|
|
+ if (StringUtils.isBlank(uid)) {
|
|
|
fileName = path + TokenManager.getUserId() + "_" + sign + ".jpg";
|
|
|
} else {
|
|
|
fileName = path + uid + "_" + sign + ".jpg";
|
|
|
@@ -646,6 +750,5 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
|
|
|
}
|