refactor(ma): 优化机具类型树查询并添加直接报废功能
- 修改登录页面和系统标题为"贵送机具管理系统" - 优化机具类型树查询逻辑,提高查询效率 - 添加在库机具直接报废功能 - 更新机具类型树查询 SQL,支持多级分类和模糊查询
This commit is contained in:
parent
de6e56f059
commit
ef7c37b79f
|
|
@ -220,7 +220,7 @@
|
||||||
function topage(id,processName) {
|
function topage(id,processName) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "post",
|
type: "post",
|
||||||
url: "http://127.0.0.1:21522/gz-car/login/userLogin",
|
url: "http://10.1.0.142:1999/gz_car/login/userLogin",
|
||||||
data: {
|
data: {
|
||||||
username: uname,
|
username: uname,
|
||||||
password: pwd
|
password: pwd
|
||||||
|
|
@ -232,10 +232,10 @@
|
||||||
localStorage.setItem("name", name);
|
localStorage.setItem("name", name);
|
||||||
//window.open("http://192.168.0.14:21625/gz-gqj/index.html")
|
//window.open("http://192.168.0.14:21625/gz-gqj/index.html")
|
||||||
if(processName === '派车计划'){
|
if(processName === '派车计划'){
|
||||||
window.open("http://localhost:63343/gz_car_ui/page/car_demand_plan/child/dispatch_car_detail.html?id="+id +"&token="+data.token)
|
window.open("http://10.1.0.142:1999/gz-car/page/car_demand_plan/child/dispatch_car_detail.html?id="+id +"&token="+data.token)
|
||||||
|
|
||||||
}else if(processName === '用车计划'){
|
}else if(processName === '用车计划'){
|
||||||
window.open("http://localhost:63343/gz_car_ui/page/car_demand_plan/child/apply_plan_detail.html?id="+id +"&token="+data.token)
|
window.open("http://10.1.0.142:1999/gz-car/page/car_demand_plan/child/apply_plan_detail.html?id="+id +"&token="+data.token)
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<%@ page contentType="text/html;charset=UTF-8" %>
|
<%@ page contentType="text/html;charset=UTF-8" %>
|
||||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
<title>黔送固定资产管理系统</title>
|
<title>贵送机具管理系统</title>
|
||||||
|
|
||||||
<c:set var="bonuspath" value="${pageContext.request.contextPath}"/>
|
<c:set var="bonuspath" value="${pageContext.request.contextPath}"/>
|
||||||
<script>
|
<script>
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ body{color:#fff; font-family:"微软雅黑"; font-size:14px; width: 100%; heigh
|
||||||
|
|
||||||
|
|
||||||
<div class="container wrap1" style="width:500px; height:450px; ">
|
<div class="container wrap1" style="width:500px; height:450px; ">
|
||||||
<div style=" height: 80px; background-color: #002636; border-radius: 15px "><p class=" text-center font16" style="top:30px; color:#258CC3; ">黔送固定资产管理系统</p></div>
|
<div style=" height: 80px; background-color: #002636; border-radius: 15px "><p class=" text-center font16" style="top:30px; color:#258CC3; ">贵送机具管理系统</p></div>
|
||||||
<div class="mg-t30" style="height:350px; background-color: #053F68; border-radius: 15px; " >
|
<div class="mg-t30" style="height:350px; background-color: #053F68; border-radius: 15px; " >
|
||||||
<form action="" onsubmit="return false">
|
<form action="" onsubmit="return false">
|
||||||
<div class="form-group " style="text-align: center;">
|
<div class="form-group " style="text-align: center;">
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
<a href="#" class="navbar-brand">
|
<a href="#" class="navbar-brand">
|
||||||
<small>
|
<small>
|
||||||
<i class="icon-leaf"></i>
|
<i class="icon-leaf"></i>
|
||||||
黔送固定资产管理系统
|
贵送机具管理系统
|
||||||
</small>
|
</small>
|
||||||
</a><!-- /.brand -->
|
</a><!-- /.brand -->
|
||||||
</div><!-- /.navbar-header -->
|
</div><!-- /.navbar-header -->
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,7 @@
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
UNION
|
UNION
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
mtc.ID,
|
mtc.ID,
|
||||||
mtc.PARENT_ID AS pId,
|
mtc.PARENT_ID AS pId,
|
||||||
|
|
@ -138,10 +139,9 @@
|
||||||
|
|
||||||
<if test=" param.typeName != null and param.typeName != ''">
|
<if test=" param.typeName != null and param.typeName != ''">
|
||||||
and mtc.PARENT_ID in (
|
and mtc.PARENT_ID in (
|
||||||
SELECT id FROM mm_type mtb WHERE
|
SELECT id FROM mm_type mtb
|
||||||
mtb.`LEVEL` = 2 AND mtb.PARENT_ID in (SELECT id FROM mm_type mta
|
WHERE mtb.`LEVEL` = 2 AND mtb.PARENT_ID in (SELECT id FROM mm_type mta
|
||||||
WHERE mta.`LEVEL` = 1 and mta.`NAME` LIKE CONCAT(
|
WHERE mta.`LEVEL` = 1 and mta.`NAME` LIKE CONCAT('%',#{param.typeName},'%' ))
|
||||||
'%',#{param.typeName},'%' ))
|
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|
@ -1192,4 +1192,105 @@
|
||||||
DROP TEMPORARY TABLE IF EXISTS temp_type_final;
|
DROP TEMPORARY TABLE IF EXISTS temp_type_final;
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="maTypeTreeVersion" resultMap="ZNode">
|
||||||
|
SELECT *
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
mta.ID,
|
||||||
|
mta.PARENT_ID AS pId,
|
||||||
|
CONCAT( mta.`NAME`, '
|
||||||
|
', CASE mta.`IS_LABEL` WHEN '1' THEN '(自有)' WHEN '2'
|
||||||
|
THEN '(外租)' ELSE
|
||||||
|
'' END ) AS `name`,
|
||||||
|
|
||||||
|
mta.`LEVEL` AS sx,
|
||||||
|
mta.SORT_NUM,
|
||||||
|
IFNULL(mor.ORG_ID,'11') as ORG_ID,
|
||||||
|
mta.IS_COUNT AS isCount
|
||||||
|
FROM
|
||||||
|
mm_type
|
||||||
|
mta
|
||||||
|
LEFT JOIN mm_type mtb on mtb.PARENT_ID = mta.ID
|
||||||
|
LEFT JOIN mm_type
|
||||||
|
mtc on mtc.PARENT_ID = mtb.ID
|
||||||
|
LEFT JOIN mm_type mtd on mtd.PARENT_ID =
|
||||||
|
mtc.ID
|
||||||
|
LEFT JOIN ma_org_relation mor ON mor.TYPE_ID = mtd.ID
|
||||||
|
WHERE
|
||||||
|
mta.`LEVEL` = 1
|
||||||
|
AND mta.PARENT_ID = 0
|
||||||
|
GROUP BY mta.ID
|
||||||
|
|
||||||
|
UNION
|
||||||
|
SELECT
|
||||||
|
mtb.ID,
|
||||||
|
mtb.PARENT_ID AS pId,
|
||||||
|
CONCAT(
|
||||||
|
mtb.`NAME`, ' ', CASE mtb.`IS_LABEL` WHEN '1' THEN '(自有)' WHEN '2'
|
||||||
|
THEN '(外租)' ELSE '' END ) AS `name`,
|
||||||
|
|
||||||
|
mtb.`LEVEL` AS sx,
|
||||||
|
mtb.SORT_NUM,
|
||||||
|
IFNULL(mor.ORG_ID,'11') as ORG_ID,
|
||||||
|
mtb.IS_COUNT AS isCount
|
||||||
|
FROM
|
||||||
|
mm_type
|
||||||
|
mtb
|
||||||
|
LEFT JOIN mm_type mtc on mtc.PARENT_ID = mtb.ID
|
||||||
|
LEFT JOIN mm_type
|
||||||
|
mtd on mtd.PARENT_ID = mtc.ID
|
||||||
|
LEFT JOIN ma_org_relation mor ON
|
||||||
|
mor.TYPE_ID = mtd.ID
|
||||||
|
|
||||||
|
WHERE
|
||||||
|
mtb.`LEVEL` = 2
|
||||||
|
|
||||||
|
AND mtb.IS_ACTIVE = 1
|
||||||
|
<if test=" param.name != null and param.name != ''">
|
||||||
|
and mtb.`NAME` LIKE CONCAT('%',#{param.name},'%')
|
||||||
|
and mtb.PARENT_ID in (
|
||||||
|
SELECT id FROM mm_type mta
|
||||||
|
WHERE
|
||||||
|
mta.`NAME` LIKE CONCAT('%',#{param.name},'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
|
||||||
|
UNION
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
mtc.ID,
|
||||||
|
mtc.PARENT_ID AS pId,
|
||||||
|
CONCAT( mtc.`NAME`, ' ', CASE
|
||||||
|
mtc.`IS_LABEL` WHEN '1' THEN '(自有)' WHEN '2'
|
||||||
|
THEN '(外租)' ELSE '' END )
|
||||||
|
AS `name`,
|
||||||
|
|
||||||
|
mtc.`LEVEL` AS sx,
|
||||||
|
mtc.SORT_NUM,
|
||||||
|
IFNULL(mor.ORG_ID,'11') as
|
||||||
|
ORG_ID,
|
||||||
|
mtc.IS_COUNT AS isCount
|
||||||
|
FROM
|
||||||
|
mm_type mtc
|
||||||
|
LEFT JOIN mm_type mtd on
|
||||||
|
mtd.PARENT_ID = mtc.ID
|
||||||
|
LEFT JOIN ma_org_relation mor ON mor.TYPE_ID =
|
||||||
|
mtd.ID
|
||||||
|
WHERE
|
||||||
|
mtc.`LEVEL` = 3
|
||||||
|
AND mtc.IS_ACTIVE = 1
|
||||||
|
<if test=" param.name != null and param.name != ''">
|
||||||
|
and (mtc.`NAME` LIKE CONCAT('%',#{param.name},'%') or
|
||||||
|
mtc.PARENT_ID in (
|
||||||
|
SELECT id FROM mm_type mtb
|
||||||
|
WHERE mtb.`LEVEL` = 2 AND mtb.PARENT_ID in (SELECT id FROM mm_type mta
|
||||||
|
WHERE mta.`LEVEL` = 1 and mta.`NAME` LIKE CONCAT('%',#{param.name},'%' ))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
|
||||||
|
) a
|
||||||
|
ORDER BY a.SORT_NUM
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -260,6 +260,30 @@ public class MachineController extends BaseController<MachineBean> {
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在库直接报废机具
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "scrapping", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxRes scrapping(MachineBean o) {
|
||||||
|
AjaxRes ar = getAjaxRes();
|
||||||
|
if (o == null || o.getId() == null) {
|
||||||
|
ar.setFailMsg("请选择机具");
|
||||||
|
return ar;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
MachineBean neo = new MachineBean();
|
||||||
|
neo.setId(o.getId());
|
||||||
|
neo.setBatchStatus("12");
|
||||||
|
service.update(neo);
|
||||||
|
ar.setSucceedMsg("报废成功");
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.toString(), e);
|
||||||
|
ar.setFailMsg(GlobalConst.UPDATE_FAIL);
|
||||||
|
}
|
||||||
|
return ar;
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping("exportModelExcel")
|
@RequestMapping("exportModelExcel")
|
||||||
public void exportModelExcel(HttpServletRequest request, HttpServletResponse response, MachineBean o) {
|
public void exportModelExcel(HttpServletRequest request, HttpServletResponse response, MachineBean o) {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,8 @@ public interface MachineTypeDao extends BaseDao<MachineTypeBean> {
|
||||||
|
|
||||||
List<ZNode> maTypeTree(@Param("param") MachineTypeBean o);
|
List<ZNode> maTypeTree(@Param("param") MachineTypeBean o);
|
||||||
|
|
||||||
|
List<ZNode> maTypeTreeVersion(@Param("param") MachineTypeBean o);
|
||||||
|
|
||||||
// syruan 优化maTypeTree查询
|
// syruan 优化maTypeTree查询
|
||||||
List<ZNode> maTypeTreeCope(@Param("param") MachineTypeBean o);
|
List<ZNode> maTypeTreeCope(@Param("param") MachineTypeBean o);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import java.util.List;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
@ -101,6 +102,9 @@ public class MachineTypeServiceImp extends BaseServiceImp<MachineTypeBean> imple
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ZNode> maTypeTree(MachineTypeBean o) {
|
public List<ZNode> maTypeTree(MachineTypeBean o) {
|
||||||
|
if (StrUtil.isEmpty(o.getTypeName()) && StrUtil.isEmpty(o.getModel())) {
|
||||||
|
return dao.maTypeTreeVersion(o);
|
||||||
|
}
|
||||||
return dao.maTypeTree(o);
|
return dao.maTypeTree(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,7 @@ import com.bonus.wf.beans.TaskRecordBean;
|
||||||
import com.bonus.wf.dao.TaskRecordDao;
|
import com.bonus.wf.dao.TaskRecordDao;
|
||||||
|
|
||||||
@Service("repairCheck")
|
@Service("repairCheck")
|
||||||
public class RepairCheckDetailsServiceImp extends BaseServiceImp<RepairCheckDetailsBean>
|
public class RepairCheckDetailsServiceImp extends BaseServiceImp<RepairCheckDetailsBean> implements RepairCheckDetailsService {
|
||||||
implements RepairCheckDetailsService {
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
UserDao uDao;
|
UserDao uDao;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue