|
@@ -10,13 +10,16 @@ import com.imcs.admin.common.config.SessionContext;
|
|
|
import com.imcs.admin.db.service.JdbcDao;
|
|
|
import com.imcs.admin.db.service.JdbcService;
|
|
|
import com.imcs.admin.util.GenerateSerial;
|
|
|
+import net.jposprinter.Sdk;
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.nio.charset.Charset;
|
|
|
import java.util.*;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
@@ -43,6 +46,14 @@ public class BusinessServiceImpl implements BusinessService{
|
|
|
serialMap.put(5,"aProductionDesignPreparationTask05");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 每周一执行一次删除环境监测数据
|
|
|
+ */
|
|
|
+ @Scheduled(cron = "0 0 0 ? * MON")
|
|
|
+ public void deleteEnvironment(){
|
|
|
+ jdbcService.delete("delete from a_environment");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public void salesProductionOrder(Long id) {
|
|
@@ -465,6 +476,21 @@ public class BusinessServiceImpl implements BusinessService{
|
|
|
"production_order_code in (select production_order_code from a_production_order where product_id = (select parent_id from a_process_version where id=? and status=1 ))",id);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void printer(String workCode) {
|
|
|
+ System.out.println("JposPrinterDemo Start ...");
|
|
|
+ Sdk sdk =new Sdk();
|
|
|
+ sdk.pioOpen("usb","",3000);//usb
|
|
|
+ //sdk.pioOpen("com1","9600",3000);//com1 ,9600/19200/38400/115200
|
|
|
+ //sdk.pioOpen("tcp:192.168.123.100","",3000);//tcp:192.168.123.100
|
|
|
+ sdk.twobarCodes(workCode, Charset.defaultCharset());
|
|
|
+ sdk.pioWritePort(workCode.getBytes());
|
|
|
+ sdk.pioWritePort("\n\n\n\n\n\n".getBytes());
|
|
|
+ sdk.selectCutPagerModerAndCutPager(0);
|
|
|
+ sdk.pioClose();
|
|
|
+ System.out.println("JposPrinterDemo finished.");
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 销售订单id
|
|
|
* @param id
|