Commit 007f54de by 李小惠

Merge branch 'develop' of http://gitlab.sothing.top/843502640/jyzb_platformV2 into develop-lxh

parents 9261ff87 5240b5de
......@@ -10,6 +10,7 @@ public enum InventoryExceptionEnum implements IExceptionEnum {
INVENTORY_BEYOND_STOCK(CommonConstant.DEFAULT_BIZ_ERROR_CODE,"填写的报废的装备数量大于实际能进行报废的数量"),
BROKENNUM_BEYOND_STOCK(CommonConstant.DEFAULT_BIZ_ERROR_CODE,"审核中的数量已存在最大可报废数量,现提交失败"),
ORDER_NOT_EXIST(CommonConstant.DEFAULT_BIZ_ERROR_CODE,"盘点单据不存在"),
ORDER_HAS_START(CommonConstant.DEFAULT_BIZ_ERROR_CODE,"单据已经开始,请勿重复操作"),
;
/**
* 错误编码
......
......@@ -138,5 +138,11 @@
<version>3.5.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.junmp.v2</groupId>
<artifactId>v2-log-db</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
......@@ -23,20 +23,21 @@ import javax.annotation.Resource;
@RestController
@Slf4j
@RequestMapping("/SoftUpdate")
@Api(tags = "软件应用管理模块")
public class ApplicationController {
@Resource
private ApplicationService applicationService;
//获取应用信息的分页
@PostMapping("/GetAllUpdateCfg")
@PostMapping(path="/GetAllUpdateCfg",name="获取应用信息的分页")
@ApiOperation("获取应用信息的分页")
public ApiRes<PageResult<Application>> GetAllUpdateCfg(@RequestBody ApplicationReq req){
return ApiRes.success(applicationService.GetAllUpdateCfg(req));
}
//新增或者修改应用信息
@PostMapping("/AddOrUpdateCfg")
@PostMapping(path="/AddOrUpdateCfg",name="新增应用信息")
@ApiOperation("新增应用信息")
public ApiRes<String> AddOrUpdateCfg(@RequestBody @Validated(ValidationApi.add.class) ApplicationReq req){
return ApiRes.success(applicationService.AddOrUpdateCfg(req));
......
......@@ -33,7 +33,7 @@ public class BussinessController {
//创建业务单
@PostMapping("/AddBussinessOrder")
@PostMapping(path="/AddBussinessOrder",name="创建业务单")
@ApiOperation("创建业务单")
public ApiRes<String> AddBussinessOrder(@RequestBody @Validated(ValidationApi.add.class) UpdateBusFormReq req){
......@@ -42,13 +42,13 @@ public class BussinessController {
//查看业务单(可以条件查询)
@PostMapping("/showBussinessOrder")
@PostMapping(path="/showBussinessOrder",name="查看业务单")
@ApiOperation("查看业务单")
public ApiRes<PageResult<BusForm>> showBussinessOrder(@RequestBody QueryBusFormReq req){
return ApiRes.success(busFormService.showBussinessOrder(req));
}
//根据业务单id查询出入库单据
@PostMapping("/showOrderByBusOrderId")
@PostMapping(path="/showOrderByBusOrderId",name="根据业务单id查询出入库单据")
@ApiOperation("根据业务单id查询出入库单据")
public ApiRes<Object> showOrderByBusOrderId(@RequestBody QueryBusFormReq req){
return ApiRes.success(busFormService.showOrderByBusOrderId(req));
......
......@@ -32,7 +32,7 @@ public class BussinessInventoryController {
private BussinessInventoryService BussinessInventoryService;
//盘库申请
@PostMapping("/AddStocktake")
@PostMapping(path="/AddStocktake",name="盘库申请")
@ApiOperation("盘库申请")
public ApiRes<String> AddStocktake (@RequestBody @Validated(ValidationApi.add.class) UpdateInventoryReq req){
//判断是否有工作流id,如果有则将状态进行修改
......@@ -48,7 +48,8 @@ public class BussinessInventoryController {
}
//盘库申请
@PostMapping("/Check")
@PostMapping(path="/Check",name="预览盘点单")
@ApiOperation("预览盘点单")
public ApiRes<BussinessInventoryDto> Check (@RequestBody @Validated(ValidationApi.detail.class) BussinessInventoryReq req){
//判断是否有工作流id,如果有则将状态进行修改
......@@ -56,35 +57,35 @@ public class BussinessInventoryController {
return ApiRes.success(BussinessInventoryService.Check(req));
}
//开始盘点,已废弃
@PostMapping("/Start")
@PostMapping(path="/Start",name="开始盘点")
@ApiOperation("开始盘点")
public ApiRes<Boolean> Start (@RequestBody BussinessInventoryReq req){
public ApiRes<Boolean> Start (@RequestBody UploadInventoryReq req){
//判断是否有工作流id,如果有则将状态进行修改
return ApiRes.success(BussinessInventoryService.Start(req));
}
//查询列表
@PostMapping("/GetPage")
@PostMapping(path="/GetPage",name="查询列表")
@ApiOperation("查询列表")
public ApiRes<PageResult<BussinessInventory>> GetPage (@RequestBody BussinessInventoryReq req){
//判断是否有工作流id,如果有则将状态进行修改
return ApiRes.success(BussinessInventoryService.GetPage(req));
}
//盘库申请
@PostMapping("/GetById")
@PostMapping(path="/GetById",name="查询详情")
@ApiOperation("查询详情")
public ApiRes<BussinessInventoryDto> GetById (@RequestBody BussinessInventoryReq req){
//判断是否有工作流id,如果有则将状态进行修改
return ApiRes.success(BussinessInventoryService.GetDetailById(req));
}
//盘库申请
@PostMapping("/UploadStock")
@PostMapping(path="/UploadStock",name="上传盘点记录")
@ApiOperation("上传盘点记录")
public ApiRes<Boolean> UploadStock (@RequestBody UploadInventoryReq req){
//判断是否有工作流id,如果有则将状态进行修改
return ApiRes.success(BussinessInventoryService.UploadStock(req));
}
//盘库申请
@PostMapping("/UseOrFinished")
@PostMapping(path="/UseOrFinished",name="确认结果/结束盘点")
@ApiOperation("确认结果/结束盘点")
public ApiRes<Boolean> UseOrFinished (@RequestBody UploadInventoryReq req){
//判断是否有工作流id,如果有则将状态进行修改
......
......@@ -24,14 +24,14 @@ public class CabinetBoxController {
@Resource
private CabinetBoxService cabinetBoxService;
//添加箱门信息
@PostMapping("/AddBoxInfo")
@PostMapping(path="/AddBoxInfo",name="添加箱门信息")
@ApiOperation("添加箱门信息")
public ApiRes<String> AddOrUpdateBoxInfo(@RequestBody UpdateCabinetReq req){
return ApiRes.success(cabinetBoxService.AddOrUpdateBoxInfo(req));
}
//添加箱门信息
@PostMapping("/DeleteBox")
@PostMapping(path="/DeleteBox",name="添加箱门信息")
@ApiOperation("删除箱门")
public ApiRes<String> DeleteBox(@RequestBody @Validated(ValidationApi.delete.class) UpdateCabinetReq req){
return ApiRes.success(cabinetBoxService.DeleteBox(req));
......
......@@ -35,14 +35,14 @@ public class CabinetController {
private CabinetBoxService cabinetBoxService;
@PostMapping("/AddCabinetInfo")
@PostMapping(path="/AddCabinetInfo",name="添加单警柜信息")
@ApiOperation("添加单警柜信息")
public ApiRes<String> addCabinetInfo(@RequestBody @Validated(ValidationApi.add.class) UpdateCabinetReq req){
String cabinetId = cabinetService.addCabinetInfo(req);
return ApiRes.success(cabinetId);
}
@PostMapping("/ErrorState")
@PostMapping(path="/ErrorState",name="单警柜状态变更")
@ApiOperation("单警柜状态变更")
public ApiRes<Boolean> ChangeCabinetState(@RequestBody UpdateCabinetReq req) {
boolean result = cabinetService.ChangeCabinetState(req);
......@@ -53,13 +53,13 @@ public class CabinetController {
}
@PostMapping("/DeleteCabinetInfo")
@PostMapping(path="/DeleteCabinetInfo",name="删除单警柜信息")
@ApiOperation("删除单警柜信息")
public ApiRes<Boolean> deleteCabinetInfo(@RequestBody @Validated(ValidationApi.delete.class) UpdateCabinetReq req) {
return ApiRes.success(cabinetService.deleteCabinetInfo(req));
}
@PostMapping("/UpdateCabinetServer")
@PostMapping(path="/UpdateCabinetServer",name="修改单警柜信息,平台使用")
@ApiOperation("修改单警柜信息,平台使用")
public ApiRes<Boolean> UpdateCabinetServer(@RequestBody UpdateCabinetReq req) {
boolean result = cabinetService.updateCabinetInfo(req);
......@@ -69,7 +69,8 @@ public class CabinetController {
return ApiRes.success(result);
}
@PostMapping("/UpdateCabinetClient")
@PostMapping(path="/UpdateCabinetClient",name="修改单警柜信息,警柜使用")
@ApiOperation("修改单警柜信息,警柜使用")
public ApiRes<Boolean> UpdateCabinetClient(@RequestBody UpdateCabinetReq req) {
boolean result = cabinetService.updateCabinetInfo(req);
......@@ -80,7 +81,7 @@ public class CabinetController {
}
//通过单警柜id查询单个箱门及其箱门信息
@PostMapping("/ShowOneCabinet")
@PostMapping(path="/ShowOneCabinet",name="查询单个单警柜及其箱门信息")
@ApiOperation("查询单个单警柜及其箱门信息")
public ApiRes<CabinetDto> showOneCabinet(@RequestBody @Validated(ValidationApi.detail.class) CabinetReq req){
return ApiRes.success(cabinetService.showOneCabinet(req));
......@@ -88,7 +89,7 @@ public class CabinetController {
//根据组织机构id查询出单警柜的详细信息(list)
@PostMapping("/ShowCabinetList")
@PostMapping(path="/ShowCabinetList",name="查询单警柜列表")
@ApiOperation("查询单警柜列表")
public ApiRes<List<CabinetDto>> showCabinetList(@RequestBody CabinetReq req){
List<CabinetDto> allCabinetList = cabinetService.getAllCabinetList(req);
......@@ -96,7 +97,7 @@ public class CabinetController {
}
//根据组织机构id查询出单警柜的详细信息(page)
@PostMapping("/ShowCabinetPage")
@PostMapping(path="/ShowCabinetPage",name="查询单警柜列表")
@ApiOperation("查询单警柜列表")
public ApiRes<PageResult<CabinetDto>> ShowCabinetPage(@RequestBody CabinetReq req){
return ApiRes.success(cabinetService.ShowCabinetPage(req));
......@@ -114,7 +115,7 @@ public class CabinetController {
// return ApiRes.success(result);
// }
@PostMapping("/SearchOrgId")
@PostMapping(path="/SearchOrgId",name="根据单警柜id查询组织机构id")
@ApiOperation("/根据单警柜id查询组织机构id")
public ApiRes<Long> SearchOrgId(@RequestBody @Validated(ValidationApi.detail.class) CabinetReq req){
return ApiRes.success(cabinetService.SearchOrgId(req));
......
......@@ -29,34 +29,34 @@ public class DestoryUnitController {
private DestoryUnitService destoryUnitService;
//创建报废/销毁单位
@PostMapping("/AddDestoryUnit")
@PostMapping(path="/AddDestoryUnit",name="创建报废/销毁单位")
@ApiOperation("创建报废/销毁单位")
public ApiRes<String> addDestoryUnit(@RequestBody @Validated(ValidationApi.add.class) DestoryUnitReq req){
return ApiRes.success(destoryUnitService.addDestoryUnit(req));
}
//修改报废/销毁单位
@PostMapping("/UpdateDestoryUnit")
@PostMapping(path="/UpdateDestoryUnit",name="修改报废/销毁单位")
@ApiOperation("修改报废/销毁单位")
public ApiRes<Boolean> updateDestoryUnit(@RequestBody @Validated(ValidationApi.edit.class) DestoryUnitReq req){
return ApiRes.success(destoryUnitService.updateDestoryUnit(req));
}
//查询报废/销毁单位(list)
@PostMapping("/ShowDestoryUnitList")
@PostMapping(path="/ShowDestoryUnitList",name="查询报废/销毁单位(list)")
@ApiOperation("查询报废/销毁单位(list)")
public ApiRes<List<DestoryUnit>> showDestoryUnitList(@RequestBody DestoryUnitReq req){
return ApiRes.success(destoryUnitService.showDestoryUnitList(req));
}
//查询报废/销毁单位(page)
@PostMapping("/ShowDestoryUnitPage")
@PostMapping(path="/ShowDestoryUnitPage",name="修改报废/销毁单位(page)")
@ApiOperation("修改报废/销毁单位(page)")
public ApiRes<PageResult<DestoryUnit>> showDestoryUnitPage(@RequestBody DestoryUnitReq req){
return ApiRes.success(destoryUnitService.showDestoryUnitPage(req));
}
//删除报废/销毁单位
@PostMapping("/DelDestoryUnit")
@PostMapping(path="/DelDestoryUnit",name="修改报废/销毁单位")
@ApiOperation("修改报废/销毁单位")
public ApiRes<Boolean> delDestoryUnit(@RequestBody DestoryUnitReq req){
return ApiRes.success(destoryUnitService.delDestoryUnit(req));
......
package com.junmp.jyzb.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.junmp.v2.db.api.entity.BaseEntity;
import org.springframework.data.elasticsearch.annotations.Document;
@TableName("sys_log")
@Document(indexName = "sys_log", shards = 1, replicas = 1)
public class EsLog extends BaseEntity {
@TableId(
value = "log_id",
type = IdType.ASSIGN_ID
)
private Long logId;
@TableField("log_name")
private String logName;
@TableField("log_content")
private String logContent;
@TableField("app_name")
private String appName;
@TableField("log_type")
private Integer logType;
@TableField("request_url")
private String requestUrl;
@TableField("request_params")
private String requestParams;
@TableField("request_result")
private String requestResult;
@TableField("server_ip")
private String serverIp;
@TableField("client_ip")
private String clientIp;
@TableField("user_id")
private Long userId;
@TableField("http_method")
private String httpMethod;
@TableField("client_browser")
private String clientBrowser;
@TableField("client_os")
private String clientOs;
public EsLog() {
}
public Long getLogId() {
return this.logId;
}
public String getLogName() {
return this.logName;
}
public String getLogContent() {
return this.logContent;
}
public String getAppName() {
return this.appName;
}
public Integer getLogType() {
return this.logType;
}
public String getRequestUrl() {
return this.requestUrl;
}
public String getRequestParams() {
return this.requestParams;
}
public String getRequestResult() {
return this.requestResult;
}
public String getServerIp() {
return this.serverIp;
}
public String getClientIp() {
return this.clientIp;
}
public Long getUserId() {
return this.userId;
}
public String getHttpMethod() {
return this.httpMethod;
}
public String getClientBrowser() {
return this.clientBrowser;
}
public String getClientOs() {
return this.clientOs;
}
public void setLogId(final Long logId) {
this.logId = logId;
}
public void setLogName(final String logName) {
this.logName = logName;
}
public void setLogContent(final String logContent) {
this.logContent = logContent;
}
public void setAppName(final String appName) {
this.appName = appName;
}
public void setLogType(final Integer logType) {
this.logType = logType;
}
public void setRequestUrl(final String requestUrl) {
this.requestUrl = requestUrl;
}
public void setRequestParams(final String requestParams) {
this.requestParams = requestParams;
}
public void setRequestResult(final String requestResult) {
this.requestResult = requestResult;
}
public void setServerIp(final String serverIp) {
this.serverIp = serverIp;
}
public void setClientIp(final String clientIp) {
this.clientIp = clientIp;
}
public void setUserId(final Long userId) {
this.userId = userId;
}
public void setHttpMethod(final String httpMethod) {
this.httpMethod = httpMethod;
}
public void setClientBrowser(final String clientBrowser) {
this.clientBrowser = clientBrowser;
}
public void setClientOs(final String clientOs) {
this.clientOs = clientOs;
}
public String toString() {
return "SysLog(logId=" + this.getLogId() + ", logName=" + this.getLogName() + ", logContent=" + this.getLogContent() + ", appName=" + this.getAppName() + ", logType=" + this.getLogType() + ", requestUrl=" + this.getRequestUrl() + ", requestParams=" + this.getRequestParams() + ", requestResult=" + this.getRequestResult() + ", serverIp=" + this.getServerIp() + ", clientIp=" + this.getClientIp() + ", userId=" + this.getUserId() + ", httpMethod=" + this.getHttpMethod() + ", clientBrowser=" + this.getClientBrowser() + ", clientOs=" + this.getClientOs() + ")";
}
}
\ No newline at end of file
package com.junmp.jyzb.logManager;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.junmp.jyzb.logManager.service.EsLogService;
import com.junmp.v2.log.api.LogRecordApi;
import com.junmp.v2.log.api.bean.dto.LogRecordDto;
import com.junmp.v2.log.api.thread.LogManagerPool;
import com.junmp.v2.log.db.entity.SysLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
import java.util.Queue;
import java.util.TimerTask;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors;
public class ESRecordManager implements LogRecordApi {
private static final Logger log = LoggerFactory.getLogger(com.junmp.v2.log.db.DbLogRecordManager.class);
private final EsLogService esService;
private final LogManagerPool logManagerPool;
private final LogRefreshManager logRefreshManager;
public ESRecordManager(LogManagerPool logManagerPool, EsLogService esService) {
this.logManagerPool = logManagerPool;
this.esService = esService;
this.logRefreshManager = new ESRecordManager.LogRefreshManager();
this.logRefreshManager.start();
}
public void add(LogRecordDto logRecord) {
if (null != logRecord) {
this.addBatch(CollectionUtil.list(false, new LogRecordDto[]{logRecord}));
}
}
public void addAsync(final LogRecordDto logRecord) {
this.logManagerPool.executeLog(new TimerTask() {
public void run() {
ESRecordManager.this.logRefreshManager.putLog(logRecord);
}
});
}
public void addBatch(List<LogRecordDto> logRecords) {
if (!ObjectUtil.isEmpty(logRecords)) {
List<SysLog> sysLogList = (List)logRecords.stream().map((dto) -> {
SysLog sysLog = new SysLog();
BeanUtil.copyProperties(dto, sysLog, new String[0]);
if (StrUtil.isEmpty(sysLog.getLogName())) {
sysLog.setLogName("API接口日志记录");
}
if (StrUtil.isEmpty(sysLog.getAppName())) {
sysLog.setAppName("none-app-name");
}
return sysLog;
}).collect(Collectors.toList());
if (ObjectUtil.isNotEmpty(sysLogList)) {
// this.esService.saveBatch(sysLogList);
}
}
}
class LogRefreshManager extends Thread {
private final long sleepTime;
private final int maxCount;
private final AtomicLong refreshMark = new AtomicLong();
public AtomicInteger count = new AtomicInteger(0);
private final Queue<LogRecordDto> queue = new ConcurrentLinkedQueue();
public LogRefreshManager() {
this.sleepTime = 3000L;
this.maxCount = 300;
}
public LogRefreshManager(long sleepTime) {
this.sleepTime = sleepTime;
this.maxCount = 300;
}
public LogRefreshManager(int maxCount) {
this.sleepTime = 3000L;
this.maxCount = maxCount;
}
public LogRefreshManager(long sleepTime, int maxCount) {
this.sleepTime = sleepTime;
this.maxCount = maxCount;
}
public void putLog(LogRecordDto record) {
int queueDataCount = this.count.get();
if (queueDataCount == 0) {
this.refreshMark.getAndSet(System.currentTimeMillis());
}
if (queueDataCount < this.maxCount * 2) {
this.queue.offer(record);
this.count.incrementAndGet();
}
}
private void refresh() {
this.refreshMark.getAndSet(System.currentTimeMillis());
int num = this.count.getAndSet(0);
List<LogRecordDto> cacheAll = new ArrayList(num);
for(int i = 0; i < num; ++i) {
LogRecordDto item = (LogRecordDto)this.queue.poll();
if (null == item) {
break;
}
cacheAll.add(item);
}
// if (null != cacheAll && cacheAll.size() > 0) {
// this.addBatch(cacheAll);
// }
}
private void timing() {
long currentTimeMillis = System.currentTimeMillis();
if (this.refreshMark.get() + this.sleepTime <= currentTimeMillis && this.count.get() > 0) {
this.refresh();
}
}
private void listener() {
if (this.count.get() >= this.maxCount) {
this.refresh();
}
}
public void run() {
try {
while(true) {
this.listener();
this.timing();
TimeUnit.MILLISECONDS.sleep(10L);
}
} catch (InterruptedException var2) {
if (ESRecordManager.log.isDebugEnabled()) {
var2.printStackTrace();
}
ESRecordManager.log.error(var2.getMessage());
}
}
}
}
\ No newline at end of file
package com.junmp.jyzb.logManager;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.junmp.v2.db.api.page.PageResult;
import com.junmp.v2.log.api.LogManagerApi;
import com.junmp.v2.log.api.bean.dto.LogRecordDto;
import com.junmp.v2.log.api.bean.req.LogRequest;
import com.junmp.v2.log.db.entity.SysLog;
import com.junmp.v2.log.db.service.SysLogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Resource;
import java.util.*;
public class EsLogManager implements LogManagerApi {
private static final Logger log = LoggerFactory.getLogger(EsLogManager.class);
@Resource
private SysLogService sysLogService;
public EsLogManager() {
}
public List<LogRecordDto> findList(LogRequest request) {
List<SysLog> sysLogList = this.sysLogService.findList(request);
List<LogRecordDto> dtoList = CollUtil.newArrayList(new LogRecordDto[0]);
BeanUtil.copyProperties(sysLogList, dtoList, new String[0]);
return dtoList;
}
public PageResult<LogRecordDto> findPage(LogRequest request) {
return this.sysLogService.getLogPage(request);
}
public void del(LogRequest request) {
this.sysLogService.del(request);
}
public void clearLog(LogRequest request) {
if (ObjectUtil.isNotNull(request) && ObjectUtil.isNotNull(request.getLogType())) {
this.sysLogService.clearLogByDate(request);
}
}
public LogRecordDto detail(LogRequest request) {
SysLog detail = this.sysLogService.detail(request);
LogRecordDto dto = new LogRecordDto();
BeanUtil.copyProperties(detail, dto, new String[0]);
return dto;
}
}
package com.junmp.jyzb.logManager.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.junmp.jyzb.api.bean.dto.ESTypeDto;
import com.junmp.jyzb.api.bean.dto.EquipmentTreeDto;
import com.junmp.jyzb.api.bean.dto.EquipmentTypeDto;
import com.junmp.jyzb.api.bean.query.QueryEquipmentTypeReq;
import com.junmp.jyzb.api.bean.req.UpdateEquipmentTypeReq;
import com.junmp.jyzb.entity.EquipmentType;
import com.junmp.jyzb.entity.EsLog;
import com.junmp.jyzb.utils.ResponseResult;
import java.io.IOException;
import java.util.List;
public interface EsLogService extends IService<EsLog> {
Object addEs();
}
\ No newline at end of file
package com.junmp.jyzb.logManager.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.junmp.jyzb.entity.EquipmentType;
import com.junmp.jyzb.entity.EsLog;
import com.junmp.jyzb.logManager.service.EsLogService;
import com.junmp.jyzb.mapper.EquipmentTypeMapper;
import com.junmp.jyzb.mapper.EsLogMapper;
import com.junmp.jyzb.service.EquipmentTypeService;
import org.springframework.stereotype.Service;
@Service
public class EsLogServiceImpl extends ServiceImpl<EsLogMapper, EsLog> implements EsLogService {
@Override
public Object addEs() {
return null;
}
}
package com.junmp.jyzb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.junmp.jyzb.entity.EquipmentType;
import com.junmp.jyzb.entity.EsLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface EsLogMapper extends BaseMapper<EsLog> {
}
\ No newline at end of file
......@@ -24,7 +24,7 @@ public interface BussinessInventoryService extends IService<BussinessInventory>
BussinessInventoryDto Check(BussinessInventoryReq req);
Boolean Start(BussinessInventoryReq req);
Boolean Start(UploadInventoryReq req);
PageResult<BussinessInventory> GetPage(BussinessInventoryReq req);
......
......@@ -274,9 +274,23 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
//开始盘点
@Transactional(rollbackFor = Exception.class)
@Override
public Boolean Start(BussinessInventoryReq req) {
public Boolean Start(UploadInventoryReq req) {
String orderId=req.getOrderId();
BussinessInventory bi= this.getById(orderId);
if (bi.getInventoryState().equals("running"))
{
throw new ServiceException(InventoryExceptionEnum.ORDER_HAS_START);
}
List<BussinessDetail> BDList=new ArrayList<>();
for (EquipmentListDto bd:
req.getEquipmentList()) {
BussinessDetail bdInsert=new BussinessDetail();
bdInsert.setInventoryId(Long.valueOf(req.getOrderId()));
BeanPlusUtil.copyProperties(bd,bdInsert);
bdInsert.setUpdateTime(DateTimeUtil.getCurrentDateTime());
BDList.add(bdInsert);
}
bussinessInventoryDetailService.saveBatch(BDList);
if (bi!=null)
{
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论