|
|
@@ -99,7 +99,7 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@Resource
|
|
|
private OrgTechCenterDetailService orgTechCenterDetailService;
|
|
|
@Resource
|
|
|
- private OrgCognizanceService orgCognizanceService;
|
|
|
+ private OrgCognizanceService orgCognizanceService;
|
|
|
@Resource
|
|
|
private OrgAnnualReportService orgAnnualReportService;
|
|
|
@Resource
|
|
|
@@ -507,7 +507,7 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
public Result disposeRatepay(OrgRatepay orgRatepay) {
|
|
|
Result res = new Result();
|
|
|
if (null == orgRatepay.getId()) {
|
|
|
- if (null == orgRatepayService.selectRatepayByUidAndYear(TokenManager.getUserId(), orgRatepay.getYear())){
|
|
|
+ if (null == orgRatepayService.selectRatepayByUidAndYear(TokenManager.getUserId(), orgRatepay.getYear())) {
|
|
|
orgRatepay.setId(UUID.randomUUID().toString());
|
|
|
orgRatepay.setUid(TokenManager.getUserId());
|
|
|
orgRatepay.setDeletedSign(0);
|
|
|
@@ -572,7 +572,7 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
public Result disposeFinance(OrgFinance orgFinance) {
|
|
|
Result res = new Result();
|
|
|
if (null == orgFinance.getId()) {
|
|
|
- if (null == orgFinanceService.selectFinanceByUidAndYear(TokenManager.getUserId(), orgFinance.getYear())){
|
|
|
+ if (null == orgFinanceService.selectFinanceByUidAndYear(TokenManager.getUserId(), orgFinance.getYear())) {
|
|
|
orgFinance.setId(UUID.randomUUID().toString());
|
|
|
orgFinance.setUid(TokenManager.getUserId());
|
|
|
orgFinance.setDeletedSign(0);
|
|
|
@@ -632,7 +632,6 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
res.setData(handleFile(res, "/cognizance/", true, req, sign, uid));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
* 科技成果转化情况列表入口
|
|
|
@@ -820,9 +819,10 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 技术中心明细新增+修改(管理+用户)
|
|
|
+ *
|
|
|
* @param orgTechCenterDetail
|
|
|
* @param projectTimeFormattedDate
|
|
|
* @param termTimeFormattedDate
|
|
|
@@ -833,13 +833,13 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
public Result disposeCenterDetail(OrgTechCenterDetail orgTechCenterDetail, String projectTimeFormattedDate,
|
|
|
String termTimeFormattedDate) throws ParseException {
|
|
|
Result res = new Result();
|
|
|
- if (!StringUtils.isBlank(projectTimeFormattedDate)){
|
|
|
+ if (!StringUtils.isBlank(projectTimeFormattedDate)) {
|
|
|
orgTechCenterDetail.setProjectTime(DateUtils.parseDate(projectTimeFormattedDate, "yyyy-MM-dd"));
|
|
|
}
|
|
|
- if (!StringUtils.isBlank(termTimeFormattedDate)){
|
|
|
+ if (!StringUtils.isBlank(termTimeFormattedDate)) {
|
|
|
orgTechCenterDetail.setTermTime(DateUtils.parseDate(termTimeFormattedDate, "yyyy-MM-dd"));
|
|
|
}
|
|
|
- if (null == orgTechCenterDetail.getId()){
|
|
|
+ if (null == orgTechCenterDetail.getId()) {
|
|
|
orgTechCenterDetail.setId(UUID.randomUUID().toString());
|
|
|
orgTechCenterDetail.setDeletedSign(0);
|
|
|
orgTechCenterDetailService.inset(orgTechCenterDetail);
|
|
|
@@ -848,9 +848,10 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 删除技术中心明细
|
|
|
+ *
|
|
|
* @param ids
|
|
|
* @return
|
|
|
*/
|
|
|
@@ -864,32 +865,33 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
res.setData(orgTechCenterDetailService.batchDeleteByPrimaryKey(id));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 获取公司联系人
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/getContacts", method = RequestMethod.GET)
|
|
|
- public Result getContacts(){
|
|
|
+ public Result getContacts() {
|
|
|
Result res = new Result();
|
|
|
OrganizationIdentity i = organizationIdentityService.selectOrgIdentityByUserId(TokenManager.getUserId());
|
|
|
Map<String, String> map = new LinkedHashMap<String, String>();
|
|
|
- if (!StringUtils.isBlank(i.getFirstContacts()) && !StringUtils.isBlank(i.getFirstMobile())){
|
|
|
+ if (!StringUtils.isBlank(i.getFirstContacts()) && !StringUtils.isBlank(i.getFirstMobile())) {
|
|
|
map.put(i.getFirstContacts(), i.getFirstMobile());
|
|
|
}
|
|
|
-
|
|
|
- if (!StringUtils.isBlank(i.getSecondContacts()) && !StringUtils.isBlank(i.getSecondMobile())){
|
|
|
+
|
|
|
+ if (!StringUtils.isBlank(i.getSecondContacts()) && !StringUtils.isBlank(i.getSecondMobile())) {
|
|
|
map.put(i.getSecondContacts(), i.getSecondMobile());
|
|
|
}
|
|
|
-
|
|
|
- if (!StringUtils.isBlank(i.getThirdContacts()) && !StringUtils.isBlank(i.getThirdMobile())){
|
|
|
+
|
|
|
+ if (!StringUtils.isBlank(i.getThirdContacts()) && !StringUtils.isBlank(i.getThirdMobile())) {
|
|
|
map.put(i.getThirdContacts(), i.getThirdMobile());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
res.setData(map);
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 高企认定列表入口
|
|
|
*
|
|
|
@@ -898,7 +900,7 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/listCognizance", method = RequestMethod.POST)
|
|
|
- public Result listCognizance( String locationProvince, String pageNo, String pageSize) {
|
|
|
+ public Result listCognizance(String locationProvince, String pageNo, String pageSize) {
|
|
|
Result res = new Result();
|
|
|
Integer pNo = 1;
|
|
|
Integer pSize = 10;
|
|
|
@@ -909,20 +911,26 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
pNo = Integer.parseInt(pageNo);
|
|
|
}
|
|
|
|
|
|
- res.setData(orgCognizanceService.listCognizance(TokenManager.getUserId() , locationProvince, pNo, pSize));
|
|
|
+ res.setData(orgCognizanceService.listCognizance(TokenManager.getUserId(), locationProvince, pNo, pSize));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 申请高企认定
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/applyCognizance", method = RequestMethod.POST)
|
|
|
- public Result applyCognizance(String contacts, String comment, Integer year, Integer state){
|
|
|
+ public Result applyCognizance(String contacts, String comment, Integer year, Integer state) {
|
|
|
Result res = new Result();
|
|
|
- if (null == year){
|
|
|
+ if (null == year) {
|
|
|
res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "申请认定年份不能为空!"));
|
|
|
}
|
|
|
+
|
|
|
+ if (null != orgCognizanceService.selectCognizanceByUidAndYear(year, TokenManager.getUserId())){
|
|
|
+ res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度高企认定已申请!"));
|
|
|
+ }
|
|
|
+
|
|
|
OrgCognizance c = new OrgCognizance();
|
|
|
c.setId(UUID.randomUUID().toString());
|
|
|
c.setUid(TokenManager.getUserId());
|
|
|
@@ -931,7 +939,7 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
c.setDeletedSign(0);
|
|
|
c.setYear(year);
|
|
|
orgCognizanceService.insert(c);
|
|
|
-
|
|
|
+
|
|
|
OrgCognizanceLog log = new OrgCognizanceLog();
|
|
|
log.setId(UUID.randomUUID().toString());
|
|
|
log.setCid(c.getId());
|
|
|
@@ -944,7 +952,7 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
orgCognizanceLogService.insert(log);
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 高企认定详情入口
|
|
|
*
|
|
|
@@ -960,11 +968,36 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 高企认定流转状态
|
|
|
+ *
|
|
|
+ * @param cid
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/cognizanceLog", method = RequestMethod.POST)
|
|
|
+ public Result cognizanceLog(String cid) {
|
|
|
+ Result res = new Result();
|
|
|
+ List<OrgCognizanceLog> list = orgCognizanceLogService.selectOrgCognizanceLogByCid(cid);
|
|
|
+ res.setData(list);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存高企认定详情
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/disposeCognizanceDetail", method = RequestMethod.POST)
|
|
|
+ public Result disposeCognizanceDetail(OrgCognizance cog){
|
|
|
+ Result res = new Result();
|
|
|
+ orgCognizanceService.updateByPrimaryKeySelective(cog);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 年报列表
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/annualReport", method = RequestMethod.POST)
|
|
|
- public Result annualReport(Integer year, Integer state, String pageSize, String pageNo ){
|
|
|
+ public Result annualReport(Integer year, Integer state, String pageSize, String pageNo) {
|
|
|
Result res = new Result();
|
|
|
res = checkCertify(res);
|
|
|
if (res.getError().isEmpty()) {
|
|
|
@@ -980,36 +1013,37 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 企业年报详情
|
|
|
+ *
|
|
|
* @param uid
|
|
|
* @param year
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/annualReportDetail", method = RequestMethod.POST)
|
|
|
- public Result annualReportDetail(Integer year){
|
|
|
+ public Result annualReportDetail(Integer year) {
|
|
|
Result res = new Result();
|
|
|
- if (null == year){
|
|
|
+ if (null == year) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "当前年份年报数据异常!"));
|
|
|
return res;
|
|
|
}
|
|
|
res.setData(handleAnnualReport(TokenManager.getUserId(), year));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
* 高企年报新增+修改
|
|
|
+ *
|
|
|
* @param orgAnnualReport
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/disposeAnnualReport", method = RequestMethod.POST)
|
|
|
- public Result disposeAnnualReport(OrgAnnualReport orgAnnualReport){
|
|
|
+ public Result disposeAnnualReport(OrgAnnualReport orgAnnualReport) {
|
|
|
Result res = new Result();
|
|
|
- if (null == orgAnnualReport.getId()){
|
|
|
- if (null != orgAnnualReportService.selectAnnualReportByYearAndUid(orgAnnualReport.getYear(), TokenManager.getUserId())){
|
|
|
+ if (null == orgAnnualReport.getId()) {
|
|
|
+ if (null != orgAnnualReportService.selectAnnualReportByYearAndUid(orgAnnualReport.getYear(),
|
|
|
+ TokenManager.getUserId())) {
|
|
|
res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年企业年报已录入!"));
|
|
|
return res;
|
|
|
} else {
|
|
|
@@ -1029,14 +1063,15 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 删除企业年报记录
|
|
|
+ *
|
|
|
* @param ids
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/deleteAnnualReport", method = RequestMethod.POST)
|
|
|
- public Result deleteAnnualReport(@RequestParam(name = "ids[]", required = true) String[] ids){
|
|
|
+ public Result deleteAnnualReport(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
Result res = new Result();
|
|
|
List<String> id = new ArrayList<String>();
|
|
|
for (String s : ids) {
|
|
|
@@ -1045,14 +1080,12 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
res.setData(orgAnnualReportService.batchDeleteByPrimaryKey(id));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
@RequestMapping(value = "/download", method = RequestMethod.POST)
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
private AnnualReportBo handleAnnualReport(String uid, Integer year) {
|
|
|
AnnualReportBo report = new AnnualReportBo();
|
|
|
-
|
|
|
+
|
|
|
AnnualReportPropertyRightBo p = orgAnnualReportService.selectAnnualReportPropertyRightBoByYearAndUid(year, uid);
|
|
|
report.setInventionPatent(null == p.getInventionPatent() ? 0 : p.getInventionPatent());
|
|
|
report.setDefensePatent(null == p.getDefensePatent() ? 0 : p.getDefensePatent());
|
|
|
@@ -1064,10 +1097,10 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
report.setCircuitDesign(null == p.getCircuitDesign() ? 0 : p.getCircuitDesign());
|
|
|
report.setExteriorPatent(null == p.getExteriorPatent() ? 0 : p.getExteriorPatent());
|
|
|
report.setSoftwareWorks(null == p.getSoftwareWorks() ? 0 : p.getSoftwareWorks());
|
|
|
-
|
|
|
+
|
|
|
BigDecimal t = orgAnnualReportService.selectAnnualReportTerritoryByYearAndUid(year, uid);
|
|
|
report.setTerritory(null == t ? new BigDecimal(0) : t);
|
|
|
-
|
|
|
+
|
|
|
AnnualReportMainBo m = orgAnnualReportService.selectAnnualReportMainBoByYearAndUid(year, uid);
|
|
|
report.setUid(m.getUid());
|
|
|
report.setUnitName(m.getUnitName());
|
|
|
@@ -1076,7 +1109,7 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
report.setLocationCity(m.getLocationCity());
|
|
|
report.setLocationArea(m.getLocationArea());
|
|
|
report.setListed(m.getListed().toString());
|
|
|
- if (null != m.getListedDate()){
|
|
|
+ if (null != m.getListedDate()) {
|
|
|
report.setListedDate(DateFormatUtils.format(m.getListedDate(), "yyyy-MM-dd"));
|
|
|
}
|
|
|
report.setListedType(m.getListedType().toString());
|
|
|
@@ -1089,24 +1122,24 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
report.setGrossProfit(null == m.getGrossProfit() ? new BigDecimal(0) : m.getGrossProfit());
|
|
|
report.setNetAsset(null == m.getNetAsset() ? new BigDecimal(0) : m.getNetAsset());
|
|
|
report.setCertificateNumber(m.getCertificateNumber());
|
|
|
- if (null != m.getIssuingDate()){
|
|
|
+ if (null != m.getIssuingDate()) {
|
|
|
report.setIssuingDate(DateFormatUtils.format(m.getIssuingDate(), "yyyy-MM-dd"));
|
|
|
}
|
|
|
report.setContacts(m.getContacts());
|
|
|
report.setResearchCost(null == m.getResearchCost() ? new BigDecimal(0) : m.getResearchCost());
|
|
|
report.setTotalRevenue(null == m.getTotalRevenue() ? new BigDecimal(0) : m.getTotalRevenue());
|
|
|
report.setLastYearRevenue(null == m.getLastYearRevenue() ? new BigDecimal(0) : m.getLastYearRevenue());
|
|
|
-
|
|
|
+
|
|
|
return report;
|
|
|
}
|
|
|
-
|
|
|
|
|
|
private String handleFile(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign,
|
|
|
String uid) {
|
|
|
List<MultipartFile> files = getFiles(req);
|
|
|
MultipartFile mf = files.get(0);
|
|
|
-
|
|
|
- String fileName = FileUtils.mosaicFileName(mf, isPrivate, sign, path, StringUtils.isBlank(uid) ? TokenManager.getUserId() : uid);
|
|
|
+
|
|
|
+ String fileName = FileUtils.mosaicFileName(mf, isPrivate, sign, path,
|
|
|
+ StringUtils.isBlank(uid) ? TokenManager.getUserId() : uid);
|
|
|
if (!files.isEmpty()) {
|
|
|
try {
|
|
|
mf.transferTo(toPrivateFile(fileName));
|
|
|
@@ -1130,7 +1163,7 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private CognizanceDetailBo handleCognizanceDetail(String uid, String cid, Integer year) {
|
|
|
CognizanceDetailBo cog = new CognizanceDetailBo();
|
|
|
|
|
|
@@ -1148,7 +1181,8 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
null == orgInfo.getBasicResearchCost() ? new BigDecimal(0) : orgInfo.getBasicResearchCost());
|
|
|
cog.setAccident(null == orgInfo.getAccient() ? 0 : orgInfo.getAccient());
|
|
|
|
|
|
- CognizanceResearchCostBo researchCost = orgCognizanceService.selectCognizanceResearchCostBoByUidAndYear(year, uid);
|
|
|
+ CognizanceResearchCostBo researchCost = orgCognizanceService.selectCognizanceResearchCostBoByUidAndYear(year,
|
|
|
+ uid);
|
|
|
cog.setResearchCost(
|
|
|
null == researchCost.getResearchCost() ? new BigDecimal(0) : researchCost.getResearchCost());
|
|
|
cog.setTerritory(null == researchCost.getTerritory() ? new BigDecimal(0) : researchCost.getTerritory());
|
|
|
@@ -1170,12 +1204,12 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
cog.setFirmTotal(null == catagory.getFirmTotal() ? 0 : catagory.getFirmTotal());
|
|
|
cog.setTechTotal(null == catagory.getTechTotal() ? 0 : catagory.getTechTotal());
|
|
|
cog.setTotalRevenue(null == catagory.getTotalRevenue() ? new BigDecimal(0) : catagory.getTotalRevenue());
|
|
|
- BigDecimal revenue = orgCognizanceService.selectLastYearRevenueByUidAndYear(year, uid);
|
|
|
- if (null != revenue){
|
|
|
- cog.setLastYearRevenue(revenue);
|
|
|
- } else {
|
|
|
- cog.setLastYearRevenue(new BigDecimal(0));
|
|
|
- }
|
|
|
+ BigDecimal revenue = orgCognizanceService.selectLastYearRevenueByUidAndYear(year, uid);
|
|
|
+ if (null != revenue) {
|
|
|
+ cog.setLastYearRevenue(revenue);
|
|
|
+ } else {
|
|
|
+ cog.setLastYearRevenue(new BigDecimal(0));
|
|
|
+ }
|
|
|
return cog;
|
|
|
}
|
|
|
|