| | |
| | | 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()); |
| | | } |
| | | } |