flower_city/src/main/java/com/dg/core/api/GuideRepairOrderAppletsController.java
@@ -225,48 +225,38 @@ @Authorization public ResultData evaluate(@RequestBody GuideRepairOrder entity, @CurrentUser SysUser sysUser) { // if(entity==null) // { // return ResultData.error("参数不能为空"); // } // // if(entity.getId()<=0) // { // return ResultData.error("工单id不能为空"); // } // // if(!StringUtils.equals(entity.getState(),"4")) // { // return ResultData.error("该工单不能评价!"); // } // // if(StringUtils.isEmpty(entity.getEvaluateState())) // { // return ResultData.error("满意程度不能为空!"); // } if(sysUser==null) if(entity==null) { return ResultData.error("sysUser为空!"); return ResultData.error("参数不能为空"); } if(entity.getId()<=0) { return ResultData.error("工单id不能为空"); } if(!StringUtils.equals(entity.getState(),"4")) { return ResultData.error("该工单不能评价!"); } if(StringUtils.isEmpty(entity.getEvaluateState())) { return ResultData.error("满意程度不能为空!"); } //已办结 // entity.setState("3"); // //新增已办结记录 // GuideEvolveEntity guideEvolveEntity=new GuideEvolveEntity(); // guideEvolveEntity.setCreateTime(LocalDateTime.now()); // guideEvolveEntity.setUpdateTime(LocalDateTime.now()); // guideEvolveEntity.setState("3"); // guideEvolveEntity.setFromDepartmentalId(sysUser.getDepartmentId()); // guideEvolveEntity.setFromUserId(sysUser.getUserId()+""); // iGuideEvolveService.insertConfig(guideEvolveEntity); entity.setState("3"); //新增已办结记录 GuideEvolveEntity guideEvolveEntity=new GuideEvolveEntity(); guideEvolveEntity.setCreateTime(LocalDateTime.now()); guideEvolveEntity.setUpdateTime(LocalDateTime.now()); guideEvolveEntity.setState("3"); guideEvolveEntity.setFromDepartmentalId(sysUser.getDepartmentId()); guideEvolveEntity.setFromUserId(sysUser.getUserId()+""); iGuideEvolveService.insertConfig(guideEvolveEntity); // return toAjax(iGuideRepairOrderService.updateConfig(entity)); return ResultData.success(sysUser.getUserId()+""); return toAjax(iGuideRepairOrderService.updateConfig(entity)); } /** flower_city/src/main/java/com/dg/core/controller/OrganizationController.java
@@ -89,7 +89,10 @@ { Assert.notNull(Id, "Id 不能为空"); OrganizationChartEntity entity=iOrganizationChartService.selectConfigById(Id); if(!StringUtils.isEmpty(entity.getParentId())) List<OrganizationChartEntity> list=iOrganizationChartService.selectConfigList(entity.getId()+"",""); if(list.size()>0) { return ResultData.error("该机构下存在其他部门!请先删除子部门"); } @@ -138,7 +141,7 @@ */ @ApiOperation(value = "通过父级id查询对应机构下的全部部门",response = OrganizationChartEntity.class) @GetMapping("/getdepartment") public TableDataInfo getIds(@RequestParam(value = "department",required = false) String departmentId) public TableDataInfo getOrganizations(@RequestParam(value = "department",required = false) String departmentId) { List<OrganizationChartEntity> ids=new ArrayList<>(); List<OrganizationChartEntity> lists = iOrganizationChartService.selectConfigList(departmentId,""); @@ -146,18 +149,17 @@ { lists.add(iOrganizationChartService.selectConfigById(departmentId)); } ids=disposestreetId(lists); ids=disposestreet(lists); if(ids.size()<1) { return null; } // ids.add(streetId); ids.add(iOrganizationChartService.selectConfigById(departmentId)); return getDataTable(ids); } //递归取id private List<OrganizationChartEntity> disposestreetId(List<OrganizationChartEntity> lists) private List<OrganizationChartEntity> disposestreet(List<OrganizationChartEntity> lists) { List<OrganizationChartEntity> ids=new ArrayList<>(); for (OrganizationChartEntity sysStreet:lists) @@ -165,7 +167,7 @@ ids.add(sysStreet); if(sysStreet.getChild()!=null && sysStreet.getChild().size()>0) { ids.addAll(disposestreetId(sysStreet.getChild())); ids.addAll(disposestreet(sysStreet.getChild())); } else { flower_city/src/main/java/com/dg/core/controller/UserController.java
@@ -50,7 +50,7 @@ SysUser user=null; //管理员登录 if(StringUtils.equals("zigonggaoadmin",account)) if(!StringUtils.isEmpty(account)) { user= IUserService.getUserByAccount(account); flower_city/src/main/java/com/dg/core/manager/RedisTokenManager.java
@@ -2,6 +2,7 @@ import com.dg.core.Constant; import io.jsonwebtoken.Claims; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.redis.core.RedisTemplate; @@ -41,7 +42,7 @@ } public boolean checkToken(String token) { if (token == null) { if (StringUtils.isEmpty(token)) { return false; } String userId = redis.boundValueOps(token).get(); @@ -61,7 +62,7 @@ */ @Override public boolean checkHCToken(String token) { if (token == null) { if (StringUtils.isEmpty(token)) { return false; } // token解析 flower_city/src/main/java/com/dg/core/service/IOrganizationChartService.java
@@ -54,4 +54,13 @@ */ int countList(String organizationName); /** * 获取部门下子部门的全部id * @param id * @return */ List<String> getIds(String id); } flower_city/src/main/java/com/dg/core/service/impl/OrganizationChartImpl.java
@@ -8,6 +8,7 @@ import com.dg.core.service.IOrganizationChartService; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; @Service @@ -87,4 +88,49 @@ public int countList(String organizationName) { return baseMapper.countList(organizationName); } /** * 递归获取id 内部使用 * @param departmentId * @return */ @Override public List<String> getIds(String id) { List<String> ids=new ArrayList<>(); List<OrganizationChartEntity> lists = baseMapper.selectConfigList(id,""); if(lists.size()<1) { lists.add(baseMapper.selectConfigById(id)); } ids=disposestreetId(lists); if(ids.size()<1) { return null; } ids.add(id); return ids; } //递归取id private List<String> disposestreetId(List<OrganizationChartEntity> lists) { List<String> ids=new ArrayList<>(); for (OrganizationChartEntity sysStreet:lists) { ids.add(sysStreet.getId()+""); if(sysStreet.getChild()!=null && sysStreet.getChild().size()>0) { ids.addAll(disposestreetId(sysStreet.getChild())); } else { ids.add(sysStreet.getId()+""); } } return ids; } } flower_city/src/main/resources/mapper/OrganizationChartMapper.xml
@@ -33,7 +33,7 @@ update_time, parent_id, update_user_id, (select user_name from automessage_sys_user where user_id=automessage_organization_chart.update_user_id)updateUserName, (select user_name from automessage_sys_user where user_id=automessage_organization_chart.update_user_id) as updateUserName, (select organization_name from automessage_organization_chart as oc where oc.id=automessage_organization_chart.parent_id) as parentName, city, district, @@ -43,7 +43,7 @@ (select name from area_code_2022 where village=area_code_2022.code) as villageName, detailed_address, grade, resume,contact_number,area_list area_list FROM automessage_organization_chart </sql> @@ -91,8 +91,6 @@ or resume like concat('%', #{keyWord}, '%') or #{keyWord} like concat('%', resume, '%') </select> <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.OrganizationChartEntity"> insert into automessage_organization_chart ( <if test="id != null">id,</if> @@ -104,6 +102,10 @@ <if test="detailedAddress != null and detailedAddress != '' ">detailed_address,</if> <if test="grade != null and grade != '' ">grade,</if> <if test="areaList != null and areaList != '' ">area_list,</if> <if test="contactNumber != null and contactNumber != '' ">contact_number,</if> <if test="departmentalApplication != null and departmentalApplication != '' ">departmental_application,</if> <if test="updateUserId != null and updateUserId != '' ">update_user_id,</if> <if test="resume != null and resume != '' ">resume,</if> update_time, create_time )values( @@ -116,6 +118,10 @@ <if test="detailedAddress != null and detailedAddress != '' ">#{detailedAddress},</if> <if test="grade != null and grade != '' ">#{grade},</if> <if test="areaList != null and areaList != '' ">#{areaList},</if> <if test="contactNumber != null and contactNumber != '' ">#{contactNumber},</if> <if test="departmentalApplication != null and departmentalApplication != '' ">#{departmentalApplication},</if> <if test="updateUserId != null and updateUserId != '' ">#{updateUserId},</if> <if test="resume != null and resume != '' ">#{resume},</if> sysdate(), sysdate() ) @@ -135,6 +141,10 @@ <if test="departmentalApplication != null and departmentalApplication != '' ">departmental_application=#{departmentalApplication},</if> <if test="updateUserId != null">update_user_id=#{updateUserId},</if> <if test="areaList != null and areaList != '' ">area_list=#{areaList},</if> <if test="contactNumber != null and contactNumber != '' ">contact_number=#{contactNumber},</if> <if test="departmentalApplication != null and departmentalApplication != '' ">departmental_application=#{departmentalApplication},</if> <if test="updateUserId != null and updateUserId != '' ">update_user_id=#{updateUserId},</if> <if test="resume != null and resume != '' ">resume=#{resume},</if> update_time=sysdate() </set> where id= #{id} flower_city/src/main/resources/mapper/SysUserMapper.xml
@@ -1,7 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.dg.core.db.gen.mapper.SysUserMapper"> <resultMap type="com.dg.core.db.gen.entity.SysUser" id="SysUserResult"> <id property="id" column="id" /> <id property="userId" column="user_id" /> @@ -74,7 +73,6 @@ FROM automessage_sys_user </sql> <select id="selectNum" parameterType="string" resultType="integer"> select count(user_id) from automessage_sys_user