Browse Source

Merge branch 'dev-mysql' into erp_batchToGoods_20180117

yujia 8 years ago
parent
commit
82e9dbbf48

+ 5 - 0
pom.xml

@@ -452,6 +452,11 @@
 			<artifactId>ps-entity</artifactId>
 			<version>0.0.1-SNAPSHOT</version>
 		</dependency>
+		<dependency>
+			<groupId>com.uas.ps</groupId>
+			<artifactId>ps-entity</artifactId>
+			<version>0.0.1-SNAPSHOT</version>
+		</dependency>
 		<!--Hutool POI工具类(对MS Office操作)-->
 		<!--<dependency>
 			<groupId>org.apache.poi</groupId>

+ 26 - 9
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java

@@ -16,10 +16,7 @@ import com.uas.platform.b2c.prod.commodity.constant.DoubleConstant;
 import com.uas.platform.b2c.prod.commodity.constant.ErrorInfoConstant;
 import com.uas.platform.b2c.prod.commodity.constant.ShortConstant;
 import com.uas.platform.b2c.prod.commodity.constant.UploadConstant;
-import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
-import com.uas.platform.b2c.prod.commodity.dao.ProductDao;
-import com.uas.platform.b2c.prod.commodity.dao.ProductPrivateDao;
-import com.uas.platform.b2c.prod.commodity.dao.ReleaseProductByBatchDao;
+import com.uas.platform.b2c.prod.commodity.dao.*;
 import com.uas.platform.b2c.prod.commodity.model.*;
 import com.uas.platform.b2c.prod.commodity.service.GoodsService;
 import com.uas.platform.b2c.prod.commodity.service.ReleaseProductByBatchService;
@@ -106,6 +103,9 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 	@Autowired
 	private ProductPrivateDao productPrivateDao;
 
+    @Autowired
+    private ProductPersonDao productPersonDao;
+
 	@Value("#{sys.productServiceIp}")
 	private String productServiceIp;
 
@@ -200,14 +200,28 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 				}
 			}
 		}
+		Long userUU = SystemSession.getUser().getUserUU();
+		Long enUU = SystemSession.getUser().getEnterprise().getUu();
 		List<ReleaseProductByBatch> addList = new ArrayList<>(releaseProductByBatchs.size());
 		addList.addAll(releaseProductByBatchs);
