合并storagelog

This commit is contained in:
sxu 2024-08-06 14:25:10 +08:00
parent a0e6e24a92
commit 9b198eaaba
15 changed files with 89 additions and 45 deletions

View File

@ -1,4 +1,4 @@
package com.bonus.sgzb.material.domain;
package com.bonus.sgzb.base.api.domain;
import com.bonus.sgzb.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -42,6 +42,9 @@ public class BmStorageLog extends BaseEntity {
@Excel(name = "实例/任务")
private String taskId;
@Excel(name = "协议id")
private int agreementId;
/**
* 任务名称
*/

View File

@ -3,7 +3,6 @@ package com.bonus.sgzb.common.log.aspect;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.bonus.sgzb.base.api.domain.*;
import com.bonus.sgzb.common.core.constant.SecurityConstants;
import com.bonus.sgzb.common.core.domain.R;
@ -12,7 +11,6 @@ import com.bonus.sgzb.common.log.enums.BusinessType;
import com.bonus.sgzb.common.log.filter.PropertyPreExcludeFilter;
import com.bonus.sgzb.common.log.service.AsyncLogService;
import com.bonus.sgzb.system.api.RemoteUserService;
import com.bonus.sgzb.system.api.domain.BmNumLogs;
import com.bonus.sgzb.system.api.domain.BmStorageLog;
import com.bonus.sgzb.system.api.model.LoginUser;
import com.fasterxml.jackson.databind.ObjectMapper;
@ -274,7 +272,7 @@ public class LogAspect
bmStorageLogList.add(bmStorageLog);
}
}
// 新购验收任务
// 新购验收任务 PurchaseMacodeInfoController.modifyManageStatus
if (joinPoint.getArgs()[0] instanceof MaInputVO) {
MaInputVO maInputVO = (MaInputVO) joinPoint.getArgs()[0];
for (MaInputRecord maInputRecord : maInputVO.getInputRecordList()) {
@ -288,6 +286,20 @@ public class LogAspect
bmStorageLogList.add(bmStorageLog);
}
}
// 新购配件入库审核 PurchaseAccessoryController.checkInput, 因为没有出入库闭环暂时不加库存监控日志
// if (joinPoint.getArgs()[0] instanceof MaInputVO) {
// MaInputVO maInputVO = (MaInputVO) joinPoint.getArgs()[0];
// for (MaInputRecord maInputRecord : maInputVO.getInputRecordList()) {
// BmStorageLog bmStorageLog = new BmStorageLog();
// bmStorageLog.setTypeId(Objects.isNull(maInputRecord.getTypeId()) ? 0 : maInputRecord.getTypeId().intValue());
// bmStorageLog.setTypeName(maInputRecord.getMaCode());
// bmStorageLog.setPreStoreNum(Objects.isNull(maInputRecord.getNum()) ? 0: maInputRecord.getNum().intValue());
// bmStorageLog.setInNum(Objects.isNull(maInputRecord.getInputNum()) ? 0: maInputRecord.getInputNum().intValue());
// bmStorageLog.setPostStoreNum(bmStorageLog.getPreStoreNum() + bmStorageLog.getInNum());
// bmStorageLog.setTaskId(String.valueOf(maInputRecord.getTaskId()));
// bmStorageLogList.add(bmStorageLog);
// }
// }
// 领料出库
if (joinPoint.getArgs()[0] instanceof List &&
((List) joinPoint.getArgs()[0]).stream().noneMatch((o -> !(o instanceof LeaseOutDetails)))) {
@ -329,7 +341,18 @@ public class LogAspect
bmStorageLog.setPostStoreNum(bai.getPostStoreNum());
bmStorageLogList.add(bmStorageLog);
}
// 二级库出入库
// 二级库出入库, 不影响ma_type库存变化暂时不加库存监控日志
// if (joinPoint.getArgs()[0] instanceof TeamLeaseInfo) {
// TeamLeaseInfo tli = (TeamLeaseInfo)joinPoint.getArgs()[0];
// BmStorageLog bmStorageLog = new BmStorageLog();
// bmStorageLog.setAgreementId(Integer.parseInt(tli.getAgreementId()));
// bmStorageLog.setTypeId(Integer.parseInt(tli.getTypeId()));
// bmStorageLog.setTypeName(tli.getTypeName());
// bmStorageLog.setPreStoreNum(1);
// bmStorageLog.setPreStoreNum(Integer.parseInt(tli.getNum())); //出入库数量,type=1出库,type=2退库
// bmStorageLog.setPostStoreNum(1);
// bmStorageLogList.add(bmStorageLog);
// }
}
}

