Commit 7a40bc26c891be8779d23f66f27ed9746c19c04f

Authored by baohanddd
1 parent 6e943e240d

add data import :机构、部门、用户(医生)

Showing 3 changed files with 34 additions and 14 deletions

platform-data-api/src/main/java/com/lyms/platform/data/service/impl/DataImportTaskServiceImpl.java View file @ 7a40bc2
... ... @@ -17,6 +17,7 @@
17 17 import com.lyms.platform.pojo.PuerperaModel;
18 18 import com.lymsh.mommybaby.earlydata.dao.PlatMapper;
19 19 import com.lymsh.mommybaby.earlydata.model.PlatDataContent;
  20 +import com.lymsh.mommybaby.earlydata.model.PlatDataType;
20 21 import org.apache.commons.lang.StringUtils;
21 22 import org.joda.time.DateTime;
22 23 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -82,6 +83,31 @@
82 83 @Override
83 84 public void updateBasicConfig() {
84 85 try {
  86 + List<PlatDataType> typeList = platMapper.selectPlatDataType();
  87 + for (PlatDataType type:typeList) {
  88 + try {
  89 + if (StringUtils.isBlank(type.getDtId())) {
  90 + continue;
  91 + }
  92 + BasicConfig config = new BasicConfig();
  93 + config.setId(type.getDtId());
  94 + config.setCode(type.getDtName());
  95 + config.setName(type.getDtName());
  96 + config.setParentId("0");
  97 + config.setTypeId("0");
  98 + config.setYn(YnEnums.YES.getId());
  99 + BasicConfig db = basicConfigService.getOneBasicConfigById(type.getDtId());
  100 + if (db == null) {
  101 + basicConfigService.addBasicConfig(config);
  102 + } else {
  103 + basicConfigService.updateBasicConfig(config);
  104 + }
  105 + } catch (Exception ee) {
  106 + ee.printStackTrace();
  107 + LogUtil.taskError(ee.getMessage(), ee);
  108 + }
  109 + }
  110 +
85 111 List<PlatDataContent> list = platMapper.selectPlatDataContent();
86 112 for (PlatDataContent data : list) {
87 113 try {
... ... @@ -92,7 +118,11 @@
92 118 config.setId(data.getDcId());
93 119 config.setCode(data.getDcNo());
94 120 config.setName(data.getDcName());
95   - config.setParentId(data.getDcParentid());
  121 + if ("0".equals(data.getDcParentid())) {
  122 + config.setParentId(data.getDcDatatypeid());
  123 + } else {
  124 + config.setParentId(data.getDcParentid());
  125 + }
96 126 config.setTypeId(data.getDcDatatypeid());
97 127 config.setYn(YnEnums.YES.getId());
98 128 BasicConfig db = basicConfigService.getOneBasicConfigById(data.getDcId());
platform-mommyData/src/main/java/com/lymsh/mommybaby/earlydata/dao/PlatMapper.java View file @ 7a40bc2
... ... @@ -12,7 +12,7 @@
12 12 */
13 13 public interface PlatMapper {
14 14  
15   - public List<PlatDataType> selectPlatDataType(OracleCommonQuery query);
  15 + public List<PlatDataType> selectPlatDataType();
16 16  
17 17 public List<PlatDataContent> selectPlatDataContent();
18 18  
platform-mommyData/src/main/resources/earlyOrm/Plat.xml View file @ 7a40bc2
... ... @@ -11,20 +11,10 @@
11 11 DT_ID,DT_NAME
12 12 </sql>
13 13  
14   - <select id="selectPlatDataType" resultMap="PlatDataTypeResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery">
  14 + <select id="selectPlatDataType" resultMap="PlatDataTypeResultMap">
15 15 select
16 16 <include refid="PlatDataTypeColumns"/>
17   - from (select<include refid="PlatDataTypeColumns"/>,rownum r
18   - from (
19   - select
20   - <include refid="PlatDataTypeColumns"/>
21   - from PLAT_DATATYPE t
22   - where DT_OPERTIME >= #{startTime}
23   - ) h where
24   - <![CDATA[ rownum <= #{endRow} ]]>
25   - )
26   - where
27   - <![CDATA[ r >= #{startRow} ]]>
  17 + from PLAT_DATATYPE
28 18 </select>
29 19  
30 20