提交 3497b091 编写于 作者: ibizdev's avatar ibizdev

xignzi006 发布系统代码

上级 dc32759b
......@@ -58,4 +58,27 @@ public class purchase_orderFallback implements purchase_orderFeignClient{
return null;
}
public Purchase_order getDraft(){
return null;
}
public Boolean checkKey(Purchase_order purchase_order){
return false;
}
public Boolean save(Purchase_order purchase_order){
return false;
}
public Boolean saveBatch(List<Purchase_order> purchase_orders){
return false;
}
public Page<Purchase_order> searchDefault(Purchase_orderSearchContext context){
return null;
}
}
......@@ -56,4 +56,24 @@ public interface purchase_orderFeignClient {
Page<Purchase_order> select();
@RequestMapping(method = RequestMethod.GET, value = "/purchase_orders/getdraft")
Purchase_order getDraft();
@RequestMapping(method = RequestMethod.POST, value = "/purchase_orders/checkkey")
Boolean checkKey(@RequestBody Purchase_order purchase_order);
@RequestMapping(method = RequestMethod.POST, value = "/purchase_orders/save")
Boolean save(@RequestBody Purchase_order purchase_order);
@RequestMapping(method = RequestMethod.POST, value = "/purchase_orders/savebatch")
Boolean saveBatch(@RequestBody List<Purchase_order> purchase_orders);
@RequestMapping(method = RequestMethod.POST, value = "/purchase_orders/searchdefault")
Page<Purchase_order> searchDefault(@RequestBody Purchase_orderSearchContext context);
}
......@@ -27,6 +27,272 @@ import cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_order;
@Data
public class Purchase_orderSearchContext extends QueryWrapperContext<Purchase_order> {
private String n_state_eq;//[状态]
public void setN_state_eq(String n_state_eq) {
this.n_state_eq = n_state_eq;
if(!ObjectUtils.isEmpty(this.n_state_eq)){
this.getSearchCond().eq("state", n_state_eq);
}
}
private String n_default_location_dest_id_usage_eq;//[目标位置类型]
public void setN_default_location_dest_id_usage_eq(String n_default_location_dest_id_usage_eq) {
this.n_default_location_dest_id_usage_eq = n_default_location_dest_id_usage_eq;
if(!ObjectUtils.isEmpty(this.n_default_location_dest_id_usage_eq)){
this.getSearchCond().eq("default_location_dest_id_usage", n_default_location_dest_id_usage_eq);
}
}
private String n_name_like;//[订单关联]
public void setN_name_like(String n_name_like) {
this.n_name_like = n_name_like;
if(!ObjectUtils.isEmpty(this.n_name_like)){
this.getSearchCond().like("name", n_name_like);
}
}
private String n_invoice_status_eq;//[账单状态]
public void setN_invoice_status_eq(String n_invoice_status_eq) {
this.n_invoice_status_eq = n_invoice_status_eq;
if(!ObjectUtils.isEmpty(this.n_invoice_status_eq)){
this.getSearchCond().eq("invoice_status", n_invoice_status_eq);
}
}
private String n_activity_state_eq;//[活动状态]
public void setN_activity_state_eq(String n_activity_state_eq) {
this.n_activity_state_eq = n_activity_state_eq;
if(!ObjectUtils.isEmpty(this.n_activity_state_eq)){
this.getSearchCond().eq("activity_state", n_activity_state_eq);
}
}
private String n_user_id_text_eq;//[采购员]
public void setN_user_id_text_eq(String n_user_id_text_eq) {
this.n_user_id_text_eq = n_user_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_user_id_text_eq)){
this.getSearchCond().eq("user_id_text", n_user_id_text_eq);
}
}
private String n_user_id_text_like;//[采购员]
public void setN_user_id_text_like(String n_user_id_text_like) {
this.n_user_id_text_like = n_user_id_text_like;
if(!ObjectUtils.isEmpty(this.n_user_id_text_like)){
this.getSearchCond().like("user_id_text", n_user_id_text_like);
}
}
private String n_fiscal_position_id_text_eq;//[税科目调整]
public void setN_fiscal_position_id_text_eq(String n_fiscal_position_id_text_eq) {
this.n_fiscal_position_id_text_eq = n_fiscal_position_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_fiscal_position_id_text_eq)){
this.getSearchCond().eq("fiscal_position_id_text", n_fiscal_position_id_text_eq);
}
}
private String n_fiscal_position_id_text_like;//[税科目调整]
public void setN_fiscal_position_id_text_like(String n_fiscal_position_id_text_like) {
this.n_fiscal_position_id_text_like = n_fiscal_position_id_text_like;
if(!ObjectUtils.isEmpty(this.n_fiscal_position_id_text_like)){
this.getSearchCond().like("fiscal_position_id_text", n_fiscal_position_id_text_like);
}
}
private String n_currency_id_text_eq;//[币种]
public void setN_currency_id_text_eq(String n_currency_id_text_eq) {
this.n_currency_id_text_eq = n_currency_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_currency_id_text_eq)){
this.getSearchCond().eq("currency_id_text", n_currency_id_text_eq);
}
}
private String n_currency_id_text_like;//[币种]
public void setN_currency_id_text_like(String n_currency_id_text_like) {
this.n_currency_id_text_like = n_currency_id_text_like;
if(!ObjectUtils.isEmpty(this.n_currency_id_text_like)){
this.getSearchCond().like("currency_id_text", n_currency_id_text_like);
}
}
private String n_company_id_text_eq;//[公司]
public void setN_company_id_text_eq(String n_company_id_text_eq) {
this.n_company_id_text_eq = n_company_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_company_id_text_eq)){
this.getSearchCond().eq("company_id_text", n_company_id_text_eq);
}
}
private String n_company_id_text_like;//[公司]
public void setN_company_id_text_like(String n_company_id_text_like) {
this.n_company_id_text_like = n_company_id_text_like;
if(!ObjectUtils.isEmpty(this.n_company_id_text_like)){
this.getSearchCond().like("company_id_text", n_company_id_text_like);
}
}
private String n_dest_address_id_text_eq;//[代发货地址]
public void setN_dest_address_id_text_eq(String n_dest_address_id_text_eq) {
this.n_dest_address_id_text_eq = n_dest_address_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_dest_address_id_text_eq)){
this.getSearchCond().eq("dest_address_id_text", n_dest_address_id_text_eq);
}
}
private String n_dest_address_id_text_like;//[代发货地址]
public void setN_dest_address_id_text_like(String n_dest_address_id_text_like) {
this.n_dest_address_id_text_like = n_dest_address_id_text_like;
if(!ObjectUtils.isEmpty(this.n_dest_address_id_text_like)){
this.getSearchCond().like("dest_address_id_text", n_dest_address_id_text_like);
}
}
private String n_write_uid_text_eq;//[最后更新人]
public void setN_write_uid_text_eq(String n_write_uid_text_eq) {
this.n_write_uid_text_eq = n_write_uid_text_eq;
if(!ObjectUtils.isEmpty(this.n_write_uid_text_eq)){
this.getSearchCond().eq("write_uid_text", n_write_uid_text_eq);
}
}
private String n_write_uid_text_like;//[最后更新人]
public void setN_write_uid_text_like(String n_write_uid_text_like) {
this.n_write_uid_text_like = n_write_uid_text_like;
if(!ObjectUtils.isEmpty(this.n_write_uid_text_like)){
this.getSearchCond().like("write_uid_text", n_write_uid_text_like);
}
}
private String n_payment_term_id_text_eq;//[付款条款]
public void setN_payment_term_id_text_eq(String n_payment_term_id_text_eq) {
this.n_payment_term_id_text_eq = n_payment_term_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_payment_term_id_text_eq)){
this.getSearchCond().eq("payment_term_id_text", n_payment_term_id_text_eq);
}
}
private String n_payment_term_id_text_like;//[付款条款]
public void setN_payment_term_id_text_like(String n_payment_term_id_text_like) {
this.n_payment_term_id_text_like = n_payment_term_id_text_like;
if(!ObjectUtils.isEmpty(this.n_payment_term_id_text_like)){
this.getSearchCond().like("payment_term_id_text", n_payment_term_id_text_like);
}
}
private String n_create_uid_text_eq;//[创建人]
public void setN_create_uid_text_eq(String n_create_uid_text_eq) {
this.n_create_uid_text_eq = n_create_uid_text_eq;
if(!ObjectUtils.isEmpty(this.n_create_uid_text_eq)){
this.getSearchCond().eq("create_uid_text", n_create_uid_text_eq);
}
}
private String n_create_uid_text_like;//[创建人]
public void setN_create_uid_text_like(String n_create_uid_text_like) {
this.n_create_uid_text_like = n_create_uid_text_like;
if(!ObjectUtils.isEmpty(this.n_create_uid_text_like)){
this.getSearchCond().like("create_uid_text", n_create_uid_text_like);
}
}
private String n_partner_id_text_eq;//[供应商]
public void setN_partner_id_text_eq(String n_partner_id_text_eq) {
this.n_partner_id_text_eq = n_partner_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_partner_id_text_eq)){
this.getSearchCond().eq("partner_id_text", n_partner_id_text_eq);
}
}
private String n_partner_id_text_like;//[供应商]
public void setN_partner_id_text_like(String n_partner_id_text_like) {
this.n_partner_id_text_like = n_partner_id_text_like;
if(!ObjectUtils.isEmpty(this.n_partner_id_text_like)){
this.getSearchCond().like("partner_id_text", n_partner_id_text_like);
}
}
private String n_picking_type_id_text_eq;//[交货到]
public void setN_picking_type_id_text_eq(String n_picking_type_id_text_eq) {
this.n_picking_type_id_text_eq = n_picking_type_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_picking_type_id_text_eq)){
this.getSearchCond().eq("picking_type_id_text", n_picking_type_id_text_eq);
}
}
private String n_picking_type_id_text_like;//[交货到]
public void setN_picking_type_id_text_like(String n_picking_type_id_text_like) {
this.n_picking_type_id_text_like = n_picking_type_id_text_like;
if(!ObjectUtils.isEmpty(this.n_picking_type_id_text_like)){
this.getSearchCond().like("picking_type_id_text", n_picking_type_id_text_like);
}
}
private String n_incoterm_id_text_eq;//[国际贸易术语]
public void setN_incoterm_id_text_eq(String n_incoterm_id_text_eq) {
this.n_incoterm_id_text_eq = n_incoterm_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_incoterm_id_text_eq)){
this.getSearchCond().eq("incoterm_id_text", n_incoterm_id_text_eq);
}
}
private String n_incoterm_id_text_like;//[国际贸易术语]
public void setN_incoterm_id_text_like(String n_incoterm_id_text_like) {
this.n_incoterm_id_text_like = n_incoterm_id_text_like;
if(!ObjectUtils.isEmpty(this.n_incoterm_id_text_like)){
this.getSearchCond().like("incoterm_id_text", n_incoterm_id_text_like);
}
}
private Long n_create_uid_eq;//[创建人]
public void setN_create_uid_eq(Long n_create_uid_eq) {
this.n_create_uid_eq = n_create_uid_eq;
if(!ObjectUtils.isEmpty(this.n_create_uid_eq)){
this.getSearchCond().eq("create_uid", n_create_uid_eq);
}
}
private Long n_partner_id_eq;//[供应商]
public void setN_partner_id_eq(Long n_partner_id_eq) {
this.n_partner_id_eq = n_partner_id_eq;
if(!ObjectUtils.isEmpty(this.n_partner_id_eq)){
this.getSearchCond().eq("partner_id", n_partner_id_eq);
}
}
private Long n_dest_address_id_eq;//[代发货地址]
public void setN_dest_address_id_eq(Long n_dest_address_id_eq) {
this.n_dest_address_id_eq = n_dest_address_id_eq;
if(!ObjectUtils.isEmpty(this.n_dest_address_id_eq)){
this.getSearchCond().eq("dest_address_id", n_dest_address_id_eq);
}
}
private Long n_company_id_eq;//[公司]
public void setN_company_id_eq(Long n_company_id_eq) {
this.n_company_id_eq = n_company_id_eq;
if(!ObjectUtils.isEmpty(this.n_company_id_eq)){
this.getSearchCond().eq("company_id", n_company_id_eq);
}
}
private Long n_currency_id_eq;//[币种]
public void setN_currency_id_eq(Long n_currency_id_eq) {
this.n_currency_id_eq = n_currency_id_eq;
if(!ObjectUtils.isEmpty(this.n_currency_id_eq)){
this.getSearchCond().eq("currency_id", n_currency_id_eq);
}
}
private Long n_payment_term_id_eq;//[付款条款]
public void setN_payment_term_id_eq(Long n_payment_term_id_eq) {
this.n_payment_term_id_eq = n_payment_term_id_eq;
if(!ObjectUtils.isEmpty(this.n_payment_term_id_eq)){
this.getSearchCond().eq("payment_term_id", n_payment_term_id_eq);
}
}
private Long n_user_id_eq;//[采购员]
public void setN_user_id_eq(Long n_user_id_eq) {
this.n_user_id_eq = n_user_id_eq;
if(!ObjectUtils.isEmpty(this.n_user_id_eq)){
this.getSearchCond().eq("user_id", n_user_id_eq);
}
}
private Long n_write_uid_eq;//[最后更新人]
public void setN_write_uid_eq(Long n_write_uid_eq) {
this.n_write_uid_eq = n_write_uid_eq;
if(!ObjectUtils.isEmpty(this.n_write_uid_eq)){
this.getSearchCond().eq("write_uid", n_write_uid_eq);
}
}
private Long n_incoterm_id_eq;//[国际贸易术语]
public void setN_incoterm_id_eq(Long n_incoterm_id_eq) {
this.n_incoterm_id_eq = n_incoterm_id_eq;
if(!ObjectUtils.isEmpty(this.n_incoterm_id_eq)){
this.getSearchCond().eq("incoterm_id", n_incoterm_id_eq);
}
}
private Long n_fiscal_position_id_eq;//[税科目调整]
public void setN_fiscal_position_id_eq(Long n_fiscal_position_id_eq) {
this.n_fiscal_position_id_eq = n_fiscal_position_id_eq;
if(!ObjectUtils.isEmpty(this.n_fiscal_position_id_eq)){
this.getSearchCond().eq("fiscal_position_id", n_fiscal_position_id_eq);
}
}
private Long n_picking_type_id_eq;//[交货到]
public void setN_picking_type_id_eq(Long n_picking_type_id_eq) {
this.n_picking_type_id_eq = n_picking_type_id_eq;
if(!ObjectUtils.isEmpty(this.n_picking_type_id_eq)){
this.getSearchCond().eq("picking_type_id", n_picking_type_id_eq);
}
}
/**
* 启用快速搜索
......
......@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
public interface Purchase_orderMapper extends BaseMapper<Purchase_order>{
Page<Purchase_order> searchDefault(IPage page, @Param("srf") Purchase_orderSearchContext context, @Param("ew") Wrapper<Purchase_order> wrapper) ;
@Override
Purchase_order selectById(Serializable id);
@Override
......@@ -61,4 +62,26 @@ public interface Purchase_orderMapper extends BaseMapper<Purchase_order>{
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<Purchase_order> selectByFiscalPositionId(@Param("id") Serializable id) ;
List<Purchase_order> selectByIncotermId(@Param("id") Serializable id) ;
List<Purchase_order> selectByPaymentTermId(@Param("id") Serializable id) ;
List<Purchase_order> selectByCompanyId(@Param("id") Serializable id) ;
List<Purchase_order> selectByCurrencyId(@Param("id") Serializable id) ;
List<Purchase_order> selectByDestAddressId(@Param("id") Serializable id) ;
List<Purchase_order> selectByPartnerId(@Param("id") Serializable id) ;
List<Purchase_order> selectByCreateUid(@Param("id") Serializable id) ;
List<Purchase_order> selectByUserId(@Param("id") Serializable id) ;
List<Purchase_order> selectByWriteUid(@Param("id") Serializable id) ;
List<Purchase_order> selectByPickingTypeId(@Param("id") Serializable id) ;
}
......@@ -33,6 +33,33 @@ public interface IPurchase_orderService extends IService<Purchase_order>{
boolean remove(Long key) ;
void removeBatch(Collection<Long> idList) ;
Purchase_order get(Long key) ;
Purchase_order getDraft(Purchase_order et) ;
boolean checkKey(Purchase_order et) ;
boolean save(Purchase_order et) ;
void saveBatch(List<Purchase_order> list) ;
Page<Purchase_order> searchDefault(Purchase_orderSearchContext context) ;
List<Purchase_order> selectByFiscalPositionId(Long id) ;
void removeByFiscalPositionId(Long id) ;
List<Purchase_order> selectByIncotermId(Long id) ;
void removeByIncotermId(Long id) ;
List<Purchase_order> selectByPaymentTermId(Long id) ;
void removeByPaymentTermId(Long id) ;
List<Purchase_order> selectByCompanyId(Long id) ;
void removeByCompanyId(Long id) ;
List<Purchase_order> selectByCurrencyId(Long id) ;
void removeByCurrencyId(Long id) ;
List<Purchase_order> selectByDestAddressId(Long id) ;
void removeByDestAddressId(Long id) ;
List<Purchase_order> selectByPartnerId(Long id) ;
void removeByPartnerId(Long id) ;
List<Purchase_order> selectByCreateUid(Long id) ;
void removeByCreateUid(Long id) ;
List<Purchase_order> selectByUserId(Long id) ;
void removeByUserId(Long id) ;
List<Purchase_order> selectByWriteUid(Long id) ;
void removeByWriteUid(Long id) ;
List<Purchase_order> selectByPickingTypeId(Long id) ;
void removeByPickingTypeId(Long id) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
......
......@@ -144,7 +144,169 @@ public class Purchase_orderServiceImpl extends ServiceImpl<Purchase_orderMapper,
return et;
}
@Override
public Purchase_order getDraft(Purchase_order et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(Purchase_order et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(Purchase_order et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(Purchase_order et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<Purchase_order> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<Purchase_order> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Purchase_order> selectByFiscalPositionId(Long id) {
return baseMapper.selectByFiscalPositionId(id);
}
@Override
public void removeByFiscalPositionId(Long id) {
this.remove(new QueryWrapper<Purchase_order>().eq("fiscal_position_id",id));
}
@Override
public List<Purchase_order> selectByIncotermId(Long id) {
return baseMapper.selectByIncotermId(id);
}
@Override
public void removeByIncotermId(Long id) {
this.remove(new QueryWrapper<Purchase_order>().eq("incoterm_id",id));
}
@Override
public List<Purchase_order> selectByPaymentTermId(Long id) {
return baseMapper.selectByPaymentTermId(id);
}
@Override
public void removeByPaymentTermId(Long id) {
this.remove(new QueryWrapper<Purchase_order>().eq("payment_term_id",id));
}
@Override
public List<Purchase_order> selectByCompanyId(Long id) {
return baseMapper.selectByCompanyId(id);
}
@Override
public void removeByCompanyId(Long id) {
this.remove(new QueryWrapper<Purchase_order>().eq("company_id",id));
}
@Override
public List<Purchase_order> selectByCurrencyId(Long id) {
return baseMapper.selectByCurrencyId(id);
}
@Override
public void removeByCurrencyId(Long id) {
this.remove(new QueryWrapper<Purchase_order>().eq("currency_id",id));
}
@Override
public List<Purchase_order> selectByDestAddressId(Long id) {
return baseMapper.selectByDestAddressId(id);
}
@Override
public void removeByDestAddressId(Long id) {
this.remove(new QueryWrapper<Purchase_order>().eq("dest_address_id",id));
}
@Override
public List<Purchase_order> selectByPartnerId(Long id) {
return baseMapper.selectByPartnerId(id);
}
@Override
public void removeByPartnerId(Long id) {
this.remove(new QueryWrapper<Purchase_order>().eq("partner_id",id));
}
@Override
public List<Purchase_order> selectByCreateUid(Long id) {
return baseMapper.selectByCreateUid(id);
}
@Override
public void removeByCreateUid(Long id) {
this.remove(new QueryWrapper<Purchase_order>().eq("create_uid",id));
}
@Override
public List<Purchase_order> selectByUserId(Long id) {
return baseMapper.selectByUserId(id);
}
@Override
public void removeByUserId(Long id) {
this.remove(new QueryWrapper<Purchase_order>().eq("user_id",id));
}
@Override
public List<Purchase_order> selectByWriteUid(Long id) {
return baseMapper.selectByWriteUid(id);
}
@Override
public void removeByWriteUid(Long id) {
this.remove(new QueryWrapper<Purchase_order>().eq("write_uid",id));
}
@Override
public List<Purchase_order> selectByPickingTypeId(Long id) {
return baseMapper.selectByPickingTypeId(id);
}
@Override
public void removeByPickingTypeId(Long id) {
this.remove(new QueryWrapper<Purchase_order>().eq("picking_type_id",id));
}
/**
* 查询集合 数据集
*/
@Override
public Page<Purchase_order> searchDefault(Purchase_orderSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Purchase_order> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Purchase_order>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
......
......@@ -943,53 +943,6 @@
<!--输出实体[RES_USERS]数据结构 -->
<changeSet author="odoo" id="tab-res_users-500-314">
<createTable tableName="RES_USERS">
<column name="CREATE_DATE" remarks="创建日期" type="DATETIME">
</column>
<column name="WRITE_DATE" remarks="最后更新时间" type="DATETIME">
</column>
<column name="ID" remarks="ID" type="BIGINT">
<constraints primaryKey="true" primaryKeyName="PK_RES_USERS_ID"/>
</column>
<column name="TARGET_SALES_DONE" remarks="活动达成" type="INT">
</column>
<column name="NOTIFICATION_TYPE" remarks="通知管理" type="VARCHAR(200)">
</column>
<column name="ACTIVE" remarks="有效" type="BIT">
</column>
<column name="KARMA" remarks="贡献值" type="INT">
</column>
<column name="WEBSITE_ID" remarks="登记网站" type="INT">
</column>
<column name="TARGET_SALES_INVOICED" remarks="销售订单目标发票" type="INT">
</column>
<column name="SHARE" remarks="共享用户" type="BIT">
</column>
<column name="ODOOBOT_STATE" remarks="OdooBot 状态" type="VARCHAR(200)">
</column>
<column name="TARGET_SALES_WON" remarks="签单是商机的最终目标" type="INT">
</column>
<column name="ACTION_ID" remarks="主页动作" type="INT">
</column>
<column name="LOGIN" remarks="登录" type="VARCHAR(100)">
</column>
<column name="SIGNATURE" remarks="签名" type="TEXT(1048576)">
</column>
<column name="COMPANY_ID" remarks="公司" type="BIGINT">
</column>
<column name="PARTNER_ID" remarks="相关的业务伙伴" type="BIGINT">
</column>
<column name="ALIAS_ID" remarks="别名" type="BIGINT">
</column>
<column name="SALE_TEAM_ID" remarks="用户的销售团队" type="BIGINT">
</column>
<column name="WRITE_UID" remarks="最后更新者" type="BIGINT">
</column>
<column name="CREATE_UID" remarks="创建人" type="BIGINT">
</column>
</createTable>
</changeSet>
<!--输出实体[RES_USERS_LOG]数据结构 -->
......@@ -1545,24 +1498,6 @@
<!--输出实体[RES_PARTNER_INDUSTRY]外键关系 -->
<!--输出实体[RES_PARTNER_TITLE]外键关系 -->
<!--输出实体[RES_USERS]外键关系 -->
<changeSet author="odoo" id="fk-res_users-500-1,799">
<addForeignKeyConstraint baseColumnNames="SALE_TEAM_ID" baseTableName="RES_USERS" constraintName="DER1N_RES_USERS__CRM_TEAM__SAL" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID" referencedTableName="CRM_TEAM" validate="true"/>
</changeSet>
<changeSet author="odoo" id="fk-res_users-500-1,800">
<addForeignKeyConstraint baseColumnNames="ALIAS_ID" baseTableName="RES_USERS" constraintName="DER1N_RES_USERS__MAIL_ALIAS__A" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID" referencedTableName="MAIL_ALIAS" validate="true"/>
</changeSet>
<changeSet author="odoo" id="fk-res_users-500-1,801">
<addForeignKeyConstraint baseColumnNames="COMPANY_ID" baseTableName="RES_USERS" constraintName="DER1N_RES_USERS__RES_COMPANY__" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID" referencedTableName="RES_COMPANY" validate="true"/>
</changeSet>
<changeSet author="odoo" id="fk-res_users-500-1,802">
<addForeignKeyConstraint baseColumnNames="PARTNER_ID" baseTableName="RES_USERS" constraintName="DER1N_RES_USERS__RES_PARTNER__" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID" referencedTableName="RES_PARTNER" validate="true"/>
</changeSet>
<changeSet author="odoo" id="fk-res_users-500-1,803">
<addForeignKeyConstraint baseColumnNames="CREATE_UID" baseTableName="RES_USERS" constraintName="DER1N_RES_USERS__RES_USERS__CR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID" referencedTableName="RES_USERS" validate="true"/>
</changeSet>
<changeSet author="odoo" id="fk-res_users-500-1,804">
<addForeignKeyConstraint baseColumnNames="WRITE_UID" baseTableName="RES_USERS" constraintName="DER1N_RES_USERS__RES_USERS__WR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID" referencedTableName="RES_USERS" validate="true"/>
</changeSet>
<!--输出实体[RES_USERS_LOG]外键关系 -->
<!--输出实体[RESOURCE_CALENDAR]外键关系 -->
<!--输出实体[RESOURCE_CALENDAR_ATTENDANCE]外键关系 -->
......
......@@ -4,6 +4,9 @@
<mapper namespace="cn.ibizlab.businesscentral.core.odoo_purchase.mapper.Purchase_orderMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Purchase_orderResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.ACCESS_TOKEN, t1.AMOUNT_TAX, t1.AMOUNT_TOTAL, t1.AMOUNT_UNTAXED, t1.COMPANY_ID, t61.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t121.NAME AS CREATE_UID_TEXT, t1.CURRENCY_ID, t41.NAME AS CURRENCY_ID_TEXT, t1.DATE_APPROVE, t1.DATE_ORDER, t1.DATE_PLANNED, t1.DEST_ADDRESS_ID, t71.NAME AS DEST_ADDRESS_ID_TEXT, t1.FISCAL_POSITION_ID, t31.NAME AS FISCAL_POSITION_ID_TEXT, t1.GROUP_ID, t1.ID, t1.INCOTERM_ID, t151.NAME AS INCOTERM_ID_TEXT, t1.INVOICE_COUNT, t1.INVOICE_STATUS, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.NAME, t1.NOTES, t1.ORIGIN, t1.PARTNER_ID, t131.NAME AS PARTNER_ID_TEXT, t1.PARTNER_REF, t1.PAYMENT_TERM_ID, t101.NAME AS PAYMENT_TERM_ID_TEXT, t1.PICKING_COUNT, t1.PICKING_TYPE_ID, t141.NAME AS PICKING_TYPE_ID_TEXT, t1.STATE, t1.USER_ID, t21.NAME AS USER_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t91.NAME AS WRITE_UID_TEXT FROM PURCHASE_ORDER t1 LEFT JOIN RES_USERS t11 ON t1.USER_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN ACCOUNT_FISCAL_POSITION t31 ON t1.FISCAL_POSITION_ID = t31.ID LEFT JOIN RES_CURRENCY t41 ON t1.CURRENCY_ID = t41.ID LEFT JOIN RES_COMPANY t51 ON t1.COMPANY_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN RES_PARTNER t71 ON t1.DEST_ADDRESS_ID = t71.ID LEFT JOIN RES_USERS t81 ON t1.WRITE_UID = t81.ID LEFT JOIN RES_PARTNER t91 ON t81.PARTNER_ID = t91.ID LEFT JOIN ACCOUNT_PAYMENT_TERM t101 ON t1.PAYMENT_TERM_ID = t101.ID LEFT JOIN RES_USERS t111 ON t1.CREATE_UID = t111.ID LEFT JOIN RES_PARTNER t121 ON t111.PARTNER_ID = t121.ID LEFT JOIN RES_PARTNER t131 ON t1.PARTNER_ID = t131.ID LEFT JOIN STOCK_PICKING_TYPE t141 ON t1.PICKING_TYPE_ID = t141.ID LEFT JOIN ACCOUNT_INCOTERMS t151 ON t1.INCOTERM_ID = t151.ID ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="Purchase_orderResultMap" type="cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_order" autoMapping="true">
......@@ -101,16 +104,101 @@
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_ORDER__ACCOUNT_FISCAL_POSITION__FISCAL_POSITION_ID] -->
<select id="selectByFiscalPositionId" resultMap="Purchase_orderResultMap">
select t1.* from (
<include refid="Default" />
) t1
where fiscal_position_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_ORDER__ACCOUNT_INCOTERMS__INCOTERM_ID] -->
<select id="selectByIncotermId" resultMap="Purchase_orderResultMap">
select t1.* from (
<include refid="Default" />
) t1
where incoterm_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_ORDER__ACCOUNT_PAYMENT_TERM__PAYMENT_TERM_ID] -->
<select id="selectByPaymentTermId" resultMap="Purchase_orderResultMap">
select t1.* from (
<include refid="Default" />
) t1
where payment_term_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_ORDER__RES_COMPANY__COMPANY_ID] -->
<select id="selectByCompanyId" resultMap="Purchase_orderResultMap">
select t1.* from (
<include refid="Default" />
) t1
where company_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_ORDER__RES_CURRENCY__CURRENCY_ID] -->
<select id="selectByCurrencyId" resultMap="Purchase_orderResultMap">
select t1.* from (
<include refid="Default" />
) t1
where currency_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_ORDER__RES_PARTNER__DEST_ADDRESS_ID] -->
<select id="selectByDestAddressId" resultMap="Purchase_orderResultMap">
select t1.* from (
<include refid="Default" />
) t1
where dest_address_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_ORDER__RES_PARTNER__PARTNER_ID] -->
<select id="selectByPartnerId" resultMap="Purchase_orderResultMap">
select t1.* from (
<include refid="Default" />
) t1
where partner_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_ORDER__RES_USERS__CREATE_UID] -->
<select id="selectByCreateUid" resultMap="Purchase_orderResultMap">
select t1.* from (
<include refid="Default" />
) t1
where create_uid=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_ORDER__RES_USERS__USER_ID] -->
<select id="selectByUserId" resultMap="Purchase_orderResultMap">
select t1.* from (
<include refid="Default" />
) t1
where user_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_ORDER__RES_USERS__WRITE_UID] -->
<select id="selectByWriteUid" resultMap="Purchase_orderResultMap">
select t1.* from (
<include refid="Default" />
) t1
where write_uid=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PURCHASE_ORDER__STOCK_PICKING_TYPE__PICKING_TYPE_ID] -->
<select id="selectByPickingTypeId" resultMap="Purchase_orderResultMap">
select t1.* from (
<include refid="Default" />
) t1
where picking_type_id=#{id}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_orderSearchContext" resultMap="Purchase_orderResultMap">
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="postgresql">
<![CDATA[ SELECT t1.ACCESS_TOKEN, t1.AMOUNT_TAX, t1.AMOUNT_TOTAL, t1.AMOUNT_UNTAXED, t1.COMPANY_ID, t61.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t121.NAME AS CREATE_UID_TEXT, t1.CURRENCY_ID, t41.NAME AS CURRENCY_ID_TEXT, t1.DATE_APPROVE, t1.DATE_ORDER, t1.DATE_PLANNED, t1.DEST_ADDRESS_ID, t71.NAME AS DEST_ADDRESS_ID_TEXT, t1.FISCAL_POSITION_ID, t31.NAME AS FISCAL_POSITION_ID_TEXT, t1.GROUP_ID, t1.ID, t1.INCOTERM_ID, t151.NAME AS INCOTERM_ID_TEXT, t1.INVOICE_COUNT, t1.INVOICE_STATUS, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.NAME, t1.ORIGIN, t1.PARTNER_ID, t131.NAME AS PARTNER_ID_TEXT, t1.PARTNER_REF, t1.PAYMENT_TERM_ID, t101.NAME AS PAYMENT_TERM_ID_TEXT, t1.PICKING_COUNT, t1.PICKING_TYPE_ID, t141.NAME AS PICKING_TYPE_ID_TEXT, t1.STATE, t1.USER_ID, t21.NAME AS USER_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t91.NAME AS WRITE_UID_TEXT FROM PURCHASE_ORDER t1 LEFT JOIN RES_USERS t11 ON t1.USER_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN ACCOUNT_FISCAL_POSITION t31 ON t1.FISCAL_POSITION_ID = t31.ID LEFT JOIN RES_CURRENCY t41 ON t1.CURRENCY_ID = t41.ID LEFT JOIN RES_COMPANY t51 ON t1.COMPANY_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN RES_PARTNER t71 ON t1.DEST_ADDRESS_ID = t71.ID LEFT JOIN RES_USERS t81 ON t1.WRITE_UID = t81.ID LEFT JOIN RES_PARTNER t91 ON t81.PARTNER_ID = t91.ID LEFT JOIN ACCOUNT_PAYMENT_TERM t101 ON t1.PAYMENT_TERM_ID = t101.ID LEFT JOIN RES_USERS t111 ON t1.CREATE_UID = t111.ID LEFT JOIN RES_PARTNER t121 ON t111.PARTNER_ID = t121.ID LEFT JOIN RES_PARTNER t131 ON t1.PARTNER_ID = t131.ID LEFT JOIN STOCK_PICKING_TYPE t141 ON t1.PICKING_TYPE_ID = t141.ID LEFT JOIN ACCOUNT_INCOTERMS t151 ON t1.INCOTERM_ID = t151.ID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.ACCESS_TOKEN, t1.AMOUNT_TAX, t1.AMOUNT_TOTAL, t1.AMOUNT_UNTAXED, t1.COMPANY_ID, t61.NAME AS COMPANY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t121.NAME AS CREATE_UID_TEXT, t1.CURRENCY_ID, t41.NAME AS CURRENCY_ID_TEXT, t1.DATE_APPROVE, t1.DATE_ORDER, t1.DATE_PLANNED, t1.DEST_ADDRESS_ID, t71.NAME AS DEST_ADDRESS_ID_TEXT, t1.FISCAL_POSITION_ID, t31.NAME AS FISCAL_POSITION_ID_TEXT, t1.GROUP_ID, t1.ID, t1.INCOTERM_ID, t151.NAME AS INCOTERM_ID_TEXT, t1.INVOICE_COUNT, t1.INVOICE_STATUS, t1.MESSAGE_MAIN_ATTACHMENT_ID, t1.NAME, t1.NOTES, t1.ORIGIN, t1.PARTNER_ID, t131.NAME AS PARTNER_ID_TEXT, t1.PARTNER_REF, t1.PAYMENT_TERM_ID, t101.NAME AS PAYMENT_TERM_ID_TEXT, t1.PICKING_COUNT, t1.PICKING_TYPE_ID, t141.NAME AS PICKING_TYPE_ID_TEXT, t1.STATE, t1.USER_ID, t21.NAME AS USER_ID_TEXT, t1.WRITE_DATE, t1.WRITE_UID, t91.NAME AS WRITE_UID_TEXT FROM PURCHASE_ORDER t1 LEFT JOIN RES_USERS t11 ON t1.USER_ID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN ACCOUNT_FISCAL_POSITION t31 ON t1.FISCAL_POSITION_ID = t31.ID LEFT JOIN RES_CURRENCY t41 ON t1.CURRENCY_ID = t41.ID LEFT JOIN RES_COMPANY t51 ON t1.COMPANY_ID = t51.ID LEFT JOIN RES_PARTNER t61 ON t51.PARTNER_ID = t61.ID LEFT JOIN RES_PARTNER t71 ON t1.DEST_ADDRESS_ID = t71.ID LEFT JOIN RES_USERS t81 ON t1.WRITE_UID = t81.ID LEFT JOIN RES_PARTNER t91 ON t81.PARTNER_ID = t91.ID LEFT JOIN ACCOUNT_PAYMENT_TERM t101 ON t1.PAYMENT_TERM_ID = t101.ID LEFT JOIN RES_USERS t111 ON t1.CREATE_UID = t111.ID LEFT JOIN RES_PARTNER t121 ON t111.PARTNER_ID = t121.ID LEFT JOIN RES_PARTNER t131 ON t1.PARTNER_ID = t131.ID LEFT JOIN STOCK_PICKING_TYPE t141 ON t1.PICKING_TYPE_ID = t141.ID LEFT JOIN ACCOUNT_INCOTERMS t151 ON t1.INCOTERM_ID = t151.ID
]]>
</sql>
</mapper>
......@@ -21,6 +21,9 @@
</dependency>
</dependencies>
<properties>
<docker.image.prefix>registry.cn-shanghai.aliyuncs.com/ibizsys</docker.image.prefix>
</properties>
<profiles>
<profile>
......@@ -54,6 +57,23 @@
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<configuration>
<serverId>ibiz-dev</serverId>
<imageName>${docker.image.prefix}/${project.artifactId}:latest</imageName>
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>../../</directory>
<include>${project.artifactId}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
</profile>
......
......@@ -109,6 +109,55 @@ public class Purchase_orderResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取采购订单草稿", tags = {"采购订单" }, notes = "获取采购订单草稿")
@RequestMapping(method = RequestMethod.GET, value = "/purchase_orders/getdraft")
public ResponseEntity<Purchase_orderDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderMapping.toDto(purchase_orderService.getDraft(new Purchase_order())));
}
@ApiOperation(value = "检查采购订单", tags = {"采购订单" }, notes = "检查采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_orders/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody Purchase_orderDTO purchase_orderdto) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderService.checkKey(purchase_orderMapping.toDomain(purchase_orderdto)));
}
@PreAuthorize("hasPermission(this.purchase_orderMapping.toDomain(#purchase_orderdto),'iBizBusinessCentral-Purchase_order-Save')")
@ApiOperation(value = "保存采购订单", tags = {"采购订单" }, notes = "保存采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_orders/save")
public ResponseEntity<Boolean> save(@RequestBody Purchase_orderDTO purchase_orderdto) {
return ResponseEntity.status(HttpStatus.OK).body(purchase_orderService.save(purchase_orderMapping.toDomain(purchase_orderdto)));
}
@PreAuthorize("hasPermission(this.purchase_orderMapping.toDomain(#purchase_orderdtos),'iBizBusinessCentral-Purchase_order-Save')")
@ApiOperation(value = "批量保存采购订单", tags = {"采购订单" }, notes = "批量保存采购订单")
@RequestMapping(method = RequestMethod.POST, value = "/purchase_orders/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<Purchase_orderDTO> purchase_orderdtos) {
purchase_orderService.saveBatch(purchase_orderMapping.toDomain(purchase_orderdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order-Get')")
@ApiOperation(value = "获取数据集", tags = {"采购订单" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/purchase_orders/fetchdefault")
public ResponseEntity<List<Purchase_orderDTO>> fetchDefault(Purchase_orderSearchContext context) {
Page<Purchase_order> domains = purchase_orderService.searchDefault(context) ;
List<Purchase_orderDTO> list = purchase_orderMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order-Get')")
@ApiOperation(value = "查询数据集", tags = {"采购订单" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/purchase_orders/searchdefault")
public ResponseEntity<Page<Purchase_orderDTO>> searchDefault(@RequestBody Purchase_orderSearchContext context) {
Page<Purchase_order> domains = purchase_orderService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(purchase_orderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -54,6 +54,7 @@ public class AuditAspect
return;
Object serviceParam =args[0];
if(serviceParam instanceof EntityBase){
EntityBase entity=(EntityBase)serviceParam;//创建数据
Map<String, Audit> auditFields= DEFieldCacheMap.getAuditFields(entity.getClass());
if(auditFields.size()==0)//是否有审计属性
......@@ -66,7 +67,7 @@ public class AuditAspect
}
//记录审计日志
dataAuditService.createAudit(request,entity,idValue,auditFields);
return;
}
}
/**
......@@ -88,6 +89,7 @@ public class AuditAspect
return point.proceed();
Object arg=args[0];
if(arg instanceof EntityBase){
EntityBase entity= (EntityBase) arg;
Map<String, Audit> auditFields= DEFieldCacheMap.getAuditFields(entity.getClass());
......@@ -110,6 +112,8 @@ public class AuditAspect
dataAuditService.updateAudit(request,beforeEntity,serviceObj,idValue,auditFields);
return true;
}
return point.proceed();
}
/**
* 实体数据更新切面,在成功更新数据后将新增数据内容记录审计日志内(审计明细【AuditInfo】中只记录审计属性变化情况,审计属性在平台属性中配置)
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册