Compare commits
No commits in common. "develop" and "master" have entirely different histories.
@ -21,7 +21,7 @@ jobs:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
ARGS: "-rlgoDzvc -i"
|
||||
SOURCE: target/${{ steps.maven.outputs.artifact-id }}.jar
|
||||
REMOTE_HOST: 192.168.88.44
|
||||
REMOTE_HOST: 10.100.130.80
|
||||
REMOTE_USER: root
|
||||
TARGET: /root/apps
|
||||
EXCLUDE: ""
|
||||
|
7
pom.xml
7
pom.xml
@ -110,11 +110,10 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.idev.excel</groupId>
|
||||
<artifactId>fastexcel</artifactId>
|
||||
<version>1.1.0</version>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>4.0.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -1,70 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 定义变量
|
||||
APP_NAME="ims"
|
||||
APP_JAR="/ims/app/ims.jar" # 替换为你的 JAR 包路径
|
||||
CONFIG_FILE="/ims/app/application.yml" # 替换为你的配置文件路径
|
||||
LOG_FILE="/ims/app/ims.log" # 日志文件路径
|
||||
PID_FILE="/ims/app/ims.pid" # 保存进程 ID 的文件
|
||||
|
||||
# 启动函数
|
||||
start() {
|
||||
if [ -f "$PID_FILE" ]; then
|
||||
PID=$(cat "$PID_FILE")
|
||||
if ps -p "$PID" > /dev/null; then
|
||||
echo "Application $APP_NAME is already running with PID $PID."
|
||||
exit 1
|
||||
else
|
||||
rm -f "$PID_FILE"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Starting $APP_NAME..."
|
||||
nohup java -jar "$APP_JAR" --spring.config.location="$CONFIG_FILE" > "$LOG_FILE" 2>&1 &
|
||||
echo $! > "$PID_FILE"
|
||||
echo "Application $APP_NAME started with PID $!."
|
||||
}
|
||||
|
||||
# 停止函数
|
||||
stop() {
|
||||
if [ -f "$PID_FILE" ]; then
|
||||
PID=$(cat "$PID_FILE")
|
||||
if ps -p "$PID" > /dev/null; then
|
||||
echo "Stopping $APP_NAME with PID $PID..."
|
||||
kill "$PID"
|
||||
rm -f "$PID_FILE"
|
||||
echo "Application $APP_NAME stopped."
|
||||
else
|
||||
echo "Application $APP_NAME is not running."
|
||||
rm -f "$PID_FILE"
|
||||
fi
|
||||
else
|
||||
echo "PID file not found. Application $APP_NAME may not be running."
|
||||
fi
|
||||
}
|
||||
|
||||
# 重启函数
|
||||
restart() {
|
||||
stop
|
||||
sleep 2
|
||||
start
|
||||
}
|
||||
|
||||
# 脚本入口
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -1,25 +1,34 @@
|
||||
package tech.riemann.ims.controller.platform.acl;
|
||||
|
||||
import club.zhcs.lina.starter.exception.BizException;
|
||||
import java.util.List;
|
||||
|
||||
import org.nutz.lang.Strings;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import club.zhcs.lina.starter.exception.BizException;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.random.R;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tech.riemann.ims.dto.response.PermissionInfo;
|
||||
import tech.riemann.ims.entity.acl.Permission;
|
||||
import tech.riemann.ims.entity.acl.Role;
|
||||
import tech.riemann.ims.service.acl.IRoleService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 角色 前端控制器
|
||||
@ -72,7 +81,6 @@ public class RoleController {
|
||||
throw BizException.create("更新角色失败!");
|
||||
}
|
||||
} else {
|
||||
role.setKey(R.UU16());
|
||||
if (roleService.save(role)) {
|
||||
return role;
|
||||
} else {
|
||||
|
@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@ -87,7 +86,6 @@ public class UserController {
|
||||
public User saveOrUpdateUser(@Validated @Parameter(description = "用户") @RequestBody User user) {
|
||||
if (user.getId() == null || user.getId() <= 0) {
|
||||
user.setPassword(PasswordUtils.randomSaltEncode(user.getPassword()));
|
||||
if(existName(user.getName())) throw BizException.create("用户名已经存在");
|
||||
if (userService.save(user)) {
|
||||
return user;
|
||||
} else {
|
||||
@ -102,13 +100,6 @@ public class UserController {
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("user/exist-name")
|
||||
@Operation(summary = "检查用户名是否存在,true存在,false不存在")
|
||||
public boolean existName(@NotBlank String name) {
|
||||
User one = userService.getOne(Wrappers.<User>lambdaQuery().eq(User::getName, name));
|
||||
return one != null;
|
||||
}
|
||||
|
||||
@DeleteMapping("user/{id}")
|
||||
@Operation(summary = "删除用户")
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
|
@ -1,31 +1,27 @@
|
||||
package tech.riemann.ims.controller.platform.material;
|
||||
|
||||
import club.zhcs.lina.starter.exception.BizException;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.util.StringUtil;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tech.riemann.ims.dto.request.ApplyInfo;
|
||||
import tech.riemann.ims.dto.request.AuditApplyInfo;
|
||||
import tech.riemann.ims.dto.request.ReviewDTO;
|
||||
import tech.riemann.ims.dto.response.*;
|
||||
import tech.riemann.ims.dto.response.ApplyDTO;
|
||||
import tech.riemann.ims.dto.response.ComparisonResDTO;
|
||||
import tech.riemann.ims.dto.response.StockDetailInfo;
|
||||
import tech.riemann.ims.entity.material.*;
|
||||
import tech.riemann.ims.enums.*;
|
||||
import tech.riemann.ims.service.material.*;
|
||||
import tech.riemann.ims.utils.ExcelUtil;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
@ -45,11 +41,7 @@ public class ApplyFormController {
|
||||
private final IMaterialService materialService;
|
||||
private final IStocktakingScanDetailService stocktakingScanDetailService;
|
||||
private final IStocktakingScanExceptionalDataService stocktakingScanExceptionalDataService;
|
||||
private final ITypeService typeService;
|
||||
private final IManualStockDetailService manualStockDetailService;
|
||||
|
||||
// 缓存需要审核的报废出库数据 key是申请id,value是材料库存详情列表
|
||||
private final Map<String, List<String>> scrapOutCacheMap = new HashMap<>();
|
||||
|
||||
@GetMapping("applies")
|
||||
@Operation(summary = "分页查询申请列表")
|
||||
@ -58,32 +50,9 @@ public class ApplyFormController {
|
||||
@Parameter(description = "页面大小") @RequestParam(name = "size", required = false, defaultValue = "10") int size,
|
||||
@Parameter(description = "申请类型(1入库 3出库 4盘点)") @RequestParam(name = "applyType") Integer applyType,
|
||||
@Parameter(description = "物料类型") @RequestParam(name = "type", required = false) String type,
|
||||
@Parameter(description = "编码/名称") @RequestParam(name = "key", required = false) String key) {
|
||||
String[] types = StringUtils.isNotBlank(type) ? type.split(",") : new String[0];
|
||||
IPage<ApplyDTO> result = applyFormService.search(page, size, applyType, List.of(types), key);
|
||||
result.getRecords().forEach(item -> item.setTypeName(typeService.getTypeName(item.getType())));
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping("apply/download-excel")
|
||||
@Operation(summary = "导出申请单列表")
|
||||
public void downloadExcel(@Parameter(description = "申请类型(1入库 3出库 4盘点)") @RequestParam(name = "applyType") Integer applyType,
|
||||
@Parameter(description = "物料类型") @RequestParam(name = "type", required = false) String type,
|
||||
@Parameter(description = "编码/名称") @RequestParam(name = "key", required = false) String key,
|
||||
HttpServletResponse response) {
|
||||
IPage<ApplyDTO> applyDTOIPage = searchPage(1, 10000, applyType, type, key);
|
||||
List<ApplyDTO> applyDTOList = applyDTOIPage.getRecords();
|
||||
// 导出excel
|
||||
String sheetName = "申请单列表";
|
||||
String excelName = "申请单列表";
|
||||
if (applyType == 1) {
|
||||
excelName = "入库申请单列表";
|
||||
sheetName = "入库";
|
||||
} else if (applyType == 3) {
|
||||
excelName = "出库申请单列表";
|
||||
sheetName = "出库";
|
||||
}
|
||||
ExcelUtil.exportExcel(response, excelName, sheetName, ApplyDTO.class, applyDTOList);
|
||||
@Parameter(description = "物料编码") @RequestParam(name = "code", required = false) String code,
|
||||
@Parameter(description = "物料名称") @RequestParam(name = "name", required = false) String name) {
|
||||
return applyFormService.search(page, size, applyType, type, code, name);
|
||||
}
|
||||
|
||||
@GetMapping("audit-applies")
|
||||
@ -98,30 +67,13 @@ public class ApplyFormController {
|
||||
return applyFormService.page(Page.of(page, size), Wrappers.<ApplyForm>lambdaQuery()
|
||||
.eq(auditType != null, ApplyForm::getAuditType, auditType)
|
||||
.eq(ApplyForm::getType, ApplyTypeEnum.AUDIT)
|
||||
.like(StringUtil.isNotBlank(taker), ApplyForm::getTaker, "%" + taker + "%")
|
||||
.ge(createDate != null, ApplyForm::getCreatedTime, createDate)
|
||||
.eq(taker != null, ApplyForm::getTaker, taker)
|
||||
.eq(createDate != null, ApplyForm::getCreatedTime, createDate)
|
||||
.in(reviewResults != null && !reviewResults.isEmpty(), ApplyForm::getReviewResult, reviewResults)
|
||||
.orderByDesc(ApplyForm::getCreatedTime)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("apply/audit/download-excel")
|
||||
@Operation(summary = "导出盘点申请单列表")
|
||||
public void downloadAuditExcel(@Parameter(description = "盘点类型") @RequestParam(name = "auditType", required = false) AuditTypeEnum auditType,
|
||||
@Parameter(description = "盘点人") @RequestParam(name = "taker", required = false) String taker,
|
||||
@Parameter(description = "创建日期") @RequestParam(name = "createDate", required = false) LocalDateTime createDate,
|
||||
@Parameter(description = "审核状态") @RequestParam(name = "reviewResults", required = false) List<ReviewResultEnum> reviewResults,
|
||||
HttpServletResponse response) {
|
||||
IPage<ApplyForm> applyFormIPage = searchAuditPage(1, 10000, auditType, taker, createDate, reviewResults);
|
||||
List<ApplyForm> applyFormList = applyFormIPage.getRecords();
|
||||
// 导出excel
|
||||
String excelName = "盘点申请单列表";
|
||||
String sheetName = "盘点";
|
||||
ExcelUtil.exportExcel(response, excelName, sheetName, ApplyForm.class, applyFormList);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("apply/{applyId}")
|
||||
@Operation(summary = "查询申请单详情")
|
||||
public ApplyInfo detail(@Parameter(description = "申请单ID") @PathVariable(name = "applyId") Integer applyId) {
|
||||
@ -141,24 +93,20 @@ public class ApplyFormController {
|
||||
|
||||
// 校验物料数量
|
||||
Map<Long, Integer> confirmMap = applyInfo.getApplyDetails().stream()
|
||||
.filter(ApplyDetail::getAssignRule)
|
||||
.filter(item -> item.getAssignRule() != AssignRuleEnum.LOW_VALUE)
|
||||
.collect(Collectors.toMap(ApplyDetail::getMaterialId, ApplyDetail::getConfirmQuantity));
|
||||
Map<Long, Long> dataMap = applyInfo.getDetailList().stream()
|
||||
.collect(Collectors.groupingBy(MaterialStockDetail::getMaterialId, Collectors.counting()));
|
||||
confirmMap.forEach((k, v) -> {
|
||||
Long l = dataMap.get(k);
|
||||
if (l == null || l.intValue() != v) {
|
||||
throw BizException.create("[" + k + "]物料数量不匹配");
|
||||
throw new IllegalArgumentException("[" + k + "]物料数量不匹配");
|
||||
}
|
||||
});
|
||||
// 新增申请单
|
||||
applyFormService.save(applyInfo.getApplyForm());
|
||||
for (ApplyDetail applyDetail : applyInfo.getApplyDetails()) {
|
||||
applyDetail.setApplyId(applyInfo.getApplyForm().getId());
|
||||
// 如果市无须赋码的情况,设置确认数量为申请数量
|
||||
if (!applyDetail.getAssignRule()) {
|
||||
applyDetail.setConfirmQuantity(applyDetail.getQuantity());
|
||||
}
|
||||
}
|
||||
applyDetailService.saveBatch(applyInfo.getApplyDetails());
|
||||
|
||||
@ -175,9 +123,9 @@ public class ApplyFormController {
|
||||
applyInfo.getApplyDetails().forEach(detail ->
|
||||
materialService.update(Wrappers.<Material>lambdaUpdate()
|
||||
.eq(Material::getId, detail.getMaterialId())
|
||||
.setSql(detail.getAssignRule(),
|
||||
.setSql(detail.getAssignRule() == AssignRuleEnum.HIGH_VALUE,
|
||||
"m_stock = m_stock + " + detail.getConfirmQuantity())
|
||||
.setSql(!detail.getAssignRule(),
|
||||
.setSql(detail.getAssignRule() == AssignRuleEnum.LOW_VALUE,
|
||||
"m_stock = m_stock + " + detail.getQuantity())
|
||||
));
|
||||
} else if (applyType == ApplyTypeEnum.LOAN_OUT) {
|
||||
@ -190,9 +138,9 @@ public class ApplyFormController {
|
||||
//修改物料库存数据
|
||||
applyInfo.getApplyDetails().forEach(detail -> materialService.update(Wrappers.<Material>lambdaUpdate()
|
||||
.eq(Material::getId, detail.getMaterialId())
|
||||
.setSql(detail.getAssignRule(),
|
||||
.setSql(detail.getAssignRule() == AssignRuleEnum.HIGH_VALUE,
|
||||
"m_stock = m_stock - " + detail.getConfirmQuantity())
|
||||
.setSql(!detail.getAssignRule(),
|
||||
.setSql(detail.getAssignRule() == AssignRuleEnum.LOW_VALUE,
|
||||
"m_stock = m_stock - " + detail.getQuantity())
|
||||
));
|
||||
} else if (applyType == ApplyTypeEnum.RETURN_RECEIPT) {
|
||||
@ -205,64 +153,15 @@ public class ApplyFormController {
|
||||
//修改物料库存数据
|
||||
applyInfo.getApplyDetails().forEach(detail -> materialService.update(Wrappers.<Material>lambdaUpdate()
|
||||
.eq(Material::getId, detail.getMaterialId())
|
||||
.setSql(detail.getAssignRule(),
|
||||
.setSql(detail.getAssignRule() == AssignRuleEnum.HIGH_VALUE,
|
||||
"m_stock = m_stock + " + detail.getConfirmQuantity())
|
||||
.setSql(!detail.getAssignRule(),
|
||||
.setSql(detail.getAssignRule() == AssignRuleEnum.LOW_VALUE,
|
||||
"m_stock = m_stock + " + detail.getQuantity())
|
||||
));
|
||||
} else if (applyType == ApplyTypeEnum.SCRAP_OUT) {
|
||||
// 将扫码的数据缓存起来方便下次使用
|
||||
List<String> list = applyInfo.getDetailList().stream().map(MaterialStockDetail::getBarcode).toList();
|
||||
scrapOutCacheMap.put(applyInfo.getApplyForm().getId().toString(), list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("scrap-out/{applyId}")
|
||||
@Operation(summary = "获取报废出库申请单")
|
||||
public List<ScrapOutApplyDTO> getScrapOutById(@Parameter(description = "申请单ID") @PathVariable(name = "applyId") Integer applyId) {
|
||||
List<ScrapOutApplyDTO> result = applyDetailService.getScrapOutById(applyId);
|
||||
result.forEach(item -> item
|
||||
.setTypeName(typeService.getTypeName(item.getType()))
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostMapping("scrap-out-review")
|
||||
@Operation(summary = "提交报废出库审核")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void submitScrapOutReview(@Parameter(description = "异常数据列表") @RequestBody ReviewDTO reviewDTO) {
|
||||
//修改申请状态
|
||||
applyFormService.update(Wrappers.<ApplyForm>lambdaUpdate()
|
||||
.set(ApplyForm::getReviewResult, reviewDTO.getReviewResult())
|
||||
.set(ApplyForm::getReviewRemark, reviewDTO.getRemark())
|
||||
.set(ApplyForm::getConfirm, Boolean.TRUE)
|
||||
.eq(ApplyForm::getId, reviewDTO.getApplyId()));
|
||||
if (reviewDTO.getReviewResult() == ReviewResultEnum.PASS) {
|
||||
// 修改物料状态
|
||||
List<String> barcodeList = scrapOutCacheMap.get(reviewDTO.getApplyId());
|
||||
if (barcodeList != null) {
|
||||
barcodeList.forEach(barcode -> materialStockDetailService.update(Wrappers.<MaterialStockDetail>lambdaUpdate()
|
||||
.set(MaterialStockDetail::getStatus, StockStatusEnum.SCRAP_OUT)
|
||||
.eq(MaterialStockDetail::getBarcode, barcode)));
|
||||
}
|
||||
}
|
||||
// 处理报废扣减库存
|
||||
List<ApplyDetail> applyDetails = applyDetailService.list(Wrappers.<ApplyDetail>lambdaQuery()
|
||||
.eq(ApplyDetail::getApplyId, reviewDTO.getApplyId()));
|
||||
if (!applyDetails.isEmpty()) {
|
||||
// 直接扣库存
|
||||
applyDetails.forEach(detail ->
|
||||
materialService.update(Wrappers.<Material>lambdaUpdate()
|
||||
.setSql("m_stock = m_stock - " + detail.getQuantity())
|
||||
.eq(Material::getId, detail.getMaterialId())
|
||||
)
|
||||
);
|
||||
}
|
||||
// 删除缓存
|
||||
scrapOutCacheMap.remove(reviewDTO.getApplyId());
|
||||
}
|
||||
|
||||
@PostMapping("audit-apply")
|
||||
@Operation(summary = "提交盘点申请单")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@ -270,55 +169,14 @@ public class ApplyFormController {
|
||||
ApplyForm applyForm = applyInfo.to();
|
||||
applyForm.setType(ApplyTypeEnum.AUDIT);
|
||||
applyFormService.save(applyForm);
|
||||
|
||||
List<Material> materials = materialService.listByIds(applyInfo.getIds());
|
||||
|
||||
materials.forEach(material -> applyDetailService.save(ApplyDetail.builder()
|
||||
.applyId(applyForm.getId())
|
||||
.materialId(material.getId())
|
||||
.quantity(material.getStock())
|
||||
.build()));
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("manual/check-data/{applyId}")
|
||||
@Operation(summary = "查询人工盘点选中物料的待核查数据")
|
||||
public List<Material> getManualCheckData(@Parameter(description = "申请单ID") @PathVariable(name = "applyId") Long applyId){
|
||||
List<ApplyDetail> details = applyDetailService.list(Wrappers.<ApplyDetail>lambdaQuery().eq(ApplyDetail::getApplyId, applyId));
|
||||
List<Long> materialIds = details.stream().map(ApplyDetail::getMaterialId).toList();
|
||||
if(materialIds.isEmpty()){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<Material> result = materialService.listByIds(materialIds);
|
||||
result.stream().filter(i -> !i.getAssignRule()).forEach(item -> item.setTypeName(typeService.getTypeName(item.getType())));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("manual/audit-apply")
|
||||
@Operation(summary = "提交人工盘点数据")
|
||||
public void submitManualStock(@Validated @Parameter(description = "人工盘点数据") @RequestBody List<ManualStockDetail> details) {
|
||||
if (details.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
manualStockDetailService.saveBatch(details);
|
||||
//修改状态
|
||||
applyFormService.update(Wrappers.<ApplyForm>lambdaUpdate()
|
||||
.eq(ApplyForm::getId, details.get(0).getApplyId())
|
||||
.set(ApplyForm::getReviewResult, ReviewResultEnum.WAIT_REVIEW));
|
||||
}
|
||||
|
||||
@GetMapping("manual/data/{applyId}")
|
||||
@Operation(summary = "获取人工盘点数据")
|
||||
public List<ManualStockDTO> getManualStock(@Parameter(description = "申请单ID") @PathVariable(name = "applyId") Long applyId) {
|
||||
List<ManualStockDTO> result = manualStockDetailService.getByApplyId(applyId);
|
||||
result.forEach(item -> item.setTypeName(typeService.getTypeName(item.getType())));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("wait-scan-data/{applyId}")
|
||||
@Operation(summary = "获取盘点的待扫码信息")
|
||||
public List<WaitScanInfo> getWaitScanData(@Parameter(description = "申请单ID") @PathVariable(name = "applyId") Long applyId) {
|
||||
return applyDetailService.getWaitScanData(applyId);
|
||||
}
|
||||
|
||||
@PostMapping("scan-data/{applyId}")
|
||||
@ -384,52 +242,20 @@ public class ApplyFormController {
|
||||
|
||||
@PostMapping("submit-review")
|
||||
@Operation(summary = "提交审核")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void submitReview(@Parameter(description = "异常数据列表") @RequestBody ReviewDTO reviewDTO) {
|
||||
applyFormService.update(Wrappers.<ApplyForm>lambdaUpdate()
|
||||
.set(ApplyForm::getReviewResult, reviewDTO.getReviewResult())
|
||||
.set(reviewDTO.getReviewResult() == ReviewResultEnum.PASS, ApplyForm::getConfirm, Boolean.TRUE)
|
||||
.set(ApplyForm::getReviewRemark, reviewDTO.getRemark())
|
||||
.eq(ApplyForm::getId, reviewDTO.getApplyId()));
|
||||
ApplyForm byId = applyFormService.getById(reviewDTO.getApplyId());
|
||||
if (byId.getAuditType() == AuditTypeEnum.MANUAL) {
|
||||
if (reviewDTO.getReviewResult() != ReviewResultEnum.PASS) {
|
||||
return;
|
||||
}
|
||||
List<ManualStockDetail> details = manualStockDetailService.list(Wrappers.<ManualStockDetail>lambdaQuery()
|
||||
.eq(ManualStockDetail::getApplyId, reviewDTO.getApplyId()));
|
||||
details.forEach(detail -> materialService.update(Wrappers.<Material>lambdaUpdate()
|
||||
.set(Material::getStock, detail.getManualStock())
|
||||
.eq(Material::getId, detail.getMaterialId())));
|
||||
return;
|
||||
}
|
||||
if (reviewDTO.getReviewResult() == ReviewResultEnum.PASS) {
|
||||
if(reviewDTO.getReviewResult() == ReviewResultEnum.PASS){
|
||||
//修改库存明细状态和库存数量
|
||||
List<StocktakingScanExceptionalData> list = stocktakingScanExceptionalDataService.list(Wrappers.<StocktakingScanExceptionalData>lambdaQuery()
|
||||
.eq(StocktakingScanExceptionalData::getApplyId, reviewDTO.getApplyId()));
|
||||
list.forEach(data -> {
|
||||
// 新入库 归还 丢失 需要处理
|
||||
if (data.getExceptionHandle() == HandleEnum.MARK_NEW) {
|
||||
// 新增库存明细 和 增加库存数量
|
||||
materialStockDetailService.save(MaterialStockDetail.builder()
|
||||
.applyId(null)
|
||||
.materialId(data.getMaterialId())
|
||||
.barcode(data.getBarcode())
|
||||
.status(StockStatusEnum.IN)
|
||||
.build());
|
||||
materialService.update(Wrappers.<Material>lambdaUpdate()
|
||||
.setSql("m_stock = m_stock + " + 1)
|
||||
.eq(Material::getId, data.getMaterialId()));
|
||||
} else if (data.getExceptionHandle() == HandleEnum.MARK_RETURN || data.getExceptionHandle() == HandleEnum.MARK_LOST) {
|
||||
materialStockDetailService.update(Wrappers.<MaterialStockDetail>lambdaUpdate()
|
||||
.set(MaterialStockDetail::getStatus, data.getExceptionHandle() == HandleEnum.MARK_RETURN
|
||||
? StockStatusEnum.IN : StockStatusEnum.LOST)
|
||||
.eq(MaterialStockDetail::getBarcode, data.getBarcode()));
|
||||
materialService.update(Wrappers.<Material>lambdaUpdate()
|
||||
.setSql(data.getExceptionHandle() == HandleEnum.MARK_RETURN, "m_stock = m_stock + " + 1)
|
||||
.setSql(data.getExceptionHandle() == HandleEnum.MARK_LOST, "m_stock = m_stock - " + 1)
|
||||
.eq(Material::getId, data.getMaterialId()));
|
||||
}
|
||||
// if(data.getExceptionHandle() == StocktakingExceptonalStatusEnum.SOCK_OUT_BUT_SCAN_EXIST){
|
||||
//
|
||||
// }
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -487,7 +313,7 @@ public class ApplyFormController {
|
||||
private Map<Long, List<MaterialStockDetail>> getStockMap(Long applyId) {
|
||||
ApplyForm applyForm = applyFormService.getById(applyId);
|
||||
List<Long> materialIds = new ArrayList<>();
|
||||
if (applyForm.getAuditType() == AuditTypeEnum.MANUAL) {
|
||||
if (applyForm.getAuditType() == AuditTypeEnum.PARTIAL) {
|
||||
// 部分盘点
|
||||
List<ApplyDetail> applyDetails = applyDetailService.list(Wrappers.<ApplyDetail>lambdaQuery().eq(ApplyDetail::getApplyId, applyId));
|
||||
materialIds = applyDetails.stream().map(ApplyDetail::getMaterialId).toList();
|
||||
|
@ -10,10 +10,8 @@ import com.google.common.cache.LoadingCache;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.random.R;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@ -21,12 +19,8 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tech.riemann.ims.entity.material.Material;
|
||||
import tech.riemann.ims.service.material.IMaterialService;
|
||||
import tech.riemann.ims.service.material.ITypeService;
|
||||
import tech.riemann.ims.utils.BarcodeUtil;
|
||||
import tech.riemann.ims.utils.ExcelUtil;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@ -42,7 +36,6 @@ import java.util.concurrent.TimeUnit;
|
||||
public class MaterialController {
|
||||
|
||||
private final IMaterialService materialService;
|
||||
private final ITypeService typeService;
|
||||
|
||||
LoadingCache<String, String> cache = CacheBuilder.newBuilder()
|
||||
.concurrencyLevel(8)
|
||||
@ -50,7 +43,7 @@ public class MaterialController {
|
||||
.initialCapacity(10)
|
||||
.maximumSize(300)
|
||||
.recordStats()
|
||||
.build(new CacheLoader<String, String>() {
|
||||
.build(new CacheLoader<String,String>() {
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
@ -65,36 +58,23 @@ public class MaterialController {
|
||||
public IPage<Material> materials(
|
||||
@Parameter(description = "页码") @RequestParam(required = false, defaultValue = "1") int page,
|
||||
@Parameter(description = "页面大小") @RequestParam(required = false, defaultValue = "10") int size,
|
||||
@Parameter(description = "类型") @RequestParam(required = false, defaultValue = "") String type,
|
||||
@Parameter(description = "类型") @RequestParam(required = false, defaultValue = "") Integer type,
|
||||
@Parameter(description = "搜索关键词") @RequestParam(required = false, defaultValue = "") String key) {
|
||||
String[] types = StringUtils.isNotBlank(type) ? type.split(",") : new String[0];
|
||||
Page<Material> result = materialService.getPage(Page.of(page, size), List.of(types),key);
|
||||
result.getRecords().forEach(item -> item.setTypeName(typeService.getTypeName(item.getType())));
|
||||
return result;
|
||||
boolean hasLike = Strings.isNotBlank(key);
|
||||
key = String.format("%%%s%%", key);
|
||||
return materialService.page(Page.of(page, size),Wrappers.<Material>lambdaQuery()
|
||||
|
||||
.like(hasLike, Material::getName, key)
|
||||
.or()
|
||||
.like(hasLike, Material::getCode, key)
|
||||
.eq(type != null, Material::getType, type)
|
||||
.orderByDesc(Material::getUpdatedTime));
|
||||
}
|
||||
|
||||
@GetMapping("material/download-excel")
|
||||
@Operation(summary = "导出物料列表")
|
||||
public void downloadExcel(@Parameter(description = "类型") @RequestParam(required = false, defaultValue = "") String type,
|
||||
@Parameter(description = "搜索关键词") @RequestParam(required = false, defaultValue = "") String key,
|
||||
HttpServletResponse response) {
|
||||
String[] types = StringUtils.isNotBlank(type) ? type.split(",") : new String[0];
|
||||
Page<Material> result = materialService.getPage(Page.of(1, 10000), List.of(types),key);
|
||||
result.getRecords().forEach(item -> item.setTypeName(typeService.getTypeName(item.getType())));
|
||||
ExcelUtil.exportExcel(response, "物料列表-" + System.currentTimeMillis(), "库存", Material.class, result.getRecords());
|
||||
}
|
||||
|
||||
@PostMapping("material/list")
|
||||
@GetMapping("material/list")
|
||||
@Operation(summary = "查询所有物料列表")
|
||||
public List<Material> all(@Parameter(description = "类型") @RequestParam(required = false, defaultValue = "") String type,
|
||||
@Parameter(description = "是否赋码") @RequestParam(required = false) Boolean assignRule) {
|
||||
String[] types = StringUtils.isNotBlank(type) ? type.split(",") : new String[0];
|
||||
List<Material> materials = materialService.queryLikeRight(List.of(types));
|
||||
if (assignRule != null) {
|
||||
materials.removeIf(item -> assignRule != item.getAssignRule());
|
||||
}
|
||||
materials.forEach(item -> item.setTypeName(typeService.getTypeName(item.getType())));
|
||||
return materials;
|
||||
public List<Material> all(){
|
||||
return materialService.list();
|
||||
}
|
||||
|
||||
@GetMapping("material/{id}")
|
||||
@ -115,7 +95,7 @@ public class MaterialController {
|
||||
throw BizException.create("保存物料失败!");
|
||||
}
|
||||
} else {
|
||||
if (materialService.update(material, Wrappers.<Material>lambdaUpdate().eq(Material::getId, material.getId()))) {
|
||||
if (materialService.update(material, Wrappers.<Material> lambdaUpdate().eq(Material::getId, material.getId()))) {
|
||||
return material;
|
||||
} else {
|
||||
throw BizException.create("更新物料失败!");
|
||||
@ -126,8 +106,7 @@ public class MaterialController {
|
||||
private String getCode() {
|
||||
String code;
|
||||
while (true) {
|
||||
code = String.valueOf(R.random(10000, 99999));
|
||||
// 需要和前端scan-form.vue中的autoInsertOneRow方法的切割联动修改
|
||||
code = String.valueOf(R.random(100000, 999999));
|
||||
try {
|
||||
// 如果代码已经存在,继续循环
|
||||
if (Strings.isBlank(cache.get(code))) {
|
||||
@ -148,21 +127,4 @@ public class MaterialController {
|
||||
throw BizException.create("删除物料失败!");
|
||||
}
|
||||
}
|
||||
|
||||
// 批量生成条形码
|
||||
@PostMapping("material/{id}/generate-barcodes")
|
||||
@Operation(summary = "批量生成条形码")
|
||||
public List<String> generateBarcodes(@Parameter(description = "物料id", required = true) @PathVariable Long id,
|
||||
@Parameter(description = "条形码数量", required = true) @RequestParam(name = "count") int count) {
|
||||
List<String> res = new ArrayList<>();
|
||||
Material byId = materialService.getById(id);
|
||||
if (byId != null && count > 0) {
|
||||
String code = byId.getCode();
|
||||
while (count-- > 0) {
|
||||
res.add(code + BarcodeUtil.generateBarcode());
|
||||
}
|
||||
}
|
||||
log.info("生成条形码成功,条形码列表:{}", res);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
@ -1,82 +0,0 @@
|
||||
package tech.riemann.ims.controller.platform.material;
|
||||
|
||||
import club.zhcs.lina.starter.exception.BizException;
|
||||
import club.zhcs.lina.utils.enums.Codebook;
|
||||
import club.zhcs.lina.utils.enums.ICodeBook;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tech.riemann.ims.dto.response.TypeTree;
|
||||
import tech.riemann.ims.entity.material.Type;
|
||||
import tech.riemann.ims.service.material.ITypeService;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2025/3/2 14:14
|
||||
*/
|
||||
@RestController
|
||||
@Slf4j
|
||||
@Tag(name = "Type", description = "物料类型管理")
|
||||
@RequiredArgsConstructor
|
||||
public class TypeController {
|
||||
|
||||
private final ITypeService typeService;
|
||||
|
||||
@GetMapping("areas")
|
||||
@Operation(summary = "查询类型")
|
||||
public List<Type> areas(
|
||||
@Parameter(description = "搜索关键词") @RequestParam(required = false, defaultValue = "") String key) {
|
||||
boolean hasLike = Strings.isNotBlank(key);
|
||||
key = String.format("%%%s%%", key);
|
||||
return typeService.list(
|
||||
Wrappers.<Type>lambdaQuery()
|
||||
.like(hasLike, Type::getName, key));
|
||||
}
|
||||
|
||||
@PostMapping("area")
|
||||
@Operation(summary = "增加/更新地区")
|
||||
public Type addAndModify(@Validated @Parameter(description = "类型") @RequestBody Type area) {
|
||||
if (area.getId() == null) {
|
||||
typeService.save(area);
|
||||
} else {
|
||||
typeService.updateById(area);
|
||||
}
|
||||
return area;
|
||||
}
|
||||
|
||||
@DeleteMapping("area/{id}")
|
||||
@Operation(summary = "删除类型")
|
||||
public void deleteArea(@Parameter(description = "id", required = true) @PathVariable long id) {
|
||||
if (!typeService.removeById(id)) {
|
||||
throw BizException.create("删除失败!");
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("area/levels")
|
||||
@Operation(summary = "级别")
|
||||
public List<Codebook> levels() {
|
||||
return Arrays.stream(Type.Level.values()).map(ICodeBook::build).toList();
|
||||
}
|
||||
|
||||
@GetMapping("area/trees")
|
||||
@Operation(summary = "类型树")
|
||||
public List<TypeTree> trees() {
|
||||
List<Type> all = typeService.list();
|
||||
List<TypeTree> data = all.stream().map(area -> TypeTree.builder()
|
||||
.value(area.getNo())
|
||||
.label(area.getName())
|
||||
.parentNo(area.getParentNo())
|
||||
.build())
|
||||
.toList();
|
||||
return TypeTree.buildTree(data, "0");
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
package tech.riemann.ims.converter;
|
||||
|
||||
import cn.idev.excel.converters.Converter;
|
||||
import cn.idev.excel.metadata.GlobalConfiguration;
|
||||
import cn.idev.excel.metadata.data.WriteCellData;
|
||||
import cn.idev.excel.metadata.property.ExcelContentProperty;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2025/3/15 18:23
|
||||
*/
|
||||
public class BooleanConverter implements Converter<Boolean> {
|
||||
|
||||
@Override
|
||||
public WriteCellData<?> convertToExcelData(Boolean value,
|
||||
ExcelContentProperty contentProperty,
|
||||
GlobalConfiguration globalConfiguration) {
|
||||
|
||||
return new WriteCellData<>(Boolean.TRUE.equals(value) ? "是" : "否");
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package tech.riemann.ims.converter;
|
||||
|
||||
import club.zhcs.lina.utils.enums.ICodeBook;
|
||||
import cn.idev.excel.converters.Converter;
|
||||
import cn.idev.excel.metadata.GlobalConfiguration;
|
||||
import cn.idev.excel.metadata.data.WriteCellData;
|
||||
import cn.idev.excel.metadata.property.ExcelContentProperty;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2025/3/15 18:23
|
||||
*/
|
||||
public class ICodeBookConverter implements Converter<ICodeBook> {
|
||||
|
||||
@Override
|
||||
public WriteCellData<?> convertToExcelData(ICodeBook value,
|
||||
ExcelContentProperty contentProperty,
|
||||
GlobalConfiguration globalConfiguration) {
|
||||
|
||||
return new WriteCellData<>(value.getDescription());
|
||||
}
|
||||
}
|
@ -23,9 +23,6 @@ public class AuditApplyInfo extends ApplyForm {
|
||||
@Schema(description = "物料ids")
|
||||
private List<String> ids;
|
||||
|
||||
@Schema(description = "物料类型")
|
||||
private List<String> types;
|
||||
|
||||
|
||||
public ApplyForm to(){
|
||||
return Json.fromJson(ApplyForm.class, Json.toJson(this));
|
||||
|
@ -1,20 +1,11 @@
|
||||
package tech.riemann.ims.dto.response;
|
||||
|
||||
import club.zhcs.lina.utils.enums.Codebook;
|
||||
import cn.idev.excel.annotation.ExcelIgnore;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import com.fasterxml.jackson.annotation.JsonGetter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.nutz.json.JsonField;
|
||||
import tech.riemann.ims.converter.BooleanConverter;
|
||||
import tech.riemann.ims.converter.ICodeBookConverter;
|
||||
import tech.riemann.ims.enums.ApplyTypeEnum;
|
||||
import tech.riemann.ims.enums.ReviewResultEnum;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
@ -26,87 +17,34 @@ import tech.riemann.ims.enums.ReviewResultEnum;
|
||||
@NoArgsConstructor
|
||||
public class ApplyDTO {
|
||||
|
||||
@Schema(description = "申请id")
|
||||
@ExcelIgnore
|
||||
private Long applyId;
|
||||
|
||||
|
||||
@Schema(description = "申请类型")
|
||||
@ExcelProperty(value = "申请类型", converter = ICodeBookConverter.class)
|
||||
@ColumnWidth(40)
|
||||
private ApplyTypeEnum applyType;
|
||||
|
||||
@Schema(description = "物料名称")
|
||||
@ExcelProperty("物料名称")
|
||||
@ColumnWidth(40)
|
||||
private String name;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
@ExcelProperty("物料编码")
|
||||
@ColumnWidth(40)
|
||||
private String code;
|
||||
|
||||
@Schema(description = "物料类型")
|
||||
@ExcelIgnore
|
||||
private String type;
|
||||
|
||||
@Schema(description = "类型名称")
|
||||
@ExcelProperty("类型名称")
|
||||
@ColumnWidth(40)
|
||||
private String typeName;
|
||||
|
||||
@Schema(description = "物料规格")
|
||||
@ExcelProperty("物料规格")
|
||||
@ColumnWidth(40)
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "申请人")
|
||||
@ExcelProperty("申请人")
|
||||
@ColumnWidth(40)
|
||||
private String applicant;
|
||||
|
||||
@Schema(description = "审核人")
|
||||
@ExcelProperty("审核人")
|
||||
@ColumnWidth(40)
|
||||
private String reviewer;
|
||||
|
||||
@Schema(description = "申请日期")
|
||||
@ExcelProperty("申请日期")
|
||||
@ColumnWidth(40)
|
||||
private String applyDate;
|
||||
|
||||
@Schema(description = "申请数量")
|
||||
@ExcelProperty("申请数量")
|
||||
@ColumnWidth(40)
|
||||
private String applyNum;
|
||||
|
||||
@Schema(description = "确认数量")
|
||||
@ExcelProperty("确认数量")
|
||||
@ColumnWidth(40)
|
||||
private String confirmNum;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
@ColumnWidth(40)
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "是否确认")
|
||||
@ExcelProperty(value = "是否确认",converter = BooleanConverter.class)
|
||||
@ColumnWidth(40)
|
||||
private Boolean confirm;
|
||||
|
||||
@Schema(description = "审核状态")
|
||||
@ExcelProperty(value = "审核状态", converter = ICodeBookConverter.class)
|
||||
@ColumnWidth(40)
|
||||
private ReviewResultEnum reviewResult;
|
||||
|
||||
@JsonGetter
|
||||
@JsonField
|
||||
public Codebook getApplyTypeInfo() {
|
||||
return applyType == null ? null : applyType.build();
|
||||
}
|
||||
|
||||
public void setApplyTypeInfo(Codebook areaUnitInfo) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,54 +0,0 @@
|
||||
package tech.riemann.ims.dto.response;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2025/3/9 19:16
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ManualStockDTO {
|
||||
|
||||
@Schema(description = "编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称" )
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private String type;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String typeName;
|
||||
|
||||
@Schema(description = "价格")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "规格" )
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "申请id")
|
||||
private Long applyId;
|
||||
|
||||
@Schema(description = "物料id")
|
||||
private Long materialId;
|
||||
|
||||
@Schema(description = "库存数量")
|
||||
private Integer stock;
|
||||
|
||||
@Schema(description = "手动核实库存数量")
|
||||
private Integer manualStock;
|
||||
|
||||
@Schema(description = "异常原因")
|
||||
private String msg;
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
package tech.riemann.ims.dto.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2025/3/15 10:39
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class ScrapOutApplyDTO {
|
||||
|
||||
@Schema(description = "物料名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "类型名称")
|
||||
private String typeName;
|
||||
|
||||
@Schema(description = "物料规格")
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "单价")
|
||||
private String price;
|
||||
|
||||
@Schema(description = "申请人")
|
||||
private String applicant;
|
||||
|
||||
@Schema(description = "确认数量")
|
||||
private Integer confirmQuantity;
|
||||
|
||||
@Schema(description = "条码集合")
|
||||
private String barcodeList;
|
||||
|
||||
@Schema(description = "报废原因")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
package tech.riemann.ims.dto.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2025/1/18 19:20
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TypeTree {
|
||||
@Schema(description = "类型编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String value;
|
||||
@Schema(description = "类型名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String label;
|
||||
private String parentNo;
|
||||
private List<TypeTree> children;
|
||||
|
||||
|
||||
public static List<TypeTree> buildTree(List<TypeTree> data, String root) {
|
||||
return data.stream()
|
||||
.filter(t -> Objects.equals(t.getParentNo(), root))
|
||||
.peek(t -> t.setChildren(buildTree(data, t.getValue()))).
|
||||
collect(Collectors.toList());
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package tech.riemann.ims.dto.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/12/11 14:07
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class WaitScanInfo {
|
||||
|
||||
@Schema(description = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "物料数量")
|
||||
private Integer count;
|
||||
}
|
@ -1,10 +1,17 @@
|
||||
package tech.riemann.ims.entity;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnore;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import org.nutz.dao.entity.annotation.Column;
|
||||
import org.nutz.dao.entity.annotation.Comment;
|
||||
import org.nutz.dao.entity.annotation.Id;
|
||||
import org.nutz.spring.boot.service.entity.Entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder.Default;
|
||||
@ -13,13 +20,6 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.nutz.dao.entity.annotation.Column;
|
||||
import org.nutz.dao.entity.annotation.Comment;
|
||||
import org.nutz.dao.entity.annotation.Id;
|
||||
import org.nutz.spring.boot.service.entity.Entity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -37,26 +37,22 @@ public class IdBaseEntity extends Entity {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@TableId(type = IdType.AUTO)
|
||||
@ExcelIgnore
|
||||
private Long id;
|
||||
|
||||
@Column("created_time")
|
||||
@Comment("创建时间")
|
||||
@TableField("created_time")
|
||||
@Default
|
||||
@ExcelIgnore
|
||||
protected LocalDateTime createdTime = LocalDateTime.now();
|
||||
|
||||
@Column("updated_time")
|
||||
@TableField("updated_time")
|
||||
@Comment("最后更新时间")
|
||||
@Default
|
||||
@ExcelIgnore
|
||||
protected LocalDateTime updatedTime = LocalDateTime.now();
|
||||
|
||||
@Schema(description = "创建人")
|
||||
@ -64,7 +60,6 @@ public class IdBaseEntity extends Entity {
|
||||
@TableField("created_by")
|
||||
@Comment("创建人")
|
||||
@JsonIgnore
|
||||
@ExcelIgnore
|
||||
protected String createdBy;
|
||||
|
||||
@Schema(description = "更新人")
|
||||
@ -72,7 +67,6 @@ public class IdBaseEntity extends Entity {
|
||||
@TableField("updated_by")
|
||||
@Comment("更新人")
|
||||
@JsonIgnore
|
||||
@ExcelIgnore
|
||||
protected String updatedBy;
|
||||
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public class Role extends IdBaseEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "角色key,英文,用来做业务")
|
||||
@Schema(description = "角色key,英文,用来做业务", requiredMode = RequiredMode.REQUIRED)
|
||||
@TableField("r_key")
|
||||
@Column("r_key")
|
||||
@Comment("角色key,英文,用来做业务")
|
||||
|
@ -12,6 +12,7 @@ import lombok.experimental.FieldNameConstants;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import tech.riemann.ims.entity.IdBaseEntity;
|
||||
import tech.riemann.ims.enums.AssignRuleEnum;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
@ -43,12 +44,8 @@ public class ApplyDetail extends IdBaseEntity {
|
||||
@ColDefine(notNull = false)
|
||||
private Long applyId;
|
||||
|
||||
@Schema(description = "是否需要赋码", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("ad_assign_rule")
|
||||
@Column("ad_assign_rule")
|
||||
@Comment("是否需要赋码")
|
||||
@ColDefine(notNull = false)
|
||||
private Boolean assignRule;
|
||||
@TableField(exist = false)
|
||||
private AssignRuleEnum assignRule;
|
||||
|
||||
@Schema(description = "物料Id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("ad_material_id")
|
||||
|
@ -1,8 +1,5 @@
|
||||
package tech.riemann.ims.entity.material;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnore;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@ -14,7 +11,6 @@ import lombok.experimental.Accessors;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import tech.riemann.ims.converter.ICodeBookConverter;
|
||||
import tech.riemann.ims.entity.IdBaseEntity;
|
||||
import tech.riemann.ims.enums.ApplyTypeEnum;
|
||||
import tech.riemann.ims.enums.AuditTypeEnum;
|
||||
@ -49,16 +45,13 @@ public class ApplyForm extends IdBaseEntity {
|
||||
@Column("af_type")
|
||||
@Comment("类型")
|
||||
@ColDefine(type = ColType.INT)
|
||||
@ExcelIgnore
|
||||
private ApplyTypeEnum type;
|
||||
|
||||
@Schema(description = "盘点类型(1: 扫码 2: 人工)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@Schema(description = "盘点类型(1: 全盘 2: 部分盘点)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("af_audit_type")
|
||||
@Column("af_audit_type")
|
||||
@Comment("盘点类型")
|
||||
@ColDefine(type = ColType.INT)
|
||||
@ExcelProperty(value = "盘点类型",converter = ICodeBookConverter.class)
|
||||
@ColumnWidth(40)
|
||||
private AuditTypeEnum auditType;
|
||||
|
||||
@Schema(description = "申请人", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@ -66,8 +59,6 @@ public class ApplyForm extends IdBaseEntity {
|
||||
@Column("af_applicant")
|
||||
@Comment("申请人")
|
||||
@ColDefine(notNull = false, width = 128, precision = 0)
|
||||
@ExcelProperty("申请人")
|
||||
@ColumnWidth(40)
|
||||
private String applicant;
|
||||
|
||||
@Schema(description = "盘点审核人", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@ -75,8 +66,6 @@ public class ApplyForm extends IdBaseEntity {
|
||||
@Column("af_reviewer")
|
||||
@Comment("盘点审核人")
|
||||
@ColDefine(notNull = false, width = 128, precision = 0)
|
||||
@ExcelProperty("盘点审核人")
|
||||
@ColumnWidth(40)
|
||||
private String reviewer;
|
||||
|
||||
@Schema(description = "盘点人", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@ -84,8 +73,6 @@ public class ApplyForm extends IdBaseEntity {
|
||||
@Column("af_taker")
|
||||
@Comment("盘点人")
|
||||
@ColDefine(notNull = false, width = 128, precision = 0)
|
||||
@ExcelProperty("盘点人")
|
||||
@ColumnWidth(40)
|
||||
private String taker;
|
||||
|
||||
@Schema(description = "申请日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@ -93,8 +80,6 @@ public class ApplyForm extends IdBaseEntity {
|
||||
@Column("af_apply_date")
|
||||
@Comment("申请日期")
|
||||
@ColDefine(type = ColType.DATETIME, notNull = false, width = 128, precision = 0)
|
||||
@ExcelProperty("申请日期")
|
||||
@ColumnWidth(40)
|
||||
private LocalDateTime applyDate;
|
||||
|
||||
@Schema(description = "是否确认(0: 未确认 1: 已确认)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@ -102,7 +87,6 @@ public class ApplyForm extends IdBaseEntity {
|
||||
@Column("af_is_confirm")
|
||||
@Comment("是否确认")
|
||||
@ColDefine(type = ColType.BOOLEAN, notNull = false, width = 128, precision = 0)
|
||||
@ExcelIgnore
|
||||
private Boolean confirm;
|
||||
|
||||
@Schema(description = "审核意见", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@ -110,8 +94,6 @@ public class ApplyForm extends IdBaseEntity {
|
||||
@Column("af_review_remark")
|
||||
@Comment("审核意见")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
@ExcelProperty("审核意见")
|
||||
@ColumnWidth(80)
|
||||
private String reviewRemark;
|
||||
|
||||
@Schema(description = "审核结果(1-待扫码 2-待提交 3-待审核 4-审核通过 5退回)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@ -119,8 +101,6 @@ public class ApplyForm extends IdBaseEntity {
|
||||
@Column("af_review_result")
|
||||
@Comment("审核结果(1-待扫码 2-待提交 3-待审核 4-审核通过 5退回)")
|
||||
@ColDefine(notNull = false, width = 128, precision = 0)
|
||||
@ExcelProperty(value = "审核结果", converter = ICodeBookConverter.class)
|
||||
@ColumnWidth(40)
|
||||
private ReviewResultEnum reviewResult;
|
||||
|
||||
}
|
||||
|
@ -1,72 +0,0 @@
|
||||
package tech.riemann.ims.entity.material;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import tech.riemann.ims.entity.IdBaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2025/3/9 18:53
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@FieldNameConstants
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName("t_manual_stock_detail")
|
||||
@Table("t_manual_stock_detail")
|
||||
@Comment("物料")
|
||||
@Schema(name = "ManualStockDetail", description = "人工手动核实物料库存明细")
|
||||
public class ManualStockDetail extends IdBaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "申请id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("m_apply_id")
|
||||
@Column("m_apply_id")
|
||||
@Comment("申请id")
|
||||
@ColDefine(notNull = false, width = 19, precision = 0)
|
||||
private Long applyId;
|
||||
|
||||
@Schema(description = "物料id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("m_material_id")
|
||||
@Column("m_material_id")
|
||||
@Comment("物料id")
|
||||
@ColDefine(notNull = false, width = 19, precision = 0)
|
||||
private Long materialId;
|
||||
|
||||
@Schema(description = "库存数量", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("m_stock")
|
||||
@Column("m_stock")
|
||||
@Comment("库存数量")
|
||||
@ColDefine(notNull = false, type = ColType.INT)
|
||||
private Integer stock;
|
||||
|
||||
@Schema(description = "手动核实库存数量", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("m_manual_stock")
|
||||
@Column("m_manual_stock")
|
||||
@Comment("手动核实库存数量")
|
||||
@ColDefine(notNull = false, type = ColType.INT)
|
||||
private Integer manualStock;
|
||||
|
||||
@Schema(description = "异常原因", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("m_msg")
|
||||
@Column("m_msg")
|
||||
@Comment("异常原因")
|
||||
@ColDefine(notNull = false)
|
||||
private String msg;
|
||||
}
|
@ -1,8 +1,5 @@
|
||||
package tech.riemann.ims.entity.material;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnore;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@ -14,11 +11,10 @@ import lombok.experimental.Accessors;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import tech.riemann.ims.converter.BooleanConverter;
|
||||
import tech.riemann.ims.entity.IdBaseEntity;
|
||||
import tech.riemann.ims.enums.AssignRuleEnum;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@ -41,8 +37,6 @@ public class Material extends IdBaseEntity {
|
||||
@Column("m_code")
|
||||
@Comment("编码")
|
||||
@ColDefine(notNull = false, width = 128, precision = 0)
|
||||
@ExcelProperty("物料编码")
|
||||
@ColumnWidth(40)
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@ -50,48 +44,27 @@ public class Material extends IdBaseEntity {
|
||||
@Column("m_name")
|
||||
@Comment("名称")
|
||||
@ColDefine(notNull = false, width = 128, precision = 0)
|
||||
@ExcelProperty("物料名称")
|
||||
@ColumnWidth(60)
|
||||
private String name;
|
||||
|
||||
@Schema(description = "是否赋码", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@Schema(description = "赋码规则(2-低值易耗品(不参与赋码) 1-高价值工具类(参与唯一赋码)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("m_assign_rule")
|
||||
@Column("m_assign_rule")
|
||||
@Comment("赋码规则")
|
||||
@ColDefine(notNull = false, type = ColType.INT)
|
||||
@ExcelProperty(value = "是否赋码",converter = BooleanConverter.class)
|
||||
@ColumnWidth(40)
|
||||
private Boolean assignRule; // 0-低值易耗品(不参与赋码) 1-高价值工具类(参与唯一赋码)
|
||||
private AssignRuleEnum assignRule; // 0-低值易耗品(不参与赋码) 1-高价值工具类(参与唯一赋码)
|
||||
|
||||
@Schema(description = "类型", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("m_type")
|
||||
@Column("m_type")
|
||||
@Comment("类型")
|
||||
@ColDefine(notNull = false, width = 128, precision = 0)
|
||||
@ExcelIgnore
|
||||
private String type;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ExcelProperty("物料类型")
|
||||
@ColumnWidth(40)
|
||||
private String typeName;
|
||||
|
||||
@Schema(description = "价格", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("m_price")
|
||||
@Column("m_price")
|
||||
@Comment("价格")
|
||||
@ColDefine(notNull = false, width = 18, precision = 0)
|
||||
@ExcelProperty("价格")
|
||||
@ColumnWidth(40)
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "规格", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("m_spec")
|
||||
@Column("m_spec")
|
||||
@Comment("规格")
|
||||
@ColDefine(notNull = false, width = 128, precision = 0)
|
||||
@ExcelProperty("物料型号")
|
||||
@ColumnWidth(40)
|
||||
private String spec;
|
||||
|
||||
|
||||
@ -100,8 +73,6 @@ public class Material extends IdBaseEntity {
|
||||
@Column("m_stock")
|
||||
@Comment("库存数量")
|
||||
@ColDefine(notNull = false, type = ColType.INT)
|
||||
@ExcelProperty("库存数量")
|
||||
@ColumnWidth(40)
|
||||
private Integer stock;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@ -109,8 +80,6 @@ public class Material extends IdBaseEntity {
|
||||
@Column("m_description")
|
||||
@Comment("备注")
|
||||
@ColDefine(notNull = false, width = 500, precision = 0)
|
||||
@ExcelProperty("备注")
|
||||
@ColumnWidth(40)
|
||||
private String description;
|
||||
|
||||
|
||||
|
@ -1,90 +0,0 @@
|
||||
package tech.riemann.ims.entity.material;
|
||||
|
||||
import club.zhcs.lina.utils.enums.Codebook;
|
||||
import club.zhcs.lina.utils.enums.ICodeBook;
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonGetter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.nutz.dao.entity.annotation.ColDefine;
|
||||
import org.nutz.dao.entity.annotation.Column;
|
||||
import org.nutz.dao.entity.annotation.Comment;
|
||||
import org.nutz.dao.entity.annotation.Table;
|
||||
import org.nutz.json.JsonField;
|
||||
import tech.riemann.ims.entity.IdBaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2025/3/2 14:07
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@FieldNameConstants
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName("t_type")
|
||||
@Table("t_type")
|
||||
@Comment("类型")
|
||||
@Schema(name = "Type", description = "类型")
|
||||
public class Type extends IdBaseEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "类型编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@TableField("a_no")
|
||||
@Column("a_no")
|
||||
@Comment("类型编码")
|
||||
@ColDefine(notNull = true, width = 10, precision = 0)
|
||||
private String no;
|
||||
|
||||
@Schema(description = "类型名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@TableField("a_name")
|
||||
@Column("a_name")
|
||||
@Comment("类型名称")
|
||||
@ColDefine(notNull = true, width = 255, precision = 0)
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类型级别", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@TableField("a_level")
|
||||
@Column("a_level")
|
||||
@Comment("类型级别")
|
||||
@ColDefine(notNull = true, width = 10, precision = 0)
|
||||
private Level level;
|
||||
|
||||
@Schema(description = "上级类型编码", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@TableField("a_parent_no")
|
||||
@Column("a_parent_no")
|
||||
@Comment("上级类型编码")
|
||||
@ColDefine(notNull = false, width = 10, precision = 0)
|
||||
private String parentNo;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum Level implements ICodeBook {
|
||||
ONE("ONE", "一级"),
|
||||
TWO("TWO", "二级"),
|
||||
;
|
||||
|
||||
@EnumValue
|
||||
final String code;
|
||||
final String description;
|
||||
}
|
||||
|
||||
@JsonGetter
|
||||
@JsonField
|
||||
public Codebook getLevelInfo() {
|
||||
return level == null ? null : level.build();
|
||||
}
|
||||
|
||||
public void setLevelInfo(Codebook areaLevel) {
|
||||
}
|
||||
}
|
@ -13,11 +13,10 @@ import lombok.Getter;
|
||||
@AllArgsConstructor
|
||||
public enum ApplyTypeEnum implements ICodeBook {
|
||||
|
||||
PURCHASE_RECEIPT("1", "采购入库"),
|
||||
RETURN_RECEIPT("2", "归还入库"),
|
||||
LOAN_OUT("3", "外借出库"),
|
||||
AUDIT("4", "盘点"),
|
||||
SCRAP_OUT("5", "报废出库"),
|
||||
PURCHASE_RECEIPT("1", "采购入库申请"),
|
||||
RETURN_RECEIPT("2", "归还入库申请"),
|
||||
LOAN_OUT("3", "外借出库申请"),
|
||||
AUDIT("4", "盘点申请"),
|
||||
;
|
||||
|
||||
@EnumValue
|
||||
|
@ -13,8 +13,8 @@ import lombok.Getter;
|
||||
@AllArgsConstructor
|
||||
public enum AuditTypeEnum implements ICodeBook {
|
||||
|
||||
SCAN("1", "扫码盘点"),
|
||||
MANUAL("2", "人工盘点"),
|
||||
ALL("1", "全部盘点"),
|
||||
PARTIAL("2", "部分盘点")
|
||||
;
|
||||
|
||||
@EnumValue
|
||||
|
@ -14,25 +14,13 @@ import lombok.Getter;
|
||||
public enum HandleEnum implements ICodeBook {
|
||||
|
||||
|
||||
//SOCK_IN_BUT_SCAN_NOT_EXIST("1", "库房在库状态但是扫码不存在")
|
||||
MARK_KEEP("1", "保持在库状态不变"), //SOCK_IN_BUT_SCAN_NOT_EXIST("1", "库房在库状态但是扫码不存在")
|
||||
MARK_LOST("2", "标记为丢失状态"),
|
||||
|
||||
MARK_LOST("1", "标记为丢失"),
|
||||
MARK_KEEP("2", "保持不变"),
|
||||
|
||||
//SOCK_OUT_BUT_SCAN_EXIST("2", "库房不是在库状态但是扫码存在"),
|
||||
MARK_RETURN("3", "标记为归还"),
|
||||
MARK_DISCARD("4", "标记为舍弃"),
|
||||
|
||||
//SOCK_NOT_EXIST_BUT_SCAN_EXIST("3", "库房不存在该条码但是扫码存在"),
|
||||
MARK_NEW("5", "标记为新入库"),
|
||||
DISCARD("3", "丢弃-1"),
|
||||
;
|
||||
|
||||
@EnumValue
|
||||
final String code;
|
||||
final String description;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -17,7 +17,6 @@ public enum StockStatusEnum implements ICodeBook {
|
||||
OUT("1", "外借"),
|
||||
OFF("2", "下架"),
|
||||
LOST("3", "丢失"),
|
||||
SCRAP_OUT("4", "报废"),
|
||||
|
||||
;
|
||||
|
||||
|
@ -1,19 +1,11 @@
|
||||
package tech.riemann.ims.mapper.material;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tech.riemann.ims.dto.response.ScrapOutApplyDTO;
|
||||
import tech.riemann.ims.dto.response.WaitScanInfo;
|
||||
import tech.riemann.ims.entity.material.ApplyDetail;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/28 15:38
|
||||
*/
|
||||
public interface ApplyDetailMapper extends BaseMapper<ApplyDetail> {
|
||||
List<WaitScanInfo> getWaitScanData(@Param("applyId") Long applyId);
|
||||
|
||||
List<ScrapOutApplyDTO> getScrapOutById(Integer applyId);
|
||||
}
|
||||
|
@ -5,13 +5,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import tech.riemann.ims.dto.response.ApplyDTO;
|
||||
import tech.riemann.ims.entity.material.ApplyForm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/28 15:38
|
||||
*/
|
||||
public interface ApplyFormMapper extends BaseMapper<ApplyForm> {
|
||||
|
||||
IPage<ApplyDTO> searchPage(IPage<ApplyDTO> page, Integer applyType, List<String> types, String key);
|
||||
IPage<ApplyDTO> searchPage(IPage<ApplyDTO> page, Integer applyType, String type, String code, String name);
|
||||
}
|
||||
|
@ -1,16 +0,0 @@
|
||||
package tech.riemann.ims.mapper.material;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tech.riemann.ims.dto.response.ManualStockDTO;
|
||||
import tech.riemann.ims.entity.material.ManualStockDetail;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/28 15:38
|
||||
*/
|
||||
public interface ManualStockDetailMapper extends BaseMapper<ManualStockDetail> {
|
||||
List<ManualStockDTO> getByApplyId(@Param("applyId") Long applyId);
|
||||
}
|
@ -1,18 +1,11 @@
|
||||
package tech.riemann.ims.mapper.material;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tech.riemann.ims.entity.material.Material;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/27 15:42
|
||||
*/
|
||||
public interface MaterialMapper extends BaseMapper<Material> {
|
||||
List<Material> queryLikeRight( @Param("types") List<String> types);
|
||||
|
||||
Page<Material> getPage(Page<Object> page, List<String> types, String key);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package tech.riemann.ims.mapper.material;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import tech.riemann.ims.entity.material.MaterialStockDetail;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* 物料明细数据表 Mapper 接口
|
||||
|
@ -1,11 +0,0 @@
|
||||
package tech.riemann.ims.mapper.material;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import tech.riemann.ims.entity.material.Type;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/27 15:42
|
||||
*/
|
||||
public interface TypeMapper extends BaseMapper<Type> {
|
||||
}
|
@ -2,19 +2,11 @@ package tech.riemann.ims.service.material;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nutz.spring.boot.service.interfaces.IdNameEntityService;
|
||||
import tech.riemann.ims.dto.response.ScrapOutApplyDTO;
|
||||
import tech.riemann.ims.dto.response.WaitScanInfo;
|
||||
import tech.riemann.ims.entity.material.ApplyDetail;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/28 15:41
|
||||
*/
|
||||
public interface IApplyDetailService extends IService<ApplyDetail>, IdNameEntityService<ApplyDetail> {
|
||||
|
||||
List<WaitScanInfo> getWaitScanData(Long applyId);
|
||||
|
||||
List<ScrapOutApplyDTO> getScrapOutById(Integer applyId);
|
||||
}
|
||||
|
@ -6,8 +6,6 @@ import org.nutz.spring.boot.service.interfaces.IdNameEntityService;
|
||||
import tech.riemann.ims.dto.response.ApplyDTO;
|
||||
import tech.riemann.ims.entity.material.ApplyForm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/28 15:35
|
||||
@ -19,8 +17,10 @@ public interface IApplyFormService extends IService<ApplyForm>, IdNameEntityServ
|
||||
* @param page 页码
|
||||
* @param size 每页数量
|
||||
* @param applyType 申请类型
|
||||
* @param key 编码或名称关键字
|
||||
* @param type 申请材料类型
|
||||
* @param code 申请材料编码
|
||||
* @param name 申请材料名称
|
||||
* @return IPage<ApplyDTO>
|
||||
*/
|
||||
IPage<ApplyDTO> search(int page, int size, Integer applyType, List<String> types, String key);
|
||||
IPage<ApplyDTO> search(int page, int size, Integer applyType, String type, String code, String name);
|
||||
}
|
||||
|
@ -1,17 +0,0 @@
|
||||
package tech.riemann.ims.service.material;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nutz.spring.boot.service.interfaces.IdNameEntityService;
|
||||
import tech.riemann.ims.dto.response.ManualStockDTO;
|
||||
import tech.riemann.ims.entity.material.ManualStockDetail;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/28 15:41
|
||||
*/
|
||||
public interface IManualStockDetailService extends IService<ManualStockDetail>, IdNameEntityService<ManualStockDetail> {
|
||||
|
||||
List<ManualStockDTO> getByApplyId(Long applyId);
|
||||
}
|
@ -1,19 +1,12 @@
|
||||
package tech.riemann.ims.service.material;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nutz.spring.boot.service.interfaces.IdNameEntityService;
|
||||
import tech.riemann.ims.entity.material.Material;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/27 15:40
|
||||
*/
|
||||
public interface IMaterialService extends IService<Material>, IdNameEntityService<Material> {
|
||||
|
||||
List<Material> queryLikeRight(List<String> types);
|
||||
|
||||
Page<Material> getPage(Page<Object> page, List<String> types, String key);
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
package tech.riemann.ims.service.material;
|
||||
|
||||
import tech.riemann.ims.entity.material.MaterialStockDetail;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nutz.spring.boot.service.interfaces.IdNameEntityService;
|
||||
import tech.riemann.ims.entity.material.MaterialStockDetail;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -1,14 +0,0 @@
|
||||
package tech.riemann.ims.service.material;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nutz.spring.boot.service.interfaces.IdNameEntityService;
|
||||
import tech.riemann.ims.entity.material.Type;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/27 15:40
|
||||
*/
|
||||
public interface ITypeService extends IService<Type>, IdNameEntityService<Type> {
|
||||
|
||||
String getTypeName(String type);
|
||||
}
|
@ -4,14 +4,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.springframework.stereotype.Service;
|
||||
import tech.riemann.ims.dto.response.ScrapOutApplyDTO;
|
||||
import tech.riemann.ims.dto.response.WaitScanInfo;
|
||||
import tech.riemann.ims.entity.material.ApplyDetail;
|
||||
import tech.riemann.ims.mapper.material.ApplyDetailMapper;
|
||||
import tech.riemann.ims.service.material.IApplyDetailService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/28 15:36
|
||||
@ -26,14 +22,4 @@ public class ApplyDetailServiceImpl extends ServiceImpl<ApplyDetailMapper, Apply
|
||||
public Dao dao() {
|
||||
return dao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WaitScanInfo> getWaitScanData(Long applyId) {
|
||||
return baseMapper.getWaitScanData(applyId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ScrapOutApplyDTO> getScrapOutById(Integer applyId) {
|
||||
return baseMapper.getScrapOutById(applyId);
|
||||
}
|
||||
}
|
||||
|
@ -11,8 +11,6 @@ import tech.riemann.ims.entity.material.ApplyForm;
|
||||
import tech.riemann.ims.mapper.material.ApplyFormMapper;
|
||||
import tech.riemann.ims.service.material.IApplyFormService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/28 15:36
|
||||
@ -30,7 +28,7 @@ public class ApplyFormServiceImpl extends ServiceImpl<ApplyFormMapper, ApplyForm
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<ApplyDTO> search(int page, int size, Integer applyType, List<String> types, String key) {
|
||||
return applyFormMapper.searchPage(Page.of(page, size), applyType, types, key);
|
||||
public IPage<ApplyDTO> search(int page, int size, Integer applyType, String type, String code, String name) {
|
||||
return applyFormMapper.searchPage(Page.of(page, size), applyType, type, code, name);
|
||||
}
|
||||
}
|
||||
|
@ -1,33 +0,0 @@
|
||||
package tech.riemann.ims.service.material.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.springframework.stereotype.Service;
|
||||
import tech.riemann.ims.dto.response.ManualStockDTO;
|
||||
import tech.riemann.ims.entity.material.ManualStockDetail;
|
||||
import tech.riemann.ims.mapper.material.ManualStockDetailMapper;
|
||||
import tech.riemann.ims.service.material.IManualStockDetailService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/28 15:36
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ManualStockDetailServiceImpl extends ServiceImpl<ManualStockDetailMapper, ManualStockDetail> implements IManualStockDetailService {
|
||||
|
||||
private final Dao dao;
|
||||
|
||||
@Override
|
||||
public Dao dao() {
|
||||
return dao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ManualStockDTO> getByApplyId(Long applyId) {
|
||||
return baseMapper.getByApplyId(applyId);
|
||||
}
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package tech.riemann.ims.service.material.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nutz.dao.Dao;
|
||||
@ -9,8 +8,6 @@ import tech.riemann.ims.entity.material.Material;
|
||||
import tech.riemann.ims.mapper.material.MaterialMapper;
|
||||
import tech.riemann.ims.service.material.IMaterialService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/27 15:41
|
||||
@ -24,14 +21,4 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
|
||||
public Dao dao() {
|
||||
return dao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Material> queryLikeRight(List<String> types) {
|
||||
return baseMapper.queryLikeRight(types);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<Material> getPage(Page<Object> page, List<String> types, String key) {
|
||||
return baseMapper.getPage(page, types, key);
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,14 @@
|
||||
package tech.riemann.ims.service.material.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.springframework.stereotype.Service;
|
||||
import tech.riemann.ims.entity.material.MaterialStockDetail;
|
||||
import tech.riemann.ims.mapper.material.MaterialStockDetailMapper;
|
||||
import tech.riemann.ims.service.material.IMaterialStockDetailService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.nutz.dao.Dao;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -40,5 +42,4 @@ public class MaterialStockDetailServiceImpl extends ServiceImpl<MaterialStockDet
|
||||
public Class<MaterialStockDetail> getEntityType() {
|
||||
return MaterialStockDetail.class;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,45 +0,0 @@
|
||||
package tech.riemann.ims.service.material.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.springframework.stereotype.Service;
|
||||
import tech.riemann.ims.entity.material.Type;
|
||||
import tech.riemann.ims.mapper.material.TypeMapper;
|
||||
import tech.riemann.ims.service.material.ITypeService;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/11/27 15:41
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TypeServiceImpl extends ServiceImpl<TypeMapper, Type> implements ITypeService {
|
||||
private final Dao dao;
|
||||
Map<String, String> names = new HashMap<>();
|
||||
@Override
|
||||
public Dao dao() {
|
||||
return dao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTypeName(String no) {
|
||||
String name = names.get(no);
|
||||
if(StringUtils.isEmpty(name)){
|
||||
|
||||
Type type = this.baseMapper.selectOne(Wrappers.<Type>lambdaQuery().eq(Type::getNo, no));
|
||||
if(type != null){
|
||||
names.put(no, type.getName());
|
||||
return type.getName();
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
package tech.riemann.ims.utils;
|
||||
|
||||
import lombok.experimental.UtilityClass;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2024/12/12 20:39
|
||||
*/
|
||||
@UtilityClass
|
||||
public class BarcodeUtil {
|
||||
|
||||
// 用于存储每天已经生成的条码的最后三位
|
||||
private static final ConcurrentHashMap<String, Set<Integer>> dailySequences = new ConcurrentHashMap<>();
|
||||
|
||||
// 日期格式化为年份后两位和一年中的某一天
|
||||
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyDDD");
|
||||
|
||||
/**
|
||||
* 生成一个7位数字条码,前4位表示年份后两位和一年中的某一天,后3位随机且当天不重复
|
||||
*/
|
||||
public static synchronized String generateBarcode() {
|
||||
// 获取当前日期部分(简化为年份后两位和一年中的第几天)
|
||||
String datePart = sdf.format(new Date());
|
||||
|
||||
// 如果当天的序列号集合不存在,则初始化一个新的集合
|
||||
dailySequences.putIfAbsent(datePart, Collections.synchronizedSet(new HashSet<>()));
|
||||
|
||||
// 获取当天的序列号集合
|
||||
Set<Integer> sequencesToday = dailySequences.get(datePart);
|
||||
|
||||
// 生成随机且不重复的三位数
|
||||
int sequence;
|
||||
do {
|
||||
sequence = ThreadLocalRandom.current().nextInt(0, 9999);
|
||||
} while (sequencesToday.contains(sequence));
|
||||
|
||||
// 将新生成的序列号添加到当天的集合中
|
||||
sequencesToday.add(sequence);
|
||||
|
||||
// 格式化序列号为3位字符串,不足前面补0
|
||||
String sequencePart = String.format("%04d", sequence);
|
||||
|
||||
return datePart + sequencePart;
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟新的一天开始,重置当天的序列号集合
|
||||
*/
|
||||
public static void resetDailySequence() {
|
||||
dailySequences.clear();
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
package tech.riemann.ims.utils;
|
||||
|
||||
import club.zhcs.lina.starter.exception.BizException;
|
||||
import cn.idev.excel.FastExcel;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.experimental.UtilityClass;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author mayong
|
||||
* @since 2025/3/15 16:17
|
||||
*/
|
||||
@UtilityClass
|
||||
public class ExcelUtil {
|
||||
|
||||
|
||||
public void exportExcel(HttpServletResponse response,
|
||||
String excelName,
|
||||
String sheetName,
|
||||
Class<?> clazz,
|
||||
Collection<?> result) {
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
String fileName = URLEncoder.encode(excelName, StandardCharsets.UTF_8).replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
try {
|
||||
FastExcel.write(response.getOutputStream(), clazz)
|
||||
.sheet(sheetName)
|
||||
.doWrite(result);
|
||||
} catch (IOException e) {
|
||||
throw BizException.create("导出Excel失败");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -16,7 +16,7 @@ management:
|
||||
include:
|
||||
- "*"
|
||||
server:
|
||||
port: 8888 # 改端口号后swagger文档访问不到
|
||||
port: 7777 # 改端口号后swagger文档访问不到
|
||||
http2:
|
||||
enabled: true
|
||||
undertow:
|
||||
@ -69,8 +69,8 @@ spring:
|
||||
name: ims
|
||||
datasource:
|
||||
url: jdbc:mysql://mysql.riemann.tech:13307/hx_jxc?characterEncoding=UTF-8
|
||||
username: root
|
||||
password: G00dl^ck
|
||||
username: hx_jxc
|
||||
password: BBSzc7cnbAhLAenT
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
filters: stat,wall,log4j2
|
||||
@ -110,10 +110,10 @@ springdoc:
|
||||
customer:
|
||||
theme: feeling-blue
|
||||
title: 库管系统
|
||||
url: https://ims.riemann.tech
|
||||
url: https://www.riemann.tech
|
||||
config-url: /v3/api-docs/swagger-config
|
||||
server:
|
||||
url: http://localhost:8888
|
||||
url: http://localhost:7777
|
||||
description: 物料库存管理系统
|
||||
info:
|
||||
title: 库管系统
|
||||
@ -126,7 +126,7 @@ springdoc:
|
||||
contact:
|
||||
email: product@ipmt.online
|
||||
name: ETP
|
||||
url: https://ims.riemann.tech
|
||||
url: https://www.riemann.tech
|
||||
swagger-ui:
|
||||
enabled: true
|
||||
group-configs:
|
||||
|
@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.riemann.ims.mapper.material.ApplyDetailMapper">
|
||||
|
||||
<resultMap id="resultMap" type="tech.riemann.ims.dto.response.WaitScanInfo">
|
||||
<result property="count" column="m_stock" />
|
||||
<result property="materialName" column="m_name" />
|
||||
</resultMap>
|
||||
|
||||
<select id="getWaitScanData" resultMap="resultMap">
|
||||
SELECT
|
||||
m.m_name,
|
||||
m.m_stock
|
||||
FROM
|
||||
t_apply_detail d
|
||||
LEFT JOIN t_material m ON m.id = d.ad_material_id
|
||||
WHERE
|
||||
d.ad_apply_id = #{applyId}
|
||||
</select>
|
||||
|
||||
<resultMap id="resultMap2" type="tech.riemann.ims.dto.response.ScrapOutApplyDTO">
|
||||
<result property="name" column="m_name" />
|
||||
<result property="type" column="m_type" />
|
||||
<result property="spec" column="m_spec" />
|
||||
<result property="price" column="m_price" />
|
||||
<result property="confirmQuantity" column="ad_confirm_quantity" />
|
||||
<result property="remark" column="ad_exception_remark" />
|
||||
<result property="applicant" column="af_applicant" />
|
||||
</resultMap>
|
||||
|
||||
<select id="getScrapOutById" resultMap="resultMap2">
|
||||
SELECT
|
||||
m.m_name,
|
||||
m.m_type,
|
||||
m.m_spec,
|
||||
m.m_price,
|
||||
d.ad_confirm_quantity,
|
||||
d.ad_exception_remark,
|
||||
a.af_applicant
|
||||
FROM
|
||||
t_apply_detail d
|
||||
LEFT JOIN t_material m ON m.id = d.ad_material_id
|
||||
LEFT JOIN t_apply_form a ON a.id = d.ad_apply_id
|
||||
WHERE
|
||||
d.ad_apply_id = #{applyId}
|
||||
</select>
|
||||
</mapper>
|
@ -3,11 +3,9 @@
|
||||
<mapper namespace="tech.riemann.ims.mapper.material.ApplyFormMapper">
|
||||
|
||||
<resultMap id="resultMap" type="tech.riemann.ims.dto.response.ApplyDTO">
|
||||
<id property="applyId" column="id" />
|
||||
<result property="applyNum" column="ad_quantity" />
|
||||
<result property="applyDate" column="af_apply_date" />
|
||||
<result property="applicant" column="af_applicant" />
|
||||
<result property="reviewer" column="af_reviewer" />
|
||||
<result property="confirmNum" column="ad_confirm_quantity" />
|
||||
<result property="type" column="m_type" />
|
||||
<result property="code" column="m_code" />
|
||||
@ -15,26 +13,20 @@
|
||||
<result property="spec" column="m_spec" />
|
||||
<result property="applyType" column="af_type" />
|
||||
<result property="remark" column="ad_exception_remark" />
|
||||
<result property="confirm" column="af_is_confirm" />
|
||||
<result property="reviewResult" column="af_review_result" />
|
||||
</resultMap>
|
||||
|
||||
<select id="searchPage" resultMap="resultMap">
|
||||
SELECT
|
||||
f.id,
|
||||
d.ad_quantity,
|
||||
f.af_apply_date,
|
||||
d.ad_exception_remark,
|
||||
d.ad_confirm_quantity,
|
||||
f.af_applicant,
|
||||
f.af_reviewer,
|
||||
m.m_type,
|
||||
m.m_code,
|
||||
m.m_name,
|
||||
m.m_spec,
|
||||
f.af_type,
|
||||
f.af_is_confirm,
|
||||
f.af_review_result
|
||||
f.af_type
|
||||
FROM
|
||||
t_apply_form f
|
||||
LEFT JOIN t_apply_detail d ON f.id = d.ad_apply_id
|
||||
@ -42,32 +34,22 @@
|
||||
WHERE 1 = 1
|
||||
<if test="applyType!= null and applyType!= ''">
|
||||
<choose>
|
||||
<!-- <when test="applyType == '3'"> Mybatis会将 “2” 解析为字符类型-->
|
||||
<when test='applyType == "1"'>
|
||||
<when test="applyType == '1'">
|
||||
and f.af_type in ('1', '2')
|
||||
</when>
|
||||
<when test='applyType == "3"'>
|
||||
and f.af_type in ('3', '5')
|
||||
</when>
|
||||
<otherwise>
|
||||
and f.af_type = #{applyType}
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="types != null and types.size() > 0">
|
||||
and (
|
||||
<foreach collection="types" item="item" separator="or">
|
||||
( m_type like concat(#{item},'%') )
|
||||
</foreach>
|
||||
)
|
||||
<if test="type!= null and type!= ''">
|
||||
AND m.m_type = #{type}
|
||||
</if>
|
||||
|
||||
<if test="key != null and key.trim().length() > 0">
|
||||
and (
|
||||
m_code like concat('%',#{key},'%')
|
||||
or m_name like concat('%',#{key},'%')
|
||||
or m_spec like concat('%',#{key},'%')
|
||||
)
|
||||
<if test="code!= null and code!= ''">
|
||||
AND m.m_code LIKE CONCAT('%', #{code}, '%')
|
||||
</if>
|
||||
<if test="name!= null and name!= ''">
|
||||
AND m.m_name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
ORDER BY f.af_apply_date DESC
|
||||
|
||||
|
@ -1,35 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.riemann.ims.mapper.material.ManualStockDetailMapper">
|
||||
|
||||
<resultMap id="resultMap" type="tech.riemann.ims.dto.response.ManualStockDTO">
|
||||
<result property="code" column="m_code"/>
|
||||
<result property="name" column="m_name"/>
|
||||
<result property="type" column="m_type"/>
|
||||
<result property="price" column="m_price"/>
|
||||
<result property="spec" column="m_spec"/>
|
||||
<result property="applyId" column="m_apply_id"/>
|
||||
<result property="materialId" column="m_material_id"/>
|
||||
<result property="stock" column="m_stock"/>
|
||||
<result property="manualStock" column="m_manual_stock"/>
|
||||
<result property="msg" column="m_msg"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getByApplyId" resultMap="resultMap">
|
||||
SELECT
|
||||
ms.m_apply_id,
|
||||
ms.m_material_id,
|
||||
ms.m_manual_stock,
|
||||
ms.m_msg,
|
||||
m.m_spec,
|
||||
ms.m_stock,
|
||||
m.m_name,
|
||||
m.m_type,
|
||||
m.m_code,
|
||||
m.m_price
|
||||
FROM
|
||||
t_manual_stock_detail ms
|
||||
left join t_material m on m.id = ms.m_material_id
|
||||
where ms.m_apply_id = #{applyId}
|
||||
</select>
|
||||
</mapper>
|
@ -1,70 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="tech.riemann.ims.mapper.material.MaterialMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="tech.riemann.ims.entity.material.Material">
|
||||
|
||||
</resultMap>
|
||||
<select id="queryLikeRight" resultType="tech.riemann.ims.entity.material.Material">
|
||||
SELECT
|
||||
id,
|
||||
m_code AS `code`,
|
||||
m_name AS `name`,
|
||||
m_assign_rule AS `assignRule`,
|
||||
m_type AS `type`,
|
||||
m_price AS `price`,
|
||||
m_spec AS `spec`,
|
||||
m_stock AS `stock`,
|
||||
m_description AS `description`,
|
||||
created_time,
|
||||
updated_time,
|
||||
created_by,
|
||||
updated_by
|
||||
FROM
|
||||
t_material
|
||||
<where>
|
||||
<foreach collection="types" item="item" separator="or">
|
||||
( m_type like concat(#{item},'%') )
|
||||
</foreach>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
<select id="getPage" resultType="tech.riemann.ims.entity.material.Material">
|
||||
|
||||
SELECT
|
||||
id,
|
||||
m_code AS `code`,
|
||||
m_name AS `name`,
|
||||
m_assign_rule AS `assignRule`,
|
||||
m_type AS `type`,
|
||||
m_price AS `price`,
|
||||
m_spec AS `spec`,
|
||||
m_stock AS `stock`,
|
||||
m_description AS `description`,
|
||||
created_time,
|
||||
updated_time,
|
||||
created_by,
|
||||
updated_by
|
||||
FROM
|
||||
t_material
|
||||
<where>
|
||||
<if test="types != null and types.size() > 0">
|
||||
and (
|
||||
<foreach collection="types" item="item" separator="or">
|
||||
( m_type like concat(#{item},'%') )
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="key != null and key.trim().length() > 0">
|
||||
and (
|
||||
m_code like concat('%',#{key},'%')
|
||||
or m_name like concat('%',#{key},'%')
|
||||
or m_spec like concat('%',#{key},'%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
order by updated_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user