|
@@ -5,13 +5,19 @@ import com.minpay.common.format.IFormatService;
|
|
|
import com.minpay.common.service.ILogService;
|
|
|
import com.minpay.common.util.CommonUtil;
|
|
|
import com.minpay.common.util.DateUtil;
|
|
|
+import com.minpay.common.util.HttpPostUtil;
|
|
|
+import com.minpay.db.table.mapper.VmDeliveryInfMapper;
|
|
|
+import com.minpay.db.table.mapper.VmOrderDetailsMapper;
|
|
|
import com.minpay.db.table.mapper.VmOrderInfMapper;
|
|
|
+import com.minpay.db.table.model.VmDeliveryInf;
|
|
|
+import com.minpay.db.table.model.VmOrderDetails;
|
|
|
import com.minpay.db.table.model.VmOrderInf;
|
|
|
import com.minpay.db.table.own.mapper.OrderManageMapper;
|
|
|
import com.startup.minpay.frame.business.IMINAction;
|
|
|
import com.startup.minpay.frame.business.res.MINActionResult;
|
|
|
import com.startup.minpay.frame.constant.IMINBusinessConstant;
|
|
|
import com.startup.minpay.frame.data.format.MINCopyFormat;
|
|
|
+import com.startup.minpay.frame.exception.MINBusinessException;
|
|
|
import com.startup.minpay.frame.jdbc.MINRowBounds;
|
|
|
import com.startup.minpay.frame.service.base.IMINDataBaseService;
|
|
|
import com.startup.minpay.frame.service.base.Service;
|
|
@@ -19,6 +25,7 @@ import com.startup.minpay.frame.session.MINSession;
|
|
|
import com.startup.minpay.frame.target.MINAction;
|
|
|
import com.startup.minpay.frame.target.MINComponent;
|
|
|
import com.startup.minpay.frame.target.MINParam;
|
|
|
+import net.sf.json.JSONObject;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
@@ -370,24 +377,63 @@ public class invCardManageAction implements IMINAction {
|
|
|
public MINActionResult updateOrderStt(
|
|
|
@MINParam ( key = "orderNo")String orderNo,
|
|
|
@MINParam ( key = "temp")String temp,
|
|
|
+ @MINParam ( key = "pickupNo")String pickupNo,
|
|
|
+ @MINParam ( key = "detailsId")String detailsId,
|
|
|
MINSession session) throws Exception{
|
|
|
MINActionResult res = new MINActionResult();
|
|
|
User user = session.getUser();
|
|
|
+ VmDeliveryInf vd = Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmDeliveryInfMapper.class)
|
|
|
+ .selectByPrimaryKey(pickupNo);
|
|
|
+ if(vd == null || "2".equals(vd.getStatus()) || "6".equals(vd.getStatus())){
|
|
|
+ throw new MINBusinessException("提货编号已提货");
|
|
|
+ }
|
|
|
+ String ordDetId = vd.getOrdDetId();
|
|
|
+ VmOrderDetails vmOrderDetails = Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmOrderDetailsMapper.class)
|
|
|
+ .selectByPrimaryKey(ordDetId);
|
|
|
+ if(vmOrderDetails == null||"01".equals(vmOrderDetails.getIsDelivery())){
|
|
|
+ throw new MINBusinessException("提货编号已提货");
|
|
|
+ }
|
|
|
+
|
|
|
String info = "";
|
|
|
- //更新订单状态
|
|
|
- VmOrderInf vd = new VmOrderInf();
|
|
|
- vd.setId(orderNo);
|
|
|
if ("0".equals(temp)) {
|
|
|
- vd.setPickupStt("02");
|
|
|
+ vd.setStatus("6");
|
|
|
info = "废止";
|
|
|
+ //修改提货表
|
|
|
+ Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmDeliveryInfMapper.class)
|
|
|
+ .updateByPrimaryKeySelective(vd);
|
|
|
+ //修改订单详情表
|
|
|
+ vmOrderDetails.setIsDelivery("01");
|
|
|
+ Service.lookup(IMINDataBaseService.class)
|
|
|
+ .getMybatisMapper(VmOrderDetailsMapper.class)
|
|
|
+ .updateByPrimaryKeySelective(vmOrderDetails);
|
|
|
+
|
|
|
}else if("1".equals(temp)) {
|
|
|
- vd.setPickupStt("01");
|
|
|
+ StringBuffer paramStr = new StringBuffer();
|
|
|
+
|
|
|
+ paramStr.append("MINView=JSON&");
|
|
|
+ paramStr.append("deliveryNo=");
|
|
|
+ paramStr.append(pickupNo);
|
|
|
+ String url = " http://127.0.0.1:9998/services/DeliveryAction/makeDeliveryForMachineNoSession?";
|
|
|
+ String jsonObj = HttpPostUtil.sendPost(url, paramStr.toString());
|
|
|
+ if(CommonUtil.isEmpty(jsonObj)){
|
|
|
+ throw new MINBusinessException("操作失败!请重新操作");
|
|
|
+ }
|
|
|
+ JSONObject js2 = JSONObject.fromObject(jsonObj);
|
|
|
+ String mINStatus = js2.getString("MINStatus");
|
|
|
+ String mINErrorMessage = js2.getString("MINErrorMessage");
|
|
|
+ //{"msg":"没有提货信息!","code":1,"MINPage":{"charset":"UTF-8","cache":false,"view":"JSON","page":"","type":"","contentType":"text/html"},"MINLangLocale":"zh_CN","MINStatus":1,"MINTime":"2020-12-13 01:41:56","MINErrorMessage":"没有提货信息!"}
|
|
|
+ if(!"0".equals(mINStatus)){
|
|
|
+ throw new MINBusinessException(mINErrorMessage);
|
|
|
+ }
|
|
|
+ //发送请求
|
|
|
info = "发货";
|
|
|
}
|
|
|
- Service.lookup(IMINDataBaseService.class)
|
|
|
- .updateByPrimaryKeySelective(VmOrderInfMapper.class, vd);
|
|
|
+
|
|
|
//日志
|
|
|
- String logInfo = user.getName()+"-更新订单状态:" +info+ ",订单号"+orderNo;
|
|
|
+ String logInfo = user.getName()+"-更新提货单状态:" +info+ ",订单号"+pickupNo;
|
|
|
Service.lookup(ILogService.class).logging(session, logInfo);
|
|
|
return res;
|
|
|
}
|