add dev and prod yml file and change the printer ip #4
|
@ -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 = "192.168.90.160";
|
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 );
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
spring:
|
||||||
|
uinddatasource:
|
||||||
|
jdbcUrl: jdbc:mysql://192.168.90.147:3306
|
||||||
|
username: utopia
|
||||||
|
password: Utopia01
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
logbackUrl: jdbc:mysql://192.168.90.147:3306/uind_logs?serverTimezone=Asia/Karachi
|
||||||
|
hikari:
|
||||||
|
maximum-pool-size: 5
|
||||||
|
pool-name: UINDMainPool
|
||||||
|
leak-detection-threshold: 2000
|
||||||
|
cosmosdatasource:
|
||||||
|
jdbcUrl: jdbc:mysql://192.168.90.147:3307
|
||||||
|
username: utopia
|
||||||
|
password: Utopia01
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
hikari:
|
||||||
|
maximum-pool-size: 5
|
||||||
|
pool-name: UINDCosmosPool
|
||||||
|
leak-detection-threshold: 2000
|
||||||
|
localdatasource:
|
||||||
|
jdbcUrl: jdbc:mysql://192.168.90.147:3306/cut_to_pack
|
||||||
|
username: utopia
|
||||||
|
password: Utopia01
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
hikari:
|
||||||
|
maximum-pool-size: 5
|
||||||
|
pool-name: CTPPool
|
||||||
|
leak-detection-threshold: 2000
|
||||||
|
|
||||||
|
ctp:
|
||||||
|
printer:
|
||||||
|
ipAdd: 192.168.90.160
|
||||||
|
port: 9100
|
|
@ -0,0 +1,34 @@
|
||||||
|
spring:
|
||||||
|
uinddatasource:
|
||||||
|
jdbcUrl: jdbc:mysql://localhost:3306
|
||||||
|
username: root
|
||||||
|
password: Utopia01
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
logbackUrl: jdbc:mysql://localhost:3306/uind_logs?serverTimezone=Asia/Karachi
|
||||||
|
hikari:
|
||||||
|
maximum-pool-size: 5
|
||||||
|
pool-name: UINDMainPool
|
||||||
|
leak-detection-threshold: 2000
|
||||||
|
cosmosdatasource:
|
||||||
|
jdbcUrl: jdbc:mysql://localhost:3307
|
||||||
|
username: root
|
||||||
|
password: Utopia01
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
hikari:
|
||||||
|
maximum-pool-size: 5
|
||||||
|
pool-name: UINDCosmosPool
|
||||||
|
leak-detection-threshold: 2000
|
||||||
|
localdatasource:
|
||||||
|
jdbcUrl: jdbc:mysql://localhost:3306/cut_to_pack
|
||||||
|
username: root
|
||||||
|
password: Utopia01
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
hikari:
|
||||||
|
maximum-pool-size: 5
|
||||||
|
pool-name: CTPPool
|
||||||
|
leak-detection-threshold: 2000
|
||||||
|
|
||||||
|
ctp:
|
||||||
|
printer:
|
||||||
|
ipAdd: 172.16.53.32
|
||||||
|
port: 9100
|
|
@ -1,8 +1,12 @@
|
||||||
application:
|
application:
|
||||||
title: Cut To Pack Service
|
title: Cut To Pack Service
|
||||||
version: v1.0
|
version: v1.0
|
||||||
|
name: application-dev
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
|
profiles:
|
||||||
|
active: dev
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
chain:
|
chain:
|
||||||
cache: false
|
cache: false
|
||||||
|
@ -19,34 +23,6 @@ spring:
|
||||||
check-template-location: true
|
check-template-location: true
|
||||||
cache: false
|
cache: false
|
||||||
prefix: classpath:/templates/
|
prefix: classpath:/templates/
|
||||||
uinddatasource:
|
|
||||||
jdbcUrl: jdbc:mysql://192.168.90.108:3306/uind_vms
|
|
||||||
username: utopia
|
|
||||||
password: Utopia01
|
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
|
||||||
logbackUrl: jdbc:mysql://192.168.90.108:3306/uind_logs?serverTimezone=Asia/Karachi
|
|
||||||
hikari:
|
|
||||||
maximum-pool-size: 5
|
|
||||||
pool-name: UINDMainPool
|
|
||||||
leak-detection-threshold: 2000
|
|
||||||
cosmosdatasource:
|
|
||||||
jdbcUrl: jdbc:mysql://192.168.90.108:3307
|
|
||||||
username: utopia
|
|
||||||
password: Utopia01
|
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
|
||||||
hikari:
|
|
||||||
maximum-pool-size: 5
|
|
||||||
pool-name: UINDCosmosPool
|
|
||||||
leak-detection-threshold: 2000
|
|
||||||
localdatasource:
|
|
||||||
jdbcUrl: jdbc:mysql://192.168.90.108:3306/cut_to_pack
|
|
||||||
username: utopia
|
|
||||||
password: Utopia01
|
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
|
||||||
hikari:
|
|
||||||
maximum-pool-size: 5
|
|
||||||
pool-name: CTPPool
|
|
||||||
leak-detection-threshold: 2000
|
|
||||||
|
|
||||||
server:
|
server:
|
||||||
servlet:
|
servlet:
|
||||||
|
|
Loading…
Reference in New Issue