Browse Source

[fix]采购管理

供应商新增供应商资质查询条件,修改供应商类型查询bug
供应商类型和供应商资质导出加上字典
修复供应商列表分页查询后端bug问题
供应商列表的审核状态加上taskStatus字段,加上新的状态 审核通过和审核拒绝
dev
liuxiaoxu 3 months ago
parent
commit
ac8b410f33
  1. 27
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java
  2. 17
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSupplier.java
  3. 14
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/SysSupplierVo.java
  4. 8
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java
  5. 13
      ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml
  6. 75
      ruoyi-admin/src/main/resources/templates/system/supplier/supplier.html

27
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java

@ -95,35 +95,10 @@ public class SysSupplierController extends BaseController
@ResponseBody
public TableDataInfo list(SysSupplier sysSupplier)
{
try {
startPage();
List<SysSupplierVo> list = sysSupplierService.selectSysSupplierList(sysSupplier);
SysUser curUser = ShiroUtils.getSysUser();
String loginName = ShiroUtils.getLoginName();
Long userId = curUser.getUserId();
Set<String> roleKeys = roleService.selectRoleKeys(userId);
// List<SysUser> sysUserlist = sysUserService.selectRoleToUserList("cgyRole");
// sysUserlist.add(curUser);
//如果主管审批,查看当前自己部门的审核
//如果经理审计需要查询自己部门下所有业务员的提交的订单,以及自身的提交的订单
// if (roleKeys.contains("cgjlRole")) {
// List<SysUser> findUser = sysUserlist.stream().filter(item -> (item.getDeptId().equals(curUser.getDeptId()))).collect(Collectors.toList());
// Set<String> user = findUser.stream().map(SysUser::getLoginName).collect(Collectors.toSet());
// startPage();
// List<SysSupplier> list2 = list.stream().filter(item -> user.contains(item.getCreateBy())).collect(Collectors.toList());
// return getDataTable(list2);
// }
// 业务员角色只能看到自己创建的数据
if (roleKeys.contains("cgyRole")) {
sysSupplier.setCreateBy(curUser.getLoginName());
startPage();
List<SysSupplierVo> list2 = sysSupplierService.selectSysSupplierList(sysSupplier);
return getDataTable(list2);
}
return getDataTable(list);
}catch(NullPointerException e){
throw new NullPointerException("当前用户没有申请客户资料");
}
}
/**

17
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSupplier.java

@ -24,11 +24,6 @@ public class SysSupplier extends BaseEntity
/*使用状态*/
private String useStatus;
/** 供应商类型 (0采购供应商、1委外供应商)*/
private String supplierType;
/** 供应商资质(1合格、2不合格、3特殊供应商)*/
private String supplierQualification;
/*采购员*/
private String purchaseBuyer;
/** 供应商编号 */
@ -39,6 +34,16 @@ public class SysSupplier extends BaseEntity
@Excel(name = "供应商名称")
private String supplierName;
/** 供应商类型 (0采购供应商、1委外供应商)*/
@Excel( name = "供应商类型",dictType = "sys_supplier_type")
private String supplierType;
/** 供应商资质(1合格、2不合格、3特殊供应商)*/
@Excel( name = "供应商资质",dictType = "sys_supplier_qualification")
private String supplierQualification;
/** 内外销 */
@Excel(name = "内外销")
private String exportSales;
@ -154,7 +159,7 @@ public class SysSupplier extends BaseEntity
private String financialContact;
/** 是否含税 */
@Excel(name = "是否含税")
@Excel(name = "是否含税", dictType = "sys_confirm_tax")
private String confirmTax;
/** 税率 */

14
ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/SysSupplierVo.java

