Commit 4b5d116a by 412743165@qq.com

提交第一版:完成基本的同步代码

parent 0e473b9e
...@@ -130,7 +130,41 @@ ...@@ -130,7 +130,41 @@
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>com.jarvis.commons</groupId>
<version>1.0-SNAPSHOT</version>
<artifactId>jarvis-commons-open-replicator</artifactId>
</dependency>
</dependencies> </dependencies>
<repositories>
<repository>
<id>rdc-releases</id>
<url>https://repo.rdc.aliyun.com/repository/107831-release-wujq6W/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<updatePolicy>always</updatePolicy>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>rdc-snapshots</id>
<url>https://repo.rdc.aliyun.com/repository/107831-snapshot-GraFJG/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<updatePolicy>always</updatePolicy>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
......
package com.jarvis.dataCenter.bean; package com.jarvis.dataCenter.bean;
import com.jarvis.dataCenter.entity.jws.InvoiceSignEntity;
import com.jarvis.dataCenter.entity.prod.*; import com.jarvis.dataCenter.entity.prod.*;
import com.jarvis.dataCenter.entity.report.ReportCsOrderInfo; import com.jarvis.dataCenter.entity.report.*;
import com.jarvis.dataCenter.entity.report.ReportDoInfo; import com.jarvis.dataCenter.entity.warehouse.*;
import com.jarvis.dataCenter.entity.report.ReportSkuInfo; import com.jarvis.lib.common.base.util.JarvisCopyUtils;
import com.jarvis.dataCenter.entity.report.ReportSoPoInfo;
import com.jarvis.dataCenter.entity.warehouse.DeliveryLicenceEntity;
import com.jarvis.dataCenter.entity.warehouse.DeliveryOrderDetailEntity;
import com.jarvis.dataCenter.entity.warehouse.DeliveryOrderEntity;
import com.jarvis.dataCenter.entity.warehouse.WarehouseEntity;
/** /**
* @author jinzhaopo * @author jinzhaopo
...@@ -477,7 +473,7 @@ public class BeanUtils { ...@@ -477,7 +473,7 @@ public class BeanUtils {
} }
public static void build(ReportCsOrderInfo reportCsOrderInfo, CsOrderDetailEntity csOrderDetailEntity) { public static void build(ReportCsOrderInfo reportCsOrderInfo, CsOrderDetailEntity csOrderDetailEntity) {
if(csOrderDetailEntity != null){ if (csOrderDetailEntity != null) {
reportCsOrderInfo.setCsOrderDetailid(csOrderDetailEntity.getCsDetailId()); reportCsOrderInfo.setCsOrderDetailid(csOrderDetailEntity.getCsDetailId());
reportCsOrderInfo.setCsOrderDetailcsDetailId(csOrderDetailEntity.getCsDetailId()); reportCsOrderInfo.setCsOrderDetailcsDetailId(csOrderDetailEntity.getCsDetailId());
reportCsOrderInfo.setCsOrderDetailcsOrderCode(csOrderDetailEntity.getCsOrderCode()); reportCsOrderInfo.setCsOrderDetailcsOrderCode(csOrderDetailEntity.getCsOrderCode());
...@@ -508,7 +504,7 @@ public class BeanUtils { ...@@ -508,7 +504,7 @@ public class BeanUtils {
} }
public static void build(ReportCsOrderInfo reportCsOrderInfo, CsOrderEntity csOrderEntity) { public static void build(ReportCsOrderInfo reportCsOrderInfo, CsOrderEntity csOrderEntity) {
if(csOrderEntity != null){ if (csOrderEntity != null) {
reportCsOrderInfo.setCsOrdercsId(csOrderEntity.getCsId()); reportCsOrderInfo.setCsOrdercsId(csOrderEntity.getCsId());
reportCsOrderInfo.setCsOrderCode(csOrderEntity.getCsOrderCode()); reportCsOrderInfo.setCsOrderCode(csOrderEntity.getCsOrderCode());
reportCsOrderInfo.setCsOrderpoOrderCode(csOrderEntity.getPoOrderCode()); reportCsOrderInfo.setCsOrderpoOrderCode(csOrderEntity.getPoOrderCode());
...@@ -575,6 +571,53 @@ public class BeanUtils { ...@@ -575,6 +571,53 @@ public class BeanUtils {
} }
public static void build(ReportDoInfo reportDoInfo, StockAllocationEntity stockAllocationEntity) {
if (stockAllocationEntity != null) {
reportDoInfo.setStockAllocationId(stockAllocationEntity.getId());
reportDoInfo.setStockAllocationdeliveryDetailId(stockAllocationEntity.getDeliveryDetailId());
reportDoInfo.setStockAllocationdeliveryOrderId(stockAllocationEntity.getDeliveryOrderId());
reportDoInfo.setStockAllocationwarehouseId(stockAllocationEntity.getWarehouseId());
reportDoInfo.setStockAllocationcontainerId(stockAllocationEntity.getContainerId());
reportDoInfo.setStockAllocationstockId(stockAllocationEntity.getStockId());
reportDoInfo.setStockAllocationskuCode(stockAllocationEntity.getSkuCode());
reportDoInfo.setStockAllocationbatchCode(stockAllocationEntity.getBatchCode());
reportDoInfo.setStockAllocationserialCode(stockAllocationEntity.getSerialCode());
reportDoInfo.setStockAllocationrfId(stockAllocationEntity.getRfId());
reportDoInfo.setStockAllocationexpiryDate(stockAllocationEntity.getExpiryDate());
reportDoInfo.setStockAllocationquantity(stockAllocationEntity.getQuantity());
reportDoInfo.setStockAllocationstatus(stockAllocationEntity.getStatus());
reportDoInfo.setStockAllocationcreatedTime(stockAllocationEntity.getCreatedTime());
reportDoInfo.setStockAllocationlevel(stockAllocationEntity.getLevel());
reportDoInfo.setStockAllocationsterilizationTime(stockAllocationEntity.getSterilizationTime());
reportDoInfo.setStockAllocationmodel(stockAllocationEntity.getModel());
reportDoInfo.setStockAllocationmanufacturer(stockAllocationEntity.getManufacturer());
reportDoInfo.setStockAllocationmaterialQuality(stockAllocationEntity.getMaterialQuality());
reportDoInfo.setStockAllocationmedicalCategory(stockAllocationEntity.getMedicalCategory());
reportDoInfo.setStockAllocationaction(stockAllocationEntity.getAction());
reportDoInfo.setStockAllocationpurpose(stockAllocationEntity.getPurpose());
reportDoInfo.setStockAllocationregistrationCategory(stockAllocationEntity.getRegistrationCategory());
reportDoInfo.setStockAllocationriskLevel(stockAllocationEntity.getRiskLevel());
reportDoInfo.setStockAllocationupdatedTime(stockAllocationEntity.getUpdatedTime());
reportDoInfo.setStockAllocationversion(stockAllocationEntity.getVersion());
}
}
public static void build(ReportDoInfo reportDoInfo, StockContainerEntity stockContainerEntity) {
if (stockContainerEntity != null) {
reportDoInfo.setStockContainerid(stockContainerEntity.getId());
reportDoInfo.setStockContainerwarehouseId(stockContainerEntity.getWarehouseId());
reportDoInfo.setStockContainername(stockContainerEntity.getName());
reportDoInfo.setStockContainercode(stockContainerEntity.getCode());
reportDoInfo.setStockContainercontainerType(stockContainerEntity.getContainerType());
reportDoInfo.setStockContainercapacity(stockContainerEntity.getCapacity());
reportDoInfo.setStockContainerenabled(stockContainerEntity.getEnabled());
reportDoInfo.setStockContainercreatedTime(stockContainerEntity.getCreatedTime());
reportDoInfo.setStockContainerupdatedTime(stockContainerEntity.getUpdatedTime());
reportDoInfo.setStockContainerversion(stockContainerEntity.getVersion());
}
}
public static void build(ReportDoInfo reportDoInfo, DeliveryOrderEntity deliveryOrderEntity) { public static void build(ReportDoInfo reportDoInfo, DeliveryOrderEntity deliveryOrderEntity) {
if (deliveryOrderEntity != null) { if (deliveryOrderEntity != null) {
reportDoInfo.setDoid(deliveryOrderEntity.getId()); reportDoInfo.setDoid(deliveryOrderEntity.getId());
...@@ -628,22 +671,22 @@ public class BeanUtils { ...@@ -628,22 +671,22 @@ public class BeanUtils {
} }
public static void build(ReportDoInfo reportDoInfo, DeliveryLicenceEntity deliveryLicenceEntity) { // public static void build(ReportDoInfo reportDoInfo, DeliveryLicenceEntity deliveryLicenceEntity) {
if (deliveryLicenceEntity != null) { // if (deliveryLicenceEntity != null) {
reportDoInfo.setLicenceId(deliveryLicenceEntity.getId()); // reportDoInfo.setLicenceId(deliveryLicenceEntity.getId());
reportDoInfo.setLicencedoCode(deliveryLicenceEntity.getDoCode()); // reportDoInfo.setLicencedoCode(deliveryLicenceEntity.getDoCode());
reportDoInfo.setLicencesupplierId(deliveryLicenceEntity.getSupplierId()); // reportDoInfo.setLicencesupplierId(deliveryLicenceEntity.getSupplierId());
reportDoInfo.setLicenceagencyId(deliveryLicenceEntity.getAgencyId()); // reportDoInfo.setLicenceagencyId(deliveryLicenceEntity.getAgencyId());
reportDoInfo.setLicencegroupId(deliveryLicenceEntity.getGroupId()); // reportDoInfo.setLicencegroupId(deliveryLicenceEntity.getGroupId());
reportDoInfo.setLicencelicenceType(deliveryLicenceEntity.getLicenceType()); // reportDoInfo.setLicencelicenceType(deliveryLicenceEntity.getLicenceType());
reportDoInfo.setLicenceproductId(deliveryLicenceEntity.getProductId()); // reportDoInfo.setLicenceproductId(deliveryLicenceEntity.getProductId());
reportDoInfo.setLicencecreatedTime(deliveryLicenceEntity.getCreatedTime()); // reportDoInfo.setLicencecreatedTime(deliveryLicenceEntity.getCreatedTime());
reportDoInfo.setLicenceupdatedTime(deliveryLicenceEntity.getUpdatedTime()); // reportDoInfo.setLicenceupdatedTime(deliveryLicenceEntity.getUpdatedTime());
reportDoInfo.setLicenceversion(deliveryLicenceEntity.getVersion()); // reportDoInfo.setLicenceversion(deliveryLicenceEntity.getVersion());
//
} // }
//
} // }
public static void build(ReportDoInfo reportDoInfo, WarehouseEntity warehouseEntity) { public static void build(ReportDoInfo reportDoInfo, WarehouseEntity warehouseEntity) {
if (warehouseEntity != null) { if (warehouseEntity != null) {
...@@ -664,5 +707,119 @@ public class BeanUtils { ...@@ -664,5 +707,119 @@ public class BeanUtils {
} }
} }
public static void build(ReportAgencyInfo reportAgencyInfo, BusAgencymasterEntity busAgencymasterEntity) {
if (busAgencymasterEntity != null) {
reportAgencyInfo.setId(busAgencymasterEntity.getId());
reportAgencyInfo.setParentId(busAgencymasterEntity.getParentId());
reportAgencyInfo.setGroupId(busAgencymasterEntity.getGroupId());
reportAgencyInfo.setAgencyCode(busAgencymasterEntity.getAgencyCode());
reportAgencyInfo.setAgencyName(busAgencymasterEntity.getAgencyName());
reportAgencyInfo.setAgencyShortName(busAgencymasterEntity.getAgencyShortName());
reportAgencyInfo.setInvTitle(busAgencymasterEntity.getInvTitle());
reportAgencyInfo.setQtyChair(busAgencymasterEntity.getQtyChair());
reportAgencyInfo.setPermissionLevel(busAgencymasterEntity.getPermissionLevel());
reportAgencyInfo.setAgencyType(busAgencymasterEntity.getAgencyType());
reportAgencyInfo.setAgencyCategoryid(busAgencymasterEntity.getAgencyCategoryid());
reportAgencyInfo.setAgencyCategoryName(busAgencymasterEntity.getAgencyCategoryName());
reportAgencyInfo.setRegionCoId(busAgencymasterEntity.getRegionCoId());
reportAgencyInfo.setRegionCoName(busAgencymasterEntity.getRegionCoName());
reportAgencyInfo.setCountryId(busAgencymasterEntity.getCountryId());
reportAgencyInfo.setCountyName(busAgencymasterEntity.getCountryName());
reportAgencyInfo.setProvinceId(busAgencymasterEntity.getProvinceId());
reportAgencyInfo.setProvinceName(busAgencymasterEntity.getProvinceName());
reportAgencyInfo.setCityId(busAgencymasterEntity.getCityId());
reportAgencyInfo.setCityName(busAgencymasterEntity.getCityName());
reportAgencyInfo.setCountyId(busAgencymasterEntity.getCountyId());
reportAgencyInfo.setCountyName(busAgencymasterEntity.getCountyName());
reportAgencyInfo.setAddress(busAgencymasterEntity.getAddress());
reportAgencyInfo.setDirector(busAgencymasterEntity.getDirector());
reportAgencyInfo.setPostCode(busAgencymasterEntity.getPostCode());
reportAgencyInfo.setAreaCode(busAgencymasterEntity.getAreaCode());
reportAgencyInfo.setTelPhone(busAgencymasterEntity.getTelPhone());
reportAgencyInfo.setLongitude(busAgencymasterEntity.getLongitude());
reportAgencyInfo.setLatitude(busAgencymasterEntity.getLatitude());
reportAgencyInfo.setLonLatFlg(busAgencymasterEntity.getLonLatFlg());
reportAgencyInfo.setEstablishDate(busAgencymasterEntity.getEstablishDate());
reportAgencyInfo.setCompanyInfoId(busAgencymasterEntity.getCompanyInfoId());
reportAgencyInfo.setUseFlg(busAgencymasterEntity.getUseFlg());
reportAgencyInfo.setMemo(busAgencymasterEntity.getMemo());
reportAgencyInfo.setCreator(busAgencymasterEntity.getCreator());
reportAgencyInfo.setEditor(busAgencymasterEntity.getEditor());
reportAgencyInfo.setCreatedTime(busAgencymasterEntity.getCreatedTime());
reportAgencyInfo.setUpdatedTime(busAgencymasterEntity.getUpdatedTime());
reportAgencyInfo.setPayStyle(busAgencymasterEntity.getPayStyle());
reportAgencyInfo.setReferee(busAgencymasterEntity.getReferee());
reportAgencyInfo.setIsGroupPurchase(busAgencymasterEntity.getIsGroupPurchase());
reportAgencyInfo.setReportFlag(busAgencymasterEntity.getReportFlag());
reportAgencyInfo.setReportAgencySign(busAgencymasterEntity.getReportAgencySign());
reportAgencyInfo.setIsAgreement(busAgencymasterEntity.getIsAgreement());
reportAgencyInfo.setAuthentication(busAgencymasterEntity.getAuthentication());
}
}
public static void build(ReportAddressInfo reportAddressInfo, BusAgencyaddressEntity busAgencyaddressEntity) {
if (busAgencyaddressEntity != null) {
reportAddressInfo.setId(busAgencyaddressEntity.getId());
reportAddressInfo.setAgencyId(busAgencyaddressEntity.getAgencyId());
reportAddressInfo.setAddrName(busAgencyaddressEntity.getAddrName());
reportAddressInfo.setAddrTyp(busAgencyaddressEntity.getAddrTyp());
reportAddressInfo.setInvTitle(busAgencyaddressEntity.getInvTitle());
reportAddressInfo.setCountryId(busAgencyaddressEntity.getCountryId());
reportAddressInfo.setCountyName(busAgencyaddressEntity.getCountryName());
reportAddressInfo.setProvinceId(busAgencyaddressEntity.getProvinceId());
reportAddressInfo.setProvinceName(busAgencyaddressEntity.getProvinceName());
reportAddressInfo.setCityId(busAgencyaddressEntity.getCityId());
reportAddressInfo.setCityName(busAgencyaddressEntity.getCityName());
reportAddressInfo.setCountyId(busAgencyaddressEntity.getCountyId());
reportAddressInfo.setCountyName(busAgencyaddressEntity.getCountyName());
reportAddressInfo.setAddress(busAgencyaddressEntity.getAddress());
reportAddressInfo.setDeliverName(busAgencyaddressEntity.getDeliverName());
reportAddressInfo.setDeliverMobile(busAgencyaddressEntity.getDeliverMobile());
reportAddressInfo.setDeliverPhone(busAgencyaddressEntity.getDeliverPhone());
reportAddressInfo.setPostCode(busAgencyaddressEntity.getPostCode());
reportAddressInfo.setLongitude(busAgencyaddressEntity.getLongitude());
reportAddressInfo.setLatitude(busAgencyaddressEntity.getLatitude());
reportAddressInfo.setLonLatFlg(busAgencyaddressEntity.getLonLatFlg());
reportAddressInfo.setIsDefault(busAgencyaddressEntity.getIsDefault());
reportAddressInfo.setUseFlg(busAgencyaddressEntity.getUseFlg());
reportAddressInfo.setMemo(busAgencyaddressEntity.getMemo());
reportAddressInfo.setCreator(busAgencyaddressEntity.getCreator());
reportAddressInfo.setEditor(busAgencyaddressEntity.getEditor());
reportAddressInfo.setCreatedTime(busAgencyaddressEntity.getCreatedTime());
reportAddressInfo.setUpdatedTime(busAgencyaddressEntity.getUpdatedTime());
reportAddressInfo.setDutyId(busAgencyaddressEntity.getDutyId());
reportAddressInfo.setInvoiceType(busAgencyaddressEntity.getInvoiceType());
reportAddressInfo.setEmail(busAgencyaddressEntity.getEmail());
reportAddressInfo.setRegisteredMobile(busAgencyaddressEntity.getRegisteredMobile());
reportAddressInfo.setBankAccount(busAgencyaddressEntity.getBankAccount());
reportAddressInfo.setInvName(busAgencyaddressEntity.getInvName());
reportAddressInfo.setInvAddress(busAgencyaddressEntity.getInvAddress());
reportAddressInfo.setInvTitleType(busAgencyaddressEntity.getInvTitleType());
}
}
public static void build(ReportInvoiceInfo reportInvoiceInfo, InvoiceSignEntity invoiceSignEntity) {
if (invoiceSignEntity != null) {
reportInvoiceInfo.setId(invoiceSignEntity.getId());
reportInvoiceInfo.setBusinessId(invoiceSignEntity.getBusinessId());
reportInvoiceInfo.setBusinessType(invoiceSignEntity.getBusinessType());
reportInvoiceInfo.setPoCode(invoiceSignEntity.getPoCode());
reportInvoiceInfo.setSoCode(invoiceSignEntity.getSoCode());
reportInvoiceInfo.setDoCode(invoiceSignEntity.getDoCode());
reportInvoiceInfo.setCsCode(invoiceSignEntity.getCsCode());
reportInvoiceInfo.setSkuCode(invoiceSignEntity.getSkuCode());
reportInvoiceInfo.setInvoiceCode(invoiceSignEntity.getInvoiceCode());
reportInvoiceInfo.setInvoiceLogisticsCode(invoiceSignEntity.getInvoiceLogisticsCode());
reportInvoiceInfo.setInvoiceActualQuantity(invoiceSignEntity.getInvoiceActualQuantity());
reportInvoiceInfo.setInvoiceActualPrice(invoiceSignEntity.getInvoiceActualPrice());
reportInvoiceInfo.setInvoiceSign(reportInvoiceInfo.getInvoiceSign());
reportInvoiceInfo.setEditTime(reportInvoiceInfo.getEditTime());
reportInvoiceInfo.setCreateTime(reportInvoiceInfo.getCreateTime());
}
}
} }
package com.jarvis.dataCenter.config;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
/**
* @author jinzhaopo
* @date 2019-11-04 18:02
*/
@Configuration
@Data
public class OpenReplicatorCofig {
@Value("${open.replicator.host}")
private String host;
@Value("${open.replicator.user}")
private String user;
@Value("${open.replicator.pwd}")
private String pwd;
@Value("${open.replicator.port}")
private String port;
}
package com.jarvis.dataCenter.controller; package com.jarvis.dataCenter.controller;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.jarvis.dataCenter.config.OpenReplicatorCofig;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.jarvis.dataCenter.enums.SyncEnum;
import com.jarvis.common.redis.service.RedisService; import com.jarvis.dataCenter.runner.OpenReplicatorRunner;
import com.jarvis.dataCenter.bean.BeanUtils; import com.jarvis.dataCenter.service.impl.report.ThreadServiceImpl;
import com.jarvis.dataCenter.entity.prod.*;
import com.jarvis.dataCenter.entity.report.ReportCsOrderInfo;
import com.jarvis.dataCenter.entity.report.ReportDoInfo;
import com.jarvis.dataCenter.entity.report.ReportSkuInfo;
import com.jarvis.dataCenter.entity.report.ReportSoPoInfo;
import com.jarvis.dataCenter.entity.warehouse.DeliveryLicenceEntity;
import com.jarvis.dataCenter.entity.warehouse.DeliveryOrderDetailEntity;
import com.jarvis.dataCenter.entity.warehouse.DeliveryOrderEntity;
import com.jarvis.dataCenter.entity.warehouse.WarehouseEntity;
import com.jarvis.dataCenter.service.prod.*;
import com.jarvis.dataCenter.service.report.ReportCsOrderInfoService;
import com.jarvis.dataCenter.service.report.ReportSkuInfoService;
import com.jarvis.dataCenter.service.report.ReportSoPoInfoService;
import com.jarvis.dataCenter.service.warehouse.DeliveryLicenceService;
import com.jarvis.dataCenter.service.warehouse.DeliveryOrderDetailService;
import com.jarvis.dataCenter.service.warehouse.DeliveryOrderService;
import com.jarvis.dataCenter.service.warehouse.WarehouseService;
import com.jarvis.lib.common.base.message.Message; import com.jarvis.lib.common.base.message.Message;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -39,51 +23,275 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -39,51 +23,275 @@ import org.springframework.web.bind.annotation.RestController;
@Api("SYNC") @Api("SYNC")
public class SyncController { public class SyncController {
@Autowired
private ThreadServiceImpl threadserviceImpl;
private static final String SO_DETAIL_KEY = "SO_ID:"; @Autowired
private OpenReplicatorRunner openReplicatorRunner;
@Autowired
private OpenReplicatorCofig openReplicatorCofig;
/** /**
* 测试同步skuInfo信息 * 查询控制同步的状态
* *
* @param syncEnum
* @return * @return
*/ */
@ApiOperation("测试同步skuInfo信息") @ApiOperation("获取状态信息")
@GetMapping("/testSkuInfo") @GetMapping("/getSyncBol")
public Message<ReportSkuInfo> testSkuInfo() { public Message<String> getSyncBol(SyncEnum syncEnum) {
Boolean status = null;
if (syncEnum == SyncEnum.REPORT_SKU) {
status = ThreadServiceImpl.syncSku;
} else if (syncEnum == SyncEnum.REPORT_ADDRESS) {
status = ThreadServiceImpl.syncAddress;
} else if (syncEnum == SyncEnum.REPORT_AGENCY) {
status = ThreadServiceImpl.syncAgency;
} else if (syncEnum == SyncEnum.REPORT_CS) {
status = ThreadServiceImpl.syncCsInfo;
} else if (syncEnum == SyncEnum.REPORT_DO) {
status = ThreadServiceImpl.sycnDoInfo;
} else if (syncEnum == SyncEnum.REPORT_INVOICE) {
status = ThreadServiceImpl.syncInvoiceInfo;
} else if (syncEnum == SyncEnum.REPORT_SO) {
status = ThreadServiceImpl.syncSoInfo;
}
return Message.success(null); return Message.success(status + "");
} }
/** /**
* 测试同步po,so信息 * @param syncEnum
* * @param status
* @return * @return
*/ */
@ApiOperation("测试同步po,so信息") @ApiOperation("设置状态信息")
@GetMapping("/testSoPo") @GetMapping("/setSyncBol")
public Message<ReportSoPoInfo> testSoPo() { public Message<String> setSyncBol(SyncEnum syncEnum, @RequestParam boolean status) {
if (syncEnum == SyncEnum.REPORT_SKU) {
ThreadServiceImpl.syncSku = status;
} else if (syncEnum == SyncEnum.REPORT_ADDRESS) {
ThreadServiceImpl.syncAddress = status;
} else if (syncEnum == SyncEnum.REPORT_AGENCY) {
ThreadServiceImpl.syncAgency = status;
} else if (syncEnum == SyncEnum.REPORT_CS) {
ThreadServiceImpl.syncCsInfo = status;
} else if (syncEnum == SyncEnum.REPORT_DO) {
ThreadServiceImpl.sycnDoInfo = status;
} else if (syncEnum == SyncEnum.REPORT_INVOICE) {
ThreadServiceImpl.syncInvoiceInfo = status;
} else if (syncEnum == SyncEnum.REPORT_SO) {
ThreadServiceImpl.syncSoInfo = status;
}
return Message.success(null); return Message.success(status + "");
}
/**
* @param syncEnum
* @return
*/
@ApiOperation("获取线程的状态")
@GetMapping("/getThreadIsAlive")
public Message<String> getThreadIsAlive(SyncEnum syncEnum) {
boolean alive = false;
if (syncEnum == SyncEnum.REPORT_SKU) {
alive = threadserviceImpl.getSyncSkuThread().isAlive();
} else if (syncEnum == SyncEnum.REPORT_ADDRESS) {
alive = threadserviceImpl.getSyncAddressThread().isAlive();
} else if (syncEnum == SyncEnum.REPORT_AGENCY) {
alive = threadserviceImpl.getSyncAgencyThread().isAlive();
} else if (syncEnum == SyncEnum.REPORT_CS) {
alive = threadserviceImpl.getSyncCsInfoThread().isAlive();
} else if (syncEnum == SyncEnum.REPORT_DO) {
alive = threadserviceImpl.getSycnDoInfoThread().isAlive();
} else if (syncEnum == SyncEnum.REPORT_INVOICE) {
alive = threadserviceImpl.getSyncInvoiceInfoThread().isAlive();
} else if (syncEnum == SyncEnum.REPORT_SO) {
alive = threadserviceImpl.getSyncSoInfoThread().isAlive();
}
return Message.success(alive + "");
} }
@ApiOperation("测试cs信息") /**
@GetMapping("/testCsInfo") * 获取线程的睡眠时间
public Message<ReportCsOrderInfo> testCsInfo() { *
* @param syncEnum
* @return
*/
@ApiOperation("获取线程的睡眠时间")
@GetMapping("/getSleepTime")
public Message<String> getSleepTime(SyncEnum syncEnum) {
long time = 0;
if (syncEnum == SyncEnum.REPORT_SKU) {
time = ThreadServiceImpl.sleepSku;
} else if (syncEnum == SyncEnum.REPORT_ADDRESS) {
time = ThreadServiceImpl.sleepAddress;
} else if (syncEnum == SyncEnum.REPORT_AGENCY) {
time = ThreadServiceImpl.sleepAgency;
} else if (syncEnum == SyncEnum.REPORT_CS) {
time = ThreadServiceImpl.sleepCsInfo;
} else if (syncEnum == SyncEnum.REPORT_DO) {
time = ThreadServiceImpl.sleepDoInfo;
} else if (syncEnum == SyncEnum.REPORT_INVOICE) {
time = ThreadServiceImpl.sleepInvoiceInfo;
} else if (syncEnum == SyncEnum.REPORT_SO) {
time = ThreadServiceImpl.sleepSoInfo;
}
return Message.success(time + "");
}
/**
* 设置线程的睡眠时间
*
* @param syncEnum
* @param time
* @return
*/
@ApiOperation("设置线程的睡眠时间")
@GetMapping("/setSleepTime")
public Message<String> getSleepTime(SyncEnum syncEnum, @RequestParam long time) {
if (syncEnum == SyncEnum.REPORT_SKU) {
ThreadServiceImpl.sleepSku = time;
} else if (syncEnum == SyncEnum.REPORT_ADDRESS) {
ThreadServiceImpl.sleepAddress = time;
} else if (syncEnum == SyncEnum.REPORT_AGENCY) {
ThreadServiceImpl.sleepAgency = time;
} else if (syncEnum == SyncEnum.REPORT_CS) {
ThreadServiceImpl.sleepCsInfo = time;
} else if (syncEnum == SyncEnum.REPORT_DO) {
ThreadServiceImpl.sleepDoInfo = time;
} else if (syncEnum == SyncEnum.REPORT_INVOICE) {
ThreadServiceImpl.sleepInvoiceInfo = time;
} else if (syncEnum == SyncEnum.REPORT_SO) {
ThreadServiceImpl.sleepSoInfo = time;
}
return Message.success(time + "");
}
/**
* @param syncEnum
* @return
*/
@ApiOperation("停止线程")
@GetMapping("/stopThread")
public Message<String> stopThread(SyncEnum syncEnum) {
if (syncEnum == SyncEnum.REPORT_SKU) {
boolean alive = threadserviceImpl.getSyncSkuThread().isAlive();
if (alive) {
threadserviceImpl.getSyncSkuThread().interrupt();
}
} else if (syncEnum == SyncEnum.REPORT_ADDRESS) {
boolean alive = threadserviceImpl.getSyncAddressThread().isAlive();
if (alive) {
threadserviceImpl.getSyncAddressThread().interrupt();
}
} else if (syncEnum == SyncEnum.REPORT_AGENCY) {
boolean alive = threadserviceImpl.getSyncAddressThread().isAlive();
if (alive) {
threadserviceImpl.getSyncAddressThread().interrupt();
}
} else if (syncEnum == SyncEnum.REPORT_CS) {
boolean alive = threadserviceImpl.getSyncCsInfoThread().isAlive();
if (alive) {
threadserviceImpl.getSyncCsInfoThread().interrupt();
}
} else if (syncEnum == SyncEnum.REPORT_DO) {
boolean alive = threadserviceImpl.getSycnDoInfoThread().isAlive();
if (alive) {
threadserviceImpl.getSycnDoInfoThread().interrupt();
}
} else if (syncEnum == SyncEnum.REPORT_INVOICE) {
boolean alive = threadserviceImpl.getSyncInvoiceInfoThread().isAlive();
if (alive) {
threadserviceImpl.getSyncInvoiceInfoThread().interrupt();
}
} else if (syncEnum == SyncEnum.REPORT_SO) {
boolean alive = threadserviceImpl.getSyncSoInfoThread().isAlive();
if (alive) {
threadserviceImpl.getSyncSoInfoThread().interrupt();
}
}
return Message.success(null); return Message.success(null);
} }
/**
* @param syncEnum
* @return
*/
@ApiOperation("启动线程")
@GetMapping("/startThread")
public Message<String> startThread(SyncEnum syncEnum) {
if (syncEnum == SyncEnum.REPORT_SKU) {
boolean alive = threadserviceImpl.getSyncSkuThread().isAlive();
if (!alive) {
threadserviceImpl.getSyncSkuThread().start();
}
} else if (syncEnum == SyncEnum.REPORT_ADDRESS) {
boolean alive = threadserviceImpl.getSyncAddressThread().isAlive();
if (!alive) {
threadserviceImpl.getSyncAddressThread().start();
}
} else if (syncEnum == SyncEnum.REPORT_AGENCY) {
boolean alive = threadserviceImpl.getSyncAddressThread().isAlive();
if (!alive) {
threadserviceImpl.getSyncAgencyThread().start();
}
} else if (syncEnum == SyncEnum.REPORT_CS) {
boolean alive = threadserviceImpl.getSyncCsInfoThread().isAlive();
if (!alive) {
threadserviceImpl.getSyncCsInfoThread().start();
}
} else if (syncEnum == SyncEnum.REPORT_DO) {
boolean alive = threadserviceImpl.getSycnDoInfoThread().isAlive();
if (!alive) {
threadserviceImpl.getSycnDoInfoThread().start();
}
} else if (syncEnum == SyncEnum.REPORT_INVOICE) {
boolean alive = threadserviceImpl.getSyncInvoiceInfoThread().isAlive();
if (!alive) {
threadserviceImpl.getSyncInvoiceInfoThread().start();
}
} else if (syncEnum == SyncEnum.REPORT_SO) {
boolean alive = threadserviceImpl.getSyncSoInfoThread().isAlive();
if (!alive) {
threadserviceImpl.getSyncSoInfoThread().start();
}
}
return Message.success(null);
}
@ApiOperation("测试DO单的信息同步") @GetMapping("/startOpenRe")
@GetMapping("/testDoInfo") @ApiOperation("启动监控")
public Message<ReportDoInfo> testDoInfo() { public Message<String> startOpenReplicator(Long binlogPosition) {
openReplicatorRunner.initOpenReplicator();
if (binlogPosition != null) {
openReplicatorRunner.getOpenReplicator().setBinlogPosition(binlogPosition);
}
openReplicatorRunner.start();
return Message.success(true + "");
}
return Message.success(null); @GetMapping("/stopOpenReplicator")
@ApiOperation("停止监控")
public Message<String> stopOpenReplicator() {
try {
openReplicatorRunner.stop();
} catch (Exception e) {
e.printStackTrace();
}
return Message.success(true + "");
} }
} }
package com.jarvis.dataCenter.entity.jws;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import lombok.Data;
import com.jarvis.lib.common.mybatisplus.entity.AbstractEntity;
/**
* <p>
* 开票的标记表 ENTITY
* </p>
*
* @author jinzhaopo
* @since 2019-11-01
*/
@Data
@TableName("invoice_sign")
public class InvoiceSignEntity extends AbstractEntity {
private static final long serialVersionUID = 1L;
@TableId(value = ID, type = IdType.AUTO)
private Integer id;
/**
* 业务ID
*/
@TableField(BUSINESS_ID)
private String businessId;
/**
* '业务类型 PURCHASE:"采购", SELL_OFF: "销退", EXCHANGE: "换货"'
*/
@TableField(BUSINESS_TYPE)
private String businessType;
/**
* 采购订单编号
*/
@TableField(PO_CODE)
private String poCode;
/**
* 销售单号
*/
@TableField(SO_CODE)
private String soCode;
/**
* 发单号
*/
@TableField(DO_CODE)
private String doCode;
/**
* 售后单号
*/
@TableField(CS_CODE)
private String csCode;
/**
* sku编码
*/
@TableField(SKU_CODE)
private String skuCode;
/**
* 发票号
*/
@TableField(INVOICE_CODE)
private String invoiceCode;
/**
* 发票物流号
*/
@TableField(INVOICE_LOGISTICS_CODE)
private String invoiceLogisticsCode;
/**
* 实际开票数量
*/
@TableField(INVOICE_ACTUAL_QUANTITY)
private BigDecimal invoiceActualQuantity;
/**
* 实际开票单价
*/
@TableField(INVOICE_ACTUAL_PRICE)
private BigDecimal invoiceActualPrice;
/**
* 是否已开票的标记:Y已开票,N未开票
*/
@TableField(INVOICE_SIGN)
private String invoiceSign;
/**
* 修改时间
*/
@TableField(EDIT_TIME)
private Date editTime;
/**
* 新增时间
*/
@TableField(CREATE_TIME)
private Date createTime;
/**
*
*/
public static final String ID = "id";
/**
* 业务ID
*/
public static final String BUSINESS_ID = "business_id";
/**
* '业务类型 PURCHASE:"采购", SELL_OFF: "销退", EXCHANGE: "换货"'
*/
public static final String BUSINESS_TYPE = "business_type";
/**
* 采购订单编号
*/
public static final String PO_CODE = "po_code";
/**
* 销售单号
*/
public static final String SO_CODE = "so_code";
/**
* 发单号
*/
public static final String DO_CODE = "do_code";
/**
* 售后单号
*/
public static final String CS_CODE = "cs_code";
/**
* sku编码
*/
public static final String SKU_CODE = "sku_code";
/**
* 发票号
*/
public static final String INVOICE_CODE = "invoice_code";
/**
* 发票物流号
*/
public static final String INVOICE_LOGISTICS_CODE = "invoice_logistics_code";
/**
* 实际开票数量
*/
public static final String INVOICE_ACTUAL_QUANTITY = "invoice_actual_quantity";
/**
* 实际开票单价
*/
public static final String INVOICE_ACTUAL_PRICE = "invoice_actual_price";
/**
* 是否已开票的标记:Y已开票,N未开票
*/
public static final String INVOICE_SIGN = "invoice_sign";
/**
* 修改时间
*/
public static final String EDIT_TIME = "edit_time";
/**
* 新增时间
*/
public static final String CREATE_TIME = "create_time";
}
package com.jarvis.dataCenter.entity.prod;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import com.jarvis.lib.common.mybatisplus.entity.AbstractEntity;
/**
* <p>
* 机构地址表 ENTITY
* </p>
*
* @author jinzhaopo
* @since 2019-11-01
*/
@Data
@TableName("bus_agencyaddress")
public class BusAgencyaddressEntity extends AbstractEntity {
private static final long serialVersionUID = 1L;
/**
* 主键 自增长
*/
@TableId(value = ID, type = IdType.AUTO)
private Integer id;
/**
* 机构ID 关联bus_agencyMaster->id
*/
@TableField(AGENCYID)
private Integer agencyId;
/**
* 地址名称 group(集团)、store(门店)
*/
@TableField(ADDRNAME)
private String addrName;
/**
* 基础档案设置 机构地址类型
*/
@TableField(ADDRTYP)
private String addrTyp;
/**
* 开票抬头
*/
@TableField(INV_TITLE)
private String invTitle;
/**
* 国家ID
*/
@TableField(COUNTRYID)
private Integer countryId;
/**
* 国家名称
*/
@TableField(COUNTRYNAME)
private String countryName;
/**
* 省份ID
*/
@TableField(PROVINCEID)
private Integer provinceId;
/**
* 省份名称
*/
@TableField(PROVINCENAME)
private String provinceName;
/**
* 城市ID
*/
@TableField(CITYID)
private Integer cityId;
/**
* 城市名称
*/
@TableField(CITYNAME)
private String cityName;
/**
* 区ID
*/
@TableField(COUNTYID)
private Integer countyId;
/**
* 区名称
*/
@TableField(COUNTYNAME)
private String countyName;
/**
* 详细地址
*/
@TableField(ADDRESS)
private String address;
/**
* 收货人
*/
@TableField(DELIVERNAME)
private String deliverName;
/**
* 手机
*/
@TableField(DELIVERMOBILE)
private String deliverMobile;
/**
* 固定电话
*/
@TableField(DELIVERPHONE)
private String deliverPhone;
/**
* 邮编
*/
@TableField(POSTCODE)
private String postCode;
/**
* 经度
*/
@TableField(LONGITUDE)
private String longitude;
/**
* 纬度
*/
@TableField(LATITUDE)
private String latitude;
/**
* 是否标经纬度 0:否 1:是
*/
@TableField(LONLATFLG)
private Integer lonLatFlg;
/**
* 是否默认
*/
@TableField(ISDEFAULT)
private Integer isDefault;
/**
* 是否作废 0:作废 1:使用
*/
@TableField(USEFLG)
private Integer useFlg;
/**
* 备注
*/
@TableField(MEMO)
private String memo;
/**
* 创建人
*/
@TableField(CREATOR)
private String creator;
/**
* 修改人
*/
@TableField(EDITOR)
private String editor;
/**
* 创建时间
*/
@TableField(CREATEDTIME)
private Date createdTime;
/**
* 更新时间
*/
@TableField(UPDATEDTIME)
private Date updatedTime;
/**
* 税号
*/
@TableField(DUTYID)
private String dutyId;
/**
* 发票类型
*/
@TableField(INVOICETYPE)
private String invoiceType;
/**
* 电子发票email
*/
@TableField(EMAIL)
private String email;
/**
* 注册电话
*/
@TableField(REGISTEREDMOBILE)
private String registeredMobile;
/**
* 银行账号
*/
@TableField(BANKACCOUNT)
private String bankAccount;
/**
* 开户行名称
*/
@TableField(INVNAME)
private String invName;
/**
* 开票地址
*/
@TableField(INVADDRESS)
private String invAddress;
/**
* 发票抬头类型:0单位;1个人
*/
@TableField(INVTITLETYPE)
private Integer invTitleType;
/**
* 主键 自增长
*/
public static final String ID = "id";
/**
* 机构ID 关联bus_agencyMaster->id
*/
public static final String AGENCYID = "agencyId";
/**
* 地址名称 group(集团)、store(门店)
*/
public static final String ADDRNAME = "addrName";
/**
* 基础档案设置 机构地址类型
*/
public static final String ADDRTYP = "addrTyp";
/**
* 开票抬头
*/
public static final String INV_TITLE = "inv_title";
/**
* 国家ID
*/
public static final String COUNTRYID = "countryId";
/**
* 国家名称
*/
public static final String COUNTRYNAME = "countryName";
/**
* 省份ID
*/
public static final String PROVINCEID = "provinceId";
/**
* 省份名称
*/
public static final String PROVINCENAME = "provinceName";
/**
* 城市ID
*/
public static final String CITYID = "cityId";
/**
* 城市名称
*/
public static final String CITYNAME = "cityName";
/**
* 区ID
*/
public static final String COUNTYID = "countyId";
/**
* 区名称
*/
public static final String COUNTYNAME = "countyName";
/**
* 详细地址
*/
public static final String ADDRESS = "address";
/**
* 收货人
*/
public static final String DELIVERNAME = "deliverName";
/**
* 手机
*/
public static final String DELIVERMOBILE = "deliverMobile";
/**
* 固定电话
*/
public static final String DELIVERPHONE = "deliverPhone";
/**
* 邮编
*/
public static final String POSTCODE = "postCode";
/**
* 经度
*/
public static final String LONGITUDE = "longitude";
/**
* 纬度
*/
public static final String LATITUDE = "latitude";
/**
* 是否标经纬度 0:否 1:是
*/
public static final String LONLATFLG = "lonLatFlg";
/**
* 是否默认
*/
public static final String ISDEFAULT = "isDefault";
/**
* 是否作废 0:作废 1:使用
*/
public static final String USEFLG = "useFlg";
/**
* 备注
*/
public static final String MEMO = "memo";
/**
* 创建人
*/
public static final String CREATOR = "creator";
/**
* 修改人
*/
public static final String EDITOR = "editor";
/**
* 创建时间
*/
public static final String CREATEDTIME = "createdTime";
/**
* 更新时间
*/
public static final String UPDATEDTIME = "updatedTime";
/**
* 税号
*/
public static final String DUTYID = "dutyId";
/**
* 发票类型
*/
public static final String INVOICETYPE = "invoiceType";
/**
* 电子发票email
*/
public static final String EMAIL = "email";
/**
* 注册电话
*/
public static final String REGISTEREDMOBILE = "registeredMobile";
/**
* 银行账号
*/
public static final String BANKACCOUNT = "bankAccount";
/**
* 开户行名称
*/
public static final String INVNAME = "invName";
/**
* 开票地址
*/
public static final String INVADDRESS = "invAddress";
/**
* 发票抬头类型:0单位;1个人
*/
public static final String INVTITLETYPE = "invTitleType";
}
package com.jarvis.dataCenter.entity.prod;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import com.jarvis.lib.common.mybatisplus.entity.AbstractEntity;
/**
* <p>
* 机构主表 ENTITY
* </p>
*
* @author jinzhaopo
* @since 2019-11-01
*/
@Data
@TableName("bus_agencymaster")
public class BusAgencymasterEntity extends AbstractEntity {
private static final long serialVersionUID = 1L;
/**
* 主键 自增长
*/
@TableId(value = ID, type = IdType.AUTO)
private Integer id;
/**
* 上级机构ID
*/
@TableField(PARENTID)
private Integer parentId;
/**
* 所属集团ID
*/
@TableField(GROUPID)
private Integer groupId;
/**
* 机构编码
*/
@TableField(AGENCYCODE)
private String agencyCode;
/**
* 机构名称
*/
@TableField(AGENCYNAME)
private String agencyName;
/**
* 机构简称
*/
@TableField(AGENCYSHORTNAME)
private String agencyShortName;
/**
* 开票抬头
*/
@TableField(INV_TITLE)
private String invTitle;
/**
* 基础档案设置 (椅位数)(com_sysItem)
*/
@TableField(QTY_CHAIR)
private String qtyChair;
/**
* 基础档案设置 权限级别维度值id
*/
@TableField(PERMISSIONLEVEL)
private String permissionLevel;
/**
* 机构类型(预留)
*/
@TableField(AGENCYTYPE)
private String agencyType;
/**
* 机构分类id 基础多级档案设置:ABC类(com_sysItem)itemGpCode = bus_agencyMaster_agencyCategory
*/
@TableField(AGENCYCATEGORYID)
private String agencyCategoryid;
/**
* 机构分类名称 基础多级档案设置:ABC类(com_sysItem)itemGpCode = bus_agencyMaster_agencyCategoryName
*/
@TableField(AGENCYCATEGORYNAME)
private String agencyCategoryName;
/**
* 基础档案多级 所属区域/子公司id 基础多级档案设置;一个集团总账户,允许建立该集团下的区域及子公司上下级关系
*/
@TableField(REGIONCOID)
private String regionCoId;
/**
* 基础多级档案设置 所属区域/子公司名称
*/
@TableField(REGIONCONAME)
private String regionCoName;
/**
* 国家ID
*/
@TableField(COUNTRYID)
private Integer countryId;
/**
* 国家名称
*/
@TableField(COUNTRYNAME)
private String countryName;
/**
* 省份ID
*/
@TableField(PROVINCEID)
private Integer provinceId;
/**
* 省份名称
*/
@TableField(PROVINCENAME)
private String provinceName;
/**
* 城市ID
*/
@TableField(CITYID)
private Integer cityId;
/**
* 城市名称
*/
@TableField(CITYNAME)
private String cityName;
/**
* 区ID
*/
@TableField(COUNTYID)
private Integer countyId;
/**
* 区名称
*/
@TableField(COUNTYNAME)
private String countyName;
/**
* 详细地址
*/
@TableField(ADDRESS)
private String address;
/**
* 机构负责人姓名
*/
@TableField(DIRECTOR)
private String director;
/**
* 邮编
*/
@TableField(POSTCODE)
private String postCode;
/**
* 固定电话区号
*/
@TableField(AREACODE)
private String areaCode;
/**
* 固定电话
*/
@TableField(TELPHONE)
private String telPhone;
/**
* 经度
*/
@TableField(LONGITUDE)
private String longitude;
/**
* 纬度
*/
@TableField(LATITUDE)
private String latitude;
/**
* 是否标经纬度 0:否 1:是
*/
@TableField(LONLATFLG)
private Integer lonLatFlg;
/**
* 成立日期 格式到年月日
*/
@TableField(ESTABLISHDATE)
private Date establishDate;
/**
* 公司信息ID 关联bus_companyInfo信息
*/
@TableField(COMPANYINFOID)
private Integer companyInfoId;
/**
* 状态 0:禁用 1:启用
*/
@TableField(USEFLG)
private Integer useFlg;
/**
* 备注
*/
@TableField(MEMO)
private String memo;
/**
* 创建人
*/
@TableField(CREATOR)
private String creator;
/**
* 修改人
*/
@TableField(EDITOR)
private String editor;
/**
* 创建时间
*/
@TableField(CREATEDTIME)
private Date createdTime;
/**
* 更新时间
*/
@TableField(UPDATEDTIME)
private Date updatedTime;
/**
* 支付方式:1 全流程 0 精简支付
*/
@TableField(PAYSTYLE)
private Integer payStyle;
/**
* 推荐人
*/
@TableField(REFEREE)
private String referee;
/**
* 是否团购 0:否 1:是
*/
@TableField(ISGROUPPURCHASE)
private Integer isGroupPurchase;
/**
* 报表机构类型(业务不要用):1(测试)2(禁用)3(专用)4(开城)5(大客户)6(金牌100)7(腰部100)8(激活券)9(其他)null未设置
*/
@TableField(REPORT_FLAG)
private Integer reportFlag;
/**
* 1(开城),2(进销存),3(大客户),4(金牌100),5(腰部100),6(激活券),7(瑞尔外部),8(供应商调货),100(未设置)
*/
@TableField(REPORT_AGENCY_SIGN)
private Integer reportAgencySign;
/**
* 是否签署医疗器械产品销售协议 0:否 1:是
*/
@TableField(ISAGREEMENT)
private Integer isAgreement;
/**
* 0:未认证;1:已认证
*/
@TableField(AUTHENTICATION)
private Integer authentication;
/**
* 主键 自增长
*/
public static final String ID = "id";
/**
* 上级机构ID
*/
public static final String PARENTID = "parentId";
/**
* 所属集团ID
*/
public static final String GROUPID = "groupId";
/**
* 机构编码
*/
public static final String AGENCYCODE = "agencyCode";
/**
* 机构名称
*/
public static final String AGENCYNAME = "agencyName";
/**
* 机构简称
*/
public static final String AGENCYSHORTNAME = "agencyShortName";
/**
* 开票抬头
*/
public static final String INV_TITLE = "inv_title";
/**
* 基础档案设置 (椅位数)(com_sysItem)
*/
public static final String QTY_CHAIR = "qty_chair";
/**
* 基础档案设置 权限级别维度值id
*/
public static final String PERMISSIONLEVEL = "permissionLevel";
/**
* 机构类型(预留)
*/
public static final String AGENCYTYPE = "agencyType";
/**
* 机构分类id 基础多级档案设置:ABC类(com_sysItem)itemGpCode = bus_agencyMaster_agencyCategory
*/
public static final String AGENCYCATEGORYID = "agencyCategoryid";
/**
* 机构分类名称 基础多级档案设置:ABC类(com_sysItem)itemGpCode = bus_agencyMaster_agencyCategoryName
*/
public static final String AGENCYCATEGORYNAME = "agencyCategoryName";
/**
* 基础档案多级 所属区域/子公司id 基础多级档案设置;一个集团总账户,允许建立该集团下的区域及子公司上下级关系
*/
public static final String REGIONCOID = "regionCoId";
/**
* 基础多级档案设置 所属区域/子公司名称
*/
public static final String REGIONCONAME = "regionCoName";
/**
* 国家ID
*/
public static final String COUNTRYID = "countryId";
/**
* 国家名称
*/
public static final String COUNTRYNAME = "countryName";
/**
* 省份ID
*/
public static final String PROVINCEID = "provinceId";
/**
* 省份名称
*/
public static final String PROVINCENAME = "provinceName";
/**
* 城市ID
*/
public static final String CITYID = "cityId";
/**
* 城市名称
*/
public static final String CITYNAME = "cityName";
/**
* 区ID
*/
public static final String COUNTYID = "countyId";
/**
* 区名称
*/
public static final String COUNTYNAME = "countyName";
/**
* 详细地址
*/
public static final String ADDRESS = "address";
/**
* 机构负责人姓名
*/
public static final String DIRECTOR = "director";
/**
* 邮编
*/
public static final String POSTCODE = "postCode";
/**
* 固定电话区号
*/
public static final String AREACODE = "areaCode";
/**
* 固定电话
*/
public static final String TELPHONE = "telPhone";
/**
* 经度
*/
public static final String LONGITUDE = "longitude";
/**
* 纬度
*/
public static final String LATITUDE = "latitude";
/**
* 是否标经纬度 0:否 1:是
*/
public static final String LONLATFLG = "lonLatFlg";
/**
* 成立日期 格式到年月日
*/
public static final String ESTABLISHDATE = "establishDate";
/**
* 公司信息ID 关联bus_companyInfo信息
*/
public static final String COMPANYINFOID = "companyInfoId";
/**
* 状态 0:禁用 1:启用
*/
public static final String USEFLG = "useFlg";
/**
* 备注
*/
public static final String MEMO = "memo";
/**
* 创建人
*/
public static final String CREATOR = "creator";
/**
* 修改人
*/
public static final String EDITOR = "editor";
/**
* 创建时间
*/
public static final String CREATEDTIME = "createdTime";
/**
* 更新时间
*/
public static final String UPDATEDTIME = "updatedTime";
/**
* 支付方式:1 全流程 0 精简支付
*/
public static final String PAYSTYLE = "payStyle";
/**
* 推荐人
*/
public static final String REFEREE = "referee";
/**
* 是否团购 0:否 1:是
*/
public static final String ISGROUPPURCHASE = "isGroupPurchase";
/**
* 报表机构类型(业务不要用):1(测试)2(禁用)3(专用)4(开城)5(大客户)6(金牌100)7(腰部100)8(激活券)9(其他)null未设置
*/
public static final String REPORT_FLAG = "report_flag";
/**
* 1(开城),2(进销存),3(大客户),4(金牌100),5(腰部100),6(激活券),7(瑞尔外部),8(供应商调货),100(未设置)
*/
public static final String REPORT_AGENCY_SIGN = "report_agency_sign";
/**
* 是否签署医疗器械产品销售协议 0:否 1:是
*/
public static final String ISAGREEMENT = "isAgreement";
/**
* 0:未认证;1:已认证
*/
public static final String AUTHENTICATION = "authentication";
}
package com.jarvis.dataCenter.entity.report;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jarvis.lib.common.mybatisplus.entity.AbstractEntity;
import lombok.Data;
import java.util.Date;
/**
* @author jinzhaopo
* @date 2019-11-01 11:26
*/
@Data
@TableName("report_address_info")
public class ReportAddressInfo extends AbstractEntity {
/**
* 主键 自增长
*/
private Integer id;
/**
* 机构ID 关联bus_agencyMaster->id
*/
private Integer agencyId;
/**
* 地址名称 group(集团)、store(门店)
*/
private String addrName;
/**
* 基础档案设置 机构地址类型
*/
private String addrTyp;
/**
* 开票抬头
*/
private String invTitle;
/**
* 国家ID
*/
private Integer countryId;
/**
* 国家名称
*/
private String countryName;
/**
* 省份ID
*/
private Integer provinceId;
/**
* 省份名称
*/
private String provinceName;
/**
* 城市ID
*/
private Integer cityId;
/**
* 城市名称
*/
private String cityName;
/**
* 区ID
*/
private Integer countyId;
/**
* 区名称
*/
private String countyName;
/**
* 详细地址
*/
private String address;
/**
* 收货人
*/
private String deliverName;
/**
* 手机
*/
private String deliverMobile;
/**
* 固定电话
*/
private String deliverPhone;
/**
* 邮编
*/
private String postCode;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 是否标经纬度 0:否 1:是
*/
private Integer lonLatFlg;
/**
* 是否默认
*/
private Integer isDefault;
/**
* 是否作废 0:作废 1:使用
*/
private Integer useFlg;
/**
* 备注
*/
private String memo;
/**
* 创建人
*/
private String creator;
/**
* 修改人
*/
private String editor;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 税号
*/
private String dutyId;
/**
* 发票类型
*/
private String invoiceType;
/**
* 电子发票email
*/
private String email;
/**
* 注册电话
*/
private String registeredMobile;
/**
* 银行账号
*/
private String bankAccount;
/**
* 开户行名称
*/
private String invName;
/**
* 开票地址
*/
private String invAddress;
/**
* 发票抬头类型:0单位;1个人
*/
private Integer invTitleType;
}
package com.jarvis.dataCenter.entity.report;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jarvis.lib.common.mybatisplus.entity.AbstractEntity;
import lombok.Data;
import java.util.Date;
/**
* @author jinzhaopo
* @date 2019-11-01 11:24
*/
@Data
@TableName("report_agency_info")
public class ReportAgencyInfo extends AbstractEntity {
/**
* 主键 自增长
*/
private Integer id;
/**
* 上级机构ID
*/
private Integer parentId;
/**
* 所属集团ID
*/
private Integer groupId;
/**
* 机构编码
*/
private String agencyCode;
/**
* 机构名称
*/
private String agencyName;
/**
* 机构简称
*/
private String agencyShortName;
/**
* 开票抬头
*/
private String invTitle;
/**
* 基础档案设置 (椅位数)(com_sysItem)
*/
private String qtyChair;
/**
* 基础档案设置 权限级别维度值id
*/
private String permissionLevel;
/**
* 机构类型(预留)
*/
private String agencyType;
/**
* 机构分类id 基础多级档案设置:ABC类(com_sysItem)itemGpCode = bus_agencyMaster_agencyCategory
*/
private String agencyCategoryid;
/**
* 机构分类名称 基础多级档案设置:ABC类(com_sysItem)itemGpCode = bus_agencyMaster_agencyCategoryName
*/
private String agencyCategoryName;
/**
* 基础档案多级 所属区域/子公司id 基础多级档案设置;一个集团总账户,允许建立该集团下的区域及子公司上下级关系
*/
private String regionCoId;
/**
* 基础多级档案设置 所属区域/子公司名称
*/
private String regionCoName;
/**
* 国家ID
*/
private Integer countryId;
/**
* 国家名称
*/
private String countryName;
/**
* 省份ID
*/
private Integer provinceId;
/**
* 省份名称
*/
private String provinceName;
/**
* 城市ID
*/
private Integer cityId;
/**
* 城市名称
*/
private String cityName;
/**
* 区ID
*/
private Integer countyId;
/**
* 区名称
*/
private String countyName;
/**
* 详细地址
*/
private String address;
/**
* 机构负责人姓名
*/
private String director;
/**
* 邮编
*/
private String postCode;
/**
* 固定电话区号
*/
private String areaCode;
/**
* 固定电话
*/
private String telPhone;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 是否标经纬度 0:否 1:是
*/
private Integer lonLatFlg;
/**
* 成立日期 格式到年月日
*/
private Date establishDate;
/**
* 公司信息ID 关联bus_companyInfo信息
*/
private Integer companyInfoId;
/**
* 状态 0:禁用 1:启用
*/
private Integer useFlg;
/**
* 备注
*/
private String memo;
/**
* 创建人
*/
private String creator;
/**
* 修改人
*/
private String editor;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 支付方式:1 全流程 0 精简支付
*/
private Integer payStyle;
/**
* 推荐人
*/
private String referee;
/**
* 是否团购 0:否 1:是
*/
private Integer isGroupPurchase;
/**
* 报表机构类型(业务不要用):1(测试)2(禁用)3(专用)4(开城)5(大客户)6(金牌100)7(腰部100)8(激活券)9(其他)null未设置
*/
private Integer reportFlag;
/**
* 1(开城),2(进销存),3(大客户),4(金牌100),5(腰部100),6(激活券),7(瑞尔外部),8(供应商调货),100(未设置)
*/
private Integer reportAgencySign;
/**
* 是否签署医疗器械产品销售协议 0:否 1:是
*/
private Integer isAgreement;
/**
* 0:未认证;1:已认证
*/
private Integer authentication;
}
...@@ -381,46 +381,214 @@ public class ReportDoInfo extends AbstractEntity { ...@@ -381,46 +381,214 @@ public class ReportDoInfo extends AbstractEntity {
private Integer doversion; private Integer doversion;
private Long stockAllocationId;
//---------------licence //----------stockContainer
private Long stockContainerid;
/**
* 仓库id
*/
private Long stockContainerwarehouseId;
private Long licenceId;
/** /**
* 发货单号 * 名称
*/ */
private String licencedoCode; private String stockContainername;
/** /**
* 供应商id * 编号
*/
private String stockContainercode;
/**
* 容器类型
*/
private String stockContainercontainerType;
/**
* 容量
*/ */
private Long licencesupplierId; private Integer stockContainercapacity;
/** /**
* 机构id * 是否启用
*/ */
private Long licenceagencyId; private String stockContainerenabled;
private Date stockContainercreatedTime;
private Date stockContainerupdatedTime;
private Integer stockContainerversion;
//-------------stock_allocation
/** /**
* 集团id * 发货单id
*/ */
private Long licencegroupId; private Long stockAllocationdeliveryOrderId;
/** /**
* 证照类型 * 发货明细id
*/ */
private String licencelicenceType; private Long stockAllocationdeliveryDetailId;
/** /**
* 产品id * 仓库id 为0是私有供应商的分配记录
*/
private Long stockAllocationwarehouseId;
/**
* 库位id 为0是私有供应商的分配记录
*/
private Long stockAllocationcontainerId;
/**
* 库存id 为0是私有供应商的分配记录
*/
private Long stockAllocationstockId;
/**
* sku编号
*/
private String stockAllocationskuCode;
/**
* 批次号
*/
private String stockAllocationbatchCode;
/**
* 序列号
*/
private String stockAllocationserialCode;
/**
* 寄售唯一码
*/
private String stockAllocationrfId;
/**
* 到期日
*/
private Date stockAllocationexpiryDate;
/**
* 是否长期有效 是:Y,否:N
*/
private String stockAllocationeternalItem;
/**
* 分配数量
*/
private BigDecimal stockAllocationquantity;
/**
* 分配状态,UN_CHECK_OUT:未发货,CHECK_OUT:已发货,CANCELED:已取消
*/
private String stockAllocationstatus;
private Date stockAllocationcreatedTime;
/**
* 级别
*/
private String stockAllocationlevel;
/**
* 消毒灭菌日期
*/ */
private Long licenceproductId; private Date stockAllocationsterilizationTime;
/**
* 型号
*/
private String stockAllocationmodel;
/**
* 生产厂商
*/
private String stockAllocationmanufacturer;
/**
* 材质
*/
private String stockAllocationmaterialQuality;
/**
* 医用耗材类别
*/
private String stockAllocationmedicalCategory;
/**
* 功能
*/
private String stockAllocationaction;
/**
* 用途
*/
private String stockAllocationpurpose;
/**
* 注册证类别
*/
private String stockAllocationregistrationCategory;
/**
* 风险级别
*/
private String stockAllocationriskLevel;
private Date stockAllocationupdatedTime;
private Integer stockAllocationversion;
private Date licencecreatedTime;
private Date licenceupdatedTime;
private Integer licenceversion; // //---------------licence
//
//
// private Long licenceId;
// /**
// * 发货单号
// */
// private String licencedoCode;
//
// /**
// * 供应商id
// */
// private Long licencesupplierId;
//
// /**
// * 机构id
// */
// private Long licenceagencyId;
//
// /**
// * 集团id
// */
// private Long licencegroupId;
//
// /**
// * 证照类型
// */
// private String licencelicenceType;
//
// /**
// * 产品id
// */
// private Long licenceproductId;
//
// private Date licencecreatedTime;
//
// private Date licenceupdatedTime;
//
// private Integer licenceversion;
//-------------warehouse //-------------warehouse
......
package com.jarvis.dataCenter.entity.report;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jarvis.lib.common.mybatisplus.entity.AbstractEntity;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author jinzhaopo
* @date 2019-11-01 13:41
*/
@Data
@TableName("report_invoice_info")
public class ReportInvoiceInfo extends AbstractEntity {
private Integer id;
/**
* 业务ID
*/
private String businessId;
/**
* '业务类型 PURCHASE:"采购", SELL_OFF: "销退", EXCHANGE: "换货"'
*/
private String businessType;
/**
* 采购订单编号
*/
private String poCode;
/**
* 销售单号
*/
private String soCode;
/**
* 发单号
*/
private String doCode;
/**
* 售后单号
*/
private String csCode;
/**
* sku编码
*/
private String skuCode;
/**
* 发票号
*/
private String invoiceCode;
/**
* 发票物流号
*/
private String invoiceLogisticsCode;
/**
* 实际开票数量
*/
private BigDecimal invoiceActualQuantity;
/**
* 实际开票单价
*/
private BigDecimal invoiceActualPrice;
/**
* 是否已开票的标记:Y已开票,N未开票
*/
private String invoiceSign;
/**
* 修改时间
*/
private Date editTime;
/**
* 新增时间
*/
private Date createTime;
}
package com.jarvis.dataCenter.entity.warehouse;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import lombok.Data;
import com.jarvis.lib.common.mybatisplus.entity.AbstractEntity;
/**
* <p>
* 库存分配记录表 ENTITY
* </p>
*
* @author jinzhaopo
* @since 2019-11-05
*/
@Data
@TableName("stock_allocation")
public class StockAllocationEntity extends AbstractEntity {
private static final long serialVersionUID = 1L;
@TableId(value = ID, type = IdType.AUTO)
private Long id;
/**
* 发货单id
*/
@TableField(DELIVERY_ORDER_ID)
private Long deliveryOrderId;
/**
* 发货明细id
*/
@TableField(DELIVERY_DETAIL_ID)
private Long deliveryDetailId;
/**
* 仓库id 为0是私有供应商的分配记录
*/
@TableField(WAREHOUSE_ID)
private Long warehouseId;
/**
* 库位id 为0是私有供应商的分配记录
*/
@TableField(CONTAINER_ID)
private Long containerId;
/**
* 库存id 为0是私有供应商的分配记录
*/
@TableField(STOCK_ID)
private Long stockId;
/**
* sku编号
*/
@TableField(SKU_CODE)
private String skuCode;
/**
* 批次号
*/
@TableField(BATCH_CODE)
private String batchCode;
/**
* 序列号
*/
@TableField(SERIAL_CODE)
private String serialCode;
/**
* 寄售唯一码
*/
@TableField(RF_ID)
private String rfId;
/**
* 到期日
*/
@TableField(EXPIRY_DATE)
private Date expiryDate;
/**
* 是否长期有效 是:Y,否:N
*/
@TableField(ETERNAL_ITEM)
private String eternalItem;
/**
* 分配数量
*/
@TableField(QUANTITY)
private BigDecimal quantity;
/**
* 分配状态,UN_CHECK_OUT:未发货,CHECK_OUT:已发货,CANCELED:已取消
*/
@TableField(STATUS)
private String status;
@TableField(CREATED_TIME)
private Date createdTime;
/**
* 级别
*/
@TableField(LEVEL)
private String level;
/**
* 消毒灭菌日期
*/
@TableField(STERILIZATION_TIME)
private Date sterilizationTime;
/**
* 型号
*/
@TableField(MODEL)
private String model;
/**
* 生产厂商
*/
@TableField(MANUFACTURER)
private String manufacturer;
/**
* 材质
*/
@TableField(MATERIAL_QUALITY)
private String materialQuality;
/**
* 医用耗材类别
*/
@TableField(MEDICAL_CATEGORY)
private String medicalCategory;
/**
* 功能
*/
@TableField(ACTION)
private String action;
/**
* 用途
*/
@TableField(PURPOSE)
private String purpose;
/**
* 注册证类别
*/
@TableField(REGISTRATION_CATEGORY)
private String registrationCategory;
/**
* 风险级别
*/
@TableField(RISK_LEVEL)
private String riskLevel;
@TableField(UPDATED_TIME)
private Date updatedTime;
@TableField(VERSION)
private Integer version;
/**
*
*/
public static final String ID = "id";
/**
* 发货单id
*/
public static final String DELIVERY_ORDER_ID = "delivery_order_id";
/**
* 发货明细id
*/
public static final String DELIVERY_DETAIL_ID = "delivery_detail_id";
/**
* 仓库id 为0是私有供应商的分配记录
*/
public static final String WAREHOUSE_ID = "warehouse_id";
/**
* 库位id 为0是私有供应商的分配记录
*/
public static final String CONTAINER_ID = "container_id";
/**
* 库存id 为0是私有供应商的分配记录
*/
public static final String STOCK_ID = "stock_id";
/**
* sku编号
*/
public static final String SKU_CODE = "sku_code";
/**
* 批次号
*/
public static final String BATCH_CODE = "batch_code";
/**
* 序列号
*/
public static final String SERIAL_CODE = "serial_code";
/**
* 寄售唯一码
*/
public static final String RF_ID = "rf_id";
/**
* 到期日
*/
public static final String EXPIRY_DATE = "expiry_date";
/**
* 是否长期有效 是:Y,否:N
*/
public static final String ETERNAL_ITEM = "eternal_item";
/**
* 分配数量
*/
public static final String QUANTITY = "quantity";
/**
* 分配状态,UN_CHECK_OUT:未发货,CHECK_OUT:已发货,CANCELED:已取消
*/
public static final String STATUS = "status";
/**
*
*/
public static final String CREATED_TIME = "created_time";
/**
* 级别
*/
public static final String LEVEL = "level";
/**
* 消毒灭菌日期
*/
public static final String STERILIZATION_TIME = "sterilization_time";
/**
* 型号
*/
public static final String MODEL = "model";
/**
* 生产厂商
*/
public static final String MANUFACTURER = "manufacturer";
/**
* 材质
*/
public static final String MATERIAL_QUALITY = "material_quality";
/**
* 医用耗材类别
*/
public static final String MEDICAL_CATEGORY = "medical_category";
/**
* 功能
*/
public static final String ACTION = "action";
/**
* 用途
*/
public static final String PURPOSE = "purpose";
/**
* 注册证类别
*/
public static final String REGISTRATION_CATEGORY = "registration_category";
/**
* 风险级别
*/
public static final String RISK_LEVEL = "risk_level";
/**
*
*/
public static final String UPDATED_TIME = "updated_time";
/**
*
*/
public static final String VERSION = "version";
}
package com.jarvis.dataCenter.entity.warehouse;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import lombok.Data;
import com.jarvis.lib.common.mybatisplus.entity.AbstractEntity;
/**
* <p>
* 库位表 ENTITY
* </p>
*
* @author jinzhaopo
* @since 2019-11-05
*/
@Data
@TableName("stock_container")
public class StockContainerEntity extends AbstractEntity {
private static final long serialVersionUID = 1L;
@TableId(value = ID, type = IdType.AUTO)
private Long id;
/**
* 仓库id
*/
@TableField(WAREHOUSE_ID)
private Long warehouseId;
/**
* 名称
*/
@TableField(NAME)
private String name;
/**
* 编号
*/
@TableField(CODE)
private String code;
/**
* 容器类型
*/
@TableField(CONTAINER_TYPE)
private String containerType;
/**
* 容量
*/
@TableField(CAPACITY)
private Integer capacity;
/**
* 是否启用
*/
@TableField(ENABLED)
private String enabled;
@TableField(CREATED_TIME)
private Date createdTime;
@TableField(UPDATED_TIME)
private Date updatedTime;
@TableField(VERSION)
private Integer version;
/**
*
*/
public static final String ID = "id";
/**
* 仓库id
*/
public static final String WAREHOUSE_ID = "warehouse_id";
/**
* 名称
*/
public static final String NAME = "name";
/**
* 编号
*/
public static final String CODE = "code";
/**
* 容器类型
*/
public static final String CONTAINER_TYPE = "container_type";
/**
* 容量
*/
public static final String CAPACITY = "capacity";
/**
* 是否启用
*/
public static final String ENABLED = "enabled";
/**
*
*/
public static final String CREATED_TIME = "created_time";
/**
*
*/
public static final String UPDATED_TIME = "updated_time";
/**
*
*/
public static final String VERSION = "version";
}
package com.jarvis.dataCenter.enums;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @author jinzhaopo
* @date 2019-11-01 15:44
*/
@ApiModel("同步数据的枚举")
public enum SyncEnum {
@ApiModelProperty(value = "同步sku")
REPORT_SKU,
@ApiModelProperty(value = "同步机构")
REPORT_AGENCY,
@ApiModelProperty(value = "同步地址")
REPORT_ADDRESS,
@ApiModelProperty(value = "同步SO")
REPORT_SO,
@ApiModelProperty(value = "同步CS")
REPORT_CS,
@ApiModelProperty(value = "同步DO")
REPORT_DO,
@ApiModelProperty(value = "同步发票")
REPORT_INVOICE;
}
package com.jarvis.dataCenter.mapper.jws;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.jarvis.dataCenter.constants.DbConstants;
import com.jarvis.dataCenter.entity.jws.InvoiceSignEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jarvis.lib.common.mybatisplus.mapper.IBaseMapper;
import org.apache.ibatis.annotations.Select;
/**
* <p>
* 开票的标记表
* </p>
*
* @author jinzhaopo
* @since 2019-11-01
*/
@DS(DbConstants.JWS)
public interface InvoiceSignMapper extends IBaseMapper<InvoiceSignEntity> {
@Select("select max(id) from invoice_sign")
Long maxId();
}
\ No newline at end of file
package com.jarvis.dataCenter.mapper.prod;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.jarvis.dataCenter.constants.DbConstants;
import com.jarvis.dataCenter.entity.prod.BusAgencyaddressEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jarvis.lib.common.mybatisplus.mapper.IBaseMapper;
import org.apache.ibatis.annotations.Select;
/**
* <p>
* 机构地址表
* </p>
*
* @author jinzhaopo
* @since 2019-11-01
*/
@DS(DbConstants.PROD)
public interface BusAgencyaddressMapper extends IBaseMapper<BusAgencyaddressEntity> {
@Select("select max(id) from bus_agencyaddress")
Long maxId();
}
\ No newline at end of file
package com.jarvis.dataCenter.mapper.prod;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.jarvis.dataCenter.constants.DbConstants;
import com.jarvis.dataCenter.entity.prod.BusAgencymasterEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jarvis.lib.common.mybatisplus.mapper.IBaseMapper;
import org.apache.ibatis.annotations.Select;
/**
* <p>
* 机构主表
* </p>
*
* @author jinzhaopo
* @since 2019-11-01
*/
@DS(DbConstants.PROD)
public interface BusAgencymasterMapper extends IBaseMapper<BusAgencymasterEntity> {
@Select("select max(id) from bus_agencymaster")
Long maxId();
}
\ No newline at end of file
package com.jarvis.dataCenter.mapper.report;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.jarvis.dataCenter.constants.DbConstants;
import com.jarvis.dataCenter.entity.report.ReportAddressInfo;
import com.jarvis.lib.common.mybatisplus.mapper.IBaseMapper;
/**
* @author jinzhaopo
* @date 2019-11-01 13:53
*/
@DS(DbConstants.REPORT)
public interface ReportAddressInfoMapper extends IBaseMapper<ReportAddressInfo> {
}
package com.jarvis.dataCenter.mapper.report;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.jarvis.dataCenter.constants.DbConstants;
import com.jarvis.dataCenter.entity.report.ReportAgencyInfo;
import com.jarvis.lib.common.mybatisplus.mapper.IBaseMapper;
/**
* @author jinzhaopo
* @date 2019-11-01 13:53
*/
@DS(DbConstants.REPORT)
public interface ReportAgencyInfoMapper extends IBaseMapper<ReportAgencyInfo> {
}
package com.jarvis.dataCenter.mapper.report;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.jarvis.dataCenter.constants.DbConstants;
import com.jarvis.dataCenter.entity.report.ReportInvoiceInfo;
import com.jarvis.lib.common.mybatisplus.mapper.IBaseMapper;
/**
* @author jinzhaopo
* @date 2019-11-01 13:54
*/
@DS(DbConstants.REPORT)
public interface ReportInvoiceInfoMapper extends IBaseMapper<ReportInvoiceInfo> {
}
package com.jarvis.dataCenter.mapper.warehouse;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.jarvis.dataCenter.constants.DbConstants;
import com.jarvis.dataCenter.entity.warehouse.StockAllocationEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jarvis.lib.common.mybatisplus.mapper.IBaseMapper;
/**
* <p>
* 库存分配记录表
* </p>
*
* @author jinzhaopo
* @since 2019-11-05
*/
@DS(DbConstants.WAREHOUSE)
public interface StockAllocationMapper extends IBaseMapper<StockAllocationEntity> {
}
\ No newline at end of file
package com.jarvis.dataCenter.mapper.warehouse;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.jarvis.dataCenter.constants.DbConstants;
import com.jarvis.dataCenter.entity.warehouse.StockContainerEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jarvis.lib.common.mybatisplus.mapper.IBaseMapper;
/**
* <p>
* 库位表
* </p>
*
* @author jinzhaopo
* @since 2019-11-05
*/
@DS(DbConstants.WAREHOUSE)
public interface StockContainerMapper extends IBaseMapper<StockContainerEntity> {
}
\ No newline at end of file
package com.jarvis.dataCenter.runner;
import com.jarvis.dataCenter.service.report.ReportCsOrderInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
/**
* @author jinzhaopo
* @date 2019-10-31 10:23
*/
@Component
@Order(value = 4)
@Slf4j
public class CsRunner implements ApplicationRunner {
@Autowired
private ReportCsOrderInfoService reportCsOrderInfoService;
@Override
public void run(ApplicationArguments args) throws Exception {
log.info("开始拉取 cs 的信息··························");
new Thread(new Runnable() {
@Override
public void run() {
reportCsOrderInfoService.sync();
}
}).start();
}
}
package com.jarvis.dataCenter.runner;
import com.jarvis.dataCenter.service.report.ReportDoInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
/**
* @author jinzhaopo
* @date 2019-10-31 10:24
*/
@Slf4j
@Component
@Order(value = 5)
public class DoRunner implements ApplicationRunner {
@Autowired
private ReportDoInfoService reportDoInfoService;
@Override
public void run(ApplicationArguments args) throws Exception {
log.info("开始拉取 do 的信息·····························");
new Thread(new Runnable() {
@Override
public void run() {
reportDoInfoService.sync();
}
}).start();
}
}
package com.jarvis.dataCenter.runner; package com.jarvis.dataCenter.runner;
import com.google.code.or.OpenReplicator;
import com.jarvis.common.redis.service.RedisService; import com.jarvis.common.redis.service.RedisService;
import com.jarvis.dataCenter.service.impl.report.ReportCsOrderInfoServiceImpl; import com.jarvis.commons.open.replicator.info.ColumnInfo;
import com.jarvis.commons.open.replicator.keeper.TableInfoKeeper;
import com.jarvis.dataCenter.entity.report.ReportInvoiceInfo;
import com.jarvis.dataCenter.service.impl.report.ReportDoInfoServiceImpl; import com.jarvis.dataCenter.service.impl.report.ReportDoInfoServiceImpl;
import com.jarvis.dataCenter.service.impl.report.ReportSkuInfoServiceImpl; import com.jarvis.dataCenter.service.impl.report.ReportInvoiceInfoServiceImpl;
import com.jarvis.dataCenter.service.impl.report.ReportSoPoInfoServiceImpl; import com.jarvis.dataCenter.service.report.ThreadService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner; import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.List;
/** /**
* @author jinzhaopo * @author jinzhaopo
* @date 2019-10-31 14:11 * @date 2019-10-31 14:11
*/ */
@Component @Component
@Order(value = 1) @Order(value = 1)
@Slf4j
public class InitRunner implements ApplicationRunner { public class InitRunner implements ApplicationRunner {
@Autowired
private ThreadService threadService;
@Autowired @Autowired
private RedisService redisService; private RedisService redisService;
...@@ -28,6 +39,17 @@ public class InitRunner implements ApplicationRunner { ...@@ -28,6 +39,17 @@ public class InitRunner implements ApplicationRunner {
// redisService.del(ReportCsOrderInfoServiceImpl.REDIS_KEY); // redisService.del(ReportCsOrderInfoServiceImpl.REDIS_KEY);
// redisService.del(ReportSkuInfoServiceImpl.REDIS_KEY); // redisService.del(ReportSkuInfoServiceImpl.REDIS_KEY);
// redisService.del(ReportSoPoInfoServiceImpl.REDIS_KEY); // redisService.del(ReportSoPoInfoServiceImpl.REDIS_KEY);
// redisService.del(ReportInvoiceInfoServiceImpl.REDIS_KEY);
threadService.syncAgency();
threadService.syncAddress();
threadService.syncInvoiceInfo();
threadService.sycnDoInfo();
threadService.syncSku();
threadService.syncCsInfo();
threadService.syncSoInfo();
} }
} }
package com.jarvis.dataCenter.runner;
import com.google.code.or.OpenReplicator;
import com.jarvis.common.redis.service.RedisService;
import com.jarvis.commons.open.replicator.Test;
import com.jarvis.commons.open.replicator.cache.CDCEventManager;
import com.jarvis.commons.open.replicator.event.CDCEvent;
import com.jarvis.commons.open.replicator.info.BinlogMasterStatus;
import com.jarvis.commons.open.replicator.listener.NotificationListener;
import com.jarvis.commons.open.replicator.util.MysqlConnection;
import com.jarvis.dataCenter.config.OpenReplicatorCofig;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.stereotype.Service;
import java.util.concurrent.TimeUnit;
/**
* @author jinzhaopo
* @date 2019-11-04 17:54
*/
@Service
@Data
@AutoConfigureAfter(OpenReplicatorCofig.class)
@Slf4j
public class OpenReplicatorRunner {
public String binlogPositionRedisKey = "bin_log_position_redis_key";
@Autowired
private OpenReplicatorCofig openReplicatorCofig;
@Autowired
private RedisService redisService;
public OpenReplicator openReplicator;
public void initOpenReplicator() {
MysqlConnection.setConnection(openReplicatorCofig.getHost(), Integer.valueOf(openReplicatorCofig.getPort()), openReplicatorCofig.getUser(), openReplicatorCofig.getPwd());
BinlogMasterStatus bms = MysqlConnection.getBinlogMasterStatus();
openReplicator = new OpenReplicator();
openReplicator.setHost(openReplicatorCofig.getHost());
openReplicator.setUser(openReplicatorCofig.getUser());
openReplicator.setPassword(openReplicatorCofig.getPwd());
openReplicator.setPort(Integer.valueOf(openReplicatorCofig.getPort()));
openReplicator.setBinlogFileName(bms.getBinlogName());
openReplicator.setBinlogEventListener(new NotificationListener());
}
public void start() {
Long binlogPosition = (Long) redisService.get(binlogPositionRedisKey);
if (binlogPosition == null) {
BinlogMasterStatus bms = MysqlConnection.getBinlogMasterStatus();
binlogPosition = bms.getPosition();
}
openReplicator.setBinlogPosition(binlogPosition);
try {
openReplicator.start();
} catch (Exception e) {
e.printStackTrace();
}
Thread thread = new Thread(new Test.PrintCDCEvent());
thread.start();
}
public void stop() {
try {
openReplicator.stop(10, TimeUnit.SECONDS);
} catch (Exception e) {
e.printStackTrace();
}
}
public static class PrintCDCEvent implements Runnable {
@Override
public void run() {
while (true) {
if (CDCEventManager.queue.isEmpty() == false) {
CDCEvent ce = CDCEventManager.queue.pollFirst();
System.out.println(ce.toString());
} else {
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
}
}
package com.jarvis.dataCenter.runner;
import com.jarvis.dataCenter.service.report.ReportSkuInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
/**
* 拉取sku的信息
*
* @author jinzhaopo
* @date 2019-10-31 10:19
*/
@Component
@Order(value = 2)
@Slf4j
public class SkuRunner implements ApplicationRunner {
@Autowired
private ReportSkuInfoService reportSkuInfoService;
@Override
public void run(ApplicationArguments args) throws Exception {
log.info("sku 信息开始拉取·······························");
new Thread(new Runnable() {
@Override
public void run() {
reportSkuInfoService.sync();
}
}).start();
}
}
package com.jarvis.dataCenter.runner;
import com.jarvis.dataCenter.service.report.ReportSoPoInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
/**
* @author jinzhaopo
* @date 2019-10-31 10:22
*/
@Component
@Order(value = 3)
@Slf4j
public class SoRunner implements ApplicationRunner {
@Autowired
private ReportSoPoInfoService reportSoPoInfoService;
@Override
public void run(ApplicationArguments args) throws Exception {
log.info("开始拉取so 的信息·····························");
new Thread(new Runnable() {
@Override
public void run() {
reportSoPoInfoService.sync();
}
}).start();
}
}
package com.jarvis.dataCenter.service.impl.jws;
import com.jarvis.dataCenter.entity.jws.InvoiceSignEntity;
import com.jarvis.dataCenter.mapper.jws.InvoiceSignMapper;
import com.jarvis.dataCenter.service.jws.InvoiceSignService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.jarvis.lib.common.mybatisplus.service.impl.BaseServiceImpl;
/**
* <p>
* 开票的标记表
* </p>
*
* @author jinzhaopo
* @since 2019-11-01
*/
@Service
public class InvoiceSignServiceImpl extends BaseServiceImpl<InvoiceSignMapper, InvoiceSignEntity> implements InvoiceSignService {
}
\ No newline at end of file
package com.jarvis.dataCenter.service.impl.prod;
import com.jarvis.dataCenter.entity.prod.BusAgencyaddressEntity;
import com.jarvis.dataCenter.mapper.prod.BusAgencyaddressMapper;
import com.jarvis.dataCenter.service.prod.BusAgencyaddressService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.jarvis.lib.common.mybatisplus.service.impl.BaseServiceImpl;
/**
* <p>
* 机构地址表
* </p>
*
* @author jinzhaopo
* @since 2019-11-01
*/
@Service
public class BusAgencyaddressServiceImpl extends BaseServiceImpl<BusAgencyaddressMapper, BusAgencyaddressEntity> implements BusAgencyaddressService {
}
\ No newline at end of file
package com.jarvis.dataCenter.service.impl.prod;
import com.jarvis.dataCenter.entity.prod.BusAgencymasterEntity;
import com.jarvis.dataCenter.mapper.prod.BusAgencymasterMapper;
import com.jarvis.dataCenter.service.prod.BusAgencymasterService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.jarvis.lib.common.mybatisplus.service.impl.BaseServiceImpl;
/**
* <p>
* 机构主表
* </p>
*
* @author jinzhaopo
* @since 2019-11-01
*/
@Service
public class BusAgencymasterServiceImpl extends BaseServiceImpl<BusAgencymasterMapper, BusAgencymasterEntity> implements BusAgencymasterService {
}
\ No newline at end of file
package com.jarvis.dataCenter.service.impl.report;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.jarvis.common.redis.service.RedisService;
import com.jarvis.dataCenter.bean.BeanUtils;
import com.jarvis.dataCenter.constants.DbConstants;
import com.jarvis.dataCenter.entity.prod.BusAgencyaddressEntity;
import com.jarvis.dataCenter.entity.report.ReportAddressInfo;
import com.jarvis.dataCenter.mapper.prod.BusAgencyaddressMapper;
import com.jarvis.dataCenter.mapper.report.ReportAddressInfoMapper;
import com.jarvis.dataCenter.service.prod.BusAgencyaddressService;
import com.jarvis.lib.common.mybatisplus.service.impl.BaseServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author jinzhaopo
* @date 2019-11-01 15:13
*/
@DS(DbConstants.REPORT)
@Service
@Slf4j
public class ReportAddressInfoService extends BaseServiceImpl<ReportAddressInfoMapper, ReportAddressInfo> implements com.jarvis.dataCenter.service.report.ReportAddressInfoService {
@Autowired
private BusAgencyaddressMapper busAgencyaddressMapper;
@Autowired
private BusAgencyaddressService busAgencyaddressService;
@Autowired
private RedisService redisService;
public static String REDIS_KEY = "sync:report:address:id:";
@Override
public boolean sync() {
Long endId = busAgencyaddressMapper.maxId();
Integer startId = (Integer) redisService.get(REDIS_KEY);
if (startId == null) {
startId = 0;
}
if(startId.intValue() > endId.intValue()){
return false;
}
//  同步信息
for (long i = startId.intValue(); i <= endId.intValue(); i++) {
try {
sync(i);
} catch (Exception e) {
e.printStackTrace();
}
redisService.getRedisTemplateObj().opsForValue().increment(REDIS_KEY, 1);
}
return true;
}
@Override
public ReportAddressInfo sync(Long addressId) {
ReportAddressInfo reportAddressInfo = new ReportAddressInfo();
BusAgencyaddressEntity busAgencyaddressEntity = busAgencyaddressService.getById(addressId);
if (busAgencyaddressEntity == null) {
return null;
}
BeanUtils.build(reportAddressInfo,busAgencyaddressEntity);
save(reportAddressInfo);
return reportAddressInfo;
}
}
package com.jarvis.dataCenter.service.impl.report;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.jarvis.common.redis.service.RedisService;
import com.jarvis.dataCenter.bean.BeanUtils;
import com.jarvis.dataCenter.constants.DbConstants;
import com.jarvis.dataCenter.entity.prod.BusAgencymasterEntity;
import com.jarvis.dataCenter.entity.report.ReportAgencyInfo;
import com.jarvis.dataCenter.mapper.prod.BusAgencyaddressMapper;
import com.jarvis.dataCenter.mapper.prod.BusAgencymasterMapper;
import com.jarvis.dataCenter.mapper.report.ReportAgencyInfoMapper;
import com.jarvis.dataCenter.service.prod.BusAgencyaddressService;
import com.jarvis.dataCenter.service.prod.BusAgencymasterService;
import com.jarvis.dataCenter.service.report.ReportAgencyInfoService;
import com.jarvis.lib.common.mybatisplus.service.impl.BaseServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sun.plugin2.message.Message;
/**
* @author jinzhaopo
* @date 2019-11-01 15:10
*/
@DS(DbConstants.REPORT)
@Service
@Slf4j
public class ReportAgencyInfoServiceImpl extends BaseServiceImpl<ReportAgencyInfoMapper, ReportAgencyInfo> implements ReportAgencyInfoService {
@Autowired
private BusAgencymasterService busAgencymasterService;
@Autowired
private BusAgencymasterMapper busAgencymasterMapper;
@Autowired
private RedisService redisService;
public static String REDIS_KEY = "sync:report:agency:id:";
@Override
public boolean sync() {
Long endId = busAgencymasterMapper.maxId();
Integer startId = (Integer) redisService.get(REDIS_KEY);
if (startId == null) {
startId = 0;
}
if (startId.intValue() > endId.intValue()) {
return false;
}
//  同步信息
for (long i = startId.intValue(); i <= endId.intValue(); i++) {
try {
sync(i);
} catch (Exception e) {
e.printStackTrace();
}
redisService.getRedisTemplateObj().opsForValue().increment(REDIS_KEY, 1);
}
return true;
}
@Override
public ReportAgencyInfo sync(Long agencyId) {
ReportAgencyInfo reportAgencyInfo = new ReportAgencyInfo();
BusAgencymasterEntity busAgencymasterEntity = busAgencymasterService.getById(agencyId);
if (busAgencymasterEntity == null) {
return null;
}
BeanUtils.build(reportAgencyInfo, busAgencymasterEntity);
save(reportAgencyInfo);
return reportAgencyInfo;
}
}
...@@ -43,12 +43,15 @@ public class ReportCsOrderInfoServiceImpl extends BaseServiceImpl<ReportCsOrderI ...@@ -43,12 +43,15 @@ public class ReportCsOrderInfoServiceImpl extends BaseServiceImpl<ReportCsOrderI
@Override @Override
public void sync() { public boolean sync() {
Long endId = csOrderDetailMapper.maxId(); Long endId = csOrderDetailMapper.maxId();
Integer startId = (Integer) redisService.get(REDIS_KEY); Integer startId = (Integer) redisService.get(REDIS_KEY);
if (startId == null) { if (startId == null) {
startId = 0; startId = 0;
} }
if(startId.intValue() > endId.intValue()){
return false;
}
//  同步信息 //  同步信息
for (long i = startId.intValue(); i <= endId.intValue(); i++) { for (long i = startId.intValue(); i <= endId.intValue(); i++) {
...@@ -59,6 +62,8 @@ public class ReportCsOrderInfoServiceImpl extends BaseServiceImpl<ReportCsOrderI ...@@ -59,6 +62,8 @@ public class ReportCsOrderInfoServiceImpl extends BaseServiceImpl<ReportCsOrderI
} }
redisService.getRedisTemplateObj().opsForValue().increment(REDIS_KEY, 1); redisService.getRedisTemplateObj().opsForValue().increment(REDIS_KEY, 1);
} }
return true;
} }
@Override @Override
...@@ -79,7 +84,6 @@ public class ReportCsOrderInfoServiceImpl extends BaseServiceImpl<ReportCsOrderI ...@@ -79,7 +84,6 @@ public class ReportCsOrderInfoServiceImpl extends BaseServiceImpl<ReportCsOrderI
BeanUtils.build(reportCsOrderInfo, csOrderEntity); BeanUtils.build(reportCsOrderInfo, csOrderEntity);
save(reportCsOrderInfo); save(reportCsOrderInfo);
log.info("save:reportCsOrderInfo:{}", reportCsOrderInfo);
return reportCsOrderInfo; return reportCsOrderInfo;
} }
} }
...@@ -6,17 +6,11 @@ import com.jarvis.common.redis.service.RedisService; ...@@ -6,17 +6,11 @@ import com.jarvis.common.redis.service.RedisService;
import com.jarvis.dataCenter.bean.BeanUtils; import com.jarvis.dataCenter.bean.BeanUtils;
import com.jarvis.dataCenter.constants.DbConstants; import com.jarvis.dataCenter.constants.DbConstants;
import com.jarvis.dataCenter.entity.report.ReportDoInfo; import com.jarvis.dataCenter.entity.report.ReportDoInfo;
import com.jarvis.dataCenter.entity.warehouse.DeliveryOrderDetailEntity; import com.jarvis.dataCenter.entity.warehouse.*;
import com.jarvis.dataCenter.entity.warehouse.DeliveryOrderEntity;
import com.jarvis.dataCenter.entity.warehouse.WarehouseEntity;
import com.jarvis.dataCenter.mapper.report.ReportDoInfoMapper; import com.jarvis.dataCenter.mapper.report.ReportDoInfoMapper;
import com.jarvis.dataCenter.mapper.warehouse.DeliveryOrderDetailMapper; import com.jarvis.dataCenter.mapper.warehouse.DeliveryOrderDetailMapper;
import com.jarvis.dataCenter.mapper.warehouse.DeliveryOrderMapper;
import com.jarvis.dataCenter.service.report.ReportCsOrderInfoService;
import com.jarvis.dataCenter.service.report.ReportDoInfoService; import com.jarvis.dataCenter.service.report.ReportDoInfoService;
import com.jarvis.dataCenter.service.warehouse.DeliveryOrderDetailService; import com.jarvis.dataCenter.service.warehouse.*;
import com.jarvis.dataCenter.service.warehouse.DeliveryOrderService;
import com.jarvis.dataCenter.service.warehouse.WarehouseService;
import com.jarvis.lib.common.mybatisplus.service.impl.BaseServiceImpl; import com.jarvis.lib.common.mybatisplus.service.impl.BaseServiceImpl;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -44,6 +38,15 @@ public class ReportDoInfoServiceImpl extends BaseServiceImpl<ReportDoInfoMapper, ...@@ -44,6 +38,15 @@ public class ReportDoInfoServiceImpl extends BaseServiceImpl<ReportDoInfoMapper,
@Autowired @Autowired
private DeliveryOrderDetailMapper deliveryOrderDetailMapper; private DeliveryOrderDetailMapper deliveryOrderDetailMapper;
@Autowired
private StockAllocationService stockAllocationService;
@Autowired
private StockContainerService stockContainerService;
@Autowired
private DeliveryLicenceService deliveryLicenceService;
public static boolean SYNC = false; public static boolean SYNC = false;
...@@ -54,12 +57,15 @@ public class ReportDoInfoServiceImpl extends BaseServiceImpl<ReportDoInfoMapper, ...@@ -54,12 +57,15 @@ public class ReportDoInfoServiceImpl extends BaseServiceImpl<ReportDoInfoMapper,
private WarehouseService warehouseService; private WarehouseService warehouseService;
@Override @Override
public void sync() { public boolean sync() {
Long endId = deliveryOrderDetailMapper.maxId(); Long endId = deliveryOrderDetailMapper.maxId();
Integer startId = (Integer) redisService.get(REDIS_KEY); Integer startId = (Integer) redisService.get(REDIS_KEY);
if (startId == null) { if (startId == null) {
startId = 0; startId = 0;
} }
if (startId.intValue() > endId.intValue()) {
return false;
}
//  同步信息 //  同步信息
for (long i = startId.intValue(); i <= endId.intValue(); i++) { for (long i = startId.intValue(); i <= endId.intValue(); i++) {
...@@ -70,29 +76,49 @@ public class ReportDoInfoServiceImpl extends BaseServiceImpl<ReportDoInfoMapper, ...@@ -70,29 +76,49 @@ public class ReportDoInfoServiceImpl extends BaseServiceImpl<ReportDoInfoMapper,
} }
redisService.getRedisTemplateObj().opsForValue().increment(REDIS_KEY, 1); redisService.getRedisTemplateObj().opsForValue().increment(REDIS_KEY, 1);
} }
return true;
} }
@Override @Override
public ReportDoInfo sync(Long doDetailId) { public ReportDoInfo sync(Long doDetailId) {
ReportDoInfo reportDoInfo = new ReportDoInfo(); ReportDoInfo reportDoInfo = new ReportDoInfo();
//发货单详情
DeliveryOrderDetailEntity deliveryOrderDetailEntity = deliveryOrderDetailService.getById(doDetailId); DeliveryOrderDetailEntity deliveryOrderDetailEntity = deliveryOrderDetailService.getById(doDetailId);
BeanUtils.build(reportDoInfo, deliveryOrderDetailEntity); BeanUtils.build(reportDoInfo, deliveryOrderDetailEntity);
if(deliveryOrderDetailEntity == null){ if (deliveryOrderDetailEntity == null) {
return null; return null;
} }
//发货单
DeliveryOrderEntity deliveryOrderEntity = DeliveryOrderEntity deliveryOrderEntity =
deliveryOrderService.getOne(Wrappers.lambdaQuery(new DeliveryOrderEntity()).eq(DeliveryOrderEntity::getCode, deliveryOrderDetailEntity.getDoCode())); deliveryOrderService.getOne(Wrappers.lambdaQuery(new DeliveryOrderEntity()).eq(DeliveryOrderEntity::getCode, deliveryOrderDetailEntity.getDoCode()));
BeanUtils.build(reportDoInfo, deliveryOrderEntity); BeanUtils.build(reportDoInfo, deliveryOrderEntity);
if (deliveryOrderDetailEntity.getSupplierWarehouseId() != null) { //库存分配
WarehouseEntity warehouseEntity = warehouseService.getById(deliveryOrderDetailEntity.getSupplierWarehouseId()); StockAllocationEntity stockAllocationEntity =
stockAllocationService.getOne(Wrappers.lambdaQuery(new StockAllocationEntity())
.eq(StockAllocationEntity::getDeliveryDetailId, deliveryOrderDetailEntity.getId())
.eq(StockAllocationEntity::getSkuCode, deliveryOrderDetailEntity.getSkuCode())
.eq(StockAllocationEntity::getDeliveryOrderId, deliveryOrderDetailEntity.getDeliveryOrderId())
);
BeanUtils.build(reportDoInfo, stockAllocationEntity);
if (stockAllocationEntity != null) {
//仓库
WarehouseEntity warehouseEntity = warehouseService.getById(stockAllocationEntity.getWarehouseId());
BeanUtils.build(reportDoInfo, warehouseEntity); BeanUtils.build(reportDoInfo, warehouseEntity);
//库位
StockContainerEntity stockContainerEntity = stockContainerService.getById(stockAllocationEntity.getContainerId());
BeanUtils.build(reportDoInfo, stockContainerEntity);
} }
save(reportDoInfo); save(reportDoInfo);
log.info("save:reportDoInfo:{}", reportDoInfo);
return reportDoInfo; return reportDoInfo;
} }
} }
package com.jarvis.dataCenter.service.impl.report;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.jarvis.common.redis.service.RedisService;
import com.jarvis.dataCenter.bean.BeanUtils;
import com.jarvis.dataCenter.constants.DbConstants;
import com.jarvis.dataCenter.entity.jws.InvoiceSignEntity;
import com.jarvis.dataCenter.entity.report.ReportInvoiceInfo;
import com.jarvis.dataCenter.mapper.jws.InvoiceSignMapper;
import com.jarvis.dataCenter.mapper.report.ReportInvoiceInfoMapper;
import com.jarvis.dataCenter.service.jws.InvoiceSignService;
import com.jarvis.dataCenter.service.report.ReportInvoiceInfoService;
import com.jarvis.lib.common.mybatisplus.service.impl.BaseServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author jinzhaopo
* @date 2019-11-01 15:14
*/
@DS(DbConstants.REPORT)
@Service
@Slf4j
public class ReportInvoiceInfoServiceImpl extends BaseServiceImpl<ReportInvoiceInfoMapper, ReportInvoiceInfo> implements ReportInvoiceInfoService {
@Autowired
private InvoiceSignService invoiceSignService;
@Autowired
private InvoiceSignMapper invoiceSignMapper;
@Autowired
private RedisService redisService;
public static String REDIS_KEY = "sync:report:invoice:id:";
@Override
public boolean sync() {
Long endId = invoiceSignMapper.maxId();
Integer startId = (Integer) redisService.get(REDIS_KEY);
if (startId == null) {
startId = 0;
}
if (startId.intValue() > endId.intValue()) {
return false;
}
//  同步信息
for (long i = startId.intValue(); i <= endId.intValue(); i++) {
try {
sync(i);
} catch (Exception e) {
e.printStackTrace();
}
redisService.getRedisTemplateObj().opsForValue().increment(REDIS_KEY, 1);
}
return true;
}
@Override
public ReportInvoiceInfo sync(Long invoiceId) {
ReportInvoiceInfo reportInvoiceInfo = new ReportInvoiceInfo();
InvoiceSignEntity invoiceSignEntity = invoiceSignService.getById(invoiceId);
if (invoiceSignEntity == null) {
return null;
}
BeanUtils.build(reportInvoiceInfo, invoiceSignEntity);
save(reportInvoiceInfo);
return reportInvoiceInfo;
}
}
...@@ -56,13 +56,18 @@ public class ReportSkuInfoServiceImpl extends BaseServiceImpl<ReportSkuInfoMappe ...@@ -56,13 +56,18 @@ public class ReportSkuInfoServiceImpl extends BaseServiceImpl<ReportSkuInfoMappe
@Override @Override
public void sync() { public boolean sync() {
Long endId = busMerchandisemasterMapper.maxId(); Long endId = busMerchandisemasterMapper.maxId();
Integer startId = (Integer) redisService.get(REDIS_KEY); Integer startId = (Integer) redisService.get(REDIS_KEY);
if (startId == null) { if (startId == null) {
startId = 0; startId = 0;
} }
System.out.println(startId + "," + endId);
if (startId.intValue() > endId.intValue()) {
return false;
}
//  同步信息 //  同步信息
for (long i = startId.intValue(); i <= endId.intValue(); i++) { for (long i = startId.intValue(); i <= endId.intValue(); i++) {
try { try {
...@@ -73,6 +78,8 @@ public class ReportSkuInfoServiceImpl extends BaseServiceImpl<ReportSkuInfoMappe ...@@ -73,6 +78,8 @@ public class ReportSkuInfoServiceImpl extends BaseServiceImpl<ReportSkuInfoMappe
redisService.getRedisTemplateObj().opsForValue().increment(REDIS_KEY, 1); redisService.getRedisTemplateObj().opsForValue().increment(REDIS_KEY, 1);
} }
return true;
} }
@Override @Override
...@@ -112,7 +119,6 @@ public class ReportSkuInfoServiceImpl extends BaseServiceImpl<ReportSkuInfoMappe ...@@ -112,7 +119,6 @@ public class ReportSkuInfoServiceImpl extends BaseServiceImpl<ReportSkuInfoMappe
BeanUtils.build(reportSkuInfo, poSupliersmasterEntity); BeanUtils.build(reportSkuInfo, poSupliersmasterEntity);
save(reportSkuInfo); save(reportSkuInfo);
log.info("save:reportSkuInfo:{}", reportSkuInfo);
return reportSkuInfo; return reportSkuInfo;
} }
} }
...@@ -52,12 +52,15 @@ public class ReportSoPoInfoServiceImpl extends BaseServiceImpl<ReportSoPoInfoMap ...@@ -52,12 +52,15 @@ public class ReportSoPoInfoServiceImpl extends BaseServiceImpl<ReportSoPoInfoMap
@Override @Override
public void sync() { public boolean sync() {
Long endId = soOrderdetailMapper.maxId(); Long endId = soOrderdetailMapper.maxId();
Integer startId = (Integer) redisService.get(REDIS_KEY); Integer startId = (Integer) redisService.get(REDIS_KEY);
if (startId == null) { if (startId == null) {
startId = 0; startId = 0;
} }
if(startId.intValue() > endId.intValue()){
return false;
}
//  同步信息 //  同步信息
for (long i = startId.intValue(); i <= endId.intValue(); i++) { for (long i = startId.intValue(); i <= endId.intValue(); i++) {
...@@ -68,6 +71,8 @@ public class ReportSoPoInfoServiceImpl extends BaseServiceImpl<ReportSoPoInfoMap ...@@ -68,6 +71,8 @@ public class ReportSoPoInfoServiceImpl extends BaseServiceImpl<ReportSoPoInfoMap
} }
redisService.getRedisTemplateObj().opsForValue().increment(REDIS_KEY, 1); redisService.getRedisTemplateObj().opsForValue().increment(REDIS_KEY, 1);
} }
return true;
} }
@Override @Override
...@@ -115,7 +120,6 @@ public class ReportSoPoInfoServiceImpl extends BaseServiceImpl<ReportSoPoInfoMap ...@@ -115,7 +120,6 @@ public class ReportSoPoInfoServiceImpl extends BaseServiceImpl<ReportSoPoInfoMap
} }
save(reportSoPoInfo); save(reportSoPoInfo);
log.info("save:reportSoPoInfo:{}", reportSoPoInfo);
return reportSoPoInfo; return reportSoPoInfo;
} }
} }
package com.jarvis.dataCenter.service.impl.report;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.jarvis.dataCenter.constants.DbConstants;
import com.jarvis.dataCenter.entity.report.ReportAgencyInfo;
import com.jarvis.dataCenter.service.report.*;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.concurrent.TimeUnit;
/**
* @author jinzhaopo
* @date 2019-11-01 14:51
*/
@DS(DbConstants.REPORT)
@Service
@Slf4j
@Data
public class ThreadServiceImpl implements ThreadService {
public static boolean syncSku = true;
public static boolean syncAgency = true;
public static boolean syncAddress = true;
public static boolean syncSoInfo = true;
public static boolean syncCsInfo = true;
public static boolean sycnDoInfo = true;
public static boolean syncInvoiceInfo = true;
public static long sleepSku = 10;
public static long sleepAgency = 10;
public static long sleepAddress = 10;
public static long sleepSoInfo = 10;
public static long sleepCsInfo = 10;
public static long sleepDoInfo = 10;
public static long sleepInvoiceInfo = 10;
@Autowired
private ReportSkuInfoService reportSkuInfoService;
@Autowired
private ReportAgencyInfoService reportAgencyInfoService;
@Autowired
private ReportAddressInfoService reportAddressInfoService;
@Autowired
private ReportSoPoInfoService reportSoPoInfoService;
@Autowired
private ReportDoInfoService reportDoInfoService;
@Autowired
private ReportCsOrderInfoService reportCsOrderInfoService;
@Autowired
private ReportInvoiceInfoService reportInvoiceInfoService;
private Thread syncSkuThread = new Thread(new Runnable() {
@Override
public void run() {
while (true) {
if (syncSku) {
boolean sync = reportSkuInfoService.sync();
if (!sync) {
try {
TimeUnit.MINUTES.sleep(sleepSku);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
}
});
private Thread syncAgencyThread = new Thread(new Runnable() {
@Override
public void run() {
while (true) {
if (syncAgency) {
boolean sync = reportAgencyInfoService.sync();
if (!sync) {
try {
TimeUnit.MINUTES.sleep(sleepAgency);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
}
});
private Thread syncAddressThread = new Thread(new Runnable() {
@Override
public void run() {
while (true) {
if (syncAddress) {
boolean sync = reportAddressInfoService.sync();
if (!sync) {
try {
TimeUnit.MINUTES.sleep(sleepAddress);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
}
});
private Thread syncSoInfoThread = new Thread(new Runnable() {
@Override
public void run() {
while (true) {
if (syncSoInfo) {
boolean sync = reportSoPoInfoService.sync();
if (!sync) {
try {
TimeUnit.MINUTES.sleep(sleepSoInfo);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
}
});
private Thread syncCsInfoThread = new Thread(new Runnable() {
@Override
public void run() {
while (true) {
if (syncCsInfo) {
boolean sync = reportCsOrderInfoService.sync();
if (!sync) {
try {
TimeUnit.MINUTES.sleep(sleepCsInfo);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
}
});
private Thread sycnDoInfoThread = new Thread(new Runnable() {
@Override
public void run() {
while (true) {
if (sycnDoInfo) {
boolean sync = reportDoInfoService.sync();
if (!sync) {
try {
TimeUnit.MINUTES.sleep(sleepDoInfo);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
}
});
private Thread syncInvoiceInfoThread = new Thread(new Runnable() {
@Override
public void run() {
while (true) {
if (syncInvoiceInfo) {
boolean sync = reportInvoiceInfoService.sync();
if (!sync) {
try {
TimeUnit.MINUTES.sleep(sleepInvoiceInfo);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
}
});
@Override
public boolean syncSku() {
syncSkuThread.start();
return true;
}
@Override
public boolean syncAgency() {
syncAgencyThread.start();
return true;
}
@Override
public boolean syncAddress() {
syncAddressThread.start();
return true;
}
@Override
public boolean syncSoInfo() {
syncSoInfoThread.start();
return true;
}
@Override
public boolean syncCsInfo() {
syncCsInfoThread.start();
return true;
}
@Override
public boolean sycnDoInfo() {
sycnDoInfoThread.start();
return true;
}
@Override
public boolean syncInvoiceInfo() {
syncInvoiceInfoThread.start();
return true;
}
}
package com.jarvis.dataCenter.service.impl.warehouse;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.jarvis.dataCenter.constants.DbConstants;
import com.jarvis.dataCenter.entity.warehouse.StockAllocationEntity;
import com.jarvis.dataCenter.mapper.warehouse.StockAllocationMapper;
import com.jarvis.dataCenter.service.warehouse.StockAllocationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.jarvis.lib.common.mybatisplus.service.impl.BaseServiceImpl;
/**
* <p>
* 库存分配记录表
* </p>
*
* @author jinzhaopo
* @since 2019-11-05
*/
@Service
@DS(DbConstants.WAREHOUSE)
public class StockAllocationServiceImpl extends BaseServiceImpl<StockAllocationMapper, StockAllocationEntity> implements StockAllocationService {
}
\ No newline at end of file
package com.jarvis.dataCenter.service.impl.warehouse;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.jarvis.dataCenter.constants.DbConstants;
import com.jarvis.dataCenter.entity.warehouse.StockContainerEntity;
import com.jarvis.dataCenter.mapper.warehouse.StockContainerMapper;
import com.jarvis.dataCenter.service.warehouse.StockContainerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.jarvis.lib.common.mybatisplus.service.impl.BaseServiceImpl;
/**
* <p>
* 库位表
* </p>
*
* @author jinzhaopo
* @since 2019-11-05
*/
@Service
@DS(DbConstants.WAREHOUSE)
public class StockContainerServiceImpl extends BaseServiceImpl<StockContainerMapper, StockContainerEntity> implements StockContainerService {
}
\ No newline at end of file
package com.jarvis.dataCenter.service.jws;
import com.jarvis.dataCenter.entity.jws.InvoiceSignEntity;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jarvis.lib.common.mybatisplus.service.IBaseService;
/**
* <p>
* 开票的标记表
* </p>
*
* @author jinzhaopo
* @since 2019-11-01
*/
public interface InvoiceSignService extends IBaseService<InvoiceSignEntity> {
}
\ No newline at end of file
package com.jarvis.dataCenter.service.prod;
import com.jarvis.dataCenter.entity.prod.BusAgencyaddressEntity;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jarvis.lib.common.mybatisplus.service.IBaseService;
/**
* <p>
* 机构地址表
* </p>
*
* @author jinzhaopo
* @since 2019-11-01
*/
public interface BusAgencyaddressService extends IBaseService<BusAgencyaddressEntity> {
}
\ No newline at end of file
package com.jarvis.dataCenter.service.prod;
import com.jarvis.dataCenter.entity.prod.BusAgencymasterEntity;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jarvis.lib.common.mybatisplus.service.IBaseService;
/**
* <p>
* 机构主表
* </p>
*
* @author jinzhaopo
* @since 2019-11-01
*/
public interface BusAgencymasterService extends IBaseService<BusAgencymasterEntity> {
}
\ No newline at end of file
package com.jarvis.dataCenter.service.report;
import com.jarvis.dataCenter.entity.report.ReportAddressInfo;
import com.jarvis.dataCenter.entity.report.ReportInvoiceInfo;
import com.jarvis.lib.common.mybatisplus.service.IBaseService;
/**
* @author jinzhaopo
* @date 2019-11-01 13:58
*/
public interface ReportAddressInfoService extends IBaseService<ReportAddressInfo> {
boolean sync();
ReportAddressInfo sync(Long addressId);
}
package com.jarvis.dataCenter.service.report;
import com.jarvis.dataCenter.entity.report.ReportAgencyInfo;
import com.jarvis.lib.common.mybatisplus.service.IBaseService;
/**
* @author jinzhaopo
* @date 2019-11-01 13:58
*/
public interface ReportAgencyInfoService extends IBaseService<ReportAgencyInfo> {
boolean sync();
ReportAgencyInfo sync(Long agencyId);
}
...@@ -9,7 +9,7 @@ import com.jarvis.lib.common.mybatisplus.service.IBaseService; ...@@ -9,7 +9,7 @@ import com.jarvis.lib.common.mybatisplus.service.IBaseService;
*/ */
public interface ReportCsOrderInfoService extends IBaseService<ReportCsOrderInfo> { public interface ReportCsOrderInfoService extends IBaseService<ReportCsOrderInfo> {
void sync(); boolean sync();
ReportCsOrderInfo sync(Long csDetailId); ReportCsOrderInfo sync(Long csDetailId);
} }
...@@ -8,7 +8,7 @@ import com.jarvis.lib.common.mybatisplus.service.IBaseService; ...@@ -8,7 +8,7 @@ import com.jarvis.lib.common.mybatisplus.service.IBaseService;
* @date 2019-10-30 14:56 * @date 2019-10-30 14:56
*/ */
public interface ReportDoInfoService extends IBaseService<ReportDoInfo> { public interface ReportDoInfoService extends IBaseService<ReportDoInfo> {
void sync(); boolean sync();
ReportDoInfo sync(Long doDetailId); ReportDoInfo sync(Long doDetailId);
} }
package com.jarvis.dataCenter.service.report;
import com.jarvis.dataCenter.entity.report.ReportDoInfo;
import com.jarvis.dataCenter.entity.report.ReportInvoiceInfo;
import com.jarvis.lib.common.mybatisplus.service.IBaseService;
/**
* @author jinzhaopo
* @date 2019-11-01 13:57
*/
public interface ReportInvoiceInfoService extends IBaseService<ReportInvoiceInfo> {
boolean sync();
ReportInvoiceInfo sync(Long invoiceId);
}
...@@ -10,7 +10,7 @@ import com.jarvis.lib.common.mybatisplus.service.IBaseService; ...@@ -10,7 +10,7 @@ import com.jarvis.lib.common.mybatisplus.service.IBaseService;
public interface ReportSkuInfoService extends IBaseService<ReportSkuInfo> { public interface ReportSkuInfoService extends IBaseService<ReportSkuInfo> {
void sync(); boolean sync();
ReportSkuInfo sync(Long skuId); ReportSkuInfo sync(Long skuId);
} }
...@@ -9,7 +9,7 @@ import com.jarvis.lib.common.mybatisplus.service.IBaseService; ...@@ -9,7 +9,7 @@ import com.jarvis.lib.common.mybatisplus.service.IBaseService;
*/ */
public interface ReportSoPoInfoService extends IBaseService<ReportSoPoInfo> { public interface ReportSoPoInfoService extends IBaseService<ReportSoPoInfo> {
void sync(); boolean sync();
ReportSoPoInfo sync(Long soDetailId); ReportSoPoInfo sync(Long soDetailId);
} }
package com.jarvis.dataCenter.service.report;
/**
* @author jinzhaopo
* @date 2019-11-01 14:49
*/
public interface ThreadService {
boolean syncSku();
boolean syncAgency();
boolean syncAddress();
boolean syncSoInfo();
boolean syncCsInfo();
boolean sycnDoInfo();
boolean syncInvoiceInfo();
}
package com.jarvis.dataCenter.service.warehouse;
import com.jarvis.dataCenter.entity.warehouse.StockAllocationEntity;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jarvis.lib.common.mybatisplus.service.IBaseService;
/**
* <p>
* 库存分配记录表
* </p>
*
* @author jinzhaopo
* @since 2019-11-05
*/
public interface StockAllocationService extends IBaseService<StockAllocationEntity> {
}
\ No newline at end of file
package com.jarvis.dataCenter.service.warehouse;
import com.jarvis.dataCenter.entity.warehouse.StockContainerEntity;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jarvis.lib.common.mybatisplus.service.IBaseService;
/**
* <p>
* 库位表
* </p>
*
* @author jinzhaopo
* @since 2019-11-05
*/
public interface StockContainerService extends IBaseService<StockContainerEntity> {
}
\ No newline at end of file
...@@ -103,3 +103,11 @@ spring: ...@@ -103,3 +103,11 @@ spring:
mybatis-plus: mybatis-plus:
configuration: configuration:
map-underscore-to-camel-case: false map-underscore-to-camel-case: false
open:
replicator:
host: rm-2zer7527706ysmqd4o.mysql.rds.aliyuncs.com
port: 3306
user: jarvis_admin
pwd: Quanli123
SELECT distinct
dod.so_code AS '销售单',
dor.`code` AS '发货单',
dod.sku_code AS 'SKU',
dod.product_id AS '产品ID',
dod.spec_id AS '规格ID',
dod.product_name AS '产品名称',
dor.supplier_short_name AS '供应商',
CONCAT(dod.spec_name,'|',dod.spec_name_ext) AS '规格|子规格',
IFNULL(dod.customer_prod_code, dod.supplier_prod_code) AS '供应商代码',
dod.producer_prod_code AS '厂商编码',
dod.brand_name AS '品牌',
dod.sales_unit AS '销售单位',
dod.expect_quantity AS '订货数量',
dod.expect_quantity - dod.outage_quantity AS '实际发货数量',
dod.customer_memo AS '备注',
dor.warehouse_id AS '仓库ID',
ware.`name` AS '仓库',
cont.`code` AS '库位',
sall.quantity AS '出库数量',
sall.batch_code AS '批次号',
CASE
WHEN sall.eternal_item='y' THEN '长期有效'
ELSE SUBSTR(sall.expiry_date,1,10)
END AS '到期日',
CASE
WHEN dl.id IS NULL THEN '是'
WHEN dl_i.id IS NOT NULL THEN '是'
ELSE '否'
END AS '是否首营'
FROM
delivery_order dor ##发货单
LEFT JOIN delivery_order_detail dod ON dod.do_code=dor.`code` ##发货单详情
LEFT JOIN stock_allocation sall ON sall.delivery_detail_id=dod.id AND sall.delivery_order_id=dod.delivery_order_id AND sall.sku_code=dod.sku_code AND sall.`status`<>'CANCELED' ##库存分配
LEFT JOIN warehouse ware ON ware.id=sall.warehouse_id ##仓库
LEFT JOIN stock_container cont ON cont.id=sall.container_id ##库位
#LEFT JOIN warehouse_stock stock ON stock.id=sall.stock_id ##库存
LEFT JOIN delivery_licence dl ON dl.agency_id=dor.delivery_agency_id AND dl.product_id=dod.product_id
LEFT JOIN delivery_licence dl_i ON dl_i.do_code = dod.do_code AND dl_i.product_id = dod.product_id
WHERE
FIND_IN_SET(dor.`code`,'${invoiceCode}')
AND dod.expect_quantity > dod.outage_quantity
ORDER BY
dod.brand_id,dod.product_id,dod.spec_id,dod.sku_code
;
\ No newline at end of file
<?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.jarvis.dataCenter.mapper.jws.InvoiceSignMapper">
</mapper>
<?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.jarvis.dataCenter.mapper.warehouse.StockAllocationMapper">
</mapper>
<?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.jarvis.dataCenter.mapper.warehouse.StockContainerMapper">
</mapper>
<?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.jarvis.dataCenter.mapper.prod.BusAgencyaddressMapper">
</mapper>
<?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.jarvis.dataCenter.mapper.prod.BusAgencymasterMapper">
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment