| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877 |
- package com.goafanti.admin.controller;
- import java.text.ParseException;
- import java.util.Calendar;
- import java.util.LinkedHashMap;
- import java.util.List;
- import java.util.Map;
- import java.util.UUID;
- import javax.annotation.Resource;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- 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.OrgCognizance;
- import com.goafanti.common.model.OrgCognizanceLog;
- import com.goafanti.common.model.OrgFinance;
- import com.goafanti.common.model.OrgHonorDatum;
- import com.goafanti.common.model.OrgHumanResource;
- import com.goafanti.common.model.OrgIntellectualProperty;
- import com.goafanti.common.model.OrgRatepay;
- import com.goafanti.common.model.OrgStandard;
- import com.goafanti.common.model.OrgTechAchievement;
- import com.goafanti.common.model.OrgTechCenter;
- import com.goafanti.common.model.OrgTechProduct;
- import com.goafanti.common.model.OrganizationIdentity;
- import com.goafanti.common.model.UserIdentity;
- 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.OrgCognizanceLogService;
- import com.goafanti.techservice.cognizance.service.OrgCognizanceService;
- 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;
- import com.goafanti.techservice.cognizance.service.OrgTechAchievementService;
- import com.goafanti.techservice.cognizance.service.OrgTechCenterService;
- import com.goafanti.techservice.cognizance.service.OrgTechProductService;
- import com.goafanti.user.bo.OrgListBo;
- import com.goafanti.user.bo.UserListBo;
- import com.goafanti.user.service.OrgHumanResourceService;
- import com.goafanti.user.service.OrganizationIdentityService;
- import com.goafanti.user.service.UserIdentityService;
- import com.goafanti.user.service.UserService;
- @Controller
- @RequestMapping(value = "/api/admin")
- public class AdminApiController extends BaseApiController {
- @Resource
- private UserService userService;
- @Resource
- private UserIdentityService userIdentityService;
- @Resource
- private OrganizationIdentityService organizationIdentityService;
- @Resource
- private OrgHumanResourceService orgHumanResourceService;
- @Resource
- private OrgStandardService orgStandardService;
- @Resource
- private OrgIntellectualPropertyService orgIntellectualPropertyService;
- @Resource
- private OrgTechProductService orgTechProductService;
- @Resource
- private OrgRatepayService orgRatepayService;
- @Resource
- private OrgFinanceService orgFinanceService;
- @Resource
- private OrgActivityService orgActivityService;
- @Resource
- private OrgActivityCostService orgActivityCostService;
- @Resource
- private OrgTechAchievementService orgTechAchievementService;
- @Resource
- private OrgHonorDatumService orgHonorDatumService;
- @Resource
- private OrgTechCenterService orgTechCenterService;
- @Resource
- private OrgCognizanceService orgCognizanceService;
- @Resource
- private OrgCognizanceLogService orgCognizanceLogService;
- /**
- * 个人用户列表
- *
- * @param mobile
- * @param email
- * @param createTime
- * @param number
- * @param auditStatus
- * @param pageNo
- * @param pageSize
- * @return
- * @throws ParseException
- */
- @RequestMapping(value = "/userList", method = RequestMethod.POST)
- public Result userList(String mobile, String email,
- @RequestParam(name = "createTime[]", required = false) String[] createTime, Integer number,
- String aftUsername, Integer auditStatus, String pageNo, String pageSize) throws ParseException {
- Result res = new Result();
- Integer pNo = 1;
- Integer pSize = 10;
- if (StringUtils.isNumeric(pageSize)) {
- pSize = Integer.parseInt(pageSize);
- }
- if (StringUtils.isNumeric(pageNo)) {
- pNo = Integer.parseInt(pageNo);
- }
- res.setData(getUserList(mobile, email, createTime, number, aftUsername, auditStatus, pNo, pSize));
- return res;
- }
- /**
- * 个人用户信息明细
- *
- * @param uid
- * @return
- */
- @RequestMapping(value = "/userDetail", method = RequestMethod.POST)
- public Result userDetail(String uid) {
- Result res = new Result();
- res.setData(userIdentityService.selectUserIdentityByUserId(uid));
- return res;
- }
- /**
- * 修改个人用户信息
- *
- * @return
- */
- @RequestMapping(value = "updateUserDetail", method = RequestMethod.POST)
- public Result updateUserDetail(UserIdentity userIdentity) {
- Result res = new Result();
- res.setData(userIdentityService.updateByPrimaryKeySelective(userIdentity));
- return res;
- }
- /**
- * 团体用户列表
- *
- * @param mobile
- * @param email
- * @param createTime
- * @param number
- * @param auditStatus
- * @param pageNo
- * @param pageSize
- * @return
- * @throws ParseException
- */
- @RequestMapping(value = "/orgList", method = RequestMethod.POST)
- public Result orgList(String mobile, String email,
- @RequestParam(name = "createTime[]", required = false) String[] createTime, Integer number,
- String aftUsername, Integer auditStatus, String pageNo, String pageSize) throws ParseException {
- Result res = new Result();
- Integer pNo = 1;
- Integer pSize = 10;
- if (StringUtils.isNumeric(pageSize)) {
- pSize = Integer.parseInt(pageSize);
- }
- if (StringUtils.isNumeric(pageNo)) {
- pNo = Integer.parseInt(pageNo);
- }
- res.setData(getOrgList(mobile, email, createTime, number, aftUsername, auditStatus, pNo, pSize));
- return res;
- }
- /**
- * 团体用户明细
- *
- * @param uid
- * @return
- */
- @RequestMapping(value = "/orgDetail", method = RequestMethod.POST)
- public Result orgDetail(String uid) {
- Result res = new Result();
- res.setData(organizationIdentityService.selectOrgIdentityByUserId(uid));
- return res;
- }
- /**
- * 修改团体用户信息
- *
- * @param orgIdentity
- * @return
- */
- @RequestMapping(value = "/updateOrgDetail", method = RequestMethod.POST)
- public Result updateOrgDetail(OrganizationIdentity orgIdentity) {
- Result res = new Result();
- res.setData(organizationIdentityService.updateByPrimaryKeySelective(orgIdentity));
- return res;
- }
- /**
- * 团体用户人力资源情况入口
- *
- * @param uid
- * 用户ID
- * @return
- */
- @RequestMapping(value = "/orgHumanResource", method = RequestMethod.POST)
- public Result orgHumanResource(Integer year, String pageNo, String pageSize, String uid) {
- Result res = new Result();
- res = checkCertify(res,uid);
- 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(orgHumanResourceService.listOrgHumanResource(year, pNo, pSize, uid));
- }
- return res;
- }
- /**
- * 修改团体用户人力资源情况
- *
- * @param orgHumanResource
- * @return
- */
- @RequestMapping(value = "/updateOrgHumanResource", method = RequestMethod.POST)
- public Result updateOrgHumanResource(OrgHumanResource orgHumanResource) {
- Result res = new Result();
- if (null == orgHumanResource.getId()) {
- orgHumanResource.setId(UUID.randomUUID().toString());
- orgHumanResourceService.insert(orgHumanResource);
- } else {
- orgHumanResourceService.updateByPrimaryKeySelective(orgHumanResource);
- }
- return res;
- }
- /**
- * 企业参与国家标准或行业标准制定情况明细入口
- *
- * @param uid
- * 用户id
- * @return
- */
- @RequestMapping(value = "/standard", method = RequestMethod.POST)
- public Result standard(String uid, String standardName, String standardNumber, Integer standardLevel,
- Integer participateWay, String pageNo, String pageSize) {
- Result res = new Result();
- res = checkCertify(res, uid);
- 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(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) {
- Result res = new Result();
- if (StringUtils.isBlank(orgStandard.getId())) {
- orgStandard.setId(UUID.randomUUID().toString());
- orgStandard.setDeletedSign(0);
- Calendar now = Calendar.getInstance();
- now.set(Calendar.MILLISECOND, 0);
- orgStandard.setCreateTime(now.getTime());
- orgStandardService.insert(orgStandard);
- } else {
- orgStandardService.updateByPrimaryKeySelective(orgStandard);
- }
- res.setData(orgStandard);
- return res;
- }
- /**
- * 管理端录入+修改知识产权信息
- *
- * @return
- * @throws ParseException
- */
- @RequestMapping(value = "/intellectual", method = RequestMethod.POST)
- public Result intellectual(OrgIntellectualProperty orgIntellectualProperty, String authorizationDateFormattedDate,
- String uid) throws ParseException {
- Result res = new Result();
- if (!StringUtils.isBlank(authorizationDateFormattedDate)) {
- orgIntellectualProperty
- .setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
- }
- if (null == orgIntellectualProperty.getId()) {
- orgIntellectualProperty.setId(UUID.randomUUID().toString());
- orgIntellectualProperty.setUid(uid);
- orgIntellectualProperty.setEvaluationCategory(
- (orgIntellectualProperty.getCatagory() >= 2 && orgIntellectualProperty.getCatagory() <= 4) ? 1 : 0);
- orgIntellectualProperty.setDeletedSign(0);
- res.setData(orgIntellectualPropertyService.insert(orgIntellectualProperty));
- } else {
- orgIntellectualProperty.setEvaluationCategory(orgIntellectualProperty.getCatagory() <= 2 ? 1 : 0);
- res.setData(orgIntellectualPropertyService.updateByPrimaryKeySelective(orgIntellectualProperty));
- }
- return res;
- }
- /**
- * 知识产权列表
- *
- * @param pageNo
- * @param pageSize
- * @return
- */
- @RequestMapping(value = "/intellectualList", method = RequestMethod.POST)
- public Result intellectualList(String pageNo, String pageSize, String uid) {
- Result res = new Result();
- res = checkCertify(res, uid);
- 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(orgIntellectualPropertyService.listIntellectual(pNo, pSize, uid));
- }
- return res;
- }
- /**
- * 上年度高新技术产品(服务)情况列表
- *
- * @param pageNo
- * @param pageSize
- * @return
- */
- @RequestMapping(value = "/techProductList", method = RequestMethod.POST)
- public Result techProductList(String pageNo, String pageSize, String uid) {
- Result res = new Result();
- res = checkCertify(res,uid);
- 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(orgTechProductService.listTechProduct(pNo, pSize, uid));
- }
- return res;
- }
- /**
- * 企业研究开发活动情况表入口
- *
- * @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,uid);
- 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);
- 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());
- 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,uid);
- 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
- * @throws ParseException
- */
- @RequestMapping(value = "/activityCost", method = RequestMethod.POST)
- public Result activityCost(OrgActivityCost orgActivityCost, String signDateFormattedDate) throws ParseException {
- Result res = new Result();
- if (StringUtils.isBlank(signDateFormattedDate)) {
- orgActivityCost.setSignDate(DateUtils.parseDate(signDateFormattedDate, "yyyy-MM-dd"));
- }
- 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) {
- Result res = new Result();
- if (null == orgTechProduct.getId()) {
- orgTechProduct.setId(UUID.randomUUID().toString());
- orgTechProduct.setDeletedSign(0);
- orgTechProductService.insert(orgTechProduct);
- } else {
- orgTechProductService.updateByPrimaryKeySelective(orgTechProduct);
- }
- res.setData(orgTechProduct);
- return res;
- }
- /**
- * 企业纳税申报信息入口
- *
- * @return
- */
- @RequestMapping(value = "/ratepay", method = RequestMethod.POST)
- public Result ratepay(Integer year, String pageNo, String pageSize, String uid) {
- Result res = new Result();
- res = checkCertify(res,uid);
- 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(orgRatepayService.listOrgRatepay(year, pNo, pSize, uid));
- }
- return res;
- }
- /**
- * 企业纳税申报信息录入+修改
- */
- @RequestMapping(value = "/disposeRatepay", method = RequestMethod.POST)
- public Result disposeRatepay(OrgRatepay orgRatepay) {
- Result res = new Result();
- if (null == orgRatepay.getId()) {
- orgRatepay.setId(UUID.randomUUID().toString());
- orgRatepay.setDeletedSign(0);
- orgRatepayService.insert(orgRatepay);
- } else {
- orgRatepayService.updateByPrimaryKeySelective(orgRatepay);
- }
- return res;
- }
- /**
- * 财务报表信息入口
- *
- * @return
- */
- @RequestMapping(value = "/finance", method = RequestMethod.POST)
- public Result finance(Integer year, String pageNo, String pageSize, String uid) {
- Result res = new Result();
- res = checkCertify(res,uid);
- 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(orgFinanceService.listFinance(year, pNo, pSize, uid));
- }
- return res;
- }
- /**
- * 财务报表录入+修改
- *
- * @param orgFinance
- * @return
- */
- @RequestMapping(value = "/disposeFinance", method = RequestMethod.POST)
- public Result disposeFinance(OrgFinance orgFinance) {
- Result res = new Result();
- if (null == orgFinance.getId()) {
- orgFinance.setId(UUID.randomUUID().toString());
- orgFinance.setDeletedSign(0);
- orgFinanceService.insert(orgFinance);
- } else {
- orgFinanceService.updateByPrimaryKeySelective(orgFinance);
- }
- return res;
- }
- /**
- * 获取当前用户已录入项目标号列表
- *
- * @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;
- }
- /**
- * 科技成果转化情况列表入口
- *
- * @param pageNo
- * @param pageSize
- * @return
- */
- @RequestMapping(value = "/achievementList", method = RequestMethod.POST)
- public Result achievementList(String pageNo, String pageSize, String uid) {
- Result res = new Result();
- res = checkCertify(res,uid);
- 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(orgTechAchievementService.listOrgTechAchievement(pNo, pSize, uid));
- }
- return res;
- }
- /**
- * 科技成果转化情况新增+修改
- *
- * @param achievement
- * @return
- * @throws ParseException
- */
- @RequestMapping(value = "/disposeAchievement", method = RequestMethod.POST)
- public Result disposeAchievement(OrgTechAchievement achievement) throws ParseException {
- Result res = new Result();
- if (null == achievement.getId()) {
- achievement.setId(UUID.randomUUID().toString());
- achievement.setDeletedSign(0);
- orgTechAchievementService.inset(achievement);
- } else {
- orgTechAchievementService.updateByPrimaryKeySelective(achievement);
- }
- return res;
- }
- /**
- * 企业荣誉及其他证明材料列表入口
- *
- * @return
- */
- @RequestMapping(value = "/honorList", method = RequestMethod.POST)
- public Result honorList(String pageNo, String pageSize, String uid) {
- Result res = new Result();
- res = checkCertify(res,uid);
- 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, uid));
- }
- return res;
- }
- /**
- * 企业荣誉及其他证明材料新增+修改
- *
- * @param achievement
- * @return
- * @throws ParseException
- */
- @RequestMapping(value = "/disposeHonor", method = RequestMethod.POST)
- public Result disposeHonor(OrgHonorDatum honor, String issuingTimeFormattedDate, String uid) 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(uid);
- honor.setDeletedSign(0);
- orgHonorDatumService.inset(honor);
- } else {
- orgHonorDatumService.updateByPrimaryKeySelective(honor);
- }
- return res;
- }
- /**
- * 技术中心入口
- *
- * @return
- */
- @RequestMapping(value = "/center", method = RequestMethod.POST)
- public Result center(String uid) {
- Result res = new Result();
- res = checkCertify(res,uid);
- if (res.getError().isEmpty()) {
- res.setData(orgTechCenterService.selectOrgTechCenterByUid(uid));
- }
- return res;
- }
- /**
- * 技术中心新增+修改
- *
- * @return
- * @throws ParseException
- */
- @RequestMapping(value = "/disposeCenter", method = RequestMethod.POST)
- public Result disposeCenter(OrgTechCenter orgTechCenter, String foundingTimeFormattedDate, String uid)
- throws ParseException {
- Result res = new Result();
- if (!StringUtils.isBlank(foundingTimeFormattedDate)) {
- orgTechCenter.setFoundingTime(DateUtils.parseDate(foundingTimeFormattedDate, "yyyy-MM-dd"));
- }
- if (null == orgTechCenter.getId()) {
- orgTechCenter.setId(UUID.randomUUID().toString());
- orgTechCenter.setUid(uid);
- orgTechCenter.setDeletedSign(0);
- orgTechCenterService.insert(orgTechCenter);
- } else {
- orgTechCenterService.updateByPrimaryKeySelective(orgTechCenter);
- }
- return res;
- }
- /**
- * 获取公司联系人
- *
- * @return
- */
- @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);
- return res;
- }
- /**
- * 申请高企认定
- *
- * @return
- */
- @RequestMapping(value = "/applyCognizance", method = RequestMethod.POST)
- public Result applyCognizance(String contacts, String comment, String consultant, String uid) {
- Result res = new Result();
- OrgCognizance c = new OrgCognizance();
- c.setId(UUID.randomUUID().toString());
- c.setUid(uid);
- c.setContacts(contacts);
- c.setComment(comment);
- c.setConsultant(consultant);
- c.setYear(Calendar.getInstance().get(Calendar.YEAR));
- c.setDeletedSign(0);
- orgCognizanceService.insert(c);
- return res;
- }
- /**
- * 高企认定列表入口
- *
- * @param locationProvince
- * @param unitName
- * @return
- */
- @RequestMapping(value = "/listCognizance", method = RequestMethod.POST)
- public Result listCognizance(String locationProvince, String unitName, String pageNo, String pageSize) {
- Result res = new Result();
- Integer pNo = 1;
- Integer pSize = 10;
- if (StringUtils.isNumeric(pageSize)) {
- pSize = Integer.parseInt(pageSize);
- }
- if (StringUtils.isNumeric(pageNo)) {
- pNo = Integer.parseInt(pageNo);
- }
- res.setData(orgCognizanceService.listCognizance(locationProvince, unitName, pNo, pSize));
- return res;
- }
-
- /**
- * 高企认定流转状态
- * @param cid
- * @return
- */
- @RequestMapping(value = "/cognizanceLog", method = RequestMethod.POST)
- public Result cognizanceLog(String cid){
- Result res = new Result();
- List<OrgCognizanceLog> list = orgCognizanceLogService.selectOrgCognizanceLogByCid(cid);
- System.out.println(list.size());
- res.setData(list);
- return res;
- }
-
- /**
- * 高企认定详情入口
- * @param uid
- * @param cid
- * @return
- */
- @RequestMapping(value = "/cognizanceDetail", method = RequestMethod.POST)
- public Result cognizanceDetail(String uid, String cid){
- Result res = new Result();
- 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);
- }
- // user个人列表
- private Pagination<UserListBo> getUserList(String mobile, String email, String[] createTime, Integer number,
- String aftUsername, Integer auditStatus, Integer pNo, Integer pSize) throws ParseException {
- return (Pagination<UserListBo>) userService.listUser(mobile, email, createTime, number, aftUsername,
- auditStatus, pNo, pSize);
- }
-
- }
|