@ -18,6 +18,11 @@ public class SysSupplierVo extends SysSupplier {
private String taskId;
/** 任务名称 */
private String taskName;
// 当前状态
private String taskStatus;
/** 办理时间 */
private Date doneTime;
/** 创建人 */
@ -95,12 +100,21 @@ public class SysSupplierVo extends SysSupplier {
}
public String getTaskStatus() {
return taskStatus;
}
public void setTaskStatus(String taskStatus) {
this.taskStatus = taskStatus;
}
@Override
public String toString() {
return "SysSupplierVo{" +
"applyUserName='" + applyUserName + '\'' +
", taskId='" + taskId + '\'' +
", taskName='" + taskName + '\'' +
", taskStatus='" + taskStatus + '\'' +
", doneTime=" + doneTime +
", createUserName='" + createUserName + '\'' +
", suspendState='" + suspendState + '\'' +

8
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java

@ -146,6 +146,14 @@ public class SysSupplierServiceImpl implements ISysSupplierService{
} else {
sysSupplierVo.setTaskName("未启动");
}
sysSupplierVo.setTaskStatus(sysSupplierVo.getTaskName());
if(sysSupplierVo.getAuditStatus()!=null && sysSupplierVo.getAuditStatus().equals("1")){
sysSupplierVo.setTaskStatus("审核通过");
}else if(sysSupplierVo.getAuditStatus()!=null && sysSupplierVo.getAuditStatus().equals("2")){
sysSupplierVo.setTaskStatus("审核拒绝");
}
returnList.add(sysSupplierVo);
}
returnList.setTotal(CollectionUtils.isEmpty(list) ? 0 : list.getTotal());

13
ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml

@ -114,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="supplierCode != null and supplierCode != ''"> and sup.supplier_code like concat('%', #{supplierCode}, '%')</if>
<if test="supplierName != null and supplierName != ''"> and sup.supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="supplierType != null and supplierType != ''"> and sup.supplier_type = #{supplierType}</if>
<if test="supplierQualification != null and supplierQualification != ''"> and sup.supplier_qualification = #{supplierQualification}</if>
<if test="useStatus != null and useStatus != ''"> and sup.use_status = #{useStatus}</if>
<if test="auditStatus != null and auditStatus != ''"> and sup.audit_status = #{auditStatus}</if>
<if test="purchaseBuyer != null and purchaseBuyer != ''"> and sup.purchase_buyer = #{purchaseBuyer}</if>
@ -129,18 +130,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="receiveAddress != null and receiveAddress != ''"> or sup.receive_address like concat('%',#{receiveAddress},'%')</if>
<if test="invoiceCompanyName != null and invoiceCompanyName != ''"> and sup.invoice_company_name like concat('%', #{invoiceCompanyName}, '%')</if>
<if test="companyTaxNumber != null and companyTaxNumber != ''"> and sup.company_tax_number like concat('%', #{companyTaxNumber}, '%')</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
<if test="instanceId != null and instanceId != ''"> and sup.instance_id = #{instanceId}</if>
<if test="instanceType != null and instanceType != ''"> and sup.instance_type = #{instanceType}</if>
<if test="submitInstanceId != null and submitInstanceId != ''"> and sup.submit_instance_id = #{submitInstanceId}</if>
<if test="cancelInstanceId != null and cancelInstanceId != ''"> and sup.cancel_instance_id = #{cancelInstanceId}</if>
<if test="restoreInstanceId != null and restoreInstanceId != ''"> and sup.restore_instance_id = #{restoreInstanceId}</if>
<if test="applyTitle != null and applyTitle != ''"> and sup.apply_title = #{applyTitle}</if>
<if test="applyUser != null and applyUser != ''"> and sup.apply_user = #{applyUser}</if>
<if test="applyTime != null "> and sup.apply_time = #{applyTime}</if>
and sup.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
<if test="keyword != null and keyword != ''"> and ((sup.supplierCode like concat('%',#{keyword},'%') or sup.suppplierName like concat('%',#{keyword},'%'))</if>
</where>
order by sup.apply_time asc, sup.create_time desc
</select>

75
ruoyi-admin/src/main/resources/templates/system/supplier/supplier.html

@ -28,21 +28,24 @@
</li>
<li>
<label>供应商类型:</label>
<select name="supplierType" th:with="type=${@dict.getType('supplier_status')}">
<select name="supplierType" th:with="type=${@dict.getType('sys_supplier_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>使用状态</label>
<select name="useStatus" th:with="type=${@dict.getType('useStatus')}">
<label>供应商资质</label>
<select name="supplierQualification" th:with="type=${@dict.getType('sys_supplier_qualification')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>采购员:</label>
<select name="purchaseBuyer" ></select>
<label>使用状态:</label>
<select name="useStatus" th:with="type=${@dict.getType('useStatus')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@ -92,50 +95,48 @@
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
detailUrl: prefix + "/detail/{id}",
search: false,
showExport: true,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
showExport: false,
showExport: true,
showColumns: true,
showToggle: true,
clickToSelect: true,
modalName: "供应商资料",
fixedColumns:true,
fixedRightNumber:1,
columns: [{checkbox: true},
{title: '供应商id',field: 'supplierId',visible: false},
{title: '审核状态',field: 'auditStatus',formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value);
}},
{title: '使用状态',field: 'useStatus',formatter: function(value, row, index) {
return $.table.selectDictLabel(useStatusDatas, value);
}},
{title: '流程实例ID',field: 'instanceId',visible: false},
{ title: '流程提交实例ID',field: 'submitInstanceId',visible: false},
{ title:'流程作废实例ID',field: 'cancelInstanceId',visible: false},
{title: '流程恢复实例ID',field: 'restoreInstanceId', visible: false},
{ title: '流程实例类型', field: 'instanceTypeName',visible: false},
{title: '申请人ID',field: 'applyUser', visible: false},
{title: '审核状态',field: 'auditStatus',visible: false,formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value);
}},
{
field: 'applyUserName',
title: '<span style="color: red;">申请人</span>',
visible: false,
formatter: function(value, row, index) {
return '<span style="color: red;">' + (value ? value : "-") + '</span>';
}
},
{field: 'applyTime',title: '申请时间'},
{title: '当前任务ID',field: 'taskId',visible: false},
{ title: '待办用户ID',field: 'todoUserId', visible: false},
{ title: '当前任务名称',field: 'taskName',
{ title: '当前任务名称',field: 'taskName', visible: false,
align: 'center',
formatter: function(value, row, index) {
return '<span class="badge badge-primary">' + value + '</span>';
}
},
{title: '当前状态',field: 'taskStatus', align: 'center',
formatter: function(value, row, index) {
if(row.auditStatus!="1"&&value != "未启动"){
return '<span class="badge badge-danger">' + value + '</span>';
}
if(value === "未启动"){
return '<span class="badge badge-primary">' + value + '</span>';
}
return '<span class="badge badge-primary">' + value + '</span>';}
},
{ title: '供应商编号',field: 'supplierCode'},
{title: '供应商名称',field: 'supplierName'},
{title: '供应商类型',field: 'supplierType',formatter: function(value, row, index) {
@ -197,6 +198,13 @@
}
}
},
{field: 'applyTime',title: '申请时间'},
{title: '使用状态',field: 'useStatus',formatter: function(value, row, index) {
return $.table.selectDictLabel(useStatusDatas, value);
}},
{
field: 'updateInfoTime',
title: '上次修改时间',
@ -216,17 +224,17 @@
var actions = [];
if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId) {
// 作废
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.supplierId + '\')"><i class="fa fa-remove"></i> 作废</a>');
actions.push('<a href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.supplierId + '\')"><i class="fa fa-remove"></i> 作废</a>');
// 编辑
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.supplierId + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
actions.push('<a href="javascript:void(0)" onclick="$.operate.edit(\'' + row.supplierId + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
// 已作废
}else{
actions.push('<a class="btn btn-default btn-xs" href="javascript:void(0)" disabled><i class="fa fa-edit"></i> 编辑</a> ');
actions.push('<a href="javascript:void(0)" disabled><i class="fa fa-edit"></i> 编辑</a> ');
}
// 有流程实例id
if(row.useStatus=="2" && !row.restoreInstanceId){
// 恢复
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.supplierId + '\')"><i class="fa fa-window-restore"></i> 恢复</a> ');
actions.push('<a href="javascript:void(0)" onclick="$.operate.restore(\'' + row.supplierId + '\')"><i class="fa fa-window-restore"></i> 恢复</a> ');
}
// 有流程实例id
if (row.instanceId) {
@ -235,17 +243,18 @@
var todoUserIdList = row.todoUserId.split(",");
if(todoUserIdList.includes(loginName)){
var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批';
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+ row.instanceTypeName +"申请" + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> ');
actions.push('<a href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+ row.instanceTypeName +"申请" + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> ');
}
}
// 审批历史
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="showHistoryDialog(\'' + row.instanceId + '\')"><i class="fa fa-list"></i> 审批历史</a> ');
actions.push('<a href="javascript:void(0)" onclick="showHistoryDialog(\'' + row.instanceId + '\')"><i class="fa fa-list"></i> 审批历史</a> ');
// 进度查看
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
actions.push('<a href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
}
// 详情
actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.supplierId + '\')"><i class="fa fa-eye"></i> 详情</a> ');
return actions.join('');
actions.push('<a href="javascript:void(0)" onclick="$.operate.detail(\'' + row.supplierId + '\')"><i class="fa fa-eye"></i> 详情</a> ');
var actionLinks = actions.join('');
return $.table.dropdownToggle(actionLinks);
}
}
],

Loading…
Cancel
Save