DeliveryAction.java 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. package com.minpay.shouhuo.deliveryaction;
  2. import com.min.base64.Base64;
  3. import com.min.des.DesUtils;
  4. import com.min.util.OffSetUtil;
  5. import com.minpay.common.bean.DrawDto;
  6. import com.minpay.common.bean.User;
  7. import com.minpay.common.exception.BusinessCodeException;
  8. import com.minpay.common.format.IFormatService;
  9. import com.minpay.common.service.IPropertiesService;
  10. import com.minpay.common.service.IPublicService;
  11. import com.minpay.common.util.CommonUtil;
  12. import com.minpay.common.util.DateUtil;
  13. import com.minpay.common.util.HttpPostUtil;
  14. import com.minpay.db.table.mapper.VmDeliveryInfMapper;
  15. import com.minpay.db.table.mapper.VmOrderDetailsMapper;
  16. import com.minpay.db.table.mapper.VmOrderInfMapper;
  17. import com.minpay.db.table.mapper.VmProEquRelMapper;
  18. import com.minpay.db.table.model.*;
  19. import com.minpay.db.table.own.mapper.DeliveryMapper;
  20. import com.startup.minpay.frame.business.IMINAction;
  21. import com.startup.minpay.frame.business.res.MINActionResult;
  22. import com.startup.minpay.frame.constant.IMINBusinessConstant;
  23. import com.startup.minpay.frame.data.format.MINCopyFormat;
  24. import com.startup.minpay.frame.exception.MINBusinessException;
  25. import com.startup.minpay.frame.jdbc.MINRowBounds;
  26. import com.startup.minpay.frame.service.base.IMINDataBaseService;
  27. import com.startup.minpay.frame.service.base.Service;
  28. import com.startup.minpay.frame.session.MINSession;
  29. import com.startup.minpay.frame.target.MINAction;
  30. import com.startup.minpay.frame.target.MINComponent;
  31. import com.startup.minpay.frame.target.MINParam;
  32. import com.startup.minpay.util.Log;
  33. import net.sf.json.JSONObject;
  34. import javax.servlet.http.HttpServletResponse;
  35. import java.io.IOException;
  36. import java.util.HashMap;
  37. import java.util.List;
  38. import java.util.Map;
  39. /**
  40. * 售货机提货相关接口
  41. * @author Zhumq
  42. *
  43. */
  44. @MINComponent
  45. public class DeliveryAction implements IMINAction{
  46. /**查询提货信息*/
  47. public static final String QUERY_DELIVERY_INFO = "queryDeliveryInfo";
  48. /**修改提货信息*/
  49. public static final String MODIFY_DELIVERY_INFO = "modifyDeliveryInfo";
  50. /**提货接口*/
  51. public static final String MAKE_DELIVERY_FOR_MACHINE = "makeDeliveryForMachine";
  52. /**提货回调*/
  53. public static final String BACK_DELIVERY_FOR_MACHINE = "backDeliveryForMachine";
  54. /**
  55. * 查询提货信息
  56. * @param equNo 售货机编号
  57. * @param dates 创建时间
  58. * @param userNo 商户编号
  59. * @param status 提货状态
  60. * @param orderNo 订单编号
  61. * @param personNo 会员编号
  62. * @param page
  63. * @param limit
  64. * @param session
  65. * @return
  66. * @throws MINBusinessException
  67. */
  68. @MINAction(value = QUERY_DELIVERY_INFO)
  69. public MINActionResult queryDeliveryInfo(
  70. @MINParam(key = "equNo")String equNo,
  71. @MINParam(key = "dates")String dates,
  72. @MINParam(key = "userNo")String userNo,
  73. @MINParam(key = "status")String status,
  74. @MINParam(key = "orderNo")String orderNo,
  75. @MINParam(key = "personNo")String personNo,
  76. @MINParam(key = "page",defaultValue = "1")int page,
  77. @MINParam(key = "limit",defaultValue = "10")int limit,
  78. MINSession session) throws MINBusinessException{
  79. MINActionResult res = new MINActionResult();
  80. if(CommonUtil.isEmpty(equNo)){
  81. throw new BusinessCodeException("JINM1101");//售货机异常,请联系工作人员
  82. }
  83. //解密售货机编号
  84. String equNoNew = OffSetUtil.deScanCode(equNo);
  85. //获取操作员信息
  86. User user = session.getUser();
  87. //创建分页对象
  88. MINRowBounds row = new MINRowBounds(page, limit);
  89. //初始化查询条件
  90. Map<String,String> map = new HashMap<String,String>();
  91. map.put("orderNo", orderNo);//订单编号
  92. map.put("status", status);//提货状态
  93. map.put("userNo", userNo);//商户编号
  94. map.put("equNo", equNoNew);//售货机编号
  95. if(CommonUtil.isEmpty(personNo)){
  96. personNo = user.getId();
  97. }
  98. map.put("personNo", personNo);//会员编号
  99. map.put("dates", dates);//创建时间
  100. //传入渠道验证
  101. map.put("channel", user.getChannel());
  102. List<Map<String,String>> list = Service.lookup(IMINDataBaseService.class)
  103. .getMybatisMapper(DeliveryMapper.class)
  104. .queryDeliveryInfo(map,row);
  105. //格式花时间和状态
  106. list = Service.lookup(IFormatService.class).formatDateTime(list, "createTime");
  107. list = new MINCopyFormat("{status:'statusDesc',proType:'proTypeDesc'}").format(list);
  108. list = Service.lookup(IFormatService.class).formatEnum(list,"{statusDesc:'VM_DELIVERY_STATUS',proTypeDesc:'PRO_TYPE'}");
  109. //传递返回值
  110. res.set(IMINBusinessConstant.F_PAGING_LAY, list);
  111. res.set(IMINBusinessConstant.F_PAGING_COUNT, row.getMaxRows());
  112. return res;
  113. }
  114. /**
  115. * 提货接口
  116. * @param orderNo 订单编号
  117. * @param deliveryNo 提货单编号
  118. * @param session
  119. * @return
  120. * @throws Exception
  121. */
  122. @MINAction(value = MAKE_DELIVERY_FOR_MACHINE)
  123. public MINActionResult makeDeliveryForMachine(
  124. @MINParam ( key = "orderNo")String orderNo,
  125. @MINParam ( key = "deliveryNo")String deliveryNo,
  126. MINSession session) throws Exception{
  127. MINActionResult res = new MINActionResult();
  128. User user = session.getUser();
  129. /**获取售货机推送地址*/
  130. String url = Service.lookup(IPropertiesService.class)
  131. .getSystemProperties().get(user.getChannel() + "_GET_MACHINE_ADDRESS").getKey();
  132. String retUrl = Service.lookup(IPropertiesService.class)
  133. .getSystemProperties().get(user.getChannel() + "_RETURN_MACHINE_ADDRESS").getKey();
  134. //组装推送接口
  135. String sendUrl = url.concat("/VendingMachineAction/pushGoods").concat("?MINView=JSON");
  136. String returnUrl = retUrl.concat("/DeliveryAction/backDeliveryForMachine");
  137. /**查询数据(提货单号是否存在)*/
  138. //初始化查询条件
  139. Map<String,String> map = new HashMap<String,String>();
  140. map.put("deliveryNo", deliveryNo);//提货编号
  141. map.put("orderNo", orderNo);//订单编号
  142. //传入渠道验证
  143. map.put("channel", user.getChannel());
  144. List<Map<String,String>> list = Service.lookup(IMINDataBaseService.class)
  145. .getMybatisMapper(DeliveryMapper.class)
  146. .queryDeliverys(map);
  147. if(list == null || list.size() != 1 ){
  148. throw new MINBusinessException("没有提货信息!");
  149. }
  150. String equType = list.get(0).get("equType");
  151. if(!"00".equals(equType) || !"01".equals(equType)){
  152. throw new MINBusinessException("机器类型不支持推货!");
  153. }
  154. VmDeliveryInf delInf = Service.lookup(IMINDataBaseService.class)
  155. .getMybatisMapper(VmDeliveryInfMapper.class).selectByPrimaryKey(deliveryNo);
  156. if(delInf == null){
  157. throw new MINBusinessException("没有提货信息!");
  158. }
  159. if(delInf.getProNums().equals(delInf.getDeliveryNums())){
  160. throw new MINBusinessException("提货已完成!");
  161. }
  162. if(!delInf.getStatus().equals("0")
  163. && !delInf.getStatus().equals("1") && !delInf.getStatus().equals("5")){
  164. throw new MINBusinessException("提货处理中,请稍后!");
  165. }
  166. //改变提货状态为5处理中....
  167. delInf.setStatus("5");
  168. //处理提货状态
  169. Service.lookup(IMINDataBaseService.class)
  170. .getMybatisMapper(VmDeliveryInfMapper.class)
  171. .updateByPrimaryKeySelective(delInf);
  172. Map<String,String> mapNew = new HashMap<String,String>();
  173. mapNew.put("imeiAddr", list.get(0).get("equIMEI"));
  174. mapNew.put("cargoNo", list.get(0).get("cargoWay"));
  175. mapNew.put("deliveryNo", deliveryNo);
  176. mapNew.put("channel", user.getChannel());
  177. mapNew.put("returnUrl", returnUrl);
  178. mapNew.put("orderNo", orderNo);
  179. mapNew.put("MINView", "JSON");
  180. JSONObject jsonOb = JSONObject.fromObject(mapNew);
  181. String str = jsonOb.toString();
  182. Log.info("通知售货机推货:".concat(str));
  183. String passwardKey = Service.lookup(IPropertiesService.class)
  184. .getSystemProperties().get(user.getChannel() +"_TO_MACHINE_PASSWORD_KEY").getKey();
  185. //数据加密
  186. String desDe = Base64.encode(DesUtils.getInstance().encrypt(Base64.encode(str).getBytes(),passwardKey.getBytes(),null));
  187. String results = HttpPostUtil.sendPostFormachine(sendUrl, desDe);
  188. // //获取转义后响应信息
  189. JSONObject detail = JSONObject.fromObject(results);
  190. String code = String.valueOf(detail.get("code"));
  191. if(!"0".equals(code)){
  192. Log.info("售货机退货失败:".concat(code));
  193. //改变提货状态为3卡货(提货失败)....
  194. delInf.setStatus("3");
  195. //处理提货状态
  196. Service.lookup(IMINDataBaseService.class)
  197. .getMybatisMapper(VmDeliveryInfMapper.class)
  198. .updateByPrimaryKeySelective(delInf);
  199. throw new BusinessCodeException("JINM0011");//操作失败!
  200. }
  201. //获取处理状态
  202. String state = String.valueOf(detail.get("returnData"));
  203. JSONObject stateNew = JSONObject.fromObject(state);
  204. if(stateNew != null
  205. && !"200".equals(String.valueOf(stateNew.get("code")))){
  206. Log.info("售货机退货卡货:".concat(CommonUtil.objToString(stateNew.get("msg"))));
  207. //改变提货状态为3卡货....
  208. delInf.setStatus("3");
  209. //处理提货状态
  210. Service.lookup(IMINDataBaseService.class)
  211. .getMybatisMapper(VmDeliveryInfMapper.class)
  212. .updateByPrimaryKeySelective(delInf);
  213. String msg = String.valueOf(stateNew.get("msg"));
  214. throw new MINBusinessException(msg);//操作失败!
  215. }else if("200".equals(String.valueOf(stateNew.get("code")))){
  216. }
  217. return res;
  218. }
  219. /**
  220. * 提货回调
  221. * @param response
  222. * @param deliveryNo
  223. * @param outNums
  224. * @param status
  225. * @param failReason
  226. * @throws MINBusinessException
  227. */
  228. @MINAction(value = BACK_DELIVERY_FOR_MACHINE,session = false)
  229. public void backDeliveryForMachine(HttpServletResponse response,
  230. String deliveryNo,
  231. String outNums,
  232. String status,
  233. String failReason) throws MINBusinessException {
  234. // 给第三方传递回调成功信息
  235. try {
  236. if(response != null) {
  237. response.getOutputStream().write("Success".getBytes());
  238. response.flushBuffer();
  239. }
  240. } catch (IOException e) {
  241. e.printStackTrace();
  242. }
  243. // 出货后维护销量
  244. VmDeliveryInf delInf = Service.lookup(IMINDataBaseService.class)
  245. .getMybatisMapper(VmDeliveryInfMapper.class).selectByPrimaryKey(deliveryNo);
  246. //处理数量
  247. if(CommonUtil.isEmpty(outNums)){
  248. outNums = "0";
  249. }
  250. String newDelNUms = CommonUtil.add(delInf.getDeliveryNums(), outNums);
  251. int compare = CommonUtil.compare(delInf.getProNums(), newDelNUms);
  252. if(0 == compare ){
  253. delInf.setStatus("2");//已出货
  254. }else if(compare > 0){
  255. delInf.setStatus("1");//部分出货
  256. }
  257. delInf.setDeliveryNums(newDelNUms);
  258. //维护出货状态和数量
  259. Service.lookup(IMINDataBaseService.class)
  260. .getMybatisMapper(VmDeliveryInfMapper.class)
  261. .updateByPrimaryKeySelective(delInf);
  262. }
  263. /**
  264. * 创建提货信息
  265. * @return
  266. * @throws BusinessCodeException
  267. * @throws MINBusinessException
  268. */
  269. //@MINAction(value = "createDeliveryInfo",session = false)
  270. public static void createDeliveryInfo(
  271. List<DrawDto> drawDtoList
  272. ) throws BusinessCodeException, MINBusinessException{
  273. String nowTime = DateUtil.getCurrentDateTimeString();
  274. for (int i = 0; i < drawDtoList.size(); i++) {
  275. DrawDto drawDto = drawDtoList.get(i);
  276. String orderId = drawDto.getOrderId();
  277. String orderDetailsId = drawDto.getOrderDetailsId();
  278. //获取订单信息
  279. VmOrderInf ordInf = Service.lookup(IMINDataBaseService.class)
  280. .getMybatisMapper(VmOrderInfMapper.class)
  281. .selectByPrimaryKey(orderId);
  282. if(ordInf == null){
  283. throw new BusinessCodeException("JINM0114");//订单信息不存在
  284. }else{
  285. if(!"00".equals(ordInf.getState())){
  286. throw new BusinessCodeException("JINM1105");//当前商品未支付,请支付后才可以提货
  287. }
  288. }
  289. VmOrderDetails detInf = Service.lookup(IMINDataBaseService.class)
  290. .getMybatisMapper(VmOrderDetailsMapper.class)
  291. .selectByPrimaryKey(orderDetailsId);
  292. //中奖的
  293. if(drawDto.isDraw()){
  294. //创建提货对象
  295. VmDeliveryInf dlInf = new VmDeliveryInf();
  296. //获取提货表主键
  297. String dlId = Service.lookup(IPublicService.class).getSequence("VM_DELIVERY_INF_ID");
  298. dlInf.setDeliveryId(dlId); //提货编号
  299. dlInf.setChannel(ordInf.getChannel()); //渠道
  300. dlInf.setEquipmentId(ordInf.getEquipmentId());//售货机编号
  301. dlInf.setPersonId(ordInf.getPersonId()); //会员编号
  302. dlInf.setOrdDetId(detInf.getDetailsId()); //订单详情编号
  303. dlInf.setProType(detInf.getProType()); //商品交易类别:00正常商品01抽奖商品
  304. dlInf.setProName(detInf.getProName()); //商品名称
  305. dlInf.setProPrice(detInf.getProPrice()); //单价
  306. dlInf.setProNums(detInf.getProNums()); //为空取订单中的数量
  307. dlInf.setAmount(detInf.getAmount()); //金额
  308. dlInf.setStatus("0"); //0未提货1部分提货2已提货3卡货4清零
  309. dlInf.setDeliveryNums("0"); //默认未提货/提货数量为0
  310. dlInf.setCargoWay(detInf.getCargoWay()); //商品所在货道
  311. dlInf.setRemarks("会员下单,售货机编号:"+ordInf.getEquipmentId());//备注
  312. dlInf.setCreateUser(ordInf.getPersonId()); //创建人
  313. dlInf.setCreateTime(nowTime); //创建时间
  314. dlInf.setModifyUser(ordInf.getPersonId()); //修改人
  315. dlInf.setModifyTime(nowTime); //修改时间
  316. dlInf.setBranchid(ordInf.getBranchid());
  317. dlInf.setProEquRelId(detInf.getProEquRelId());
  318. //执行新增提货信息
  319. Service.lookup(IMINDataBaseService.class)
  320. .getMybatisMapper(VmDeliveryInfMapper.class)
  321. .insertSelective(dlInf);
  322. //更新订单详情
  323. detInf.setDeliveryId(dlId);
  324. detInf.setIsWinning("01");
  325. detInf.setIsDelivery("01");
  326. Service.lookup(IMINDataBaseService.class)
  327. .getMybatisMapper(VmOrderDetailsMapper.class)
  328. .updateByPrimaryKeySelective(detInf);
  329. /**没有中奖的*/
  330. }else{
  331. detInf.setIsWinning("02");
  332. Service.lookup(IMINDataBaseService.class)
  333. .getMybatisMapper(VmOrderDetailsMapper.class)
  334. .updateByPrimaryKeySelective(detInf);
  335. }
  336. }
  337. }
  338. /**
  339. * 创建提货信息
  340. * @param orderNo 订单编号
  341. * @return
  342. * @throws BusinessCodeException
  343. * @throws MINBusinessException
  344. */
  345. //@MINAction(value = "createDeliveryInfo",session = false)
  346. public MINActionResult createDeliveryInfoTwo(
  347. // @MINParam(key = "orderNo")
  348. String orderNo
  349. ) throws BusinessCodeException, MINBusinessException{
  350. MINActionResult res = new MINActionResult();
  351. String nowTime = DateUtil.getCurrentDateTimeString();
  352. //获取订单信息
  353. VmOrderInf ordInf = Service.lookup(IMINDataBaseService.class)
  354. .getMybatisMapper(VmOrderInfMapper.class)
  355. .selectByPrimaryKey(orderNo);
  356. if(ordInf == null){
  357. throw new BusinessCodeException("JINM0114");//订单信息不存在
  358. }else{
  359. if(!"00".equals(ordInf.getState())){
  360. throw new BusinessCodeException("JINM1105");//当前商品未支付,请支付后才可以提货
  361. }
  362. }
  363. //获取已支付的,待提货的订单商品信息
  364. VmOrderDetailsExample examp = new VmOrderDetailsExample();
  365. examp.createCriteria().andChannelEqualTo(ordInf.getChannel()).andOrderIdEqualTo(orderNo);
  366. List<VmOrderDetails> ordetList = Service.lookup(IMINDataBaseService.class)
  367. .getMybatisMapper(VmOrderDetailsMapper.class)
  368. .selectByExample(examp);
  369. for (int i = 0; i < ordetList.size(); i++) {
  370. VmOrderDetails detInf = ordetList.get(i);
  371. if(detInf != null){
  372. //创建提货对象
  373. VmDeliveryInf dlInf = new VmDeliveryInf();
  374. //获取提货表主键
  375. String dlId = Service.lookup(IPublicService.class).getSequence("VM_DELIVERY_INF_ID");
  376. res.set("dlId", dlId);
  377. dlInf.setDeliveryId(dlId); //提货编号
  378. dlInf.setChannel(ordInf.getChannel()); //渠道
  379. dlInf.setEquipmentId(ordInf.getEquipmentId());//售货机编号
  380. dlInf.setPersonId(ordInf.getPersonId()); //会员编号
  381. dlInf.setOrdDetId(detInf.getDetailsId()); //订单详情编号
  382. dlInf.setProType(detInf.getProType()); //商品交易类别:00正常商品01抽奖商品
  383. dlInf.setProName(detInf.getProName()); //商品名称
  384. dlInf.setProPrice(detInf.getProPrice()); //单价
  385. dlInf.setProNums(detInf.getProNums()); //数量
  386. dlInf.setAmount(detInf.getAmount()); //金额
  387. dlInf.setStatus("0"); //0未提货1部分提货2已提货3卡货4清零
  388. dlInf.setDeliveryNums("0"); //默认未提货/提货数量为0
  389. dlInf.setCargoWay(detInf.getCargoWay()); //商品所在货道
  390. dlInf.setRemarks("会员下单,售货机编号:"+ordInf.getEquipmentId());//备注
  391. dlInf.setCreateUser(ordInf.getPersonId()); //创建人
  392. dlInf.setCreateTime(nowTime); //创建时间
  393. dlInf.setModifyUser(ordInf.getPersonId()); //修改人
  394. dlInf.setModifyTime(nowTime); //修改时间
  395. //执行新增提货信息
  396. Service.lookup(IMINDataBaseService.class)
  397. .getMybatisMapper(VmDeliveryInfMapper.class)
  398. .insert(dlInf);
  399. }
  400. }
  401. return res;
  402. }
  403. /**
  404. * 创建提货信息
  405. * @param orderNo 订单编号
  406. * @return
  407. * @throws BusinessCodeException
  408. * @throws MINBusinessException
  409. */
  410. //@MINAction(value = "createDeliveryInfo",session = false)
  411. public static void purchaseCreateDeliveryInfo(
  412. String orderNo,String drawNumber
  413. ) throws BusinessCodeException, MINBusinessException{
  414. String nowTime = DateUtil.getCurrentDateTimeString();
  415. //获取订单信息
  416. VmOrderInf ordInf = Service.lookup(IMINDataBaseService.class)
  417. .getMybatisMapper(VmOrderInfMapper.class)
  418. .selectByPrimaryKey(orderNo);
  419. if(ordInf == null){
  420. throw new BusinessCodeException("JINM0114");//订单信息不存在
  421. }else{
  422. if(!"00".equals(ordInf.getState())){
  423. throw new BusinessCodeException("JINM1105");//当前商品未支付,请支付后才可以提货
  424. }
  425. }
  426. //获取已支付的,待提货的订单商品信息
  427. VmOrderDetailsExample examp = new VmOrderDetailsExample();
  428. examp.createCriteria().andChannelEqualTo(ordInf.getChannel()).andOrderIdEqualTo(orderNo);
  429. List<VmOrderDetails> ordetList = Service.lookup(IMINDataBaseService.class)
  430. .getMybatisMapper(VmOrderDetailsMapper.class)
  431. .selectByExample(examp);
  432. for (int i = 0; i < ordetList.size(); i++) {
  433. VmOrderDetails detInf = ordetList.get(i);
  434. if(detInf != null){
  435. //创建提货对象
  436. VmDeliveryInf dlInf = new VmDeliveryInf();
  437. //获取提货表主键
  438. String dlId = Service.lookup(IPublicService.class).getSequence("VM_DELIVERY_INF_ID");
  439. dlInf.setDeliveryId(dlId); //提货编号
  440. dlInf.setChannel(ordInf.getChannel()); //渠道
  441. dlInf.setEquipmentId(ordInf.getEquipmentId());//售货机编号
  442. dlInf.setPersonId(ordInf.getPersonId()); //会员编号
  443. dlInf.setOrdDetId(detInf.getDetailsId()); //订单详情编号
  444. dlInf.setProType(detInf.getProType()); //商品交易类别:00正常商品01抽奖商品
  445. dlInf.setProName(detInf.getProName()); //商品名称
  446. dlInf.setProPrice(detInf.getProPrice()); //单价
  447. if(!CommonUtil.isEmpty(drawNumber)){
  448. dlInf.setProNums(drawNumber); //数量
  449. }else{
  450. dlInf.setProNums(detInf.getProNums()); //为空取订单中的数量
  451. }
  452. dlInf.setAmount(detInf.getAmount()); //金额
  453. dlInf.setStatus("0"); //0未提货1部分提货2已提货3卡货4清零
  454. dlInf.setDeliveryNums("0"); //默认未提货/提货数量为0
  455. dlInf.setCargoWay(detInf.getCargoWay()); //商品所在货道
  456. dlInf.setRemarks("会员下单,售货机编号:"+ordInf.getEquipmentId());//备注
  457. dlInf.setCreateUser(ordInf.getPersonId()); //创建人
  458. dlInf.setCreateTime(nowTime); //创建时间
  459. dlInf.setModifyUser(ordInf.getPersonId()); //修改人
  460. dlInf.setModifyTime(nowTime); //修改时间
  461. dlInf.setProEquRelId(detInf.getProEquRelId()); //货道编号
  462. //执行新增提货信息
  463. Service.lookup(IMINDataBaseService.class)
  464. .getMybatisMapper(VmDeliveryInfMapper.class)
  465. .insert(dlInf);
  466. //订单明细表set提货单编号
  467. detInf.setDeliveryId(dlId);
  468. Service.lookup(IMINDataBaseService.class)
  469. .getMybatisMapper(VmOrderDetailsMapper.class)
  470. .updateByPrimaryKeySelective(detInf);
  471. }
  472. }
  473. }
  474. }