Browse Source

chaxun暂存

dev_shibei_match
yinzuomei 4 years ago
parent
commit
75693df9b5
  1. 5
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormItemDTO.java
  2. 88
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ConditionResultDTO.java
  3. 20
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java
  4. 5
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java
  5. 5
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemEntity.java
  6. 12
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java
  7. 16
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java
  8. 46
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml

5
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormItemDTO.java

@ -17,9 +17,10 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
@ -74,7 +75,7 @@ public class IcFormItemDTO implements Serializable {
private String itemType;
/**
* 分组ID,'默认NONE'
* 分组ID,'默认0'
*/
private String itemGroupId;

88
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ConditionResultDTO.java

@ -0,0 +1,88 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 查询条件
* @Author yinzuomei
* @Date 2021/10/27 9:09 上午
*/
@Data
public class ConditionResultDTO implements Serializable {
private static final long serialVersionUID = -2021200288758478252L;
/**
* 父项ID
*/
private String itemId;
/**
* 默认ic_resi_user
*/
private String tableName;
/**
* 父项ID
*/
private String parentItemId;
/**
* 项标签
*/
private String label;
/**
* 控件类型,EG:INPUT;从字典获取
*/
private String itemType;
/**
* 分组ID,'默认NONE'
*/
private String itemGroupId;
/**
* 是否必填,1必填0不必填
*/
private Integer required;
/**
* 手机号mobile; 身份证id_card
*/
private String validType;
/**
* 默认值
*/
private String defaultValue;
/**
* 选项来源,REMOTE;LOCAL;如果是动态加载的下拉框或者CHECKBOX等的情况下使用URL:接口获取(LABEL,VALUE)JSON:直接从JSON中取
*/
private String optionSourceType;
/**
* 来源地址,REMOTE才有固定格式;如果OPTIONS_SOURCE是URL则此处填写要调用的接口的URL相对路径例如/API/GOV/ORG/XXXX此处不应设置参数若需要参数应当完全由后端通过TOKEN信息来获取
*/
private String optionSourceValue;
/**
* 排序
*/
private Integer sort;
/**
* 占位提示语
*/
private String placeholder;
/**
* 列名
*/
private String columnName;
private List<OptionDTO> options;
}

20
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java

@ -29,8 +29,10 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcFormDTO;
import com.epmet.dto.form.CustomerFormQueryDTO;
import com.epmet.dto.result.ConditionResultDTO;
import com.epmet.dto.result.CustomerFormResultDTO;
import com.epmet.excel.IcFormExcel;
import com.epmet.service.IcFormItemService;
import com.epmet.service.IcFormService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -52,6 +54,8 @@ public class IcFormController {
@Autowired
private IcFormService icFormService;
@Autowired
private IcFormItemService icFormItemService;
@GetMapping("page")
public Result<PageData<IcFormDTO>> page(@RequestParam Map<String, Object> params){
@ -109,6 +113,22 @@ public class IcFormController {
formDto.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDto,CustomerFormQueryDTO.AddUserInternalGroup.class);
return new Result<CustomerFormResultDTO>().ok(icFormService.getCustomerForm(formDto));
}
/**
* 获取居民信息的查询条件组件列表
*
* @param tokenDto
* @param formDto
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.ConditionResultDTO>>
* @author yinzuomei
* @date 2021/10/27 9:18 上午
*/
@PostMapping("conditionlist")
public Result<List<ConditionResultDTO>> queryConditionList(@LoginUser TokenDto tokenDto, @RequestBody CustomerFormQueryDTO formDto){
formDto.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDto,CustomerFormQueryDTO.AddUserInternalGroup.class);
return new Result<List<ConditionResultDTO>>().ok(icFormItemService.queryConditionList(formDto));
}
}

5
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/IcFormItemDao.java

@ -18,8 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.ConditionResultDTO;
import com.epmet.entity.IcFormItemEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 表单项
@ -30,4 +34,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface IcFormItemDao extends BaseDao<IcFormItemEntity> {
List<ConditionResultDTO> selectConditionList(@Param("customerId") String customerId, @Param("formCode") String formCode);
}

5
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemEntity.java

