提交 af9d4789 authored 作者: zhoushaopan's avatar zhoushaopan

fix(配发模块,装备模块): 修服了横向配发500。以及缓存

修服了横向配发500。以及缓存
上级 fde15867
...@@ -226,7 +226,6 @@ public class AllotBillController { ...@@ -226,7 +226,6 @@ public class AllotBillController {
//从草稿发起 //从草稿发起
else { else {
TaskBto taskBto = taskService.get(allotBillSaveVo.getTaskId()); TaskBto taskBto = taskService.get(allotBillSaveVo.getTaskId());
// taskBto.setTitle("["+allotBillSaveVo.getReceiveUnit().substring(0,3) + "]型号" + StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) + "的装备共" + allotBillSaveVo.getAllotCount() + "件");
taskBto.setTitle("["+DeviceModelSort.unitNameToDisName(allotBillSaveVo.getReceiveUnit()) + "]型号" + taskBto.setTitle("["+DeviceModelSort.unitNameToDisName(allotBillSaveVo.getReceiveUnit()) + "]型号" +
StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel) StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel)
.distinct().collect(Collectors.toList())) + "的装备共" + allotBillSaveVo.getAllotCount() + "件"); .distinct().collect(Collectors.toList())) + "的装备共" + allotBillSaveVo.getAllotCount() + "件");
...@@ -278,6 +277,16 @@ public class AllotBillController { ...@@ -278,6 +277,16 @@ public class AllotBillController {
//推动任务到配发中状态 //推动任务到配发中状态
saveEntity = taskService.moveToSpecial(taskBto1, StatusEnum.WAIT_UPLOAD_CROSS_FILE, userId); saveEntity = taskService.moveToSpecial(taskBto1, StatusEnum.WAIT_UPLOAD_CROSS_FILE, userId);
} }
TaskBto taskBto2 = new TaskBto(StatusEnum.WAIT_UPLOAD_ALLOT_FILE.id,
"["+DeviceModelSort.unitNameToDisName(allotBillSaveVo.getReceiveUnit()) + "]型号" +
StringSplitUtil.stringListToString(allotBillSaveVo.getScriptSaveVos()
.stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList())) +
"的装备共" + allotBillSaveVo.getAllotCount() + "件", saveEntity.getId(),
saveEntity.getNodeIdDetail() + saveEntity.getId() + ".", saveEntity.getBillId(),
3, allotBillSaveVo.getSendUnitId(),
0, null, Collections.singletonList(0));
taskService.start(taskBto2);
} }
List<FileVo> fileVoList = new ArrayList<>(); List<FileVo> fileVoList = new ArrayList<>();
//分解装备id字符串 //分解装备id字符串
......
...@@ -28,12 +28,14 @@ import com.tykj.dev.misc.utils.PageUtil; ...@@ -28,12 +28,14 @@ import com.tykj.dev.misc.utils.PageUtil;
import com.tykj.dev.misc.utils.ResultUtil; import com.tykj.dev.misc.utils.ResultUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.Synchronized;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.data.jpa.repository.Lock;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
......
package com.tykj.dev.rfid.controller; package com.tykj.dev.rfid.controller;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.rfid.entity.domin.AccessControlName;
import com.tykj.dev.rfid.timeTask.ReadUtils; import com.tykj.dev.rfid.timeTask.ReadUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/** /**
* @author zsp * @author zsp
* @create 2021/12/2 10:39 * @create 2021/12/2 10:39
*/ */
@RestController @RestController
@Api(tags = "读写机模块", value = "读写机模块") @Api(tags = "读写机模块", description = "读写机模块")
@AutoDocument @AutoDocument
@RequestMapping("/readMachine") @RequestMapping("/readMachine")
@Slf4j @Slf4j
...@@ -34,6 +30,8 @@ public class ReadController { ...@@ -34,6 +30,8 @@ public class ReadController {
readUtils.testinitreader(); readUtils.testinitreader();
//开始盘存 //开始盘存
readUtils.testinventory1(); readUtils.testinventory1();
//关闭
readUtils.getJreader().CloseReader();
return ResponseEntity.ok("读写成功"); return ResponseEntity.ok("读写成功");
} }
} }
...@@ -2,8 +2,9 @@ package com.tykj.dev.rfid.timeTask; ...@@ -2,8 +2,9 @@ package com.tykj.dev.rfid.timeTask;
import com.uhf.api.cls.Reader; import com.uhf.api.cls.Reader;
import com.uhf.api.cls.Reader.*; import com.uhf.api.cls.Reader.*;
import lombok.Data;
@Data
public class ReadUtils { public class ReadUtils {
/** /**
...@@ -20,8 +21,7 @@ public class ReadUtils { ...@@ -20,8 +21,7 @@ public class ReadUtils {
Jreader=new Reader(); Jreader=new Reader();
} }
public void testtran() public void testtran(){
{
byte[] hex=new byte[]{(byte) 0xA2,(byte) 0xC8,(byte) 0xD4,(byte) 0xE5}; byte[] hex=new byte[]{(byte) 0xA2,(byte) 0xC8,(byte) 0xD4,(byte) 0xE5};
int len=4; int len=4;
char[] str=new char[4*2]; char[] str=new char[4*2];
...@@ -47,8 +47,7 @@ public class ReadUtils { ...@@ -47,8 +47,7 @@ public class ReadUtils {
System.out.println(hexbuf[i]); System.out.println(hexbuf[i]);
} }
public void testpsam() public void testpsam(){
{
int soltid=1; int soltid=1;
int coslen=2; int coslen=2;
byte[] cos=new byte[]{0x11,0x22,0x33,0x44,0x55,0x66,0x77,(byte) 0x88,(byte) 0x99,0x12,0x34}; byte[] cos=new byte[]{0x11,0x22,0x33,0x44,0x55,0x66,0x77,(byte) 0x88,(byte) 0x99,0x12,0x34};
...@@ -60,8 +59,7 @@ public class ReadUtils { ...@@ -60,8 +59,7 @@ public class ReadUtils {
errcode, (short)1000); errcode, (short)1000);
} }
public void testcustomcmd() public void testcustomcmd() {
{
//m4 qt //m4 qt
IMPINJM4QtPara CustomPara=Jreader.new IMPINJM4QtPara(); IMPINJM4QtPara CustomPara=Jreader.new IMPINJM4QtPara();
CustomPara.TimeOut=800; CustomPara.TimeOut=800;
...@@ -103,8 +101,7 @@ public class ReadUtils { ...@@ -103,8 +101,7 @@ public class ReadUtils {
} }
public void testreadandwrite() public void testreadandwrite(){
{
/* /*
* READER_ERR WriteTagData(int ant,char bank,int address, byte[] data, int datalen, byte[] accesspasswd,short timeout); * READER_ERR WriteTagData(int ant,char bank,int address, byte[] data, int datalen, byte[] accesspasswd,short timeout);
* ant ??????????? * ant ???????????
...@@ -160,8 +157,7 @@ public class ReadUtils { ...@@ -160,8 +157,7 @@ public class ReadUtils {
} }
public void testblockop() public void testblockop() {
{
String pwd="11000000"; String pwd="11000000";
byte[] data=new byte[4]; byte[] data=new byte[4];
Jreader.Str2Hex(pwd, pwd.length(), data); Jreader.Str2Hex(pwd, pwd.length(), data);
...@@ -171,7 +167,6 @@ public class ReadUtils { ...@@ -171,7 +167,6 @@ public class ReadUtils {
//???????? //????????
Jreader.BlockPermaLock(1, 1, 2, 6, new byte[]{(byte) 0xff,(byte) 0xff}, data, (short)1000); Jreader.BlockPermaLock(1, 1, 2, 6, new byte[]{(byte) 0xff,(byte) 0xff}, data, (short)1000);
} }
public void testinitreader() { public void testinitreader() {
...@@ -237,8 +232,7 @@ public class ReadUtils { ...@@ -237,8 +232,7 @@ public class ReadUtils {
er=Jreader.ParamSet(Mtr_Param.MTR_PARAM_READER_IS_CHK_ANT, 0); er=Jreader.ParamSet(Mtr_Param.MTR_PARAM_READER_IS_CHK_ANT, 0);
} }
public void testinventory1() public void testinventory1() {
{
/* /*
* *
* ??????????????????????????????????? * ???????????????????????????????????
...@@ -286,8 +280,7 @@ public class ReadUtils { ...@@ -286,8 +280,7 @@ public class ReadUtils {
} }
public void testdataonreader() public void testdataonreader() {
{
byte[] data3=new byte[100]; byte[] data3=new byte[100];
READER_ERR er=Jreader.ReadDataOnReader(0, data3, 100); READER_ERR er=Jreader.ReadDataOnReader(0, data3, 100);
er=Jreader.SaveDataOnReader(0, data3, 100); er=Jreader.SaveDataOnReader(0, data3, 100);
...@@ -296,16 +289,14 @@ public class ReadUtils { ...@@ -296,16 +289,14 @@ public class ReadUtils {
er=Jreader.EraseDataOnReader(); er=Jreader.EraseDataOnReader();
} }
public void testkilltag() public void testkilltag() {
{
String pwd="11000000"; String pwd="11000000";
byte[] data=new byte[4]; byte[] data=new byte[4];
Jreader.Str2Hex(pwd, pwd.length(), data); Jreader.Str2Hex(pwd, pwd.length(), data);
READER_ERR er=Jreader.KillTag(1, data, (short) 1000); READER_ERR er=Jreader.KillTag(1, data, (short) 1000);
} }
public void testlocktag() public void testlocktag() {
{
String pwd="12340000"; String pwd="12340000";
// READER_ERR er=Jreader.Lock180006BTag(1, 2, 6, (short) 1000); // READER_ERR er=Jreader.Lock180006BTag(1, 2, 6, (short) 1000);
byte[] data=new byte[4]; byte[] data=new byte[4];
...@@ -326,8 +317,7 @@ public class ReadUtils { ...@@ -326,8 +317,7 @@ public class ReadUtils {
er=Jreader.LockTag(1, (byte)Lock_Obj.LOCK_OBJECT_BANK1.value(), (short)Lock_Type.BANK1_UNLOCK.value(), data, (short)1000); er=Jreader.LockTag(1, (byte)Lock_Obj.LOCK_OBJECT_BANK1.value(), (short)Lock_Type.BANK1_UNLOCK.value(), data, (short)1000);
} }
public void testsetip() public void testsetip() {
{
Reader_Ip rip=Jreader.new Reader_Ip(); Reader_Ip rip=Jreader.new Reader_Ip();
/* /*
rip.ip=new byte[]{'1','9','2','.','1','6','8','.','1','.','1','0','1'}; rip.ip=new byte[]{'1','9','2','.','1','6','8','.','1','.','1','0','1'};
...@@ -343,8 +333,7 @@ public class ReadUtils { ...@@ -343,8 +333,7 @@ public class ReadUtils {
READER_ERR er=Jreader.ParamSet(Mtr_Param.MTR_PARAM_READER_IP, rip); READER_ERR er=Jreader.ParamSet(Mtr_Param.MTR_PARAM_READER_IP, rip);
} }
public void testrparams() public void testrparams() {
{
HoptableData_ST hdst=Jreader.new HoptableData_ST(); HoptableData_ST hdst=Jreader.new HoptableData_ST();
hdst.lenhtb=5; hdst.lenhtb=5;
hdst.htb[0]=915250; hdst.htb[0]=915250;
...@@ -578,8 +567,7 @@ public class ReadUtils { ...@@ -578,8 +567,7 @@ public class ReadUtils {
er=Jreader.ParamGet(Mtr_Param.MTR_PARAM_TRANSMIT_MODE, val2); er=Jreader.ParamGet(Mtr_Param.MTR_PARAM_TRANSMIT_MODE, val2);
} }
public void testgpio() public void testgpio() {
{
READER_ERR er=Jreader.SetGPO(1, 1); READER_ERR er=Jreader.SetGPO(1, 1);
er=Jreader.SetGPO(2, 0); er=Jreader.SetGPO(2, 0);
er=Jreader.SetGPO(3, 0); er=Jreader.SetGPO(3, 0);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论