1.添加同步,业务单据类型代码
							parent
							
								
									d7a1453cfd
								
							
						
					
					
						commit
						f2e715bd9a
					
				| @ -0,0 +1,7 @@ | |||||||
|  | package com.glxp.api.dao.sync; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||||
|  | import com.glxp.api.entity.sync.SyncDataChangeBustypesEntity; | ||||||
|  | 
 | ||||||
|  | public interface SyncDataChangeBustypesDao extends BaseMapper<SyncDataChangeBustypesEntity> { | ||||||
|  | } | ||||||
| @ -0,0 +1,31 @@ | |||||||
|  | package com.glxp.api.entity.sync; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.annotation.IdType; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableField; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableId; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableName; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 单据同步 - 业务单据类型 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | @TableName(value = "sync_data_change_bustypes") | ||||||
|  | public class SyncDataChangeBustypesEntity { | ||||||
|  | 
 | ||||||
|  |     @TableId(value = "id", type = IdType.AUTO) | ||||||
|  |     private Integer id; | ||||||
|  | 
 | ||||||
|  |     @TableField(value = "`action`") | ||||||
|  |     private String action; | ||||||
|  | 
 | ||||||
|  |     @TableField(value = "`name`") | ||||||
|  |     private String name; | ||||||
|  | 
 | ||||||
|  |     @TableField(value = "outChange") | ||||||
|  |     private Byte outChange; | ||||||
|  | 
 | ||||||
|  |     @TableField(value = "orderStatus") | ||||||
|  |     private Byte orderStatus; | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,18 @@ | |||||||
|  | package com.glxp.api.service.sync; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.entity.sync.SyncDataChangeBustypesEntity; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 单据同步 - 业务单据类型 Service | ||||||
|  |  */ | ||||||
|  | public interface SyncDataChangeBustypeService { | ||||||
|  | 
 | ||||||
|  |     List<SyncDataChangeBustypesEntity> findAll(); | ||||||
|  | 
 | ||||||
|  |     boolean deleteAll(); | ||||||
|  | 
 | ||||||
|  |     void inserts(List<SyncDataChangeBustypesEntity> syncDataChangeBustypesEntities); | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,44 @@ | |||||||
|  | package com.glxp.api.service.sync.impl; | ||||||
|  | 
 | ||||||
|  | import cn.hutool.core.collection.CollUtil; | ||||||
|  | import com.glxp.api.dao.sync.SyncDataChangeBustypesDao; | ||||||
|  | import com.glxp.api.entity.sync.SyncDataChangeBustypesEntity; | ||||||
|  | import com.glxp.api.service.sync.SyncDataChangeBustypeService; | ||||||
|  | import org.apache.ibatis.session.ExecutorType; | ||||||
|  | import org.apache.ibatis.session.SqlSession; | ||||||
|  | import org.apache.ibatis.session.SqlSessionFactory; | ||||||
|  | import org.apache.ibatis.session.TransactionIsolationLevel; | ||||||
|  | import org.springframework.stereotype.Service; | ||||||
|  | import org.springframework.transaction.annotation.Transactional; | ||||||
|  | 
 | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | @Service | ||||||
|  | @Transactional(rollbackFor = Exception.class) | ||||||
|  | public class SyncDataChangeBustypeServiceImpl implements SyncDataChangeBustypeService { | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     private SyncDataChangeBustypesDao syncDataChangeBustypesDao; | ||||||
|  |     @Resource | ||||||
|  |     private SqlSessionFactory sqlSessionFactory; | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public List<SyncDataChangeBustypesEntity> findAll() { | ||||||
|  |         return syncDataChangeBustypesDao.selectList(null); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public boolean deleteAll() { | ||||||
|  |         syncDataChangeBustypesDao.delete(null); | ||||||
|  |         return true; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     @Override | ||||||
|  |     public void inserts(List<SyncDataChangeBustypesEntity> syncDataChangeBustypesEntities) { | ||||||
|  |         if (CollUtil.isNotEmpty(syncDataChangeBustypesEntities)) { | ||||||
|  |             SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, TransactionIsolationLevel.READ_COMMITTED); | ||||||
|  |             syncDataChangeBustypesEntities.forEach(item -> syncDataChangeBustypesDao.insert(item)); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,17 @@ | |||||||
|  | <?xml version="1.0" encoding="UTF-8"?> | ||||||
|  | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||||
|  | <mapper namespace="com.glxp.api.dao.sync.SyncDataChangeBustypesDao"> | ||||||
|  |   <resultMap id="BaseResultMap" type="com.glxp.api.entity.sync.SyncDataChangeBustypesEntity"> | ||||||
|  |     <!--@mbg.generated--> | ||||||
|  |     <!--@Table sync_data_change_bustypes--> | ||||||
|  |     <id column="id" jdbcType="INTEGER" property="id" /> | ||||||
|  |     <result column="action" jdbcType="VARCHAR" property="action" /> | ||||||
|  |     <result column="name" jdbcType="VARCHAR" property="name" /> | ||||||
|  |     <result column="outChange" jdbcType="TINYINT" property="outChange" /> | ||||||
|  |     <result column="orderStatus" jdbcType="TINYINT" property="orderStatus" /> | ||||||
|  |   </resultMap> | ||||||
|  |   <sql id="Base_Column_List"> | ||||||
|  |     <!--@mbg.generated--> | ||||||
|  |     id, `action`, `name`, outChange, orderStatus | ||||||
|  |   </sql> | ||||||
|  | </mapper> | ||||||
					Loading…
					
					
				
		Reference in New Issue