问题优化

This commit is contained in:
hayu 2025-07-10 18:54:12 +08:00
parent 06eeeb01c7
commit f4bd00b4fb
8 changed files with 81 additions and 11 deletions

View File

@ -51,17 +51,22 @@
<table id="baseTable" class="table table-striped table-bordered table-hover" >
<thead>
<tr>
<th style="width:5%" class="center">
<th style="width:3%" class="center">
选择<!-- <label><input type="checkbox" class="ace" ><span class="lbl"></span></label> -->
</th>
<th style="width:5%" class="center hidden-480">序号</th>
<th style="width:3%" class="center hidden-480">序号</th>
<th style="width:6%" class="center">机具类型</th>
<th style="width:6%" class="center">机具规格</th>
<th style="width:6%" class="center">机具数量</th>
<th style="width:6%" class="center">报废人</th>
<th style="width:6%" class="center">检验人</th>
<th style="width:11%" class="center">申请时间</th>
<th style="width:10%" class="center">操作</th>
<th style="width:4%" class="center">机具数量</th>
<th style="width:6%" class="center">报废来源</th>
<th style="width:5%" class="center">报废人</th>
<th style="width:5%" class="center">检验人</th>
<th style="width:5%" class="center">指派人</th>
<th style="width:6%" class="center">指派时间</th>
<th style="width:6%" class="center">申请时间</th>
<th style="width:6%" class="center">完成时间</th>
<th style="width:5%" class="center">完成状态</th>
<th style="width:6%" class="center">操作</th>
</tr>
</thead>
<tbody></tbody>

View File

@ -79,6 +79,7 @@ function getbaseList(init) {
html += "<td style='vertical-align:middle;' class='center'>"+ JY.Object.notEmpty(l.typeName) + "</td>";
html += "<td style='vertical-align:middle;' class='center'>"+ JY.Object.notEmpty(l.modelName) + "</td>";
html += "<td style='vertical-align:middle;' class='center'>"+ JY.Object.notEmpty(l.scrapNum) + "</td>";
html += "<td style='vertical-align:middle;' class='center'>"+ JY.Object.notEmpty(l.source) + "</td>";
if(l.scrapPerson == "" || l.scrapPerson == null){
l.scrapPerson = "尚未指派";
html += "<td style='vertical-align:middle;cursor:pointer;' class='center hidden-480'><a href='#' onclick='user("+ l.id +")'>" + l.scrapPerson + "</a></td>";
@ -93,7 +94,11 @@ function getbaseList(init) {
}
html += "<td style='vertical-align:middle;' class='center'>"+ JY.Object.notEmpty(l.scrapChecker) + "</td>";
html += "<td style='vertical-align:middle;' class='center'>"+ JY.Object.notEmpty(l.assigner) + "</td>";
html += "<td style='vertical-align:middle;' class='center'>"+ JY.Object.notEmpty(l.specifyTime) + "</td>";
html += "<td style='vertical-align:middle;' class='center'>"+ JY.Object.notEmpty(l.operationTime) + "</td>";
html += "<td style='vertical-align:middle;' class='center'>" + (l.isSure === "1" ? JY.Object.notEmpty(l.scrapTime) : "") + "</td>";
html += "<td style='vertical-align:middle;' class='center'>" + (l.isSure === "1" ? "已完成" : "未完成") + "</td>";
html += rowFunction(l.scrapPersonId,l.id,l.isActive);
html += "</tr>";
}

View File

@ -115,7 +115,9 @@
(sum( IFNULL(ROUND(wrc.ALCHECK_NUM),0) ) + sum( IFNULL(ROUND(wrc.ALSCRAP_NUM),0))) AS checkNum,
mt.IS_COUNT AS isCount,
GROUP_CONCAT(DISTINCT wrc.REPAIR_ID) as repairIds
GROUP_CONCAT(DISTINCT wrc.REPAIR_ID) as repairIds,
MAX(wrc.CHECK_TIME) AS checkTime,
MAX(wrc.OPERATION_TIME) AS repairTime
FROM
wf_repair_check wrc
LEFT JOIN mm_type mt ON mt.ID = wrc.MODEL_ID
@ -133,6 +135,10 @@
GROUP BY wrc.MODEL_ID
)a
WHERE a.checkNum > 0
<if test="startTime != null and startTime != ''">
AND LEFT(a.checkTime,10) BETWEEN #{startTime} and #{endTime}
</if>
ORDER BY a.checkTime desc
</select>

View File

@ -81,6 +81,9 @@
WHERE wtr.IS_ACTIVE = 1 AND wtr.PROCESS_ID = 3 AND wtr.DEFINITION_ID = 8
AND wtr.IS_FINISH = #{isFinish}
AND wtr.CHECKER_ID = #{checkerId}
<if test="startTime != null and startTime != ''">
AND LEFT(wtr.OPERATION_TIME,10) BETWEEN #{startTime} and #{endTime}
</if>
ORDER BY wtr.OPERATION_TIME DESC
</select>

