|
|
@@ -7,6 +7,7 @@ import javax.persistence.criteria.CriteriaQuery;
|
|
|
import javax.persistence.criteria.Predicate;
|
|
|
import javax.persistence.criteria.Root;
|
|
|
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
@@ -15,6 +16,7 @@ import org.springframework.stereotype.Service;
|
|
|
import com.uas.platform.b2b.dao.PurchaseNoticeDao;
|
|
|
import com.uas.platform.b2b.dao.SaleSendDao;
|
|
|
import com.uas.platform.b2b.dao.SaleSendItemDao;
|
|
|
+import com.uas.platform.b2b.erp.model.PurchaseNotify;
|
|
|
import com.uas.platform.b2b.model.PurchaseNotice;
|
|
|
import com.uas.platform.b2b.model.PurchaseOrder;
|
|
|
import com.uas.platform.b2b.model.SaleSend;
|
|
|
@@ -22,6 +24,7 @@ import com.uas.platform.b2b.model.SaleSendItem;
|
|
|
import com.uas.platform.b2b.service.PurchaseNoticeService;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
import com.uas.platform.b2b.support.XingePusher;
|
|
|
+import com.uas.platform.core.model.Constant;
|
|
|
import com.uas.platform.core.model.PageInfo;
|
|
|
import com.uas.platform.core.model.Status;
|
|
|
|
|
|
@@ -45,12 +48,11 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
PurchaseOrder order = notice.getOrderItem().getOrder();
|
|
|
if (order.getVendUserUU() != null) {
|
|
|
// Android
|
|
|
- XingePusher.pushSingleAccountAndroid(order.getVendUserUU().toString(), "新增一个送货提醒-",
|
|
|
- "单号:" + notice.getCode() + ",客户:" + order.getEnterprise().getEnName(),
|
|
|
- "com.sas.mobile.activity.PurchaseChangeActivity");
|
|
|
+ XingePusher.pushSingleAccountAndroid(order.getVendUserUU().toString(), "新增一个送货提醒-", "单号:" + notice.getCode() + ",客户:"
|
|
|
+ + order.getEnterprise().getEnName(), "com.sas.mobile.activity.PurchaseChangeActivity");
|
|
|
// IOS
|
|
|
- XingePusher.pushSingleAccountIOS(order.getVendUserUU().toString(),
|
|
|
- "新增一个送货提醒-" + "单号:" + notice.getCode() + ",客户:" + order.getEnterprise().getEnName());
|
|
|
+ XingePusher.pushSingleAccountIOS(order.getVendUserUU().toString(), "新增一个送货提醒-" + "单号:" + notice.getCode() + ",客户:"
|
|
|
+ + order.getEnterprise().getEnName());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -105,14 +107,12 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
|
|
|
@Override
|
|
|
public List<SaleSend> findNotUploadSend() {
|
|
|
- return saleSendDao.findByCustUUAndSendStatus(SystemSession.getUser().getEnterprise().getUu(),
|
|
|
- (short) Status.NOT_UPLOAD.value());
|
|
|
+ return saleSendDao.findByCustUUAndSendStatus(SystemSession.getUser().getEnterprise().getUu(), (short) Status.NOT_UPLOAD.value());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<SaleSend> findNotSendSend() {
|
|
|
- return saleSendDao.findByEnUUAndBackStatus(SystemSession.getUser().getEnterprise().getUu(),
|
|
|
- (short) Status.NOT_UPLOAD.value());
|
|
|
+ return saleSendDao.findByEnUUAndBackStatus(SystemSession.getUser().getEnterprise().getUu(), (short) Status.NOT_UPLOAD.value());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -137,4 +137,34 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void end(List<PurchaseNotify> notifies) {
|
|
|
+ long enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
|
+ for (PurchaseNotify notify : notifies) {
|
|
|
+ List<PurchaseNotice> notices = purchaseNoticeDao.findByEnUUAndCode(enUU, notify.getPn_code());
|
|
|
+ if (!CollectionUtils.isEmpty(notices)) {
|
|
|
+ PurchaseNotice notice = notices.get(0);
|
|
|
+ notice.setEnd(Constant.YES);
|
|
|
+ notice.setEndStatus((short) Status.NOT_UPLOAD.value());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<PurchaseNotice> findNotSendEnd() {
|
|
|
+ return purchaseNoticeDao.findByVendUUAndEndAndEndStatus(SystemSession.getUser().getEnterprise().getUu(), Constant.YES,
|
|
|
+ (short) Status.NOT_UPLOAD.value());
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onEndDownSuccess(String[] idArray) {
|
|
|
+ for (String id : idArray) {
|
|
|
+ PurchaseNotice notice = purchaseNoticeDao.findOne(Long.parseLong(id));
|
|
|
+ if (notice != null) {
|
|
|
+ notice.setEndStatus((short) Status.DOWNLOADED.value());
|
|
|
+ purchaseNoticeDao.save(notice);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|