库存日志
This commit is contained in:
parent
80b7d8dec0
commit
08ad41ea1d
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.bonus.sgzb.base.api.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class HttpResult {
|
||||||
|
private int code;
|
||||||
|
private int data;
|
||||||
|
private String msg;
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ import java.util.*;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.base.api.domain.HttpResult;
|
||||||
import com.bonus.sgzb.base.api.domain.MachIneDto;
|
import com.bonus.sgzb.base.api.domain.MachIneDto;
|
||||||
import com.bonus.sgzb.base.api.domain.SavePutInfoDto;
|
import com.bonus.sgzb.base.api.domain.SavePutInfoDto;
|
||||||
import com.bonus.sgzb.common.core.constant.SecurityConstants;
|
import com.bonus.sgzb.common.core.constant.SecurityConstants;
|
||||||
|
|
@ -16,6 +17,7 @@ import com.bonus.sgzb.system.api.RemoteUserService;
|
||||||
import com.bonus.sgzb.system.api.domain.BmNumLogs;
|
import com.bonus.sgzb.system.api.domain.BmNumLogs;
|
||||||
import com.bonus.sgzb.system.api.domain.BmStorageLog;
|
import com.bonus.sgzb.system.api.domain.BmStorageLog;
|
||||||
import com.bonus.sgzb.system.api.model.LoginUser;
|
import com.bonus.sgzb.system.api.model.LoginUser;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.aspectj.lang.JoinPoint;
|
import org.aspectj.lang.JoinPoint;
|
||||||
|
|
@ -62,6 +64,8 @@ public class LogAspect
|
||||||
@Autowired
|
@Autowired
|
||||||
private RemoteUserService remoteUserService;
|
private RemoteUserService remoteUserService;
|
||||||
|
|
||||||
|
private static ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理请求前执行
|
* 处理请求前执行
|
||||||
*/
|
*/
|
||||||
|
|
@ -180,6 +184,10 @@ public class LogAspect
|
||||||
|
|
||||||
if (StringUtils.isNotNull(jsonResult)) {
|
if (StringUtils.isNotNull(jsonResult)) {
|
||||||
bmStorageLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000));
|
bmStorageLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000));
|
||||||
|
HttpResult msgCode = objectMapper.readValue(bmStorageLog.getJsonResult(), HttpResult.class);
|
||||||
|
bmStorageLog.setResultCode(msgCode.getCode());
|
||||||
|
bmStorageLog.setStatus(msgCode.getCode()==200 ? 0 : 1);
|
||||||
|
bmStorageLog.setResultMsg(msgCode.getMsg());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -274,9 +282,12 @@ public class LogAspect
|
||||||
if (StringUtils.isEmpty(paramsMap) && (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod))) {
|
if (StringUtils.isEmpty(paramsMap) && (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod))) {
|
||||||
if (joinPoint.getArgs()[0] instanceof SavePutInfoDto) {
|
if (joinPoint.getArgs()[0] instanceof SavePutInfoDto) {
|
||||||
SavePutInfoDto savePutInfoDto = (SavePutInfoDto) joinPoint.getArgs()[0];
|
SavePutInfoDto savePutInfoDto = (SavePutInfoDto) joinPoint.getArgs()[0];
|
||||||
for (MachIneDto machIneDto : savePutInfoDto.getMachIneDtoList()) {
|
for (MachIneDto machineDto : savePutInfoDto.getMachIneDtoList()) {
|
||||||
BmStorageLog bmStorageLog = new BmStorageLog();
|
BmStorageLog bmStorageLog = new BmStorageLog();
|
||||||
bmStorageLog.setInNum(machIneDto.getNum().intValue());
|
bmStorageLog.setTypeId(Integer.parseInt(machineDto.getTypeId()));
|
||||||
|
bmStorageLog.setTypeName(machineDto.getMaCode());
|
||||||
|
bmStorageLog.setPreStoreNum(machineDto.getNum().intValue());
|
||||||
|
bmStorageLog.setInNum(machineDto.getPutInStoreNum().intValue());
|
||||||
bmStorageLogList.add(bmStorageLog);
|
bmStorageLogList.add(bmStorageLog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,15 +12,17 @@
|
||||||
<result column="type_id" jdbcType="INTEGER" property="typeId" />
|
<result column="type_id" jdbcType="INTEGER" property="typeId" />
|
||||||
<result column="type_name" jdbcType="VARCHAR" property="typeName" />
|
<result column="type_name" jdbcType="VARCHAR" property="typeName" />
|
||||||
<result column="type_parent_name" jdbcType="VARCHAR" property="typeParentName" />
|
<result column="type_parent_name" jdbcType="VARCHAR" property="typeParentName" />
|
||||||
<result column="pre_store_num" jdbcType="VARCHAR" property="preStoreNum" />
|
<result column="pre_store_num" jdbcType="INTEGER" property="preStoreNum" />
|
||||||
<result column="in_num" jdbcType="VARCHAR" property="inNum" />
|
<result column="in_num" jdbcType="INTEGER" property="inNum" />
|
||||||
<result column="out_num" jdbcType="VARCHAR" property="outNum" />
|
<result column="out_num" jdbcType="INTEGER" property="outNum" />
|
||||||
<result column="back_num" jdbcType="VARCHAR" property="backNum" />
|
<result column="back_num" jdbcType="INTEGER" property="backNum" />
|
||||||
<result column="pass_num" jdbcType="VARCHAR" property="passNum" />
|
<result column="pass_num" jdbcType="INTEGER" property="passNum" />
|
||||||
<result column="maintenance_num" jdbcType="VARCHAR" property="maintenanceNum" />
|
<result column="maintenance_num" jdbcType="INTEGER" property="maintenanceNum" />
|
||||||
<result column="scrap_num" jdbcType="VARCHAR" property="scrapNum" />
|
<result column="scrap_num" jdbcType="INTEGER" property="scrapNum" />
|
||||||
<result column="post_store_num" jdbcType="VARCHAR" property="postStoreNum" />
|
<result column="post_store_num" jdbcType="INTEGER" property="postStoreNum" />
|
||||||
<result column="json_result" jdbcType="VARCHAR" property="jsonResult" />
|
<result column="json_result" jdbcType="VARCHAR" property="jsonResult" />
|
||||||
|
<result column="result_code" jdbcType="INTEGER" property="resultCode" />
|
||||||
|
<result column="result_msg" jdbcType="VARCHAR" property="resultMsg" />
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
<result column="creator" jdbcType="VARCHAR" property="creator" />
|
<result column="creator" jdbcType="VARCHAR" property="creator" />
|
||||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||||
|
|
@ -35,28 +37,28 @@
|
||||||
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
bnl.id, bnl.model_title, bnl.`method`, bnl.task_id, bnl.type_id, bnl.pre_num, bnl.audit_num, bnl.pre_store_num, bnl.in_num, bnl.out_num,
|
bsl.id, bsl.model_title, bsl.`method`, bsl.task_id, bsl.type_id, bsl.pre_store_num, bsl.in_num, bsl.out_num,bsl.post_store_num,bsl.result_code,bsl.result_msg,
|
||||||
bnl.back_num, bnl.pass_num, bnl.maintenance_num, bnl.scrap_num, bnl.`description`, bnl.json_result, bnl.create_time, bnl.creator, bnl.manage_type,
|
bsl.back_num, bsl.pass_num, bsl.maintenance_num, bsl.scrap_num, bsl.json_result, bsl.create_time, bsl.creator, bsl.manage_type,
|
||||||
bnl.remark, bnl.`status`, mt.type_name, mt1.type_name as type_parent_name, tt.code as task_name, bnl.post_store_num
|
bsl.remark, bsl.`status`, mt.type_name, mt1.type_name as type_parent_name, tt.code as task_name
|
||||||
from bm_storage_log bnl
|
from bm_storage_log bsl
|
||||||
left join ma_type mt on bnl.type_id = mt.type_id
|
left join ma_type mt on bsl.type_id = mt.type_id
|
||||||
inner join ma_type mt1 on mt.parent_id = mt1.type_id
|
inner join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||||
left join tm_task tt on bnl.task_id = tt.task_id
|
left join tm_task tt on bsl.task_id = tt.task_id
|
||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAll" resultMap="BaseResultMap">
|
<select id="selectAll" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
bnl.id, bnl.model_title, bnl.`method`, bnl.task_id, bnl.type_id, bnl.pre_num, bnl.audit_num, bnl.pre_store_num, bnl.in_num, bnl.out_num,
|
bsl.id, bsl.model_title, bsl.`method`, bsl.task_id, bsl.type_id, bsl.pre_store_num, bsl.in_num, bsl.out_num,bsl.post_store_num,bsl.result_code,bsl.result_msg,
|
||||||
bnl.back_num, bnl.pass_num, bnl.maintenance_num, bnl.scrap_num, bnl.`description`, bnl.json_result, bnl.create_time, bnl.creator, bnl.manage_type,
|
bsl.back_num, bsl.pass_num, bsl.maintenance_num, bsl.scrap_num, bsl.json_result, bsl.create_time, bsl.creator, bsl.manage_type,
|
||||||
bnl.remark, bnl.`status`, mt.type_name, mt1.type_name as type_parent_name, tt.code as task_name, bnl.post_store_num
|
bsl.remark, bsl.`status`, mt.type_name, mt1.type_name as type_parent_name, tt.code as task_name
|
||||||
from bm_storage_log bnl
|
from bm_storage_log bsl
|
||||||
left join ma_type mt on bnl.type_id = mt.type_id
|
left join ma_type mt on bsl.type_id = mt.type_id
|
||||||
inner join ma_type mt1 on mt.parent_id = mt1.type_id
|
inner join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||||
left join tm_task tt on bnl.task_id = tt.task_id
|
left join tm_task tt on bsl.task_id = tt.task_id
|
||||||
<where>
|
<where>
|
||||||
<if test="modelTitle != null and modelTitle != ''">
|
<if test="modelTitle != null and modelTitle != ''">
|
||||||
and bnl.model_title like concat('%', #{modelTitle}, '%')
|
and bsl.model_title like concat('%', #{modelTitle}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="typeName != null and typeName != ''">
|
<if test="typeName != null and typeName != ''">
|
||||||
and mt1.type_name like concat('%', #{typeName}, '%')
|
and mt1.type_name like concat('%', #{typeName}, '%')
|
||||||
|
|
@ -92,7 +94,7 @@
|
||||||
create_time, creator, remark, out_num, manage_type,
|
create_time, creator, remark, out_num, manage_type,
|
||||||
type_name, type_model_name, pre_store_num, in_num,
|
type_name, type_model_name, pre_store_num, in_num,
|
||||||
back_num, pass_num, maintenance_num,
|
back_num, pass_num, maintenance_num,
|
||||||
scrap_num, `status`, post_store_num
|
scrap_num, `status`, post_store_num, result_code, result_msg, json_result
|
||||||
) values
|
) values
|
||||||
<foreach item="item" index="index" collection="list" separator=",">
|
<foreach item="item" index="index" collection="list" separator=",">
|
||||||
(
|
(
|
||||||
|
|
@ -100,7 +102,8 @@
|
||||||
now(), #{item.creator,jdbcType=VARCHAR}, #{item.remark,jdbcType=VARCHAR}, #{item.outNum,jdbcType=INTEGER}, #{item.manageType,jdbcType=VARCHAR},
|
now(), #{item.creator,jdbcType=VARCHAR}, #{item.remark,jdbcType=VARCHAR}, #{item.outNum,jdbcType=INTEGER}, #{item.manageType,jdbcType=VARCHAR},
|
||||||
#{item.typeName,jdbcType=VARCHAR}, #{item.typeModelName,jdbcType=VARCHAR}, #{item.preStoreNum,jdbcType=INTEGER}, #{item.inNum,jdbcType=INTEGER},
|
#{item.typeName,jdbcType=VARCHAR}, #{item.typeModelName,jdbcType=VARCHAR}, #{item.preStoreNum,jdbcType=INTEGER}, #{item.inNum,jdbcType=INTEGER},
|
||||||
#{item.backNum,jdbcType=INTEGER}, #{item.passNum,jdbcType=INTEGER}, #{item.maintenanceNum,jdbcType=INTEGER},
|
#{item.backNum,jdbcType=INTEGER}, #{item.passNum,jdbcType=INTEGER}, #{item.maintenanceNum,jdbcType=INTEGER},
|
||||||
#{item.scrapNum,jdbcType=INTEGER}, #{item.status,jdbcType=VARCHAR}, #{item.postStoreNum,jdbcType=INTEGER}
|
#{item.scrapNum,jdbcType=INTEGER}, #{item.status,jdbcType=VARCHAR}, #{item.postStoreNum,jdbcType=INTEGER},
|
||||||
|
#{item.resultCode,jdbcType=INTEGER}, #{item.resultMsg,jdbcType=VARCHAR}, #{item.jsonResult,jdbcType=VARCHAR}
|
||||||
)
|
)
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,14 @@ import request from '@/utils/request'
|
||||||
|
|
||||||
/* 日志列表 */
|
/* 日志列表 */
|
||||||
export const getLogsListApi = (params) => {
|
export const getLogsListApi = (params) => {
|
||||||
return request.get('/system/bm_num_logs/list', {
|
return request.get('/system/bm_storage_logs/list', {
|
||||||
params:params
|
params:params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 日志详情 */
|
/* 日志详情 */
|
||||||
export const getLogsDetailsApi = (id) => {
|
export const getLogsDetailsApi = (id) => {
|
||||||
return request.get(`/system/bm_num_logs/selectByPrimaryKey`, {
|
return request.get(`/system/bm_storage_logs/selectByPrimaryKey`, {
|
||||||
params: {
|
params: {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
<el-table-column align="center" prop="modelTitle" label="模块名称" show-overflow-tooltip />
|
<el-table-column align="center" prop="modelTitle" label="模块名称" show-overflow-tooltip />
|
||||||
<!-- <el-table-column show-overflow-tooltip align="center" prop="method" label="请求方式" />-->
|
<!-- <el-table-column show-overflow-tooltip align="center" prop="method" label="请求方式" />-->
|
||||||
<!-- <el-table-column show-overflow-tooltip align="center" prop="method" label="请求地址" />-->
|
<!-- <el-table-column show-overflow-tooltip align="center" prop="method" label="请求地址" />-->
|
||||||
<el-table-column show-overflow-tooltip align="center" prop="taskId" label="任务ID" />
|
<!-- <el-table-column show-overflow-tooltip align="center" prop="taskId" label="任务ID" />-->
|
||||||
<el-table-column show-overflow-tooltip align="center" prop="typeParentName" label="机具类型" />
|
<el-table-column show-overflow-tooltip align="center" prop="typeParentName" label="机具类型" />
|
||||||
<el-table-column show-overflow-tooltip align="center" prop="typeName" label="机具规格" />
|
<el-table-column show-overflow-tooltip align="center" prop="typeName" label="机具规格" />
|
||||||
<el-table-column show-overflow-tooltip align="center" prop="preStoreNum" label="操作前库存" />
|
<el-table-column show-overflow-tooltip align="center" prop="preStoreNum" label="操作前库存" />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue