Pre Merge pull request !98 from dxfeng/feature/dxf

pull/98/MERGE
dxfeng 3 years ago committed by Gitee
commit 63733485c2
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -7,6 +7,7 @@ import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.apache.commons.lang.StringUtils;
import weaver.general.Util; import weaver.general.Util;
/** /**
@ -37,7 +38,7 @@ public class ExtendInfoFieldParam {
public String getControlType() { public String getControlType() {
JSONArray fieldType = (JSONArray) this.getFieldType(); JSONArray fieldType = (JSONArray) this.getFieldType();
String fieldHtmlType = Util.null2String(fieldType.get(0)).trim(); String fieldHtmlType = Util.null2String(fieldType.get(0));
if (fieldHtmlType.equals("input")) { if (fieldHtmlType.equals("input")) {
fieldHtmlType = "1"; fieldHtmlType = "1";
} else if (fieldHtmlType.equals("textarea")) { } else if (fieldHtmlType.equals("textarea")) {
@ -109,4 +110,21 @@ public class ExtendInfoFieldParam {
} }
return fp.getFielddbtype(); 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"/> <include refid="baseColumns"/>
FROM FROM
jcl_field_extendtitle t jcl_field_extendtitle t
WHERE t.delete_type = 0 and t.is_show = 1 WHERE t.delete_type = 0
<if test=" groupId != null "> <if test=" groupId != null ">
and group_id = #{groupId} and group_id = #{groupId}
</if> </if>
@ -132,7 +132,7 @@
<include refid="baseColumns"/> <include refid="baseColumns"/>
FROM FROM
jcl_field_extendtitle t jcl_field_extendtitle t
WHERE t.delete_type = 0 and t.is_show = 1 WHERE t.delete_type = 0
AND id IN AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")"> <foreach collection="ids" open="(" item="id" separator="," close=")">
#{id} #{id}

@ -73,10 +73,10 @@ public interface FieldDefinedService {
/** /**
* *
* *
* @param id * @param param
* @return * @return
*/ */
int deleteTitle(Long id); int deleteTitle(ExtendTitleSaveParam param);
/** /**
* *

@ -214,8 +214,16 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
} }
@Override @Override
public int deleteTitle(Long id) { public int deleteTitle(ExtendTitleSaveParam param) {
return getExtendTitleMapper().deleteExtendTitleByIds(DeleteParam.builder().ids(id.toString()).build().getIds()); 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 @Override

@ -144,7 +144,7 @@ public class FieldDefinedController {
public ReturnResult deleteTitle(@Context HttpServletRequest request, @Context HttpServletResponse response, @PathParam("moduleTypeEnum") ModuleTypeEnum moduleTypeEnum, @RequestBody ExtendTitleSaveParam param) { public ReturnResult deleteTitle(@Context HttpServletRequest request, @Context HttpServletResponse response, @PathParam("moduleTypeEnum") ModuleTypeEnum moduleTypeEnum, @RequestBody ExtendTitleSaveParam param) {
try { try {
User user = HrmUserVarify.getUser(request, response); User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getFieldDefinedWrapper(user).deleteTitle(param.getId())); return ReturnResult.successed(getFieldDefinedWrapper(user).deleteTitle(param));
} catch (Exception e) { } catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage()); return ReturnResult.exceptionHandle(e.getMessage());
} }

@ -70,8 +70,8 @@ public class FieldDefinedWrapper extends Service {
} }
public int deleteTitle(Long id) { public int deleteTitle(ExtendTitleSaveParam param) {
return getFieldDefinedService(user).deleteTitle(id); return getFieldDefinedService(user).deleteTitle(param);
} }

Loading…
Cancel
Save