Просмотр исходного кода

Merge branch 'master' of ssh://10.10.101.21/source/platform-b2b into release-201823-hb

hejq 7 лет назад
Родитель
Сommit
2fd6d4d5e0
19 измененных файлов с 356 добавлено и 319 удалено
  1. 6 1
      src/main/java/com/uas/platform/b2b/controller/SaleNoticeController.java
  2. 16 6
      src/main/java/com/uas/platform/b2b/dao/PurchaseNoticeDao.java
  3. 16 7
      src/main/java/com/uas/platform/b2b/dao/SaleSendItemDao.java
  4. 2 2
      src/main/java/com/uas/platform/b2b/erp/controller/NotExistOrderController.java
  5. 2 2
      src/main/java/com/uas/platform/b2b/erp/model/APCheck.java
  6. 37 31
      src/main/java/com/uas/platform/b2b/erp/service/impl/PurchaseNotifyServiceImpl.java
  7. 0 5
      src/main/java/com/uas/platform/b2b/model/Product.java
  8. 2 2
      src/main/java/com/uas/platform/b2b/model/PurchaseNotice.java
  9. 15 0
      src/main/java/com/uas/platform/b2b/ps/ProductUtils.java
  10. 11 0
      src/main/java/com/uas/platform/b2b/service/PurchaseNoticeService.java
  11. 26 84
      src/main/java/com/uas/platform/b2b/service/impl/PurcOrderServiceImpl.java
  12. 0 4
      src/main/java/com/uas/platform/b2b/service/impl/PurchaseAcceptServiceImpl.java
  13. 125 22
      src/main/java/com/uas/platform/b2b/service/impl/PurchaseNoticeServiceImpl.java
  14. 32 0
      src/main/java/com/uas/platform/b2b/support/DecimalUtils.java
  15. 45 0
      src/main/java/com/uas/platform/b2b/support/SearchUtils.java
  16. 17 68
      src/main/java/com/uas/platform/b2b/temporary/model/ProductInfo.java
  17. 0 76
      src/main/java/com/uas/platform/b2b/temporary/model/UpdateByBatchParameter.java
  18. 3 8
      src/main/webapp/resources/js/index/app.js
  19. 1 1
      src/main/webapp/resources/tpl/index/purc/modal/purc_uplodaByBatch.html

+ 6 - 1
src/main/java/com/uas/platform/b2b/controller/SaleNoticeController.java

@@ -35,6 +35,7 @@ import javax.servlet.http.HttpServletRequest;
 import java.io.UnsupportedEncodingException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -207,7 +208,11 @@ public class SaleNoticeController {
 			}
 			pageParams.getFilters().put("pn_enuu", new MultiValue(list, true));
 		}
-		pageParams.getFilters().put("is_waiting", (short) Constant.YES);
+		pageParams.getFilters().put("is_waiting", Constant.YES);
+		// 排除已结案的数据
+		Map<String,Object> map = new HashMap<>(1);
+		map.put("pn_end", Constant.YES);
+        pageParams.setNotEqualFilters(map);
 		if (fromDate != null) {
 			pageParams.getFilters().put(SearchConstants.FROM_DATE_KEY, fromDate);
 		}

+ 16 - 6
src/main/java/com/uas/platform/b2b/dao/PurchaseNoticeDao.java

@@ -68,14 +68,15 @@ public interface PurchaseNoticeDao extends JpaSpecificationExecutor<PurchaseNoti
 	@Query("select count(n) from PurchaseNotice n where n.vendUU = :vendUU and n.status = :status and n.waiting = 0")
 	int getCountByVendUUAndStatus(@Param("vendUU") long vendUU, @Param("status") short status);
 
-	/**
-	 * 按发货单更新通知单的发货数
-	 * @param id 发货单id
-	 */
+    /**
+     * 按发货单更新通知单的发货数
+     * @param id 发货单id
+     * @param sendQty 已发货数量
+     */
 	@Modifying(clearAutomatically = true)
     @Transactional(rollbackFor = SQLException.class)
-	@Query("update PurchaseNotice n set n.endQty=(select sum(s.qty) from SaleSendItem s where s.notice=n) where n.id= :id")
-	void updateBySend(@Param("id") long id);
+	@Query("update PurchaseNotice n set n.endQty= :sendQty where n.id= :id")
+	void updateBySend(@Param("id") long id, @Param("sendQty") Double sendQty);
 	
 	/**
 	 * 根据截止日期获取(交货日期)
@@ -179,4 +180,13 @@ public interface PurchaseNoticeDao extends JpaSpecificationExecutor<PurchaseNoti
 	 */
 	@Query("select p.id from PurchaseNotice p where  p.date >= :date")
 	List<Long> findByDate( @Param("date") Date date);
+
+    /**
+     * 根据采购明细Id查询已发货的数量
+     *
+     * @param itemId 采购明细id
+     * @return
+     */
+    @Query("select sum(p.endQty) from PurchaseNotice p where p.orderItemId = :itemId")
+	Double getSendQtyByItemId(@Param("itemId") Long itemId);
 }

+ 16 - 7
src/main/java/com/uas/platform/b2b/dao/SaleSendItemDao.java

@@ -1,7 +1,6 @@
 package com.uas.platform.b2b.dao;
 
-import java.util.List;
-
+import com.uas.platform.b2b.model.SaleSendItem;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.Modifying;
@@ -10,10 +9,10 @@ import org.springframework.data.repository.query.Param;
 import org.springframework.stereotype.Repository;
 import org.springframework.transaction.annotation.Transactional;
 
-import com.uas.platform.b2b.model.SaleSendItem;
+import java.sql.SQLException;
+import java.util.List;
 
 @Repository
