提交 6d1d9e56 编写于 作者: ibizdev's avatar ibizdev

lab_gzf 部署微服务接口

上级 06bd37a6
......@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /businesscentral-app-businesscentral.jar
EXPOSE 10320
EXPOSE 8080
ADD businesscentral-app-businesscentral.jar /businesscentral-app-businesscentral.jar
......@@ -3,23 +3,9 @@ services:
businesscentral-app-businesscentral:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/businesscentral-app-businesscentral:latest
ports:
- "10320:10320"
- "8080:8080"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=10320
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
- SPRING_REDIS_HOST=127.0.0.1
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_LAB01_e85d8801c
- SPRING_DATASOURCE_PASSWORD=b1@@@772
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_e85d8801c?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_e85d8801c
- CAS=https://passport.ibizlab.cn
- NACOS=172.16.240.110:8848
deploy:
resources:
limits:
......
......@@ -7,6 +7,10 @@ logging:
#zuul网关路由设置
zuul:
routes:
opportunityproduct:
path: /opportunityproducts/**
serviceId: ibizbusinesscentral-centralapi
stripPrefix: false
campaignlist:
path: /campaignlists/**
serviceId: ibizbusinesscentral-centralapi
......
......@@ -208,10 +208,10 @@ public class TransactionCurrencyServiceImpl extends ServiceImpl<TransactionCurre
private cn.ibizlab.businesscentral.core.product.service.IProductAssociationService productassociationService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.product.service.IProductPricePevelService productpricepevelService;
private cn.ibizlab.businesscentral.core.product.service.IProductPriceLevelService productpricelevelService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.product.service.IProductSubStituteService productsubstituteService;
private cn.ibizlab.businesscentral.core.product.service.IProductSubstituteService productsubstituteService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.product.service.IProductService productService;
......
......@@ -49,7 +49,7 @@ public class UomScheduleServiceImpl extends ServiceImpl<UomScheduleMapper, UomSc
private cn.ibizlab.businesscentral.core.service.service.IContractDetailService contractdetailService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.product.service.IProductPricePevelService productpricepevelService;
private cn.ibizlab.businesscentral.core.product.service.IProductPriceLevelService productpricelevelService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.product.service.IProductService productService;
......
......@@ -58,7 +58,7 @@ public class UomServiceImpl extends ServiceImpl<UomMapper, Uom> implements IUomS
private cn.ibizlab.businesscentral.core.product.service.IProductAssociationService productassociationService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.product.service.IProductPricePevelService productpricepevelService;
private cn.ibizlab.businesscentral.core.product.service.IProductPriceLevelService productpricelevelService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.product.service.IProductService productService;
......
package cn.ibizlab.businesscentral.core.product.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.businesscentral.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.businesscentral.core.product.domain.ProductPriceLevel;
/**
* 关系型数据实体[ProductPriceLevel] 查询条件对象
*/
@Slf4j
@Data
public class ProductPriceLevelSearchContext extends QueryWrapperContext<ProductPriceLevel> {
private String n_pricingmethodcode_eq;//[定价方式]
public void setN_pricingmethodcode_eq(String n_pricingmethodcode_eq) {
this.n_pricingmethodcode_eq = n_pricingmethodcode_eq;
if(!ObjectUtils.isEmpty(this.n_pricingmethodcode_eq)){
this.getSearchCond().eq("pricingmethodcode", n_pricingmethodcode_eq);
}
}
private String n_roundingoptioncode_eq;//[舍入选项]
public void setN_roundingoptioncode_eq(String n_roundingoptioncode_eq) {
this.n_roundingoptioncode_eq = n_roundingoptioncode_eq;
if(!ObjectUtils.isEmpty(this.n_roundingoptioncode_eq)){
this.getSearchCond().eq("roundingoptioncode", n_roundingoptioncode_eq);
}
}
private String n_quantitysellingcode_eq;//[销售数量控制]
public void setN_quantitysellingcode_eq(String n_quantitysellingcode_eq) {
this.n_quantitysellingcode_eq = n_quantitysellingcode_eq;
if(!ObjectUtils.isEmpty(this.n_quantitysellingcode_eq)){
this.getSearchCond().eq("quantitysellingcode", n_quantitysellingcode_eq);
}
}
private String n_roundingpolicycode_eq;//[舍入原则]
public void setN_roundingpolicycode_eq(String n_roundingpolicycode_eq) {
this.n_roundingpolicycode_eq = n_roundingpolicycode_eq;
if(!ObjectUtils.isEmpty(this.n_roundingpolicycode_eq)){
this.getSearchCond().eq("roundingpolicycode", n_roundingpolicycode_eq);
}
}
private String n_productid_eq;//[产品]
public void setN_productid_eq(String n_productid_eq) {
this.n_productid_eq = n_productid_eq;
if(!ObjectUtils.isEmpty(this.n_productid_eq)){
this.getSearchCond().eq("productid", n_productid_eq);
}
}
private String n_uomscheduleid_eq;//[单位计划 ID]
public void setN_uomscheduleid_eq(String n_uomscheduleid_eq) {
this.n_uomscheduleid_eq = n_uomscheduleid_eq;
if(!ObjectUtils.isEmpty(this.n_uomscheduleid_eq)){
this.getSearchCond().eq("uomscheduleid", n_uomscheduleid_eq);
}
}
private String n_transactioncurrencyid_eq;//[货币]
public void setN_transactioncurrencyid_eq(String n_transactioncurrencyid_eq) {
this.n_transactioncurrencyid_eq = n_transactioncurrencyid_eq;
if(!ObjectUtils.isEmpty(this.n_transactioncurrencyid_eq)){
this.getSearchCond().eq("transactioncurrencyid", n_transactioncurrencyid_eq);
}
}
private String n_uomid_eq;//[计价单位]
public void setN_uomid_eq(String n_uomid_eq) {
this.n_uomid_eq = n_uomid_eq;
if(!ObjectUtils.isEmpty(this.n_uomid_eq)){
this.getSearchCond().eq("uomid", n_uomid_eq);
}
}
private String n_discounttypeid_eq;//[折扣表]
public void setN_discounttypeid_eq(String n_discounttypeid_eq) {
this.n_discounttypeid_eq = n_discounttypeid_eq;
if(!ObjectUtils.isEmpty(this.n_discounttypeid_eq)){
this.getSearchCond().eq("discounttypeid", n_discounttypeid_eq);
}
}
private String n_pricelevelid_eq;//[价目表]
public void setN_pricelevelid_eq(String n_pricelevelid_eq) {
this.n_pricelevelid_eq = n_pricelevelid_eq;
if(!ObjectUtils.isEmpty(this.n_pricelevelid_eq)){
this.getSearchCond().eq("pricelevelid", n_pricelevelid_eq);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
}
}
}
package cn.ibizlab.businesscentral.core.product.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import cn.ibizlab.businesscentral.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.businesscentral.core.product.domain.ProductSubstitute;
/**
* 关系型数据实体[ProductSubstitute] 查询条件对象
*/
@Slf4j
@Data
public class ProductSubstituteSearchContext extends QueryWrapperContext<ProductSubstitute> {
private String n_productsubstitutename_like;//[产品子套件名称]
public void setN_productsubstitutename_like(String n_productsubstitutename_like) {
this.n_productsubstitutename_like = n_productsubstitutename_like;
if(!ObjectUtils.isEmpty(this.n_productsubstitutename_like)){
this.getSearchCond().like("productsubstitutename", n_productsubstitutename_like);
}
}
private Integer n_statuscode_eq;//[状态描述]
public void setN_statuscode_eq(Integer n_statuscode_eq) {
this.n_statuscode_eq = n_statuscode_eq;
if(!ObjectUtils.isEmpty(this.n_statuscode_eq)){
this.getSearchCond().eq("statuscode", n_statuscode_eq);
}
}
private String n_direction_eq;//[方向]
public void setN_direction_eq(String n_direction_eq) {
this.n_direction_eq = n_direction_eq;
if(!ObjectUtils.isEmpty(this.n_direction_eq)){
this.getSearchCond().eq("direction", n_direction_eq);
}
}
private String n_salesrelationshiptype_eq;//[销售关系类型]
public void setN_salesrelationshiptype_eq(String n_salesrelationshiptype_eq) {
this.n_salesrelationshiptype_eq = n_salesrelationshiptype_eq;
if(!ObjectUtils.isEmpty(this.n_salesrelationshiptype_eq)){
this.getSearchCond().eq("salesrelationshiptype", n_salesrelationshiptype_eq);
}
}
private Integer n_statecode_eq;//[状态]
public void setN_statecode_eq(Integer n_statecode_eq) {
this.n_statecode_eq = n_statecode_eq;
if(!ObjectUtils.isEmpty(this.n_statecode_eq)){
this.getSearchCond().eq("statecode", n_statecode_eq);
}
}
private String n_productid_eq;//[产品]
public void setN_productid_eq(String n_productid_eq) {
this.n_productid_eq = n_productid_eq;
if(!ObjectUtils.isEmpty(this.n_productid_eq)){
this.getSearchCond().eq("productid", n_productid_eq);
}
}
private String n_substitutedproductid_eq;//[相关产品]
public void setN_substitutedproductid_eq(String n_substitutedproductid_eq) {
this.n_substitutedproductid_eq = n_substitutedproductid_eq;
if(!ObjectUtils.isEmpty(this.n_substitutedproductid_eq)){
this.getSearchCond().eq("substitutedproductid", n_substitutedproductid_eq);
}
}
private String n_transactioncurrencyid_eq;//[货币]
public void setN_transactioncurrencyid_eq(String n_transactioncurrencyid_eq) {
this.n_transactioncurrencyid_eq = n_transactioncurrencyid_eq;
if(!ObjectUtils.isEmpty(this.n_transactioncurrencyid_eq)){
this.getSearchCond().eq("transactioncurrencyid", n_transactioncurrencyid_eq);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("productsubstitutename", query)
);
}
}
}
package cn.ibizlab.businesscentral.core.product.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.businesscentral.core.product.domain.ProductPriceLevel;
import cn.ibizlab.businesscentral.core.product.filter.ProductPriceLevelSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface ProductPriceLevelMapper extends BaseMapper<ProductPriceLevel>{
Page<ProductPriceLevel> searchDefault(IPage page, @Param("srf") ProductPriceLevelSearchContext context, @Param("ew") Wrapper<ProductPriceLevel> wrapper) ;
@Override
ProductPriceLevel selectById(Serializable id);
@Override
int insert(ProductPriceLevel entity);
@Override
int updateById(@Param(Constants.ENTITY) ProductPriceLevel entity);
@Override
int update(@Param(Constants.ENTITY) ProductPriceLevel entity, @Param("ew") Wrapper<ProductPriceLevel> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<ProductPriceLevel> selectByDiscounttypeid(@Param("discounttypeid") Serializable discounttypeid) ;
List<ProductPriceLevel> selectByPricelevelid(@Param("pricelevelid") Serializable pricelevelid) ;
List<ProductPriceLevel> selectByProductid(@Param("productid") Serializable productid) ;
List<ProductPriceLevel> selectByTransactioncurrencyid(@Param("transactioncurrencyid") Serializable transactioncurrencyid) ;
List<ProductPriceLevel> selectByUomscheduleid(@Param("uomscheduleid") Serializable uomscheduleid) ;
List<ProductPriceLevel> selectByUomid(@Param("uomid") Serializable uomid) ;
}
package cn.ibizlab.businesscentral.core.product.mapper;
import java.util.List;
import org.apache.ibatis.annotations.*;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.HashMap;
import org.apache.ibatis.annotations.Select;
import cn.ibizlab.businesscentral.core.product.domain.ProductSubstitute;
import cn.ibizlab.businesscentral.core.product.filter.ProductSubstituteSearchContext;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.alibaba.fastjson.JSONObject;
public interface ProductSubstituteMapper extends BaseMapper<ProductSubstitute>{
Page<ProductSubstitute> searchDefault(IPage page, @Param("srf") ProductSubstituteSearchContext context, @Param("ew") Wrapper<ProductSubstitute> wrapper) ;
@Override
ProductSubstitute selectById(Serializable id);
@Override
int insert(ProductSubstitute entity);
@Override
int updateById(@Param(Constants.ENTITY) ProductSubstitute entity);
@Override
int update(@Param(Constants.ENTITY) ProductSubstitute entity, @Param("ew") Wrapper<ProductSubstitute> updateWrapper);
@Override
int deleteById(Serializable id);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select("${sql}")
List<JSONObject> selectBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update("${sql}")
boolean updateBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert("${sql}")
boolean insertBySQL(@Param("sql") String sql, @Param("et")Map param);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<ProductSubstitute> selectByProductid(@Param("productid") Serializable productid) ;
List<ProductSubstitute> selectBySubstitutedproductid(@Param("productid") Serializable productid) ;
List<ProductSubstitute> selectByTransactioncurrencyid(@Param("transactioncurrencyid") Serializable transactioncurrencyid) ;
}
package cn.ibizlab.businesscentral.core.product.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.businesscentral.core.product.domain.ProductPriceLevel;
import cn.ibizlab.businesscentral.core.product.filter.ProductPriceLevelSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[ProductPriceLevel] 服务对象接口
*/
public interface IProductPriceLevelService extends IService<ProductPriceLevel>{
boolean create(ProductPriceLevel et) ;
void createBatch(List<ProductPriceLevel> list) ;
ProductPriceLevel get(String key) ;
boolean save(ProductPriceLevel et) ;
void saveBatch(List<ProductPriceLevel> list) ;
boolean update(ProductPriceLevel et) ;
void updateBatch(List<ProductPriceLevel> list) ;
ProductPriceLevel getDraft(ProductPriceLevel et) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
boolean checkKey(ProductPriceLevel et) ;
Page<ProductPriceLevel> searchDefault(ProductPriceLevelSearchContext context) ;
List<ProductPriceLevel> selectByDiscounttypeid(String discounttypeid) ;
void removeByDiscounttypeid(String discounttypeid) ;
List<ProductPriceLevel> selectByPricelevelid(String pricelevelid) ;
void removeByPricelevelid(String pricelevelid) ;
List<ProductPriceLevel> selectByProductid(String productid) ;
void removeByProductid(String productid) ;
List<ProductPriceLevel> selectByTransactioncurrencyid(String transactioncurrencyid) ;
void removeByTransactioncurrencyid(String transactioncurrencyid) ;
List<ProductPriceLevel> selectByUomscheduleid(String uomscheduleid) ;
void removeByUomscheduleid(String uomscheduleid) ;
List<ProductPriceLevel> selectByUomid(String uomid) ;
void removeByUomid(String uomid) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<ProductPriceLevel> getProductpricelevelByIds(List<String> ids) ;
List<ProductPriceLevel> getProductpricelevelByEntities(List<ProductPriceLevel> entities) ;
}
package cn.ibizlab.businesscentral.core.product.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.businesscentral.core.product.domain.ProductSubstitute;
import cn.ibizlab.businesscentral.core.product.filter.ProductSubstituteSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[ProductSubstitute] 服务对象接口
*/
public interface IProductSubstituteService extends IService<ProductSubstitute>{
boolean create(ProductSubstitute et) ;
void createBatch(List<ProductSubstitute> list) ;
boolean checkKey(ProductSubstitute et) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
boolean update(ProductSubstitute et) ;
void updateBatch(List<ProductSubstitute> list) ;
boolean save(ProductSubstitute et) ;
void saveBatch(List<ProductSubstitute> list) ;
ProductSubstitute get(String key) ;
ProductSubstitute getDraft(ProductSubstitute et) ;
Page<ProductSubstitute> searchDefault(ProductSubstituteSearchContext context) ;
List<ProductSubstitute> selectByProductid(String productid) ;
void removeByProductid(String productid) ;
List<ProductSubstitute> selectBySubstitutedproductid(String productid) ;
void removeBySubstitutedproductid(String productid) ;
List<ProductSubstitute> selectByTransactioncurrencyid(String transactioncurrencyid) ;
void removeByTransactioncurrencyid(String transactioncurrencyid) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List<JSONObject> select(String sql, Map param);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean execute(String sql, Map param);
List<ProductSubstitute> getProductsubstituteByIds(List<String> ids) ;
List<ProductSubstitute> getProductsubstituteByEntities(List<ProductSubstitute> entities) ;
}
......@@ -61,7 +61,7 @@ public class PriceLevelServiceImpl extends ServiceImpl<PriceLevelMapper, PriceLe
private cn.ibizlab.businesscentral.core.sales.service.IOpportunityService opportunityService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.product.service.IProductPricePevelService productpricepevelService;
private cn.ibizlab.businesscentral.core.product.service.IProductPriceLevelService productpricelevelService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.product.service.IProductService productService;
......
package cn.ibizlab.businesscentral.core.product.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.product.domain.ProductPriceLevel;
import cn.ibizlab.businesscentral.core.product.filter.ProductPriceLevelSearchContext;
import cn.ibizlab.businesscentral.core.product.service.IProductPriceLevelService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.product.mapper.ProductPriceLevelMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[价目表项] 服务对象接口实现
*/
@Slf4j
@Service("ProductPriceLevelServiceImpl")
public class ProductPriceLevelServiceImpl extends ServiceImpl<ProductPriceLevelMapper, ProductPriceLevel> implements IProductPriceLevelService {
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.sales.service.IDiscountTypeService discounttypeService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.product.service.IPriceLevelService pricelevelService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.product.service.IProductService productService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.base.service.ITransactionCurrencyService transactioncurrencyService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.base.service.IUomScheduleService uomscheduleService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.base.service.IUomService uomService;
private int batchSize = 500;
@Override
@Transactional
public boolean create(ProductPriceLevel et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getProductpricelevelid()),et);
return true;
}
@Override
public void createBatch(List<ProductPriceLevel> list) {
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public ProductPriceLevel get(String key) {
ProductPriceLevel et = getById(key);
if(et==null){
et=new ProductPriceLevel();
et.setProductpricelevelid(key);
}
else{
}
return et;
}
@Override
@Transactional
public boolean save(ProductPriceLevel et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(ProductPriceLevel et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<ProductPriceLevel> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<ProductPriceLevel> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(ProductPriceLevel et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("productpricelevelid",et.getProductpricelevelid())))
return false;
CachedBeanCopier.copy(get(et.getProductpricelevelid()),et);
return true;
}
@Override
public void updateBatch(List<ProductPriceLevel> list) {
updateBatchById(list,batchSize);
}
@Override
public ProductPriceLevel getDraft(ProductPriceLevel et) {
return et;
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
public boolean checkKey(ProductPriceLevel et) {
return (!ObjectUtils.isEmpty(et.getProductpricelevelid()))&&(!Objects.isNull(this.getById(et.getProductpricelevelid())));
}
@Override
public List<ProductPriceLevel> selectByDiscounttypeid(String discounttypeid) {
return baseMapper.selectByDiscounttypeid(discounttypeid);
}
@Override
public void removeByDiscounttypeid(String discounttypeid) {
this.remove(new QueryWrapper<ProductPriceLevel>().eq("discounttypeid",discounttypeid));
}
@Override
public List<ProductPriceLevel> selectByPricelevelid(String pricelevelid) {
return baseMapper.selectByPricelevelid(pricelevelid);
}
@Override
public void removeByPricelevelid(String pricelevelid) {
this.remove(new QueryWrapper<ProductPriceLevel>().eq("pricelevelid",pricelevelid));
}
@Override
public List<ProductPriceLevel> selectByProductid(String productid) {
return baseMapper.selectByProductid(productid);
}
@Override
public void removeByProductid(String productid) {
this.remove(new QueryWrapper<ProductPriceLevel>().eq("productid",productid));
}
@Override
public List<ProductPriceLevel> selectByTransactioncurrencyid(String transactioncurrencyid) {
return baseMapper.selectByTransactioncurrencyid(transactioncurrencyid);
}
@Override
public void removeByTransactioncurrencyid(String transactioncurrencyid) {
this.remove(new QueryWrapper<ProductPriceLevel>().eq("transactioncurrencyid",transactioncurrencyid));
}
@Override
public List<ProductPriceLevel> selectByUomscheduleid(String uomscheduleid) {
return baseMapper.selectByUomscheduleid(uomscheduleid);
}
@Override
public void removeByUomscheduleid(String uomscheduleid) {
this.remove(new QueryWrapper<ProductPriceLevel>().eq("uomscheduleid",uomscheduleid));
}
@Override
public List<ProductPriceLevel> selectByUomid(String uomid) {
return baseMapper.selectByUomid(uomid);
}
@Override
public void removeByUomid(String uomid) {
this.remove(new QueryWrapper<ProductPriceLevel>().eq("uomid",uomid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<ProductPriceLevel> searchDefault(ProductPriceLevelSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<ProductPriceLevel> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<ProductPriceLevel>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<ProductPriceLevel> getProductpricelevelByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<ProductPriceLevel> getProductpricelevelByEntities(List<ProductPriceLevel> entities) {
List ids =new ArrayList();
for(ProductPriceLevel entity : entities){
Serializable id=entity.getProductpricelevelid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
......@@ -61,10 +61,10 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
private cn.ibizlab.businesscentral.core.product.service.IProductAssociationService productassociationService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.product.service.IProductPricePevelService productpricepevelService;
private cn.ibizlab.businesscentral.core.product.service.IProductPriceLevelService productpricelevelService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.product.service.IProductSubStituteService productsubstituteService;
private cn.ibizlab.businesscentral.core.product.service.IProductSubstituteService productsubstituteService;
private cn.ibizlab.businesscentral.core.product.service.IProductService productService = this;
@Autowired
......
package cn.ibizlab.businesscentral.core.product.service.impl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.math.BigInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.businesscentral.core.product.domain.ProductSubstitute;
import cn.ibizlab.businesscentral.core.product.filter.ProductSubstituteSearchContext;
import cn.ibizlab.businesscentral.core.product.service.IProductSubstituteService;
import cn.ibizlab.businesscentral.util.helper.CachedBeanCopier;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.businesscentral.core.product.mapper.ProductSubstituteMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[产品替换] 服务对象接口实现
*/
@Slf4j
@Service("ProductSubstituteServiceImpl")
public class ProductSubstituteServiceImpl extends ServiceImpl<ProductSubstituteMapper, ProductSubstitute> implements IProductSubstituteService {
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.product.service.IProductService productService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.base.service.ITransactionCurrencyService transactioncurrencyService;
private int batchSize = 500;
@Override
@Transactional
public boolean create(ProductSubstitute et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getProductsubstituteid()),et);
return true;
}
@Override
public void createBatch(List<ProductSubstitute> list) {
this.saveBatch(list,batchSize);
}
@Override
public boolean checkKey(ProductSubstitute et) {
return (!ObjectUtils.isEmpty(et.getProductsubstituteid()))&&(!Objects.isNull(this.getById(et.getProductsubstituteid())));
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public boolean update(ProductSubstitute et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("productsubstituteid",et.getProductsubstituteid())))
return false;
CachedBeanCopier.copy(get(et.getProductsubstituteid()),et);
return true;
}
@Override
public void updateBatch(List<ProductSubstitute> list) {
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean save(ProductSubstitute et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(ProductSubstitute et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<ProductSubstitute> list) {
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<ProductSubstitute> list) {
saveOrUpdateBatch(list,batchSize);
}
@Override
@Transactional
public ProductSubstitute get(String key) {
ProductSubstitute et = getById(key);
if(et==null){
et=new ProductSubstitute();
et.setProductsubstituteid(key);
}
else{
}
return et;
}
@Override
public ProductSubstitute getDraft(ProductSubstitute et) {
return et;
}
@Override
public List<ProductSubstitute> selectByProductid(String productid) {
return baseMapper.selectByProductid(productid);
}
@Override
public void removeByProductid(String productid) {
this.remove(new QueryWrapper<ProductSubstitute>().eq("productid",productid));
}
@Override
public List<ProductSubstitute> selectBySubstitutedproductid(String productid) {
return baseMapper.selectBySubstitutedproductid(productid);
}
@Override
public void removeBySubstitutedproductid(String productid) {
this.remove(new QueryWrapper<ProductSubstitute>().eq("substitutedproductid",productid));
}
@Override
public List<ProductSubstitute> selectByTransactioncurrencyid(String transactioncurrencyid) {
return baseMapper.selectByTransactioncurrencyid(transactioncurrencyid);
}
@Override
public void removeByTransactioncurrencyid(String transactioncurrencyid) {
this.remove(new QueryWrapper<ProductSubstitute>().eq("transactioncurrencyid",transactioncurrencyid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<ProductSubstitute> searchDefault(ProductSubstituteSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<ProductSubstitute> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<ProductSubstitute>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
@Override
public List<JSONObject> select(String sql, Map param){
return this.baseMapper.selectBySQL(sql,param);
}
@Override
@Transactional
public boolean execute(String sql , Map param){
if (sql == null || sql.isEmpty()) {
return false;
}
if (sql.toLowerCase().trim().startsWith("insert")) {
return this.baseMapper.insertBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("update")) {
return this.baseMapper.updateBySQL(sql,param);
}
if (sql.toLowerCase().trim().startsWith("delete")) {
return this.baseMapper.deleteBySQL(sql,param);
}
log.warn("暂未支持的SQL语法");
return true;
}
@Override
public List<ProductSubstitute> getProductsubstituteByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<ProductSubstitute> getProductsubstituteByEntities(List<ProductSubstitute> entities) {
List ids =new ArrayList();
for(ProductSubstitute entity : entities){
Serializable id=entity.getProductsubstituteid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
......@@ -49,7 +49,7 @@ public class DiscountTypeServiceImpl extends ServiceImpl<DiscountTypeMapper, Dis
private cn.ibizlab.businesscentral.core.sales.service.IDiscountService discountService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.product.service.IProductPricePevelService productpricepevelService;
private cn.ibizlab.businesscentral.core.product.service.IProductPriceLevelService productpricelevelService;
@Autowired
@Lazy
private cn.ibizlab.businesscentral.core.base.service.ITransactionCurrencyService transactioncurrencyService;
......
<?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="cn.ibizlab.businesscentral.core.product.mapper.ProductPriceLevelMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="ProductPriceLevelResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`AMOUNT`, t1.`AMOUNT_BASE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DISCOUNTTYPEID`, t1.`EXCHANGERATE`, t1.`IMPORTSEQUENCENUMBER`, t1.`ORGANIZATIONID`, t1.`OVERRIDDENCREATEDON`, t1.`PERCENTAGE`, t1.`PRICELEVELID`, t1.`PRICINGMETHODCODE`, t1.`PROCESSID`, t1.`PRODUCTID`, t1.`PRODUCTNUMBER`, t1.`PRODUCTPRICELEVELID`, t1.`QUANTITYSELLINGCODE`, t1.`ROUNDINGOPTIONAMOUNT`, t1.`ROUNDINGOPTIONAMOUNT_BASE`, t1.`ROUNDINGOPTIONCODE`, t1.`ROUNDINGPOLICYCODE`, t1.`STAGEID`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TRANSACTIONCURRENCYID`, t1.`TRAVERSEDPATH`, t1.`UOMID`, t1.`UOMSCHEDULEID`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER` FROM `PRODUCTPRICELEVEL` t1 ) t1 where productpricelevelid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="ProductPriceLevelResultMap" type="cn.ibizlab.businesscentral.core.product.domain.ProductPriceLevel" autoMapping="true">
<id property="productpricelevelid" column="productpricelevelid" /><!--主键字段映射-->
<result property="amountBase" column="amount_base" />
<result property="roundingoptionamountBase" column="roundingoptionamount_base" />
<result property="productid" column="productid" />
<result property="uomscheduleid" column="uomscheduleid" />
<result property="transactioncurrencyid" column="transactioncurrencyid" />
<result property="uomid" column="uomid" />
<result property="discounttypeid" column="discounttypeid" />
<result property="pricelevelid" column="pricelevelid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="discounttype" javaType="cn.ibizlab.businesscentral.core.sales.domain.DiscountType" column="discounttypeid" select="cn.ibizlab.businesscentral.core.sales.mapper.DiscountTypeMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="pricelevel" javaType="cn.ibizlab.businesscentral.core.product.domain.PriceLevel" column="pricelevelid" select="cn.ibizlab.businesscentral.core.product.mapper.PriceLevelMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="product" javaType="cn.ibizlab.businesscentral.core.product.domain.Product" column="productid" select="cn.ibizlab.businesscentral.core.product.mapper.ProductMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="transactioncurrency" javaType="cn.ibizlab.businesscentral.core.base.domain.TransactionCurrency" column="transactioncurrencyid" select="cn.ibizlab.businesscentral.core.base.mapper.TransactionCurrencyMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="uomschedule" javaType="cn.ibizlab.businesscentral.core.base.domain.UomSchedule" column="uomscheduleid" select="cn.ibizlab.businesscentral.core.base.mapper.UomScheduleMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="uom" javaType="cn.ibizlab.businesscentral.core.base.domain.Uom" column="uomid" select="cn.ibizlab.businesscentral.core.base.mapper.UomMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCTPRICELEVEL__DISCOUNTTYPE__DISCOUNTTYPEID] -->
<select id="selectByDiscounttypeid" resultMap="ProductPriceLevelResultMap">
select t1.* from (
<include refid="Default" />
) t1
where discounttypeid=#{discounttypeid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCTPRICELEVEL__PRICELEVEL__PRICELEVELID] -->
<select id="selectByPricelevelid" resultMap="ProductPriceLevelResultMap">
select t1.* from (
<include refid="Default" />
) t1
where pricelevelid=#{pricelevelid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCTPRICELEVEL__PRODUCT__PRODUCTID] -->
<select id="selectByProductid" resultMap="ProductPriceLevelResultMap">
select t1.* from (
<include refid="Default" />
) t1
where productid=#{productid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCTPRICELEVEL__TRANSACTIONCURRENCY__TRANSACTIONCURRENCYID] -->
<select id="selectByTransactioncurrencyid" resultMap="ProductPriceLevelResultMap">
select t1.* from (
<include refid="Default" />
) t1
where transactioncurrencyid=#{transactioncurrencyid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCTPRICELEVEL__UOMSCHEDULE__UOMSCHEDULEID] -->
<select id="selectByUomscheduleid" resultMap="ProductPriceLevelResultMap">
select t1.* from (
<include refid="Default" />
) t1
where uomscheduleid=#{uomscheduleid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCTPRICELEVEL__UOM__UOMID] -->
<select id="selectByUomid" resultMap="ProductPriceLevelResultMap">
select t1.* from (
<include refid="Default" />
) t1
where uomid=#{uomid}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.product.filter.ProductPriceLevelSearchContext" resultMap="ProductPriceLevelResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`AMOUNT`, t1.`AMOUNT_BASE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DISCOUNTTYPEID`, t1.`EXCHANGERATE`, t1.`IMPORTSEQUENCENUMBER`, t1.`ORGANIZATIONID`, t1.`OVERRIDDENCREATEDON`, t1.`PERCENTAGE`, t1.`PRICELEVELID`, t1.`PRICINGMETHODCODE`, t1.`PROCESSID`, t1.`PRODUCTID`, t1.`PRODUCTNUMBER`, t1.`PRODUCTPRICELEVELID`, t1.`QUANTITYSELLINGCODE`, t1.`ROUNDINGOPTIONAMOUNT`, t1.`ROUNDINGOPTIONAMOUNT_BASE`, t1.`ROUNDINGOPTIONCODE`, t1.`ROUNDINGPOLICYCODE`, t1.`STAGEID`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TRANSACTIONCURRENCYID`, t1.`TRAVERSEDPATH`, t1.`UOMID`, t1.`UOMSCHEDULEID`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER` FROM `PRODUCTPRICELEVEL` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`AMOUNT`, t1.`AMOUNT_BASE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DISCOUNTTYPEID`, t1.`EXCHANGERATE`, t1.`IMPORTSEQUENCENUMBER`, t1.`ORGANIZATIONID`, t1.`OVERRIDDENCREATEDON`, t1.`PERCENTAGE`, t1.`PRICELEVELID`, t1.`PRICINGMETHODCODE`, t1.`PROCESSID`, t1.`PRODUCTID`, t1.`PRODUCTNUMBER`, t1.`PRODUCTPRICELEVELID`, t1.`QUANTITYSELLINGCODE`, t1.`ROUNDINGOPTIONAMOUNT`, t1.`ROUNDINGOPTIONAMOUNT_BASE`, t1.`ROUNDINGOPTIONCODE`, t1.`ROUNDINGPOLICYCODE`, t1.`STAGEID`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TRANSACTIONCURRENCYID`, t1.`TRAVERSEDPATH`, t1.`UOMID`, t1.`UOMSCHEDULEID`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER` FROM `PRODUCTPRICELEVEL` t1
]]>
</sql>
</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="cn.ibizlab.businesscentral.core.product.mapper.ProductSubstituteMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="ProductSubstituteResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DIRECTION`, t1.`EXCHANGERATE`, t1.`IMPORTSEQUENCENUMBER`, t1.`OVERRIDDENCREATEDON`, t1.`PRODUCTID`, t1.`PRODUCTSUBSTITUTEID`, t1.`PRODUCTSUBSTITUTENAME`, t1.`SALESRELATIONSHIPTYPE`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`SUBSTITUTEDPRODUCTID`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TRANSACTIONCURRENCYID`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER` FROM `PRODUCTSUBSTITUTE` t1 ) t1 where productsubstituteid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="ProductSubstituteResultMap" type="cn.ibizlab.businesscentral.core.product.domain.ProductSubstitute" autoMapping="true">
<id property="productsubstituteid" column="productsubstituteid" /><!--主键字段映射-->
<result property="productid" column="productid" />
<result property="substitutedproductid" column="substitutedproductid" />
<result property="transactioncurrencyid" column="transactioncurrencyid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="product" javaType="cn.ibizlab.businesscentral.core.product.domain.Product" column="productid" select="cn.ibizlab.businesscentral.core.product.mapper.ProductMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="substitutedproduct" javaType="cn.ibizlab.businesscentral.core.product.domain.Product" column="substitutedproductid" select="cn.ibizlab.businesscentral.core.product.mapper.ProductMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="transactioncurrency" javaType="cn.ibizlab.businesscentral.core.base.domain.TransactionCurrency" column="transactioncurrencyid" select="cn.ibizlab.businesscentral.core.base.mapper.TransactionCurrencyMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCTSUBSTITUTE__PRODUCT__PRODUCTID] -->
<select id="selectByProductid" resultMap="ProductSubstituteResultMap">
select t1.* from (
<include refid="Default" />
) t1
where productid=#{productid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCTSUBSTITUTE__PRODUCT__SUBSTITUTEDPRODUCTID] -->
<select id="selectBySubstitutedproductid" resultMap="ProductSubstituteResultMap">
select t1.* from (
<include refid="Default" />
) t1
where substitutedproductid=#{productid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCTSUBSTITUTE__TRANSACTIONCURRENCY__TRANSACTIONCURRENCYID] -->
<select id="selectByTransactioncurrencyid" resultMap="ProductSubstituteResultMap">
select t1.* from (
<include refid="Default" />
) t1
where transactioncurrencyid=#{transactioncurrencyid}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.product.filter.ProductSubstituteSearchContext" resultMap="ProductSubstituteResultMap">
select t1.* from (
<include refid="Default" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DIRECTION`, t1.`EXCHANGERATE`, t1.`IMPORTSEQUENCENUMBER`, t1.`OVERRIDDENCREATEDON`, t1.`PRODUCTID`, t1.`PRODUCTSUBSTITUTEID`, t1.`PRODUCTSUBSTITUTENAME`, t1.`SALESRELATIONSHIPTYPE`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`SUBSTITUTEDPRODUCTID`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TRANSACTIONCURRENCYID`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER` FROM `PRODUCTSUBSTITUTE` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DIRECTION`, t1.`EXCHANGERATE`, t1.`IMPORTSEQUENCENUMBER`, t1.`OVERRIDDENCREATEDON`, t1.`PRODUCTID`, t1.`PRODUCTSUBSTITUTEID`, t1.`PRODUCTSUBSTITUTENAME`, t1.`SALESRELATIONSHIPTYPE`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`SUBSTITUTEDPRODUCTID`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TRANSACTIONCURRENCYID`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER` FROM `PRODUCTSUBSTITUTE` t1
]]>
</sql>
</mapper>
......@@ -4,6 +4,14 @@
],
"entities":[
{
"dename":"OpportunityProduct",
"delogicname":"商机产品",
"sysmoudle":{"id":"SALES","name":"Sales"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"CampaignList",
"delogicname":"市场活动-营销列表",
"sysmoudle":{"id":"MARKETING","name":"Marketing"},
......
......@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /businesscentral-provider-centralapi.jar
EXPOSE 8081
EXPOSE 10310
ADD businesscentral-provider-centralapi.jar /businesscentral-provider-centralapi.jar
......@@ -3,9 +3,23 @@ services:
businesscentral-provider-centralapi:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/businesscentral-provider-centralapi:latest
ports:
- "8081:8081"
- "10310:10310"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=10310
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
- SPRING_REDIS_HOST=127.0.0.1
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_LAB01_e85d8801c
- SPRING_DATASOURCE_PASSWORD=b1@@@772
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_e85d8801c?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_e85d8801c
- CAS=https://passport.ibizlab.cn
- NACOS=172.16.240.110:8848
deploy:
resources:
limits:
......
package cn.ibizlab.businesscentral.centralapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.businesscentral.core.sales.domain.OpportunityProduct;
import cn.ibizlab.businesscentral.centralapi.dto.OpportunityProductDTO;
import cn.ibizlab.businesscentral.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface OpportunityProductMapping extends MappingBase<OpportunityProductDTO, OpportunityProduct> {
}
......@@ -37,11 +37,11 @@
git clone -b master $para2 ibizbusinesscentral/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibizbusinesscentral/
mvn clean package -Pbusinesscentral
cd businesscentral-app/businesscentral-app-businesscentral
mvn -Pbusinesscentral docker:build
mvn -Pbusinesscentral docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/businesscentral-app-businesscentral.yaml iBizEE --with-registry-auth
mvn clean package -Pcentralapi
cd businesscentral-provider/businesscentral-provider-centralapi
mvn -Pcentralapi docker:build
mvn -Pcentralapi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/businesscentral-provider-centralapi.yaml iBizEE --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册