Merge pull request 'demand: 新增TMS站点批次操作日志管理页面。删除批次增加操作日志。批次新增/删除运单增加操作日志' (#138) from develop into master

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/138
This commit is contained in:
heyu 2025-07-30 14:47:10 +08:00
commit 1c1f0faf0d
10 changed files with 731 additions and 12 deletions

View File

@ -0,0 +1,135 @@
/**
* @Project: emis
* @Title: EmisTmsSiteBatchLogController.java
* @author heyu
* @date 2025-07-30 15:55:57
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> TMS站点批次操作日志 控制器 </p>
*/
package com.xdadan.erp.web.emis;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xdadan.erp.common.annotation.Log;
import com.xdadan.erp.common.core.controller.BaseController;
import com.xdadan.erp.common.core.domain.AjaxResult;
import com.xdadan.erp.common.core.page.TableDataInfo;
import com.xdadan.erp.common.enums.BusinessType;
import com.xdadan.erp.common.utils.StringUtils;
import com.xdadan.erp.common.utils.poi.ExcelUtil;
import com.xdadan.erp.emis.domain.EmisTmsSiteBatchLog;
import com.xdadan.erp.emis.service.IEmisTmsSiteBatchLogService;
/**
* TMS站点批次操作日志Controller
*
* @author heyu
* @date 2025-07-30 15:55:57
*/
@RestController
@RequestMapping("/emis/emisTmsSiteBatchLog")
public class EmisTmsSiteBatchLogController extends BaseController {
@Autowired
private IEmisTmsSiteBatchLogService emisTmsSiteBatchLogService;
/**
* 获取操作记录
*
* @param batchNo
* @return
*/
@GetMapping("/getTmsSiteBatchLogList")
public TableDataInfo getTmsSiteBatchLogList(String batchNo) {
List<EmisTmsSiteBatchLog> list = emisTmsSiteBatchLogService.selectListByBatchNo(batchNo);
return getDataTable(list);
}
/**
* 查询TMS站点批次操作日志列表
*/
@PreAuthorize("@ss.hasPermi('emis:emisTmsSiteBatchLog:list')")
@GetMapping("/list")
public TableDataInfo list(EmisTmsSiteBatchLog emisTmsSiteBatchLog) {
startPage();
List<EmisTmsSiteBatchLog> list = emisTmsSiteBatchLogService.selectEmisTmsSiteBatchLogList(emisTmsSiteBatchLog);
return getDataTable(list);
}
/**
* 检查是否重复
*
* @param emisTmsSiteBatchLog
* @return 数量
*/
@PreAuthorize("@ss.hasPermi('emis:emisTmsSiteBatchLog:list')")
@GetMapping("/checkUnique")
public AjaxResult checkUnique(EmisTmsSiteBatchLog emisTmsSiteBatchLog) {
int cnt = emisTmsSiteBatchLogService.checkUnique(emisTmsSiteBatchLog);
return AjaxResult.success("检查成功", cnt);
}
/**
* 导出TMS站点批次操作日志列表
*/
@PreAuthorize("@ss.hasPermi('emis:emisTmsSiteBatchLog:export')")
@Log(title = "TMS站点批次操作日志", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EmisTmsSiteBatchLog emisTmsSiteBatchLog) {
List<EmisTmsSiteBatchLog> list = emisTmsSiteBatchLogService.selectEmisTmsSiteBatchLogList(emisTmsSiteBatchLog);
ExcelUtil<EmisTmsSiteBatchLog> util = new ExcelUtil<EmisTmsSiteBatchLog>(EmisTmsSiteBatchLog.class);
util.exportExcel(response, list, "TMS站点批次操作日志数据");
}
/**
* 获取TMS站点批次操作日志详细信息
*/
@PreAuthorize("@ss.hasPermi('emis:emisTmsSiteBatchLog:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(emisTmsSiteBatchLogService.selectEmisTmsSiteBatchLogById(id));
}
/**
* 新增TMS站点批次操作日志
*/
@PreAuthorize("@ss.hasPermi('emis:emisTmsSiteBatchLog:add')")
@Log(title = "TMS站点批次操作日志", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EmisTmsSiteBatchLog emisTmsSiteBatchLog) {
return toAjax(emisTmsSiteBatchLogService.insertEmisTmsSiteBatchLog(emisTmsSiteBatchLog));
}
/**
* 修改TMS站点批次操作日志
*/
@PreAuthorize("@ss.hasPermi('emis:emisTmsSiteBatchLog:edit')")
@Log(title = "TMS站点批次操作日志", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EmisTmsSiteBatchLog emisTmsSiteBatchLog) {
return toAjax(emisTmsSiteBatchLogService.updateEmisTmsSiteBatchLog(emisTmsSiteBatchLog));
}
/**
* 删除TMS站点批次操作日志
*/
@PreAuthorize("@ss.hasPermi('emis:emisTmsSiteBatchLog:remove')")
@Log(title = "TMS站点批次操作日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(emisTmsSiteBatchLogService.deleteEmisTmsSiteBatchLogByIds(ids));
}
}

View File

@ -0,0 +1,53 @@
/**
* @Project: emis
* @Title: EmisTmsSiteBatchLog.java
* @author heyu
* @date 2025-07-30 15:55:57
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> TMS站点批次操作日志 实体类 </p>
*/
package com.xdadan.erp.emis.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.xdadan.erp.common.annotation.Excel;
import com.xdadan.erp.common.core.domain.BaseEntity;
import com.xdadan.erp.common.core.domain.TreeEntity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
/**
* @ClassName EmisTmsSiteBatchLog
* @Description TMS站点批次操作日志
* @author heyu
* @date 2025-07-30 15:55:57
*/
@Data
public class EmisTmsSiteBatchLog extends BaseEntity {
private static final long serialVersionUID = 1L;
/* id */
private Long id;
/* 批次号 */
private String batchNo;
/* 操作类型 1-新增运单 2-删除运单 */
private String opType;
/* 操作时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date opDate;
/* 操作人 */
private String opManCode;
/* 操作名 */
private String opMan;
/* 操作站点 */
private String opSiteCode;
/* 操作站点名称 */
private String opSiteName;
/* 操作日志信息 */
private String opDesc;
}

View File

@ -0,0 +1,19 @@
package com.xdadan.erp.emis.domain.enumtype;
/**
* TMS站点批次操作日志类型
* TMS site batch operate log type
*/
public enum TmsSiteBatchLogType {
BATCH_CREATE("1", "新增运单"),
BATCH_DELETE("2", "删除运单");
public String opType;
public String opName;
TmsSiteBatchLogType(String opType, String opName) {
this.opType = opType;
this.opName = opName;
}
}

View File

@ -86,4 +86,12 @@ public interface EmisTmsSiteBatchDtlMapper extends BaseMapper<EmisTmsSiteBatchDt
*/
int updateDelFlagByBatchNo(String batchNo);
/**
* 根据批次号查询批次明细
*
* @param batchNo 批次号
* @return 批次明细列表
*/
List<EmisTmsSiteBatchDtl> selectEmisTmsSiteBatchDtlByBatchNo(@Param("batchNo") String batchNo);
}