View File

@ -6,12 +6,18 @@
<select id="findByPage" parameterType="com.bonus.scrap.beans.ScrapDetailsBean" resultMap="scrap">
SELECT wsd.ID as id,wsd.is_active as isActive,ROUND(wsd.SCRAP_NUM) AS scrapNum,mt.`NAME` AS modelName,wsd.SCRAP_TIME AS scrapTime,
mtt.`NAME` AS typeName,pu.`NAME` AS scrapChecker,wsd.SCRAP_PERSON as scrapPersonId,puu.`NAME` AS scrapPerson,
wsd.OPERATION_TIME as operationTime
wsd.OPERATION_TIME as operationTime,wsd.SPECIFY_TIME as specifyTime,pu3.`NAME` AS assigner,
wsd.IS_SURE as isSure,
wtd.`NAME` as source
FROM wf_scrap_details wsd
LEFT JOIN mm_type mt ON mt.ID = wsd.MODEL_ID
LEFT JOIN mm_type mtt ON mtt.ID = mt.PARENT_ID
LEFT JOIN pm_user pu ON pu.ID = wsd.SCRAP_CHECKER
LEFT JOIN pm_user puu ON puu.ID = wsd.SCRAP_PERSON
LEFT JOIN pm_user pu3 ON pu3.ID = wsd.ASSIGNER
LEFT JOIN wf_task_record wtr on wtr.ID=wsd.TASK_ID
LEFT JOIN wf_task_record wtr2 on wtr.SUP_ID=wtr2.ID
LEFT JOIN wf_task_definition wtd on wtd.ID=wtr2.DEFINITION_ID
WHERE left(wsd.OPERATION_TIME,10) BETWEEN #{param.startTime} and #{param.endTime}
<if test="param.keyWord != null and param.keyWord !='' ">
AND(
@ -24,7 +30,7 @@
</select>
<update id="update" parameterType="com.bonus.scrap.beans.ScrapDetailsBean" >
update wf_scrap_details set SCRAP_PERSON = #{scrapPerson}, SCRAP_CHECKER = #{scrapPerson}
update wf_scrap_details set SCRAP_PERSON = #{scrapPerson}, SCRAP_CHECKER = #{scrapPerson},SPECIFY_TIME=NOW(),ASSIGNER=#{userId}
where ID = #{id}
</update>
@ -281,6 +287,7 @@
SUM(wsd.SCRAP_NUM) as scrap,
SUM(wsd.ALSCRAP_NUM) as alScrapNum ,
mt.IS_COUNT as isCount,
wsd.SCRAP_TIME as scrapTime,
0 as isFinish
FROM
wf_scrap_details wsd
@ -296,6 +303,7 @@
</if>
GROUP BY wsd.MODEL_ID
HAVING alScrapNum > 0
ORDER BY wsd.SCRAP_TIME DESC
</select>

View File

@ -54,6 +54,20 @@ public class ScrapDetailsBean {
private ScrapDetailsBean[] arr;
private float paraNum;
/**
* 指派时间
*/
private String specifyTime;
/**
* 指派人
*/
private String assigner;
/**
* 来源
*/
private String source;
public String getUserId() {
return userId;
@ -423,4 +437,28 @@ public class ScrapDetailsBean {
this.paraNum = paraNum;
}
public String getSpecifyTime() {
return specifyTime;
}
public void setSpecifyTime(String specifyTime) {
this.specifyTime = specifyTime;
}
public String getAssigner() {
return assigner;
}
public void setAssignere(String assigner) {
this.assigner = assigner;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
}

View File

@ -16,6 +16,8 @@ import com.bonus.sys.AjaxRes;
import com.bonus.sys.BaseController;
import com.bonus.sys.GlobalConst;
import com.bonus.sys.Page;
import com.bonus.sys.UserShiroHelper;
import com.bonus.sys.beans.UserBean;
import com.sun.java_cup.internal.runtime.virtual_parse_stack;
@Controller
@ -51,6 +53,9 @@ public class ScrapDetailsController extends BaseController<ScrapDetailsBean> {
public AjaxRes update(ScrapDetailsBean o) {
AjaxRes ar = getAjaxRes();
try {
UserBean user = UserShiroHelper.getRealCurrentUser();
int userId = user.getId();
o.setUserId(userId+"");
service.update(o);
ar.setSucceedMsg(GlobalConst.SAVE_SUCCEED);
} catch (Exception e) {

View File

@ -267,7 +267,7 @@ public class ScrapDetailsServiceImp extends BaseServiceImp<ScrapDetailsBean> imp
// 修改维修报废数据 scrap_num + paraScrapNum, is_sure = 1
mtBean.setThisScrapNum(paraScrapNum);
mtBean.setIsSure("1");
mtBean.setScrapTime(DateTimeHelper.getNowDate());
mtBean.setScrapTime(DateTimeHelper.getNowTime());
res = dao.updateScrapDetails(mtBean);
if (res == 0) {