!100 移动到组

Merge pull request !100 from dxfeng/feature/dxf
pull/101/MERGE
dxfeng 3 years ago committed by Gitee
commit dfc1ce9484
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -35,5 +35,7 @@ public interface ExtendInfoMapper {
List<ExtendInfoPO> getExtendInfosByIds(@Param("ids") Collection<Long> ids); List<ExtendInfoPO> getExtendInfosByIds(@Param("ids") Collection<Long> ids);
int updateExtendGroupId(@Param("groupId") Long groupId, @Param("ids") Collection<Long> ids);
} }

@ -228,6 +228,15 @@
COLUMN COLUMN
${fieldName}; ${fieldName};
</update> </update>
<update id="updateExtendGroupId">
UPDATE jcl_field_extendinfo
SET extend_group_id = #{groupId}
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</update>
<select id="listFields" resultMap="BaseResultMap"> <select id="listFields" resultMap="BaseResultMap">

@ -26,7 +26,7 @@ import com.engine.organization.service.FieldDefinedService;
import com.engine.organization.util.OrganizationAssert; import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.StringUtils;
import weaver.general.Util; import weaver.general.Util;
import weaver.systeminfo.SystemEnv; import weaver.systeminfo.SystemEnv;
import weaver.workflow.field.BrowserComInfo; import weaver.workflow.field.BrowserComInfo;
@ -428,8 +428,6 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
returnMap.put("data", lsFieldInfo); returnMap.put("data", lsFieldInfo);
returnMap.put("encryptEnable", false); returnMap.put("encryptEnable", false);
// TODO 后续去除
returnMap.put("status", "1");
return returnMap; return returnMap;
} }
@ -498,6 +496,16 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
@Override @Override
public void changeGroup(ExtendInfoChangeParam param) { public void changeGroup(ExtendInfoChangeParam param) {
// 移动字段的ID
String fieldids = param.getFieldids();
// extendTiele表ID
Long groupid = param.getGroupid();
if (StringUtils.isNotEmpty(fieldids) && null != groupid) {
// 更新extendInfo表的extend_group_id
List<Long> ids = Arrays.asList(fieldids.split(",")).stream().map(item -> Long.parseLong(item)).collect(Collectors.toList());
getExtendInfoMapper().updateExtendGroupId(groupid, ids);
}
} }

@ -3,6 +3,7 @@ package com.engine.organization.web;
import com.engine.common.util.ParamUtil; import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil; import com.engine.common.util.ServiceUtil;
import com.engine.organization.entity.extend.param.ExtendFieldSearchParam; import com.engine.organization.entity.extend.param.ExtendFieldSearchParam;
import com.engine.organization.entity.extend.param.ExtendInfoChangeParam;
import com.engine.organization.entity.extend.param.ExtendTitleSaveParam; import com.engine.organization.entity.extend.param.ExtendTitleSaveParam;
import com.engine.organization.entity.fieldset.param.FieldTypeTreeParam; import com.engine.organization.entity.fieldset.param.FieldTypeTreeParam;
import com.engine.organization.enums.ModuleTypeEnum; import com.engine.organization.enums.ModuleTypeEnum;
@ -189,4 +190,17 @@ public class FieldDefinedController {
return ReturnResult.exceptionHandle(e.getMessage()); return ReturnResult.exceptionHandle(e.getMessage());
} }
} }
@POST
@Path("/{moduleTypeEnum}/changeGroup")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult changeGroup(@Context HttpServletRequest request, @Context HttpServletResponse response, @PathParam("moduleTypeEnum") ModuleTypeEnum moduleTypeEnum, @RequestBody ExtendInfoChangeParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
getFieldDefinedWrapper(user).changeGroup(param);
return ReturnResult.successed();
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
} }

@ -3,6 +3,7 @@ package com.engine.organization.wrapper;
import com.engine.common.util.ServiceUtil; import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service; import com.engine.core.impl.Service;
import com.engine.organization.entity.extend.param.ExtendFieldSearchParam; import com.engine.organization.entity.extend.param.ExtendFieldSearchParam;
import com.engine.organization.entity.extend.param.ExtendInfoChangeParam;
import com.engine.organization.entity.extend.param.ExtendTitleSaveParam; import com.engine.organization.entity.extend.param.ExtendTitleSaveParam;
import com.engine.organization.entity.fieldset.param.FieldTypeTreeParam; import com.engine.organization.entity.fieldset.param.FieldTypeTreeParam;
import com.engine.organization.entity.fieldset.vo.TypeTreeVO; import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
@ -96,4 +97,8 @@ public class FieldDefinedWrapper extends Service {
public void deleteFieldDefined(ExtendFieldSearchParam param) { public void deleteFieldDefined(ExtendFieldSearchParam param) {
getFieldDefinedService(user).deleteFieldDefined(param); getFieldDefinedService(user).deleteFieldDefined(param);
} }
public void changeGroup(ExtendInfoChangeParam param) {
getFieldDefinedService(user).changeGroup(param);
}
} }

Loading…
Cancel
Save