View File

@ -168,6 +168,7 @@ public class PurchaseAccessoryController extends BaseController
* 新购配件入库审核
*/
@ApiOperation(value = "新购配件入库审核")
//@Log(title = "新购配件入库审核", businessType = BusinessType.MATERIAL)
@PostMapping("/checkInput")
public AjaxResult checkInput(@RequestBody List<PurchasePartDetails> purchasePartDetails){
return toAjax(purchaseAccessoryService.checkInput(purchasePartDetails));

View File

@ -1,6 +1,7 @@
package com.bonus.sgzb.material.controller;
import cn.hutool.core.convert.Convert;
import com.bonus.sgzb.base.api.domain.TeamLeaseInfo;
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
@ -54,7 +55,7 @@ public class SecondaryWarehouseController extends BaseController {
*/
@ApiOperation(value = "出库/退库操作")
@PostMapping("/operate")
@Log(title = "二级库管理--出库退库操作", businessType = BusinessType.MATERIAL)
//@Log(title = "二级库管理--出库退库操作", businessType = BusinessType.MATERIAL)
public AjaxResult operate(TeamLeaseInfo bean){
return toAjax(service.addOperate(bean));
}

View File

@ -31,6 +31,10 @@ public class PurchasePartDetails extends BaseEntity
@ApiModelProperty(value = "规格id")
private Long partId;
/** 实时库存 */
@ApiModelProperty(value = "实时库存")
private BigDecimal num;
/** 规格id */
@ApiModelProperty(value = "规格id")
private Long typeId;
@ -194,6 +198,14 @@ public class PurchasePartDetails extends BaseEntity
this.partId = partId;
}
public BigDecimal getNum() {
return num;
}
public void setNum(BigDecimal num) {
this.num = num;
}
public void setPurchasePrice(String purchasePrice)
{
this.purchasePrice = purchasePrice;

View File

@ -1,7 +1,7 @@
package com.bonus.sgzb.material.mapper;
import com.bonus.sgzb.material.domain.SecondaryWarehouse;
import com.bonus.sgzb.material.domain.TeamLeaseInfo;
import com.bonus.sgzb.base.api.domain.TeamLeaseInfo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;

View File

@ -1,7 +1,7 @@
package com.bonus.sgzb.material.service;
import com.bonus.sgzb.material.domain.SecondaryWarehouse;
import com.bonus.sgzb.material.domain.TeamLeaseInfo;
import com.bonus.sgzb.base.api.domain.TeamLeaseInfo;
import java.util.List;

View File

@ -3,7 +3,7 @@ package com.bonus.sgzb.material.service.impl;
import com.bonus.sgzb.common.core.exception.ServiceException;
import com.bonus.sgzb.common.security.utils.SecurityUtils;
import com.bonus.sgzb.material.domain.SecondaryWarehouse;
import com.bonus.sgzb.material.domain.TeamLeaseInfo;
import com.bonus.sgzb.base.api.domain.TeamLeaseInfo;
import com.bonus.sgzb.material.mapper.SecondaryWarehouseMapper;
import com.bonus.sgzb.material.service.SecondaryWarehouseService;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -310,6 +310,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectPutinDetails" resultType="com.bonus.sgzb.material.domain.PurchasePartDetails">
SELECT pcd.id,
mt.pa_id as partId,
mt.num as num,
mt1.pa_id as modelId,
mt.pa_name specificationType,
mt1.pa_name typeName,

View File

@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sai.agreement_id,
sai.type_id
</select>
<select id="getOperateList" resultType="com.bonus.sgzb.material.domain.TeamLeaseInfo">
<select id="getOperateList" resultType="com.bonus.sgzb.base.api.domain.TeamLeaseInfo">
SELECT
bui.unit_name AS unitName,
bp.lot_name AS proName,
@ -99,7 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</if>
</select>
<select id="getRecordsOne" resultType="com.bonus.sgzb.material.domain.TeamLeaseInfo">
<select id="getRecordsOne" resultType="com.bonus.sgzb.base.api.domain.TeamLeaseInfo">
SELECT
mt1.type_name AS typeName,
mt.type_name AS modelName,
@ -116,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
order by sai.start_time desc
</select>
<select id="getRecordsTwo" resultType="com.bonus.sgzb.material.domain.TeamLeaseInfo">
<select id="getRecordsTwo" resultType="com.bonus.sgzb.base.api.domain.TeamLeaseInfo">
SELECT
mt1.type_name AS typeName,
mt.type_name AS modelName,
@ -133,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
order by sai.end_time desc
</select>
<select id="getRecordsThree" resultType="com.bonus.sgzb.material.domain.TeamLeaseInfo">
<select id="getRecordsThree" resultType="com.bonus.sgzb.base.api.domain.TeamLeaseInfo">
SELECT
mt1.type_name AS typeName,
mt.type_name AS modelName,
@ -150,7 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
order by sai.start_time desc
</select>
<select id="getRecordsFour" resultType="com.bonus.sgzb.material.domain.TeamLeaseInfo">
<select id="getRecordsFour" resultType="com.bonus.sgzb.base.api.domain.TeamLeaseInfo">
select tli.team_name as teamName,
mt1.type_name AS typeName,
mt.type_name AS modelName,
@ -166,7 +166,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and DATE(tli.create_time) = #{startTime}
</if>
</select>
<select id="getRecordsFive" resultType="com.bonus.sgzb.material.domain.TeamLeaseInfo">
<select id="getRecordsFive" resultType="com.bonus.sgzb.base.api.domain.TeamLeaseInfo">
select tli.team_name as teamName,
mt1.type_name AS typeName,
mt.type_name AS modelName,

View File

@ -8,7 +8,7 @@ import java.util.List;
public interface BmStorageLogMapper {
int deleteByPrimaryKey(Integer id);
int insert(BmStorageLog record);
// int insert(BmStorageLog record);
int batchInsert(List<BmStorageLog> records);

View File

@ -23,9 +23,9 @@ public class BmStorageLogService {
return bmStorageLogMapper.deleteByPrimaryKey(id);
}
public int insert(BmStorageLog record) {
return bmStorageLogMapper.insert(record);
}
// public int insert(BmStorageLog record) {
// return bmStorageLogMapper.insert(record);
// }
public int batchInsert(List<BmStorageLog> records) {
log.info("batch insert log {}", records);

View File

@ -8,6 +8,7 @@
<result column="model_title" jdbcType="VARCHAR" property="modelTitle" />
<result column="method" jdbcType="VARCHAR" property="method" />
<result column="task_id" jdbcType="VARCHAR" property="taskId" />
<result column="agreement_id" jdbcType="INTEGER" property="agreementId" />
<result column="task_name" jdbcType="VARCHAR" property="taskName" />
<result column="type_id" jdbcType="INTEGER" property="typeId" />
<result column="type_name" jdbcType="VARCHAR" property="typeName" />
@ -38,7 +39,7 @@
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
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,
bsl.back_num, bsl.pass_num, bsl.maintenance_num, bsl.scrap_num, bsl.json_result, bsl.create_time, bsl.creator, bsl.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, bsl.agreement_id,
bsl.remark, bsl.`status`, mt.type_name, mt1.type_name as type_parent_name, tt.code as task_name
from bm_storage_log bsl
left join ma_type mt on bsl.type_id = mt.type_id
@ -50,7 +51,7 @@
<select id="selectAll" resultMap="BaseResultMap">
select
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,
bsl.back_num, bsl.pass_num, bsl.maintenance_num, bsl.scrap_num, bsl.json_result, bsl.create_time, bsl.creator, bsl.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, bsl.agreement_id,
bsl.remark, bsl.`status`, mt.type_name, mt1.type_name as type_parent_name, tt.code as task_name
from bm_storage_log bsl
left join ma_type mt on bsl.type_id = mt.type_id
@ -72,28 +73,28 @@
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.system.api.domain.BmStorageLog" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into bm_storage_log (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, in_num,
back_num, pass_num, maintenance_num, scrap_num, `status`, post_store_num
)
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}, #{inNum,jdbcType=VARCHAR},
#{backNum,jdbcType=VARCHAR}, #{passNum,jdbcType=VARCHAR}, #{maintenanceNum,jdbcType=VARCHAR}, #{scrapNum,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
#{postStoreNum,jdbcType=VARCHAR}
)
</insert>
<!-- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.system.api.domain.BmStorageLog" useGeneratedKeys="true">-->
<!-- &lt;!&ndash;@mbg.generated&ndash;&gt;-->
<!-- insert into bm_storage_log (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, in_num,-->
<!-- back_num, pass_num, maintenance_num, scrap_num, `status`, post_store_num-->
<!-- )-->
<!-- 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}, #{inNum,jdbcType=VARCHAR},-->
<!-- #{backNum,jdbcType=VARCHAR}, #{passNum,jdbcType=VARCHAR}, #{maintenanceNum,jdbcType=VARCHAR}, #{scrapNum,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},-->
<!-- #{postStoreNum,jdbcType=VARCHAR}-->
<!-- )-->
<!-- </insert>-->
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.system.api.domain.BmStorageLog" useGeneratedKeys="true">
insert into bm_storage_log (model_title, `method`, task_id, type_id,
create_time, creator, remark, out_num, manage_type,
type_name, type_model_name, pre_store_num, in_num,
back_num, pass_num, maintenance_num,
back_num, pass_num, maintenance_num, agreement_id,
scrap_num, `status`, post_store_num, result_code, result_msg, json_result
) values
<foreach item="item" index="index" collection="list" separator=",">
@ -101,7 +102,7 @@
#{item.modelTitle,jdbcType=VARCHAR}, #{item.method,jdbcType=VARCHAR}, #{item.taskId,jdbcType=VARCHAR}, #{item.typeId,jdbcType=INTEGER},
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.backNum,jdbcType=INTEGER}, #{item.passNum,jdbcType=INTEGER}, #{item.maintenanceNum,jdbcType=INTEGER},
#{item.backNum,jdbcType=INTEGER}, #{item.passNum,jdbcType=INTEGER}, #{item.maintenanceNum,jdbcType=INTEGER}, #{item.agreementId,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}
)

