| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.DocTypeService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/7/7 |
| | |
| | | |
| | | @Transactional |
| | | public ReturnT<String> start(Order order) { |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("id",order.getOrderNo()); |
| | | param.put("dDate",new Date()); |
| | | param.put("cHandler",9527); |
| | | param.put("dDate",sdf.format(new Date())); |
| | | param.put("cHandler",""); |
| | | |
| | | List<Map<String,Object>> orderDetlsParam = new ArrayList<>(); |
| | | param.put("orderDetails",orderDetlsParam); |
| | | |
| | | List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); |
| | | |
| | | for (OrderDetl orderDetl : orderDetls){ |
| | | Map<String, Object> odMap = new HashMap<>(); |
| | | odMap.put("autoid",orderDetl.getItemNum()); |
| | | odMap.put("iQuantity",orderDetl.getQty()); |
| | | orderDetlsParam.add(odMap); |
| | | } |
| | | |
| | | // Map<String, Object> param = new HashMap<>(); |
| | | // param.put("id",order.getOrderNo()); |
| | | // param.put("dDate",new Date()); |
| | | // param.put("cHandler",9527); |
| | | |
| | | int code = doHttpRequest(param, "单据审核", url, orderReportPath, null, "127.0.0.1"); |
| | | if(code == 200){ |
| | | if(code == 0){ |
| | | order.setSettle(6L); |
| | | orderService.updateById(order); |
| | | } |
| | |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | |
| | | int code = (int) jsonObject.get("code"); |
| | | if(code != 200){ |
| | | throw new CoolException(jsonObject.get("msg").toString()); |
| | | if(Cools.isEmpty(jsonObject.get("errCode"))){ |
| | | throw new CoolException(jsonObject.get("Message").toString()); |
| | | } |
| | | |
| | | int code = (int) jsonObject.get("errCode"); |
| | | if(code != 0){ |
| | | throw new CoolException(jsonObject.get("errMsg").toString()); |
| | | } |
| | | success = true; |
| | | return code; |