Browse Source

更新盒管理模块

新增手持盘点机模块
master
xia 3 years ago
parent
commit
7d5b6ab73e
  1. 5
      archives/pom.xml
  2. 8
      archives/src/main/java/com/storeroom/modules/archives/controller/ArchivesController.java
  3. 52
      archives/src/main/java/com/storeroom/modules/archives/controller/CaseController.java
  4. 149
      archives/src/main/java/com/storeroom/modules/archives/controller/RFIDController.java
  5. 48
      archives/src/main/java/com/storeroom/modules/archives/domain/ArchivesCase.java
  6. 14
      archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesCaseRepository.java
  7. 1
      archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesSummaryRepository.java
  8. 15
      archives/src/main/java/com/storeroom/modules/archives/service/ArchivesCaseService.java
  9. 2
      archives/src/main/java/com/storeroom/modules/archives/service/ArchivesService.java
  10. 61
      archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesCaseServiceImpl.java
  11. 46
      archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesServiceImpl.java
  12. 8
      archives/src/main/java/com/storeroom/modules/dictionary/repository/ArchivesDictionaryRepository.java
  13. 20
      archives/src/main/java/com/storeroom/modules/dictionary/service/dto/CaseDTO.java
  14. 4
      system/src/main/resources/application.yml

5
archives/pom.xml

@ -29,6 +29,11 @@
<artifactId>logging</artifactId> <artifactId>logging</artifactId>
<version>1.0</version> <version>1.0</version>
</dependency> </dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

8
archives/src/main/java/com/storeroom/modules/archives/controller/ArchivesController.java

