diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java index e40fbc50..c761e6ba 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java @@ -18,6 +18,7 @@ import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.system.domain.SysSalesOrderVo; import com.ruoyi.system.domain.SysSupplier; +import com.ruoyi.system.domain.Vo.SysSupplierVo; import com.ruoyi.system.domain.exportDto.SysSupplierDto; import com.ruoyi.system.service.ISysDictTypeService; import com.ruoyi.system.service.ISysRoleService; @@ -89,7 +90,7 @@ public class SysSupplierController extends BaseController { try { startPage(); - List list = sysSupplierService.selectSysSupplierList(sysSupplier); + List list = sysSupplierService.selectSysSupplierList(sysSupplier); SysUser curUser = ShiroUtils.getSysUser(); String loginName = ShiroUtils.getLoginName(); Long userId = curUser.getUserId(); @@ -99,7 +100,7 @@ public class SysSupplierController extends BaseController if (curUser.getUserName().contains("admin")) { SysSupplier sysSupplier2 = new SysSupplier(); startPage(); - List list2 = sysSupplierService.selectSysSupplierList(sysSupplier2); + List list2 = sysSupplierService.selectSysSupplierList(sysSupplier2); return getDataTable(list2); } //如果主管审批,查看当前自己部门的审核 @@ -115,7 +116,7 @@ public class SysSupplierController extends BaseController if (roleKeys.contains("cgjlRole")) { sysSupplier.setCreateBy(curUser.getLoginName()); startPage(); - List list2 = sysSupplierService.selectSysSupplierList(sysSupplier); + List list2 = sysSupplierService.selectSysSupplierList(sysSupplier); return getDataTable(list2); } return getDataTable(list); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSupplier.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSupplier.java index cc89ef0b..85b38865 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSupplier.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSupplier.java @@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import java.util.Date; + /** * 供应商资料对象 sys_supplier * @@ -151,9 +153,33 @@ public class SysSupplier extends BaseEntity @Excel(name = "税率") private String taxRate; - private String firstAddTime; + /** 流程实例ID */ + private String instanceId; + + /** 流程实例类型 */ + private String instanceType; + + /** 提交流程实例ID */ + private String submitInstanceId; + + /** 作废流程实例ID */ + private String cancelInstanceId; + + /** 恢复流程实例ID */ + private String restoreInstanceId; + + /** 申请人 */ + private String applyTitle; + + /** 申请人 */ + private String applyUser; - private String updateInfoTime; + /** 申请时间 */ + private Date applyTime; + +// private String firstAddTime; +// +// private String updateInfoTime; private Long photoAttachId; @@ -164,6 +190,80 @@ public class SysSupplier extends BaseEntity private String removeFileIdStr; + private String delFlag; + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getInstanceId() { + return instanceId; + } + + public void setInstanceId(String instanceId) { + this.instanceId = instanceId; + } + + public String getInstanceType() { + return instanceType; + } + + public void setInstanceType(String instanceType) { + this.instanceType = instanceType; + } + + public String getSubmitInstanceId() { + return submitInstanceId; + } + + public void setSubmitInstanceId(String submitInstanceId) { + this.submitInstanceId = submitInstanceId; + } + + public String getCancelInstanceId() { + return cancelInstanceId; + } + + public void setCancelInstanceId(String cancelInstanceId) { + this.cancelInstanceId = cancelInstanceId; + } + + public String getRestoreInstanceId() { + return restoreInstanceId; + } + + public void setRestoreInstanceId(String restoreInstanceId) { + this.restoreInstanceId = restoreInstanceId; + } + + public String getApplyTitle() { + return applyTitle; + } + + public void setApplyTitle(String applyTitle) { + this.applyTitle = applyTitle; + } + + public String getApplyUser() { + return applyUser; + } + + public void setApplyUser(String applyUser) { + this.applyUser = applyUser; + } + + public Date getApplyTime() { + return applyTime; + } + + public void setApplyTime(Date applyTime) { + this.applyTime = applyTime; + } + public Long getPhotoAttachId() { return photoAttachId; } @@ -235,23 +335,6 @@ public class SysSupplier extends BaseEntity public void setPurchaseBuyer(String purchaseBuyer) { this.purchaseBuyer = purchaseBuyer; } - - public String getFirstAddTime() { - return firstAddTime; - } - - public void setFirstAddTime(String firstAddTime) { - this.firstAddTime = firstAddTime; - } - - public String getUpdateInfoTime() { - return updateInfoTime; - } - - public void setUpdateInfoTime(String updateInfoTime) { - this.updateInfoTime = updateInfoTime; - } - public void setSupplierId(Long supplierId) { this.supplierId = supplierId; @@ -578,8 +661,6 @@ public class SysSupplier extends BaseEntity .append("financialContact", getFinancialContact()) .append("confirmTax", getConfirmTax()) .append("taxRate", getTaxRate()) - .append("firstAddTime", getFirstAddTime()) - .append("updateInfoTime", getUpdateInfoTime()) .toString(); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSupplierMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSupplierMapper.java index d9b7f5b6..c9913350 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSupplierMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSupplierMapper.java @@ -1,6 +1,7 @@ package com.ruoyi.system.mapper; import com.ruoyi.system.domain.SysSupplier; +import com.ruoyi.system.domain.Vo.SysSupplierVo; import java.util.List; @@ -18,7 +19,7 @@ public interface SysSupplierMapper * @param supplierId 供应商资料ID * @return 供应商资料 */ - public SysSupplier selectSysSupplierById(Long supplierId); + public SysSupplierVo selectSysSupplierById(Long supplierId); /** * 查询供应商资料列表 @@ -26,7 +27,7 @@ public interface SysSupplierMapper * @param sysSupplier 供应商资料 * @return 供应商资料集合 */ - public List selectSysSupplierList(SysSupplier sysSupplier); + public List selectSysSupplierList(SysSupplier sysSupplier); /** * 新增供应商资料 @@ -76,4 +77,12 @@ public interface SysSupplierMapper * 关联退换货 入库后退货-选择供应商-无供应商 * */ List getSupplierCodes(); + + Integer deleteSysSupplierBySupplierCodes(String[] supplierCodes); + + Integer deleteSysSupplierBySupplierCode(String supplierCode); + + Integer updateSysSupplierBySupplierCode(String delFlag,String sysSupplierCode); + + Integer updateSysSupplierBySupplierCodes(String delFlag,SysSupplier[] sysSupplierCodes); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSupplierService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSupplierService.java index 54dc5d59..1e9956ad 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSupplierService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSupplierService.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service; import com.ruoyi.system.domain.SysSupplier; +import com.ruoyi.system.domain.Vo.SysSupplierVo; import org.springframework.stereotype.Service; import java.util.List; @@ -24,11 +25,11 @@ public interface ISysSupplierService /** * 查询供应商资料列表 - * + * * @param sysSupplier 供应商资料 * @return 供应商资料集合 */ - public List selectSysSupplierList(SysSupplier sysSupplier); + public List selectSysSupplierList(SysSupplier sysSupplier); /** * 新增供应商资料 @@ -71,7 +72,7 @@ public interface ISysSupplierService Object getId(); - public List selectSysSupplierListAll(); + public List selectSysSupplierListAll(); /** * 关联退换货 入库后退货-选择供应商-无供应商 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java index 07525158..4fa6c71e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java @@ -7,6 +7,7 @@ import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.domain.SysAttach; import com.ruoyi.system.domain.SysSupplier; +import com.ruoyi.system.domain.Vo.SysSupplierVo; import com.ruoyi.system.mapper.SysSupplierMapper; import com.ruoyi.system.service.ISysAttachFileService; import com.ruoyi.system.service.ISysAttachService; @@ -49,19 +50,19 @@ public class SysSupplierServiceImpl implements ISysSupplierService * @return 供应商资料 */ @Override - public SysSupplier selectSysSupplierById(Long supplierId) + public SysSupplierVo selectSysSupplierById(Long supplierId) { return sysSupplierMapper.selectSysSupplierById(supplierId); } /** * 查询供应商资料列表 - * + * * @param sysSupplier 供应商资料 * @return 供应商资料 */ @Override - public List selectSysSupplierList(SysSupplier sysSupplier) + public List selectSysSupplierList(SysSupplier sysSupplier) { return sysSupplierMapper.selectSysSupplierList(sysSupplier); } @@ -140,7 +141,7 @@ public class SysSupplierServiceImpl implements ISysSupplierService } @Override - public List selectSysSupplierBycode() { + public List selectSysSupplierBycode() { return sysSupplierMapper.selectSysSupplierBycode(); } @@ -158,7 +159,7 @@ public class SysSupplierServiceImpl implements ISysSupplierService return redisCache.generateBillNo("GYS"); } @Override - public List selectSysSupplierListAll() { + public List selectSysSupplierListAll() { SysSupplier sysSupplier = new SysSupplier(); sysSupplier.setAuditStatus("1"); return sysSupplierMapper.selectSysSupplierList(sysSupplier); @@ -174,7 +175,6 @@ public class SysSupplierServiceImpl implements ISysSupplierService return list; } - /** * 关联退换货 入库后退货-选择供应商-无供应商 * */ @@ -184,4 +184,5 @@ public class SysSupplierServiceImpl implements ISysSupplierService List list = sysSupplierMapper.getSupplierCodes(); return list; } + } diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml index 30226714..e5b27937 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml @@ -3,48 +3,60 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -56,7 +68,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" customer_email, website, payment_terms, supplier_days, actual_payment_days, settlement_bank, exchange_settlement_account, deposit_bank, bank_account, rmb_registered_capital, Industry_code, merchandiser, merchandiser_telephone, - financial_contact, confirm_tax, tax_rate, first_add_time, update_info_time + financial_contact, confirm_tax, tax_rate, photo_attach_id, photo_url, create_by, + create_time, update_by, update_time, remark, + instance_type, instance_id, restore_instance_id, cancel_instance_id, submit_instance_id, + apply_title, apply_user, apply_time,del_flag from sys_supplier @@ -69,34 +84,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sup.customer_email, sup.website, sup.payment_terms, sup.supplier_days, sup.actual_payment_days, sup.settlement_bank, sup.exchange_settlement_account, sup.deposit_bank, sup.bank_account, sup.rmb_registered_capital, sup.Industry_code, sup.merchandiser, sup.merchandiser_telephone, - sup.financial_contact, sup.confirm_tax, sup.tax_rate, sup.first_add_time, sup.update_info_time + sup.financial_contact, sup.confirm_tax, sup.tax_rate, sup.first_add_time, sup.update_info_time, + sup.photo_attach_id, sup.create_by, sup.create_time, sup.update_by, sup.update_time, sup.remark,sup.del_flag, + sup.instance_type, sup.instance_id, sup.restore_instance_id, sup.cancel_instance_id, sup.submit_instance_id, + sup.apply_title, sup.apply_user, sup.apply_time,p.dict_value as instance_type_name,file.url as photo_url from sys_supplier as sup + left join( + select dict_value,dict_label from sys_dict_data + where dict_type = 'processType' + ) as p on sup.instance_type = p.dict_value left join ( - select - att.rel_id - ,file.url - ,min(file.create_time) as create_time - from sys_attach as att - left join sys_attach_file as file - on att.id = file.attach_id - where att.source_type = 'supplier' and att.source_sub_type = 'photo' - group by att.rel_id - )file - on sup.supplier_id = file.rel_id - + select att.rel_id,file.url,min(file.create_time) as create_time + from sys_attach as att left join sys_attach_file as file on att.id = file.attach_id + where att.source_type = 'supplier' and att.source_sub_type = 'photo' + group by att.rel_id + ) as file on sup.supplier_id = file.rel_id + and sup.supplier_code like concat('%', #{supplierCode}, '%') and sup.supplier_name like concat('%', #{supplierName}, '%') - and sup.supplier_type = #{supplierType} - and sup.use_status = #{useStatus} - and sup.audit_status = #{auditStatus} - and sup.purchase_buyer = #{purchaseBuyer} + and sup.supplier_type = #{supplierType} + and sup.use_status = #{useStatus} + and sup.audit_status = #{auditStatus} + and sup.purchase_buyer = #{purchaseBuyer} and sup.export_sales = #{exportSales} and sup.enterprise_name like concat('%', #{enterpriseName}, '%') and sup.customer_contact like concat('%', #{customerContact}, '%') and sup.merchandiser like concat('%', #{merchandiser}, '%') + and sup.instance_id = #{instanceId} + and sup.instance_type = #{instanceType} + and sup.submit_instance_id = #{submitInstanceId} + and sup.cancel_instance_id = #{cancelInstanceId} + and sup.restore_instance_id = #{restoreInstanceId} + and sup.apply_title = #{applyTitle} + and sup.apply_user = #{applyUser} + and sup.apply_time = #{applyTime} + + and sup.create_time between #{params.beginCreateTime} and #{params.endCreateTime} + + and ((sup.supplierCode like concat('%',#{keyword},'%') or sup.suppplierName like concat('%',#{keyword},'%')) + order by sup.create_time,sup.supplier_id desc -