diff --git a/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java b/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java index 2690a98b..0adfead5 100644 --- a/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java +++ b/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java @@ -100,10 +100,10 @@ public class ExtendInfoBO { .controlType(Integer.parseInt(controlType)) .browserType(browserType) .extendGroupId(extendGroupId) - .isenable(null == infoFieldParam.getEnable() ? null : Integer.parseInt(infoFieldParam.getEnable())) - .isrequired(null == infoFieldParam.getRequired() ? null : Integer.parseInt(infoFieldParam.getRequired())) + .isenable("1".equals(infoFieldParam.getEnable()) ? 1 : 0) + .isrequired("1".equals(infoFieldParam.getRequired()) ? 1 : 0) .listShow(1) - .editShow(null == infoFieldParam.getIsModify() ? null : Integer.parseInt(infoFieldParam.getIsModify())) + .editShow("0".equals(infoFieldParam.getIsModify()) ? 0 : 1) .addShow(1) .browserShow(1) .customValue(infoFieldParam.getFieldType().toString()) diff --git a/src/com/engine/organization/entity/extend/param/ExtendInfoFieldParam.java b/src/com/engine/organization/entity/extend/param/ExtendInfoFieldParam.java index 7d0f42a3..ca44f358 100644 --- a/src/com/engine/organization/entity/extend/param/ExtendInfoFieldParam.java +++ b/src/com/engine/organization/entity/extend/param/ExtendInfoFieldParam.java @@ -10,7 +10,6 @@ import lombok.NoArgsConstructor; import weaver.general.Util; /** - * @description: TODO * @author:dxfeng * @createTime: 2022/06/15 * @version: 1.0 @@ -38,7 +37,7 @@ public class ExtendInfoFieldParam { public String getControlType() { JSONArray fieldType = (JSONArray) this.getFieldType(); - String fieldHtmlType = Util.null2String(fieldType.get(0)); + String fieldHtmlType = Util.null2String(fieldType.get(0)).trim(); if (fieldHtmlType.equals("input")) { fieldHtmlType = "1"; } else if (fieldHtmlType.equals("textarea")) { diff --git a/src/com/engine/organization/mapper/extend/ExtendGroupMapper.java b/src/com/engine/organization/mapper/extend/ExtendGroupMapper.java index 48aaae09..7f07081e 100644 --- a/src/com/engine/organization/mapper/extend/ExtendGroupMapper.java +++ b/src/com/engine/organization/mapper/extend/ExtendGroupMapper.java @@ -1,7 +1,6 @@ package com.engine.organization.mapper.extend; import com.engine.organization.entity.extend.po.ExtendGroupPO; -import com.engine.organization.entity.fieldset.param.FieldTypeTreeParam; import org.apache.ibatis.annotations.Param; import java.util.Collection; @@ -51,11 +50,11 @@ public interface ExtendGroupMapper { void insertIgnoreNull(ExtendGroupPO extendGroupPO); - void update(@Param("id")Long id, @Param("name")String name); + void update(@Param("id") Long id, @Param("name") String name); void delete(@Param("id") Long id); - void updateNameAndOrder(@Param("id")Long id, @Param("groupName")String groupName, @Param("showOrder")Integer showOrder); + void updateNameAndOrder(@Param("id") Long id, @Param("groupName") String groupName, @Param("showOrder") Integer showOrder, @Param("isShow") String isShow); - void batchDelete(@Param("ids")Set removeSet); + void batchDelete(@Param("ids") Set removeSet); } diff --git a/src/com/engine/organization/mapper/extend/ExtendGroupMapper.xml b/src/com/engine/organization/mapper/extend/ExtendGroupMapper.xml index f17809e6..7da508c4 100644 --- a/src/com/engine/organization/mapper/extend/ExtendGroupMapper.xml +++ b/src/com/engine/organization/mapper/extend/ExtendGroupMapper.xml @@ -23,6 +23,7 @@ , t.group_name , t.is_system_default , t.creator + , t.is_show , t.show_order , t.delete_type , t.create_time @@ -35,7 +36,7 @@ FROM jcl_field_extendgroup t - WHERE t.delete_type = 0 and t.is_show = 1 + WHERE t.delete_type = 0 and extend_type = #{extendType} @@ -162,7 +163,8 @@ update jcl_field_extendgroup group_name=#{groupName}, - show_order=#{showOrder} + show_order=#{showOrder}, + is_show = #{isShow} WHERE id = #{id} AND delete_type = 0 diff --git a/src/com/engine/organization/service/impl/FieldDefinedServiceImpl.java b/src/com/engine/organization/service/impl/FieldDefinedServiceImpl.java index 8a0f89b0..03f67704 100644 --- a/src/com/engine/organization/service/impl/FieldDefinedServiceImpl.java +++ b/src/com/engine/organization/service/impl/FieldDefinedServiceImpl.java @@ -445,13 +445,14 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ removeSet.add(e); } }); - MapperProxyFactory.getProxy(ExtendGroupMapper.class).batchDelete(removeSet); + if (CollectionUtils.isNotEmpty(removeSet)) { + MapperProxyFactory.getProxy(ExtendGroupMapper.class).batchDelete(removeSet); + } int showOrder = 0; extendGroupPOS.forEach(e -> { e.setExtendType(extendType); e.setPid(fieldTypeTreeParam.getParentId()); - e.setIsShow(fieldTypeTreeParam.getIsShow()); e.setShowOrder(showOrder + 1); e.setIsSystemDefault(1); e.setCreator((long) user.getUID()); @@ -462,7 +463,7 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ if (e.getId() == null) {//新增 MapperProxyFactory.getProxy(ExtendGroupMapper.class).insertIgnoreNull(e); } else { //更新 - MapperProxyFactory.getProxy(ExtendGroupMapper.class).updateNameAndOrder(e.getId(), e.getGroupName(), e.getShowOrder()); + MapperProxyFactory.getProxy(ExtendGroupMapper.class).updateNameAndOrder(e.getId(), e.getGroupName(), e.getShowOrder(), e.getIsShow()); } });