View File

@ -41,7 +41,9 @@
<el-table-column show-overflow-tooltip align="center" prop="preStoreNum" label="操作前库存" />
<el-table-column show-overflow-tooltip align="center" prop="inNum" label="入库数量" />
<el-table-column show-overflow-tooltip align="center" prop="outNum" label="出库数量" />
<el-table-column show-overflow-tooltip align="center" prop="backNum" label="退库数量" />
<el-table-column show-overflow-tooltip align="center" prop="passNum" label="(退库)合格数量" />
<el-table-column show-overflow-tooltip align="center" prop="maintenanceNum" label="(退库)维修数量" />
<el-table-column show-overflow-tooltip align="center" prop="scrapNum" label="(退库)报废数量" />
<!-- <el-table-column show-overflow-tooltip align="center" prop="description" label="描述" />-->
<el-table-column show-overflow-tooltip align="center" prop="postStoreNum" label="操作后库存" />
<el-table-column show-overflow-tooltip align="center" prop="createTime" label="日期" />
@ -120,10 +122,10 @@ export default {
{ label: '操作前库存', content: 'preStoreNum' },
{ label: '入库数量', content: 'inNum' },
{ label: '出库数量', content: 'outNum' },
{ label: '退库数量', content: 'backNum' },
{ label: '合格数量', content: 'passNum' },
{ label: '维修数量', content: 'maintenanceNum' },
{ label: '报废数量', content: 'scrapNum' },
{ label: '(退库)总数量', content: 'backNum' },
{ label: '(退库)合格数量', content: 'passNum' },
{ label: '(退库)维修数量', content: 'maintenanceNum' },
{ label: '(退库)报废数量', content: 'scrapNum' },
{ label: '操作后库存', content: 'postStoreNum' },
{ label: '请求地址', content: 'method' },
],