|
|
@@ -1,19 +1,10 @@
|
|
|
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.*;
|
|
|
-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 com.uas.platform.b2b.model.PurchaseNotice;
|
|
|
+import com.uas.platform.b2b.model.PurchaseOrderItem;
|
|
|
import org.junit.Test;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -135,64 +126,4 @@ public class PurchaseNotify extends BaseJunitTest {
|
|
|
return notice;
|
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
- public void test() {
|
|
|
- PageParams params = new PageParams();
|
|
|
- params.setCount(20);
|
|
|
- params.setPage(1);
|
|
|
- PageInfo pageInfo = new PageInfo(params);
|
|
|
- Page<Product> productPage = ProductUtils.findByPageInfo(pageInfo, null);
|
|
|
- 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));
|
|
|
- }
|
|
|
}
|