Commit df411a4f by yinyong

数据中心-半成品生产库存数据

parent f2d39080
...@@ -35,7 +35,7 @@ public class SyncSemiPurchaseDetailsJob extends PointJob { ...@@ -35,7 +35,7 @@ public class SyncSemiPurchaseDetailsJob extends PointJob {
public void executeJob(ShardingContext shardingContext, JobPointLog jobPointLog) { public void executeJob(ShardingContext shardingContext, JobPointLog jobPointLog) {
MediaType mediaType = MediaType.parse("application/json"); MediaType mediaType = MediaType.parse("application/json");
LinkedHashMap<String, Object> map = new LinkedHashMap<>(4); LinkedHashMap<String, Object> map = new LinkedHashMap<>(4);
map.put("start", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getStartTime().minusMinutes(1L))); map.put("start", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getStartTime().minusMinutes(10L)));
map.put("end", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getEndTime())); map.put("end", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getEndTime()));
map.put("pagesize", jobPointLog.getPageSize()); map.put("pagesize", jobPointLog.getPageSize());
List<PurchaseDetailDTO> purchaseDetailDTOList = null; List<PurchaseDetailDTO> purchaseDetailDTOList = null;
......
package com.bailuntec.job;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.bailuntec.domain.constant.CommonConstant;
import com.bailuntec.domain.dto.PurchaseDetailDTO;
import com.bailuntec.domain.entity.DcSemiPurchaseInfo;
import com.bailuntec.domain.entity.JobPointLog;
import com.bailuntec.domain.example.DcSemiPurchaseInfoExample;
import com.bailuntec.mapper.DcSemiPurchaseInfoMapper;
import com.bailuntec.mapper.JobPointLogMapper;
import com.bailuntec.support.PointJob;
import com.bailuntec.utils.OkHttpUtil;
import com.bailuntec.utils.PropertiesUtil;
import com.bailuntec.utils.SessionUtil;
import com.dangdang.ddframe.job.api.ShardingContext;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.LinkedHashMap;
import java.util.List;
@Slf4j
public class SyncSemiPurchaseOldDetailsJob extends PointJob {
private static PropertiesUtil propertiesUtil = PropertiesUtil.getInstance("const");
private static OkHttpClient client = OkHttpUtil.getInstance();
@Override
public void executeJob(ShardingContext shardingContext, JobPointLog jobPointLog) {
MediaType mediaType = MediaType.parse("application/json");
LinkedHashMap<String, Object> map = new LinkedHashMap<>(4);
map.put("start", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getStartTime().minusDays(15L)));
map.put("end", DateTimeFormatter.ofPattern(CommonConstant.TIME_FORMAT).format(jobPointLog.getEndTime()));
map.put("pagesize", jobPointLog.getPageSize());
List<PurchaseDetailDTO> purchaseDetailDTOList = null;
do {
map.put("page", jobPointLog.getPageIndex());
RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(map));
String purchaseStr = null;
Response response = null;
if (purchaseDetailDTOList != null) purchaseDetailDTOList = null;
try {
Request request = new Request.Builder()
.url(propertiesUtil.getPropertyAsString("SEMI_PURCHASE_DETAILS_URL"))
.post(body)
.addHeader("Content-Type", "application/json")
.build();
response = client.newCall(request).execute();
purchaseStr = response.body().string();
} catch (IOException e) {
log.error("调用半成品采购单sku详细信息接口失败", e);
throw new RuntimeException("调用半成品采购单sku详细信息接口失败", e);
} finally {
if (response != null) {
response.close();
}
}
if (StringUtils.isNotBlank(purchaseStr)) {
JSONObject jsonObject = JSON.parseObject(purchaseStr);
if (jsonObject != null) {
purchaseDetailDTOList = jsonObject.getObject("data", new TypeReference<List<PurchaseDetailDTO>>() {
});
if (purchaseDetailDTOList != null && purchaseDetailDTOList.size() > 0) {
try {
DcSemiPurchaseInfoMapper mapper = SessionUtil.getSession().getMapper(DcSemiPurchaseInfoMapper.class);
if (jobPointLog.getPageIndex() % 10 == 0) {
JobPointLogMapper pointLogMapper = SessionUtil.getSession().getMapper(JobPointLogMapper.class);
pointLogMapper.upsertSelective(jobPointLog);
}
purchaseDetailDTOList.forEach(purchaseDetail -> {
log.warn(purchaseDetail.getBailunSku() + "&" + purchaseDetail.getPurchaseId());
DcSemiPurchaseInfo dcSemiPurchaseInfo = new DcSemiPurchaseInfo();
try {
BeanUtils.copyProperties(dcSemiPurchaseInfo, purchaseDetail);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("BeanUtils.copyProperties采购单sku详细信息异常");
}
dcSemiPurchaseInfo.setQuantityNotInbound(purchaseDetail.getQuantityPurchase() - purchaseDetail.getQuantityInbound());
dcSemiPurchaseInfo.setCreateTime(LocalDateTime.parse(purchaseDetail.getCreateTimed(), DateTimeFormatter.ofPattern("yyyy/M/d H:m:s")));
dcSemiPurchaseInfo.setUpdateTime(LocalDateTime.parse(purchaseDetail.getUpdateTimed(), DateTimeFormatter.ofPattern("yyyy/M/d H:m:s")));
dcSemiPurchaseInfo.setGmtModified(LocalDateTime.now());
int i = mapper.updateByExampleSelective(dcSemiPurchaseInfo, DcSemiPurchaseInfoExample.newAndCreateCriteria().andBailunSkuEqualTo(dcSemiPurchaseInfo.getBailunSku()).andPurchaseIdEqualTo(dcSemiPurchaseInfo.getPurchaseId()).example());
if (i == 0) {
mapper.insertSelective(dcSemiPurchaseInfo);
}
});
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("MYBATIS操作DB失败");
} finally {
SessionUtil.closeSession();
}
}else {
break;
}
} else {
throw new RuntimeException("调用采购单sku详细信息接口失败");
}
} else {
throw new RuntimeException("调用采购单sku详细信息接口失败");
}
jobPointLog.setPageIndex(jobPointLog.getPageIndex() + 1);
} while (true);
jobPointLog.setPageIndex(1);
jobPointLog.setStartTime(jobPointLog.getEndTime());
jobPointLog.setEndTime(jobPointLog.getStartTime().plusDays(jobPointLog.getIntervalTime().longValue()).isAfter(LocalDateTime.now()) ? LocalDateTime.now() : jobPointLog.getStartTime().plusDays(jobPointLog.getIntervalTime().longValue()));
}
}
#PURCHASE_DETAILS_URL=http://purchase.bailuntec.com/api/GetPagePurchaseSkuInfo PURCHASE_DETAILS_URL=http://purchase.bailuntec.com/api/GetPagePurchaseSkuInfo
SEMI_PURCHASE_DETAILS_URL=http://mjcg.bailuntec.com/Api/GetPagePurchaseSkuInfo SEMI_PURCHASE_DETAILS_URL=http://mjcg.bailuntec.com/Api/GetPagePurchaseSkuInfo
PURCHASE_DETAILS_URL=http://10.0.6.15:3333/api/GetPagePurchaseSkuInfo #PURCHASE_DETAILS_URL=http://10.0.6.15:3333/api/GetPagePurchaseSkuInfo
PURCHASE_AIMS_URL=http://api.purchase.bailuntec.com/Api/PurchaseSource PURCHASE_AIMS_URL=http://api.purchase.bailuntec.com/Api/PurchaseSource
\ No newline at end of file
import com.bailuntec.domain.entity.JobPointLog; import com.bailuntec.domain.entity.JobPointLog;
import com.bailuntec.job.SyncPurchaseAimsJob; import com.bailuntec.job.SyncPurchaseAimsJob;
import com.bailuntec.job.SyncPurchaseDetailsJob; import com.bailuntec.job.SyncPurchaseDetailsJob;
import com.bailuntec.job.SyncSemiPurchaseDetailsJob;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import java.time.LocalDateTime; import java.time.LocalDateTime;
...@@ -9,9 +10,9 @@ public class SyncPurchaseDetailsTest { ...@@ -9,9 +10,9 @@ public class SyncPurchaseDetailsTest {
@Test @Test
public void test() { public void test() {
SyncPurchaseDetailsJob syncPurchaseDetailsJob = new SyncPurchaseDetailsJob(); SyncPurchaseDetailsJob syncPurchaseDetailsJob = new SyncPurchaseDetailsJob();
syncPurchaseDetailsJob.executeJob(null, new JobPointLog("base-purchase-details", 140,1000,0,1, syncPurchaseDetailsJob.executeJob(null, new JobPointLog("base-purchase-details", 1,1000,0,1,
LocalDateTime.of(2018,12,25,0,0), LocalDateTime.of(2020,03,01,0,0),
LocalDateTime.of(2018,12,26,0,0))); LocalDateTime.of(2020,03,15,0,0)));
} }
@Test @Test
...@@ -22,4 +23,12 @@ public class SyncPurchaseDetailsTest { ...@@ -22,4 +23,12 @@ public class SyncPurchaseDetailsTest {
LocalDateTime.of(2018,12,26,0,0))); LocalDateTime.of(2018,12,26,0,0)));
} }
@Test
public void test2() {
SyncSemiPurchaseDetailsJob syncSemiPurchaseDetailsJob = new SyncSemiPurchaseDetailsJob();
syncSemiPurchaseDetailsJob.executeJob(null, new JobPointLog("test1", 1, 100, 0, 1,
LocalDateTime.of(2020,4,10,0,0),
LocalDateTime.of(2020,4,28,0,0)));
}
} }
...@@ -2,6 +2,7 @@ package com.bailuntec; ...@@ -2,6 +2,7 @@ package com.bailuntec;
import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.pool.DruidDataSource;
import com.bailuntec.job.SemiOrderSyncJob; import com.bailuntec.job.SemiOrderSyncJob;
import com.bailuntec.job.SemiStockProdSyncJob;
import com.bailuntec.job.SemiStockReportSyncJob; import com.bailuntec.job.SemiStockReportSyncJob;
import com.bailuntec.listener.SemiOrderSyncJobListener; import com.bailuntec.listener.SemiOrderSyncJobListener;
import com.bailuntec.utils.PropertiesUtil; import com.bailuntec.utils.PropertiesUtil;
...@@ -28,6 +29,7 @@ public class Application { ...@@ -28,6 +29,7 @@ public class Application {
public static void main(String[] args) { public static void main(String[] args) {
new JobScheduler(createRegistryCenter(), createJobConfiguration(),createJobEventConfiguration(), new SemiOrderSyncJobListener()).init(); new JobScheduler(createRegistryCenter(), createJobConfiguration(),createJobEventConfiguration(), new SemiOrderSyncJobListener()).init();
new JobScheduler(createRegistryCenter(), createJobConfiguration1(), createJobEventConfiguration()).init(); new JobScheduler(createRegistryCenter(), createJobConfiguration1(), createJobEventConfiguration()).init();
new JobScheduler(createRegistryCenter(), createJobConfiguration2(), createJobEventConfiguration()).init();
} }
private static CoordinatorRegistryCenter createRegistryCenter() { private static CoordinatorRegistryCenter createRegistryCenter() {
...@@ -50,6 +52,13 @@ public class Application { ...@@ -50,6 +52,13 @@ public class Application {
return simpleJobRootConfig; return simpleJobRootConfig;
} }
private static LiteJobConfiguration createJobConfiguration2() {
JobCoreConfiguration simpleCoreConfig = JobCoreConfiguration.newBuilder(propertiesUtil.getPropertyAsString("JOB_STOCK_PROD_NAME"), propertiesUtil.getPropertyAsString("JOB_STOCK_PROD_CRON"), propertiesUtil.getPropertyAsInt("SHARDING_TOTAL_COUNT")).build();
SimpleJobConfiguration simpleJobConfig = new SimpleJobConfiguration(simpleCoreConfig, SemiStockProdSyncJob.class.getCanonicalName());
LiteJobConfiguration simpleJobRootConfig = LiteJobConfiguration.newBuilder(simpleJobConfig).build();
return simpleJobRootConfig;
}
private static JobEventConfiguration createJobEventConfiguration() { private static JobEventConfiguration createJobEventConfiguration() {
JobEventConfiguration jobEventRdbConfig = new JobEventRdbConfiguration(setUpEventTraceDataSource()); JobEventConfiguration jobEventRdbConfig = new JobEventRdbConfiguration(setUpEventTraceDataSource());
return jobEventRdbConfig; return jobEventRdbConfig;
......
package com.bailuntec.job;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.bailuntec.domain.constant.CommonConstant;
import com.bailuntec.domain.entity.DcSemiStockProd;
import com.bailuntec.domain.entity.DcSemiStockReport;
import com.bailuntec.domain.entity.JobPointLog;
import com.bailuntec.domain.pojo.SemiStockReportInfo;
import com.bailuntec.mapper.DcSemiStockProdMapper;
import com.bailuntec.mapper.DcSemiStockReportMapper;
import com.bailuntec.mapper.JobPointLogMapper;
import com.bailuntec.support.PointJob;
import com.bailuntec.utils.ExceptionUtil;
import com.bailuntec.utils.OkHttpUtil;
import com.bailuntec.utils.PropertiesUtil;
import com.bailuntec.utils.SessionUtil;
import com.dangdang.ddframe.job.api.ShardingContext;
import lombok.extern.slf4j.Slf4j;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.LinkedHashMap;
import java.util.List;
@Slf4j
public class SemiStockProdSyncJob extends PointJob {
private OkHttpClient okHttpClient = OkHttpUtil.getInstance();
private PropertiesUtil propertiesUtil = PropertiesUtil.getInstance("const");
@Override
public void executeJob(ShardingContext shardingContext, JobPointLog jobPointLog) {
LinkedHashMap<String, String> map = new LinkedHashMap<>(2);
map.put("rows", jobPointLog.getPageSize().toString());
Integer totalPage = 0;
do {
map.put("page", jobPointLog.getPageIndex().equals(0) ? "1" : jobPointLog.getPageIndex().toString());
Response response = null;
String palResultStr = null;
try {
Request request = new Request.Builder()
.get()
.url(OkHttpUtil.attachHttpGetParams(propertiesUtil.getPropertyAsString("SEMI_STOCK_PROD"), map))
.addHeader("Content-Type", "application/json")
.build();
response = okHttpClient.newCall(request).execute();
palResultStr = response.body().string();
} catch (IOException e) {
throw new RuntimeException(map + "请求流水接口同步百伦接口失败" + response, e);
} finally {
if (response != null) {
response.close();
}
}
if (StringUtils.isNoneBlank(palResultStr)) {
SemiStockReportInfo<DcSemiStockProd> stockResultRoot = JSONObject.parseObject(palResultStr, new TypeReference<SemiStockReportInfo<DcSemiStockProd>>(){});
if (stockResultRoot != null && stockResultRoot.getSuccess().booleanValue()) {
if (jobPointLog.getPageIndex().equals(0)) {
jobPointLog.setPageIndex(stockResultRoot.getData().getTotalPages() + 1);
}
List<DcSemiStockProd> resultData = stockResultRoot.getData() == null ? null : stockResultRoot.getData().getItems();
totalPage = stockResultRoot.getData().getTotalPages();
if (resultData != null && resultData.size() > 0) {
for(DcSemiStockProd semiStockProd : resultData) {
semiStockProd.setId(null);
DcSemiStockProdMapper mapper = SessionUtil.getSession().getMapper(DcSemiStockProdMapper.class);
mapper.upsertSelective(semiStockProd);
}
}
} else {
log.warn("返回数据错误:"+ palResultStr);
throw new RuntimeException("调用生产库存接口同步百伦库存流水失败, 响应200, 请求参数" + map.toString());
}
} else {
throw new RuntimeException("调用生产库存接口同步百伦库存流水失败, 响应为null, 请求参数" + map.toString());
}
if (jobPointLog.getPageIndex() % 10 == 0) {
try {
JobPointLogMapper mapper = SessionUtil.getSession().getMapper(JobPointLogMapper.class);
mapper.upsertSelective(jobPointLog);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(ExceptionUtil.transform(e), e);
} finally {
SessionUtil.closeSession();
}
}
jobPointLog.setPageIndex(jobPointLog.getPageIndex() - 1);
} while (0 < jobPointLog.getPageIndex());
jobPointLog.setPageIndex(0);
jobPointLog.setStartTime(jobPointLog.getEndTime());
jobPointLog.setEndTime(jobPointLog.getEndTime().plusDays(jobPointLog.getIntervalTime()).isAfter(LocalDateTime.now().minusHours(3)) ? LocalDateTime.now().minusHours(3) : jobPointLog.getEndTime().plusDays(jobPointLog.getIntervalTime()));
}
}
SEMI_ORDER_URL=http://mjzz.bailuntec.com/api/ApiOrderApply SEMI_ORDER_URL=http://mjzz.bailuntec.com/api/ApiOrderApply
SEMI_STOCK_URL=http://mjzz.bailuntec.com/Material/FullStockLogPage SEMI_STOCK_URL=http://mjzz.bailuntec.com/Material/FullStockLogPage
\ No newline at end of file SEMI_STOCK_PROD=http://mjzz.bailuntec.com/api/ProdStockPage
\ No newline at end of file
...@@ -13,4 +13,6 @@ JOB_NAME=base-sync-semi-order ...@@ -13,4 +13,6 @@ JOB_NAME=base-sync-semi-order
JOB_CRON=0/1 * * * * ? * JOB_CRON=0/1 * * * * ? *
JOB_STOCK_NAME=base_sync_semi_stock JOB_STOCK_NAME=base_sync_semi_stock
JOB_STOCK_CRON=0/10 * * * * ? * JOB_STOCK_CRON=0/10 * * * * ? *
JOB_STOCK_PROD_NAME=base-sync-semi-prod
JOB_STOCK_PROD_CRON=0/10 * * * * ? *
SHARDING_TOTAL_COUNT=1 SHARDING_TOTAL_COUNT=1
\ No newline at end of file
package com.bailuntec.domain.entity;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Data
public class DcSemiStockProd {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_stock_prod.id
*
* @mbg.generated
*/
private Integer id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_stock_prod.material_id
*
* @mbg.generated
*/
private Integer materialId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_stock_prod.warehouse_id
*
* @mbg.generated
*/
private Integer warehouseId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_stock_prod.jit_prod_stock
*
* @mbg.generated
*/
private BigDecimal jitProdStock;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_stock_prod.plan_prod_stock
*
* @mbg.generated
*/
private BigDecimal planProdStock;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_stock_prod.warehouse_name
*
* @mbg.generated
*/
private String warehouseName;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_stock_prod.material_code
*
* @mbg.generated
*/
private String materialCode;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_stock_prod.material_name
*
* @mbg.generated
*/
private String materialName;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_stock_prod.material_category
*
* @mbg.generated
*/
private String materialCategory;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_stock_prod.new_price
*
* @mbg.generated
*/
private BigDecimal newPrice;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_stock_prod.gmt_create
*
* @mbg.generated
*/
private LocalDateTime gmtCreate;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_semi_stock_prod.gmt_modify
*
* @mbg.generated
*/
private LocalDateTime gmtModify;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_semi_stock_prod
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", materialId=").append(materialId);
sb.append(", warehouseId=").append(warehouseId);
sb.append(", jitProdStock=").append(jitProdStock);
sb.append(", planProdStock=").append(planProdStock);
sb.append(", warehouseName=").append(warehouseName);
sb.append(", materialCode=").append(materialCode);
sb.append(", materialName=").append(materialName);
sb.append(", materialCategory=").append(materialCategory);
sb.append(", newPrice=").append(newPrice);
sb.append(", gmtCreate=").append(gmtCreate);
sb.append(", gmtModify=").append(gmtModify);
sb.append("]");
return sb.toString();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_semi_stock_prod
*
* @mbg.generated
*/
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
DcSemiStockProd other = (DcSemiStockProd) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getMaterialId() == null ? other.getMaterialId() == null : this.getMaterialId().equals(other.getMaterialId()))
&& (this.getWarehouseId() == null ? other.getWarehouseId() == null : this.getWarehouseId().equals(other.getWarehouseId()))
&& (this.getJitProdStock() == null ? other.getJitProdStock() == null : this.getJitProdStock().equals(other.getJitProdStock()))
&& (this.getPlanProdStock() == null ? other.getPlanProdStock() == null : this.getPlanProdStock().equals(other.getPlanProdStock()))
&& (this.getWarehouseName() == null ? other.getWarehouseName() == null : this.getWarehouseName().equals(other.getWarehouseName()))
&& (this.getMaterialCode() == null ? other.getMaterialCode() == null : this.getMaterialCode().equals(other.getMaterialCode()))
&& (this.getMaterialName() == null ? other.getMaterialName() == null : this.getMaterialName().equals(other.getMaterialName()))
&& (this.getMaterialCategory() == null ? other.getMaterialCategory() == null : this.getMaterialCategory().equals(other.getMaterialCategory()))
&& (this.getNewPrice() == null ? other.getNewPrice() == null : this.getNewPrice().equals(other.getNewPrice()))
&& (this.getGmtCreate() == null ? other.getGmtCreate() == null : this.getGmtCreate().equals(other.getGmtCreate()))
&& (this.getGmtModify() == null ? other.getGmtModify() == null : this.getGmtModify().equals(other.getGmtModify()));
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_semi_stock_prod
*
* @mbg.generated
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getMaterialId() == null) ? 0 : getMaterialId().hashCode());
result = prime * result + ((getWarehouseId() == null) ? 0 : getWarehouseId().hashCode());
result = prime * result + ((getJitProdStock() == null) ? 0 : getJitProdStock().hashCode());
result = prime * result + ((getPlanProdStock() == null) ? 0 : getPlanProdStock().hashCode());
result = prime * result + ((getWarehouseName() == null) ? 0 : getWarehouseName().hashCode());
result = prime * result + ((getMaterialCode() == null) ? 0 : getMaterialCode().hashCode());
result = prime * result + ((getMaterialName() == null) ? 0 : getMaterialName().hashCode());
result = prime * result + ((getMaterialCategory() == null) ? 0 : getMaterialCategory().hashCode());
result = prime * result + ((getNewPrice() == null) ? 0 : getNewPrice().hashCode());
result = prime * result + ((getGmtCreate() == null) ? 0 : getGmtCreate().hashCode());
result = prime * result + ((getGmtModify() == null) ? 0 : getGmtModify().hashCode());
return result;
}
}
\ No newline at end of file
package com.bailuntec.mapper;
import com.bailuntec.domain.entity.DcSemiStockProd;
import com.bailuntec.domain.example.DcSemiStockProdExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface DcSemiStockProdMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_semi_stock_prod
*
* @mbg.generated
*/
long countByExample(DcSemiStockProdExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_semi_stock_prod
*
* @mbg.generated
*/
int deleteByExample(DcSemiStockProdExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_semi_stock_prod
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_semi_stock_prod
*
* @mbg.generated
*/
int insert(DcSemiStockProd record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_semi_stock_prod
*
* @mbg.generated
*/
int insertSelective(DcSemiStockProd record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_semi_stock_prod
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
DcSemiStockProd selectOneByExample(DcSemiStockProdExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_semi_stock_prod
*
* @mbg.generated
*/
List<DcSemiStockProd> selectByExample(DcSemiStockProdExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_semi_stock_prod
*
* @mbg.generated
*/
DcSemiStockProd selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_semi_stock_prod
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") DcSemiStockProd record, @Param("example") DcSemiStockProdExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_semi_stock_prod
*
* @mbg.generated
*/
int updateByExample(@Param("record") DcSemiStockProd record, @Param("example") DcSemiStockProdExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_semi_stock_prod
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(DcSemiStockProd record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_semi_stock_prod
*
* @mbg.generated
*/
int updateByPrimaryKey(DcSemiStockProd record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_semi_stock_prod
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsert(DcSemiStockProd record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_semi_stock_prod
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int upsertSelective(DcSemiStockProd record);
}
\ No newline at end of file
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