Authored by Lixiaodi

Merge branch 'master' of http://git.yoho.cn/ufo/ufo-platform

... ... @@ -17,4 +17,6 @@ public interface BuyerOrderMapper {
int selectTotalByCondition(@Param("buyerOrderReq") BuyerOrderReq req);
List<BuyerOrder> selectByCondition(@Param("buyerOrderReq") BuyerOrderReq req);
int updateStatusById(@Param("id") Integer id, @Param("status") Byte status);
}
... ...
... ... @@ -14,6 +14,8 @@ public class BuyerOrderReq extends PageRequestBO{
*/
private static final long serialVersionUID = 1620427808531296022L;
private Integer id;
private String orderCode;
private Integer uid;
... ... @@ -38,7 +40,15 @@ public class BuyerOrderReq extends PageRequestBO{
private Integer depotNo;
public String getOrderCode() {
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getOrderCode() {
return orderCode;
}
... ...
... ... @@ -99,5 +99,9 @@
</if>
</select>
<update id="updateStatusById">
update buyer_order set status=#{status} where id=#{id}
</update>
</mapper>
\ No newline at end of file
... ...
... ... @@ -36,4 +36,16 @@ public class BuyerOrderController {
PageResponseBO<BuyerOrderResp> result = buyerOrderService.queryOrderList(req);
return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build();
}
@RequestMapping(value = "/updateOrderStatus")
public ApiResponse updateOrderStatus(BuyerOrderReq req) {
LOGGER.info("updateOrderStatus in. req is {}", req);
int result = buyerOrderService.updateOrderStatus(req);
if(result > 0) {
return new ApiResponse.ApiResponseBuilder().code(200).message("更新成功").build();
}else {
return new ApiResponse.ApiResponseBuilder().code(500).message("更新失败").build();
}
}
}
... ...
... ... @@ -14,4 +14,6 @@ public interface IBuyerOrderService {
Map<String, Integer> getCountByJudgeStatus();
PageResponseBO<BuyerOrderResp> queryOrderList(BuyerOrderReq req);
int updateOrderStatus(BuyerOrderReq req);
}
... ...
... ... @@ -124,6 +124,15 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
return result;
}
public int updateOrderStatus(BuyerOrderReq req) {
if(null == req.getId() || null == req.getStatus()) {
return 0;
}
return buyerOrderMapper.updateStatusById(req.getId(), req.getStatus());
}
private List<BuyerOrderResp> convertToResp(List<BuyerOrder> orderList, Map<String, BuyerOrderGoods> buyerGoodsMap,
Map<Integer, SellerOrder> sellerOrderMap, Map<Integer, SellerOrderGoods> sellerGoodsMap, Map<String, ExpressInfo> expressInfoMap){
List<BuyerOrderResp> respList = Lists.newArrayList();
... ...
... ... @@ -255,14 +255,14 @@ function getToBeJudgedList(){
},{
title: "操作",
field: "asdf",
width: 30,
width: 40,
align: "center",
formatter: function (value, rowData, rowIndex) {
if (rowData.status == 2) {
return "<a role='close' dataId='"+ rowData.shopId +"' style='margin-left:10px;background-color: #5cb85c !important;'>确认收货</a>";
return "<a role='confirm' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5cb85c !important;'>确认收货</a>";
} else if (rowData.status == 3) {
return "<a role='open' dataId='"+ rowData.shopId +"' style='margin-left:10px;background-color: #d9534f !important;'>鉴定通过</a>"+
"<a role='open' dataId='"+ rowData.shopId +"' style='margin-left:10px;background-color: #5cb85c !important;'>鉴定不通过</a>";
return "<a role='pass' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #d9534f !important;'>鉴定通过</a>"+
"<a role='reject' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5cb85c !important;'>鉴定不通过</a>";
}
}
}]],
... ... @@ -272,29 +272,54 @@ function getToBeJudgedList(){
idField: "id",
singleSelect: true,
onLoadSuccess: function (data) {
$(this).datagrid("getPanel").find("a[role='open']").linkbutton({
$(this).datagrid("getPanel").find("a[role='confirm']").linkbutton({
onClick: function () {
var id = $(this).attr("dataId");
$.messager.confirm("确认收货提醒", "是否确认收货?确认收货前请务必确定货品已到达仓库。", function(flag) {
if (flag) {
$.post(contextPath + "/buyerOrder/updateOrderStatus", {
id : id,
status : 3
}, function(data) {
if (data.code == 200) {
$("#orderListTable").datagrid("reload");
window.self.$.messager.show({
title : "提示",
msg : "确认收货成功!"
});
}else {
window.self.$.messager.alert("失败", "失败!", "error");
}
});
}
});
}
});
$(this).datagrid("getPanel").find("a[role='pass']").linkbutton({
onClick: function () {
var shopsId = $(this).attr("dataId");
$.post(contextPath + "/couponLimit/shopStartOrStop.do", {
shopsIdForShop : shopsId,
shopLimitStatus : 1,
shopLimitStatus : 0,
type : 0
}, function(data) {
if (data.code == CODE_SUCCESS) {
$("#limitListTable").datagrid("reload");
window.self.$.messager.show({
title : "提示",
msg : "开启成功!"
msg : "关闭成功!"
});
} else {
window.self.$.messager.alert("失败", data.message, "error");
}
});
}
});
$(this).datagrid("getPanel").find("a[role='close']").linkbutton({
$(this).datagrid("getPanel").find("a[role='reject']").linkbutton({
onClick: function () {
var shopsId = $(this).attr("dataId");
$.post(contextPath + "/couponLimit/shopStartOrStop.do", {
... ... @@ -315,6 +340,7 @@ function getToBeJudgedList(){
}
});
}
});
}
... ... @@ -390,8 +416,8 @@ function getAlreadyJudgedList(){
});
}
function addPage() {
var div = $("<div id='addProductCouponLimitDiv'>").appendTo($(document.body));
function addConfirmPage() {
var div = $("<div id='confirmDiv'>").appendTo($(document.body));
var url = contextPath + "/html/promotion/useCouponLimit/add.html";
$(div).myDialog({
width: "50%",
... ...