提交 85846c15 编写于 作者: ibizdev's avatar ibizdev

lab_gzf 发布系统代码

上级 be228d0b
......@@ -81,4 +81,9 @@ public class purchase_orderFallback implements purchase_orderFeignClient{
}
public Page<Purchase_order> searchOrder(Purchase_orderSearchContext context){
return null;
}
}
......@@ -76,4 +76,9 @@ public interface purchase_orderFeignClient {
Page<Purchase_order> searchDefault(@RequestBody Purchase_orderSearchContext context);
@RequestMapping(method = RequestMethod.POST, value = "/purchase_orders/searchorder")
Page<Purchase_order> searchOrder(@RequestBody Purchase_orderSearchContext context);
}
......@@ -20,6 +20,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) ;
Page<Purchase_order> searchOrder(IPage page, @Param("srf") Purchase_orderSearchContext context, @Param("ew") Wrapper<Purchase_order> wrapper) ;
@Override
Purchase_order selectById(Serializable id);
@Override
......
......@@ -38,6 +38,7 @@ public interface IPurchase_orderService extends IService<Purchase_order>{
boolean save(Purchase_order et) ;
void saveBatch(List<Purchase_order> list) ;
Page<Purchase_order> searchDefault(Purchase_orderSearchContext context) ;
Page<Purchase_order> searchOrder(Purchase_orderSearchContext context) ;
List<Purchase_order> selectByRequisitionId(Long id) ;
void removeByRequisitionId(Long id) ;
List<Purchase_order> selectByFiscalPositionId(Long id) ;
......
......@@ -321,6 +321,15 @@ public class Purchase_orderServiceImpl extends ServiceImpl<Purchase_orderMapper,
return new PageImpl<Purchase_order>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 订单
*/
@Override
public Page<Purchase_order> searchOrder(Purchase_orderSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Purchase_order> pages=baseMapper.searchOrder(context.getPages(),context,context.getSelectCond());
return new PageImpl<Purchase_order>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
......
......@@ -201,11 +201,26 @@
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[Order]-->
<select id="searchOrder" parameterType="cn.ibizlab.businesscentral.core.odoo_purchase.filter.Purchase_orderSearchContext" resultMap="Purchase_orderResultMap">
select t1.* from (
<include refid="Order" />
)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.REQUISITION_ID, t161.NAME AS REQUISITION_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 LEFT JOIN PURCHASE_REQUISITION t161 ON t1.REQUISITION_ID = t161.ID
]]>
</sql>
<!--数据查询[Order]-->
<sql id="Order" 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.REQUISITION_ID, t161.NAME AS REQUISITION_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 LEFT JOIN PURCHASE_REQUISITION t161 ON t1.REQUISITION_ID = t161.ID
WHERE ( ( t1.STATE = 'purchase' OR t1.STATE = 'done' ) )
]]>
</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.REQUISITION_ID, t161.NAME AS REQUISITION_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 LEFT JOIN PURCHASE_REQUISITION t161 ON t1.REQUISITION_ID = t161.ID
......
......@@ -158,6 +158,28 @@ public class Purchase_orderResource {
.body(new PageImpl(purchase_orderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Purchase_order-searchOrder-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order-Get')")
@ApiOperation(value = "获取订单", tags = {"采购订单" } ,notes = "获取订单")
@RequestMapping(method= RequestMethod.GET , value="/purchase_orders/fetchorder")
public ResponseEntity<List<Purchase_orderDTO>> fetchOrder(Purchase_orderSearchContext context) {
Page<Purchase_order> domains = purchase_orderService.searchOrder(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-searchOrder-all') and hasPermission(#context,'iBizBusinessCentral-Purchase_order-Get')")
@ApiOperation(value = "查询订单", tags = {"采购订单" } ,notes = "查询订单")
@RequestMapping(method= RequestMethod.POST , value="/purchase_orders/searchorder")
public ResponseEntity<Page<Purchase_orderDTO>> searchOrder(@RequestBody Purchase_orderSearchContext context) {
Page<Purchase_order> domains = purchase_orderService.searchOrder(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(purchase_orderMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册