Commit 8f5c2103 authored by chenzhao's avatar chenzhao

修改代码

parent b3493783
...@@ -14,13 +14,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -14,13 +14,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -823,8 +817,12 @@ public class OrgUsrController extends BaseController { ...@@ -823,8 +817,12 @@ public class OrgUsrController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "查当前登录人的所属单位", notes = "查当前登录人的所属单位") @ApiOperation(httpMethod = "GET", value = "查当前登录人的所属单位", notes = "查当前登录人的所属单位")
public ResponseModel<String> getParentId() { public ResponseModel<String> getParentId() {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
OrgUsr orgUsr = orgUsrMapper.selectById(personIdentity.getCompanyId()); ResponseModel<Object> companyByUserId = this.getCompanyByUserId(Long.valueOf(reginParams.getUserModel().getUserId()));
Object result = companyByUserId.getResult();
String s = JSONObject.toJSONString(result);
OrgUsr orgUsr = JSONObject.parseObject(s, OrgUsr.class);
// String companyId = ((Map<String, Object>) result).get("sequenceNbr").toString();
String companyId = String.valueOf(orgUsr.getSequenceNbr()); String companyId = String.valueOf(orgUsr.getSequenceNbr());
//判断登陆人是否已经是顶级节点单位 //判断登陆人是否已经是顶级节点单位
if (orgUsr.getParentId() != null ) { if (orgUsr.getParentId() != null ) {
...@@ -967,4 +965,14 @@ public class OrgUsrController extends BaseController { ...@@ -967,4 +965,14 @@ public class OrgUsrController extends BaseController {
public ResponseModel<Object> getCompanyInfo(@RequestParam String companyId) throws Exception { public ResponseModel<Object> getCompanyInfo(@RequestParam String companyId) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.getByIduser(companyId)); return ResponseHelper.buildResponse(iOrgUsrService.getByIduser(companyId));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "查询当前登陆人所属单位的下级部门", notes = "查询当前登陆人所属单位的下级部门")
@PostMapping(value = "/getDetByCompanyId")
public ResponseModel<Object> getDetByCompanyId() throws Exception {
ResponseModel<String> parentId = this.getParentId();
return ResponseHelper.buildResponse(iOrgUsrService.getDetByCompanyId(parentId.getResult()));
}
} }
\ No newline at end of file
...@@ -3253,4 +3253,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -3253,4 +3253,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return baseMapper.selectList(wrapper); return baseMapper.selectList(wrapper);
} }
public List<OrgUsr> getDetByCompanyId(String companyId){
QueryWrapper<OrgUsr> wrapper = new QueryWrapper<>();
wrapper.eq("is_delete",false);
wrapper.eq("parent_id",companyId);
wrapper.eq("biz_org_type","DEPARTMENT");
return baseMapper.selectList(wrapper);
}
} }
\ No newline at end of file
...@@ -143,6 +143,7 @@ public class PointController extends AbstractBaseController { ...@@ -143,6 +143,7 @@ public class PointController extends AbstractBaseController {
List<RoutePoint> routePointList = iRoutePointDao.queryByPointId(pointClassify.getPointId()); List<RoutePoint> routePointList = iRoutePointDao.queryByPointId(pointClassify.getPointId());
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
PointClassify newPointClassify = new PointClassify(); PointClassify newPointClassify = new PointClassify();
List<PointInputItemVo> customInputList = pointClassify.getEquipIputDetailData();//巡检项
if(pointClassify.getId()==null){ if(pointClassify.getId()==null){
newPointClassify.setEquipmentId(pointClassify.getEquipmentId()); newPointClassify.setEquipmentId(pointClassify.getEquipmentId());
...@@ -179,12 +180,10 @@ public class PointController extends AbstractBaseController { ...@@ -179,12 +180,10 @@ public class PointController extends AbstractBaseController {
newPointClassify.setCategoryCode(pointClassify.getCategoryCode()); newPointClassify.setCategoryCode(pointClassify.getCategoryCode());
newPointClassify.setCategoryName(pointClassify.getCategoryName()); newPointClassify.setCategoryName(pointClassify.getCategoryName());
newPointClassify.setCode(pointClassify.getCode()); newPointClassify.setCode(pointClassify.getCode());
iPointService.addPointClassifyByPointId(newPointClassify);
}else{ }else{
newPointClassify.setId(pointClassify.getId()); newPointClassify.setId(pointClassify.getId());
List<PointInputItemVo> oldInputItemList =iPointService. queryOldPointInputItem(pointClassify.getPointId()); // 新的巡检项的补集,即需要删除的项 List<PointInputItemVo> oldInputItemList =iPointService. queryOldPointInputItem(pointClassify.getPointId()); // 新的巡检项的补集,即需要删除的项
List<PointInputItemVo> newInputItemList = new ArrayList<>(); List<PointInputItemVo> newInputItemList = new ArrayList<>();
List<PointInputItemVo> classList = pointClassify.getEquipIputDetailData(); List<PointInputItemVo> classList = pointClassify.getEquipIputDetailData();
...@@ -209,9 +208,7 @@ public class PointController extends AbstractBaseController { ...@@ -209,9 +208,7 @@ public class PointController extends AbstractBaseController {
} }
} }
iPointService.addPointClassifyByPointId(newPointClassify);
List<PointInputItemVo> customInputList = pointClassify.getEquipIputDetailData();//巡检项
for (PointInputItemVo pItemVo : customInputList) { for (PointInputItemVo pItemVo : customInputList) {
PointInputItem pointInputItem = new PointInputItem(); PointInputItem pointInputItem = new PointInputItem();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment