20 changed files with 678 additions and 12 deletions
@ -0,0 +1,73 @@ |
|||||||
|
package com.logpm.factory.oupai.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
@Data |
||||||
|
@TableName("op_out_going_order") |
||||||
|
@ApiModel(value = "OpOutGoingOrder对象", description = "欧派工厂配送单") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class OpOutGoingOrderEntity extends BaseEntity { |
||||||
|
|
||||||
|
/** 预留1 */ |
||||||
|
@ApiModelProperty(name = "预留1",notes = "") |
||||||
|
private String reserve1 ; |
||||||
|
/** 预留2 */ |
||||||
|
@ApiModelProperty(name = "预留2",notes = "") |
||||||
|
private String reserve2 ; |
||||||
|
/** 预留3 */ |
||||||
|
@ApiModelProperty(name = "预留3",notes = "") |
||||||
|
private String reserve3 ; |
||||||
|
/** 预留4 */ |
||||||
|
@ApiModelProperty(name = "预留4",notes = "") |
||||||
|
private String reserve4 ; |
||||||
|
/** 预留5 */ |
||||||
|
@ApiModelProperty(name = "预留5",notes = "") |
||||||
|
private String reserve5 ; |
||||||
|
|
||||||
|
/** 配送单编码 */ |
||||||
|
@ApiModelProperty(name = "配送单编码",notes = "") |
||||||
|
private String code ; |
||||||
|
/** 配送单状态 */ |
||||||
|
@ApiModelProperty(name = "配送单状态",notes = "") |
||||||
|
private Integer outGoingOrderStatus ; |
||||||
|
/** 配送仓库编码 */ |
||||||
|
@ApiModelProperty(name = "配送仓库编码",notes = "") |
||||||
|
private String warehouseCode ; |
||||||
|
/** 配送仓库名称 */ |
||||||
|
@ApiModelProperty(name = "配送仓库名称",notes = "") |
||||||
|
private String warehouseName ; |
||||||
|
/** 配送仓库地址 */ |
||||||
|
@ApiModelProperty(name = "配送仓库地址",notes = "") |
||||||
|
private String warehouseAddress ; |
||||||
|
/** 配送车牌号 */ |
||||||
|
@ApiModelProperty(name = "配送车牌号",notes = "") |
||||||
|
private String truckPlate ; |
||||||
|
/** 配送日期 */ |
||||||
|
@ApiModelProperty(name = "配送日期",notes = "") |
||||||
|
private Date deliveryDate ; |
||||||
|
/** 创建者 */ |
||||||
|
@ApiModelProperty(name = "创建者",notes = "") |
||||||
|
private String creator ; |
||||||
|
/** 创建时间 */ |
||||||
|
@ApiModelProperty(name = "创建时间",notes = "") |
||||||
|
private Date createTime ; |
||||||
|
@ApiModelProperty(name = "门店编码",notes = "") |
||||||
|
private String storeCode; |
||||||
|
@ApiModelProperty(name = "门店名称",notes = "") |
||||||
|
private String storeName; |
||||||
|
@ApiModelProperty(name = "商场编码",notes = "") |
||||||
|
private String shopCode; |
||||||
|
@ApiModelProperty(name = "商场名称",notes = "") |
||||||
|
private String shopName; |
||||||
|
/** 发货时间 */ |
||||||
|
@ApiModelProperty(name = "发货时间",notes = "") |
||||||
|
private Date sendTime ; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,89 @@ |
|||||||
|
package com.logpm.factory.oupai.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
@Data |
||||||
|
@TableName("op_sign_bill") |
||||||
|
@ApiModel(value = "OpSignBill对象", description = "欧派工厂签收单") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class OpSignBillEntity extends BaseEntity { |
||||||
|
|
||||||
|
/** 预留1 */ |
||||||
|
@ApiModelProperty(name = "预留1",notes = "") |
||||||
|
private String reserve1 ; |
||||||
|
/** 预留2 */ |
||||||
|
@ApiModelProperty(name = "预留2",notes = "") |
||||||
|
private String reserve2 ; |
||||||
|
/** 预留3 */ |
||||||
|
@ApiModelProperty(name = "预留3",notes = "") |
||||||
|
private String reserve3 ; |
||||||
|
/** 预留4 */ |
||||||
|
@ApiModelProperty(name = "预留4",notes = "") |
||||||
|
private String reserve4 ; |
||||||
|
/** 预留5 */ |
||||||
|
@ApiModelProperty(name = "预留5",notes = "") |
||||||
|
private String reserve5 ; |
||||||
|
|
||||||
|
@ApiModelProperty(name = "配送单id",notes = "") |
||||||
|
private Long outGoingOrderId ; |
||||||
|
@ApiModelProperty(name = "签收单号",notes = "") |
||||||
|
private String code ; |
||||||
|
/** |
||||||
|
* 新建:0 |
||||||
|
* |
||||||
|
* 已签收:1 |
||||||
|
* |
||||||
|
* 部分签收:2 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(name = "状态",notes = "") |
||||||
|
private Integer signBillStatus ; |
||||||
|
@ApiModelProperty(name = "签收人",notes = "") |
||||||
|
private String signPerson ; |
||||||
|
@ApiModelProperty(name = "签收人电话",notes = "") |
||||||
|
private String signPhone ; |
||||||
|
@ApiModelProperty(name = "签收人地址",notes = "") |
||||||
|
private String signAddress ; |
||||||
|
@ApiModelProperty(name = "签收时间",notes = "") |
||||||
|
private Date signTime ; |
||||||
|
@ApiModelProperty(name = "签收说明",notes = "") |
||||||
|
private String remark; |
||||||
|
@ApiModelProperty(name = "配送单号",notes = "") |
||||||
|
private String outGoingOrderCode; |
||||||
|
@ApiModelProperty(name = "再投原因",notes = "") |
||||||
|
private String againsendReason; |
||||||
|
@ApiModelProperty(name = "再投描述",notes = "") |
||||||
|
private String description; |
||||||
|
@ApiModelProperty(name = "是否再投",notes = "") |
||||||
|
private Integer isAgainsend;//0否1是
|
||||||
|
@ApiModelProperty(name = "创建者",notes = "") |
||||||
|
private String creator; |
||||||
|
@ApiModelProperty(name = "创建时间",notes = "") |
||||||
|
private Date createTime ; |
||||||
|
@ApiModelProperty(name = "顾客评分",notes = "") |
||||||
|
private BigDecimal customerRate ; |
||||||
|
@ApiModelProperty(name = "顾客反馈",notes = "") |
||||||
|
private String customerFeedback; |
||||||
|
@ApiModelProperty(name = "门店编码",notes = "") |
||||||
|
private String storeCode; |
||||||
|
@ApiModelProperty(name = "门店名称",notes = "") |
||||||
|
private String storeName; |
||||||
|
@ApiModelProperty(name = "商场编码",notes = "") |
||||||
|
private String shopCode; |
||||||
|
@ApiModelProperty(name = "商场名称",notes = "") |
||||||
|
private String shopName; |
||||||
|
@ApiModelProperty(name = "司机电话",notes = "") |
||||||
|
private String driverPhone; |
||||||
|
@ApiModelProperty(name = "司机名称",notes = "") |
||||||
|
private String driverName; |
||||||
|
@ApiModelProperty(name = "配送日期",notes = "") |
||||||
|
private Date deliveryTime; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,44 @@ |
|||||||
|
package com.logpm.factory.oupai.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
@Data |
||||||
|
@TableName("op_sign_package") |
||||||
|
@ApiModel(value = "OpSignPackage对象", description = "欧派工厂签收包件") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class OpSignPackageEntity extends BaseEntity { |
||||||
|
|
||||||
|
/** 预留1 */ |
||||||
|
@ApiModelProperty(name = "预留1",notes = "") |
||||||
|
private String reserve1 ; |
||||||
|
/** 预留2 */ |
||||||
|
@ApiModelProperty(name = "预留2",notes = "") |
||||||
|
private String reserve2 ; |
||||||
|
/** 预留3 */ |
||||||
|
@ApiModelProperty(name = "预留3",notes = "") |
||||||
|
private String reserve3 ; |
||||||
|
/** 预留4 */ |
||||||
|
@ApiModelProperty(name = "预留4",notes = "") |
||||||
|
private String reserve4 ; |
||||||
|
/** 预留5 */ |
||||||
|
@ApiModelProperty(name = "预留5",notes = "") |
||||||
|
private String reserve5 ; |
||||||
|
|
||||||
|
|
||||||
|
private Long signBillId; |
||||||
|
/** 包件码 */ |
||||||
|
@ApiModelProperty(name = "包件码",notes = "") |
||||||
|
private String orderPackageCode ; |
||||||
|
/** 签收状态 */ |
||||||
|
@ApiModelProperty(name = "签收状态",notes = "") |
||||||
|
private Integer packageStatus ; |
||||||
|
/** 是否是库存品 */ |
||||||
|
@ApiModelProperty(name = "是否是库存品",notes = "") |
||||||
|
private Integer isInventory ;//0否 1是
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,12 @@ |
|||||||
|
package com.logpm.factory.oupai.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.logpm.factory.oupai.entity.OpOutGoingOrderEntity; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
@Mapper |
||||||
|
public interface OpOutGoingOrderMapper extends BaseMapper<OpOutGoingOrderEntity> { |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="com.logpm.factory.oupai.mapper.OpOutGoingOrderMapper"> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,9 @@ |
|||||||
|
package com.logpm.factory.oupai.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.logpm.factory.oupai.entity.OpSignBillEntity; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
@Mapper |
||||||
|
public interface OpSignBillMapper extends BaseMapper<OpSignBillEntity> { |
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="com.logpm.factory.oupai.mapper.OpSignBillMapper"> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,9 @@ |
|||||||
|
package com.logpm.factory.oupai.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.logpm.factory.oupai.entity.OpSignPackageEntity; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
@Mapper |
||||||
|
public interface OpSignPackageMapper extends BaseMapper<OpSignPackageEntity> { |
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="com.logpm.factory.oupai.mapper.OpSignPackageMapper"> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,274 @@ |
|||||||
|
package com.logpm.factory.oupai.receiver; |
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray; |
||||||
|
import com.alibaba.fastjson.JSONObject; |
||||||
|
import com.logpm.factory.oupai.entity.OpOrderStatusLogEntity; |
||||||
|
import com.logpm.factory.oupai.entity.OpOutGoingOrderEntity; |
||||||
|
import com.logpm.factory.oupai.entity.OpSignBillEntity; |
||||||
|
import com.logpm.factory.oupai.entity.OpSignPackageEntity; |
||||||
|
import com.logpm.factory.oupai.service.IOpOutGoingOrderService; |
||||||
|
import com.logpm.factory.oupai.service.IOpSignBillService; |
||||||
|
import com.logpm.factory.oupai.service.IOpSignPackageService; |
||||||
|
import com.rabbitmq.client.Channel; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springblade.common.constant.RabbitConstant; |
||||||
|
import org.springblade.common.utils.CommonUtil; |
||||||
|
import org.springframework.amqp.core.Message; |
||||||
|
import org.springframework.amqp.rabbit.annotation.RabbitHandler; |
||||||
|
import org.springframework.amqp.rabbit.annotation.RabbitListener; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.stereotype.Component; |
||||||
|
|
||||||
|
import java.io.IOException; |
||||||
|
import java.util.Map; |
||||||
|
import java.util.Objects; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 获取订单数据 处理器 |
||||||
|
* |
||||||
|
* @author yangkai.shen |
||||||
|
*/ |
||||||
|
@Slf4j |
||||||
|
@RabbitListener(queues = RabbitConstant.OUPAI_SIGN_QUEUE) |
||||||
|
@Component |
||||||
|
public class OpSignDataHandler { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private IOpOutGoingOrderService opOutGoingOrderService; |
||||||
|
@Autowired |
||||||
|
private IOpSignBillService opSignBillService; |
||||||
|
@Autowired |
||||||
|
private IOpSignPackageService opSignPackageService; |
||||||
|
|
||||||
|
|
||||||
|
@RabbitHandler |
||||||
|
public void opSignDataHandler(Map map, Message message, Channel channel) throws IOException { |
||||||
|
// 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉
|
||||||
|
log.info("##################opSignDataHandler: 处理欧派收货数据到新系统"); |
||||||
|
OpOrderStatusLogEntity opOrderStatusLogEntity = (OpOrderStatusLogEntity) map.get("messageData"); |
||||||
|
String args = opOrderStatusLogEntity.getArgs(); |
||||||
|
JSONObject jsonObject = JSONObject.parseObject(args); |
||||||
|
JSONArray jsonArray = jsonObject.getJSONArray("value"); |
||||||
|
for (int i = 0; i < jsonArray.size(); i++) { |
||||||
|
JSONObject valueObject = jsonArray.getJSONObject(i); |
||||||
|
JSONObject outGoingOrder = valueObject.getJSONObject("OutGoingOrder"); |
||||||
|
String outGoingOrderCode = outGoingOrder.getString("Code"); |
||||||
|
JSONObject store = valueObject.getJSONObject("Store"); |
||||||
|
JSONArray packages = valueObject.getJSONArray("Packages"); |
||||||
|
String status = outGoingOrder.getString("Status"); |
||||||
|
//先查询是否已经有数据存在系统中
|
||||||
|
OpOutGoingOrderEntity opOutGoingOrderEntity = opOutGoingOrderService.getEntityByCode(outGoingOrderCode); |
||||||
|
Long outGoingOrderId = null; |
||||||
|
if(Objects.isNull(opOutGoingOrderEntity)){ |
||||||
|
//如果是空则新增
|
||||||
|
opOutGoingOrderEntity = new OpOutGoingOrderEntity(); |
||||||
|
opOutGoingOrderEntity.setCode(outGoingOrderCode); |
||||||
|
if("新建".equals(status)){ |
||||||
|
opOutGoingOrderEntity.setOutGoingOrderStatus(0); |
||||||
|
}else if("已调度".equals(status)){ |
||||||
|
opOutGoingOrderEntity.setOutGoingOrderStatus(1); |
||||||
|
}else if("已发运".equals(status)){ |
||||||
|
opOutGoingOrderEntity.setOutGoingOrderStatus(2); |
||||||
|
}else if("已签收".equals(status)){ |
||||||
|
opOutGoingOrderEntity.setOutGoingOrderStatus(3); |
||||||
|
}else if("部分签收".equals(status)){ |
||||||
|
opOutGoingOrderEntity.setOutGoingOrderStatus(4); |
||||||
|
}else if("待处理".equals(status)){ |
||||||
|
opOutGoingOrderEntity.setOutGoingOrderStatus(5); |
||||||
|
} |
||||||
|
JSONObject warehouse = outGoingOrder.getJSONObject("Warehouse"); |
||||||
|
if(!Objects.isNull(warehouse)){ |
||||||
|
opOutGoingOrderEntity.setWarehouseCode(warehouse.getString("Code")); |
||||||
|
opOutGoingOrderEntity.setWarehouseName(warehouse.getString("Name")); |
||||||
|
opOutGoingOrderEntity.setWarehouseAddress(warehouse.getString("Address")); |
||||||
|
} |
||||||
|
JSONObject truck = outGoingOrder.getJSONObject("Truck"); |
||||||
|
if(!Objects.isNull(truck)){ |
||||||
|
opOutGoingOrderEntity.setTruckPlate(truck.getString("Plate")); |
||||||
|
} |
||||||
|
opOutGoingOrderEntity.setDeliveryDate(CommonUtil.StringToDate(outGoingOrder.getString("DeliveryDate"))); |
||||||
|
opOutGoingOrderEntity.setCreator(outGoingOrder.getString("Creator")); |
||||||
|
opOutGoingOrderEntity.setCreateTime(CommonUtil.StringToDate(outGoingOrder.getString("CreateTime"))); |
||||||
|
|
||||||
|
if (!Objects.isNull(store)) { |
||||||
|
JSONObject shop = store.getJSONObject("Shop"); |
||||||
|
if(!Objects.isNull(shop)){ |
||||||
|
opOutGoingOrderEntity.setShopCode(shop.getString("Code")); |
||||||
|
opOutGoingOrderEntity.setShopName(shop.getString("Name")); |
||||||
|
} |
||||||
|
opOutGoingOrderEntity.setStoreCode(store.getString("Code")); |
||||||
|
opOutGoingOrderEntity.setStoreName(store.getString("Name")); |
||||||
|
} |
||||||
|
opOutGoingOrderEntity.setSendTime(CommonUtil.StringToDate(outGoingOrder.getString("SendTime"))); |
||||||
|
opOutGoingOrderService.save(opOutGoingOrderEntity); |
||||||
|
outGoingOrderId = opOutGoingOrderEntity.getId(); |
||||||
|
}else{ |
||||||
|
if("新建".equals(status)){ |
||||||
|
opOutGoingOrderEntity.setOutGoingOrderStatus(0); |
||||||
|
}else if("已调度".equals(status)){ |
||||||
|
opOutGoingOrderEntity.setOutGoingOrderStatus(1); |
||||||
|
}else if("已发运".equals(status)){ |
||||||
|
opOutGoingOrderEntity.setOutGoingOrderStatus(2); |
||||||
|
}else if("已签收".equals(status)){ |
||||||
|
opOutGoingOrderEntity.setOutGoingOrderStatus(3); |
||||||
|
}else if("部分签收".equals(status)){ |
||||||
|
opOutGoingOrderEntity.setOutGoingOrderStatus(4); |
||||||
|
}else if("待处理".equals(status)){ |
||||||
|
opOutGoingOrderEntity.setOutGoingOrderStatus(5); |
||||||
|
} |
||||||
|
opOutGoingOrderService.updateById(opOutGoingOrderEntity); |
||||||
|
outGoingOrderId = opOutGoingOrderEntity.getId(); |
||||||
|
} |
||||||
|
|
||||||
|
//处理签收单数据
|
||||||
|
Long signBillId = null; |
||||||
|
String recevierCode = valueObject.getString("Code"); |
||||||
|
String SignBillStatus = valueObject.getString("Status"); |
||||||
|
OpSignBillEntity signBillEntity = opSignBillService.findEntityByCode(recevierCode); |
||||||
|
if(Objects.isNull(signBillEntity)){ |
||||||
|
signBillEntity = new OpSignBillEntity(); |
||||||
|
signBillEntity.setOutGoingOrderId(outGoingOrderId); |
||||||
|
signBillEntity.setCode(recevierCode); |
||||||
|
if("新建".equals(SignBillStatus)){ |
||||||
|
signBillEntity.setSignBillStatus(0); |
||||||
|
}else if("已签收".equals(SignBillStatus)){ |
||||||
|
signBillEntity.setSignBillStatus(1); |
||||||
|
}else if("部分签收".equals(SignBillStatus)){ |
||||||
|
signBillEntity.setSignBillStatus(2); |
||||||
|
} |
||||||
|
signBillEntity.setSignPerson(valueObject.getString("SignPerson")); |
||||||
|
signBillEntity.setSignPhone(valueObject.getString("SignPhone")); |
||||||
|
signBillEntity.setSignAddress(valueObject.getString("SignAddress")); |
||||||
|
signBillEntity.setSignTime(CommonUtil.StringToDate(valueObject.getString("SignTime"))); |
||||||
|
signBillEntity.setRemark(valueObject.getString("Remark")); |
||||||
|
signBillEntity.setOutGoingOrderCode(outGoingOrderCode); |
||||||
|
signBillEntity.setAgainsendReason(valueObject.getString("AgainsendReason")); |
||||||
|
signBillEntity.setDescription(valueObject.getString("Description")); |
||||||
|
Boolean isAgainsend = valueObject.getBoolean("IsAgainsend"); |
||||||
|
if(isAgainsend){ |
||||||
|
signBillEntity.setIsAgainsend(1); |
||||||
|
}else{ |
||||||
|
signBillEntity.setIsAgainsend(0); |
||||||
|
} |
||||||
|
signBillEntity.setCreator(valueObject.getString("Creator")); |
||||||
|
signBillEntity.setCreateTime(CommonUtil.StringToDate(valueObject.getString("CreateTime"))); |
||||||
|
signBillEntity.setCustomerRate(valueObject.getBigDecimal("CustomerRate")); |
||||||
|
signBillEntity.setCustomerFeedback(valueObject.getString("CustomerFeedback")); |
||||||
|
if (!Objects.isNull(store)) { |
||||||
|
JSONObject shop = store.getJSONObject("Shop"); |
||||||
|
if(!Objects.isNull(shop)){ |
||||||
|
signBillEntity.setShopCode(shop.getString("Code")); |
||||||
|
signBillEntity.setShopName(shop.getString("Name")); |
||||||
|
} |
||||||
|
signBillEntity.setStoreCode(store.getString("Code")); |
||||||
|
signBillEntity.setStoreName(store.getString("Name")); |
||||||
|
} |
||||||
|
signBillEntity.setDriverPhone(valueObject.getString("DriverPhone")); |
||||||
|
signBillEntity.setDriverName(valueObject.getString("DriverName")); |
||||||
|
signBillEntity.setDeliveryTime(CommonUtil.StringToDate(valueObject.getString("DeliveryTime"))); |
||||||
|
opSignBillService.save(signBillEntity); |
||||||
|
signBillId = signBillEntity.getId(); |
||||||
|
}else{ |
||||||
|
if("新建".equals(SignBillStatus)){ |
||||||
|
signBillEntity.setSignBillStatus(0); |
||||||
|
}else if("已签收".equals(SignBillStatus)){ |
||||||
|
signBillEntity.setSignBillStatus(1); |
||||||
|
}else if("部分签收".equals(SignBillStatus)){ |
||||||
|
signBillEntity.setSignBillStatus(2); |
||||||
|
} |
||||||
|
opSignBillService.updateById(signBillEntity); |
||||||
|
signBillId = signBillEntity.getId(); |
||||||
|
} |
||||||
|
|
||||||
|
//存入包件数据
|
||||||
|
for (int j = 0; j <packages.size(); j++) { |
||||||
|
JSONObject packagesJSONObject = packages.getJSONObject(j); |
||||||
|
String code = packagesJSONObject.getString("Code"); |
||||||
|
String packageStatus = packagesJSONObject.getString("PackageStatus"); |
||||||
|
OpSignPackageEntity signPackageEntity = opSignPackageService.findEntityByOrderPackageCode(code); |
||||||
|
if(Objects.isNull(signPackageEntity)){ |
||||||
|
signPackageEntity = new OpSignPackageEntity(); |
||||||
|
signPackageEntity.setSignBillId(signBillId); |
||||||
|
signPackageEntity.setOrderPackageCode(code); |
||||||
|
if ("已调度".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(1); |
||||||
|
} else if ("已装车".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(2); |
||||||
|
} else if ("待收货".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(3); |
||||||
|
} else if ("已收货".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(4); |
||||||
|
} else if ("已在库".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(5); |
||||||
|
} else if ("待理货".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(6); |
||||||
|
} else if ("待上架".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(7); |
||||||
|
} else if ("已上架".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(8); |
||||||
|
} else if ("已下架".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(9); |
||||||
|
} else if ("已发运".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(10); |
||||||
|
} else if ("已签收".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(11); |
||||||
|
} else if ("待返货".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(12); |
||||||
|
} else if ("已提件".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(13); |
||||||
|
} else if ("已拒收".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(14); |
||||||
|
} else if ("异常".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(-1); |
||||||
|
} else { |
||||||
|
signPackageEntity.setPackageStatus(0); |
||||||
|
} |
||||||
|
|
||||||
|
Boolean isInventory = packagesJSONObject.getBoolean("IsInventory"); |
||||||
|
if(isInventory){ |
||||||
|
signPackageEntity.setIsInventory(1); |
||||||
|
}else{ |
||||||
|
signPackageEntity.setIsInventory(0); |
||||||
|
} |
||||||
|
opSignPackageService.save(signPackageEntity); |
||||||
|
}else{ |
||||||
|
if ("已调度".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(1); |
||||||
|
} else if ("已装车".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(2); |
||||||
|
} else if ("待收货".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(3); |
||||||
|
} else if ("已收货".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(4); |
||||||
|
} else if ("已在库".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(5); |
||||||
|
} else if ("待理货".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(6); |
||||||
|
} else if ("待上架".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(7); |
||||||
|
} else if ("已上架".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(8); |
||||||
|
} else if ("已下架".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(9); |
||||||
|
} else if ("已发运".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(10); |
||||||
|
} else if ("已签收".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(11); |
||||||
|
} else if ("待返货".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(12); |
||||||
|
} else if ("已提件".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(13); |
||||||
|
} else if ("已拒收".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(14); |
||||||
|
} else if ("异常".equals(packageStatus)) { |
||||||
|
signPackageEntity.setPackageStatus(-1); |
||||||
|
} else { |
||||||
|
signPackageEntity.setPackageStatus(0); |
||||||
|
} |
||||||
|
opSignPackageService.updateById(signPackageEntity); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,9 @@ |
|||||||
|
package com.logpm.factory.oupai.service; |
||||||
|
|
||||||
|
import com.logpm.factory.oupai.entity.OpOutGoingOrderEntity; |
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
|
||||||
|
public interface IOpOutGoingOrderService extends BaseService<OpOutGoingOrderEntity> { |
||||||
|
|
||||||
|
OpOutGoingOrderEntity getEntityByCode(String outGoingOrderCode); |
||||||
|
} |
@ -0,0 +1,8 @@ |
|||||||
|
package com.logpm.factory.oupai.service; |
||||||
|
|
||||||
|
import com.logpm.factory.oupai.entity.OpSignBillEntity; |
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
|
||||||
|
public interface IOpSignBillService extends BaseService<OpSignBillEntity> { |
||||||
|
OpSignBillEntity findEntityByCode(String recevierCode); |
||||||
|
} |
@ -0,0 +1,8 @@ |
|||||||
|
package com.logpm.factory.oupai.service; |
||||||
|
|
||||||
|
import com.logpm.factory.oupai.entity.OpSignPackageEntity; |
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
|
||||||
|
public interface IOpSignPackageService extends BaseService<OpSignPackageEntity> { |
||||||
|
OpSignPackageEntity findEntityByOrderPackageCode(String code); |
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
package com.logpm.factory.oupai.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.logpm.factory.oupai.entity.OpOutGoingOrderEntity; |
||||||
|
import com.logpm.factory.oupai.mapper.OpOutGoingOrderMapper; |
||||||
|
import com.logpm.factory.oupai.service.IOpOutGoingOrderService; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
@Service |
||||||
|
@AllArgsConstructor |
||||||
|
public class OpOutGoingOrderServiceImpl extends BaseServiceImpl<OpOutGoingOrderMapper, OpOutGoingOrderEntity> implements IOpOutGoingOrderService { |
||||||
|
@Override |
||||||
|
public OpOutGoingOrderEntity getEntityByCode(String outGoingOrderCode) { |
||||||
|
QueryWrapper<OpOutGoingOrderEntity> queryWrapper = new QueryWrapper<>(); |
||||||
|
queryWrapper.eq("code",outGoingOrderCode) |
||||||
|
.eq("is_deleted",0); |
||||||
|
return baseMapper.selectOne(queryWrapper); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
package com.logpm.factory.oupai.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.logpm.factory.oupai.entity.OpSignBillEntity; |
||||||
|
import com.logpm.factory.oupai.mapper.OpSignBillMapper; |
||||||
|
import com.logpm.factory.oupai.service.IOpSignBillService; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
@Service |
||||||
|
@AllArgsConstructor |
||||||
|
public class OpSignBillServiceImpl extends BaseServiceImpl<OpSignBillMapper, OpSignBillEntity> implements IOpSignBillService { |
||||||
|
@Override |
||||||
|
public OpSignBillEntity findEntityByCode(String recevierCode) { |
||||||
|
QueryWrapper<OpSignBillEntity> queryWrapper = new QueryWrapper<>(); |
||||||
|
queryWrapper.eq("code",recevierCode) |
||||||
|
.eq("is_deleted",0); |
||||||
|
return baseMapper.selectOne(queryWrapper); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
package com.logpm.factory.oupai.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.logpm.factory.oupai.entity.OpSignPackageEntity; |
||||||
|
import com.logpm.factory.oupai.mapper.OpSignPackageMapper; |
||||||
|
import com.logpm.factory.oupai.service.IOpSignPackageService; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
@Service |
||||||
|
@AllArgsConstructor |
||||||
|
public class OpSignPackageServiceImpl extends BaseServiceImpl<OpSignPackageMapper, OpSignPackageEntity> implements IOpSignPackageService { |
||||||
|
@Override |
||||||
|
public OpSignPackageEntity findEntityByOrderPackageCode(String code) { |
||||||
|
QueryWrapper<OpSignPackageEntity> queryWrapper = new QueryWrapper<>(); |
||||||
|
queryWrapper.eq("order_package_code",code) |
||||||
|
.eq("is_deleted",0); |
||||||
|
return baseMapper.selectOne(queryWrapper); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue