Commit 2157aed5 by 李小惠

新增装备绑定箱门数据结构以及控制层方法

parent 22dd9de4
2024-03-22 08:41:56.419 ERROR 16168 --- [http-nio-10030-exec-6] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token 2024-03-22 08:41:56.419 ERROR 16168 --- [http-nio-10030-exec-6] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
2024-03-22 08:44:27.804 ERROR 16168 --- [http-nio-10030-exec-6] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>账号或密码错误 2024-03-22 08:44:27.804 ERROR 16168 --- [http-nio-10030-exec-6] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>账号或密码错误
2024-03-22 08:45:17.271 ERROR 16168 --- [http-nio-10030-exec-10] c.j.j.b.c.handle.GlobalExceptionHandler : 业务异常,错误信息为:应用名称已存在 2024-03-22 08:45:17.271 ERROR 16168 --- [http-nio-10030-exec-10] c.j.j.b.c.handle.GlobalExceptionHandler : 业务异常,错误信息为:应用名称已存在
2024-03-22 13:12:20.078 ERROR 24848 --- [main] c.j.v.c.listener.ConfigInitListener : 初始化系统配置表失败,执行查询语句失败
java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:906)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:831)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.junmp.v2.config.listener.ConfigInitListener.eventCallback(ConfigInitListener.java:79)
at com.junmp.v2.common.listener.ContextInitializedListener.onApplicationEvent(ContextInitializedListener.java:30)
at com.junmp.v2.common.listener.ContextInitializedListener.onApplicationEvent(ContextInitializedListener.java:20)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.contextPrepared(EventPublishingRunListener.java:89)
at org.springframework.boot.SpringApplicationRunListeners.lambda$contextPrepared$3(SpringApplicationRunListeners.java:67)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
at org.springframework.boot.SpringApplicationRunListeners.contextPrepared(SpringApplicationRunListeners.java:67)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:391)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:325)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1313)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302)
at com.junmp.jyzb.boot.JyzbBootApplication.main(JyzbBootApplication.java:46)
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)
at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)
at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:91)
at com.mysql.cj.NativeSession.connect(NativeSession.java:144)
at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:850)
... 24 common frames omitted
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:75)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:476)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:218)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:200)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:162)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:394)
at java.net.Socket.connect(Socket.java:606)
at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:155)
at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:65)
... 26 common frames omitted
2024-03-22 13:12:20.163 ERROR 24848 --- [main] o.s.boot.SpringApplication : Application run failed
com.junmp.v2.config.api.exception.ConfigException: 初始化系统配置表失败,执行查询语句失败
at com.junmp.v2.config.listener.ConfigInitListener.eventCallback(ConfigInitListener.java:95)
at com.junmp.v2.common.listener.ContextInitializedListener.onApplicationEvent(ContextInitializedListener.java:30)
at com.junmp.v2.common.listener.ContextInitializedListener.onApplicationEvent(ContextInitializedListener.java:20)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.contextPrepared(EventPublishingRunListener.java:89)
at org.springframework.boot.SpringApplicationRunListeners.lambda$contextPrepared$3(SpringApplicationRunListeners.java:67)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
at org.springframework.boot.SpringApplicationRunListeners.contextPrepared(SpringApplicationRunListeners.java:67)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:391)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:325)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1313)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302)
at com.junmp.jyzb.boot.JyzbBootApplication.main(JyzbBootApplication.java:46)
...@@ -49,3 +49,88 @@ ...@@ -49,3 +49,88 @@
2024-03-22 09:15:34.236 INFO 16168 --- [http-nio-10030-exec-8] c.j.v2.ws.channel.WsSessionContainer : 推送消息>>{"data":"23","serverMsgType":"102","toUserId":"1760955516758704130"} 2024-03-22 09:15:34.236 INFO 16168 --- [http-nio-10030-exec-8] c.j.v2.ws.channel.WsSessionContainer : 推送消息>>{"data":"23","serverMsgType":"102","toUserId":"1760955516758704130"}
2024-03-22 09:15:34.236 INFO 16168 --- [http-nio-10030-exec-8] c.j.v2.ws.server.ScreenWebSocketServer : 已建立连接 2024-03-22 09:15:34.236 INFO 16168 --- [http-nio-10030-exec-8] c.j.v2.ws.server.ScreenWebSocketServer : 已建立连接
2024-03-22 09:21:35.307 WARN 16168 --- [http-nio-10030-exec-4] c.j.v2.ws.server.ScreenWebSocketServer : 会话已关闭 2024-03-22 09:21:35.307 WARN 16168 --- [http-nio-10030-exec-4] c.j.v2.ws.server.ScreenWebSocketServer : 会话已关闭
2024-03-22 13:12:13.009 INFO 24848 --- [main] c.j.v.c.listener.ConfigInitListener : 当前数据库驱动类>>>com.mysql.cj.jdbc.Driver
2024-03-22 13:12:13.314 WARN 24848 --- [background-preinit] o.s.h.c.j.Jackson2ObjectMapperBuilder : For Jackson Kotlin classes support please add "com.fasterxml.jackson.module:jackson-module-kotlin" to the classpath
2024-03-22 13:12:20.078 ERROR 24848 --- [main] c.j.v.c.listener.ConfigInitListener : 初始化系统配置表失败,执行查询语句失败
java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:906)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:831)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.junmp.v2.config.listener.ConfigInitListener.eventCallback(ConfigInitListener.java:79)
at com.junmp.v2.common.listener.ContextInitializedListener.onApplicationEvent(ContextInitializedListener.java:30)
at com.junmp.v2.common.listener.ContextInitializedListener.onApplicationEvent(ContextInitializedListener.java:20)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.contextPrepared(EventPublishingRunListener.java:89)
at org.springframework.boot.SpringApplicationRunListeners.lambda$contextPrepared$3(SpringApplicationRunListeners.java:67)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
at org.springframework.boot.SpringApplicationRunListeners.contextPrepared(SpringApplicationRunListeners.java:67)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:391)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:325)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1313)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302)
at com.junmp.jyzb.boot.JyzbBootApplication.main(JyzbBootApplication.java:46)
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)
at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)
at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:91)
at com.mysql.cj.NativeSession.connect(NativeSession.java:144)
at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:850)
... 24 common frames omitted
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:75)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:476)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:218)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:200)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:162)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:394)
at java.net.Socket.connect(Socket.java:606)
at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:155)
at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:65)
... 26 common frames omitted
2024-03-22 13:12:20.163 ERROR 24848 --- [main] o.s.boot.SpringApplication : Application run failed
com.junmp.v2.config.api.exception.ConfigException: 初始化系统配置表失败,执行查询语句失败
at com.junmp.v2.config.listener.ConfigInitListener.eventCallback(ConfigInitListener.java:95)
at com.junmp.v2.common.listener.ContextInitializedListener.onApplicationEvent(ContextInitializedListener.java:30)
at com.junmp.v2.common.listener.ContextInitializedListener.onApplicationEvent(ContextInitializedListener.java:20)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.contextPrepared(EventPublishingRunListener.java:89)
at org.springframework.boot.SpringApplicationRunListeners.lambda$contextPrepared$3(SpringApplicationRunListeners.java:67)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
at org.springframework.boot.SpringApplicationRunListeners.contextPrepared(SpringApplicationRunListeners.java:67)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:391)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:325)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1313)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302)
at com.junmp.jyzb.boot.JyzbBootApplication.main(JyzbBootApplication.java:46)
...@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; ...@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
/** /**
...@@ -16,12 +17,13 @@ import java.util.List; ...@@ -16,12 +17,13 @@ import java.util.List;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class EquipmentBindReq extends BaseRequest { public class EquipmentBindReq extends BaseRequest {
/** /**
* 单警柜箱号id * epc
*/ */
@NotBlank(message = "箱号id不能为空",groups = {edit.class}) private String epc;
private String cabinetBoxId;
/** /**
* 装备id集合 * type_id
*/ */
List<String> equipmentList; private String typeId;
private String sizeId;
private BigDecimal price;
} }
package com.junmp.jyzb.api.bean.req;
import lombok.Data;
import java.util.List;
@Data
public class UpdateEqsBoxReq {
private Long orgId;
private String locationId;
private List<String> epcList;
private List<EquipmentBindReq> eqsList;
}
...@@ -29,6 +29,7 @@ public enum PolicemanExceptionEnum implements IExceptionEnum { ...@@ -29,6 +29,7 @@ public enum PolicemanExceptionEnum implements IExceptionEnum {
*/ */
POLICECODE_IS_EXISTS(CommonConstant.DEFAULT_USER_ERROR_CODE,"警员编号已经存在,警员编号重复"), POLICECODE_IS_EXISTS(CommonConstant.DEFAULT_USER_ERROR_CODE,"警员编号已经存在,警员编号重复"),
POLICENAME_IS_EXISTS(CommonConstant.DEFAULT_USER_ERROR_CODE,"警员姓名已经存在,警员姓名重复"), POLICENAME_IS_EXISTS(CommonConstant.DEFAULT_USER_ERROR_CODE,"警员姓名已经存在,警员姓名重复"),
POLICE_IS_EXISTS(CommonConstant.DEFAULT_USER_ERROR_CODE,"警员姓名+警号已经存在,请勿重复添加"),
/** /**
* 该警员已经绑定账号 * 该警员已经绑定账号
......
...@@ -74,7 +74,7 @@ public class CabinetController { ...@@ -74,7 +74,7 @@ public class CabinetController {
@PostMapping(path="/UpdateCabinetClient",name="修改单警柜信息,警柜使用#logType=30") @PostMapping(path="/UpdateCabinetClient",name="修改单警柜信息,警柜使用#logType=30")
@ApiOperation("修改单警柜信息,警柜使用") @ApiOperation("修改单警柜信息,警柜使用")
public ApiRes<Boolean> UpdateCabinetClient(@RequestBody UpdateCabinetReq req) { public ApiRes<Boolean> UpdateCabinetClient(@RequestBody UpdateCabinetReq req) {
boolean result = cabinetService.updateCabinetInfo(req); boolean result = cabinetService.updateCabinetClient(req);
if (!result){ if (!result){
return ApiRes.failure("操作失败"); return ApiRes.failure("操作失败");
} }
......
...@@ -5,8 +5,8 @@ import com.junmp.jyzb.api.bean.dto.*; ...@@ -5,8 +5,8 @@ import com.junmp.jyzb.api.bean.dto.*;
import com.junmp.jyzb.api.bean.dto.FetchingDataDto.EquipmentDto; import com.junmp.jyzb.api.bean.dto.FetchingDataDto.EquipmentDto;
import com.junmp.jyzb.api.bean.query.*; import com.junmp.jyzb.api.bean.query.*;
import com.junmp.jyzb.api.bean.req.BatchEditingInvsReq; import com.junmp.jyzb.api.bean.req.BatchEditingInvsReq;
import com.junmp.jyzb.api.bean.req.EquipmentBindReq;
import com.junmp.jyzb.api.bean.req.RabbitMqOrderReq; import com.junmp.jyzb.api.bean.req.RabbitMqOrderReq;
import com.junmp.jyzb.api.bean.req.UpdateEqsBoxReq;
import com.junmp.jyzb.entity.InventorySummary; import com.junmp.jyzb.entity.InventorySummary;
import com.junmp.jyzb.entity.LogDetail; import com.junmp.jyzb.entity.LogDetail;
import com.junmp.jyzb.entity.LogSummary; import com.junmp.jyzb.entity.LogSummary;
...@@ -46,11 +46,11 @@ public class InventoryController { ...@@ -46,11 +46,11 @@ public class InventoryController {
//装备绑定箱门 //装备绑定箱门
@PostMapping(path="/EquipmentBind",name="装备绑定箱门#logType=30") // @PostMapping(path="/EquipmentBind",name="装备绑定箱门#logType=30")
@ApiOperation("装备绑定箱门") // @ApiOperation("装备绑定箱门")
public ApiRes<Boolean> InventoryBind(@RequestBody @Validated(ValidationApi.edit.class) EquipmentBindReq req){ // public ApiRes<Boolean> InventoryBind(@RequestBody @Validated(ValidationApi.edit.class) EquipmentBindReq req){
return ApiRes.success(inventoryService.InventoryBind(req)); // return ApiRes.success(inventoryService.InventoryBind(req));
} // }
//手动修改仓库数量信息,修改的是base_warehouse中的个别字段(总数,总价,入库数,出库数),是通过inventory_summary进行统计的 //手动修改仓库数量信息,修改的是base_warehouse中的个别字段(总数,总价,入库数,出库数),是通过inventory_summary进行统计的
...@@ -316,6 +316,18 @@ public class InventoryController { ...@@ -316,6 +316,18 @@ public class InventoryController {
return ApiRes.success(inventoryService.GetByPeriodAndDate(req)); return ApiRes.success(inventoryService.GetByPeriodAndDate(req));
} }
//装备绑定箱门
@PostMapping(path = "/EqsBindBox",name = "装备绑定箱门#logType=30")
@ApiOperation("装备绑定箱门")
public ApiRes<Boolean> EqsBindBox(@RequestBody UpdateEqsBoxReq req){
return ApiRes.success(inventoryService.EqsBindBox(req));
}
//装备解绑箱门
@PostMapping(path = "/EqsUnBindBox",name = "装备解绑箱门#logType=30")
@ApiOperation("装备解绑箱门")
public ApiRes<Boolean> EqsUnBindBox(@RequestBody UpdateEqsBoxReq req){
return ApiRes.success(inventoryService.EqsUnBindBox(req));
}
......
...@@ -247,6 +247,12 @@ public class PoliceController { ...@@ -247,6 +247,12 @@ public class PoliceController {
public ApiRes<Boolean> PoliceBindBox(@RequestBody @Validated(ValidationApi.add.class) PolicemanReq req){ public ApiRes<Boolean> PoliceBindBox(@RequestBody @Validated(ValidationApi.add.class) PolicemanReq req){
return ApiRes.success(policemanService.PoliceBindBox(req)); return ApiRes.success(policemanService.PoliceBindBox(req));
} }
//人员解绑箱门
@PostMapping(path = "PoliceUnBindBox",name = "人员解绑箱门#logType=30")
@ApiOperation("人员解绑箱门")
public ApiRes<Boolean> PoliceUnBindBox(@RequestBody @Validated(ValidationApi.add.class) PolicemanReq req){
return ApiRes.success(policemanService.PoliceUnBindBox(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 java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* @TableName base_police_equipment_detail
*/
@TableName(value ="base_police_equipment_detail")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PoliceEquipmentDetail implements Serializable {
/**
* 主键id
*/
@TableId(value = "id",type = IdType.ASSIGN_UUID)
private String id;
/**
* 警员id
*/
@TableField(value = "police_id")
private String policeId;
/**
* epc
*/
@TableField(value = "epc")
private String epc;
/**
* 组织机构id
*/
@TableField(value = "org_id")
private String orgId;
/**
* 位置id
*/
@TableField(value = "location_id")
private String locationId;
/**
* 类型id
*/
@TableField(value = "type_id")
private String typeId;
/**
* 号型id
*/
@TableField(value = "size_id")
private String sizeId;
/**
* 单价
*/
@TableField(value = "price")
private BigDecimal price;
/**
* 创建时间
*/
@TableField(value = "create_time")
private Date createTime;
/**
* 更新时间
*/
@TableField(value = "update_time")
private Date updateTime;
/**
* 创建人员
*/
@TableField(value = "create_user")
private String createUser;
/**
* 更新人员
*/
@TableField(value = "update_user")
private String updateUser;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.junmp.jyzb.mapper;
import com.junmp.jyzb.entity.PoliceEquipmentDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author Administrator
* @description 针对表【base_police_equipment_detail】的数据库操作Mapper
* @createDate 2024-03-25 14:18:17
* @Entity aaa.domain.PoliceEquipmentDetail
*/
public interface PoliceEquipmentDetailMapper extends BaseMapper<PoliceEquipmentDetail> {
}
...@@ -7,8 +7,9 @@ import com.junmp.jyzb.api.bean.dto.FetchingDataDto.EquipmentDto; ...@@ -7,8 +7,9 @@ import com.junmp.jyzb.api.bean.dto.FetchingDataDto.EquipmentDto;
import com.junmp.jyzb.api.bean.query.*; import com.junmp.jyzb.api.bean.query.*;
import com.junmp.jyzb.api.bean.req.BatchEditingInvsReq; import com.junmp.jyzb.api.bean.req.BatchEditingInvsReq;
import com.junmp.jyzb.api.bean.req.EquipmentBindReq;
import com.junmp.jyzb.api.bean.req.RabbitMqOrderReq; import com.junmp.jyzb.api.bean.req.RabbitMqOrderReq;
import com.junmp.jyzb.api.bean.req.UpdateEqsBoxReq;
import com.junmp.jyzb.entity.Inventory; import com.junmp.jyzb.entity.Inventory;
import com.junmp.jyzb.entity.InventorySummary; import com.junmp.jyzb.entity.InventorySummary;
import com.junmp.jyzb.entity.LogDetail; import com.junmp.jyzb.entity.LogDetail;
...@@ -29,7 +30,7 @@ public interface InventoryService extends IService<Inventory> { ...@@ -29,7 +30,7 @@ public interface InventoryService extends IService<Inventory> {
boolean UpdateCabinetInsNum(CabinetReq req); boolean UpdateCabinetInsNum(CabinetReq req);
boolean InventoryBind(EquipmentBindReq req); // boolean InventoryBind(EquipmentBindReq req);
List<InventoryDto> GetInvInfoByEpc(InventoryReq req); List<InventoryDto> GetInvInfoByEpc(InventoryReq req);
...@@ -95,4 +96,7 @@ public interface InventoryService extends IService<Inventory> { ...@@ -95,4 +96,7 @@ public interface InventoryService extends IService<Inventory> {
List<PeriodAndDateDto> GetByPeriodAndDate(InventoryReq req); List<PeriodAndDateDto> GetByPeriodAndDate(InventoryReq req);
List<Inventory> selectSum(List<Object[]> searchItem,Integer epctype); List<Inventory> selectSum(List<Object[]> searchItem,Integer epctype);
boolean EqsBindBox(UpdateEqsBoxReq req);
boolean EqsUnBindBox(UpdateEqsBoxReq req);
} }
package com.junmp.jyzb.service;
import com.junmp.jyzb.entity.PoliceEquipmentDetail;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author Administrator
* @description 针对表【base_police_equipment_detail】的数据库操作Service
* @createDate 2024-03-25 14:18:17
*/
public interface PoliceEquipmentDetailService extends IService<PoliceEquipmentDetail> {
}
...@@ -27,6 +27,8 @@ import java.util.List; ...@@ -27,6 +27,8 @@ import java.util.List;
public interface PolicemanService extends IService<Policeman> { public interface PolicemanService extends IService<Policeman> {
Object addEs(); Object addEs();
//添加警员 //添加警员
...@@ -136,4 +138,8 @@ public interface PolicemanService extends IService<Policeman> { ...@@ -136,4 +138,8 @@ public interface PolicemanService extends IService<Policeman> {
boolean CreateAllUserId(); boolean CreateAllUserId();
boolean PoliceUnBindBox(PolicemanReq req);
} }
...@@ -15,8 +15,8 @@ import com.junmp.jyzb.api.bean.dto.*; ...@@ -15,8 +15,8 @@ import com.junmp.jyzb.api.bean.dto.*;
import com.junmp.jyzb.api.bean.dto.FetchingDataDto.EquipmentDto; import com.junmp.jyzb.api.bean.dto.FetchingDataDto.EquipmentDto;
import com.junmp.jyzb.api.bean.query.*; import com.junmp.jyzb.api.bean.query.*;
import com.junmp.jyzb.api.bean.req.BatchEditingInvsReq; import com.junmp.jyzb.api.bean.req.BatchEditingInvsReq;
import com.junmp.jyzb.api.bean.req.EquipmentBindReq;
import com.junmp.jyzb.api.bean.req.RabbitMqOrderReq; import com.junmp.jyzb.api.bean.req.RabbitMqOrderReq;
import com.junmp.jyzb.api.bean.req.UpdateEqsBoxReq;
import com.junmp.jyzb.api.bean.vo.InventoryVo; import com.junmp.jyzb.api.bean.vo.InventoryVo;
import com.junmp.jyzb.api.exception.JYZBAppException; import com.junmp.jyzb.api.exception.JYZBAppException;
import com.junmp.jyzb.api.exception.enums.*; import com.junmp.jyzb.api.exception.enums.*;
...@@ -165,26 +165,26 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory ...@@ -165,26 +165,26 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
} }
//装备绑定箱门 //装备绑定箱门
@Override // @Override
public boolean InventoryBind(EquipmentBindReq req) { // public boolean InventoryBind(EquipmentBindReq req) {
//判断箱门是否存在 // //判断箱门是否存在
CabinetBox cabinetBox = cabinetBoxService.CabinetBoxExist(req.getCabinetBoxId()); // CabinetBox cabinetBox = cabinetBoxService.CabinetBoxExist(req.getCabinetBoxId());
if (Objects.isNull(cabinetBox)){ // if (Objects.isNull(cabinetBox)){
throw new ServiceException(CabinetBoxExceptionEnum.CABINETBOX_ISNOT_EXISTS); // throw new ServiceException(CabinetBoxExceptionEnum.CABINETBOX_ISNOT_EXISTS);
} // }
List<String> equipmentList = req.getEquipmentList(); // List<String> equipmentList = req.getEquipmentList();
if (equipmentList.size()==0){ // if (equipmentList.size()==0){
throw new ServiceException(CabinetExceptionEnum.PARAMETER_ERROR); // throw new ServiceException(CabinetExceptionEnum.PARAMETER_ERROR);
} // }
List<Inventory> inventoryList=new ArrayList<>(); // List<Inventory> inventoryList=new ArrayList<>();
for (String id: equipmentList) { // for (String id: equipmentList) {
Inventory inventory = getById(id); // Inventory inventory = getById(id);
//locationId:根据单警柜的不同存放的内容不同,单警柜存放箱门id,仓库存放仓库id // //locationId:根据单警柜的不同存放的内容不同,单警柜存放箱门id,仓库存放仓库id
inventory.setLocationId(req.getCabinetBoxId()); // inventory.setLocationId(req.getCabinetBoxId());
inventoryList.add(inventory); // inventoryList.add(inventory);
} // }
return updateBatchById(inventoryList); // return updateBatchById(inventoryList);
} // }
//根据Epc查询装备信息 //根据Epc查询装备信息
@Override @Override
...@@ -894,5 +894,27 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory ...@@ -894,5 +894,27 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
return inventoryMapper.selectSum(searchItem,epcType); return inventoryMapper.selectSum(searchItem,epcType);
} }
//装备绑定箱门
@Override
public boolean EqsBindBox(UpdateEqsBoxReq req) {
//1.修改具体epc位置信息
// for (:) {
//
// }
//2.修改原始出库仓库的库存汇总信息
//3.新增绑定箱门的库存汇总信息
//4.具体epc绑定人员
return false;
}
//装备解绑箱门
@Override
public boolean EqsUnBindBox(UpdateEqsBoxReq req) {
//1.修改epc具体位置信息
//2.修改绑定单警柜的库存信息
return false;
}
} }
\ No newline at end of file
package com.junmp.jyzb.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.junmp.jyzb.entity.PoliceEquipmentDetail;
import com.junmp.jyzb.service.PoliceEquipmentDetailService;
import com.junmp.jyzb.mapper.PoliceEquipmentDetailMapper;
import org.springframework.stereotype.Service;
/**
* @author Administrator
* @description 针对表【base_police_equipment_detail】的数据库操作Service实现
* @createDate 2024-03-25 14:18:17
*/
@Service
public class PoliceEquipmentDetailServiceImpl extends ServiceImpl<PoliceEquipmentDetailMapper, PoliceEquipmentDetail>
implements PoliceEquipmentDetailService{
}
...@@ -753,7 +753,7 @@ ...@@ -753,7 +753,7 @@
</select> </select>
<select id="GetByPeriodAndDate" resultType="com.junmp.jyzb.api.bean.PeriodAndDateDto"> <select id="GetByPeriodAndDate" resultType="com.junmp.jyzb.api.bean.PeriodAndDateDto">
select count(*) as zkCount,location_id,max(location_name) as location_name,warranty_period,production_date,price as unit_price,org_id FROM( select count(*) as zk_count,location_id,max(location_name) as location_name,warranty_period,production_date,price as unit_price,org_id FROM(
SELECT a.*,b.warranty_period,b.production_date,b.price FROM SELECT a.*,b.warranty_period,b.production_date,b.price FROM
(SELECT org_id,size_id,type_id,location_id,epc,location_name FROM `base_warehouse_inventory` wi (SELECT org_id,size_id,type_id,location_id,epc,location_name FROM `base_warehouse_inventory` wi
where org_id=#{req.orgId} and type_id=#{req.typeId} where org_id=#{req.orgId} and type_id=#{req.typeId}
...@@ -781,7 +781,7 @@ ...@@ -781,7 +781,7 @@
and price =#{req.price} and price =#{req.price}
</if> </if>
<if test="req.zkCount != null and req.zkCount !=''"> <if test="req.zkCount != null and req.zkCount !=''">
and zkCount =#{req.zkCount} and zk_count =#{req.zkCount}
</if> </if>
<if test="req.warrantyPeriod != null and req.warrantyPeriod !=''"> <if test="req.warrantyPeriod != null and req.warrantyPeriod !=''">
and warranty_period =#{req.warrantyPeriod} and warranty_period =#{req.warrantyPeriod}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.junmp.jyzb.mapper.PoliceEquipmentDetailMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.entity.PoliceEquipmentDetail">
<id property="id" column="id" jdbcType="VARCHAR"/>
<result property="policeId" column="police_id" jdbcType="VARCHAR"/>
<result property="epc" column="epc" jdbcType="VARCHAR"/>
<result property="orgId" column="org_id" jdbcType="VARCHAR"/>
<result property="locationId" column="location_id" jdbcType="VARCHAR"/>
<result property="typeId" column="type_id" jdbcType="VARCHAR"/>
<result property="sizeId" column="size_id" jdbcType="VARCHAR"/>
<result property="price" column="price" jdbcType="DECIMAL"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="createUser" column="create_user" jdbcType="VARCHAR"/>
<result property="updateUser" column="update_user" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id,police_id,epc,
org_id,location_id,type_id,
size_id,price,create_time,
update_time,create_user,update_user
</sql>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论