提交 2d61cd89 authored 作者: zjm's avatar zjm

合并dev

...@@ -76,7 +76,7 @@ public class FileController { ...@@ -76,7 +76,7 @@ public class FileController {
*/ */
@ApiOperation(value = "生成维修单据") @ApiOperation(value = "生成维修单据")
@PostMapping("/printRepair") @PostMapping("/printRepair")
public ResponseEntity printRepair(@RequestBody Documents documents) throws IOException, DocumentException { public ResponseEntity printRepair(@RequestBody Documents documents) {
String[] content = JavaToPdfHtmlFreeMarker.freeMarkerRenderRepair(documents,url+"htmlModel/"); String[] content = JavaToPdfHtmlFreeMarker.freeMarkerRenderRepair(documents,url+"htmlModel/");
log.info("[file] 调用了生成出入单据对接口 出入库单据"); log.info("[file] 调用了生成出入单据对接口 出入库单据");
return ResponseEntity.ok(JavaToPdfHtmlFreeMarker.createPdf(content,url,preview,"documents/")); return ResponseEntity.ok(JavaToPdfHtmlFreeMarker.createPdf(content,url,preview,"documents/"));
...@@ -213,7 +213,7 @@ public class FileController { ...@@ -213,7 +213,7 @@ public class FileController {
*/ */
@ApiOperation(value = "生成单据1") @ApiOperation(value = "生成单据1")
@GetMapping("/printDocuments1") @GetMapping("/printDocuments1")
public ResponseEntity printDocuments(HttpServletResponse response,HttpServletRequest request) throws IOException, DocumentException { public ResponseEntity printDocuments(HttpServletResponse response,HttpServletRequest request){
int interval = request.getSession().getMaxInactiveInterval(); int interval = request.getSession().getMaxInactiveInterval();
System.out.println("-------"+interval); System.out.println("-------"+interval);
Documents documents=new Documents(); Documents documents=new Documents();
...@@ -222,13 +222,13 @@ public class FileController { ...@@ -222,13 +222,13 @@ public class FileController {
documents.setReplyNum("123123123131"); documents.setReplyNum("123123123131");
documents.setSenderUnit("浙江省"); documents.setSenderUnit("浙江省");
documents.setTitle("密码装备清退单"); documents.setTitle("密码装备清退单");
documents.setId(1); documents.setId(null);
List<DocumentDevice> documentDevices=new ArrayList<>(); List<DocumentDevice> documentDevices=new ArrayList<>();
for (int i=0;i<20;i++){ for (int i=0;i<1;i++){
DocumentDevice documentDevice=new DocumentDevice(); DocumentDevice documentDevice=new DocumentDevice();
documentDevice.setCount(i); documentDevice.setCount(i);
documentDevice.setModel("MM001"); documentDevice.setModel("ZJM-123123");
documentDevice.setRemark("备注"); documentDevice.setRemark("<1231231231>312312312321312");
documentDevice.setApplicationField("省一级"); documentDevice.setApplicationField("省一级");
documentDevice.setDeviceSerialNumber("asdq1231232"); documentDevice.setDeviceSerialNumber("asdq1231232");
// documentDevice.setProductionSerialNumber("12312312312"); // documentDevice.setProductionSerialNumber("12312312312");
...@@ -238,10 +238,9 @@ public class FileController { ...@@ -238,10 +238,9 @@ public class FileController {
documentDevices.add(documentDevice); documentDevices.add(documentDevice);
} }
documents.setDocumentDevices(documentDevices); documents.setDocumentDevices(documentDevices);
String[] content = JavaToPdfHtmlFreeMarker.freeMarkerRender(documents,url+"htmlModel/"); // String[] content = JavaToPdfHtmlFreeMarker.freeMarkerRender(documents,url+"htmlModel/");
String[] content = JavaToPdfHtmlFreeMarker.freeMarkerRenderRepair(documents,url+"htmlModel/");
log.info("[file] 调用了生成出入单据对接口 出入库单据");
log.info("[file] 调用了生成出入单据对接口 documents");
return ResponseEntity.ok(JavaToPdfHtmlFreeMarker.createPdf(content,url,preview,"documents/")); return ResponseEntity.ok(JavaToPdfHtmlFreeMarker.createPdf(content,url,preview,"documents/"));
} }
......
...@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
/** /**
* @author zjm * @author zjm
...@@ -84,4 +85,52 @@ public class DocumentDevice { ...@@ -84,4 +85,52 @@ public class DocumentDevice {
this.setOneCount((remainder > 0) ? deviceSerialNumber.length()/56 + 1 : deviceSerialNumber.length()/56); this.setOneCount((remainder > 0) ? deviceSerialNumber.length()/56 + 1 : deviceSerialNumber.length()/56);
return this; return this;
} }
public DocumentDevice toChangeWord(){
remark=changeWord(remark);
return this;
}
public String changeWord(String keyword) {
System.out.println(keyword);
if (StringUtils.isNotBlank(keyword)) {
if (keyword.contains("<br/>")){
keyword = keyword.replace("<br/>", "Ǵ");
}
if (keyword.contains("<")) {
keyword = keyword.replace("<", "&lt;");
}
if (keyword.contains(">")) {
keyword = keyword.replace(">", "&gt;");
}
}
keyword = keyword.replace("Ǵ", "<br/>");
return keyword;
}
public static void main(String[] args) {
String keyword="<11111>ashdsa<br />asdsad<2222>";
if (StringUtils.isNotBlank(keyword)) {
if (keyword.contains("<br />")){
keyword = keyword.replace("<br />", "Ǵ");
}
if (keyword.contains("&")) {
keyword = keyword.replace("&", "&amp;");
}
if (keyword.contains("<")) {
keyword = keyword.replace("<", "&lt;");
}
if (keyword.contains(">")) {
keyword = keyword.replace(">", "&gt;");
}
}
keyword = keyword.replace("Ǵ", "<br />");
System.out.println(keyword);
}
} }
...@@ -115,7 +115,7 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -115,7 +115,7 @@ public class JavaToPdfHtmlFreeMarker {
String url = new File(htmlFile).toURI().toURL().toString(); String url = new File(htmlFile).toURI().toURL().toString();
ByteArrayOutputStream os = new ByteArrayOutputStream(); ByteArrayOutputStream os = new ByteArrayOutputStream();
ITextRenderer renderer = new ITextRenderer(); ITextRenderer renderer = new ITextRenderer();
renderer.setDocument(htmlFile); renderer.setDocument(url);
// 解决中文不显示问题 // 解决中文不显示问题
ITextFontResolver fontResolver = renderer.getFontResolver(); ITextFontResolver fontResolver = renderer.getFontResolver();
fontResolver.addFont(ResourceUtils.getURL("classpath:").getPath()+"font/simhei.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); fontResolver.addFont(ResourceUtils.getURL("classpath:").getPath()+"font/simhei.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
...@@ -253,6 +253,7 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -253,6 +253,7 @@ public class JavaToPdfHtmlFreeMarker {
for (int i=1; i<=3; i++){ for (int i=1; i<=3; i++){
Integer page=1; Integer page=1;
for (List<DocumentDevice> list1:listList) { for (List<DocumentDevice> list1:listList) {
String htmlname=htmlPath+ UUID.randomUUID().toString()+".html"; String htmlname=htmlPath+ UUID.randomUUID().toString()+".html";
// 合并数据模型与模板 // 合并数据模型与模板
FileWriter fileWriter = new FileWriter(new File(htmlname)); FileWriter fileWriter = new FileWriter(new File(htmlname));
...@@ -266,6 +267,7 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -266,6 +267,7 @@ public class JavaToPdfHtmlFreeMarker {
return strings; return strings;
} catch (Exception e) { } catch (Exception e) {
log.error("[freeMarkerRender] 方法找不到地址:{}",htmlPath); log.error("[freeMarkerRender] 方法找不到地址:{}",htmlPath);
log.error("{}",e);
} finally { } finally {
try { try {
out.close(); out.close();
...@@ -347,7 +349,7 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -347,7 +349,7 @@ public class JavaToPdfHtmlFreeMarker {
documentDevice.setModel(String.join("",modelList.subList(0,differ))); documentDevice.setModel(String.join("",modelList.subList(0,differ)));
documentDevice1.setModel(String.join("",modelList.subList(differ,modelList.size()))); documentDevice1.setModel(String.join("",modelList.subList(differ,modelList.size())));
}else { }else {
documentDevice.setModel(String.join("",modelList.subList(0,differ))); documentDevice.setModel(String.join("",modelList.subList(0,modelList.size())));
} }
if (seqList.size()>differ){ if (seqList.size()>differ){
...@@ -632,7 +634,7 @@ public class JavaToPdfHtmlFreeMarker { ...@@ -632,7 +634,7 @@ public class JavaToPdfHtmlFreeMarker {
// list1.add(documentDevice); // list1.add(documentDevice);
// } // }
// ); // );
data.put("documentDevices",list); data.put("documentDevices",list.stream().map(DocumentDevice::toChangeWord).collect(Collectors.toList()));
return data; return data;
} }
......
...@@ -108,7 +108,8 @@ public class RepairBackBillServiceImpl implements RepairBackBillService { ...@@ -108,7 +108,8 @@ public class RepairBackBillServiceImpl implements RepairBackBillService {
@Override @Override
public boolean delete(Integer id) { public boolean delete(Integer id) {
return false; deviceRepairBackBillDao.deleteById(id);
return true;
} }
@Override @Override
......
...@@ -1000,7 +1000,7 @@ public class SelfCheckController { ...@@ -1000,7 +1000,7 @@ public class SelfCheckController {
Integer storageLocationId = selfCheckVo.getStorageLocationId(); Integer storageLocationId = selfCheckVo.getStorageLocationId();
String unit = userUtils.getCurrentUserUnitName(); String unit = userUtils.getCurrentUserUnitName();
PredicateBuilder<DeviceLibrary> predicateBuilder = Specifications.and(); PredicateBuilder<DeviceLibrary> predicateBuilder = Specifications.and();
predicateBuilder.eq("locationUnit", unit); predicateBuilder.eq("ownUnit", unit);
if (selfCheckVo.getFilterStatusList() != null){ if (selfCheckVo.getFilterStatusList() != null){
predicateBuilder.notIn("lifeStatus",selfCheckVo.getFilterStatusList().toArray()); predicateBuilder.notIn("lifeStatus",selfCheckVo.getFilterStatusList().toArray());
...@@ -1011,7 +1011,7 @@ public class SelfCheckController { ...@@ -1011,7 +1011,7 @@ public class SelfCheckController {
if (storageLocationId1 != null ){ if (storageLocationId1 != null ){
if (storageLocationId1 != 0){ if (storageLocationId1 != 0){
predicateBuilder.eq("storageLocationId",storageLocationId1); predicateBuilder.eq("storageLocationId",storageLocationId1);
// predicateBuilder.eq("ownUnit", unit);
} }
} }
}else { }else {
...@@ -1038,6 +1038,8 @@ public class SelfCheckController { ...@@ -1038,6 +1038,8 @@ public class SelfCheckController {
List<Integer> status = new ArrayList<>(Arrays.asList(5,10,12)); List<Integer> status = new ArrayList<>(Arrays.asList(5,10,12));
List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAll(predicateBuilder.build()) List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAll(predicateBuilder.build())
.stream().filter(deviceLibrary -> !status.contains(deviceLibrary.getLifeStatus())).collect(Collectors.toList()); .stream().filter(deviceLibrary -> !status.contains(deviceLibrary.getLifeStatus())).collect(Collectors.toList());
// List<DeviceLibrary> deviceLibraries = deviceLibraryDao.findAll()
// .stream().filter(deviceLibrary -> !status.contains(deviceLibrary.getLifeStatus())).collect(Collectors.toList());
deviceLibraries.forEach(DeviceLibrary::setConfigName); deviceLibraries.forEach(DeviceLibrary::setConfigName);
List<DeviceLibrary> deviceLibraryEntities = deviceLibraries.stream() List<DeviceLibrary> deviceLibraryEntities = deviceLibraries.stream()
.filter(deviceLibrary -> deviceLibrary.getLocationUnit().equals(unit)&&(deviceLibrary.getLifeStatus()==2||deviceLibrary.getLifeStatus()==14)) .filter(deviceLibrary -> deviceLibrary.getLocationUnit().equals(unit)&&(deviceLibrary.getLifeStatus()==2||deviceLibrary.getLifeStatus()==14))
......
...@@ -1508,7 +1508,9 @@ public class TaskServiceImpl implements TaskService { ...@@ -1508,7 +1508,9 @@ public class TaskServiceImpl implements TaskService {
predicateBuilder.eq("billStatus", StatusEnum.ARCHIVE.id); predicateBuilder.eq("billStatus", StatusEnum.ARCHIVE.id);
} }
if (taskSelectVo.getSelectNum() == 0) { if (taskSelectVo.getSelectNum() == 0) {
predicateBuilder.notIn("billStatus", StatusEnum.ARCHIVE.id); if (!taskSelectVo.getBusinessType().contains(BusinessEnum.WORK_HANDOVER.id)) {
predicateBuilder.notIn("billStatus", StatusEnum.ARCHIVE.id);
}
} }
if (taskSelectVo.getSelectNum() == 1) { if (taskSelectVo.getSelectNum() == 1) {
predicateBuilder.eq("createUserId", userUtils.getCurrentUserId()); predicateBuilder.eq("createUserId", userUtils.getCurrentUserId());
......
package com.tykj.dev.device.train.controller; package com.tykj.dev.device.train.controller;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.train.entity.vo.TerminateVo;
import com.tykj.dev.device.train.entity.vo.WorkHandoverAddVo; import com.tykj.dev.device.train.entity.vo.WorkHandoverAddVo;
import com.tykj.dev.device.train.entity.vo.WorkHandoverEndAddVo; import com.tykj.dev.device.train.entity.vo.WorkHandoverEndAddVo;
import com.tykj.dev.device.train.service.WorkHandoverService; import com.tykj.dev.device.train.service.WorkHandoverService;
...@@ -14,6 +15,7 @@ import org.springframework.security.core.annotation.AuthenticationPrincipal; ...@@ -14,6 +15,7 @@ import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -83,6 +85,7 @@ public class HandoverController { ...@@ -83,6 +85,7 @@ public class HandoverController {
} }
/** /**
<<<<<<< HEAD
* 区块验证 * 区块验证
*/ */
@GetMapping(value ="/checkTrueData/{billId}") @GetMapping(value ="/checkTrueData/{billId}")
...@@ -100,4 +103,12 @@ public class HandoverController { ...@@ -100,4 +103,12 @@ public class HandoverController {
return ResponseEntity.ok(workHandoverService.traceabilityParsing(billId)); return ResponseEntity.ok(workHandoverService.traceabilityParsing(billId));
} }
@PostMapping(value = "/terminateWorkHandover")
@ApiOperation(value = "工作交接-终止工作交接")
public ResponseEntity userList(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser, @RequestBody TerminateVo terminateVo) {
workHandoverService.terminateWorkHandover(terminateVo);
return ResponseEntity.ok("终止成功");
}
} }
...@@ -62,13 +62,20 @@ public class WorkHandover { ...@@ -62,13 +62,20 @@ public class WorkHandover {
private String file; private String file;
/** /**
* 状态 1.新建 2.完成 * 状态 1.新建 2.完成 3.终止
*/ */
private Integer status=1; private Integer status=1;
@ApiModelProperty(value = "区块链RID",name = "recordId") @ApiModelProperty(value = "区块链RID",name = "recordId")
private String recordId; private String recordId;
/**
* 终止说明
*/
@Column(name = "terminate" ,columnDefinition = "TEXT")
private String terminate;
/** /**
* 工作交接单据集合 * 工作交接单据集合
*/ */
......
package com.tykj.dev.device.train.entity.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Column;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "终止说明vo", description = "终止说明vo")
public class TerminateVo {
/**
* 终止说明
*/
@ApiModelProperty(value = "终止说明", example = "bmxx", name = "terminate")
@Column(name = "terminate" ,columnDefinition = "TEXT")
private String terminate;
/**
* 工作交接id
*/
@ApiModelProperty(value = "工作交接id", example = "bmxx", name = "billId")
private Integer billId;
}
...@@ -2,6 +2,7 @@ package com.tykj.dev.device.train.service; ...@@ -2,6 +2,7 @@ package com.tykj.dev.device.train.service;
import com.tykj.dev.device.block.entity.vo.BlockTraceabilityParsing; import com.tykj.dev.device.block.entity.vo.BlockTraceabilityParsing;
import com.tykj.dev.device.train.entity.WorkHandover; import com.tykj.dev.device.train.entity.WorkHandover;
import com.tykj.dev.device.train.entity.vo.TerminateVo;
import com.tykj.dev.device.train.entity.vo.WorkHandoverAddVo; import com.tykj.dev.device.train.entity.vo.WorkHandoverAddVo;
import com.tykj.dev.device.train.entity.vo.WorkHandoverEndAddVo; import com.tykj.dev.device.train.entity.vo.WorkHandoverEndAddVo;
import com.tykj.dev.device.user.subject.entity.SecurityUser; import com.tykj.dev.device.user.subject.entity.SecurityUser;
...@@ -43,7 +44,6 @@ public interface WorkHandoverService { ...@@ -43,7 +44,6 @@ public interface WorkHandoverService {
*/ */
List<User> handover(List<Integer> userIds); List<User> handover(List<Integer> userIds);
boolean checkTrueData(Integer billId); boolean checkTrueData(Integer billId);
BlockTraceabilityParsing traceabilityParsing(Integer billId); BlockTraceabilityParsing traceabilityParsing(Integer billId);
...@@ -52,4 +52,10 @@ public interface WorkHandoverService { ...@@ -52,4 +52,10 @@ public interface WorkHandoverService {
* 历史数据上链 * 历史数据上链
*/ */
void historyUpperChain(); void historyUpperChain();
/**
* 终止工作交接
*/
void terminateWorkHandover(TerminateVo terminateVo);
} }
...@@ -17,6 +17,7 @@ import com.tykj.dev.device.train.dao.WorkHandoverDao; ...@@ -17,6 +17,7 @@ import com.tykj.dev.device.train.dao.WorkHandoverDao;
import com.tykj.dev.device.train.dao.WorkHandoverDevDao; import com.tykj.dev.device.train.dao.WorkHandoverDevDao;
import com.tykj.dev.device.train.entity.WorkHandover; import com.tykj.dev.device.train.entity.WorkHandover;
import com.tykj.dev.device.train.entity.WorkHandoverDev; import com.tykj.dev.device.train.entity.WorkHandoverDev;
import com.tykj.dev.device.train.entity.vo.TerminateVo;
import com.tykj.dev.device.train.entity.vo.WorkHandoverAddVo; import com.tykj.dev.device.train.entity.vo.WorkHandoverAddVo;
import com.tykj.dev.device.train.entity.vo.WorkHandoverEndAddVo; import com.tykj.dev.device.train.entity.vo.WorkHandoverEndAddVo;
import com.tykj.dev.device.train.entity.vo.WorkHandoverUserVo; import com.tykj.dev.device.train.entity.vo.WorkHandoverUserVo;
...@@ -244,6 +245,8 @@ public class WorkHandoverServiceImpl implements WorkHandoverService { ...@@ -244,6 +245,8 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
); );
} }
private String operatorName(WorkHandover workHandover) { private String operatorName(WorkHandover workHandover) {
StringBuffer buf = new StringBuffer(); StringBuffer buf = new StringBuffer();
...@@ -268,6 +271,23 @@ public class WorkHandoverServiceImpl implements WorkHandoverService { ...@@ -268,6 +271,23 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
return contrast; return contrast;
} }
@Override
public void terminateWorkHandover(TerminateVo terminateVo) {
Optional<WorkHandover> byId = workHandoverDao.findById(terminateVo.getBillId());
if (byId.isPresent()){
WorkHandover workHandover = byId.get();
workHandover.setStatus(3);
workHandover.setTerminate(terminateVo.getTerminate());
workHandoverDao.save(workHandover);
TaskBto taskBto = trainTaskService.selectFatherIsNullAndBillidAndBillType(workHandover.getWorkHandoverId(), BusinessEnum.WORK_HANDOVER.id);
taskService.moveToArchive(taskBto);
}else {
throw new ApiException("[工作交接] 终止工作交接任务");
}
}
private void addMessage(MessageBto messageBto){ private void addMessage(MessageBto messageBto){
messageService.add(messageBto); messageService.add(messageBto);
} }
...@@ -320,3 +340,4 @@ public class WorkHandoverServiceImpl implements WorkHandoverService { ...@@ -320,3 +340,4 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
blockService.sendText(BlockBusinessEnum.WORK_HANDOVER.subCode,JacksonUtil.toJSon(workHandover), BusinessEnum.WORK_HANDOVER.id,id,workHandover.getLeadershipName()); blockService.sendText(BlockBusinessEnum.WORK_HANDOVER.subCode,JacksonUtil.toJSon(workHandover), BusinessEnum.WORK_HANDOVER.id,id,workHandover.getLeadershipName());
} }
} }
...@@ -13,9 +13,10 @@ spring.jpa.hibernate.ddl-auto=update ...@@ -13,9 +13,10 @@ spring.jpa.hibernate.ddl-auto=update
#spring.jpa.hibernate.ddl-auto=update #spring.jpa.hibernate.ddl-auto=update
#file.path=C:/Users/dengdiyi/Documents/file/ #file.path=C:/Users/dengdiyi/Documents/file/
# spring boot admin # spring boot admin
#file.path=/Users/zjm/code/test-tu/
file.path=C:/file/ #file.path=/Users/ozoz/data/
preview.path=http://192.168.0.14:8090/file/ file.path=C:/ZB/
preview.path=http://192.168.102.169:8087/file/
spring.boot.admin.client.url=http://localhost:8769 spring.boot.admin.client.url=http://localhost:8769
spring.boot.admin.client.instance.serviceBaseUrl=http://localhost:8087 spring.boot.admin.client.instance.serviceBaseUrl=http://localhost:8087
block.flag=true block.flag=true
...@@ -26,4 +27,6 @@ block.carrier.ip=http://192.168.0.147:8088 ...@@ -26,4 +27,6 @@ block.carrier.ip=http://192.168.0.147:8088
carrier.url = http://192.168.0.101:8087/configuration/saveConfiguration carrier.url = http://192.168.0.101:8087/configuration/saveConfiguration
file.matching.excel=/Users/zhoushaopan/excel/ file.matching.excel=/Users/zhoushaopan/excel/
check.time.last=C:/file/CHECKTIME2.txt check.time.last=C:/file/CHECKTIME2.txt
\ No newline at end of file
ven.http=
...@@ -10,4 +10,5 @@ preview.path=http://10.153.4.11:8088/equip/file/ ...@@ -10,4 +10,5 @@ preview.path=http://10.153.4.11:8088/equip/file/
block.flag=true block.flag=true
carrier.url = http://10.153.4.11:8088/carrier/configuration/saveConfiguration carrier.url = http://10.153.4.11:8088/carrier/configuration/saveConfiguration
file.matching.excel=/data/equip/matching/excel/ file.matching.excel=/data/equip/matching/excel/
\ No newline at end of file ven.http=http://10.153.4.10:8081
\ No newline at end of file
...@@ -12,5 +12,9 @@ qrcode.path = /opt/qrcode/ ...@@ -12,5 +12,9 @@ qrcode.path = /opt/qrcode/
qrcode.preview.path=http://10.153.4.11:8088/equipTest/code/ qrcode.preview.path=http://10.153.4.11:8088/equipTest/code/
carrier.url = http://10.153.4.11:8088/carrierTest/configuration/saveConfiguration carrier.url = http://10.153.4.11:8088/carrierTest/configuration/saveConfiguration
file.matching.excel=/data/equipTest/matching/excel/ file.matching.excel=/data/equipTest/matching/excel/
block.carrier.ip=http://10.153.4.11:8088/blockTest block.carrier.ip=http://10.153.4.11:8088/blockTest
check.time.last=/opt/zb/check check.time.last=/opt/zb/check
\ No newline at end of file
ven.http=http://10.153.4.10:8081
...@@ -14,7 +14,8 @@ block.flag=true ...@@ -14,7 +14,8 @@ block.flag=true
readMachine.ip=10.153.4.80 readMachine.ip=10.153.4.80
qrcode.path = /opt/qrcode/ qrcode.path = /opt/qrcode/
qrcode.preview.path=http://localhost:8088/equip/code/
qrcode.preview.path=http://10.153.4.80/equip/code/
carrier.url = http://10.153.4.80:8088/carrier/configuration/saveConfiguration carrier.url = http://10.153.4.80:8088/carrier/configuration/saveConfiguration
...@@ -22,4 +23,5 @@ file.matching.excel=/data/equip/excel/ ...@@ -22,4 +23,5 @@ file.matching.excel=/data/equip/excel/
block.carrier.ip=http://10.153.4.80:8088/block block.carrier.ip=http://10.153.4.80:8088/block
check.time.last=/opt/zb/check check.time.last=/opt/zb/check
\ No newline at end of file ven.http=http://10.153.4.80:8081
...@@ -22,4 +22,15 @@ public interface VenitalisService { ...@@ -22,4 +22,15 @@ public interface VenitalisService {
* 特征对比 * 特征对比
*/ */
Integer contrastRet(String deviceType,String value); Integer contrastRet(String deviceType,String value);
/**
* 删除特征
*/
RegistereRetVo delFeature(Integer userId,String featureItem);
/**
* 查询特征
*/
String featureQuery(Integer userId);
} }
...@@ -14,12 +14,14 @@ import com.tykj.dev.misc.utils.JacksonUtil; ...@@ -14,12 +14,14 @@ import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.httpclientutil.HttpClientUtil; import com.tykj.dev.misc.utils.httpclientutil.HttpClientUtil;
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.Value;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Objects;
/** /**
* @author zjm * @author zjm
...@@ -36,10 +38,16 @@ public class VenitalisServiceImpl implements VenitalisService { ...@@ -36,10 +38,16 @@ public class VenitalisServiceImpl implements VenitalisService {
@Autowired @Autowired
private UserLogDao userLogDao; private UserLogDao userLogDao;
// private final static String http="http://10.153.4.11:8081"; @Value("${ven.http}")
private final static String http="http://192.168.0.80:8081"; private String http;
// private final static String http="http://10.153.4.80:8081";
private final static String REGISTERE="/api/v2/auth/register"; private final static String REGISTERE="/api/v2/auth/register";
private final static String CONTRAST="/api/v2/auth/identify"; private final static String CONTRAST="/api/v2/auth/identify";
private final static String Feature="/api/v2/auth/delFeature";
private final static String FEATUREQUERY="/api/v2/auth/featureQuery";
@Override @Override
public RegistereRetVo registeredRet(VenitalisVo venitalisVo) { public RegistereRetVo registeredRet(VenitalisVo venitalisVo) {
User user= userDao.findById(venitalisVo.getUserId()).get(); User user= userDao.findById(venitalisVo.getUserId()).get();
...@@ -65,7 +73,7 @@ public class VenitalisServiceImpl implements VenitalisService { ...@@ -65,7 +73,7 @@ public class VenitalisServiceImpl implements VenitalisService {
registereRetVo.setRet(true); registereRetVo.setRet(true);
userLogDao.save(new UserLog(venitalisVo.getUserId(),new Date(),user.getName()+"注册了指静脉")); userLogDao.save(new UserLog(venitalisVo.getUserId(),new Date(),user.getName()+"注册了指静脉"));
return registereRetVo; return registereRetVo;
}else { } else {
registereRetVo.setRet(false); registereRetVo.setRet(false);
return registereRetVo; return registereRetVo;
} }
...@@ -89,4 +97,38 @@ public class VenitalisServiceImpl implements VenitalisService { ...@@ -89,4 +97,38 @@ public class VenitalisServiceImpl implements VenitalisService {
} }
} }
@Override
public RegistereRetVo delFeature(Integer userId, String featureItem) {
Map<String, Object> params=new HashMap<>();
params.put("username","lingo");
params.put("password","511B0D5F341BDDBD9A5348923B48D14C");
params.put("id_type","06");
params.put("device_type","tg.VM661J.img");
params.put("uid",userId);
params.put("feature_item",featureItem);
String ret= HttpClientUtil.httpPostRequest(http+Feature,params);
RegisteredRet registeredRet= JacksonUtil.readValue(ret,RegisteredRet.class);
RegistereRetVo registereRetVo=new RegistereRetVo();
if (Objects.requireNonNull(registeredRet).getResult_code().equals("200")){
registereRetVo.setRet(true);
}else {
registereRetVo.setRet(false);
}
return registereRetVo;
}
@Override
public String featureQuery(Integer userId) {
Map<String, Object> params=new HashMap<>();
params.put("username","lingo");
params.put("password","511B0D5F341BDDBD9A5348923B48D14C");
params.put("id_type","06");
params.put("device_type","tg.VM661J.img");
params.put("uid",userId);
String ret= HttpClientUtil.httpPostRequest(http+FEATUREQUERY,params);
return ret;
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论