numlog
This commit is contained in:
parent
c5940da435
commit
fcb3780c93
|
|
@ -173,4 +173,7 @@ public class LeaseOutDetails implements Serializable {
|
|||
@ApiModelProperty(value = "数量出库-出库数量")
|
||||
private Integer inputNum;
|
||||
|
||||
@ApiModelProperty(value = "数量出库 -> 操作前库存量")
|
||||
private Integer num;
|
||||
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@ public class BmNumLogs extends BaseEntity {
|
|||
* 实例
|
||||
*/
|
||||
@Excel(name = "实例/任务")
|
||||
private String task;
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
|
|
@ -83,12 +83,6 @@ public class BmNumLogs extends BaseEntity {
|
|||
@Excel(name = "响应内容/状态码/返回参数")
|
||||
private String jsonResult;
|
||||
|
||||
/**
|
||||
* 请求时间
|
||||
*/
|
||||
@Excel(name = "请求时间")
|
||||
private LocalDateTime time;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
|
|
@ -107,4 +101,32 @@ public class BmNumLogs extends BaseEntity {
|
|||
@Excel(name = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Excel(name = "型号")
|
||||
private String typeModelName;
|
||||
|
||||
@Excel(name = "申请数量")
|
||||
private String preNum;
|
||||
|
||||
@Excel(name = "申核数量")
|
||||
private String auditNum;
|
||||
|
||||
@Excel(name = "操作前库存")
|
||||
private String preStoreNum;
|
||||
|
||||
@Excel(name = "入库数量")
|
||||
private String inNum;
|
||||
|
||||
@Excel(name = "出库数量")
|
||||
private String outNum;
|
||||
|
||||
@Excel(name = "退库数量")
|
||||
private String backNum;
|
||||
|
||||
@Excel(name = "出库类型 0编码出库 1数量出库 2成套出库")
|
||||
private String manageType;
|
||||
|
||||
private String createBy;
|
||||
private String parentId;
|
||||
private String inputNum;
|
||||
|
||||
}
|
||||
|
|
@ -276,7 +276,7 @@ public class LogAspect
|
|||
}
|
||||
}
|
||||
if (paramsMap.containsKey("taskId")) {
|
||||
numLog.setTask(String.valueOf(paramsMap.get("taskId")));
|
||||
numLog.setTaskId(String.valueOf(paramsMap.get("taskId")));
|
||||
}
|
||||
if (paramsMap.containsKey("typeId")) {
|
||||
if (paramsMap.get("typeId") instanceof Integer) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.bonus.sgzb.system.service.impl;
|
||||
|
||||
import com.bonus.sgzb.system.mapper.BmNumLogsMapper;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -10,17 +13,41 @@ import com.bonus.sgzb.system.api.domain.BmNumLogs;
|
|||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BmNumLogsService{
|
||||
|
||||
@Autowired
|
||||
private BmNumLogsMapper bmNumLogsMapper;
|
||||
|
||||
private static ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
public int deleteByPrimaryKey(Integer id) {
|
||||
return bmNumLogsMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
|
||||
// public int insert(BmNumLogs record) {
|
||||
// return bmNumLogsMapper.insert(record);
|
||||
// }
|
||||
public int insert(BmNumLogs record) {
|
||||
try {
|
||||
String description = record.getDescription().replace("[", "").replace("]", "");
|
||||
log.info("goto print material log {}", description);
|
||||
BmNumLogs des = objectMapper.readValue(description, BmNumLogs.class);
|
||||
record.setTypeName(des.getTypeName());
|
||||
record.setTypeModelName(des.getTypeModelName());
|
||||
record.setPreNum(des.getPreNum()); //领料申请数量、退料申请数量
|
||||
record.setAuditNum(des.getAuditNum()); //领料审核数量、但自2024/8/1退料无审核环节
|
||||
record.setInputNum(des.getInputNum()); //输入数量
|
||||
record.setOutNum(des.getOutNum()); // 出库数
|
||||
record.setManageType(des.getManageType());
|
||||
record.setTaskId(des.getTaskId());
|
||||
record.setTypeId(des.getTypeId());
|
||||
record.setPreStoreNum(des.getNum()); //操作前库存数
|
||||
} catch (JsonProcessingException e) {
|
||||
//[{"auditNum":null,"createBy":"1","id":1790,"inputNum":1,"manageType":1,"outNum":1.0,"parentId":657,"preNum":null,"taskId":2082,"typeId":121,"typeModelName":"5T(博大)","typeName":"马达头"}]
|
||||
log.error("解析日志对象失败:{}", record.getDescription());
|
||||
}
|
||||
return bmNumLogsMapper.insert(record);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,13 +64,15 @@
|
|||
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.system.api.domain.BmNumLogs" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into bm_num_logs (model_title, `method`, task,
|
||||
type_id, description, json_result,
|
||||
`time`, creator, remark
|
||||
insert into bm_num_logs (model_title, `method`, task_id, type_id,
|
||||
description, json_result, create_time, creator, remark,
|
||||
pre_num, input_num, out_num, audit_num, manage_type,
|
||||
type_name, type_model_name, pre_store_num
|
||||
)
|
||||
values (#{modelTitle,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, #{task,jdbcType=VARCHAR},
|
||||
#{typeId,jdbcType=INTEGER}, #{description,jdbcType=VARCHAR}, #{jsonResult,jdbcType=VARCHAR},
|
||||
now(), #{creator,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}
|
||||
values (#{modelTitle,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, #{taskId,jdbcType=VARCHAR}, #{typeId,jdbcType=INTEGER},
|
||||
#{description,jdbcType=VARCHAR}, #{jsonResult,jdbcType=VARCHAR}, now(), #{creator,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
|
||||
#{preNum,jdbcType=VARCHAR}, #{inputNum,jdbcType=VARCHAR}, #{outNum,jdbcType=VARCHAR}, #{auditNum,jdbcType=VARCHAR}, #{manageType,jdbcType=VARCHAR},
|
||||
#{typeName,jdbcType=VARCHAR}, #{typeModelName,jdbcType=VARCHAR}, #{preStoreNum,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue