Browse Source

[update]技术绩效:添加生成技术绩效ID的方法,并在添加时放入添加页面中,技术绩效字段ID改为String类型

dev
zhangsiqi 7 months ago
parent
commit
437ea0e1b9
  1. 10
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/ErpTechniqueMeritsController.java
  2. 6
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/ErpTechniqueMerits.java
  3. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/service/IErpTechniqueMeritsService.java
  4. 9
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/ErpTechniqueMeritsServiceImpl.java
  5. 2
      ruoyi-admin/src/main/resources/mapper/system/ErpTechniqueMeritsMapper.xml
  6. 9
      ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html
  7. 28
      ruoyi-admin/src/main/resources/templates/system/technicalMerits/add.html
  8. 4
      ruoyi-admin/src/main/resources/templates/system/technicalMerits/detail.html
  9. 4
      ruoyi-admin/src/main/resources/templates/system/technicalMerits/edit.html
  10. 4
      ruoyi-admin/src/main/resources/templates/system/technicalMerits/technicalMerits.html

10
ruoyi-admin/src/main/java/com/ruoyi/system/controller/ErpTechniqueMeritsController.java

@ -1,6 +1,9 @@
package com.ruoyi.system.controller; package com.ruoyi.system.controller;
import java.util.List; import java.util.List;
import com.ruoyi.ck.utils.Result;
import com.ruoyi.common.core.redis.RedisCache;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -29,7 +32,6 @@ public class ErpTechniqueMeritsController extends BaseController
@Autowired @Autowired
private IErpTechniqueMeritsService erpTechniqueMeritsService; private IErpTechniqueMeritsService erpTechniqueMeritsService;
@RequiresPermissions("system:technicalMerits:view") @RequiresPermissions("system:technicalMerits:view")
@GetMapping() @GetMapping()
public String technicalMerits() public String technicalMerits()
@ -154,4 +156,10 @@ public class ErpTechniqueMeritsController extends BaseController
{ {
return AjaxResult.success(erpTechniqueMeritsService.selectErpTechniqueMeritsById(id)); return AjaxResult.success(erpTechniqueMeritsService.selectErpTechniqueMeritsById(id));
} }
@GetMapping("/getId")
@ResponseBody
public Result getId() throws Exception {
return Result.getSuccessResult(erpTechniqueMeritsService.getId());
}
} }

6
ruoyi-admin/src/main/java/com/ruoyi/system/domain/ErpTechniqueMerits.java

@ -22,7 +22,7 @@ public class ErpTechniqueMerits extends BaseEntity
/** 技术绩效ID */ /** 技术绩效ID */
@Excel(name = "技术绩效ID") @Excel(name = "技术绩效ID")
private Long techniqueId; private String techniqueId;
/** 员工ID */ /** 员工ID */
@Excel(name = "员工ID") @Excel(name = "员工ID")
@ -68,12 +68,12 @@ public class ErpTechniqueMerits extends BaseEntity
{ {
return id; return id;
} }
public void setTechniqueId(Long techniqueId) public void setTechniqueId(String techniqueId)
{ {
this.techniqueId = techniqueId; this.techniqueId = techniqueId;
} }
public Long getTechniqueId() public String getTechniqueId()
{ {
return techniqueId; return techniqueId;
} }

2
ruoyi-admin/src/main/java/com/ruoyi/system/service/IErpTechniqueMeritsService.java

@ -72,4 +72,6 @@ public interface IErpTechniqueMeritsService
* @return * @return
*/ */
int restoreErpTechniqueMeritsById(Long id); int restoreErpTechniqueMeritsById(Long id);
public Object getId();
} }

9
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/ErpTechniqueMeritsServiceImpl.java

