|
@@ -264,10 +264,10 @@ public class ChannelSkuCompareServiceImpl implements IChannelSkuCompareService, |
|
@@ -264,10 +264,10 @@ public class ChannelSkuCompareServiceImpl implements IChannelSkuCompareService, |
264
|
|
264
|
|
265
|
Storage storage = new Storage();
|
265
|
Storage storage = new Storage();
|
266
|
storage.setId(csc.getSku());
|
266
|
storage.setId(csc.getSku());
|
267
|
- BigDecimal suggestLowPrice = csc.getChannelPrice().multiply(BigDecimal.valueOf(1).subtract(csc.getLowRate())).setScale(0, BigDecimal.ROUND_DOWN);;
|
267
|
+ BigDecimal suggestLowPrice = csc.getChannelPrice().multiply(BigDecimal.valueOf(1).subtract(csc.getLowRate())).setScale(0, BigDecimal.ROUND_DOWN);
|
268
|
BigDecimal suggestHighPrice = csc.getChannelPrice().multiply(BigDecimal.valueOf(1).add(csc.getHighRate())).setScale(0, BigDecimal.ROUND_DOWN);
|
268
|
BigDecimal suggestHighPrice = csc.getChannelPrice().multiply(BigDecimal.valueOf(1).add(csc.getHighRate())).setScale(0, BigDecimal.ROUND_DOWN);
|
269
|
- storage.setSuggestLowPrice(suggestLowPrice);
|
|
|
270
|
- storage.setSuggestHighPrice(suggestHighPrice);
|
269
|
+ storage.setSuggestLowPrice(changeToNineEnd(suggestLowPrice, 1));
|
|
|
270
|
+ storage.setSuggestHighPrice(changeToNineEnd(suggestHighPrice, 2));
|
271
|
normalIdList.add(csc.getId());
|
271
|
normalIdList.add(csc.getId());
|
272
|
storageList.add(storage);
|
272
|
storageList.add(storage);
|
273
|
}
|
273
|
}
|
|
@@ -282,6 +282,32 @@ public class ChannelSkuCompareServiceImpl implements IChannelSkuCompareService, |
|
@@ -282,6 +282,32 @@ public class ChannelSkuCompareServiceImpl implements IChannelSkuCompareService, |
282
|
channelSkuCompareMapper.updateStatusByIds(normalIdList, CHANNEL_SKU_COMPARE_NORMAL, 0);//uid=0表示系统操作
|
282
|
channelSkuCompareMapper.updateStatusByIds(normalIdList, CHANNEL_SKU_COMPARE_NORMAL, 0);//uid=0表示系统操作
|
283
|
storageMapper.updateBatchSuggestPrice(storageList);
|
283
|
storageMapper.updateBatchSuggestPrice(storageList);
|
284
|
}
|
284
|
}
|
|
|
285
|
+ }
|
|
|
286
|
+
|
|
|
287
|
+ /**
|
|
|
288
|
+ *
|
|
|
289
|
+ * @param old
|
|
|
290
|
+ * @param type 1:low 2:high
|
|
|
291
|
+ * @return
|
|
|
292
|
+ */
|
|
|
293
|
+ private static BigDecimal changeToNineEnd(BigDecimal old, int type) {
|
|
|
294
|
+ String oldStr = old.toString();
|
|
|
295
|
+ if(oldStr.endsWith("9")) {
|
|
|
296
|
+ return old;
|
|
|
297
|
+ }
|
|
|
298
|
+
|
|
|
299
|
+ String newStr = oldStr.substring(0, oldStr.length()-1) + "9";
|
|
|
300
|
+ BigDecimal result = BigDecimal.valueOf(0);
|
|
|
301
|
+ if(type == 1) {//low
|
|
|
302
|
+ result = new BigDecimal(newStr).subtract(BigDecimal.valueOf(10));
|
|
|
303
|
+ if(result.compareTo(BigDecimal.valueOf(0)) < 0) {
|
|
|
304
|
+ return old;
|
|
|
305
|
+ }
|
|
|
306
|
+ }else if(type == 2) {//high
|
|
|
307
|
+ result = new BigDecimal(newStr);
|
|
|
308
|
+ }
|
|
|
309
|
+
|
|
|
310
|
+ return result;
|
285
|
|
311
|
|
286
|
}
|
312
|
}
|
287
|
|
313
|
|