694069be 刘嘉

更新 整单是售后完成,但订单状态不是[退款/退货成功]状态的订单状态

1 个父辈 0deb1cb3
......@@ -141,4 +141,10 @@ public interface IMDoingOrderDao {
//根据订单号获取订单详情
DoingOrderDetailResponse getIMOrderDetailByMap(Map<String, Object> param);
/**
* 更新 整单是售后完成,但订单状态不是[退款/退货成功]状态的订单
* @param params
*/
void updateOrderStatusByMap(Map<String,Object> params);
}
......
......@@ -41,6 +41,8 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.ValidationException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
......@@ -408,4 +410,36 @@ public class IMOrderRefundController extends BaseController {
return ResponseRender.renderData(iMRefundOrderService.searchUnsuccessfulRefundOrderList(iMOrderRefundBeanList));
}
/**
* 更新 整单是售后完成,但订单状态不是[退款/退货成功]状态的订单
* @param str
* @return
* @throws Exception
*/
@RequestMapping(value = "/imorder/refund/updateRefundOrserList")
@ResponseBody
public String updateRefundOrserList(String str)throws Exception{
try {
if(StringUtil.isNull(str)){
return ResponseUtil.error("请输入验证码");
}
if(!"056839532496493e933a6e2ece2fb749".equals(MD5Util.MD5ToNewWeSale(str))){
return ResponseUtil.error("请输入正确验证码");
}
}catch (Exception e){
log.error(e);
throw new ApiDataException(2, "md5错误", e);
}
ArrayList<String> refundList = new ArrayList<String>(Arrays.asList("S0021522258815331", "S011201804020733100665", "S013201803292002548637","S013201803292039238172",
"S013201803292219146602","S0271521047077511","S0311520709106971","S0351522263111238","S0361521792447158","S044201803310813456331","S0451522105234726","S072201803300917554787",
"S080201804021438156843","S081201803301321268318","S081201804030739055230","S0821522257785998","S0861522258771557","S090201804031350228548","S0951520712293242","S0951520728488229",
"S0981520746819299","S1011521674243505","S101201804011152207744","S101201804031500247525","S104201804011607091004","S105201803301418465847","S1071522277200968","S1091522264482792","S128201803301118156510",
"S1331517178633710","S134201804031337248413","S1351520719407884","S140201804020046231224","S1431520742518876","S1461521418597350","S150201803311058501300","S1511520709284202","S1521522272052514","S152201804021256497637",
"S1601519799639608","S1671520732763386","S184201803292124104484","S188201804020053046208","S190201804011804461777","S193201804030028274818","S194201803311353117388","S194201803311359137016","S1991520825026133","S206201803311740362678",
"S209201804022048206544","S209201804031335482106","S211201804022049010278","S214201804031505302202","S232201803292037135511","S232201803292207590857","S2331522025154721","S2351522257613518","S2401522452902291","S244201804022243354657",
"S245201803300618376176","S252201803301009364387","S252201804020812593582","S254201804021129432187"));
iimDoingOrderService.updateRefundOrderList(refundList);
return ResponseUtil.success("更新成功");
}
}
......
......@@ -851,4 +851,8 @@
where do.main_order_code = #{mainOrderCode} and do.order_from = #{orderFrom} AND do.delete_flag=1
</select>
<update id="updateOrderStatusByMap" parameterType="java.util.Map">
update ${doingOrderTable} set order_status = 7 WHERE order_code = #{orderCode}
</update>
</mapper>
\ No newline at end of file
......
......@@ -98,5 +98,12 @@ public interface IIMDoingOrderService {
//判断main_order_code与ordercode获取订单信息
DoingOrderDetailResponse getIMOrderDetailByOrderCodeOrMainOrderCode(String orderCode) throws Exception;
/**
* 更新 整单是售后完成,但订单状态不是[退款/退货成功]状态的订单
* @param list
* @throws Exception
*/
void updateRefundOrderList(List<String> list)throws Exception;
}
......
......@@ -1321,5 +1321,18 @@ public class IMDoingOrderService extends BaseServiceImpl implements IIMDoingOrde
return doingOrderDetailResponse;
}
@Override
public void updateRefundOrderList(List<String> list) throws Exception {
for(int i = 0;i<list.size();i++){
Map<String,Object> params = new HashMap<>();
String redisMysqlDbConfig = this.getRedisConfigByOrderCode(list.get(i));
String tableName = DbUtil.getDatabaseByOrderCode(list.get(i), 16);
params.put("doingOrderTable", "im_doing_order_" + tableName);
params.put("orderCode", list.get(i));
DBContextHolder.setDBType(redisMysqlDbConfig);
iMDoingOrderDao.updateOrderStatusByMap(params);
}
}
}
......