提交 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);
}
......@@ -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]外键关系 -->
......
......@@ -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,19 +54,20 @@ public class AuditAspect
return;
Object serviceParam =args[0];
EntityBase entity=(EntityBase)serviceParam;//创建数据
Map<String, Audit> auditFields= DEFieldCacheMap.getAuditFields(entity.getClass());
if(auditFields.size()==0)//是否有审计属性
return;
if(serviceParam instanceof EntityBase){
EntityBase entity=(EntityBase)serviceParam;//创建数据
Map<String, Audit> auditFields= DEFieldCacheMap.getAuditFields(entity.getClass());
if(auditFields.size()==0)//是否有审计属性
return;
String idField=DEFieldCacheMap.getDEKeyField(entity.getClass());
Object idValue="";
if(!StringUtils.isEmpty(idField)){
idValue=entity.get(idField);
String idField=DEFieldCacheMap.getDEKeyField(entity.getClass());
Object idValue="";
if(!StringUtils.isEmpty(idField)){
idValue=entity.get(idField);
}
//记录审计日志
dataAuditService.createAudit(request,entity,idValue,auditFields);
}
//记录审计日志
dataAuditService.createAudit(request,entity,idValue,auditFields);
return;
}
/**
......@@ -88,27 +89,30 @@ public class AuditAspect
return point.proceed();
Object arg=args[0];
EntityBase entity= (EntityBase) arg;
Map<String, Audit> auditFields= DEFieldCacheMap.getAuditFields(entity.getClass());
if(arg instanceof EntityBase){
EntityBase entity= (EntityBase) arg;
Map<String, Audit> auditFields= DEFieldCacheMap.getAuditFields(entity.getClass());
//是否有审计属性
if(auditFields.size()==0)
return point.proceed();
String idField=DEFieldCacheMap.getDEKeyField(entity.getClass());
Object idValue="";
if(!StringUtils.isEmpty(idField)){
idValue=entity.get(idField);
}
if(ObjectUtils.isEmpty(idValue))
return point.proceed();
//是否有审计属性
if(auditFields.size()==0)
return point.proceed();
String idField=DEFieldCacheMap.getDEKeyField(entity.getClass());
Object idValue="";
if(!StringUtils.isEmpty(idField)){
idValue=entity.get(idField);
}
if(ObjectUtils.isEmpty(idValue))
return point.proceed();
//获取更新前实体
EntityBase beforeEntity=getEntity(serviceObj,idValue);
//执行更新操作
point.proceed();
//记录审计日志
dataAuditService.updateAudit(request,beforeEntity,serviceObj,idValue,auditFields);
return true;
//获取更新前实体
EntityBase beforeEntity=getEntity(serviceObj,idValue);
//执行更新操作
point.proceed();
//记录审计日志
dataAuditService.updateAudit(request,beforeEntity,serviceObj,idValue,auditFields);
return true;
}
return point.proceed();
}
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册