commit
55d82c095a
|
|
@ -7,6 +7,7 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.general.Util;
|
||||
|
||||
/**
|
||||
|
|
@ -37,7 +38,7 @@ public class ExtendInfoFieldParam {
|
|||
|
||||
public String getControlType() {
|
||||
JSONArray fieldType = (JSONArray) this.getFieldType();
|
||||
String fieldHtmlType = Util.null2String(fieldType.get(0)).trim();
|
||||
String fieldHtmlType = Util.null2String(fieldType.get(0));
|
||||
if (fieldHtmlType.equals("input")) {
|
||||
fieldHtmlType = "1";
|
||||
} else if (fieldHtmlType.equals("textarea")) {
|
||||
|
|
@ -109,4 +110,21 @@ public class ExtendInfoFieldParam {
|
|||
}
|
||||
return fp.getFielddbtype();
|
||||
}
|
||||
|
||||
public static String toDbc(String input) {
|
||||
if (StringUtils.isBlank(input)) {
|
||||
return "";
|
||||
}
|
||||
char[] c = input.toCharArray();
|
||||
for (int i = 0; i < c.length; i++) {
|
||||
if (c[i] == 12288) {
|
||||
c[i] = (char) 32;
|
||||
continue;
|
||||
}
|
||||
if (c[i] > 65280 && c[i] < 65375) {
|
||||
c[i] = (char) (c[i] - 65248);
|
||||
}
|
||||
}
|
||||
return new String(c);
|
||||
}
|
||||
}
|
||||
|
|
@ -120,7 +120,7 @@
|
|||
<include refid="baseColumns"/>
|
||||
FROM
|
||||
jcl_field_extendtitle t
|
||||
WHERE t.delete_type = 0 and t.is_show = 1
|
||||
WHERE t.delete_type = 0
|
||||
<if test=" groupId != null ">
|
||||
and group_id = #{groupId}
|
||||
</if>
|
||||
|
|
@ -132,7 +132,7 @@
|
|||
<include refid="baseColumns"/>
|
||||
FROM
|
||||
jcl_field_extendtitle t
|
||||
WHERE t.delete_type = 0 and t.is_show = 1
|
||||
WHERE t.delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
|
|
|
|||
|
|
@ -73,10 +73,10 @@ public interface FieldDefinedService {
|
|||
/**
|
||||
* 删除标题信息
|
||||
*
|
||||
* @param id
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
int deleteTitle(Long id);
|
||||
int deleteTitle(ExtendTitleSaveParam param);
|
||||
|
||||
/**
|
||||
* 获取自定义字段列表
|
||||
|
|
|
|||
|
|
@ -214,8 +214,16 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
}
|
||||
|
||||
@Override
|
||||
public int deleteTitle(Long id) {
|
||||
return getExtendTitleMapper().deleteExtendTitleByIds(DeleteParam.builder().ids(id.toString()).build().getIds());
|
||||
public int deleteTitle(ExtendTitleSaveParam param) {
|
||||
getExtendTitleMapper().deleteExtendTitleByIds(DeleteParam.builder().ids(param.getId().toString()).build().getIds());
|
||||
List<ExtendTitlePO> titlesByGroupID = getExtendTitleMapper().getTitlesByGroupID(param.getGroupType());
|
||||
|
||||
if (CollectionUtils.isEmpty(titlesByGroupID)) {
|
||||
// 删除整个分组
|
||||
getExtendGroupMapper().delete(param.getGroupType());
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -432,7 +440,7 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
MapperProxyFactory.getProxy(ExtendGroupMapper.class).delete(id);
|
||||
List<ExtendInfoPO> extendInfoList = getExtendInfoMapper().listFields(extendGroupPO.getExtendType().toString(), extendGroupPO.getId().toString(), ExtendGroupBO.getTableNameByGroupPO(extendGroupPO), "");
|
||||
List<Long> ids = extendInfoList.stream().map(ExtendInfoPO::getId).collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(ids)) {
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
// 删除数据
|
||||
dropColumns(ids, extendGroupPO, extendInfoList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ public class FieldDefinedController {
|
|||
public ReturnResult deleteTitle(@Context HttpServletRequest request, @Context HttpServletResponse response, @PathParam("moduleTypeEnum") ModuleTypeEnum moduleTypeEnum, @RequestBody ExtendTitleSaveParam param) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getFieldDefinedWrapper(user).deleteTitle(param.getId()));
|
||||
return ReturnResult.successed(getFieldDefinedWrapper(user).deleteTitle(param));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e.getMessage());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ public class FieldDefinedWrapper extends Service {
|
|||
}
|
||||
|
||||
|
||||
public int deleteTitle(Long id) {
|
||||
return getFieldDefinedService(user).deleteTitle(id);
|
||||
public int deleteTitle(ExtendTitleSaveParam param) {
|
||||
return getFieldDefinedService(user).deleteTitle(param);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue