提交 9ada634c 编写于 作者: ibizdev's avatar ibizdev

xignzi006 发布系统代码

上级 b75ee1b1
......@@ -574,13 +574,20 @@ public class Purchase_order extends EntityMP implements Serializable {
@JsonProperty("picking_type_id")
private Long pickingTypeId;
/**
* ID
* 采购申请单
*/
@DEField(name = "requisition_id")
@TableField(value = "requisition_id")
@JSONField(name = "requisition_id")
@JsonProperty("requisition_id")
private Long requisitionId;
/**
* 采购申请单
*/
@TableField(exist = false)
@JSONField(name = "requisition_id_text")
@JsonProperty("requisition_id_text")
private String requisitionIdText;
/**
*
......@@ -919,7 +926,7 @@ public class Purchase_order extends EntityMP implements Serializable {
}
/**
* 设置 [ID]
* 设置 [采购申请单]
*/
public void setRequisitionId(Long requisitionId){
this.requisitionId = requisitionId ;
......
......@@ -293,13 +293,27 @@ public class Purchase_orderSearchContext extends QueryWrapperContext<Purchase_or
this.getSearchCond().eq("picking_type_id", n_picking_type_id_eq);
}
}
private Long n_requisition_id_eq;//[ID]
private Long n_requisition_id_eq;//[采购申请单]
public void setN_requisition_id_eq(Long n_requisition_id_eq) {
this.n_requisition_id_eq = n_requisition_id_eq;
if(!ObjectUtils.isEmpty(this.n_requisition_id_eq)){
this.getSearchCond().eq("requisition_id", n_requisition_id_eq);
}
}
private String n_requisition_id_text_eq;//[采购申请单]
public void setN_requisition_id_text_eq(String n_requisition_id_text_eq) {
this.n_requisition_id_text_eq = n_requisition_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_requisition_id_text_eq)){
this.getSearchCond().eq("requisition_id_text", n_requisition_id_text_eq);
}
}
private String n_requisition_id_text_like;//[采购申请单]
public void setN_requisition_id_text_like(String n_requisition_id_text_like) {
this.n_requisition_id_text_like = n_requisition_id_text_like;
if(!ObjectUtils.isEmpty(this.n_requisition_id_text_like)){
this.getSearchCond().like("requisition_id_text", n_requisition_id_text_like);
}
}
/**
* 启用快速搜索
......
......@@ -328,6 +328,16 @@ public class Purchase_orderServiceImpl extends ServiceImpl<Purchase_orderMapper,
* @param et
*/
private void fillParentData(Purchase_order et){
//实体关系[DER1N_PURCHASE_ORDER_PURCHASE_REQUISITION_REQUISITION_ID]
if(!ObjectUtils.isEmpty(et.getRequisitionId())){
cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition odooRequisition=et.getOdooRequisition();
if(ObjectUtils.isEmpty(odooRequisition)){
cn.ibizlab.businesscentral.core.odoo_purchase.domain.Purchase_requisition majorEntity=purchaseRequisitionService.get(et.getRequisitionId());
et.setOdooRequisition(majorEntity);
odooRequisition=majorEntity;
}
et.setRequisitionIdText(odooRequisition.getName());
}
//实体关系[DER1N_PURCHASE_ORDER__ACCOUNT_FISCAL_POSITION__FISCAL_POSITION_ID]
if(!ObjectUtils.isEmpty(et.getFiscalPositionId())){
cn.ibizlab.businesscentral.core.odoo_account.domain.Account_fiscal_position odooFiscalPosition=et.getOdooFiscalPosition();
......
......@@ -58,4 +58,27 @@ public class uom_uomFallback implements uom_uomFeignClient{
return null;
}
public Uom_uom getDraft(){
return null;
}
public Boolean checkKey(Uom_uom uom_uom){
return false;
}
public Boolean save(Uom_uom uom_uom){
return false;
}
public Boolean saveBatch(List<Uom_uom> uom_uoms){
return false;
}
public Page<Uom_uom> searchDefault(Uom_uomSearchContext context){
return null;
}
}
......@@ -56,4 +56,24 @@ public interface uom_uomFeignClient {
Page<Uom_uom> select();
@RequestMapping(method = RequestMethod.GET, value = "/uom_uoms/getdraft")
Uom_uom getDraft();
@RequestMapping(method = RequestMethod.POST, value = "/uom_uoms/checkkey")
Boolean checkKey(@RequestBody Uom_uom uom_uom);
@RequestMapping(method = RequestMethod.POST, value = "/uom_uoms/save")
Boolean save(@RequestBody Uom_uom uom_uom);
@RequestMapping(method = RequestMethod.POST, value = "/uom_uoms/savebatch")
Boolean saveBatch(@RequestBody List<Uom_uom> uom_uoms);
@RequestMapping(method = RequestMethod.POST, value = "/uom_uoms/searchdefault")
Page<Uom_uom> searchDefault(@RequestBody Uom_uomSearchContext context);
}
......@@ -27,6 +27,83 @@ import cn.ibizlab.businesscentral.core.odoo_uom.domain.Uom_uom;
@Data
public class Uom_uomSearchContext extends QueryWrapperContext<Uom_uom> {
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_uom_type_eq;//[类型]
public void setN_uom_type_eq(String n_uom_type_eq) {
this.n_uom_type_eq = n_uom_type_eq;
if(!ObjectUtils.isEmpty(this.n_uom_type_eq)){
this.getSearchCond().eq("uom_type", n_uom_type_eq);
}
}
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_category_id_text_eq;//[类别]
public void setN_category_id_text_eq(String n_category_id_text_eq) {
this.n_category_id_text_eq = n_category_id_text_eq;
if(!ObjectUtils.isEmpty(this.n_category_id_text_eq)){
this.getSearchCond().eq("category_id_text", n_category_id_text_eq);
}
}
private String n_category_id_text_like;//[类别]
public void setN_category_id_text_like(String n_category_id_text_like) {
this.n_category_id_text_like = n_category_id_text_like;
if(!ObjectUtils.isEmpty(this.n_category_id_text_like)){
this.getSearchCond().like("category_id_text", n_category_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 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_category_id_eq;//[类别]
public void setN_category_id_eq(Long n_category_id_eq) {
this.n_category_id_eq = n_category_id_eq;
if(!ObjectUtils.isEmpty(this.n_category_id_eq)){
this.getSearchCond().eq("category_id", n_category_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);
}
}
/**
* 启用快速搜索
......
......@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
public interface Uom_uomMapper extends BaseMapper<Uom_uom>{
Page<Uom_uom> searchDefault(IPage page, @Param("srf") Uom_uomSearchContext context, @Param("ew") Wrapper<Uom_uom> wrapper) ;
@Override
Uom_uom selectById(Serializable id);
@Override
......@@ -61,4 +62,10 @@ public interface Uom_uomMapper extends BaseMapper<Uom_uom>{
@Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<Uom_uom> selectByCreateUid(@Param("id") Serializable id) ;
List<Uom_uom> selectByWriteUid(@Param("id") Serializable id) ;
List<Uom_uom> selectByCategoryId(@Param("id") Serializable id) ;
}
......@@ -33,6 +33,17 @@ public interface IUom_uomService extends IService<Uom_uom>{
boolean remove(Long key) ;
void removeBatch(Collection<Long> idList) ;
Uom_uom get(Long key) ;
Uom_uom getDraft(Uom_uom et) ;
boolean checkKey(Uom_uom et) ;
boolean save(Uom_uom et) ;
void saveBatch(List<Uom_uom> list) ;
Page<Uom_uom> searchDefault(Uom_uomSearchContext context) ;
List<Uom_uom> selectByCreateUid(Long id) ;
void removeByCreateUid(Long id) ;
List<Uom_uom> selectByWriteUid(Long id) ;
void removeByWriteUid(Long id) ;
List<Uom_uom> selectByCategoryId(Long id) ;
void removeByCategoryId(Long id) ;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
......
......@@ -210,7 +210,89 @@ public class Uom_uomServiceImpl extends ServiceImpl<Uom_uomMapper, Uom_uom> impl
return et;
}
@Override
public Uom_uom getDraft(Uom_uom et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(Uom_uom et) {
return (!ObjectUtils.isEmpty(et.getId()))&&(!Objects.isNull(this.getById(et.getId())));
}
@Override
@Transactional
public boolean save(Uom_uom et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(Uom_uom et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
@Transactional
public boolean saveBatch(Collection<Uom_uom> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
@Transactional
public void saveBatch(List<Uom_uom> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<Uom_uom> selectByCreateUid(Long id) {
return baseMapper.selectByCreateUid(id);
}
@Override
public void removeByCreateUid(Long id) {
this.remove(new QueryWrapper<Uom_uom>().eq("create_uid",id));
}
@Override
public List<Uom_uom> selectByWriteUid(Long id) {
return baseMapper.selectByWriteUid(id);
}
@Override
public void removeByWriteUid(Long id) {
this.remove(new QueryWrapper<Uom_uom>().eq("write_uid",id));
}
@Override
public List<Uom_uom> selectByCategoryId(Long id) {
return baseMapper.selectByCategoryId(id);
}
@Override
public void removeByCategoryId(Long id) {
this.remove(new QueryWrapper<Uom_uom>().eq("category_id",id));
}
/**
* 查询集合 数据集
*/
@Override
public Page<Uom_uom> searchDefault(Uom_uomSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Uom_uom> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<Uom_uom>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
......
......@@ -5,7 +5,7 @@
<!--该方法用于重写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.REQUISITION_ID, 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}]]>
<![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.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 ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -78,6 +78,7 @@
<result property="fiscalPositionId" column="fiscal_position_id" />
<result property="pickingTypeId" column="picking_type_id" />
<result property="requisitionId" column="requisition_id" />
<result property="requisitionIdText" column="requisition_id_text" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
......@@ -202,12 +203,12 @@
<!--数据查询[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, 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
<![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>
<!--数据查询[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, 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
<![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
]]>
</sql>
</mapper>
......
......@@ -4,6 +4,9 @@
<mapper namespace="cn.ibizlab.businesscentral.core.odoo_uom.mapper.Uom_uomMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="Uom_uomResultMap" databaseId="postgresql">
<![CDATA[select t1.* from (SELECT t1.ACTIVE, t1.CATEGORY_ID, t31.NAME AS CATEGORY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t51.NAME AS CREATE_UID_TEXT, t1.FACTOR, t1.ID, t31.IS_POS_GROUPABLE, t31.MEASURE_TYPE, t1.NAME, t1.ROUNDING, t1.UOM_TYPE, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UID_TEXT FROM UOM_UOM t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN UOM_CATEGORY t31 ON t1.CATEGORY_ID = t31.ID LEFT JOIN RES_USERS t41 ON t1.CREATE_UID = t41.ID LEFT JOIN RES_PARTNER t51 ON t41.PARTNER_ID = t51.ID ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="Uom_uomResultMap" type="cn.ibizlab.businesscentral.core.odoo_uom.domain.Uom_uom" autoMapping="true">
......@@ -33,8 +36,45 @@
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_UOM_UOM__RES_USERS__CREATE_UID] -->
<select id="selectByCreateUid" resultMap="Uom_uomResultMap">
select t1.* from (
<include refid="Default" />
) t1
where create_uid=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_UOM_UOM__RES_USERS__WRITE_UID] -->
<select id="selectByWriteUid" resultMap="Uom_uomResultMap">
select t1.* from (
<include refid="Default" />
) t1
where write_uid=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_UOM_UOM__UOM_CATEGORY__CATEGORY_ID] -->
<select id="selectByCategoryId" resultMap="Uom_uomResultMap">
select t1.* from (
<include refid="Default" />
) t1
where category_id=#{id}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.odoo_uom.filter.Uom_uomSearchContext" resultMap="Uom_uomResultMap">
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.ACTIVE, t1.CATEGORY_ID, t31.NAME AS CATEGORY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t51.NAME AS CREATE_UID_TEXT, t1.FACTOR, t1.ID, t31.IS_POS_GROUPABLE, t31.MEASURE_TYPE, t1.NAME, t1.ROUNDING, t1.UOM_TYPE, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UID_TEXT FROM UOM_UOM t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN UOM_CATEGORY t31 ON t1.CATEGORY_ID = t31.ID LEFT JOIN RES_USERS t41 ON t1.CREATE_UID = t41.ID LEFT JOIN RES_PARTNER t51 ON t41.PARTNER_ID = t51.ID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="postgresql">
<![CDATA[ SELECT t1.ACTIVE, t1.CATEGORY_ID, t31.NAME AS CATEGORY_ID_TEXT, t1.CREATE_DATE, t1.CREATE_UID, t51.NAME AS CREATE_UID_TEXT, t1.FACTOR, t1.ID, t31.IS_POS_GROUPABLE, t31.MEASURE_TYPE, t1.NAME, t1.ROUNDING, t1.UOM_TYPE, t1.WRITE_DATE, t1.WRITE_UID, t21.NAME AS WRITE_UID_TEXT FROM UOM_UOM t1 LEFT JOIN RES_USERS t11 ON t1.WRITE_UID = t11.ID LEFT JOIN RES_PARTNER t21 ON t11.PARTNER_ID = t21.ID LEFT JOIN UOM_CATEGORY t31 ON t1.CATEGORY_ID = t31.ID LEFT JOIN RES_USERS t41 ON t1.CREATE_UID = t41.ID LEFT JOIN RES_PARTNER t51 ON t41.PARTNER_ID = t51.ID
]]>
</sql>
</mapper>
......@@ -122061,7 +122061,7 @@
{
"fieldname":"REQUISITION_ID" ,
"codename":"Requisition_id",
"field_logic_name":"ID",
"field_logic_name":"采购申请单",
"entity_name":"Purchase_order",
"ref_de":"PURCHASE_REQUISITION",
"ref_field_name":"ID",
......@@ -122074,6 +122074,23 @@
"data_length":20,
"key_field":0,
"major_field":0
},
{
"fieldname":"REQUISITION_ID_TEXT" ,
"codename":"Requisition_id_text",
"field_logic_name":"采购申请单",
"entity_name":"Purchase_order",
"ref_de":"PURCHASE_REQUISITION",
"ref_field_name":"NAME",
"relation_name":"DER1N_PURCHASE_ORDER_PURCHASE_REQUISITION_REQUISITION_ID",
"relation_codename":"Odoo_requisition",
"field_type":"PICKUPTEXT",
"nullable":1,
"physical_field":0,
"data_type":"VARCHAR",
"data_length":100,
"key_field":0,
"major_field":0
}
],
"subEntitys":[
......@@ -664,6 +664,15 @@ public class Purchase_orderDTO extends DTOBase implements Serializable {
@JsonSerialize(using = ToStringSerializer.class)
private Long requisitionId;
/**
* 属性 [REQUISITION_ID_TEXT]
*
*/
@JSONField(name = "requisition_id_text")
@JsonProperty("requisition_id_text")
@Size(min = 0, max = 100, message = "内容长度必须小于等于[100]")
private String requisitionIdText;
/**
* 设置 [ACCESS_TOKEN]
......
......@@ -109,6 +109,55 @@ public class Uom_uomResource {
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取产品计量单位草稿", tags = {"产品计量单位" }, notes = "获取产品计量单位草稿")
@RequestMapping(method = RequestMethod.GET, value = "/uom_uoms/getdraft")
public ResponseEntity<Uom_uomDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(uom_uomMapping.toDto(uom_uomService.getDraft(new Uom_uom())));
}
@ApiOperation(value = "检查产品计量单位", tags = {"产品计量单位" }, notes = "检查产品计量单位")
@RequestMapping(method = RequestMethod.POST, value = "/uom_uoms/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody Uom_uomDTO uom_uomdto) {
return ResponseEntity.status(HttpStatus.OK).body(uom_uomService.checkKey(uom_uomMapping.toDomain(uom_uomdto)));
}
@PreAuthorize("hasPermission(this.uom_uomMapping.toDomain(#uom_uomdto),'iBizBusinessCentral-Uom_uom-Save')")
@ApiOperation(value = "保存产品计量单位", tags = {"产品计量单位" }, notes = "保存产品计量单位")
@RequestMapping(method = RequestMethod.POST, value = "/uom_uoms/save")
public ResponseEntity<Boolean> save(@RequestBody Uom_uomDTO uom_uomdto) {
return ResponseEntity.status(HttpStatus.OK).body(uom_uomService.save(uom_uomMapping.toDomain(uom_uomdto)));
}
@PreAuthorize("hasPermission(this.uom_uomMapping.toDomain(#uom_uomdtos),'iBizBusinessCentral-Uom_uom-Save')")
@ApiOperation(value = "批量保存产品计量单位", tags = {"产品计量单位" }, notes = "批量保存产品计量单位")
@RequestMapping(method = RequestMethod.POST, value = "/uom_uoms/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<Uom_uomDTO> uom_uomdtos) {
uom_uomService.saveBatch(uom_uomMapping.toDomain(uom_uomdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Uom_uom-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Uom_uom-Get')")
@ApiOperation(value = "获取数据集", tags = {"产品计量单位" } ,notes = "获取数据集")
@RequestMapping(method= RequestMethod.GET , value="/uom_uoms/fetchdefault")
public ResponseEntity<List<Uom_uomDTO>> fetchDefault(Uom_uomSearchContext context) {
Page<Uom_uom> domains = uom_uomService.searchDefault(context) ;
List<Uom_uomDTO> list = uom_uomMapping.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-Uom_uom-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Uom_uom-Get')")
@ApiOperation(value = "查询数据集", tags = {"产品计量单位" } ,notes = "查询数据集")
@RequestMapping(method= RequestMethod.POST , value="/uom_uoms/searchdefault")
public ResponseEntity<Page<Uom_uomDTO>> searchDefault(@RequestBody Uom_uomSearchContext context) {
Page<Uom_uom> domains = uom_uomService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(uom_uomMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册