View File

@ -0,0 +1,85 @@
/**
* @Project: emis
* @Title: EmisTmsSiteBatchLogMapper.java
* @author heyu
* @date 2025-07-30 15:55:57
* @Copyright: ShangHai Doitinfo 2022 All rights reserved.
* @version v1.0
* @Description: <p> TMS站点批次操作日志 Mapper 接口 </p>
* <span style='color:red'> Warning : This file is generate by ai tools,don't edit!!! </span>
*/
package com.xdadan.erp.emis.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xdadan.erp.emis.domain.EmisTmsSiteBatchLog;
import org.apache.ibatis.annotations.Param;
/**
* @ClassName EmisTmsSiteBatchLogMapper
* @Description
* <p>
* TMS站点批次操作日志 Mapper 接口
* </p>
* @author heyu
* @date 2025-07-30 15:55:57
*/
public interface EmisTmsSiteBatchLogMapper extends BaseMapper<EmisTmsSiteBatchLog> {
/**
* 主键查询
*
* @param id
* @return
*/
public EmisTmsSiteBatchLog selectEmisTmsSiteBatchLogById(Long id);
/**
* 查询列表
*
* @param emisTmsSiteBatchLog
* @return 集合
*/
public List<EmisTmsSiteBatchLog> selectEmisTmsSiteBatchLogList(EmisTmsSiteBatchLog emisTmsSiteBatchLog);
public List<EmisTmsSiteBatchLog> selectListByBatchNo(@Param("batchNo") String batchNo);
/**
* 检查是否重复
*
* @param emisTmsSiteBatchLog
* @return 数量
*/
public int checkUnique(EmisTmsSiteBatchLog emisTmsSiteBatchLog);
/**
* 新增
*
* @param emisTmsSiteBatchLog
* @return
*/
public int insertEmisTmsSiteBatchLog(EmisTmsSiteBatchLog emisTmsSiteBatchLog);
/**
* 修改
*
* @param emisTmsSiteBatchLog
* @return
*/
public int updateEmisTmsSiteBatchLog(EmisTmsSiteBatchLog emisTmsSiteBatchLog);
/**
* 删除
*
* @param id 主键
* @return 结果
*/
public int deleteEmisTmsSiteBatchLogById(Long id);
/**
* 批量删除
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteEmisTmsSiteBatchLogByIds(Long[] ids);
}

View File

@ -96,6 +96,7 @@ public interface EmisTmsSiteBatchMapper extends BaseMapper<EmisTmsSiteBatch>
* @param ids 需要删除的数据主键集合
* @return 结果
*/
@DataAuditLog(operateType= OperateType.DELETE,serviceClass= EmisTmsSiteBatchServiceImpl.class)
public int deleteEmisTmsSiteBatchByIds(Long[] ids);

View File

@ -0,0 +1,79 @@
/**
* @Project: emis
* @Title: IEmisTmsSiteBatchLogService.java
* @author heyu
* @date 2025-07-30 15:55:57
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> TMS站点批次操作日志 服务类接口 </p>
*/
package com.xdadan.erp.emis.service;
import java.util.List;
import com.xdadan.erp.emis.domain.EmisTmsSiteBatchLog;
/**
* @ClassName IEmisTmsSiteBatchLogService
* @Description TMS站点批次操作日志
* @author heyu
* @date 2025-07-30 15:55:57
*/
public interface IEmisTmsSiteBatchLogService {
/**
* 主键查询
*
* @param id
* @return
*/
public EmisTmsSiteBatchLog selectEmisTmsSiteBatchLogById(Long id);
/**
* 查询TMS站点批次操作日志列表
*
* @param emisTmsSiteBatchLog TMS站点批次操作日志
* @return TMS站点批次操作日志集合
*/
public List<EmisTmsSiteBatchLog> selectEmisTmsSiteBatchLogList(EmisTmsSiteBatchLog emisTmsSiteBatchLog);
public List<EmisTmsSiteBatchLog> selectListByBatchNo(String batchNo);
/**
* 检查是否重复
*
* @param emisTmsSiteBatchLog
* @return 数量
*/
public int checkUnique(EmisTmsSiteBatchLog emisTmsSiteBatchLog);
/**
* 新增TMS站点批次操作日志
*
* @param emisTmsSiteBatchLog TMS站点批次操作日志
* @return 结果
*/
public int insertEmisTmsSiteBatchLog(EmisTmsSiteBatchLog emisTmsSiteBatchLog);
/**
* 修改TMS站点批次操作日志
*
* @param emisTmsSiteBatchLog TMS站点批次操作日志
* @return 结果
*/
public int updateEmisTmsSiteBatchLog(EmisTmsSiteBatchLog emisTmsSiteBatchLog);
/**
* 批量删除TMS站点批次操作日志
*
* @param ids 需要删除的TMS站点批次操作日志主键集合
* @return 结果
*/
public int deleteEmisTmsSiteBatchLogByIds(Long[] ids);
/**
* 删除TMS站点批次操作日志信息
*
* @param id TMS站点批次操作日志主键
* @return 结果
*/
public int deleteEmisTmsSiteBatchLogById(Long id);
}

View File

@ -0,0 +1,113 @@
/**
* @Project: emis
* @Title: EmisTmsSiteBatchLogServiceImpl.java
* @author heyu
* @date 2025-07-30 15:55:57
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> TMS站点批次操作日志 实体类 </p>
*/
package com.xdadan.erp.emis.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xdadan.erp.emis.domain.EmisTmsSiteBatchLog;
import com.xdadan.erp.emis.mapper.EmisTmsSiteBatchLogMapper;
import com.xdadan.erp.emis.service.IEmisTmsSiteBatchLogService;
/**
* TMS站点批次操作日志Service业务层处理
*
* @author heyu
* @date 2025-07-30 15:55:57
*/
@Service
public class EmisTmsSiteBatchLogServiceImpl implements IEmisTmsSiteBatchLogService {
@Autowired
private EmisTmsSiteBatchLogMapper emisTmsSiteBatchLogMapper;
/**
* 查询TMS站点批次操作日志
*
* @param id TMS站点批次操作日志主键
* @return TMS站点批次操作日志
*/
@Override
public EmisTmsSiteBatchLog selectEmisTmsSiteBatchLogById(Long id) {
return emisTmsSiteBatchLogMapper.selectEmisTmsSiteBatchLogById(id);
}
/**
* 查询TMS站点批次操作日志列表
*
* @param emisTmsSiteBatchLog TMS站点批次操作日志
* @return TMS站点批次操作日志
*/
@Override
public List<EmisTmsSiteBatchLog> selectEmisTmsSiteBatchLogList(EmisTmsSiteBatchLog emisTmsSiteBatchLog) {
return emisTmsSiteBatchLogMapper.selectEmisTmsSiteBatchLogList(emisTmsSiteBatchLog);
}
@Override
public List<EmisTmsSiteBatchLog> selectListByBatchNo(String batchNo) {
return emisTmsSiteBatchLogMapper.selectListByBatchNo(batchNo);
}
/**
* 检查是否重复
*
* @param emisTmsSiteBatchLog
* @return 数量
*/
@Override
public int checkUnique(EmisTmsSiteBatchLog emisTmsSiteBatchLog) {
return emisTmsSiteBatchLogMapper.checkUnique(emisTmsSiteBatchLog);
}
/**
* 新增TMS站点批次操作日志
*
* @param emisTmsSiteBatchLog TMS站点批次操作日志
* @return 结果
*/
@Override
public int insertEmisTmsSiteBatchLog(EmisTmsSiteBatchLog emisTmsSiteBatchLog) {
return emisTmsSiteBatchLogMapper.insertEmisTmsSiteBatchLog(emisTmsSiteBatchLog);
}
/**
* 修改TMS站点批次操作日志
*
* @param emisTmsSiteBatchLog TMS站点批次操作日志
* @return 结果
*/
@Override
public int updateEmisTmsSiteBatchLog(EmisTmsSiteBatchLog emisTmsSiteBatchLog) {
return emisTmsSiteBatchLogMapper.updateEmisTmsSiteBatchLog(emisTmsSiteBatchLog);
}
/**
* 批量删除TMS站点批次操作日志
*
* @param ids 需要删除的TMS站点批次操作日志主键
* @return 结果
*/
@Override
public int deleteEmisTmsSiteBatchLogByIds(Long[] ids) {
return emisTmsSiteBatchLogMapper.deleteEmisTmsSiteBatchLogByIds(ids);
}
/**
* 删除TMS站点批次操作日志信息
*
* @param id TMS站点批次操作日志主键
* @return 结果
*/
@Override
public int deleteEmisTmsSiteBatchLogById(Long id) {
return emisTmsSiteBatchLogMapper.deleteEmisTmsSiteBatchLogById(id);
}
}

View File

@ -10,10 +10,9 @@
package com.xdadan.erp.emis.service.impl;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
import java.util.ArrayList;
import cn.hutool.core.collection.CollectionUtil;
import com.xdadan.erp.common.core.redis.RedissonService;
@ -25,7 +24,10 @@ import com.xdadan.erp.emis.domain.exception.EmisBizError;
import com.xdadan.erp.emis.mapper.EmisTmsSiteBatchDtlMapper;
import com.xdadan.erp.emis.mapper.EmisTmsSiteBatchLoadingMapper;
import com.xdadan.erp.emis.mapper.EmisTransPlanRuleMapper;
import com.xdadan.erp.emis.mapper.EmisTmsSiteBatchLogMapper;
import com.xdadan.erp.emis.mapper.EmisWaybillMapper;
import com.xdadan.erp.emis.service.EmisBaseService;
import com.xdadan.erp.emis.service.IEmisTmsSiteBatchDtlService;
import jodd.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -62,8 +64,15 @@ public class EmisTmsSiteBatchServiceImpl extends EmisBaseService implements IEmi
@Autowired
private EmisTransPlanRuleMapper emisTransPlanRuleMapper;
@Autowired
private EmisTmsSiteBatchLogMapper emisTmsSiteBatchLogMapper;
@Autowired
private EmisWaybillMapper emisWaybillMapper;
/**
* 获取稽核数据
*
* @param id
* @return
*/
@ -251,8 +260,7 @@ public class EmisTmsSiteBatchServiceImpl extends EmisBaseService implements IEmi
.collect(Collectors.toMap(
EmisTmsSiteBatchDtl::getBillCode,
item -> item,
(existing, replacement) -> existing
))
(existing, replacement) -> existing))
.values()
.stream()
.collect(Collectors.toList());
@ -262,6 +270,10 @@ public class EmisTmsSiteBatchServiceImpl extends EmisBaseService implements IEmi
itemDtl.setBatchNo(emisTmsSiteBatch.getBatchNo());
emisTmsSiteBatchDtlMapper.insertEmisTmsSiteBatchDtl(itemDtl);
}
List<String> billCodes = distinctBatchDtlList.stream().map(EmisTmsSiteBatchDtl::getBillCode).distinct().collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(billCodes)) {
setOperateLog(emisTmsSiteBatch, "1", "新增运单", billCodes);
}
}
if (!CollectionUtils.isEmpty(emisTmsSiteBatch.getLoadingList())) {
for (EmisTmsSiteBatchLoading batchLoading : emisTmsSiteBatch.getLoadingList()) {
@ -292,8 +304,7 @@ public class EmisTmsSiteBatchServiceImpl extends EmisBaseService implements IEmi
.collect(Collectors.toMap(
EmisTmsSiteBatchDtl::getBillCode,
item -> item,
(existing, replacement) -> existing
))
(existing, replacement) -> existing))
.values()
.stream()
.collect(Collectors.toList());
@ -302,17 +313,65 @@ public class EmisTmsSiteBatchServiceImpl extends EmisBaseService implements IEmi
}
}
emisTmsSiteBatchMapper.updateEmisTmsSiteBatch(emisTmsSiteBatch);
emisTmsSiteBatchDtlMapper.updateDelFlagByBatchNo(emisTmsSiteBatch.getBatchNo());
emisTmsSiteBatchLoadingMapper.updateDelFlagByBatchNo(emisTmsSiteBatch.getBatchNo());
if (StringUtil.isBlank(emisTmsSiteBatch.getBatchNo())) {
return 1;
}
if (CollectionUtil.isNotEmpty(distinctBatchDtlList)) {
for (EmisTmsSiteBatchDtl itemDtl : distinctBatchDtlList) {
itemDtl.setBatchNo(emisTmsSiteBatch.getBatchNo());
emisTmsSiteBatchDtlMapper.insertEmisTmsSiteBatchDtl(itemDtl);
// 获取历史批次明细数据
List<EmisTmsSiteBatchDtl> historyBatchDtlList = emisTmsSiteBatchDtlMapper
.selectEmisTmsSiteBatchDtlByBatchNo(emisTmsSiteBatch.getBatchNo());
// 处理批次明细数据:比较历史数据和新数据,进行插入或软删除操作
if (CollectionUtil.isNotEmpty(distinctBatchDtlList) || CollectionUtil.isNotEmpty(historyBatchDtlList)) {
// 将历史数据按billCode分组,便于查找
Map<String, EmisTmsSiteBatchDtl> historyBatchDtlMap = historyBatchDtlList.stream()
.collect(Collectors.toMap(EmisTmsSiteBatchDtl::getBillCode, item -> item,
(existing, replacement) -> existing));
// 将新数据按billCode分组,便于查找
Map<String, EmisTmsSiteBatchDtl> newBatchDtlMap = distinctBatchDtlList != null
? distinctBatchDtlList.stream()
.collect(Collectors.toMap(EmisTmsSiteBatchDtl::getBillCode, item -> item,
(existing, replacement) -> existing))
: new HashMap<>();
// 处理需要插入的新数据
if (CollectionUtil.isNotEmpty(distinctBatchDtlList)) {
List<String> newBillCodes = new ArrayList<>();
for (EmisTmsSiteBatchDtl itemDtl : distinctBatchDtlList) {
// 如果历史数据中不存在该billCode,则插入新数据
if (!historyBatchDtlMap.containsKey(itemDtl.getBillCode())) {
emisTmsSiteBatchDtlMapper.insertEmisTmsSiteBatchDtl(itemDtl);
newBillCodes.add(itemDtl.getBillCode());
}
}
// 记录新增运单日志
if (!newBillCodes.isEmpty()) {
setOperateLog(emisTmsSiteBatch, "1", "新增运单", newBillCodes);
}
}
// 处理需要软删除的历史数据
if (CollectionUtil.isNotEmpty(historyBatchDtlList)) {
List<String> deletedBillCodes = new ArrayList<>();
for (EmisTmsSiteBatchDtl historyDtl : historyBatchDtlList) {
// 如果新数据中不存在该billCode,则软删除历史数据
if (!newBatchDtlMap.containsKey(historyDtl.getBillCode())) {
emisTmsSiteBatchDtlMapper.deleteEmisTmsSiteBatchDtlById(historyDtl.getId());
deletedBillCodes.add(historyDtl.getBillCode());
}
}
// 记录删除运单日志
if (!deletedBillCodes.isEmpty()) {
setOperateLog(emisTmsSiteBatch, "2", "删除运单", deletedBillCodes);
}
}
}
if (CollectionUtil.isNotEmpty(emisTmsSiteBatch.getLoadingList())) {
for (EmisTmsSiteBatchLoading batchLoading : emisTmsSiteBatch.getLoadingList()) {
batchLoading.setBatchNo(emisTmsSiteBatch.getBatchNo());
@ -322,4 +381,15 @@ public class EmisTmsSiteBatchServiceImpl extends EmisBaseService implements IEmi
return 1;
}
private void setOperateLog(EmisTmsSiteBatch emisTmsSiteBatch, String number, String 删除运单, List<String> deletedBillCodes) {
EmisTmsSiteBatchLog log = new EmisTmsSiteBatchLog();
log.setBatchNo(emisTmsSiteBatch.getBatchNo());
log.setOpType(number);
log.setOpDate(new Date());
log.setOpMan(getCurrentUser().getEmpName());
log.setOpSiteName(getCurrentUser().getOwnerSiteName());
log.setOpDesc(emisTmsSiteBatch.getBatchNo() + 删除运单 + String.join(",", deletedBillCodes));
emisTmsSiteBatchLogMapper.insertEmisTmsSiteBatchLog(log);
}
}

View File

@ -0,0 +1,156 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xdadan.erp.emis.mapper.EmisTmsSiteBatchLogMapper">
<resultMap type="EmisTmsSiteBatchLog" id="EmisTmsSiteBatchLogResult">
<result property="id" column="id" />
<result property="batchNo" column="batch_no" />
<result property="opType" column="op_type" />
<result property="opDate" column="op_date" />
<result property="opManCode" column="op_man_code" />
<result property="opMan" column="op_man" />
<result property="opSiteCode" column="op_site_code" />
<result property="opSiteName" column="op_site_name" />
<result property="opDesc" column="op_desc" />
</resultMap>
<sql id="selectEmisTmsSiteBatchLogVo">
select id, batch_no, op_type, op_date, op_man_code, op_man, op_site_code, op_site_name, op_desc, del_flag, remark, create_by, create_time, update_by, update_time, update_site, create_site from emis_tms_site_batch_log
</sql>
<select id="selectListByBatchNo" parameterType="String" resultMap="EmisTmsSiteBatchLogResult">
select id, batch_no, op_type, op_date, op_man_code, op_man, op_site_code, op_site_name, op_desc, del_flag, remark, create_by, create_time, update_by, update_time, update_site, create_site
from emis_tms_site_batch_log
where del_flag='0' and batch_no=#{batchNo}
</select>
<select id="selectEmisTmsSiteBatchLogList" parameterType="EmisTmsSiteBatchLog" resultMap="EmisTmsSiteBatchLogResult">
<include refid="selectEmisTmsSiteBatchLogVo"/>
<where>
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="batchNo != null and batchNo != ''"> and batch_no like concat('%', #{batchNo}, '%')</if>
<if test="opType != null and opType != ''"> and op_type like concat('%', #{opType}, '%')</if>
<if test="opDate != null "> and op_date = #{opDate}</if>
<if test="opManCode != null and opManCode != ''"> and op_man_code like concat('%', #{opManCode}, '%')</if>
<if test="opMan != null and opMan != ''"> and op_man like concat('%', #{opMan}, '%')</if>
<if test="opSiteCode != null and opSiteCode != ''"> and op_site_code like concat('%', #{opSiteCode}, '%')</if>
<if test="opSiteName != null and opSiteName != ''"> and op_site_name like concat('%', #{opSiteName}, '%')</if>
<if test="opDesc != null and opDesc != ''"> and op_desc like concat('%', #{opDesc}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
</where>
order by create_time desc
</select>
<select id="checkUnique" parameterType="EmisTmsSiteBatchLog" resultType="int">
select count(1) from emis_tms_site_batch_log
where del_flag='0'
and id = #{id}
and batch_no = #{batchNo}
and op_type = #{opType}
and op_date = #{opDate}
and op_man_code = #{opManCode}
and op_man = #{opMan}
and op_site_code = #{opSiteCode}
and op_site_name = #{opSiteName}
and op_desc = #{opDesc}
and del_flag = #{delFlag}
and remark = #{remark}
and create_by = #{createBy}
and create_time = #{createTime}
and update_by = #{updateBy}
and update_time = #{updateTime}
and update_site = #{updateSite}
and create_site = #{createSite}
limit 1
</select>
<select id="selectEmisTmsSiteBatchLogById" parameterType="Long" resultMap="EmisTmsSiteBatchLogResult">
select id, batch_no, op_type, op_date, op_man_code, op_man, op_site_code, op_site_name, op_desc, del_flag, remark, create_by, create_time, update_by, update_time, update_site, create_site
from emis_tms_site_batch_log a
where a.id = #{id}
</select>
<insert id="insertEmisTmsSiteBatchLog" parameterType="EmisTmsSiteBatchLog" useGeneratedKeys="true" keyProperty="id">
insert into emis_tms_site_batch_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="batchNo != null and batchNo != ''">batch_no,</if>
<if test="opType != null and opType != ''">op_type,</if>
<if test="opDate != null">op_date,</if>
<if test="opManCode != null and opManCode != ''">op_man_code,</if>
<if test="opMan != null and opMan != ''">op_man,</if>
<if test="opSiteCode != null and opSiteCode != ''">op_site_code,</if>
<if test="opSiteName != null and opSiteName != ''">op_site_name,</if>
<if test="opDesc != null and opDesc != ''">op_desc,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateSite != null and updateSite != ''">update_site,</if>
<if test="createSite != null and createSite != ''">create_site,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="batchNo != null and batchNo != ''">#{batchNo},</if>
<if test="opType != null and opType != ''">#{opType},</if>
<if test="opDate != null">#{opDate},</if>
<if test="opManCode != null and opManCode != ''">#{opManCode},</if>
<if test="opMan != null and opMan != ''">#{opMan},</if>
<if test="opSiteCode != null and opSiteCode != ''">#{opSiteCode},</if>
<if test="opSiteName != null and opSiteName != ''">#{opSiteName},</if>
<if test="opDesc != null and opDesc != ''">#{opDesc},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
<if test="createSite != null and createSite != ''">#{createSite},</if>
</trim>
</insert>
<update id="updateEmisTmsSiteBatchLog" parameterType="EmisTmsSiteBatchLog">
update emis_tms_site_batch_log
<trim prefix="SET" suffixOverrides=",">
<if test="batchNo != null and batchNo != ''">batch_no = #{batchNo},</if>
<if test="opType != null and opType != ''">op_type = #{opType},</if>
<if test="opDate != null">op_date = #{opDate},</if>
<if test="opManCode != null and opManCode != ''">op_man_code = #{opManCode},</if>
<if test="opMan != null and opMan != ''">op_man = #{opMan},</if>
<if test="opSiteCode != null and opSiteCode != ''">op_site_code = #{opSiteCode},</if>
<if test="opSiteName != null and opSiteName != ''">op_site_name = #{opSiteName},</if>
<if test="opDesc != null and opDesc != ''">op_desc = #{opDesc},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEmisTmsSiteBatchLogById" parameterType="Long">
delete from emis_tms_site_batch_log where id = #{id}
</delete>
<delete id="deleteEmisTmsSiteBatchLogByIds" parameterType="String">
delete from emis_tms_site_batch_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>