-@Transactional
 public interface SaleSendItemDao extends JpaSpecificationExecutor<SaleSendItem>, JpaRepository<SaleSendItem, Long> {
 
 	/**
@@ -40,6 +39,7 @@ public interface SaleSendItemDao extends JpaSpecificationExecutor<SaleSendItem>,
 	 */
 	@Modifying(clearAutomatically = true)
 	@Query("update SaleSendItem s set s.qty = :qty,s.replyRemark = :remark where s.id= :id")
+	@Transactional(rollbackFor = SQLException.class)
 	public void updateByReply(@Param("id") long id, @Param("qty") double qty, @Param("remark") String remark);
 	
 	/**
@@ -50,6 +50,7 @@ public interface SaleSendItemDao extends JpaSpecificationExecutor<SaleSendItem>,
 	@Modifying(clearAutomatically = true)
 	@Query(nativeQuery = true,
 		value = "update sale$senditem si set si_verifyqty = (select sum(siv_qty) from SALE$SENDITEMVERIFY siv where siv.SIV_SENDITEMID = si.SI_ID ), si_okqty = (select sum(siv_okqty) from SALE$SENDITEMVERIFY siv where siv.SIV_SENDITEMID = si.SI_ID ), si_notokqty = (select sum(siv_notokqty) from SALE$SENDITEMVERIFY siv where siv.SIV_SENDITEMID = si.SI_ID ) where si.si_id= :id")
+	@Transactional(rollbackFor = SQLException.class)
 	public void updateByVerify(@Param("id") long id);
 	
 	/**
@@ -76,8 +77,16 @@ public interface SaleSendItemDao extends JpaSpecificationExecutor<SaleSendItem>,
 	 */
 	@Modifying
 	@Query("update SaleSendItem s set s.packageQty = :packageQty,s.outBoxQty = :outBoxQty where s.id= :id")
-	public void updatePackageQty(@Param("id") long id, @Param("packageQty") Double packageQty, @Param("outBoxQty") Double outBoxQty);
-	
-	
+	@Transactional(rollbackFor = SQLException.class)
+	void updatePackageQty(@Param("id") long id, @Param("packageQty") Double packageQty, @Param("outBoxQty") Double outBoxQty);
+
+    /**
+     * 根据发货提醒id获取已发货数量
+     *
+     * @param noticeId 发货提醒id
+     * @return 该发货提醒已发货的数量
+     */
+	@Query("select sum(s.qty) from SaleSendItem s where s.noticeId= :noticeId")
+	Double getSendQtyByNoticeId(@Param("noticeId") Long noticeId);
 
 }

+ 2 - 2
src/main/java/com/uas/platform/b2b/erp/controller/NotExistOrderController.java

@@ -73,12 +73,12 @@ public class NotExistOrderController {
     }
 
     /**
-     * 获取平台不存在的单据信息,采购单明细
+     * 获取平台不存在的单据信息,委外单
      */
     @RequestMapping(value = "/makeMain", method = RequestMethod.GET)
     public List<NotExistOrders> findNotExistMakeMain() {
         List<NotExistOrders> orders = orderService.findByEnUUAndStatusAndType(SystemSession.getUser().getEnterprise().getUu(),
-                Status.NOT_UPLOAD.value(), OrderType.saleItem.name());
+                Status.NOT_UPLOAD.value(), OrderType.makeMain.name());
         logger.log("查询未上传订单", "查询未上传委外单", orders.size());
         return orders;
     }

+ 2 - 2
src/main/java/com/uas/platform/b2b/erp/model/APCheck.java

@@ -2,6 +2,7 @@ package com.uas.platform.b2b.erp.model;
 
 import com.uas.platform.b2b.model.PurchaseApCheck;
 import com.uas.platform.b2b.model.PurchaseApCheckItem;
+import com.uas.platform.b2b.support.DecimalUtils;
 import org.springframework.util.CollectionUtils;
 
 import java.util.*;
