|
|
@@ -1,20 +1,15 @@
|
|
|
package com.goafanti.admin.controller;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
-import java.math.BigDecimal;
|
|
|
import java.text.ParseException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Calendar;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
import java.util.UUID;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
-import org.apache.commons.lang3.time.DateFormatUtils;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
@@ -25,7 +20,6 @@ import com.goafanti.admin.service.AftFileService;
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.controller.BaseApiController;
|
|
|
-import com.goafanti.common.model.Admin;
|
|
|
import com.goafanti.common.model.AftFile;
|
|
|
import com.goafanti.common.model.OrgActivity;
|
|
|
import com.goafanti.common.model.OrgActivityCost;
|
|
|
@@ -53,13 +47,7 @@ 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.bo.AnnualReportBo;
|
|
|
-import com.goafanti.techservice.cognizance.bo.AnnualReportMainBo;
|
|
|
-import com.goafanti.techservice.cognizance.bo.AnnualReportPropertyRightBo;
|
|
|
-import com.goafanti.techservice.cognizance.bo.CognizanceCatagoryBo;
|
|
|
import com.goafanti.techservice.cognizance.bo.CognizanceDetailBo;
|
|
|
-import com.goafanti.techservice.cognizance.bo.CognizanceManageCostBo;
|
|
|
-import com.goafanti.techservice.cognizance.bo.CognizanceOrgInfoBo;
|
|
|
-import com.goafanti.techservice.cognizance.bo.CognizanceResearchCostBo;
|
|
|
import com.goafanti.techservice.cognizance.service.OrgActivityCostService;
|
|
|
import com.goafanti.techservice.cognizance.service.OrgActivityService;
|
|
|
import com.goafanti.techservice.cognizance.service.OrgAnnualReportService;
|
|
|
@@ -154,11 +142,7 @@ public class AdminApiController extends BaseApiController {
|
|
|
u.setCreateTime(now.getTime());
|
|
|
u.setPassword(passwordUtil.getEncryptPwd(u));
|
|
|
u.setLvl(0);
|
|
|
- List<Admin> admins = adminService.selectAllAdmin();
|
|
|
- if (!admins.isEmpty()) {
|
|
|
- Collections.shuffle(admins);
|
|
|
- u.setAid(admins.get(0).getId());
|
|
|
- }
|
|
|
+ u.setAid(TokenManager.getAdminId());
|
|
|
userService.insertRegister(u, "", unitName);
|
|
|
return res;
|
|
|
}
|
|
|
@@ -858,21 +842,7 @@ public class AdminApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/getContacts", method = RequestMethod.POST)
|
|
|
public Result getContacts(String uid) {
|
|
|
Result res = new Result();
|
|
|
- OrganizationIdentity i = organizationIdentityService.selectOrgIdentityByUserId(uid);
|
|
|
- Map<String, String> map = new LinkedHashMap<String, String>();
|
|
|
- if (!StringUtils.isBlank(i.getFirstContacts()) && !StringUtils.isBlank(i.getFirstMobile())) {
|
|
|
- map.put(i.getFirstContacts(), i.getFirstMobile());
|
|
|
- }
|
|
|
-
|
|
|
- if (!StringUtils.isBlank(i.getSecondContacts()) && !StringUtils.isBlank(i.getSecondMobile())) {
|
|
|
- map.put(i.getSecondContacts(), i.getSecondMobile());
|
|
|
- }
|
|
|
-
|
|
|
- if (!StringUtils.isBlank(i.getThirdContacts()) && !StringUtils.isBlank(i.getThirdMobile())) {
|
|
|
- map.put(i.getThirdContacts(), i.getThirdMobile());
|
|
|
- }
|
|
|
-
|
|
|
- res.setData(map);
|
|
|
+ res.setData(organizationIdentityService.selectContactsByUserId(uid));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -882,7 +852,7 @@ public class AdminApiController extends BaseApiController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/applyCognizance", method = RequestMethod.POST)
|
|
|
- public Result applyCognizance(String contacts, String comment, String consultant, String uid, Integer year,
|
|
|
+ public Result applyCognizance(Integer contacts, String comment, String consultant, String uid, Integer year,
|
|
|
Integer state) {
|
|
|
Result res = new Result();
|
|
|
if (null != orgCognizanceService.selectCognizanceByUidAndYear(year, uid)) {
|
|
|
@@ -1185,100 +1155,16 @@ public class AdminApiController extends BaseApiController {
|
|
|
return userService.listUser(mobile, email, createTime, number, aftUsername,
|
|
|
auditStatus, pNo, pSize);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ //高企详情
|
|
|
private CognizanceDetailBo handleCognizanceDetail(String uid, String cid, Integer year) {
|
|
|
- CognizanceDetailBo cog = new CognizanceDetailBo();
|
|
|
-
|
|
|
- CognizanceOrgInfoBo orgInfo = orgCognizanceService.selectCognizanceOrgInfoBoByUidAndCid(uid, cid);
|
|
|
- cog.setUid(null == orgInfo.getUid() ? "" : orgInfo.getUid());
|
|
|
- cog.setCid(null == orgInfo.getCid() ? "" : orgInfo.getCid());
|
|
|
- cog.setUnitName(null == orgInfo.getUnitName() ? "" : orgInfo.getUnitName());
|
|
|
- cog.setOrgCode(null == orgInfo.getOrgCode() ? "" : orgInfo.getOrgCode());
|
|
|
- cog.setPostalAddress(null == orgInfo.getPostalAddress() ? "" : orgInfo.getPostalAddress());
|
|
|
- cog.setContacts(null == orgInfo.getContacts() ? "" : orgInfo.getContacts());
|
|
|
- cog.setTechnicalField1(null == orgInfo.getTechnicalField1() ? 0 : orgInfo.getTechnicalField1());
|
|
|
- cog.setTechnicalField2(null == orgInfo.getTechnicalField2() ? 0 : orgInfo.getTechnicalField2());
|
|
|
- cog.setTechnicalField3(null == orgInfo.getTechnicalField3() ? 0 : orgInfo.getTechnicalField3());
|
|
|
- cog.setBasicResearchCost(
|
|
|
- null == orgInfo.getBasicResearchCost() ? new BigDecimal(0) : orgInfo.getBasicResearchCost());
|
|
|
- cog.setAccident(null == orgInfo.getAccient() ? 0 : orgInfo.getAccient());
|
|
|
-
|
|
|
- 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());
|
|
|
-
|
|
|
- CognizanceManageCostBo manageCost = orgCognizanceService.selectCognizanceManageCostBoByUidAndYear(year, uid);
|
|
|
- cog.setNetAsset1(null == manageCost.getNetAsset1() ? new BigDecimal(0) : manageCost.getNetAsset1());
|
|
|
- cog.setNetAsset2(null == manageCost.getNetAsset2() ? new BigDecimal(0) : manageCost.getNetAsset2());
|
|
|
- cog.setNetAsset3(null == manageCost.getNetAsset3() ? new BigDecimal(0) : manageCost.getNetAsset3());
|
|
|
- cog.setSalesRevenue1(null == manageCost.getSalesRevenue1() ? new BigDecimal(0) : manageCost.getSalesRevenue1());
|
|
|
- cog.setSalesRevenue2(null == manageCost.getSalesRevenue2() ? new BigDecimal(0) : manageCost.getSalesRevenue2());
|
|
|
- cog.setSalesRevenue3(null == manageCost.getSalesRevenue3() ? new BigDecimal(0) : manageCost.getSalesRevenue3());
|
|
|
- cog.setGrossProfit1(null == manageCost.getGrossProfit1() ? new BigDecimal(0) : manageCost.getGrossProfit1());
|
|
|
- cog.setGrossProfit2(null == manageCost.getGrossProfit2() ? new BigDecimal(0) : manageCost.getGrossProfit2());
|
|
|
- cog.setGrossProfit3(null == manageCost.getGrossProfit3() ? new BigDecimal(0) : manageCost.getGrossProfit3());
|
|
|
-
|
|
|
- CognizanceCatagoryBo catagory = orgCognizanceService.selectCognizanceCatagoryBoByUidAndYear(year, uid);
|
|
|
- cog.setFirstCatagory(null == catagory.getFirstCatagory() ? 0 : catagory.getFirstCatagory());
|
|
|
- cog.setSecondCatagory(null == catagory.getSecondCatagory() ? 0 : catagory.getSecondCatagory());
|
|
|
- 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);
|
|
|
- cog.setLastYearRevenue(null == revenue ? new BigDecimal(0) : revenue);
|
|
|
- return cog;
|
|
|
+ return orgCognizanceService.selectCognizanceDetailBo(uid, cid, year);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ //年报
|
|
|
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());
|
|
|
- report.setNationalCrop(null == p.getNationalCrop() ? 0 : p.getNationalCrop());
|
|
|
- report.setNewPlantCariety(null == p.getNewPlantCariety() ? 0 : p.getNewPlantCariety());
|
|
|
- report.setNationalDrug(null == p.getNationalDrug() ? 0 : p.getNationalDrug());
|
|
|
- report.setChineseMedicine(null == p.getChineseMedicine() ? 0 : p.getChineseMedicine());
|
|
|
- report.setUtilityPatent(null == p.getUtilityPatent() ? 0 : p.getUtilityPatent());
|
|
|
- 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());
|
|
|
- report.setOrgCode(m.getOrgCode());
|
|
|
- report.setLocationProvince(m.getLocationProvince());
|
|
|
- report.setLocationCity(m.getLocationCity());
|
|
|
- report.setLocationArea(m.getLocationArea());
|
|
|
- report.setListed(m.getListed().toString());
|
|
|
- if (null != m.getListedDate()) {
|
|
|
- report.setListedDate(DateFormatUtils.format(m.getListedDate(), "yyyy-MM-dd"));
|
|
|
- }
|
|
|
- report.setListedType(m.getListedType().toString());
|
|
|
- report.setStockCode(m.getStockCode());
|
|
|
- report.setFirmTotal(null == m.getFirmTotal() ? 0 : m.getFirmTotal());
|
|
|
- report.setTechTotal(null == m.getTechTotal() ? 0 : m.getTechTotal());
|
|
|
- report.setNewEmployment(null == m.getNewEmployment() ? 0 : m.getNewEmployment());
|
|
|
- report.setGraduateNumber(null == m.getGraduateNumber() ? 0 : m.getGraduateNumber());
|
|
|
- report.setSalesRevenue(null == m.getSalesRevenue() ? new BigDecimal(0) : m.getSalesRevenue());
|
|
|
- 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()) {
|
|
|
- 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;
|
|
|
+ return orgAnnualReportService.selectAnnualReportBo(uid, year);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private String handleFile(Result res, HttpServletRequest req, String fileName, List<MultipartFile> files,
|