|
|
@@ -13,11 +13,12 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
import com.goafanti.common.controller.BaseApiController;
|
|
|
import com.goafanti.common.model.OrgHumanResource;
|
|
|
+import com.goafanti.common.model.OrgStandard;
|
|
|
import com.goafanti.common.model.OrganizationIdentity;
|
|
|
import com.goafanti.common.model.UserIdentity;
|
|
|
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.service.OrgStandardService;
|
|
|
import com.goafanti.user.bo.OrgListBo;
|
|
|
import com.goafanti.user.bo.UserListBo;
|
|
|
import com.goafanti.user.service.OrgHumanResourceService;
|
|
|
@@ -29,17 +30,16 @@ import com.goafanti.user.service.UserService;
|
|
|
@RequestMapping(value = "/api/admin")
|
|
|
public class AdminApiController extends BaseApiController {
|
|
|
@Resource
|
|
|
- private UserService userService;
|
|
|
+ private UserService userService;
|
|
|
@Resource
|
|
|
- private UserIdentityService userIdentityService;
|
|
|
+ private UserIdentityService userIdentityService;
|
|
|
@Resource
|
|
|
- private OrganizationIdentityService organizationIdentityService;
|
|
|
+ private OrganizationIdentityService organizationIdentityService;
|
|
|
@Resource
|
|
|
- private OrgHumanResourceService orgHumanResourceService;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ private OrgHumanResourceService orgHumanResourceService;
|
|
|
+ @Resource
|
|
|
+ private OrgStandardService orgStandardService;
|
|
|
+
|
|
|
/**
|
|
|
* 个人用户列表
|
|
|
*
|
|
|
@@ -69,9 +69,10 @@ public class AdminApiController extends BaseApiController {
|
|
|
res.setData(getUserList(mobile, email, createTime, number, aftUsername, auditStatus, pNo, pSize));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 个人用户信息明细
|
|
|
+ *
|
|
|
* @param uid
|
|
|
* @return
|
|
|
*/
|
|
|
@@ -81,30 +82,32 @@ public class AdminApiController extends BaseApiController {
|
|
|
res.setData(userIdentityService.selectUserIdentityByUserId(uid));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 修改个人用户信息
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "updateUserDetail", method = RequestMethod.POST)
|
|
|
- public Result updateUserDetail(UserIdentity userIdentity){
|
|
|
+ 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
|
|
|
- */
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 团体用户列表
|
|
|
+ *
|
|
|
+ * @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,
|
|
|
@@ -121,73 +124,123 @@ public class AdminApiController extends BaseApiController {
|
|
|
res.setData(getOrgList(mobile, email, createTime, number, auditStatus, pNo, pSize));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 团体用户明细
|
|
|
+ *
|
|
|
* @param uid
|
|
|
* @return
|
|
|
*/
|
|
|
- @RequestMapping(value="/orgDetail", method = RequestMethod.POST)
|
|
|
- public Result orgDetail(String uid){
|
|
|
+ @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){
|
|
|
+ public Result updateOrgDetail(OrganizationIdentity orgIdentity) {
|
|
|
Result res = new Result();
|
|
|
res.setData(organizationIdentityService.updateByPrimaryKeySelective(orgIdentity));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 团体用户人力资源情况入口
|
|
|
- * @param uid 用户ID
|
|
|
+ *
|
|
|
+ * @param uid
|
|
|
+ * 用户ID
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/orgHumanResource", method = RequestMethod.POST)
|
|
|
- public Result orgHumanResource(String uid){
|
|
|
+ public Result orgHumanResource(String uid) {
|
|
|
Result res = new Result();
|
|
|
res.setData(orgHumanResourceService.selectOrgHumanResourceByUserId(uid));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 修改团体用户人力资源情况
|
|
|
+ *
|
|
|
* @param orgHumanResource
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/updateOrgHumanResource", method = RequestMethod.POST)
|
|
|
- public Result updateOrgHumanResource(OrgHumanResource orgHumanResource){
|
|
|
+ public Result updateOrgHumanResource(OrgHumanResource orgHumanResource) {
|
|
|
Result res = new Result();
|
|
|
OrgHumanResource org = orgHumanResourceService.selectOrgHumanResourceByUserId(orgHumanResource.getUid());
|
|
|
- if (null == org){
|
|
|
+ if (null == org) {
|
|
|
orgHumanResource.setId(UUID.randomUUID().toString());
|
|
|
orgHumanResourceService.insert(orgHumanResource);
|
|
|
} else {
|
|
|
orgHumanResourceService.updateByPrimaryKeySelective(orgHumanResource);
|
|
|
}
|
|
|
- res.setData(orgHumanResource);
|
|
|
+ res.setData(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();
|
|
|
+ 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());
|
|
|
+ orgStandardService.insert(orgStandard);
|
|
|
+ } else {
|
|
|
+ orgStandardService.updateByPrimaryKeySelective(orgStandard);
|
|
|
+ }
|
|
|
+ res.setData(orgStandard);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// org团体列表
|
|
|
- private Pagination<OrgListBo> getOrgList(String mobile, String email, String[] createTime, Integer number, Integer auditStatus,
|
|
|
- Integer pNo, Integer pSize) throws ParseException {
|
|
|
- return (Pagination<OrgListBo>) organizationIdentityService.listOrg(mobile, email, createTime, number,
|
|
|
+ private Pagination<OrgListBo> getOrgList(String mobile, String email, String[] createTime, Integer number,
|
|
|
+ Integer auditStatus, Integer pNo, Integer pSize) throws ParseException {
|
|
|
+ return (Pagination<OrgListBo>) organizationIdentityService.listOrg(mobile, email, createTime, number,
|
|
|
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);
|
|
|
+ return (Pagination<UserListBo>) userService.listUser(mobile, email, createTime, number, aftUsername,
|
|
|
+ auditStatus, pNo, pSize);
|
|
|
}
|
|
|
}
|