@@ -172,9 +173,8 @@ public class APCheck{
 		this.ac_remark = apCheck.getRemark();
 		this.ac_commitdate = apCheck.getCommitDate();
 		this.ac_status = apCheck.getStatus();
-		this.ac_checkamount = apCheck.getCheckAmount();
+		this.ac_checkamount = DecimalUtils.decimalPoint(apCheck.getCheckAmount(), 2);
 		this.ac_currency = apCheck.getCurrency();
-//		this.ac_rate = apCheck.getTaxrate();
 		this.ac_rate = apCheck.getRate();
 		this.ac_paymentname = apCheck.getPayments();
 		this.ac_custuu = apCheck.getCustUu();

+ 37 - 31
src/main/java/com/uas/platform/b2b/erp/service/impl/PurchaseNotifyServiceImpl.java

@@ -1,13 +1,19 @@
 package com.uas.platform.b2b.erp.service.impl;
 
 import com.uas.platform.b2b.core.util.SqlDateFormdateUtils;
-import com.uas.platform.b2b.dao.*;
+import com.uas.platform.b2b.dao.PurchaseNoticeDao;
+import com.uas.platform.b2b.dao.PurchaseOrderItemDao;
+import com.uas.platform.b2b.dao.SaleSendItemDao;
+import com.uas.platform.b2b.dao.SaleSendItemVerifyDao;
 import com.uas.platform.b2b.erp.model.AcceptNotify;
 import com.uas.platform.b2b.erp.model.AcceptNotifyConfirm;
 import com.uas.platform.b2b.erp.model.AcceptNotifyVerify;
 import com.uas.platform.b2b.erp.model.PurchaseNotify;
 import com.uas.platform.b2b.erp.service.PurchaseNotifyService;
-import com.uas.platform.b2b.model.*;
+import com.uas.platform.b2b.model.PurchaseNotice;
+import com.uas.platform.b2b.model.SaleSend;
+import com.uas.platform.b2b.model.SaleSendItem;
+import com.uas.platform.b2b.model.SaleSendItemVerify;
 import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.core.model.Status;
 import org.apache.commons.collections.CollectionUtils;
@@ -40,13 +46,11 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
 	@Autowired
 	private SaleSendItemVerifyDao saleSendItemVerifyDao;
     @Autowired
-    private CommunalLogDao communalLogDao;
-    @Autowired
     private JdbcTemplate jdbcTemplate;
 
 	@Override
 	public List<PurchaseNotice> convertPurchaseNotify(List<PurchaseNotify> notifies) {
-		List<PurchaseNotice> notices = new ArrayList<PurchaseNotice>();
+		List<PurchaseNotice> notices = new ArrayList<>();
 		for (PurchaseNotify notify : notifies) {
 			PurchaseNotice notice = notify.convert();
 			List<PurchaseNotice> existNotices = purchaseNoticeDao.findByEnUUAndSourceId(notice.getEnUU(),
@@ -72,23 +76,23 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
 				// 对卖家传输状态 // 待上传
 				existNotice.setSendStatus((short) Status.NOT_UPLOAD.value());
 				if (existNotice.getQty() != null && !existNotice.getQty().equals(notice.getQty())) {
-					if (existNotice.getEndQty() > notice.getQty()) {
-						// 已发货数大于新的需求数,修改平台上的需求数为已发货数,将已发货数量传回买家ERP修改发货提醒的数量
-						existNotice.setRemark(remark + dateString + "修改需求数量," + existNotice.getQty() + " -> "
-								+ existNotice.getEndQty());
+                    if (existNotice.getEndQty() > notice.getQty()) {
+                        // 已发货数大于新的需求数,修改平台上的需求数为已发货数,将已发货数量传回买家ERP修改发货提醒的数量
+                        existNotice.setRemark(remark + dateString + "修改需求数量," + existNotice.getQty() + " -> "
+                                + existNotice.getEndQty());
                         // 需求数量
-						existNotice.setQty(existNotice.getEndQty());
+                        existNotice.setQty(existNotice.getEndQty());
                         // 状态  已回复
-						existNotice.setStatus((short) Status.REPLIED.value());
-						notices.add(existNotice);
-					} else {
-						// 已发货数小于或等于新的需求数,修改平台上的需求数为新的需求数
-						existNotice.setRemark(
-								remark + dateString + "修改需求数量," + existNotice.getQty() + " -> " + notice.getQty());
-						existNotice.setQty(notice.getQty());
-						existNotice.setDelivery(notice.getDelivery());
-						notices.add(existNotice);
-					}
+                        existNotice.setStatus((short) Status.REPLIED.value());
+                        notices.add(existNotice);
+                    } else {
+                        // 已发货数小于或等于新的需求数,修改平台上的需求数为新的需求数
+                        existNotice.setRemark(
+                                remark + dateString + "修改需求数量," + existNotice.getQty() + " -> " + notice.getQty());
+                        existNotice.setQty(notice.getQty());
+                        existNotice.setDelivery(notice.getDelivery());
+                        notices.add(existNotice);
+                    }
 				} else {
 					String existDeliveryStr = "空";
 					String deliveryStr = "空";
@@ -100,7 +104,11 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
 					}
 					if (!existDeliveryStr.equals(deliveryStr)) {
 						existNotice.setRemark(remark + dateString + "修改交期," + existDeliveryStr + " -> " + deliveryStr);
-                        mergeWaitingStatus(existNotice.getId(), SqlDateFormdateUtils.DATE_FORMAT.format(notice.getDelivery()));
+                        Double ltinStock = 0.00;
+                        if (notice.getOrderItem() != null && notice.getOrderItem().getLtinstock() != null) {
+                            ltinStock = notice.getOrderItem().getLtinstock();
+                        }
+                        existNotice.setWaiting(getNoticeWaiting(SqlDateFormdateUtils.DATE_FORMAT.format(notice.getDelivery()), ltinStock));
 					}
 					existNotice.setDelivery(notice.getDelivery());
 					notices.add(existNotice);
@@ -111,20 +119,18 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
 	}
 
     /**
-     * 更新发货提醒备料状态
+     * 根据函数获取备料状态
      *
-     * @param noticeId 发货单id
-	 * @param deliveryStr 新的交货周期
+     * @param deliveryStr 格式化日期
+     * @param ltinStock 物料备料提前期
+     * @return
      */
-    private void mergeWaitingStatus(Long noticeId, String deliveryStr) {
-        String sql = "update purc$notice,purc$orderitems set is_waiting = PURC_NOTICE_WAIT_TO_SEND('" + deliveryStr + "', coalesce(pr_ltinstock, 0)) " +
-                "where pn_pdid = pd_id and pn_id = " + noticeId;
-        jdbcTemplate.execute(sql);
-        communalLogDao.save(new CommunalLog("更新发货提醒备料状态", "通过发货提醒更新备料状态", "发货单id: " + noticeId,
-                SystemSession.getUser().getEnterprise().getUu()));
+    private Short getNoticeWaiting(String deliveryStr, double ltinStock) {
+        String sql = String.format("select PURC_NOTICE_WAIT_TO_SEND('%s', %f)", deliveryStr, ltinStock);
+        Short waitStatus = jdbcTemplate.queryForObject(sql, Short.class);
+        return waitStatus;
     }
 
-
     /**
 	 * 将平台的发货提醒封装成ERP系统的发货提醒
 	 *

+ 0 - 5
src/main/java/com/uas/platform/b2b/model/Product.java

@@ -513,11 +513,6 @@ public class Product {
 		this.cmpUuId = cmpUuId;
 	}
 
-	@Override
-	public String toString() {
-		return "编号:" + getCode() + ",标题:" + getTitle() + ",规格型号:" + getSpec();
-	}
-
 	public String getSourceApp() {
 		return sourceApp;
 	}

+ 2 - 2
src/main/java/com/uas/platform/b2b/model/PurchaseNotice.java

@@ -85,7 +85,7 @@ public class PurchaseNotice implements Serializable {
 	/**
 	 * 客户采购单明细
 	 */
-	@OneToOne(cascade = {  }, fetch = FetchType.EAGER)
+	@OneToOne(fetch = FetchType.EAGER)
 	@JoinColumn(name = "pn_pdid", insertable = false, updatable = false)
 	private PurchaseOrderItem orderItem;
 
@@ -113,7 +113,7 @@ public class PurchaseNotice implements Serializable {
 	/**
 	 * 备货状态(1--是、0--否)
 	 */
-	@Column(name = "is_waiting", insertable = false, updatable = false)
+	@Column(name = "is_waiting")
 	private Short waiting;
 
 	/**

+ 15 - 0
src/main/java/com/uas/platform/b2b/ps/ProductUtils.java

@@ -10,6 +10,7 @@ import com.uas.platform.b2b.model.Product;
 import com.uas.platform.b2b.model.ProductInfo;
 import com.uas.platform.b2b.model.ProductUsers;
 import com.uas.platform.b2b.support.SysConf;
+import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.util.HttpUtil;
 import com.uas.platform.core.util.HttpUtil.Response;
@@ -628,4 +629,18 @@ public class ProductUtils {
         return null;
     }
 
+    /**
+     * 针对导入的物料信息批量验证
+     *
+     * @param productList 导入物料信息
+     */
+    public static Map<String, Object> checkImportProductList(List<com.uas.platform.b2b.temporary.model.ProductInfo> productList) throws Exception {
+        String res = HttpUtil.doPost(PRODUCT_PUBLIC_SERVICE_URL + "/product/checkImportProductList", FlexJsonUtils.toJsonDeep(productList));
+        if (null != res) {
+            Map<String, Object> map = JSON.parseObject(res);
+            return map;
+        } else {
+            throw new IllegalOperatorException("物料导入失败");
+        }
+    }
 }

+ 11 - 0
src/main/java/com/uas/platform/b2b/service/PurchaseNoticeService.java

@@ -344,4 +344,15 @@ public interface PurchaseNoticeService {
      * @return
      */
     SPage<PurchaseNotice> findAllNoticesByPageInfo(PageInfo pageInfo, String keyword, SearchFilter filter);
+
+	/**
+	 * 按条件查询发货提醒
+	 *
+	 * @param pageInfo 分页信息,过滤条件
+	 * @param keyword 搜索词
+	 * @param filter 过滤条件
+	 * @param state 状态
+	 * @return SPage封装的数据
+	 */
+    SPage<PurchaseNotice> findNoticesByPageInfo(PageInfo pageInfo, String keyword, SearchFilter filter, String state);
 }

+ 26 - 84
src/main/java/com/uas/platform/b2b/service/impl/PurcOrderServiceImpl.java

@@ -25,6 +25,7 @@ import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 @Service
 public class PurcOrderServiceImpl implements PurcOrderService {
@@ -120,28 +121,27 @@ public class PurcOrderServiceImpl implements PurcOrderService {
 	@Override
 	public ModelMap releaseByWorkbook(Workbook workbook) throws Exception {
 		ModelMap modelMap = new ModelMap();
-		List<String> alters = new ArrayList<String>();
-		List<ProductInfo> productInfos = new ArrayList<ProductInfo>();
+		List<String> alters = new ArrayList<>();
+		List<ProductInfo> productInfos = new ArrayList<>();
 		Sheet sheet = workbook.getSheetAt(0);
 		int rowNum = sheet.getLastRowNum();
 		Row headerRow = sheet.getRow(0);
+		int valueNum = 3;
 		int total = 0;
-		int success = 0;
 		if (headerRow != null) {
-			for (int r = 3; r <= rowNum; r++) {
+			for (int r = valueNum; r <= rowNum; r++) {
 			    int line = r + 1;
                 Row row = sheet.getRow(r);
 				if (row != null) {
 				    int failure =  0;
 					total++;
-					Product product = new Product();
 					ProductInfo productInfo = new ProductInfo();
 
 					// 商品名称
 					if (row.getCell(0) != null && row.getCell(0).getCellType() != Cell.CELL_TYPE_BLANK) {
 						row.getCell(0).setCellType(Cell.CELL_TYPE_STRING);
 						try {
-							product.setTitle(row.getCell(0).getStringCellValue().trim());
+                            productInfo.setTitle(row.getCell(0).getStringCellValue().trim());
 						} catch (Exception e) {
                             alters.add("第" + line + "行第" + 1 + "列名称格式不正确;");
                             failure++;
@@ -155,7 +155,7 @@ public class PurcOrderServiceImpl implements PurcOrderService {
 					if (row.getCell(1) != null) {
 						row.getCell(1).setCellType(Cell.CELL_TYPE_STRING);
 						try {
-							product.setCode(row.getCell(1).getStringCellValue().trim());
+                            productInfo.setCode(row.getCell(1).getStringCellValue().trim());
 						} catch (Exception e) {
                             alters.add("第" + line + "行第" + 2 + "列编号格式不正确;");
                             failure++;
@@ -166,7 +166,7 @@ public class PurcOrderServiceImpl implements PurcOrderService {
 					if (row.getCell(2) != null && row.getCell(2).getCellType() != Cell.CELL_TYPE_BLANK) {
 						row.getCell(2).setCellType(Cell.CELL_TYPE_STRING);
 						try {
-							product.setSpec(row.getCell(2).getStringCellValue().trim());
+                            productInfo.setSpec(row.getCell(2).getStringCellValue().trim());
 						} catch (Exception e) {
                             alters.add("第" + line + "行第" + 3 + "规格型号格式不正确;");
                             failure++;
@@ -180,7 +180,7 @@ public class PurcOrderServiceImpl implements PurcOrderService {
 					if (row.getCell(3) != null) {
 						row.getCell(3).setCellType(Cell.CELL_TYPE_STRING);
 						try {
-							product.setCmpCode(row.getCell(3).getStringCellValue().trim());
+                            productInfo.setCmpCode(row.getCell(3).getStringCellValue().trim());
 						} catch (Exception e) {
                             alters.add("第" + line + "行第" + 4 + "列原厂型号格式不正确;");
                             failure++;
@@ -242,16 +242,29 @@ public class PurcOrderServiceImpl implements PurcOrderService {
 						productInfo.setRemark(row.getCell(8).getStringCellValue());
 					}
 					if (failure == 0) {
-					    // 录入数据符合要求,进行物料处理
-						List<ProductInfo> productInfoList = (List<ProductInfo>) musterdProduct(product, productInfo, success).get("productInfos");
-                        productInfos.addAll(productInfoList);
-                        success = (Integer) musterdProduct(product, productInfo, success).get("success");
+                        productInfo.setEnUU(SystemSession.getUser().getEnterprise().getUu());
+                        productInfo.setUserUU(SystemSession.getUser().getUserUU());
+                        productInfo.setSourceApp("B2B");
+                        productInfo.setIsSale(Constant.YES);
+                        //设置默认单位
+                        productInfo.setUnit("PCS");
+                        //为了同步商城数据标准,标准字段也赋值
+                        productInfo.setPcmpcode(productInfo.getCmpCode());
+                        productInfo.setPbranden(productInfo.getPbranden() == null ? productInfo.getBrand() : productInfo.getPbranden());
+                        // 新增数据时间
+                        productInfo.setErpDate(new Date(System.currentTimeMillis()));
+                        productInfo.setStandard(Constant.NO);
+                        productInfo.setIsPurchase(Constant.YES);
+                        productInfos.add(productInfo);
                     }
 				}
 			}
             if (alters.size() > 0) {
                 modelMap.put("alters", alters);
             } else {
+                Map<String, Object> map = ProductUtils.checkImportProductList(productInfos);
+                productInfos = (List<ProductInfo>) map.get("products");
+                Integer success = (Integer) map.get("success");
                 if (!CollectionUtils.isEmpty(productInfos)) {
                     modelMap.put("products", productInfos);
                 }
@@ -262,77 +275,6 @@ public class PurcOrderServiceImpl implements PurcOrderService {
 		return modelMap;
 	}
 
-    /**
-     * 输入数据符合要求,进行其他处理操作
-     *
-     * @param product
-     * @param productInfo
-     * @param success
-     * @return
-     */
-    private ModelMap musterdProduct(Product product, ProductInfo productInfo, int success) {
-        List<ProductInfo> productInfos = new ArrayList<>();
-        ModelMap map = new ModelMap();
-        product.setEnUU(SystemSession.getUser().getEnterprise().getUu());
-        product.setUserUU(SystemSession.getUser().getUserUU());
-        product.setSourceApp("B2B");
-        product.setIsSale(Constant.YES);
-        if (product.getTitle() != null) {
-            //设置默认单位
-            product.setUnit("PCS");
-            //为了同步商城数据标准,标准字段也赋值
-            product.setPcmpcode(product.getCmpCode());
-            product.setPbranden(product.getPbranden() == null ? product.getBrand() : product.getPbranden());
-            // 新增数据时间
-            product.setErpDate(new Date(System.currentTimeMillis()));
-            product.setStandard(Constant.NO);
-            product.setIsPurchase(Constant.YES);
-            // 如果物料不存在,则进行存储
-            if (product.getCode() != null) {
-                List<Product> prods = ProductUtils.findByEnUUAndCode(SystemSession.getUser().getEnterprise().getUu(), product.getCode());
-                if (CollectionUtils.isEmpty(prods)) {
-                    try {
-                        Long prId = ProductUtils.updateOne(product);
-                        product.setId(prId);
-                        success++;
-                    } catch (Exception e) {
-
-                    }
-                } else {
-                    product = prods.get(0);
-                    success++;
-                }
-            } else {// 物料编码不存在
-                List<Product> prods = ProductUtils.findByEnUUAndTitle(SystemSession.getUser().getEnterprise().getUu(), product.getTitle());
-                if (CollectionUtils.isEmpty(prods)) {
-                    //生成随机编码
-                    SimpleDateFormat sdf = new SimpleDateFormat("yymmddhhmm_sss");
-                    product.setCode("prod" + sdf.format(new Date()));
-                    try {
-                        Long prId = ProductUtils.updateOne(product);
-                        product.setId(prId);
-                        success++;
-                    } catch (Exception e) {
-
-                    }
-                } else {
-                    product = prods.get(0);
-                    success++;
-                }
-            }
-            productInfo.setId(product.getId());
-            productInfo.setTitle(product.getTitle());
-            productInfo.setCode(product.getCode());
-            productInfo.setSpec(product.getSpec());
-            productInfo.setPrice(productInfo.getRateprice());
-            productInfo.setTotalprice(productInfo.getPrice() * productInfo.getAmount());
-            productInfos.add(productInfo);
-        }
-        map.put("productInfos", productInfos);
-        map.put("success", success);
-        return map;
-    }
-
     @Override
 	public ModelMap copyorder(Long id) {
 		PurchaseOrderAll order = purchaseOrderAllDao.findOne(id);

+ 0 - 4
src/main/java/com/uas/platform/b2b/service/impl/PurchaseAcceptServiceImpl.java

@@ -1,11 +1,9 @@
 package com.uas.platform.b2b.service.impl;
 
-import com.uas.platform.b2b.core.util.ContextUtils;
 import com.uas.platform.b2b.dao.PurcAcceptItemDao;
 import com.uas.platform.b2b.dao.PurchaseAcceptDao;
 import com.uas.platform.b2b.dao.PurchaseAcceptItemDao;
 import com.uas.platform.b2b.dao.PurchaseOrderItemDao;
-import com.uas.platform.b2b.event.PurchaseAcceptSaveReleaseEvent;
 import com.uas.platform.b2b.model.*;
 import com.uas.platform.b2b.search.SearchService;
 import com.uas.platform.b2b.service.PurchaseAcceptService;
@@ -71,8 +69,6 @@ public class PurchaseAcceptServiceImpl implements PurchaseAcceptService {
 				}
 			}
 		}
-		// 产生消息
-		ContextUtils.publishEvent(new PurchaseAcceptSaveReleaseEvent(PurchaseAcceptItem.distinct(acceptItems)));
 	}
 
 	@Override

+ 125 - 22
src/main/java/com/uas/platform/b2b/service/impl/PurchaseNoticeServiceImpl.java

@@ -6,15 +6,12 @@ import com.uas.platform.b2b.core.util.ThreadTask;
 import com.uas.platform.b2b.dao.*;
 import com.uas.platform.b2b.erp.model.PurchaseNotify;
 import com.uas.platform.b2b.event.SaleSendAcceptReleaseEvent;
-import com.uas.platform.b2b.event.SaleSendRefuseReleaseEvent;
 import com.uas.platform.b2b.model.*;
 import com.uas.platform.b2b.ps.service.PersonalProductService;
 import com.uas.platform.b2b.search.SearchService;
 import com.uas.platform.b2b.service.PurchaseNoticeService;
-import com.uas.platform.b2b.support.CollectionUtil;
-import com.uas.platform.b2b.support.SPageUtils;
-import com.uas.platform.b2b.support.SystemSession;
-import com.uas.platform.b2b.support.UsageBufferedLogger;
+import com.uas.platform.b2b.service.UserService;
+import com.uas.platform.b2b.support.*;
 import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.logging.BufferedLoggerManager;
 import com.uas.platform.core.model.Constant;
@@ -47,6 +44,7 @@ import java.util.*;
 public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
 
 	private final static UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
+
 	@Autowired
 	private PurchaseNoticeDao purchaseNoticeDao;
 
@@ -104,6 +102,9 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
 	@Autowired
 	private PurchaseNoticeEndDao noticeEndDao;
 
+	@Autowired
+    private UserService userService;
+
     /**
      * 最多数量
      */
@@ -241,7 +242,10 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
 		saleSendItemDao.save(sendItems);
 		for (SaleSendItem item : sendItems) {
 			if (item.getNoticeId() != null) {
-				purchaseNoticeDao.updateBySend(item.getNoticeId());
+			    Double sendQty = saleSendItemDao.getSendQtyByNoticeId(item.getNoticeId());
+				purchaseNoticeDao.updateBySend(item.getNoticeId(), sendQty);
+                logger.log("更新发货提醒发货数量", "ERP主动收料通知单/上传发货单更新发货提醒已发货数量",
+                        "发货单: " + item.getNoticeId() + ",更新数量: " + sendQty);
 				// 更新发货状态
 				updateNoticeStatus(item.getNoticeId());
 			}
@@ -472,18 +476,16 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
 
 	@Override
 	public void onSaleSendChange(List<SaleSendItem> sendItems) {
-		List<Long> ids = new ArrayList<>();
 		for (SaleSendItem item : sendItems) {
 			saleSendItemDao.updateByReply(item.getId(), item.getQty(), item.getReplyRemark());
 			if (item.getNoticeId() != null) {
-				purchaseNoticeDao.updateBySend(item.getNoticeId());
+			    Double sendQty = saleSendItemDao.getSendQtyByNoticeId(item.getNoticeId());
+				purchaseNoticeDao.updateBySend(item.getNoticeId(), sendQty);
+                logger.log("更新发货提醒发货数量", "ERP上传收料通知的确认数量更新发货提醒已发货数量",
+                        "发货单: " + item.getNoticeId() + ",更新数量: " + sendQty);
                 updateNoticeStatus(item.getNoticeId());
-				ids.add(item.getNoticeId());
 			}
 		}
-		List<PurchaseNotice> notices = purchaseNoticeDao.findAll(ids);
-		// 买家拒收之后给卖家发消息
-		ContextUtils.publishEvent(new SaleSendRefuseReleaseEvent(SaleSendItem.distinct(sendItems)));
 	}
 
     /**
@@ -1060,27 +1062,128 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
      */
     @Override
     public SPage<PurchaseNotice> findAllNoticesByPageInfo(final PageInfo pageInfo, String keyword, final SearchFilter filter) {
+		if (filter != null) {
+			if (!CollectionUtils.isEmpty(filter.getDistribute())) {
+				pageInfo.expression(PredicateUtils.in("enUU", filter.getDistribute(), false));
+			}
+			if (filter.getFromDate() != null) {
+				pageInfo.expression(PredicateUtils.gte("date", new Date(filter.getFromDate()), false));
+			}
+			if (filter.getEndDate() != null) {
+				pageInfo.expression(PredicateUtils.lte("date", new Date(filter.getEndDate()), false));
+			}
+		}
+		pageInfo.expression(PredicateUtils.isNull("end"));
         Page<PurchaseNotice> notices = purchaseNoticeDao.findAll(new Specification<PurchaseNotice>() {
             @Override
             public Predicate toPredicate(Root<PurchaseNotice> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
-                if (filter != null) {
-                    if (!CollectionUtils.isEmpty(filter.getDistribute())) {
-                        pageInfo.expression(PredicateUtils.in("enUU", filter.getDistribute(), false));
+                List<Predicate> predicatesList = new ArrayList<Predicate>();
+                if (!StringUtils.isEmpty(keyword)) {
+					Predicate custName = builder.like(root.get("orderItem").get("order").get("enterprise").get("enName"), "%" + keyword+ "%");
+                    if (keyword.matches(SearchUtils.UU_REGEXP)) {
+                        Predicate custUU = builder.like(root.get("orderItem").get("order").get("enterprise").get("uu"), "%" + keyword+ "%");
+                        builder.or(custUU);
                     }
-                    if (filter.getFromDate() != null) {
-                        pageInfo.expression(PredicateUtils.gte("date", new Date(filter.getFromDate()), false));
-                    }
-                    if (filter.getEndDate() != null) {
-                        pageInfo.expression(PredicateUtils.lte("date", new Date(filter.getEndDate()), false));
+					Predicate productCode = builder.like(root.get("orderItem").get("productCode"), "%" + keyword+ "%");
+                    Predicate productTitle = builder.like(root.get("orderItem").get("productTitle"), "%" + keyword+ "%");
+                    Predicate productSpec = builder.like(root.get("orderItem").get("productSpec"), "%" + keyword+ "%");
+                    Predicate orderCode = builder.like(root.get("orderItem").get("order").get("code"), "%" + keyword+ "%");
+                    predicatesList.add(builder.or(custName, productCode, productTitle, productSpec, orderCode));
+				}
+                Predicate[] predicates = pageInfo.getPredicates(root, query, builder);
+                Arrays.stream(predicates).forEach(predicate -> {
+                    predicatesList.add(predicate);
+                });
+                return builder.and(predicatesList.toArray(new Predicate[predicatesList.size()]));
+            }
+        }, pageInfo);
+        return SPageUtils.covertSPage(notices);
+    }
+
+    /**
+     * 按条件查询发货提醒
+     *
+     * @param pageInfo  分页信息,过滤条件
+     * @param keyword   搜索词
+     * @param filter    过滤条件
+     * @param state 状态
+     * @return SPage封装的数据
+     */
+    @Override
+    public SPage<PurchaseNotice> findNoticesByPageInfo(PageInfo pageInfo, String keyword, SearchFilter filter, String state) {
+        // 根据状态设置其他条件
+        setState(pageInfo, state, filter);
+        if (filter != null) {
+            if (!CollectionUtils.isEmpty(filter.getDistribute())) {
+                pageInfo.expression(PredicateUtils.in("enUU", filter.getDistribute(), false));
+            }
+            if (filter.getFromDate() != null) {
+                pageInfo.expression(PredicateUtils.gte("date", new Date(filter.getFromDate()), false));
+            }
+            if (filter.getEndDate() != null) {
+                pageInfo.expression(PredicateUtils.lte("date", new Date(filter.getEndDate()), false));
+            }
+        }
+        Page<PurchaseNotice> notices = purchaseNoticeDao.findAll(new Specification<PurchaseNotice>() {
+            @Override
+            public Predicate toPredicate(Root<PurchaseNotice> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
+                List<Predicate> predicatesList = new ArrayList<Predicate>();
+                if (!StringUtils.isEmpty(keyword)) {
+                    Predicate custName = builder.like(root.get("orderItem").get("order").get("enterprise").get("enName"), "%" + keyword+ "%");
+                    if (keyword.matches(SearchUtils.UU_REGEXP)) {
+                        Predicate custUU = builder.like(root.get("orderItem").get("order").get("enterprise").get("uu"), "%" + keyword+ "%");
+                        builder.or(custUU);
                     }
+                    Predicate productCode = builder.like(root.get("orderItem").get("productCode"), "%" + keyword+ "%");
+                    Predicate productTitle = builder.like(root.get("orderItem").get("productTitle"), "%" + keyword+ "%");
+                    Predicate productSpec = builder.like(root.get("orderItem").get("productSpec"), "%" + keyword+ "%");
+                    Predicate orderCode = builder.like(root.get("orderItem").get("order").get("code"), "%" + keyword+ "%");
+                    predicatesList.add(builder.or(custName, productCode, productTitle, productSpec, orderCode));
                 }
-                pageInfo.expression(PredicateUtils.isNull("end"));
-                return query.where(pageInfo.getPredicates(root, query, builder)).getRestriction();
+                Predicate[] predicates = pageInfo.getPredicates(root, query, builder);
+                Arrays.stream(predicates).forEach(predicate -> {
+                    predicatesList.add(predicate);
+                });
+                return builder.and(predicatesList.toArray(new Predicate[predicatesList.size()]));
             }
         }, pageInfo);
         return SPageUtils.covertSPage(notices);
     }
 
+    /**
+     * 封装相关查询条件
+     *
+     * @param pageInfo 分页参数
+     * @param state 状态
+     *              <pre>
+     *              _todo : 待发货
+     *              done: 已发货
+     *              end: 已取消
+     *              </pre>
+     * @param filter 过滤条件
+     */
+    private void setState(PageInfo pageInfo, String state, SearchFilter filter) {
+        pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
+        SearchFilter distribute = userService.distribute();
+        if (distribute != null && !CollectionUtils.isEmpty(distribute.getDistribute())) {
+            List<Object> list = new ArrayList<>();
+            list.addAll(distribute.getDistribute());
+            filter.setDistribute(list);
+        }
+        if (SearchUtils.TODO_STATE.equals(state)) {
+            pageInfo.expression(PredicateUtils.or(PredicateUtils.isNull("end"), PredicateUtils.eq("end", Constant.NO, false)));
+            pageInfo.filter("status", (short)Status.NOT_REPLY.value());
+            pageInfo.filter("waiting", Constant.NO);
+        } else if (SearchUtils.DONE_STATE.equals(state)) {
+            pageInfo.expression(PredicateUtils.or(PredicateUtils.isNull("end"), PredicateUtils.eq("end", Constant.NO, false)));
+            pageInfo.filter("status", (short)Status.REPLIED.value());
+        } else if (SearchUtils.END_STATE.equals(state)) {
+            pageInfo.filter("end", Constant.YES);
+        } else if (SearchUtils.WAITING_STATE.equals(state)) {
+            pageInfo.filter("waiting", Constant.YES);
+        }
+    }
+
     @Override
 	@Transactional(rollbackFor = Exception.class)
 	public void setReadByOrder(String category, Long[] sourceId) {

+ 32 - 0
src/main/java/com/uas/platform/b2b/support/DecimalUtils.java

@@ -0,0 +1,32 @@
+package com.uas.platform.b2b.support;
+
+import java.text.DecimalFormat;
+
+/**
+ * 平台数据小数点处理方式
+ *
+ * @author hejq
+ * @date 2018-08-16 15:30
+ */
+public class DecimalUtils {
+
+    /**
+     * 小数分割
+     *      <pre>
+     *          默认会四舍五入
+     *      </pre>
+     * @param oldValue 原值
+     * @param digit 小数点
+     * @return 返回处理后的数据
+     */
+    public static Double decimalPoint(Double oldValue, Integer digit) {
+        if (null != oldValue) {
+            String str = "#.###############";
+            String digitStr = str.substring(0, (2 + digit));
+            DecimalFormat decimalFormat = new java.text.DecimalFormat(digitStr);
+            return Double.valueOf(decimalFormat.format(oldValue));
+        } else {
+            return 0.00;
+        }
+    }
+}

+ 45 - 0
src/main/java/com/uas/platform/b2b/support/SearchUtils.java

@@ -0,0 +1,45 @@
+package com.uas.platform.b2b.support;
+
+/**
+ * 搜索相关
+ *
+ * @author hejq
+ * @date 2018-08-13 18:54
+ */
+public class SearchUtils {
+
+    /**
+     * UU号正则表达式
+     */
+    public static final String UU_REGEXP = "^\\d{4,}$";
+
+    /**
+     * 数字正则表达式
+     */
+    public static final String NUM_REGEXP= "^[0-9]*$";
+
+    /**
+     * 待处理
+     */
+    public static final String TODO_STATE = "todo";
+
+    /**
+     * 全部
+     */
+    public static final String ALL_STATE = "all";
+
+    /**
+     * 已处理
+     */
+    public static final String DONE_STATE = "done";
+
+    /**
+     * 已结案,已取消
+     */
+    public static final String END_STATE = "end";
+
+    /**
+     * 待发货
+     */
+    public static final String WAITING_STATE = "waiting";
+}

+ 17 - 68
src/main/java/com/uas/platform/b2b/temporary/model/ProductInfo.java

@@ -1,5 +1,7 @@
 package com.uas.platform.b2b.temporary.model;
 
+import com.uas.platform.b2b.model.Product;
+
 import java.util.Date;
 
 /**
@@ -8,33 +10,18 @@ import java.util.Date;
  * @author hejq
  * @time 创建时间:2017年5月17日
  */
-public class ProductInfo {
-
-	/**
-	 * id
-	 */
-	private Long id;
-
-	/**
-	 * 商品信息标题
-	 */
-	private String title;
-
-	/**
-	 * 产品编号
-	 */
-	private String code;
-
-	/**
-	 * 产品规格
-	 */
-	private String spec;
+public class ProductInfo extends Product {
 
 	/**
 	 * 数量
 	 */
 	private Double amount;
 
+    /**
+     * 不含税单价
+     */
+    private Double unitPrice;
+
 	/**
 	 * 税率
 	 */
@@ -45,11 +32,6 @@ public class ProductInfo {
 	 */
 	private Double rateprice;
 
-	/**
-	 * 不含税单价
-	 */
-	private Double price;
-
 	/**
 	 * 不含税总额
 	 */
@@ -65,38 +47,6 @@ public class ProductInfo {
 	 */
 	private String remark;
 
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public String getTitle() {
-		return title;
-	}
-
-	public void setTitle(String title) {
-		this.title = title;
-	}
-
-	public String getCode() {
-		return code;
-	}
-
-	public void setCode(String code) {
-		this.code = code;
-	}
-
-	public String getSpec() {
-		return spec;
-	}
-
-	public void setSpec(String spec) {
-		this.spec = spec;
-	}
-
 	public Double getAmount() {
 		return amount;
 	}
@@ -113,7 +63,15 @@ public class ProductInfo {
 		this.rate = rate;
 	}
 
-	public Double getRateprice() {
+    public Double getUnitPrice() {
+        return unitPrice;
+    }
+
+    public void setUnitPrice(Double unitPrice) {
+        this.unitPrice = unitPrice;
+    }
+
+    public Double getRateprice() {
 		return rateprice;
 	}
 
@@ -121,14 +79,6 @@ public class ProductInfo {
 		this.rateprice = rateprice;
 	}
 
-	public Double getPrice() {
-		return price;
-	}
-
-	public void setPrice(Double price) {
-		this.price = price;
-	}
-
 	public Double getTotalprice() {
 		return totalprice;
 	}
@@ -152,5 +102,4 @@ public class ProductInfo {
 	public void setRemark(String remark) {
 		this.remark = remark;
 	}
-
 }

+ 0 - 76
src/main/java/com/uas/platform/b2b/temporary/model/UpdateByBatchParameter.java

@@ -1,76 +0,0 @@
-package com.uas.platform.b2b.temporary.model;
-
-/**
- * 批量修改传递的参数设置
- * 
- * @author hejq
- * @time 创建时间:2017年6月9日
- */
-public class UpdateByBatchParameter {
-
-	/**
-	 * 修改的字段类型
-	 */
-	private String updatetype;
-
-	/**
-	 * 需要修改的来源类型(销售、采购、总物料)
-	 */
-	private String type;
-
-	/**
-	 * 标准类型(all:全部; standard:标准; nonstandard: 非标准)
-	 */
-	private String standard;
-
-	/**
-	 * 原值
-	 */
-	private String oldvalue;
-
-	/**
-	 * 新值
-	 */
-	private String newvalue;
-
-	public String getUpdatetype() {
-		return updatetype;
-	}
-
-	public void setUpdatetype(String updatetype) {
-		this.updatetype = updatetype;
-	}
-
-	public String getType() {
-		return type;
-	}
-
-	public void setType(String type) {
-		this.type = type;
-	}
-
-	public String getStandard() {
-		return standard;
-	}
-
-	public void setStandard(String standard) {
-		this.standard = standard;
-	}
-
-	public String getOldvalue() {
-		return oldvalue;
-	}
-
-	public void setOldvalue(String oldvalue) {
-		this.oldvalue = oldvalue;
-	}
-
-	public String getNewvalue() {
-		return newvalue;
-	}
-
-	public void setNewvalue(String newvalue) {
-		this.newvalue = newvalue;
-	}
-
-}

+ 3 - 8
src/main/webapp/resources/js/index/app.js

@@ -14421,7 +14421,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                         unit: 'PCS',
                         spec: prod.spec,
                         qty: prod.amount,
-                        price: prod.price,
+                        price: prod.rateprice,
                         remark: prod.remark,
                         delivery: prod.date,
                         prid: prod.id,
@@ -14429,7 +14429,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                         prodsource: 'purchaser'
                     });
                 })
-
             }, function () {
 
             });
@@ -14590,12 +14589,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         };
 
         $scope.enSure = function () {
-            $modalInstance.close($scope.result.products);
-        }
-
-        // 点击确定时增加加载标志
-        $scope.addClass = function() {
             $scope.loading = true;
+            $modalInstance.close($scope.result.products);
         }
 
         $scope.cancel = function () {
@@ -16149,7 +16144,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                         unit: 'PCS',
                         spec: prod.spec,
                         qty: prod.amount,
-                        price: prod.price,
+                        price: prod.rateprice,
                         remark: prod.remark,
                         delivery: prod.date,
                         prid: prod.id,

+ 1 - 1
src/main/webapp/resources/tpl/index/purc/modal/purc_uplodaByBatch.html

@@ -67,7 +67,7 @@
 </div>
 <div class="modal-footer Deputy">
 	<div class="text-center">
-		<button class="btn btn-success btn-sm" ng-click=" addClass(); enSure()" type="button">确定</button>
+		<button class="btn btn-success btn-sm" ng-click="enSure()" type="button">确定</button>
 		<button class="btn btn-danger btn-sm" ng-click="cancel()" type="button">取消</button>
 	</div>
 </div>