@ -18,13 +18,10 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 表单项
*
@ -74,7 +71,7 @@ public class IcFormItemEntity extends BaseEpmetEntity {
private String itemType;
/**
* 分组ID,'默认NONE'
* 分组ID,'默认0'
*/
private String itemGroupId;

12
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java

@ -20,6 +20,8 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcFormItemDTO;
import com.epmet.dto.form.CustomerFormQueryDTO;
import com.epmet.dto.result.ConditionResultDTO;
import com.epmet.entity.IcFormItemEntity;
import java.util.List;
@ -92,4 +94,14 @@ public interface IcFormItemService extends BaseService<IcFormItemEntity> {
* @date 2021-10-26
*/
void delete(String[] ids);
/**
* 获取居民信息的查询条件组件列表
*
* @param formDto
* @return java.util.List<com.epmet.dto.result.ConditionResultDTO>
* @author yinzuomei
* @date 2021/10/27 9:19 上午
*/
List<ConditionResultDTO> queryConditionList(CustomerFormQueryDTO formDto);
}

16
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java

@ -25,6 +25,8 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcFormItemDao;
import com.epmet.dto.IcFormItemDTO;
import com.epmet.dto.form.CustomerFormQueryDTO;
import com.epmet.dto.result.ConditionResultDTO;
import com.epmet.entity.IcFormItemEntity;
import com.epmet.service.IcFormItemService;
import org.apache.commons.lang3.StringUtils;
@ -97,4 +99,18 @@ public class IcFormItemServiceImpl extends BaseServiceImpl<IcFormItemDao, IcForm
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* 获取居民信息的查询条件组件列表
*
* @param formDto
* @return java.util.List<com.epmet.dto.result.ConditionResultDTO>
* @author yinzuomei
* @date 2021/10/27 9:19 上午
*/
@Override
public List<ConditionResultDTO> queryConditionList(CustomerFormQueryDTO formDto) {
List<ConditionResultDTO> list=baseDao.selectConditionList(formDto.getCustomerId(),formDto.getFormCode());
return list;
}
}

46
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml

@ -4,5 +4,51 @@
<mapper namespace="com.epmet.dao.IcFormItemDao">
<resultMap id="ConditionResultDTOMap" type="com.epmet.dto.result.ConditionResultDTO">
<id property="itemId" column="item_id" ></id>
<result property="tableName" column="table_name"/>
<result property="parentItemId" column="PARENT_ITEM_ID"/>
<result property="label" column="LABEL"/>
<result property="itemType" column="ITEM_TYPE"/>
<result property="itemGroupId" column="ITEM_GROUP_ID"/>
<result property="required" column="REQUIRED"/>
<result property="validType" column="VALID_TYPE"/>
<result property="defaultValue" column="DEFAULT_VALUE"/>
<result property="optionSourceType" column="OPTION_SOURCE_TYPE"/>
<result property="optionSourceValue" column="OPTION_SOURCE_VALUE"/>
<result property="sort" column="SORT"/>
<result property="placeholder" column="PLACEHOLDER"/>
<result property="columnName" column="COLUMN_NAME"/>
<collection property="options" ofType="com.epmet.dto.result.OptionDTO"
column="item_id" select="com.epmet.dao.IcFormDao.selectListOption">
<result property="label" column=""/>
<result property="value" column="url"/>
</collection>
</resultMap>
<select id="selectConditionList" parameterType="map" resultMap="ConditionResultDTOMap">
SELECT
b.FORM_ITEM_ID AS item_id,
IFNULL(g.TABLE_NAME,'')AS TABLE_NAME,
i.PARENT_ITEM_ID,
i.LABEL,
i.ITEM_TYPE,
i.ITEM_GROUP_ID,
i.REQUIRED,
IFNULL(i.VALID_TYPE,'')as VALID_TYPE,
IFNULL(i.DEFAULT_VALUE,'') as DEFAULT_VALUE,
IFNULL(i.OPTION_SOURCE_TYPE,'') as OPTION_SOURCE_TYPE,
IFNULL(i.OPTION_SOURCE_VALUE,'') as OPTION_SOURCE_VALUE,
b.SORT,
IFNULL(i.PLACEHOLDER,'') as PLACEHOLDER,
IFNULL(i.COLUMN_NAME,'')as COLUMN_NAME
FROM ic_form_query_builder b
inner join ic_form_item i on(i.id=b.FORM_ITEM_ID and i.DEL_FLAG='0')
LEFT JOIN ic_form_item_group g ON ( i.ITEM_GROUP_ID = g.id )
WHERE
b.DEL_FLAG = '0'
AND b.CUSTOMER_ID = #{customerId}
AND b.FORM_CODE = #{formCode}
ORDER BY b.SORT asc
</select>
</mapper>
Loading…
Cancel
Save