fixed new user error and properties
parent
038db5ee8d
commit
c8b1374688
|
@ -38,7 +38,7 @@ public class UserDAO {
|
||||||
return namedParameterJdbcTemplate.query( SELECT_BY_USERNAME, params, new UserRowMapper() )
|
return namedParameterJdbcTemplate.query( SELECT_BY_USERNAME, params, new UserRowMapper() )
|
||||||
.stream()
|
.stream()
|
||||||
.findAny()
|
.findAny()
|
||||||
.orElse( new User() );
|
.orElse( null );
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<User> findAll() {
|
public List<User> findAll() {
|
||||||
|
|
|
@ -13,6 +13,7 @@ import com.zebra.sdk.comm.TcpConnection;
|
||||||
import com.zebra.sdk.graphics.internal.ZebraImage;
|
import com.zebra.sdk.graphics.internal.ZebraImage;
|
||||||
import com.zebra.sdk.printer.ZebraPrinter;
|
import com.zebra.sdk.printer.ZebraPrinter;
|
||||||
import com.zebra.sdk.printer.ZebraPrinterFactory;
|
import com.zebra.sdk.printer.ZebraPrinterFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
|
@ -27,6 +28,12 @@ import java.util.List;
|
||||||
@Service
|
@Service
|
||||||
public class BarcodeService {
|
public class BarcodeService {
|
||||||
|
|
||||||
|
@Value("${ctp.printer.ipAdd}")
|
||||||
|
private String ipAddress;
|
||||||
|
|
||||||
|
@Value("${ctp.printer.port}")
|
||||||
|
private int port;
|
||||||
|
|
||||||
private final BundleDAO bundleDAO;
|
private final BundleDAO bundleDAO;
|
||||||
private final MasterBundleDAO masterBundleDAO;
|
private final MasterBundleDAO masterBundleDAO;
|
||||||
private final FinishedItemDAO finishedItemDAO;
|
private final FinishedItemDAO finishedItemDAO;
|
||||||
|
@ -123,9 +130,7 @@ public class BarcodeService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void printLabel( BufferedImage bufferedImage ) throws Exception {
|
public void printLabel( BufferedImage bufferedImage ) throws Exception {
|
||||||
String ipAddr = "172.16.53.32";
|
Connection connection = new TcpConnection( ipAddress, port );
|
||||||
int port = 9100;
|
|
||||||
Connection connection = new TcpConnection( ipAddr, port );
|
|
||||||
connection.open();
|
connection.open();
|
||||||
ZebraPrinter printer = ZebraPrinterFactory.getInstance( connection );
|
ZebraPrinter printer = ZebraPrinterFactory.getInstance( connection );
|
||||||
ZebraImage zebraImage = new ZebraImage( bufferedImage );
|
ZebraImage zebraImage = new ZebraImage( bufferedImage );
|
||||||
|
|
|
@ -1,20 +1,4 @@
|
||||||
spring:
|
spring:
|
||||||
resources:
|
|
||||||
chain:
|
|
||||||
cache: false
|
|
||||||
strategy:
|
|
||||||
content:
|
|
||||||
enabled: true
|
|
||||||
paths: /**
|
|
||||||
html-application-cache: true
|
|
||||||
enabled: true
|
|
||||||
cache:
|
|
||||||
period: 0
|
|
||||||
static-locations: classpath:/static/
|
|
||||||
thymeleaf:
|
|
||||||
check-template-location: true
|
|
||||||
cache: false
|
|
||||||
prefix: classpath:/templates/
|
|
||||||
uinddatasource:
|
uinddatasource:
|
||||||
jdbcUrl: jdbc:mysql://192.168.90.147:3306
|
jdbcUrl: jdbc:mysql://192.168.90.147:3306
|
||||||
username: utopia
|
username: utopia
|
||||||
|
@ -44,23 +28,7 @@ spring:
|
||||||
pool-name: CTPPool
|
pool-name: CTPPool
|
||||||
leak-detection-threshold: 2000
|
leak-detection-threshold: 2000
|
||||||
|
|
||||||
server:
|
|
||||||
servlet:
|
|
||||||
context-path: /ctp
|
|
||||||
tomcat:
|
|
||||||
remoteip:
|
|
||||||
remote-ip-header: X-FORWARDED-FOR
|
|
||||||
max-parameter-count: 50000
|
|
||||||
port: 8080
|
|
||||||
compression:
|
|
||||||
enabled: true
|
|
||||||
mime-types: text/html, text/xml, text/plain, text/css, text/javascript, application/javascript, application/json, application/xml
|
|
||||||
min-response-size: 2KB
|
|
||||||
|
|
||||||
thymeleaf-layout-dialect:
|
|
||||||
version: 2.1.1
|
|
||||||
|
|
||||||
ctp:
|
ctp:
|
||||||
cipher:
|
printer:
|
||||||
key: BC87A69BFCEC4A71E73B8DCCC4F14
|
ipAdd: 192.168.90.160
|
||||||
seed-value : 7XYXo8Qq6D
|
port: 9100
|
|
@ -1,20 +1,4 @@
|
||||||
spring:
|
spring:
|
||||||
resources:
|
|
||||||
chain:
|
|
||||||
cache: false
|
|
||||||
strategy:
|
|
||||||
content:
|
|
||||||
enabled: true
|
|
||||||
paths: /**
|
|
||||||
html-application-cache: true
|
|
||||||
enabled: true
|
|
||||||
cache:
|
|
||||||
period: 0
|
|
||||||
static-locations: classpath:/static/
|
|
||||||
thymeleaf:
|
|
||||||
check-template-location: true
|
|
||||||
cache: false
|
|
||||||
prefix: classpath:/templates/
|
|
||||||
uinddatasource:
|
uinddatasource:
|
||||||
jdbcUrl: jdbc:mysql://localhost:3306
|
jdbcUrl: jdbc:mysql://localhost:3306
|
||||||
username: root
|
username: root
|
||||||
|
@ -44,23 +28,7 @@ spring:
|
||||||
pool-name: CTPPool
|
pool-name: CTPPool
|
||||||
leak-detection-threshold: 2000
|
leak-detection-threshold: 2000
|
||||||
|
|
||||||
server:
|
|
||||||
servlet:
|
|
||||||
context-path: /ctp
|
|
||||||
tomcat:
|
|
||||||
remoteip:
|
|
||||||
remote-ip-header: X-FORWARDED-FOR
|
|
||||||
max-parameter-count: 50000
|
|
||||||
port: 8080
|
|
||||||
compression:
|
|
||||||
enabled: true
|
|
||||||
mime-types: text/html, text/xml, text/plain, text/css, text/javascript, application/javascript, application/json, application/xml
|
|
||||||
min-response-size: 2KB
|
|
||||||
|
|
||||||
thymeleaf-layout-dialect:
|
|
||||||
version: 2.1.1
|
|
||||||
|
|
||||||
ctp:
|
ctp:
|
||||||
cipher:
|
printer:
|
||||||
key: BC87A69BFCEC4A71E73B8DCCC4F14
|
ipAdd: 172.16.53.32
|
||||||
seed-value : 7XYXo8Qq6D
|
port: 9100
|
|
@ -6,3 +6,41 @@ application:
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: dev
|
||||||
|
|
||||||
|
resources:
|
||||||
|
chain:
|
||||||
|
cache: false
|
||||||
|
strategy:
|
||||||
|
content:
|
||||||
|
enabled: true
|
||||||
|
paths: /**
|
||||||
|
html-application-cache: true
|
||||||
|
enabled: true
|
||||||
|
cache:
|
||||||
|
period: 0
|
||||||
|
static-locations: classpath:/static/
|
||||||
|
thymeleaf:
|
||||||
|
check-template-location: true
|
||||||
|
cache: false
|
||||||
|
prefix: classpath:/templates/
|
||||||
|
|
||||||
|
server:
|
||||||
|
servlet:
|
||||||
|
context-path: /ctp
|
||||||
|
tomcat:
|
||||||
|
remoteip:
|
||||||
|
remote-ip-header: X-FORWARDED-FOR
|
||||||
|
max-parameter-count: 50000
|
||||||
|
port: 8080
|
||||||
|
compression:
|
||||||
|
enabled: true
|
||||||
|
mime-types: text/html, text/xml, text/plain, text/css, text/javascript, application/javascript, application/json, application/xml
|
||||||
|
min-response-size: 2KB
|
||||||
|
|
||||||
|
thymeleaf-layout-dialect:
|
||||||
|
version: 2.1.1
|
||||||
|
|
||||||
|
ctp:
|
||||||
|
cipher:
|
||||||
|
key: BC87A69BFCEC4A71E73B8DCCC4F14
|
||||||
|
seed-value : 7XYXo8Qq6D
|
Loading…
Reference in New Issue