@ -1,6 +1,8 @@
package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
import java.util.List; import java.util.List;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -21,7 +23,8 @@ public class ErpTechniqueMeritsServiceImpl implements IErpTechniqueMeritsService
{ {
@Autowired @Autowired
private ErpTechniqueMeritsMapper erpTechniqueMeritsMapper; private ErpTechniqueMeritsMapper erpTechniqueMeritsMapper;
@Autowired
private RedisCache redisCache;
/** /**
* 查询技术绩效列表 * 查询技术绩效列表
* *
@ -123,4 +126,8 @@ public class ErpTechniqueMeritsServiceImpl implements IErpTechniqueMeritsService
{ {
return erpTechniqueMeritsMapper.restoreErpTechniqueMeritsById(id); return erpTechniqueMeritsMapper.restoreErpTechniqueMeritsById(id);
} }
@Override
public Object getId(){
return redisCache.generateNo("JSJX");
}
} }

2
ruoyi-admin/src/main/resources/mapper/system/ErpTechniqueMeritsMapper.xml

@ -5,7 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.system.mapper.ErpTechniqueMeritsMapper"> <mapper namespace="com.ruoyi.system.mapper.ErpTechniqueMeritsMapper">
<resultMap type="ErpTechniqueMerits" id="ErpTechniqueMeritsResult"> <resultMap type="ErpTechniqueMerits" id="ErpTechniqueMeritsResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="techniqueId" column="technique_id" /> <result property="techniqueId" column="technique_id" />
<result property="staffNo" column="staff_no" /> <result property="staffNo" column="staff_no" />
<result property="makeName" column="make_name" /> <result property="makeName" column="make_name" />

9
ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html

@ -23,7 +23,7 @@
<div class="form-group" shiro:hasPermission="system:customerQuote:edit"> <div class="form-group" shiro:hasPermission="system:customerQuote:edit">
<label class="col-sm-4 control-label">业务员:</label> <label class="col-sm-4 control-label">业务员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select readonly class="form-control" name="businessMembers" required th:field="*{businessMembers}"> <select class="form-control" name="businessMembers" th:field="*{businessMembers}" readonly required>
<option value="">请选择</option> <option value="">请选择</option>
</select> </select>
</div> </div>
@ -43,7 +43,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">报价币种:</label> <label class="col-sm-4 control-label">报价币种:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control" id="commonCurrency_edit" th:with="dictList=${@dict.getType('sys_common_currency')}" name="commonCurrency" required> <select class="form-control" id="commonCurrency_edit" th:field="*{commonCurrency}" th:with="dictList=${@dict.getType('sys_common_currency')}" name="commonCurrency" required>
<option value="">请选择</option> <option value="">请选择</option>
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}" ></option> <option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}" ></option>
</select> </select>
@ -68,7 +68,10 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">国内税率:</label> <label class="col-sm-4 control-label">国内税率:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="rmbTax" id="rmbTax_edit" th:field="*{rmbTax}" class="form-control" type="number" placeholder="13%" /> <div class="input-group">
<input name="rmbTax" id="rmbTax_edit" th:field="*{rmbTax}" class="form-control" placeholder="13" />
<span class="input-group-addon">%</span>
</div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">

28
ruoyi-admin/src/main/resources/templates/system/technicalMerits/add.html

@ -9,7 +9,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">技术绩效ID:</label> <label class="col-sm-3 control-label">技术绩效ID:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="techniqueId" class="form-control" type="text"> <input name="techniqueId" class="form-control" type="text" disabled>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -33,7 +33,9 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">币种:</label> <label class="col-sm-3 control-label">币种:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="currency" class="form-control" type="text"> <select name="currency" class="form-control" th:with="currency=${@dict.getType('sys_common_currency')}">
<option th:each="dict : ${currency}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -71,10 +73,24 @@
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "system/technicalMerits" var prefix = ctx + "system/technicalMerits"
$("#form-technicalMerits-add").validate({ $("#form-technicalMerits-add").validate({focusCleanup: true});
focusCleanup: true $(function (){
}); $.ajax({
url: prefix + "/getId",
type: "get",
dateType: "json",
success: function (resp) {
if (resp.code === 0) {
$("#form-technicalMerits-add input[name='techniqueId']").val(resp.data);
} else {
$.modal.msgError("失败啦");
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
});
})
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-technicalMerits-add').serialize()); $.operate.save(prefix + "/add", $('#form-technicalMerits-add').serialize());

4
ruoyi-admin/src/main/resources/templates/system/technicalMerits/detail.html

@ -34,7 +34,9 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">币种:</label> <label class="col-sm-3 control-label">币种:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="currency" th:field="*{currency}" class="form-control" type="text"> <select name="currency" class="form-control" th:with="currency=${@dict.getType('sys_common_currency')}" th:field="*{currency}">
<option th:each="dict : ${currency}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">

4
ruoyi-admin/src/main/resources/templates/system/technicalMerits/edit.html

@ -34,7 +34,9 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">币种:</label> <label class="col-sm-3 control-label">币种:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="currency" th:field="*{currency}" class="form-control" type="text"> <select name="currency" class="form-control" th:with="currency=${@dict.getType('sys_common_currency')}" th:field="*{currency}">
<option th:each="dict : ${currency}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">

4
ruoyi-admin/src/main/resources/templates/system/technicalMerits/technicalMerits.html

@ -37,7 +37,9 @@
</form> </form>
</div> </div>
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<a <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:technicalMerits:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-warning"> <a class="btn btn-warning">
<i class="fa fa-download"></i> 导入已发放绩效 <i class="fa fa-download"></i> 导入已发放绩效
</a> </a>

Loading…
Cancel
Save