Commit 6e6621f9 by 赵剑炜

Merge branch 'develop' into develop-zhaojw

# Conflicts:
#	.gitignore
#	jyzb-api/target/jyzb-app.jar
#	jyzb-boot/target/jyzb-boot.jar
#	jyzb-boot/target/jyzb-boot.jar.original
#	jyzb-process/target/jyzb-app.jar
parents 183042cb a5ea14b6
<<<<<<< HEAD
/jyzb-process/target
/jyzb-api/target/
/jyzb-biz/target/
##ignore this file##
/target/
.classpath
.project
/.settings/
##filter databfile、sln file##
*.mdb
*.ldb
*.sln
##class file##
*.com
*.class
*.dll
*.exe
*.o
*.so
# compression file
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
*.via
*.tmp
*.err
# OS generated files #
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
/*/target/*
=======
/jyzb-boot/target
>>>>>>> develop
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
<option name="insertMethodEnabled" value="false" /> <option name="insertMethodEnabled" value="false" />
<option name="insertSelectiveMethodEnabled" value="false" /> <option name="insertSelectiveMethodEnabled" value="false" />
<option name="javaMapperPackage" value="com.junmp.jyzb.mapper" /> <option name="javaMapperPackage" value="com.junmp.jyzb.mapper" />
<option name="javaMapperPath" value="D:\java-project\jyzb\jyzb-platform\jyzb-biz\src\main\java" /> <option name="javaMapperPath" value="$PROJECT_DIR$/jyzb-biz/src/main/java" />
<option name="javaModelPackage" value="com.junmp.jyzb.domain" /> <option name="javaModelPackage" value="com.junmp.jyzb.domain" />
<option name="javaModelPath" value="D:\java-project\jyzb\jyzb-platform\jyzb-biz\src\main\java" /> <option name="javaModelPath" value="$PROJECT_DIR$/jyzb-biz/src/main/java" />
<option name="lastDatabaseCrudChooseModuleName" value="jyzb-api" /> <option name="lastDatabaseCrudChooseModuleName" value="jyzb-biz" />
<option name="lombokAllArgConstructor" value="true" /> <option name="lombokAllArgConstructor" value="true" />
<option name="lombokDataAnnotation" value="true" /> <option name="lombokDataAnnotation" value="true" />
<option name="lombokNoArgsConstructor" value="true" /> <option name="lombokNoArgsConstructor" value="true" />
...@@ -37,6 +37,22 @@ ...@@ -37,6 +37,22 @@
</UserPackageAndPathInfoByModule> </UserPackageAndPathInfoByModule>
</value> </value>
</entry> </entry>
<entry key="jyzb-biz">
<value>
<UserPackageAndPathInfoByModule>
<option name="javaMapperPackage" value="com.junmp.jyzb.mapper" />
<option name="javaMapperPath" value="$PROJECT_DIR$/jyzb-biz/src/main/java" />
<option name="javaModelPacakge" value="com.junmp.jyzb.domain" />
<option name="javaModelPath" value="$PROJECT_DIR$/jyzb-biz/src/main/java" />
<option name="javaServiceInterfacePackage" value="com.junmp.jyzb.service" />
<option name="javaServiceInterfacePath" value="$PROJECT_DIR$/jyzb-biz/src/main/java" />
<option name="javaServicePackage" value="com.junmp.jyzb.service.impl" />
<option name="javaServicePath" value="$PROJECT_DIR$/jyzb-biz/src/main/java" />
<option name="xmlPackage" value="mapper" />
<option name="xmlPath" value="$PROJECT_DIR$/jyzb-biz/src/main/resources" />
</UserPackageAndPathInfoByModule>
</value>
</entry>
</map> </map>
</option> </option>
<option name="mybatisPlusStaticField" value="false" /> <option name="mybatisPlusStaticField" value="false" />
...@@ -64,11 +80,14 @@ ...@@ -64,11 +80,14 @@
<value> <value>
<TableGenerateConfig> <TableGenerateConfig>
<option name="deleteByPrimayKeyEnabled" value="false" /> <option name="deleteByPrimayKeyEnabled" value="false" />
<option name="generatedKey" value="" />
<option name="insertMethodEnabled" value="false" /> <option name="insertMethodEnabled" value="false" />
<option name="insertSelectiveMethodEnabled" value="false" /> <option name="insertSelectiveMethodEnabled" value="false" />
<option name="javaModelName" value="CabinetBox" /> <option name="javaModelName" value="CabinetBox" />
<option name="moduleName" value="jyzb-api" /> <option name="moduleName" value="jyzb-api" />
<option name="selectByPrimaryKeyEnabled" value="false" /> <option name="selectByPrimaryKeyEnabled" value="false" />
<option name="sequenceColumn" value="" />
<option name="sequenceId" value="" />
<option name="updateByPrimaryKeySelectiveEnabled" value="false" /> <option name="updateByPrimaryKeySelectiveEnabled" value="false" />
<option name="updateByPrimaykeyEnabled" value="false" /> <option name="updateByPrimaykeyEnabled" value="false" />
<option name="useActualColumnName" value="false" /> <option name="useActualColumnName" value="false" />
...@@ -251,6 +270,21 @@ ...@@ -251,6 +270,21 @@
</TableGenerateConfig> </TableGenerateConfig>
</value> </value>
</entry> </entry>
<entry key="db_jyzb:base_shelf">
<value>
<TableGenerateConfig>
<option name="deleteByPrimayKeyEnabled" value="false" />
<option name="insertMethodEnabled" value="false" />
<option name="insertSelectiveMethodEnabled" value="false" />
<option name="javaModelName" value="Shelf" />
<option name="moduleName" value="jyzb-biz" />
<option name="selectByPrimaryKeyEnabled" value="false" />
<option name="updateByPrimaryKeySelectiveEnabled" value="false" />
<option name="updateByPrimaykeyEnabled" value="false" />
<option name="useActualColumnName" value="false" />
</TableGenerateConfig>
</value>
</entry>
<entry key="db_jyzb:base_supplier"> <entry key="db_jyzb:base_supplier">
<value> <value>
<TableGenerateConfig> <TableGenerateConfig>
...@@ -281,6 +315,21 @@ ...@@ -281,6 +315,21 @@
</TableGenerateConfig> </TableGenerateConfig>
</value> </value>
</entry> </entry>
<entry key="db_jyzb:base_supplier_type">
<value>
<TableGenerateConfig>
<option name="deleteByPrimayKeyEnabled" value="false" />
<option name="insertMethodEnabled" value="false" />
<option name="insertSelectiveMethodEnabled" value="false" />
<option name="javaModelName" value="SupplierType" />
<option name="moduleName" value="jyzb-biz" />
<option name="selectByPrimaryKeyEnabled" value="false" />
<option name="updateByPrimaryKeySelectiveEnabled" value="false" />
<option name="updateByPrimaykeyEnabled" value="false" />
<option name="useActualColumnName" value="false" />
</TableGenerateConfig>
</value>
</entry>
<entry key="db_jyzb:base_warehouse"> <entry key="db_jyzb:base_warehouse">
<value> <value>
<TableGenerateConfig> <TableGenerateConfig>
...@@ -296,6 +345,21 @@ ...@@ -296,6 +345,21 @@
</TableGenerateConfig> </TableGenerateConfig>
</value> </value>
</entry> </entry>
<entry key="db_jyzb:base_warehouse_area">
<value>
<TableGenerateConfig>
<option name="deleteByPrimayKeyEnabled" value="false" />
<option name="insertMethodEnabled" value="false" />
<option name="insertSelectiveMethodEnabled" value="false" />
<option name="javaModelName" value="WarehouseArea" />
<option name="moduleName" value="jyzb-biz" />
<option name="selectByPrimaryKeyEnabled" value="false" />
<option name="updateByPrimaryKeySelectiveEnabled" value="false" />
<option name="updateByPrimaykeyEnabled" value="false" />
<option name="useActualColumnName" value="false" />
</TableGenerateConfig>
</value>
</entry>
<entry key="db_jyzb:base_year_report"> <entry key="db_jyzb:base_year_report">
<value> <value>
<TableGenerateConfig> <TableGenerateConfig>
...@@ -311,13 +375,29 @@ ...@@ -311,13 +375,29 @@
</TableGenerateConfig> </TableGenerateConfig>
</value> </value>
</entry> </entry>
<entry key="db_jyzb:pub_org">
<value>
<TableGenerateConfig>
<option name="deleteByPrimayKeyEnabled" value="false" />
<option name="generatedKey" value="org_id" />
<option name="insertMethodEnabled" value="false" />
<option name="insertSelectiveMethodEnabled" value="false" />
<option name="javaModelName" value="PubOrg" />
<option name="moduleName" value="jyzb-biz" />
<option name="selectByPrimaryKeyEnabled" value="false" />
<option name="updateByPrimaryKeySelectiveEnabled" value="false" />
<option name="updateByPrimaykeyEnabled" value="false" />
<option name="useActualColumnName" value="false" />
</TableGenerateConfig>
</value>
</entry>
</map> </map>
</option> </option>
<option name="updateByPrimaryKeySelectiveEnabled" value="false" /> <option name="updateByPrimaryKeySelectiveEnabled" value="false" />
<option name="updateByPrimaykeyEnabled" value="false" /> <option name="updateByPrimaykeyEnabled" value="false" />
<option name="useSwagger" value="true" /> <option name="useSwagger" value="true" />
<option name="xmlMapperPackage" value="mapper" /> <option name="xmlMapperPackage" value="mapper" />
<option name="xmlMapperPath" value="D:\java-project\jyzb\jyzb-platform\jyzb-biz\src\main\resources" /> <option name="xmlMapperPath" value="$PROJECT_DIR$/jyzb-biz/src/main/resources" />
</ProjectProfile> </ProjectProfile>
</option> </option>
</component> </component>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="MavenProjectsManager"> <component name="MavenProjectsManager">
<option name="originalFiles"> <option name="originalFiles">
<list> <list>
<option value="$PROJECT_DIR$/pom.xml" /> <option value="$PROJECT_DIR$/pom.xml" />
<option value="$PROJECT_DIR$/jyzb-process/pom.xml" />
</list> </list>
</option> </option>
<option name="ignoredFiles">
<set>
<option value="$PROJECT_DIR$/jyzb-business/pom.xml" />
</set>
</option>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8 (3)" project-jdk-type="JavaSDK" /> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="19" project-jdk-type="JavaSDK" />
</project> </project>
\ No newline at end of file
package com.junmp.jyzb.controller; package com.junmp.jyzb.controller;
import com.junmp.jyzb.service.CabinetBoxService;
import com.junmp.jyzb.service.CabinetService; import com.junmp.jyzb.service.CabinetService;
import com.junmp.jyzb.service.PoliceFingerService;
import com.junmp.jyzb.utils.HttpStatus; import com.junmp.jyzb.utils.HttpStatus;
import com.junmp.jyzb.utils.ResponseResult; import com.junmp.jyzb.utils.ResponseResult;
import com.junmp.jyzb.utils.ReturnData;
import com.junmp.jyzb.utils.ReturnMsg;
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;
...@@ -24,44 +28,48 @@ public class CabinetController { ...@@ -24,44 +28,48 @@ public class CabinetController {
@Resource @Resource
public CabinetService cabinetService; public CabinetService cabinetService;
@Resource
private CabinetBoxService cabinetBoxService;
@PostMapping("/AddCabinet") @PostMapping("/AddCabinet")
@ApiOperation("添加单警柜") @ApiOperation("添加单警柜")
public ResponseResult addCabinet(@RequestBody Map<String,Object> msg) { public ResponseResult addCabinet(@RequestBody Map<String,Object> msg) {
cabinetService.addCabinet(msg); ResponseResult returnMsg = cabinetService.addCabinet(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/DeleteCabinet") @PostMapping("/DeleteCabinet")
@ApiOperation("删除单警柜信息") @ApiOperation("删除单警柜信息")
public ResponseResult deleteCabinet(@RequestBody Map<String,Object> msg) { public ResponseResult deleteCabinet(@RequestBody Map<String,Object> msg) {
cabinetService.deleteCabinet(msg); ResponseResult returnMsg = cabinetService.deleteCabinet(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/GetAllCabinet") @PostMapping("/ShowCabinet")
@ApiOperation("查询单警柜列表") @ApiOperation("查询单警柜列表")
public ResponseResult getAllWarehouse(@RequestBody Map<String, Object> orgId){ public ResponseResult showCabinet(@RequestBody Map<String, Object> msg){
//获取该组织机构下所有警员的id ResponseResult returnMsg = cabinetService.getAllCabinet(msg);
List<Map<String, Object>> allCabinet=new ArrayList<>(); return returnMsg;
List<String> allCabinetId =cabinetService.getAllCabinetId(orgId);
for (String cabinetId : allCabinetId){
Map<String, Object> warehouseMsg = cabinetService.getOneCabinet(cabinetId);
allCabinet.add(warehouseMsg);
}
return new ResponseResult(HttpStatus.SUCCESS,"操作成功",allCabinet);
} }
@PostMapping("/UpdateCabinet") @PostMapping("/UpdateCabinet")
@ApiOperation("修改单警柜信息") @ApiOperation("修改单警柜信息")
public ResponseResult updateCabinet(@RequestBody Map<String,Object> msg) { public ResponseResult updateCabinet(@RequestBody Map<String,Object> msg) {
cabinetService.updateCabinet(msg); ResponseResult returnMsg =cabinetService.updateCabinet(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/ChangeCabinetState") @PostMapping("/ErrorState")
@ApiOperation("单警柜状态变更") @ApiOperation("单警柜状态变更")
public ResponseResult changeCabinetState(@RequestBody Map<String,Object> msg) { public ResponseResult changeCabinetState(@RequestBody Map<String,Object> msg) {
//cabinetService.changeCabinetState(msg); ResponseResult returnMsg = cabinetService.changeCabinetState(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
}
@PostMapping("/GetCabinetDetail")
@ApiOperation("查询单警柜及其箱号信息")
public ResponseResult getCabinetDetail(@RequestBody Map<String, Object> msg){
ResponseResult returnMsg = cabinetService.getCabinetDetail(msg);
return returnMsg;
} }
} }
\ No newline at end of file
...@@ -4,6 +4,7 @@ import com.junmp.jyzb.service.EquipmentSizeService; ...@@ -4,6 +4,7 @@ import com.junmp.jyzb.service.EquipmentSizeService;
import com.junmp.jyzb.service.WarehouseService; import com.junmp.jyzb.service.WarehouseService;
import com.junmp.jyzb.utils.HttpStatus; import com.junmp.jyzb.utils.HttpStatus;
import com.junmp.jyzb.utils.ResponseResult; import com.junmp.jyzb.utils.ResponseResult;
import com.junmp.jyzb.utils.ReturnMsg;
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;
...@@ -28,43 +29,42 @@ public class EquipmentSizeController { ...@@ -28,43 +29,42 @@ public class EquipmentSizeController {
@PostMapping("/AddSize") @PostMapping("/AddSize")
@ApiOperation("添加号型信息") @ApiOperation("添加号型信息")
public ResponseResult addSize(@RequestBody Map<String,Object> msg) { public ResponseResult addSize(@RequestBody Map<String,Object> msg) {
equipmentSizeService.addSize(msg); ResponseResult returnMsg = equipmentSizeService.addSize(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/DeleteSize") @PostMapping("/DeleteSize")
@ApiOperation("删除号型信息") @ApiOperation("删除号型信息")
public ResponseResult deleteSize(@RequestBody Map<String,Object> msg) { public ResponseResult deleteSize(@RequestBody Map<String,Object> msg) {
equipmentSizeService.deleteSize(msg); ResponseResult returnMsg = equipmentSizeService.deleteSize(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/GetOneSize") @PostMapping("/GetOneSize")
@ApiOperation("查询单个号型信息") @ApiOperation("查询单个号型信息")
public ResponseResult getOneSize(@RequestBody Map<String, Object> msg) { public ResponseResult getOneSize(@RequestBody Map<String, Object> msg) {
String sizeId = msg.get("id").toString(); ResponseResult returnMsg = equipmentSizeService.getOneSize(msg);
Map<String, Object> sizeMsg = equipmentSizeService.getOneSize(sizeId); return returnMsg;
return new ResponseResult(HttpStatus.SUCCESS,"操作成功",sizeMsg);
} }
@PostMapping("/ShowSize") @PostMapping("/ShowSize")
@ApiOperation("查询号型列表") //根据组织机构id查询 @ApiOperation("查询号型列表") //根据组织机构id查询
public ResponseResult getAllSize(@RequestBody Map<String, Object> typeId){ public ResponseResult getAllSize(@RequestBody Map<String, Object> msg){
//获取该组织机构下所有警员的id ResponseResult returnMsg = equipmentSizeService.getAllSize(msg);
List<Map<String, Object>> allSize=new ArrayList<>(); return returnMsg;
List<String> allSizeId =equipmentSizeService.getAllSizeId(typeId);
for (String sizeId :allSizeId){
Map<String, Object> sizeMsg = equipmentSizeService.getOneSize(sizeId);
allSize.add(sizeMsg);
}
return new ResponseResult(HttpStatus.SUCCESS,"操作成功",allSize);
} }
@PostMapping("/UpdateSize") @PostMapping("/UpdateSize")
@ApiOperation("修改号型信息") @ApiOperation("修改号型信息")
public ResponseResult updateSize(@RequestBody Map<String,Object> msg) { public ResponseResult updateSize(@RequestBody Map<String,Object> msg) {
equipmentSizeService.updateSize(msg); ResponseResult returnMsg = equipmentSizeService.updateSize(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/ChangeSizeState")
@ApiOperation("禁用/启用装备号型")
public ResponseResult changeSizeState(@RequestBody Map<String,Object> msg) {
ResponseResult returnMsg = equipmentSizeService.changeSizeState(msg);
return returnMsg;
}
} }
package com.junmp.jyzb.controller; package com.junmp.jyzb.controller;
import com.junmp.jyzb.service.EquipmentTypeService; import com.junmp.jyzb.service.EquipmentTypeService;
import com.junmp.jyzb.service.WarehouseService;
import com.junmp.jyzb.utils.HttpStatus; import com.junmp.jyzb.utils.HttpStatus;
import com.junmp.jyzb.utils.ResponseResult; import com.junmp.jyzb.utils.ResponseResult;
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.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -23,25 +20,53 @@ public class EquipmentTypeController { ...@@ -23,25 +20,53 @@ public class EquipmentTypeController {
@Resource @Resource
public EquipmentTypeService equipmentTypeService; public EquipmentTypeService equipmentTypeService;
@PostMapping("/AddEquipment")
@ApiOperation("添加物资")
public ResponseResult addEquipment(@RequestBody Map<String,Object> msg) {
ResponseResult returnMsg = equipmentTypeService.addEquipment(msg);
return returnMsg;
}
//添加装备时计算id
@PostMapping("/CalculationEquipmentId")
public ResponseResult calculationEquipmentId() {
ResponseResult returnMsg = equipmentTypeService.calculationEquipmentId();
return returnMsg;
}
@PostMapping("/DeleteEquipment")
@ApiOperation("删除仓库信息")
public ResponseResult deleteEquipment(@RequestBody Map<String,Object> msg) {
ResponseResult returnMsg = equipmentTypeService.deleteEquipment(msg);
return returnMsg;
}
@PostMapping("/ChangeEquipmentState")
@ApiOperation("禁用/启用装备类型")
public ResponseResult changeEquipmentState(@RequestBody Map<String,Object> msg) {
ResponseResult returnMsg = equipmentTypeService.changeEquipmentState(msg);
return returnMsg;
}
@PostMapping("/ShowEquipmentList") @PostMapping("/ShowEquipmentList")
@ApiOperation("查询物资列表") @ApiOperation("查询物资列表")
public ResponseResult getMenuList() { public ResponseResult ShowEquipmentList() {
List<Map<String, Object>> equipmentList = equipmentTypeService.getEquipmentList(); List<Map<String, Object>> equipmentList = equipmentTypeService.getEquipmentList();
return new ResponseResult(HttpStatus.SUCCESS,"操作成功",equipmentList); return new ResponseResult(HttpStatus.SUCCESS,"操作成功",equipmentList);
} }
@PostMapping("/AddEquipment") @PostMapping("/GetEquipmentDetail")
@ApiOperation("添加物资") @ApiOperation("查询单个物资信息")
public ResponseResult addEquipment(@RequestBody Map<String,Object> msg) { public ResponseResult getOneEquipment(@RequestBody Map<String, Object> msg) {
equipmentTypeService.addEquipment(msg); //String warehouseId = msg.get("").toString();
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); ResponseResult returnMsg = equipmentTypeService.getOneEquipment(msg);
return returnMsg;
} }
// @PostMapping("/ChangeEquipmentState") @PostMapping("/UpdateEquipment")
// @ApiOperation("改变物资状态") @ApiOperation("修改物资信息")
// public ResponseResult deleteWarehouse(@RequestBody Map<String,Object> msg) { public ResponseResult updateEquipment(@RequestBody Map<String,Object> msg) {
// //TODO ResponseResult responseMsg = equipmentTypeService.updateEquipment(msg);
// return new ResponseResult(10000,"操作成功"); return responseMsg;
// } }
} }
...@@ -5,7 +5,8 @@ import com.junmp.jyzb.service.PoliceFingerService; ...@@ -5,7 +5,8 @@ import com.junmp.jyzb.service.PoliceFingerService;
import com.junmp.jyzb.service.PolicemanService; import com.junmp.jyzb.service.PolicemanService;
import com.junmp.jyzb.utils.HttpStatus; import com.junmp.jyzb.utils.HttpStatus;
import com.junmp.jyzb.utils.ResponseResult; import com.junmp.jyzb.utils.ResponseResult;
import com.sun.net.httpserver.Authenticator; import com.junmp.jyzb.utils.ReturnData;
import com.junmp.jyzb.utils.ReturnMsg;
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;
...@@ -13,7 +14,6 @@ import org.springframework.web.bind.annotation.*; ...@@ -13,7 +14,6 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -26,96 +26,83 @@ public class PoliceController { ...@@ -26,96 +26,83 @@ public class PoliceController {
@Resource @Resource
public PolicemanService policemanService; public PolicemanService policemanService;
@Resource
private PoliceFingerService fingerService;
@PostMapping("/AddPoliceman") @PostMapping("/AddPoliceman")
@ApiOperation("添加警员信息") @ApiOperation("添加警员信息")
public ResponseResult addPoliceman(@RequestBody Map<String,Object> msg) { public ResponseResult addPoliceman(@RequestBody Map<String,Object> msg) {
policemanService.addPoliceman(msg); ResponseResult returnMsg = policemanService.addPoliceman(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/AddFingerInfo") @PostMapping("/AddFingerInfo")
@ApiOperation("添加指纹信息") @ApiOperation("添加指纹信息")
public ResponseResult addFingerInfo(@RequestBody Map<String,Object> msg) { public ResponseResult addFingerInfo(@RequestBody Map<String,Object> msg) {
policemanService.addFingerInfo(msg); ResponseResult returnMsg = policemanService.addFingerInfo(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/AddFaceInfo") @PostMapping("/AddFaceInfo")
@ApiOperation("添加警员面部信息") @ApiOperation("添加警员面部信息")
public ResponseResult addFaceInfo(@RequestBody Map<String,Object> msg) { public ResponseResult addFaceInfo(@RequestBody Map<String,Object> msg) {
policemanService.addFaceInfo(msg); ResponseResult returnMsg = policemanService.addFaceInfo(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/DeletePolice") @PostMapping("/DeletePolice")
@ApiOperation("删除警员信息") @ApiOperation("删除警员信息")
public ResponseResult deletePolice(@RequestBody Map<String,Object> msg) { public ResponseResult deletePolice(@RequestBody Map<String,Object> msg) {
policemanService.deletePolice(msg); ResponseResult returnMsg = policemanService.deletePolice(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/ChangePoliceState") @PostMapping("/ChangePoliceState")
@ApiOperation("修改警员状态") @ApiOperation("修改警员状态")
public ResponseResult ChangePoliceState(@RequestBody Map<String,Object> msg) { public ResponseResult ChangePoliceState(@RequestBody Map<String,Object> msg) {
policemanService.changePoliceState(msg); ResponseResult returnMsg = policemanService.changePoliceState(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/ShowPolice") @PostMapping("/ShowPolice")
@ApiOperation("查询警员列表") //根据组织机构id查询 @ApiOperation("查询警员列表") //根据组织机构id查询
public ResponseResult getAllPoliceman(@RequestBody Map<String, Object> orgId){ public ResponseResult getAllPoliceman(@RequestBody Map<String, Object> orgId){
//获取该组织机构下所有警员的id ResponseResult returnMsg = policemanService.getAllPoliceman(orgId);
List<Map<String, Object>> allPoliceman=new ArrayList<>(); return returnMsg;
List<String> allPoliceId =policemanService.getAllPoliceId(orgId);
for (String policeId :allPoliceId){
Map<String, Object> policeMsg = policemanService.getOnePolice(policeId);
List<Map<String, Object>> fingerprints= fingerService.getFingersByUserId(policeId);
policeMsg.put("fingerMsg",fingerprints);
allPoliceman.add(policeMsg);
}
return new ResponseResult(HttpStatus.SUCCESS,"操作成功",allPoliceman);
} }
@PostMapping("/GetPoliceDetail") @PostMapping("/GetPoliceDetail")
@ApiOperation("查询单个警员信息") @ApiOperation("查询单个警员信息")
public ResponseResult getOnePolice(@RequestBody Map<String, Object> msg) { public ResponseResult getOnePolice(@RequestBody Map<String, Object> msg) {
String userId = msg.get("policeId").toString(); ResponseResult returnMsg = policemanService.getOnePolice(msg);
Map<String, Object> policeMsg = policemanService.getOnePolice(userId); return returnMsg;
// List<Map<String, Object>> fingerprints = fingerService.getFingersByUserId(userId);
// policeMsg.put("fingerMsg",fingerprints);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功",policeMsg);
} }
@PostMapping("/UpdatePolice") @PostMapping("/UpdatePolice")
@ApiOperation("修改警员信息") @ApiOperation("修改警员信息")
public ResponseResult updatePolice(@RequestBody Map<String,Object> msg) { public ResponseResult updatePolice(@RequestBody Map<String,Object> msg) {
policemanService.updatePolice(msg); ResponseResult returnMsg = policemanService.updatePolice(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/DeleteFingerInfo") @PostMapping("/DeleteFingerInfo")
@ApiOperation("删除警员指纹信息") @ApiOperation("删除警员指纹信息")
public ResponseResult deletePoliceFinger(@RequestBody Map<String,Object> msg) { public ResponseResult deletePoliceFinger(@RequestBody Map<String,Object> msg) {
policemanService.deleteFinger(msg); ResponseResult returnMsg= policemanService.deleteFinger(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/GetAllPoliceByCabinet") //todo 更新查询所有
@PostMapping("/GetPoliceData")
@ApiOperation("查询与单警柜绑定的警员信息") //根据单警柜id查询 @ApiOperation("查询与单警柜绑定的警员信息") //根据单警柜id查询
public ResponseResult getAllPoliceByCabinet(@RequestBody Map<String, Object> cabinetId){ public ResponseResult getPoliceData(@RequestBody Map<String, Object> cabinetId){
//获取该组织机构下所有警员的id
ResponseResult returnMsg =policemanService.getPoliceData(cabinetId);
return returnMsg;
}
@PostMapping("/ChangePoliceOrg")
@ApiOperation("警员调岗")
public ResponseResult changePoliceOrg(@RequestBody Map<String, Object> cabinetId){
//获取该组织机构下所有警员的id //获取该组织机构下所有警员的id
List<Map<String, Object>> allPoliceman=new ArrayList<>(); //ResponseResult returnMsg =policemanService.getPoliceData(cabinetId);
List<String> allPoliceId =policemanService.getAllPoliceIdByCabinet(cabinetId); return null;
for (String policeId :allPoliceId){
Map<String, Object> policeMsg = policemanService.getOnePolice(policeId);
List<Map<String, Object>> fingerprints= fingerService.getFingersByUserId(policeId);
policeMsg.put("fingerMsg",fingerprints);
allPoliceman.add(policeMsg);
}
return new ResponseResult(HttpStatus.SUCCESS,"操作成功",allPoliceman);
} }
} }
package com.junmp.jyzb.controller;
import com.junmp.jyzb.service.PubOrgService;
import com.junmp.jyzb.utils.HttpStatus;
import com.junmp.jyzb.utils.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
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.RestController;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@RestController
@Slf4j
@RequestMapping("/PubOrg")
@Api(tags = "组织机构模块")
public class PubOrgController {
@Resource
public PubOrgService equipmentTypeService;
@PostMapping("/ShowPubOrgList")
@ApiOperation("查询物资列表_简化版")
public ResponseResult ShowEquipmentList(@RequestBody Map<String, Object> orgId) {
//传入当前的组织机构id,展示所有本级及下级的
ResponseResult returnMsg = equipmentTypeService.showPubOrgList(orgId);
return returnMsg;
}
@PostMapping("/ShowPubOrgListOld")
@ApiOperation("查询物资列表_完整版")
public ResponseResult showPubOrgListOld(@RequestBody Map<String, Object> orgId) {
//传入当前的组织机构id,展示所有本级及下级的
ResponseResult returnMsg = equipmentTypeService.showPubOrgListOld(orgId);
return returnMsg;
}
}
...@@ -29,42 +29,43 @@ public class SupplierController { ...@@ -29,42 +29,43 @@ public class SupplierController {
@PostMapping("/AddSupplier") @PostMapping("/AddSupplier")
@ApiOperation("添加供应商") @ApiOperation("添加供应商")
public ResponseResult addSupplier(@RequestBody Map<String,Object> msg) { public ResponseResult addSupplier(@RequestBody Map<String,Object> msg) {
supplierService.addSupplier(msg); ResponseResult returnMsg = supplierService.addSupplier(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/DeleteSupplier") @PostMapping("/DeleteSupplier")
@ApiOperation("删除供应商信息") @ApiOperation("删除供应商信息")
public ResponseResult deleteSupplier(@RequestBody Map<String,Object> msg) { public ResponseResult deleteSupplier(@RequestBody Map<String,Object> msg) {
supplierService.deleteSupplier(msg); ResponseResult returnMsg = supplierService.deleteSupplier(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/ShowSupplier") @PostMapping("/ShowSupplier")
@ApiOperation("查询供应商列表") @ApiOperation("查询供应商列表")
public ResponseResult getAllSupplier(@RequestBody Map<String,Object> msg){ public ResponseResult getAllSupplier(@RequestBody Map<String,Object> msg){
ResponseResult returnMsg = supplierService.getAllSupplier(msg);
List<Map<String, Object>> allSupplier=new ArrayList<>(); return returnMsg;
List<String> allSupplierId =supplierService.getAllSupplierId();
for (String supplierId :allSupplierId){
Map<String, Object> supplierMsg = supplierService.getOneSupplier(supplierId);
allSupplier.add(supplierMsg);
}
return new ResponseResult(HttpStatus.SUCCESS,"操作成功",allSupplier);
} }
@PostMapping("/GetOneSupplier") // @PostMapping("/GetOneSupplier")
@ApiOperation("查询单个供应商信息") // @ApiOperation("查询单个供应商信息")
public ResponseResult getOneSupplier(@RequestBody Map<String, Object> msg) { // public ResponseResult getOneSupplier(@RequestBody Map<String, Object> msg) {
String supplierId = msg.get("supplierId").toString(); // String supplierId = msg.get("supplierId").toString();
Map<String, Object> supplierMsg = supplierService.getOneSupplier(supplierId); // Map<String, Object> supplierMsg = supplierService.getOneSupplier(supplierId);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功",supplierMsg); // return new ResponseResult(HttpStatus.SUCCESS,"操作成功",supplierMsg);
} // }
@PostMapping("/UpdateSupplier") @PostMapping("/UpdateSupplier")
@ApiOperation("修改供应商信息") @ApiOperation("修改供应商信息")
public ResponseResult updateSupplier(@RequestBody Map<String,Object> msg) { public ResponseResult updateSupplier(@RequestBody Map<String,Object> msg) {
supplierService.updateSupplier(msg); ResponseResult returnMsg = supplierService.updateSupplier(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
}
@PostMapping("/ChangeSupplierState")
@ApiOperation("修改警员状态")
public ResponseResult changeSupplierState(@RequestBody Map<String,Object> msg) {
ResponseResult returnMsg = supplierService.changeSupplierState(msg);
return returnMsg;
} }
} }
...@@ -5,6 +5,8 @@ import com.junmp.jyzb.service.PolicemanService; ...@@ -5,6 +5,8 @@ import com.junmp.jyzb.service.PolicemanService;
import com.junmp.jyzb.service.WarehouseService; import com.junmp.jyzb.service.WarehouseService;
import com.junmp.jyzb.utils.HttpStatus; import com.junmp.jyzb.utils.HttpStatus;
import com.junmp.jyzb.utils.ResponseResult; import com.junmp.jyzb.utils.ResponseResult;
import com.junmp.jyzb.utils.ReturnData;
import com.junmp.jyzb.utils.ReturnMsg;
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;
...@@ -29,49 +31,108 @@ public class WarehouseController { ...@@ -29,49 +31,108 @@ public class WarehouseController {
@PostMapping("/AddWarehouse") @PostMapping("/AddWarehouse")
@ApiOperation("添加仓库") @ApiOperation("添加仓库")
public ResponseResult addWarehouse(@RequestBody Map<String,Object> msg) { public ResponseResult addWarehouse(@RequestBody Map<String,Object> msg) {
warehouseService.addWarehouse(msg); ResponseResult returnMsg = warehouseService.addWarehouse(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/DeleteWarehouse") @PostMapping("/DeleteWarehouse")
@ApiOperation("删除仓库信息") @ApiOperation("删除仓库信息")
public ResponseResult deleteWarehouse(@RequestBody Map<String,Object> msg) { public ResponseResult deleteWarehouse(@RequestBody Map<String,Object> msg) {
warehouseService.deleteWarehouse(msg); ResponseResult returnMsg = warehouseService.deleteWarehouse(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/ChangeWarehouseState") @PostMapping("/ChangeWarehouseState")
@ApiOperation("禁用仓库") @ApiOperation("禁用/启用仓库")
public ResponseResult changeWarehouseState(@RequestBody Map<String,Object> msg) { public ResponseResult changeWarehouseState(@RequestBody Map<String,Object> msg) {
warehouseService.changeWarehouseState(msg); ResponseResult returnMsg = warehouseService.changeWarehouseState(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
} }
@PostMapping("/ShowWarehouse") @PostMapping("/ShowWarehouse")
@ApiOperation("查询仓库列表") @ApiOperation("查询仓库列表")
public ResponseResult getAllWarehouse(@RequestBody Map<String, Object> orgId){ public ResponseResult getAllWarehouse(@RequestBody Map<String, Object> orgId){
//获取该组织机构下所有警员的id ResponseResult returnMsg = warehouseService.getAllWarehouse(orgId);
List<Map<String, Object>> allWarehouse=new ArrayList<>(); return returnMsg;
List<String> allWarehouseId =warehouseService.getAllWarehouseId(orgId);
for (String warehouseId :allWarehouseId){ // //获取该组织机构下所有警员的id
Map<String, Object> warehouseMsg = warehouseService.getOneWarehouse(warehouseId); // List<Map<String, Object>> allWarehouse=new ArrayList<>();
allWarehouse.add(warehouseMsg); // List<String> allWarehouseId =warehouseService.getAllWarehouseId(orgId);
} // for (String warehouseId :allWarehouseId){
return new ResponseResult(HttpStatus.SUCCESS,"操作成功",allWarehouse); // Map<String, Object> warehouseMsg = warehouseService.getOneWarehouse(warehouseId);
// allWarehouse.add(warehouseMsg);
// }
// return new ResponseResult(HttpStatus.SUCCESS,ReturnMsg.PASS,allWarehouse);
} }
@PostMapping("/GetOneWarehouse") @PostMapping("/GetWarehouseDetail")
@ApiOperation("查询单个仓库信息") @ApiOperation("查询单个仓库信息")
public ResponseResult getOneWarehouse(@RequestBody Map<String, Object> msg) { public ResponseResult getOneWarehouse(@RequestBody Map<String, Object> msg) {
String warehouseId = msg.get("warehouseId").toString(); ResponseResult returnMsg = warehouseService.getOneWarehouse(msg);
Map<String, Object> warehouseMsg = warehouseService.getOneWarehouse(warehouseId); return returnMsg;
return new ResponseResult(HttpStatus.SUCCESS,"操作成功",warehouseMsg);
} }
@PostMapping("/UpdateWarehouse") @PostMapping("/UpdateWarehouse")
@ApiOperation("修改仓库信息") @ApiOperation("修改仓库信息")
public ResponseResult updateWarehouse(@RequestBody Map<String,Object> msg) { public ResponseResult updateWarehouse(@RequestBody Map<String,Object> msg) {
warehouseService.updateWarehouse(msg); ResponseResult returnMsg = warehouseService.updateWarehouse(msg);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功"); return returnMsg;
}
@PostMapping("/AddArea")
@ApiOperation("添加区域")
public ResponseResult addArea(@RequestBody Map<String,Object> msg) {
ResponseResult returnMsg = warehouseService.addArea(msg);
return returnMsg;
}
@PostMapping("/UpdateArea")
@ApiOperation("修改区域")
public ResponseResult updateArea(@RequestBody Map<String,Object> msg) {
ResponseResult returnMsg = warehouseService.updateArea(msg);
return returnMsg;
}
@PostMapping("/DeleteArea")
@ApiOperation("删除区域")
public ResponseResult deleteArea(@RequestBody Map<String,Object> msg) {
ResponseResult returnMsg = warehouseService.deleteArea(msg);
return returnMsg;
}
@PostMapping("/GetAreaList")
@ApiOperation("查询区域信息")
public ResponseResult getAreaList(@RequestBody Map<String, Object> msg){
ResponseResult returnMsg = warehouseService.getAreaList(msg);
return returnMsg;
}
@PostMapping("/AddShelf")
@ApiOperation("添加货架")
public ResponseResult addShelf(@RequestBody Map<String,Object> msg) {
ResponseResult returnMsg = warehouseService.addShelf(msg);
return returnMsg;
}
@PostMapping("/UpdateShelf")
@ApiOperation("修改货架")
public ResponseResult updateShelf(@RequestBody Map<String,Object> msg) {
ResponseResult returnMsg = warehouseService.updateShelf(msg);
return returnMsg;
}
@PostMapping("/DeleteShelf")
@ApiOperation("删除货架")
public ResponseResult deleteShelf(@RequestBody Map<String,Object> msg) {
ResponseResult returnMsg = warehouseService.deleteShelf(msg);
return returnMsg;
}
@PostMapping("/GetShelfList")
@ApiOperation("查询区域信息")
public ResponseResult getShelfList(@RequestBody Map<String, Object> msg){
ResponseResult returnMsg = warehouseService.getShelfList(msg);
return returnMsg;
} }
} }
...@@ -26,6 +26,12 @@ public class Cabinet implements Serializable { ...@@ -26,6 +26,12 @@ public class Cabinet implements Serializable {
private String cabinetNum; private String cabinetNum;
/** /**
* 箱数
*/
@ApiModelProperty(value = "箱数")
private Integer num;
/**
* 单警柜名称 * 单警柜名称
*/ */
@ApiModelProperty(value = "单警柜名称") @ApiModelProperty(value = "单警柜名称")
...@@ -47,7 +53,7 @@ public class Cabinet implements Serializable { ...@@ -47,7 +53,7 @@ public class Cabinet implements Serializable {
* 单警柜当前状态,0正常,1异常 * 单警柜当前状态,0正常,1异常
*/ */
@ApiModelProperty(value = "单警柜当前状态,0正常,1异常") @ApiModelProperty(value = "单警柜当前状态,0正常,1异常")
private Integer errorState; private Integer state;
/** /**
* 创建时间 * 创建时间
...@@ -67,5 +73,11 @@ public class Cabinet implements Serializable { ...@@ -67,5 +73,11 @@ public class Cabinet implements Serializable {
@ApiModelProperty(value = "更新人员") @ApiModelProperty(value = "更新人员")
private String updateUser; private String updateUser;
/**
* 箱数
*/
// @ApiModelProperty(value = "箱数")
// private Integer num;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -37,10 +37,10 @@ public class CabinetBox implements Serializable { ...@@ -37,10 +37,10 @@ public class CabinetBox implements Serializable {
private String policeName; private String policeName;
/** /**
* 异常状态:0正常/1异常 * 异常状态:1正常/0异常
*/ */
@ApiModelProperty(value = "异常状态:0正常/1异常") @ApiModelProperty(value = "异常状态:1正常/0异常")
private Integer errorState; private Integer state;
/** /**
* 异常原因 * 异常原因
......
...@@ -35,7 +35,7 @@ public class EquipmentSize implements Serializable { ...@@ -35,7 +35,7 @@ public class EquipmentSize implements Serializable {
* 号型码 * 号型码
*/ */
@ApiModelProperty(value = "号型码") @ApiModelProperty(value = "号型码")
private Integer code; private String code;
/** /**
* 号型名称 * 号型名称
...@@ -65,7 +65,7 @@ public class EquipmentSize implements Serializable { ...@@ -65,7 +65,7 @@ public class EquipmentSize implements Serializable {
* 价格 * 价格
*/ */
@ApiModelProperty(value = "价格") @ApiModelProperty(value = "价格")
private Float price; private Double price;
/** /**
* 当前状态:0关闭/1启用 * 当前状态:0关闭/1启用
......
package com.junmp.jyzb.domain; package com.junmp.jyzb.domain;
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleCreateTableStatement;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
...@@ -34,12 +36,24 @@ public class Policeman implements Serializable { ...@@ -34,12 +36,24 @@ public class Policeman implements Serializable {
private String cabinetId; private String cabinetId;
/** /**
* 组织机构名称
*/
@ApiModelProperty(value="组织机构名称")
private Cabinet cabinetName;
/**
* 机构代码,一个警员只属于一个机构 * 机构代码,一个警员只属于一个机构
*/ */
@ApiModelProperty(value="机构代码,一个警员只属于一个机构") @ApiModelProperty(value="机构代码,一个警员只属于一个机构")
private String orgId; private String orgId;
/** /**
* 机构名称
*/
@ApiModelProperty(value="机构名称")
private PubOrg orgName;
/**
* 警员编号 * 警员编号
*/ */
@ApiModelProperty(value="警员编号") @ApiModelProperty(value="警员编号")
...@@ -120,7 +134,30 @@ public class Policeman implements Serializable { ...@@ -120,7 +134,30 @@ public class Policeman implements Serializable {
/** /**
* 指纹信息 * 指纹信息
* */ * */
private List<PoliceFinger> fingerMsg; private List<Map<String, Object>> fingerMsg;
/**
* 警员状态
*/
@ApiModelProperty(value="指纹id")
private Integer fingerId;
/**
* 指纹名称
*/
@ApiModelProperty(value="指纹名称")
private String fingerName;
/**
* 指纹信息
*/
@ApiModelProperty(value="指纹信息")
private String fingerInfo;
/**
* 单警柜关联箱号id
* */
private String cabinetBoxId;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
package com.junmp.jyzb.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 组织机构信息
*/
@ApiModel(value="com-junmp-jyzb-domain-PubOrg")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PubOrg implements Serializable {
/**
* 主键
*/
@ApiModelProperty(value="主键")
private Long orgId;
/**
* 父id,一级节点父id是0
*/
@ApiModelProperty(value="父id,一级节点父id是0")
private Long orgParentId;
/**
* 父ids
*/
@ApiModelProperty(value="父ids")
private String orgParentIds;
/**
* 组织编码
*/
@ApiModelProperty(value="组织编码")
private String orgCode;
/**
* 组织名称
*/
@ApiModelProperty(value="组织名称")
private String orgName;
/**
* 机构类型100企业,101:机构
*/
@ApiModelProperty(value="机构类型100企业,101:机构")
private Short orgType;
/**
* 排序
*/
@ApiModelProperty(value="排序")
private Byte sortVal;
/**
* 状态:1-启用,2-禁用
*/
@ApiModelProperty(value="状态:1-启用,2-禁用")
private Byte statusFlag;
/**
* 描述
*/
@ApiModelProperty(value="描述")
private String remark;
/**
* 删除标记:Y-已删除,N-未删除
*/
@ApiModelProperty(value="删除标记:Y-已删除,N-未删除")
private Short delFlag;
/**
* 机构全称
*/
@ApiModelProperty(value="机构全称")
private String orgFullName;
/**
* 地址
*/
@ApiModelProperty(value="地址")
private String address;
/**
* 联系人
*/
@ApiModelProperty(value="联系人")
private String contact;
/**
* 电话
*/
@ApiModelProperty(value="电话")
private String phone;
/**
* 创建时间
*/
@ApiModelProperty(value="创建时间")
private Date createTime;
/**
* 创建人
*/
@ApiModelProperty(value="创建人")
private Long createUser;
/**
* 更新时间
*/
@ApiModelProperty(value="更新时间")
private Date updateTime;
/**
* 更新人
*/
@ApiModelProperty(value="更新人")
private Long updateUser;
@ApiModelProperty(value="")
private String guid;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.junmp.jyzb.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ApiModel(value="com-junmp-jyzb-domain-Shelf")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Shelf implements Serializable {
/**
* 货架id
*/
@ApiModelProperty(value="货架id")
private String shelfId;
/**
* 货架名称
*/
@ApiModelProperty(value="货架名称")
private String shelfName;
/**
* 编码
*/
@ApiModelProperty(value="编码")
private String code;
/**
* 货架类型Normal:普通货架Smart:智能货架
*/
@ApiModelProperty(value="货架类型Normal:普通货架Smart:智能货架")
private String type;
/**
* 仓库
*/
@ApiModelProperty(value="仓库")
private String warehouseId;
/**
* 货架层数
*/
@ApiModelProperty(value="货架层数")
private Integer shelfRows;
/**
* 单层货架列数
*/
@ApiModelProperty(value="单层货架列数")
private Integer shelfColumns;
/**
* 货架排数(智能货架多货架拼接)
*/
@ApiModelProperty(value="货架排数(智能货架多货架拼接)")
private Integer shelfRanges;
/**
* 智能货架地址
*/
@ApiModelProperty(value="智能货架地址")
private String url;
/**
* 型号
*/
@ApiModelProperty(value="型号")
private String sizeInfo;
@ApiModelProperty(value="")
private Date createTime;
@ApiModelProperty(value="")
private Date updateTime;
@ApiModelProperty(value="")
private String createUser;
@ApiModelProperty(value="")
private String updateUser;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
...@@ -79,5 +79,11 @@ public class Supplier implements Serializable { ...@@ -79,5 +79,11 @@ public class Supplier implements Serializable {
@ApiModelProperty(value = "联系方式") @ApiModelProperty(value = "联系方式")
private String phone; private String phone;
/**
* 状态码
*/
@ApiModelProperty(value = "状态码")
private Integer state;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -8,76 +8,52 @@ import lombok.AllArgsConstructor; ...@@ -8,76 +8,52 @@ import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@ApiModel(value = "com-junmp-jyzb-domain-Organization") @ApiModel(value="com-junmp-jyzb-domain-SupplierType")
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class Organization implements Serializable { public class SupplierType implements Serializable {
/** /**
* 组织机构表ID * 供应商产品ID
*/ */
@ApiModelProperty(value = "组织机构表ID") @ApiModelProperty(value="供应商产品ID")
private String id; private String id;
/** /**
* 组织机构名称 * 供应商代码
*/ */
@ApiModelProperty(value = "组织机构名称") @ApiModelProperty(value="供应商代码")
private String name; private String supplierId;
/** /**
* 组织机构代码 * 产品代码
*/ */
@ApiModelProperty(value = "组织机构代码") @ApiModelProperty(value="产品代码")
private String code; private String typeId;
/** /**
* 创建时间 * 状态,0:停用,1:启用
*/ */
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value="状态,0:停用,1:启用")
private Date createTime; private Integer state;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
private Date updateTime;
/**
* 组织机构短码
*/
@ApiModelProperty(value = "组织机构短码")
private String findCode;
/**
* 区域名称
*/
@ApiModelProperty(value = "区域名称")
private String areaName;
/**
* 装备总数
*/
@ApiModelProperty(value = "装备总数")
private Integer equipmentNumber;
/** /**
* 使用次数 * 创建时间
*/ */
@ApiModelProperty(value = "使用次数") @ApiModelProperty(value="创建时间")
private Integer useNumber; private Date createTime;
/** /**
* 使用状态(0:启用,1:停用) * 最后更新时间
*/ */
@ApiModelProperty(value = "使用状态(0:启用,1:停用)") @ApiModelProperty(value="最后更新时间")
private Integer state; private Date updateTime;
/** /**
* 父类ID * 更新人ID
*/ */
@ApiModelProperty(value = "父类ID") @ApiModelProperty(value="更新人ID")
private String parentId; private String updateUser;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -38,6 +38,12 @@ public class Warehouse implements Serializable { ...@@ -38,6 +38,12 @@ public class Warehouse implements Serializable {
private String phone; private String phone;
/** /**
* 视屏地址
*/
@ApiModelProperty(value = "视屏地址")
private String video;
/**
* 创建时间 * 创建时间
*/ */
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
...@@ -56,28 +62,48 @@ public class Warehouse implements Serializable { ...@@ -56,28 +62,48 @@ public class Warehouse implements Serializable {
private String updateUser; private String updateUser;
/** /**
* 新版本组织机构外键
*/
@ApiModelProperty(value = "新版本组织机构外键")
private Integer orgIdInt;
/**
* 是否锁库,1锁库,0未锁库
*/
@ApiModelProperty(value = "是否锁库")
private Integer isLocked;
/**
* 组织机构表id * 组织机构表id
*/ */
@ApiModelProperty(value = "组织机构表id") @ApiModelProperty(value = "组织机构表id")
private String orgId; private String orgId;
/** /**
* 视屏地址 * 当前仓库下装备总数
*/ */
@ApiModelProperty(value = "视屏地址") @ApiModelProperty(value = "当前仓库下装备总数")
private String video; private Integer sum;
/** /**
* 1表启用,0表禁用 * 出库装备总数
*/ */
@ApiModelProperty(value = "状态") @ApiModelProperty(value = "当前仓库下装备总数")
private Integer state; private Integer outSum;
/** /**
* 当前仓库下装备总数 * 出库装备总数
*/ */
@ApiModelProperty(value = "当前仓库下装备总数") @ApiModelProperty(value = "当前仓库下装备总数")
private Integer sum; private Integer inSum;
/**
* 1表启用,0表禁用
*/
@ApiModelProperty(value = "状态")
private Integer state;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
package com.junmp.jyzb.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ApiModel(value="com-junmp-jyzb-domain-WarehouseArea")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WarehouseArea implements Serializable {
/**
* 区域主键
*/
@ApiModelProperty(value="区域主键")
private String areaId;
/**
* 区域名称
*/
@ApiModelProperty(value="区域名称")
private String areaName;
/**
* 所属组织机构
*/
@ApiModelProperty(value="所属组织机构")
private Long orgIdInt;
/**
* 所属仓库id
*/
@ApiModelProperty(value="所属仓库id")
private String warehouseId;
/**
* 区域照片
*/
@ApiModelProperty(value="区域照片")
private String photo;
@ApiModelProperty(value="")
private Date createTime;
@ApiModelProperty(value="")
private Date updateTime;
@ApiModelProperty(value="")
private String createUser;
@ApiModelProperty(value="")
private String updateUser;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.junmp.jyzb.mapper; package com.junmp.jyzb.mapper;
import com.junmp.jyzb.domain.CabinetBox;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper @Mapper
public interface CabinetBoxMapper { public interface CabinetBoxMapper {
List<Map<String, Object>> getBoxMsg(String id);
void changeCabinetState(CabinetBox cabinetBox);
String getOneCabinetBox(String cabinetBoxId);
} }
\ No newline at end of file
...@@ -12,7 +12,7 @@ public interface CabinetMapper { ...@@ -12,7 +12,7 @@ public interface CabinetMapper {
public int addCabinet(Cabinet cabinet); public int addCabinet(Cabinet cabinet);
public List<Map<String, Object>> getAllCabinet(String orgId); public List<Map<String, Object>> getAllCabinet();
Map<String, Object> getOneCabinet(String id); Map<String, Object> getOneCabinet(String id);
...@@ -21,4 +21,14 @@ public interface CabinetMapper { ...@@ -21,4 +21,14 @@ public interface CabinetMapper {
void updateCabinet(Cabinet cabinet); void updateCabinet(Cabinet cabinet);
List<String> getAllCabinetId(String orgId); List<String> getAllCabinetId(String orgId);
void changeCabinetState(Cabinet cabinet);
List<String> getAllCabinetBoxId(String id);
Map<String, Object> getCabinetByCabinetNum(String cabinetNum);
List<String> getAllCabinetIdByHighest();
String getCabinetNumById(String id);
} }
\ No newline at end of file
...@@ -19,4 +19,10 @@ public interface EquipmentSizeMapper { ...@@ -19,4 +19,10 @@ public interface EquipmentSizeMapper {
void updateSize(EquipmentSize size); void updateSize(EquipmentSize size);
List<String> getAllSizeId(String orgId); List<String> getAllSizeId(String orgId);
void changeSizeState(EquipmentSize size);
List<String> getSizeByCode(String code);
String getCodeById(String id);
} }
\ No newline at end of file
package com.junmp.jyzb.mapper; package com.junmp.jyzb.mapper;
import com.junmp.jyzb.domain.EquipmentType; import com.junmp.jyzb.domain.EquipmentType;
import com.junmp.jyzb.domain.Warehouse;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
@Mapper @Mapper
public interface EquipmentTypeMapper { public interface EquipmentTypeMapper {
List<EquipmentType> selectAllEquipment();
void addEquipment(EquipmentType equipmentType); void addEquipment(EquipmentType equipmentType);
//Map<String, Object> getOneEquipment(String id);
void deleteEquipment(String id);
void updateEquipment(EquipmentType msg);
List<String> getAllEquipmentId(String orgId);
void changeEquipmentState(EquipmentType msg);
List<EquipmentType> selectAllEquipment();
List<Map<String,Object>> getAll();
void addData(List<Map<String, Object>> resultList);
String getIdByParentId(String parentId);
//添加商品的供应商
void addSupplier(@Param("uuid") String uuid,@Param("equipmentType") EquipmentType equipmentType, @Param("supplierList") List<String> supplierList);
void setCalculationId(@Param("numStr") String numStr,@Param("parentId") String parentId);
String getOneEquipmentId(String numStr);
void deleteSupplier(String id);
Map<String,Object> getOneEquipment(EquipmentType equipment);
List<Map<String, Object>> getSupplierByTypeId(EquipmentType equipment);
List<String> getLowestTypeId();
} }
\ No newline at end of file
...@@ -9,19 +9,9 @@ import java.util.Map; ...@@ -9,19 +9,9 @@ import java.util.Map;
@Mapper @Mapper
public interface PolicemanMapper extends BaseMapper<Policeman> { public interface PolicemanMapper extends BaseMapper<Policeman> {
/**
* 新增警员信息
*/
void addPoliceman(Policeman policeman);
/** void addPoliceman(Policeman policeman);
* 查询警员列表
*/
public List<Map<String, Object>> getAllPoliceman(String orgId);
/**
* 查询单个警员的信息
*/
Map<String, Object> getOnePolice(String id); Map<String, Object> getOnePolice(String id);
void deletePolice(String id); void deletePolice(String id);
...@@ -32,9 +22,21 @@ public interface PolicemanMapper extends BaseMapper<Policeman> { ...@@ -32,9 +22,21 @@ public interface PolicemanMapper extends BaseMapper<Policeman> {
void deleteFinger(String fingerId); void deleteFinger(String fingerId);
List<String> getAllPoliceIdByCabinet(String cabinetId); List<String> getAllPoliceIdByBoxId(String boxId);
void addFaceInfo(Policeman police); void addFaceInfo(Policeman police);
void changePoliceState(Policeman police); void changePoliceState(Policeman police);
List<String> getChildren(String id);
List<String> getAllBoxIdByCabinet(String cabinetId);
List<String> getPoliceByPoliceCode(String policeCode);
List<Map<String,Object>> getAllPolice();
List<String> getAllPoliceIdByHighest();
String getPoliceCodeById(String id);
} }
\ No newline at end of file
package com.junmp.jyzb.mapper;
import com.junmp.jyzb.domain.PubOrg;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface PubOrgMapper {
List<PubOrg> selectAllOrg();
Long getOnePubOrg(String orgId);
}
\ No newline at end of file
package com.junmp.jyzb.mapper;
import com.junmp.jyzb.domain.Shelf;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
public interface ShelfMapper {
void addShelf(Shelf shelf);
void updateShelf(Shelf shelf);
void deleteShelf(String shelfId);
List<Map<String, Object>> getShelfList(Shelf shelf);
}
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.junmp.jyzb.mapper; ...@@ -3,6 +3,7 @@ package com.junmp.jyzb.mapper;
import com.junmp.jyzb.domain.Supplier; import com.junmp.jyzb.domain.Supplier;
import com.junmp.jyzb.domain.Warehouse; import com.junmp.jyzb.domain.Warehouse;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -12,11 +13,18 @@ public interface SupplierMapper { ...@@ -12,11 +13,18 @@ public interface SupplierMapper {
public int addSupplier(Supplier supplier); public int addSupplier(Supplier supplier);
Map<String, Object> getOneSupplier(String id); // Map<String, Object> getOneSupplier(String id,Object SelectName,Object SelectCode);
Map<String, Object> getOneSupplier(@Param("id") String id, @Param("SelectName") Object SelectName, @Param("SelectCode") Object SelectCode);
//Map<String, Object> getOneSupplier(@Param("id") String id);
void deleteSupplier(String id); void deleteSupplier(String id);
void updateSupplier(Supplier supplier); void updateSupplier(Supplier supplier);
List<String> getAllSupplierId(); List<String> getAllSupplierId();
void changeSupplierState(Supplier supplier);
List<Map<String, Object>> getAllSupplier();
} }
\ No newline at end of file
package com.junmp.jyzb.mapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SupplierTypeMapper {
}
\ No newline at end of file
package com.junmp.jyzb.mapper;
import com.junmp.jyzb.domain.Shelf;
import com.junmp.jyzb.domain.WarehouseArea;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
public interface WarehouseAreaMapper {
void addArea(WarehouseArea warehouseArea);
void updateArea(WarehouseArea warehouseArea);
void deleteArea(String areaId);
List<Map<String, Object>> getAreaList(Shelf shelf);
}
\ No newline at end of file
...@@ -21,4 +21,8 @@ public interface WarehouseMapper { ...@@ -21,4 +21,8 @@ public interface WarehouseMapper {
List<String> getAllWarehouseId(String orgId); List<String> getAllWarehouseId(String orgId);
void changeWarehouseState(Warehouse warehouse); void changeWarehouseState(Warehouse warehouse);
List<String> getAllWarehouseIdByHighest();
List<Map<String, Object>> getAllWarehouse();
} }
\ No newline at end of file
package com.junmp.jyzb.service; package com.junmp.jyzb.service;
public interface CabinetBoxService{ import java.util.List;
import java.util.Map;
public interface CabinetBoxService{
List<Map<String, Object>> getAllBoxMsg(String id);
} }
package com.junmp.jyzb.service; package com.junmp.jyzb.service;
import com.junmp.jyzb.utils.ResponseResult;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public interface CabinetService{ public interface CabinetService{
void addCabinet(Map<String, Object> msg); ResponseResult addCabinet(Map<String, Object> msg);
void deleteCabinet(Map<String, Object> msg); ResponseResult deleteCabinet(Map<String, Object> msg);
List<String> getAllCabinetId(Map<String, Object> orgId); List<String> getAllCabinetId(Map<String, Object> orgId);
Map<String, Object> getOneCabinet(String cabinetId); Map<String, Object> getOneCabinet(String cabinetId);
void updateCabinet(Map<String, Object> msg); ResponseResult updateCabinet(Map<String, Object> msg);
ResponseResult changeCabinetState(Map<String, Object> msg);
List<String> getAllCabinetBoxId(String id);
ResponseResult getAllCabinet(Map<String, Object> msg);
ResponseResult getCabinetDetail(Map<String, Object> msg);
} }
package com.junmp.jyzb.service; package com.junmp.jyzb.service;
import com.junmp.jyzb.utils.ResponseResult;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public interface EquipmentSizeService{ public interface EquipmentSizeService{
void addSize(Map<String, Object> msg); ResponseResult addSize(Map<String, Object> msg);
Map<String,Object> getOneSize(String id); ResponseResult getOneSize(Map<String,Object> id);
void deleteSize(Map<String, Object> msg); ResponseResult deleteSize(Map<String, Object> msg);
void updateSize(Map<String, Object> msg); ResponseResult updateSize(Map<String, Object> msg);
List<String> getAllSizeId(Map<String, Object> orgId); List<String> getAllSizeId(Map<String, Object> orgId);
ResponseResult changeSizeState(Map<String, Object> msg);
ResponseResult getAllSize(Map<String, Object> msg);
} }
package com.junmp.jyzb.service; package com.junmp.jyzb.service;
import com.junmp.jyzb.utils.ResponseResult;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public interface EquipmentTypeService{ public interface EquipmentTypeService{
ResponseResult addEquipment(Map<String, Object> msg);
ResponseResult calculationEquipmentId();
ResponseResult deleteEquipment(Map<String, Object> msg);
ResponseResult updateEquipment(Map<String, Object> msg);
ResponseResult changeEquipmentState(Map<String, Object> msg);
List<Map<String, Object>> getEquipmentList(); List<Map<String, Object>> getEquipmentList();
void addEquipment(Map<String, Object> msg); ResponseResult getOneEquipment(Map<String, Object> msg);
} }
...@@ -3,27 +3,34 @@ package com.junmp.jyzb.service; ...@@ -3,27 +3,34 @@ package com.junmp.jyzb.service;
import com.junmp.jyzb.domain.Policeman; import com.junmp.jyzb.domain.Policeman;
import com.junmp.jyzb.utils.ResponseResult; import com.junmp.jyzb.utils.ResponseResult;
import javax.naming.spi.ResolveResult;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public interface PolicemanService{ public interface PolicemanService{
void addPoliceman(Map<String, Object> msg); ResponseResult addPoliceman(Map<String, Object> msg);
Map<String,Object> getOnePolice(String id); ResponseResult getOnePolice(Map<String, Object> id);
void deletePolice(Map<String, Object> msg); ResponseResult deletePolice(Map<String, Object> msg);
void updatePolice(Map<String, Object> msg); ResponseResult updatePolice(Map<String, Object> msg);
List<String> getAllPoliceId(Map<String, Object> orgId); List<String> getAllPoliceId(Map<String, Object> orgId);
void deleteFinger(Map<String, Object> msg); ResponseResult deleteFinger(Map<String, Object> msg);
List<String> getAllPoliceIdByCabinet(Map<String, Object> cabinetId); List<String> getAllPoliceIdByCabinet(Map<String, Object> cabinetId);
void addFingerInfo(Map<String, Object> msg); ResponseResult addFingerInfo(Map<String, Object> msg);
void addFaceInfo(Map<String, Object> msg); ResponseResult addFaceInfo(Map<String, Object> msg);
void changePoliceState(Map<String, Object> msg); ResponseResult changePoliceState(Map<String, Object> msg);
//List<Map<String, Object>> getAllPoliceman(List<String> allPoliceId);
ResponseResult getAllPoliceman(Map<String, Object> orgId);
ResponseResult getPoliceData(Map<String, Object> cabinetId);
} }
package com.junmp.jyzb.service;
import com.junmp.jyzb.utils.ResponseResult;
import java.util.List;
import java.util.Map;
public interface PubOrgService{
ResponseResult showPubOrgList(Map<String, Object> orgId);
ResponseResult showPubOrgListOld(Map<String, Object> orgId);
}
package com.junmp.jyzb.service;
public interface ShelfService{
}
package com.junmp.jyzb.service; package com.junmp.jyzb.service;
import com.junmp.jyzb.utils.ResponseResult;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public interface SupplierService{ public interface SupplierService{
void addSupplier(Map<String, Object> msg); ResponseResult addSupplier(Map<String, Object> msg);
Map<String,Object> getOneSupplier(String id); Map<String,Object> getOneSupplier(String id,Object name,Object code);
void deleteSupplier(Map<String, Object> msg); ResponseResult deleteSupplier(Map<String, Object> msg);
void updateSupplier(Map<String, Object> msg); ResponseResult updateSupplier(Map<String, Object> msg);
List<String> getAllSupplierId(); List<String> getAllSupplierId();
ResponseResult getAllSupplier(Map<String, Object> msg);
ResponseResult changeSupplierState(Map<String, Object> msg);
} }
package com.junmp.jyzb.service;
public interface SupplierTypeService{
}
package com.junmp.jyzb.service;
public interface WarehouseAreaService{
}
package com.junmp.jyzb.service; package com.junmp.jyzb.service;
import com.junmp.jyzb.utils.ResponseResult;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public interface WarehouseService{ public interface WarehouseService{
void addWarehouse(Map<String, Object> msg); ResponseResult addWarehouse(Map<String, Object> msg);
Map<String,Object> getOneWarehouse(String id); ResponseResult getOneWarehouse(Map<String, Object> id);
void deleteWarehouse(Map<String, Object> msg); ResponseResult deleteWarehouse(Map<String, Object> msg);
void updateWarehouse(Map<String, Object> msg); ResponseResult updateWarehouse(Map<String, Object> msg);
List<String> getAllWarehouseId(Map<String, Object> orgId); List<String> getAllWarehouseId(Map<String, Object> orgId);
void changeWarehouseState(Map<String, Object> msg); ResponseResult changeWarehouseState(Map<String, Object> msg);
ResponseResult getAllWarehouse(Map<String, Object> orgId);
/**
* 新增8接口
* */
ResponseResult addArea(Map<String, Object> msg);
ResponseResult updateArea(Map<String, Object> msg);
ResponseResult deleteArea(Map<String, Object> msg);
ResponseResult getAreaList(Map<String, Object> msg);
ResponseResult addShelf(Map<String, Object> msg);
ResponseResult updateShelf(Map<String, Object> msg);
ResponseResult deleteShelf(Map<String, Object> msg);
ResponseResult getShelfList(Map<String, Object> msg);
} }
package com.junmp.jyzb.service.impl; package com.junmp.jyzb.service.impl;
import com.junmp.jyzb.mapper.CabinetBoxMapper;
import com.junmp.jyzb.mapper.PoliceFingerMapper;
import com.junmp.jyzb.service.CabinetBoxService; import com.junmp.jyzb.service.CabinetBoxService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service @Service
public class CabinetBoxServiceImpl implements CabinetBoxService { public class CabinetBoxServiceImpl implements CabinetBoxService {
@Resource
private CabinetBoxMapper cabinetBoxMapper;
@Override
public List<Map<String, Object>> getAllBoxMsg(String id) {
return cabinetBoxMapper.getBoxMsg(id);
}
} }
package com.junmp.jyzb.service.impl; package com.junmp.jyzb.service.impl;
import com.junmp.jyzb.domain.EquipmentSize; import com.junmp.jyzb.domain.EquipmentSize;
import com.junmp.jyzb.domain.Warehouse; import com.junmp.jyzb.domain.EquipmentType;
import com.junmp.jyzb.mapper.EquipmentTypeMapper;
import com.junmp.jyzb.service.EquipmentSizeService; import com.junmp.jyzb.service.EquipmentSizeService;
import com.junmp.jyzb.utils.DateTimeUtil; import com.junmp.jyzb.utils.DateTimeUtil;
import com.junmp.jyzb.utils.HttpStatus;
import com.junmp.jyzb.utils.ResponseResult;
import com.junmp.jyzb.utils.ReturnMsg;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import com.junmp.jyzb.mapper.EquipmentSizeMapper; import com.junmp.jyzb.mapper.EquipmentSizeMapper;
import java.util.Date; import java.util.*;
import java.util.List;
import java.util.Map; import static com.junmp.jyzb.utils.CheckBlank.checkNotBlank;
import java.util.UUID;
@Service @Service
public class EquipmentSizeServiceImpl implements EquipmentSizeService { public class EquipmentSizeServiceImpl implements EquipmentSizeService {
...@@ -19,60 +22,156 @@ public class EquipmentSizeServiceImpl implements EquipmentSizeService { ...@@ -19,60 +22,156 @@ public class EquipmentSizeServiceImpl implements EquipmentSizeService {
@Resource @Resource
private EquipmentSizeMapper equipmentSizeMapper; private EquipmentSizeMapper equipmentSizeMapper;
@Resource
private EquipmentTypeMapper equipmentTypeMapper;
private static final String REDIS_SIZE = "Size_";
@Override @Override
public void addSize(Map<String, Object> msg) { public ResponseResult addSize(Map<String, Object> msg) {
try {
checkNotBlank(msg.get("typeId"), "typeId不能为空");
checkNotBlank(msg.get("code"), "code不能为空");
checkNotBlank(msg.get("name"), "name不能为空");
//checkNotBlank((String) msg.get("note"), "note不能为空");
//Objects.requireNonNull(msg.get("price"), "price不能为空");
Objects.requireNonNull(msg.get("epcType"), "epcType不能为空");
} catch (IllegalArgumentException e) {
return new ResponseResult(HttpStatus.ERROR, ReturnMsg.ERROR,e.getMessage());
}
//TODO 查询是否有重复的code
// List<String> sizeCodeFlag = equipmentSizeMapper.getSizeByCode((String) msg.get("code"));
// if (!sizeCodeFlag.isEmpty()){
// return new ResponseResult(HttpStatus.ERROR, ReturnMsg.ERROR,"装备号型码已存在");
// }
//todo typeId只能是最下级的
// List<String> resultId = equipmentTypeMapper.getLowestTypeId();
// if (!resultId.contains(msg.get("typeId"))){
// return new ResponseResult(HttpStatus.ERROR, ReturnMsg.ERROR,"typeId只能是最下一级");
// }
EquipmentSize size =new EquipmentSize(); EquipmentSize size =new EquipmentSize();
//将警员相关信息添加到警员表
//生成一个uuid //生成一个uuid
String uuid = UUID.randomUUID().toString().replaceAll("-", ""); String uuid = UUID.randomUUID().toString().replaceAll("-", "");
//生成当前时间 //生成当前时间
Date currentDate = DateTimeUtil.getCurrentDateTime(); Date currentDate = DateTimeUtil.getCurrentDateTime();
size.setId(uuid); size.setId(uuid);
size.setCreateTime(currentDate); size.setCreateTime(currentDate);
size.setUpdateTime(currentDate);
size.setTypeId((String) msg.get("typeId")); size.setTypeId((String) msg.get("typeId"));
size.setCode((Integer) msg.get("code")); size.setCode((String) msg.get("code"));
size.setName((String) msg.get("name")); size.setName((String) msg.get("name"));
size.setNote((String) msg.get("note")); size.setNote((String) msg.get("note"));
size.setPrice((Float) msg.get("price")); size.setPrice((Double) msg.get("price"));
size.setEpcType((Integer) msg.get("epcType")); size.setEpcType((Integer) msg.get("epcType"));
equipmentSizeMapper.addSize(size); equipmentSizeMapper.addSize(size);
return new ResponseResult(HttpStatus.SUCCESS, ReturnMsg.PASS,uuid);
} }
@Override @Override
public Map<String,Object> getOneSize(String msg) { public ResponseResult getOneSize(Map<String,Object> msg) {
return equipmentSizeMapper.getOneSize(msg); try {
checkNotBlank(msg.get("id"), "id不能为空");
} catch (IllegalArgumentException e) {
return new ResponseResult(HttpStatus.ERROR, ReturnMsg.ERROR,e.getMessage());
}
String sizeId = msg.get("id").toString();
Map<String, Object> oneSize = equipmentSizeMapper.getOneSize(sizeId);
return new ResponseResult(HttpStatus.SUCCESS,ReturnMsg.PASS,oneSize);
} }
@Override @Override
public void deleteSize(Map<String, Object> msg) { public ResponseResult deleteSize(Map<String, Object> msg) {
// 进行参数校验
try {
checkNotBlank(msg.get("sizeList"), "sizeList不能为空");
} catch (IllegalArgumentException e) {
return new ResponseResult(HttpStatus.ERROR, ReturnMsg.ERROR,e.getMessage());
}
List<Object> sizeList = (List<Object>) msg.get("sizeList"); List<Object> sizeList = (List<Object>) msg.get("sizeList");
for (Object sizeId:sizeList){ for (Object sizeId:sizeList){
equipmentSizeMapper.deleteSize(sizeId.toString()); equipmentSizeMapper.deleteSize(sizeId.toString());
} }
return new ResponseResult(HttpStatus.SUCCESS,ReturnMsg.PASS);
} }
@Override @Override
public void updateSize(Map<String, Object> msg) { public ResponseResult updateSize(Map<String, Object> msg) {
try {
checkNotBlank(msg.get("id"), "id不能为空");
checkNotBlank(msg.get("typeId"), "typeId不能为空");
checkNotBlank(msg.get("code"), "code不能为空");
checkNotBlank(msg.get("name"), "name不能为空");
Objects.requireNonNull(msg.get("epcType"), "epcType不能为空");
} catch (IllegalArgumentException e) {
return new ResponseResult(HttpStatus.ERROR, ReturnMsg.ERROR,e.getMessage());
}
//todo 判断code是否重复
// //查询是否有重复的code
// List<String> sizeCodeFlag = equipmentSizeMapper.getSizeByCode((String) msg.get("code"));
// //判断code是否有变动
// String oldCode = equipmentSizeMapper.getCodeById(msg.get("id").toString());
// if ()
// if (!sizeCodeFlag.isEmpty()){
// return new ResponseResult(HttpStatus.ERROR, ReturnMsg.ERROR,"装备号型码已存在");
// }
EquipmentSize size =new EquipmentSize(); EquipmentSize size =new EquipmentSize();
Date currentDate = DateTimeUtil.getCurrentDateTime(); Date currentDate = DateTimeUtil.getCurrentDateTime();
//police.setId(uuid); //police.setId(uuid);
size.setId((String) msg.get("id")); size.setId((String) msg.get("id"));
size.setTypeId((String) msg.get("typeId")); size.setTypeId((String) msg.get("typeId"));
size.setCode((Integer) msg.get("code")); size.setCode((String) msg.get("code"));
size.setName((String) msg.get("name")); size.setName((String) msg.get("name"));
size.setNote((String) msg.get("note")); size.setNote((String) msg.get("note"));
size.setUpdateTime(currentDate); size.setUpdateTime(currentDate);
size.setPrice((Float) msg.get("price")); size.setPrice((Double) msg.get("price"));
size.setState((Integer) msg.get("state")); //size.setState((Integer) msg.get("state"));
size.setEpcType((Integer) msg.get("epcType")); size.setEpcType((Integer) msg.get("epcType"));
equipmentSizeMapper.updateSize(size); equipmentSizeMapper.updateSize(size);
return new ResponseResult(HttpStatus.SUCCESS,ReturnMsg.PASS);
} }
@Override @Override
public List<String> getAllSizeId(Map<String, Object> typeId) { public List<String> getAllSizeId(Map<String, Object> typeId) {
List<String> msg = equipmentSizeMapper.getAllSizeId(typeId.get("typeId").toString()); List<String> msg = equipmentSizeMapper.getAllSizeId(typeId.get("typeId").toString());
return msg; return msg;
} }
@Override
public ResponseResult changeSizeState(Map<String, Object> msg) {
try {
checkNotBlank(msg.get("id"), "id不能为空");
checkNotBlank(msg.get("state"), "state不能为空");
} catch (IllegalArgumentException e) {
return new ResponseResult(HttpStatus.ERROR, ReturnMsg.ERROR,e.getMessage());
}
EquipmentSize size =new EquipmentSize();
size.setId(msg.get("id").toString());
size.setState((Integer) msg.get("state"));
equipmentSizeMapper.changeSizeState(size);
return new ResponseResult(HttpStatus.SUCCESS, ReturnMsg.PASS);
}
@Override
public ResponseResult getAllSize(Map<String, Object> msg) {
List<Map<String, Object>> allSize=new ArrayList<>();
List<String> allSizeId =getAllSizeId(msg);
for (String sizeId :allSizeId){
Map<String, Object> sizeMsg = equipmentSizeMapper.getOneSize(sizeId);
allSize.add(sizeMsg);
}
return new ResponseResult(HttpStatus.SUCCESS,ReturnMsg.PASS,allSize);
}
} }
package com.junmp.jyzb.service.impl;
import com.junmp.jyzb.domain.EquipmentType;
import com.junmp.jyzb.domain.PubOrg;
import com.junmp.jyzb.utils.HttpStatus;
import com.junmp.jyzb.utils.RedisUtils;
import com.junmp.jyzb.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.junmp.jyzb.mapper.PubOrgMapper;
import com.junmp.jyzb.service.PubOrgService;
import java.util.*;
@Service
public class PubOrgServiceImpl implements PubOrgService{
@Resource
private PubOrgMapper pubOrgMapper;
@Autowired
private RedisUtils redisUtils;
//todo 当orgId不传入-1会出现bug
@Override
public ResponseResult showPubOrgList(Map<String, Object> orgId) {
//构建 Redis 缓存键
String redisKey = "showPubOrgList_"+orgId;
// 从 Redis 中获取数据
List<Map<String, Object>> cachedData = redisUtils.findCachedData(redisKey);
if (cachedData!=null){
return new ResponseResult(HttpStatus.SUCCESS,"操作成功",cachedData);
}
List<PubOrg> menuList = pubOrgMapper.selectAllOrg();
List<Map<String, Object>> resultList = new ArrayList<>();
for (PubOrg menu : menuList) {
//System.out.println(menu.getIdByParentId()+" "+menu.getName()+" "+menu.getParentId());
if (menu.getOrgParentId().toString().equals((orgId.get("orgId")))) {
Map<String, Object> map = new HashMap<>();
map.put("id", menu.getOrgId());
map.put("parentId", menu.getOrgParentId());
//去掉前缀
String name1 = menu.getOrgName(); //name1 ,获得“浙江省公安厅”
//List<String> name2 = null;
List<String> name2 = new ArrayList<>();
//name3为固定字段
List<String> name3 = new ArrayList<>();
name3.add("公安局");
name3.add("公安");
name3.add("分局");
if (menu.getOrgName().length()>3 && name2.size() <2 && (menu.getOrgName().charAt(2)=='省' ||menu.getOrgName().charAt(2)=='市')){
String nameHistory = menu.getOrgName().substring(0,3); //name2 ,获得“浙江省”
name2.add(nameHistory);
name2.add(" ");
name2.add(" ");
}
if (menu.getOrgName().length()>3 && (menu.getOrgName().charAt(2)=='区')){
name2.remove(2);
String nameHistory = menu.getOrgName().substring(0,3);
name2.add(2,nameHistory);
}
map.put("orgName", name1);
List<Map<String, Object>> children = getChildMenus(menu.getOrgId(),menuList,name1,name2,name3);//name为要删掉的前缀
if (!children.isEmpty()) {
map.put("children", children);
}
//map.put("children", getChildMenus(menu.getOrgId(),menuList,name1,name2,name3));
resultList.add(map);
}
}
redisUtils.set(redisKey, resultList);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功",resultList);
}
private List<Map<String, Object>> getChildMenus(Long parentId, List<PubOrg> menuList,String deleteName1,List<String> deleteName2,List<String> deleteName3) {
List<Map<String, Object>> childList = new ArrayList<>();
for (PubOrg menu : menuList) {
//if (menu.getParentId() != null && menu.getParentId().equals(parentId)) {
if (menu.getOrgParentId().toString().equals(parentId.toString())) {
Map<String, Object> map = new HashMap<>();
map.put("id", menu.getOrgId());
map.put("parentId", menu.getOrgParentId());
//去掉前缀
String name1 = menu.getOrgName();
List<String> name2 = new ArrayList<>();
name2 = deleteName2;
String result = removePrefix(name1, deleteName1);
//遍历name2删掉前缀
for (String nameMsg:name2){
result = removePrefix(result, nameMsg);
for (String name3:deleteName3){
result = removePrefix(result, name3);
}
}
map.put("orgName", result);
if (result.length()>3 && (result.charAt(2)=='省' ||result.charAt(2)=='市')){
name2.remove(1);
String nameHistory = result.substring(0,3); //获得“绍兴市”
name2.add(1,nameHistory);
}
if (result.length()>3 && (result.charAt(2)=='区' ||result.charAt(2)=='县')){
name2.remove(2);
String nameHistory = result.substring(0,3);
name2.add(2,nameHistory);
}
List<Map<String, Object>> children = getChildMenus(menu.getOrgId(), menuList,name1,name2,deleteName3);
if (!children.isEmpty()) {
map.put("children", children);
}
childList.add(map);
}
}
return childList;
}
//例:传入abc,a ==>bc 删掉开头的字符串,不是就不删除
public static String removePrefix(String name, String deleteName) {
if (name.startsWith(deleteName)) {
return name.substring(deleteName.length());
} else {
return name;
}
}
/**
* 组织机构名称不进行删减的代码
* */
@Override
public ResponseResult showPubOrgListOld(Map<String, Object> orgId) {
//构建 Redis 缓存键
String redisKey = "showPubOrgListOld_"+orgId;
// 从 Redis 中获取数据
List<Map<String, Object>> cachedData = redisUtils.findCachedData(redisKey);
if (cachedData!=null){
return new ResponseResult(HttpStatus.SUCCESS,"操作成功",cachedData);
}
List<PubOrg> menuList = pubOrgMapper.selectAllOrg();
List<Map<String, Object>> resultList = new ArrayList<>();
for (PubOrg menu : menuList) {
if (menu.getOrgParentId().toString().equals((orgId.get("orgId")))) {
Map<String, Object> map = new HashMap<>();
map.put("id", menu.getOrgId());
map.put("parentId", menu.getOrgParentId());
map.put("orgName", menu.getOrgName());
List<Map<String, Object>> children = getChildMenusOld(menu.getOrgId(), menuList);
if (!children.isEmpty()) {
map.put("children", children);
}
resultList.add(map);
}
}
redisUtils.set(redisKey, resultList);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功",resultList);
}
private List<Map<String, Object>> getChildMenusOld(Long parentId, List<PubOrg> menuList) {
List<Map<String, Object>> childList = new ArrayList<>();
for (PubOrg menu : menuList) {
if (menu.getOrgParentId().toString().equals(parentId.toString())) {
Map<String, Object> map = new HashMap<>();
map.put("id", menu.getOrgId());
map.put("parentId", menu.getOrgParentId());
map.put("orgName", menu.getOrgName());
List<Map<String, Object>> children = getChildMenusOld(menu.getOrgId(), menuList);
if (!children.isEmpty()) {
map.put("children", children);
}
childList.add(map);
}
}
return childList;
}
}
package com.junmp.jyzb.service.impl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.junmp.jyzb.mapper.ShelfMapper;
import com.junmp.jyzb.service.ShelfService;
@Service
public class ShelfServiceImpl implements ShelfService{
@Resource
private ShelfMapper shelfMapper;
}
package com.junmp.jyzb.service.impl; package com.junmp.jyzb.service.impl;
import com.junmp.jyzb.domain.Policeman;
import com.junmp.jyzb.domain.Supplier; import com.junmp.jyzb.domain.Supplier;
import com.junmp.jyzb.domain.Warehouse;
import com.junmp.jyzb.service.SupplierService; import com.junmp.jyzb.service.SupplierService;
import com.junmp.jyzb.utils.DateTimeUtil; import com.junmp.jyzb.utils.*;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import com.junmp.jyzb.mapper.SupplierMapper; import com.junmp.jyzb.mapper.SupplierMapper;
import java.util.Date; import java.util.*;
import java.util.List;
import java.util.Map; import static com.junmp.jyzb.utils.CheckBlank.checkNotBlank;
import java.util.UUID;
@Service @Service
public class SupplierServiceImpl implements SupplierService { public class SupplierServiceImpl implements SupplierService {
...@@ -19,8 +18,24 @@ public class SupplierServiceImpl implements SupplierService { ...@@ -19,8 +18,24 @@ public class SupplierServiceImpl implements SupplierService {
@Resource @Resource
private SupplierMapper supplierMapper; private SupplierMapper supplierMapper;
@Resource
private RedisUtils redisUtils;
private static final String REDIS_SUPPLIER = "Supplier_";
@Override @Override
public void addSupplier(Map<String, Object> msg) { public ResponseResult addSupplier(Map<String, Object> msg) {
try {
checkNotBlank(msg.get("name"), "name不能为空");
//checkNotBlank((String) msg.get("shortName"), "shortName不能为空");
checkNotBlank(msg.get("name"), "name不能为空");
checkNotBlank(msg.get("code"), "code不能为空");
checkNotBlank(msg.get("contacts"), "contacts不能为空");
checkNotBlank(msg.get("phone"), "phone不能为空");
} catch (IllegalArgumentException e) {
return new ResponseResult(HttpStatus.ERROR, ReturnMsg.ERROR,e.getMessage());
}
Supplier supplier =new Supplier(); Supplier supplier =new Supplier();
//将警员相关信息添加到警员表 //将警员相关信息添加到警员表
//生成一个uuid //生成一个uuid
...@@ -29,30 +44,70 @@ public class SupplierServiceImpl implements SupplierService { ...@@ -29,30 +44,70 @@ public class SupplierServiceImpl implements SupplierService {
Date currentDate = DateTimeUtil.getCurrentDateTime(); Date currentDate = DateTimeUtil.getCurrentDateTime();
supplier.setId(uuid); supplier.setId(uuid);
supplier.setCreateTime(currentDate); supplier.setCreateTime(currentDate);
supplier.setUpdateTime(currentDate);
supplier.setName((String) msg.get("name")); supplier.setName((String) msg.get("name"));
supplier.setShortName((String) msg.get("shortName")); supplier.setShortName((String) msg.get("shortName"));
supplier.setCode((String) msg.get("code")); supplier.setCode((String) msg.get("code"));
supplier.setContacts((String) msg.get("contacts")); supplier.setContacts((String) msg.get("contacts"));
supplier.setPhone((String) msg.get("phone")); supplier.setPhone((String) msg.get("phone"));
supplier.setCreateUser((String) msg.get("createUser")); //supplier.setCreateUser((String) msg.get("createUser"));
supplierMapper.addSupplier(supplier); supplierMapper.addSupplier(supplier);
// 将uuid、创建时间、更新时间加入到policeman中
msg.put("id",uuid);
long timestamp = currentDate.getTime(); // 将Date对象转换为long类型的时间戳
//policeman.put("createTime",timestamp);
msg.put("updateTime",timestamp);
/**
* 更新缓存
* */
//构建Redis缓存键
String redisKey = REDIS_SUPPLIER;
// 从 Redis 中获取数据
List<Map<String, Object>> cachedData = redisUtils.findCachedData(redisKey);
if (cachedData != null) {
cachedData.add(0,msg);
//将查询结果存入 Redis 中
redisUtils.set(redisKey, cachedData);
}
return new ResponseResult(HttpStatus.SUCCESS, ReturnMsg.PASS,uuid);
} }
@Override @Override
public Map<String,Object> getOneSupplier(String id) { public Map<String,Object> getOneSupplier(String id,Object name,Object code) {
return supplierMapper.getOneSupplier(id); //读取msg中的检索信息
return supplierMapper.getOneSupplier(id,name,code);
} }
@Override @Override
public void deleteSupplier(Map<String, Object> msg) { public ResponseResult deleteSupplier(Map<String, Object> msg) {
try {
checkNotBlank(msg.get("supplierList"), "supplierList不能为空");
} catch (IllegalArgumentException e) {
return new ResponseResult(HttpStatus.ERROR, ReturnMsg.ERROR,e.getMessage());
}
List<Object> supplierList = (List<Object>) msg.get("supplierList"); List<Object> supplierList = (List<Object>) msg.get("supplierList");
for (Object supplierId:supplierList){ for (Object supplierId:supplierList){
supplierMapper.deleteSupplier(supplierId.toString()); supplierMapper.deleteSupplier(supplierId.toString());
} }
return new ResponseResult(HttpStatus.SUCCESS,"操作成功");
} }
@Override @Override
public void updateSupplier(Map<String, Object> msg) { public ResponseResult updateSupplier(Map<String, Object> msg) {
try {
checkNotBlank(msg.get("id"), "id不能为空");
//checkNotBlank((String) msg.get("shortName"), "shortName不能为空");
checkNotBlank(msg.get("name"), "name不能为空");
checkNotBlank(msg.get("code"), "code不能为空");
checkNotBlank(msg.get("contacts"), "contacts不能为空");
checkNotBlank(msg.get("phone"), "phone不能为空");
} catch (IllegalArgumentException e) {
return new ResponseResult(HttpStatus.ERROR, ReturnMsg.ERROR,e.getMessage());
}
Supplier supplier =new Supplier(); Supplier supplier =new Supplier();
Date currentDate = DateTimeUtil.getCurrentDateTime(); Date currentDate = DateTimeUtil.getCurrentDateTime();
supplier.setUpdateTime(currentDate); supplier.setUpdateTime(currentDate);
...@@ -63,8 +118,9 @@ public class SupplierServiceImpl implements SupplierService { ...@@ -63,8 +118,9 @@ public class SupplierServiceImpl implements SupplierService {
supplier.setCode((String) msg.get("code")); supplier.setCode((String) msg.get("code"));
supplier.setContacts((String) msg.get("contacts")); supplier.setContacts((String) msg.get("contacts"));
supplier.setPhone((String) msg.get("phone")); supplier.setPhone((String) msg.get("phone"));
supplier.setUpdateUser((String) msg.get("updateUser")); //supplier.setUpdateUser((String) msg.get("updateUser"));
supplierMapper.updateSupplier(supplier); supplierMapper.updateSupplier(supplier);
return new ResponseResult(HttpStatus.SUCCESS, ReturnMsg.PASS);
} }
@Override @Override
...@@ -72,4 +128,74 @@ public class SupplierServiceImpl implements SupplierService { ...@@ -72,4 +128,74 @@ public class SupplierServiceImpl implements SupplierService {
List<String> msg = supplierMapper.getAllSupplierId(); List<String> msg = supplierMapper.getAllSupplierId();
return msg; return msg;
} }
@Override
public ResponseResult getAllSupplier(Map<String, Object> msg) {
// Object name = msg.get("name");
// Object code = msg.get("code");
// List<Map<String, Object>> allSupplier=new ArrayList<>();
// // 构建 Redis 缓存键
// String redisKey = REDIS_SUPPLIER;
// // 从 Redis 中获取数据
// List<Map<String, Object>> cachedData = redisUtils.findCachedData(redisKey);
// if (cachedData != null) {
// //将Long类型的数据转化为Date
// for (Map<String,Object> one:cachedData){
// Long dataMsg = (Long) one.get("updateTime");
// one.put("updateTime", redisUtils.getDate(dataMsg));
// allSupplier.add(one);
// }
// return new ResponseResult(HttpStatus.SUCCESS,ReturnMsg.PASS,allSupplier);
// }
//
// List<String> allSupplierId =getAllSupplierId();
// for (String supplierId :allSupplierId){
// Map<String, Object> supplierMsg = getOneSupplier(supplierId,null,null); //入参设置为null,关闭模糊查询
// if (supplierMsg!=null){
// allSupplier.add(supplierMsg);
// }
// }
// //将查询结果存入Redis中, 不设置过期时间 , 默认为永久
// redisUtils.set(redisKey, allSupplier);
// return new ResponseResult(HttpStatus.SUCCESS,"操作成功",allSupplier);
List<Map<String, Object>> allSupplier=new ArrayList<>();
//构建 Redis 缓存键
String redisKey = REDIS_SUPPLIER;
// 从 Redis 中获取数据
List<Map<String, Object>> cachedData = redisUtils.findCachedData(redisKey);
if (cachedData != null) {
//将Long类型的数据转化为Date
for (Map<String,Object> one:cachedData){
Long dataMsg = (Long) one.get("updateTime");
one.put("updateTime", redisUtils.getDate(dataMsg));
allSupplier.add(one);
}
return new ResponseResult(HttpStatus.SUCCESS,ReturnMsg.PASS,allSupplier);
}
//将查询结果存入Redis中, 不设置过期时间 , 默认为永久
allSupplier = supplierMapper.getAllSupplier();
redisUtils.set(redisKey, allSupplier);
return new ResponseResult(HttpStatus.SUCCESS,"操作成功",allSupplier);
}
@Override
public ResponseResult changeSupplierState(Map<String, Object> msg) {
try {
checkNotBlank(msg.get("supplierId"), "supplierId不能为空");
checkNotBlank(msg.get("state"), "state不能为空");
} catch (IllegalArgumentException e) {
return new ResponseResult(HttpStatus.ERROR, ReturnMsg.ERROR,e.getMessage());
}
Supplier supplier =new Supplier();
supplier.setId(msg.get("supplierId").toString());
supplier.setState((Integer) msg.get("state"));
supplierMapper.changeSupplierState(supplier);
return new ResponseResult(HttpStatus.SUCCESS,ReturnMsg.PASS);
}
} }
package com.junmp.jyzb.service.impl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.junmp.jyzb.mapper.SupplierTypeMapper;
import com.junmp.jyzb.service.SupplierTypeService;
@Service
public class SupplierTypeServiceImpl implements SupplierTypeService{
@Resource
private SupplierTypeMapper supplierTypeMapper;
}
package com.junmp.jyzb.service.impl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.junmp.jyzb.mapper.WarehouseAreaMapper;
import com.junmp.jyzb.service.WarehouseAreaService;
@Service
public class WarehouseAreaServiceImpl implements WarehouseAreaService{
@Resource
private WarehouseAreaMapper warehouseAreaMapper;
}
package com.junmp.jyzb.utils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import java.util.List;
/**
* 接口参数校验
* */
public class CheckBlank {
public static <T> void checkNotBlank(T value, String errorMsg) {
// 如果value为null
if (value == null) {
throw new IllegalArgumentException(errorMsg);
}
// 如果value为字符串类型
if (value instanceof String) {
String strValue = (String) value;
if (StringUtils.isBlank(strValue)) {
throw new IllegalArgumentException(errorMsg);
}
}
// 如果value为List类型
if (value instanceof List) {
List<?> listValue = (List<?>) value;
if (listValue.isEmpty()) {
throw new IllegalArgumentException(errorMsg);
}
}
}
}
...@@ -3,7 +3,7 @@ package com.junmp.jyzb.utils; ...@@ -3,7 +3,7 @@ package com.junmp.jyzb.utils;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.*;
public class DateTimeUtil { public class DateTimeUtil {
private static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
...@@ -18,4 +18,16 @@ public class DateTimeUtil { ...@@ -18,4 +18,16 @@ public class DateTimeUtil {
return null; return null;
} }
} }
public static List<Map<String,Object>> timeSort(List<Map<String,Object>> allPoliceman) {
Collections.sort(allPoliceman, new Comparator<Map<String, Object>>() {
@Override
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
Date updateTime1 = (Date) o1.get("updateTime");
Date updateTime2 = (Date) o2.get("updateTime");
return updateTime2.compareTo(updateTime1);
}
});
return allPoliceman;
}
} }
\ No newline at end of file
...@@ -15,6 +15,11 @@ public class HttpStatus ...@@ -15,6 +15,11 @@ public class HttpStatus
public static final int SUCCESS = 99200; public static final int SUCCESS = 99200;
/** /**
* 操作失败
*/
public static final int ERROR = 99500;
/**
* 没有操作权限 * 没有操作权限
*/ */
public static final int NO_PERMISSION = 10001; public static final int NO_PERMISSION = 10001;
......
package com.junmp.jyzb.utils;
import com.junmp.jyzb.domain.Policeman;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
public class ObjectToMap {
public static Map<String, Object> toMap(Object obj) {
Map<String, Object> map = new HashMap<>();
Class<?> cls = obj.getClass();
// 获取对象的所有属性
Field[] fields = cls.getDeclaredFields();
for (Field field : fields) {
try {
// 设置字段可访问,以便获取其值
field.setAccessible(true);
// 将字段名和字段值添加到Map中
map.put(field.getName(), field.get(obj));
} catch (IllegalAccessException e) {
// 处理异常
e.printStackTrace();
}
}
return map;
}
}
package com.junmp.jyzb.utils;
import org.omg.CORBA.OBJ_ADAPTER;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
@Service
public class RedisUtils {
private static final long REDIS_EXPIRE_TIME = 60*60*2; // 缓存过期时间(单位:秒)默认为两个小时
@Autowired
private RedisTemplate<String, Object> redisTemplate;
/**
* 从 Redis 中获取指定键的缓存数据
*/
public <T> T get(String key) {
return (T) redisTemplate.opsForValue().get(key);
}
/**
* 向 Redis 中设置指定键和值的缓存数据,并设置过期时间
*/
public void set(String key, Object value) {
if (value != null && !Objects.isNull(value)) {
// 将查询结果存入 Redis 中
redisTemplate.opsForValue().set(key, value);
//redisUtils.set(redisKey, allPoliceman);
}
}
// 从缓存中获取Date类型的数据
public Date getDate(Long msg) {
Date date = new Date(msg);
return date;
// Long timestamp = (Long) redisTemplate.opsForValue().get(key);
// return timestamp != null ? new Date(timestamp) : null;
}
/**
* 重载set方法,可以传入自定义的 缓存过期时间
*/
public void set(String key, Object value,Long time) {
if (value != null && !Objects.isNull(value)) {
// 将查询结果存入 Redis 中
redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
}
}
/**
* 查找是否有缓存数据
*/
public <T> T findCachedData(String redisKey){
// 从 Redis 中获取数据
Object cachedData = get(redisKey);
if (cachedData != null) {
// 如果缓存命中,则直接返回缓存数据
return (T) cachedData;
}else {
return null;
}
}
/**
* 删除 Redis 中指定键的缓存数据
*/
public void delete(String key) {
redisTemplate.delete(key);
}
}
\ No newline at end of file
package com.junmp.jyzb.utils;
/**
* 返回数据
*
* @author ruoyi
*/
public class ReturnData {
/**
* 没有查询到相关数据
*/
public static final String NO_DATA = "没有查询到相关数据";
}
package com.junmp.jyzb.utils;
/**
* 返回信息
*
* @author ruoyi
*/
public class ReturnMsg {
/**
* 操作成功
*/
public static final String PASS = "操作成功";
/**
* 操作失败
*/
public static final String ERROR = "操作失败";
/**
* 未查询到相关数据
*/
public static final String NO_DATA = "未查询到相关数据";
/**
* 请求数据不合法
*/
public static final String DATA_ILLEGAL = "请求数据不合法";
}
...@@ -16,4 +16,22 @@ ...@@ -16,4 +16,22 @@
<!--@mbg.generated--> <!--@mbg.generated-->
id, cabinet_id, police_id, police_name, error_state, error_msg, log_map id, cabinet_id, police_id, police_name, error_state, error_msg, log_map
</sql> </sql>
<select id="getBoxMsg" resultType="java.util.Map">
SELECT f.id as cabinetBoxId,num,state,error_msg as errorMsg
FROM base_cabinet_box f
WHERE f.cabinet_id = #{id};
</select>
<update id="changeCabinetState">
update base_cabinet_box f
set state = #{state},error_msg=#{errorMsg}
where f.id =#{id}
</update>
<select id="getOneCabinetBox" resultType="String">
select id
from base_cabinet_box b
where b.id =#{cabinetBoxId}
</select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.junmp.jyzb.mapper.CabinetMapper"> <mapper namespace="com.junmp.jyzb.mapper.CabinetMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.domain.Cabinet">
<!--@mbg.generated-->
<!--@Table base_cabinet-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="cabinet_num" jdbcType="VARCHAR" property="cabinetNum" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="org_id" jdbcType="VARCHAR" property="orgId" />
<result column="location" jdbcType="VARCHAR" property="location" />
<result column="error_state" jdbcType="INTEGER" property="errorState" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="create_user" jdbcType="TIMESTAMP" property="createUser" />
<result column="update_user" jdbcType="VARCHAR" property="updateUser" />
</resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
id, cabinet_num, `name`, org_id, `location`, error_state, create_time, update_time, id, cabinet_num, `name`, org_id, `location`, error_state, create_time, update_time,
...@@ -23,14 +10,23 @@ ...@@ -23,14 +10,23 @@
<insert id="addCabinet" parameterType="com.junmp.jyzb.domain.Warehouse"> <insert id="addCabinet" parameterType="com.junmp.jyzb.domain.Warehouse">
insert into base_cabinet insert into base_cabinet
(id,cabinet_num,name,org_id,location,error_state,create_time,update_user,delete_flag) (id,cabinet_num,name,org_id,location,state,num,create_time,update_time)
values values
(#{id},#{cabinetNum},#{name},#{orgId},#{location},#{errorState},#{createTime},#{updateUser},0) (#{id},#{cabinetNum},#{name},#{orgId},#{location},1,#{num},#{createTime},#{updateTime})
</insert> </insert>
<select id="getOneCabinet" resultType="Map"> <select id="getOneCabinet" resultType="Map">
select id,cabinet_num,name,org_id,location,error_state from base_cabinet p select
where p.id=#{id} and delete_flag=0 c.id,
c.cabinet_num as cabinetNum,
c.name,
o.org_id as orgId,
o.org_name as orgName,
c.location,
c.state,
c.update_time as updateTime
from base_cabinet c,pub_org o
where c.id=#{id} and c.org_id_int =o.org_id
</select> </select>
<delete id="deleteCabinet"> <delete id="deleteCabinet">
...@@ -38,25 +34,57 @@ ...@@ -38,25 +34,57 @@
where w.id =#{id} where w.id =#{id}
</delete> </delete>
<update id="updateCabinet"> <update id="updateCabinet">
update base_cabinet p update base_cabinet p
set cabinet_num = #{cabinetNum},name=#{name},org_id=#{orgId},location=#{location},error_state=#{errorState},update_time=#{updateTime},update_user=#{updateUser} set cabinet_num = #{cabinetNum},name=#{name},location=#{location},update_time=#{updateTime},org_id_int=#{orgId}
where p.id =#{id} and delete_flag=0 where p.id =#{id}
</update> </update>
<select id="getAllCabinet" resultType="Map"> <select id="getAllCabinet" resultType="Map">
select p.id,p.name as police_name,cabinet_id,org_id,police_code,sex,face_info,photo ,f.name as finger_name,finger_info select
from base_policeman p,base_police_finger f c.id,
where p.id=f.police_id c.cabinet_num as cabinetNum,
and p.org_id=#{orgId} c.name,
and delete_flag=0 o.org_id as orgId,
o.org_name as orgName,
c.location,
c.state,
c.update_time as updateTime
from pub_org o
right join base_cabinet c on c.org_id_int =o.org_id
</select> </select>
<select id="getAllCabinetId" resultType="String"> <select id="getAllCabinetId" resultType="String">
select id select id
from base_cabinet w from base_cabinet w
where org_id=#{orgId} and delete_flag=0; where org_id=#{orgId};
</select>
<update id="changeCabinetState">
update base_cabinet c
set state = #{state}
where c.id =#{id}
</update>
<select id="getAllCabinetBoxId" resultType="String">
select id
from base_cabinet_box b
where cabinet_id=#{id}
</select>
<select id="getCabinetByCabinetNum" resultType="Map">
select id
from base_cabinet w
where cabinet_num=#{cabinetNum};
</select>
<select id="getAllCabinetIdByHighest" resultType="String">
select id
from base_cabinet w
</select>
<select id="getCabinetNumById" resultType="java.lang.String">
select cabinet_num from base_cabinet where id =#{id}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
<insert id="addSize" parameterType="com.junmp.jyzb.domain.EquipmentSize"> <insert id="addSize" parameterType="com.junmp.jyzb.domain.EquipmentSize">
insert into base_equipment_size insert into base_equipment_size
(id,type_id as typeId,code,name,create_time as createTime,note,price,state,epcType) (id,type_id,code,name,create_time,update_time,note,price,state,epc_type)
values values
(#{id},#{typeId},#{code},#{name},#{createTime},#{note},#{price},#{state},#{epcType}) (#{id},#{typeId},#{code},#{name},#{createTime},#{updateTime},#{note},#{price},#{state},#{epcType})
</insert> </insert>
<select id="getOneSize" resultType="Map"> <select id="getOneSize" resultType="Map">
...@@ -48,4 +48,20 @@ ...@@ -48,4 +48,20 @@
from base_equipment_size w from base_equipment_size w
where type_id=#{typeId} where type_id=#{typeId}
</select> </select>
<update id="changeSizeState">
update base_equipment_size w
set state = #{state}
where w.id =#{id}
</update>
<select id="getSizeByCode" resultType="String">
select code
from base_equipment_size s
where code=#{code}
</select>
<!-- <select id="getCodeById" resultType="java.lang.String">-->
<!-- select from where id =#{id}-->
<!-- </select>-->
</mapper> </mapper>
\ No newline at end of file
...@@ -18,10 +18,26 @@ ...@@ -18,10 +18,26 @@
id, `name`, code, parent_id, create_time, update_time, `state`, note id, `name`, code, parent_id, create_time, update_time, `state`, note
</sql> </sql>
<select id="selectAllEquipment" resultMap="BaseResultMap"> <select id="selectAllEquipment" resultType="com.junmp.jyzb.domain.EquipmentType">
SELECT id,name,unit,unit_type,code,parent_id,state,note,code SELECT id,name,unit,unit_type,code,parent_id,state,note,code,create_time,update_time
FROM base_equipment_type FROM base_equipment_type
</select> </select>
<!-- <where>-->
<!-- <if test="SelectTypeId != null">-->
<!-- AND id LIKE CONCAT(#{SelectTypeId})-->
<!-- </if>-->
<!-- <if test="SelectState != null">-->
<!-- AND state LIKE CONCAT(#{SelectState})-->
<!-- </if>-->
<!-- </where>-->
<!-- <if test="SelectTypeId != null and SelectTypeId != ''">-->
<!-- AND id LIKE CONCAT(#{SelectTypeId})-->
<!-- </if>-->
<!-- <if test="SelectState != null and SelectState != ''">-->
<!-- AND state LIKE CONCAT(#{SelectState})-->
<!-- </if>-->
<!--SELECT id,name,unit,unit_type,code,parent_id,state,note,--> <!--SELECT id,name,unit,unit_type,code,parent_id,state,note,-->
<!-- CASE--> <!-- CASE-->
...@@ -31,10 +47,96 @@ ...@@ -31,10 +47,96 @@
<!-- FROM base_equipment_type--> <!-- FROM base_equipment_type-->
<insert id="addEquipment" parameterType="com.junmp.jyzb.domain.EquipmentType"> <insert id="addEquipment" parameterType="com.junmp.jyzb.domain.EquipmentType">
insert into base_warehouse insert into base_equipment_type
(id,name,unit,unit_type,code,parent_id,create_time,state,note) (id,name,unit_type,code,parent_id,create_time,update_time,state,note)
values values
(#{id},#{name},#{unit},#{unitType},#{code},#{parentId},#{createTime},1,#{note}) (#{id},#{name},#{unitType},#{id},#{parentId},#{createTime},#{updateTime},1,#{note})
</insert> </insert>
<update id="changeEquipmentState">
update base_equipment_type w
set w.state = #{state}
where w.id = #{id}
</update>
<!--<update id="changeEquipmentState">-->
<!-- update base_equipment_type w,base_supplier_id i-->
<!-- set w.state = #{state},i.state = #{state}-->
<!-- where w.id =#{id} and i.type_id = #{id}-->
<!-- </update>-->
<delete id="deleteEquipment">
delete from base_equipment_type w
where id =#{id}
</delete>
<update id="updateEquipment">
update base_equipment_type p
set name = #{name},unit_type=#{unitType},code=#{id},update_time=#{updateTime},parent_id=#{parentId},note=#{note}
where p.id =#{id}
</update>
<select id="getAllEquipmentId" resultType="String">
select id
from base_equipment_type w
</select>
<select id="getAll" resultType="Map">
select id,parent_id as parentId from base_equipment_type
</select>
<insert id="addData" parameterType="java.util.List">
INSERT INTO base_equipment_id (id, parent_id)
VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.id}, #{item.parentId})
</foreach>
</insert>
<select id="getIdByParentId" resultType="String">
select id
from base_equipment_id i
where parent_id = #{parentId}
</select>
<insert id="addSupplier" parameterType="com.junmp.jyzb.domain.EquipmentType">
INSERT INTO base_supplier_type (id,supplier_id,type_id,state,create_time,update_time)
VALUES
<foreach collection="supplierList" item="supplier" separator=",">
(#{uuid}, #{supplier},#{equipmentType.id},1,#{equipmentType.createTime},#{equipmentType.updateTime})
</foreach>
</insert>
<update id="setCalculationId">
update base_equipment_id i
set id = #{numStr}
where i.parent_id =#{parentId}
</update>
<select id="getOneEquipmentId" resultType="String">
select id
from base_equipment_type t
where t.id =#{numStr}
</select>
<delete id="deleteSupplier">
delete from base_supplier_type w
where type_id =#{id}
</delete>
<select id="getOneEquipment" resultType="Map">
select id,parent_id as parentId,name,unit_type as unitType,code,create_time as createTime,update_time as updateTime,state from base_equipment_type
</select>
<select id="getSupplierByTypeId" resultType="java.util.Map">
SELECT s.name
FROM base_supplier_type t
left join base_supplier s on t.supplier_id = s.id
WHERE type_id = #{id}
</select>
<select id="getLowestTypeId" resultType="String">
select id
from base_equipment_type w
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -16,7 +16,9 @@ ...@@ -16,7 +16,9 @@
<insert id="addFingers"> <insert id="addFingers">
insert into base_police_finger insert into base_police_finger
(police_id,name,finger_info,create_time) VALUES (#{policeId},#{name},#{fingerInfo},#{createTime}) (police_id,name,finger_info,create_time,update_time)
VALUES
(#{policeId},#{name},#{fingerInfo},#{createTime},update_time)
</insert> </insert>
<update id="updateFingers"> <update id="updateFingers">
......
...@@ -2,40 +2,39 @@ ...@@ -2,40 +2,39 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.junmp.jyzb.mapper.PolicemanMapper"> <mapper namespace="com.junmp.jyzb.mapper.PolicemanMapper">
<resultMap id="PolicemanMap" type="com.junmp.jyzb.domain.Policeman"> <!--<resultMap id="PolicemanMap" type="Map">-->
<result column="id" property="id"/> <!-- <id property="id" column="id"/>-->
<result column="name" property="name"/> <!-- <result property="orgId" column="orgId"/>-->
<result column="cabinet_id" property="cabinetId"/> <!-- <result property="orgName" column="orgName"/>-->
<result column="org_id" property="orgId"/> <!-- <result property="name" column="name"/>-->
<result column="police_code" property="policeCode"/> <!-- <result property="sex" column="sex"/>-->
<result column="sex" property="sex"/> <!-- <result property="phone" column="phone"/>-->
<result column="face_info" property="faceInfo"/> <!-- <result property="photo" column="photo"/>-->
<result column="isCreatedAccount" property="isCreatedAccount"/> <!-- <result property="policeCode" column="policeCode"/>-->
<result column="door_code" property="doorCode"/> <!-- <result property="cabinetId" column="cabinetId"/>-->
<result column="password" property="password"/> <!-- <result property="cabinetName" column="cabinetName"/>-->
<result column="photo" property="photo"/> <!-- <result property="updateTime" column="updateTime"/>-->
<result column="phone" property="phone"/> <!-- <collection property="fingerMsg" ofType="java.util.Map">-->
<result column="create_time" property="createTime"/> <!-- <id property="fingerId" column="fingerId"/>-->
<result column="update_time" property="updateTime"/> <!-- <result property="fingerName" column="fingerName"/>-->
<result column="id_card" property="idCard"/> <!-- <result property="fingerInfo" column="fingerInfo"/>-->
<result column="update_user" property="updateUser"/> <!-- </collection>-->
<result column="state" property="state"/> <!--</resultMap>-->
</resultMap>
<insert id="addPoliceman" parameterType="com.junmp.jyzb.domain.Policeman"> <insert id="addPoliceman" parameterType="com.junmp.jyzb.domain.Policeman">
insert into base_policeman insert into base_policeman
(id,org_id,name,police_code,sex,isCreatedAccount, (id,org_id_int,name,police_code,sex,
cabinet_id,phone,id_card,photo,update_user,create_time) cabinet_box_id,phone,id_card,photo,create_time,update_time)
values values
(#{id},#{orgId},#{name},#{policeCode},#{sex},#{isCreatedAccount}, (#{id},#{orgId},#{name},#{policeCode},#{sex},
#{cabinetId},#{phone},#{idCard},#{photo},#{updateUser},#{createTime}) #{cabinetBoxId},#{phone},#{idCard},#{photo},#{createTime},#{updateTime})
</insert> </insert>
<select id="getOnePolice" resultType="Map"> <select id="getOnePolice" resultType="Map">
SELECT SELECT
p.id AS id, p.id AS id,
o.org_id AS orgId, o.org_id AS orgId,
o.area_name AS orgName, o.org_name AS orgName,
p.name AS name, p.name AS name,
p.sex, p.sex,
p.phone, p.phone,
...@@ -46,10 +45,51 @@ ...@@ -46,10 +45,51 @@
p.update_time AS updateTime p.update_time AS updateTime
FROM base_policeman p FROM base_policeman p
LEFT JOIN pub_org o ON p.org_id = o.org_id LEFT JOIN pub_org o ON p.org_id = o.org_id
LEFT JOIN base_cabinet c ON p.cabinet_id = c.id LEFT JOIN base_cabinet c ON p.cabinet_box_id = c.id
WHERE p.id = #{id}; WHERE p.id = #{id};
</select> </select>
<select id="getAllPolice" resultType="Map">
SELECT
p.id AS id,
o.org_id AS orgId,
o.org_name AS orgName,
p.name AS name,
p.sex,
p.phone,
p.photo,
p.police_code AS policeCode,
c.id AS cabinetId,
c.name AS cabinetName,
p.update_time AS updateTime
<!-- GROUP_CONCAT(JSON_OBJECT('fingerId', f.id, 'fingerName', f.name,'fingerInfo', f.finger_info)) AS fingerMsg-->
<!-- GROUP_CONCAT(JSON_OBJECT('fingerId', f.id, 'fingerName', f.name,'fingerInfo', f.finger_info)) AS fingerMsg-->
FROM pub_org o
right JOIN base_policeman p ON p.org_id = o.org_id
right JOIN base_cabinet c ON p.cabinet_box_id = c.id
<!-- LEFT JOIN base_police_finger f ON f.police_id = p.id-->
<!-- GROUP BY p.id, o.org_id, o.org_name, p.name, p.sex, p.phone, p.photo, p.police_code, c.id, c.name, p.update_time-->
</select>
<!--<select id="getAllPolice" resultType="java.util.Map">-->
<!-- SELECT-->
<!-- p.id AS id,-->
<!-- o.org_id AS orgId,-->
<!-- o.org_name AS orgName,-->
<!-- p.name AS name,-->
<!-- p.sex,-->
<!-- p.phone,-->
<!-- p.photo,-->
<!-- p.police_code AS policeCode,-->
<!-- c.id AS cabinetId,-->
<!-- c.name AS cabinetName,-->
<!-- p.update_time AS updateTime,-->
<!-- FROM base_policeman p-->
<!-- LEFT JOIN pub_org o ON p.org_id = o.org_id-->
<!-- LEFT JOIN base_cabinet c ON p.cabinet_box_id = c.id-->
<!--</select>-->
<delete id="deletePolice"> <delete id="deletePolice">
DELETE FROM base_policeman p WHERE p.id =#{id}; DELETE FROM base_policeman p WHERE p.id =#{id};
</delete> </delete>
...@@ -62,7 +102,7 @@ ...@@ -62,7 +102,7 @@
police_code=#{policeCode}, police_code=#{policeCode},
sex=#{sex}, sex=#{sex},
isCreatedAccount=#{isCreatedAccount}, isCreatedAccount=#{isCreatedAccount},
cabinet_id=#{cabinetId}, cabinet_box_id=#{cabinetBoxId},
phone=#{phone}, phone=#{phone},
id_card=#{idCard}, id_card=#{idCard},
update_user=#{updateUser}, update_user=#{updateUser},
...@@ -71,18 +111,23 @@ ...@@ -71,18 +111,23 @@
where p.id =#{id} where p.id =#{id}
</update> </update>
<select id="getAllPoliceman" resultType="Map"> <!-- <select id="getAllPoliceman" resultType="Map">-->
select p.id,p.name as police_name,cabinet_id,org_id,police_code,sex,face_info,photo ,f.name as finger_name,finger_info <!-- select p.id,p.name as police_name,cabinet_id,org_id,police_code,sex,face_info,photo ,f.name as finger_name,finger_info-->
from base_policeman p,base_police_finger f <!-- from base_policeman p,base_police_finger f-->
where p.id=f.police_id <!-- where p.id=f.police_id-->
and p.org_id=#{orgId} <!-- and p.org_id=#{orgId}-->
and delete_flag=0 <!-- and delete_flag=0-->
</select> <!-- </select>-->
<select id="getAllPoliceId" resultType="String"> <select id="getAllPoliceId" resultType="String">
select id select id
from base_policeman p from base_policeman p
where org_id=#{orgId} where org_id_int=#{orgId}
</select>
<select id="getAllPoliceIdByHighest" resultType="String">
select id
from base_policeman p
</select> </select>
<delete id="deleteFinger"> <delete id="deleteFinger">
...@@ -90,10 +135,10 @@ ...@@ -90,10 +135,10 @@
where id =#{fingerId} where id =#{fingerId}
</delete> </delete>
<select id="getAllPoliceIdByCabinet" resultType="String"> <select id="getAllPoliceIdByBoxId" resultType="String">
select id select id
from base_policeman p from base_policeman p
where cabinet_id=#{cabinetId} and delete_flag=0; where cabinet_box_id=#{boxId}
</select> </select>
<update id="addFaceInfo" parameterType="com.junmp.jyzb.domain.Policeman"> <update id="addFaceInfo" parameterType="com.junmp.jyzb.domain.Policeman">
...@@ -107,4 +152,22 @@ ...@@ -107,4 +152,22 @@
set state = #{state} set state = #{state}
where p.id =#{id} where p.id =#{id}
</update> </update>
<select id="getChildren" resultType="String">
select org_id from pub_org where org_parent_id = #{id}
</select>
<select id="getAllBoxIdByCabinet" resultType="String">
select id
from base_cabinet_box b
where cabinet_id=#{cabinetId}
</select>
<select id="getPoliceByPoliceCode" resultType="java.lang.String">
select police_code from base_policeman where police_code =#{policeCode}
</select>
<select id="getPoliceCodeById" resultType="java.lang.String">
select police_code from base_policeman where id =#{id}
</select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.junmp.jyzb.mapper.PubOrgMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.domain.PubOrg">
<!--@mbg.generated-->
<!--@Table pub_org-->
<id column="org_id" jdbcType="BIGINT" property="orgId" />
<result column="org_parent_id" jdbcType="BIGINT" property="orgParentId" />
<result column="org_parent_ids" jdbcType="VARCHAR" property="orgParentIds" />
<result column="org_code" jdbcType="VARCHAR" property="orgCode" />
<result column="org_name" jdbcType="VARCHAR" property="orgName" />
<result column="org_type" jdbcType="SMALLINT" property="orgType" />
<result column="sort_val" jdbcType="TINYINT" property="sortVal" />
<result column="status_flag" jdbcType="TINYINT" property="statusFlag" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="del_flag" jdbcType="SMALLINT" property="delFlag" />
<result column="org_full_name" jdbcType="VARCHAR" property="orgFullName" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="contact" jdbcType="VARCHAR" property="contact" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_user" jdbcType="BIGINT" property="createUser" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="update_user" jdbcType="BIGINT" property="updateUser" />
<result column="guid" jdbcType="VARCHAR" property="guid" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
org_id, org_parent_id, org_parent_ids, org_code, org_name, org_type, sort_val, status_flag,
remark, del_flag, org_full_name, address, contact, phone, create_time, create_user,
update_time, update_user, guid
</sql>
<select id="selectAllOrg" resultType="com.junmp.jyzb.domain.PubOrg">
SELECT org_id,org_parent_id,org_name
FROM pub_org
</select>
<select id="getOnePubOrg" resultType="Long">
select org_id
from pub_org t
where t.org_id =#{orgId}
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.junmp.jyzb.mapper.ShelfMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.domain.Shelf">
<!--@mbg.generated-->
<!--@Table base_shelf-->
<id column="shelf_id" jdbcType="VARCHAR" property="shelfId" />
<result column="shelf_name" jdbcType="VARCHAR" property="shelfName" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="warehouseId" jdbcType="VARCHAR" property="warehouseId" />
<result column="shelf_rows" jdbcType="INTEGER" property="shelfRows" />
<result column="shelf_columns" jdbcType="INTEGER" property="shelfColumns" />
<result column="shelf_ranges" jdbcType="INTEGER" property="shelfRanges" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="size_info" jdbcType="VARCHAR" property="sizeInfo" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="update_user" jdbcType="VARCHAR" property="updateUser" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
shelf_id, shelf_name, code, `type`, warehouseId, shelf_rows, shelf_columns, shelf_ranges,
url, size_info, create_time, update_time, create_user, update_user
</sql>
<insert id="addShelf" parameterType="com.junmp.jyzb.domain.Shelf">
insert into base_shelf
(shelf_id,shelf_name,code,type,warehouse_id,shelf_rows,shelf_columns,shelf_ranges,url,size_info,create_time,update_time)
values
(#{shelfId},#{shelfName},#{code},#{type},#{warehouseId},#{shelfRows},#{shelfColumns},#{shelfRanges},#{url},#{sizeInfo},#{createTime},#{updateTime})
</insert>
<delete id="deleteShelf">
delete from base_shelf s
where shelf_id =#{shelfId}
</delete>
<update id="updateShelf">
update base_shelf s
set shelf_id = #{shelfId},
code=#{code},
type=#{type},
warehouse_id=#{warehouseId},
shelf_rows=#{shelfRows},
shelf_columns=#{shelfColumns},
shelf_ranges=#{shelfRanges},
url=#{url},
size_info=#{sizeInfo},
update_time=#{updateTime}
where shelf_id =#{shelfId}
</update>
<select id="getShelfList" resultType="Map">
select
shelf_id as shelfId,
shelf_name as shelfName,
code,
type,
shelf_rows as shelfRows,
shelf_columns as shelfColumns,
shelf_id as shelfRanges,
url,
size_info as sizeInfo
from base_shelf s
where s.warehouse_id = #{warehouseId}
</select>
</mapper>
\ No newline at end of file
...@@ -23,20 +23,37 @@ ...@@ -23,20 +23,37 @@
<insert id="addSupplier" parameterType="com.junmp.jyzb.domain.Supplier"> <insert id="addSupplier" parameterType="com.junmp.jyzb.domain.Supplier">
insert into base_supplier insert into base_supplier
(id,name,code,short_name,contacts,phone,create_time,create_user) (id,name,code,short_name,contacts,phone,create_time,update_time,create_user,state)
values values
(#{id},#{name},#{code},#{shortName},#{contacts},#{phone},#{createTime},#{createUser}) (#{id},#{name},#{code},#{shortName},#{contacts},#{phone},#{createTime},#{updateTime},#{createUser},1)
</insert> </insert>
<!-- <select id="getOneSupplier" resultType="Map">-->
<!-- SELECT id, name, code, short_name AS shortName, contacts, phone, update_user,-->
<!-- CASE-->
<!-- WHEN update_time IS NULL THEN create_time-->
<!-- ELSE update_time-->
<!-- END AS updateTime-->
<!-- FROM base_supplier-->
<!-- WHERE id = #{id}-->
<!-- </select>-->
<!--CASE-->
<!-- WHEN update_time IS NULL THEN create_time-->
<!-- ELSE update_time-->
<!-- END AS updateTime-->
<select id="getOneSupplier" resultType="Map"> <select id="getOneSupplier" resultType="Map">
SELECT id, name, code, short_name AS shortName, contacts, phone, update_user, SELECT id, name, code, short_name AS shortName, contacts, phone, update_user,state
CASE FROM base_supplier
WHEN update_time IS NULL THEN create_time WHERE id = #{id}
ELSE update_time <if test="SelectName != null and SelectName != ''">
END AS updateTime AND name LIKE CONCAT('%', #{SelectName}, '%')
FROM base_supplier </if>
WHERE id = #{id}; <if test="SelectCode != null and SelectCode != ''">
</select> AND code LIKE CONCAT('%', #{SelectCode}, '%')
</if>
</select>
<update id="deleteSupplier"> <update id="deleteSupplier">
update base_supplier w update base_supplier w
...@@ -55,4 +72,15 @@ ...@@ -55,4 +72,15 @@
select id select id
from base_supplier w from base_supplier w
</select> </select>
<update id="changeSupplierState">
update base_supplier p
set state = #{state}
where p.id =#{id}
</update>
<select id="getAllSupplier" resultType="Map">
SELECT id, name, code, short_name AS shortName, contacts, phone, update_time as updateTime,state
FROM base_supplier
</select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.junmp.jyzb.mapper.SupplierTypeMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.domain.SupplierType">
<!--@mbg.generated-->
<!--@Table base_supplier_type-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="supplier_id" jdbcType="VARCHAR" property="supplierId" />
<result column="type_id" jdbcType="VARCHAR" property="typeId" />
<result column="state" jdbcType="INTEGER" property="state" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="update_user" jdbcType="VARCHAR" property="updateUser" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, supplier_id, type_id, `state`, create_time, update_time, update_user
</sql>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.junmp.jyzb.mapper.WarehouseAreaMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.domain.WarehouseArea">
<!--@mbg.generated-->
<!--@Table base_warehouse_area-->
<id column="area_id" jdbcType="BIGINT" property="areaId" />
<result column="area_name" jdbcType="VARCHAR" property="areaName" />
<result column="org_id_int" jdbcType="BIGINT" property="orgIdInt" />
<result column="warehouse_id" jdbcType="VARCHAR" property="warehouseId" />
<result column="photo" jdbcType="VARCHAR" property="photo" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="update_user" jdbcType="VARCHAR" property="updateUser" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
area_id, area_name, org_id_int, warehouse_id, photo, create_time, update_time, create_user,
update_user
</sql>
<insert id="addArea" parameterType="com.junmp.jyzb.domain.WarehouseArea">
insert into base_warehouse_area
(area_id,area_name,photo,create_time,update_time)
values
(#{areaId},#{areaName},#{photo},#{createTime},#{updateTime})
</insert>
<delete id="deleteArea">
delete from base_warehouse_area a
where area_id =#{areaId}
</delete>
<update id="updateArea">
update base_warehouse_area a
set area_name = #{areaName},warehouse_id = #{warehouseId},photo=#{photo},update_time=#{updateTime}
where a.area_id =#{areaId}
</update>
<select id="getAreaList" resultType="Map">
select
area_id as areaId,
area_name as areaName,
photo as photo
from base_warehouse_area s
where s.warehouse_id = #{warehouseId}
</select>
</mapper>
\ No newline at end of file
...@@ -21,15 +21,26 @@ ...@@ -21,15 +21,26 @@
<insert id="addWarehouse" parameterType="com.junmp.jyzb.domain.Warehouse"> <insert id="addWarehouse" parameterType="com.junmp.jyzb.domain.Warehouse">
insert into base_warehouse insert into base_warehouse
(id,name,location,phone,create_time,update_user,org_id,videp,state) (id,name,location,phone,create_time,update_time,update_user,org_id_int,video,state)
values values
(#{id},#{name},#{location},#{phone},#{createTime},#{updateUser},#{orgId},#{video},1) (#{id},#{name},#{location},#{phone},#{createTime},#{updateTime},#{updateUser},#{orgId},#{video},1)
</insert> </insert>
<select id="getOneWarehouse" resultType="Map"> <select id="getOneWarehouse" resultType="Map">
select w.id as warehouseId,o.name as orgName,w.name as name,w.state,location,phone,update_time as updateTime select
from base_warehouse w,base_organization o w.id as warehouseId,
where w.org_id=o.id and p.id=#{id} o.org_name as orgName,
w.name as name,
w.state,
location,
w.phone,
is_locked as isLocked,
sum,
in_sum as inSum,
out_sum as outSum,
w.update_time as updateTime
from base_warehouse w LEFT JOIN pub_org o on w.org_id=o.org_id
where w.id=#{id}
</select> </select>
<update id="changeWarehouseState"> <update id="changeWarehouseState">
...@@ -52,6 +63,27 @@ ...@@ -52,6 +63,27 @@
<select id="getAllWarehouseId" resultType="String"> <select id="getAllWarehouseId" resultType="String">
select id select id
from base_warehouse w from base_warehouse w
where org_id=#{orgId} where org_id_int=#{orgId}
</select>
<select id="getAllWarehouseIdByHighest" resultType="String">
select id
from base_warehouse w
</select>
<select id="getAllWarehouse" resultType="Map">
select
w.id as warehouseId,
o.org_name as orgName,
w.name as name,
w.state,
location,
w.phone,
is_locked as isLocked,
sum,
in_sum as inSum,
out_sum as outSum,
w.update_time as updateTime
from base_warehouse w LEFT JOIN pub_org o on w.org_id=o.org_id
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论