|
|
@@ -1,14 +1,18 @@
|
|
|
package com.uas.platform.b2b.purc;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.uas.platform.b2b.BaseJunitTest;
|
|
|
+import com.uas.platform.b2b.dao.CommunalLogDao;
|
|
|
import com.uas.platform.b2b.dao.PurchaseNoticeDao;
|
|
|
+import com.uas.platform.b2b.dao.PurchaseNoticeEndDao;
|
|
|
import com.uas.platform.b2b.dao.PurchaseOrderItemDao;
|
|
|
-import com.uas.platform.b2b.model.Product;
|
|
|
-import com.uas.platform.b2b.model.PurchaseNotice;
|
|
|
-import com.uas.platform.b2b.model.PurchaseOrderItem;
|
|
|
+import com.uas.platform.b2b.model.*;
|
|
|
import com.uas.platform.b2b.ps.ProductUtils;
|
|
|
+import com.uas.platform.b2b.support.CollectionUtil;
|
|
|
+import com.uas.platform.core.model.Constant;
|
|
|
import com.uas.platform.core.model.PageInfo;
|
|
|
import com.uas.platform.core.model.PageParams;
|
|
|
+import com.uas.platform.core.model.Status;
|
|
|
import com.uas.sso.support.Page;
|
|
|
import org.junit.Test;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -141,4 +145,54 @@ public class PurchaseNotify extends BaseJunitTest {
|
|
|
System.out.println(productPage);
|
|
|
}
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PurchaseNoticeEndDao noticeEndDao;
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void end() {
|
|
|
+ List<com.uas.platform.b2b.erp.model.PurchaseNotify> notifies = new ArrayList<>();
|
|
|
+ com.uas.platform.b2b.erp.model.PurchaseNotify notify = new com.uas.platform.b2b.erp.model.PurchaseNotify();
|
|
|
+ notify.setPn_id(21819L);
|
|
|
+ notifies.add(notify);
|
|
|
+ notify = new com.uas.platform.b2b.erp.model.PurchaseNotify();
|
|
|
+ notify.setPn_id(23145L);
|
|
|
+ notifies.add(notify);
|
|
|
+ notify = new com.uas.platform.b2b.erp.model.PurchaseNotify();
|
|
|
+ notify.setPn_id(23447L);
|
|
|
+ notifies.add(notify);
|
|
|
+ notify = new com.uas.platform.b2b.erp.model.PurchaseNotify();
|
|
|
+ notify.setPn_id(23568L);
|
|
|
+ notifies.add(notify);
|
|
|
+ notify = new com.uas.platform.b2b.erp.model.PurchaseNotify();
|
|
|
+ notify.setPn_id(24207L);
|
|
|
+ notifies.add(notify);
|
|
|
+ notify = new com.uas.platform.b2b.erp.model.PurchaseNotify();
|
|
|
+ notify.setPn_id(24304L);
|
|
|
+ notifies.add(notify);
|
|
|
+ Long enUU = 10041166L;
|
|
|
+ List<Long> idList = CollectionUtil.getKeyCollection(notifies);
|
|
|
+ List<PurchaseNoticeEnd> noticeList = noticeEndDao.findByEnUUAndSourceIdList(enUU, idList);
|
|
|
+ noticeList.forEach(notice -> {
|
|
|
+ notice.setEnd(Constant.YES);
|
|
|
+ notice.setEndStatus((short) Status.DOWNLOADED.value());
|
|
|
+ notice.setErpDate(new Date(System.currentTimeMillis()));
|
|
|
+ });
|
|
|
+ noticeList = noticeEndDao.save(noticeList);
|
|
|
+ System.out.println(JSON.toJSONString(noticeList));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CommunalLogDao logDao;
|
|
|
+ @Test
|
|
|
+ @Transactional(rollbackFor = RuntimeException.class)
|
|
|
+ public void jpaSave() {
|
|
|
+ CommunalLog log = logDao.findOne(11868L);
|
|
|
+ /*log.setDetail("测试JPA保存");
|
|
|
+ log.setEnUU(10041166L);
|
|
|
+ log.setTitle("测试JPA");
|
|
|
+ log.setTime(System.currentTimeMillis());
|
|
|
+ log.setUserUU(1000001615L);
|
|
|
+ log = logDao.save(log);*/
|
|
|
+ System.out.println(JSON.toJSONString(log));
|
|
|
+ }
|
|
|
}
|