-		if (!isAPerson) {
-			resetRepeatData(addList);
+		resetRepeatData(addList, isAPerson);
+		if (isAPerson) {
+			for (ReleaseProductByBatch releaseProductByBatch : addList) {
+				List<Product> productList = productDao.findByEnUUAndPcmpcodeAndPbrandenAndB2cEnabled(enUU,releaseProductByBatch.getB2cCode(),
+						releaseProductByBatch.getB2cBranden(),IntegerConstant.YES_SHORT);
+				if (!CollectionUtils.isEmpty(productList)) {
+				    List<ProductPerson> productPersonList = productPersonDao.findByProductId(productList.get(0).getId());
+				    if (!CollectionUtils.isEmpty(productPersonList)) {
+                        releaseProductByBatch.setErrmsg(ErrorInfoConstant.REPEAT_INFO.getInfo());
+                        releaseProductByBatch.setReleaseCode(ReleaseStatus.had_exists.value());
+                        releaseProductByBatch.setReleaseStatus(ReleaseStatus.had_exists.getPhrase());
+                        total --;
+                    }
+				}
+			}
 		}
 		commonDao.save(addList, ReleaseProductByBatch.class);
-		Long userUU = SystemSession.getUser().getUserUU();
-		Long enUU = SystemSession.getUser().getEnterprise().getUu();
+
 		releaseProductByBatchDao.callValidProcedure(enUU, batch);
 		Integer filter = releaseProductByBatchDao.getCountOfImportFail(userUU, batch, failCode);
 		Integer failure = releaseProductByBatchDao.getCountPublisherUuAndBatchAndReleaseCode(userUU, batch, ReleaseStatus.failure.value());
@@ -224,7 +238,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 	 * 判断是否重复,重复则重设状态
 	 * @param data
 	 */
-	private void resetRepeatData(List<ReleaseProductByBatch> data) {
+	private void resetRepeatData(List<ReleaseProductByBatch> data, boolean isAPerson) {
 		Long enuu = SystemSession.getUser().getEnterprise() != null ? SystemSession.getUser().getEnterprise().getUu() : null;
 		if (enuu == null) {
 			throw new IllegalOperatorException("企业enuu丢失");
@@ -235,6 +249,9 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 				each.setB2cBranden(standardList.get(0).getPbranden());
 				each.setB2cCode(standardList.get(0).getPcmpcode());
 			}
+			if (isAPerson) {
+				continue;
+			}
 			List<Product> productList = productDao.findByEnUUAndPcmpcodeAndPbrandenAndB2cEnabled(enuu, each.getB2cCode(), each.getB2cBranden(), IntegerConstant.YES_SHORT);
 			if (!CollectionUtils.isEmpty(productList)) {
 				List<Goods> goodsList = goodsDao.findRepeatGoodsInProductId(productList.get(0).getId(), each.getProductDate(), each.getPackaging(), each.getMinPackage(), each.getMinBuyQty(), each.getSelfMaxDelivery(), each.getSelfMinDelivery(), each.getUnit());

BIN
src/main/resources/jxls-tpl/trade/releaseByBatchError-person.xls


+ 1 - 1
src/main/resources/prod/sys.properties

@@ -42,7 +42,7 @@ searchUrl=http://10.10.0.76:8081
 # message ip
 messageServiceIp=http://message.ubtob.com/
 # product public ip
-productServiceIp=http://192.168.253.12:24000
+productServiceIp=http://10.10.0.197:8080
 
 # Kafka
 kafka-bootstrap-servers=10.10.100.11:9292,10.10.100.12:9292,10.10.100.13:9292,10.10.100.14:9292,10.10.100.15:9292,10.10.100.16:9292

+ 1 - 1
src/main/webapp/resources/css/commonComponent.css

@@ -1,6 +1,6 @@
 /*---------------------提示框样式 start---------------------*/
 /*示例:
-<div class="com-del-box">
+<div class="com-mall-del-box">
     <div class="title">
         <i></i>
     </div>

BIN
src/main/webapp/resources/img/upload/daishou-active.png


BIN
src/main/webapp/resources/img/upload/daishou-default.png


BIN
src/main/webapp/resources/img/upload/ziying-active.png


BIN
src/main/webapp/resources/img/upload/ziying-default.png


+ 20 - 7
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_upload_ctrl.js

@@ -41,13 +41,26 @@ define([ 'app/app' ], function(app) {
         //翻页的信息
         $scope.pageParams = {};
 
-        //选择相应的销售类型
-        $scope.sellType = function(type) {
-            if($scope.batch.selfSellEabled) {
-                $scope.batch.sellType = type;
-            }else {
-                $scope.batch.sellType = 'UAS';
-            }
+		// 自营店铺选择寄售提示框
+		$scope.showSelfSellRemindBox = false;
+
+		$scope.setShowSelfSellRemindBox = function (flag, type) {
+			if (type && type == 'no') {
+				$scope.sellType('self');
+			}
+			$scope.showSelfSellRemindBox = flag;
+		}
+
+		//选择相应的销售类型
+		$scope.sellType = function(type) {
+			if($scope.batch.selfSellEabled) {
+				$scope.batch.sellType = type;
+				if (type == 'UAS') {
+					$scope.setShowSelfSellRemindBox(true);
+				}
+			}else {
+				$scope.batch.sellType = 'UAS';
+			}
 
         };
 

+ 84 - 4
src/main/webapp/resources/view/vendor/forstore/vendor_upload.html

@@ -150,6 +150,15 @@
     .add_category .sale-label input[type="radio"] {
         display: none;
     }
+    .add_category .sale-label span {
+        cursor: pointer;
+    }
+    .add_category .sale-label span:first-child {
+        margin-right: 15px;
+    }
+    .add_category .sale-label span[disabled] {
+        cursor: not-allowed;
+    }
     .user_right a.blue-bg{
         color: #fff !important;
         margin-top: 5px;
@@ -401,6 +410,57 @@
     .com-del-box .operate a {
         color: #5078cb;
     }
+    .type-remind-box {
+        width: 289px;
+        height: 132px;
+        -webkit-box-shadow: none;
+        -moz-box-shadow: none;
+        box-shadow: none;
+    }
+    .type-remind-box .title {
+        height: 23px;
+        line-height: 23px;
+    }
+    .type-remind-box .result {
+        width: 239px;
+        height: 37px;
+        margin: 16px auto 18px;
+        font-size: 14px;
+        color: #666;
+        line-height: 20px;
+    }
+    .type-remind-box .result span {
+        color: #e83825;
+    }
+    .type-remind-box .operate {
+        text-align: center;
+    }
+    .type-remind-box .operate a {
+        display: inline-block;
+        width: 90px;
+        height: 28px;
+        line-height: 28px;
+        text-align: center;
+        background: #5078cb;
+        color: #fff;
+        font-size: 14px;
+        vertical-align: middle;
+    }
+    .type-remind-box .operate a:first-child {
+        margin-right: 10px;
+    }
+    .type-remind-box .operate a:last-child {
+        background: #fff;
+        color: #5078cb;
+        border: 1px solid #5078cb;
+    }
+    .type-remind-box .operate a:first-child:hover {
+        color: #fff !important;
+    }
+    .type-remind-box .operate a:last-child:hover{
+        border-bottom: 1px solid #5078cb !important;
+        color: #5078cb !important;
+    }
 </style>
 <div class="user_right fr">
     <!--货品管理-->
@@ -429,9 +489,9 @@
                         <em class="open-icon" ng-click="open02=!open02" ng-class="{'active': !open02}"></em>
                     </p>
                     <div class="add_category" ng-if="!open02">
-                        <div ng-if="$$productOn.tab == 'bathOn'">1、请选择是店铺自营还是优软代售</div>
+                        <div ng-if="$$productOn.tab == 'bathOn'">1、请选择销售方式:</div>
                         <div class="sale-label" style="margin-top: -10px;" ng-if="$$productOn.tab == 'bathOn'">
-                            <label class="sellType">
+                           <!-- <label class="sellType">
                                 <input ng-click="sellType('UAS')" type="radio" name="487" id="sellbyUAS" ng-model="batch.sellType" ng-checked="batch.sellType == 'UAS'">
                                 <label for="sellbyUAS"></label>
                                 <span>优软代售</span>
@@ -440,7 +500,15 @@
                                 <input ng-click="sellType('self')" type="radio" name="487" id="sellbyself" ng-model="batch.sellType" ng-checked="batch.sellType == 'self'">
                                 <label for="sellbyself" ng-disabled="!batch.selfSellEabled"></label>
                                 <span ng-disabled="!batch.selfSellEabled">店铺自营</span>
-                            </label>
+                            </label>-->
+                            <span>
+                                <img ng-show="batch.sellType == 'self'" src="static/img/upload/daishou-default.png" alt="" ng-click="sellType('UAS')">
+                                <img ng-hide="batch.sellType == 'self'" src="static/img/upload/daishou-active.png" alt="">
+                            </span>
+                            <span ng-disabled="!batch.selfSellEabled">
+                                <img ng-show="batch.sellType == 'UAS'" src="static/img/upload/ziying-default.png" alt="" ng-click="sellType('self')">
+                                <img ng-hide="batch.sellType == 'UAS'" src="static/img/upload/ziying-active.png" alt="">
+                            </span>
                         </div>
                         <div><span ng-if="$$productOn.tab == 'bathOn'">2、</span>请上传已经编辑好的库存表格,选择好上传的文件之后,点击确认上传</div>
                         <div class="upload">
@@ -574,7 +642,7 @@
                         <!--<div><a ng-click="cancelDelete()">取消</a><a ng-click="deleteBatch(deleteId)">确认</a></div>-->
                     <!--</div>-->
                 <!--</div>-->
-                <div class="com-modal-wrap" ng-if="result && result.total != 0 && !hadImport && $$productOn.tab == 'bathOnPerson' && personMedol">
+                <div class="com-modal-wrap" ng-if="result && !hadImport && $$productOn.tab == 'bathOnPerson' && personMedol">
                     <div class="com-del-box com-mall-del-box">
                         <div class="title">
                             <i ng-click="setPersonMedol()"></i>
@@ -587,6 +655,18 @@
                         </div>
                     </div>
                 </div>
+                <div class="com-modal-wrap" ng-if="showSelfSellRemindBox">
+                    <div class="type-remind-box com-mall-del-box">
+                        <div class="title">
+                            <i ng-click="setShowSelfSellRemindBox(false, 'no')"></i>
+                        </div>
+                        <div class="result"><span>选择寄售,</span>产品将由优软统一售卖,不会出现在您的自营店铺,是否切换?</div>
+                        <div class="operate">
+                            <a href="javascript:void(0)" ng-click="setShowSelfSellRemindBox(false)">是</a>
+                            <a href="javascript:void(0)" ng-click="setShowSelfSellRemindBox(false, 'no')">否</a>
+                        </div>
+                    </div>
+                </div>
             </div>
         </div>
     </div>