Browse Source

[feat] 委外加工

新增委外报价的自动生成委外报价单号后端接口
修改委外报价新增前端页面
dev
liuxiaoxu 4 months ago
parent
commit
45727f8c69
  1. 13
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java
  2. 6
      ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceQuoteService.java
  3. 16
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceQuoteServiceImpl.java
  4. 18
      ruoyi-admin/src/main/resources/templates/system/outsource_quote/add.html

13
ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java

@ -161,4 +161,17 @@ public class OutsourceQuoteController extends BaseController
{
return toAjax(outsourceQuoteService.deleteOutsourceQuoteByOutsourceQuoteIds(ids));
}
/**
* 自动生成委外报价编号
*
*/
@GetMapping("/generateOutsourceQuoteCode")
@ResponseBody
public String generateOutsourceQuoteCode(){
String result = outsourceQuoteService.generateOutsourceQuoteCode();
return result;
}
}

6
ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceQuoteService.java

@ -68,4 +68,10 @@ public interface IOutsourceQuoteService
* @param outsourceQuote 委外报价对象
*/
public void insertOutsourceQuoteChild(OutsourceQuote outsourceQuote);
/**
* 自动生成委外报价编号
* */
String generateOutsourceQuoteCode();
}

16
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceQuoteServiceImpl.java

@ -1,6 +1,8 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.OutsourceQuote;
@ -27,6 +29,9 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService
@Autowired
private OutsourceQuoteMapper outsourceQuoteMapper;
@Autowired
private RedisCache redisCache;
/**
* 查询委外报价
*
@ -149,4 +154,15 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService
}
}
}
/**
* 自动生成委外报价编号
* */
@Override
public String generateOutsourceQuoteCode() {
return redisCache.generateBillNo("WWBJ");
}
}

18
ruoyi-admin/src/main/resources/templates/system/outsource_quote/add.html

@ -12,15 +12,12 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-outsource_quote-add">
<h4 class="form-header h4">委外报价信息</h4>
<div class="row">
<div class="form-group">
<label class="col-sm-3 control-label is-required">委外报价单号:</label>
<div class="col-sm-8">
<input name="outsourceQuoteCode" readonly="readonly" class="form-control" type="text" value="
WWBJ002">
<input name="outsourceQuoteCode" readonly="readonly" class="form-control" type="text">
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商编号:</label>
<div class="col-sm-8">
@ -104,6 +101,19 @@ WWBJ002">
$.ajax(config)
};
//获取单号
$.ajax({
url: prefix + "/generateOutsourceQuoteCode",
type: "GET",
dateType: "json",
success: function (resp) {
console.log(resp)
if (resp != null) {$("input[name='outsourceQuoteCode']").val(resp);} else {$.modal.msgError("失败啦");}
}
});
function submitHandler() {
var url = prefix + "/add";
var outsourceQuote = {

Loading…
Cancel
Save