| | |
| | | |
| | | select * from public.coal2000 order by gid limit 20; |
| | | select * from lf.sys_download |
| | | |
| | | select * from lf.sys_layer where pubid>0 |
| | | |
| | | |
| | | |
| | |
| | | -- insert into lf.sys_meta_pub (metaid,pubid) values (1399,1); |
| | | |
| | | select * from lf.sys_meta_pub; |
| | | ----------------------------------------------------------------------------------------------------- 38.数据发布-下载表 |
| | | -- drop table if exists lf.sys_pub_down; |
| | | create table lf.sys_pub_down( |
| | | id serial primary key, |
| | | pubid integer, |
| | | downid integer, |
| | | create_user integer default 1, |
| | | create_time timestamp(6) without time zone default now() |
| | | ); |
| | | comment on table lf.sys_pub_down is '数据发布-下载表'; |
| | | comment on column lf.sys_pub_down.id is '主键ID'; |
| | | comment on column lf.sys_pub_down.pubid is '数据发布ID'; |
| | | comment on column lf.sys_pub_down.downid is '下载ID'; |
| | | comment on column lf.sys_pub_down.create_user is '创建人ID'; |
| | | comment on column lf.sys_pub_down.create_time is '创建时间'; |
| | | |
| | | select * from lf.sys_pub_down; |
| | | ----------------------------------------------------------------------------------------------------- |
| | |
| | | public Integer inserts(List<PublishEntity> list); |
| | | |
| | | /** |
| | | * 插入数据发布-下载表 |
| | | * |
| | | * @param pubid |
| | | * @param downid |
| | | * @param createUser |
| | | * @return |
| | | */ |
| | | public Integer insertPubDown(Integer pubid, Integer downid, Integer createUser); |
| | | |
| | | /** |
| | | * 删除一条 |
| | | * |
| | | * @param id |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer insertPubDown(Integer pubid, Integer downid, Integer createUser) { |
| | | return publishMapper.insertPubDown(pubid, downid, createUser); |
| | | } |
| | | |
| | | @Override |
| | | public Integer delete(int id) { |
| | | return publishMapper.delete(id); |
| | | } |
| | |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.*; |
| | | import com.lf.server.service.data.DownloadService; |
| | | import com.lf.server.service.data.PublishService; |
| | | import com.lf.server.service.sys.DownlogService; |
| | | import net.lingala.zip4j.ZipFile; |
| | | import net.lingala.zip4j.model.ZipParameters; |
| | |
| | | public class InquiryService { |
| | | @Resource |
| | | PathHelper pathHelper; |
| | | |
| | | @Resource |
| | | PublishService publishService; |
| | | |
| | | @Resource |
| | | DownloadService downloadService; |
| | |
| | | String dbPwd = Md5Helper.reverse(Md5Helper.generate(dt.getPwd())); |
| | | DownloadEntity de = getDownloadEntity(ue, zipFile, dbPwd); |
| | | int rows = downloadService.insert(de); |
| | | if (de.getId() > 0) { |
| | | insertPubDown(pub, de, ue); |
| | | } |
| | | |
| | | return rows > 0 ? de.getGuid() : null; |
| | | } |
| | |
| | | |
| | | return de; |
| | | } |
| | | |
| | | /** |
| | | * 插入数据发布-下载表 |
| | | */ |
| | | private void insertPubDown(PublishEntity pub, DownloadEntity de, UserEntity ue) { |
| | | publishService.insertPubDown(pub.getId(), de.getId(), ue.getId()); |
| | | } |
| | | } |
| | |
| | | (#{regid},#{name},#{url},#{path},#{type},#{status},#{dirid},#{depid},#{min},#{max},#{json},#{createUser},now(),#{bak}) |
| | | </insert> |
| | | |
| | | <insert id="insertPubDown"> |
| | | insert into lf.sys_pub_down (pubid, downid, create_user) values (#{pubid}, #{downid}, #{createUser}) |
| | | </insert> |
| | | |
| | | <insert id="inserts"> |
| | | insert into lf.sys_publish |
| | | (regid,name,url,path,type,status,dirid,depid,min,max,json,create_user,create_time,bak) |