@ -20,6 +20,14 @@ public class ArchivesController {
private final ArchivesService archivesService; private final ArchivesService archivesService;
@ApiOperation("档案列表")
@GetMapping("/initArchivesViewTable")
public ApiResponse<Object> initArchivesViewTable(
String categoryId
){
return ApiResponse.success(archivesService.initArchivesViewTable(categoryId));
}
@ApiOperation("档案列表") @ApiOperation("档案列表")
@GetMapping("/initArchivesView") @GetMapping("/initArchivesView")
public ApiResponse<Object> initArchivesView( public ApiResponse<Object> initArchivesView(

52
archives/src/main/java/com/storeroom/modules/archives/controller/CaseController.java

@ -0,0 +1,52 @@
package com.storeroom.modules.archives.controller;
import com.storeroom.modules.archives.service.ArchivesCaseService;
import com.storeroom.modules.dictionary.service.dto.CaseDTO;
import com.storeroom.utils.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@RestController
@RequiredArgsConstructor
@Api(tags = "盒管理")
@RequestMapping("/api/case")
public class CaseController {
private final ArchivesCaseService caseService;
@ApiOperation("档案盒列表")
@GetMapping("/initCaseList")
public ApiResponse<Object> initCaseList(
String tid, String caseName, Pageable page
){
return ApiResponse.success(caseService.initCaseList(tid,caseName,page));
}
@ApiOperation("档案盒编辑")
@PostMapping("/edit")
public ApiResponse<Object> edit(
@Validated @RequestBody CaseDTO dto
){
return ApiResponse.success(caseService.edit(dto));
}
@ApiOperation("档案盒绑定标签")
@PostMapping("/bingdingLabel")
public ApiResponse<Object> bingdingLabel(
@Validated @RequestBody CaseDTO dto
){
Integer bindingCount = caseService.findIsBingdingLabel(dto.getTid(),dto.getLabelType());
if(bindingCount == 0){
return ApiResponse.success(null);
}else{
return ApiResponse.error();
}
}
}

149
archives/src/main/java/com/storeroom/modules/archives/controller/RFIDController.java

@ -0,0 +1,149 @@
package com.storeroom.modules.archives.controller;
import cn.hutool.http.HttpResource;
import com.storeroom.utils.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@RestController
@RequiredArgsConstructor
@Api(tags = "RFID手持机")
@RequestMapping("/api/RFID")
public class RFIDController {
@Value("${hand-held.ip}")
private String ip;
@ApiOperation("读取epc和Tid号")
@GetMapping("/ReadEpc")
public ApiResponse<Object> ReadEpc(String op,String sDevID) throws IOException {
String result = "";
try {
HttpClient client = HttpClients.createDefault();
String url = "http://"+ip+"/RFIDInterface.aspx?op="+op+"&sDevID="+sDevID;
HttpGet httpGet = new HttpGet(url);
httpGet.setHeader("Content-Type", "application/x-www-form-urlencoded");
System.out.println("调用URL: " + httpGet.getURI());
//httpClient实例化
CloseableHttpClient httpClient = HttpClients.createDefault();
// 执行请求并获取返回
HttpResponse response = httpClient.execute(httpGet);
HttpEntity entity = response.getEntity();
System.out.println("返回状态码:" + response.getStatusLine());
// 显示结果
BufferedReader reader = new BufferedReader(new InputStreamReader(entity.getContent(), "UTF-8"));
String line = null;
StringBuffer responseSB = new StringBuffer();
while ((line = reader.readLine()) != null) {
if(line.contains("<!")){
break;
}
responseSB.append(line.trim());
}
System.out.println("返回消息:" + responseSB);
reader.close();
httpClient.close();
result = responseSB.toString();
}catch (Exception e){
System.err.println(e.toString());
}
return ApiResponse.success(result);
}
@ApiOperation("写epc")
@GetMapping("/WriteEPC")
public ApiResponse<Object> WriteEPC(String op,String sDevID,String EAS,String Type,String Code,String Tid) throws IOException {
String result = "";
try {
HttpClient client = HttpClients.createDefault();
String url = "http://"+ip+"/RFIDInterface.aspx?op="+op
+"&sDevID="+sDevID
+"&EAS="+EAS
+"&Type="+Type
+"&Code="+Code
+"&Tid="+Tid;
HttpGet httpGet = new HttpGet(url);
httpGet.setHeader("Content-Type", "application/x-www-form-urlencoded");
System.out.println("调用URL: " + httpGet.getURI());
//httpClient实例化
CloseableHttpClient httpClient = HttpClients.createDefault();
// 执行请求并获取返回
HttpResponse response = httpClient.execute(httpGet);
HttpEntity entity = response.getEntity();
System.out.println("返回状态码:" + response.getStatusLine());
// 显示结果
BufferedReader reader = new BufferedReader(new InputStreamReader(entity.getContent(), "UTF-8"));
String line = null;
StringBuffer responseSB = new StringBuffer();
while ((line = reader.readLine()) != null) {
if(line.contains("<!")){
break;
}
responseSB.append(line.trim());
}
System.out.println("返回消息:" + responseSB);
reader.close();
httpClient.close();
result = responseSB.toString();
}catch (Exception e){
System.err.println(e.toString());
}
return ApiResponse.success(result);
}
@ApiOperation("读写器状态检测")
@GetMapping("/CheckStatus")
public ApiResponse<Object> CheckStatus(String op,String sDevID) throws IOException {
String result = "";
try {
HttpClient client = HttpClients.createDefault();
String url = "http://"+ip+"/RFIDInterface.aspx?op="+op+"&sDevID="+sDevID;
HttpGet httpGet = new HttpGet(url);
httpGet.setHeader("Content-Type", "application/x-www-form-urlencoded");
System.out.println("调用URL: " + httpGet.getURI());
//httpClient实例化
CloseableHttpClient httpClient = HttpClients.createDefault();
// 执行请求并获取返回
HttpResponse response = httpClient.execute(httpGet);
HttpEntity entity = response.getEntity();
System.out.println("返回状态码:" + response.getStatusLine());
// 显示结果
BufferedReader reader = new BufferedReader(new InputStreamReader(entity.getContent(), "UTF-8"));
String line = null;
StringBuffer responseSB = new StringBuffer();
while ((line = reader.readLine()) != null) {
if(line.contains("<!")){
break;
}
responseSB.append(line.trim());
}
System.out.println("返回消息:" + responseSB);
reader.close();
httpClient.close();
result = responseSB.toString();
}catch (Exception e){
System.err.println(e.toString());
}
return ApiResponse.success(result);
}
}

48
archives/src/main/java/com/storeroom/modules/archives/domain/ArchivesCase.java

@ -0,0 +1,48 @@
package com.storeroom.modules.archives.domain;
import com.storeroom.base.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
@Entity
@Getter
@Setter
@Table(name = "archives_case")
public class ArchivesCase extends BaseEntity implements Serializable {
@Id
@Column(name = "id")
private String id;
@Column(name = "case_name")
@ApiModelProperty(value = "盒名称")
private String caseName;
@Column(name = "case_type")
@ApiModelProperty(value = "盒类别 0.未定义 1.文件 2.案卷")
private Integer caseType;
@Column(name = "tid")
@ApiModelProperty(value = "盒标签")
private String tid;
@Column(name = "folder_location")
@ApiModelProperty(value = "存放位置")
private String folderLocation;
@Column(name = "folder_location_details")
@ApiModelProperty(value = "存放具体位置")
private String folderLocationDetails;
@Column(name = "deposit_num")
@ApiModelProperty(value = "存放数量")
private Integer depositNum;
}

14
archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesCaseRepository.java

@ -0,0 +1,14 @@
package com.storeroom.modules.archives.repository;
import com.storeroom.modules.archives.domain.ArchivesCase;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ArchivesCaseRepository extends JpaRepository<ArchivesCase, String>{
Page<ArchivesCase> findAllByCaseNameLikeAndTidLike(String caseName, String tid, Pageable page);
Integer countAllByTid(String tid);
}

1
archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesSummaryRepository.java

@ -9,5 +9,6 @@ import java.util.Map;
public interface ArchivesSummaryRepository extends JpaRepository<ArchivesSummary, String>{ public interface ArchivesSummaryRepository extends JpaRepository<ArchivesSummary, String>{
Integer countAllByTagNo(String tid);
} }

15
archives/src/main/java/com/storeroom/modules/archives/service/ArchivesCaseService.java

@ -0,0 +1,15 @@
package com.storeroom.modules.archives.service;
import com.storeroom.modules.dictionary.service.dto.CaseDTO;
import org.springframework.data.domain.Pageable;
public interface ArchivesCaseService {
//初始化档案盒列表
Object initCaseList(String tid, String caseName, Pageable page);
//编辑档案盒信息
Object edit(CaseDTO dto);
//查询该标签是否绑定过
Integer findIsBingdingLabel(String label,Integer labelType);
}

2
archives/src/main/java/com/storeroom/modules/archives/service/ArchivesService.java

@ -4,6 +4,8 @@ import com.storeroom.modules.archives.service.dto.ArchivesDTO;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
public interface ArchivesService { public interface ArchivesService {
//初始化档案列表标题
Object initArchivesViewTable(String categoryId);
//初始化档案列表 //初始化档案列表
Object initArchivesView(String categoryId, String query, boolean isdel,Pageable page); Object initArchivesView(String categoryId, String query, boolean isdel,Pageable page);
//预编辑档案 初始化信息 //预编辑档案 初始化信息

61
archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesCaseServiceImpl.java

@ -0,0 +1,61 @@
package com.storeroom.modules.archives.service.impl;
import com.storeroom.modules.archives.domain.ArchivesCase;
import com.storeroom.modules.archives.repository.ArchivesCaseRepository;
import com.storeroom.modules.archives.repository.ArchivesSummaryRepository;
import com.storeroom.modules.archives.service.ArchivesCaseService;
import com.storeroom.modules.dictionary.service.dto.CaseDTO;
import com.storeroom.utils.NanoIdUtils;
import com.storeroom.utils.PageUtil;
import com.storeroom.utils.StringUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.sql.Timestamp;
@Service
@RequiredArgsConstructor
public class ArchivesCaseServiceImpl implements ArchivesCaseService {
private final ArchivesCaseRepository caseRepository;
private final ArchivesSummaryRepository archivesSummaryRepository;
@Override
public Object initCaseList(String tid, String caseName, Pageable page) {
tid = StringUtils.isEmpty(tid) ? "%%" : "%"+tid+"%";
caseName = StringUtils.isEmpty(caseName) ? "%%" : "%"+caseName+"%";
Page<ArchivesCase> pageCase = caseRepository.findAllByCaseNameLikeAndTidLike(caseName,tid,page);
return PageUtil.toPage(pageCase);
}
@Override
public Object edit(CaseDTO dto) {
ArchivesCase archivesCase = null;
if(!StringUtils.isEmpty(dto.getId())){
archivesCase = caseRepository.findById(dto.getId()).get();
}else{
archivesCase = new ArchivesCase();
archivesCase.setId(NanoIdUtils.randomNanoId());
archivesCase.setCaseType(0);
archivesCase.setDepositNum(0);
}
archivesCase.setCaseName(dto.getCaseName());
return caseRepository.saveAndFlush(archivesCase);
}
@Override
public Integer findIsBingdingLabel(String tid,Integer labelType) {
if(labelType==1){
return archivesSummaryRepository.countAllByTagNo(tid);
}else if(labelType==2){
return caseRepository.countAllByTid(tid);
}else if(labelType==3){
return 0;
}else{
return 0;
}
}
}

46
archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesServiceImpl.java

@ -11,6 +11,7 @@ import com.storeroom.modules.dictionary.domain.ArchivesType;
import com.storeroom.modules.dictionary.repository.ArchivesDictionaryRepository; import com.storeroom.modules.dictionary.repository.ArchivesDictionaryRepository;
import com.storeroom.modules.dictionary.repository.ArchivesTypeRepository; import com.storeroom.modules.dictionary.repository.ArchivesTypeRepository;
import com.storeroom.utils.NanoIdUtils; import com.storeroom.utils.NanoIdUtils;
import com.storeroom.utils.PageUtil;
import com.storeroom.utils.StringUtils; import com.storeroom.utils.StringUtils;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@ -36,15 +37,19 @@ public class ArchivesServiceImpl implements ArchivesService {
@PersistenceContext @PersistenceContext
EntityManager entityManager; EntityManager entityManager;
@Override
public Object initArchivesViewTable(String categoryId) {
List<ArchivesDictionary> queryShow = archivesDictionaryRepository.findDisPlay(categoryId);
return queryShow;
}
@Override @Override
public Object initArchivesView(String categoryId, String query, boolean isdel,Pageable page) { public Object initArchivesView(String categoryId, String query, boolean isdel,Pageable page) {
categoryId = "FFAFBB1647D459C82080A";
Optional<ArchivesType> optional = archivesTypeRepository.findById(categoryId); Optional<ArchivesType> optional = archivesTypeRepository.findById(categoryId);
if(!optional.isPresent()) if(!optional.isPresent())
return "未查询到到门类信息!"; return "未查询到到门类信息!";
ArchivesType archivesType = optional.get(); ArchivesType archivesType = optional.get();
List<String> queryFields = archivesDictionaryRepository.findDisPlayField(categoryId); List<String> queryFields = archivesDictionaryRepository.findDisPlayField(categoryId);
List<ArchivesDictionary> queryShow = archivesDictionaryRepository.findDisPlay(categoryId);
String queryField = queryFields.stream().map(String::valueOf).collect(Collectors.joining(",")); String queryField = queryFields.stream().map(String::valueOf).collect(Collectors.joining(","));
String queryTable = archivesType.getEnName(); String queryTable = archivesType.getEnName();
String quertOrder = ""; String quertOrder = "";
@ -58,16 +63,24 @@ public class ArchivesServiceImpl implements ArchivesService {
if(objects.length > 0) if(objects.length > 0)
quertOrder = " order by " + quertOrder.substring(0,quertOrder.length()-1); quertOrder = " order by " + quertOrder.substring(0,quertOrder.length()-1);
List<Object[]> countList = entityManager.createNativeQuery("select count(1) from "+queryTable+additional).getResultList();
Object count = countList.get(0);
List<Object[]> list = entityManager.createNativeQuery("select "+queryField+" from "+queryTable+additional+quertOrder).getResultList(); List<Object[]> list = entityManager.createNativeQuery("select "+queryField+" from "+queryTable+additional+quertOrder).getResultList();
JSONObject json = new JSONObject();
json.put("queryFields",queryShow);
json.put("showlist",list);
return json;
List<Map> returnlist = new ArrayList<>();
for(Object[] objs:list){
Map map = new HashMap();
for(int i = 0;i<queryFields.size();i++){
map.put(queryFields.get(i),objs[i]);
}
returnlist.add(map);
}
return PageUtil.toPage(returnlist,count);
} }
@Override @Override
public Object doedit(String categoryId,String archivesId) { public Object doedit(String categoryId,String archivesId) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
List<ArchivesDictionary> allFiled = archivesDictionaryRepository.findAllByCategoryIdOrderByIsSequenceAsc(categoryId);
List<ArchivesDictionary> showFiled = archivesDictionaryRepository.findAllByCategoryIdAndIsInputOrderByIsSequenceAsc(categoryId,true); List<ArchivesDictionary> showFiled = archivesDictionaryRepository.findAllByCategoryIdAndIsInputOrderByIsSequenceAsc(categoryId,true);
if(!StringUtils.isEmpty(archivesId)){ if(!StringUtils.isEmpty(archivesId)){
ArchivesType archivesType = archivesTypeRepository.findById(categoryId).get(); ArchivesType archivesType = archivesTypeRepository.findById(categoryId).get();
@ -87,6 +100,7 @@ public class ArchivesServiceImpl implements ArchivesService {
json.put("echo",echo); json.put("echo",echo);
} }
} }
json.put("allFiled",allFiled);
json.put("showFiled",showFiled); json.put("showFiled",showFiled);
return json; return json;
} }
@ -94,14 +108,10 @@ public class ArchivesServiceImpl implements ArchivesService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Object edit(ArchivesDTO dto) { public Object edit(ArchivesDTO dto) {
dto = new ArchivesDTO();
dto.setJsonString("{'category_name':'测试111','remarks':'这是一个备注2'}");
String dtoId = "42DA07A3174510955C5636";
// String dtoId = null; // String dtoId = null;
JSONObject json = new JSONObject(dto.getJsonString()); JSONObject json = new JSONObject(dto.getJsonString());
String categoryId = "FFAFBB1647D459C82080A";
ArchivesType archivesType = archivesTypeRepository.findById(categoryId).get();
List<ArchivesDictionary> showFiled = archivesDictionaryRepository.findAllByCategoryIdAndIsInputOrderByIsSequenceAsc(categoryId,true);
ArchivesType archivesType = archivesTypeRepository.findById(dto.getCategoryId()).get();
List<ArchivesDictionary> showFiled = archivesDictionaryRepository.findAllByCategoryIdAndIsInputOrderByIsSequenceAsc(dto.getCategoryId(),true);
String insertFiled = ""; String insertFiled = "";
String insertValue = ""; String insertValue = "";
String updateValue = ""; String updateValue = "";
@ -122,7 +132,7 @@ public class ArchivesServiceImpl implements ArchivesService {
if(list.size()!=0){ if(list.size()!=0){
for(Object[] objs:list){ for(Object[] objs:list){
if(json.get(archivesDictionary.getFieldName()).equals(objs[1])){ if(json.get(archivesDictionary.getFieldName()).equals(objs[1])){
if(!dtoId.equals(objs[0])){
if(!dto.getId().equals(objs[0])){
return archivesDictionary.getFieldName()+"不可重复"; return archivesDictionary.getFieldName()+"不可重复";
} }
} }
@ -131,7 +141,7 @@ public class ArchivesServiceImpl implements ArchivesService {
} }
} }
if(StringUtils.isEmpty(dtoId)){
if(StringUtils.isEmpty(dto.getId())){
insertFiled +=archivesDictionary.getFieldName()+","; insertFiled +=archivesDictionary.getFieldName()+",";
insertValue += archivesDictionary.getIsDataType() == 1 ? insertValue += archivesDictionary.getIsDataType() == 1 ?
null == json.get(archivesDictionary.getFieldName()) ? null+"," : "'"+json.get(archivesDictionary.getFieldName())+"'," null == json.get(archivesDictionary.getFieldName()) ? null+"," : "'"+json.get(archivesDictionary.getFieldName())+"',"
@ -148,8 +158,8 @@ public class ArchivesServiceImpl implements ArchivesService {
updateValue = updateValue.length() != 0 ? updateValue.substring(0,updateValue.length()-1) : ""; updateValue = updateValue.length() != 0 ? updateValue.substring(0,updateValue.length()-1) : "";
insertFiled = "id,"+insertFiled; insertFiled = "id,"+insertFiled;
insertValue = "'"+NanoIdUtils.randomNanoId()+"',"+insertValue; insertValue = "'"+NanoIdUtils.randomNanoId()+"',"+insertValue;
String sql = StringUtils.isEmpty(dtoId) ? "insert into " + archivesType.getEnName() + "(" + insertFiled +") values ("+insertValue+")"
: "update "+archivesType.getEnName() +" set "+updateValue+" where id = '"+dtoId+"'";
String sql = StringUtils.isEmpty(dto.getId()) ? "insert into " + archivesType.getEnName() + "(" + insertFiled +") values ("+insertValue+")"
: "update "+archivesType.getEnName() +" set "+updateValue+" where id = '"+dto.getId()+"'";
int result = entityManager.createNativeQuery(sql).executeUpdate(); int result = entityManager.createNativeQuery(sql).executeUpdate();
return "成功更新"+result+"条数据。"; return "成功更新"+result+"条数据。";
} }
@ -157,8 +167,6 @@ public class ArchivesServiceImpl implements ArchivesService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Object delete(ArchivesDTO dto) { public Object delete(ArchivesDTO dto) {
dto.setId("42DA07A3174510955C5635");
dto.setCategoryId("FFAFBB1647D459C82080A");
ArchivesType archivesType = archivesTypeRepository.findById(dto.getCategoryId()).get(); ArchivesType archivesType = archivesTypeRepository.findById(dto.getCategoryId()).get();
String queryTable = archivesType.getEnName(); String queryTable = archivesType.getEnName();
String sql = "update " + queryTable + " set is_delete_time = '" +sdf.format(new Date())+"',is_delete_man='"+dto.getDelMan()+"' where id = '"+dto.getId()+"'"; String sql = "update " + queryTable + " set is_delete_time = '" +sdf.format(new Date())+"',is_delete_man='"+dto.getDelMan()+"' where id = '"+dto.getId()+"'";
@ -169,8 +177,6 @@ public class ArchivesServiceImpl implements ArchivesService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Object completelyDelete(ArchivesDTO dto) { public Object completelyDelete(ArchivesDTO dto) {
dto.setId("42DA07A3174510955C5635");
dto.setCategoryId("FFAFBB1647D459C82080A");
ArchivesType archivesType = archivesTypeRepository.findById(dto.getCategoryId()).get(); ArchivesType archivesType = archivesTypeRepository.findById(dto.getCategoryId()).get();
String queryTable = archivesType.getEnName(); String queryTable = archivesType.getEnName();
String sql = "delete from " +queryTable+" where id = '"+dto.getId()+"'"; String sql = "delete from " +queryTable+" where id = '"+dto.getId()+"'";

8
archives/src/main/java/com/storeroom/modules/dictionary/repository/ArchivesDictionaryRepository.java

@ -10,12 +10,14 @@ import java.util.List;
public interface ArchivesDictionaryRepository extends JpaRepository<ArchivesDictionary, String>, JpaSpecificationExecutor<ArchivesDictionary> { public interface ArchivesDictionaryRepository extends JpaRepository<ArchivesDictionary, String>, JpaSpecificationExecutor<ArchivesDictionary> {
@Query(nativeQuery = true, @Query(nativeQuery = true,
value = "select field_name from archives_dictionary where category_id = ?1 and is_display is true order by is_displayorder asc")
value = "select field_name from archives_dictionary where category_id = ?1 and is_display is true order by display_order asc")
List<String> findDisPlayField(String categoryId); List<String> findDisPlayField(String categoryId);
List<ArchivesDictionary> findAllByCategoryIdAndIsInputOrderByIsSequenceAsc(String categoryId, boolean isInput); List<ArchivesDictionary> findAllByCategoryIdAndIsInputOrderByIsSequenceAsc(String categoryId, boolean isInput);
List<ArchivesDictionary> findAllByCategoryIdOrderByIsSequenceAsc(String categoryId);
// @Query(value = "INSERT INTO yxk_storeroom.archives_dictionary(id,category_id,field_name,field_cn_name,dictionary_id,is_data_type,is_data_type_details,is_column_length,is_sequence,is_type,is_system VALUES ())", nativeQuery = true) // @Query(value = "INSERT INTO yxk_storeroom.archives_dictionary(id,category_id,field_name,field_cn_name,dictionary_id,is_data_type,is_data_type_details,is_column_length,is_sequence,is_type,is_system VALUES ())", nativeQuery = true)
// void insertData(String id,String categoryId, // void insertData(String id,String categoryId,
// String fieldName,String fieldCnName, // String fieldName,String fieldCnName,
@ -23,9 +25,7 @@ public interface ArchivesDictionaryRepository extends JpaRepository<ArchivesDict
// String isDataTypeDetails,String isColumnLength, // String isDataTypeDetails,String isColumnLength,
// Integer isSequence,Integer isType,Integer isSystem); // Integer isSequence,Integer isType,Integer isSystem);
@Query(value = "from ArchivesDictionary where categoryId = ?1 and isDisplay = true order by isDisplayorder asc")
@Query(value = "from ArchivesDictionary where categoryId = ?1 and isDisplay = true order by displayOrder asc")
List<ArchivesDictionary> findDisPlay(String categoryId); List<ArchivesDictionary> findDisPlay(String categoryId);
//
// List<ArchivesDictionary> findAllByCategoryIdAndIsInputOrderByIsSequenceAsc(String categoryId,boolean isInput);
} }

20
archives/src/main/java/com/storeroom/modules/dictionary/service/dto/CaseDTO.java

@ -0,0 +1,20 @@
package com.storeroom.modules.dictionary.service.dto;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class CaseDTO {
//盒id
private String id;
//盒名称
private String caseName;
//盒标签
private String tid;
//标签类型
private Integer labelType;
//盒架位
private String folderLocation;
}

4
system/src/main/resources/application.yml

@ -72,6 +72,10 @@ user-cache:
# 最小存活时间 (ms) # 最小存活时间 (ms)
min-idle-time: 3600000 min-idle-time: 3600000
# 手持机参数
hand-held:
ip: 47.98.148.152:8057
# 生成表模板 # 生成表模板
table-template: table-template:
#生成表名称 #生成表名称

Loading…
Cancel
Save