| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.fasterxml.jackson.databind.JsonNode; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.zy.asrs.entity.DocType; |
| | | 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 com.zy.asrs.service.OrderService; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Autowired |
| | |
| | | |
| | | //条件拼接 |
| | | log.info("条件拼接"); |
| | | String entryIds = null; |
| | | if (kingDeeUtilType.entryId==1){ |
| | | List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); |
| | | for (OrderDetl orderDetl:orderDetls){ |
| | | if (Cools.isEmpty(entryIds)){ |
| | | entryIds = orderDetl.getBeBatch().toString(); |
| | | }else { |
| | | entryIds = entryIds+"," +orderDetl.getBeBatch(); |
| | | } |
| | | } |
| | | orderNoS = ""; |
| | | } |
| | | if (Cools.isEmpty(entryIds)){ |
| | | entryIds = ""; |
| | | } |
| | | |
| | | JSONObject dataJsonObject = new JSONObject(); |
| | | dataJsonObject.put("Numbers",orderNoS); |
| | | dataJsonObject.put("EntryIds",""); |
| | | dataJsonObject.put("EntryIds",entryIds); |
| | | dataJsonObject.put("RuleId",kingDeeUtilType.ruleId); |
| | | dataJsonObject.put("TargetFormId",kingDeeUtilType.correspondingFormId); |
| | | |
| | |
| | | .setHttps(true) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject data = JSON.parseObject(response); |
| | | // JSONObject data = JSON.parseObject(response); |
| | | log.info("下推response:"+response); |
| | | Object IsSuccess = findValueByKey(JSON.parseObject(response), "IsSuccess"); |
| | | String bool=IsSuccess.toString(); |
| | | // Object IsSuccess = findValueByKey(JSON.parseObject(response), "IsSuccess"); |
| | | // String bool=IsSuccess.toString(); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | JsonNode rootNode = objectMapper.readTree(response); |
| | | boolean bool = rootNode.get("Result").get("ResponseStatus").get("IsSuccess").asBoolean(); |
| | | log.info("下推bool:"+bool); |
| | | |
| | | //下推完成原订单4转6 6.上报完成 |
| | | if(bool.equals("true")){ |
| | | if(bool){ |
| | | success = true; |
| | | order.setSettle(6L); |
| | | order.setUpdateTime(new Date()); |
| | | orderService.update(order,new EntityWrapper<Order>().eq("order_no",order.getOrderNo())); |
| | | } |
| | | } catch (Exception e) { |