Authored by tanling

Merge branch 'test6.9.6' of http://git.yoho.cn/ufo/ufo-platform into test6.9.6

... ... @@ -264,10 +264,10 @@ public class ChannelSkuCompareServiceImpl implements IChannelSkuCompareService,
Storage storage = new Storage();
storage.setId(csc.getSku());
BigDecimal suggestLowPrice = csc.getChannelPrice().multiply(BigDecimal.valueOf(1).subtract(csc.getLowRate())).setScale(0, BigDecimal.ROUND_DOWN);;
BigDecimal suggestLowPrice = csc.getChannelPrice().multiply(BigDecimal.valueOf(1).subtract(csc.getLowRate())).setScale(0, BigDecimal.ROUND_DOWN);
BigDecimal suggestHighPrice = csc.getChannelPrice().multiply(BigDecimal.valueOf(1).add(csc.getHighRate())).setScale(0, BigDecimal.ROUND_DOWN);
storage.setSuggestLowPrice(suggestLowPrice);
storage.setSuggestHighPrice(suggestHighPrice);
storage.setSuggestLowPrice(changeToNineEnd(suggestLowPrice, 1));
storage.setSuggestHighPrice(changeToNineEnd(suggestHighPrice, 2));
normalIdList.add(csc.getId());
storageList.add(storage);
}
... ... @@ -282,6 +282,32 @@ public class ChannelSkuCompareServiceImpl implements IChannelSkuCompareService,
channelSkuCompareMapper.updateStatusByIds(normalIdList, CHANNEL_SKU_COMPARE_NORMAL, 0);//uid=0表示系统操作
storageMapper.updateBatchSuggestPrice(storageList);
}
}
/**
*
* @param old
* @param type 1:low 2:high
* @return
*/
private static BigDecimal changeToNineEnd(BigDecimal old, int type) {
String oldStr = old.toString();
if(oldStr.endsWith("9")) {
return old;
}
String newStr = oldStr.substring(0, oldStr.length()-1) + "9";
BigDecimal result = BigDecimal.valueOf(0);
if(type == 1) {//low
result = new BigDecimal(newStr).subtract(BigDecimal.valueOf(10));
if(result.compareTo(BigDecimal.valueOf(0)) < 0) {
return old;
}
}else if(type == 2) {//high
result = new BigDecimal(newStr);
}
return result;
}
... ...
... ... @@ -157,6 +157,7 @@ function loadMainList(){
str = "<a role='audit' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5cb85c !important;'>审核</a>" + str;
}else if(rowData.status==3){
str = "<a role='upperShelf' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #428bca !important;'>上架</a>";
str += "<a role='reject' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #428bca !important;'>驳回</a>";
}else{
str = "<a role='detail' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #428bca !important;'>查看</a>";
}
... ... @@ -198,7 +199,28 @@ function loadMainList(){
}else {
window.self.$.messager.alert("失败", "失败!", "error");
}
}); }
});
}
});
$(this).datagrid("getPanel").find("a[role='reject']").linkbutton({
onClick: function () {
var id = $(this).attr("dataId");
$.post(contextPath + "/selfShelves/updateAuditInfoById", {
id : id,
status : 2
}, function(data) {
if (data.code == 200) {
$("#mainListTable").datagrid("reload");
window.self.$.messager.show({
title : "提示",
msg : "驳回成功!"
});
}else {
window.self.$.messager.alert("失败", "失败!", "error");
}
});
}
});
}
... ...